From 6815a66ad7430c3a89ea7897e567fe6c4f252ce3 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 21 Mar 2022 21:33:27 -0400 Subject: [PATCH] am33xx: musb: Remove unused configuration logic At this point DM and OF_CONTROL are used to configure how the USB ports are enabled, with the exception of in SPL and no SPL_OF_CONTROL. Remove a bunch of now unused logic to simplify the code. Signed-off-by: Tom Rini --- arch/arm/mach-omap2/am33xx/board.c | 82 +++--------------------------- 1 file changed, 6 insertions(+), 76 deletions(-) diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index 5175eb01cb..7f1b84e466 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -207,10 +207,8 @@ int cpu_mmc_init(struct bd_info *bis) #define RTC_BOARD_TYPE_SHIFT 16 /* AM33XX has two MUSB controllers which can be host or gadget */ -#if (defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)) && \ - (defined(CONFIG_AM335X_USB0) || defined(CONFIG_AM335X_USB1)) && \ - (!CONFIG_IS_ENABLED(DM_USB) || !CONFIG_IS_ENABLED(OF_CONTROL)) && \ - (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_MUSB_NEW)) +#if (defined(CONFIG_AM335X_USB0) || defined(CONFIG_AM335X_USB1)) && \ + defined(CONFIG_SPL_BUILD) static struct musb_hdrc_config musb_config = { .multipoint = 1, @@ -219,7 +217,7 @@ static struct musb_hdrc_config musb_config = { .ram_bits = 12, }; -#if CONFIG_IS_ENABLED(DM_USB) && !CONFIG_IS_ENABLED(OF_CONTROL) +#ifdef CONFIG_AM335X_USB0 static struct ti_musb_plat usb0 = { .base = (void *)USB0_OTG_BASE, .ctrl_mod_base = &((struct ctrl_dev *)CTRL_DEVICE_BASE)->usb_ctrl0, @@ -229,7 +227,9 @@ static struct ti_musb_plat usb0 = { .platform_ops = &musb_dsps_ops, }, }; +#endif +#ifdef CONFIG_AM335X_USB1 static struct ti_musb_plat usb1 = { .base = (void *)USB1_OTG_BASE, .ctrl_mod_base = &((struct ctrl_dev *)CTRL_DEVICE_BASE)->usb_ctrl1, @@ -239,6 +239,7 @@ static struct ti_musb_plat usb1 = { .platform_ops = &musb_dsps_ops, }, }; +#endif U_BOOT_DRVINFOS(am33xx_usbs) = { #ifdef CONFIG_AM335X_USB0_PERIPHERAL @@ -257,77 +258,6 @@ int arch_misc_init(void) { return 0; } -#else -static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; - -/* USB 2.0 PHY Control */ -#define CM_PHY_PWRDN (1 << 0) -#define CM_PHY_OTG_PWRDN (1 << 1) -#define OTGVDET_EN (1 << 19) -#define OTGSESSENDEN (1 << 20) - -static void am33xx_usb_set_phy_power(u8 on, u32 *reg_addr) -{ - if (on) { - clrsetbits_le32(reg_addr, CM_PHY_PWRDN | CM_PHY_OTG_PWRDN, - OTGVDET_EN | OTGSESSENDEN); - } else { - clrsetbits_le32(reg_addr, 0, CM_PHY_PWRDN | CM_PHY_OTG_PWRDN); - } -} - -#ifdef CONFIG_AM335X_USB0 -static void am33xx_otg0_set_phy_power(struct udevice *dev, u8 on) -{ - am33xx_usb_set_phy_power(on, &cdev->usb_ctrl0); -} - -struct omap_musb_board_data otg0_board_data = { - .set_phy_power = am33xx_otg0_set_phy_power, -}; - -static struct musb_hdrc_platform_data otg0_plat = { - .mode = CONFIG_AM335X_USB0_MODE, - .config = &musb_config, - .power = 50, - .platform_ops = &musb_dsps_ops, - .board_data = &otg0_board_data, -}; -#endif - -#ifdef CONFIG_AM335X_USB1 -static void am33xx_otg1_set_phy_power(struct udevice *dev, u8 on) -{ - am33xx_usb_set_phy_power(on, &cdev->usb_ctrl1); -} - -struct omap_musb_board_data otg1_board_data = { - .set_phy_power = am33xx_otg1_set_phy_power, -}; - -static struct musb_hdrc_platform_data otg1_plat = { - .mode = CONFIG_AM335X_USB1_MODE, - .config = &musb_config, - .power = 50, - .platform_ops = &musb_dsps_ops, - .board_data = &otg1_board_data, -}; -#endif - -int arch_misc_init(void) -{ -#ifdef CONFIG_AM335X_USB0 - musb_register(&otg0_plat, &otg0_board_data, - (void *)USB0_OTG_BASE); -#endif -#ifdef CONFIG_AM335X_USB1 - musb_register(&otg1_plat, &otg1_board_data, - (void *)USB1_OTG_BASE); -#endif - return 0; -} -#endif - #else /* CONFIG_USB_MUSB_* && CONFIG_AM335X_USB* && !CONFIG_DM_USB */ int arch_misc_init(void) -- 2.39.5