diff options
| author | Mike Frysinger <michael.frysinger@analog.com> | 2008-01-24 04:14:04 -0500 |
|---|---|---|
| committer | Bryan Wu <bryan.wu@analog.com> | 2008-01-24 04:14:04 -0500 |
| commit | de8c43f2fca9bb06f3ee87b38a61d5d9966ce221 (patch) | |
| tree | c39c995e31e29703056cd547f5aa4e3a967ba9ab | |
| parent | 96a5c6f9bef027e1187b2f168bb3e08ef21d0b6f (diff) | |
[Blackfin] arch: use common flash driver to setup partitions rather than the bf5xx-flash driver
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
| -rw-r--r-- | arch/blackfin/Kconfig | 5 | ||||
| -rw-r--r-- | arch/blackfin/mach-bf533/boards/stamp.c | 52 | ||||
| -rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 45 | ||||
| -rw-r--r-- | arch/blackfin/mach-bf548/boards/ezkit.c | 40 | ||||
| -rw-r--r-- | arch/blackfin/mach-bf561/boards/ezkit.c | 42 |
5 files changed, 174 insertions, 10 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index ecb356ed8db8..fc7ca86ac8bf 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
| @@ -268,11 +268,6 @@ config MEM_MT48LC32M16A2TG_75 | |||
| 268 | depends on (BFIN527_EZKIT) | 268 | depends on (BFIN527_EZKIT) |
| 269 | default y | 269 | default y |
| 270 | 270 | ||
| 271 | config BFIN_SHARED_FLASH_ENET | ||
| 272 | bool | ||
| 273 | depends on (BFIN533_STAMP) | ||
| 274 | default y | ||
| 275 | |||
| 276 | source "arch/blackfin/mach-bf527/Kconfig" | 271 | source "arch/blackfin/mach-bf527/Kconfig" |
| 277 | source "arch/blackfin/mach-bf533/Kconfig" | 272 | source "arch/blackfin/mach-bf533/Kconfig" |
| 278 | source "arch/blackfin/mach-bf561/Kconfig" | 273 | source "arch/blackfin/mach-bf561/Kconfig" |
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c index cd87df730ef5..ac52b040b336 100644 --- a/arch/blackfin/mach-bf533/boards/stamp.c +++ b/arch/blackfin/mach-bf533/boards/stamp.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <linux/platform_device.h> | 32 | #include <linux/platform_device.h> |
| 33 | #include <linux/mtd/mtd.h> | 33 | #include <linux/mtd/mtd.h> |
| 34 | #include <linux/mtd/partitions.h> | 34 | #include <linux/mtd/partitions.h> |
| 35 | #include <linux/mtd/physmap.h> | ||
| 35 | #include <linux/spi/spi.h> | 36 | #include <linux/spi/spi.h> |
| 36 | #include <linux/spi/flash.h> | 37 | #include <linux/spi/flash.h> |
| 37 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | 38 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| @@ -108,6 +109,50 @@ static struct platform_device net2272_bfin_device = { | |||
| 108 | }; | 109 | }; |
| 109 | #endif | 110 | #endif |
| 110 | 111 | ||
| 112 | static struct mtd_partition stamp_partitions[] = { | ||
| 113 | { | ||
| 114 | .name = "Bootloader", | ||
| 115 | .size = 0x20000, | ||
| 116 | .offset = 0, | ||
| 117 | }, { | ||
| 118 | .name = "Kernel", | ||
| 119 | .size = 0xE0000, | ||
| 120 | .offset = MTDPART_OFS_APPEND, | ||
| 121 | }, { | ||
| 122 | .name = "RootFS", | ||
| 123 | .size = MTDPART_SIZ_FULL, | ||
| 124 | .offset = MTDPART_OFS_APPEND, | ||
| 125 | } | ||
| 126 | }; | ||
| 127 | |||
| 128 | static struct physmap_flash_data stamp_flash_data = { | ||
| 129 | .width = 2, | ||
| 130 | .parts = stamp_partitions, | ||
| 131 | .nr_parts = ARRAY_SIZE(stamp_partitions), | ||
| 132 | }; | ||
| 133 | |||
| 134 | static struct resource stamp_flash_resource[] = { | ||
| 135 | { | ||
| 136 | .name = "cfi_probe", | ||
| 137 | .start = 0x20000000, | ||
| 138 | .end = 0x203fffff, | ||
| 139 | .flags = IORESOURCE_MEM, | ||
| 140 | }, { | ||
| 141 | .start = CONFIG_ENET_FLASH_PIN, | ||
| 142 | .flags = IORESOURCE_IRQ, | ||
| 143 | } | ||
| 144 | }; | ||
| 145 | |||
| 146 | static struct platform_device stamp_flash_device = { | ||
| 147 | .name = "BF5xx-Flash", | ||
| 148 | .id = 0, | ||
| 149 | .dev = { | ||
| 150 | .platform_data = &stamp_flash_data, | ||
| 151 | }, | ||
| 152 | .num_resources = ARRAY_SIZE(stamp_flash_resource), | ||
| 153 | .resource = stamp_flash_resource, | ||
| 154 | }; | ||
| 155 | |||
| 111 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 156 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 112 | /* all SPI peripherals info goes here */ | 157 | /* all SPI peripherals info goes here */ |
| 113 | 158 | ||
| @@ -457,6 +502,7 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
| 457 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | 502 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) |
| 458 | &i2c_gpio_device, | 503 | &i2c_gpio_device, |
| 459 | #endif | 504 | #endif |
| 505 | &stamp_flash_device, | ||
| 460 | }; | 506 | }; |
| 461 | 507 | ||
| 462 | static int __init stamp_init(void) | 508 | static int __init stamp_init(void) |
| @@ -469,12 +515,10 @@ static int __init stamp_init(void) | |||
| 469 | return ret; | 515 | return ret; |
| 470 | 516 | ||
| 471 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | 517 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
| 472 | # if defined(CONFIG_BFIN_SHARED_FLASH_ENET) | ||
| 473 | /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */ | 518 | /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */ |
| 474 | bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (1 << CONFIG_ENET_FLASH_PIN)); | 519 | bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (1 << CONFIG_ENET_FLASH_PIN)); |
| 475 | bfin_write_FIO_FLAG_S(1 << CONFIG_ENET_FLASH_PIN); | 520 | bfin_write_FIO_FLAG_S(1 << CONFIG_ENET_FLASH_PIN); |
| 476 | SSYNC(); | 521 | SSYNC(); |
| 477 | # endif | ||
| 478 | #endif | 522 | #endif |
| 479 | 523 | ||
| 480 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 524 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| @@ -491,10 +535,8 @@ arch_initcall(stamp_init); | |||
| 491 | 535 | ||
| 492 | void native_machine_restart(char *cmd) | 536 | void native_machine_restart(char *cmd) |
| 493 | { | 537 | { |
| 494 | #if defined(CONFIG_BFIN_SHARED_FLASH_ENET) | 538 | #define BIT_TO_SET (1 << CONFIG_ENET_FLASH_PIN) |
| 495 | # define BIT_TO_SET (1 << CONFIG_ENET_FLASH_PIN) | ||
| 496 | bfin_write_FIO_INEN(~BIT_TO_SET); | 539 | bfin_write_FIO_INEN(~BIT_TO_SET); |
| 497 | bfin_write_FIO_DIR(BIT_TO_SET); | 540 | bfin_write_FIO_DIR(BIT_TO_SET); |
| 498 | bfin_write_FIO_FLAG_C(BIT_TO_SET); | 541 | bfin_write_FIO_FLAG_C(BIT_TO_SET); |
| 499 | #endif | ||
| 500 | } | 542 | } |
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 37759ac7df2a..772541548b76 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <linux/platform_device.h> | 32 | #include <linux/platform_device.h> |
| 33 | #include <linux/mtd/mtd.h> | 33 | #include <linux/mtd/mtd.h> |
| 34 | #include <linux/mtd/partitions.h> | 34 | #include <linux/mtd/partitions.h> |
| 35 | #include <linux/mtd/physmap.h> | ||
| 35 | #include <linux/spi/spi.h> | 36 | #include <linux/spi/spi.h> |
| 36 | #include <linux/spi/flash.h> | 37 | #include <linux/spi/flash.h> |
| 37 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | 38 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
| @@ -339,6 +340,49 @@ static struct platform_device net2272_bfin_device = { | |||
| 339 | }; | 340 | }; |
| 340 | #endif | 341 | #endif |
| 341 | 342 | ||
| 343 | static struct mtd_partition stamp_partitions[] = { | ||
| 344 | { | ||
| 345 | .name = "Bootloader", | ||
| 346 | .size = 0x20000, | ||
| 347 | .offset = 0, | ||
| 348 | }, { | ||
| 349 | .name = "Kernel", | ||
| 350 | .size = 0xE0000, | ||
| 351 | .offset = MTDPART_OFS_APPEND, | ||
| 352 | }, { | ||
| 353 | .name = "RootFS", | ||
| 354 | .size = 0x400000 - 0x20000 - 0xE0000 - 0x10000, | ||
| 355 | .offset = MTDPART_OFS_APPEND, | ||
| 356 | }, { | ||
| 357 | .name = "MAC Address", | ||
| 358 | .size = MTDPART_SIZ_FULL, | ||
| 359 | .offset = 0x3F0000, | ||
| 360 | .mask_flags = MTD_WRITEABLE, | ||
| 361 | } | ||
| 362 | }; | ||
| 363 | |||
| 364 | static struct physmap_flash_data stamp_flash_data = { | ||
| 365 | .width = 2, | ||
| 366 | .parts = stamp_partitions, | ||
| 367 | .nr_parts = ARRAY_SIZE(stamp_partitions), | ||
| 368 | }; | ||
| 369 | |||
| 370 | static struct resource stamp_flash_resource = { | ||
| 371 | .start = 0x20000000, | ||
| 372 | .end = 0x203fffff, | ||
| 373 | .flags = IORESOURCE_MEM, | ||
| 374 | }; | ||
| 375 | |||
| 376 | static struct platform_device stamp_flash_device = { | ||
| 377 | .name = "physmap-flash", | ||
| 378 | .id = 0, | ||
| 379 | .dev = { | ||
| 380 | .platform_data = &stamp_flash_data, | ||
| 381 | }, | ||
| 382 | .num_resources = 1, | ||
| 383 | .resource = &stamp_flash_resource, | ||
| 384 | }; | ||
| 385 | |||
| 342 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 386 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 343 | /* all SPI peripherals info goes here */ | 387 | /* all SPI peripherals info goes here */ |
| 344 | 388 | ||
| @@ -761,6 +805,7 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
| 761 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | 805 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 762 | &bfin_device_gpiokeys, | 806 | &bfin_device_gpiokeys, |
| 763 | #endif | 807 | #endif |
| 808 | &stamp_flash_device, | ||
| 764 | }; | 809 | }; |
| 765 | 810 | ||
| 766 | static int __init stamp_init(void) | 811 | static int __init stamp_init(void) |
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c index 4ca3288fd07c..14860f04d1bd 100644 --- a/arch/blackfin/mach-bf548/boards/ezkit.c +++ b/arch/blackfin/mach-bf548/boards/ezkit.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <linux/platform_device.h> | 32 | #include <linux/platform_device.h> |
| 33 | #include <linux/mtd/mtd.h> | 33 | #include <linux/mtd/mtd.h> |
| 34 | #include <linux/mtd/partitions.h> | 34 | #include <linux/mtd/partitions.h> |
| 35 | #include <linux/mtd/physmap.h> | ||
| 35 | #include <linux/spi/spi.h> | 36 | #include <linux/spi/spi.h> |
| 36 | #include <linux/spi/flash.h> | 37 | #include <linux/spi/flash.h> |
| 37 | #include <linux/irq.h> | 38 | #include <linux/irq.h> |
| @@ -327,6 +328,44 @@ static struct platform_device bf54x_sdh_device = { | |||
| 327 | }; | 328 | }; |
| 328 | #endif | 329 | #endif |
| 329 | 330 | ||
| 331 | static struct mtd_partition ezkit_partitions[] = { | ||
| 332 | { | ||
| 333 | .name = "Bootloader", | ||
| 334 | .size = 0x20000, | ||
| 335 | .offset = 0, | ||
| 336 | }, { | ||
| 337 | .name = "Kernel", | ||
| 338 | .size = 0xE0000, | ||
| 339 | .offset = MTDPART_OFS_APPEND, | ||
| 340 | }, { | ||
| 341 | .name = "RootFS", | ||
| 342 | .size = MTDPART_SIZ_FULL, | ||
| 343 | .offset = MTDPART_OFS_APPEND, | ||
| 344 | } | ||
| 345 | }; | ||
| 346 | |||
| 347 | static struct physmap_flash_data ezkit_flash_data = { | ||
| 348 | .width = 2, | ||
| 349 | .parts = ezkit_partitions, | ||
| 350 | .nr_parts = ARRAY_SIZE(ezkit_partitions), | ||
| 351 | }; | ||
| 352 | |||
| 353 | static struct resource ezkit_flash_resource = { | ||
| 354 | .start = 0x20000000, | ||
| 355 | .end = 0x20ffffff, | ||
| 356 | .flags = IORESOURCE_MEM, | ||
| 357 | }; | ||
| 358 | |||
| 359 | static struct platform_device ezkit_flash_device = { | ||
| 360 | .name = "physmap-flash", | ||
| 361 | .id = 0, | ||
| 362 | .dev = { | ||
| 363 | .platform_data = &ezkit_flash_data, | ||
| 364 | }, | ||
| 365 | .num_resources = 1, | ||
| 366 | .resource = &ezkit_flash_resource, | ||
| 367 | }; | ||
| 368 | |||
| 330 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 369 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
| 331 | /* all SPI peripherals info goes here */ | 370 | /* all SPI peripherals info goes here */ |
| 332 | #if defined(CONFIG_MTD_M25P80) \ | 371 | #if defined(CONFIG_MTD_M25P80) \ |
| @@ -589,6 +628,7 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
| 589 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | 628 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) |
| 590 | &bfin_device_gpiokeys, | 629 | &bfin_device_gpiokeys, |
| 591 | #endif | 630 | #endif |
| 631 | &ezkit_flash_device, | ||
| 592 | }; | 632 | }; |
| 593 | 633 | ||
| 594 | static int __init stamp_init(void) | 634 | static int __init stamp_init(void) |
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c index 36114dd4ab3a..7601c3be1b5c 100644 --- a/arch/blackfin/mach-bf561/boards/ezkit.c +++ b/arch/blackfin/mach-bf561/boards/ezkit.c | |||
| @@ -29,6 +29,9 @@ | |||
| 29 | 29 | ||
| 30 | #include <linux/device.h> | 30 | #include <linux/device.h> |
| 31 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
| 32 | #include <linux/mtd/mtd.h> | ||
| 33 | #include <linux/mtd/partitions.h> | ||
| 34 | #include <linux/mtd/physmap.h> | ||
| 32 | #include <linux/spi/spi.h> | 35 | #include <linux/spi/spi.h> |
| 33 | #include <linux/irq.h> | 36 | #include <linux/irq.h> |
| 34 | #include <linux/interrupt.h> | 37 | #include <linux/interrupt.h> |
| @@ -155,6 +158,44 @@ static struct platform_device bfin_uart_device = { | |||
| 155 | }; | 158 | }; |
| 156 | #endif | 159 | #endif |
| 157 | 160 | ||
| 161 | static struct mtd_partition ezkit_partitions[] = { | ||
| 162 | { | ||
| 163 | .name = "Bootloader", | ||
| 164 | .size = 0x20000, | ||
| 165 | .offset = 0, | ||
| 166 | }, { | ||
| 167 | .name = "Kernel", | ||
| 168 | .size = 0xE0000, | ||
| 169 | .offset = MTDPART_OFS_APPEND, | ||
| 170 | }, { | ||
| 171 | .name = "RootFS", | ||
| 172 | .size = MTDPART_SIZ_FULL, | ||
| 173 | .offset = MTDPART_OFS_APPEND, | ||
| 174 | } | ||
| 175 | }; | ||
| 176 | |||
| 177 | static struct physmap_flash_data ezkit_flash_data = { | ||
| 178 | .width = 2, | ||
| 179 | .parts = ezkit_partitions, | ||
| 180 | .nr_parts = ARRAY_SIZE(ezkit_partitions), | ||
| 181 | }; | ||
| 182 | |||
| 183 | static struct resource ezkit_flash_resource = { | ||
| 184 | .start = 0x20000000, | ||
| 185 | .end = 0x207fffff, | ||
| 186 | .flags = IORESOURCE_MEM, | ||
| 187 | }; | ||
| 188 | |||
| 189 | static struct platform_device ezkit_flash_device = { | ||
| 190 | .name = "physmap-flash", | ||
| 191 | .id = 0, | ||
| 192 | .dev = { | ||
| 193 | .platform_data = &ezkit_flash_data, | ||
| 194 | }, | ||
| 195 | .num_resources = 1, | ||
| 196 | .resource = &ezkit_flash_resource, | ||
| 197 | }; | ||
| 198 | |||
| 158 | #ifdef CONFIG_SPI_BFIN | 199 | #ifdef CONFIG_SPI_BFIN |
| 159 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ | 200 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
| 160 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | 201 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
| @@ -318,6 +359,7 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
| 318 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | 359 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) |
| 319 | &i2c_gpio_device, | 360 | &i2c_gpio_device, |
| 320 | #endif | 361 | #endif |
| 362 | &ezkit_flash_device, | ||
| 321 | }; | 363 | }; |
| 322 | 364 | ||
| 323 | static int __init ezkit_init(void) | 365 | static int __init ezkit_init(void) |
