[PATCH v2] ARM: omap3: evm: Complete DM_ETH and DM_USB migrations
Derald D. Woods
woods.technical at gmail.com
Sun Jul 19 02:07:01 CEST 2020
This commit completes the migrations for DM_ETH and DM_USB. The board
is now consistent with omap3_beagle and other remaining OMAP3 boards.
Cc: Tom Rini <trini at konsulko.com>
Cc: Adam Ford <aford173 at gmail.com>
Signed-off-by: Derald D. Woods <woods.technical at gmail.com>
---
Changes for v2:
- Add omitted ethernet node to omap3-evm-u-boot.dtsi
* Based on similar changes found in logicpd-torpedo-35xx-devkit.dtsi
---
arch/arm/dts/omap3-evm-u-boot.dtsi | 10 ++++
arch/arm/mach-omap2/omap3/Kconfig | 3 ++
board/ti/evm/evm.c | 82 ++++--------------------------
configs/omap3_evm_defconfig | 14 +++--
4 files changed, 33 insertions(+), 76 deletions(-)
diff --git a/arch/arm/dts/omap3-evm-u-boot.dtsi b/arch/arm/dts/omap3-evm-u-boot.dtsi
index b9e433f873..97a8141c8a 100644
--- a/arch/arm/dts/omap3-evm-u-boot.dtsi
+++ b/arch/arm/dts/omap3-evm-u-boot.dtsi
@@ -11,4 +11,14 @@
chosen {
stdout-path = &uart1;
};
+
+ ethernet at 2c000000 {
+ compatible = "smsc,lan9221","smsc,lan9115";
+ reg = <0x2c000000 0xff>;
+ bank-width = <2>;
+ vddvario-supply = <&vddvario>;
+ vdd33a-supply = <&vdd33a>;
+ reg-io-width = <4>;
+ smsc,save-mac-address;
+ };
};
diff --git a/arch/arm/mach-omap2/omap3/Kconfig b/arch/arm/mach-omap2/omap3/Kconfig
index cf11e5707f..0a6eb4cb26 100644
--- a/arch/arm/mach-omap2/omap3/Kconfig
+++ b/arch/arm/mach-omap2/omap3/Kconfig
@@ -61,7 +61,10 @@ config TARGET_OMAP3_EVM
select DM
select DM_GPIO
select DM_SERIAL
+ select OMAP3_GPIO_2
select OMAP3_GPIO_3
+ select OMAP3_GPIO_5
+ select OMAP3_GPIO_6
imply CMD_DM
config TARGET_OMAP3_IGEP00X0
diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 193b3eb576..ecbd843676 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -16,7 +16,6 @@
#include <init.h>
#include <net.h>
#include <ns16550.h>
-#include <netdev.h>
#include <serial.h>
#include <asm/io.h>
#include <asm/arch/mem.h>
@@ -24,20 +23,17 @@
#include <asm/arch/sys_proto.h>
#include <asm/arch/mmc_host_def.h>
#include <asm/gpio.h>
-#include <i2c.h>
#include <twl4030.h>
#include <asm/mach-types.h>
-#include <asm/omap_musb.h>
#include <linux/delay.h>
#include <linux/mtd/rawnand.h>
-#include <linux/usb/ch9.h>
-#include <linux/usb/gadget.h>
-#include <linux/usb/musb.h>
#include "evm.h"
#define OMAP3EVM_GPIO_ETH_RST_GEN1 64
#define OMAP3EVM_GPIO_ETH_RST_GEN2 7
+#define CONFIG_SMC911X_BASE 0x2C000000
+
DECLARE_GLOBAL_DATA_PTR;
static u32 omap3_evm_version;
@@ -49,7 +45,7 @@ u32 get_omap3_evm_rev(void)
static void omap3_evm_get_revision(void)
{
-#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_SMC911X)
/*
* Board revision can be ascertained only by identifying
* the Ethernet chipset.
@@ -70,7 +66,7 @@ static void omap3_evm_get_revision(void)
default:
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
}
-#else /* !CONFIG_CMD_NET */
+#else /* !CONFIG_SMC911X */
#if defined(CONFIG_STATIC_BOARD_REV)
/* Look for static defintion of the board revision */
omap3_evm_version = CONFIG_STATIC_BOARD_REV;
@@ -78,7 +74,7 @@ static void omap3_evm_get_revision(void)
/* Fallback to the default above */
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
#endif /* CONFIG_STATIC_BOARD_REV */
-#endif /* CONFIG_CMD_NET */
+#endif /* CONFIG_SMC911X */
}
#if defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)
@@ -155,33 +151,6 @@ void get_board_mem_timings(struct board_sdrc_timings *timings)
}
#endif /* CONFIG_SPL_BUILD */
-#if defined(CONFIG_USB_MUSB_OMAP2PLUS)
-static struct musb_hdrc_config musb_config = {
- .multipoint = 1,
- .dyn_fifo = 1,
- .num_eps = 16,
- .ram_bits = 12,
-};
-
-static struct omap_musb_board_data musb_board_data = {
- .interface_type = MUSB_INTERFACE_ULPI,
-};
-
-static struct musb_hdrc_platform_data musb_plat = {
-#if defined(CONFIG_USB_MUSB_HOST)
- .mode = MUSB_HOST,
-#elif defined(CONFIG_USB_MUSB_GADGET)
- .mode = MUSB_PERIPHERAL,
-#else
-#error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
-#endif /* CONFIG_USB_MUSB_{GADGET,HOST} */
- .config = &musb_config,
- .power = 100,
- .platform_ops = &omap2430_ops,
- .board_data = &musb_board_data,
-};
-#endif /* CONFIG_USB_MUSB_OMAP2PLUS */
-
/*
* Routine: misc_init_r
* Description: Init ethernet (done here so udelay works)
@@ -190,25 +159,18 @@ int misc_init_r(void)
{
twl4030_power_init();
-#ifdef CONFIG_SYS_I2C_OMAP24XX
- i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
-#endif
-
-#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_SMC911X)
setup_net_chip();
#endif
omap3_evm_get_revision();
-#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_SMC911X)
reset_net_chip();
#endif
omap_die_id_display();
-#if defined(CONFIG_USB_MUSB_OMAP2PLUS)
- musb_register(&musb_plat, &musb_board_data, (void *)MUSB_BASE);
-#endif
-
-#if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET)
+#if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET) && \
+ !defined(CONFIG_SMC911X)
omap_die_id_usbethaddr();
#endif
return 0;
@@ -225,7 +187,7 @@ void set_muxconf_regs(void)
MUX_EVM();
}
-#if defined(CONFIG_CMD_NET)
+#if defined(CONFIG_SMC911X)
/*
* Routine: setup_net_chip
* Description: Setting up the configuration GPMC registers specific to the
@@ -283,33 +245,11 @@ static void reset_net_chip(void)
udelay(1);
gpio_set_value(rst_gpio, 1);
}
-
-int board_eth_init(struct bd_info *bis)
-{
-#if defined(CONFIG_SMC911X)
- env_set("ethaddr", NULL);
- return smc911x_initialize(0, CONFIG_SMC911X_BASE);
-#else
- return 0;
-#endif
-}
-#endif /* CONFIG_CMD_NET */
+#endif /* CONFIG_SMC911X */
#if defined(CONFIG_MMC)
-int board_mmc_init(struct bd_info *bis)
-{
- return omap_mmc_init(0, 0, 0, -1, -1);
-}
-
void board_mmc_power_init(void)
{
twl4030_power_mmc_init(0);
}
#endif /* CONFIG_MMC */
-
-#if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET) && !defined(CONFIG_CMD_NET)
-int board_eth_init(struct bd_info *bis)
-{
- return usb_eth_initialize(bis);
-}
-#endif /* CONFIG_USB_ETHER */
diff --git a/configs/omap3_evm_defconfig b/configs/omap3_evm_defconfig
index 1322707968..cf62c73cc3 100644
--- a/configs/omap3_evm_defconfig
+++ b/configs/omap3_evm_defconfig
@@ -10,6 +10,7 @@ CONFIG_NR_DRAM_BANKS=2
CONFIG_SPL=y
CONFIG_DISTRO_DEFAULTS=y
CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="usb start"
CONFIG_SYS_CONSOLE_INFO_QUIET=y
CONFIG_DEFAULT_FDT_FILE="omap3-evm.dtb"
CONFIG_VERSION_VARIABLE=y
@@ -38,7 +39,7 @@ CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:512k(spl),1920k(u-boot),128k(u-boot-env),128k(dtb),6m(kernel),-(rootfs)"
CONFIG_CMD_UBI=y
# CONFIG_ISO_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
CONFIG_SPL_PARTITION_UUIDS=y
CONFIG_OF_CONTROL=y
CONFIG_SPL_OF_CONTROL=y
@@ -48,11 +49,10 @@ CONFIG_ENV_IS_IN_NAND=y
CONFIG_SPL_DM=y
CONFIG_SPL_DM_SEQ_ALIAS=y
CONFIG_SPL_OF_TRANSLATE=y
-# CONFIG_SPL_BLK is not set
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0x82000000
+CONFIG_GPIO_HOG=y
CONFIG_DM_MMC=y
-# CONFIG_SPL_DM_MMC is not set
CONFIG_MMC_OMAP_HS=y
CONFIG_MTD=y
CONFIG_MTD_RAW_NAND=y
@@ -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=0x2C000000
CONFIG_SMC911X_32_BIT=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
@@ -78,6 +78,10 @@ CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
CONFIG_USB_GADGET_VENDOR_NUM=0x0451
CONFIG_USB_GADGET_PRODUCT_NUM=0x5678
CONFIG_USB_ETHER=y
+CONFIG_USB_HOST_ETHER=y
+CONFIG_USB_ETHER_ASIX=y
+CONFIG_USB_ETHER_MCS7830=y
+CONFIG_USB_ETHER_SMSC95XX=y
+CONFIG_VIDEO_OMAP3=y
CONFIG_FAT_WRITE=y
CONFIG_BCH=y
-# CONFIG_EFI_LOADER is not set
--
2.27.0
More information about the U-Boot
mailing list