diff options
Diffstat (limited to 'arch/mips/txx9/generic')
-rw-r--r-- | arch/mips/txx9/generic/setup.c | 21 | ||||
-rw-r--r-- | arch/mips/txx9/generic/setup_tx4938.c | 21 | ||||
-rw-r--r-- | arch/mips/txx9/generic/setup_tx4939.c | 17 |
3 files changed, 59 insertions, 0 deletions
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c index a13a08b8c9e..8a266c6a3f5 100644 --- a/arch/mips/txx9/generic/setup.c +++ b/arch/mips/txx9/generic/setup.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <asm/txx9/generic.h> | 32 | #include <asm/txx9/generic.h> |
33 | #include <asm/txx9/pci.h> | 33 | #include <asm/txx9/pci.h> |
34 | #include <asm/txx9tmr.h> | 34 | #include <asm/txx9tmr.h> |
35 | #include <asm/txx9/ndfmc.h> | ||
35 | #ifdef CONFIG_CPU_TX49XX | 36 | #ifdef CONFIG_CPU_TX49XX |
36 | #include <asm/txx9/tx4938.h> | 37 | #include <asm/txx9/tx4938.h> |
37 | #endif | 38 | #endif |
@@ -691,6 +692,26 @@ void __init txx9_physmap_flash_init(int no, unsigned long addr, | |||
691 | #endif | 692 | #endif |
692 | } | 693 | } |
693 | 694 | ||
695 | void __init txx9_ndfmc_init(unsigned long baseaddr, | ||
696 | const struct txx9ndfmc_platform_data *pdata) | ||
697 | { | ||
698 | #if defined(CONFIG_MTD_NAND_TXX9NDFMC) || \ | ||
699 | defined(CONFIG_MTD_NAND_TXX9NDFMC_MODULE) | ||
700 | struct resource res = { | ||
701 | .start = baseaddr, | ||
702 | .end = baseaddr + 0x1000 - 1, | ||
703 | .flags = IORESOURCE_MEM, | ||
704 | }; | ||
705 | struct platform_device *pdev = platform_device_alloc("txx9ndfmc", -1); | ||
706 | |||
707 | if (!pdev || | ||
708 | platform_device_add_resources(pdev, &res, 1) || | ||
709 | platform_device_add_data(pdev, pdata, sizeof(*pdata)) || | ||
710 | platform_device_add(pdev)) | ||
711 | platform_device_put(pdev); | ||
712 | #endif | ||
713 | } | ||
714 | |||
694 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) | 715 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) |
695 | static DEFINE_SPINLOCK(txx9_iocled_lock); | 716 | static DEFINE_SPINLOCK(txx9_iocled_lock); |
696 | 717 | ||
diff --git a/arch/mips/txx9/generic/setup_tx4938.c b/arch/mips/txx9/generic/setup_tx4938.c index 25819ff1c35..f0844f891f0 100644 --- a/arch/mips/txx9/generic/setup_tx4938.c +++ b/arch/mips/txx9/generic/setup_tx4938.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <asm/txx9tmr.h> | 23 | #include <asm/txx9tmr.h> |
24 | #include <asm/txx9pio.h> | 24 | #include <asm/txx9pio.h> |
25 | #include <asm/txx9/generic.h> | 25 | #include <asm/txx9/generic.h> |
26 | #include <asm/txx9/ndfmc.h> | ||
26 | #include <asm/txx9/tx4938.h> | 27 | #include <asm/txx9/tx4938.h> |
27 | 28 | ||
28 | static void __init tx4938_wdr_init(void) | 29 | static void __init tx4938_wdr_init(void) |
@@ -382,6 +383,26 @@ void __init tx4938_ata_init(unsigned int irq, unsigned int shift, int tune) | |||
382 | platform_device_put(pdev); | 383 | platform_device_put(pdev); |
383 | } | 384 | } |
384 | 385 | ||
386 | void __init tx4938_ndfmc_init(unsigned int hold, unsigned int spw) | ||
387 | { | ||
388 | struct txx9ndfmc_platform_data plat_data = { | ||
389 | .shift = 1, | ||
390 | .gbus_clock = txx9_gbus_clock, | ||
391 | .hold = hold, | ||
392 | .spw = spw, | ||
393 | .ch_mask = 1, | ||
394 | }; | ||
395 | unsigned long baseaddr = TX4938_NDFMC_REG & 0xfffffffffULL; | ||
396 | |||
397 | #ifdef __BIG_ENDIAN | ||
398 | baseaddr += 4; | ||
399 | #endif | ||
400 | if ((__raw_readq(&tx4938_ccfgptr->pcfg) & | ||
401 | (TX4938_PCFG_ATA_SEL|TX4938_PCFG_ISA_SEL|TX4938_PCFG_NDF_SEL)) == | ||
402 | TX4938_PCFG_NDF_SEL) | ||
403 | txx9_ndfmc_init(baseaddr, &plat_data); | ||
404 | } | ||
405 | |||
385 | static void __init tx4938_stop_unused_modules(void) | 406 | static void __init tx4938_stop_unused_modules(void) |
386 | { | 407 | { |
387 | __u64 pcfg, rst = 0, ckd = 0; | 408 | __u64 pcfg, rst = 0, ckd = 0; |
diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c index 55440967b3a..7a25b573e9b 100644 --- a/arch/mips/txx9/generic/setup_tx4939.c +++ b/arch/mips/txx9/generic/setup_tx4939.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/txx9irq.h> | 27 | #include <asm/txx9irq.h> |
28 | #include <asm/txx9tmr.h> | 28 | #include <asm/txx9tmr.h> |
29 | #include <asm/txx9/generic.h> | 29 | #include <asm/txx9/generic.h> |
30 | #include <asm/txx9/ndfmc.h> | ||
30 | #include <asm/txx9/tx4939.h> | 31 | #include <asm/txx9/tx4939.h> |
31 | 32 | ||
32 | static void __init tx4939_wdr_init(void) | 33 | static void __init tx4939_wdr_init(void) |
@@ -457,6 +458,22 @@ void __init tx4939_rtc_init(void) | |||
457 | platform_device_register(&rtc_dev); | 458 | platform_device_register(&rtc_dev); |
458 | } | 459 | } |
459 | 460 | ||
461 | void __init tx4939_ndfmc_init(unsigned int hold, unsigned int spw, | ||
462 | unsigned char ch_mask, unsigned char wide_mask) | ||
463 | { | ||
464 | struct txx9ndfmc_platform_data plat_data = { | ||
465 | .shift = 1, | ||
466 | .gbus_clock = txx9_gbus_clock, | ||
467 | .hold = hold, | ||
468 | .spw = spw, | ||
469 | .flags = NDFMC_PLAT_FLAG_NO_RSTR | NDFMC_PLAT_FLAG_HOLDADD | | ||
470 | NDFMC_PLAT_FLAG_DUMMYWRITE, | ||
471 | .ch_mask = ch_mask, | ||
472 | .wide_mask = wide_mask, | ||
473 | }; | ||
474 | txx9_ndfmc_init(TX4939_NDFMC_REG & 0xfffffffffULL, &plat_data); | ||
475 | } | ||
476 | |||
460 | static void __init tx4939_stop_unused_modules(void) | 477 | static void __init tx4939_stop_unused_modules(void) |
461 | { | 478 | { |
462 | __u64 pcfg, rst = 0, ckd = 0; | 479 | __u64 pcfg, rst = 0, ckd = 0; |