aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/txx9
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/txx9')
-rw-r--r--arch/mips/txx9/generic/setup_tx4939.c46
-rw-r--r--arch/mips/txx9/rbtx4939/setup.c1
2 files changed, 47 insertions, 0 deletions
diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c
index f14a497077da..6c0049a5bbc1 100644
--- a/arch/mips/txx9/generic/setup_tx4939.c
+++ b/arch/mips/txx9/generic/setup_tx4939.c
@@ -20,6 +20,7 @@
20#include <linux/param.h> 20#include <linux/param.h>
21#include <linux/ptrace.h> 21#include <linux/ptrace.h>
22#include <linux/mtd/physmap.h> 22#include <linux/mtd/physmap.h>
23#include <linux/platform_device.h>
23#include <asm/bootinfo.h> 24#include <asm/bootinfo.h>
24#include <asm/reboot.h> 25#include <asm/reboot.h>
25#include <asm/traps.h> 26#include <asm/traps.h>
@@ -389,6 +390,51 @@ void __init tx4939_mtd_init(int ch)
389 txx9_physmap_flash_init(ch, start, size, &pdata); 390 txx9_physmap_flash_init(ch, start, size, &pdata);
390} 391}
391 392
393#define TX4939_ATA_REG_PHYS(ch) (TX4939_ATA_REG(ch) & 0xfffffffffULL)
394void __init tx4939_ata_init(void)
395{
396 static struct resource ata0_res[] = {
397 {
398 .start = TX4939_ATA_REG_PHYS(0),
399 .end = TX4939_ATA_REG_PHYS(0) + 0x1000 - 1,
400 .flags = IORESOURCE_MEM,
401 }, {
402 .start = TXX9_IRQ_BASE + TX4939_IR_ATA(0),
403 .flags = IORESOURCE_IRQ,
404 },
405 };
406 static struct resource ata1_res[] = {
407 {
408 .start = TX4939_ATA_REG_PHYS(1),
409 .end = TX4939_ATA_REG_PHYS(1) + 0x1000 - 1,
410 .flags = IORESOURCE_MEM,
411 }, {
412 .start = TXX9_IRQ_BASE + TX4939_IR_ATA(1),
413 .flags = IORESOURCE_IRQ,
414 },
415 };
416 static struct platform_device ata0_dev = {
417 .name = "tx4939ide",
418 .id = 0,
419 .num_resources = ARRAY_SIZE(ata0_res),
420 .resource = ata0_res,
421 };
422 static struct platform_device ata1_dev = {
423 .name = "tx4939ide",
424 .id = 1,
425 .num_resources = ARRAY_SIZE(ata1_res),
426 .resource = ata1_res,
427 };
428 __u64 pcfg = __raw_readq(&tx4939_ccfgptr->pcfg);
429
430 if (pcfg & TX4939_PCFG_ATA0MODE)
431 platform_device_register(&ata0_dev);
432 if ((pcfg & (TX4939_PCFG_ATA1MODE |
433 TX4939_PCFG_ET1MODE |
434 TX4939_PCFG_ET0MODE)) == TX4939_PCFG_ATA1MODE)
435 platform_device_register(&ata1_dev);
436}
437
392static void __init tx4939_stop_unused_modules(void) 438static void __init tx4939_stop_unused_modules(void)
393{ 439{
394 __u64 pcfg, rst = 0, ckd = 0; 440 __u64 pcfg, rst = 0, ckd = 0;
diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c
index 277864d5e779..9855d7bccc20 100644
--- a/arch/mips/txx9/rbtx4939/setup.c
+++ b/arch/mips/txx9/rbtx4939/setup.c
@@ -264,6 +264,7 @@ static void __init rbtx4939_device_init(void)
264#endif 264#endif
265 rbtx4939_led_setup(); 265 rbtx4939_led_setup();
266 tx4939_wdt_init(); 266 tx4939_wdt_init();
267 tx4939_ata_init();
267} 268}
268 269
269static void __init rbtx4939_setup(void) 270static void __init rbtx4939_setup(void)