diff options
author | Wenyou Yang <wenyou.yang@atmel.com> | 2014-12-11 02:31:09 -0500 |
---|---|---|
committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2015-01-12 09:50:23 -0500 |
commit | b8659752c37ec157ee254cff443b1c9d523aea22 (patch) | |
tree | 10e08184637cd8299cd99fae3c386810bd22459d /arch | |
parent | 55eb9c343fdd3611ae3de6ab8a8512f303d3f581 (diff) |
ARM: at91: board-dt-sama5: add phy_fixup to override NAND_Tree
Appearance: On some SAMA5D4EK boards, after power up, the Eth1 doesn't work.
Reason: The PIOE2 pin is connected to the NAND_Tree# of KSZ8081,
But it outputs LOW during the reset period, which cause the NAND_Tree# enabled.
Add phy_fixup() to disable NAND_Tree by overriding the Operation
Mode Strap Override register(i.e. Register 16h) to clear the NAND_Tree bit.
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-at91/board-dt-sama5.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c index 8fb9ef5333f1..97f7367d32b8 100644 --- a/arch/arm/mach-at91/board-dt-sama5.c +++ b/arch/arm/mach-at91/board-dt-sama5.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/of_platform.h> | 17 | #include <linux/of_platform.h> |
18 | #include <linux/phy.h> | 18 | #include <linux/phy.h> |
19 | #include <linux/clk-provider.h> | 19 | #include <linux/clk-provider.h> |
20 | #include <linux/phy.h> | ||
20 | 21 | ||
21 | #include <asm/setup.h> | 22 | #include <asm/setup.h> |
22 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
@@ -26,8 +27,25 @@ | |||
26 | 27 | ||
27 | #include "generic.h" | 28 | #include "generic.h" |
28 | 29 | ||
30 | static int ksz8081_phy_fixup(struct phy_device *phy) | ||
31 | { | ||
32 | int value; | ||
33 | |||
34 | value = phy_read(phy, 0x16); | ||
35 | value &= ~0x20; | ||
36 | phy_write(phy, 0x16, value); | ||
37 | |||
38 | return 0; | ||
39 | } | ||
40 | |||
29 | static void __init sama5_dt_device_init(void) | 41 | static void __init sama5_dt_device_init(void) |
30 | { | 42 | { |
43 | if (of_machine_is_compatible("atmel,sama5d4ek") && | ||
44 | IS_ENABLED(CONFIG_PHYLIB)) { | ||
45 | phy_register_fixup_for_id("fc028000.etherne:00", | ||
46 | ksz8081_phy_fixup); | ||
47 | } | ||
48 | |||
31 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 49 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
32 | } | 50 | } |
33 | 51 | ||