From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 143D5C433EF for ; Tue, 22 Feb 2022 01:33:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D9B9C83CB4; Tue, 22 Feb 2022 02:33:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oOI+tfc2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DAB0683C29; Tue, 22 Feb 2022 02:32:02 +0100 (CET) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (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 1E3A283C8A for ; Tue, 22 Feb 2022 02:31:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pgwipeout@gmail.com Received: by mail-qk1-x736.google.com with SMTP id f10so15162764qkg.9 for ; Mon, 21 Feb 2022 17:31:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=41Nl21ezedG+maYlf1/jkgiBgbR9Jo+vdea6rLKhKQw=; b=oOI+tfc2SU6WuRkuVPb+wcAsXYgHwqGx+YWMS/RYoxNYQffKkw2lXPPT2ki2kHEPps 537T8vfUiQ2vgcwvsnkwe2DYi7wd3TeyP06a8V4CJlFEbM9mqvFHTqREIvq6WXhH+wZe vKLg8ZwpakOTS9eGGHAvm53qz0q4gTJ7RmSWQGwUdFZ3QFKOjrz1H+S5IKwcTd8aXYgJ HZ/zqvBG3EliXSNiwNlSYt4hbRPchTkGwYWhvt8VycNC8gVx7+dEJWSK4OBoL4SVqRdR GuFiFG5rcdJS9KdefU/vlKkx3Q902uFbfRDciI6895Kjag9osJqzRE58EPGrAtqZzH1q 5RUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=41Nl21ezedG+maYlf1/jkgiBgbR9Jo+vdea6rLKhKQw=; b=FIK8EtyJjylr9WDZ5Z+RTWHmKbyiJD4rWpcwTkvRcVyyFx1evunxFcGQ4VFBdfIkXn OuV9X9CVT+0WzKLn+feu+VYlNXJhoIQWPvMiJbQStgB2t/Z5yYauQTTIYQs/2gTSvbgh p4bZOiZ5TRLIn+86ThegVMpGlBokrNksBVCPE9PeuezM/mGFHGafJ7qoidZwconcfgiI ob3wUMDdRNDSBSF0Um7kvJAV4T8QNtRT47FQbVywhH1wAT1q6JroKwkstz83+0ZobEg3 Xt899tkDSVkyDePxMVrUXMaWwDfRPQD6UiMvz30PN9OQih31ffHhehgVzV6Md4IoDdfn +QtA== X-Gm-Message-State: AOAM533qppv+hu5whXA530BBsFPshC87IRCUKC9+3nkTQpnCYrURVGdm ve324wpu5WLGKlspVHhcg7I= X-Google-Smtp-Source: ABdhPJw4gFlbkYe/SWWOseg0sJ7h7iOXSqh8exOy1iRZqflbsjYy2X/yxp3YgHQ2d5QUzFrOUOchRA== X-Received: by 2002:ae9:dd81:0:b0:49a:e96d:3c5a with SMTP id r123-20020ae9dd81000000b0049ae96d3c5amr13672387qkf.50.1645493500736; Mon, 21 Feb 2022 17:31:40 -0800 (PST) Received: from master-x64.sparksnet (c-98-233-193-225.hsd1.dc.comcast.net. [98.233.193.225]) by smtp.gmail.com with ESMTPSA id q12sm31597841qtx.51.2022.02.21.17.31.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 17:31:40 -0800 (PST) From: Peter Geis To: Simon Glass , Philipp Tomsich , Kever Yang Cc: Peter Geis , u-boot@lists.denx.de Subject: [PATCH v1 09/11] rockchip: move dwc3 config to chip specific handler Date: Mon, 21 Feb 2022 20:31:28 -0500 Message-Id: <20220222013131.3114990-10-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220222013131.3114990-1-pgwipeout@gmail.com> References: <20220222013131.3114990-1-pgwipeout@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean The dwc3 code in the mach-rockchip board file is specific to the rk3399. Move it to the rk3399 chip specific code. Signed-off-by: Peter Geis --- arch/arm/mach-rockchip/board.c | 24 --------------------- arch/arm/mach-rockchip/rk3399/rk3399.c | 29 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index 5304eb055c6d..b19c15c26f2e 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -127,30 +127,6 @@ int board_usb_cleanup(int index, enum usb_init_type init) } #endif /* CONFIG_USB_GADGET_DWC2_OTG */ -#if defined(CONFIG_USB_DWC3_GADGET) && !defined(CONFIG_DM_USB_GADGET) -#include - -static struct dwc3_device dwc3_device_data = { - .maximum_speed = USB_SPEED_HIGH, - .base = 0xfe800000, - .dr_mode = USB_DR_MODE_PERIPHERAL, - .index = 0, - .dis_u2_susphy_quirk = 1, - .hsphy_mode = USBPHY_INTERFACE_MODE_UTMIW, -}; - -int usb_gadget_handle_interrupts(int index) -{ - dwc3_uboot_handle_interrupt(0); - return 0; -} - -int board_usb_init(int index, enum usb_init_type init) -{ - return dwc3_uboot_init(&dwc3_device_data); -} -#endif /* CONFIG_USB_DWC3_GADGET */ - #endif /* CONFIG_USB_GADGET */ #if CONFIG_IS_ENABLED(FASTBOOT) diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c index d40969c88898..c7e38997e521 100644 --- a/arch/arm/mach-rockchip/rk3399/rk3399.c +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c @@ -284,3 +284,32 @@ void spl_board_init(void) #endif } #endif + +#if defined(CONFIG_USB_GADGET) +#include + +#if defined(CONFIG_USB_DWC3_GADGET) && !defined(CONFIG_DM_USB_GADGET) +#include + +static struct dwc3_device dwc3_device_data = { + .maximum_speed = USB_SPEED_HIGH, + .base = 0xfe800000, + .dr_mode = USB_DR_MODE_PERIPHERAL, + .index = 0, + .dis_u2_susphy_quirk = 1, + .hsphy_mode = USBPHY_INTERFACE_MODE_UTMIW, +}; + +int usb_gadget_handle_interrupts(int index) +{ + dwc3_uboot_handle_interrupt(0); + return 0; +} + +int board_usb_init(int index, enum usb_init_type init) +{ + return dwc3_uboot_init(&dwc3_device_data); +} +#endif /* CONFIG_USB_DWC3_GADGET */ + +#endif /* CONFIG_USB_GADGET */ -- 2.25.1