From patchwork Mon Sep 13 00:32:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 1527165 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H76sR6hxTz9sXN for ; Mon, 13 Sep 2021 10:33:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AE973839B6; Mon, 13 Sep 2021 02:33:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 3C2C8839AC; Mon, 13 Sep 2021 02:32:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 865D183984 for ; Mon, 13 Sep 2021 02:32:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tom.rini@gmail.com Received: by mail-qk1-f172.google.com with SMTP id p4so8762577qki.3 for ; Sun, 12 Sep 2021 17:32:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=z+TdCWrSkxAOi/YGDKHnqcgy3CZ/LQ54vkY+E0McGAk=; b=6oU5vdQIad67ijSQJA/XqyOQBgm32WF22T2HDyXXQgiOFcaedw1dZnJ7KpBC0uXet6 FRq6Irh6AQ4qGDGnTN3AIlpDqHxJT/NR9tnM9aqYD88HMAVqjlSTXHUHkqG6aySoEOHl 2XCMH0a1z9lm/Dtl3CDXBuVBqtLGdpKvqVIKLGYa3N4jg8tjeOiW794vu31r5csxt17E rC1SaNtTxOqGUYT6ubJQZ+aIhha8AXWelbx17BGtzQSdwnCKoU9+dsr8ZdTY4FJskUuS ej0WldmWzZHcrM3c9ZyIY2ccPEPGqFpMykUt4+Pw6PHxFHeEpT4GGmwV121AounFRxUr yrbQ== X-Gm-Message-State: AOAM532MVJW2BjxJK9VruxhPinmULHUmZ7096e/e+6m2Ebe3OL15Kvhd +LaeWpFj2leba2iVHQiWVSCXqvTcZg== X-Google-Smtp-Source: ABdhPJwG6wLfk4LLBv9ks2HR0ObkPB1qRSQaj0i9A2WZkTf8hJDF28k/vciae8mTn2/MB8Alrr0yfQ== X-Received: by 2002:a05:620a:2223:: with SMTP id n3mr7839553qkh.66.1631493159762; Sun, 12 Sep 2021 17:32:39 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b01-cbda-0166-c2e8-bb10-efce.res6.spectrum.com. [2603:6081:7b01:cbda:166:c2e8:bb10:efce]) by smtp.gmail.com with ESMTPSA id x27sm3300211qtm.23.2021.09.12.17.32.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 17:32:39 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 03/17] am335x: Remove legacy non-DM_USB code Date: Sun, 12 Sep 2021 20:32:19 -0400 Message-Id: <20210913003233.4125-3-trini@konsulko.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210913003233.4125-1-trini@konsulko.com> References: <20210913003233.4125-1-trini@konsulko.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 --- 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