From patchwork Wed Jun 29 10:06:13 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: 585814 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp190149mab; Wed, 29 Jun 2022 03:06:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sfxH4nYFA2BUGirLNR4VgrFblEJ8VxABbX+fSmrbZNeEuOdGuhukk1Dr+u6erd4pfxAwFf X-Received: by 2002:ac2:4906:0:b0:47f:6c71:6de5 with SMTP id n6-20020ac24906000000b0047f6c716de5mr1577980lfi.137.1656497198303; Wed, 29 Jun 2022 03:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656497198; cv=none; d=google.com; s=arc-20160816; b=YXACPHysrf+DFMhYTZRN/ruBsAUQxWT/SFRloHSLfeyqEuZYEqsMDmSeVMTJZ9tF4d dZc9/kpPnQh0M4LcnL+llgTKulq7v6IU6RIekXXmg+Kyjo8v625bLsUDn+PbpTsEMFUM zKPJ/Myot5IhXBIQ1wddLdRzczfhfE7s9e2s67vTfe2bV2BfnTxvWo9yHjvhvPnrjjjB KTPXbCvurMp8zXQYnQoAnn1gOhV91KtdcQAqgzvb5nZsFEcn/uS6gmws5PwOF4bGUmU0 uaV6xeGUO9BodlNu1OtOgNMFLK02xiTB2Ia1kn/rA7TBTihRjNyveMLgaxMiwCeraUJA 91Ww== 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=Y28tWw3m971TF0PbLalIXKjHuw++hbZMpEGxPwmqKyo=; b=UcJhdjlP3QrO5a9wsFDX6oc176odI8zMn01fvJsdQRCAgbiZg6fHVI1dTgE5CDGjlr 4WxZOC9xp8TzQOHo3xeSu7p9Yj5jI3syG/Pwnyc1fRLQSTc/FjMVlVixPLmGd2PAoT+g 4oeNwXLJMfn4ElGOZZuYE1XGJOoY7AsA8Uumv96BpvRZVzTw8soBNJYcQ6b/84vxhyOv ov35YILha/I97Gbu+9xaF7xiBUh0eQpqGrbKqd5Byv7O+dJQ+klK9v/pYpHPiwkzGEo+ t6jwef9RdgRzFjlwVRoLKfdMl49FckwDMrN8QKZ70C5sHgwh5Tsu5klJp+ULdR1rM69F 15Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hORrj6++; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id c6-20020a056512104600b0047dd44655a4si17456545lfb.451.2022.06.29.03.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 03:06:38 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hORrj6++; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 9F4DD8424E; Wed, 29 Jun 2022 12:06:31 +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="hORrj6++"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EF86483F17; Wed, 29 Jun 2022 12:06:29 +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=unavailable autolearn_force=no version=3.4.2 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (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 478D68424E for ; Wed, 29 Jun 2022 12:06:27 +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-wm1-x332.google.com with SMTP id v193-20020a1cacca000000b003a051f41541so2879227wme.5 for ; Wed, 29 Jun 2022 03:06:27 -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=Y28tWw3m971TF0PbLalIXKjHuw++hbZMpEGxPwmqKyo=; b=hORrj6++STcU2ZLzcyyMkIV+8PdzYMwCm4Y0XFinedRwxEEwGRGzebXr36+AflYowM mL+/Syv3JzBQ//+yD6IuyXBTNDbBOxqry9f1gWbTwU5vnZzSCNYfdC4K5sC7Jq8wGULd SkyJJ9L1XtQpasdkJbZd/wLnn2ZQtGEVUV+nq9pwqUZVi4vkKDU5oQM8spgR36pQbz9t I8yjfmUxtcKqirJTOSFrQt8L3u2j2qrmofxHpD9KZ5NsBOois6/+GM7awKTK/I6AI5kg YFP2SQ6duihWNdttWJo+LyPaHdSyHVByscm22sH6KKB5DsZLRHbX8lvRVtSnCcR+3ip/ CnWw== 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=Y28tWw3m971TF0PbLalIXKjHuw++hbZMpEGxPwmqKyo=; b=W8OAKdduxcRriheKHuyFUmDpetbadKFIRsPjmDN5Ac1TgLmB6nnV+kLaZoLsScWlsX eDePUk7MkTDTNOOc9WMOIf5CiNKc6OerUh3/68/FrtPXRh+X+hnE1pbTm5/EzrUWNn40 vLRvFSish2K5UIuDOP3TZeN25KZW2YQ7SezHAfaGFAVFb2vZf87GtA7p6vnhn71QaQi9 S6XZnB+x2m0yQcU7DdhfELLJgmMyQicf52S6sO6KrP3IgU2sjMyA5iG3NF9Azw9GFsKN mQqqeQQ7N29I1vM+XvRL3nXYzIEW24evZ5Lm52jqvOhRRfD0pSNHq7mYVtdHTLsDVN9/ jF1A== X-Gm-Message-State: AJIora8CavPFKdU7xDTTQvXLjJ27nP+gKn7VoalRm/SBNvu/4g54r5W3 v37r510kYbHPM/p5+2wTjPbhjbUJkMkihg== X-Received: by 2002:a1c:f018:0:b0:3a0:3f8d:d71e with SMTP id a24-20020a1cf018000000b003a03f8dd71emr2817256wmb.104.1656497186648; Wed, 29 Jun 2022 03:06:26 -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 h4-20020a5d4304000000b0021b829d111csm16526076wrq.112.2022.06.29.03.06.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 03:06:26 -0700 (PDT) From: Rui Miguel Silva To: u-boot@lists.denx.de, Marek Vasut Cc: Tom Rini , Rui Miguel Silva Subject: [PATCH v5 0/3] usb: add isp1760 hcd support Date: Wed, 29 Jun 2022 11:06:13 +0100 Message-Id: <20220629100616.417550-1-rui.silva@linaro.org> X-Mailer: git-send-email 2.37.0 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 v4[4] -> v5: Marek: - fix makefile to include the common urb code for the musb_host, musb_gadget and r8a66597 drivers 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/ 4: https://lore.kernel.org/u-boot/20220628174214.2496-1-rui.silva@linaro.org/T/#t 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 | 4 + 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, 3826 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%)