aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/txx9/rbtx4938
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2008-08-19 09:55:11 -0400
committerRalf Baechle <ralf@linux-mips.org>2008-10-11 11:18:42 -0400
commit51f607c76e1e7bd089dcad97b6b0a58649be06a3 (patch)
treebcf9389a1e3bcd347d7c560163d2c014d804a162 /arch/mips/txx9/rbtx4938
parentc7b95bcb38ea492fd025008ef99501a2b90aa237 (diff)
MIPS: TXx9: Add mtd support
Add helper routines to register physmap-flash platform devices for NOR flashes. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/txx9/rbtx4938')
-rw-r--r--arch/mips/txx9/rbtx4938/setup.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/mips/txx9/rbtx4938/setup.c b/arch/mips/txx9/rbtx4938/setup.c
index 9ab48dec0fe8..e7bc5b8c7db8 100644
--- a/arch/mips/txx9/rbtx4938/setup.c
+++ b/arch/mips/txx9/rbtx4938/setup.c
@@ -15,6 +15,7 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/mtd/physmap.h>
18 19
19#include <asm/reboot.h> 20#include <asm/reboot.h>
20#include <asm/io.h> 21#include <asm/io.h>
@@ -294,6 +295,42 @@ static int __init rbtx4938_spi_init(void)
294 return 0; 295 return 0;
295} 296}
296 297
298static void __init rbtx4938_mtd_init(void)
299{
300 struct physmap_flash_data pdata = {
301 .width = 4,
302 };
303
304 switch (readb(rbtx4938_bdipsw_addr) & 7) {
305 case 0:
306 /* Boot */
307 txx9_physmap_flash_init(0, 0x1fc00000, 0x400000, &pdata);
308 /* System */
309 txx9_physmap_flash_init(1, 0x1e000000, 0x1000000, &pdata);
310 break;
311 case 1:
312 /* System */
313 txx9_physmap_flash_init(0, 0x1f000000, 0x1000000, &pdata);
314 /* Boot */
315 txx9_physmap_flash_init(1, 0x1ec00000, 0x400000, &pdata);
316 break;
317 case 2:
318 /* Ext */
319 txx9_physmap_flash_init(0, 0x1f000000, 0x1000000, &pdata);
320 /* System */
321 txx9_physmap_flash_init(1, 0x1e000000, 0x1000000, &pdata);
322 /* Boot */
323 txx9_physmap_flash_init(2, 0x1dc00000, 0x400000, &pdata);
324 break;
325 case 3:
326 /* Boot */
327 txx9_physmap_flash_init(1, 0x1bc00000, 0x400000, &pdata);
328 /* System */
329 txx9_physmap_flash_init(2, 0x1a000000, 0x1000000, &pdata);
330 break;
331 }
332}
333
297static void __init rbtx4938_arch_init(void) 334static void __init rbtx4938_arch_init(void)
298{ 335{
299 gpiochip_add(&rbtx4938_spi_gpio_chip); 336 gpiochip_add(&rbtx4938_spi_gpio_chip);
@@ -306,6 +343,7 @@ static void __init rbtx4938_device_init(void)
306 rbtx4938_ethaddr_init(); 343 rbtx4938_ethaddr_init();
307 rbtx4938_ne_init(); 344 rbtx4938_ne_init();
308 tx4938_wdt_init(); 345 tx4938_wdt_init();
346 rbtx4938_mtd_init();
309} 347}
310 348
311struct txx9_board_vec rbtx4938_vec __initdata = { 349struct txx9_board_vec rbtx4938_vec __initdata = {