* [PATCH v2 0/3] arm64: dts: hi3798cv200: fix GICR size, add cache info, maintenance irq and GICH, GICV spaces
@ 2024-02-18 12:02 Yang Xiwen via B4 Relay
2024-02-18 12:02 ` [PATCH v2 1/3] arm64: dts: hi3798cv200: fix the size of GICR Yang Xiwen via B4 Relay
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Yang Xiwen via B4 Relay @ 2024-02-18 12:02 UTC (permalink / raw)
To: Wei Xu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jiancheng Xue, Alex Elder, Peter Griffin
Cc: linux-arm-kernel, devicetree, linux-kernel, Yang Xiwen
They are tested on a hi3798mv200 board in fact. Though the 2 SoCs are
highly similar and the CPU should be the same. Still, Tested-by are
welcomed.
The patchset fixes some warnings reported by the kernel during boot.
The cache size info is from Processor_Datasheet_v2XX.pdf [1], Section
2.2.1 Master Processor.
The cache line size and the set-associative info are from Cortex-A53
Documentation [2]. Dts for other SoCs are also a good reference.
From the doc, we know L1 i-cache is 4-way assoc, L1 d-cache is 2-way
assoc and L2 cache is 16-way assoc. Fill the dts props accordingly.
Also, to use KVM's VGIC code, we need to add GICH, GICV and maintenance
IRQ to the dts. They are added with verification.
Dear maintainers, maybe consider Cc to stable too?
[1]: https://github.com/96boards/documentation/blob/master/enterprise/poplar/hardware-docs/Processor_Datasheet_v2XX.pdf
[2]: https://developer.arm.com/documentation/ddi0500/j/Level-1-Memory-System
Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
---
Changes in v2:
- arm64: dts: hi3798cv200: add GICH, GICV register spces and
maintainance IRQ.
- Link to v1: https://lore.kernel.org/r/20240218-cache-v1-0-2c0a8a4472e7@outlook.com
---
Yang Xiwen (3):
arm64: dts: hi3798cv200: fix the size of GICR
arm64: dts: hi3798cv200: add GICH, GICV register space and irq
arm64: dts: hi3798cv200: add cache info
arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi | 43 +++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
---
base-commit: 8d3dea210042f54b952b481838c1e7dfc4ec751d
change-id: 20240218-cache-11c8bf7566c2
Best regards,
--
Yang Xiwen <forbidden405@outlook.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH v2 1/3] arm64: dts: hi3798cv200: fix the size of GICR
2024-02-18 12:02 [PATCH v2 0/3] arm64: dts: hi3798cv200: fix GICR size, add cache info, maintenance irq and GICH, GICV spaces Yang Xiwen via B4 Relay
@ 2024-02-18 12:02 ` Yang Xiwen via B4 Relay
2024-02-18 12:02 ` [PATCH v2 2/3] arm64: dts: hi3798cv200: add GICH, GICV register space and irq Yang Xiwen via B4 Relay
2024-02-18 12:02 ` [PATCH v2 3/3] arm64: dts: hi3798cv200: add cache info Yang Xiwen via B4 Relay
2 siblings, 0 replies; 5+ messages in thread
From: Yang Xiwen via B4 Relay @ 2024-02-18 12:02 UTC (permalink / raw)
To: Wei Xu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jiancheng Xue, Alex Elder, Peter Griffin
Cc: linux-arm-kernel, devicetree, linux-kernel, Yang Xiwen
From: Yang Xiwen <forbidden405@outlook.com>
During boot, kernel complains:
[ 0.000000] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set
Looking at GIC-400 datasheet, I believe this SoC is using a regular
GIC-400 and the GICR space size should be 8 KB rather than 256B.
With this patch:
[ 0.000000] GIC: Using split EOI/Deactivate mode
So this should be the correct fix.
Fixes: 2f20182ed670 ("arm64: dts: hisilicon: add dts files for hi3798cv200-poplar board")
Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
---
arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi b/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi
index ed1b5a7a6067..d01023401d7e 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi
@@ -58,7 +58,7 @@ cpu@3 {
gic: interrupt-controller@f1001000 {
compatible = "arm,gic-400";
reg = <0x0 0xf1001000 0x0 0x1000>, /* GICD */
- <0x0 0xf1002000 0x0 0x100>; /* GICC */
+ <0x0 0xf1002000 0x0 0x2000>; /* GICC */
#address-cells = <0>;
#interrupt-cells = <3>;
interrupt-controller;
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH v2 2/3] arm64: dts: hi3798cv200: add GICH, GICV register space and irq
2024-02-18 12:02 [PATCH v2 0/3] arm64: dts: hi3798cv200: fix GICR size, add cache info, maintenance irq and GICH, GICV spaces Yang Xiwen via B4 Relay
2024-02-18 12:02 ` [PATCH v2 1/3] arm64: dts: hi3798cv200: fix the size of GICR Yang Xiwen via B4 Relay
@ 2024-02-18 12:02 ` Yang Xiwen via B4 Relay
2024-02-18 12:02 ` [PATCH v2 3/3] arm64: dts: hi3798cv200: add cache info Yang Xiwen via B4 Relay
2 siblings, 0 replies; 5+ messages in thread
From: Yang Xiwen via B4 Relay @ 2024-02-18 12:02 UTC (permalink / raw)
To: Wei Xu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jiancheng Xue, Alex Elder, Peter Griffin
Cc: linux-arm-kernel, devicetree, linux-kernel, Yang Xiwen
From: Yang Xiwen <forbidden405@outlook.com>
This is needed by KVM to make use of VGIC code. Just like regular
GIC-400, PPI #9 is the hypervisor maintenance interrupt. It has been
verified.
Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
---
arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi b/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi
index d01023401d7e..fc64d2fa99eb 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi
@@ -58,7 +58,11 @@ cpu@3 {
gic: interrupt-controller@f1001000 {
compatible = "arm,gic-400";
reg = <0x0 0xf1001000 0x0 0x1000>, /* GICD */
- <0x0 0xf1002000 0x0 0x2000>; /* GICC */
+ <0x0 0xf1002000 0x0 0x2000>, /* GICC */
+ <0x0 0xf1004000 0x0 0x2000>, /* GICH */
+ <0x0 0xf1006000 0x0 0x2000>; /* GICV */
+ interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) |
+ IRQ_TYPE_LEVEL_HIGH)>;
#address-cells = <0>;
#interrupt-cells = <3>;
interrupt-controller;
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH v2 3/3] arm64: dts: hi3798cv200: add cache info
2024-02-18 12:02 [PATCH v2 0/3] arm64: dts: hi3798cv200: fix GICR size, add cache info, maintenance irq and GICH, GICV spaces Yang Xiwen via B4 Relay
2024-02-18 12:02 ` [PATCH v2 1/3] arm64: dts: hi3798cv200: fix the size of GICR Yang Xiwen via B4 Relay
2024-02-18 12:02 ` [PATCH v2 2/3] arm64: dts: hi3798cv200: add GICH, GICV register space and irq Yang Xiwen via B4 Relay
@ 2024-02-18 12:02 ` Yang Xiwen via B4 Relay
2024-02-19 7:20 ` Krzysztof Kozlowski
2 siblings, 1 reply; 5+ messages in thread
From: Yang Xiwen via B4 Relay @ 2024-02-18 12:02 UTC (permalink / raw)
To: Wei Xu, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Jiancheng Xue, Alex Elder, Peter Griffin
Cc: linux-arm-kernel, devicetree, linux-kernel, Yang Xiwen
From: Yang Xiwen <forbidden405@outlook.com>
During boot, the kernel complains:
[ 0.044029] cacheinfo: Unable to detect cache hierarchy for CPU 0
So add L1/L2 cache info to the dts according to the datasheet. (32KiB L1
i-cache + 32 KiB L1 d-cache + 512 KiB L2 unified cache)
With this patch, the line above is gone and the following info is added
to the output of `lscpu`:
Caches (sum of all):
L1d: 128 KiB (4 instances)
L1i: 128 KiB (4 instances)
L2: 512 KiB (1 instance)
Fixes: 2f20182ed670 ("arm64: dts: hisilicon: add dts files for hi3798cv200-poplar board")
Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
---
arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi | 37 ++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi b/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi
index fc64d2fa99eb..0a9533786f50 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi
+++ b/arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi
@@ -31,6 +31,13 @@ cpu@0 {
device_type = "cpu";
reg = <0x0 0x0>;
enable-method = "psci";
+ d-cache-size = <0x8000>; /* 32 KiB */
+ d-cache-line-size = <64>;
+ d-cache-sets = <128>;
+ i-cache-size = <0x8000>; /* 32 KiB */
+ i-cache-line-size = <64>;
+ i-cache-sets = <256>;
+ next-level-cache = <&L2_0>;
};
cpu@1 {
@@ -38,6 +45,13 @@ cpu@1 {
device_type = "cpu";
reg = <0x0 0x1>;
enable-method = "psci";
+ d-cache-size = <0x8000>; /* 32 KiB */
+ d-cache-line-size = <64>;
+ d-cache-sets = <128>;
+ i-cache-size = <0x8000>; /* 32 KiB */
+ i-cache-line-size = <64>;
+ i-cache-sets = <256>;
+ next-level-cache = <&L2_0>;
};
cpu@2 {
@@ -45,6 +59,13 @@ cpu@2 {
device_type = "cpu";
reg = <0x0 0x2>;
enable-method = "psci";
+ d-cache-size = <0x8000>; /* 32 KiB */
+ d-cache-line-size = <64>;
+ d-cache-sets = <128>;
+ i-cache-size = <0x8000>; /* 32 KiB */
+ i-cache-line-size = <64>;
+ i-cache-sets = <256>;
+ next-level-cache = <&L2_0>;
};
cpu@3 {
@@ -52,9 +73,25 @@ cpu@3 {
device_type = "cpu";
reg = <0x0 0x3>;
enable-method = "psci";
+ d-cache-size = <0x8000>; /* 32 KiB */
+ d-cache-line-size = <64>;
+ d-cache-sets = <128>;
+ i-cache-size = <0x8000>; /* 32 KiB */
+ i-cache-line-size = <64>;
+ i-cache-sets = <256>;
+ next-level-cache = <&L2_0>;
};
};
+ L2_0: l2-cache0 {
+ compatible = "cache";
+ cache-unified;
+ cache-size = <0x80000>; /* 512 KiB */
+ cache-line-size = <64>;
+ cache-sets = <512>;
+ cache-level = <2>;
+ };
+
gic: interrupt-controller@f1001000 {
compatible = "arm,gic-400";
reg = <0x0 0xf1001000 0x0 0x1000>, /* GICD */
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2 3/3] arm64: dts: hi3798cv200: add cache info
2024-02-18 12:02 ` [PATCH v2 3/3] arm64: dts: hi3798cv200: add cache info Yang Xiwen via B4 Relay
@ 2024-02-19 7:20 ` Krzysztof Kozlowski
0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-19 7:20 UTC (permalink / raw)
To: forbidden405, Wei Xu, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Jiancheng Xue, Alex Elder, Peter Griffin
Cc: linux-arm-kernel, devicetree, linux-kernel
On 18/02/2024 13:02, Yang Xiwen via B4 Relay wrote:
> From: Yang Xiwen <forbidden405@outlook.com>
>
> During boot, the kernel complains:
>
> [ 0.044029] cacheinfo: Unable to detect cache hierarchy for CPU 0
>
> So add L1/L2 cache info to the dts according to the datasheet. (32KiB L1
> i-cache + 32 KiB L1 d-cache + 512 KiB L2 unified cache)
> cpu@3 {
> @@ -52,9 +73,25 @@ cpu@3 {
> device_type = "cpu";
> reg = <0x0 0x3>;
> enable-method = "psci";
> + d-cache-size = <0x8000>; /* 32 KiB */
> + d-cache-line-size = <64>;
> + d-cache-sets = <128>;
> + i-cache-size = <0x8000>; /* 32 KiB */
> + i-cache-line-size = <64>;
> + i-cache-sets = <256>;
> + next-level-cache = <&L2_0>;
> };
> };
>
> + L2_0: l2-cache0 {
Do you have more than one? If not, then "l2-cache". If yes, then
"l2-cache-0".
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-02-19 7:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-18 12:02 [PATCH v2 0/3] arm64: dts: hi3798cv200: fix GICR size, add cache info, maintenance irq and GICH, GICV spaces Yang Xiwen via B4 Relay
2024-02-18 12:02 ` [PATCH v2 1/3] arm64: dts: hi3798cv200: fix the size of GICR Yang Xiwen via B4 Relay
2024-02-18 12:02 ` [PATCH v2 2/3] arm64: dts: hi3798cv200: add GICH, GICV register space and irq Yang Xiwen via B4 Relay
2024-02-18 12:02 ` [PATCH v2 3/3] arm64: dts: hi3798cv200: add cache info Yang Xiwen via B4 Relay
2024-02-19 7:20 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox