From 458821452642fd5dc2377b73cd1323fd4a9653e7 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 4 Oct 2006 13:21:45 +0900 Subject: sh: First step at generic timeofday support. At the moment we wrap GENERIC_TIME around our existing timer API. As boards start providing their own clocksources, they're able to select GENERIC_TIME accordingly and optimize out most of the timer API. Once the current timers have been reworked as proper clocksource drivers, the rest of the place holders for the timer API can go away and we can flip on GENERIC_TIME unconditionally. Signed-off-by: Paul Mundt --- include/asm-sh/timer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/asm-sh/timer.h b/include/asm-sh/timer.h index c7ab28095ba..ebc78db1a9e 100644 --- a/include/asm-sh/timer.h +++ b/include/asm-sh/timer.h @@ -8,7 +8,9 @@ struct sys_timer_ops { int (*init)(void); int (*start)(void); int (*stop)(void); +#ifndef CONFIG_GENERIC_TIME unsigned long (*get_offset)(void); +#endif unsigned long (*get_frequency)(void); }; @@ -24,10 +26,12 @@ struct sys_timer { extern struct sys_timer tmu_timer; extern struct sys_timer *sys_timer; +#ifndef CONFIG_GENERIC_TIME static inline unsigned long get_timer_offset(void) { return sys_timer->ops->get_offset(); } +#endif static inline unsigned long get_timer_frequency(void) { -- cgit v1.2.3 From a700f3594d63a85af196ac64984f7375d903afad Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 4 Oct 2006 13:27:32 +0900 Subject: sh: Kill off timer_ops get_frequency(). We're not using this anywhere these days, kill it off. Signed-off-by: Paul Mundt --- include/asm-sh/timer.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/asm-sh/timer.h b/include/asm-sh/timer.h index ebc78db1a9e..341cb71c2f9 100644 --- a/include/asm-sh/timer.h +++ b/include/asm-sh/timer.h @@ -11,7 +11,6 @@ struct sys_timer_ops { #ifndef CONFIG_GENERIC_TIME unsigned long (*get_offset)(void); #endif - unsigned long (*get_frequency)(void); }; struct sys_timer { @@ -33,11 +32,6 @@ static inline unsigned long get_timer_offset(void) } #endif -static inline unsigned long get_timer_frequency(void) -{ - return sys_timer->ops->get_frequency(); -} - /* arch/sh/kernel/timers/timer.c */ struct sys_timer *get_sys_timer(void); -- cgit v1.2.3 From 35f3c5185b1e28e6591aa649db8bf4fa16f1a7f3 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Fri, 6 Oct 2006 15:31:16 +0900 Subject: sh: Updates for IRQ handler changes. Trivial fixes for build breakage introduced by IRQ handler changes. Signed-off-by: Paul Mundt --- include/asm-sh/hw_irq.h | 4 ++++ include/asm-sh/irq_regs.h | 1 + include/asm-sh/timer.h | 3 +-- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 include/asm-sh/irq_regs.h (limited to 'include') diff --git a/include/asm-sh/hw_irq.h b/include/asm-sh/hw_irq.h index fed26616967..80ee1cda749 100644 --- a/include/asm-sh/hw_irq.h +++ b/include/asm-sh/hw_irq.h @@ -1,4 +1,8 @@ #ifndef __ASM_SH_HW_IRQ_H #define __ASM_SH_HW_IRQ_H +#include + +extern atomic_t irq_err_count; + #endif /* __ASM_SH_HW_IRQ_H */ diff --git a/include/asm-sh/irq_regs.h b/include/asm-sh/irq_regs.h new file mode 100644 index 00000000000..3dd9c0b7027 --- /dev/null +++ b/include/asm-sh/irq_regs.h @@ -0,0 +1 @@ +#include diff --git a/include/asm-sh/timer.h b/include/asm-sh/timer.h index 341cb71c2f9..5df842bcf7b 100644 --- a/include/asm-sh/timer.h +++ b/include/asm-sh/timer.h @@ -36,7 +36,6 @@ static inline unsigned long get_timer_offset(void) struct sys_timer *get_sys_timer(void); /* arch/sh/kernel/time.c */ -void handle_timer_tick(struct pt_regs *); +void handle_timer_tick(void); #endif /* __ASM_SH_TIMER_H */ - -- cgit v1.2.3 From 525ccc452c79db41874c5edac3f67618a0997d6f Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Fri, 6 Oct 2006 17:35:48 +0900 Subject: sh: Convert INTC2 IRQ handler to irq_chip. More struct irq_chip conversions, this time the INTC2 handlers. Signed-off-by: Paul Mundt --- include/asm-sh/irq.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h index 0e5f365aff7..28996f9c58c 100644 --- a/include/asm-sh/irq.h +++ b/include/asm-sh/irq.h @@ -697,13 +697,15 @@ extern int ipr_irq_demux(int irq); #define INTC2_INTPRI_OFFSET 0x00 -void make_intc2_irq(unsigned int irq, - unsigned int ipr_offset, unsigned int ipr_shift, - unsigned int msk_offset, unsigned int msk_shift, - unsigned int priority); +struct intc2_data { + unsigned short irq; + unsigned char ipr_offset, ipr_shift; + unsigned char msk_offset, msk_shift; + unsigned char priority; +}; + +void make_intc2_irq(struct intc2_data *); void init_IRQ_intc2(void); -void intc2_add_clear_irq(int irq, int (*fn)(int)); - #endif extern int shmse_irq_demux(int irq); -- cgit v1.2.3 From 8ae91b9ad88a130cd50fc0b78b16e7b9510b8067 Mon Sep 17 00:00:00 2001 From: Ryusuke Sakato Date: Thu, 12 Oct 2006 12:16:13 +0900 Subject: sh: SH-4A UBC support A simple patch to enable the UBC on SH-4A. Signed-off-by: Ryusuke Sakato Signed-off-by: Paul Mundt --- include/asm-sh/cpu-sh4/ubc.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'include') diff --git a/include/asm-sh/cpu-sh4/ubc.h b/include/asm-sh/cpu-sh4/ubc.h index 3d094316765..c86e1705093 100644 --- a/include/asm-sh/cpu-sh4/ubc.h +++ b/include/asm-sh/cpu-sh4/ubc.h @@ -3,6 +3,7 @@ * * Copyright (C) 1999 Niibe Yutaka * Copyright (C) 2003 Paul Mundt + * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -11,6 +12,41 @@ #ifndef __ASM_CPU_SH4_UBC_H #define __ASM_CPU_SH4_UBC_H +#if defined(CONFIG_CPU_SH4A) +#define UBC_CBR0 0xff200000 +#define UBC_CRR0 0xff200004 +#define UBC_CAR0 0xff200008 +#define UBC_CAMR0 0xff20000c +#define UBC_CBR1 0xff200020 +#define UBC_CRR1 0xff200024 +#define UBC_CAR1 0xff200028 +#define UBC_CAMR1 0xff20002c +#define UBC_CDR1 0xff200030 +#define UBC_CDMR1 0xff200034 +#define UBC_CETR1 0xff200038 +#define UBC_CCMFR 0xff200600 +#define UBC_CBCR 0xff200620 + +/* CBR */ +#define UBC_CBR_AIE (0x01<<30) +#define UBC_CBR_ID_INST (0x01<<4) +#define UBC_CBR_RW_READ (0x01<<1) +#define UBC_CBR_CE (0x01) + +#define UBC_CBR_AIV_MASK (0x00FF0000) +#define UBC_CBR_AIV_SHIFT (16) +#define UBC_CBR_AIV_SET(asid) (((asid)<