With all SPL cases covered now by having SPL_OF_CONTROL enabled, we can drop legacy code related to AM335x MUSB options.
Signed-off-by: Tom Rini <[email protected]> --- arch/arm/mach-omap2/am33xx/board.c | 126 ------------------------- include/configs/am335x_evm.h | 12 --- include/configs/am335x_guardian.h | 5 - include/configs/baltos.h | 12 --- include/configs/chiliboard.h | 4 - include/configs/siemens-am33x-common.h | 8 -- 6 files changed, 167 deletions(-) diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index 6c0556c57728..4bf9c5359ecc 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -205,130 +205,6 @@ int cpu_mmc_init(struct bd_info *bis) /* Board type field bit shift for RTC only with DDR in self-refresh mode */ #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)) - -static struct musb_hdrc_config musb_config = { - .multipoint = 1, - .dyn_fifo = 1, - .num_eps = 16, - .ram_bits = 12, -}; - -#if CONFIG_IS_ENABLED(DM_USB) && !CONFIG_IS_ENABLED(OF_CONTROL) -static struct ti_musb_plat usb0 = { - .base = (void *)USB0_OTG_BASE, - .ctrl_mod_base = &((struct ctrl_dev *)CTRL_DEVICE_BASE)->usb_ctrl0, - .plat = { - .config = &musb_config, - .power = 50, - .platform_ops = &musb_dsps_ops, - }, -}; - -static struct ti_musb_plat usb1 = { - .base = (void *)USB1_OTG_BASE, - .ctrl_mod_base = &((struct ctrl_dev *)CTRL_DEVICE_BASE)->usb_ctrl1, - .plat = { - .config = &musb_config, - .power = 50, - .platform_ops = &musb_dsps_ops, - }, -}; - -U_BOOT_DRVINFOS(am33xx_usbs) = { -#if CONFIG_AM335X_USB0_MODE == MUSB_PERIPHERAL - { "ti-musb-peripheral", &usb0 }, -#elif CONFIG_AM335X_USB0_MODE == MUSB_HOST - { "ti-musb-host", &usb0 }, -#endif -#if CONFIG_AM335X_USB1_MODE == MUSB_PERIPHERAL - { "ti-musb-peripheral", &usb1 }, -#elif CONFIG_AM335X_USB1_MODE == MUSB_HOST - { "ti-musb-host", &usb1 }, -#endif -}; - -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) { struct udevice *dev; @@ -349,8 +225,6 @@ int arch_misc_init(void) return 0; } -#endif /* CONFIG_USB_MUSB_* && CONFIG_AM335X_USB* && !CONFIG_DM_USB */ - #if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) #if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC) || \ diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index 0f6ffd9ba7c2..5dd4484be933 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -212,18 +212,6 @@ * in memory. */ -/* - * USB configuration. We enable MUSB support, both for host and for - * gadget. We set USB0 as peripheral and USB1 as host, based on the - * board schematic and physical port wired to each. Then for host we - * add mass storage support and for gadget we add both RNDIS ethernet - * and DFU. - */ -#define CONFIG_AM335X_USB0 -#define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL -#define CONFIG_AM335X_USB1 -#define CONFIG_AM335X_USB1_MODE MUSB_HOST - /* * Disable MMC DM for SPL build and can be re-enabled after adding * DM support in SPL diff --git a/include/configs/am335x_guardian.h b/include/configs/am335x_guardian.h index d93db09c9b5e..608fb167fdd8 100644 --- a/include/configs/am335x_guardian.h +++ b/include/configs/am335x_guardian.h @@ -146,9 +146,4 @@ #endif /* CONFIG_MTD_RAW_NAND */ -#define CONFIG_AM335X_USB0 -#define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL -#define CONFIG_AM335X_USB1 -#define CONFIG_AM335X_USB1_MODE MUSB_HOST - #endif /* ! __CONFIG_AM335X_GUARDIAN_H */ diff --git a/include/configs/baltos.h b/include/configs/baltos.h index 2fe6c8639392..966b95bdaccc 100644 --- a/include/configs/baltos.h +++ b/include/configs/baltos.h @@ -232,18 +232,6 @@ #endif #endif -/* - * USB configuration. We enable MUSB support, both for host and for - * gadget. We set USB0 as peripheral and USB1 as host, based on the - * board schematic and physical port wired to each. Then for host we - * add mass storage support and for gadget we add both RNDIS ethernet - * and DFU. - */ -#define CONFIG_AM335X_USB0 -#define CONFIG_AM335X_USB0_MODE MUSB_HOST -#define CONFIG_AM335X_USB1 -#define CONFIG_AM335X_USB1_MODE MUSB_OTG - /* NAND support */ #ifdef CONFIG_MTD_RAW_NAND #define GPMC_NAND_ECC_LP_x8_LAYOUT 1 diff --git a/include/configs/chiliboard.h b/include/configs/chiliboard.h index 86cac236f96b..da1efd003e12 100644 --- a/include/configs/chiliboard.h +++ b/include/configs/chiliboard.h @@ -146,10 +146,6 @@ #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x000c0000 /* NAND: SPL related configs */ -/* USB configuration */ -#define CONFIG_AM335X_USB1 -#define CONFIG_AM335X_USB1_MODE MUSB_HOST - /* * Disable MMC DM for SPL build and can be re-enabled after adding * DM support in SPL diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h index 6ccba95f3052..18e0786d6d09 100644 --- a/include/configs/siemens-am33x-common.h +++ b/include/configs/siemens-am33x-common.h @@ -115,14 +115,6 @@ */ #ifndef CONFIG_SPL_BUILD -/* - * USB configuration - */ -#define CONFIG_AM335X_USB0 -#define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL -#define CONFIG_AM335X_USB1 -#define CONFIG_AM335X_USB1_MODE MUSB_HOST - /* USB DRACO ID as default */ #define CONFIG_USBD_HS -- 2.17.1

