diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-09-19 05:27:32 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-19 05:28:41 -0400 |
commit | 929bf0d0156562ce631728b6fa53d68004d456d2 (patch) | |
tree | 739063990a8077b29ef97e69d73bce94573daae4 /arch/mips/ar7/platform.c | |
parent | def0a9b2573e00ab0b486cb5382625203ab4c4a6 (diff) | |
parent | 202c4675c55ddf6b443c7e057d2dff6b42ef71aa (diff) |
Merge branch 'linus' into perfcounters/core
Merge reason: Bring in tracing changes we depend on.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/mips/ar7/platform.c')
-rw-r--r-- | arch/mips/ar7/platform.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c index 2ecab6155932..e2278c04459d 100644 --- a/arch/mips/ar7/platform.c +++ b/arch/mips/ar7/platform.c | |||
@@ -32,6 +32,8 @@ | |||
32 | #include <linux/leds.h> | 32 | #include <linux/leds.h> |
33 | #include <linux/string.h> | 33 | #include <linux/string.h> |
34 | #include <linux/etherdevice.h> | 34 | #include <linux/etherdevice.h> |
35 | #include <linux/phy.h> | ||
36 | #include <linux/phy_fixed.h> | ||
35 | 37 | ||
36 | #include <asm/addrspace.h> | 38 | #include <asm/addrspace.h> |
37 | #include <asm/mach-ar7/ar7.h> | 39 | #include <asm/mach-ar7/ar7.h> |
@@ -208,6 +210,12 @@ static struct physmap_flash_data physmap_flash_data = { | |||
208 | .width = 2, | 210 | .width = 2, |
209 | }; | 211 | }; |
210 | 212 | ||
213 | static struct fixed_phy_status fixed_phy_status __initdata = { | ||
214 | .link = 1, | ||
215 | .speed = 100, | ||
216 | .duplex = 1, | ||
217 | }; | ||
218 | |||
211 | static struct plat_cpmac_data cpmac_low_data = { | 219 | static struct plat_cpmac_data cpmac_low_data = { |
212 | .reset_bit = 17, | 220 | .reset_bit = 17, |
213 | .power_bit = 20, | 221 | .power_bit = 20, |
@@ -409,6 +417,20 @@ static struct platform_device ar7_udc = { | |||
409 | .num_resources = ARRAY_SIZE(usb_res), | 417 | .num_resources = ARRAY_SIZE(usb_res), |
410 | }; | 418 | }; |
411 | 419 | ||
420 | static struct resource ar7_wdt_res = { | ||
421 | .name = "regs", | ||
422 | .start = -1, /* Filled at runtime */ | ||
423 | .end = -1, /* Filled at runtime */ | ||
424 | .flags = IORESOURCE_MEM, | ||
425 | }; | ||
426 | |||
427 | static struct platform_device ar7_wdt = { | ||
428 | .id = -1, | ||
429 | .name = "ar7_wdt", | ||
430 | .resource = &ar7_wdt_res, | ||
431 | .num_resources = 1, | ||
432 | }; | ||
433 | |||
412 | static inline unsigned char char2hex(char h) | 434 | static inline unsigned char char2hex(char h) |
413 | { | 435 | { |
414 | switch (h) { | 436 | switch (h) { |
@@ -479,6 +501,7 @@ static void __init detect_leds(void) | |||
479 | 501 | ||
480 | static int __init ar7_register_devices(void) | 502 | static int __init ar7_register_devices(void) |
481 | { | 503 | { |
504 | u16 chip_id; | ||
482 | int res; | 505 | int res; |
483 | #ifdef CONFIG_SERIAL_8250 | 506 | #ifdef CONFIG_SERIAL_8250 |
484 | static struct uart_port uart_port[2]; | 507 | static struct uart_port uart_port[2]; |
@@ -530,6 +553,9 @@ static int __init ar7_register_devices(void) | |||
530 | } | 553 | } |
531 | 554 | ||
532 | if (ar7_has_high_cpmac()) { | 555 | if (ar7_has_high_cpmac()) { |
556 | res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status); | ||
557 | if (res && res != -ENODEV) | ||
558 | return res; | ||
533 | cpmac_get_mac(1, cpmac_high_data.dev_addr); | 559 | cpmac_get_mac(1, cpmac_high_data.dev_addr); |
534 | res = platform_device_register(&cpmac_high); | 560 | res = platform_device_register(&cpmac_high); |
535 | if (res) | 561 | if (res) |
@@ -538,6 +564,10 @@ static int __init ar7_register_devices(void) | |||
538 | cpmac_low_data.phy_mask = 0xffffffff; | 564 | cpmac_low_data.phy_mask = 0xffffffff; |
539 | } | 565 | } |
540 | 566 | ||
567 | res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status); | ||
568 | if (res && res != -ENODEV) | ||
569 | return res; | ||
570 | |||
541 | cpmac_get_mac(0, cpmac_low_data.dev_addr); | 571 | cpmac_get_mac(0, cpmac_low_data.dev_addr); |
542 | res = platform_device_register(&cpmac_low); | 572 | res = platform_device_register(&cpmac_low); |
543 | if (res) | 573 | if (res) |
@@ -550,6 +580,23 @@ static int __init ar7_register_devices(void) | |||
550 | 580 | ||
551 | res = platform_device_register(&ar7_udc); | 581 | res = platform_device_register(&ar7_udc); |
552 | 582 | ||
583 | chip_id = ar7_chip_id(); | ||
584 | switch (chip_id) { | ||
585 | case AR7_CHIP_7100: | ||
586 | case AR7_CHIP_7200: | ||
587 | ar7_wdt_res.start = AR7_REGS_WDT; | ||
588 | break; | ||
589 | case AR7_CHIP_7300: | ||
590 | ar7_wdt_res.start = UR8_REGS_WDT; | ||
591 | break; | ||
592 | default: | ||
593 | break; | ||
594 | } | ||
595 | |||
596 | ar7_wdt_res.end = ar7_wdt_res.start + 0x20; | ||
597 | |||
598 | res = platform_device_register(&ar7_wdt); | ||
599 | |||
553 | return res; | 600 | return res; |
554 | } | 601 | } |
555 | arch_initcall(ar7_register_devices); | 602 | arch_initcall(ar7_register_devices); |