Skip to content

Commit c454f61

Browse files
committed
conf/evalsoc: update clint node of dts and opensbi to reduce PMP entries for clint region.
Signed-off-by: guibing <guibing@nucleisys.com>
1 parent 838cac4 commit c454f61

5 files changed

Lines changed: 19 additions & 4 deletions

File tree

conf/evalsoc/nuclei_rv32imac.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@
481481
clint0: clint@18031000 {
482482
#interrupt-cells = <1>;
483483
compatible = "riscv,clint0";
484-
reg = <0x0 0x18031000 0x0 0xC000>;
484+
reg = <0x0 0x18031000 0x0 0x10000>;
485485
interrupts-extended =
486486
<&cpu0_intc 3 &cpu0_intc 7
487487
&cpu1_intc 3 &cpu1_intc 7

conf/evalsoc/nuclei_rv32imafdc.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@
481481
clint0: clint@18031000 {
482482
#interrupt-cells = <1>;
483483
compatible = "riscv,clint0";
484-
reg = <0x0 0x18031000 0x0 0xC000>;
484+
reg = <0x0 0x18031000 0x0 0x10000>;
485485
interrupts-extended =
486486
<&cpu0_intc 3 &cpu0_intc 7
487487
&cpu1_intc 3 &cpu1_intc 7

conf/evalsoc/nuclei_rv64imac.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@
462462
clint0: clint@18031000 {
463463
#interrupt-cells = <1>;
464464
compatible = "riscv,clint0";
465-
reg = <0x0 0x18031000 0x0 0xC000>;
465+
reg = <0x0 0x18031000 0x0 0x10000>;
466466
interrupts-extended =
467467
<&cpu0_intc 3 &cpu0_intc 7
468468
&cpu1_intc 3 &cpu1_intc 7

conf/evalsoc/nuclei_rv64imafdc.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@
462462
clint0: clint@18031000 {
463463
#interrupt-cells = <1>;
464464
compatible = "riscv,clint0";
465-
reg = <0x0 0x18031000 0x0 0xC000>;
465+
reg = <0x0 0x18031000 0x0 0x10000>;
466466
interrupts-extended =
467467
<&cpu0_intc 3 &cpu0_intc 7
468468
&cpu1_intc 3 &cpu1_intc 7

conf/evalsoc/opensbi/evalsoc.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <sbi_utils/fdt/fdt_helper.h>
1313
#include <sbi_utils/fdt/fdt_fixup.h>
1414

15+
extern unsigned long clint_offset_quirk;
1516
static const struct fdt_match nuclei_evalsoc_match[] = {
1617
{ .compatible = "nuclei,evalsoc" },
1718
{ .compatible = "nuclei,eval-soc" },
@@ -48,7 +49,21 @@ static int nuclei_evalsoc_final_init(bool cold_boot,
4849
return 0;
4950
}
5051

52+
static int nuclei_evalsoc_early_init(bool cold_boot,
53+
const struct fdt_match *match)
54+
{
55+
/*
56+
* The NUCLEI CLINT address is not aligned to 0x10000 boundary, which would require
57+
* additional PMP entries to configure permissions for the CLINT region.
58+
* the clint_offset_quirk var to fixup this issue.
59+
*/
60+
clint_offset_quirk = 0x1000;
61+
62+
return 0;
63+
}
64+
5165
const struct platform_override nuclei_evalsoc = {
5266
.match_table = nuclei_evalsoc_match,
67+
.early_init = nuclei_evalsoc_early_init,
5368
.final_init = nuclei_evalsoc_final_init,
5469
};

0 commit comments

Comments
 (0)