[U-Boot] [PATCHv6 06/28] net: sunxi: Restore sunxi_[eg]mac behavior

Joe Hershberger joe.hershberger at ni.com
Tue May 30 21:04:37 UTC 2017


On Mon, May 15, 2017 at 3:02 AM, Olliver Schinagl <oliver at schinagl.nl> wrote:
> Commit 4d43d065db326 ("sunxi: Move SUNXI_GMAC to Kconfig") renamed
> SUNXI_[EG]MAC but did not update include/configs/sunxi-common.h where
> based on these two symbols other config symbols where being set, such
> as CONFIG_PHY_REALTEK for SUNXI_GMAC boards and the CONFIG_PHY_ADDR
> being set to a safe default.
>
> This patch restores that behavior by adding the PHY_REALTEK to the
> defconfigs, where they belong and by setting the address based on the
> new config symbols.
>
> Additionally, we use the new renamed symbol in the Makefiles to
> actually compile the drivers.
>
> Signed-off-by: Olliver Schinagl <oliver at schinagl.nl>
> ---
>  arch/arm/include/asm/arch-sunxi/sys_proto.h | 2 +-
>  board/sunxi/Makefile                        | 2 +-
>  configs/A20-OLinuXino-Lime2_defconfig       | 1 +
>  configs/A20-OLinuXino-Lime_defconfig        | 1 +
>  configs/A20-OLinuXino_MICRO_defconfig       | 1 +
>  configs/A20-Olimex-SOM-EVB_defconfig        | 1 +
>  configs/Bananapi_defconfig                  | 1 +
>  configs/Bananapro_defconfig                 | 1 +
>  configs/CSQ_CS908_defconfig                 | 1 +
>  configs/Colombus_defconfig                  | 1 +
>  configs/Cubieboard2_defconfig               | 1 +
>  configs/Cubietruck_defconfig                | 1 +
>  configs/Hummingbird_A31_defconfig           | 1 +
>  configs/Itead_Ibox_A20_defconfig            | 1 +
>  configs/Lamobo_R1_defconfig                 | 1 +
>  configs/Linksprite_pcDuino3_Nano_defconfig  | 1 +
>  configs/Linksprite_pcDuino3_defconfig       | 1 +
>  configs/Mele_A1000G_quad_defconfig          | 1 +
>  configs/Mele_I7_defconfig                   | 1 +
>  configs/Mele_M3_defconfig                   | 1 +
>  configs/Mele_M5_defconfig                   | 1 +
>  configs/Mele_M9_defconfig                   | 1 +
>  configs/Orangepi_defconfig                  | 1 +
>  configs/Orangepi_mini_defconfig             | 1 +
>  configs/Sinlinx_SinA31s_defconfig           | 1 +
>  configs/Sinovoip_BPI_M2_defconfig           | 1 +
>  configs/Wits_Pro_A20_DKT_defconfig          | 1 +
>  configs/i12-tvbox_defconfig                 | 1 +
>  configs/icnova-a20-swac_defconfig           | 1 +
>  configs/mixtile_loftq_defconfig             | 1 +
>  drivers/net/Kconfig                         | 5 +++++
>  drivers/net/Makefile                        | 2 +-
>  include/configs/sunxi-common.h              | 9 +++------
>  scripts/config_whitelist.txt                | 2 --
>  34 files changed, 39 insertions(+), 11 deletions(-)
>
> diff --git a/arch/arm/include/asm/arch-sunxi/sys_proto.h b/arch/arm/include/asm/arch-sunxi/sys_proto.h
> index a373319a2b..850236ed42 100644
> --- a/arch/arm/include/asm/arch-sunxi/sys_proto.h
> +++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h
> @@ -24,7 +24,7 @@ void sdelay(unsigned long);
>  void return_to_fel(uint32_t lr, uint32_t sp);
>
>  /* Board / SoC level designware gmac init */
> -#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC
> +#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUN7I_MAC
>  void eth_init_board(void);
>  #else
>  static inline void eth_init_board(void) {}
> diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile
> index 43766e0ef4..b4768b9b9b 100644
> --- a/board/sunxi/Makefile
> +++ b/board/sunxi/Makefile
> @@ -9,7 +9,7 @@
>  # SPDX-License-Identifier:     GPL-2.0+
>  #
>  obj-y  += board.o
> -obj-$(CONFIG_SUNXI_GMAC)       += gmac.o
> +obj-$(CONFIG_SUN7I_MAC)                += gmac.o
>  obj-$(CONFIG_SUNXI_AHCI)       += ahci.o
>  obj-$(CONFIG_MACH_SUN4I)       += dram_sun4i_auto.o
>  obj-$(CONFIG_MACH_SUN5I)       += dram_sun5i_auto.o
> diff --git a/configs/A20-OLinuXino-Lime2_defconfig b/configs/A20-OLinuXino-Lime2_defconfig
> index 14d1159ead..14a51ef3f9 100644
> --- a/configs/A20-OLinuXino-Lime2_defconfig
> +++ b/configs/A20-OLinuXino-Lime2_defconfig
> @@ -22,6 +22,7 @@ CONFIG_CMD_USB_MASS_STORAGE=y
>  # CONFIG_SPL_PARTITION_UUIDS is not set
>  CONFIG_DFU_RAM=y
>  CONFIG_SUN7I_GMAC=y
> +CONFIG_PHY_REALTEK=y

Would it make sense to either select this at the platform level or to
imply it in the driver Kconfig?

>  CONFIG_RTL8211X_PHY_FORCE_MASTER=y
>  CONFIG_AXP_ALDO3_VOLT=2800
>  CONFIG_AXP_ALDO4_VOLT=2800

[...]

> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index c0d141754f..04e8cf39c8 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -182,6 +182,9 @@ config SUN4I_EMAC
>           sun4i hardware. Newer hardware supports the SUN7I_EMAC driver,
>           which also works with 100 Megabit PHY's.
>
> +config SUN7I_MAC
> +       bool
> +
>  choice
>         prompt "Allwinner Sun7i GMAC support"
>         help
> @@ -196,6 +199,7 @@ config SUN7I_NONE
>  config SUN7I_EMAC
>         bool "MII"
>         select ETH_DESIGNWARE
> +       select SUN7I_MAC
>         select PHYLIB
>         select MII
>         help
> @@ -205,6 +209,7 @@ config SUN7I_EMAC
>  config SUN7I_GMAC
>         bool "RGMII"
>         select ETH_DESIGNWARE
> +       select SUN7I_MAC
>         select PHYLIB
>         select RGMII
>         select PHY_GIGE
> diff --git a/drivers/net/Makefile b/drivers/net/Makefile
> index aedb2cc90d..c5dd52bee2 100644
> --- a/drivers/net/Makefile
> +++ b/drivers/net/Makefile
> @@ -22,7 +22,7 @@ obj-$(CONFIG_DNET) += dnet.o
>  obj-$(CONFIG_E1000) += e1000.o
>  obj-$(CONFIG_E1000_SPI) += e1000_spi.o
>  obj-$(CONFIG_EEPRO100) += eepro100.o
> -obj-$(CONFIG_SUNXI_EMAC) += sunxi_emac.o
> +obj-$(CONFIG_SUN4I_EMAC) += sunxi_emac.o
>  obj-$(CONFIG_SUN8I_EMAC) += sun8i_emac.o
>  obj-$(CONFIG_ENC28J60) += enc28j60.o
>  obj-$(CONFIG_EP93XX) += ep93xx_eth.o
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index 8f97b80619..5d2c5b9040 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -287,15 +287,12 @@ extern int soft_i2c_gpio_scl;
>  #endif /* CONFIG_VIDEO */
>
>  /* Ethernet support */
> -#ifdef CONFIG_SUNXI_EMAC
> +#if defined(CONFIG_SUN4I_EMAC) || \
> +    defined(CONFIG_SUN7I_EMAC) || \
> +    defined(CONFIG_SUN7I_GMAC)
>  #define CONFIG_PHY_ADDR                1
>  #endif
>
> -#ifdef CONFIG_SUNXI_GMAC
> -#define CONFIG_PHY_ADDR                1
> -#define CONFIG_PHY_REALTEK
> -#endif
> -
>  #ifdef CONFIG_USB_EHCI_HCD
>  #define CONFIG_USB_OHCI_NEW
>  #define CONFIG_USB_OHCI_SUNXI
> diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
> index cd0165f934..1e2bf24d5a 100644
> --- a/scripts/config_whitelist.txt
> +++ b/scripts/config_whitelist.txt
> @@ -2796,8 +2796,6 @@ CONFIG_STV0991_HZ
>  CONFIG_STV0991_HZ_CLOCK
>  CONFIG_ST_SMI
>  CONFIG_SUNXI_AHCI
> -CONFIG_SUNXI_EMAC
> -CONFIG_SUNXI_GMAC
>  CONFIG_SUNXI_GPIO
>  CONFIG_SUNXI_MAX_FB_SIZE
>  CONFIG_SUNXI_USB_PHYS
> --
> 2.11.0
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot


More information about the U-Boot mailing list