Skip to contentSkip to conversation

Change the sg2042 timer layout to fit aclint format

PATCH In review Inochi Amaoto 4 participants 11 messages Dec 4, 2023 – Jan 22, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v5 cover Change the sg2042 timer layout to fit aclint format

As the sg2042 uses different address for timer and mswi of its clint device, it should follow the aclint format. For the previous patchs, it only use only one address for both mtime and mtimer, this is can not be parsed by OpenSBI. To resolve this, separate these two registers in the dtb.

This patch can be tested with upstream SBI with the following patch:
1. https://lists.infradead.org/pipermail/opensbi/2023-November/005926.html

Changed from v4:
1. left T-HEAD aclint register in the bindings only.
2. improve the bindings commit message.

Changed from v3:
1. add all register in the bindings

Changed from v2:
1. Use reg-names to map the registers.

Changed from v1:
1. change the commit to address the reason for ABI change.
2. remove unnecessary link in the commit.

Inochi Amaoto (2):
dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and
mtimecmp regs
riscv: dts: sophgo: separate sg2042 mtime and mtimecmp to fit aclint
format

 .../timer/thead,c900-aclint-mtimer.yaml       |  9 ++-
 arch/riscv/boot/dts/sophgo/sg2042.dtsi        | 80 +++++++++++--------
 2 files changed, 56 insertions(+), 33 deletions(-)

--
2.43.0

#1 lore raw

PATCH v5 1/2 dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs

The timer registers of aclint don't follow the clint layout and can be mapped on any different offset. As sg2042 uses separated timer and mswi for its clint, it should follow the aclint spec and have separated registers.

The previous patch introduced a new type of T-HEAD aclint timer which has clint timer layout. Although it has the clint timer layout, it should follow the aclint spec and uses the separated mtime and mtimecmp regs. So a ABI change is needed to make the timer fit the aclint spec.

To make T-HEAD aclint timer more closer to the aclint spec, use regs-names to represent the mtimecmp register, which can avoid hack for unsupport mtime register of T-HEAD aclint timer.

Also, as T-HEAD aclint only supports mtimecmp, it is unnecessary to implement the whole aclint spec. To make this binding T-HEAD specific, only add reg-name for existed register. For details, see the discussion in the last link.

---
 .../bindings/timer/thead,c900-aclint-mtimer.yaml         | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml +8 -1
index fbd235650e52..2e92bcdeb423 100644
@@ -17,7 +17,12 @@ properties:
       - const: thead,c900-aclint-mtimer
 
   reg:
-    maxItems: 1
+    items:
+      - description: MTIMECMP Registers
+
+  reg-names:
+    items:
+      - const: mtimecmp
 
   interrupts-extended:
     minItems: 1
@@ -28,6 +33,7 @@ additionalProperties: false
 required:
   - compatible
   - reg
+  - reg-names
   - interrupts-extended
 
 examples:
@@ -39,5 +45,6 @@ examples:
                             <&cpu3intc 7>,
                             <&cpu4intc 7>;
       reg = <0xac000000 0x00010000>;
+      reg-names = "mtimecmp";
     };
 ...

--
2.43.0

Acked-by on v5 1/2
#2 lore raw

Re: [PATCH v5 1/2] dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs

Quoted 63 lines · Inochi Amaoto

The timer registers of aclint don't follow the clint layout and can be mapped on any different offset. As sg2042 uses separated timer and mswi for its clint, it should follow the aclint spec and have separated registers.

The previous patch introduced a new type of T-HEAD aclint timer which has clint timer layout. Although it has the clint timer layout, it should follow the aclint spec and uses the separated mtime and mtimecmp regs. So a ABI change is needed to make the timer fit the aclint spec.

To make T-HEAD aclint timer more closer to the aclint spec, use regs-names to represent the mtimecmp register, which can avoid hack for unsupport mtime register of T-HEAD aclint timer.

Also, as T-HEAD aclint only supports mtimecmp, it is unnecessary to implement the whole aclint spec. To make this binding T-HEAD specific, only add reg-name for existed register. For details, see the discussion in the last link.

---
 .../bindings/timer/thead,c900-aclint-mtimer.yaml         | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/timer/thead,c900-aclint-mtimer.yaml +8 -2
index fbd235650e52..2e92bcdeb423 100644
@@ -17,7 +17,12 @@ properties:
       - const: thead,c900-aclint-mtimer
 
   reg:
-    maxItems: 1
+    items:
+      - description: MTIMECMP Registers
+
+  reg-names:
+    items:
+      - const: mtimecmp
 
   interrupts-extended:
     minItems: 1
@@ -28,6 +33,7 @@ additionalProperties: false
 required:
   - compatible
   - reg
+  - reg-names
   - interrupts-extended
 
 examples:
@@ -39,5 +45,6 @@ examples:
                             <&cpu3intc 7>,
                             <&cpu4intc 7>;
       reg = <0xac000000 0x00010000>;
+      reg-names = "mtimecmp";
     };
...
--
Quoted 2 lines

2.43.0

Signature · 2 lines
Best Regards
 Guo Ren
Acked-by on v5 1/2
#3 lore raw

Re: [PATCH v5 1/2] dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs

In reply to Inochi Amaoto
Quoted 19 lines · Inochi Amaoto

The timer registers of aclint don't follow the clint layout and can be mapped on any different offset. As sg2042 uses separated timer and mswi for its clint, it should follow the aclint spec and have separated registers.

The previous patch introduced a new type of T-HEAD aclint timer which has clint timer layout. Although it has the clint timer layout, it should follow the aclint spec and uses the separated mtime and mtimecmp regs. So a ABI change is needed to make the timer fit the aclint spec.

To make T-HEAD aclint timer more closer to the aclint spec, use regs-names to represent the mtimecmp register, which can avoid hack for unsupport mtime register of T-HEAD aclint timer.

Also, as T-HEAD aclint only supports mtimecmp, it is unnecessary to implement the whole aclint spec. To make this binding T-HEAD specific, only add reg-name for existed register. For details, see the discussion in the last link.

Quoted 5 lines

Although, I figure it is going to be me that ends up taking it.

Cheers,
Conor.

#4 lore raw

Re: [PATCH v5 1/2] dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs

Quoted 26 lines · Conor Dooley
Quoted 19 lines · Inochi Amaoto

The timer registers of aclint don't follow the clint layout and can be mapped on any different offset. As sg2042 uses separated timer and mswi for its clint, it should follow the aclint spec and have separated registers.

The previous patch introduced a new type of T-HEAD aclint timer which has clint timer layout. Although it has the clint timer layout, it should follow the aclint spec and uses the separated mtime and mtimecmp regs. So a ABI change is needed to make the timer fit the aclint spec.

To make T-HEAD aclint timer more closer to the aclint spec, use regs-names to represent the mtimecmp register, which can avoid hack for unsupport mtime register of T-HEAD aclint timer.

Also, as T-HEAD aclint only supports mtimecmp, it is unnecessary to implement the whole aclint spec. To make this binding T-HEAD specific, only add reg-name for existed register. For details, see the discussion in the last link.

Quoted 5 lines
Quoted 3 lines

Although, I figure it is going to be me that ends up taking it.

No, I should take it

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#5 lore raw

Re: [PATCH v5 1/2] dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs

Quoted 27 lines · Daniel Lezcano
Quoted 26 lines · Conor Dooley
Quoted 24 lines · Inochi Amaoto

The timer registers of aclint don't follow the clint layout and can be mapped on any different offset. As sg2042 uses separated timer and mswi for its clint, it should follow the aclint spec and have separated registers.

The previous patch introduced a new type of T-HEAD aclint timer which has clint timer layout. Although it has the clint timer layout, it should follow the aclint spec and uses the separated mtime and mtimecmp regs. So a ABI change is needed to make the timer fit the aclint spec.

To make T-HEAD aclint timer more closer to the aclint spec, use regs-names to represent the mtimecmp register, which can avoid hack for unsupport mtime register of T-HEAD aclint timer.

Also, as T-HEAD aclint only supports mtimecmp, it is unnecessary to implement the whole aclint spec. To make this binding T-HEAD specific, only add reg-name for existed register. For details, see the discussion in the last link.

Quoted 5 lines
Quoted 3 lines

Although, I figure it is going to be me that ends up taking it.

No, I should take it

Sweet, I'd rather you took it than it went via a DT tree :)

#6 lore raw

Re: [PATCH v5 1/2] dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs

Quoted 28 lines · Daniel Lezcano
Quoted 27 lines · Conor Dooley
Quoted 26 lines · Inochi Amaoto
Quoted 24 lines

The timer registers of aclint don't follow the clint layout and can be mapped on any different offset. As sg2042 uses separated timer and mswi for its clint, it should follow the aclint spec and have separated registers.

The previous patch introduced a new type of T-HEAD aclint timer which has clint timer layout. Although it has the clint timer layout, it should follow the aclint spec and uses the separated mtime and mtimecmp regs. So a ABI change is needed to make the timer fit the aclint spec.

To make T-HEAD aclint timer more closer to the aclint spec, use regs-names to represent the mtimecmp register, which can avoid hack for unsupport mtime register of T-HEAD aclint timer.

Also, as T-HEAD aclint only supports mtimecmp, it is unnecessary to implement the whole aclint spec. To make this binding T-HEAD specific, only add reg-name for existed register. For details, see the discussion in the last link.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Although, I figure it is going to be me that ends up taking it.

No, I should take it

Sweet, I'd rather you took it than it went via a DT tree :)

Thanks you both for taking this. This is good news for me.

#7 lore raw

Re: [PATCH v5 1/2] dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs

In reply to Inochi Amaoto
Quoted 19 lines · Inochi Amaoto

The timer registers of aclint don't follow the clint layout and can be mapped on any different offset. As sg2042 uses separated timer and mswi for its clint, it should follow the aclint spec and have separated registers.

The previous patch introduced a new type of T-HEAD aclint timer which has clint timer layout. Although it has the clint timer layout, it should follow the aclint spec and uses the separated mtime and mtimecmp regs. So a ABI change is needed to make the timer fit the aclint spec.

To make T-HEAD aclint timer more closer to the aclint spec, use regs-names to represent the mtimecmp register, which can avoid hack for unsupport mtime register of T-HEAD aclint timer.

Also, as T-HEAD aclint only supports mtimecmp, it is unnecessary to implement the whole aclint spec. To make this binding T-HEAD specific, only add reg-name for existed register. For details, see the discussion in the last link.

Quoted 6 lines

---

Applied 1/2, thanks

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
#8 lore raw

PATCH v5 2/2 riscv: dts: sophgo: separate sg2042 mtime and mtimecmp to fit aclint format

In reply to Inochi Amaoto

Change the timer layout in the dtb to fit the format that needed by the SBI.

Fixes 967a94a92aaa ("riscv: dts: add initial Sophgo SG2042 SoC device tree")
---
 arch/riscv/boot/dts/sophgo/sg2042.dtsi | 80 +++++++++++++++-----------
 1 file changed, 48 insertions(+), 32 deletions(-)
arch/riscv/boot/dts/sophgo/sg2042.dtsi +48 -32
index 93256540d078..ead1cc35d88b 100644
@@ -93,144 +93,160 @@ clint_mswi: interrupt-controller@7094000000 {
 					      <&cpu63_intc 3>;
 		};
 
-		clint_mtimer0: timer@70ac000000 {
+		clint_mtimer0: timer@70ac004000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac000000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac004000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu0_intc 7>,
 					      <&cpu1_intc 7>,
 					      <&cpu2_intc 7>,
 					      <&cpu3_intc 7>;
 		};
 
-		clint_mtimer1: timer@70ac010000 {
+		clint_mtimer1: timer@70ac014000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac010000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac014000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu4_intc 7>,
 					      <&cpu5_intc 7>,
 					      <&cpu6_intc 7>,
 					      <&cpu7_intc 7>;
 		};
 
-		clint_mtimer2: timer@70ac020000 {
+		clint_mtimer2: timer@70ac024000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac020000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac024000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu8_intc 7>,
 					      <&cpu9_intc 7>,
 					      <&cpu10_intc 7>,
 					      <&cpu11_intc 7>;
 		};
 
-		clint_mtimer3: timer@70ac030000 {
+		clint_mtimer3: timer@70ac034000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac030000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac034000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu12_intc 7>,
 					      <&cpu13_intc 7>,
 					      <&cpu14_intc 7>,
 					      <&cpu15_intc 7>;
 		};
 
-		clint_mtimer4: timer@70ac040000 {
+		clint_mtimer4: timer@70ac044000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac040000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac044000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu16_intc 7>,
 					      <&cpu17_intc 7>,
 					      <&cpu18_intc 7>,
 					      <&cpu19_intc 7>;
 		};
 
-		clint_mtimer5: timer@70ac050000 {
+		clint_mtimer5: timer@70ac054000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac050000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac054000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu20_intc 7>,
 					      <&cpu21_intc 7>,
 					      <&cpu22_intc 7>,
 					      <&cpu23_intc 7>;
 		};
 
-		clint_mtimer6: timer@70ac060000 {
+		clint_mtimer6: timer@70ac064000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac060000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac064000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu24_intc 7>,
 					      <&cpu25_intc 7>,
 					      <&cpu26_intc 7>,
 					      <&cpu27_intc 7>;
 		};
 
-		clint_mtimer7: timer@70ac070000 {
+		clint_mtimer7: timer@70ac074000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac070000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac074000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu28_intc 7>,
 					      <&cpu29_intc 7>,
 					      <&cpu30_intc 7>,
 					      <&cpu31_intc 7>;
 		};
 
-		clint_mtimer8: timer@70ac080000 {
+		clint_mtimer8: timer@70ac084000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac080000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac084000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu32_intc 7>,
 					      <&cpu33_intc 7>,
 					      <&cpu34_intc 7>,
 					      <&cpu35_intc 7>;
 		};
 
-		clint_mtimer9: timer@70ac090000 {
+		clint_mtimer9: timer@70ac094000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac090000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac094000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu36_intc 7>,
 					      <&cpu37_intc 7>,
 					      <&cpu38_intc 7>,
 					      <&cpu39_intc 7>;
 		};
 
-		clint_mtimer10: timer@70ac0a0000 {
+		clint_mtimer10: timer@70ac0a4000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac0a0000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac0a4000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu40_intc 7>,
 					      <&cpu41_intc 7>,
 					      <&cpu42_intc 7>,
 					      <&cpu43_intc 7>;
 		};
 
-		clint_mtimer11: timer@70ac0b0000 {
+		clint_mtimer11: timer@70ac0b4000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac0b0000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac0b4000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu44_intc 7>,
 					      <&cpu45_intc 7>,
 					      <&cpu46_intc 7>,
 					      <&cpu47_intc 7>;
 		};
 
-		clint_mtimer12: timer@70ac0c0000 {
+		clint_mtimer12: timer@70ac0c4000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac0c0000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac0c4000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu48_intc 7>,
 					      <&cpu49_intc 7>,
 					      <&cpu50_intc 7>,
 					      <&cpu51_intc 7>;
 		};
 
-		clint_mtimer13: timer@70ac0d0000 {
+		clint_mtimer13: timer@70ac0d4000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac0d0000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac0d4000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu52_intc 7>,
 					      <&cpu53_intc 7>,
 					      <&cpu54_intc 7>,
 					      <&cpu55_intc 7>;
 		};
 
-		clint_mtimer14: timer@70ac0e0000 {
+		clint_mtimer14: timer@70ac0e4000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac0e0000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac0e4000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu56_intc 7>,
 					      <&cpu57_intc 7>,
 					      <&cpu58_intc 7>,
 					      <&cpu59_intc 7>;
 		};
 
-		clint_mtimer15: timer@70ac0f0000 {
+		clint_mtimer15: timer@70ac0f4000 {
 			compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-			reg = <0x00000070 0xac0f0000 0x00000000 0x00007ff8>;
+			reg = <0x00000070 0xac0f4000 0x00000000 0x0000c000>;
+			reg-names = "mtimecmp";
 			interrupts-extended = <&cpu60_intc 7>,
 					      <&cpu61_intc 7>,
 					      <&cpu62_intc 7>,

--
2.43.0

Reviewed-by on v5 2/2
#9 lore raw

Re: [PATCH v5 2/2] riscv: dts: sophgo: separate sg2042 mtime and mtimecmp to fit aclint format

Quoted 209 lines · Inochi Amaoto

Change the timer layout in the dtb to fit the format that needed by the SBI.

Fixes 967a94a92aaa ("riscv: dts: add initial Sophgo SG2042 SoC device tree")
---
 arch/riscv/boot/dts/sophgo/sg2042.dtsi | 80 +++++++++++++++-----------
 1 file changed, 48 insertions(+), 32 deletions(-)
arch/riscv/boot/dts/sophgo/sg2042.dtsi +48 -33
index 93256540d078..ead1cc35d88b 100644
@@ -93,144 +93,160 @@ clint_mswi: interrupt-controller@7094000000 {
                                              <&cpu63_intc 3>;
                };
 
-               clint_mtimer0: timer@70ac000000 {
+               clint_mtimer0: timer@70ac004000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac000000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac004000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu0_intc 7>,
                                              <&cpu1_intc 7>,
                                              <&cpu2_intc 7>,
                                              <&cpu3_intc 7>;
                };
 
-               clint_mtimer1: timer@70ac010000 {
+               clint_mtimer1: timer@70ac014000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac010000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac014000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu4_intc 7>,
                                              <&cpu5_intc 7>,
                                              <&cpu6_intc 7>,
                                              <&cpu7_intc 7>;
                };
 
-               clint_mtimer2: timer@70ac020000 {
+               clint_mtimer2: timer@70ac024000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac020000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac024000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu8_intc 7>,
                                              <&cpu9_intc 7>,
                                              <&cpu10_intc 7>,
                                              <&cpu11_intc 7>;
                };
 
-               clint_mtimer3: timer@70ac030000 {
+               clint_mtimer3: timer@70ac034000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac030000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac034000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu12_intc 7>,
                                              <&cpu13_intc 7>,
                                              <&cpu14_intc 7>,
                                              <&cpu15_intc 7>;
                };
 
-               clint_mtimer4: timer@70ac040000 {
+               clint_mtimer4: timer@70ac044000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac040000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac044000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu16_intc 7>,
                                              <&cpu17_intc 7>,
                                              <&cpu18_intc 7>,
                                              <&cpu19_intc 7>;
                };
 
-               clint_mtimer5: timer@70ac050000 {
+               clint_mtimer5: timer@70ac054000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac050000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac054000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu20_intc 7>,
                                              <&cpu21_intc 7>,
                                              <&cpu22_intc 7>,
                                              <&cpu23_intc 7>;
                };
 
-               clint_mtimer6: timer@70ac060000 {
+               clint_mtimer6: timer@70ac064000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac060000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac064000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu24_intc 7>,
                                              <&cpu25_intc 7>,
                                              <&cpu26_intc 7>,
                                              <&cpu27_intc 7>;
                };
 
-               clint_mtimer7: timer@70ac070000 {
+               clint_mtimer7: timer@70ac074000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac070000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac074000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu28_intc 7>,
                                              <&cpu29_intc 7>,
                                              <&cpu30_intc 7>,
                                              <&cpu31_intc 7>;
                };
 
-               clint_mtimer8: timer@70ac080000 {
+               clint_mtimer8: timer@70ac084000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac080000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac084000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu32_intc 7>,
                                              <&cpu33_intc 7>,
                                              <&cpu34_intc 7>,
                                              <&cpu35_intc 7>;
                };
 
-               clint_mtimer9: timer@70ac090000 {
+               clint_mtimer9: timer@70ac094000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac090000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac094000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu36_intc 7>,
                                              <&cpu37_intc 7>,
                                              <&cpu38_intc 7>,
                                              <&cpu39_intc 7>;
                };
 
-               clint_mtimer10: timer@70ac0a0000 {
+               clint_mtimer10: timer@70ac0a4000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac0a0000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac0a4000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu40_intc 7>,
                                              <&cpu41_intc 7>,
                                              <&cpu42_intc 7>,
                                              <&cpu43_intc 7>;
                };
 
-               clint_mtimer11: timer@70ac0b0000 {
+               clint_mtimer11: timer@70ac0b4000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac0b0000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac0b4000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu44_intc 7>,
                                              <&cpu45_intc 7>,
                                              <&cpu46_intc 7>,
                                              <&cpu47_intc 7>;
                };
 
-               clint_mtimer12: timer@70ac0c0000 {
+               clint_mtimer12: timer@70ac0c4000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac0c0000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac0c4000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu48_intc 7>,
                                              <&cpu49_intc 7>,
                                              <&cpu50_intc 7>,
                                              <&cpu51_intc 7>;
                };
 
-               clint_mtimer13: timer@70ac0d0000 {
+               clint_mtimer13: timer@70ac0d4000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac0d0000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac0d4000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu52_intc 7>,
                                              <&cpu53_intc 7>,
                                              <&cpu54_intc 7>,
                                              <&cpu55_intc 7>;
                };
 
-               clint_mtimer14: timer@70ac0e0000 {
+               clint_mtimer14: timer@70ac0e4000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac0e0000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac0e4000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu56_intc 7>,
                                              <&cpu57_intc 7>,
                                              <&cpu58_intc 7>,
                                              <&cpu59_intc 7>;
                };
 
-               clint_mtimer15: timer@70ac0f0000 {
+               clint_mtimer15: timer@70ac0f4000 {
                        compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer";
-                       reg = <0x00000070 0xac0f0000 0x00000000 0x00007ff8>;
+                       reg = <0x00000070 0xac0f4000 0x00000000 0x0000c000>;
+                       reg-names = "mtimecmp";
                        interrupts-extended = <&cpu60_intc 7>,
                                              <&cpu61_intc 7>,
                                              <&cpu62_intc 7>,
--
Quoted 2 lines

2.43.0

Signature · 2 lines
Best Regards
 Guo Ren
#10 lore raw

Re: [PATCH v5 2/2] riscv: dts: sophgo: separate sg2042 mtime and mtimecmp to fit aclint format

In reply to Inochi Amaoto

Hi Conor,

I have already noticed the binding is merged. But the dt patch is not, I wonder if it is the time to merge this dt change?

Regards,
Inochi