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 3B774C433F5 for ; Tue, 22 Feb 2022 01:33:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1AE4A83CA6; Tue, 22 Feb 2022 02:33:12 +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="iFFrYJzD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1263D8382C; Tue, 22 Feb 2022 02:32:00 +0100 (CET) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (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 C55EA83C8D 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-x72f.google.com with SMTP id c7so17139046qka.7 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=irn/3NEw9fW305o9p0zovAdA4bSz+8hQMp0HMhkcrOc=; b=iFFrYJzDpS0nbNcasfsquq+JPrcS0ekcseuUNn0HItTQmvLGEjCRv1TtvZbaeFb2ZS gskxpIfR4xfniVPkG0go9WkvSm58oRzUL2r4+vIP2iXi9AI3g7bXCJ0/ZyozBadEurho 20Ho5n1gq6i2QoImasJV1lH8re9oKsU9WB1U2QIcFGL3ZLnWScjYJC0eBe6Nr3ZHi2/E Qbl/rM1gDKjYqC40w800XgfLf4vB9LVo2ksK3SNFpFk3KFkFCCW4HZq5Et+GLLweMQDA EMpX2HY2usZJUPNhpbVp1MoCjKFZWO6dk3smyFeCHvrmwkuyFUBgRDg4iPg4+VuIureS E/CA== 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=irn/3NEw9fW305o9p0zovAdA4bSz+8hQMp0HMhkcrOc=; b=zk/aIV0IU163GpbQwAAGQ7o/eq8ha6kmpn0qi6M8KUYxITN92cKDqBb80Yj2b2UChL pAq5dZSjkQm9kBdfL9aN0b2jJojE64Bqplb02qKl3RnoWh84VLc+CiNArY0qhWqUCVvo 0hKpN69uaP72Dnln+MsCfh1w+NHOQGfrxGve73vLm2T3n0OewB6qW6vtIm8RTfr36T7x cQQUxOA5/LKhLGLaEd3d7qVSYqGuKT+tAQ4xGIMnNRGZQmHj0vxEMUehQ6w4fojTg6sa 5bolv1ajWz/bN+CEZROt9nKtEniZTNTfsVXqWzcx39+9f9YcLznUrinQP9HDxsEpybmJ FsWQ== X-Gm-Message-State: AOAM532i9huXKH2Wpn55A7S0XVbxXtTrvaQg950bHkPGclpXAl25K2Wo XBlttNTeuuCkmNXpHbPLvas= X-Google-Smtp-Source: ABdhPJyblcut8957i6WnUW3RPNrTixAgmY0YIMqPYmGBIvrxK2VGNN+pJyLgk/wfBit2AimwVIlCgw== X-Received: by 2002:a05:620a:70e:b0:605:b871:6af4 with SMTP id 14-20020a05620a070e00b00605b8716af4mr13896440qkc.747.1645493501598; Mon, 21 Feb 2022 17:31:41 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 17:31:41 -0800 (PST) From: Peter Geis To: Simon Glass , Philipp Tomsich , Kever Yang Cc: Peter Geis , u-boot@lists.denx.de Subject: [PATCH v1 10/11] rockchip: rk3568: add dwc3 otg support Date: Mon, 21 Feb 2022 20:31:29 -0500 Message-Id: <20220222013131.3114990-11-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 Add the required platform data to the rk3568 chip config, in order to support dwc3 otg on this chip. Signed-off-by: Peter Geis --- arch/arm/mach-rockchip/rk3568/rk3568.c | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/mach-rockchip/rk3568/rk3568.c b/arch/arm/mach-rockchip/rk3568/rk3568.c index 0e0a7f5b54f2..ef6bc67a88b0 100644 --- a/arch/arm/mach-rockchip/rk3568/rk3568.c +++ b/arch/arm/mach-rockchip/rk3568/rk3568.c @@ -158,3 +158,32 @@ void spl_board_init(void) setup_boot_mode(); } #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 = 0xfcc00000, + .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