From 5e0fa3f63eda875cbe23be37d64a16c65a577209 Mon Sep 17 00:00:00 2001 From: Stanislav Brabec Date: Thu, 22 Oct 2009 23:05:03 +0200 Subject: [ARM] pxa/zaurus: fix NAND flash OOB layout for Borzoi Borzoi, Terrier and Akita use the same NAND Flash OOB layout, which seems to be different from Spitz for some reason. Here is a fix. When the code was ported to the platform data, the map was applied just for Akita. After this patch, Flash works again on Borzoi. Terrier still has a problem with partition table different from Borzoi (unfixable without reading of the system configuration in flash) and JFFS2 partitions can be mounted (with some "Empty flash at ... ends at ..." in the syslog). Signed-off-by: Stanislav Brabec Acked-by: Richard Purdie Signed-off-by: Eric Miao --- arch/arm/mach-pxa/spitz.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 82ff5733e4d..3da45d05174 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -779,11 +779,34 @@ static void __init common_init(void) pxa_set_i2c_info(NULL); } +#if defined(CONFIG_MACH_AKITA) || defined(CONFIG_MACH_BORZOI) +static struct nand_bbt_descr sharpsl_akita_bbt = { + .options = 0, + .offs = 4, + .len = 1, + .pattern = scan_ff_pattern +}; + +static struct nand_ecclayout akita_oobinfo = { + .eccbytes = 24, + .eccpos = { + 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11, + 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23, + 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37}, + .oobfree = {{0x08, 0x09}} +}; +#endif + #if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI) static void __init spitz_init(void) { spitz_ficp_platform_data.gpio_pwdown = SPITZ_GPIO_IR_ON; + if (machine_is_borzoi()) { + sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt; + sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo; + } + platform_scoop_config = &spitz_pcmcia_config; common_init(); @@ -808,22 +831,6 @@ static struct i2c_board_info akita_i2c_board_info[] = { }, }; -static struct nand_bbt_descr sharpsl_akita_bbt = { - .options = 0, - .offs = 4, - .len = 1, - .pattern = scan_ff_pattern -}; - -static struct nand_ecclayout akita_oobinfo = { - .eccbytes = 24, - .eccpos = { - 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11, - 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23, - 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37}, - .oobfree = {{0x08, 0x09}} -}; - static void __init akita_init(void) { spitz_ficp_platform_data.gpio_pwdown = AKITA_GPIO_IR_ON; -- cgit v1.2.3 From 902805dbdae016653768f7139d7b3ab36a20cc6d Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 26 Oct 2009 23:59:30 +0100 Subject: [ARM] pxa/palm: fix incorrect initialization of Palm Tungsten C keyboard Palm Tungsten C keyboard structure has swapped rows/cols gpio structures and does not work. This patch fixes it. Signed-off-by: Ondrej Zajicek Cc: Marek Vasut Signed-off-by: Eric Miao --- arch/arm/mach-pxa/palmtc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c index bb2cc0dd44e..0b92291a58f 100644 --- a/arch/arm/mach-pxa/palmtc.c +++ b/arch/arm/mach-pxa/palmtc.c @@ -292,10 +292,10 @@ const static unsigned int palmtc_keypad_col_gpios[] = { static struct matrix_keypad_platform_data palmtc_keypad_platform_data = { .keymap_data = &palmtc_keymap_data, - .col_gpios = palmtc_keypad_row_gpios, - .num_col_gpios = 12, - .row_gpios = palmtc_keypad_col_gpios, - .num_row_gpios = 4, + .row_gpios = palmtc_keypad_row_gpios, + .num_row_gpios = ARRAY_SIZE(palmtc_keypad_row_gpios), + .col_gpios = palmtc_keypad_col_gpios, + .num_col_gpios = ARRAY_SIZE(palmtc_keypad_col_gpios), .active_low = 1, .debounce_ms = 20, -- cgit v1.2.3 From c482ae4dcf23fd241321595d71bbe8aee33eabf5 Mon Sep 17 00:00:00 2001 From: Haojian Zhuang Date: Mon, 2 Nov 2009 14:02:21 -0500 Subject: [ARM] pxa: fix resume failure by saving/restoring IPRx registers Since interrupt handler is changed to use interrupt priority, we also need to save and restore these interrupt controller registers in suspend/resume routine. Signed-off-by: Haojian Zhuang Tested-by: Daniel Mack Tested-by: Pavel Machek Tested-by: Robert Jarzmik Acked-by: Pavel Machek Signed-off-by: Eric Miao --- arch/arm/mach-pxa/irq.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index d694ce28966..6112af431fa 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c @@ -25,6 +25,8 @@ #include "generic.h" +#define MAX_INTERNAL_IRQS 128 + #define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f) #define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR)) #define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR)) @@ -122,6 +124,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn) { int irq, i; + BUG_ON(irq_nr > MAX_INTERNAL_IRQS); + pxa_internal_irq_nr = irq_nr; for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) { @@ -149,7 +153,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn) } #ifdef CONFIG_PM -static unsigned long saved_icmr[2]; +static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32]; +static unsigned long saved_ipr[MAX_INTERNAL_IRQS]; static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) { @@ -159,6 +164,8 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) saved_icmr[i] = _ICMR(irq); _ICMR(irq) = 0; } + for (i = 0; i < pxa_internal_irq_nr; i++) + saved_ipr[i] = IPR(i); return 0; } @@ -171,6 +178,8 @@ static int pxa_irq_resume(struct sys_device *dev) _ICMR(irq) = saved_icmr[i]; _ICLR(irq) = 0; } + for (i = 0; i < pxa_internal_irq_nr; i++) + IPR(i) = saved_ipr[i]; ICCR = 1; return 0; -- cgit v1.2.3