From fced80c735941fa518ac67c0b61bbe153fb8c050 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 6 Sep 2008 12:10:45 +0100 Subject: [ARM] Convert asm/io.h to linux/io.h Signed-off-by: Russell King --- arch/arm/mach-ep93xx/adssphere.c | 2 +- arch/arm/mach-ep93xx/clock.c | 2 +- arch/arm/mach-ep93xx/core.c | 2 +- arch/arm/mach-ep93xx/edb9302.c | 2 +- arch/arm/mach-ep93xx/edb9302a.c | 2 +- arch/arm/mach-ep93xx/edb9307.c | 2 +- arch/arm/mach-ep93xx/edb9312.c | 2 +- arch/arm/mach-ep93xx/edb9315.c | 2 +- arch/arm/mach-ep93xx/edb9315a.c | 2 +- arch/arm/mach-ep93xx/gesbc9312.c | 2 +- arch/arm/mach-ep93xx/gpio.c | 2 +- arch/arm/mach-ep93xx/include/mach/ts72xx.h | 2 +- arch/arm/mach-ep93xx/micro9.c | 3 +-- arch/arm/mach-ep93xx/ts72xx.c | 2 +- 14 files changed, 14 insertions(+), 15 deletions(-) (limited to 'arch/arm/mach-ep93xx') diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c index aa1fb352fb8..18f8b1dc8bd 100644 --- a/arch/arm/mach-ep93xx/adssphere.c +++ b/arch/arm/mach-ep93xx/adssphere.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c index 6062e47f204..8c9f2491dcc 100644 --- a/arch/arm/mach-ep93xx/clock.c +++ b/arch/arm/mach-ep93xx/clock.c @@ -15,9 +15,9 @@ #include #include #include +#include #include #include -#include struct clk { char *name; diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index f99f4366939..1a5af1b262b 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -41,7 +42,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/mach-ep93xx/edb9302.c b/arch/arm/mach-ep93xx/edb9302.c index 97550c0ad7b..358a83392d0 100644 --- a/arch/arm/mach-ep93xx/edb9302.c +++ b/arch/arm/mach-ep93xx/edb9302.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-ep93xx/edb9302a.c b/arch/arm/mach-ep93xx/edb9302a.c index 99b01d44bf1..65cc55cfeac 100644 --- a/arch/arm/mach-ep93xx/edb9302a.c +++ b/arch/arm/mach-ep93xx/edb9302a.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-ep93xx/edb9307.c b/arch/arm/mach-ep93xx/edb9307.c index 9fb72d01a36..551de24d6f2 100644 --- a/arch/arm/mach-ep93xx/edb9307.c +++ b/arch/arm/mach-ep93xx/edb9307.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-ep93xx/edb9312.c b/arch/arm/mach-ep93xx/edb9312.c index 87267a574f5..9167e7c8dbc 100644 --- a/arch/arm/mach-ep93xx/edb9312.c +++ b/arch/arm/mach-ep93xx/edb9312.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-ep93xx/edb9315.c b/arch/arm/mach-ep93xx/edb9315.c index 7e373950be4..d267bb64447 100644 --- a/arch/arm/mach-ep93xx/edb9315.c +++ b/arch/arm/mach-ep93xx/edb9315.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-ep93xx/edb9315a.c b/arch/arm/mach-ep93xx/edb9315a.c index 08a7c9bfb68..6ffe21d81e4 100644 --- a/arch/arm/mach-ep93xx/edb9315a.c +++ b/arch/arm/mach-ep93xx/edb9315a.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c index 9b41ec1f089..ad57bb1780d 100644 --- a/arch/arm/mach-ep93xx/gesbc9312.c +++ b/arch/arm/mach-ep93xx/gesbc9312.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-ep93xx/gpio.c b/arch/arm/mach-ep93xx/gpio.c index 0f3fb87ca4b..5a06ed9eafd 100644 --- a/arch/arm/mach-ep93xx/gpio.c +++ b/arch/arm/mach-ep93xx/gpio.c @@ -16,9 +16,9 @@ #include #include #include +#include #include -#include #include struct ep93xx_gpio_chip { diff --git a/arch/arm/mach-ep93xx/include/mach/ts72xx.h b/arch/arm/mach-ep93xx/include/mach/ts72xx.h index 30b318aa1a1..34ddec081c4 100644 --- a/arch/arm/mach-ep93xx/include/mach/ts72xx.h +++ b/arch/arm/mach-ep93xx/include/mach/ts72xx.h @@ -70,7 +70,7 @@ #ifndef __ASSEMBLY__ -#include +#include static inline int board_is_ts7200(void) { diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c index de047a5c811..06555f372cd 100644 --- a/arch/arm/mach-ep93xx/micro9.c +++ b/arch/arm/mach-ep93xx/micro9.c @@ -16,10 +16,9 @@ #include #include #include - +#include #include -#include #include #include diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index c3cbff126d0..a6959c8bb84 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.3 From f69162ae63a5fa045aff35b535906696ba85666f Mon Sep 17 00:00:00 2001 From: Hartley Sweeten Date: Fri, 5 Sep 2008 17:14:35 +0100 Subject: [ARM] 5242/1: ep93xx: bugfix, GPIO port F enable register offset The GPIO port F enable register offset points to the wrong register, 0x5c is the IntStsF register. The correct offset is 0x58. This patch corrects it. Signed-off-by: H Hartley Sweeten Signed-off-by: Russell King --- arch/arm/mach-ep93xx/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-ep93xx') diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index f99f4366939..d6967dedce5 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -157,7 +157,7 @@ static unsigned char gpio_int_type2[3]; static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c }; static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 }; static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 }; -static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x5c }; +static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 }; void ep93xx_gpio_update_int_params(unsigned port) { -- cgit v1.2.3 From 7a1f3701183e2efb45e480517e29f6880e105f7b Mon Sep 17 00:00:00 2001 From: Hartley Sweeten Date: Fri, 5 Sep 2008 17:24:40 +0100 Subject: [ARM] 5243/1: ep93xx: bugfix, GPIO ports C and F are swapped In the GPIOLIB support for EP93xx ports C anf F are swapped. This patch correct it. Signed-off-by: H Hartley Sweeten Signed-off-by: Russell King --- arch/arm/mach-ep93xx/gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-ep93xx') diff --git a/arch/arm/mach-ep93xx/gpio.c b/arch/arm/mach-ep93xx/gpio.c index 0f3fb87ca4b..468d5234da7 100644 --- a/arch/arm/mach-ep93xx/gpio.c +++ b/arch/arm/mach-ep93xx/gpio.c @@ -141,10 +141,10 @@ static void ep93xx_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) static struct ep93xx_gpio_chip ep93xx_gpio_banks[] = { EP93XX_GPIO_BANK("A", 0x00, 0x10, 0), EP93XX_GPIO_BANK("B", 0x04, 0x14, 8), - EP93XX_GPIO_BANK("C", 0x30, 0x34, 40), + EP93XX_GPIO_BANK("C", 0x08, 0x18, 40), EP93XX_GPIO_BANK("D", 0x0c, 0x1c, 24), EP93XX_GPIO_BANK("E", 0x20, 0x24, 32), - EP93XX_GPIO_BANK("F", 0x08, 0x18, 16), + EP93XX_GPIO_BANK("F", 0x30, 0x34, 16), EP93XX_GPIO_BANK("G", 0x38, 0x3c, 48), EP93XX_GPIO_BANK("H", 0x40, 0x44, 56), }; -- cgit v1.2.3 From 92e88aa7fb8190031dca9e04acbf4821bd77941b Mon Sep 17 00:00:00 2001 From: Hartley Sweeten Date: Thu, 2 Oct 2008 17:13:02 +0100 Subject: [ARM] 5276/1: ep93xx: allow selecting UART for early kernel messages Currently on the EP93xx platform early kernel messages go to UART1. Since this UART is the only one that has modem control signals it might be used for another purpose and it is undesirable for those messages to appear. This patch allows one of the other UARTs to be selected in the kernel configuration. It is assumed that the bootloader has configured and initialized the UART since this was the previous assumption. Signed-off-by: H Hartley Sweeten Signed-off-by: Russell King --- arch/arm/mach-ep93xx/Kconfig | 14 ++++++++++++++ arch/arm/mach-ep93xx/include/mach/uncompress.h | 21 +++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) (limited to 'arch/arm/mach-ep93xx') diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig index ea8549bfbef..5a1b8c05c95 100644 --- a/arch/arm/mach-ep93xx/Kconfig +++ b/arch/arm/mach-ep93xx/Kconfig @@ -88,6 +88,20 @@ config MACH_TS72XX Say 'Y' here if you want your kernel to support the Technologic Systems TS-72xx board. +choice + prompt "Select a UART for early kernel messages" + +config EP93XX_EARLY_UART1 + bool "UART1" + +config EP93XX_EARLY_UART2 + bool "UART2" + +config EP93XX_EARLY_UART3 + bool "UART3" + +endchoice + endmenu endif diff --git a/arch/arm/mach-ep93xx/include/mach/uncompress.h b/arch/arm/mach-ep93xx/include/mach/uncompress.h index 1fd2f17de32..16026c2b1c8 100644 --- a/arch/arm/mach-ep93xx/include/mach/uncompress.h +++ b/arch/arm/mach-ep93xx/include/mach/uncompress.h @@ -31,10 +31,19 @@ static void __raw_writel(unsigned int value, unsigned int ptr) *((volatile unsigned int *)ptr) = value; } - -#define PHYS_UART1_DATA 0x808c0000 -#define PHYS_UART1_FLAG 0x808c0018 -#define UART1_FLAG_TXFF 0x20 +#if defined(CONFIG_EP93XX_EARLY_UART1) +#define UART_BASE EP93XX_UART1_PHYS_BASE +#elif defined(CONFIG_EP93XX_EARLY_UART2) +#define UART_BASE EP93XX_UART2_PHYS_BASE +#elif defined(CONFIG_EP93XX_EARLY_UART3) +#define UART_BASE EP93XX_UART3_PHYS_BASE +#else +#define UART_BASE EP93XX_UART1_PHYS_BASE +#endif + +#define PHYS_UART_DATA (UART_BASE + 0x00) +#define PHYS_UART_FLAG (UART_BASE + 0x18) +#define UART_FLAG_TXFF 0x20 static inline void putc(int c) { @@ -42,11 +51,11 @@ static inline void putc(int c) for (i = 0; i < 1000; i++) { /* Transmit fifo not full? */ - if (!(__raw_readb(PHYS_UART1_FLAG) & UART1_FLAG_TXFF)) + if (!(__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF)) break; } - __raw_writeb(c, PHYS_UART1_DATA); + __raw_writeb(c, PHYS_UART_DATA); } static inline void flush(void) -- cgit v1.2.3 From a0a08fdca534e1dffc6d8bb239f53177ab06f946 Mon Sep 17 00:00:00 2001 From: Hartley Sweeten Date: Sat, 4 Oct 2008 20:01:49 +0100 Subject: [ARM] 5273/2: ep93xx: move ethernet support into core.c All EP93xx based systems can support Ethernet. This patch moves the platform_device setup from the various board support files into the core support file. The Ethernet driver data still remains in the individual platform setup files to allow specific platform configuration. This also adds Ethernet support to the edb9302, edb9312, and edb9315 platforms. Signed-off-by: H Hartley Sweeten Signed-off-by: Russell King --- arch/arm/mach-ep93xx/adssphere.c | 26 +-------------------- arch/arm/mach-ep93xx/core.c | 35 ++++++++++++++++++++++++++++ arch/arm/mach-ep93xx/edb9302.c | 6 +++++ arch/arm/mach-ep93xx/edb9302a.c | 26 +-------------------- arch/arm/mach-ep93xx/edb9307.c | 26 +-------------------- arch/arm/mach-ep93xx/edb9312.c | 6 +++++ arch/arm/mach-ep93xx/edb9315.c | 6 +++++ arch/arm/mach-ep93xx/edb9315a.c | 26 +-------------------- arch/arm/mach-ep93xx/gesbc9312.c | 27 +++------------------ arch/arm/mach-ep93xx/include/mach/platform.h | 12 +++++----- arch/arm/mach-ep93xx/micro9.c | 31 +----------------------- arch/arm/mach-ep93xx/ts72xx.c | 26 +-------------------- 12 files changed, 68 insertions(+), 185 deletions(-) (limited to 'arch/arm/mach-ep93xx') diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c index aa1fb352fb8..8e3bbb5299e 100644 --- a/arch/arm/mach-ep93xx/adssphere.c +++ b/arch/arm/mach-ep93xx/adssphere.c @@ -47,36 +47,12 @@ static struct ep93xx_eth_data adssphere_eth_data = { .phy_id = 1, }; -static struct resource adssphere_eth_resource[] = { - { - .start = EP93XX_ETHERNET_PHYS_BASE, - .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_EP93XX_ETHERNET, - .end = IRQ_EP93XX_ETHERNET, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device adssphere_eth_device = { - .name = "ep93xx-eth", - .id = -1, - .dev = { - .platform_data = &adssphere_eth_data, - }, - .num_resources = 2, - .resource = adssphere_eth_resource, -}; - static void __init adssphere_init_machine(void) { ep93xx_init_devices(); platform_device_register(&adssphere_flash); - memcpy(adssphere_eth_data.dev_addr, - (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); - platform_device_register(&adssphere_eth_device); + ep93xx_register_eth(&adssphere_eth_data, 1); } MACHINE_START(ADSSPHERE, "ADS Sphere board") diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index d6967dedce5..52ee8aa046c 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -461,6 +461,41 @@ static struct platform_device ep93xx_ohci_device = { .resource = ep93xx_ohci_resources, }; +static struct ep93xx_eth_data ep93xx_eth_data; + +static struct resource ep93xx_eth_resource[] = { + { + .start = EP93XX_ETHERNET_PHYS_BASE, + .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, + .flags = IORESOURCE_MEM, + }, { + .start = IRQ_EP93XX_ETHERNET, + .end = IRQ_EP93XX_ETHERNET, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device ep93xx_eth_device = { + .name = "ep93xx-eth", + .id = -1, + .dev = { + .platform_data = &ep93xx_eth_data, + }, + .num_resources = ARRAY_SIZE(ep93xx_eth_resource), + .resource = ep93xx_eth_resource, +}; + +void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr) +{ + if (copy_addr) { + memcpy(data->dev_addr, + (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); + } + + ep93xx_eth_data = *data; + platform_device_register(&ep93xx_eth_device); +} + extern void ep93xx_gpio_init(void); void __init ep93xx_init_devices(void) diff --git a/arch/arm/mach-ep93xx/edb9302.c b/arch/arm/mach-ep93xx/edb9302.c index 97550c0ad7b..899784f3b7b 100644 --- a/arch/arm/mach-ep93xx/edb9302.c +++ b/arch/arm/mach-ep93xx/edb9302.c @@ -43,10 +43,16 @@ static struct platform_device edb9302_flash = { .resource = &edb9302_flash_resource, }; +static struct ep93xx_eth_data edb9302_eth_data = { + .phy_id = 1, +}; + static void __init edb9302_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9302_flash); + + ep93xx_register_eth(&edb9302_eth_data, 1); } MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board") diff --git a/arch/arm/mach-ep93xx/edb9302a.c b/arch/arm/mach-ep93xx/edb9302a.c index 99b01d44bf1..ea7e4eb0cc2 100644 --- a/arch/arm/mach-ep93xx/edb9302a.c +++ b/arch/arm/mach-ep93xx/edb9302a.c @@ -47,36 +47,12 @@ static struct ep93xx_eth_data edb9302a_eth_data = { .phy_id = 1, }; -static struct resource edb9302a_eth_resource[] = { - { - .start = EP93XX_ETHERNET_PHYS_BASE, - .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_EP93XX_ETHERNET, - .end = IRQ_EP93XX_ETHERNET, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device edb9302a_eth_device = { - .name = "ep93xx-eth", - .id = -1, - .dev = { - .platform_data = &edb9302a_eth_data, - }, - .num_resources = 2, - .resource = edb9302a_eth_resource, -}; - static void __init edb9302a_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9302a_flash); - memcpy(edb9302a_eth_data.dev_addr, - (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); - platform_device_register(&edb9302a_eth_device); + ep93xx_register_eth(&edb9302a_eth_data, 1); } MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board") diff --git a/arch/arm/mach-ep93xx/edb9307.c b/arch/arm/mach-ep93xx/edb9307.c index 9fb72d01a36..7dee28e9d7f 100644 --- a/arch/arm/mach-ep93xx/edb9307.c +++ b/arch/arm/mach-ep93xx/edb9307.c @@ -47,36 +47,12 @@ static struct ep93xx_eth_data edb9307_eth_data = { .phy_id = 1, }; -static struct resource edb9307_eth_resource[] = { - { - .start = EP93XX_ETHERNET_PHYS_BASE, - .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_EP93XX_ETHERNET, - .end = IRQ_EP93XX_ETHERNET, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device edb9307_eth_device = { - .name = "ep93xx-eth", - .id = -1, - .dev = { - .platform_data = &edb9307_eth_data, - }, - .num_resources = 2, - .resource = edb9307_eth_resource, -}; - static void __init edb9307_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9307_flash); - memcpy(edb9307_eth_data.dev_addr, - (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); - platform_device_register(&edb9307_eth_device); + ep93xx_register_eth(&edb9307_eth_data, 1); } MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board") diff --git a/arch/arm/mach-ep93xx/edb9312.c b/arch/arm/mach-ep93xx/edb9312.c index 87267a574f5..3f660d1fc96 100644 --- a/arch/arm/mach-ep93xx/edb9312.c +++ b/arch/arm/mach-ep93xx/edb9312.c @@ -44,10 +44,16 @@ static struct platform_device edb9312_flash = { .resource = &edb9312_flash_resource, }; +static struct ep93xx_eth_data edb9312_eth_data = { + .phy_id = 1, +}; + static void __init edb9312_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9312_flash); + + ep93xx_register_eth(&edb9312_eth_data, 1); } MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board") diff --git a/arch/arm/mach-ep93xx/edb9315.c b/arch/arm/mach-ep93xx/edb9315.c index 7e373950be4..a1e76c329da 100644 --- a/arch/arm/mach-ep93xx/edb9315.c +++ b/arch/arm/mach-ep93xx/edb9315.c @@ -43,10 +43,16 @@ static struct platform_device edb9315_flash = { .resource = &edb9315_flash_resource, }; +static struct ep93xx_eth_data edb9315_eth_data = { + .phy_id = 1, +}; + static void __init edb9315_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9315_flash); + + ep93xx_register_eth(&edb9315_eth_data, 1); } MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board") diff --git a/arch/arm/mach-ep93xx/edb9315a.c b/arch/arm/mach-ep93xx/edb9315a.c index 08a7c9bfb68..cbd77bf18aa 100644 --- a/arch/arm/mach-ep93xx/edb9315a.c +++ b/arch/arm/mach-ep93xx/edb9315a.c @@ -47,36 +47,12 @@ static struct ep93xx_eth_data edb9315a_eth_data = { .phy_id = 1, }; -static struct resource edb9315a_eth_resource[] = { - { - .start = EP93XX_ETHERNET_PHYS_BASE, - .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_EP93XX_ETHERNET, - .end = IRQ_EP93XX_ETHERNET, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device edb9315a_eth_device = { - .name = "ep93xx-eth", - .id = -1, - .dev = { - .platform_data = &edb9315a_eth_data, - }, - .num_resources = 2, - .resource = edb9315a_eth_resource, -}; - static void __init edb9315a_init_machine(void) { ep93xx_init_devices(); platform_device_register(&edb9315a_flash); - memcpy(edb9315a_eth_data.dev_addr, - (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); - platform_device_register(&edb9315a_eth_device); + ep93xx_register_eth(&edb9315a_eth_data, 1); } MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board") diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c index 9b41ec1f089..8a67e53cba6 100644 --- a/arch/arm/mach-ep93xx/gesbc9312.c +++ b/arch/arm/mach-ep93xx/gesbc9312.c @@ -44,36 +44,15 @@ static struct platform_device gesbc9312_flash = { }; static struct ep93xx_eth_data gesbc9312_eth_data = { - .phy_id = 1, -}; - -static struct resource gesbc9312_eth_resource[] = { - { - .start = EP93XX_ETHERNET_PHYS_BASE, - .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_EP93XX_ETHERNET, - .end = IRQ_EP93XX_ETHERNET, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device gesbc9312_eth_device = { - .name = "ep93xx-eth", - .id = -1, - .dev = { - .platform_data = &gesbc9312_eth_data, - }, - .num_resources = 2, - .resource = gesbc9312_eth_resource, + .phy_id = 1, }; static void __init gesbc9312_init_machine(void) { ep93xx_init_devices(); platform_device_register(&gesbc9312_flash); - platform_device_register(&gesbc9312_eth_device); + + ep93xx_register_eth(&gesbc9312_eth_data, 0); } MACHINE_START(GESBC9312, "Glomation GESBC-9312-sx") diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index b5c182473f5..db2489d3bda 100644 --- a/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/arch/arm/mach-ep93xx/include/mach/platform.h @@ -4,17 +4,17 @@ #ifndef __ASSEMBLY__ -void ep93xx_map_io(void); -void ep93xx_init_irq(void); -void ep93xx_init_time(unsigned long); -void ep93xx_init_devices(void); -extern struct sys_timer ep93xx_timer; - struct ep93xx_eth_data { unsigned char dev_addr[6]; unsigned char phy_id; }; +void ep93xx_map_io(void); +void ep93xx_init_irq(void); +void ep93xx_init_time(unsigned long); +void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); +void ep93xx_init_devices(void); +extern struct sys_timer ep93xx_timer; #endif diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c index de047a5c811..72c8d44f4dd 100644 --- a/arch/arm/mach-ep93xx/micro9.c +++ b/arch/arm/mach-ep93xx/micro9.c @@ -29,38 +29,9 @@ static struct ep93xx_eth_data micro9_eth_data = { .phy_id = 0x1f, }; -static struct resource micro9_eth_resource[] = { - { - .start = EP93XX_ETHERNET_PHYS_BASE, - .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_EP93XX_ETHERNET, - .end = IRQ_EP93XX_ETHERNET, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device micro9_eth_device = { - .name = "ep93xx-eth", - .id = -1, - .dev = { - .platform_data = µ9_eth_data, - }, - .num_resources = ARRAY_SIZE(micro9_eth_resource), - .resource = micro9_eth_resource, -}; - -static void __init micro9_eth_init(void) -{ - memcpy(micro9_eth_data.dev_addr, - (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); - platform_device_register(µ9_eth_device); -} - static void __init micro9_init(void) { - micro9_eth_init(); + ep93xx_register_eth(µ9_eth_data, 1); } /* diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index c3cbff126d0..61e7d664fd2 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c @@ -161,28 +161,6 @@ static struct ep93xx_eth_data ts72xx_eth_data = { .phy_id = 1, }; -static struct resource ts72xx_eth_resource[] = { - { - .start = EP93XX_ETHERNET_PHYS_BASE, - .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff, - .flags = IORESOURCE_MEM, - }, { - .start = IRQ_EP93XX_ETHERNET, - .end = IRQ_EP93XX_ETHERNET, - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device ts72xx_eth_device = { - .name = "ep93xx-eth", - .id = -1, - .dev = { - .platform_data = &ts72xx_eth_data, - }, - .num_resources = 2, - .resource = ts72xx_eth_resource, -}; - static void __init ts72xx_init_machine(void) { ep93xx_init_devices(); @@ -190,9 +168,7 @@ static void __init ts72xx_init_machine(void) platform_device_register(&ts72xx_flash); platform_device_register(&ts72xx_rtc_device); - memcpy(ts72xx_eth_data.dev_addr, - (void *)(EP93XX_ETHERNET_BASE + 0x50), 6); - platform_device_register(&ts72xx_eth_device); + ep93xx_register_eth(&ts72xx_eth_data, 1); } MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC") -- cgit v1.2.3 From 446b097a426f0fa7d37bd2576bdf6d72d6483ac1 Mon Sep 17 00:00:00 2001 From: Hartley Sweeten Date: Mon, 6 Oct 2008 22:43:02 +0100 Subject: [ARM] 5293/1: ep93xx: add defines for external chipselects This patch adds defines for the external chipselect physical base addresses available with the EP93xx. These are meant to be used in the platform init code. In addition, documentation about the synchronous/asynchronous boot modes for the EP93xx and a reference to errata about issues with synchronous booting has been added. Signed-off-by: Signed-off-by: Russell King --- arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'arch/arm/mach-ep93xx') diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h index 9f4458c8e07..22d6c9a6e4c 100644 --- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h @@ -5,6 +5,40 @@ #ifndef __ASM_ARCH_EP93XX_REGS_H #define __ASM_ARCH_EP93XX_REGS_H +/* + * EP93xx Physical Memory Map: + * + * The ASDO pin is sampled at system reset to select a synchronous or + * asynchronous boot configuration. When ASDO is "1" (i.e. pulled-up) + * the synchronous boot mode is selected. When ASDO is "0" (i.e + * pulled-down) the asynchronous boot mode is selected. + * + * In synchronous boot mode nSDCE3 is decoded starting at physical address + * 0x00000000 and nCS0 is decoded starting at 0xf0000000. For asynchronous + * boot mode they are swapped with nCS0 decoded at 0x00000000 ann nSDCE3 + * decoded at 0xf0000000. + * + * There is known errata for the EP93xx dealing with External Memory + * Configurations. Please refer to "AN273: EP93xx Silicon Rev E Design + * Guidelines" for more information. This document can be found at: + * + * http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf + */ + +#define EP93XX_CS0_PHYS_BASE_ASYNC 0x00000000 /* ASDO Pin = 0 */ +#define EP93XX_SDCE3_PHYS_BASE_SYNC 0x00000000 /* ASDO Pin = 1 */ +#define EP93XX_CS1_PHYS_BASE 0x10000000 +#define EP93XX_CS2_PHYS_BASE 0x20000000 +#define EP93XX_CS3_PHYS_BASE 0x30000000 +#define EP93XX_PCMCIA_PHYS_BASE 0x40000000 +#define EP93XX_CS6_PHYS_BASE 0x60000000 +#define EP93XX_CS7_PHYS_BASE 0x70000000 +#define EP93XX_SDCE0_PHYS_BASE 0xc0000000 +#define EP93XX_SDCE1_PHYS_BASE 0xd0000000 +#define EP93XX_SDCE2_PHYS_BASE 0xe0000000 +#define EP93XX_SDCE3_PHYS_BASE_ASYNC 0xf0000000 /* ASDO Pin = 0 */ +#define EP93XX_CS0_PHYS_BASE_SYNC 0xf0000000 /* ASDO Pin = 1 */ + /* * EP93xx linux memory map: * -- cgit v1.2.3