From patchwork Mon Jan 20 13:09:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 859356 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 740801E0E01 for ; Mon, 20 Jan 2025 13:09:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737378585; cv=none; b=ctliSkHQPF5pk3tAeGCspgOQoHD52oQ0UmOEZwNnIw6w1muNOzq+DxKbKzC8d/i2884E3jWk/DvAAgennpdlhlhKeZ0hSS9sRXZIGLzh09PM2E2QskTig34ShMNVsWRBdXZsnDMAV2JKIVzY3N/MD38736+E9vWnOVZpdNC42ak= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737378585; c=relaxed/simple; bh=uct9U7IhGmLGks2dzIuQgZHdXFiBAwtQzHFSaHGw5ao=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QyB1w7/SRNg1LgYkFtLM1COPDi43s21WBXRvAKNeXcQBrgG8JsJ4erauGgk8Jm8GyzxUIH+0aipbbuFjGHMZmYP5fhTJDGG2vYde7A1fXxsKfF9jPuvGMPKn1xsxBL4zUIeeDfLBEIG1qyUgcp/I3x2nzbKWHTWQpiDUmyZaIyg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=A5rclq2a; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="A5rclq2a" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-438a39e659cso11130625e9.2 for ; Mon, 20 Jan 2025 05:09:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1737378582; x=1737983382; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f6x24vOEL5/TJ8vXf0hNcJSgsC5eLh36a2PxWG5XS3Q=; b=A5rclq2aAaPsgiQLdXDrjLZ5tbiqvYLg+ba9RHu9YPDBrUuryNzfrqiqImCrFBbyGb nSwQh04H8o7XaWrH9kRR/ef0Q2HGyy23qolknvFih6eAHJhmNkuAj589GQcL/QXyZGyc 95uAabMEgP7rV95nxZM4l18VSlhg3OndDuHFYXoDVZ8JelwvL49x8/JmoXyUu3GL1KSl un2BIpyX33MkzWBoL39J7bd6PHKNg1wAFLX0ldl9CqK3YWGlzHqQwaz/JC2+eFxTH2W5 kXIysTatgOGkrlJVzuggTxSCjs7Z8VI4J/eczgerBw9UYQhD+f0Jo9Ua/7xqTIkH6z19 xFuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737378582; x=1737983382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f6x24vOEL5/TJ8vXf0hNcJSgsC5eLh36a2PxWG5XS3Q=; b=UwsaW4seK0hFqBkaJ6BJJzuBCd8lE5iBrrukv3t6BwwmOsFR+/roG9UKZomAKBmPKa CcKmg9EpbLWP9yc/Ja+pqppjNn+XImQcP+0GuodSp0iEKn7MQLs0CGcgZLoSbLSKOOTD 0d1hPYhWuMJCy0nZx3K7aAnXBbHZUcElTzrsj2HSbG7OtSe2f9nM+7NqI3JcThpDuHOP pvhmDM7lH9YyqQ8ZiIMflGNy+xewgLwPOwi0Juih7lUOR8EFN4TqEYCXb4RF/rQZg4mm X+AcG2B8Vhnai2VF3R1MYFmpJ1LgNfI+IlZmm6J5OsGYTFmNPRwkAlNb0QxO6pmTpfys sqbw== X-Forwarded-Encrypted: i=1; AJvYcCVNCDBoegg5EpzRUCbNnK8ze/BDLk8Pz82YHMiApDsVs0AZ5izvhEyObcJeu59whUG/WzZBr69GAl72J3I=@vger.kernel.org X-Gm-Message-State: AOJu0YylwyB3CN3P1n3znFFxks/DCl6NTzLET3t2Xm8K/2HCP2/CppB9 OleL4BBGTkIC/7OFONZPW7YlkvZ55HLshVMNDoeUQ0SZBjwzL/gUNn8cIBzchOA= X-Gm-Gg: ASbGnctoNRqLz1CuoyX8ll2dHQgsQMyHcMabdxhMnS3Ni2WH2G2gpbZuCP0pkhqKf+g jEklDMo+V+7De4hXkrtq7bfnzah2+IB3AJHprpoHTY0VaPPbj4NKfTE/V7AixCLVKXFK4qzPSwK k14TxzCg4GoBNADaOFyiI3OzxaqCFkAICNbxgQPNmygVzm3rohszG4WN2YsG6miRCGDXYxgdzDB xP4fkYD0O24lDDw+pT8BWXNX94uBtknP6lCnFpnMTNub6XqPnnpKK/AVd0YU0Pnj57mvuF2rrla xQX+e3IYYd7iTr+JTg75GQg= X-Google-Smtp-Source: AGHT+IGxlb5HA5FYguAsz6eUdlluzgj3rUbYoqrhqAKMsNvCOU1DkxKaDcLmK42gJnvVftsGSFzeeQ== X-Received: by 2002:a05:600c:3844:b0:434:ff08:202b with SMTP id 5b1f17b1804b1-438913dbc09mr122718855e9.12.1737378581607; Mon, 20 Jan 2025 05:09:41 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.35]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4389041f61bsm138001955e9.17.2025.01.20.05.09.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 05:09:41 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, magnus.damm@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, p.zabel@pengutronix.de, claudiu.beznea.uj@bp.renesas.com, wsa+renesas@sang-engineering.com, prabhakar.mahadev-lad.rj@bp.renesas.com Cc: claudiu.beznea@tuxon.dev, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v4 1/4] serial: sh-sci: Update the suspend/resume support Date: Mon, 20 Jan 2025 15:09:33 +0200 Message-ID: <20250120130936.1080069-2-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250120130936.1080069-1-claudiu.beznea.uj@bp.renesas.com> References: <20250120130936.1080069-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Claudiu Beznea The Renesas RZ/G3S supports a power saving mode where power to most of the SoC components is turned off. When returning from this power saving mode, SoC components need to be re-configured. The SCIFs on the Renesas RZ/G3S need to be re-configured as well when returning from this power saving mode. The sh-sci code already configures the SCIF clocks, power domain and registers by calling uart_resume_port() in sci_resume(). On suspend path the SCIF UART ports are suspended accordingly (by calling uart_suspend_port() in sci_suspend()). The only missing setting is the reset signal. For this assert/de-assert the reset signal on driver suspend/resume. In case the no_console_suspend is specified by the user, the registers need to be saved on suspend path and restore on resume path. To do this the sci_console_setup() function was added. There is no need to cache/restore the status or FIFO registers. Only the control registers. To differentiate b/w these, the struct sci_port_params::regs was updated with a new member that specifies if the register needs to be chached on suspend. Only the RZ_SCIFA instances were updated with this new support as the hardware for the rest of variants was missing for testing. Signed-off-by: Claudiu Beznea --- Changes in v4: - none Changes in v3: - none Changes in v2: - rebased on top of the update version of patch 2/8 from this series drivers/tty/serial/sh-sci.c | 53 ++++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index b1ea48f38248..ae43237dd684 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -101,7 +101,7 @@ enum SCI_CLKS { if ((_port)->sampling_rate_mask & SCI_SR((_sr))) struct plat_sci_reg { - u8 offset, size; + u8 offset, size, suspend_cacheable; }; struct sci_port_params { @@ -134,6 +134,8 @@ struct sci_port { struct dma_chan *chan_tx; struct dma_chan *chan_rx; + struct reset_control *rstc; + #ifdef CONFIG_SERIAL_SH_SCI_DMA struct dma_chan *chan_tx_saved; struct dma_chan *chan_rx_saved; @@ -153,6 +155,7 @@ struct sci_port { int rx_trigger; struct timer_list rx_fifo_timer; int rx_fifo_timeout; + unsigned int console_cached_regs[SCIx_NR_REGS]; u16 hscif_tot; bool has_rtscts; @@ -300,17 +303,17 @@ static const struct sci_port_params sci_port_params[SCIx_NR_REGTYPES] = { */ [SCIx_RZ_SCIFA_REGTYPE] = { .regs = { - [SCSMR] = { 0x00, 16 }, - [SCBRR] = { 0x02, 8 }, - [SCSCR] = { 0x04, 16 }, + [SCSMR] = { 0x00, 16, 1 }, + [SCBRR] = { 0x02, 8, 1 }, + [SCSCR] = { 0x04, 16, 1 }, [SCxTDR] = { 0x06, 8 }, [SCxSR] = { 0x08, 16 }, [SCxRDR] = { 0x0A, 8 }, - [SCFCR] = { 0x0C, 16 }, + [SCFCR] = { 0x0C, 16, 1 }, [SCFDR] = { 0x0E, 16 }, - [SCSPTR] = { 0x10, 16 }, + [SCSPTR] = { 0x10, 16, 1 }, [SCLSR] = { 0x12, 16 }, - [SEMR] = { 0x14, 8 }, + [SEMR] = { 0x14, 8, 1 }, }, .fifosize = 16, .overrun_reg = SCLSR, @@ -3374,6 +3377,7 @@ static struct plat_sci_port *sci_parse_dt(struct platform_device *pdev, } sp = &sci_ports[id]; + sp->rstc = rstc; *dev_id = id; p->type = SCI_OF_TYPE(data); @@ -3546,13 +3550,34 @@ static int sci_probe(struct platform_device *dev) return 0; } +static void sci_console_setup(struct sci_port *s, bool save) +{ + for (u16 i = 0; i < SCIx_NR_REGS; i++) { + struct uart_port *port = &s->port; + + if (!s->params->regs[i].suspend_cacheable) + continue; + + if (save) + s->console_cached_regs[i] = sci_serial_in(port, i); + else + sci_serial_out(port, i, s->console_cached_regs[i]); + } +} + static __maybe_unused int sci_suspend(struct device *dev) { struct sci_port *sport = dev_get_drvdata(dev); - if (sport) + if (sport) { uart_suspend_port(&sci_uart_driver, &sport->port); + if (!console_suspend_enabled && uart_console(&sport->port)) + sci_console_setup(sport, true); + else + return reset_control_assert(sport->rstc); + } + return 0; } @@ -3560,8 +3585,18 @@ static __maybe_unused int sci_resume(struct device *dev) { struct sci_port *sport = dev_get_drvdata(dev); - if (sport) + if (sport) { + if (!console_suspend_enabled && uart_console(&sport->port)) { + sci_console_setup(sport, false); + } else { + int ret = reset_control_deassert(sport->rstc); + + if (ret) + return ret; + } + uart_resume_port(&sci_uart_driver, &sport->port); + } return 0; } From patchwork Mon Jan 20 13:09:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 858870 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 064231DFE16 for ; Mon, 20 Jan 2025 13:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737378587; cv=none; b=E0k5YqidOsuZrKzQSQUGfBHp9J9XWj55BYEiDpT7FXr6u4FpaRzLpIOubhMgr9C0RTBofG9eJut4oKk9Ec8BWDH7VM/tKrU4a7uEWBxSk6TsTqjTdw88hykiRz+i2PJCAY9M10aXRdDfb2vx2wfJF1KcI5u+GQddp6rBtoXwDFc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737378587; c=relaxed/simple; bh=7n5sMDbwVn+ispnfZZTJJPvroNDzqS+OKERZbs8Fe0Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IAnDooiiv/+XEjSCSukNS+iIS/bUK5S3KkIRt1f78laY+wuOaNxtQdBcE8AdQ+o/93k1GqRztem9k9xxVpDwqqJ4VXu0+Aj5hYjVmxXSRXl+KM38Npjneo4k6oRwj2MAWLg/+SB8VEWqaB4qs5BRM8N2lXf1pI2R6h4Cgqvrxko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=Y4caGsss; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="Y4caGsss" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-436281c8a38so31561435e9.3 for ; Mon, 20 Jan 2025 05:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1737378583; x=1737983383; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2gRlxtvByNO5udzwmMv5gFGDjo6tJlSTC3E0AGWaYSY=; b=Y4caGsssFUKZXUr41pPOSXGP8Q668FEh1XziKh8tRfwWIBE2MvWuMacekpLEmzr6wQ NPBr6TM8JNcYvp1rtZmdfTIZrGz1WEZ/4ku9+4EcYXp4tta9Uw+xQS9oqBHiGbTmzaxM 4ee7afd3fNNDRSirgdL6fzppbKurcZGDUXSFX6DqSp8MCBA5pyBhXUTh1c/BacGFfqqv NK9abCjIkWwJV1U+jEmAwqaunm6aTy40utMsQkHQbVLy/RsBmxkEEx9RuP9K6cOgswLa YsfGAqmcIy7xNMfLfORpbpNcvD1JFcVw8MxKUIpz3iINeTZagqSRnlPUfV0dmxOduH0i PASQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737378583; x=1737983383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2gRlxtvByNO5udzwmMv5gFGDjo6tJlSTC3E0AGWaYSY=; b=vyBQfsjX0cZ5vdtKU2b1kfGbi8oY5OsiEOL/5x+Eid5R6SteS9WUIK8im+jvFlqrKS zqqAK0FlBsV6xFCX0j/bhzBllD1D7/1VYMxZBL2nsHINf1PGyeCsGzLdOfTkCgqFnPLn n7kYw/Doyb4DJfFLHtPLtj1yoi7+/tOsHmm4WO91fGXlP67w5ZCO4+KkRm/ycB1kdzk0 +wEyZApzG87drZJ5MSa6Yc00FpbxfrsO28t/a5GdFUSDjlCNCfNfDgy4+eD50q/t7+Db QcS7zXWdS8pAOKT9XDnfOJIPeji8hhGHIV1yb1qOXe2t+VnqjOds8BbhwLzx6vOEgcVc oOkw== X-Forwarded-Encrypted: i=1; AJvYcCXc0X0CnC1wB9FscRUGuV1aJEBrKEGsRIdRk1w4ykRsvkHz5oCHNNuN3iTlJLscSI4dJBJueYU/w5FQ9lA=@vger.kernel.org X-Gm-Message-State: AOJu0Yyc514q3ShXo/O7hcCGUibdUORnzxYXBGGDUKByOzSOCNm0JRK/ sRNlDrWsS7Rf9cq/uaG67tZiL63Mfo1Yw0Use1vNLCkLkayVRQsSCNmzuq0wVZ5g0KG7E9DjBHS g X-Gm-Gg: ASbGncsGduP9RhVMKlLB7L8hEAC3MLwWs3ITkJQG8kW1iUZ3pOLeuLzZNVzsW8USoBK yBYwUrILUZJQenU7RM/+GfKnQRYJalCNpzcQP+Qlp9hzuxacnmxT2XS9wkXGMX7KOmmk7VhpSks ztOaMZYeorbtoqmTCWDb1XRz+MFmk3PmWsXfUygswqwn58FrQ5uIBp9drXvnqq2yAmJXZn+gFS2 +jGw6dUN34aT8cpR+L45piMBoi6GUxy+WgHhr4GjqYGDRZ3pK8TnI3rlUiAYdeJmWjL22ben8Zl r4q8OHvHZ86o2dyd9w9TXcY= X-Google-Smtp-Source: AGHT+IGUE8yPgR7lQfCZF5G3ZqkDOFLEhMezebE22LyEhYPqM8owjlY/N8nCg5j028/go6Z7PsODoQ== X-Received: by 2002:a05:600c:6c9a:b0:438:a240:c54 with SMTP id 5b1f17b1804b1-438a2400d95mr64394965e9.9.1737378583223; Mon, 20 Jan 2025 05:09:43 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.35]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4389041f61bsm138001955e9.17.2025.01.20.05.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 05:09:42 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, magnus.damm@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, p.zabel@pengutronix.de, claudiu.beznea.uj@bp.renesas.com, wsa+renesas@sang-engineering.com, prabhakar.mahadev-lad.rj@bp.renesas.com Cc: claudiu.beznea@tuxon.dev, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v4 2/4] arm64: dts: renesas: rzg3s-smarc-switches: Add a header to describe different switches Date: Mon, 20 Jan 2025 15:09:34 +0200 Message-ID: <20250120130936.1080069-3-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250120130936.1080069-1-claudiu.beznea.uj@bp.renesas.com> References: <20250120130936.1080069-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Claudiu Beznea There are different switches available on both the RZ/G3S SMARC Module and RZ SMARC Carrier II boards. These switches are used to route different SoC signals to different parts available on board. These switches are described in device trees through macros. These macros are set accordingly such that the resulted compiled dtb to describe the on-board switches states. The SCIF1 depends on the state of the SW_CONFIG3 and SW_OPT_MUX4 switches. SCIF1 can be enabled through a device tree overlay. To manage all switches in a unified state and allow users to configure the output device tree, add a file that contains all switch definitions and states. Commit prepares the code to enable SCIF1 on the RZ/G3S overlay. Signed-off-by: Claudiu Beznea --- Changes in v4: - adjusted the patch description - used GPL-2.0-only OR BSD-2-Clause license - used proper description for SW_CONFIG3 Changes in v3: - none Changes in v2: - none .../boot/dts/renesas/rzg3s-smarc-som.dtsi | 20 +----------- .../boot/dts/renesas/rzg3s-smarc-switches.h | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 arch/arm64/boot/dts/renesas/rzg3s-smarc-switches.h diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi index ef12c1c462a7..39845faec894 100644 --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi @@ -9,25 +9,7 @@ #include #include -/* - * On-board switches' states: - * @SW_OFF: switch's state is OFF - * @SW_ON: switch's state is ON - */ -#define SW_OFF 0 -#define SW_ON 1 - -/* - * SW_CONFIG[x] switches' states: - * @SW_CONFIG2: - * SW_OFF - SD0 is connected to eMMC - * SW_ON - SD0 is connected to uSD0 card - * @SW_CONFIG3: - * SW_OFF - SD2 is connected to SoC - * SW_ON - SCIF1, SSI0, IRQ0, IRQ1 connected to SoC - */ -#define SW_CONFIG2 SW_OFF -#define SW_CONFIG3 SW_ON +#include "rzg3s-smarc-switches.h" / { compatible = "renesas,rzg3s-smarcm", "renesas,r9a08g045s33", "renesas,r9a08g045"; diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc-switches.h b/arch/arm64/boot/dts/renesas/rzg3s-smarc-switches.h new file mode 100644 index 000000000000..514a8a6dc013 --- /dev/null +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-switches.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * On-board switches for the Renesas RZ/G3S SMARC Module and RZ SMARC Carrier II + * boards. + * + * Copyright (C) 2024 Renesas Electronics Corp. + */ + +#ifndef __RZG3S_SMARC_SWITCHES__ +#define __RZG3S_SMARC_SWITCHES__ + +/* + * On-board switches' states: + * @SW_OFF: switch's state is OFF + * @SW_ON: switch's state is ON + */ +#define SW_OFF 0 +#define SW_ON 1 + +/* + * SW_CONFIG[x] switches' states: + * @SW_CONFIG2: + * SW_OFF - SD0 is connected to eMMC + * SW_ON - SD0 is connected to uSD0 card + * @SW_CONFIG3: + * SW_OFF - SD2 is connected to SoC + * SW_ON - SCIF1, SSI0, IRQ0, IRQ1 connected to SoC + */ +#define SW_CONFIG2 SW_OFF +#define SW_CONFIG3 SW_ON + +#endif /* __RZG3S_SMARC_SWITCHES__ */ From patchwork Mon Jan 20 13:09:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 859355 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 977521E1A2D for ; Mon, 20 Jan 2025 13:09:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737378589; cv=none; b=jQt5/yQ352jWYLV4lBQyw2hsQOC20Ajh+lQiBYEVUxTOqyrssldMgFLkgB9NvF4Jh0Wc3anQFphpjk2WN9Mv5YJhsku+ozbxz/4yJhzQeFnRuRYbL2QdYtA57wrjk8U3ri9MQ1qvwJ15XeuzFO9EnX8p88N5krhiEdLUrnJBM8U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737378589; c=relaxed/simple; bh=7o3Y+E7nnBZwgQGYjXgcYEZjLUWyl3PQWnVN9lSAnOw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G2nhH0UyYEbUQdF2jHOfEbVmiBpyFRNMMBZwYTV4johL1vLFVqrpeB65ICPMnLDoBuWxPWfzMQG6a4t32+IutaOv5FzLl4G1hp5e5GErit6SiNIxt/6X5tcYsRiFWe3OuInce6WZgXVftjisW95ywva+n7rrBroyk7TnGhDC9R8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=onaj1ljd; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="onaj1ljd" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-436345cc17bso31574815e9.0 for ; Mon, 20 Jan 2025 05:09:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1737378585; x=1737983385; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2lPi/twN6zUkfiC5mOpKuXZ209zqYTSm0G6i4T4io+0=; b=onaj1ljdkRsIYtjBEwJW48yzPCGLBwRuE7i6+GWZc1UNZkmgyma9zKOgFdjoMiofao pSqjSqfAdTrjhqEHiMatSquI4JVNAPCrKTuQ71WpLQt+zJ+WRlE9kNlWPK+zupvUvaFj h3VAo4ge5R/qSxHGdKrBITU9cwq23sUI2uSi6bcZde4Pm9lPtZV6vVJ6qTr2SmN0B6l3 Y2X8VTYKWY2H1/NxK7njQGJsF0beLHcRBwmCF3CHrRwZ6jnphn709nxehJlqT1VsjEO6 sM6ZFyfO32MFhDsQnCdvhGCRUThFIVpnoYP02kUP+dSzAzK2YK+YOhBlY8jz3IMCsToN DKOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737378585; x=1737983385; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2lPi/twN6zUkfiC5mOpKuXZ209zqYTSm0G6i4T4io+0=; b=s+0oG/7G1yjeNMCkTUmzlGRzmnLXPuVuP52mx6bNJdJZrB8FhIybUAiOLIpDIYuuPl 8k4sGpd0IH63pXXKMnRIAVDZvPOuXbdV0vw7pQ9TOftIr56Gh0kxXCbMBmPH66VDBTgF OZFfSmE+Dl5TRAXf5fR/EfO9/nkrfj+CxyV/4XtwR2IJUxK3iGYx1erFLUk3sqx9hkhy Qikodl+x9BOc8yxGV8pDsvbWNy+Syw3wcAm+6k1jm2T4f5PLxsYa/N9vt8fKfviOpsQy oC82CGlDfgZt8ogjgQmDVuaZlQykdmwHlB5YRQxTXQhJ5HEQXMG9xY8YFi2QOvuMr5q+ 1Mdg== X-Forwarded-Encrypted: i=1; AJvYcCUrZRS05+CCFewjAy9pSJ1+Q8LyIOi7q5sGHxzC7ZjR6fCMyR6ZB17ND008j18vJLbDSlbCyDAruVPYPJE=@vger.kernel.org X-Gm-Message-State: AOJu0YwbctPdONXNg4+Up9WDwHnTRRElG6rm2froMrtpgvzNN8Yni6RH YD/zUPWyKveBEzpRd0fVTQfExWX6MYbZtE9y4TgmxcPwcZAH+ubdfKsNWacqrLo= X-Gm-Gg: ASbGncsGONFCsvN8c0OVHTfbY9Ux5E5rPEDxvY1P4AnHuHl0f7vX3jhmJtjHfav+hat 6LqgkrgBUavie2K0hazkGqQ24DfdUCr6+35dlrJUFgLa5Cv97OwBfxdMB9SZUtWf6aINf/i2m9F Ywj08+lqBhTmS/Jrq7l1XESFH3oil3GgkR6jSAy/FuJCkj3v6BU7SBR118iz/o/1lNs9z3rax1U gKPujyncjiwdD68Q3XOMTXog7wSYI9spWk1NftQiOiREjInY1DYEC65GkXqbjn1LWfrr5fy7Gif RusgNPclfcvGNZPwVh49VoM= X-Google-Smtp-Source: AGHT+IEcU/85w7UbVunXHIxQ5T1EeguZXj0W8RnMAbTNHN0/tPf0amR8m308HxvIlVOOV/v1s38tVA== X-Received: by 2002:a05:600c:c0e:b0:431:5044:e388 with SMTP id 5b1f17b1804b1-4389142968emr119630415e9.22.1737378584913; Mon, 20 Jan 2025 05:09:44 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.35]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4389041f61bsm138001955e9.17.2025.01.20.05.09.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 05:09:44 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, magnus.damm@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, p.zabel@pengutronix.de, claudiu.beznea.uj@bp.renesas.com, wsa+renesas@sang-engineering.com, prabhakar.mahadev-lad.rj@bp.renesas.com Cc: claudiu.beznea@tuxon.dev, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v4 3/4] arm64: dts: renesas: rzg3s-smarc: Enable SCIF3 Date: Mon, 20 Jan 2025 15:09:35 +0200 Message-ID: <20250120130936.1080069-4-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250120130936.1080069-1-claudiu.beznea.uj@bp.renesas.com> References: <20250120130936.1080069-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Claudiu Beznea Enable SCIF3. It is routed on the RZ SMARC Carrier II board on SER1_UART interface. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven --- Changes in v4: - dropped checking the SW_CONFIG3 - dropped the include of rzg3s-smarc-switches.h Changes in v3: - none Changes in v2: - none arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi index 81b4ffd1417d..0851e0b7ed40 100644 --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi @@ -12,6 +12,7 @@ / { aliases { i2c0 = &i2c0; + serial1 = &scif3; serial3 = &scif0; mmc1 = &sdhi1; }; @@ -162,6 +163,11 @@ scif0_pins: scif0 { ; /* TXD */ }; + scif3_pins: scif3 { + pinmux = , /* RXD */ + ; /* TXD */ + }; + sdhi1_pins: sd1 { data { pins = "SD1_DATA0", "SD1_DATA1", "SD1_DATA2", "SD1_DATA3"; @@ -208,6 +214,12 @@ &scif0 { status = "okay"; }; +&scif3 { + pinctrl-names = "default"; + pinctrl-0 = <&scif3_pins>; + status = "okay"; +}; + &sdhi1 { pinctrl-0 = <&sdhi1_pins>; pinctrl-1 = <&sdhi1_pins_uhs>; From patchwork Mon Jan 20 13:09:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 858869 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 477841E22FD for ; Mon, 20 Jan 2025 13:09:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737378590; cv=none; b=P6I2sOBXfE20lfoo0K6Y14nMBIpcXNJBmql/oc+iQCHE7G9tY1Zz15T4hLYz2zvRHVfxVnfWPJvf5AC15V51IEbg6U7Dr2IDMpsfUGrjyeDiP+iMv1k61POIVnsst5Q0OwbYuUSVdr3PRk/qPUz6jh/z4gZCKZhSIxeIZqfWY9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737378590; c=relaxed/simple; bh=qzL/yPlM4qaEVTfC35APhrTxhShJXYpDIh1eAz4tDV0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vi2kXbC1SNlf4aWSutDiqT4/YSA/UHYFf8EYeLpIBAWQ4PhOrJgci2KpeuyyOAaCLmLY8uzappqZzsW7kFFgVd+/FTjo95Dc0CLOBX/DuLtN3DgGeT5g/jr6KjGcY1e3rdPVFfzFFgoM3Sq6CRo9ZYi++5zo1iOhAELKU5B6w1o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=Pz41wpbO; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="Pz41wpbO" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4361815b96cso30569815e9.1 for ; Mon, 20 Jan 2025 05:09:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1737378586; x=1737983386; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fpM+C9xuZuqoM99Roe4nwWX6mJzuLBPzipIWISPswDw=; b=Pz41wpbOssOIrZlDsobIGZA/PdWeEkBCnpsAjyYNXUEKu1x9AHCSsTqIpGftIeEvkT E4NHa/UdWf39GqAf4dGWezacaxt5smU8pAQ2O7h+wNl9Y4i/OYpcl8IrFq9dpXy7EFr+ sap69N3Z3+lSbdW6t2lBRBp2cLvlyj48Tum/4xDpnnmVqsa+ybndkShFU+PElsHctHa5 HQksG+fKk9XuMpAZzap37srupQjoPdFTeIdzNEl5g8o8f/DA1//QRB+CCnGtTGE77Jvn LmUOTXv2gDusxWNEwyY9RtRtBZxjuOCfKdc4eafbeqjGPvD4x/hM/JsCMkC8j0LpGBx7 afWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737378586; x=1737983386; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fpM+C9xuZuqoM99Roe4nwWX6mJzuLBPzipIWISPswDw=; b=mghvhLCJiOWKJg1/SCmkfXocXDNVIrI13fbDCCaAKGtLCUDb3Q3N7GkQxCrIlt/vQA /fo/epkPobyC6jDciWqu68mb8aMYbsgsoaukO/El83yxhcPQ1aJByUadiZfZWY+ox5LW jm6+liRtglFPIjEaymKVTBkSuS4OdbzIADwr9/aZSzG8s2QZ59y1B0KQMbT6cojySZz4 VF0wHBjfwoyS0LyqcHTc/CfiH+wWzuEEdW7AiwVar+riIZrf5fFOHHSobq8CPCMzBDa4 dIoZRdXLozB371HeaR6+P4aRfLKcw794g8wpY2EojQL5QcS6eu+rdJlMiL+OeOX4Top8 fiHA== X-Forwarded-Encrypted: i=1; AJvYcCVV8TIRMdgkl2CGxp8t6+kAeSTjqzRPiBhwr+9QwiVO8RP910WE77Kbi/zYE9N8jewSAtA/bNgxHH8O8Ow=@vger.kernel.org X-Gm-Message-State: AOJu0YxpdisqrcrL9G7f6t0PPDLM4LLvPoR2wj3g4r/YEmk54jXko04D HCVdcXzLdMN3eLVJRa/mHbzOnHRJjo4i2gnLCWusAnGGOIC3T9F1e9AzXm+qTFk= X-Gm-Gg: ASbGncukNQHL9LsgCQIR94WOjNiJHMOc++hktfqbi3ylpZVbv6Bclp3p+bHsd/t/PXO D0WlrR5zNPjvH0hmRQJvlWqoeaaU1VbIERbHVcolTm4RP0Ppz9R1OPD5GvpeWXA+bWH8jnPYQbk sXASZNlD6Ip/mwA5e54W5J/anA3V3yl4SUMrp3IrxQjpLfsBVlMT+4RVXFFy1A+Q8gYP+FIyQh0 tpNRow4WHmGiwSQkQyMTur2W4039DOYfzLxEfkJGfmTV0vfXflDpT9WntjBnVUcsoKPJT5r071H Z8BAw3TAyl9xXoxRRRStUwYqaHSG74pFew== X-Google-Smtp-Source: AGHT+IFZ/Y3vJcfkQ+QI4bPVUXbmxlLYggt+xsKAqK2r7ijvSF53ZjfGaghnmp+AoXwnifqlzL2bgw== X-Received: by 2002:a05:600c:3149:b0:434:f270:a513 with SMTP id 5b1f17b1804b1-4389144e70fmr125594245e9.29.1737378586472; Mon, 20 Jan 2025 05:09:46 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.35]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4389041f61bsm138001955e9.17.2025.01.20.05.09.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2025 05:09:46 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, magnus.damm@gmail.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, p.zabel@pengutronix.de, claudiu.beznea.uj@bp.renesas.com, wsa+renesas@sang-engineering.com, prabhakar.mahadev-lad.rj@bp.renesas.com Cc: claudiu.beznea@tuxon.dev, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v4 4/4] arm64: dts: renesas: r9a08g045s33-smarc-pmod: Add overlay for SCIF1 Date: Mon, 20 Jan 2025 15:09:36 +0200 Message-ID: <20250120130936.1080069-5-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250120130936.1080069-1-claudiu.beznea.uj@bp.renesas.com> References: <20250120130936.1080069-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Claudiu Beznea Add DT overlay for SCIF1 (of the Renesas RZ/G3S SoC) routed through the PMOD1_3A interface available on the Renesas RZ SMARC Carrier II board. Signed-off-by: Claudiu Beznea --- Changes in v4: - rename overlay name to r9a08g045s33-smarc-pmod1-type-3a - add note about the needed switches for SCIF1 - guard the scif1 node with #if SW_CONFIG3 == SW_ON && SW_OPT_MUX4 == SW_ON - dropped the alias section from the overlay file and move it the board file - document SW_OPT_MUX4 switch Changes in v3: - none Changes in v2: - none arch/arm64/boot/dts/renesas/Makefile | 3 ++ .../r9a08g045s33-smarc-pmod1-type-3a.dtso | 48 +++++++++++++++++++ .../boot/dts/renesas/rzg3s-smarc-switches.h | 8 ++++ arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi | 1 + 4 files changed, 60 insertions(+) create mode 100644 arch/arm64/boot/dts/renesas/r9a08g045s33-smarc-pmod1-type-3a.dtso diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile index 928635f2e76b..ef7f7b55145d 100644 --- a/arch/arm64/boot/dts/renesas/Makefile +++ b/arch/arm64/boot/dts/renesas/Makefile @@ -143,6 +143,9 @@ r9a07g054l2-smarc-cru-csi-ov5645-dtbs := r9a07g054l2-smarc.dtb r9a07g054l2-smarc dtb-$(CONFIG_ARCH_R9A07G054) += r9a07g054l2-smarc-cru-csi-ov5645.dtb dtb-$(CONFIG_ARCH_R9A08G045) += r9a08g045s33-smarc.dtb +dtb-$(CONFIG_ARCH_R9A07G043) += r9a08g045s33-smarc-pmod1-type-3a.dtbo +r9a08g045s33-smarc-pmod1-type-3a-dtbs := r9a08g045s33-smarc.dtb r9a08g045s33-smarc-pmod1-type-3a.dtbo +dtb-$(CONFIG_ARCH_R9A07G043) += r9a08g045s33-smarc-pmod1-type-3a.dtb dtb-$(CONFIG_ARCH_R9A09G011) += r9a09g011-v2mevk2.dtb diff --git a/arch/arm64/boot/dts/renesas/r9a08g045s33-smarc-pmod1-type-3a.dtso b/arch/arm64/boot/dts/renesas/r9a08g045s33-smarc-pmod1-type-3a.dtso new file mode 100644 index 000000000000..e4cb4449f190 --- /dev/null +++ b/arch/arm64/boot/dts/renesas/r9a08g045s33-smarc-pmod1-type-3a.dtso @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Device Tree Source for the RZ/G3S SMARC Carrier II EVK PMOD parts + * + * Copyright (C) 2024 Renesas Electronics Corp. + * + * + * [Connection] + * + * SMARC Carrier II EVK + * +--------------------------------------------+ + * |PMOD1_3A (PMOD1 PIN HEADER) | + * | SCIF1_CTS# (pin1) (pin7) PMOD1_GPIO10 | + * | SCIF1_TXD (pin2) (pin8) PMOD1_GPIO11 | + * | SCIF1_RXD (pin3) (pin9) PMOD1_GPIO12 | + * | SCIF1_RTS# (pin4) (pin10) PMOD1_GPIO13 | + * | GND (pin5) (pin11) GND | + * | PWR_PMOD1 (pin6) (pin12) GND | + * +--------------------------------------------+ + * + * The following switches should be set as follows for SCIF1: + * - SW_CONFIG2: ON + * - SW_OPT_MUX4: ON + */ + +/dts-v1/; +/plugin/; + +#include +#include "rzg3s-smarc-switches.h" + +&pinctrl { + scif1_pins: scif1-pins { + pinmux = , /* TXD */ + , /* RXD */ + , /* CTS */ + ; /* RTS */ + }; +}; + +#if SW_CONFIG3 == SW_ON && SW_OPT_MUX4 == SW_ON +&scif1 { + pinctrl-names = "default"; + pinctrl-0 = <&scif1_pins>; + uart-has-rtscts; + status = "okay"; +}; +#endif diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc-switches.h b/arch/arm64/boot/dts/renesas/rzg3s-smarc-switches.h index 514a8a6dc013..9766cea55dc6 100644 --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc-switches.h +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc-switches.h @@ -29,4 +29,12 @@ #define SW_CONFIG2 SW_OFF #define SW_CONFIG3 SW_ON +/* + * SW_OPT_MUX[x] switches' states: + * @SW_OPT_MUX4: + * SW_OFF - The SMARC SER0 signals are routed to M.2 Key E UART + * SW_ON - The SMARC SER0 signals are routed to PMOD1 + */ +#define SW_OPT_MUX4 SW_ON + #endif /* __RZG3S_SMARC_SWITCHES__ */ diff --git a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi index 0851e0b7ed40..5e044a4d0234 100644 --- a/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi +++ b/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi @@ -12,6 +12,7 @@ / { aliases { i2c0 = &i2c0; + serial0 = &scif1; serial1 = &scif3; serial3 = &scif0; mmc1 = &sdhi1;