Skip to contentSkip to conversation

mx6ul_14x14_evk: Remove unneeded USB board code

PATCH Applied Fabio Estevam 2 participants 5 messages Oct 18, 2024 – Oct 25, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mx6ul_14x14_evk: Remove unneeded USB board code

From: Fabio Estevam <[email protected]>

With CONFIG_DM_USB, there is no longer the need for any USB board code anymore.

Remove the unneeded USB board code.

While at it, also remove the uneeeded CONFIG_USB_MAX_CONTROLLER_COUNT option.

---
 .../mx6ul_14x14_evk/mx6ul_14x14_evk.c         | 51 -------------------
 configs/mx6ul_14x14_evk_defconfig             |  1 -
 2 files changed, 52 deletions(-)
board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c +0 -51
index c4ab59da78c7..fbb5a12212d7 100644
@@ -31,8 +31,6 @@
 #include <power/pmic.h>
 #include <power/pfuze3000_pmic.h>
 #include "../common/pfuze.h"
-#include <usb.h>
-#include <usb/ehci-ci.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -155,49 +153,6 @@ int board_mmc_init(struct bd_info *bis)
 }
 #endif
 
-#ifdef CONFIG_USB_EHCI_MX6
-#ifndef CONFIG_DM_USB
-
-#define USB_OTHERREGS_OFFSET	0x800
-#define UCTRL_PWR_POL		(1 << 9)
-
-static iomux_v3_cfg_t const usb_otg_pads[] = {
-	MX6_PAD_GPIO1_IO00__ANATOP_OTG1_ID | MUX_PAD_CTRL(OTG_ID_PAD_CTRL),
-};
-
-/* At default the 3v3 enables the MIC2026 for VBUS power */
-static void setup_usb(void)
-{
-	imx_iomux_v3_setup_multiple_pads(usb_otg_pads,
-					 ARRAY_SIZE(usb_otg_pads));
-}
-
-int board_usb_phy_mode(int port)
-{
-	if (port == 1)
-		return USB_INIT_HOST;
-	else
-		return usb_phy_mode(port);
-}
-
-int board_ehci_hcd_init(int port)
-{
-	u32 *usbnc_usb_ctrl;
-
-	if (port > 1)
-		return -EINVAL;
-
-	usbnc_usb_ctrl = (u32 *)(USB_BASE_ADDR + USB_OTHERREGS_OFFSET +
-				 port * 4);
-
-	/* Set Power polarity */
-	setbits_le32(usbnc_usb_ctrl, UCTRL_PWR_POL);
-
-	return 0;
-}
-#endif
-#endif
-
 #ifdef CONFIG_FEC_MXC
 static int setup_fec(int fec_id)
 {
@@ -284,12 +239,6 @@ int board_init(void)
 	setup_fec(CFG_FEC_ENET_DEV);
 #endif
 
-#ifdef CONFIG_USB_EHCI_MX6
-#ifndef CONFIG_DM_USB
-	setup_usb();
-#endif
-#endif
-
 #ifdef CONFIG_FSL_QSPI
 	board_qspi_init();
 #endif
configs/mx6ul_14x14_evk_defconfig +0 -1
index bbeb364e256c..522c5660d72c 100644
@@ -92,7 +92,6 @@ CONFIG_SOFT_SPI=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_SPL_USB_HOST=y
-CONFIG_USB_MAX_CONTROLLER_COUNT=2
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_SPL_USB_GADGET=y
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 mx6ul_14x14_evk: Convert to watchdog driver model

From: Fabio Estevam <[email protected]>

Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused the 'reset' command in U-Boot to not cause a board reset.

Fix it by switching to the watchdog driver model via sysreset, which is the preferred method for implementing the watchdog reset.

---
 configs/mx6ul_14x14_evk_defconfig | 4 ++++
 1 file changed, 4 insertions(+)
configs/mx6ul_14x14_evk_defconfig +4 -0
index 522c5660d72c..9fbd2c648bc7 100644
@@ -89,6 +89,9 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_FSL_QSPI=y
 CONFIG_SOFT_SPI=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
+CONFIG_SYSRESET_WATCHDOG_AUTO=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
 CONFIG_SPL_USB_HOST=y
@@ -107,3 +110,4 @@ CONFIG_VIDEO_MXS=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
 CONFIG_BMP_16BPP=y
+CONFIG_IMX_WATCHDOG=y
Signature · 1 line
2.34.1
Reviewed-by on v1 2/2
#2 lore raw

RE: [PATCH 2/2] mx6ul_14x14_evk: Convert to watchdog driver model

Quoted 5 lines

Subject: [PATCH 2/2] mx6ul_14x14_evk: Convert to watchdog driver model

From: Fabio Estevam <[email protected]>

Quoted 8 lines

Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused the 'reset' command in U-Boot to not cause a board reset.

Fix it by switching to the watchdog driver model via sysreset, which is the preferred method for implementing the watchdog reset.

---

Reviewed-by on v1 1/2
#3 lore raw
In reply to Fabio Estevam
Quoted 5 lines

Subject: [PATCH 1/2] mx6ul_14x14_evk: Remove unneeded USB board code

From: Fabio Estevam <[email protected]>

Quoted 8 lines

With CONFIG_DM_USB, there is no longer the need for any USB board code anymore.

Remove the unneeded USB board code.

While at it, also remove the uneeeded
CONFIG_USB_MAX_CONTROLLER_COUNT option.