From patchwork Mon Jan 22 16:04:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13525693 X-Patchwork-Delegate: geert@linux-m68k.org Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 C81CB4D5AF for ; Mon, 22 Jan 2024 16:06:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705939562; cv=none; b=BpIPauPbYCTQZdGrwo4XKwlQGbcWpPgWNkyhI85L2dgT+Eo8CihvzsnXDnpUhbDp4CFcY1nItlIgVuvkcvnTFgYZn9nz2+Soak4zYk9+qsvGrYdnte006LunRCX7UesIE2OUd2rfVgyhNl0g1GL9bd+ledN8IQS2XL2fENnJ2Ng= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705939562; c=relaxed/simple; bh=0yNamDlWAt2UOp9EwrLfsQiqRHfQuVX+zMaru+neglg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nAFcX/ZEtVvh2mxEMLgf8UyDKkQkSRTlBQSYbtXIygOI1uAzIXJevr1CIugbmgtxpMNtq0p6ZCC8QcxS486MP7u1CrSlxwLiQ+miydWRnE6NKeDFaT+nXRntuy5kh0xzW2aCYx+b65qr28379b5qzogEuq8ojxRV6XEQj+ghT34= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se; spf=pass smtp.mailfrom=ragnatech.se; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b=va9zdhuw; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b="va9zdhuw" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3392ba29845so1819799f8f.2 for ; Mon, 22 Jan 2024 08:06:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; s=google; t=1705939559; x=1706544359; 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=YKGazpYao0V+LkbPgl3xbNn7Not0RSEPDH2BeUOoMg0=; b=va9zdhuw2uE3H9LAdYTVGjNxSo4wFBty1QuzWaQ8+fSCEtBu2phYosNdlY2rPqd2ON N2n1xeZ5RSVxJuqVOHKsNF1pwms8E5r9DFTFOBjul2i8mt27lxJs6YgDjwrIheY4R4Mq JyLND/vRiEOnDIg3eaCg8LGJlIMw7dHPfsvmS9EjeNudkB8GFNLHSAz4Xf8WFjbdJHXe 64tHLGA0oEhc4wDwsGjk431iCIoqUJt/0v+7CtK1zVoWThdV+pM6z4PTI99pJDGmovRB kxKzaEDIJXCnMpD60ZofGLK9yBU/Wf0kNpL1dheENQuSfk/L4z9MujgFt9eSTStlLTaw KlKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705939559; x=1706544359; 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=YKGazpYao0V+LkbPgl3xbNn7Not0RSEPDH2BeUOoMg0=; b=CC2icKVaLveAnRqdndo286PmjbLRS0psKUjA7jAygrw+LnWAKMmpGN07l1cE9Z2VMY m/bVBqlMeJ+DeMObklnCtPb3MEfMJT77G+UkpBGRg4CwPLH/t6LOFvxonGIZyRhcYODV PeerTQp6nBQ7nnmZIaK3skGYDS8CPFH86U7L+4bzBKvo17Lu3h+v+r6VbFUa0lYasfCL T1VtaeKKRl7EUWh/lpInjOr2HUhfvfIp2+1oiVQLS+DnCoI6wVWUTnYIRu3ys2AhTfiS oZzOJafa6WpS1aZA4UWJyM4OUkQT+8zwWYhmmyPiBhVE1MSVTfc3x1KnMCm9ARsk/zu2 VE1Q== X-Gm-Message-State: AOJu0YyCy2v0aEoVhK5uiTI7/bE8viiAVY0K6V9I5Tdy3t9+NhUdm2ui ToTG8YL9+ozRKcDhlKJ6oYQNX0t5QX8QkzRsTndoqRwz2ak5+wLlDU/AQKtYWJ8= X-Google-Smtp-Source: AGHT+IGC6py6HvOpfx0Q4nOFXkYsesGuitcZIsYaTj4ILkZczEDQMZOu10hIsKPscIw2OFKjcEfrzA== X-Received: by 2002:a05:6000:1e81:b0:337:c0de:1f70 with SMTP id dd1-20020a0560001e8100b00337c0de1f70mr1782445wrb.41.1705939559194; Mon, 22 Jan 2024 08:05:59 -0800 (PST) Received: from sleipner.berto.se (p4fcc8c6a.dip0.t-ipconnect.de. [79.204.140.106]) by smtp.googlemail.com with ESMTPSA id q6-20020a5d6586000000b0033921f48044sm8808860wru.55.2024.01.22.08.05.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 08:05:58 -0800 (PST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Geert Uytterhoeven Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH 1/2] arm64: dts: renesas: r8a779g0: R-Car Ethernet TSN support Date: Mon, 22 Jan 2024 17:04:40 +0100 Message-ID: <20240122160441.759620-2-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122160441.759620-1-niklas.soderlund+renesas@ragnatech.se> References: <20240122160441.759620-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add Ethernet TSN support for R-Car V4H. Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven --- arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi index d3d25e077c5d..e64a204f1f8a 100644 --- a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi @@ -538,6 +538,22 @@ tmu4: timer@ffc00000 { status = "disabled"; }; + tsn0: ethernet@e6460000 { + compatible = "renesas,r8a779g0-ethertsn", "renesas,rcar-gen4-ethertsn"; + reg = <0 0xe6460000 0 0x7000>, + <0 0xe6449000 0 0x500>; + reg-names = "tsnes", "gptp"; + interrupts = , + ; + interrupt-names = "tx", "rx"; + clocks = <&cpg CPG_MOD 2723>; + power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; + resets = <&cpg 2723>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + i2c0: i2c@e6500000 { compatible = "renesas,i2c-r8a779g0", "renesas,rcar-gen4-i2c"; From patchwork Mon Jan 22 16:04:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13525694 X-Patchwork-Delegate: geert@linux-m68k.org Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 D1D254D5AF for ; Mon, 22 Jan 2024 16:06:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705939566; cv=none; b=a437lbX6quzFRIJJ1h2wCci+a8CCekVKeSMGQsHO1N2dPUCzSrChMqHIyd33jDaCx/3+1loiArwa3ZwzsKoKWc83/gpUO7BAk1W400WFEB0fc+vhORoeNKZW3/eYomjfAS6aIrcxBlitKwIiQIBPCVNgqYZxfSmXE0FsFvYsRjk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705939566; c=relaxed/simple; bh=8+Jr9Hsh9KgnYxsoSQDSxqXxI1FhclIeUqpZMIYnqKQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IVjKAHuAtFpASZF+mcnVawvltMRgWsoJ2NIAGIHYbrC5p/yv6R0lkFgxwb1iDSHTwS+LA5Kv/DNtQVKkK6nfb8lWllZ2bFwNDDUeB2rYOdijKv8bAdrTzB/PTFD7iQ4FkPxfQzGeCMaS53ztPxNij2BKlF73Y0yp8z4GiFBcM7k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se; spf=pass smtp.mailfrom=ragnatech.se; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b=f26/bgvK; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b="f26/bgvK" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40e9ef9853bso18080235e9.1 for ; Mon, 22 Jan 2024 08:06:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; s=google; t=1705939560; x=1706544360; 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=rlarwS5ZWGd/b0VwyKRXYjLC1ZJXtKCaEoHcpJgSB1I=; b=f26/bgvK1C+9QhOISv03gt4KVa9+/qD3fMcS554BpE8qY1N5Vn8m1K/ieGKEKgtk1r F0nZt2fskhEk+4tBltdn4yrSS1SKmOLgWvgFuXe3ONyDuRjfOJTtRr5WTkv8aLB2AnD9 M+TqLaqTjNMbsLUwo9lPXg2/S1UECjLH3TlpwI6Wok8GA7Xv1AO3r8CgXSi82sQcB22Z 1EdwbD9vpX+ZBN1s0ixHmJRmDybz620fvbrTFL6Owx7NTpynn/8sT/SPyBpvKQQ6owNQ s5ncJQ7Xlf/TrXxqqmzzQT0AP7oM8OtnlTRK4hyHE5XqlDzrshDAZ4+xWT+uCJgoMB8W sulA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705939560; x=1706544360; 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=rlarwS5ZWGd/b0VwyKRXYjLC1ZJXtKCaEoHcpJgSB1I=; b=i248+BF4iq64baQcTKEuDFimkoVErP9vbBO8c/KnzmGYSH0TfBxU2spErih3tcciWu o4z9A4ryYJCSt6FeAFhON15i3/c4yypVV6gcdnhV5AR52EaLsV8yo6nVGK63fbZ7DLUo 4liFq5bhbrjk0S77dRWPYcReB0tk8s+v1ydx5NZsEZJJpPVQ/uX66lPQ2PoRIeFo0rXx sc7xX6SYT1j5lJUQIJ/wZmfW5y5sw7uPShslyCvGxJENyNsylLPEXwanRVHEldSh34eX 1c8mrfsgUlBxcaeT3ihd5ajhjnjgg4P4r8YKqOhz1YeyK+xvYSTUio9E3TzeKRg7gdTU WTJg== X-Gm-Message-State: AOJu0YwihwtC2gxxo6HZG3fiCMc5jaM6ZzW/PXrdwBy78n9txb3N26sT 6JdAGUic9ksTI4BtKYJ9lzhsRViaKMd6Ad5HisicQlXdwnPQVL9l6vYE2hfgoYI= X-Google-Smtp-Source: AGHT+IFnJN+3OxQxnArgp3IoR1GNOboQMVz5rwH9l+fuJBi30dSZq7sXPsdB9PKZnV/3C0/Mnh0GQg== X-Received: by 2002:a05:600c:63d1:b0:40d:61bc:cf55 with SMTP id dx17-20020a05600c63d100b0040d61bccf55mr2263823wmb.89.1705939560001; Mon, 22 Jan 2024 08:06:00 -0800 (PST) Received: from sleipner.berto.se (p4fcc8c6a.dip0.t-ipconnect.de. [79.204.140.106]) by smtp.googlemail.com with ESMTPSA id q6-20020a5d6586000000b0033921f48044sm8808860wru.55.2024.01.22.08.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 08:05:59 -0800 (PST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Geert Uytterhoeven Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH 2/2] arm64: dts: renesas: white-hawk: Add Ethernet TSN overlay Date: Mon, 22 Jan 2024 17:04:41 +0100 Message-ID: <20240122160441.759620-3-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122160441.759620-1-niklas.soderlund+renesas@ragnatech.se> References: <20240122160441.759620-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On the white-hawk development board the Ethernet TSN IP can be connected to one of two different external PHYs. One PHY is located on the breakout board, and the other on the Ethernet sub-board. Which PHY is connected depends on what resistors are mounted on the board. The default white-hawk configuration connect the TSN with the PHY on the breakout board. Unfortunately the standard breakout board do not populate the external PHY. Add an overlay that can be applied to enable Ethernet TSN support for those boards that do populate the breakout board, or mount the appropriate resistors to connect TSN with the Ethernet sub-board. Signed-off-by: Niklas Söderlund --- arch/arm64/boot/dts/renesas/Makefile | 2 + .../dts/renesas/r8a779g0-white-hawk-tsn.dtso | 53 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-tsn.dtso diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile index 8ea68d582710..c26047c9f84a 100644 --- a/arch/arm64/boot/dts/renesas/Makefile +++ b/arch/arm64/boot/dts/renesas/Makefile @@ -84,7 +84,9 @@ dtb-$(CONFIG_ARCH_R8A779F0) += r8a779f4-s4sk.dtb dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk.dtb dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk-ard-audio-da7212.dtbo r8a779g0-white-hawk-ard-audio-da7212-dtbs := r8a779g0-white-hawk.dtb r8a779g0-white-hawk-ard-audio-da7212.dtbo +r8a779g0-white-hawk-tsn-dtbs := r8a779g0-white-hawk.dtb r8a779g0-white-hawk-tsn.dtbo dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk-ard-audio-da7212.dtb +dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk-tsn.dtb dtb-$(CONFIG_ARCH_R8A77951) += r8a779m1-salvator-xs.dtb r8a779m1-salvator-xs-panel-aa104xd12-dtbs := r8a779m1-salvator-xs.dtb salvator-panel-aa104xd12.dtbo diff --git a/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-tsn.dtso b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-tsn.dtso new file mode 100644 index 000000000000..d9b6c11c425c --- /dev/null +++ b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-tsn.dtso @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +/* + * Device Tree Source for the White Hawk board with connected TSN PHY. + * + * Copyright (C) 2023 Niklas Söderlund + */ + +/dts-v1/; +/plugin/; + +#include +#include + +&pfc { + tsn0_pins: tsn0 { + mux { + groups = "tsn0_link", "tsn0_mdio", "tsn0_rgmii", + "tsn0_txcrefclk"; + function = "tsn0"; + }; + + pins_mdio { + groups = "tsn0_mdio"; + drive-strength = <21>; + }; + + pins_mii { + groups = "tsn0_rgmii"; + drive-strength = <21>; + }; + + }; +}; + +&tsn0 { + pinctrl-0 = <&tsn0_pins>; + pinctrl-names = "default"; + phy-mode = "rgmii"; + phy-handle = <&phy3>; + tx-internal-delay-ps = <2000>; + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + phy3: ethernet-phy@3 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <0>; + interrupt-parent = <&gpio4>; + interrupts = <3 IRQ_TYPE_LEVEL_LOW>; + reset-gpios = <&gpio1 23 GPIO_ACTIVE_LOW>; + }; +};