diff options
-rw-r--r-- | arch/arm/mach-davinci/board-omapl138-hawk.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c index 0b8dbdb79fe0..75b3fe23ee63 100644 --- a/arch/arm/mach-davinci/board-omapl138-hawk.c +++ b/arch/arm/mach-davinci/board-omapl138-hawk.c | |||
@@ -19,6 +19,47 @@ | |||
19 | 19 | ||
20 | #include <mach/cp_intc.h> | 20 | #include <mach/cp_intc.h> |
21 | #include <mach/da8xx.h> | 21 | #include <mach/da8xx.h> |
22 | #include <mach/mux.h> | ||
23 | |||
24 | #define HAWKBOARD_PHY_ID "0:07" | ||
25 | |||
26 | static short omapl138_hawk_mii_pins[] __initdata = { | ||
27 | DA850_MII_TXEN, DA850_MII_TXCLK, DA850_MII_COL, DA850_MII_TXD_3, | ||
28 | DA850_MII_TXD_2, DA850_MII_TXD_1, DA850_MII_TXD_0, DA850_MII_RXER, | ||
29 | DA850_MII_CRS, DA850_MII_RXCLK, DA850_MII_RXDV, DA850_MII_RXD_3, | ||
30 | DA850_MII_RXD_2, DA850_MII_RXD_1, DA850_MII_RXD_0, DA850_MDIO_CLK, | ||
31 | DA850_MDIO_D, | ||
32 | -1 | ||
33 | }; | ||
34 | |||
35 | static __init void omapl138_hawk_config_emac(void) | ||
36 | { | ||
37 | void __iomem *cfgchip3 = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG); | ||
38 | int ret; | ||
39 | u32 val; | ||
40 | struct davinci_soc_info *soc_info = &davinci_soc_info; | ||
41 | |||
42 | val = __raw_readl(cfgchip3); | ||
43 | val &= ~BIT(8); | ||
44 | ret = davinci_cfg_reg_list(omapl138_hawk_mii_pins); | ||
45 | if (ret) { | ||
46 | pr_warning("%s: cpgmac/mii mux setup failed: %d\n", | ||
47 | __func__, ret); | ||
48 | return; | ||
49 | } | ||
50 | |||
51 | /* configure the CFGCHIP3 register for MII */ | ||
52 | __raw_writel(val, cfgchip3); | ||
53 | pr_info("EMAC: MII PHY configured\n"); | ||
54 | |||
55 | soc_info->emac_pdata->phy_id = HAWKBOARD_PHY_ID; | ||
56 | |||
57 | ret = da8xx_register_emac(); | ||
58 | if (ret) | ||
59 | pr_warning("%s: emac registration failed: %d\n", | ||
60 | __func__, ret); | ||
61 | } | ||
62 | |||
22 | 63 | ||
23 | static struct davinci_uart_config omapl138_hawk_uart_config __initdata = { | 64 | static struct davinci_uart_config omapl138_hawk_uart_config __initdata = { |
24 | .enabled_uarts = 0x7, | 65 | .enabled_uarts = 0x7, |
@@ -30,6 +71,8 @@ static __init void omapl138_hawk_init(void) | |||
30 | 71 | ||
31 | davinci_serial_init(&omapl138_hawk_uart_config); | 72 | davinci_serial_init(&omapl138_hawk_uart_config); |
32 | 73 | ||
74 | omapl138_hawk_config_emac(); | ||
75 | |||
33 | ret = da8xx_register_watchdog(); | 76 | ret = da8xx_register_watchdog(); |
34 | if (ret) | 77 | if (ret) |
35 | pr_warning("omapl138_hawk_init: " | 78 | pr_warning("omapl138_hawk_init: " |