From patchwork Thu Jun 27 04:33:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13713805 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1A631BF24 for ; Thu, 27 Jun 2024 04:33:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462807; cv=none; b=dE0QrAGCB4HFK/2nBU5z3E3Lz4IRftCw83/cUpI3iiuUMwip/4eIPQYp44xtzmV+bjBlULsQNL9pwyCsqNMowclflZOMe5KlC0qM3OwkOgjQTeuneCluktMa8l8DISpZFyOPV1a3u7B5BhavKy4E7ubGkC8GttKshKOjs+9Sdaw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462807; c=relaxed/simple; bh=PK2W04ll2hb3v5bvKi3h167n4UeVm/19716wzgjOpak=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pxgPucqBe4ORaSvx86AJ7vWWuGkhs3ozucLbDntwd0PiYqbIWYFUBl2n8WODdV9veNxQa31dnt+ixfF01NWnIE/rVv3AHiRP4yfBvhJ1vpIlrOJa896+jiTjRzlSJ4vlHHFhVl1+STM73nxQDvoYCJpJaqMPymUOzffHxoFdWlQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=NfHzEWzM; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="NfHzEWzM" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 605282C02A7; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1719462802; bh=7RK4VpqVUUaL3B9RJ09rDSqQRUnNry1hz3tgFTTAcV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NfHzEWzMcvbtHvB91GsZFZE4xO57zW+q1kunlNxC8DyG49j09RZf6kCSbQUdEUvm1 uybd+Yn3guMX9AR5F3w9lroaS8PL1cvuPpfZ3SbR+6hEHcqr7DAHfafbRyoBvZ92P1 4qBZ46ev7d/z8Rz6349eTbFnwJn2vGxlR1aiKk2t+vCL6ywttb8KizX2bs/JtVgeYj 7n8Hs6u+lL95BUJy0uQ9W3zPcxqfgi8Pk7IhvFdYlFWIVf9TE0/FmA0cJmAe83rk6H nrQFP17T50j0pJO9LKjav5qjodY/qwnu6AfCNMlfdhHyDddVrcaF9n5cgiDh+dFHsx w84gXoeCMN2/w== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Thu, 27 Jun 2024 16:33:21 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id E1D1313EE6D; Thu, 27 Jun 2024 16:33:21 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id DD06E280499; Thu, 27 Jun 2024 16:33:21 +1200 (NZST) From: Chris Packham To: tglx@linutronix.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, tsbogend@alpha.franken.de, daniel.lezcano@linaro.org, paulburton@kernel.org, peterz@infradead.org, mail@birger-koblitz.de, bert@biot.com, john@phrozen.org, sander@svanheule.net Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, kabel@kernel.org, ericwouds@gmail.com, Chris Packham Subject: [PATCH v3 1/9] mips: dts: realtek: use "serial" instead of "uart" in node name Date: Thu, 27 Jun 2024 16:33:09 +1200 Message-ID: <20240627043317.3751996-2-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> References: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=CvQccW4D c=1 sm=1 tr=0 ts=667ceb91 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=fO4XG2tHwy1-jxZR0dsA:9 a=3ZKOabzyN94A:10 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Update the node name for the UARTs to resolve the following dtbs_check complaints: uart@2000: $nodename:0: 'uart@2000' does not match '^serial(@.*)?$' uart@2100: $nodename:0: 'uart@2100' does not match '^serial(@.*)?$' Signed-off-by: Chris Packham Reviewed-by: Marek BehĂșn --- Notes: Changes in v2: - New arch/mips/boot/dts/realtek/rtl83xx.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/boot/dts/realtek/rtl83xx.dtsi b/arch/mips/boot/dts/realtek/rtl83xx.dtsi index de65a111b626..03ddc61f7c9e 100644 --- a/arch/mips/boot/dts/realtek/rtl83xx.dtsi +++ b/arch/mips/boot/dts/realtek/rtl83xx.dtsi @@ -22,7 +22,7 @@ soc: soc { #size-cells = <1>; ranges = <0x0 0x18000000 0x10000>; - uart0: uart@2000 { + uart0: serial@2000 { compatible = "ns16550a"; reg = <0x2000 0x100>; @@ -39,7 +39,7 @@ uart0: uart@2000 { status = "disabled"; }; - uart1: uart@2100 { + uart1: serial@2100 { compatible = "ns16550a"; reg = <0x2100 0x100>; From patchwork Thu Jun 27 04:33:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13713804 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0A481BDDB for ; Thu, 27 Jun 2024 04:33:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462807; cv=none; b=JcpFbcw5N/5wxu43eLbUKvwXxbGUc1X3qmE6D4YjQgC68JUYEdFxJzKXkJjuWqraMIfL4tBOIcagsbSOvPYwvvoU8dNyLVyCvYQGdKgv4LAzXDy0mo8xMpS0WvjYYTBLO/F38oyH3+zFRKw8yoIiGmUDMj7DhOc0kVBL85YqjPM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462807; c=relaxed/simple; bh=qQR/McBQUictKN6FDFcmG2wHXZ9K5U/5SuRHpnHk9NM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Erevw+lngLUfCmmCvDJzv6AV6ajopA4AWuHUrQjNvSk9a/WujGqxHnrqsDdia8XQh8/NwT3VcW1I3C9xYCkvn6bL97BDnqbJZG6+Mw8IpRyvoaQ0iGbUZr0lrbklM5iS+JYKNF+2xr0BYPwIIOD421jOr6OoY+PrykniIaFaxhA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=T+9nBxDg; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="T+9nBxDg" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 5E0F12C0241; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1719462802; bh=VqDnsxa9IRPhUHF/UMDGZUqazd5Q4It/crg+iHCE85s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T+9nBxDgqzJDwWQNn8g27evUVmFMhwYOl7rd3cgBGD92+GCUkRbrHs8z7DHs2aLIa N7TQrrgf+UYZ+V1y0dc+geYmXF3mkEwiVUpWyQ1jThRfQCqDeh6j7FXpe4cRlWpgu6 E5fYG8muxkFQxQRf/On36c6P02JdAuAhAYaAZbmmSZea6N7Kgjl6s7OU1nSquJGnFV scfeVx05tQucUU0y4DokonWMEjRY63ZaLX2/3XQCb9yDAr4KZLvf3iM4oES6gS5GQ3 0qBQ/fukMLUQfJQfGfnX1vk151VWTSlMbyGz26IhrHayT/07zX202+uh4ehi0HHvNS 1DIq3igs/NPmg== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Thu, 27 Jun 2024 16:33:22 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id E3FCC13EE84; Thu, 27 Jun 2024 16:33:21 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id DEFF3280930; Thu, 27 Jun 2024 16:33:21 +1200 (NZST) From: Chris Packham To: tglx@linutronix.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, tsbogend@alpha.franken.de, daniel.lezcano@linaro.org, paulburton@kernel.org, peterz@infradead.org, mail@birger-koblitz.de, bert@biot.com, john@phrozen.org, sander@svanheule.net Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, kabel@kernel.org, ericwouds@gmail.com, Chris Packham Subject: [PATCH v3 2/9] mips: dts: realtek: add device_type property to cpu node Date: Thu, 27 Jun 2024 16:33:10 +1200 Message-ID: <20240627043317.3751996-3-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> References: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=CvQccW4D c=1 sm=1 tr=0 ts=667ceb92 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=WrkMwgpS-tb6rWOXYdcA:9 a=3ZKOabzyN94A:10 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Add device_type = "cpu" to the cpu node for the rtl838x SoC. This resolves the following dtbs_check complaint: cpus: cpu@0: 'cache-level' is a required property Signed-off-by: Chris Packham Reviewed-by: Marek BehĂșn --- Notes: Changes in v2: - New arch/mips/boot/dts/realtek/rtl838x.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/boot/dts/realtek/rtl838x.dtsi b/arch/mips/boot/dts/realtek/rtl838x.dtsi index 6cc4ff5c0d19..722106e39194 100644 --- a/arch/mips/boot/dts/realtek/rtl838x.dtsi +++ b/arch/mips/boot/dts/realtek/rtl838x.dtsi @@ -6,6 +6,7 @@ cpus { #size-cells = <0>; cpu@0 { + device_type = "cpu"; compatible = "mips,mips4KEc"; reg = <0>; clocks = <&baseclk 0>; From patchwork Thu Jun 27 04:33:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13713803 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC5001BC44 for ; Thu, 27 Jun 2024 04:33:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462807; cv=none; b=cIuHJzHwGGzS13XukaD0skrN2WttMBCQnZeDlDbUpWPi9ReuhQvp6wGTDB4DkIBzEg3Kx5EvG7gHo03qyrn5Ctg6VqBlaS+jxM9EeQL6e4rOKOXyVXSiwn3HzXe74VupSp5tzGkm968AyGvCChZ8viKQf6Ic7V8PufBLkENr81Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462807; c=relaxed/simple; bh=SxKy6c8aH+qBN/CAmRz9nQAaQ/ZLS4PmvHvoZ7ft5Ns=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m9cKzLoMAhU+hV5XPrhRa+LaNS9w/TJ545F+T94SwiIeRcbp2U9HWqHy6RHHTBfY9otuXAkm+kw/YjG8IJydwW1TjHAsWZcVf6wdn7WaEY+d6fspL8T9C2/GmLCtCtHPcKaAOWYgWP8T5ASNJu8Ag82ZLumD673vNxiBtFAuynM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=kIHa8te4; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="kIHa8te4" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 8E1592C0659; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1719462802; bh=+6losAJiIn99Fr4mDJL5LYRb7pOWepPEf8cwsm5Q63w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kIHa8te4tNtrCc8P5N0rQpHy3MLeA9CFUfYNmynUKb2sYJHiZsNi6aOBPeReSWBFd 4k9OZII+bdjQFdvlnkZXhklI22WAmFockwMxepznbwRR1c2x5L8q6APNETgxuMvrWL AbAKXcvK1kLwcMR3SvJTrsUDH/0ZHFE5Gmh7jr74x2IL6799DOJbwPQb5WkeaMGDAU 6FTEIgqMIUjttHslAdAbpjpcLgaZ0l8LL3LeY3pyQkgQWM/WkzNI48WH4n11yRRQFj rlwULVo2VWuJHXO93kt8f6ETeXVPC2vzh51+XkN+j9yyeIXEZ99LHWeEHIqU8eJ7rH nHgmVMmPlM8jg== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Thu, 27 Jun 2024 16:33:22 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id E7F2713EE87; Thu, 27 Jun 2024 16:33:21 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id E4D9C28078C; Thu, 27 Jun 2024 16:33:21 +1200 (NZST) From: Chris Packham To: tglx@linutronix.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, tsbogend@alpha.franken.de, daniel.lezcano@linaro.org, paulburton@kernel.org, peterz@infradead.org, mail@birger-koblitz.de, bert@biot.com, john@phrozen.org, sander@svanheule.net Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, kabel@kernel.org, ericwouds@gmail.com, Chris Packham Subject: [PATCH v3 3/9] dt-bindings: vendor-prefixes: Add Cameo Communications Date: Thu, 27 Jun 2024 16:33:11 +1200 Message-ID: <20240627043317.3751996-4-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> References: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=CvQccW4D c=1 sm=1 tr=0 ts=667ceb92 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=9AoCKF9XAAAA:8 a=L4MHaItcyTsGJ2lxC4sA:9 a=3ZKOabzyN94A:10 a=zuUzDCw_FVeVL6jMbh0G:22 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Add entry for Cameo Communications (https://www.cameo.com.tw/) Signed-off-by: Chris Packham Acked-by: Krzysztof Kozlowski --- Notes: Changes in v3: - new Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index fbf47f0bacf1..67550f0dd189 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -246,6 +246,8 @@ patternProperties: description: CALAO Systems SAS "^calxeda,.*": description: Calxeda + "^cameo,.*": + description: Cameo Communications, Inc "^canaan,.*": description: Canaan, Inc. "^caninos,.*": From patchwork Thu Jun 27 04:33:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13713806 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAF871B947 for ; Thu, 27 Jun 2024 04:33:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462808; cv=none; b=F7OD/kJzGXhLL9F1AMhOKgARfgjuRs32Q9syjXfocADX89gs24EfJ2GLcLo2Ft21Uq60bVZK7i5ITZer9B/Am3jVJk/Cr/bsgje6JGldprGiL2BL0ZtjAldbaF+obh3mPuhbvW3BzIwqf2gUnUVLaUh6NpQ36uFNXEcDmjLNyPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462808; c=relaxed/simple; bh=Y3libUm+j5psOOxlpsMlLt0oDjgknlcmIRd8zChI610=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r9v/aRzkiq+3A5+mURQekH/yvU1JGJ/6q2B4xCi4s0eN29afEaKeuUS1SYtjwuPgVnq1QZ7x6ImjIh8OhIgRPMtHOtTQToXeb8t157aIMC1lzCSYeapwsejCQJbtBQlP0Zuv9Nik35c6lDvE6fv6Pf7QTOWkwJUbM9slnHuI18o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=hxSQVSE4; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="hxSQVSE4" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 722C32C04A9; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1719462802; bh=MxFICam9h/pm5tSiPkeoyztfvHM9KRsaNx4A9czN95o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hxSQVSE4pciS/T30Usc0DOvNumJMtHRS+2Z/R1BBl1l5ghxgmHN4FFQNZU8s9tQVG TW6f56MCNTHD0c8d2Ac0V0dnJTy0sqOZ1VDF0ypqYF0nTkP3UygM8D2h9cw9PVXmyP AtKhRmitRzcsf6xaklDPjWtR4qx7WKdrtwoImF4vOtAYPdrNRs96nLsYTC5raBQs/t GHYGOqmT/TwOiCBG9DtzgHTEhci/ttJwn9EI/+GMYNIRhSJg/nCH2zSJGDBeCJwUAv ZA3gvwwhbNV0h9c3FLMETMDdli/sHFYd6B2s5BY5weBGtwX81OjzdwywWcnbv1E36I kuyxy6fwZEL2A== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Thu, 27 Jun 2024 16:33:22 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id EC3DF13ED5B; Thu, 27 Jun 2024 16:33:21 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id E954F28078C; Thu, 27 Jun 2024 16:33:21 +1200 (NZST) From: Chris Packham To: tglx@linutronix.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, tsbogend@alpha.franken.de, daniel.lezcano@linaro.org, paulburton@kernel.org, peterz@infradead.org, mail@birger-koblitz.de, bert@biot.com, john@phrozen.org, sander@svanheule.net Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, kabel@kernel.org, ericwouds@gmail.com, Chris Packham Subject: [PATCH v3 4/9] dt-bindings: mips: realtek: Add rtl930x-soc compatible Date: Thu, 27 Jun 2024 16:33:12 +1200 Message-ID: <20240627043317.3751996-5-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> References: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=CvQccW4D c=1 sm=1 tr=0 ts=667ceb92 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=NHmAL4TRMSeL2PaLwp8A:9 a=3ZKOabzyN94A:10 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Add the rtl9302 SoC and the Cameo RTL9302C_2xRTL8224_2XGE reference board to the list of Realtek compatible strings. Signed-off-by: Chris Packham Reviewed-by: Krzysztof Kozlowski --- Notes: Changes in v3: - Use full board name - I've decided to stick with rtl9302-soc to disambiguate it from what I eventually plan to add as rtl9302-switch which is in the same package but are separate dies. Changes in v2: - Use specific compatible for rtl9302-soc - Fix to allow correct board, soc compatible Documentation/devicetree/bindings/mips/realtek-rtl.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/mips/realtek-rtl.yaml b/Documentation/devicetree/bindings/mips/realtek-rtl.yaml index f8ac309d2994..d337655bfbf8 100644 --- a/Documentation/devicetree/bindings/mips/realtek-rtl.yaml +++ b/Documentation/devicetree/bindings/mips/realtek-rtl.yaml @@ -20,5 +20,9 @@ properties: - enum: - cisco,sg220-26 - const: realtek,rtl8382-soc + - items: + - enum: + - cameo,rtl9302c-2x-rtl8224-2xge + - const: realtek,rtl9302-soc additionalProperties: true From patchwork Thu Jun 27 04:33:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13713809 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 712341CAB3 for ; Thu, 27 Jun 2024 04:33:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462811; cv=none; b=hI0ePrEZrK156NPrUcX2C1bwyaU7aqe1adEZxzuy5O6RpAIKT5B8sWENVorhLkSSDtmOM18hjWeIg0fAJcOmMudxoE89JSm2wu7mNHjqbUUJRlVCaHtkC8mmz+NuBeEmBamekwwtO/Wi05p00TbDj/s851zXS5hH49aac3I7MWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462811; c=relaxed/simple; bh=jYZM1xatOiLwT5jhGkQtuGm8c4KLUB3IilRgDN92hvM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zwm3aw8DHDani7wRND3IzgZPJZJ+juGIX/n9CFK4r0fSS38oPSB+Sg0GCb3SqIixUZuXsvYjQEiczc6Ld+Dt4WKK0a7Ew5oieBP0+8lclduhFNzahrT1xe0nx9o7SyxUIjgNfiT1eN9CSvqrUZ7ugwV3GTu4d6NhebTLkVrzRvc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=lrnZL75H; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="lrnZL75H" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id C6F5B2C0861; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1719462802; bh=38rbN0zRUJYTT11wA5vuTQE8ttsPebHXRPA3KedOVf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lrnZL75HX/374MEIUDqZUcsBgdbLOLxSJRhUJpLB5sN3f4rKq7ZthEZG1Q+MNstYJ d8iQYJ7BPOxJWLTmMsTVYTDpjLo63RVb+U2ddAx8yIX+v569DW6s1sY+ZaFVRHSHlh Dohga6um/dDbbru43hfcTU9xazqvHBA8Cix/tH4U9WzI/B0JVdHuDkXThhttFDzZLB xJvYYzVuwnWN8F2KbPYnbejeZBoa1a8IomfnFZ5uymBUXE947QvGXEqIqxcAA2Z2DO 7bbzwDcvv5foMjotejyh3PUvoz80mO3c74ekHsVK6GbQctotGiS0hLZhuam62CmwM/ z6JQiIWB/iZSA== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Thu, 27 Jun 2024 16:33:22 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id F0BF913EE8E; Thu, 27 Jun 2024 16:33:21 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id EDC1528078C; Thu, 27 Jun 2024 16:33:21 +1200 (NZST) From: Chris Packham To: tglx@linutronix.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, tsbogend@alpha.franken.de, daniel.lezcano@linaro.org, paulburton@kernel.org, peterz@infradead.org, mail@birger-koblitz.de, bert@biot.com, john@phrozen.org, sander@svanheule.net Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, kabel@kernel.org, ericwouds@gmail.com, Chris Packham Subject: [PATCH v3 5/9] dt-bindings: timer: Add schema for realtek,otto-timer Date: Thu, 27 Jun 2024 16:33:13 +1200 Message-ID: <20240627043317.3751996-6-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> References: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=CvQccW4D c=1 sm=1 tr=0 ts=667ceb92 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=gEfo2CItAAAA:8 a=2AJCWd3gv_sDiQv9-YsA:9 a=3ZKOabzyN94A:10 a=7p-po5nT6doXOX8LVc8m:22 a=sptkURWiP4Gy88Gu7hUp:22 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Add the devicetree schema for the realtek,otto-timer present on a number of Realtek SoCs. Signed-off-by: Chris Packham Reviewed-by: Krzysztof Kozlowski --- Notes: Changes in v3: - Use items to describe regs and interrupt properties - Remove minItems condition Changes in v2: - Use specific compatible (rtl9302-timer instead of rtl930x-timer) - Remove unnecessary label - Remove unused irq flags (interrupt controller is one-cell) - Set minItems for reg and interrupts based on compatible .../bindings/timer/realtek,otto-timer.yaml | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Documentation/devicetree/bindings/timer/realtek,otto-timer.yaml diff --git a/Documentation/devicetree/bindings/timer/realtek,otto-timer.yaml b/Documentation/devicetree/bindings/timer/realtek,otto-timer.yaml new file mode 100644 index 000000000000..7b6ec2c69484 --- /dev/null +++ b/Documentation/devicetree/bindings/timer/realtek,otto-timer.yaml @@ -0,0 +1,63 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/timer/realtek,otto-timer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Realtek Otto SoCs Timer/Counter + +description: + Realtek SoCs support a number of timers/counters. These are used + as a per CPU clock event generator and an overall CPU clocksource. + +maintainers: + - Chris Packham + +properties: + $nodename: + pattern: "^timer@[0-9a-f]+$" + + compatible: + items: + - enum: + - realtek,rtl9302-timer + - const: realtek,otto-timer + + reg: + items: + - description: timer0 registers + - description: timer1 registers + - description: timer2 registers + - description: timer3 registers + - description: timer4 registers + + clocks: + maxItems: 1 + + interrupts: + items: + - description: timer0 interrupt + - description: timer1 interrupt + - description: timer2 interrupt + - description: timer3 interrupt + - description: timer4 interrupt + +required: + - compatible + - reg + - clocks + - interrupts + +additionalProperties: false + +examples: + - | + timer@3200 { + compatible = "realtek,rtl9302-timer", "realtek,otto-timer"; + reg = <0x3200 0x10>, <0x3210 0x10>, <0x3220 0x10>, + <0x3230 0x10>, <0x3240 0x10>; + + interrupt-parent = <&intc>; + interrupts = <7>, <8>, <9>, <10>, <11>; + clocks = <&lx_clk>; + }; From patchwork Thu Jun 27 04:33:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13713808 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 813AE1C6B7 for ; Thu, 27 Jun 2024 04:33:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462810; cv=none; b=So4LNlluX0Da7cL2Y3nW16DOcWdTRns7U4Vf2VlrFSpz/AcHGkOlMNwLDtvmU6y90JaVrKd6pjGSOURZpMa1kYNwbilq59C0fl6Lifkr+RkXb+WCFbPIe7A1bMv86op1h/YLysAjx4zMPriAgxs+tdvAiamY8ZzsbL3mqDRYqdE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462810; c=relaxed/simple; bh=qtWouIeSqxc8SQXAJd2Fe1NXRZ6SvYPUz0BqPENUIvE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AyLh+ImBuur/Z++sE+19ocgdIYd2tuHiaUkOtqL7NMgPlwHgV138qEIrdOP8aS6aa4j9Nk/tGid/Zoa1r09B8IvDVX9m0mt4faX8u6+1+RMmLJ+J5YP2wFBmhny9pT8aQcBbtAEaDVQH3Xh/b4AVU68cVoqPph3CdzxqD4R5peg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=L5VR4DUt; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="L5VR4DUt" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id B94A72C0715; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1719462802; bh=jI2sZsbSPKTHA9dVQ0SCKTGaq9ONt4i+cOgJyQI8DtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L5VR4DUtmXAwNuRn2lYMl5UL1EsmdW/7tKRsnANUR+N+S+dbn/7PMSmNQLh1gisu/ trHYy8Z820T9BH9hY9CyspRlQ4yQ5BjPKhLAAhvQoSkkok+rQErNfT2bMIf6BTBukW ukU2sxLV7SgiefRL3vT7YfE2EmH2rTrbELuv1JLLDfSuT6LbVKkGZHcMryBc2vWip5 OmjXIk4/QwtGz/rX2htjlfUNGiZswmgTh+HLLvO9r0n4jgYuckfvjirxFfTzz9bb1+ x/hCpj2VKUpmp5CSi11cZRmbUYw7Yl/0pm4mi+Kxjp4pYvKuNODhFlNuyrUV0wtgKU +IRxD2u2ZSpnw== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Thu, 27 Jun 2024 16:33:22 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id 010EB13EE6D; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id F23DD28078C; Thu, 27 Jun 2024 16:33:21 +1200 (NZST) From: Chris Packham To: tglx@linutronix.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, tsbogend@alpha.franken.de, daniel.lezcano@linaro.org, paulburton@kernel.org, peterz@infradead.org, mail@birger-koblitz.de, bert@biot.com, john@phrozen.org, sander@svanheule.net Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, kabel@kernel.org, ericwouds@gmail.com, Chris Packham Subject: [PATCH v3 6/9] dt-bindings: interrupt-controller: realtek,rtl-intc: Add rtl9300-intc Date: Thu, 27 Jun 2024 16:33:14 +1200 Message-ID: <20240627043317.3751996-7-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> References: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=CvQccW4D c=1 sm=1 tr=0 ts=667ceb92 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=RxOWC8M5BiJtX5JSj5EA:9 a=3ZKOabzyN94A:10 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Add a compatible string for the interrupt controller found on the rtl930x SoCs. The interrupt controller has registers for VPE1 so these are added as a second reg cell. Signed-off-by: Chris Packham --- Notes: Changes in v3: - Use items to describe the regs property Changes in v2: - Set reg:maxItems to 2 to allow for VPE1 registers on the rtl9300. Add a condition to enforce the old limit on other SoCs. - Connor and Krzysztof offered acks on v1 but I think the changes here are big enough to void those. .../interrupt-controller/realtek,rtl-intc.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml index fb5593724059..d0e5bdf45d05 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml @@ -25,6 +25,7 @@ properties: - items: - enum: - realtek,rtl8380-intc + - realtek,rtl9300-intc - const: realtek,rtl-intc - const: realtek,rtl-intc deprecated: true @@ -35,7 +36,9 @@ properties: const: 1 reg: - maxItems: 1 + items: + - description: vpe0 registers + - description: vpe1 registers interrupts: minItems: 1 @@ -71,6 +74,19 @@ allOf: else: required: - interrupts + - if: + properties: + compatible: + contains: + const: realtek,rtl9300-intc + then: + properties: + reg: + maxItems: 2 + else: + properties: + reg: + maxItems: 1 additionalProperties: false From patchwork Thu Jun 27 04:33:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13713811 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F02320B12 for ; Thu, 27 Jun 2024 04:33:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462812; cv=none; b=NzmFPL6jiqvwNHuH/RSx0D6Fm0i9OsH8TpnIJ8Eji8GapFgDw9xR0Ss5XA7Aj4BV0nWaB5hWoFpX+Zbn/hjppPhuJP9Pzjq559a35XUAF9x4IepR+sE2KLpD2Jt6VKpk8Pja6rBJmOKEj8f5m7u7Tn0yCdysLhfsbVP53UJx4Aw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462812; c=relaxed/simple; bh=+BXIG/gITstDI5TQ5bzMkPue36VfuxT3zmb6OgiWCRw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hzEtMuKiR/bpuPVNC+udU+WNfajXrpNFnyjzTQc3rV7XWsV65L0uObze3GwNlUyehd8pSI0hJ7HxaiW4BTZLjQ48xD36VfluI3fJxAXfxWL+OzRJiehS0aj9NYlnxz44sDyEFS9gEDBLkxKfsEj2H20izPwU6aOylUdZ01Gf3io= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=uJN/nSa8; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="uJN/nSa8" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id E4A1B2C0BA5; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1719462802; bh=uwxKKaRxDPXdNi/DNP11vICh+TgslIC6Vig0FtEYjmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uJN/nSa8wYkcFTQ0LYKBcCTb9h+a/z+ft6uvM2TNZjgUw2lgmxRJX3URejdhSSCrI L4cfxrNASZCxgJdKwvH0dAit68tyPThv//ypt5UWRwzWUkZ2Oa45/mI30V669YDeAG cXetaJN28nh+S3jI3Tk6qrmUhhMRwRW3B+hwYO9S3Vvb2Gh5BrfFDr+NcxqS+coQyB tKuMmX3D6oCYOH4fxwSmaLG4E3KwBfbNXG/20rOMpt0NErP/UtY0G0hfkGcdOE4VnJ wRj4RE+u80d1CTpSDavyBirYj1zFNhDoXTB/w8gRijFQCnfY2jzdMqQamE5a3nXGVl eWH/ErLUIDERg== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Thu, 27 Jun 2024 16:33:22 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id 05D2713EE94; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 02BFE28078C; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) From: Chris Packham To: tglx@linutronix.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, tsbogend@alpha.franken.de, daniel.lezcano@linaro.org, paulburton@kernel.org, peterz@infradead.org, mail@birger-koblitz.de, bert@biot.com, john@phrozen.org, sander@svanheule.net Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, kabel@kernel.org, ericwouds@gmail.com, Chris Packham , Markus Stockhausen Subject: [PATCH v3 7/9] clocksource: realtek: Add timer driver for rtl-otto platforms Date: Thu, 27 Jun 2024 16:33:15 +1200 Message-ID: <20240627043317.3751996-8-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> References: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=CvQccW4D c=1 sm=1 tr=0 ts=667ceb92 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=jU52IrjdAAAA:8 a=jdP34snFAAAA:8 a=lYcVSoeQvU4dK_rf-5cA:9 a=3ZKOabzyN94A:10 a=udjdHy_fWrGJRxLc5KTh:22 a=jlphF6vWLdwq7oh3TaWq:22 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat The timer/counter block on the Realtek SoCs provides up to 5 timers. It also includes a watchdog timer but this isn't being used currently (it will be added as a separate wdt driver). One timer will be used per CPU as a local clock event generator. An additional timer will be used as an overal stable clocksource. Signed-off-by: Markus Stockhausen Signed-off-by: Sander Vanheule Signed-off-by: Chris Packham --- Notes: This is derrived from openwrt[1],[2]. I've retained the original signoff and added my own. [1] https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob_plain;f=target/linux/realtek/files-5.15/drivers/clocksource/timer-rtl-otto.c;hb=HEAD [2] https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob_plain;f=target/linux/realtek/patches-5.15/302-clocksource-add-otto-driver.patch;hb=HEAD Changes in v3: - Remove unnecessary select COMMON_CLK - Use %p when printing pointer Changes in v2 - None drivers/clocksource/Kconfig | 10 + drivers/clocksource/Makefile | 1 + drivers/clocksource/timer-rtl-otto.c | 287 +++++++++++++++++++++++++++ include/linux/cpuhotplug.h | 1 + 4 files changed, 299 insertions(+) create mode 100644 drivers/clocksource/timer-rtl-otto.c diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 34faa0320ece..70ba57210862 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -134,6 +134,16 @@ config RDA_TIMER help Enables the support for the RDA Micro timer driver. +config REALTEK_OTTO_TIMER + bool "Clocksource/timer for the Realtek Otto platform" + select TIMER_OF + help + This driver adds support for the timers found in the Realtek RTL83xx + and RTL93xx SoCs series. This includes chips such as RTL8380, RTL8381 + and RTL832, as well as chips from the RTL839x series, such as RTL8390 + RT8391, RTL8392, RTL8393 and RTL8396 and chips of the RTL930x series + such as RTL9301, RTL9302 or RTL9303. + config SUN4I_TIMER bool "Sun4i timer driver" if COMPILE_TEST depends on HAS_IOMEM diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile index 4bb856e4df55..22743785299e 100644 --- a/drivers/clocksource/Makefile +++ b/drivers/clocksource/Makefile @@ -59,6 +59,7 @@ obj-$(CONFIG_MILBEAUT_TIMER) += timer-milbeaut.o obj-$(CONFIG_SPRD_TIMER) += timer-sprd.o obj-$(CONFIG_NPCM7XX_TIMER) += timer-npcm7xx.o obj-$(CONFIG_RDA_TIMER) += timer-rda.o +obj-$(CONFIG_REALTEK_OTTO_TIMER) += timer-rtl-otto.o obj-$(CONFIG_ARC_TIMERS) += arc_timer.o obj-$(CONFIG_ARM_ARCH_TIMER) += arm_arch_timer.o diff --git a/drivers/clocksource/timer-rtl-otto.c b/drivers/clocksource/timer-rtl-otto.c new file mode 100644 index 000000000000..f1b9d35eacd1 --- /dev/null +++ b/drivers/clocksource/timer-rtl-otto.c @@ -0,0 +1,287 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include +#include +#include +#include "timer-of.h" + +#define RTTM_DATA 0x0 +#define RTTM_CNT 0x4 +#define RTTM_CTRL 0x8 +#define RTTM_INT 0xc + +#define RTTM_CTRL_ENABLE BIT(28) +#define RTTM_INT_PENDING BIT(16) +#define RTTM_INT_ENABLE BIT(20) + +/* + * The Otto platform provides multiple 28 bit timers/counters with the following + * operating logic. If enabled the timer counts up. Per timer one can set a + * maximum counter value as an end marker. If end marker is reached the timer + * fires an interrupt. If the timer "overflows" by reaching the end marker or + * by adding 1 to 0x0fffffff the counter is reset to 0. When this happens and + * the timer is in operating mode COUNTER it stops. In mode TIMER it will + * continue to count up. + */ +#define RTTM_CTRL_COUNTER 0 +#define RTTM_CTRL_TIMER BIT(24) + +#define RTTM_BIT_COUNT 28 +#define RTTM_MIN_DELTA 8 +#define RTTM_MAX_DELTA CLOCKSOURCE_MASK(28) + +/* + * Timers are derived from the LXB clock frequency. Usually this is a fixed + * multiple of the 25 MHz oscillator. The 930X SOC is an exception from that. + * Its LXB clock has only dividers and uses the switch PLL of 2.45 GHz as its + * base. The only meaningful frequencies we can achieve from that are 175.000 + * MHz and 153.125 MHz. The greatest common divisor of all explained possible + * speeds is 3125000. Pin the timers to this 3.125 MHz reference frequency. + */ +#define RTTM_TICKS_PER_SEC 3125000 + +struct rttm_cs { + struct timer_of to; + struct clocksource cs; +}; + +/* Simple internal register functions */ +static inline void rttm_set_counter(void __iomem *base, unsigned int counter) +{ + iowrite32(counter, base + RTTM_CNT); +} + +static inline unsigned int rttm_get_counter(void __iomem *base) +{ + return ioread32(base + RTTM_CNT); +} + +static inline void rttm_set_period(void __iomem *base, unsigned int period) +{ + iowrite32(period, base + RTTM_DATA); +} + +static inline void rttm_disable_timer(void __iomem *base) +{ + iowrite32(0, base + RTTM_CTRL); +} + +static inline void rttm_enable_timer(void __iomem *base, u32 mode, u32 divisor) +{ + iowrite32(RTTM_CTRL_ENABLE | mode | divisor, base + RTTM_CTRL); +} + +static inline void rttm_ack_irq(void __iomem *base) +{ + iowrite32(ioread32(base + RTTM_INT) | RTTM_INT_PENDING, base + RTTM_INT); +} + +static inline void rttm_enable_irq(void __iomem *base) +{ + iowrite32(RTTM_INT_ENABLE, base + RTTM_INT); +} + +static inline void rttm_disable_irq(void __iomem *base) +{ + iowrite32(0, base + RTTM_INT); +} + +/* Aggregated control functions for kernel clock framework */ +#define RTTM_DEBUG(base) \ + pr_debug("------------- %d %p\n", \ + smp_processor_id(), base) + +static irqreturn_t rttm_timer_interrupt(int irq, void *dev_id) +{ + struct clock_event_device *clkevt = dev_id; + struct timer_of *to = to_timer_of(clkevt); + + rttm_ack_irq(to->of_base.base); + RTTM_DEBUG(to->of_base.base); + clkevt->event_handler(clkevt); + + return IRQ_HANDLED; +} + +static void rttm_stop_timer(void __iomem *base) +{ + rttm_disable_timer(base); + rttm_ack_irq(base); +} + +static void rttm_start_timer(struct timer_of *to, u32 mode) +{ + rttm_set_counter(to->of_base.base, 0); + rttm_enable_timer(to->of_base.base, mode, to->of_clk.rate / RTTM_TICKS_PER_SEC); +} + +static int rttm_next_event(unsigned long delta, struct clock_event_device *clkevt) +{ + struct timer_of *to = to_timer_of(clkevt); + + RTTM_DEBUG(to->of_base.base); + rttm_stop_timer(to->of_base.base); + rttm_set_period(to->of_base.base, delta); + rttm_start_timer(to, RTTM_CTRL_COUNTER); + + return 0; +} + +static int rttm_state_oneshot(struct clock_event_device *clkevt) +{ + struct timer_of *to = to_timer_of(clkevt); + + RTTM_DEBUG(to->of_base.base); + rttm_stop_timer(to->of_base.base); + rttm_set_period(to->of_base.base, RTTM_TICKS_PER_SEC / HZ); + rttm_start_timer(to, RTTM_CTRL_COUNTER); + + return 0; +} + +static int rttm_state_periodic(struct clock_event_device *clkevt) +{ + struct timer_of *to = to_timer_of(clkevt); + + RTTM_DEBUG(to->of_base.base); + rttm_stop_timer(to->of_base.base); + rttm_set_period(to->of_base.base, RTTM_TICKS_PER_SEC / HZ); + rttm_start_timer(to, RTTM_CTRL_TIMER); + + return 0; +} + +static int rttm_state_shutdown(struct clock_event_device *clkevt) +{ + struct timer_of *to = to_timer_of(clkevt); + + RTTM_DEBUG(to->of_base.base); + rttm_stop_timer(to->of_base.base); + + return 0; +} + +static void rttm_setup_timer(void __iomem *base) +{ + RTTM_DEBUG(base); + rttm_stop_timer(base); + rttm_set_period(base, 0); +} + +static u64 rttm_read_clocksource(struct clocksource *cs) +{ + struct rttm_cs *rcs = container_of(cs, struct rttm_cs, cs); + + return (u64)rttm_get_counter(rcs->to.of_base.base); +} + +/* Module initialization part. */ +static DEFINE_PER_CPU(struct timer_of, rttm_to) = { + .flags = TIMER_OF_BASE | TIMER_OF_CLOCK | TIMER_OF_IRQ, + .of_irq = { + .flags = IRQF_PERCPU | IRQF_TIMER, + .handler = rttm_timer_interrupt, + }, + .clkevt = { + .rating = 400, + .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, + .set_state_periodic = rttm_state_periodic, + .set_state_shutdown = rttm_state_shutdown, + .set_state_oneshot = rttm_state_oneshot, + .set_next_event = rttm_next_event + }, +}; + +static int rttm_enable_clocksource(struct clocksource *cs) +{ + struct rttm_cs *rcs = container_of(cs, struct rttm_cs, cs); + + rttm_disable_irq(rcs->to.of_base.base); + rttm_setup_timer(rcs->to.of_base.base); + rttm_enable_timer(rcs->to.of_base.base, RTTM_CTRL_TIMER, + rcs->to.of_clk.rate / RTTM_TICKS_PER_SEC); + + return 0; +} + +struct rttm_cs rttm_cs = { + .to = { + .flags = TIMER_OF_BASE | TIMER_OF_CLOCK, + }, + .cs = { + .name = "realtek_otto_timer", + .rating = 400, + .mask = CLOCKSOURCE_MASK(RTTM_BIT_COUNT), + .flags = CLOCK_SOURCE_IS_CONTINUOUS, + .read = rttm_read_clocksource, + } +}; + +static u64 notrace rttm_read_clock(void) +{ + return (u64)rttm_get_counter(rttm_cs.to.of_base.base); +} + +static int rttm_cpu_starting(unsigned int cpu) +{ + struct timer_of *to = per_cpu_ptr(&rttm_to, cpu); + + RTTM_DEBUG(to->of_base.base); + to->clkevt.cpumask = cpumask_of(cpu); + irq_force_affinity(to->of_irq.irq, to->clkevt.cpumask); + clockevents_config_and_register(&to->clkevt, RTTM_TICKS_PER_SEC, + RTTM_MIN_DELTA, RTTM_MAX_DELTA); + rttm_enable_irq(to->of_base.base); + + return 0; +} + +static int __init rttm_probe(struct device_node *np) +{ + int cpu, cpu_rollback; + struct timer_of *to; + int clkidx = num_possible_cpus(); + + /* Use the first n timers as per CPU clock event generators */ + for_each_possible_cpu(cpu) { + to = per_cpu_ptr(&rttm_to, cpu); + to->of_irq.index = to->of_base.index = cpu; + if (timer_of_init(np, to)) { + pr_err("setup of timer %d failed\n", cpu); + goto rollback; + } + rttm_setup_timer(to->of_base.base); + } + + /* Activate the n'th + 1 timer as a stable CPU clocksource. */ + to = &rttm_cs.to; + to->of_base.index = clkidx; + timer_of_init(np, to); + if (rttm_cs.to.of_base.base && rttm_cs.to.of_clk.rate) { + rttm_enable_clocksource(&rttm_cs.cs); + clocksource_register_hz(&rttm_cs.cs, RTTM_TICKS_PER_SEC); + sched_clock_register(rttm_read_clock, RTTM_BIT_COUNT, RTTM_TICKS_PER_SEC); + } else + pr_err(" setup of timer %d as clocksource failed", clkidx); + + return cpuhp_setup_state(CPUHP_AP_REALTEK_TIMER_STARTING, + "timer/realtek:online", + rttm_cpu_starting, NULL); +rollback: + pr_err("timer registration failed\n"); + for_each_possible_cpu(cpu_rollback) { + if (cpu_rollback == cpu) + break; + to = per_cpu_ptr(&rttm_to, cpu_rollback); + timer_of_cleanup(to); + } + + return -EINVAL; +} + +TIMER_OF_DECLARE(otto_timer, "realtek,otto-timer", rttm_probe); diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 7a5785f405b6..56b744dc1317 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -171,6 +171,7 @@ enum cpuhp_state { CPUHP_AP_ARMADA_TIMER_STARTING, CPUHP_AP_MIPS_GIC_TIMER_STARTING, CPUHP_AP_ARC_TIMER_STARTING, + CPUHP_AP_REALTEK_TIMER_STARTING, CPUHP_AP_RISCV_TIMER_STARTING, CPUHP_AP_CLINT_TIMER_STARTING, CPUHP_AP_CSKY_TIMER_STARTING, From patchwork Thu Jun 27 04:33:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13713812 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58BB720B33 for ; Thu, 27 Jun 2024 04:33:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462812; cv=none; b=XRVdryTtgtl5oK6K1+bXbNiZVHORSk6zLx/f+pCHXgJ6/ab0Hh8my1QjWt4UsdyRF5DaooGem50A7gWk18VNfdk9t4H/FMMx8Gd3hBYL+J6EExgb8F1ge7ryzZLRKvl67CRald0aTMav99BNP+ZTNVA0oPBbp+yvj+9O8FX9A+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462812; c=relaxed/simple; bh=ZdVi8VCgi+qsF52rErTRXrOm0eUlYjIJVqLwTSOdHXc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lhogv2eBpeZeoewe+W0RVy/5UtXadqWT0qqTmAj6jhYNcx+Jm3cwVTNOxUnM297Kk9W4jjMTVNdUvLJh8gcROG//zphLETarbx7Qf8NMY3NwY2O9NDs+WkAwflKwjS31NBpyg6RnnPg1U13z4F0yyHPg+TfliG/mfYmQa9nLTVc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=HnpZsRuz; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="HnpZsRuz" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id D6C382C0A3D; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1719462802; bh=VrmO1c5KC//uEF1RjNzzRNkc9fm5nR9Yhl79hutvYko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HnpZsRuzF638LoMIEROzRcU06mqTANgoDr5E0mAf2VM3T8hmk1ZBvO5hZd7LCmkz5 oVULJ1lL+hEDEz17zXgRnXjBKDIZFqGi/NopGCXVm2Q+nZCSsoT56TP8+YU3j5yT1f Lc149Xp1kFGJcD4BdAlEgxVU/sgjzOx0+CnE+0kt+q2DLP9CYbtLTNHUstYE5Xms8P 7EVUyAfoUuJ4K5IlDfck7gdQ2YZwLYjdG80VJuGRWxIjCb9LZCISAd4QKHkJpcGgvr OoDo7i4gJLUQtHdXmManMPRYQZ60vZr4IHJaJQ4UgQ++Nk+aJr4e47rocXC9KTvUO3 MSNq83ObCEVLw== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Thu, 27 Jun 2024 16:33:22 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id 0A50513EE84; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 075FC28078C; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) From: Chris Packham To: tglx@linutronix.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, tsbogend@alpha.franken.de, daniel.lezcano@linaro.org, paulburton@kernel.org, peterz@infradead.org, mail@birger-koblitz.de, bert@biot.com, john@phrozen.org, sander@svanheule.net Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, kabel@kernel.org, ericwouds@gmail.com, Chris Packham Subject: [PATCH v3 8/9] mips: generic: add fdt fixup for Realtek reference board Date: Thu, 27 Jun 2024 16:33:16 +1200 Message-ID: <20240627043317.3751996-9-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> References: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=CvQccW4D c=1 sm=1 tr=0 ts=667ceb92 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=x-EMvBfK1kxHbq4Brr4A:9 a=3ZKOabzyN94A:10 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat The bootloader used on the Realtek RTL9302C boards is an ancient vendor fork of U-Boot that doesn't understand device trees. So to run a modern kernel it is necessary use one of the APPENDED_DTB options. When appending the DTB the inintrd information, if present, needs to be inserted into the /chosen device tree node. The bootloader provides the initrd start/size via the firmware environment. Add a fdt fixup that will update the device tree with the initrd information. Signed-off-by: Chris Packham --- Notes: Changes in v3: - None Changes in v2: - update compatible string arch/mips/generic/Makefile | 1 + arch/mips/generic/board-realtek.c | 81 +++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 arch/mips/generic/board-realtek.c diff --git a/arch/mips/generic/Makefile b/arch/mips/generic/Makefile index 56011d738441..ea0e4ad5e600 100644 --- a/arch/mips/generic/Makefile +++ b/arch/mips/generic/Makefile @@ -13,3 +13,4 @@ obj-$(CONFIG_LEGACY_BOARD_SEAD3) += board-sead3.o obj-$(CONFIG_LEGACY_BOARD_OCELOT) += board-ocelot.o obj-$(CONFIG_MACH_INGENIC) += board-ingenic.o obj-$(CONFIG_VIRT_BOARD_RANCHU) += board-ranchu.o +obj-$(CONFIG_MACH_REALTEK_RTL) += board-realtek.o diff --git a/arch/mips/generic/board-realtek.c b/arch/mips/generic/board-realtek.c new file mode 100644 index 000000000000..cd83fbf1968c --- /dev/null +++ b/arch/mips/generic/board-realtek.c @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2024 Allied Telesis + */ + +#include +#include +#include +#include + +#include +#include + +static __init int realtek_add_initrd(void *fdt) +{ + int node, err; + u32 start, size; + + node = fdt_path_offset(fdt, "/chosen"); + if (node < 0) { + pr_err("/chosen node not found\n"); + return -ENOENT; + } + + start = fw_getenvl("initrd_start"); + size = fw_getenvl("initrd_size"); + + if (start == 0 && size == 0) + return 0; + + pr_info("Adding initrd info from environment\n"); + + err = fdt_setprop_u32(fdt, node, "linux,initrd-start", start); + if (err) { + pr_err("unable to set initrd-start: %d\n", err); + return err; + } + + err = fdt_setprop_u32(fdt, node, "linux,initrd-end", start + size); + if (err) { + pr_err("unable to set initrd-end: %d\n", err); + return err; + } + + return 0; +} + +static const struct mips_fdt_fixup realtek_fdt_fixups[] __initconst = { + { realtek_add_initrd, "add initrd" }, + {}, +}; + +static __init const void *realtek_fixup_fdt(const void *fdt, const void *match_data) +{ + static unsigned char fdt_buf[16 << 10] __initdata; + int err; + + if (fdt_check_header(fdt)) + panic("Corrupt DT"); + + fw_init_cmdline(); + + err = apply_mips_fdt_fixups(fdt_buf, sizeof(fdt_buf), fdt, realtek_fdt_fixups); + if (err) + panic("Unable to fixup FDT: %d", err); + + return fdt_buf; + +} + +static const struct of_device_id realtek_of_match[] __initconst = { + { + .compatible = "realtek,rtl9302", + }, + {} +}; + +MIPS_MACHINE(realtek) = { + .matches = realtek_of_match, + .fixup_fdt = realtek_fixup_fdt, +}; From patchwork Thu Jun 27 04:33:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 13713810 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29F69208BA for ; Thu, 27 Jun 2024 04:33:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462812; cv=none; b=VRRgKX+63SLRVI3gBfjjCSDEpPz4NnGVbvafMmgKDQs3THezyjURmwiEr/ZCqtC+0ruDbLfq279yPRHLBusdFUJiMTI+PSNBXcjTqYT+GVXbGJhHFAuYhePRvE1KoIZT+oJbo7AazUjY2L3Posv0M8GT+yx7TOSle6BPMjT6KEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719462812; c=relaxed/simple; bh=9OHHBeRNYkf08tWVOx58hAsOaRBNPBBISNQUuPYyddg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mNcSmKqYMdRcC5Y7vQA1ZgwoOmJFEcLUCpbuuQF6ntNl7h4leRjiBbfAPaVfUt2xydaISiwrIcWzSdt++HiTfHDhye+GYgH9Qj/2vrLEa2vz0N01WTtC+Vuncd8gxNm35rf+LzOLGp7YG+QdCuL6LZYKjq6rYGa0/8upe8CYKoo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=oJz0BbLm; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="oJz0BbLm" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id E4C6D2C0C2E; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1719462802; bh=OyAj5xTANs1fjuTKws7ah8fvMoeSnsG3zKFlZspY/G4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oJz0BbLmXa7Oo/PtEYHyLCZumN+NOpaPYGEFea+bfEvWiiwyrwjwLdc5ytFNx0ora HO9IbsBV68cacyRQxZ/mBYswWK/NTfaxn5bdKnssP/lJhlbKaB+SkXEqcKmf6SkWtH e2p77VHDx5LWH1gDQxE5l/2P4hlqRoVbqJZMvisHJOttsQa+cn1EZPgDc1JE+6zaUR uBzQPgkWHmO9Dai5VwjF6F84ByJJI4hJKu4D4yFIqpl0Zs+517B9Y2yxNaaGDc60pF QSqVU7zHkXxOLt4cznTPOj03zoJLHIzykQGA3PglsTE3wOu/pCez2nAMokBtOCbjzm k4dws3Xop8EBA== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Thu, 27 Jun 2024 16:33:22 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id 0ECCA13EE9B; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 0BE9B28078C; Thu, 27 Jun 2024 16:33:22 +1200 (NZST) From: Chris Packham To: tglx@linutronix.de, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, tsbogend@alpha.franken.de, daniel.lezcano@linaro.org, paulburton@kernel.org, peterz@infradead.org, mail@birger-koblitz.de, bert@biot.com, john@phrozen.org, sander@svanheule.net Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, kabel@kernel.org, ericwouds@gmail.com, Chris Packham Subject: [PATCH v3 9/9] mips: dts: realtek: Add RTL9302C board Date: Thu, 27 Jun 2024 16:33:17 +1200 Message-ID: <20240627043317.3751996-10-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> References: <20240627043317.3751996-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=CvQccW4D c=1 sm=1 tr=0 ts=667ceb92 a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=FkagyKZCYwirPjr5IuAA:9 a=3ZKOabzyN94A:10 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Add support for the RTL9302 SoC and the RTL9302C_2xRTL8224_2XGE reference board. The RTL930x family of SoCs are Realtek switches with an embedded MIPS core (800MHz 34Kc). Most of the peripherals are similar to the RTL838x SoC and can make use of many existing drivers. Add in full DSA switch support is still a work in progress. Signed-off-by: Chris Packham --- Notes: Changes in v3: - Use full board name Changes in v2: - Use specific compatibles instead of rtl930x - Remove unnecessary irq flags (interrupt controller is one-cell) - Remove earlycon - Name clocks as recommended in dt schema arch/mips/boot/dts/realtek/Makefile | 1 + .../cameo-rtl9302c-2x-rtl8224-2xge.dts | 73 +++++++++++++++++ arch/mips/boot/dts/realtek/rtl930x.dtsi | 79 +++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 arch/mips/boot/dts/realtek/cameo-rtl9302c-2x-rtl8224-2xge.dts create mode 100644 arch/mips/boot/dts/realtek/rtl930x.dtsi diff --git a/arch/mips/boot/dts/realtek/Makefile b/arch/mips/boot/dts/realtek/Makefile index fba4e93187a6..d2709798763f 100644 --- a/arch/mips/boot/dts/realtek/Makefile +++ b/arch/mips/boot/dts/realtek/Makefile @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 dtb-y += cisco_sg220-26.dtb +dtb-y += cameo-rtl9302c-2x-rtl8224-2xge.dtb diff --git a/arch/mips/boot/dts/realtek/cameo-rtl9302c-2x-rtl8224-2xge.dts b/arch/mips/boot/dts/realtek/cameo-rtl9302c-2x-rtl8224-2xge.dts new file mode 100644 index 000000000000..b51e10ae4950 --- /dev/null +++ b/arch/mips/boot/dts/realtek/cameo-rtl9302c-2x-rtl8224-2xge.dts @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/dts-v1/; + +#include "rtl930x.dtsi" + +#include +#include +#include +#include + +/ { + compatible = "cameo,rtl9302c-2x-rtl8224-2xge", "realtek,rtl9302-soc"; + model = "RTL9302C Development Board"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&uart0 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0xe0000>; + read-only; + }; + partition@e0000 { + label = "u-boot-env"; + reg = <0xe0000 0x10000>; + }; + partition@f0000 { + label = "u-boot-env2"; + reg = <0xf0000 0x10000>; + read-only; + }; + partition@100000 { + label = "jffs"; + reg = <0x100000 0x100000>; + }; + partition@200000 { + label = "jffs2"; + reg = <0x200000 0x100000>; + }; + partition@300000 { + label = "runtime"; + reg = <0x300000 0xe80000>; + }; + partition@1180000 { + label = "runtime2"; + reg = <0x1180000 0xe80000>; + }; + }; + }; +}; diff --git a/arch/mips/boot/dts/realtek/rtl930x.dtsi b/arch/mips/boot/dts/realtek/rtl930x.dtsi new file mode 100644 index 000000000000..f271940f82be --- /dev/null +++ b/arch/mips/boot/dts/realtek/rtl930x.dtsi @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause + +#include "rtl83xx.dtsi" + +/ { + compatible = "realtek,rtl9302-soc"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "mips,mips34Kc"; + reg = <0>; + clocks = <&baseclk 0>; + clock-names = "cpu"; + }; + }; + + baseclk: clock-800mhz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <800000000>; + }; + + lx_clk: clock-175mhz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <175000000>; + }; +}; + +&soc { + intc: interrupt-controller@3000 { + compatible = "realtek,rtl9300-intc", "realtek,rtl-intc"; + reg = <0x3000 0x18>, <0x3018 0x18>; + interrupt-controller; + #interrupt-cells = <1>; + + interrupt-parent = <&cpuintc>; + interrupts = <2>, <3>, <4>, <5>, <6>, <7>; + }; + + spi0: spi@1200 { + compatible = "realtek,rtl8380-spi"; + reg = <0x1200 0x100>; + + #address-cells = <1>; + #size-cells = <0>; + }; + + timer0: timer@3200 { + compatible = "realtek,rtl9302-timer", "realtek,otto-timer"; + reg = <0x3200 0x10>, <0x3210 0x10>, <0x3220 0x10>, + <0x3230 0x10>, <0x3240 0x10>; + + interrupt-parent = <&intc>; + interrupts = <7>, <8>, <9>, <10>, <11>; + clocks = <&lx_clk>; + }; +}; + +&uart0 { + /delete-property/ clock-frequency; + clocks = <&lx_clk>; + + interrupt-parent = <&intc>; + interrupts = <30>; +}; + +&uart1 { + /delete-property/ clock-frequency; + clocks = <&lx_clk>; + + interrupt-parent = <&intc>; + interrupts = <31>; +}; +