diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2013-08-17 18:15:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-20 20:10:40 -0400 |
commit | 06a64f91da72cb5827e2bedef2ead60a123fd66e (patch) | |
tree | 5a80eb7e8436b675b4790bb9362cb5e356b03a18 /arch/sh | |
parent | ea857f28ab5ca82508e70ffbc8cb296705133f01 (diff) |
SH7619: fix Ether support
The 'sh_eth' driver's probe will crash as the platform code is hopelessly behind
the platform data -- it passes PHY ID instead of 'struct sh_eth_plat_data *'.
Strangely, both commit d88a3ea6fa4c (SH7619 add ethernet controler support) that
added the platform code and commit 71557a37adb5 ([netdrvr] sh_eth: Add SH7619
support) were done in about the same time, yet the latter one added 'struct
sh_eth_plat_data' and the platform code didn't ever get updated...
Add the proper platform data and fix off-by-one memory resource end error, while
at it...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/cpu/sh2/setup-sh7619.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/sh/kernel/cpu/sh2/setup-sh7619.c b/arch/sh/kernel/cpu/sh2/setup-sh7619.c index bb11e1925178..bbadd4820336 100644 --- a/arch/sh/kernel/cpu/sh2/setup-sh7619.c +++ b/arch/sh/kernel/cpu/sh2/setup-sh7619.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/serial.h> | 13 | #include <linux/serial.h> |
14 | #include <linux/serial_sci.h> | 14 | #include <linux/serial_sci.h> |
15 | #include <linux/sh_eth.h> | ||
15 | #include <linux/sh_timer.h> | 16 | #include <linux/sh_timer.h> |
16 | #include <linux/io.h> | 17 | #include <linux/io.h> |
17 | 18 | ||
@@ -110,10 +111,17 @@ static struct platform_device scif2_device = { | |||
110 | }, | 111 | }, |
111 | }; | 112 | }; |
112 | 113 | ||
114 | static struct sh_eth_plat_data eth_platform_data = { | ||
115 | .phy = 1, | ||
116 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | ||
117 | .register_type = SH_ETH_REG_FAST_SH3_SH2, | ||
118 | .phy_interace = PHY_INTERFACE_MODE_MII, | ||
119 | }; | ||
120 | |||
113 | static struct resource eth_resources[] = { | 121 | static struct resource eth_resources[] = { |
114 | [0] = { | 122 | [0] = { |
115 | .start = 0xfb000000, | 123 | .start = 0xfb000000, |
116 | .end = 0xfb0001c8, | 124 | .end = 0xfb0001c7, |
117 | .flags = IORESOURCE_MEM, | 125 | .flags = IORESOURCE_MEM, |
118 | }, | 126 | }, |
119 | [1] = { | 127 | [1] = { |
@@ -127,7 +135,7 @@ static struct platform_device eth_device = { | |||
127 | .name = "sh7619-ether", | 135 | .name = "sh7619-ether", |
128 | .id = -1, | 136 | .id = -1, |
129 | .dev = { | 137 | .dev = { |
130 | .platform_data = (void *)1, | 138 | .platform_data = ð_platform_data, |
131 | }, | 139 | }, |
132 | .num_resources = ARRAY_SIZE(eth_resources), | 140 | .num_resources = ARRAY_SIZE(eth_resources), |
133 | .resource = eth_resources, | 141 | .resource = eth_resources, |