]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
meson: odroid-c2: enable Ethernet support through the device tree
authorBeniamino Galvani <b.galvani@gmail.com>
Tue, 16 Aug 2016 09:49:50 +0000 (11:49 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 6 Sep 2016 17:18:19 +0000 (13:18 -0400)
Remove the device definition from board file, update the driver with
the new compatible property and update config with necessary options.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/arm/include/asm/arch-meson/gxbb.h
board/amlogic/odroid-c2/odroid-c2.c
configs/odroid-c2_defconfig
drivers/net/designware.c

index f90f632dafec766950b74321fc59ba0a59ae030c..ce41349792bd1ea7bdbd8c94e895def0dceb715a 100644 (file)
@@ -20,9 +20,6 @@
 #define GXBB_GPIO_IN(n)                GXBB_PERIPHS_ADDR(_GXBB_GPIO_OFF(n) + 1)
 #define GXBB_GPIO_OUT(n)       GXBB_PERIPHS_ADDR(_GXBB_GPIO_OFF(n) + 2)
 
-/* Pinmux registers 0 to 12 */
-#define GXBB_PINMUX(n)         GXBB_PERIPHS_ADDR(0x2c + (n))
-
 #define GXBB_ETH_REG_0         GXBB_PERIPHS_ADDR(0x50)
 #define GXBB_ETH_REG_1         GXBB_PERIPHS_ADDR(0x51)
 
index bd72100e09bcac206c54b1ff54ecb96ad8f313bd..b61daaa4a7515f26de7faee4edb547f732a8a73f 100644 (file)
@@ -21,24 +21,11 @@ int board_init(void)
        return 0;
 }
 
-static const struct eth_pdata gxbb_eth_pdata = {
-       .iobase = GXBB_ETH_BASE,
-       .phy_interface = PHY_INTERFACE_MODE_RGMII,
-};
-
-U_BOOT_DEVICE(meson_eth) = {
-       .name = "eth_designware",
-       .platdata = &gxbb_eth_pdata,
-};
-
 int misc_init_r(void)
 {
        u8 mac_addr[EFUSE_MAC_SIZE];
        ssize_t len;
 
-       /* Select Ethernet function */
-       setbits_le32(GXBB_PINMUX(6), 0x3fff);
-
        /* Set RGMII mode */
        setbits_le32(GXBB_ETH_REG_0, GXBB_ETH_REG_0_PHY_INTF |
                                     GXBB_ETH_REG_0_TX_PHASE(1) |
index 808bbc2b894c4b9fe107e27b7c63b299c064db8a..3e9ef682046fb1fb3cbf919df6b7ea16c33cfd46 100644 (file)
@@ -14,6 +14,9 @@ CONFIG_HUSH_PARSER=y
 CONFIG_OF_CONTROL=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM_ETH=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_MESON_GXBB=y
 CONFIG_DEBUG_UART=y
 CONFIG_DEBUG_UART_MESON=y
 CONFIG_DEBUG_UART_BASE=0xc81004c0
index 8ba72e30b1de4305652483193e606680ea432090..9e6d7261844323827039cc2ad7c4bf0b0d2cd3ec 100644 (file)
@@ -737,6 +737,7 @@ static int designware_eth_ofdata_to_platdata(struct udevice *dev)
 static const struct udevice_id designware_eth_ids[] = {
        { .compatible = "allwinner,sun7i-a20-gmac" },
        { .compatible = "altr,socfpga-stmmac" },
+       { .compatible = "amlogic,meson6-dwmac" },
        { }
 };