[U-Boot] [PATCHv6 04/28] net: sunxi simplify defconfig

Joe Hershberger joe.hershberger at ni.com
Tue May 30 20:58:01 UTC 2017


On Mon, May 15, 2017 at 3:02 AM, Olliver Schinagl <oliver at schinagl.nl> wrote:
> We currently have a few dependencies explicitly set in the sunxi
> defconfigs. Things such as, RGMII, DESIGNWARE_ETH in combination with
> SUN7I_GMAC. When selecting SUN7I_GMAC we already imply DESIGNWARE_ETH
> for example.
>
> This patch puts this logic into the Kconfig thus simplifying the
> defconfigs. For a user it is also no more logical when enabling one of
> the drivers in Kconfig to have the proper dependencies automatically
> selected.
>
> One thing to note, the sun7i driver can be connected in two modes,
> RGMII and MII mode and we use both throughout the boards. To make this
> easy we split up the CONFIG_SUNXI_GMAC symbol into the SUN7I_GMAC and
> the SUN7I_EMAC symbol, where the SUN7I_EMAC indicates a MII connected
> designware IP.
>
> Signed-off-by: Olliver Schinagl <oliver at schinagl.nl>
> ---
>  configs/A20-OLinuXino-Lime2-eMMC_defconfig |  2 --
>  configs/A20-OLinuXino-Lime2_defconfig      |  2 --
>  configs/A20-OLinuXino-Lime_defconfig       |  3 +-
>  configs/A20-OLinuXino_MICRO_defconfig      |  3 +-
>  configs/A20-Olimex-SOM-EVB_defconfig       |  2 --
>  configs/Bananapi_defconfig                 |  2 --
>  configs/Bananapro_defconfig                |  2 --
>  configs/CSQ_CS908_defconfig                |  3 +-
>  configs/Colombus_defconfig                 |  2 --
>  configs/Cubieboard2_defconfig              |  3 +-
>  configs/Cubietruck_defconfig               |  2 --
>  configs/Hummingbird_A31_defconfig          |  2 --
>  configs/Itead_Ibox_A20_defconfig           |  3 +-
>  configs/Lamobo_R1_defconfig                |  2 --
>  configs/Linksprite_pcDuino3_Nano_defconfig |  2 --
>  configs/Linksprite_pcDuino3_defconfig      |  3 +-
>  configs/Mele_A1000G_quad_defconfig         |  3 +-
>  configs/Mele_I7_defconfig                  |  3 +-
>  configs/Mele_M3_defconfig                  |  3 +-
>  configs/Mele_M5_defconfig                  |  3 +-
>  configs/Mele_M9_defconfig                  |  3 +-
>  configs/Orangepi_defconfig                 |  2 --
>  configs/Orangepi_mini_defconfig            |  2 --
>  configs/Sinlinx_SinA31s_defconfig          |  3 +-
>  configs/Sinovoip_BPI_M2_defconfig          |  2 --
>  configs/Wits_Pro_A20_DKT_defconfig         |  2 --
>  configs/i12-tvbox_defconfig                |  3 +-
>  configs/icnova-a20-swac_defconfig          |  3 +-
>  configs/mixtile_loftq_defconfig            |  2 --
>  drivers/net/Kconfig                        | 54 ++++++++++++++++++++++++------
>  include/configs/sunxi-common.h             |  3 --
>  31 files changed, 57 insertions(+), 72 deletions(-)
>
[...]
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index 336557f395..c0d141754f 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -149,11 +149,11 @@ config PCH_GBE
>           This MAC is present in Intel Platform Controller Hub EG20T. It
>           supports 10/100/1000 Mbps operation.
>
> +config MII
> +       bool
> +

This is a generic config that describes any MII - arguably it could be
cleaned up to mean MDIO.

>  config RGMII
> -       bool "Enable RGMII"

This wasn't a very generically useful config option (meaning there are
many devices which use RGMII and don't specify this) so it should
probably see expanded use or at least have some depends on in the
config that limit it's appearance to drivers that care.

> -       help
> -         Enable the support of the Reduced Gigabit Media-Independent
> -         Interface (RGMII).
> +       bool

It doesn't seem great to hide this, but maybe that's a better approach
than making it depend on the correct drivers.

>
>  config PHY_GIGE
>         bool
> @@ -170,17 +170,49 @@ config RTL8169
>           This driver supports Realtek 8169 series gigabit ethernet family of
>           PCI/PCIe chipsets/adapters.
>
> -config SUN7I_GMAC
> -       bool "Enable Allwinner GMAC Ethernet support"
> -       select PHY_GIGE
> -       help
> -         Enable the support for Sun7i GMAC Ethernet controller
> -
>  config SUN4I_EMAC
>         bool "Allwinner Sun4i Ethernet MAC support"
>         depends on DM_ETH
> +       select MII
> +       select PHYLIB
> +       help
> +         This driver provides the Allwinner based SoCs with 100 Megabit
> +         network support as it is found on the sun4i and sun7i. This driver
> +         is known to have performance issues and should only be used on
> +         sun4i hardware. Newer hardware supports the SUN7I_EMAC driver,
> +         which also works with 100 Megabit PHY's.
> +
> +choice
> +       prompt "Allwinner Sun7i GMAC support"
>         help
> -         This driver supports the Allwinner based SUN4I Ethernet MAC.
> +         This driver provides the Allwinner based SoCs network support based
> +         on the Synopsys Designware gigabit driver. The driver supports both
> +         RGMII and MII communications and can thus be used as a drop in
> +         replacement of the SUN4I_EMAC driver.
> +
> +config SUN7I_NONE
> +       bool "Disable"
> +
> +config SUN7I_EMAC
> +       bool "MII"
> +       select ETH_DESIGNWARE
> +       select PHYLIB
> +       select MII
> +       help
> +         If connecting the sun7i MAC to an ethernet (10/100) only PHY,
> +         select this option.
> +
> +config SUN7I_GMAC
> +       bool "RGMII"
> +       select ETH_DESIGNWARE
> +       select PHYLIB
> +       select RGMII
> +       select PHY_GIGE

Presumably you would still need to define MII here.

> +       help
> +         If connecting the sun7i MAC to a gigabit ethernet PHY, select
> +         this option.
> +
> +endchoice
>
>  config SUN8I_EMAC
>          bool "Allwinner Sun8i Ethernet MAC support"
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index 3d8a130f38..8f97b80619 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -289,13 +289,10 @@ extern int soft_i2c_gpio_scl;
>  /* Ethernet support */
>  #ifdef CONFIG_SUNXI_EMAC
>  #define CONFIG_PHY_ADDR                1
> -#define CONFIG_MII                     /* MII PHY management           */
> -#define CONFIG_PHYLIB
>  #endif
>
>  #ifdef CONFIG_SUNXI_GMAC
>  #define CONFIG_PHY_ADDR                1
> -#define CONFIG_MII                     /* MII PHY management           */
>  #define CONFIG_PHY_REALTEK
>  #endif
>
> --
> 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