From patchwork Tue Jun 28 17:42:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 585582 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp993870mab; Tue, 28 Jun 2022 10:42:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s67xwDj+N+aG01UfspFPZt1yedl7v9at4bnbA0RAMOJS1MabVJ9Qp9dnb5babiFd0bVBrd X-Received: by 2002:a2e:3109:0:b0:25a:8a0c:40e2 with SMTP id x9-20020a2e3109000000b0025a8a0c40e2mr9796876ljx.26.1656438147534; Tue, 28 Jun 2022 10:42:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656438147; cv=none; d=google.com; s=arc-20160816; b=Y5dGv9E27bEHQj2+1uCrmc2C1UO8iwgdORqvKYQWOzZgImIRcMTV5eHPMKIpezNZA/ 8eA6iXcdc5u3kiCgXviK3Oy4lOqgW3SPavoXI/Gidq/2zmvRcgOLBox4JFrahiV1SoUs hlkhRul04pCUkb3yLbYNQNJadHFJxxe/TqaBKUkJ5h8Iu5j8IlG/MWJLYtM20Cfq/KL3 HYSawdqpI7anhlTz32tz+PZZwAu4+fRkysEAvVf96Ne5PBVZrldx9dZextBRnX0g7c1s RfusUgTS9bTRO/CNIfvEFJZfdUhmcPjIp0K7xMLkGGLrUO+2wJwTP8y+Dmy4fTg3gu+d 0YEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=4JPIfg3XVjmwTMevfEcdW2L+NxwGNfV7N6+UibSU6MY=; b=kioYwoOz289E4azqBC1V+NLqmh2CybHxwYXicghpKM0xTMMlmKQuwJgN5udxXMJlB5 QjPW7VtH2H9DGf9IlorzDFZdpxhiA+SGOYfxv9CLq+Ws2+eqSa2roDZNdLo405ilmsXd QbKcxhCGARALPyAy6fmMWhbNyhxGYOWtlZkNwMCh0u+tN1bFp+S9cZWLKKqWzTY42UGa XamJda1wLuxg69nUjbEA4wg31U/42ivwahjOaNz2N/XKYjsGZvn0QSZV4jaIMyw8XEeW O6RxV+8LfVZyhJocx4cI6jvCP2YVpa1dyWWrjl3KSPJ0OwDdtkLdnEBLTc4r+sCDN0Bb FG8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rhXYRC1W; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id x1-20020a2ea7c1000000b0025bca1fe789si4476756ljp.35.2022.06.28.10.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 10:42:27 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rhXYRC1W; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 61DCB8407A; Tue, 28 Jun 2022 19:42:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="rhXYRC1W"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E64B08407A; Tue, 28 Jun 2022 19:42:23 +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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 A89968407A for ; Tue, 28 Jun 2022 19:42:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rui.silva@linaro.org Received: by mail-wr1-x429.google.com with SMTP id s1so18739137wra.9 for ; Tue, 28 Jun 2022 10:42:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4JPIfg3XVjmwTMevfEcdW2L+NxwGNfV7N6+UibSU6MY=; b=rhXYRC1WgZGiWYC2K4yq06YV4NoA+ocDoMq+SOqnkWlNCrqT8KnHbxvPqLh8kyLo1G JSaukbBYdKeV2d2aMnapvsDOYx9omxEIC48aKVZd746tdpq9bjYfdXeptuWX3WrLSvye AYhnrEvIMFFhTGkp7FyrdhRdFKbq4Hq/NQaMQRmQZrrY8xlo6zXdi0f7uSACV6wRRkes 5g0ifrA6Ri+6o/H7YikeEGn4iX/iPn04HPaywA2Sp6gVv/vXmfHhCdkAeR3klbKdLG98 3qUHfwVezW3fBmHWCIwsRcjX1x2/G099MjmZh87HhzRWXRVf3FFoqzukIuQz0k1J/Jsi LNKg== 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:mime-version :content-transfer-encoding; bh=4JPIfg3XVjmwTMevfEcdW2L+NxwGNfV7N6+UibSU6MY=; b=QFud5+RiZ7LSKNIMgmC5TNj6+RobqsLk6xbX3F7Be0Z6twmAj1+xZ+H3JV8sHTZC7X t0tJ37Op5RSlAwphxUI0IXdi7h+EqWS3bGgkC4E8gtVDWKmIl5lm1oCftV5IlC0Pwk+W VAQA/li4CZpEQwyAbMYha9RXYT9UEJZ6NJvtNKsNpFspEngR0ccVH3qEe3JeNzVJDXEn Xp3N9viqmSoA/Axz8kAFeX4wlImrJy1Y/P8T1Z6C5U0qjUOyJB9JisR/iKLycLt4rl3u ScR0bJLakSnfUvalGBmytHs4qcldmApjvZYWQEUWC1tHH2lqGfPV15UNel6xqiEdOB2L /iaQ== X-Gm-Message-State: AJIora9R0fsySoi4EZ7nc/YzNqH0j26sy/rdgIoXN0J0mA96KteYyyg0 9nLKwVa4Xttqxqx9kJOzYwCyjmWWDc8Ntg== X-Received: by 2002:adf:d213:0:b0:21b:8b4a:24be with SMTP id j19-20020adfd213000000b0021b8b4a24bemr18435159wrh.234.1656438139966; Tue, 28 Jun 2022 10:42:19 -0700 (PDT) Received: from arch-thunder.local (a109-49-33-111.cpe.netcabo.pt. [109.49.33.111]) by smtp.gmail.com with ESMTPSA id j19-20020a5d6e53000000b002102b16b9a4sm14219914wrz.110.2022.06.28.10.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 10:42:19 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de, Marek Vasut Cc: Tom Rini , Rui Miguel Silva Subject: [PATCH v4 0/3] usb: add isp1760 hcd support Date: Tue, 28 Jun 2022 18:42:11 +0100 Message-Id: <20220628174214.2496-1-rui.silva@linaro.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 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.6 at phobos.denx.de X-Virus-Status: Clean Add support for the usb isp1760 host controller family, which for example is present in MPS3 FPGA board from Arm (isp1763). First we move some helper functions and defines to a more common place to be shared by several urb users. (patch 1/3) Then add the driver itself, is a ported version of the kernel actual driver, which I am also the maintainer. (patch 2/3) And last, enable it for the corstone1000 platform that uses that MPS3 board for its implementation (patch 3/3). Cheers, Rui v3 -> v4: - rebase on top of next and resend with Marek in --to v2[3] -> v3: - when you think you have amend commit and fix stay uncommitted. s/[HC_FIELD_MAX] = {};/[HC_FIELD_MAX] = {},/ v1[0] -> v2: - gentle ping - merge fix from kernel upstream [1] PS: This should go on top of the corstone1000 platform enable series [2] 0: https://lore.kernel.org/u-boot/20220512142016.2025129-1-rui.silva@linaro.org/ 1: https://lore.kernel.org/linux-usb/20220516091424.391209-1-linus.walleij@linaro.org/ 2: https://lore.kernel.org/u-boot/20220511095541.1461937-1-rui.silva@linaro.org/T/#t 3: https://lore.kernel.org/u-boot/20220523090119.1212016-1-rui.silva@linaro.org/ Rui Miguel Silva (3): usb: common: move urb code to common usb: add isp1760 family driver corstone1000: enable isp1763 usb controller and mmc Makefile | 1 + configs/corstone1000_defconfig | 3 + drivers/usb/Kconfig | 2 + drivers/usb/common/Makefile | 3 + drivers/usb/common/usb_urb.c | 160 ++ drivers/usb/host/r8a66597-hcd.c | 30 +- drivers/usb/isp1760/Kconfig | 12 + drivers/usb/isp1760/Makefile | 6 + drivers/usb/isp1760/isp1760-core.c | 380 +++ drivers/usb/isp1760/isp1760-core.h | 96 + drivers/usb/isp1760/isp1760-hcd.c | 2477 +++++++++++++++++ drivers/usb/isp1760/isp1760-hcd.h | 81 + drivers/usb/isp1760/isp1760-if.c | 125 + drivers/usb/isp1760/isp1760-regs.h | 292 ++ drivers/usb/isp1760/isp1760-uboot.c | 75 + drivers/usb/isp1760/isp1760-uboot.h | 27 + drivers/usb/musb-new/musb_core.c | 2 +- drivers/usb/musb-new/musb_host.c | 2 +- drivers/usb/musb-new/musb_host.h | 2 +- drivers/usb/musb-new/musb_uboot.c | 38 +- drivers/usb/musb-new/musb_uboot.h | 2 +- include/configs/corstone1000.h | 6 + .../linux/usb/usb_urb_compat.h | 47 +- include/usb_defs.h | 32 + 24 files changed, 3825 insertions(+), 76 deletions(-) create mode 100644 drivers/usb/common/usb_urb.c create mode 100644 drivers/usb/isp1760/Kconfig create mode 100644 drivers/usb/isp1760/Makefile create mode 100644 drivers/usb/isp1760/isp1760-core.c create mode 100644 drivers/usb/isp1760/isp1760-core.h create mode 100644 drivers/usb/isp1760/isp1760-hcd.c create mode 100644 drivers/usb/isp1760/isp1760-hcd.h create mode 100644 drivers/usb/isp1760/isp1760-if.c create mode 100644 drivers/usb/isp1760/isp1760-regs.h create mode 100644 drivers/usb/isp1760/isp1760-uboot.c create mode 100644 drivers/usb/isp1760/isp1760-uboot.h rename drivers/usb/musb-new/usb-compat.h => include/linux/usb/usb_urb_compat.h (59%)