lib/utils: Support the official clint DT bindings
PATCH 1/3 lib/utils: Support the official clint DT bindings
Linux kernel commit a2770b57d083 ("dt-bindings: timer: Add CLINT bindings") adds the official DT bindings for CLINT, which uses "sifive,clint0" as the compatible string. "riscv,clint0" is now legacy and has to be kept for backward compatibility of legacy systems.
---
lib/utils/ipi/fdt_ipi_clint.c | 1 + lib/utils/timer/fdt_timer_clint.c | 1 + 2 files changed, 2 insertions(+)
lib/utils/ipi/fdt_ipi_clint.c +1 -0
@@ -36,6 +36,7 @@ static int ipi_clint_cold_init(void *fdt, int nodeoff,static const struct fdt_match ipi_clint_match[] = { { .compatible ="riscv,clint0" }, + { .compatible ="sifive,clint0" }, { }, };
lib/utils/timer/fdt_timer_clint.c +1 -0
@@ -38,6 +38,7 @@ static int timer_clint_cold_init(void *fdt, int nodeoff,static const struct fdt_match timer_clint_match[] = { { .compatible ="riscv,clint0" }, + { .compatible ="sifive,clint0" }, { }, };
Signature · 1 line
2.25.1
PATCH 2/3 lib/utils: Drop the 'compat' parameter of fdt_plic_fixup()
At present fdt_plic_fixup() accepts a 'compat' parameter for PLIC compatible string. In preparation to support the new DT bindings, drop this and use "riscv,plic0" directly in fdt_plic_fixup().
---
include/sbi_utils/fdt/fdt_fixup.h | 3 +-- lib/utils/fdt/fdt_fixup.c | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-)
include/sbi_utils/fdt/fdt_fixup.h +1 -2
@@ -30,9 +30,8 @@ void fdt_cpu_fixup(void *fdt);* It is recommended that platform codes call this helper in their final_init() * * @param fdt: device tree blob -* @param compat: PLIC node compatible string */ -void fdt_plic_fixup (void *fdt,const char *compat); +void fdt_plic_fixup (void *fdt);/** * Fix up the reserved memory node in the device tree
lib/utils/fdt/fdt_fixup.c +3 -3
@@ -51,13 +51,13 @@ void fdt_cpu_fixup(void *fdt) } } -void fdt_plic_fixup (void *fdt,const char *compat) +void fdt_plic_fixup (void *fdt) {u32 *cells;int i, cells_count;int plic_off; - plic_off =fdt_node_offset_by_compatible (fdt,0 , compat); + plic_off =fdt_node_offset_by_compatible (fdt,0 ,"riscv,plic0" );if (plic_off <0 )return ;
@@ -257,7 +257,7 @@ int fdt_reserved_memory_nomap_fixup(void *fdt)void fdt_fixups (void *fdt) { -fdt_plic_fixup (fdt,"riscv,plic0" ); +fdt_plic_fixup (fdt);fdt_reserved_memory_fixup (fdt); }
Signature · 1 line
2.25.1
PATCH 2/3 lib/utils: Drop the 'compat' parameter of fdt_plic_fixup()
Quoted 11 lines
-----Original Message-----
From: opensbi <[email protected]> On Behalf Of Bin Meng
Sent: 27 March 2021 10:35
To: opensbi at lists.infradead.org
Cc: Bin Meng <[email protected]>
Subject: [PATCH 2/3] lib/utils: Drop the 'compat' parameter offdt_plic_fixup()
Quoted 5 lines
At present
fdt_plic_fixup()accepts a 'compat' parameter for PLIC compatible string. In preparation to support the new DT bindings, drop this and use "riscv,plic0" directly infdt_plic_fixup().Signed-off-by Bin Meng <[email protected]>
Looks good to me.
Regards,
Anup
Quoted 59 lines
---
include/sbi_utils/fdt/fdt_fixup.h | 3 +-- lib/utils/fdt/fdt_fixup.c | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-)include/sbi_utils/fdt/fdt_fixup.h +1
-2@@ -30,9 +30,8 @@ void fdt_cpu_fixup(void *fdt);* It is recommended that platform codes call this helper in their final_init() * * @param fdt: device tree blob -* @param compat: PLIC node compatible string */ -void fdt_plic_fixup (void *fdt,const char *compat); +void fdt_plic_fixup (void *fdt);/** * Fix up the reserved memory node in the device tree diff --git
a/lib/utils/fdt/fdt_fixup.cb/lib/utils/fdt/fdt_fixup.cindex eea450d..a306ff5 100644lib/utils/fdt/fdt_fixup.c +3
-4@@ -51,13 +51,13 @@ void fdt_cpu_fixup(void *fdt) } } -void fdt_plic_fixup (void *fdt,const char *compat) +void fdt_plic_fixup (void *fdt) {u32 *cells;int i, cells_count;int plic_off; - plic_off =fdt_node_offset_by_compatible (fdt,0 , compat); + plic_off =fdt_node_offset_by_compatible (fdt,0 ,"riscv,plic0" );if (plic_off <0 )return ;@@ -257,7 +257,7 @@ int fdt_reserved_memory_nomap_fixup(void *fdt)void fdt_fixups (void *fdt) { -fdt_plic_fixup (fdt,"riscv,plic0" ); +fdt_plic_fixup (fdt);fdt_reserved_memory_fixup (fdt); } --2.25.1
--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
Anup Patel
AppliedPATCH 2/3 lib/utils: Drop the 'compat' parameter of fdt_plic_fixup()
Quoted 24 lines
-----Original Message-----
From: Anup Patel
Sent: 31 March 2021 10:25
To: Bin Meng <[email protected]>; opensbi at lists.infradead.org
Subject: RE: [PATCH 2/3] lib/utils: Drop the 'compat' parameter offdt_plic_fixup()Quoted 13 lines
-----Original Message-----
From: opensbi <[email protected]> On Behalf Of Bin Meng
Sent: 27 March 2021 10:35
To: opensbi at lists.infradead.org
Cc: Bin Meng <[email protected]>
Subject: [PATCH 2/3] lib/utils: Drop the 'compat' parameter offdt_plic_fixup()At present
fdt_plic_fixup()accepts a 'compat' parameter for PLIC compatible string. In preparation to support the new DT bindings, drop this and use "riscv,plic0" directly infdt_plic_fixup().
Quoted 5 lines
Quoted 1 line
Signed-off-by Bin Meng <[email protected]>Looks good to me.
Reviewed-by Anup Patel <[email protected]>
Applied this patch to the riscv/opensbi repo.
Thanks,
Anup
Quoted 64 lines
Regards,
AnupQuoted 60 lines
---
include/sbi_utils/fdt/fdt_fixup.h | 3 +-- lib/utils/fdt/fdt_fixup.c | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-)include/sbi_utils/fdt/fdt_fixup.h +1
-2@@ -30,9 +30,8 @@ void fdt_cpu_fixup(void *fdt);* It is recommended that platform codes call this helper in their final_init() * * @param fdt: device tree blob -* @param compat: PLIC node compatible string */ -void fdt_plic_fixup (void *fdt,const char *compat); +void fdt_plic_fixup (void *fdt);/** * Fix up the reserved memory node in the device tree diff --git
a/lib/utils/fdt/fdt_fixup.cb/lib/utils/fdt/fdt_fixup.cindex eea450d..a306ff5
100644lib/utils/fdt/fdt_fixup.c +3
-4@@ -51,13 +51,13 @@ void fdt_cpu_fixup(void *fdt) } } -void fdt_plic_fixup (void *fdt,const char *compat) +void fdt_plic_fixup (void *fdt) {u32 *cells;int i, cells_count;int plic_off; - plic_off =fdt_node_offset_by_compatible (fdt,0 , compat); + plic_off =fdt_node_offset_by_compatible (fdt,0 ,"riscv,plic0" );if (plic_off <0 )return ;@@ -257,7 +257,7 @@ int fdt_reserved_memory_nomap_fixup(void *fdt)void fdt_fixups (void *fdt) { -fdt_plic_fixup (fdt,"riscv,plic0" ); +fdt_plic_fixup (fdt);fdt_reserved_memory_fixup (fdt); } --2.25.1
--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
PATCH 3/3 lib/utils: Support fixing up the official DT bindings of PLIC
In reply to Bin MengCurrent fdt_plic_fixup() only does necessary fix-up against the legacy "riscv,plic0" node. The upstream Linux kernel defines its official DT bindings which uses "sifive,plic-1.0.0" as the compatible string and we should check that first, and if not present fall back to legacy.
---
lib/utils/fdt/fdt_fixup.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
lib/utils/fdt/fdt_fixup.c +6 -3
@@ -57,9 +57,12 @@ void fdt_plic_fixup(void *fdt)int i, cells_count;int plic_off; - plic_off =fdt_node_offset_by_compatible (fdt,0 ,"riscv,plic0" ); -if (plic_off <0 ) -return ; + plic_off =fdt_node_offset_by_compatible (fdt,0 ,"sifive,plic-1.0.0" ); +if (plic_off <0 ) { + plic_off =fdt_node_offset_by_compatible (fdt,0 ,"riscv,plic0" ); +if (plic_off <0 ) +return ; + } cells = (u32 *)fdt_getprop (fdt, plic_off,"interrupts-extended" , &cells_count);
Signature · 1 line
2.25.1
PATCH 3/3 lib/utils: Support fixing up the official DT bindings of PLIC
Quoted 11 lines
-----Original Message-----
From: opensbi <[email protected]> On Behalf Of Bin Meng
Sent: 27 March 2021 10:35
To: opensbi at lists.infradead.org
Cc: Bin Meng <[email protected]>
Subject: [PATCH 3/3] lib/utils: Support fixing up the official DT bindings of PLIC
Quoted 6 lines
Current
fdt_plic_fixup()only does necessary fix-up against the legacy "riscv,plic0" node. The upstream Linux kernel defines its official DT bindings which uses "sifive,plic-1.0.0" as the compatible string and we should check that first, and if not present fall back to legacy.Signed-off-by Bin Meng <[email protected]>
Looks good to me.
Regards,
Anup
Quoted 34 lines
---
lib/utils/fdt/fdt_fixup.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)lib/utils/fdt/fdt_fixup.c index renamed from lib/utils/fdt/fdt_fixup.c +0
-0a306ff5..1465500 100644
lib/utils/fdt/fdt_fixup.c +6
-3@@ -57,9 +57,12 @@ void fdt_plic_fixup(void *fdt)int i, cells_count;int plic_off; - plic_off =fdt_node_offset_by_compatible (fdt,0 ,"riscv,plic0" ); -if (plic_off <0 ) -return ; + plic_off =fdt_node_offset_by_compatible (fdt,0 ,"sifive,plic-1.0.0" ); +if (plic_off <0 ) { + plic_off =fdt_node_offset_by_compatible (fdt,0 ,"riscv,plic0" ); +if (plic_off <0 ) +return ; + } cells = (u32 *)fdt_getprop(fdt, plic_off,"interrupts-extended",
&cells_count);
--
2.25.1--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
Anup Patel
AppliedPATCH 3/3 lib/utils: Support fixing up the official DT bindings of PLIC
Quoted 25 lines
-----Original Message-----
From: Anup Patel
Sent: 31 March 2021 10:26
To: Bin Meng <[email protected]>; opensbi at lists.infradead.org
Subject: RE: [PATCH 3/3] lib/utils: Support fixing up the official DT bindings of PLICQuoted 14 lines
-----Original Message-----
From: opensbi <[email protected]> On Behalf Of Bin Meng
Sent: 27 March 2021 10:35
To: opensbi at lists.infradead.org
Cc: Bin Meng <[email protected]>
Subject: [PATCH 3/3] lib/utils: Support fixing up the official DT bindings of PLICCurrent
fdt_plic_fixup()only does necessary fix-up against the legacy "riscv,plic0" node. The upstream Linux kernel defines its official DT bindings which uses "sifive,plic-1.0.0" as the compatible string and we should check that first, and if not present fall back to legacy.
Quoted 5 lines
Quoted 1 line
Signed-off-by Bin Meng <[email protected]>Looks good to me.
Reviewed-by Anup Patel <[email protected]>
Applied this patch to the riscv/opensbi repo.
Thanks,
Anup
Quoted 39 lines
Regards,
AnupQuoted 35 lines
---
lib/utils/fdt/fdt_fixup.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)lib/utils/fdt/fdt_fixup.c +0
-0index
a306ff5..1465500 100644lib/utils/fdt/fdt_fixup.c +6
-3@@ -57,9 +57,12 @@ void fdt_plic_fixup(void *fdt)int i, cells_count;int plic_off; - plic_off =fdt_node_offset_by_compatible (fdt,0 ,"riscv,plic0" ); -if (plic_off <0 ) -return ; + plic_off =fdt_node_offset_by_compatible (fdt,0 ,"sifive,plic-1.0.0" ); +if (plic_off <0 ) { + plic_off =fdt_node_offset_by_compatible (fdt,0 ,"riscv,plic0" ); +if (plic_off <0 ) +return ; + } cells = (u32 *)fdt_getprop(fdt, plic_off,"interrupts-extended",
&cells_count);
--
2.25.1--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
PATCH 1/3 lib/utils: Support the official clint DT bindings
In reply to Bin MengQuoted 10 lines
-----Original Message-----
From: opensbi <[email protected]> On Behalf Of Bin Meng
Sent: 27 March 2021 10:35
To: opensbi at lists.infradead.org
Cc: Bin Meng <[email protected]>
Subject: [PATCH 1/3] lib/utils: Support the official clint DT bindings
Quoted 6 lines
Linux kernel commit
a2770b57d083("dt-bindings: timer: Add CLINT bindings") adds the official DT bindings for CLINT, which uses "sifive,clint0" as the compatible string. "riscv,clint0" is now legacy and has to be kept for backward compatibility of legacy systems.Signed-off-by Bin Meng <[email protected]>
Looks good to me.
Regards,
Anup
Quoted 38 lines
---
lib/utils/ipi/fdt_ipi_clint.c | 1 + lib/utils/timer/fdt_timer_clint.c | 1 + 2 files changed, 2 insertions(+)lib/utils/ipi/fdt_ipi_clint.c index renamed from lib/utils/ipi/fdt_ipi_clint.c +0
-0e992440..e799fd7 100644
lib/utils/ipi/fdt_ipi_clint.c +1
-0@@ -36,6 +36,7 @@ static int ipi_clint_cold_init(void *fdt, int nodeoff,static const struct fdt_match ipi_clint_match[] = { { .compatible ="riscv,clint0" }, + { .compatible ="sifive,clint0" }, { }, };lib/utils/timer/fdt_timer_clint.c +1
-1@@ -38,6 +38,7 @@ static int timer_clint_cold_init(void *fdt, int nodeoff,static const struct fdt_match timer_clint_match[] = { { .compatible ="riscv,clint0" }, + { .compatible ="sifive,clint0" }, { }, }; --2.25.1
--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
Anup Patel
AppliedPATCH 1/3 lib/utils: Support the official clint DT bindings
Quoted 23 lines
-----Original Message-----
From: Anup Patel
Sent: 31 March 2021 10:23
To: 'Bin Meng' <[email protected]>; opensbi at lists.infradead.org
Subject: RE: [PATCH 1/3] lib/utils: Support the official clint DT bindingsQuoted 13 lines
-----Original Message-----
From: opensbi <[email protected]> On Behalf Of Bin Meng
Sent: 27 March 2021 10:35
To: opensbi at lists.infradead.org
Cc: Bin Meng <[email protected]>
Subject: [PATCH 1/3] lib/utils: Support the official clint DT bindingsLinux kernel commit
a2770b57d083("dt-bindings: timer: Add CLINT bindings") adds the official DT bindings for CLINT, which uses "sifive,clint0" as the compatible string. "riscv,clint0" is now legacy and has to be kept for backward compatibility of legacy systems.
Quoted 5 lines
Quoted 1 line
Signed-off-by Bin Meng <[email protected]>Looks good to me.
Reviewed-by Anup Patel <[email protected]>
Applied this patch to the riscv/opensbi repo.
Thanks,
Anup
Quoted 46 lines
Regards,
AnupQuoted 42 lines
---
lib/utils/ipi/fdt_ipi_clint.c | 1 + lib/utils/timer/fdt_timer_clint.c | 1 + 2 files changed, 2 insertions(+)(quoted diff) +0
-0
b/lib/utils/ipi/fdt_ipi_clint.cindex
e992440..e799fd7 100644lib/utils/ipi/fdt_ipi_clint.c +1
-0@@ -36,6 +36,7 @@ static int ipi_clint_cold_init(void *fdt, int nodeoff, static const struct fdt_match ipi_clint_match[] = { { .compatible ="riscv,clint0" }, + { .compatible ="sifive,clint0" }, { }, };lib/utils/timer/fdt_timer_clint.c +1
-1@@ -38,6 +38,7 @@ static int timer_clint_cold_init(void *fdt, int nodeoff, static const struct fdt_match timer_clint_match[] = { { .compatible ="riscv,clint0" }, + { .compatible ="sifive,clint0" }, { }, }; --2.25.1
--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi