
/dts-v1/;

/ {
    #address-cells = <1>;
    #size-cells    = <1>;

    chosen {
        bootargs = "console=hvc0 earlycon=sbi root=/dev/mmcblk0p2 rootfstype=ext4 rw swiotlb=noforce rootwait rcupdate.rcu_cpu_stall_timeout=2";
    };

    sys_clk: pll {
        compatible = "fixed-clock";
        #clock-cells = <0>;
        clock-frequency  = <100000000>;
    };

    cpus {
        #address-cells = <1>;
        #size-cells    = <0>;
        timebase-frequency = <100000000>;

        CPU0: cpu@0 {
            device_type = "cpu";
            compatible = "riscv";
            riscv,isa = "rv64imafdc";
            mmu-type = "riscv,sv39";
            reg = <0>;
            clock-frequency = <100000000>;
            status = "okay";


            L0: interrupt-controller {
                #address-cells = <0>;
                #interrupt-cells = <0x00000001>;
                interrupt-controller;
                compatible = "riscv,cpu-intc";
            };
        };

        CPU1: cpu@1 {
            device_type = "cpu";
            compatible = "riscv";
            riscv,isa = "rv64imafdc";
            mmu-type = "riscv,sv39";
            reg = <1>;
            clock-frequency = <100000000>;
            status = "okay";


            L1: interrupt-controller {
                #address-cells = <0>;
                #interrupt-cells = <0x00000001>;
                interrupt-controller;
                compatible = "riscv,cpu-intc";
            };
        };

        cpu-map {
            cluster0 {
                core0 {
                    cpu = <&CPU0>;
                };
                core1 {
                    cpu = <&CPU1>;
                };
            };
        };
    };

    memory@41000000 {
        device_type = "memory";
        reg = <0x41000000 0x1F000000>;
    };

    reserved-memory {
        #address-cells = <1>;
        #size-cells    = <1>;
        ranges;

        opensbi@40f00000 {
            reg = <0x40f00000 0x80000>;
        };

        framebuffer@40c00000 {
            reg = <0x40c00000 0x1d4c00>;
        };

    };

    vreg_mmc: vreg_mmc {
        compatible = "regulator-fixed";
        regulator-name = "vreg_mmc";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
        regulator-always-on;
    };

    soc {
        #address-cells = <1>;
        #size-cells    = <1>;
        compatible = "simple-bus";
        interrupt-parent = <&intc0>;
        ranges;

        soc_ctrl0: soc_controller@f0000000 {
            compatible = "litex,soc-controller";
            reg = <0xf0000000 0xc>;
            status = "okay";
        };

        intc0: interrupt-controller@f0c00000 {
            compatible = "sifive,fu540-c000-plic", "sifive,plic-1.0.0";
            reg = <0xf0c00000 0x400000>;
            #address-cells = <0>;
            #interrupt-cells = <1>;
            interrupt-controller;
            interrupts-extended = <
                &L0 11 &L0 9
                &L1 11 &L1 9>;
            riscv,ndev = <32>;
        };

        mac0: mac@f0002000 {
            compatible = "litex,liteeth";
            reg = <0xf0002000 0x7c>,
                  <0xf0002800 0x0a>,
                  <0x80000000 0x2000>;
            reg-names = "mac", "mdio", "buffer";
            litex,rx-slots = <2>;
            litex,tx-slots = <2>;
            litex,slot-size = <2048>;
            interrupts = <3>;
            status = "okay";
        };

        mmc0: mmc@f0007000 {
            compatible = "litex,mmc";
            reg = <0xf0007000 0x100>,
                  <0xf0005800 0x100>,
                  <0xf0005000 0x100>,
                  <0xf0006800 0x100>,
                  <0xf0006000 0x100>;
            reg-names = "phy", "core", "reader", "writer", "irq";
            clocks = <&sys_clk>;
            vmmc-supply = <&vreg_mmc>;
            bus-width = <0x04>;
            interrupts = <4>;
            status = "okay";
        };

        leds: gpio@f0003800 {
            compatible = "litex,gpio";
            reg = <0xf0003800 0x4>;
            gpio-controller;
            #gpio-cells = <2>;
            litex,direction = "out";
            status = "disabled";
        };

        framebuffer0: framebuffer@40c00000 {
            compatible = "simple-framebuffer";
            reg = <0x40c00000 0x1d4c00>;
            width = <800>;
            height = <600>;
            stride = <3200>;
            format = "a8b8g8r8";
        };
    };
};
