diff mbox series

ARM: omap3_logic boards: Convert to DM_ETH

Message ID 20200326152607.28587-1-aford173@gmail.com
State Changes Requested
Delegated to: Lokesh Vutla
Headers show
Series ARM: omap3_logic boards: Convert to DM_ETH | expand

Commit Message

Adam Ford March 26, 2020, 3:26 p.m. UTC
With the converstion of SMC911x to DM, this can facilitate the omap3
boards from LogicPD (now called Beacon EmbeddedWorks) to be converted.
There isn't a clean solution to doing this in phases, so the boards are
all being done together to avoid breaking functionality.

Because the GPMC bus hasn't been converted, the -u-boot.dtsi node needs
to show the address of the ethernet controller for each board.

The board file, which is common betwen the OMAP35 and DM37 SOM LV and
Torpedo boards, can remove the manual ethernet initialization, but it
still needs to register the address and GPMC configuration for the Ethernet
controller which is now being moved around to board_late_init().

Lastly, this patch updates the various config files to add the reference
for DM_ETH and remove the SMC address, which is now fetched from the
newly created device tree nodes.

Signed-off-by: Adam Ford <aford173@gmail.com>

Comments

Lokesh Vutla April 7, 2020, 7:31 a.m. UTC | #1
On 26/03/20 8:56 PM, Adam Ford wrote:
> With the converstion of SMC911x to DM, this can facilitate the omap3
> boards from LogicPD (now called Beacon EmbeddedWorks) to be converted.
> There isn't a clean solution to doing this in phases, so the boards are
> all being done together to avoid breaking functionality.
> 
> Because the GPMC bus hasn't been converted, the -u-boot.dtsi node needs
> to show the address of the ethernet controller for each board.
> 
> The board file, which is common betwen the OMAP35 and DM37 SOM LV and
> Torpedo boards, can remove the manual ethernet initialization, but it
> still needs to register the address and GPMC configuration for the Ethernet
> controller which is now being moved around to board_late_init().
> 
> Lastly, this patch updates the various config files to add the reference
> for DM_ETH and remove the SMC address, which is now fetched from the
> newly created device tree nodes.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>


Applied to u-boot-ti.

Thanks and regards,
Lokesh
Lokesh Vutla April 9, 2020, 6:48 a.m. UTC | #2
On 26/03/20 8:56 PM, Adam Ford wrote:
> With the converstion of SMC911x to DM, this can facilitate the omap3
> boards from LogicPD (now called Beacon EmbeddedWorks) to be converted.
> There isn't a clean solution to doing this in phases, so the boards are
> all being done together to avoid breaking functionality.
> 
> Because the GPMC bus hasn't been converted, the -u-boot.dtsi node needs
> to show the address of the ethernet controller for each board.
> 
> The board file, which is common betwen the OMAP35 and DM37 SOM LV and
> Torpedo boards, can remove the manual ethernet initialization, but it
> still needs to register the address and GPMC configuration for the Ethernet
> controller which is now being moved around to board_late_init().
> 
> Lastly, this patch updates the various config files to add the reference
> for DM_ETH and remove the SMC address, which is now fetched from the
> newly created device tree nodes.

Because of this the build is not going through. It is asking to fill in the SMC
address value as below:

#
# configuration written to .config
#
.config:1093:warning: symbol value '' invalid for SMC911X_BASE
*
* Restart config...
*
*
* Network device support
*
Network device support (NETDEVICES) [Y/n/?] y
  Enable GbE PHY status parsing and configuration (PHY_GIGE) [N/y/?] n
  Altera Triple-Speed Ethernet MAC support (ALTERA_TSE) [N/y/?] n
  Broadcom SF2 (Starfighter2) Ethernet support (BCM_SF2_ETH) [N/y/?] n
  BCMGENET V5 support (BCMGENET) [N/y/?] n
  Synopsys DWC Ethernet QOS device support (DWC_ETH_QOS) [N/y/?] n
  Intel PRO/1000 Gigabit Ethernet support (E1000) [N/y/?] n
  Synopsys Designware Ethernet MAC (ETH_DESIGNWARE) [N/y/?] n
  OpenCores 10/100 Mbps Ethernet MAC (ETHOC) [N/y/?] n
  Freescale FMan ethernet support (FMAN_ENET) [N/y/?] n
  Ftmac100 Ethernet Support (FTMAC100) [N/y/?] n
  Ftgmac100 Ethernet Support (FTGMAC100) [N/y/?] n
  ColdFire Ethernet Support (MCFFEC) [N/y/?] n
  ColdFire DMA Ethernet Support (FSLDMAFEC) [N/y/?] n
  Cadence MACB/GEM Ethernet Interface (MACB) [N/y/?] n
  Enable RGMII (RGMII) [N/y/?] n
  Enable MII (MII) [N/y/?] n
  Realtek 8139 series Ethernet controller driver (RTL8139) [N/y/?] n
  Realtek 8169 series Ethernet controller driver (RTL8169) [N/y/?] n
  SMSC LAN911x and LAN921x controller driver (SMC911X) [Y/n/?] y
    SMC911X Base Address (SMC911X_BASE) [] (NEW)

Can you fix it and re send the patch?

Thanks and regards,
Lokesh
Adam Ford April 9, 2020, 11:35 a.m. UTC | #3
On Thu, Apr 9, 2020 at 1:48 AM Lokesh Vutla <lokeshvutla@ti.com> wrote:
>
>
>
> On 26/03/20 8:56 PM, Adam Ford wrote:
> > With the converstion of SMC911x to DM, this can facilitate the omap3
> > boards from LogicPD (now called Beacon EmbeddedWorks) to be converted.
> > There isn't a clean solution to doing this in phases, so the boards are
> > all being done together to avoid breaking functionality.
> >
> > Because the GPMC bus hasn't been converted, the -u-boot.dtsi node needs
> > to show the address of the ethernet controller for each board.
> >
> > The board file, which is common betwen the OMAP35 and DM37 SOM LV and
> > Torpedo boards, can remove the manual ethernet initialization, but it
> > still needs to register the address and GPMC configuration for the Ethernet
> > controller which is now being moved around to board_late_init().
> >
> > Lastly, this patch updates the various config files to add the reference
> > for DM_ETH and remove the SMC address, which is now fetched from the
> > newly created device tree nodes.
>
> Because of this the build is not going through. It is asking to fill in the SMC
> address value as below:
>
> #
> # configuration written to .config
> #
> .config:1093:warning: symbol value '' invalid for SMC911X_BASE
> *
> * Restart config...
> *
> *
> * Network device support
> *
> Network device support (NETDEVICES) [Y/n/?] y
>   Enable GbE PHY status parsing and configuration (PHY_GIGE) [N/y/?] n
>   Altera Triple-Speed Ethernet MAC support (ALTERA_TSE) [N/y/?] n
>   Broadcom SF2 (Starfighter2) Ethernet support (BCM_SF2_ETH) [N/y/?] n
>   BCMGENET V5 support (BCMGENET) [N/y/?] n
>   Synopsys DWC Ethernet QOS device support (DWC_ETH_QOS) [N/y/?] n
>   Intel PRO/1000 Gigabit Ethernet support (E1000) [N/y/?] n
>   Synopsys Designware Ethernet MAC (ETH_DESIGNWARE) [N/y/?] n
>   OpenCores 10/100 Mbps Ethernet MAC (ETHOC) [N/y/?] n
>   Freescale FMan ethernet support (FMAN_ENET) [N/y/?] n
>   Ftmac100 Ethernet Support (FTMAC100) [N/y/?] n
>   Ftgmac100 Ethernet Support (FTGMAC100) [N/y/?] n
>   ColdFire Ethernet Support (MCFFEC) [N/y/?] n
>   ColdFire DMA Ethernet Support (FSLDMAFEC) [N/y/?] n
>   Cadence MACB/GEM Ethernet Interface (MACB) [N/y/?] n
>   Enable RGMII (RGMII) [N/y/?] n
>   Enable MII (MII) [N/y/?] n
>   Realtek 8139 series Ethernet controller driver (RTL8139) [N/y/?] n
>   Realtek 8169 series Ethernet controller driver (RTL8169) [N/y/?] n
>   SMSC LAN911x and LAN921x controller driver (SMC911X) [Y/n/?] y
>     SMC911X Base Address (SMC911X_BASE) [] (NEW)
>
> Can you fix it and re send the patch?

I got ahead of myself.  My patch is based on a series [1] which
converts SMC911X to DM_ETH.

[1] - https://patchwork.ozlabs.org/cover/1261535/

Until that series is applied, my patch is premature.  I'll wait until
[1] is applied, then, I'll rebase my patch and re-submit as V2.

Sorry about that.

adam

>
> Thanks and regards,
> Lokesh
>
diff mbox series

Patch

diff --git a/arch/arm/dts/logicpd-som-lv-35xx-devkit-u-boot.dtsi b/arch/arm/dts/logicpd-som-lv-35xx-devkit-u-boot.dtsi
index 173b492cd9..78211fd23c 100644
--- a/arch/arm/dts/logicpd-som-lv-35xx-devkit-u-boot.dtsi
+++ b/arch/arm/dts/logicpd-som-lv-35xx-devkit-u-boot.dtsi
@@ -15,6 +15,16 @@ 
 		/delete-property/ serial1;
 		/delete-property/ serial2;
 	};
+
+	ethernet@08000000 {
+		compatible = "smsc,lan9221","smsc,lan9115";
+		reg = <0x08000000>;
+		bank-width = <2>;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
 };
 
 &gpio1 {
diff --git a/arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi b/arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi
index 173b492cd9..78211fd23c 100644
--- a/arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi
+++ b/arch/arm/dts/logicpd-som-lv-37xx-devkit-u-boot.dtsi
@@ -15,6 +15,16 @@ 
 		/delete-property/ serial1;
 		/delete-property/ serial2;
 	};
+
+	ethernet@08000000 {
+		compatible = "smsc,lan9221","smsc,lan9115";
+		reg = <0x08000000>;
+		bank-width = <2>;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
 };
 
 &gpio1 {
diff --git a/arch/arm/dts/logicpd-torpedo-35xx-devkit-u-boot.dtsi b/arch/arm/dts/logicpd-torpedo-35xx-devkit-u-boot.dtsi
index 581247def0..331ea906a0 100644
--- a/arch/arm/dts/logicpd-torpedo-35xx-devkit-u-boot.dtsi
+++ b/arch/arm/dts/logicpd-torpedo-35xx-devkit-u-boot.dtsi
@@ -15,6 +15,16 @@ 
 		/delete-property/ serial1;
 		/delete-property/ serial2;
 	};
+
+	ethernet@08000000 {
+		compatible = "smsc,lan9221","smsc,lan9115";
+		reg = <0x08000000>;
+		bank-width = <2>;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
 };
 
 &gpio1 {
diff --git a/arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi b/arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi
index 9b709c147c..f63bb53023 100644
--- a/arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi
+++ b/arch/arm/dts/logicpd-torpedo-37xx-devkit-u-boot.dtsi
@@ -11,6 +11,16 @@ 
 		/delete-property/ serial1;
 		/delete-property/ serial2;
 	};
+
+	ethernet@08000000 {
+		compatible = "smsc,lan9221","smsc,lan9115";
+		reg = <0x08000000>;
+		bank-width = <2>;
+		vddvario-supply = <&vddvario>;
+		vdd33a-supply = <&vdd33a>;
+		reg-io-width = <4>;
+		smsc,save-mac-address;
+	};
 };
 
 &i2c1 {
diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c
index 21d8a21010..50572c6a71 100644
--- a/board/logicpd/omap3som/omap3logic.c
+++ b/board/logicpd/omap3som/omap3logic.c
@@ -14,7 +14,6 @@ 
 #include <dm.h>
 #include <init.h>
 #include <ns16550.h>
-#include <netdev.h>
 #include <flash.h>
 #include <nand.h>
 #include <i2c.h>
@@ -58,6 +57,8 @@  DECLARE_GLOBAL_DATA_PTR;
 #define LOGIC_MT28_OMAP35_ASYNC_GPMC_CONFIG6	0x09030000
 #define LOGIC_MT28_OMAP35_ASYNC_GPMC_CONFIG7	0x00000C50
 
+#define CONFIG_SMC911X_BASE 0x08000000
+
 #ifdef CONFIG_SPL_OS_BOOT
 int spl_start_uboot(void)
 {
@@ -204,22 +205,6 @@  static void unlock_nand(void)
 	nand_unlock(mtd, 0, mtd->size, 0);
 }
 
-int board_late_init(void)
-{
-#ifdef CONFIG_CMD_NAND_LOCK_UNLOCK
-	unlock_nand();
-#endif
-	return 0;
-}
-#endif
-
-#if defined(CONFIG_MMC)
-void board_mmc_power_init(void)
-{
-	twl4030_power_mmc_init(0);
-}
-#endif
-
 #ifdef CONFIG_SMC911X
 /* GPMC CS1 settings for Logic SOM LV/Torpedo LAN92xx Ethernet chip */
 static const u32 gpmc_lan92xx_config[] = {
@@ -230,12 +215,25 @@  static const u32 gpmc_lan92xx_config[] = {
 	NET_LAN92XX_GPMC_CONFIG5,
 	NET_LAN92XX_GPMC_CONFIG6,
 };
+#endif
 
-int board_eth_init(bd_t *bis)
+int board_late_init(void)
 {
+#ifdef CONFIG_CMD_NAND_LOCK_UNLOCK
+	unlock_nand();
+#endif
+
+#ifdef CONFIG_SMC911X
 	enable_gpmc_cs_config(gpmc_lan92xx_config, &gpmc_cfg->cs[1],
 			CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
+#endif
+	return 0;
+}
+#endif
 
-	return smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#if defined(CONFIG_MMC)
+void board_mmc_power_init(void)
+{
+	twl4030_power_mmc_init(0);
 }
 #endif
diff --git a/configs/omap35_logic_defconfig b/configs/omap35_logic_defconfig
index bcf4efc621..a460ed559e 100644
--- a/configs/omap35_logic_defconfig
+++ b/configs/omap35_logic_defconfig
@@ -56,8 +56,8 @@  CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
 CONFIG_SYS_NAND_U_BOOT_OFFS=0x80000
 CONFIG_SPL_NAND_SIMPLE=y
+CONFIG_DM_ETH=y
 CONFIG_SMC911X=y
-CONFIG_SMC911X_BASE=0x08000000
 CONFIG_SMC911X_32_BIT=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_SINGLE=y
diff --git a/configs/omap35_logic_somlv_defconfig b/configs/omap35_logic_somlv_defconfig
index 51c5d449e0..f6db27f02e 100644
--- a/configs/omap35_logic_somlv_defconfig
+++ b/configs/omap35_logic_somlv_defconfig
@@ -60,8 +60,8 @@  CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
 CONFIG_SYS_NAND_U_BOOT_OFFS=0x80000
 CONFIG_SPL_NAND_SIMPLE=y
+CONFIG_DM_ETH=y
 CONFIG_SMC911X=y
-CONFIG_SMC911X_BASE=0x08000000
 CONFIG_SMC911X_32_BIT=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_SINGLE=y
diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig
index 15925fb7db..918532a66c 100644
--- a/configs/omap3_logic_defconfig
+++ b/configs/omap3_logic_defconfig
@@ -55,8 +55,8 @@  CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
 CONFIG_SYS_NAND_U_BOOT_OFFS=0x80000
 CONFIG_SPL_NAND_SIMPLE=y
+CONFIG_DM_ETH=y
 CONFIG_SMC911X=y
-CONFIG_SMC911X_BASE=0x08000000
 CONFIG_SMC911X_32_BIT=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_SINGLE=y
diff --git a/configs/omap3_logic_somlv_defconfig b/configs/omap3_logic_somlv_defconfig
index ea8fc37f12..4a63437653 100644
--- a/configs/omap3_logic_somlv_defconfig
+++ b/configs/omap3_logic_somlv_defconfig
@@ -62,8 +62,8 @@  CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
 CONFIG_SYS_NAND_U_BOOT_OFFS=0x80000
 CONFIG_SPL_NAND_SIMPLE=y
+CONFIG_DM_ETH=y
 CONFIG_SMC911X=y
-CONFIG_SMC911X_BASE=0x08000000
 CONFIG_SMC911X_32_BIT=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_SINGLE=y