From 6fafbae869958f687447951024faeb87afcc8b94 Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 3 Feb 2012 19:03:31 +0000 Subject: [PATCH] --- yaml --- r: 296288 b: refs/heads/master c: 29c140b623ce2c55131c6d1c26a2f3e455723b81 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/common/sa1111.c | 10 + trunk/arch/arm/mach-sa1100/assabet.c | 39 +- trunk/arch/arm/mach-sa1100/badge4.c | 19 +- trunk/arch/arm/mach-sa1100/cerf.c | 13 +- trunk/arch/arm/mach-sa1100/collie.c | 24 +- trunk/arch/arm/mach-sa1100/generic.c | 97 +++- trunk/arch/arm/mach-sa1100/h3xxx.c | 13 +- trunk/arch/arm/mach-sa1100/hackkit.c | 7 +- .../arch/arm/mach-sa1100/include/mach/irqs.h | 8 + .../arm/mach-sa1100/include/mach/neponset.h | 52 +- trunk/arch/arm/mach-sa1100/irq.c | 7 +- trunk/arch/arm/mach-sa1100/jornada720.c | 33 +- trunk/arch/arm/mach-sa1100/nanoengine.c | 11 +- trunk/arch/arm/mach-sa1100/neponset.c | 534 +++++++----------- trunk/arch/arm/mach-sa1100/pci-nanoengine.c | 8 +- trunk/arch/arm/mach-sa1100/pleb.c | 24 +- trunk/arch/arm/mach-sa1100/shannon.c | 7 +- trunk/arch/arm/mach-sa1100/simpad.c | 11 +- trunk/arch/arm/mach-sa1100/sleep.S | 37 +- trunk/drivers/net/ethernet/smsc/smc91x.c | 2 +- trunk/drivers/pcmcia/sa1100_neponset.c | 7 +- 22 files changed, 537 insertions(+), 428 deletions(-) diff --git a/[refs] b/[refs] index 49be169241b8..29205c743571 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fbae0f8912dc12b284433c05417ea76311205bbf +refs/heads/master: 29c140b623ce2c55131c6d1c26a2f3e455723b81 diff --git a/trunk/arch/arm/common/sa1111.c b/trunk/arch/arm/common/sa1111.c index bf508a78aa33..c7bed309b3aa 100644 --- a/trunk/arch/arm/common/sa1111.c +++ b/trunk/arch/arm/common/sa1111.c @@ -88,6 +88,7 @@ #define IRQ_S1_BVD1_STSCHG (54) extern void sa1110_mb_enable(void); +extern void sa1110_mb_disable(void); /* * We keep the following data for the overall SA1111. Note that the @@ -926,6 +927,10 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state) spin_unlock_irqrestore(&sachip->lock, flags); +#ifdef CONFIG_ARCH_SA1100 + sa1110_mb_disable(); +#endif + return 0; } @@ -966,6 +971,11 @@ static int sa1111_resume(struct platform_device *dev) */ sa1111_wake(sachip); +#ifdef CONFIG_ARCH_SA1100 + /* Enable the memory bus request/grant signals */ + sa1110_mb_enable(); +#endif + /* * Only lock for write ops. Also, sa1111_wake must be called with * released spinlock! diff --git a/trunk/arch/arm/mach-sa1100/assabet.c b/trunk/arch/arm/mach-sa1100/assabet.c index f2030bc22cde..0c4b76ab4d8e 100644 --- a/trunk/arch/arm/mach-sa1100/assabet.c +++ b/trunk/arch/arm/mach-sa1100/assabet.c @@ -40,13 +40,13 @@ #include "generic.h" #define ASSABET_BCR_DB1110 \ - (ASSABET_BCR_SPK_OFF | \ + (ASSABET_BCR_SPK_OFF | ASSABET_BCR_QMUTE | \ ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \ ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \ ASSABET_BCR_IRDA_MD0) #define ASSABET_BCR_DB1111 \ - (ASSABET_BCR_SPK_OFF | \ + (ASSABET_BCR_SPK_OFF | ASSABET_BCR_QMUTE | \ ASSABET_BCR_LED_GREEN | ASSABET_BCR_LED_RED | \ ASSABET_BCR_RS232EN | ASSABET_BCR_LCD_12RGB | \ ASSABET_BCR_CF_BUS_OFF | ASSABET_BCR_STEREO_LB | \ @@ -152,8 +152,15 @@ static struct flash_platform_data assabet_flash_data = { }; static struct resource assabet_flash_resources[] = { - DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M), - DEFINE_RES_MEM(SA1100_CS1_PHYS, SZ_32M), + { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, + }, { + .start = SA1100_CS1_PHYS, + .end = SA1100_CS1_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, + } }; @@ -197,22 +204,13 @@ static struct mcp_plat_data assabet_mcp_data = { .sclk_rate = 11981000, }; -#ifdef CONFIG_ASSABET_NEPONSET -static struct resource neponset_resources[] = { - DEFINE_RES_MEM(0x10000000, 0x08000000), - DEFINE_RES_MEM(0x18000000, 0x04000000), - DEFINE_RES_MEM(0x40000000, SZ_8K), - DEFINE_RES_IRQ(IRQ_GPIO25), -}; -#endif - static void __init assabet_init(void) { /* * Ensure that the power supply is in "high power" mode. */ - GPSR = GPIO_GPIO16; GPDR |= GPIO_GPIO16; + GPSR = GPIO_GPIO16; /* * Ensure that these pins are set as outputs and are driving @@ -220,16 +218,8 @@ static void __init assabet_init(void) * the WS latch in the CPLD, and we don't float causing * excessive power drain. --rmk */ - GPCR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM; GPDR |= GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM; - - /* - * Also set GPIO27 as an output; this is used to clock UART3 - * via the FPGA and as otherwise has no pullups or pulldowns, - * so stop it floating. - */ - GPCR = GPIO_GPIO27; - GPDR |= GPIO_GPIO27; + GPCR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM; /* * Set up registers for sleep mode. @@ -256,9 +246,6 @@ static void __init assabet_init(void) #ifndef CONFIG_ASSABET_NEPONSET printk( "Warning: Neponset detected but full support " "hasn't been configured in the kernel\n" ); -#else - platform_device_register_simple("neponset", 0, - neponset_resources, ARRAY_SIZE(neponset_resources)); #endif } diff --git a/trunk/arch/arm/mach-sa1100/badge4.c b/trunk/arch/arm/mach-sa1100/badge4.c index ce2dbdf4ba1a..b07a2c024cb7 100644 --- a/trunk/arch/arm/mach-sa1100/badge4.c +++ b/trunk/arch/arm/mach-sa1100/badge4.c @@ -39,8 +39,16 @@ #include "generic.h" static struct resource sa1111_resources[] = { - [0] = DEFINE_RES_MEM(BADGE4_SA1111_BASE, 0x2000), - [1] = DEFINE_RES_IRQ(BADGE4_IRQ_GPIO_SA1111), + [0] = { + .start = BADGE4_SA1111_BASE, + .end = BADGE4_SA1111_BASE + 0x00001fff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = BADGE4_IRQ_GPIO_SA1111, + .end = BADGE4_IRQ_GPIO_SA1111, + .flags = IORESOURCE_IRQ, + }, }; static struct sa1111_platform_data sa1111_info = { @@ -113,8 +121,11 @@ static struct flash_platform_data badge4_flash_data = { .nr_parts = ARRAY_SIZE(badge4_partitions), }; -static struct resource badge4_flash_resource = - DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_64M); +static struct resource badge4_flash_resource = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_64M - 1, + .flags = IORESOURCE_MEM, +}; static int five_v_on __initdata = 0; diff --git a/trunk/arch/arm/mach-sa1100/cerf.c b/trunk/arch/arm/mach-sa1100/cerf.c index c2f9ba3a9578..11bb6d0b9be3 100644 --- a/trunk/arch/arm/mach-sa1100/cerf.c +++ b/trunk/arch/arm/mach-sa1100/cerf.c @@ -33,7 +33,11 @@ #include "generic.h" static struct resource cerfuart2_resources[] = { - [0] = DEFINE_RES_MEM(0x80030000, SZ_64K), + [0] = { + .start = 0x80030000, + .end = 0x8003ffff, + .flags = IORESOURCE_MEM, + }, }; static struct platform_device cerfuart2_device = { @@ -83,8 +87,11 @@ static struct flash_platform_data cerf_flash_data = { .nr_parts = ARRAY_SIZE(cerf_partitions), }; -static struct resource cerf_flash_resource = - DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M); +static struct resource cerf_flash_resource = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, +}; static void __init cerf_init_irq(void) { diff --git a/trunk/arch/arm/mach-sa1100/collie.c b/trunk/arch/arm/mach-sa1100/collie.c index dbe5cf719f7e..fd5652118ed1 100644 --- a/trunk/arch/arm/mach-sa1100/collie.c +++ b/trunk/arch/arm/mach-sa1100/collie.c @@ -48,7 +48,11 @@ #include "generic.h" static struct resource collie_scoop_resources[] = { - [0] = DEFINE_RES_MEM(0x40800000, SZ_4K), + [0] = { + .start = 0x40800000, + .end = 0x40800fff, + .flags = IORESOURCE_MEM, + }, }; static struct scoop_config collie_scoop_setup = { @@ -217,8 +221,16 @@ device_initcall(collie_uart_init); static struct resource locomo_resources[] = { - [0] = DEFINE_RES_MEM(0x40000000, SZ_8K), - [1] = DEFINE_RES_IRQ(IRQ_GPIO25), + [0] = { + .start = 0x40000000, + .end = 0x40001fff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_GPIO25, + .end = IRQ_GPIO25, + .flags = IORESOURCE_IRQ, + }, }; static struct locomo_platform_data locomo_info = { @@ -291,7 +303,11 @@ static struct flash_platform_data collie_flash_data = { }; static struct resource collie_flash_resources[] = { - DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M), + { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, + } }; static void __init collie_init(void) diff --git a/trunk/arch/arm/mach-sa1100/generic.c b/trunk/arch/arm/mach-sa1100/generic.c index 2b33b4597468..bb10ee2cb89f 100644 --- a/trunk/arch/arm/mach-sa1100/generic.c +++ b/trunk/arch/arm/mach-sa1100/generic.c @@ -149,8 +149,16 @@ static void sa11x0_register_device(struct platform_device *dev, void *data) static struct resource sa11x0udc_resources[] = { - [0] = DEFINE_RES_MEM(__PREG(Ser0UDCCR), SZ_64K), - [1] = DEFINE_RES_IRQ(IRQ_Ser0UDC), + [0] = { + .start = __PREG(Ser0UDCCR), + .end = __PREG(Ser0UDCCR) + 0xffff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_Ser0UDC, + .end = IRQ_Ser0UDC, + .flags = IORESOURCE_IRQ, + }, }; static u64 sa11x0udc_dma_mask = 0xffffffffUL; @@ -167,8 +175,16 @@ static struct platform_device sa11x0udc_device = { }; static struct resource sa11x0uart1_resources[] = { - [0] = DEFINE_RES_MEM(__PREG(Ser1UTCR0), SZ_64K), - [1] = DEFINE_RES_IRQ(IRQ_Ser1UART), + [0] = { + .start = __PREG(Ser1UTCR0), + .end = __PREG(Ser1UTCR0) + 0xffff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_Ser1UART, + .end = IRQ_Ser1UART, + .flags = IORESOURCE_IRQ, + }, }; static struct platform_device sa11x0uart1_device = { @@ -179,8 +195,16 @@ static struct platform_device sa11x0uart1_device = { }; static struct resource sa11x0uart3_resources[] = { - [0] = DEFINE_RES_MEM(__PREG(Ser3UTCR0), SZ_64K), - [1] = DEFINE_RES_IRQ(IRQ_Ser3UART), + [0] = { + .start = __PREG(Ser3UTCR0), + .end = __PREG(Ser3UTCR0) + 0xffff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_Ser3UART, + .end = IRQ_Ser3UART, + .flags = IORESOURCE_IRQ, + }, }; static struct platform_device sa11x0uart3_device = { @@ -191,8 +215,16 @@ static struct platform_device sa11x0uart3_device = { }; static struct resource sa11x0mcp_resources[] = { - [0] = DEFINE_RES_MEM(__PREG(Ser4MCCR0), SZ_64K), - [1] = DEFINE_RES_IRQ(IRQ_Ser4MCP), + [0] = { + .start = __PREG(Ser4MCCR0), + .end = __PREG(Ser4MCCR0) + 0xffff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_Ser4MCP, + .end = IRQ_Ser4MCP, + .flags = IORESOURCE_IRQ, + }, }; static u64 sa11x0mcp_dma_mask = 0xffffffffUL; @@ -214,8 +246,16 @@ void sa11x0_register_mcp(struct mcp_plat_data *data) } static struct resource sa11x0ssp_resources[] = { - [0] = DEFINE_RES_MEM(0x80070000, SZ_64K), - [1] = DEFINE_RES_IRQ(IRQ_Ser4SSP), + [0] = { + .start = 0x80070000, + .end = 0x8007ffff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_Ser4SSP, + .end = IRQ_Ser4SSP, + .flags = IORESOURCE_IRQ, + }, }; static u64 sa11x0ssp_dma_mask = 0xffffffffUL; @@ -232,8 +272,16 @@ static struct platform_device sa11x0ssp_device = { }; static struct resource sa11x0fb_resources[] = { - [0] = DEFINE_RES_MEM(0xb0100000, SZ_64K), - [1] = DEFINE_RES_IRQ(IRQ_LCD), + [0] = { + .start = 0xb0100000, + .end = 0xb010ffff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_LCD, + .end = IRQ_LCD, + .flags = IORESOURCE_IRQ, + }, }; static struct platform_device sa11x0fb_device = { @@ -266,10 +314,23 @@ void sa11x0_register_mtd(struct flash_platform_data *flash, } static struct resource sa11x0ir_resources[] = { - DEFINE_RES_MEM(__PREG(Ser2UTCR0), 0x24), - DEFINE_RES_MEM(__PREG(Ser2HSCR0), 0x1c), - DEFINE_RES_MEM(__PREG(Ser2HSCR2), 0x04), - DEFINE_RES_IRQ(IRQ_Ser2ICP), + { + .start = __PREG(Ser2UTCR0), + .end = __PREG(Ser2UTCR0) + 0x24 - 1, + .flags = IORESOURCE_MEM, + }, { + .start = __PREG(Ser2HSCR0), + .end = __PREG(Ser2HSCR0) + 0x1c - 1, + .flags = IORESOURCE_MEM, + }, { + .start = __PREG(Ser2HSCR2), + .end = __PREG(Ser2HSCR2) + 0x04 - 1, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_Ser2ICP, + .end = IRQ_Ser2ICP, + .flags = IORESOURCE_IRQ, + } }; static struct platform_device sa11x0ir_device = { @@ -367,7 +428,7 @@ void __init sa1100_map_io(void) * the MBGNT signal false to ensure the SA1111 doesn't own the * SDRAM bus. */ -void sa1110_mb_disable(void) +void __init sa1110_mb_disable(void) { unsigned long flags; @@ -386,7 +447,7 @@ void sa1110_mb_disable(void) * If the system is going to use the SA-1111 DMA engines, set up * the memory bus request/grant pins. */ -void sa1110_mb_enable(void) +void __devinit sa1110_mb_enable(void) { unsigned long flags; diff --git a/trunk/arch/arm/mach-sa1100/h3xxx.c b/trunk/arch/arm/mach-sa1100/h3xxx.c index 63150e1ffe9e..b0784c974c2d 100644 --- a/trunk/arch/arm/mach-sa1100/h3xxx.c +++ b/trunk/arch/arm/mach-sa1100/h3xxx.c @@ -109,8 +109,11 @@ static struct flash_platform_data h3xxx_flash_data = { .nr_parts = ARRAY_SIZE(h3xxx_partitions), }; -static struct resource h3xxx_flash_resource = - DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M); +static struct resource h3xxx_flash_resource = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, +}; /* @@ -183,7 +186,11 @@ static struct sa1100_port_fns h3xxx_port_fns __initdata = { */ static struct resource egpio_resources[] = { - [0] = DEFINE_RES_MEM(H3600_EGPIO_PHYS, 0x4), + [0] = { + .start = H3600_EGPIO_PHYS, + .end = H3600_EGPIO_PHYS + 0x4 - 1, + .flags = IORESOURCE_MEM, + }, }; static struct htc_egpio_chip egpio_chips[] = { diff --git a/trunk/arch/arm/mach-sa1100/hackkit.c b/trunk/arch/arm/mach-sa1100/hackkit.c index 37d381ad5464..c01bb36db940 100644 --- a/trunk/arch/arm/mach-sa1100/hackkit.c +++ b/trunk/arch/arm/mach-sa1100/hackkit.c @@ -179,8 +179,11 @@ static struct flash_platform_data hackkit_flash_data = { .nr_parts = ARRAY_SIZE(hackkit_partitions), }; -static struct resource hackkit_flash_resource = - DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M); +static struct resource hackkit_flash_resource = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M, + .flags = IORESOURCE_MEM, +}; static void __init hackkit_init(void) { diff --git a/trunk/arch/arm/mach-sa1100/include/mach/irqs.h b/trunk/arch/arm/mach-sa1100/include/mach/irqs.h index 9e07634a4670..d18f21abef80 100644 --- a/trunk/arch/arm/mach-sa1100/include/mach/irqs.h +++ b/trunk/arch/arm/mach-sa1100/include/mach/irqs.h @@ -82,3 +82,11 @@ #else #define NR_IRQS (IRQ_BOARD_START) #endif + +/* + * Board specific IRQs. Define them here. + * Do not surround them with ifdefs. + */ +#define IRQ_NEPONSET_SMC9196 (IRQ_BOARD_START + 0) +#define IRQ_NEPONSET_USAR (IRQ_BOARD_START + 1) +#define IRQ_NEPONSET_SA1111 (IRQ_BOARD_START + 2) diff --git a/trunk/arch/arm/mach-sa1100/include/mach/neponset.h b/trunk/arch/arm/mach-sa1100/include/mach/neponset.h index 5516a52a329d..ffe2bc45eed0 100644 --- a/trunk/arch/arm/mach-sa1100/include/mach/neponset.h +++ b/trunk/arch/arm/mach-sa1100/include/mach/neponset.h @@ -15,6 +15,54 @@ /* * Neponset definitions: */ + +#define NEPONSET_CPLD_BASE (0x10000000) +#define Nep_p2v( x ) ((x) - NEPONSET_CPLD_BASE + 0xf3000000) +#define Nep_v2p( x ) ((x) - 0xf3000000 + NEPONSET_CPLD_BASE) + +#define _IRR 0x10000024 /* Interrupt Reason Register */ +#define _AUD_CTL 0x100000c0 /* Audio controls (RW) */ +#define _MDM_CTL_0 0x100000b0 /* Modem control 0 (RW) */ +#define _MDM_CTL_1 0x100000b4 /* Modem control 1 (RW) */ +#define _NCR_0 0x100000a0 /* Control Register (RW) */ +#define _KP_X_OUT 0x10000090 /* Keypad row write (RW) */ +#define _KP_Y_IN 0x10000080 /* Keypad column read (RO) */ +#define _SWPK 0x10000020 /* Switch pack (RO) */ +#define _WHOAMI 0x10000000 /* System ID Register (RO) */ + +#define _LEDS 0x10000010 /* LEDs [31:0] (WO) */ + +#define IRR (*((volatile u_char *) Nep_p2v(_IRR))) +#define AUD_CTL (*((volatile u_char *) Nep_p2v(_AUD_CTL))) +#define MDM_CTL_0 (*((volatile u_char *) Nep_p2v(_MDM_CTL_0))) +#define MDM_CTL_1 (*((volatile u_char *) Nep_p2v(_MDM_CTL_1))) +#define NCR_0 (*((volatile u_char *) Nep_p2v(_NCR_0))) +#define KP_X_OUT (*((volatile u_char *) Nep_p2v(_KP_X_OUT))) +#define KP_Y_IN (*((volatile u_char *) Nep_p2v(_KP_Y_IN))) +#define SWPK (*((volatile u_char *) Nep_p2v(_SWPK))) +#define WHOAMI (*((volatile u_char *) Nep_p2v(_WHOAMI))) + +#define LEDS (*((volatile Word *) Nep_p2v(_LEDS))) + +#define IRR_ETHERNET (1<<0) +#define IRR_USAR (1<<1) +#define IRR_SA1111 (1<<2) + +#define AUD_SEL_1341 (1<<0) +#define AUD_MUTE_1341 (1<<1) + +#define MDM_CTL0_RTS1 (1 << 0) +#define MDM_CTL0_DTR1 (1 << 1) +#define MDM_CTL0_RTS2 (1 << 2) +#define MDM_CTL0_DTR2 (1 << 3) + +#define MDM_CTL1_CTS1 (1 << 0) +#define MDM_CTL1_DSR1 (1 << 1) +#define MDM_CTL1_DCD1 (1 << 2) +#define MDM_CTL1_CTS2 (1 << 3) +#define MDM_CTL1_DSR2 (1 << 4) +#define MDM_CTL1_DCD2 (1 << 5) + #define NCR_GP01_OFF (1<<0) #define NCR_TP_PWR_EN (1<<1) #define NCR_MS_PWR_EN (1<<2) @@ -23,8 +71,4 @@ #define NCR_A0VPP (1<<5) #define NCR_A1VPP (1<<6) -void neponset_ncr_frob(unsigned int, unsigned int); -#define neponset_ncr_set(v) neponset_ncr_frob(0, v) -#define neponset_ncr_clear(v) neponset_ncr_frob(v, 0) - #endif diff --git a/trunk/arch/arm/mach-sa1100/irq.c b/trunk/arch/arm/mach-sa1100/irq.c index 5d12a305f53e..dfbf824a69fa 100644 --- a/trunk/arch/arm/mach-sa1100/irq.c +++ b/trunk/arch/arm/mach-sa1100/irq.c @@ -221,8 +221,11 @@ static struct irq_chip sa1100_normal_chip = { .irq_set_wake = sa1100_set_wake, }; -static struct resource irq_resource = - DEFINE_RES_MEM_NAMED(0x90050000, SZ_64K, "irqs"); +static struct resource irq_resource = { + .name = "irqs", + .start = 0x90050000, + .end = 0x9005ffff, +}; static struct sa1100irq_state { unsigned int saved; diff --git a/trunk/arch/arm/mach-sa1100/jornada720.c b/trunk/arch/arm/mach-sa1100/jornada720.c index 8512cfcc0d9b..ee121d6f0480 100644 --- a/trunk/arch/arm/mach-sa1100/jornada720.c +++ b/trunk/arch/arm/mach-sa1100/jornada720.c @@ -46,7 +46,7 @@ /* memory space (line 52 of HP's doc) */ #define SA1111REGSTART 0x40000000 -#define SA1111REGLEN 0x00002000 +#define SA1111REGLEN 0x00001fff #define EPSONREGSTART 0x48000000 #define EPSONREGLEN 0x00100000 #define EPSONFBSTART 0x48200000 @@ -174,8 +174,16 @@ static struct s1d13xxxfb_pdata s1d13xxxfb_data = { }; static struct resource s1d13xxxfb_resources[] = { - [0] = DEFINE_RES_MEM(EPSONFBSTART, EPSONFBLEN), - [1] = DEFINE_RES_MEM(EPSONREGSTART, EPSONREGLEN), + [0] = { + .start = EPSONFBSTART, + .end = EPSONFBSTART + EPSONFBLEN, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = EPSONREGSTART, + .end = EPSONREGSTART + EPSONREGLEN, + .flags = IORESOURCE_MEM, + } }; static struct platform_device s1d13xxxfb_device = { @@ -189,8 +197,16 @@ static struct platform_device s1d13xxxfb_device = { }; static struct resource sa1111_resources[] = { - [0] = DEFINE_RES_MEM(SA1111REGSTART, SA1111REGLEN), - [1] = DEFINE_RES_IRQ(IRQ_GPIO1), + [0] = { + .start = SA1111REGSTART, + .end = SA1111REGSTART + SA1111REGLEN, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_GPIO1, + .end = IRQ_GPIO1, + .flags = IORESOURCE_IRQ, + }, }; static struct sa1111_platform_data sa1111_info = { @@ -336,8 +352,11 @@ static struct flash_platform_data jornada720_flash_data = { .nr_parts = ARRAY_SIZE(jornada720_partitions), }; -static struct resource jornada720_flash_resource = - DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M); +static struct resource jornada720_flash_resource = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, +}; static void __init jornada720_mach_init(void) { diff --git a/trunk/arch/arm/mach-sa1100/nanoengine.c b/trunk/arch/arm/mach-sa1100/nanoengine.c index 3923911000de..85f6ee672225 100644 --- a/trunk/arch/arm/mach-sa1100/nanoengine.c +++ b/trunk/arch/arm/mach-sa1100/nanoengine.c @@ -58,8 +58,15 @@ static struct flash_platform_data nanoengine_flash_data = { }; static struct resource nanoengine_flash_resources[] = { - DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_32M), - DEFINE_RES_MEM(SA1100_CS1_PHYS, SZ_32M), + { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, + }, { + .start = SA1100_CS1_PHYS, + .end = SA1100_CS1_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, + } }; static struct map_desc nanoengine_io_desc[] __initdata = { diff --git a/trunk/arch/arm/mach-sa1100/neponset.c b/trunk/arch/arm/mach-sa1100/neponset.c index 7ffa631eede4..b4fa53a1427e 100644 --- a/trunk/arch/arm/mach-sa1100/neponset.c +++ b/trunk/arch/arm/mach-sa1100/neponset.c @@ -1,103 +1,89 @@ /* * linux/arch/arm/mach-sa1100/neponset.c + * */ -#include +#include #include +#include #include -#include -#include -#include -#include -#include #include -#include +#include +#include #include +#include #include +#include #include +#include +#include #include #include -#include -#include -#include +/* + * Install handler for Neponset IRQ. Note that we have to loop here + * since the ETHERNET and USAR IRQs are level based, and we need to + * ensure that the IRQ signal is deasserted before returning. This + * is rather unfortunate. + */ +static void +neponset_irq_handler(unsigned int irq, struct irq_desc *desc) +{ + unsigned int irr; -#define NEP_IRQ_SMC91X 0 -#define NEP_IRQ_USAR 1 -#define NEP_IRQ_SA1111 2 -#define NEP_IRQ_NR 3 - -#define WHOAMI 0x00 -#define LEDS 0x10 -#define SWPK 0x20 -#define IRR 0x24 -#define KP_Y_IN 0x80 -#define KP_X_OUT 0x90 -#define NCR_0 0xa0 -#define MDM_CTL_0 0xb0 -#define MDM_CTL_1 0xb4 -#define AUD_CTL 0xc0 - -#define IRR_ETHERNET (1 << 0) -#define IRR_USAR (1 << 1) -#define IRR_SA1111 (1 << 2) - -#define MDM_CTL0_RTS1 (1 << 0) -#define MDM_CTL0_DTR1 (1 << 1) -#define MDM_CTL0_RTS2 (1 << 2) -#define MDM_CTL0_DTR2 (1 << 3) - -#define MDM_CTL1_CTS1 (1 << 0) -#define MDM_CTL1_DSR1 (1 << 1) -#define MDM_CTL1_DCD1 (1 << 2) -#define MDM_CTL1_CTS2 (1 << 3) -#define MDM_CTL1_DSR2 (1 << 4) -#define MDM_CTL1_DCD2 (1 << 5) - -#define AUD_SEL_1341 (1 << 0) -#define AUD_MUTE_1341 (1 << 1) + while (1) { + /* + * Acknowledge the parent IRQ. + */ + desc->irq_data.chip->irq_ack(&desc->irq_data); -extern void sa1110_mb_disable(void); + /* + * Read the interrupt reason register. Let's have all + * active IRQ bits high. Note: there is a typo in the + * Neponset user's guide for the SA1111 IRR level. + */ + irr = IRR ^ (IRR_ETHERNET | IRR_USAR); -struct neponset_drvdata { - void __iomem *base; - struct platform_device *sa1111; - struct platform_device *smc91x; - unsigned irq_base; -#ifdef CONFIG_PM_SLEEP - u32 ncr0; - u32 mdm_ctl_0; -#endif -}; + if ((irr & (IRR_ETHERNET | IRR_USAR | IRR_SA1111)) == 0) + break; + + /* + * Since there is no individual mask, we have to + * mask the parent IRQ. This is safe, since we'll + * recheck the register for any pending IRQs. + */ + if (irr & (IRR_ETHERNET | IRR_USAR)) { + desc->irq_data.chip->irq_mask(&desc->irq_data); -static void __iomem *nep_base; + /* + * Ack the interrupt now to prevent re-entering + * this neponset handler. Again, this is safe + * since we'll check the IRR register prior to + * leaving. + */ + desc->irq_data.chip->irq_ack(&desc->irq_data); -void neponset_ncr_frob(unsigned int mask, unsigned int val) -{ - void __iomem *base = nep_base; - - if (base) { - unsigned long flags; - unsigned v; - - local_irq_save(flags); - v = readb_relaxed(base + NCR_0); - writeb_relaxed((v & ~mask) | val, base + NCR_0); - local_irq_restore(flags); - } else { - WARN(1, "nep_base unset\n"); + if (irr & IRR_ETHERNET) { + generic_handle_irq(IRQ_NEPONSET_SMC9196); + } + + if (irr & IRR_USAR) { + generic_handle_irq(IRQ_NEPONSET_USAR); + } + + desc->irq_data.chip->irq_unmask(&desc->irq_data); + } + + if (irr & IRR_SA1111) { + generic_handle_irq(IRQ_NEPONSET_SA1111); + } } } static void neponset_set_mctrl(struct uart_port *port, u_int mctrl) { - void __iomem *base = nep_base; - u_int mdm_ctl0; + u_int mdm_ctl0 = MDM_CTL_0; - if (!base) - return; - - mdm_ctl0 = readb_relaxed(base + MDM_CTL_0); if (port->mapbase == _Ser1UTCR0) { if (mctrl & TIOCM_RTS) mdm_ctl0 &= ~MDM_CTL0_RTS2; @@ -120,19 +106,14 @@ static void neponset_set_mctrl(struct uart_port *port, u_int mctrl) mdm_ctl0 |= MDM_CTL0_DTR1; } - writeb_relaxed(mdm_ctl0, base + MDM_CTL_0); + MDM_CTL_0 = mdm_ctl0; } static u_int neponset_get_mctrl(struct uart_port *port) { - void __iomem *base = nep_base; u_int ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR; - u_int mdm_ctl1; - - if (!base) - return ret; + u_int mdm_ctl1 = MDM_CTL_1; - mdm_ctl1 = readb_relaxed(base + MDM_CTL_1); if (port->mapbase == _Ser1UTCR0) { if (mdm_ctl1 & MDM_CTL1_DCD2) ret &= ~TIOCM_CD; @@ -157,284 +138,201 @@ static struct sa1100_port_fns neponset_port_fns __devinitdata = { .get_mctrl = neponset_get_mctrl, }; -/* - * Install handler for Neponset IRQ. Note that we have to loop here - * since the ETHERNET and USAR IRQs are level based, and we need to - * ensure that the IRQ signal is deasserted before returning. This - * is rather unfortunate. - */ -static void neponset_irq_handler(unsigned int irq, struct irq_desc *desc) -{ - struct neponset_drvdata *d = irq_desc_get_handler_data(desc); - unsigned int irr; - - while (1) { - /* - * Acknowledge the parent IRQ. - */ - desc->irq_data.chip->irq_ack(&desc->irq_data); - - /* - * Read the interrupt reason register. Let's have all - * active IRQ bits high. Note: there is a typo in the - * Neponset user's guide for the SA1111 IRR level. - */ - irr = readb_relaxed(d->base + IRR); - irr ^= IRR_ETHERNET | IRR_USAR; - - if ((irr & (IRR_ETHERNET | IRR_USAR | IRR_SA1111)) == 0) - break; - - /* - * Since there is no individual mask, we have to - * mask the parent IRQ. This is safe, since we'll - * recheck the register for any pending IRQs. - */ - if (irr & (IRR_ETHERNET | IRR_USAR)) { - desc->irq_data.chip->irq_mask(&desc->irq_data); - - /* - * Ack the interrupt now to prevent re-entering - * this neponset handler. Again, this is safe - * since we'll check the IRR register prior to - * leaving. - */ - desc->irq_data.chip->irq_ack(&desc->irq_data); - - if (irr & IRR_ETHERNET) - generic_handle_irq(d->irq_base + NEP_IRQ_SMC91X); - - if (irr & IRR_USAR) - generic_handle_irq(d->irq_base + NEP_IRQ_USAR); - - desc->irq_data.chip->irq_unmask(&desc->irq_data); - } - - if (irr & IRR_SA1111) - generic_handle_irq(d->irq_base + NEP_IRQ_SA1111); - } -} - -/* Yes, we really do not have any kind of masking or unmasking */ -static void nochip_noop(struct irq_data *irq) -{ -} - -static struct irq_chip nochip = { - .name = "neponset", - .irq_ack = nochip_noop, - .irq_mask = nochip_noop, - .irq_unmask = nochip_noop, -}; - -static struct sa1111_platform_data sa1111_info = { - .irq_base = IRQ_BOARD_END, -}; - static int __devinit neponset_probe(struct platform_device *dev) { - struct neponset_drvdata *d; - struct resource *nep_res, *sa1111_res, *smc91x_res; - struct resource sa1111_resources[] = { - DEFINE_RES_MEM(0x40000000, SZ_8K), - { .flags = IORESOURCE_IRQ }, - }; - struct platform_device_info sa1111_devinfo = { - .parent = &dev->dev, - .name = "sa1111", - .id = 0, - .res = sa1111_resources, - .num_res = ARRAY_SIZE(sa1111_resources), - .data = &sa1111_info, - .size_data = sizeof(sa1111_info), - .dma_mask = 0xffffffffUL, - }; - struct resource smc91x_resources[] = { - DEFINE_RES_MEM_NAMED(SA1100_CS3_PHYS, - 0x02000000, "smc91x-regs"), - DEFINE_RES_MEM_NAMED(SA1100_CS3_PHYS + 0x02000000, - 0x02000000, "smc91x-attrib"), - { .flags = IORESOURCE_IRQ }, - }; - struct platform_device_info smc91x_devinfo = { - .parent = &dev->dev, - .name = "smc91x", - .id = 0, - .res = smc91x_resources, - .num_res = ARRAY_SIZE(smc91x_resources), - }; - int ret, irq; - - if (nep_base) - return -EBUSY; - - irq = ret = platform_get_irq(dev, 0); - if (ret < 0) - goto err_alloc; - - nep_res = platform_get_resource(dev, IORESOURCE_MEM, 0); - smc91x_res = platform_get_resource(dev, IORESOURCE_MEM, 1); - sa1111_res = platform_get_resource(dev, IORESOURCE_MEM, 2); - if (!nep_res || !smc91x_res || !sa1111_res) { - ret = -ENXIO; - goto err_alloc; - } - - d = kzalloc(sizeof(*d), GFP_KERNEL); - if (!d) { - ret = -ENOMEM; - goto err_alloc; - } - - d->base = ioremap(nep_res->start, SZ_4K); - if (!d->base) { - ret = -ENOMEM; - goto err_ioremap; - } - - if (readb_relaxed(d->base + WHOAMI) != 0x11) { - dev_warn(&dev->dev, "Neponset board detected, but wrong ID: %02x\n", - readb_relaxed(d->base + WHOAMI)); - ret = -ENODEV; - goto err_id; - } - - ret = irq_alloc_descs(-1, IRQ_BOARD_START, NEP_IRQ_NR, -1); - if (ret <= 0) { - dev_err(&dev->dev, "unable to allocate %u irqs: %d\n", - NEP_IRQ_NR, ret); - if (ret == 0) - ret = -ENOMEM; - goto err_irq_alloc; - } - - d->irq_base = ret; - - irq_set_chip_and_handler(d->irq_base + NEP_IRQ_SMC91X, &nochip, - handle_simple_irq); - set_irq_flags(d->irq_base + NEP_IRQ_SMC91X, IRQF_VALID | IRQF_PROBE); - irq_set_chip_and_handler(d->irq_base + NEP_IRQ_USAR, &nochip, - handle_simple_irq); - set_irq_flags(d->irq_base + NEP_IRQ_USAR, IRQF_VALID | IRQF_PROBE); - irq_set_chip(d->irq_base + NEP_IRQ_SA1111, &nochip); + sa1100_register_uart_fns(&neponset_port_fns); - irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING); - irq_set_handler_data(irq, d); - irq_set_chained_handler(irq, neponset_irq_handler); + /* + * Install handler for GPIO25. + */ + irq_set_irq_type(IRQ_GPIO25, IRQ_TYPE_EDGE_RISING); + irq_set_chained_handler(IRQ_GPIO25, neponset_irq_handler); /* - * We would set IRQ_GPIO25 to be a wake-up IRQ, but unfortunately - * something on the Neponset activates this IRQ on sleep (eth?) + * We would set IRQ_GPIO25 to be a wake-up IRQ, but + * unfortunately something on the Neponset activates + * this IRQ on sleep (ethernet?) */ #if 0 - enable_irq_wake(irq); + enable_irq_wake(IRQ_GPIO25); #endif - dev_info(&dev->dev, "Neponset daughter board, providing IRQ%u-%u\n", - d->irq_base, d->irq_base + NEP_IRQ_NR - 1); - nep_base = d->base; - - sa1100_register_uart_fns(&neponset_port_fns); - - /* Ensure that the memory bus request/grant signals are setup */ - sa1110_mb_disable(); - - /* Disable GPIO 0/1 drivers so the buttons work on the Assabet */ - writeb_relaxed(NCR_GP01_OFF, d->base + NCR_0); - - sa1111_resources[0].parent = sa1111_res; - sa1111_resources[1].start = d->irq_base + NEP_IRQ_SA1111; - sa1111_resources[1].end = d->irq_base + NEP_IRQ_SA1111; - d->sa1111 = platform_device_register_full(&sa1111_devinfo); - - smc91x_resources[0].parent = smc91x_res; - smc91x_resources[1].parent = smc91x_res; - smc91x_resources[2].start = d->irq_base + NEP_IRQ_SMC91X; - smc91x_resources[2].end = d->irq_base + NEP_IRQ_SMC91X; - d->smc91x = platform_device_register_full(&smc91x_devinfo); + /* + * Setup other Neponset IRQs. SA1111 will be done by the + * generic SA1111 code. + */ + irq_set_handler(IRQ_NEPONSET_SMC9196, handle_simple_irq); + set_irq_flags(IRQ_NEPONSET_SMC9196, IRQF_VALID | IRQF_PROBE); + irq_set_handler(IRQ_NEPONSET_USAR, handle_simple_irq); + set_irq_flags(IRQ_NEPONSET_USAR, IRQF_VALID | IRQF_PROBE); - platform_set_drvdata(dev, d); + /* + * Disable GPIO 0/1 drivers so the buttons work on the module. + */ + NCR_0 = NCR_GP01_OFF; return 0; - - err_irq_alloc: - err_id: - iounmap(d->base); - err_ioremap: - kfree(d); - err_alloc: - return ret; } -static int __devexit neponset_remove(struct platform_device *dev) -{ - struct neponset_drvdata *d = platform_get_drvdata(dev); - int irq = platform_get_irq(dev, 0); - - if (!IS_ERR(d->sa1111)) - platform_device_unregister(d->sa1111); - if (!IS_ERR(d->smc91x)) - platform_device_unregister(d->smc91x); - irq_set_chained_handler(irq, NULL); - irq_free_descs(d->irq_base, NEP_IRQ_NR); - nep_base = NULL; - iounmap(d->base); - kfree(d); +#ifdef CONFIG_PM - return 0; -} +/* + * LDM power management. + */ +static unsigned int neponset_saved_state; -#ifdef CONFIG_PM_SLEEP -static int neponset_suspend(struct device *dev) +static int neponset_suspend(struct platform_device *dev, pm_message_t state) { - struct neponset_drvdata *d = dev_get_drvdata(dev); - - d->ncr0 = readb_relaxed(d->base + NCR_0); - d->mdm_ctl_0 = readb_relaxed(d->base + MDM_CTL_0); + /* + * Save state. + */ + neponset_saved_state = NCR_0; return 0; } -static int neponset_resume(struct device *dev) +static int neponset_resume(struct platform_device *dev) { - struct neponset_drvdata *d = dev_get_drvdata(dev); - - writeb_relaxed(d->ncr0, d->base + NCR_0); - writeb_relaxed(d->mdm_ctl_0, d->base + MDM_CTL_0); + NCR_0 = neponset_saved_state; return 0; } -static const struct dev_pm_ops neponset_pm_ops = { - .suspend_noirq = neponset_suspend, - .resume_noirq = neponset_resume, - .freeze_noirq = neponset_suspend, - .restore_noirq = neponset_resume, -}; -#define PM_OPS &neponset_pm_ops #else -#define PM_OPS NULL +#define neponset_suspend NULL +#define neponset_resume NULL #endif static struct platform_driver neponset_device_driver = { .probe = neponset_probe, - .remove = __devexit_p(neponset_remove), + .suspend = neponset_suspend, + .resume = neponset_resume, .driver = { .name = "neponset", - .owner = THIS_MODULE, - .pm = PM_OPS, }, }; +static struct resource neponset_resources[] = { + [0] = { + .start = 0x10000000, + .end = 0x17ffffff, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device neponset_device = { + .name = "neponset", + .id = 0, + .num_resources = ARRAY_SIZE(neponset_resources), + .resource = neponset_resources, +}; + +static struct resource sa1111_resources[] = { + [0] = { + .start = 0x40000000, + .end = 0x40001fff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_NEPONSET_SA1111, + .end = IRQ_NEPONSET_SA1111, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct sa1111_platform_data sa1111_info = { + .irq_base = IRQ_BOARD_END, +}; + +static u64 sa1111_dmamask = 0xffffffffUL; + +static struct platform_device sa1111_device = { + .name = "sa1111", + .id = 0, + .dev = { + .dma_mask = &sa1111_dmamask, + .coherent_dma_mask = 0xffffffff, + .platform_data = &sa1111_info, + }, + .num_resources = ARRAY_SIZE(sa1111_resources), + .resource = sa1111_resources, +}; + +static struct resource smc91x_resources[] = { + [0] = { + .name = "smc91x-regs", + .start = SA1100_CS3_PHYS, + .end = SA1100_CS3_PHYS + 0x01ffffff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_NEPONSET_SMC9196, + .end = IRQ_NEPONSET_SMC9196, + .flags = IORESOURCE_IRQ, + }, + [2] = { + .name = "smc91x-attrib", + .start = SA1100_CS3_PHYS + 0x02000000, + .end = SA1100_CS3_PHYS + 0x03ffffff, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device smc91x_device = { + .name = "smc91x", + .id = 0, + .num_resources = ARRAY_SIZE(smc91x_resources), + .resource = smc91x_resources, +}; + +static struct platform_device *devices[] __initdata = { + &neponset_device, + &sa1111_device, + &smc91x_device, +}; + +extern void sa1110_mb_disable(void); + static int __init neponset_init(void) { - return platform_driver_register(&neponset_device_driver); + platform_driver_register(&neponset_device_driver); + + /* + * The Neponset is only present on the Assabet machine type. + */ + if (!machine_is_assabet()) + return -ENODEV; + + /* + * Ensure that the memory bus request/grant signals are setup, + * and the grant is held in its inactive state, whether or not + * we actually have a Neponset attached. + */ + sa1110_mb_disable(); + + if (!machine_has_neponset()) { + printk(KERN_DEBUG "Neponset expansion board not present\n"); + return -ENODEV; + } + + if (WHOAMI != 0x11) { + printk(KERN_WARNING "Neponset board detected, but " + "wrong ID: %02x\n", WHOAMI); + return -ENODEV; + } + + return platform_add_devices(devices, ARRAY_SIZE(devices)); } subsys_initcall(neponset_init); static struct map_desc neponset_io_desc[] __initdata = { - { /* SA-1111 */ + { /* System Registers */ + .virtual = 0xf3000000, + .pfn = __phys_to_pfn(0x10000000), + .length = SZ_1M, + .type = MT_DEVICE + }, { /* SA-1111 */ .virtual = 0xf4000000, .pfn = __phys_to_pfn(0x40000000), .length = SZ_1M, diff --git a/trunk/arch/arm/mach-sa1100/pci-nanoengine.c b/trunk/arch/arm/mach-sa1100/pci-nanoengine.c index 41bb018b3103..0d01ca788922 100644 --- a/trunk/arch/arm/mach-sa1100/pci-nanoengine.c +++ b/trunk/arch/arm/mach-sa1100/pci-nanoengine.c @@ -135,8 +135,12 @@ struct pci_bus * __init pci_nanoengine_scan_bus(int nr, struct pci_sys_data *sys &sys->resources); } -static struct resource pci_io_ports = - DEFINE_RES_IO_NAMED(0x400, 0x400, "PCI IO"); +static struct resource pci_io_ports = { + .name = "PCI IO", + .start = 0x400, + .end = 0x7FF, + .flags = IORESOURCE_IO, +}; static struct resource pci_non_prefetchable_memory = { .name = "PCI non-prefetchable", diff --git a/trunk/arch/arm/mach-sa1100/pleb.c b/trunk/arch/arm/mach-sa1100/pleb.c index ca5d33b6041a..9307df053533 100644 --- a/trunk/arch/arm/mach-sa1100/pleb.c +++ b/trunk/arch/arm/mach-sa1100/pleb.c @@ -37,9 +37,17 @@ #define IRQ_GPIO_ETH0_IRQ IRQ_GPIO21 static struct resource smc91x_resources[] = { - [0] = DEFINE_RES_MEM(PLEB_ETH0_P, 0x04000000), + [0] = { + .start = PLEB_ETH0_P, + .end = PLEB_ETH0_P | 0x03ffffff, + .flags = IORESOURCE_MEM, + }, #if 0 /* Autoprobe instead, to get rising/falling edge characteristic right */ - [1] = DEFINE_RES_IRQ(IRQ_GPIO_ETH0_IRQ), + [1] = { + .start = IRQ_GPIO_ETH0_IRQ, + .end = IRQ_GPIO_ETH0_IRQ, + .flags = IORESOURCE_IRQ, + }, #endif }; @@ -62,8 +70,16 @@ static struct platform_device *devices[] __initdata = { * the two SA1100 lowest chip select outputs. */ static struct resource pleb_flash_resources[] = { - [0] = DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_8M), - [1] = DEFINE_RES_MEM(SA1100_CS1_PHYS, SZ_8M), + [0] = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_8M - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = SA1100_CS1_PHYS, + .end = SA1100_CS1_PHYS + SZ_8M - 1, + .flags = IORESOURCE_MEM, + } }; diff --git a/trunk/arch/arm/mach-sa1100/shannon.c b/trunk/arch/arm/mach-sa1100/shannon.c index 5fd615649847..318b2b766a0b 100644 --- a/trunk/arch/arm/mach-sa1100/shannon.c +++ b/trunk/arch/arm/mach-sa1100/shannon.c @@ -46,8 +46,11 @@ static struct flash_platform_data shannon_flash_data = { .nr_parts = ARRAY_SIZE(shannon_partitions), }; -static struct resource shannon_flash_resource = - DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_4M); +static struct resource shannon_flash_resource = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_4M - 1, + .flags = IORESOURCE_MEM, +}; static struct mcp_plat_data shannon_mcp_data = { .mccr0 = MCCR0_ADM, diff --git a/trunk/arch/arm/mach-sa1100/simpad.c b/trunk/arch/arm/mach-sa1100/simpad.c index cdb9d197c092..e17c04d6e324 100644 --- a/trunk/arch/arm/mach-sa1100/simpad.c +++ b/trunk/arch/arm/mach-sa1100/simpad.c @@ -176,8 +176,15 @@ static struct flash_platform_data simpad_flash_data = { static struct resource simpad_flash_resources [] = { - DEFINE_RES_MEM(SA1100_CS0_PHYS, SZ_16M), - DEFINE_RES_MEM(SA1100_CS1_PHYS, SZ_16M), + { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_16M -1, + .flags = IORESOURCE_MEM, + }, { + .start = SA1100_CS1_PHYS, + .end = SA1100_CS1_PHYS + SZ_16M -1, + .flags = IORESOURCE_MEM, + } }; static struct mcp_plat_data simpad_mcp_data = { diff --git a/trunk/arch/arm/mach-sa1100/sleep.S b/trunk/arch/arm/mach-sa1100/sleep.S index 30cc6721665b..e8223315b442 100644 --- a/trunk/arch/arm/mach-sa1100/sleep.S +++ b/trunk/arch/arm/mach-sa1100/sleep.S @@ -26,36 +26,27 @@ * * Causes sa11x0 to enter sleep state * - * Must be aligned to a cacheline. */ - .balign 32 + ENTRY(sa1100_finish_suspend) @ disable clock switching mcr p15, 0, r1, c15, c2, 2 - ldr r6, =MDREFR - ldr r4, [r6] - orr r4, r4, #MDREFR_K1DB2 - ldr r5, =PPCR - - @ Pre-load __udelay into the I-cache - mov r0, #1 - bl __udelay - mov r0, r0 - - @ The following must all exist in a single cache line to - @ avoid accessing memory until this sequence is complete, - @ otherwise we occasionally hang. - - @ Adjust memory timing before lowering CPU clock - str r4, [r6] + @ Adjust memory timing before lowering CPU clock + @ Clock speed adjustment without changing memory timing makes + @ CPU hang in some cases + ldr r0, =MDREFR + ldr r1, [r0] + orr r1, r1, #MDREFR_K1DB2 + str r1, [r0] @ delay 90us and set CPU PLL to lowest speed @ fixes resume problem on high speed SA1110 mov r0, #90 bl __udelay + ldr r0, =PPCR mov r1, #0 - str r1, [r5] + str r1, [r0] mov r0, #90 bl __udelay @@ -94,10 +85,12 @@ ENTRY(sa1100_finish_suspend) bic r5, r5, #FMsk(MSC_RT) bic r5, r5, #FMsk(MSC_RT)<<16 + ldr r6, =MDREFR + ldr r7, [r6] - bic r7, r7, #0x0000FF00 - bic r7, r7, #0x000000F0 - orr r8, r7, #MDREFR_SLFRSH +bic r7, r7, #0x0000FF00 +bic r7, r7, #0x000000F0 +orr r8, r7, #MDREFR_SLFRSH ldr r9, =MDCNFG ldr r10, [r9] diff --git a/trunk/drivers/net/ethernet/smsc/smc91x.c b/trunk/drivers/net/ethernet/smsc/smc91x.c index 0dba0501b712..64ad3ed74495 100644 --- a/trunk/drivers/net/ethernet/smsc/smc91x.c +++ b/trunk/drivers/net/ethernet/smsc/smc91x.c @@ -2281,7 +2281,7 @@ static int __devinit smc_drv_probe(struct platform_device *pdev) if (ret) goto out_release_io; #if defined(CONFIG_SA1100_ASSABET) - neponset_ncr_set(NCR_ENET_OSC_EN); + NCR_0 |= NCR_ENET_OSC_EN; #endif platform_set_drvdata(pdev, ndev); ret = smc_enable_device(pdev); diff --git a/trunk/drivers/pcmcia/sa1100_neponset.c b/trunk/drivers/pcmcia/sa1100_neponset.c index 4300a7fb3edb..c95639b5f2a0 100644 --- a/trunk/drivers/pcmcia/sa1100_neponset.c +++ b/trunk/drivers/pcmcia/sa1100_neponset.c @@ -94,7 +94,12 @@ neponset_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_sta ret = sa1111_pcmcia_configure_socket(skt, state); if (ret == 0) { - neponset_ncr_frob(ncr_mask, ncr_set); + unsigned long flags; + + local_irq_save(flags); + NCR_0 = (NCR_0 & ~ncr_mask) | ncr_set; + + local_irq_restore(flags); sa1111_set_io(s->dev, pa_dwr_mask, pa_dwr_set); }