{"id":2228263,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2228263/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260424160316.157380-4-micbis.openwrt@gmail.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.1/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260424160316.157380-4-micbis.openwrt@gmail.com>","date":"2026-04-24T16:03:16","name":"[v6,3/3] usb: gadget: rcar: Add support for RZ/G2L (R9A07G044)","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"2541ac056ce290a69a2872dae30151a252ed516e","submitter":{"id":93164,"url":"http://patchwork.ozlabs.org/api/1.1/people/93164/?format=json","name":"Michele Bisogno","email":"micbis.openwrt@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260424160316.157380-4-micbis.openwrt@gmail.com/mbox/","series":[{"id":501462,"url":"http://patchwork.ozlabs.org/api/1.1/series/501462/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=501462","date":"2026-04-24T16:03:14","name":"usb: gadget: rcar: Add RZ/G2L support and lifecycle fixes","version":6,"mbox":"http://patchwork.ozlabs.org/series/501462/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2228263/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2228263/checks/","tags":{},"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=s/1b4pa1;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.b=\"s/1b4pa1\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com","phobos.denx.de;\n spf=pass smtp.mailfrom=micbis.openwrt@gmail.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g2yVR3bbHz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 26 Apr 2026 04:07:59 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 8B867844FF;\n\tSat, 25 Apr 2026 20:03:21 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id E7C838435B; Sat, 25 Apr 2026 19:51:21 +0200 (CEST)","from mail-ej1-x630.google.com (mail-ej1-x630.google.com\n [IPv6:2a00:1450:4864:20::630])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id C818184308\n for <u-boot@lists.denx.de>; Sat, 25 Apr 2026 19:51:19 +0200 (CEST)","by mail-ej1-x630.google.com with SMTP id\n a640c23a62f3a-b9c9d03524cso1233940766b.3\n for <u-boot@lists.denx.de>; Sat, 25 Apr 2026 10:51:19 -0700 (PDT)","from localhost.localdomain ([151.70.144.55])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488fc10777csm678783845e9.8.2026.04.24.09.04.07\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 24 Apr 2026 09:04:07 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_GMAIL_RCVD,FREEMAIL_FROM,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no\n autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777139479; x=1777744279; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=ZoydWEKnN0EEChvkfKpSzrThS6WCboZ434hrmvxtqvU=;\n b=s/1b4pa16MHWxiuy2ZPB3Ml++iNlmAREr1lrXjnuTqxrhYoN95rJCVl9hwykjduHMW\n mwgmaPn2VB9NY364CfeZhmeOeLiwAqSdpavOONlBFTOxHtPqLhVwigga1pux4fONZAYk\n gg+y9bq5C1rSbg7vbXIu+M6VGFejELGIDDTrNxWp3bXhnJoZjipCHpB4V1uNalwTeDWC\n lpBOWa7Vw/tqo6X6tn0NXSTazZdexQLV3wVqaPLnHSxwmc6hdEQxjgdsCWopL6x46Nvl\n dvajSCP6VkFz8HBKIZnlwG0i57BHmIyc+opJSrT/p1F5FsYdZ7wsKYwKaDTBo9g/NHYX\n 7Wcg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777139479; x=1777744279;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\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jlcvdfNuLIQAhC5LC4OI5CmJYdhUydA6GO19bbhan9cT4LOzvGc1Op\n HG9jFmW+NGlYRxDB/7ryiaiUQzK+o79TvQ55LNx/la7u9fmeLs7C8=","X-Received":"by 2002:a05:600c:a40a:b0:489:1ba8:5bf0 with SMTP id\n 5b1f17b1804b1-4891ba85dc1mr289191445e9.21.1777046648285;\n Fri, 24 Apr 2026 09:04:08 -0700 (PDT)","From":"Michele Bisogno <micbis.openwrt@gmail.com>","To":"Marek Vasut <marex@denx.de>, Lukasz Majewski <lukma@denx.de>,\n Mattijs Korpershoek <mkorpershoek@kernel.org>","Cc":"Nobuhiro Iwamatsu <iwamatsu@nigauri.org>, Tom Rini <trini@konsulko.com>,\n u-boot@lists.denx.de, Michele Bisogno <micbis.openwrt@gmail.com>","Subject":"[PATCH v6 3/3] usb: gadget: rcar: Add support for RZ/G2L (R9A07G044)","Date":"Fri, 24 Apr 2026 18:03:16 +0200","Message-Id":"<20260424160316.157380-4-micbis.openwrt@gmail.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20260424160316.157380-1-micbis.openwrt@gmail.com>","References":"<20260424160316.157380-1-micbis.openwrt@gmail.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Mailman-Approved-At":"Sat, 25 Apr 2026 20:03:18 +0200","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"The Renesas RZ/G2L (and RZ/G2LC) USBHS controller requires the\nCNEN bit in the SYSCFG register to be set for function operation.\nAdditionally, its CFIFO is byte-addressable.\n\nIntroduce a new renesas_usbhs_driver_param structure for the\nRZ/G2L SoC and link it via the udevice_id data pointer. Update\nusbhs_probe() to accept the udevice pointer to retrieve these\nparameters during initialization.\n\nThis alignment follows the logic used in the Linux kernel\nrenesas_usbhs driver.\n\nReviewed-by: Marek Vasut <marex@denx.de>\nSigned-off-by: Michele Bisogno <micbis.openwrt@gmail.com>\n---\n drivers/usb/gadget/rcar/common.c      | 20 ++++++++++++++++++++\n drivers/usb/gadget/rcar/renesas_usb.h |  1 +\n 2 files changed, 21 insertions(+)","diff":"diff --git a/drivers/usb/gadget/rcar/common.c b/drivers/usb/gadget/rcar/common.c\nindex 2bf0dcff393..10548f7a20c 100644\n--- a/drivers/usb/gadget/rcar/common.c\n+++ b/drivers/usb/gadget/rcar/common.c\n@@ -92,6 +92,12 @@ void usbhs_sys_function_ctrl(struct usbhs_priv *priv, int enable)\n \tu16 mask = DCFM | DRPD | DPRPU | HSE | USBE;\n \tu16 val  = HSE | USBE;\n \n+\t/* CNEN bit is required for function operation */\n+\tif (usbhs_get_dparam(priv, has_cnen)) {\n+\t\tmask |= CNEN;\n+\t\tval  |= CNEN;\n+\t}\n+\n \t/*\n \t * if enable\n \t *\n@@ -363,13 +369,21 @@ static int usbhs_probe(struct udevice *dev)\n {\n \tstruct usbhs_priv_otg_data *otg_priv = dev_get_priv(dev);\n \tstruct usbhs_priv *priv = &otg_priv->usbhs_priv;\n+\tstruct renesas_usbhs_driver_param *plat_param;\n \tint ret;\n \n+\tplat_param = (struct renesas_usbhs_driver_param *)dev_get_driver_data(dev);\n+\n \tpriv->dparam.type = USBHS_TYPE_RCAR_GEN3;\n \tpriv->dparam.pio_dma_border = 64;\n \tpriv->dparam.pipe_configs = usbhsc_new_pipe;\n \tpriv->dparam.pipe_size = ARRAY_SIZE(usbhsc_new_pipe);\n \n+\tif (plat_param) {\n+\t\tpriv->dparam.has_cnen\t\t= plat_param->has_cnen;\n+\t\tpriv->dparam.cfifo_byte_addr\t= plat_param->cfifo_byte_addr;\n+\t}\n+\n \t/* call pipe and module init */\n \tret = usbhs_pipe_probe(priv);\n \tif (ret < 0)\n@@ -487,8 +501,14 @@ static int usbhs_udc_otg_remove(struct udevice *dev)\n \treturn dm_scan_fdt_dev(dev);\n }\n \n+static struct renesas_usbhs_driver_param rzg2l_param = {\n+\t.has_cnen = 1,\n+\t.cfifo_byte_addr = 1,\n+};\n+\n static const struct udevice_id usbhs_udc_otg_ids[] = {\n \t{ .compatible = \"renesas,rcar-gen3-usbhs\" },\n+\t{ .compatible = \"renesas,rzg2l-usbhs\", .data = (unsigned long)&rzg2l_param },\n \t{},\n };\n \ndiff --git a/drivers/usb/gadget/rcar/renesas_usb.h b/drivers/usb/gadget/rcar/renesas_usb.h\nindex 8155e3dcaf6..140a70251cf 100644\n--- a/drivers/usb/gadget/rcar/renesas_usb.h\n+++ b/drivers/usb/gadget/rcar/renesas_usb.h\n@@ -111,6 +111,7 @@ struct renesas_usbhs_driver_param {\n \tu32 has_otg:1; /* for controlling PWEN/EXTLP */\n \tu32 has_sudmac:1; /* for SUDMAC */\n \tu32 has_usb_dmac:1; /* for USB-DMAC */\n+\tu32 has_cnen:1;\n \tu32 cfifo_byte_addr:1; /* CFIFO is byte addressable */\n #define USBHS_USB_DMAC_XFER_SIZE\t32\t/* hardcode the xfer size */\n \tu32 multi_clks:1;\n","prefixes":["v6","3/3"]}