diff options
author | Paul Parsons <lost.distance@yahoo.com> | 2012-02-26 20:17:19 -0500 |
---|---|---|
committer | Haojian Zhuang <haojian.zhuang@marvell.com> | 2012-02-27 21:20:35 -0500 |
commit | 11407e5713ad85f416705a1ba0daf490ffaeda42 (patch) | |
tree | b4a9f1eb870666b6d7fae0ff0622e9d6509dbddb /arch/arm | |
parent | 6b21d18ed50c7d145220b0724ea7f2613abf0f95 (diff) |
pxa/hx4700: Correct StrataFlash block size discovery
The HP iPAQ hx4700 has 128Mb of flash provided by two Intel StrataFlash devices.
The hx4700 platform configuration defines a single 128Mb flash resource,
resulting in the MTD physmap-flash driver probing the first device only and
presuming the second device is identical:
physmap platform flash device: 08000000 at 00000000
physmap-flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000089 Chip ID 0x008816
physmap-flash: Found 2 x16 devices at 0x4000000 in 32-bit bank
<snip>
erase region 0: offset=0x0,size=0x10000,blocks=4
erase region 1: offset=0x40000,size=0x40000,blocks=255
erase region 2: offset=0x4000000,size=0x10000,blocks=4
erase region 3: offset=0x4040000,size=0x40000,blocks=255
physmap-flash: 2 set(s) of 2 interleaved chips --> 32 partitions of 4096 KiB
Unfortunately the two devices are not identical. The first has a device ID of
0x8816, identifying a bottom parameter device. The second has a device ID of
0x8813, identifying a top parameter device. By not probing the second device,
physmap-flash does not discover the correct block sizes.
This patch splits the configuration into two 64Mb flash resources, forcing
physmap-flash to probe both devices and thus discover the correct block sizes:
physmap platform flash device: 04000000 at 00000000
physmap-flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000089 Chip ID 0x008816
<snip>
erase region 0: offset=0x0,size=0x10000,blocks=4
erase region 1: offset=0x40000,size=0x40000,blocks=255
physmap-flash: 1 set(s) of 2 interleaved chips --> 16 partitions of 4096 KiB
physmap platform flash device: 04000000 at 04000000
physmap-flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000089 Chip ID 0x008813
<snip>
erase region 0: offset=0x0,size=0x40000,blocks=255
erase region 1: offset=0x3fc0000,size=0x10000,blocks=4
physmap-flash: 1 set(s) of 2 interleaved chips --> 16 partitions of 4096 KiB
Concatenating MTD devices:
(0): "physmap-flash"
(1): "physmap-flash"
into device "physmap-flash"
Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-pxa/hx4700.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index fb9b62dcf4ca..de877a9d3e4c 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c | |||
@@ -704,10 +704,9 @@ static void hx4700_set_vpp(struct platform_device *pdev, int vpp) | |||
704 | gpio_set_value(GPIO91_HX4700_FLASH_VPEN, vpp); | 704 | gpio_set_value(GPIO91_HX4700_FLASH_VPEN, vpp); |
705 | } | 705 | } |
706 | 706 | ||
707 | static struct resource strataflash_resource = { | 707 | static struct resource strataflash_resource[] = { |
708 | .start = PXA_CS0_PHYS, | 708 | [0] = DEFINE_RES_MEM(PXA_CS0_PHYS, SZ_64M), |
709 | .end = PXA_CS0_PHYS + SZ_128M - 1, | 709 | [1] = DEFINE_RES_MEM(PXA_CS0_PHYS + SZ_64M, SZ_64M), |
710 | .flags = IORESOURCE_MEM, | ||
711 | }; | 710 | }; |
712 | 711 | ||
713 | static struct physmap_flash_data strataflash_data = { | 712 | static struct physmap_flash_data strataflash_data = { |
@@ -718,8 +717,8 @@ static struct physmap_flash_data strataflash_data = { | |||
718 | static struct platform_device strataflash = { | 717 | static struct platform_device strataflash = { |
719 | .name = "physmap-flash", | 718 | .name = "physmap-flash", |
720 | .id = -1, | 719 | .id = -1, |
721 | .resource = &strataflash_resource, | 720 | .resource = strataflash_resource, |
722 | .num_resources = 1, | 721 | .num_resources = ARRAY_SIZE(strataflash_resource), |
723 | .dev = { | 722 | .dev = { |
724 | .platform_data = &strataflash_data, | 723 | .platform_data = &strataflash_data, |
725 | }, | 724 | }, |