From cb6e77f0d40c3aac19c199e3c90b0db139019e62 Mon Sep 17 00:00:00 2001 From: Lee Lup Yuen Date: Sat, 28 Oct 2023 21:00:49 +0800 Subject: [PATCH] Update doc --- README.md | 10 +++ bl808-pine64-ox64.dtb | Bin 0 -> 4012 bytes bl808-pine64-ox64.dts | 190 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 200 insertions(+) create mode 100755 bl808-pine64-ox64.dtb create mode 100644 bl808-pine64-ox64.dts diff --git a/README.md b/README.md index c469b66..36a62f8 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,16 @@ Thus we simply reuse the code from NuttX Star64! TODO: Dump the Device Tree +```text +dtc \ + -o bl808-pine64-ox64.dts \ + -O dts \ + -I dtb \ + bl808-pine64-ox64.dtb +``` + +Here's the Decompiled Device Tree: [bl808-pine64-ox64.dts](bl808-pine64-ox64.dts) + TODO: Transmit to UART3. Reuse the BL602 UART Driver for NuttX. TODO: Print Debug Logs with OpenSBI diff --git a/bl808-pine64-ox64.dtb b/bl808-pine64-ox64.dtb new file mode 100755 index 0000000000000000000000000000000000000000..eb8629b2034537981395a92056c1558b7702f059 GIT binary patch literal 4012 zcma)9y>A>v6rVjvNFY%l0)nV6GC~x$@g{MMgRpWA0)!mNmO%m`!LheH=UcKL$L^kU zjwphJsF0wbL87GKt4c+I5Jeg~=txHa5<-GMAO-OIz1caB?MuQ)vor5w-h1=jn>VvR z9sTDorH*~0lv+~iXdB~G=ntVkh>q6!P^lw-nE9@+*Fg7RJi+-W$@Stwr^kr)nIOyBZorvY z%RQ-jsKdAuoevgOnN-mhacEZd1?Y3(RiW+E?zMh@}U%dN$QBnt;|G{w`O-=W`!?j?Dx%W^!b{iw+6vPe^1 z3a62AjB_I!JM_W5BZs6L=yp%k$7bQ1n7c8f&V%SJr+bq+O#LXm3>+KRGM;LXOmqxF z5edo4{Ik`6on*oX&~I@)5oisMchrCumc4S%)azC8(5kzut^?oxLQz)tEv$9mnR;lG z(Njd0SNu{X*(lY1zsX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-ox64.dts b/bl808-pine64-ox64.dts new file mode 100644 index 0000000..f6987c1 --- /dev/null +++ b/bl808-pine64-ox64.dts @@ -0,0 +1,190 @@ +/dts-v1/; + +/ { + compatible = "pine64,ox64\0bflb,bl808"; + #address-cells = <0x01>; + #size-cells = <0x01>; + model = "Pine64 Ox64"; + + cpus { + timebase-frequency = <0xf4240>; + #address-cells = <0x01>; + #size-cells = <0x00>; + + cpu@0 { + compatible = "thead,c906\0riscv"; + device_type = "cpu"; + reg = <0x00>; + d-cache-block-size = <0x40>; + d-cache-sets = <0x100>; + d-cache-size = <0x8000>; + i-cache-block-size = <0x40>; + i-cache-sets = <0x80>; + i-cache-size = <0x8000>; + mmu-type = "riscv,sv39"; + riscv,isa = "rv64imafdc"; + phandle = <0x07>; + + interrupt-controller { + compatible = "riscv,cpu-intc"; + interrupt-controller; + #address-cells = <0x00>; + #interrupt-cells = <0x01>; + phandle = <0x06>; + }; + }; + }; + + xtal-clk { + compatible = "fixed-clock"; + clock-frequency = <0x2625a00>; + clock-output-names = "xtal"; + #clock-cells = <0x00>; + phandle = <0x04>; + }; + + sdh-clk { + compatible = "fixed-clock"; + clock-frequency = <0x5b8d800>; + clock-output-names = "sdh"; + #clock-cells = <0x00>; + phandle = <0x05>; + }; + + soc { + compatible = "simple-bus"; + ranges; + interrupt-parent = <0x01>; + dma-noncoherent; + #address-cells = <0x01>; + #size-cells = <0x01>; + + pinctrl@0x200008C4 { + compatible = "bflb,pinctrl"; + reg = <0x200008c4 0x1000>; + gpio-controller; + #gpio-cells = <0x02>; + gpio-ranges = <0x02 0x00 0x00 0x2e>; + bflb,npins = <0x2e>; + status = "okay"; + interrupt-controller; + #interrupt-cells = <0x02>; + interrupts-extended = <0x03 0x00 0x04 0x01>; + phandle = <0x02>; + + sdh-pins { + pins = "GPIO0\0GPIO1\0GPIO2\0GPIO3\0GPIO4\0GPIO5"; + function = "sdh"; + phandle = <0x08>; + }; + }; + + seceng@0x20004000 { + compatible = "bflb,seceng"; + reg = <0x20004000 0x1000>; + status = "okay"; + phandle = <0x09>; + }; + + serial@30002000 { + compatible = "bflb,bl808-uart"; + reg = <0x30002000 0x1000>; + interrupts = <0x14 0x04>; + clocks = <0x04>; + status = "okay"; + phandle = <0x0a>; + }; + + serial@0x2000AA00 { + compatible = "bflb,bl808-uart"; + reg = <0x2000aa00 0x100>; + interrupts-extended = <0x03 0x00 0x01 0x01>; + mboxes = <0x03 0x00 0x01>; + clocks = <0x04>; + status = "okay"; + phandle = <0x0b>; + }; + + sdhci@20060000 { + compatible = "bflb,bl808-sdhci"; + reg = <0x20060000 0x100>; + interrupts-extended = <0x03 0x00 0x00 0x01>; + mboxes = <0x03 0x00 0x00>; + clocks = <0x05>; + status = "okay"; + phandle = <0x0c>; + }; + + mailbox@30005000 { + compatible = "bflb,bl808-ipc"; + reg = <0x30005000 0x20 0x30005020 0x20 0x2000a800 0x20 0x2000a820 0x20>; + interrupts = <0x36 0x04>; + interrupt-controller; + #interrupt-cells = <0x03>; + #mbox-cells = <0x02>; + status = "okay"; + phandle = <0x03>; + }; + + interrupt-controller@e0000000 { + compatible = "thead,c900-plic"; + reg = <0xe0000000 0x4000000>; + interrupts-extended = <0x06 0xffffffff 0x06 0x09>; + interrupt-controller; + #address-cells = <0x00>; + #interrupt-cells = <0x02>; + riscv,ndev = <0x40>; + phandle = <0x01>; + }; + + timer@e4000000 { + compatible = "thead,c900-clint"; + reg = <0xe4000000 0xc000>; + interrupts-extended = <0x06 0x03 0x06 0x07>; + phandle = <0x0d>; + }; + }; + + aliases { + serial0 = "/soc/serial@30002000"; + serial1 = "/soc/serial@0x2000AA00"; + }; + + chosen { + stdout-path = "serial0:2000000n8"; + bootargs = "console=ttyS0,2000000 loglevel=8 earlycon=sbi root=PARTLABEL=rootfs rootwait rootfstype=ext4"; + linux,initrd-start = <0x00 0x52000000>; + linux,initrd-end = <0x00 0x52941784>; + }; + + memory@50000000 { + device_type = "memory"; + reg = <0x50000000 0x4000000>; + }; + + xip_flash@58500000 { + compatible = "mtd-rom"; + reg = <0x58500000 0x400000>; + linux,mtd-name = "xip-flash.0"; + erase-size = <0x10000>; + bank-width = <0x04>; + #address-cells = <0x01>; + #size-cells = <0x01>; + }; + + __symbols__ { + cpu0 = "/cpus/cpu@0"; + cpu0_intc = "/cpus/cpu@0/interrupt-controller"; + xtal = "/xtal-clk"; + sdh = "/sdh-clk"; + pinctrl = "/soc/pinctrl@0x200008C4"; + sdh_pins = "/soc/pinctrl@0x200008C4/sdh-pins"; + seceng = "/soc/seceng@0x20004000"; + uart0 = "/soc/serial@30002000"; + uart1 = "/soc/serial@0x2000AA00"; + sdhci0 = "/soc/sdhci@20060000"; + ipclic = "/soc/mailbox@30005000"; + plic = "/soc/interrupt-controller@e0000000"; + clint = "/soc/timer@e4000000"; + }; +};