kendryte / k230_sdk

Kendryte K230 SDK
BSD 2-Clause "Simplified" License
165 stars 35 forks source link

[help]: about PLIC and CLINT #28

Closed yf13 closed 9 months ago

yf13 commented 10 months ago

Help

Can you teach how many PLIC and CLINT instances in the k230 SoC? how are these instances related to the CPUs?

The k230-datasheet.md says that each CPU integrates with PLIC and doesn't mention CLINT.

wangjianxin-canaan commented 10 months ago

linux dts have clint and plic config:

src/little/linux/arch/riscv/boot/dts/kendryte/k230.dtsi:

    clint0: clint@f04000000 {
        compatible = "riscv,clint0";
        interrupts-extended = <
            &cpu0_intc  3 &cpu0_intc  7
            >;
        reg = <0xf 0x04000000 0x0 0x04000000>;
        clint,has-no-64bit-mmio;
    };

    intc: interrupt-controller@f00000000 {
        #interrupt-cells = <1>;
        compatible = "riscv,plic0";
        interrupt-controller;
        interrupts-extended = <
            &cpu0_intc  0xffffffff &cpu0_intc  9
            >;
        reg = <0xf 0x00000000 0x0 0x04000000>;
        reg-names = "control";
        riscv,max-priority = <7>;
        riscv,ndev = <200>;
    };
yf13 commented 10 months ago

@wangjianxin-canaan, I saw above Linux DTS before raising the question.

Does CPU1 also use CLINT and PLIC? If so , are the PLIC and CLINT instances shared between two CPUs?

wangjianxin-canaan commented 10 months ago

@wangjianxin-canaan, I saw above Linux DTS before raising the question.

Does CPU1 also use CLINT and PLIC? If so , are the PLIC and CLINT instances shared between two CPUs? both cpu0 and cpu1 have independent PLIC and CLINT。

yf13 commented 10 months ago

@wangjianxin-canaan thanks for teaching.

Let's use CLINTx and PLICx to depict controllers for CPU x , x can be 0 or 1 in K230 SoC .

The above DTS fragment shows the addresses for CLIC0 and PLIC0. Can I ask if the addresses of CLINT1 and PLIC1 are also at 0xf04000000 and 0xf00000000 respectively? if not, please teach their addresses. If yes, then how can they be independent if they are having same addresses?

wangjianxin-canaan commented 10 months ago

@wangjianxin-canaan thanks for teaching.

Let's use CLINTx and PLICx to depict controllers for CPU x , x can be 0 or 1 in K230 SoC .

The above DTS fragment shows the addresses for CLIC0 and PLIC0. Can I ask if the addresses of CLINT1 and PLIC1 are also at 0xf04000000 and 0xf00000000 respectively? if not, please teach their addresses. If yes, then how can they be independent if they are having same addresses?

yes,CLINT1 and PLIC1 are also at 0xf04000000 and 0xf00000000. this address are local address. linux can run cor1.

yf13 commented 9 months ago

@wangjianxin-canaan Thanks for the clarifications! can you teach if there is any other devices also use such local addresses?

wangjianxin-canaan commented 9 months ago

@wangjianxin-canaan Thanks for the clarifications! can you teach if there is any other devices also use such local addresses? No other devices have local addresses。