From 20646337e8c64c9067e2d1f9d7e48181764ea7db Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 21 Jun 2010 21:03:18 +0100 Subject: [PATCH] --- yaml --- r: 201410 b: refs/heads/master c: 309caa9cc6ff39d261264ec4ff10e29489afc8f8 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-ep93xx/adssphere.c | 24 +++++++++- trunk/arch/arm/mach-ep93xx/core.c | 46 +------------------ trunk/arch/arm/mach-ep93xx/edb93xx.c | 31 ++++++++++++- trunk/arch/arm/mach-ep93xx/gesbc9312.c | 24 +++++++++- .../arm/mach-ep93xx/include/mach/platform.h | 3 -- trunk/arch/arm/mach-ep93xx/micro9.c | 37 +++++++++++---- trunk/arch/arm/mach-ep93xx/simone.c | 24 +++++++++- trunk/arch/arm/mach-ep93xx/ts72xx.c | 27 +++++++++-- trunk/arch/arm/mm/ioremap.c | 6 +++ 10 files changed, 157 insertions(+), 67 deletions(-) diff --git a/[refs] b/[refs] index 086dae7adb8d..2161385f7723 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a0fb007bf0c7de9ae361a9ad3821df4c69d4d2d9 +refs/heads/master: 309caa9cc6ff39d261264ec4ff10e29489afc8f8 diff --git a/trunk/arch/arm/mach-ep93xx/adssphere.c b/trunk/arch/arm/mach-ep93xx/adssphere.c index f744f676783f..3a1a855bfdca 100644 --- a/trunk/arch/arm/mach-ep93xx/adssphere.c +++ b/trunk/arch/arm/mach-ep93xx/adssphere.c @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -20,6 +21,26 @@ #include +static struct physmap_flash_data adssphere_flash_data = { + .width = 4, +}; + +static struct resource adssphere_flash_resource = { + .start = EP93XX_CS6_PHYS_BASE, + .end = EP93XX_CS6_PHYS_BASE + SZ_32M - 1, + .flags = IORESOURCE_MEM, +}; + +static struct platform_device adssphere_flash = { + .name = "physmap-flash", + .id = 0, + .dev = { + .platform_data = &adssphere_flash_data, + }, + .num_resources = 1, + .resource = &adssphere_flash_resource, +}; + static struct ep93xx_eth_data __initdata adssphere_eth_data = { .phy_id = 1, }; @@ -27,7 +48,8 @@ static struct ep93xx_eth_data __initdata adssphere_eth_data = { static void __init adssphere_init_machine(void) { ep93xx_init_devices(); - ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M); + platform_device_register(&adssphere_flash); + ep93xx_register_eth(&adssphere_eth_data, 1); } diff --git a/trunk/arch/arm/mach-ep93xx/core.c b/trunk/arch/arm/mach-ep93xx/core.c index 8e37a045188c..9092677f63eb 100644 --- a/trunk/arch/arm/mach-ep93xx/core.c +++ b/trunk/arch/arm/mach-ep93xx/core.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -216,8 +215,8 @@ void ep93xx_devcfg_set_clear(unsigned int set_bits, unsigned int clear_bits) spin_lock_irqsave(&syscon_swlock, flags); val = __raw_readl(EP93XX_SYSCON_DEVCFG); - val &= ~clear_bits; val |= set_bits; + val &= ~clear_bits; __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK); __raw_writel(val, EP93XX_SYSCON_DEVCFG); @@ -348,43 +347,6 @@ static struct platform_device ep93xx_ohci_device = { }; -/************************************************************************* - * EP93xx physmap'ed flash - *************************************************************************/ -static struct physmap_flash_data ep93xx_flash_data; - -static struct resource ep93xx_flash_resource = { - .flags = IORESOURCE_MEM, -}; - -static struct platform_device ep93xx_flash = { - .name = "physmap-flash", - .id = 0, - .dev = { - .platform_data = &ep93xx_flash_data, - }, - .num_resources = 1, - .resource = &ep93xx_flash_resource, -}; - -/** - * ep93xx_register_flash() - Register the external flash device. - * @width: bank width in octets - * @start: resource start address - * @size: resource size - */ -void __init ep93xx_register_flash(unsigned int width, - resource_size_t start, resource_size_t size) -{ - ep93xx_flash_data.width = width; - - ep93xx_flash_resource.start = start; - ep93xx_flash_resource.end = start + size - 1; - - platform_device_register(&ep93xx_flash); -} - - /************************************************************************* * EP93xx ethernet peripheral handling *************************************************************************/ @@ -658,11 +620,6 @@ static struct platform_device ep93xx_fb_device = { .resource = ep93xx_fb_resource, }; -static struct platform_device ep93xx_bl_device = { - .name = "ep93xx-bl", - .id = -1, -}; - /** * ep93xx_register_fb - Register the framebuffer platform device. * @data: platform specific framebuffer configuration (__initdata) @@ -671,7 +628,6 @@ void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data) { ep93xxfb_data = *data; platform_device_register(&ep93xx_fb_device); - platform_device_register(&ep93xx_bl_device); } diff --git a/trunk/arch/arm/mach-ep93xx/edb93xx.c b/trunk/arch/arm/mach-ep93xx/edb93xx.c index c2ce9034ba87..3884182cd362 100644 --- a/trunk/arch/arm/mach-ep93xx/edb93xx.c +++ b/trunk/arch/arm/mach-ep93xx/edb93xx.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -37,13 +38,39 @@ #include +static struct physmap_flash_data edb93xx_flash_data; + +static struct resource edb93xx_flash_resource = { + .flags = IORESOURCE_MEM, +}; + +static struct platform_device edb93xx_flash = { + .name = "physmap-flash", + .id = 0, + .dev = { + .platform_data = &edb93xx_flash_data, + }, + .num_resources = 1, + .resource = &edb93xx_flash_resource, +}; + +static void __init __edb93xx_register_flash(unsigned int width, + resource_size_t start, resource_size_t size) +{ + edb93xx_flash_data.width = width; + edb93xx_flash_resource.start = start; + edb93xx_flash_resource.end = start + size - 1; + + platform_device_register(&edb93xx_flash); +} + static void __init edb93xx_register_flash(void) { if (machine_is_edb9307() || machine_is_edb9312() || machine_is_edb9315()) { - ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M); + __edb93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M); } else { - ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M); + __edb93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M); } } diff --git a/trunk/arch/arm/mach-ep93xx/gesbc9312.c b/trunk/arch/arm/mach-ep93xx/gesbc9312.c index d97168c0ba33..a809618e9f05 100644 --- a/trunk/arch/arm/mach-ep93xx/gesbc9312.c +++ b/trunk/arch/arm/mach-ep93xx/gesbc9312.c @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -20,6 +21,26 @@ #include +static struct physmap_flash_data gesbc9312_flash_data = { + .width = 4, +}; + +static struct resource gesbc9312_flash_resource = { + .start = EP93XX_CS6_PHYS_BASE, + .end = EP93XX_CS6_PHYS_BASE + SZ_8M - 1, + .flags = IORESOURCE_MEM, +}; + +static struct platform_device gesbc9312_flash = { + .name = "physmap-flash", + .id = 0, + .dev = { + .platform_data = &gesbc9312_flash_data, + }, + .num_resources = 1, + .resource = &gesbc9312_flash_resource, +}; + static struct ep93xx_eth_data __initdata gesbc9312_eth_data = { .phy_id = 1, }; @@ -27,7 +48,8 @@ static struct ep93xx_eth_data __initdata gesbc9312_eth_data = { static void __init gesbc9312_init_machine(void) { ep93xx_init_devices(); - ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_8M); + platform_device_register(&gesbc9312_flash); + ep93xx_register_eth(&gesbc9312_eth_data, 0); } diff --git a/trunk/arch/arm/mach-ep93xx/include/mach/platform.h b/trunk/arch/arm/mach-ep93xx/include/mach/platform.h index a6c09176334c..9a4413dd44bb 100644 --- a/trunk/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/trunk/arch/arm/mach-ep93xx/include/mach/platform.h @@ -43,9 +43,6 @@ static inline void ep93xx_devcfg_clear_bits(unsigned int bits) unsigned int ep93xx_chip_revision(void); -void ep93xx_register_flash(unsigned int width, - resource_size_t start, resource_size_t size); - void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); void ep93xx_register_i2c(struct i2c_gpio_platform_data *data, struct i2c_board_info *devices, int num); diff --git a/trunk/arch/arm/mach-ep93xx/micro9.c b/trunk/arch/arm/mach-ep93xx/micro9.c index 2ba776320a82..1cc911b4efa6 100644 --- a/trunk/arch/arm/mach-ep93xx/micro9.c +++ b/trunk/arch/arm/mach-ep93xx/micro9.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -30,6 +31,31 @@ * Micro9-Lite uses a separate MTD map driver for flash support * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1 *************************************************************************/ +static struct physmap_flash_data micro9_flash_data; + +static struct resource micro9_flash_resource = { + .start = EP93XX_CS1_PHYS_BASE, + .end = EP93XX_CS1_PHYS_BASE + SZ_64M - 1, + .flags = IORESOURCE_MEM, +}; + +static struct platform_device micro9_flash = { + .name = "physmap-flash", + .id = 0, + .dev = { + .platform_data = µ9_flash_data, + }, + .num_resources = 1, + .resource = µ9_flash_resource, +}; + +static void __init __micro9_register_flash(unsigned int width) +{ + micro9_flash_data.width = width; + + platform_device_register(µ9_flash); +} + static unsigned int __init micro9_detect_bootwidth(void) { u32 v; @@ -44,17 +70,10 @@ static unsigned int __init micro9_detect_bootwidth(void) static void __init micro9_register_flash(void) { - unsigned int width; - if (machine_is_micro9()) - width = 4; + __micro9_register_flash(4); else if (machine_is_micro9m() || machine_is_micro9s()) - width = micro9_detect_bootwidth(); - else - width = 0; - - if (width) - ep93xx_register_flash(width, EP93XX_CS1_PHYS_BASE, SZ_64M); + __micro9_register_flash(micro9_detect_bootwidth()); } diff --git a/trunk/arch/arm/mach-ep93xx/simone.c b/trunk/arch/arm/mach-ep93xx/simone.c index 5dded5884133..388aec95f60e 100644 --- a/trunk/arch/arm/mach-ep93xx/simone.c +++ b/trunk/arch/arm/mach-ep93xx/simone.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +29,26 @@ #include #include +static struct physmap_flash_data simone_flash_data = { + .width = 2, +}; + +static struct resource simone_flash_resource = { + .start = EP93XX_CS6_PHYS_BASE, + .end = EP93XX_CS6_PHYS_BASE + SZ_8M - 1, + .flags = IORESOURCE_MEM, +}; + +static struct platform_device simone_flash = { + .name = "physmap-flash", + .id = 0, + .num_resources = 1, + .resource = &simone_flash_resource, + .dev = { + .platform_data = &simone_flash_data, + }, +}; + static struct ep93xx_eth_data __initdata simone_eth_data = { .phy_id = 1, }; @@ -56,7 +77,8 @@ static struct i2c_board_info __initdata simone_i2c_board_info[] = { static void __init simone_init_machine(void) { ep93xx_init_devices(); - ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_8M); + + platform_device_register(&simone_flash); ep93xx_register_eth(&simone_eth_data, 1); ep93xx_register_fb(&simone_fb_info); ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info, diff --git a/trunk/arch/arm/mach-ep93xx/ts72xx.c b/trunk/arch/arm/mach-ep93xx/ts72xx.c index 93aeab8af705..ae7319e588c7 100644 --- a/trunk/arch/arm/mach-ep93xx/ts72xx.c +++ b/trunk/arch/arm/mach-ep93xx/ts72xx.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -172,13 +173,31 @@ static struct platform_device ts72xx_nand_flash = { }; +/************************************************************************* + * NOR flash (TS-7200 only) + *************************************************************************/ +static struct physmap_flash_data ts72xx_nor_data = { + .width = 2, +}; + +static struct resource ts72xx_nor_resource = { + .start = EP93XX_CS6_PHYS_BASE, + .end = EP93XX_CS6_PHYS_BASE + SZ_16M - 1, + .flags = IORESOURCE_MEM, +}; + +static struct platform_device ts72xx_nor_flash = { + .name = "physmap-flash", + .id = 0, + .dev.platform_data = &ts72xx_nor_data, + .resource = &ts72xx_nor_resource, + .num_resources = 1, +}; + static void __init ts72xx_register_flash(void) { - /* - * TS7200 has NOR flash all other TS72xx board have NAND flash. - */ if (board_is_ts7200()) { - ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M); + platform_device_register(&ts72xx_nor_flash); } else { resource_size_t start; diff --git a/trunk/arch/arm/mm/ioremap.c b/trunk/arch/arm/mm/ioremap.c index 28c8b950ef04..03f11935ed08 100644 --- a/trunk/arch/arm/mm/ioremap.c +++ b/trunk/arch/arm/mm/ioremap.c @@ -268,6 +268,12 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn, if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK)) return NULL; + /* + * Don't allow RAM to be mapped - this causes problems with ARMv6+ + */ + if (WARN_ON(pfn_valid(pfn))) + return NULL; + type = get_mem_type(mtype); if (!type) return NULL;