You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
(82) |
Jun
(72) |
Jul
(39) |
Aug
(104) |
Sep
(61) |
Oct
(55) |
Nov
(101) |
Dec
(48) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(52) |
Feb
(67) |
Mar
(18) |
Apr
(16) |
May
(33) |
Jun
(12) |
Jul
(102) |
Aug
(168) |
Sep
(65) |
Oct
(60) |
Nov
(43) |
Dec
(121) |
2002 |
Jan
(69) |
Feb
(32) |
Mar
(90) |
Apr
(59) |
May
(45) |
Jun
(43) |
Jul
(33) |
Aug
(21) |
Sep
(11) |
Oct
(20) |
Nov
(26) |
Dec
(3) |
2003 |
Jan
(12) |
Feb
(18) |
Mar
(11) |
Apr
(11) |
May
(41) |
Jun
(76) |
Jul
(77) |
Aug
(15) |
Sep
(38) |
Oct
(56) |
Nov
(19) |
Dec
(39) |
2004 |
Jan
(17) |
Feb
(52) |
Mar
(36) |
Apr
(34) |
May
(48) |
Jun
(85) |
Jul
(38) |
Aug
(42) |
Sep
(41) |
Oct
(77) |
Nov
(27) |
Dec
(19) |
2005 |
Jan
(32) |
Feb
(35) |
Mar
(29) |
Apr
(8) |
May
(7) |
Jun
(31) |
Jul
(46) |
Aug
(93) |
Sep
(65) |
Oct
(85) |
Nov
(219) |
Dec
(47) |
2006 |
Jan
(170) |
Feb
(103) |
Mar
(49) |
Apr
(43) |
May
(45) |
Jun
(29) |
Jul
(77) |
Aug
(82) |
Sep
(43) |
Oct
(45) |
Nov
(26) |
Dec
(85) |
2007 |
Jan
(42) |
Feb
(48) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(53) |
Jul
(175) |
Aug
(212) |
Sep
(91) |
Oct
(103) |
Nov
(110) |
Dec
(5) |
2008 |
Jan
(20) |
Feb
(11) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(5) |
Sep
(3) |
Oct
(12) |
Nov
|
Dec
|
From: Mike F. <va...@ge...> - 2007-08-03 03:56:21
|
On Thursday 02 August 2007, Adrian McMenamin wrote: > This patch adds a set machine-ops callbacks what is the advantage here over using weaks ? seems like weaks would be=20 simpler and better because you could cull the default ones at link time if = a=20 board provided its own ... =2Dmike |
From: Paul M. <le...@li...> - 2007-08-03 03:44:25
|
On Fri, Aug 03, 2007 at 12:13:13AM +0200, Markus Brunner wrote: > this patch adds the SH_RTC_4_DIGIT_YEAR kernel configuration option. > It is set for all SH4 CPUs and for the 7705 and 7710 SH3 CPUs. > > Unfortunately I wasn't able to get a SH7712 datasheet, so I couldn't > check the register for that. Hopefully somebody else has one and can > check this. SH7712 seems to have the same issue, so that keeps it simple. I've thought about this a little more, and as it's quite probable that we'll start seeing more of this kind of divergence, we may as well just start setting capabilities in the platform data (that's more or less what it's there for anyways). How about something like this? I'll toss it in the 2.6.23 queue if it's fine for you, so rtc-sh doesn't end up being useless on these CPUs in 2.6.23 :-) -- arch/sh/kernel/cpu/sh3/setup-sh7705.c | 12 ++++++-- arch/sh/kernel/cpu/sh3/setup-sh7710.c | 10 ++++++ drivers/rtc/rtc-sh.c | 51 ++++++++++++++++++++++------------ include/asm-sh/rtc.h | 6 ++++ 4 files changed, 58 insertions(+), 21 deletions(-) diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c index 6fc68e7..568cc08 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c @@ -1,7 +1,7 @@ /* * SH7705 Setup * - * Copyright (C) 2006 Paul Mundt + * Copyright (C) 2006, 2007 Paul Mundt * Copyright (C) 2007 Nobuhiro Iwamatsu * * This file is subject to the terms and conditions of the GNU General Public @@ -13,8 +13,9 @@ #include <linux/irq.h> #include <linux/serial.h> #include <asm/sci.h> +#include <asm/rtc.h> -enum{ +enum { UNUSED = 0, /* interrupt sources */ @@ -138,11 +139,18 @@ static struct resource rtc_resources[] = { }, }; +static struct sh_rtc_platform_info rtc_info = { + .capabilities = RTC_CAP_4_DIGIT_YEAR, +}; + static struct platform_device rtc_device = { .name = "sh-rtc", .id = -1, .num_resources = ARRAY_SIZE(rtc_resources), .resource = rtc_resources, + .dev = { + .platform_data = &rtc_info, + }, }; static struct platform_device *sh7705_devices[] __initdata = { diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c index 07f26ab..eb55ac9 100644 --- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c +++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c @@ -1,7 +1,7 @@ /* * SH3 Setup code for SH7710, SH7712 * - * Copyright (C) 2006 Paul Mundt + * Copyright (C) 2006, 2007 Paul Mundt * Copyright (C) 2007 Nobuhiro Iwamatsu * * This file is subject to the terms and conditions of the GNU General Public @@ -13,6 +13,7 @@ #include <linux/irq.h> #include <linux/serial.h> #include <asm/sci.h> +#include <asm/rtc.h> enum { UNUSED = 0, @@ -130,11 +131,18 @@ static struct resource rtc_resources[] = { }, }; +static struct sh_rtc_platform_info rtc_info = { + .capabilities = RTC_CAP_4_DIGIT_YEAR, +}; + static struct platform_device rtc_device = { .name = "sh-rtc", .id = -1, .num_resources = ARRAY_SIZE(rtc_resources), .resource = rtc_resources, + .dev = { + .platform_data = &rtc_info, + }, }; static struct plat_sci_port sci_platform_data[] = { diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index 93ee05e..78277a1 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c @@ -1,7 +1,7 @@ /* * SuperH On-Chip RTC Support * - * Copyright (C) 2006 Paul Mundt + * Copyright (C) 2006, 2007 Paul Mundt * Copyright (C) 2006 Jamie Lenehan * * Based on the old arch/sh/kernel/cpu/rtc.c by: @@ -23,16 +23,19 @@ #include <linux/interrupt.h> #include <linux/spinlock.h> #include <linux/io.h> +#include <asm/rtc.h> #define DRV_NAME "sh-rtc" -#define DRV_VERSION "0.1.2" +#define DRV_VERSION "0.1.3" #ifdef CONFIG_CPU_SH3 #define rtc_reg_size sizeof(u16) #define RTC_BIT_INVERTED 0 /* No bug on SH7708, SH7709A */ +#define RTC_DEF_CAPABILITIES 0UL #elif defined(CONFIG_CPU_SH4) #define rtc_reg_size sizeof(u32) #define RTC_BIT_INVERTED 0x40 /* bug on SH7750, SH7750S */ +#define RTC_DEF_CAPABILITIES RTC_CAP_4_DIGIT_YEAR #endif #define RTC_REG(r) ((r) * rtc_reg_size) @@ -80,6 +83,7 @@ struct sh_rtc { struct rtc_device *rtc_dev; spinlock_t lock; int rearm_aie; + unsigned long capabilities; /* See asm-sh/rtc.h for cap bits */ }; static irqreturn_t sh_rtc_interrupt(int irq, void *dev_id) @@ -319,14 +323,14 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm) tm->tm_mday = BCD2BIN(readb(rtc->regbase + RDAYCNT)); tm->tm_mon = BCD2BIN(readb(rtc->regbase + RMONCNT)) - 1; -#if defined(CONFIG_CPU_SH4) - yr = readw(rtc->regbase + RYRCNT); - yr100 = BCD2BIN(yr >> 8); - yr &= 0xff; -#else - yr = readb(rtc->regbase + RYRCNT); - yr100 = BCD2BIN((yr == 0x99) ? 0x19 : 0x20); -#endif + if (rtc->capabilities & RTC_CAP_4_DIGIT_YEAR) { + yr = readw(rtc->regbase + RYRCNT); + yr100 = BCD2BIN(yr >> 8); + yr &= 0xff; + } else { + yr = readb(rtc->regbase + RYRCNT); + yr100 = BCD2BIN((yr == 0x99) ? 0x19 : 0x20); + } tm->tm_year = (yr100 * 100 + BCD2BIN(yr)) - 1900; @@ -375,14 +379,14 @@ static int sh_rtc_set_time(struct device *dev, struct rtc_time *tm) writeb(BIN2BCD(tm->tm_mday), rtc->regbase + RDAYCNT); writeb(BIN2BCD(tm->tm_mon + 1), rtc->regbase + RMONCNT); -#ifdef CONFIG_CPU_SH3 - year = tm->tm_year % 100; - writeb(BIN2BCD(year), rtc->regbase + RYRCNT); -#else - year = (BIN2BCD((tm->tm_year + 1900) / 100) << 8) | - BIN2BCD(tm->tm_year % 100); - writew(year, rtc->regbase + RYRCNT); -#endif + if (rtc->capabilities & RTC_CAP_4_DIGIT_YEAR) { + year = (BIN2BCD((tm->tm_year + 1900) / 100) << 8) | + BIN2BCD(tm->tm_year % 100); + writew(year, rtc->regbase + RYRCNT); + } else { + year = tm->tm_year % 100; + writeb(BIN2BCD(year), rtc->regbase + RYRCNT); + } /* Start RTC */ tmp = readb(rtc->regbase + RCR2); @@ -589,6 +593,17 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev) goto err_badmap; } + rtc->capabilities = RTC_DEF_CAPABILITIES; + if (pdev->dev.platform_data) { + struct sh_rtc_platform_info *pinfo = pdev->dev.platform_data; + + /* + * Some CPUs have special capabilities in addition to the + * default set. Add those in here. + */ + rtc->capabilities |= pinfo->capabilities; + } + platform_set_drvdata(pdev, rtc); return 0; diff --git a/include/asm-sh/rtc.h b/include/asm-sh/rtc.h index 91aacc9..b106a73 100644 --- a/include/asm-sh/rtc.h +++ b/include/asm-sh/rtc.h @@ -5,4 +5,10 @@ extern void (*board_time_init)(void); extern void (*rtc_sh_get_time)(struct timespec *); extern int (*rtc_sh_set_time)(const time_t); +#define RTC_CAP_4_DIGIT_YEAR (1 << 0) + +struct sh_rtc_platform_info { + unsigned long capabilities; +}; + #endif /* _ASM_RTC_H */ |
From: Paul M. <le...@li...> - 2007-08-03 01:20:47
|
On Fri, Aug 03, 2007 at 12:08:05AM +0900, Magnus Damm wrote: > sh: update r2d defconfig On Fri, Aug 03, 2007 at 12:09:42AM +0900, Magnus Damm wrote: > sh: fix cf support on r2d boards On Fri, Aug 03, 2007 at 12:11:19AM +0900, Magnus Damm wrote: > sh: fix defconfigs for sh7751r boards David's patch took care of the snapgear update, so I ripped that out of your patch, but everything else looked fine. All of these have been queued for 2.6.23 (as I expect was where you wanted them to be applied), thanks. |
From: Paul M. <le...@li...> - 2007-08-03 01:15:18
|
On Thu, Jul 26, 2007 at 03:29:39PM +1000, David McCullough wrote: > Updated the snapgear defconfig to get a booting kernel. > > Signed-off-by: David McCullough <dav...@se...> > Queued for 2.6.23, thanks. |
From: Paul M. <le...@li...> - 2007-08-03 00:58:29
|
On Fri, Aug 03, 2007 at 01:30:39AM +0900, Magnus Damm wrote: > Not sure, but 7708 is missing a few things compared to the rest of the > 770x. For interrupt related stuff please have a look at the newly > added setup-sh770x.c file. I guess the most important part of it from > my interrupt point of view is that 7708 doesn't support pint. And I > remember something about CF on pint, but I'm not sure it that's true > for all models. So there you have something related to your > pata_platform polling. The DMA controller is also missing from 7708, > maybe that one is used by the sound driver? > The audio problems are more likely due to the TMU utilization. The sh_dac driver explicitly clobbers TMU1, which we happen to use for the clock source (TMU0 is the clock event timer, TMU1 the clock source). So we need to be a bit more intelligent with regards to how we allocate TMU channels. |
From: Adrian M. <ad...@ne...> - 2007-08-02 23:54:56
|
machine-ops patch with better whitespace control This patch adds a set machine-ops callbacks - as with the existing i386 code - that will allow better, per machine, shutdown code to be implemented. Signed-off by: Adrian McMenamin <ad...@mc...> |
From: Adrian M. <ad...@ne...> - 2007-08-02 23:41:29
|
Here is a new patch that hopefully answers some of your points. This has been tested on the Dreamcast but does need to be tested on various builds to ensure there are no hidden nasties with the build. Here's a description: This patch adds a set machine-ops callbacks - as with the existing i386 code - that will allow better, per machine, shutdown code to be implemented. Signed-off by: Adrian McMenamin <ad...@mc...> diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile index 1f141a8..7ab2359 100644 --- a/arch/sh/kernel/Makefile +++ b/arch/sh/kernel/Makefile @@ -5,10 +5,11 @@ extra-y := head.o init_task.o vmlinux.lds obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process.o ptrace.o \ - semaphore.o setup.o signal.o sys_sh.o syscalls.o \ + reboot.o semaphore.o setup.o signal.o sys_sh.o syscalls.o \ time.o topology.o traps.o obj-y += cpu/ timers/ + obj-$(CONFIG_VSYSCALL) += vsyscall/ obj-$(CONFIG_SMP) += smp.o diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c index 790ed69..201b370 100644 --- a/arch/sh/kernel/machine_kexec.c +++ b/arch/sh/kernel/machine_kexec.c @@ -29,9 +29,6 @@ extern const unsigned char relocate_new_kernel[]; extern const unsigned int relocate_new_kernel_size; extern void *gdb_vbr_vector; -void machine_shutdown(void) -{ -} void machine_crash_shutdown(struct pt_regs *regs) { diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index 15ae322..5484e30 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c @@ -24,13 +24,12 @@ #include <asm/pgalloc.h> #include <asm/system.h> #include <asm/ubc.h> +#include <asm/reboot.h> static int hlt_counter; int ubc_usercnt = 0; void (*pm_idle)(void); -void (*pm_power_off)(void); -EXPORT_SYMBOL(pm_power_off); void disable_hlt(void) { @@ -96,27 +95,6 @@ void cpu_idle(void) } } -void machine_restart(char * __unused) -{ - /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ - asm volatile("ldc %0, sr\n\t" - "mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001)); -} - -void machine_halt(void) -{ - local_irq_disable(); - - while (1) - cpu_sleep(); -} - -void machine_power_off(void) -{ - if (pm_power_off) - pm_power_off(); -} - void show_regs(struct pt_regs * regs) { printk("\n"); diff --git a/arch/sh/kernel/reboot.c b/arch/sh/kernel/reboot.c new file mode 100644 index 0000000..00a8afe --- /dev/null +++ b/arch/sh/kernel/reboot.c @@ -0,0 +1,99 @@ +/* + * linux/arch/sh/kernel/reboot.c + * + * Essentially copied from i386 code + * some SuperH code copyright Adrian McMenamin, 2007 + * Most copied from process.c + * + * Copyright (C) 1995 Linus Torvalds + * + * SuperH version: Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima + * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC + * Copyright (C) 2002 - 2007 Paul Mundt + * + * Licensed under the terms of version 2 of GNU GPL + */ + +#include <linux/mm.h> +#include <linux/module.h> +#include <linux/delay.h> +#include <linux/init.h> +#include <asm/reboot.h> + +/* + * Power off function, if any + */ +void (*pm_power_off)(void); +EXPORT_SYMBOL(pm_power_off); + + + +static void native_machine_shutdown(void) +{ +/* Is there anything we can do here? */ +} + + +static void native_machine_emergency_restart(void) +{ + /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ + asm volatile("ldc %0, sr\n\t" + "mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001)); +} + +static void native_machine_restart(char * __unused) +{ + native_machine_shutdown(); + native_machine_emergency_restart(); +} + +static void native_machine_halt(void) +{ + local_irq_disable(); + + while (1) + cpu_sleep(); + +} + +static void native_machine_power_off(void) +{ + if (pm_power_off) { + native_machine_shutdown(); + pm_power_off(); + } +} + + +struct machine_ops machine_ops = { + .power_off = native_machine_power_off, + .shutdown = native_machine_shutdown, + .emergency_restart = native_machine_emergency_restart, + .restart = native_machine_restart, + .halt = native_machine_halt, +}; + +void machine_power_off(void) +{ + machine_ops.power_off(); +} + +void machine_shutdown(void) +{ + machine_ops.shutdown(); +} + +void machine_emergency_restart(void) +{ + machine_ops.emergency_restart(); +} + +void machine_restart(char *cmd) +{ + machine_ops.restart(cmd); +} + +void machine_halt(void) +{ + machine_ops.halt(); +} diff --git a/include/asm-sh/emergency-restart.h b/include/asm-sh/emergency-restart.h index 108d8c4..d6bec92 100644 --- a/include/asm-sh/emergency-restart.h +++ b/include/asm-sh/emergency-restart.h @@ -1,6 +1,6 @@ -#ifndef _ASM_EMERGENCY_RESTART_H -#define _ASM_EMERGENCY_RESTART_H +#ifndef _ASM_SH_EMERGENCY_RESTART_H +#define _ASM_SH_EMERGENCY_RESTART_H -#include <asm-generic/emergency-restart.h> +extern void machine_emergency_restart(void); -#endif /* _ASM_EMERGENCY_RESTART_H */ +#endif /* _ASM_SH_EMERGENCY_RESTART_H */ |
From: Markus B. <sup...@go...> - 2007-08-02 22:09:18
|
Hi Paul, this patch adds the SH_RTC_4_DIGIT_YEAR kernel configuration option. It is set for all SH4 CPUs and for the 7705 and 7710 SH3 CPUs. Unfortunately I wasn't able to get a SH7712 datasheet, so I couldn't check the register for that. Hopefully somebody else has one and can check this. All other SH3 CPUs only have a 2 digit year register. Signed-off by: Markus Brunner <sup...@gm...> --- diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index ceceb05..4dc2d68 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -457,6 +457,10 @@ config SH_CLK_MD help MD2 - MD0 pin setting. +config SH_RTC_4_DIGIT_YEAR + bool + default n + source "kernel/time/Kconfig" endmenu diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig index eca68da..6e00121 100644 --- a/arch/sh/mm/Kconfig +++ b/arch/sh/mm/Kconfig @@ -18,6 +18,7 @@ config CPU_SH4 select CPU_HAS_INTEVT select CPU_HAS_SR_RB select CPU_HAS_PTEA if (!CPU_SUBTYPE_ST40 && !CPU_SH4A) || CPU_SHX2 + select SH_RTC_4_DIGIT_YEAR config CPU_SH4A bool @@ -66,6 +67,7 @@ config CPU_SUBTYPE_SH7705 bool "Support SH7705 processor" select CPU_SH3 select CPU_HAS_INTC_IRQ + select SH_RTC_4_DIGIT_YEAR config CPU_SUBTYPE_SH7706 bool "Support SH7706 processor" @@ -101,6 +103,7 @@ config CPU_SUBTYPE_SH7710 select CPU_SH3 select CPU_HAS_INTC_IRQ select CPU_HAS_DSP + select SH_RTC_4_DIGIT_YEAR help Select SH7710 if you have a SH3-DSP SH7710 CPU. diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index 93ee05e..e40552a 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c @@ -319,7 +319,7 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm) tm->tm_mday = BCD2BIN(readb(rtc->regbase + RDAYCNT)); tm->tm_mon = BCD2BIN(readb(rtc->regbase + RMONCNT)) - 1; -#if defined(CONFIG_CPU_SH4) +#if defined(CONFIG_SH_RTC_4_DIGIT_YEAR) yr = readw(rtc->regbase + RYRCNT); yr100 = BCD2BIN(yr >> 8); yr &= 0xff; @@ -375,13 +375,13 @@ static int sh_rtc_set_time(struct device *dev, struct rtc_time *tm) writeb(BIN2BCD(tm->tm_mday), rtc->regbase + RDAYCNT); writeb(BIN2BCD(tm->tm_mon + 1), rtc->regbase + RMONCNT); -#ifdef CONFIG_CPU_SH3 - year = tm->tm_year % 100; - writeb(BIN2BCD(year), rtc->regbase + RYRCNT); -#else +#if defined(CONFIG_SH_RTC_4_DIGIT_YEAR) year = (BIN2BCD((tm->tm_year + 1900) / 100) << 8) | BIN2BCD(tm->tm_year % 100); writew(year, rtc->regbase + RYRCNT); +#else + year = tm->tm_year % 100; + writeb(BIN2BCD(year), rtc->regbase + RYRCNT); #endif /* Start RTC */ |
From: Paul M. <le...@li...> - 2007-08-02 22:01:29
|
On Thu, Aug 02, 2007 at 10:09:51PM +0100, Adrian McMenamin wrote: > On 02/08/07, Adrian McMenamin <lkm...@gm...> wrote: > > Paul/list > > > > This is my first attempt at this and it seems to work on the > > Dreamcast. I need to add a set of fixups for the Dreamcast also (at > > the moment it just replicates the behaviour in the current process.c) > > - as that is the whole point. > > > Apologies, that patch was incomplete and in other ways messed up. This > should be the proper patch > > diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile > index 1f141a8..e019ad1 100644 > --- a/arch/sh/kernel/Makefile > +++ b/arch/sh/kernel/Makefile > @@ -6,9 +6,10 @@ extra-y := head.o init_task.o vmlinux.lds > > obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process.o ptrace.o \ > semaphore.o setup.o signal.o sys_sh.o syscalls.o \ > - time.o topology.o traps.o > + time.o topology.o traps.o reboot.o > And here I was happy to have kept that alphabetized for so many years ;-) > +void machine_emergency_restart(void) > +{ > + machine_ops.emergency_restart(); > +} > + Some whitespace damage here. > +void machine_restart(char *cmd) > +{ > + printk(KERN_INFO "Got here\n"); > + machine_ops.restart(cmd); Debugging printk(). > --- /dev/null 2007-04-19 22:41:52.000000000 +0100 > +++ include/asm-sh/reboot.h 2007-08-02 00:06:49.000000000 +0100 > @@ -0,0 +1,20 @@ > +#ifndef _ASM_REBOOT_H > +#define _ASM_REBOOT_H > + > +/*straight lift from i386 code*/ > +struct pt_regs; > + > +struct machine_ops > +{ > + void (*restart)(char *cmd); > + void (*halt)(void); > + void (*power_off)(void); > + void (*shutdown)(void); > + void (*crash_shutdown)(struct pt_regs *); > + void (*emergency_restart)(void); > +}; > + > +extern struct machine_ops machine_ops; > + I wonder if we care about shutdown/crash_shutdown() at all. Note that machine_crash_shutdown() is currently defined by the kexec code, in arch/sh/kernel/machine_kexec.c. Can you consolidate the definitions from there in to your reboot.c and test the build with CONFIG_KEXEC=y? > + > +#endif /* _ASM_REBOOT_H */ > diff -ruN /dev/null include/asm-sh/emergency-restart.h > --- /dev/null 2007-04-19 22:41:52.000000000 +0100 > +++ include/asm-sh/emergency-restart.h 2007-08-02 21:09:09.000000000 +0100 > @@ -0,0 +1,6 @@ > +#ifndef _ASM_GENERIC_EMERGENCY_RESTART_H > +#define _ASM_GENERIC_EMERGENCY_RESTART_H > + > +extern void machine_emergency_restart(void); > + > +#endif /* _ASM_GENERIC_EMERGENCY_RESTART_H */ > I also wonder if this is worth it. Perhaps we should just consolidate the native_machine_emergency_restart() logic in native_machine_restart(), and stick with the asm-generic/emergency_restart.h, we don't requite the cmd parsing at all, so it's probably not something we care about. This also allows emergency_restart to be killed off from the machine_ops struct. |
From: Adrian M. <lkm...@gm...> - 2007-08-02 21:09:56
|
On 02/08/07, Adrian McMenamin <lkm...@gm...> wrote: > Paul/list > > This is my first attempt at this and it seems to work on the > Dreamcast. I need to add a set of fixups for the Dreamcast also (at > the moment it just replicates the behaviour in the current process.c) > - as that is the whole point. > Apologies, that patch was incomplete and in other ways messed up. This should be the proper patch diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile index 1f141a8..e019ad1 100644 --- a/arch/sh/kernel/Makefile +++ b/arch/sh/kernel/Makefile @@ -6,9 +6,10 @@ extra-y := head.o init_task.o vmlinux.lds obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process.o ptrace.o \ semaphore.o setup.o signal.o sys_sh.o syscalls.o \ - time.o topology.o traps.o + time.o topology.o traps.o reboot.o obj-y += cpu/ timers/ + obj-$(CONFIG_VSYSCALL) += vsyscall/ obj-$(CONFIG_SMP) += smp.o diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index 15ae322..5484e30 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c @@ -24,13 +24,12 @@ #include <asm/pgalloc.h> #include <asm/system.h> #include <asm/ubc.h> +#include <asm/reboot.h> static int hlt_counter; int ubc_usercnt = 0; void (*pm_idle)(void); -void (*pm_power_off)(void); -EXPORT_SYMBOL(pm_power_off); void disable_hlt(void) { @@ -96,27 +95,6 @@ void cpu_idle(void) } } -void machine_restart(char * __unused) -{ - /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ - asm volatile("ldc %0, sr\n\t" - "mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001)); -} - -void machine_halt(void) -{ - local_irq_disable(); - - while (1) - cpu_sleep(); -} - -void machine_power_off(void) -{ - if (pm_power_off) - pm_power_off(); -} - void show_regs(struct pt_regs * regs) { printk("\n"); diff --git a/arch/sh/kernel/reboot.c b/arch/sh/kernel/reboot.c new file mode 100644 index 0000000..3ae91f4 --- /dev/null +++ b/arch/sh/kernel/reboot.c @@ -0,0 +1,100 @@ +/* + * linux/arch/sh/kernel/reboot.c + * + * Essentially copied from i386 code + * some SuperH code copyright Adrian McMenamin, 2007 + * Most copied from process.c + * + * Copyright (C) 1995 Linus Torvalds + * + * SuperH version: Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima + * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC + * Copyright (C) 2002 - 2007 Paul Mundt + * + * Licensed under the terms of version 2 of GNU GPL + */ + +#include <linux/mm.h> +#include <linux/module.h> +#include <linux/delay.h> +#include <linux/init.h> +#include <asm/reboot.h> + +/* + * Power off function, if any + */ +void (*pm_power_off)(void); +EXPORT_SYMBOL(pm_power_off); + + + +static void native_machine_shutdown(void) +{ +/* Is there anything we can do here? */ +} + + +static void native_machine_emergency_restart(void) +{ + /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ + asm volatile("ldc %0, sr\n\t" + "mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001)); +} + +static void native_machine_restart(char * __unused) +{ + native_machine_shutdown(); + native_machine_emergency_restart(); +} + +static void native_machine_halt(void) +{ + local_irq_disable(); + + while (1) + cpu_sleep(); + +} + +static void native_machine_power_off(void) +{ + if (pm_power_off) { + native_machine_shutdown(); + pm_power_off(); + } +} + + +struct machine_ops machine_ops = { + .power_off = native_machine_power_off, + .shutdown = native_machine_shutdown, + .emergency_restart = native_machine_emergency_restart, + .restart = native_machine_restart, + .halt = native_machine_halt, +}; + +void machine_power_off(void) +{ + machine_ops.power_off(); +} + +void machine_shutdown(void) +{ + machine_ops.shutdown(); +} + +void machine_emergency_restart(void) +{ + machine_ops.emergency_restart(); +} + +void machine_restart(char *cmd) +{ + printk(KERN_INFO "Got here\n"); + machine_ops.restart(cmd); +} + +void machine_halt(void) +{ + machine_ops.halt(); +} diff -ruN /dev/null include/asm-sh/reboot.h --- /dev/null 2007-04-19 22:41:52.000000000 +0100 +++ include/asm-sh/reboot.h 2007-08-02 00:06:49.000000000 +0100 @@ -0,0 +1,20 @@ +#ifndef _ASM_REBOOT_H +#define _ASM_REBOOT_H + +/*straight lift from i386 code*/ +struct pt_regs; + +struct machine_ops +{ + void (*restart)(char *cmd); + void (*halt)(void); + void (*power_off)(void); + void (*shutdown)(void); + void (*crash_shutdown)(struct pt_regs *); + void (*emergency_restart)(void); +}; + +extern struct machine_ops machine_ops; + + +#endif /* _ASM_REBOOT_H */ diff -ruN /dev/null include/asm-sh/emergency-restart.h --- /dev/null 2007-04-19 22:41:52.000000000 +0100 +++ include/asm-sh/emergency-restart.h 2007-08-02 21:09:09.000000000 +0100 @@ -0,0 +1,6 @@ +#ifndef _ASM_GENERIC_EMERGENCY_RESTART_H +#define _ASM_GENERIC_EMERGENCY_RESTART_H + +extern void machine_emergency_restart(void); + +#endif /* _ASM_GENERIC_EMERGENCY_RESTART_H */ |
From: Adrian M. <lkm...@gm...> - 2007-08-02 20:59:44
|
Paul/list This is my first attempt at this and it seems to work on the Dreamcast. I need to add a set of fixups for the Dreamcast also (at the moment it just replicates the behaviour in the current process.c) - as that is the whole point. Comments? Signed-off by: Adrian McMenamin <ad...@mc...> diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile index 1f141a8..e019ad1 100644 --- a/arch/sh/kernel/Makefile +++ b/arch/sh/kernel/Makefile @@ -6,9 +6,10 @@ extra-y := head.o init_task.o vmlinux.lds obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process.o ptrace.o \ semaphore.o setup.o signal.o sys_sh.o syscalls.o \ - time.o topology.o traps.o + time.o topology.o traps.o reboot.o obj-y += cpu/ timers/ + obj-$(CONFIG_VSYSCALL) += vsyscall/ obj-$(CONFIG_SMP) += smp.o diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c index 15ae322..5484e30 100644 --- a/arch/sh/kernel/process.c +++ b/arch/sh/kernel/process.c @@ -24,13 +24,12 @@ #include <asm/pgalloc.h> #include <asm/system.h> #include <asm/ubc.h> +#include <asm/reboot.h> static int hlt_counter; int ubc_usercnt = 0; void (*pm_idle)(void); -void (*pm_power_off)(void); -EXPORT_SYMBOL(pm_power_off); void disable_hlt(void) { @@ -96,27 +95,6 @@ void cpu_idle(void) } } -void machine_restart(char * __unused) -{ - /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ - asm volatile("ldc %0, sr\n\t" - "mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001)); -} - -void machine_halt(void) -{ - local_irq_disable(); - - while (1) - cpu_sleep(); -} - -void machine_power_off(void) -{ - if (pm_power_off) - pm_power_off(); -} - void show_regs(struct pt_regs * regs) { printk("\n"); diff --git a/arch/sh/kernel/reboot.c b/arch/sh/kernel/reboot.c new file mode 100644 index 0000000..3ae91f4 --- /dev/null +++ b/arch/sh/kernel/reboot.c @@ -0,0 +1,100 @@ +/* + * linux/arch/sh/kernel/reboot.c + * + * Essentially copied from i386 code + * some SuperH code copyright Adrian McMenamin, 2007 + * Most copied from process.c + * + * Copyright (C) 1995 Linus Torvalds + * + * SuperH version: Copyright (C) 1999, 2000 Niibe Yutaka & Kaz Kojima + * Copyright (C) 2006 Lineo Solutions Inc. support SH4A UBC + * Copyright (C) 2002 - 2007 Paul Mundt + * + * Licensed under the terms of version 2 of GNU GPL + */ + +#include <linux/mm.h> +#include <linux/module.h> +#include <linux/delay.h> +#include <linux/init.h> +#include <asm/reboot.h> + +/* + * Power off function, if any + */ +void (*pm_power_off)(void); +EXPORT_SYMBOL(pm_power_off); + + + +static void native_machine_shutdown(void) +{ +/* Is there anything we can do here? */ +} + + +static void native_machine_emergency_restart(void) +{ + /* SR.BL=1 and invoke address error to let CPU reset (manual reset) */ + asm volatile("ldc %0, sr\n\t" + "mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001)); +} + +static void native_machine_restart(char * __unused) +{ + native_machine_shutdown(); + native_machine_emergency_restart(); +} + +static void native_machine_halt(void) +{ + local_irq_disable(); + + while (1) + cpu_sleep(); + +} + +static void native_machine_power_off(void) +{ + if (pm_power_off) { + native_machine_shutdown(); + pm_power_off(); + } +} + + +struct machine_ops machine_ops = { + .power_off = native_machine_power_off, + .shutdown = native_machine_shutdown, + .emergency_restart = native_machine_emergency_restart, + .restart = native_machine_restart, + .halt = native_machine_halt, +}; + +void machine_power_off(void) +{ + machine_ops.power_off(); +} + +void machine_shutdown(void) +{ + machine_ops.shutdown(); +} + +void machine_emergency_restart(void) +{ + machine_ops.emergency_restart(); +} + +void machine_restart(char *cmd) +{ + printk(KERN_INFO "Got here\n"); + machine_ops.restart(cmd); +} + +void machine_halt(void) +{ + machine_ops.halt(); +} diff --git a/include/asm-sh/emergency-restart.h b/include/asm-sh/emergency-restart.h index 108d8c4..7d73a4b 100644 --- a/include/asm-sh/emergency-restart.h +++ b/include/asm-sh/emergency-restart.h @@ -1,6 +1,6 @@ -#ifndef _ASM_EMERGENCY_RESTART_H -#define _ASM_EMERGENCY_RESTART_H +#ifndef _ASM_GENERIC_EMERGENCY_RESTART_H +#define _ASM_GENERIC_EMERGENCY_RESTART_H -#include <asm-generic/emergency-restart.h> +extern void machine_emergency_restart(void); -#endif /* _ASM_EMERGENCY_RESTART_H */ +#endif /* _ASM_GENERIC_EMERGENCY_RESTART_H */ |
From: Kristoffer E. <kri...@gm...> - 2007-08-02 18:20:51
|
The things is that I've never heard anyone state any difference (aside from pure cpu mhz) between the hp620/660 and hp680/690 platform. Even NetBSD seems to treat them as same platform. So why are we having these issues, seems quite strange. I might rip a 620 in half just to see what kind of hardware actually is in there. I suspect that either people just assumed the hardware was same or that they never actually tried it. I got pictures of hp680 ripped apart, but that wont help much since that is working well. Well, I'll think of it some more. Will see if I cannot get hold of a 620 and rip it in half. /Kristoffer On Fri, 3 Aug 2007 01:30:39 +0900 "Magnus Damm" <mag...@gm...> wrote: > Hi Kristoffer, > > On 8/2/07, Kristoffer Ericson <kri...@gm...> wrote: > > Greetings, > > > > Wanted some expert input on this. We are having situations where things are working perfectly fine on hp680/690 while working badly on 620/660lx. > > > > Examples: > > New alsa sounddriver works perfectly fine on hp680/hp690 but not at all on 620/660 > > Pata platform driver works perfectly fine on hp680/hp690 while not at all on 620/660, we have solved this by doing polling instead. > > HP680/HP690 reports 7729 CPU, while 620/660 reports 7708. ? > > > > Any ideas anyone? Assume 7709 vs 7708 would this explain the issues? > > Not sure, but 7708 is missing a few things compared to the rest of the > 770x. For interrupt related stuff please have a look at the newly > added setup-sh770x.c file. I guess the most important part of it from > my interrupt point of view is that 7708 doesn't support pint. And I > remember something about CF on pint, but I'm not sure it that's true > for all models. So there you have something related to your > pata_platform polling. The DMA controller is also missing from 7708, > maybe that one is used by the sound driver? > > It would be useful with more hardware information. Are there any > documents out there where people have marked out which pins that go > where? If you can find that then it should be pretty easy hack up > kernel support for all models. sh3-based models at least that is. =) > > / magnus -- Kristoffer Ericson <Kri...@Gm...> |
From: Magnus D. <mag...@gm...> - 2007-08-02 16:30:41
|
Hi Kristoffer, On 8/2/07, Kristoffer Ericson <kri...@gm...> wrote: > Greetings, > > Wanted some expert input on this. We are having situations where things are working perfectly fine on hp680/690 while working badly on 620/660lx. > > Examples: > New alsa sounddriver works perfectly fine on hp680/hp690 but not at all on 620/660 > Pata platform driver works perfectly fine on hp680/hp690 while not at all on 620/660, we have solved this by doing polling instead. > HP680/HP690 reports 7729 CPU, while 620/660 reports 7708. ? > > Any ideas anyone? Assume 7709 vs 7708 would this explain the issues? Not sure, but 7708 is missing a few things compared to the rest of the 770x. For interrupt related stuff please have a look at the newly added setup-sh770x.c file. I guess the most important part of it from my interrupt point of view is that 7708 doesn't support pint. And I remember something about CF on pint, but I'm not sure it that's true for all models. So there you have something related to your pata_platform polling. The DMA controller is also missing from 7708, maybe that one is used by the sound driver? It would be useful with more hardware information. Are there any documents out there where people have marked out which pins that go where? If you can find that then it should be pretty easy hack up kernel support for all models. sh3-based models at least that is. =) / magnus |
From: Magnus D. <mag...@gm...> - 2007-08-02 16:00:08
|
sh: intc - remove redundant irq code for shmin This patch removes redundant interrupt code for the shmin board which is using a sh770x processor and 4 IRQ lines as individual interrupts (IRQ-mode). Signed-off-by: Magnus Damm <da...@ig...> --- arch/sh/boards/shmin/setup.c | 26 +------------------------- arch/sh/kernel/cpu/sh3/setup-sh770x.c | 4 ++++ 2 files changed, 5 insertions(+), 25 deletions(-) --- 0001/arch/sh/boards/shmin/setup.c +++ work/arch/sh/boards/shmin/setup.c 2007-08-02 23:39:31.000000000 +0900 @@ -14,36 +14,12 @@ #define PFC_PHCR 0xa400010eUL #define INTC_ICR1 0xa4000010UL -#define INTC_IPRC 0xa4000016UL - -static struct ipr_data ipr_irq_table[] = { - { 32, 0, 0, 0 }, - { 33, 0, 4, 0 }, - { 34, 0, 8, 8 }, - { 35, 0, 12, 0 }, -}; - -static unsigned long ipr_offsets[] = { - INTC_IPRC, -}; - -static struct ipr_desc ipr_irq_desc = { - .ipr_offsets = ipr_offsets, - .nr_offsets = ARRAY_SIZE(ipr_offsets), - - .ipr_data = ipr_irq_table, - .nr_irqs = ARRAY_SIZE(ipr_irq_table), - - .chip = { - .name = "IPR-shmin", - }, -}; static void __init init_shmin_irq(void) { ctrl_outw(0x2a00, PFC_PHCR); // IRQ0-3=IRQ ctrl_outw(0x0aaa, INTC_ICR1); // IRQ0-3=IRQ-mode,Low-active. - register_ipr_controller(&ipr_irq_desc); + plat_irq_setup_pins(IRQ_MODE_IRQ); } static void __iomem *shmin_ioport_map(unsigned long port, unsigned int size) --- 0001/arch/sh/kernel/cpu/sh3/setup-sh770x.c +++ work/arch/sh/kernel/cpu/sh3/setup-sh770x.c 2007-08-02 23:39:31.000000000 +0900 @@ -201,12 +201,16 @@ static int __init sh770x_devices_setup(v } __initcall(sh770x_devices_setup); +#define INTC_ICR1 0xa4000010UL +#define INTC_ICR1_IRQLVL (1<<14) + void __init plat_irq_setup_pins(int mode) { if (mode == IRQ_MODE_IRQ) { #if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ defined(CONFIG_CPU_SUBTYPE_SH7707) || \ defined(CONFIG_CPU_SUBTYPE_SH7709) + ctrl_outw(ctrl_inw(INTC_ICR1) & ~INTC_ICR1_IRQLVL, INTC_ICR1); register_intc_controller(&intc_desc_irq); return; #endif |
From: Magnus D. <mag...@gm...> - 2007-08-02 15:54:38
|
sh: intc - remove redundant irq code for sh03, snapgear and titan This patch removes redundant board specific interrupt code for boards using sh775x processors and 4 IRQ lines in "Individual Interrupt Mode" aka IRLM. Three boards are affected: sh03, snapgear and titan. The right way to do this is to use cpu specific code provided by intc. A nice side effect is that sh03 now compiles - board not BROKEN any more. Signed-off-by: Magnus Damm <da...@ig...> --- arch/sh/Kconfig | 2 +- arch/sh/boards/sh03/setup.c | 26 +------------------------- arch/sh/boards/snapgear/setup.c | 30 ++---------------------------- arch/sh/boards/titan/setup.c | 30 +----------------------------- arch/sh/kernel/cpu/sh4/setup-sh7750.c | 14 ++++++++++---- include/asm-sh/hw_irq.h | 5 ----- include/asm-sh/sh03/io.h | 9 --------- include/asm-sh/snapgear.h | 12 ++++-------- 8 files changed, 19 insertions(+), 109 deletions(-) --- 0007/arch/sh/Kconfig +++ work/arch/sh/Kconfig 2007-08-02 23:35:22.000000000 +0900 @@ -308,7 +308,7 @@ config SH_MPC1211 config SH_SH03 bool "Interface CTP/PCI-SH03" - depends on CPU_SUBTYPE_SH7751 && BROKEN + depends on CPU_SUBTYPE_SH7751 select CPU_HAS_IPR_IRQ select SYS_SUPPORTS_PCI help --- 0001/arch/sh/boards/sh03/setup.c +++ work/arch/sh/boards/sh03/setup.c 2007-08-02 23:34:48.000000000 +0900 @@ -15,33 +15,9 @@ #include <asm/sh03/sh03.h> #include <asm/addrspace.h> -static struct ipr_data ipr_irq_table[] = { - { IRL0_IRQ, 0, IRL0_IPR_POS, IRL0_PRIORITY }, - { IRL1_IRQ, 0, IRL1_IPR_POS, IRL1_PRIORITY }, - { IRL2_IRQ, 0, IRL2_IPR_POS, IRL2_PRIORITY }, - { IRL3_IRQ, 0, IRL3_IPR_POS, IRL3_PRIORITY }, -}; - -static unsigned long ipr_offsets[] = { - INTC_IPRD, -}; - -static struct ipr_desc ipr_irq_desc = { - .ipr_offsets = ipr_offsets, - .nr_offsets = ARRAY_SIZE(ipr_offsets), - - .ipr_data = ipr_irq_table, - .nr_irqs = ARRAY_SIZE(ipr_irq_table), - - .chip = { - .name = "IPR-sh03", - }, -}; - static void __init init_sh03_IRQ(void) { - ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR); - register_ipr_controller(&ipr_irq_desc); + plat_irq_setup_pins(IRQ_MODE_IRQ); } extern void *cf_io_base; --- 0001/arch/sh/boards/snapgear/setup.c +++ work/arch/sh/boards/snapgear/setup.c 2007-08-02 23:34:48.000000000 +0900 @@ -68,37 +68,11 @@ module_init(eraseconfig_init); * IRL3 = crypto */ -static struct ipr_data ipr_irq_table[] = { - { IRL0_IRQ, 0, IRL0_IPR_POS, IRL0_PRIORITY }, - { IRL1_IRQ, 0, IRL1_IPR_POS, IRL1_PRIORITY }, - { IRL2_IRQ, 0, IRL2_IPR_POS, IRL2_PRIORITY }, - { IRL3_IRQ, 0, IRL3_IPR_POS, IRL3_PRIORITY }, -}; - -static unsigned long ipr_offsets[] = { - INTC_IPRD, -}; - -static struct ipr_desc ipr_irq_desc = { - .ipr_offsets = ipr_offsets, - .nr_offsets = ARRAY_SIZE(ipr_offsets), - - .ipr_data = ipr_irq_table, - .nr_irqs = ARRAY_SIZE(ipr_irq_table), - - .chip = { - .name = "IPR-snapgear", - }, -}; - static void __init init_snapgear_IRQ(void) { - /* enable individual interrupt mode for externals */ - ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR); - printk("Setup SnapGear IRQ/IPR ...\n"); - - register_ipr_controller(&ipr_irq_desc); + /* enable individual interrupt mode for externals */ + plat_irq_setup_pins(IRQ_MODE_IRQ); } /* --- 0001/arch/sh/boards/titan/setup.c +++ work/arch/sh/boards/titan/setup.c 2007-08-02 23:34:48.000000000 +0900 @@ -12,38 +12,10 @@ #include <asm/titan.h> #include <asm/io.h> -static struct ipr_data ipr_irq_table[] = { - /* IRQ, IPR idx, shift, prio */ - { TITAN_IRQ_WAN, 3, 12, 8 }, /* eth0 (WAN) */ - { TITAN_IRQ_LAN, 3, 8, 8 }, /* eth1 (LAN) */ - { TITAN_IRQ_MPCIA, 3, 4, 8 }, /* mPCI A (top) */ - { TITAN_IRQ_USB, 3, 0, 8 }, /* mPCI B (bottom), USB */ -}; - -static unsigned long ipr_offsets[] = { /* stolen from setup-sh7750.c */ - 0xffd00004UL, /* 0: IPRA */ - 0xffd00008UL, /* 1: IPRB */ - 0xffd0000cUL, /* 2: IPRC */ - 0xffd00010UL, /* 3: IPRD */ -}; - -static struct ipr_desc ipr_irq_desc = { - .ipr_offsets = ipr_offsets, - .nr_offsets = ARRAY_SIZE(ipr_offsets), - - .ipr_data = ipr_irq_table, - .nr_irqs = ARRAY_SIZE(ipr_irq_table), - - .chip = { - .name = "IPR-titan", - }, -}; static void __init init_titan_irq(void) { /* enable individual interrupt mode for externals */ - ipr_irq_enable_irlm(); - /* register ipr irqs */ - register_ipr_controller(&ipr_irq_desc); + plat_irq_setup_pins(IRQ_MODE_IRQ); } static struct sh_machine_vector mv_titan __initmv = { --- 0001/arch/sh/kernel/cpu/sh4/setup-sh7750.c +++ work/arch/sh/kernel/cpu/sh4/setup-sh7750.c 2007-08-02 23:34:48.000000000 +0900 @@ -282,13 +282,19 @@ void __init plat_irq_setup(void) #define INTC_ICR 0xffd00000UL #define INTC_ICR_IRLM (1<<7) -/* enable individual interrupt mode for external interupts */ -void __init ipr_irq_enable_irlm(void) +void __init plat_irq_setup_pins(int mode) { #if defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7091) BUG(); /* impossible to mask interrupts on SH7750 and SH7091 */ + return; #endif - register_intc_controller(&intc_desc_irlm); - ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR); + switch (mode) { + case IRQ_MODE_IRQ: /* individual interrupt mode for IRL3-0 */ + ctrl_outw(ctrl_inw(INTC_ICR) | INTC_ICR_IRLM, INTC_ICR); + register_intc_controller(&intc_desc_irlm); + break; + default: + BUG(); + } } --- 0005/include/asm-sh/hw_irq.h +++ work/include/asm-sh/hw_irq.h 2007-08-02 23:34:48.000000000 +0900 @@ -41,11 +41,6 @@ struct ipr_desc { void register_ipr_controller(struct ipr_desc *); -/* - * Enable individual interrupt mode for external IPR IRQs. - */ -void __init ipr_irq_enable_irlm(void); - typedef unsigned char intc_enum; struct intc_vect { --- 0001/include/asm-sh/sh03/io.h +++ work/include/asm-sh/sh03/io.h 2007-08-02 23:34:48.000000000 +0900 @@ -11,22 +11,13 @@ #include <linux/time.h> -#define INTC_IPRD 0xffd00010UL - #define IRL0_IRQ 2 -#define IRL0_IPR_POS 3 #define IRL0_PRIORITY 13 - #define IRL1_IRQ 5 -#define IRL1_IPR_POS 2 #define IRL1_PRIORITY 10 - #define IRL2_IRQ 8 -#define IRL2_IPR_POS 1 #define IRL2_PRIORITY 7 - #define IRL3_IRQ 11 -#define IRL3_IPR_POS 0 #define IRL3_PRIORITY 4 void heartbeat_sh03(void); --- 0001/include/asm-sh/snapgear.h +++ work/include/asm-sh/snapgear.h 2007-08-02 23:34:48.000000000 +0900 @@ -19,20 +19,16 @@ * is the interrupt :-) */ -#define IRL0_IRQ 2 -#define IRL0_IPR_POS 3 +#define IRL0_IRQ 2 #define IRL0_PRIORITY 13 -#define IRL1_IRQ 5 -#define IRL1_IPR_POS 2 +#define IRL1_IRQ 5 #define IRL1_PRIORITY 10 -#define IRL2_IRQ 8 -#define IRL2_IPR_POS 1 +#define IRL2_IRQ 8 #define IRL2_PRIORITY 7 -#define IRL3_IRQ 11 -#define IRL3_IPR_POS 0 +#define IRL3_IRQ 11 #define IRL3_PRIORITY 4 #endif |
From: Magnus D. <mag...@gm...> - 2007-08-02 15:12:35
|
sh: fix defconfigs for sh7751r boards This patch fixes up the defconfig for various sh7751r based boards by updating them to the single cpu subtype CONFIG_CPU_SUBTYPE_SH7751R. The following sh4 boards are updated: hs7751rvoip, landisk, lboxre2, snapgear, systemh, titan The current defconfigs with two subtypes defined trigger a configuration bug which result in kernel configurations with missing board support code. We end up with kernels without board code and with generic machvec only. So we need this patch to make sure the board code gets compiled in. Signed-off-by: Magnus Damm <da...@ig...> --- arch/sh/configs/hs7751rvoip_defconfig | 2 +- arch/sh/configs/landisk_defconfig | 2 +- arch/sh/configs/lboxre2_defconfig | 2 +- arch/sh/configs/snapgear_defconfig | 2 +- arch/sh/configs/systemh_defconfig | 2 +- arch/sh/configs/titan_defconfig | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) --- 0001/arch/sh/configs/hs7751rvoip_defconfig +++ work/arch/sh/configs/hs7751rvoip_defconfig 2007-08-02 23:27:00.000000000 +0900 @@ -145,7 +145,7 @@ CONFIG_CPU_SH4=y # CONFIG_CPU_SUBTYPE_SH7091 is not set # CONFIG_CPU_SUBTYPE_SH7750R is not set # CONFIG_CPU_SUBTYPE_SH7750S is not set -CONFIG_CPU_SUBTYPE_SH7751=y +# CONFIG_CPU_SUBTYPE_SH7751 is not set CONFIG_CPU_SUBTYPE_SH7751R=y # CONFIG_CPU_SUBTYPE_SH7760 is not set # CONFIG_CPU_SUBTYPE_SH4_202 is not set --- 0001/arch/sh/configs/landisk_defconfig +++ work/arch/sh/configs/landisk_defconfig 2007-08-02 23:22:52.000000000 +0900 @@ -156,7 +156,7 @@ CONFIG_CPU_SH4=y # CONFIG_CPU_SUBTYPE_SH7091 is not set # CONFIG_CPU_SUBTYPE_SH7750R is not set # CONFIG_CPU_SUBTYPE_SH7750S is not set -CONFIG_CPU_SUBTYPE_SH7751=y +# CONFIG_CPU_SUBTYPE_SH7751 is not set CONFIG_CPU_SUBTYPE_SH7751R=y # CONFIG_CPU_SUBTYPE_SH7760 is not set # CONFIG_CPU_SUBTYPE_SH4_202 is not set --- 0001/arch/sh/configs/lboxre2_defconfig +++ work/arch/sh/configs/lboxre2_defconfig 2007-08-02 23:17:22.000000000 +0900 @@ -159,7 +159,7 @@ CONFIG_CPU_SH4=y # CONFIG_CPU_SUBTYPE_SH7091 is not set # CONFIG_CPU_SUBTYPE_SH7750R is not set # CONFIG_CPU_SUBTYPE_SH7750S is not set -CONFIG_CPU_SUBTYPE_SH7751=y +# CONFIG_CPU_SUBTYPE_SH7751 is not set CONFIG_CPU_SUBTYPE_SH7751R=y # CONFIG_CPU_SUBTYPE_SH7760 is not set # CONFIG_CPU_SUBTYPE_SH4_202 is not set --- 0001/arch/sh/configs/snapgear_defconfig +++ work/arch/sh/configs/snapgear_defconfig 2007-08-02 23:02:46.000000000 +0900 @@ -138,7 +138,7 @@ CONFIG_CPU_SH4=y # CONFIG_CPU_SUBTYPE_SH7091 is not set # CONFIG_CPU_SUBTYPE_SH7750R is not set # CONFIG_CPU_SUBTYPE_SH7750S is not set -CONFIG_CPU_SUBTYPE_SH7751=y +# CONFIG_CPU_SUBTYPE_SH7751 is not set CONFIG_CPU_SUBTYPE_SH7751R=y # CONFIG_CPU_SUBTYPE_SH7760 is not set # CONFIG_CPU_SUBTYPE_SH4_202 is not set --- 0001/arch/sh/configs/systemh_defconfig +++ work/arch/sh/configs/systemh_defconfig 2007-08-02 23:06:43.000000000 +0900 @@ -141,7 +141,7 @@ CONFIG_CPU_SH4=y # CONFIG_CPU_SUBTYPE_SH7091 is not set # CONFIG_CPU_SUBTYPE_SH7750R is not set # CONFIG_CPU_SUBTYPE_SH7750S is not set -CONFIG_CPU_SUBTYPE_SH7751=y +# CONFIG_CPU_SUBTYPE_SH7751 is not set CONFIG_CPU_SUBTYPE_SH7751R=y # CONFIG_CPU_SUBTYPE_SH7760 is not set # CONFIG_CPU_SUBTYPE_SH4_202 is not set --- 0001/arch/sh/configs/titan_defconfig +++ work/arch/sh/configs/titan_defconfig 2007-08-02 23:02:46.000000000 +0900 @@ -147,7 +147,7 @@ CONFIG_CPU_SH4=y # CONFIG_CPU_SUBTYPE_SH7091 is not set # CONFIG_CPU_SUBTYPE_SH7750R is not set # CONFIG_CPU_SUBTYPE_SH7750S is not set -CONFIG_CPU_SUBTYPE_SH7751=y +# CONFIG_CPU_SUBTYPE_SH7751 is not set CONFIG_CPU_SUBTYPE_SH7751R=y # CONFIG_CPU_SUBTYPE_SH7760 is not set # CONFIG_CPU_SUBTYPE_SH4_202 is not set |
From: Magnus D. <mag...@gm...> - 2007-08-02 15:11:00
|
sh: fix cf support on r2d boards This patch makes sure cf support is enabled on R2D-PLUS but disabled on R2D-1. Without this fix R2D-1 boards hang on bootup. Signed-off-by: Magnus Damm <da...@ig...> --- arch/sh/boards/renesas/rts7751r2d/setup.c | 9 ++++++++- include/asm-sh/rts7751r2d.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) --- 0001/arch/sh/boards/renesas/rts7751r2d/setup.c +++ work/arch/sh/boards/renesas/rts7751r2d/setup.c 2007-08-02 20:01:13.000000000 +0900 @@ -140,12 +140,19 @@ static struct platform_device sm501_devi static struct platform_device *rts7751r2d_devices[] __initdata = { &uart_device, &heartbeat_device, - &cf_ide_device, &sm501_device, }; static int __init rts7751r2d_devices_setup(void) { + int ret; + + if (ctrl_inw(PA_BVERREG) == 0x10) { /* only working on R2D-PLUS */ + ret = platform_device_register(&cf_ide_device); + if (ret) + return ret; + } + return platform_add_devices(rts7751r2d_devices, ARRAY_SIZE(rts7751r2d_devices)); } --- 0001/include/asm-sh/rts7751r2d.h +++ work/include/asm-sh/rts7751r2d.h 2007-08-02 20:03:48.000000000 +0900 @@ -37,7 +37,7 @@ #define PA_VERREG 0xa4000032 /* FPGA Version Register */ #define PA_INPORT 0xa4000034 /* KEY Input Port control */ #define PA_OUTPORT 0xa4000036 /* LED control */ -#define PA_DMPORT 0xa4000038 /* DM270 Output Port control */ +#define PA_BVERREG 0xa4000038 /* Board Revision Register */ #define PA_AX88796L 0xaa000400 /* AX88796L Area */ #define PA_VOYAGER 0xab000000 /* VOYAGER GX Area */ |
From: Magnus D. <mag...@gm...> - 2007-08-02 15:09:21
|
sh: update r2d defconfig - Disable CONFIG_SH_DMA to avoid boot up freeze on R2D-1 - Disable CONFIG_SH_STANDARD_BIOS to support R2D-PLUS boot loaders Signed-off-by: Magnus Damm <da...@ig...> --- arch/sh/configs/rts7751r2d_defconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- 0001/arch/sh/configs/rts7751r2d_defconfig +++ work/arch/sh/configs/rts7751r2d_defconfig 2007-08-02 21:28:22.000000000 +0900 @@ -243,8 +243,8 @@ CONFIG_SH_PCLK_FREQ=60000000 # # DMA support # -CONFIG_SH_DMA=y -CONFIG_NR_ONCHIP_DMA_CHANNELS=8 +# CONFIG_SH_DMA is not set +# CONFIG_NR_ONCHIP_DMA_CHANNELS is not set # CONFIG_NR_DMA_CHANNELS_BOOL is not set # @@ -280,7 +280,7 @@ CONFIG_ZERO_PAGE_OFFSET=0x00010000 CONFIG_BOOT_LINK_OFFSET=0x00800000 # CONFIG_UBC_WAKEUP is not set CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 root=/dev/sda1 earlyprintk=bios" +CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 root=/dev/sda1 earlyprintk=serial" # # Bus options @@ -1323,7 +1323,7 @@ CONFIG_ENABLE_MUST_CHECK=y # CONFIG_DEBUG_KERNEL is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_DEBUG_BUGVERBOSE is not set -CONFIG_SH_STANDARD_BIOS=y +# CONFIG_SH_STANDARD_BIOS is not set CONFIG_EARLY_SCIF_CONSOLE=y CONFIG_EARLY_SCIF_CONSOLE_PORT=0xffe80000 CONFIG_EARLY_PRINTK=y |
From: Kristoffer E. <kri...@gm...> - 2007-08-01 19:41:30
|
Greetings, Wanted some expert input on this. We are having situations where things are working perfectly fine on hp680/690 while working badly on 620/660lx. Examples: New alsa sounddriver works perfectly fine on hp680/hp690 but not at all on 620/660 Pata platform driver works perfectly fine on hp680/hp690 while not at all on 620/660, we have solved this by doing polling instead. HP680/HP690 reports 7729 CPU, while 620/660 reports 7708. ? Any ideas anyone? Assume 7709 vs 7708 would this explain the issues? -- Kristoffer Ericson <Kri...@Gm...> |
From: EXTERNAL B. M. (P. ST-FIR/Eng) <ext...@de...> - 2007-08-01 15:12:41
|
Hi, I'm back again and reworking the SH7720 patch. Migration to the new INTC is nearly finished and the kernel boots successfuly. > The DMA API is in a bit of flux at the moment, we've got to revamp it > for the driver model and also for dmaengine integration.=20 ... > Yes, the UBC stuff is completely bitrotted.=20 ... > I'm hopeful Roland will get the remaining > issues sorted out for 2.6.24 or so so we can actually fix up the UBC > for once.=20 I will wait with this two parts until they are reworked. >> A small bug was fixed after line 367 rtc-sh.c. The comment already >> claimed to stop the RTC, but actually it was not done. This is not >> necessary for all CPUs, but at least for 7720 and 7705. >>=20 > Looks like an issue with the block version. I suppose we should > version it explicitly and keep the CPU selections in the Kconfig, > rather than having the driver turn in to ifdef hell. >=20 I will put this in a seperate patch. >> We tried to implement early printk but failed miserably. The >> scif_sercon_init function was never called. Any hints? >>=20 > scif_sercon_init() currently depends on SH-4, and will only be called > if you boot with earlyprintk=3Dserial, and have > CONFIG_EARLY_SCIF_CONSOLE set.=20 >=20 > Most platforms do not want any reinit of the ports for debug, we > generally just want to reuse the bootloader configuration and give the > kernel an idea of where an initialized port is in order to do the > early printk. >=20 I realised, that early_printk relies on SH4 and changed the code to work on SH3. The kernel command line was set up properly, too. So I don't have any clue why it=20 didn't work. I will have a look at this later, but the real scif driver works, so=20 it's not very important. > kgdb is being replaced with the unified stub, which is currently in > -mm. You may want to look at that and see if it works for you. I've > identified a few problems with it that I've hacked some patches up > for, but I've not had the time to finish those up and get them to > Andrew yet. I'll try and do that if you're interested in this. I will try -mm when I've time, but I'm glad to hear real kgdb support is on ist way >=20 >> Ethernet NFS performance is pretty bad (about 500 kB/s). I have not >> done any research on this yet. >>=20 > This is pretty normal when the sense selection on the IRQ is wrong. > It's especially common for edge-triggered smc91x chips when the > IPR/INTC2 code does level sensing. The INTC stuff from Magnus > provides the proper hooks for getting all of this tidied up and > hooked up for your CPU, I'd suggest looking at that first. I have a smsc9115 (smc911x) which only handles level irqs. The INTC code seems to be a much cleaner solution than the old one. I already migrated the IPR=20 Interrupts and will take a closer look at the sens selection tomorrow. Regards Markus |
From: Paul M. <le...@li...> - 2007-08-01 03:44:52
|
On Wed, Aug 01, 2007 at 12:24:33PM +0900, Magnus Damm wrote: > sh: intc - add support for x3 > > This patch converts the cpu specific interrupt setup code for x3 from intc2 > to intc. New vectors are also added to match the preliminary information. > I suppose we'll have to hook up the IPI vectors later.. > + INTC_GROUP(DTU0, DTU0_TEND, DTU0_AE, DTU0_TMISS), > + INTC_GROUP(DTU1, DTU1_TEND, DTU1_AE, DTU1_TMISS), > + INTC_GROUP(DTU2, DTU1_TEND, DTU2_AE, DTU2_TMISS), > + INTC_GROUP(DTU3, DTU1_TEND, DTU3_AE, DTU3_TMISS), Careful here, you obviously wanted DTU2_TEND and DTU3_TEND. I've got them fixed up locally, so I'll just merge those bits from my working tree. Looks like a good start otherwise. The next items for this are probably going to be IPI vectors, handling the processor IDs as a relative offset for the mask regs, and then finally the hardware auto-balancing. Also not that we can't poke at the offline CPUs register space until they've been released from their reset vector, this might need a bit of thinking for guarding against CPU hotplug in how INTC chooses to handle things in SMP mode. The current assumption from the loader is that the boot CPU is always CPU#0, but I'd also like to avoid making this assumption in the code in as many places as possible, in the event where CPU#0 is otherwise constrained. I'll queue it up, thanks. |
From: Magnus D. <mag...@gm...> - 2007-08-01 03:32:46
|
sh: intc - fix IRQ4 and IRQ5 typo on sh3 The intc tables for sh3 currently contain a typo where the bit fields in IPRD are mixed up for IRQ4 and IRQ5. This patch makes sure the correct bit fields are used - all according to the datasheets. Signed-off-by: Magnus Damm <da...@ig...> --- arch/sh/kernel/cpu/sh3/setup-sh7705.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh770x.c | 2 +- arch/sh/kernel/cpu/sh3/setup-sh7710.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) --- 0001/arch/sh/kernel/cpu/sh3/setup-sh7705.c +++ work/arch/sh/kernel/cpu/sh3/setup-sh7705.c 2007-07-31 15:17:02.000000000 +0900 @@ -75,7 +75,7 @@ static struct intc_prio_reg prio_registe { 0xfffffee2, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, { 0xfffffee4, 16, 4, /* IPRB */ { WDT, REF_RCMI, 0, 0 } }, { 0xa4000016, 16, 4, /* IPRC */ { IRQ3, IRQ2, IRQ1, IRQ0 } }, - { 0xa4000018, 16, 4, /* IPRD */ { PINT07, PINT815, IRQ4, IRQ5 } }, + { 0xa4000018, 16, 4, /* IPRD */ { PINT07, PINT815, IRQ5, IRQ4 } }, { 0xa400001a, 16, 4, /* IPRE */ { DMAC, SCIF0, SCIF2, ADC_ADI } }, { 0xa4080000, 16, 4, /* IPRF */ { 0, 0, USB } }, { 0xa4080002, 16, 4, /* IPRG */ { TPU0, TPU1 } }, --- 0001/arch/sh/kernel/cpu/sh3/setup-sh770x.c +++ work/arch/sh/kernel/cpu/sh3/setup-sh770x.c 2007-07-31 15:15:25.000000000 +0900 @@ -95,7 +95,7 @@ static struct intc_prio_reg prio_registe defined(CONFIG_CPU_SUBTYPE_SH7707) || \ defined(CONFIG_CPU_SUBTYPE_SH7709) { 0xa4000016, 16, 4, /* IPRC */ { IRQ3, IRQ2, IRQ1, IRQ0 } }, - { 0xa4000018, 16, 4, /* IPRD */ { 0, 0, IRQ4, IRQ5 } }, + { 0xa4000018, 16, 4, /* IPRD */ { 0, 0, IRQ5, IRQ4 } }, { 0xa400001a, 16, 4, /* IPRE */ { DMAC, 0, SCIF2, ADC_ADI } }, #endif #if defined(CONFIG_CPU_SUBTYPE_SH7707) || \ --- 0001/arch/sh/kernel/cpu/sh3/setup-sh7710.c +++ work/arch/sh/kernel/cpu/sh3/setup-sh7710.c 2007-07-31 15:20:05.000000000 +0900 @@ -88,7 +88,7 @@ static struct intc_prio_reg prio_registe { 0xfffffee2, 16, 4, /* IPRA */ { TMU0, TMU1, TMU2, RTC } }, { 0xfffffee4, 16, 4, /* IPRB */ { WDT, REF, 0, 0 } }, { 0xa4000016, 16, 4, /* IPRC */ { IRQ3, IRQ2, IRQ1, IRQ0 } }, - { 0xa4000018, 16, 4, /* IPRD */ { 0, 0, IRQ4, IRQ5 } }, + { 0xa4000018, 16, 4, /* IPRD */ { 0, 0, IRQ5, IRQ4 } }, { 0xa400001a, 16, 4, /* IPRE */ { DMAC1, SCIF0, SCIF1 } }, { 0xa4080000, 16, 4, /* IPRF */ { 0, DMAC2 } }, #ifdef CONFIG_CPU_SUBTYPE_SH7710 |
From: Magnus D. <mag...@gm...> - 2007-08-01 03:25:38
|
sh: intc - add support for x3 This patch converts the cpu specific interrupt setup code for x3 from intc2 to intc. New vectors are also added to match the preliminary information. Use plat_irq_setup_pins() to select between IRQ and IRL mode for IRQ0-3. Signed-off-by: Magnus Damm <da...@ig...> --- arch/sh/kernel/cpu/sh4a/setup-shx3.c | 216 ++++++++++++++++++++++++++++++---- arch/sh/mm/Kconfig | 2 2 files changed, 197 insertions(+), 21 deletions(-) --- 0001/arch/sh/kernel/cpu/sh4a/setup-shx3.c +++ work/arch/sh/kernel/cpu/sh4a/setup-shx3.c 2007-07-31 14:51:37.000000000 +0900 @@ -58,28 +58,204 @@ static int __init shx3_devices_setup(voi } __initcall(shx3_devices_setup); -static struct intc2_data intc2_irq_table[] = { - { 16, 0, 0, 0, 1, 2 }, /* TMU0 */ - { 40, 4, 0, 0x20, 0, 3 }, /* SCIF0 ERI */ - { 41, 4, 0, 0x20, 1, 3 }, /* SCIF0 RXI */ - { 42, 4, 0, 0x20, 2, 3 }, /* SCIF0 BRI */ - { 43, 4, 0, 0x20, 3, 3 }, /* SCIF0 TXI */ -}; - -static struct intc2_desc intc2_irq_desc __read_mostly = { - .prio_base = 0xfe410000, - .msk_base = 0xfe410820, - .mskclr_base = 0xfe410850, - - .intc2_data = intc2_irq_table, - .nr_irqs = ARRAY_SIZE(intc2_irq_table), - - .chip = { - .name = "INTC2-SHX3", - }, +enum { + UNUSED = 0, + + /* interrupt sources */ + + IRL_LLLL, IRL_LLLH, IRL_LLHL, IRL_LLHH, + IRL_LHLL, IRL_LHLH, IRL_LHHL, IRL_LHHH, + IRL_HLLL, IRL_HLLH, IRL_HLHL, IRL_HLHH, + IRL_HHLL, IRL_HHLH, IRL_HHHL, + IRQ0, IRQ1, IRQ2, IRQ3, + HUDII, + TMU0, TMU1, TMU2, TMU3, TMU4, TMU5, + PCII0, PCII1, PCII2, PCII3, PCII4, + PCII5, PCII6, PCII7, PCII8, PCII9, + SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI, + SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI, + SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI, + SCIF3_ERI, SCIF3_RXI, SCIF3_BRI, SCIF3_TXI, + DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2, DMAC0_DMINT3, + DMAC0_DMINT4, DMAC0_DMINT5, DMAC0_DMAE, + DU, + DMAC1_DMINT6, DMAC1_DMINT7, DMAC1_DMINT8, DMAC1_DMINT9, + DMAC1_DMINT10, DMAC1_DMINT11, DMAC1_DMAE, + IIC, VIN0, VIN1, VCORE0, ATAPI, + DTU0_TEND, DTU0_AE, DTU0_TMISS, + DTU1_TEND, DTU1_AE, DTU1_TMISS, + DTU2_TEND, DTU2_AE, DTU2_TMISS, + DTU3_TEND, DTU3_AE, DTU3_TMISS, + FE0, FE1, + GPIO0, GPIO1, GPIO2, GPIO3, + PAM, IRM, + + /* interrupt groups */ + + IRL, PCII56789, SCIF0, SCIF1, SCIF2, SCIF3, + DMAC0, DMAC1, DTU0, DTU1, DTU2, DTU3, +}; + +static struct intc_vect vectors[] = { + INTC_VECT(HUDII, 0x3e0), + INTC_VECT(TMU0, 0x400), INTC_VECT(TMU1, 0x420), + INTC_VECT(TMU2, 0x440), INTC_VECT(TMU3, 0x460), + INTC_VECT(TMU4, 0x480), INTC_VECT(TMU5, 0x4a0), + INTC_VECT(PCII0, 0x500), INTC_VECT(PCII1, 0x520), + INTC_VECT(PCII2, 0x540), INTC_VECT(PCII3, 0x560), + INTC_VECT(PCII4, 0x580), INTC_VECT(PCII5, 0x5a0), + INTC_VECT(PCII6, 0x5c0), INTC_VECT(PCII7, 0x5e0), + INTC_VECT(PCII8, 0x600), INTC_VECT(PCII9, 0x620), + INTC_VECT(SCIF0_ERI, 0x700), INTC_VECT(SCIF0_RXI, 0x720), + INTC_VECT(SCIF0_BRI, 0x740), INTC_VECT(SCIF0_TXI, 0x760), + INTC_VECT(SCIF1_ERI, 0x780), INTC_VECT(SCIF1_RXI, 0x7a0), + INTC_VECT(SCIF1_BRI, 0x7c0), INTC_VECT(SCIF1_TXI, 0x7e0), + INTC_VECT(SCIF2_ERI, 0x800), INTC_VECT(SCIF2_RXI, 0x820), + INTC_VECT(SCIF2_BRI, 0x840), INTC_VECT(SCIF2_TXI, 0x860), + INTC_VECT(SCIF3_ERI, 0x880), INTC_VECT(SCIF3_RXI, 0x8a0), + INTC_VECT(SCIF3_BRI, 0x8c0), INTC_VECT(SCIF3_TXI, 0x8e0), + INTC_VECT(DMAC0_DMINT0, 0x900), INTC_VECT(DMAC0_DMINT1, 0x920), + INTC_VECT(DMAC0_DMINT2, 0x940), INTC_VECT(DMAC0_DMINT3, 0x960), + INTC_VECT(DMAC0_DMINT4, 0x980), INTC_VECT(DMAC0_DMINT5, 0x9a0), + INTC_VECT(DMAC0_DMAE, 0x9c0), + INTC_VECT(DU, 0x9e0), + INTC_VECT(DMAC1_DMINT6, 0xa00), INTC_VECT(DMAC1_DMINT7, 0xa20), + INTC_VECT(DMAC1_DMINT8, 0xa40), INTC_VECT(DMAC1_DMINT9, 0xa60), + INTC_VECT(DMAC1_DMINT10, 0xa80), INTC_VECT(DMAC1_DMINT11, 0xaa0), + INTC_VECT(DMAC1_DMAE, 0xac0), + INTC_VECT(IIC, 0xae0), + INTC_VECT(VIN0, 0xb00), INTC_VECT(VIN1, 0xb20), + INTC_VECT(VCORE0, 0xb00), INTC_VECT(ATAPI, 0xb60), + INTC_VECT(DTU0_TEND, 0xc00), INTC_VECT(DTU0_AE, 0xc20), + INTC_VECT(DTU0_TMISS, 0xc40), + INTC_VECT(DTU1_TEND, 0xc60), INTC_VECT(DTU1_AE, 0xc80), + INTC_VECT(DTU1_TMISS, 0xca0), + INTC_VECT(DTU2_TEND, 0xcc0), INTC_VECT(DTU2_AE, 0xce0), + INTC_VECT(DTU2_TMISS, 0xd00), + INTC_VECT(DTU3_TEND, 0xd20), INTC_VECT(DTU3_AE, 0xd40), + INTC_VECT(DTU3_TMISS, 0xd60), + INTC_VECT(FE0, 0xe00), INTC_VECT(FE1, 0xe20), + INTC_VECT(GPIO0, 0xe40), INTC_VECT(GPIO1, 0xe60), + INTC_VECT(GPIO2, 0xe80), INTC_VECT(GPIO3, 0xea0), + INTC_VECT(PAM, 0xec0), INTC_VECT(IRM, 0xee0), +}; + +static struct intc_group groups[] = { + INTC_GROUP(IRL, IRL_LLLL, IRL_LLLH, IRL_LLHL, IRL_LLHH, + IRL_LHLL, IRL_LHLH, IRL_LHHL, IRL_LHHH, + IRL_HLLL, IRL_HLLH, IRL_HLHL, IRL_HLHH, + IRL_HHLL, IRL_HHLH, IRL_HHHL), + INTC_GROUP(PCII56789, PCII5, PCII6, PCII7, PCII8, PCII9), + INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI), + INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI), + INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI), + INTC_GROUP(SCIF3, SCIF3_ERI, SCIF3_RXI, SCIF3_BRI, SCIF3_TXI), + INTC_GROUP(DMAC0, DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2, + DMAC0_DMINT3, DMAC0_DMINT4, DMAC0_DMINT5, DMAC0_DMAE), + INTC_GROUP(DMAC1, DMAC1_DMINT6, DMAC1_DMINT7, DMAC1_DMINT8, + DMAC1_DMINT9, DMAC1_DMINT10, DMAC1_DMINT11), + INTC_GROUP(DTU0, DTU0_TEND, DTU0_AE, DTU0_TMISS), + INTC_GROUP(DTU1, DTU1_TEND, DTU1_AE, DTU1_TMISS), + INTC_GROUP(DTU2, DTU1_TEND, DTU2_AE, DTU2_TMISS), + INTC_GROUP(DTU3, DTU1_TEND, DTU3_AE, DTU3_TMISS), +}; + +static struct intc_prio priorities[] = { + INTC_PRIO(SCIF0, 3), + INTC_PRIO(SCIF1, 3), + INTC_PRIO(SCIF2, 3), + INTC_PRIO(SCIF3, 3), +}; + +static struct intc_mask_reg mask_registers[] = { + { 0xfe410030, 0xfe410050, 32, /* CnINTMSK0 / CnINTMSKCLR0 */ + { IRQ0, IRQ1, IRQ2, IRQ3 } }, + { 0xfe410040, 0xfe410060, 32, /* CnINTMSK1 / CnINTMSKCLR1 */ + { IRL } }, + { 0xfe410820, 0xfe410850, 32, /* CnINT2MSK0 / CnINT2MSKCLR0 */ + { FE1, FE0, 0, ATAPI, VCORE0, VIN1, VIN0, IIC, + DU, GPIO3, GPIO2, GPIO1, GPIO0, PAM, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, /* HUDI bits ignored */ + 0, TMU5, TMU4, TMU3, TMU2, TMU1, TMU0, 0, } }, + { 0xfe410830, 0xfe410860, 32, /* CnINT2MSK1 / CnINT2MSKCLR1 */ + { 0, 0, 0, 0, DTU3, DTU2, DTU1, DTU0, /* IRM bits ignored */ + PCII9, PCII8, PCII7, PCII6, PCII5, PCII4, PCII3, PCII2, + PCII1, PCII0, DMAC1_DMAE, DMAC1_DMINT11, + DMAC1_DMINT10, DMAC1_DMINT9, DMAC1_DMINT8, DMAC1_DMINT7, + DMAC1_DMINT6, DMAC0_DMAE, DMAC0_DMINT5, DMAC0_DMINT4, + DMAC0_DMINT3, DMAC0_DMINT2, DMAC0_DMINT1, DMAC0_DMINT0 } }, + { 0xfe410840, 0xfe410870, 32, /* CnINT2MSK2 / CnINT2MSKCLR2 */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + SCIF3_TXI, SCIF3_BRI, SCIF3_RXI, SCIF3_ERI, + SCIF2_TXI, SCIF2_BRI, SCIF2_RXI, SCIF2_ERI, + SCIF1_TXI, SCIF1_BRI, SCIF1_RXI, SCIF1_ERI, + SCIF0_TXI, SCIF0_BRI, SCIF0_RXI, SCIF0_ERI } }, +}; + +static struct intc_prio_reg prio_registers[] = { + { 0xfe410010, 32, 4, /* INTPRI */ { IRQ0, IRQ1, IRQ2, IRQ3 } }, + + { 0xfe410800, 32, 4, /* INT2PRI0 */ { 0, HUDII, TMU5, TMU4, + TMU3, TMU2, TMU1, TMU0 } }, + { 0xfe410804, 32, 4, /* INT2PRI1 */ { DTU3, DTU2, DTU1, DTU0, + SCIF3, SCIF2, SCIF1, SCIF0 } }, + { 0xfe410808, 32, 4, /* INT2PRI2 */ { DMAC1, DMAC0, PCII56789, PCII4, + PCII3, PCII2, PCII1, PCII0 } }, + { 0xfe41080c, 32, 4, /* INT2PRI3 */ { FE1, FE0, ATAPI, VCORE0, + VIN1, VIN0, IIC, DU} }, + { 0xfe410810, 32, 4, /* INT2PRI4 */ { 0, 0, PAM, GPIO3, + GPIO2, GPIO1, GPIO0, IRM } }, }; +static DECLARE_INTC_DESC(intc_desc, "shx3", vectors, groups, priorities, + mask_registers, prio_registers, NULL); + +/* Support for external interrupt pins in IRQ mode */ + +static struct intc_vect vectors_irq[] = { + INTC_VECT(IRQ0, 0x240), INTC_VECT(IRQ1, 0x280), + INTC_VECT(IRQ2, 0x2c0), INTC_VECT(IRQ3, 0x300), +}; + +static struct intc_sense_reg sense_registers[] = { + { 0xfe41001c, 32, 2, /* ICR1 */ { IRQ0, IRQ1, IRQ2, IRQ3 } }, +}; + +static DECLARE_INTC_DESC(intc_desc_irq, "shx3-irq", vectors_irq, groups, + priorities, mask_registers, prio_registers, + sense_registers); + +/* External interrupt pins in IRL mode */ + +static struct intc_vect vectors_irl[] = { + INTC_VECT(IRL_LLLL, 0x200), INTC_VECT(IRL_LLLH, 0x220), + INTC_VECT(IRL_LLHL, 0x240), INTC_VECT(IRL_LLHH, 0x260), + INTC_VECT(IRL_LHLL, 0x280), INTC_VECT(IRL_LHLH, 0x2a0), + INTC_VECT(IRL_LHHL, 0x2c0), INTC_VECT(IRL_LHHH, 0x2e0), + INTC_VECT(IRL_HLLL, 0x300), INTC_VECT(IRL_HLLH, 0x320), + INTC_VECT(IRL_HLHL, 0x340), INTC_VECT(IRL_HLHH, 0x360), + INTC_VECT(IRL_HHLL, 0x380), INTC_VECT(IRL_HHLH, 0x3a0), + INTC_VECT(IRL_HHHL, 0x3c0), +}; + +static DECLARE_INTC_DESC(intc_desc_irl, "shx3-irl", vectors_irl, groups, + priorities, mask_registers, prio_registers, NULL); + +void __init plat_irq_setup_pins(int mode) +{ + switch (mode) { + case IRQ_MODE_IRQ: + register_intc_controller(&intc_desc_irq); + break; + case IRQ_MODE_IRL3210: + register_intc_controller(&intc_desc_irl); + break; + default: + BUG(); + } +} + void __init plat_irq_setup(void) { - register_intc2_controller(&intc2_irq_desc); + register_intc_controller(&intc_desc); } --- 0003/arch/sh/mm/Kconfig +++ work/arch/sh/mm/Kconfig 2007-07-31 12:52:53.000000000 +0900 @@ -198,7 +198,7 @@ config CPU_SUBTYPE_SHX3 bool "Support SH-X3 processor" select CPU_SH4A select CPU_SHX3 - select CPU_HAS_INTC2_IRQ + select CPU_HAS_INTC_IRQ # SH4AL-DSP Processor Support |
From: Manuel L. <ma...@ro...> - 2007-07-31 04:41:15
|
On Tue, Jul 31, 2007 at 07:22:14AM +0900, Paul Mundt wrote: > On Mon, Jul 30, 2007 at 07:30:42PM +0900, Magnus Damm wrote: > > sh: intc - add support for SH7760 V2 > > > > This patch converts the cpu specific interrupt setup code for sh7760 from > > ipr + intc2 to intc. New vectors are also added to match the information > > provided by the datasheet. > > > > Vectors for IRQ4-IRQ7 are enabled by default. Use plat_irq_setup_pins() if > > pins IRL0-3 should be used in IRLM mode. > > > > The patch also adds the SIM block to the serial port platform data. > > Version two of this patch fixes MMCIF problems reported by Manuel Lauss. > > > > Signed-off-by: Magnus Damm <da...@ig...> > > Manuel, can you add an Acked-by for this if it works for you and there > are no other visible regressions on your platform? I'll add it to the > 2.6.24 queue then, thanks. I see no problems with it, so: Acked-by: Manuel Lauss <ma...@ro...> Thanks, Manuel Lauss |
From: Paul M. <le...@li...> - 2007-07-30 22:22:58
|
On Mon, Jul 30, 2007 at 07:30:42PM +0900, Magnus Damm wrote: > sh: intc - add support for SH7760 V2 > > This patch converts the cpu specific interrupt setup code for sh7760 from > ipr + intc2 to intc. New vectors are also added to match the information > provided by the datasheet. > > Vectors for IRQ4-IRQ7 are enabled by default. Use plat_irq_setup_pins() if > pins IRL0-3 should be used in IRLM mode. > > The patch also adds the SIM block to the serial port platform data. > Version two of this patch fixes MMCIF problems reported by Manuel Lauss. > > Signed-off-by: Magnus Damm <da...@ig...> Manuel, can you add an Acked-by for this if it works for you and there are no other visible regressions on your platform? I'll add it to the 2.6.24 queue then, thanks. |