{"id":2228284,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2228284/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260423130323.32533-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":"<20260423130323.32533-4-micbis.openwrt@gmail.com>","date":"2026-04-23T13:03:23","name":"[v5,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/20260423130323.32533-4-micbis.openwrt@gmail.com/mbox/","series":[{"id":501473,"url":"http://patchwork.ozlabs.org/api/1.1/series/501473/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=501473","date":"2026-04-23T13:03:21","name":"usb: gadget: rcar: Add RZ/G2L support and lifecycle fixes","version":5,"mbox":"http://patchwork.ozlabs.org/series/501473/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2228284/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2228284/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=SnMzWLY4;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; 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=\"SnMzWLY4\";\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 [85.214.62.61])\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 4g31p81YsFz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 26 Apr 2026 06:36:48 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 83CC18445D;\n\tSat, 25 Apr 2026 22:36:30 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 3E8298448C; Sat, 25 Apr 2026 20:31:19 +0200 (CEST)","from mail-lf1-x130.google.com (mail-lf1-x130.google.com\n [IPv6:2a00:1450:4864:20::130])\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 36DC184445\n for <u-boot@lists.denx.de>; Sat, 25 Apr 2026 20:31:17 +0200 (CEST)","by mail-lf1-x130.google.com with SMTP id\n 2adb3069b0e04-5a0faa0d15cso8713243e87.0\n for <u-boot@lists.denx.de>; Sat, 25 Apr 2026 11:31:17 -0700 (PDT)","from localhost.localdomain ([151.70.144.55])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488fc0f8188sm549381425e9.2.2026.04.23.06.03.47\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 23 Apr 2026 06:03:47 -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=1777141876; x=1777746676; 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=NjMV4plsEVdtD/IjRw5vFgk17+txSXm8V6nD6TA2L9o=;\n b=SnMzWLY4h4TqOq8wxcgvVDYWG3Ue0/Vb4pzVetZTsp04QbbdeEi7wWjnOLVoumKuHG\n 45s2gbYcAOjeWPZpgj5QlqttLzTpOAZ88A1QiOjfWh8HDWfRZim/zLiNWwZAe9yGeFK3\n UyuiCX0iSE990KQ/kOOvtvJy7dIvqkyUlU5x4SW5/9Tk5CLgl9ywvHwCiBRlvbvjLs8T\n gcWri4NZRYsruUH/r0K0MPHWhdHfoBbdZaH88awyBNDQj9kL6bu523v4PIizq8cLcBHi\n U0SEltORHph4RNAowAp7W0lz8qClgb89T2VQwXio458zXAVWOjRpjCWDgSNLFkpe8Yyg\n sjOw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777141876; x=1777746676;\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;\n bh=NjMV4plsEVdtD/IjRw5vFgk17+txSXm8V6nD6T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A\n ExRwPRYnBwRSEgbBiSj7aSl2CX4gprFIRzk4cAn6gp37skqcS525Q=","X-Received":"by 2002:a05:600c:8b38:b0:485:39b2:a47c with SMTP id\n 5b1f17b1804b1-488fb796fa0mr370060265e9.25.1776949428260;\n Thu, 23 Apr 2026 06:03:48 -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 v5 3/3] usb: gadget: rcar: Add support for RZ/G2L (R9A07G044)","Date":"Thu, 23 Apr 2026 15:03:23 +0200","Message-Id":"<20260423130323.32533-4-micbis.openwrt@gmail.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20260423130323.32533-1-micbis.openwrt@gmail.com>","References":"<20260423130323.32533-1-micbis.openwrt@gmail.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Mailman-Approved-At":"Sat, 25 Apr 2026 22:36:28 +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\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 32c4f1fadb1..580a0fbf090 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@@ -482,8 +496,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":["v5","3/3"]}