From nobody Sun Feb 8 03:58:09 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 B52C4341072 for ; Wed, 17 Dec 2025 08:09:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765958943; cv=none; b=O7BuRtxObGRv+jwlK8cCNzVC7Y+xY1Tnj4MxXdhIntf/cFwCOgA0fKb7jGOXzk+/RHcM0oSa/K6PMFtO0rW8QOshU/UsEGZf+UOYhoTI1vNFBXGMNzxITAK3rmLTDhJGMpw3tkqDYlaJHxhUy8tY6F3oF5u5Qfs1k/ejDPXWk7k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765958943; c=relaxed/simple; bh=WYGDwtO9eQNVNa8ZVym/Vt5s9Af72lv4Y1u8XOfzFPM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GDrkOFYyJXQ2L8mutT+4PmfNOQ6A1Y1Dc7yWqy3wOb37evaMVjJU0oyBeH/QHvtinsd3ikLV9EMUhocFeuQAGCm780+aAgS1w8O0R+rWpMmzrv4elGpdUw8MQagPZav/flTO6GEqRZWIMytnZ760kH/Ru6aIUucYRXh2rLP6dhQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OnwZvAxH; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OnwZvAxH" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-477a1c28778so59533755e9.3 for ; Wed, 17 Dec 2025 00:09:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765958939; x=1766563739; 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=MNdbat0FCjuFkU/WW3WZpT0/Ox10m6+452sPx2EkmMU=; b=OnwZvAxHh53g7oaA2/aZE6FPlfIY0YYKx2wfwSo3lQza6vHpDCZ070Std54DpfK9xb /hSrFjvgPrHM96TzkBYgxjQTvjuzWkIYpTIbjxIZvfJLtvllO33zSlfv/YR6mSMwW3P9 CuQgXGS/KVxwNr9Z7rsC4rXulpCMS5GR6hqYrhsAD68K1cf00N7GXeAGisR/m8+CkecY GCIYp9A2yN+tLq4JQBpEhA4ylx2Oo4o42kCG0JvwyOEES0KT/ZfRAkCW5mI1v4gd4ti2 F2KSnNtPc9xgdOpmxrk16xD3t8ykkugKGnbMwlfIRporRpOle47MD564F/YX4qX3flxB vmNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765958939; x=1766563739; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=MNdbat0FCjuFkU/WW3WZpT0/Ox10m6+452sPx2EkmMU=; b=S+3QMdwyzkOijhcoAhscbQo4UNHivdYF3g6ZzNnNKmzPfZzENs58ZPYsVkq2/IJUh5 y6R3qL9pmDha9F/MwQuQ9Hy9ZTkFsK/horCLgP0I4eJi1LZcpejwQuG6xE1eS4X3kI83 2QPWNquKfTEISwjHdt6yD8IktqlLxdmeBvw/e7kB349Mf5ziJ7S5mXcC41E+f4AgUkAj DnVTTo7kwQo0/2UavH8f7gqj9lRkuRpSGNrSJndtkGxIS0KNll4Rb/6jxttENlHGT0Ll Ds7cyGlhs2WJxR+Gy7hB0Ex/VuDMXtGnFP/E5UoQglZKsnDHAF+qeO/Y/uBOlS9oMV75 i8IA== X-Gm-Message-State: AOJu0YywrMwF6BUYBXoZSiz2TBqcjw0ZoygTwb/B7D6BHwZhTtdK7CFy GHRsHwXeJGXK/DUxGqlYwJjTxU/w3kOsvw5Vcz2bURklX/UNGPvyNrFGks0lPg== X-Gm-Gg: AY/fxX4z/8h+ReXdjmch7Gb9hhGlJMSajD/ITDaQDQlQeK1uExk2ilzuSTQCJ68B8z2 ZL7UTYB9dUoLS2mXB2U61qAVziC7GWURjSBd7F8FEDTMUs7YTWDRJL3HR48mfJOmA1TgTgSc/PM aqLkO/kJ1bREnMgY5CCH+QL0EAL6dbqEcZd+mrjkM4fZy3nmsFzE/r4NfMPqAk28MklMxXr1ERT WsLqYXaGwUBixzKnEYBgkDX1+oKZ+f/A4trTDbeTOCZxpjOjW28zGT4ORKk/V6BliLtIz3Kd7A2 V5urNmfbpLUSUvWnsmTaF81yI9uJTfU27WSaZK81/NvPjgDcax2lJiSed//+xhWwQto8fIrpIyn wTX6Uit+DBJsHdIjVbp5PQT33Bb1qYU1zWeMd/BDTMN9rq/eK2LVQz98lktLSxL3ikg4JkwTIA4 QWSSxGk6O4BN3DphQZnIY5xDOJMC65IreW8/8du4YRLq/rKsehwjo/jP+/RbGU11P2 X-Google-Smtp-Source: AGHT+IGIniiX4z2xcB+HJw7rpdiF/WcO2McouN4KlikrTH48po4ehonwpvhBjzZMT7mg2YbyGVhW7A== X-Received: by 2002:a05:600c:4ed0:b0:477:79c7:8994 with SMTP id 5b1f17b1804b1-47a8f90ea5fmr200713865e9.30.1765958938898; Wed, 17 Dec 2025 00:08:58 -0800 (PST) Received: from localhost (brnt-04-b2-v4wan-170138-cust2432.vm7.cable.virginm.net. [94.175.9.129]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47bdc1cb6a8sm25518315e9.2.2025.12.17.00.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 00:08:56 -0800 (PST) From: Stafford Horne To: LKML Cc: Linux OpenRISC , Stafford Horne , Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 1/5] dt-bindings: Add compatible string opencores,gpio to gpio-mmio Date: Wed, 17 Dec 2025 08:08:27 +0000 Message-ID: <20251217080843.70621-2-shorne@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251217080843.70621-1-shorne@gmail.com> References: <20251217080843.70621-1-shorne@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In FPGA Development boards with GPIOs we use the opencores gpio verilog rtl. This is compatible with the gpio-mmio. Add the compatible string to allow as below. Example: gpio0: gpio@91000000 { compatible =3D "opencores,gpio", "brcm,bcm6345-gpio"; reg =3D <0x91000000 0x1>, <0x91000001 0x1>; reg-names =3D "dat", "dirout"; gpio-controller; #gpio-cells =3D <2>; status =3D "okay"; }; Link: https://opencores.org/projects/gpio Signed-off-by: Stafford Horne Acked-by: Conor Dooley Reviewed-by: Linus Walleij --- Since v1: - Fix schema to actually match the example. .../devicetree/bindings/gpio/gpio-mmio.yaml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml b/Docume= ntation/devicetree/bindings/gpio/gpio-mmio.yaml index b4d55bf6a285..6fcf5fd2cb66 100644 --- a/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml +++ b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml @@ -18,11 +18,16 @@ description: =20 properties: compatible: - enum: - - brcm,bcm6345-gpio - - ni,169445-nand-gpio - - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO contr= oller - - intel,ixp4xx-expansion-bus-mmio-gpio + oneOf: + - enum: + - brcm,bcm6345-gpio + - ni,169445-nand-gpio + - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO c= ontroller + - intel,ixp4xx-expansion-bus-mmio-gpio + - items: + - enum: + - opencores,gpio + - const: brcm,bcm6345-gpio =20 big-endian: true =20 --=20 2.51.0 From nobody Sun Feb 8 03:58:09 2026 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 4E971341AD0 for ; Wed, 17 Dec 2025 08:09:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765958948; cv=none; b=Az5yqB+6hSxl2TzUtvJxFqmK8QH7TEmxPCUsgZ4Mj1HAHMJCDGRiuvFPWL0djFuAcco43uBObPnXdqeqmguYVINfU87HzKiaGQY5vLsjI1EJYafhMLJqLJym+4uJvVu65brLgQ5AzP4ejKP1Azw+jzi1ziKS300mOHsJOKDshtQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765958948; c=relaxed/simple; bh=teGjSeO2//jxel7lgj4m4mlRBfXDz8ZUiXqvHEVM9SM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FLa4hlPNUU08IZoHSJfGCnYTDtghvKgSRWusYbuT+QC1IDmagBTYFrPOVTGXrUNL8h4TBo5YwAf4A0G2xiRjdSg7mg5h/GQrsrAczX2TRKwVXHeE0LHIXy9LAafkcKpqq4DNbzkaEl3Qi0vF3Jg1WuSRRVsRntCIIujbqax5MTg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=I6sFGfYL; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="I6sFGfYL" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4779cb0a33fso64859745e9.0 for ; Wed, 17 Dec 2025 00:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765958944; x=1766563744; 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=/LVF5aHC+kNGWsjnPASPozbIVCRyZHBLtnFy/MbPGkI=; b=I6sFGfYLJ+t6ss1M/UyaqilaUr5BZxO+PmiqxcGJQ67WT/r3X4cGUAdEkOFKW/OOXc U0IbFaYV45GVUEgVcITN9gMZl3fFMolcLZSfjUV5I/rKw89jIyxbmJEaLN6Btx9zxoqI SLG2MDtj1T53+rY8LSvzcZSijXuc48i0wLG6Znz2UlsIGkw1fFHxOIq1iQToY2H1LN01 KMZ+RZDdxaJBkXfDi9mtcBEscn4+tBJQeFMl6HnkR+5Ot27SgIIiQZw/dlN25Jo65sjR 0KpHRMrIHNjigakgd3TfbrcpQx1OCIDiybS4C0cIdJAGpIgl0OVp4PdWSZt11nA7U0sS qzEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765958944; x=1766563744; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/LVF5aHC+kNGWsjnPASPozbIVCRyZHBLtnFy/MbPGkI=; b=jBCAjWIMMrBNGSzkEhJPvaNmkzPZWnW/M+ewU3ChgEm6vpHFlk8LrFIzCkP4yMZenh wYfZDD1obUZqZLMuSLfkgWW30NRxNMRh7dBgzKuN0vrKxIwAjh30HTQDYSalY+j3mUBf ROMuXG2IsAVClgY3anagdHwpx6oDkQKg6V8m8cf2+KC/B9QbzCrKiXS0XAQ6YUiBW5Vj 0R2fZG0TH6zmKImqcMGFiEceIkytgIgj/p314voGoaDMYiYWF4SuZk7fq982r0cTlOgK Q9sLK5l5254Ix9iyl3IH6FiLIguKF77g39I9khzY8yqJyiiMjeZsVA+mk/pRRS5WusNP WMAg== X-Gm-Message-State: AOJu0Yx6c79zX5lzhq3q0ugSbIwnBP2XYwiGqwe0gtsscHbmAowDbB/1 hZGb44n+1uq1N3aGAWI7RfU/Qc4xv+zhY0tMq7LD4vf4a+f1o96oA1ogNUxduQ== X-Gm-Gg: AY/fxX5CBSvYr6bwP6UWVywThjQX+lV/0mjWxcRI22Vg11wZY4g7FtLoqUKxh/vdPST UsRXqJrgL/zlNgQxEjAhggewd4D4uPTP9mRbJRCEMJcKZZrKJBOl3gxbWaZDEO/sMKj1is9d8om DKqLxr81jTRiRxkVML2dR59N+QupsqnjYRHoPKZJ8aEzktMaRJrdGGZDbcQmbGT0vEolrtZNNI/ F87XONZAe/KJqDjXpeb1N6Bsj9VxFj2GPMPij1xUkPhzWHyvUuVKBvPx3FUJS4VsH1PG+4kwH3l ZtLY5vhBiXNjgghHZOy5Bcx1g5m2a10wFsReIREDJGbRYuzxciHyrwGY1BnqKtNGivYVMoroPcz qs2Z7l1DHyC/1CYgkIcqAsVSiIawsmdk3tMLT0KdnY9XzBR+Flga9l1kTS1oCA9eB6Sjqy/cDpW QFPaK6qi7VqbjGCPgBTELIif9OwU7DfIQOuIjzYjUEl3sTHFf2F0svQls/MQZGOAmR X-Google-Smtp-Source: AGHT+IG82/FX7K47bFBuMA9at1JE+WAYs0tp/kZ7s/WyR9nx0jG1HlR6wKqpb9YQ5gRQ9ks2yeYy2Q== X-Received: by 2002:a05:600c:1908:b0:46e:7247:cbc0 with SMTP id 5b1f17b1804b1-47a8f904534mr174009255e9.18.1765958943573; Wed, 17 Dec 2025 00:09:03 -0800 (PST) Received: from localhost (brnt-04-b2-v4wan-170138-cust2432.vm7.cable.virginm.net. [94.175.9.129]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47bd992b915sm24560625e9.11.2025.12.17.00.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 00:09:02 -0800 (PST) From: Stafford Horne To: LKML Cc: Linux OpenRISC , Stafford Horne , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonas Bonn , Stefan Kristiansson , devicetree@vger.kernel.org Subject: [PATCH v2 2/5] openrisc: dts: Add de0 nano config and devicetree Date: Wed, 17 Dec 2025 08:08:28 +0000 Message-ID: <20251217080843.70621-3-shorne@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251217080843.70621-1-shorne@gmail.com> References: <20251217080843.70621-1-shorne@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The de0 nano from Terasic is an FPGA board that we use in the OpenRISC community to test OpenRISC configurations. Add a base configuration for the board that runs an OpenRISC CPU at 50Mhz with 32MB ram, UART for console and some GPIOs for LEDs and switches. There is an older version of this floating around that defines all of the hardware on the board including SPI's, flash devices, sram, ADCs etc. Eventually it would be good to get the full version upstream but for now I think a minimal board is good to start with. Link: https://openrisc.io/tutorials/de0_nano/ Link: https://github.com/olofk/de0_nano Signed-off-by: Stafford Horne --- arch/openrisc/boot/dts/de0-nano-common.dtsi | 41 +++++++++++ arch/openrisc/boot/dts/de0-nano.dts | 54 ++++++++++++++ arch/openrisc/configs/de0_nano_defconfig | 79 +++++++++++++++++++++ 3 files changed, 174 insertions(+) create mode 100644 arch/openrisc/boot/dts/de0-nano-common.dtsi create mode 100644 arch/openrisc/boot/dts/de0-nano.dts create mode 100644 arch/openrisc/configs/de0_nano_defconfig diff --git a/arch/openrisc/boot/dts/de0-nano-common.dtsi b/arch/openrisc/bo= ot/dts/de0-nano-common.dtsi new file mode 100644 index 000000000000..421c366d120e --- /dev/null +++ b/arch/openrisc/boot/dts/de0-nano-common.dtsi @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include + +/ { + memory@0 { + device_type =3D "memory"; + reg =3D <0x00000000 0x02000000>; + }; + + leds: leds { + compatible =3D "gpio-leds"; + status =3D "okay"; + led-heartbeat { + gpios =3D <&gpio0 0 GPIO_ACTIVE_HIGH>; + color =3D ; + function =3D LED_FUNCTION_HEARTBEAT; + linux,default-trigger =3D "heartbeat"; + label =3D "heartbeat"; + }; + }; + + gpio0: gpio@91000000 { + compatible =3D "opencores,gpio", "brcm,bcm6345-gpio"; + reg =3D <0x91000000 0x1>, <0x91000001 0x1>; + reg-names =3D "dat", "dirout"; + gpio-controller; + #gpio-cells =3D <2>; + status =3D "okay"; + }; + + gpio1: gpio@92000000 { + compatible =3D "opencores,gpio", "brcm,bcm6345-gpio"; + reg =3D <0x92000000 0x1>, <0x92000001 0x1>; + reg-names =3D "dat", "dirout"; + gpio-controller; + #gpio-cells =3D <2>; + status =3D "disabled"; + }; +}; diff --git a/arch/openrisc/boot/dts/de0-nano.dts b/arch/openrisc/boot/dts/d= e0-nano.dts new file mode 100644 index 000000000000..06c9b0b2406e --- /dev/null +++ b/arch/openrisc/boot/dts/de0-nano.dts @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-2.0 + +/dts-v1/; + +#include "de0-nano-common.dtsi" + +/ { + model =3D "Terasic DE0 Nano"; + compatible =3D "opencores,or1ksim"; + #address-cells =3D <1>; + #size-cells =3D <1>; + interrupt-parent =3D <&pic>; + + aliases { + uart0 =3D &serial0; + }; + + chosen { + bootargs =3D "earlycon"; + stdout-path =3D "uart0:115200"; + }; + + cpus { + #address-cells =3D <1>; + #size-cells =3D <0>; + cpu@0 { + compatible =3D "opencores,or1200-rtlsvn481"; + reg =3D <0>; + clock-frequency =3D <50000000>; + }; + }; + + /* + * OR1K PIC is built into CPU and accessed via special purpose + * registers. It is not addressable and, hence, has no 'reg' + * property. + */ + pic: pic { + compatible =3D "opencores,or1k-pic"; + #interrupt-cells =3D <1>; + interrupt-controller; + }; + + serial0: serial@90000000 { + compatible =3D "opencores,uart16550-rtlsvn105", "ns16550a"; + reg =3D <0x90000000 0x100>; + interrupts =3D <2>; + clock-frequency =3D <50000000>; + }; +}; + +&gpio1 { + status =3D "okay"; +}; diff --git a/arch/openrisc/configs/de0_nano_defconfig b/arch/openrisc/confi= gs/de0_nano_defconfig new file mode 100644 index 000000000000..bc63905f9cd8 --- /dev/null +++ b/arch/openrisc/configs/de0_nano_defconfig @@ -0,0 +1,79 @@ +CONFIG_SYSVIPC=3Dy +CONFIG_NO_HZ=3Dy +CONFIG_LOG_BUF_SHIFT=3D14 +CONFIG_BLK_DEV_INITRD=3Dy +# CONFIG_RD_GZIP is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_LZO is not set +# CONFIG_RD_LZ4 is not set +# CONFIG_RD_ZSTD is not set +CONFIG_EXPERT=3Dy +# CONFIG_EPOLL is not set +# CONFIG_TIMERFD is not set +# CONFIG_EVENTFD is not set +# CONFIG_AIO is not set +CONFIG_BUILTIN_DTB_NAME=3D"de0-nano" +# CONFIG_FPU is not set +CONFIG_HZ_100=3Dy +# CONFIG_BLOCK is not set +CONFIG_SLUB_TINY=3Dy +# CONFIG_COMPAT_BRK is not set +# CONFIG_VM_EVENT_COUNTERS is not set +CONFIG_NET=3Dy +CONFIG_UNIX=3Dy +CONFIG_UNIX_DIAG=3Dy +CONFIG_INET=3Dy +CONFIG_IP_MULTICAST=3Dy +CONFIG_INET_UDP_DIAG=3Dy +CONFIG_INET_RAW_DIAG=3Dy +CONFIG_INET_DIAG_DESTROY=3Dy +# CONFIG_IPV6 is not set +CONFIG_DEVTMPFS=3Dy +CONFIG_DEVTMPFS_MOUNT=3Dy +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +# CONFIG_FW_LOADER is not set +# CONFIG_INPUT is not set +# CONFIG_SERIO is not set +# CONFIG_VT is not set +# CONFIG_LEGACY_PTYS is not set +CONFIG_SERIAL_8250=3Dy +CONFIG_SERIAL_8250_CONSOLE=3Dy +CONFIG_SERIAL_OF_PLATFORM=3Dy +# CONFIG_HW_RANDOM is not set +CONFIG_PPS=3Dy +CONFIG_GPIO_SYSFS=3Dy +# CONFIG_GPIO_SYSFS_LEGACY is not set +CONFIG_GPIO_GENERIC_PLATFORM=3Dy +# CONFIG_HWMON is not set +# CONFIG_USB_SUPPORT is not set +CONFIG_NEW_LEDS=3Dy +CONFIG_LEDS_CLASS=3Dy +CONFIG_LEDS_GPIO=3Dy +CONFIG_LEDS_TRIGGERS=3Dy +CONFIG_LEDS_TRIGGER_TIMER=3Dy +CONFIG_LEDS_TRIGGER_ONESHOT=3Dy +CONFIG_LEDS_TRIGGER_HEARTBEAT=3Dy +CONFIG_LEDS_TRIGGER_CPU=3Dy +CONFIG_LEDS_TRIGGER_ACTIVITY=3Dy +CONFIG_LEDS_TRIGGER_GPIO=3Dy +CONFIG_LEDS_TRIGGER_DEFAULT_ON=3Dy +CONFIG_LEDS_TRIGGER_TRANSIENT=3Dy +CONFIG_LEDS_TRIGGER_PANIC=3Dy +CONFIG_LEDS_TRIGGER_NETDEV=3Dy +CONFIG_LEDS_TRIGGER_PATTERN=3Dy +CONFIG_LEDS_TRIGGER_TTY=3Dy +# CONFIG_VIRTIO_MENU is not set +# CONFIG_VHOST_MENU is not set +# CONFIG_DNOTIFY is not set +CONFIG_TMPFS=3Dy +# CONFIG_XZ_DEC_X86 is not set +# CONFIG_XZ_DEC_POWERPC is not set +# CONFIG_XZ_DEC_ARM is not set +# CONFIG_XZ_DEC_ARMTHUMB is not set +# CONFIG_XZ_DEC_ARM64 is not set +# CONFIG_XZ_DEC_SPARC is not set +# CONFIG_XZ_DEC_RISCV is not set +CONFIG_PRINTK_TIME=3Dy +# CONFIG_DEBUG_MISC is not set +# CONFIG_FTRACE is not set +# CONFIG_RUNTIME_TESTING_MENU is not set --=20 2.51.0 From nobody Sun Feb 8 03:58:09 2026 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 93BDB342525 for ; Wed, 17 Dec 2025 08:09:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765958953; cv=none; b=Q/K08/wl/hYQeLR8exSKs3sM3+WV/cABItNpCo9gK0n3LtTMFrfhUXa1NJjiC7lEkGAbW4A9pPtZtd5sXu7orQiw6V8/HZHSDw5kKcmLkvJIVTrlaYCx82/yKdK/v4jvUogO9cAV/pVmkM1gLEKoSjyKu1ZR1Fd4m3irX8e7ZHQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765958953; c=relaxed/simple; bh=Upo/KeJ1tydzhEX3FEnB2Lq6CdSMUiNT1LlycW0K1NM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rhaLp31sahm0uEsJaecp5Bv1iI3/ZyF0jmgXovXCJplP5g805uAoOjLWeNYuR37XNwSO/e4v4oGeaFwFrPYqd9u/9Qd3r/mc3Xr4YnzYuLUfpeYShUPM1tI7vYBfsBowzWSf4RMtmMn0FZoU10329kBVjdzovZDVJoAGT2rYtyE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nPayYxL2; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nPayYxL2" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-477563e28a3so1609645e9.1 for ; Wed, 17 Dec 2025 00:09:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765958948; x=1766563748; 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=VFXHMGeoomdbZOLp3ce3D0yDHo0q4hSajO4R4fHl4CQ=; b=nPayYxL2f6oP7HUVKxICogu72BNfjl5QmcC4GmE+RiKQalXJaNg0DzKf6UFXB+ZGsu vxYwUwRjGzs86Y/yz/KgXIP67jHetvG3h1nLuRk2s7SCVf26guPMUlpvWuEDeH2y3KBC twYKwLiV7jPjdlrJIKwFILKPt+jcVLrMV8UhPZ+1TxmyxqiviI1ftbFjmD+fHX4H/kLz XnWDP9mhsVj0WYSgGa/P0/dSExPN3S5aDsYIs3vJcCGvuZgU0u38VR8uTONEY3XrIY2/ 3k1xJOJHmUhqsxQhuiz9thZfF7up2Zn/bnQRUx/zxiARX7CJVSde8Bne8EMoiHKmZs7k 3D2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765958948; x=1766563748; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VFXHMGeoomdbZOLp3ce3D0yDHo0q4hSajO4R4fHl4CQ=; b=rDs9P1NxrOPmMhx77sZ4x/ek/n6mb+nP1tGgjBd1sjj37ida0D2+lf8tpzp+TEWN1h nK9hNIPZJPEuH3DcSR3UfiZUKnIB5jEON3g6SAwpdPySCVxTZlO4hwjHxGqaH13w6tnG Oz1865cDALXBWjxnryuAuL4IY+U/yWTiPaAZCg9mdZDCo4TRA1d8U79rAVTHHJTryqtQ SRugJXeaRVCxyiMzDrLP78whml01OJvg6nrx8sWbjyPmzU/SWGOJSa8hFcsHMtEYRF2D igiPM6/ezmfAEpPZPIhHbw3x1s/2/aNRZqAveBRIUmr/d0LD1O+y5817lHVDxwogSTvM keQQ== X-Gm-Message-State: AOJu0Yw4X8Uc0uuWKgeAsEG39U3u9ryvuyFCOccK1yYUpzoH4RyC681/ nxhvAsQQ3p058NPYUekZY087W9p234qKpNihyY8t+0bmSG/2QFymikoophv/mQ== X-Gm-Gg: AY/fxX6+qImjLuHdMjxfQhogi/MRDZiJXscUf23m86CV6Go257R+LTdo5A0j5v/+g1h WTDs02I1l+5FECaVnlVqyOg3f5X6H+aRK18HrEsAb31vkshh1RlDB8oKzcxP2zy51vg0mckxeoI B+tNybEekjclyKx0eFIeHnsqsEXL+kYqCkk8D0OBTECbrLWRIvYyXt2FIm7qCleHvKsK4Wzybsi jlvDryGpElBaDdPlDQaa+/Y4Kw0qRtSDRQthhFUZuydoLF5GixMOSCIa0N0QrnvYBV6E/uRQcyu 7/NgAqhOwk7XT0f73dirmuHA0/8ldUf0FaZD0EmIC+awJhAWzanCHNzSBOqqrtJFQzIyU0S5ef7 F3AQBH3rPmnv+XGDvpWiuLnThlbAoDYb9sBLP3zmKg9WRgdX/xirZ1eNlKpCEZxZPs/g4yYIZdP hW7WDa3N/pgJyQVLqlkG5AGpEG7EPjcVmkI42AAhthJOtL6k0MQEtSHpo2U37TV8PI X-Google-Smtp-Source: AGHT+IFdA/DhWhc0fvmsOUqd7FLcG+OG0v2ccGRkQHL3gBaAO1Q1UrtDjoq1SDubt5kPWl7UFxdxGA== X-Received: by 2002:a05:600c:444a:b0:46e:59bd:f7e2 with SMTP id 5b1f17b1804b1-47a8f1c20e1mr166323265e9.11.1765958947878; Wed, 17 Dec 2025 00:09:07 -0800 (PST) Received: from localhost (brnt-04-b2-v4wan-170138-cust2432.vm7.cable.virginm.net. [94.175.9.129]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47bdc14b421sm25574375e9.0.2025.12.17.00.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 00:09:06 -0800 (PST) From: Stafford Horne To: LKML Cc: Linux OpenRISC , Stafford Horne , Jonas Bonn , Stefan Kristiansson , Thomas Gleixner Subject: [PATCH v2 3/5] openrisc: Fix IPIs on simple multicore systems Date: Wed, 17 Dec 2025 08:08:29 +0000 Message-ID: <20251217080843.70621-4-shorne@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251217080843.70621-1-shorne@gmail.com> References: <20251217080843.70621-1-shorne@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Commit c05671846451 ("openrisc: sleep instead of spin on secondary wait") fixed OpenRISC SMP Linux for QEMU. However, stability was never achieved on FPGA development boards. This is because the above patch has a step to unmask IPIs on non-boot cpu's but on hardware without power management, IPIs remain masked. This meant that IPI's were never actually working on the simple SMP systems we run on development boards. The systems booted but stability was very suspect. Add the ability to unmask IPI's on the non-boot cores. This is done by making the OMPIC IRQs proper percpu IRQs. We can then use the enabled_percpu_irq() to unmask IRQ on the non-boot cpus. Update the or1k PIC driver to use a flow handler that can switch between percpu and the configured level or edge flow handlers at runtime. This mechanism is inspired by that done in the J-Core AIC driver. Signed-off-by: Stafford Horne --- arch/openrisc/include/asm/smp.h | 3 ++- arch/openrisc/kernel/smp.c | 22 +++++++++++++++++++++- drivers/irqchip/irq-ompic.c | 15 +++++++++++---- drivers/irqchip/irq-or1k-pic.c | 27 ++++++++++++++++++++++++++- 4 files changed, 60 insertions(+), 7 deletions(-) diff --git a/arch/openrisc/include/asm/smp.h b/arch/openrisc/include/asm/sm= p.h index e21d2f12b5b6..007296f160ef 100644 --- a/arch/openrisc/include/asm/smp.h +++ b/arch/openrisc/include/asm/smp.h @@ -20,7 +20,8 @@ extern void smp_init_cpus(void); extern void arch_send_call_function_single_ipi(int cpu); extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); =20 -extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned i= nt)); +extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned i= nt), + unsigned int irq); extern void handle_IPI(unsigned int ipi_msg); =20 #endif /* __ASM_OPENRISC_SMP_H */ diff --git a/arch/openrisc/kernel/smp.c b/arch/openrisc/kernel/smp.c index 86da4bc5ee0b..040ca201b692 100644 --- a/arch/openrisc/kernel/smp.c +++ b/arch/openrisc/kernel/smp.c @@ -13,6 +13,7 @@ =20 #include #include +#include #include #include #include @@ -25,6 +26,7 @@ =20 asmlinkage __init void secondary_start_kernel(void); =20 +static unsigned int ipi_irq __ro_after_init; static void (*smp_cross_call)(const struct cpumask *, unsigned int); =20 unsigned long secondary_release =3D -1; @@ -39,6 +41,14 @@ enum ipi_msg_type { =20 static DEFINE_SPINLOCK(boot_lock); =20 +static void or1k_ipi_enable(void) +{ + if (WARN_ON_ONCE(!ipi_irq)) + return; + + enable_percpu_irq(ipi_irq, 0); +} + static void boot_secondary(unsigned int cpu, struct task_struct *idle) { /* @@ -136,6 +146,7 @@ asmlinkage __init void secondary_start_kernel(void) complete(&cpu_running); =20 synchronise_count_slave(cpu); + or1k_ipi_enable(); set_cpu_online(cpu, true); =20 local_irq_enable(); @@ -195,9 +206,18 @@ void smp_send_stop(void) smp_call_function(stop_this_cpu, NULL, 0); } =20 -void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned= int)) +void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned= int), + unsigned int irq) { + if (WARN_ON(ipi_irq)) + return; + smp_cross_call =3D fn; + + ipi_irq =3D irq; + + /* Enabled IPIs for boot CPU immediately */ + or1k_ipi_enable(); } =20 void arch_send_call_function_single_ipi(int cpu) diff --git a/drivers/irqchip/irq-ompic.c b/drivers/irqchip/irq-ompic.c index e66ef4373b1e..f0e0b435bb1d 100644 --- a/drivers/irqchip/irq-ompic.c +++ b/drivers/irqchip/irq-ompic.c @@ -84,6 +84,8 @@ DEFINE_PER_CPU(unsigned long, ops); =20 static void __iomem *ompic_base; =20 +static DEFINE_PER_CPU_READ_MOSTLY(int, ipi_dummy_dev); + static inline u32 ompic_readreg(void __iomem *base, loff_t offset) { return ioread32be(base + offset); @@ -183,12 +185,17 @@ static int __init ompic_of_init(struct device_node *n= ode, goto out_unmap; } =20 - ret =3D request_irq(irq, ompic_ipi_handler, IRQF_PERCPU, - "ompic_ipi", NULL); - if (ret) + irq_set_percpu_devid(irq); + ret =3D request_percpu_irq(irq, ompic_ipi_handler, "ompic_ipi", + &ipi_dummy_dev); + + if (ret) { + pr_err("ompic: failed to request irq %d, error: %d", + irq, ret); goto out_irq_disp; + } =20 - set_smp_cross_call(ompic_raise_softirq); + set_smp_cross_call(ompic_raise_softirq, irq); =20 return 0; =20 diff --git a/drivers/irqchip/irq-or1k-pic.c b/drivers/irqchip/irq-or1k-pic.c index 48126067c54b..73dc99c71d40 100644 --- a/drivers/irqchip/irq-or1k-pic.c +++ b/drivers/irqchip/irq-or1k-pic.c @@ -118,11 +118,36 @@ static void or1k_pic_handle_irq(struct pt_regs *regs) generic_handle_domain_irq(root_domain, irq); } =20 +/* + * The OR1K PIC is a cpu-local interrupt controller and does not distingui= sh or + * use distinct irq number ranges for per-cpu event interrupts (IPI). Since + * information to determine whether a particular irq number should be trea= ted as + * per-cpu is not available at mapping time, we use a wrapper handler func= tion + * which chooses the right handler at runtime based on whether IRQF_PERCPU= was + * used when requesting the irq. Borrowed from J-Core AIC. + */ +static void or1k_irq_flow_handler(struct irq_desc *desc) +{ +#ifdef CONFIG_SMP + struct irq_data *data =3D irq_desc_get_irq_data(desc); + struct or1k_pic_dev *pic =3D data->domain->host_data; + + if (irqd_is_per_cpu(data)) + handle_percpu_devid_irq(desc); + else + pic->handle(desc); +#endif +} + static int or1k_map(struct irq_domain *d, unsigned int irq, irq_hw_number_= t hw) { struct or1k_pic_dev *pic =3D d->host_data; =20 - irq_set_chip_and_handler(irq, &pic->chip, pic->handle); + if (IS_ENABLED(CONFIG_SMP)) + irq_set_chip_and_handler(irq, &pic->chip, or1k_irq_flow_handler); + else + irq_set_chip_and_handler(irq, &pic->chip, pic->handle); + irq_set_status_flags(irq, pic->flags); =20 return 0; --=20 2.51.0 From nobody Sun Feb 8 03:58:09 2026 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 C82A2342C92 for ; Wed, 17 Dec 2025 08:09:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765958956; cv=none; b=Cdp3o4l4e8ziicmDkkcZesm9WnMdjf3ND8udY2DAf/hWhyhLQsWXhmiD7gpiind5xmAYGyQRvI8FtjsIjZrIhm54q90T1o05pl6xReY6LczRmYRsEmYorqqlPqwuIOd1n/JgU7cFJASa25GXKe4euLdvKw96QCqMW3SCPEMyGWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765958956; c=relaxed/simple; bh=xPcg96DcvhxTMAkfp4RAyJaORSxOAQYQ8H8AiXKiTVY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UHajccXOrlK83VetBK7gLY7E9nN++H0Vzvf5E/Mkw6H8B67Rs2tWn2omXpgC2WiGxoVMwwtbEvu4aDS4UairjQKnwA/ILZ/WtrCH03/eAOy+ZHP1yPtarhOSw1GO+NQUKDui+cjzP0kEnEbPHsAWam6pesXbVMDs0Ra0kJRNr4k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fxhOIVX2; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fxhOIVX2" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4777771ed1aso41307905e9.2 for ; Wed, 17 Dec 2025 00:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765958952; x=1766563752; 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=0A0KKwP3NdhXeaIpiIMiycb1Ngs8zVhebvsR8yBVwL4=; b=fxhOIVX2NIsitPY2ERUx1jWYAeyq760mF2dMpK/eHS0Mj2qZGlDiz4MqDdNpr6Km77 AyrOaI6COAU4FhjJUUvAsr1y64zUwbpUHUW8FI/I+zovFqigwwzimNGSvnDEQ4a03auQ YCzJ1iVtfVCLIFZXptx/kYjC6IEQZLRPDEpku8B/mAeLAnFtc+xZwim4nqanvqHePQnd mocyX66O+lMpba4ePXccsun1HLuWS4bhO429/fevn4rSwH4yUAIltBr/QnIc1XIKwUDR YfFCEztimcqpUw7Kq7qq96fZUQEHKdhlTVDPp9jnYqnwGBTqwyd8gGPEyZ7YsFo+Fnte G8aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765958952; x=1766563752; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0A0KKwP3NdhXeaIpiIMiycb1Ngs8zVhebvsR8yBVwL4=; b=wLXktZsW1CjahCQf2ZkBfmVDGXkzew36miZGfB3b+R5AAuKHcOccX0Bmhnx3vU3HH3 vekAdf4ssGQXdOCwYrZivh8xOT3zn1DI9TxEvRm4U31KZRawALpxl2dcegArgn0ysQCV sFIrnqPGATLi4+y1wMAZEBFpkOmAickcwLEJv73xuonpzhuy4fGJJnw55RVSE7/eduH0 DyF7osVNcBVV3VbZuoEU5pJ2yJe+hoocKj10/KDM/UqlTOX67zdItrGTfSMGzWCdDg+q hLttvyjd+VcCeA7pthPnTVcqGUMg21ro5or1DE82MJyM5HdStkWOoGuyfaImx7RKhj4Z VA1Q== X-Gm-Message-State: AOJu0YzImCTlip2evJ+W+spSKP4hTpYtWGrv/rXXLvnkCP6s1AIr4wJx JzdbQMPVraZcpMGgRXqUaKTBoHIhVzoQDkaG9dnJgNJHItNP+1m6+yUFRTIrXQ== X-Gm-Gg: AY/fxX6i2T4HepJwKNQ31pwGJ7ckxgIhIed4CrQRUljyKx6YuG8BWeu3TEsXaNe8LL4 QQsH6FlTpPXwNMcAW7Ba6hMjf+9wtlJGZ+pU+fgSIaurVYvf2o8DmMmVrLKyot2Ipy1scnIICiS Wfp1a54j05InGovSK3RshbdORLhqQykFRDxHaLE/rmh8TVL6vybwzoeiG8YjTn9bLtwyDuyUcCI IX73dmixdbjH+/Ai+eGVx6ZDjyDPAFpjFSAr2zJnGm4CNa+8J7+3SsfpM0W9wjjy76ZQCDZNTbR 7W5SBEmwQz3PN9xBX5CfUpSnR2schTuulC/cSH4l0aPoSVv+/PWczWUQadvEcG8iXLRf8aW5oKc xPrQBUh4fSMDOWlqSwbamqHO807PJzfVUtmMj0qwo1A37bNYQ7AtyhBRjAGpVqqBUZIur1Ovc0y 5pDaaCQwCpGDWwIGNnUhLeW4OJjeoLG2nzIxQ6spxtKrjmKKEqrzH1S6RI6M1TmSpL X-Google-Smtp-Source: AGHT+IFOqj0HGgW3GOvgzFqprTgC1+JPT38q8uGINy4v0xBZPx7Kjx5cWMJSdoLYa8rFvU8ni4vxNQ== X-Received: by 2002:a05:600c:46cb:b0:47a:810f:1d06 with SMTP id 5b1f17b1804b1-47a8f89cb47mr183074525e9.4.1765958952428; Wed, 17 Dec 2025 00:09:12 -0800 (PST) Received: from localhost (brnt-04-b2-v4wan-170138-cust2432.vm7.cable.virginm.net. [94.175.9.129]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47bdc1de9cesm26318945e9.8.2025.12.17.00.09.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 00:09:10 -0800 (PST) From: Stafford Horne To: LKML Cc: Linux OpenRISC , Stafford Horne , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonas Bonn , Stefan Kristiansson , Masahiro Yamada , devicetree@vger.kernel.org Subject: [PATCH v2 4/5] openrisc: dts: Split simple smp dts to dts and dtsi Date: Wed, 17 Dec 2025 08:08:30 +0000 Message-ID: <20251217080843.70621-5-shorne@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251217080843.70621-1-shorne@gmail.com> References: <20251217080843.70621-1-shorne@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Split out the common memory, CPU and PIC definitions of the simple SMP system to a DTSI file which we will later use for our De0 Nano multicore board device tree. We also take this opportunity to swich underscores to dashes as that seems to be the more common convention for DTS files. Signed-off-by: Stafford Horne --- Since v1: - Removed clock-frequency 0 in dtsi file. - Fix DTB name in defconfig file arch/openrisc/boot/dts/simple-smp.dts | 25 +++++++++++++++++++ .../dts/{simple_smp.dts =3D> simple-smp.dtsi} | 9 +++---- arch/openrisc/configs/simple_smp_defconfig | 2 +- 3 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 arch/openrisc/boot/dts/simple-smp.dts rename arch/openrisc/boot/dts/{simple_smp.dts =3D> simple-smp.dtsi} (90%) diff --git a/arch/openrisc/boot/dts/simple-smp.dts b/arch/openrisc/boot/dts= /simple-smp.dts new file mode 100644 index 000000000000..26f6a9236b30 --- /dev/null +++ b/arch/openrisc/boot/dts/simple-smp.dts @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0 + +/dts-v1/; + +#include "simple-smp.dtsi" + +/ { + model =3D "Simple SMP Board"; +}; + +&cpu0 { + clock-frequency =3D <20000000>; +}; + +&cpu1 { + clock-frequency =3D <20000000>; +}; + +&serial0 { + clock-frequency =3D <20000000>; +}; + +&enet0 { + status =3D "okay"; +}; diff --git a/arch/openrisc/boot/dts/simple_smp.dts b/arch/openrisc/boot/dts= /simple-smp.dtsi similarity index 90% rename from arch/openrisc/boot/dts/simple_smp.dts rename to arch/openrisc/boot/dts/simple-smp.dtsi index 71af0e117bfe..2013fd3e7a18 100644 --- a/arch/openrisc/boot/dts/simple_smp.dts +++ b/arch/openrisc/boot/dts/simple-smp.dtsi @@ -1,4 +1,3 @@ -/dts-v1/; / { compatible =3D "opencores,or1ksim"; #address-cells =3D <1>; @@ -22,15 +21,13 @@ memory@0 { cpus { #address-cells =3D <1>; #size-cells =3D <0>; - cpu@0 { + cpu0: cpu@0 { compatible =3D "opencores,or1200-rtlsvn481"; reg =3D <0>; - clock-frequency =3D <20000000>; }; - cpu@1 { + cpu1: cpu@1 { compatible =3D "opencores,or1200-rtlsvn481"; reg =3D <1>; - clock-frequency =3D <20000000>; }; }; =20 @@ -57,7 +54,6 @@ serial0: serial@90000000 { compatible =3D "opencores,uart16550-rtlsvn105", "ns16550a"; reg =3D <0x90000000 0x100>; interrupts =3D <2>; - clock-frequency =3D <20000000>; }; =20 enet0: ethoc@92000000 { @@ -65,5 +61,6 @@ enet0: ethoc@92000000 { reg =3D <0x92000000 0x800>; interrupts =3D <4>; big-endian; + status =3D "disabled"; }; }; diff --git a/arch/openrisc/configs/simple_smp_defconfig b/arch/openrisc/con= figs/simple_smp_defconfig index 6008e824d31c..db77c795225e 100644 --- a/arch/openrisc/configs/simple_smp_defconfig +++ b/arch/openrisc/configs/simple_smp_defconfig @@ -20,7 +20,7 @@ CONFIG_SLUB=3Dy CONFIG_SLUB_TINY=3Dy CONFIG_MODULES=3Dy # CONFIG_BLOCK is not set -CONFIG_BUILTIN_DTB_NAME=3D"simple_smp" +CONFIG_BUILTIN_DTB_NAME=3D"simple-smp" CONFIG_SMP=3Dy CONFIG_HZ_100=3Dy CONFIG_OPENRISC_HAVE_SHADOW_GPRS=3Dy --=20 2.51.0 From nobody Sun Feb 8 03:58:09 2026 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 F335A343D6F for ; Wed, 17 Dec 2025 08:09:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765958962; cv=none; b=p7U9MaUhwF4UcB5IUfSFnKVKN9NN231MTdPaN+Di7vXMfUeH6gpIZI28BLi8xKCsARU3bJ/wXRQ5S1hf9nvFC4l5Cvw/bz5CvP0tYj1OA6mBulxuaw15UGLXNnyFYiIf8Kiu6OIetGTzl/qNe4LBJy04RzyH1QqWbj5oQAwkHi8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765958962; c=relaxed/simple; bh=un/mmc47M7TzaiskJcRDfyxuLNhftyXJQ1e6SZgvuK4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sGugwrJD5O7/R5ZAGPG8FDqDMt98wI7rrAUEDhM+LVstaY/vTkCMhJbm+fhXu0mkFUy1L/Gwxr3WGTz96kbvmhauUXA2Fu/hezU5+LEukwJdcH1g/iuoXxNwqNYUWdXIgLkKCgnvRUoHnWgZnvbGrJMgvDLJCxmgiJ1gJRlSHF8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DEwHWepE; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DEwHWepE" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4779cc419b2so54693735e9.3 for ; Wed, 17 Dec 2025 00:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765958958; x=1766563758; 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=3suL/FJnULndAdzhv6eYWlf/ToXJG1zAeBlGIDXgmts=; b=DEwHWepE71HisTp0qbr8iIajJP13x39e3eOz3qEcL32bKLhP3YWBcCxcUy0dMidAko lTWktOS/BZdGKF5LJceEz74IrMWt4t5fuoX0QoR05IB75I1dvixxUyPP3RJG3XEWjHRm MKmgG8nyCqyLbC2rJXQZ8xLzIHGFYN/oPudXvXcKYtDY/N8XIMK6+GVzTH7Q7z8M2cJD S5vyvEN6FmnQFSqbIr8v6tRfI5R33Fi2FmOBkiAwEY6SulhHkNGmO0+XuatCrgJcSfIy P4lIlsW0SY3g7W6Qzcc1VOW5DozklZrdtCPmqyEg/F8kdfb7R1oHGzwvwOfhZifHI3QR d8sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765958958; x=1766563758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=3suL/FJnULndAdzhv6eYWlf/ToXJG1zAeBlGIDXgmts=; b=PGw/NqkI6eATuhtwW8BiP7C/zRiitCniwx8L0Xz6Jdkg4jNudzzYpknyoyLaNar7cn SmsjecQAN4GtaSu9WtW8VONtVJ8ZE4nSAmgaLk6ehFpbpAzHF4L0EUuie+mweU4fEKIr 3hVFnOE1ph+qcJu9VrepucuDcQA77CF0z8kKX00dzv4uIi29jHUaSrCDA6lLZ93ULt2J r0l9tGI4PvVS0p+F1sp3BR8fWGagLPIIsFCSQaP382dnpNkO8PjMa7svf+2LI4Y0uvx8 qz+onTAXGrpYudoo/O/aIW318F8GCJ/AE5V16MBpPP2quOYCqJW8e14Rt74VQNh/TNKX 38Wg== X-Gm-Message-State: AOJu0Ywg4/IQJCOfjBTXnCKKeznldg8YrpcdieRdbRCxRadxowiuPs6V I0e4CBmmpqRKF4VOGtxaCfqcND3ulWglm0sdHqhgvq79/E9/rS7JT3J5j1U4+g== X-Gm-Gg: AY/fxX54GvJphy+ulq3lhUXoNmFn4Ii5dR8vxOKs/EXDEnbPmzyLzEywzYajwpoG0lB uuHbzsaR7X9+XjdhSyabWhcj3RgzLQmlSzBYsuePLXIdf4j6YNbk9yEB7tSAPimO+p4ZiY/jNti S2GVkYMEUstlfoAvN9Kbsp13CgAwEJkzEDTDSQeacNj9b+Ah3ODbSA0uZcsYmIy0uO9+QyiZhgH BxJIXjn6KFyn7Y/UBBXj/1Yg90WMhtWCP3ovw0gCQZr6cAp8LGK5LR8Tlhpty6iTTP5BlQpTdqD Jc74S6JBdyjnyYfrnXILT2JG208Oy1mI/xFrhp+CI840SlVdg8ADxmyxcj87lGMkASqsLCa9C3+ JhYx8z5fRmwtI+jVR+XK2A9BFWWj191Ak6/ukSfL40rebLYS6ajH7uekRCY3a5Cv7Nn5w2maEd0 FWZZMc6rlMqBbURYIfjgGUBlaLre9ZS9vAnniYxnbWVACmaPuYr8R82TrzRIn+B7rJU+hTdSOoW Mw= X-Google-Smtp-Source: AGHT+IHM0Ub87vjuqv+zwJR2PykqY9IAsIuRCl4dDP2w4RgPOiEKqUDQHDu8ILCEtmP4lXn1S2sa6g== X-Received: by 2002:a05:600c:818f:b0:477:8a2a:1244 with SMTP id 5b1f17b1804b1-47a8f8bd357mr145868925e9.11.1765958957879; Wed, 17 Dec 2025 00:09:17 -0800 (PST) Received: from localhost (brnt-04-b2-v4wan-170138-cust2432.vm7.cable.virginm.net. [94.175.9.129]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47bd9154168sm25369625e9.7.2025.12.17.00.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Dec 2025 00:09:17 -0800 (PST) From: Stafford Horne To: LKML Cc: Linux OpenRISC , Stafford Horne , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonas Bonn , Stefan Kristiansson , devicetree@vger.kernel.org Subject: [PATCH v2 5/5] openrisc: dts: Add de0 nano multicore config and devicetree Date: Wed, 17 Dec 2025 08:08:31 +0000 Message-ID: <20251217080843.70621-6-shorne@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251217080843.70621-1-shorne@gmail.com> References: <20251217080843.70621-1-shorne@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a multicore configuration for the Terasic de0 nano FPGA development board. This SoC runs 2 OpenRISC CPUs at 50Mhz with 32MB ram, UART for console and GPIOs for LEDs. This FPGA SoC is based on the simple-smp reference board and brings in devices from the de0 nano common DTSI file. A default config is added that brings together the device tree and driver setup. Link: https://github.com/stffrdhrn/de0_nano-multicore Signed-off-by: Stafford Horne --- arch/openrisc/boot/dts/de0-nano-multicore.dts | 25 +++++ .../configs/de0_nano_multicore_defconfig | 92 +++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 arch/openrisc/boot/dts/de0-nano-multicore.dts create mode 100644 arch/openrisc/configs/de0_nano_multicore_defconfig diff --git a/arch/openrisc/boot/dts/de0-nano-multicore.dts b/arch/openrisc/= boot/dts/de0-nano-multicore.dts new file mode 100644 index 000000000000..b6cf286afaa4 --- /dev/null +++ b/arch/openrisc/boot/dts/de0-nano-multicore.dts @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include + +/dts-v1/; + +#include "simple-smp.dtsi" +#include "de0-nano-common.dtsi" + +/ { + model =3D "Terasic DE0 Nano - Multicore"; +}; + +&cpu0 { + clock-frequency =3D <50000000>; +}; + +&cpu1 { + clock-frequency =3D <50000000>; +}; + +&serial0 { + clock-frequency =3D <50000000>; +}; diff --git a/arch/openrisc/configs/de0_nano_multicore_defconfig b/arch/open= risc/configs/de0_nano_multicore_defconfig new file mode 100644 index 000000000000..d33b1226e09c --- /dev/null +++ b/arch/openrisc/configs/de0_nano_multicore_defconfig @@ -0,0 +1,92 @@ +CONFIG_LOCALVERSION=3D"-de0nano-smp" +CONFIG_SYSVIPC=3Dy +CONFIG_POSIX_MQUEUE=3Dy +CONFIG_NO_HZ=3Dy +CONFIG_LOG_BUF_SHIFT=3D14 +CONFIG_BLK_DEV_INITRD=3Dy +# CONFIG_RD_GZIP is not set +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_XZ is not set +# CONFIG_RD_LZO is not set +# CONFIG_RD_LZ4 is not set +CONFIG_EXPERT=3Dy +# CONFIG_EPOLL is not set +# CONFIG_TIMERFD is not set +# CONFIG_EVENTFD is not set +# CONFIG_AIO is not set +CONFIG_KALLSYMS_ALL=3Dy +CONFIG_DCACHE_WRITETHROUGH=3Dy +CONFIG_BUILTIN_DTB_NAME=3D"de0-nano-multicore" +CONFIG_OPENRISC_HAVE_INST_CMOV=3Dy +CONFIG_SMP=3Dy +CONFIG_HZ_100=3Dy +CONFIG_JUMP_LABEL=3Dy +# CONFIG_BLOCK is not set +CONFIG_SLUB_TINY=3Dy +# CONFIG_COMPAT_BRK is not set +# CONFIG_VM_EVENT_COUNTERS is not set +CONFIG_NET=3Dy +CONFIG_PACKET=3Dy +CONFIG_UNIX=3Dy +CONFIG_UNIX_DIAG=3Dy +CONFIG_INET=3Dy +CONFIG_IP_MULTICAST=3Dy +CONFIG_TCP_CONG_ADVANCED=3Dy +# CONFIG_TCP_CONG_BIC is not set +# CONFIG_TCP_CONG_CUBIC is not set +# CONFIG_TCP_CONG_WESTWOOD is not set +# CONFIG_TCP_CONG_HTCP is not set +# CONFIG_IPV6 is not set +# CONFIG_WIRELESS is not set +CONFIG_DEVTMPFS=3Dy +CONFIG_DEVTMPFS_MOUNT=3Dy +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +# CONFIG_FW_LOADER is not set +CONFIG_NETDEVICES=3Dy +CONFIG_ETHOC=3Dy +CONFIG_MICREL_PHY=3Dy +# CONFIG_WLAN is not set +# CONFIG_INPUT is not set +# CONFIG_SERIO is not set +# CONFIG_VT is not set +# CONFIG_LEGACY_PTYS is not set +CONFIG_SERIAL_8250=3Dy +CONFIG_SERIAL_8250_CONSOLE=3Dy +CONFIG_SERIAL_OF_PLATFORM=3Dy +# CONFIG_HW_RANDOM is not set +CONFIG_GPIO_SYSFS=3Dy +# CONFIG_GPIO_CDEV_V1 is not set +CONFIG_GPIO_GENERIC_PLATFORM=3Dy +# CONFIG_HWMON is not set +# CONFIG_USB_SUPPORT is not set +CONFIG_NEW_LEDS=3Dy +CONFIG_LEDS_CLASS=3Dy +CONFIG_LEDS_GPIO=3Dy +CONFIG_LEDS_TRIGGERS=3Dy +CONFIG_LEDS_TRIGGER_TIMER=3Dy +CONFIG_LEDS_TRIGGER_ONESHOT=3Dy +CONFIG_LEDS_TRIGGER_HEARTBEAT=3Dy +CONFIG_LEDS_TRIGGER_CPU=3Dy +CONFIG_LEDS_TRIGGER_ACTIVITY=3Dy +CONFIG_LEDS_TRIGGER_GPIO=3Dy +CONFIG_LEDS_TRIGGER_DEFAULT_ON=3Dy +CONFIG_LEDS_TRIGGER_TRANSIENT=3Dy +CONFIG_LEDS_TRIGGER_PANIC=3Dy +CONFIG_LEDS_TRIGGER_NETDEV=3Dy +CONFIG_LEDS_TRIGGER_PATTERN=3Dy +CONFIG_LEDS_TRIGGER_TTY=3Dy +# CONFIG_DNOTIFY is not set +CONFIG_TMPFS=3Dy +CONFIG_NFS_FS=3Dy +CONFIG_XZ_DEC=3Dy +CONFIG_PRINTK_TIME=3Dy +CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=3Dy +CONFIG_GDB_SCRIPTS=3Dy +CONFIG_VMLINUX_MAP=3Dy +CONFIG_HARDLOCKUP_DETECTOR=3Dy +CONFIG_WQ_WATCHDOG=3Dy +CONFIG_WQ_CPU_INTENSIVE_REPORT=3Dy +CONFIG_STACKTRACE=3Dy +CONFIG_RCU_CPU_STALL_CPUTIME=3Dy +# CONFIG_RCU_TRACE is not set --=20 2.51.0