页次: 1
buildroot上游已经支持了D1 Nezha开发板,我为Lichee RV Dock做了如下适配开发:
A.uboot、opensbi使用了上游linux-sunxi社区的d1-wip分支,参见https://linux-sunxi.org/Allwinner_Nezha
B.linux kernel使用了上周日(2022年1月9日)release的linux-5.16 + linux-sunxi社区的d1-wip分 支合并而成
C.为Lichee RV CM和其Dock添加了dts文件
D.buildroot添加了Lichee RV的board/相应目录和configs/目录下相应的defconfig文件
这样做的好处是,紧跟上游,代码清晰,关键软件部件几乎最新。
0.host上安装用于buildroot的必要软件包
此过程略,可自行搜索解决
1.获取代码:
git clone https://gitee.com/xhackerustc/buildroot.git -b d1-wip
2.用buildroot编译用于licheepi rv的img:
cd buildroot
make licheepi_rv_defconfig
make menuconfig //上游buildroot默认uclibc且最小化编译,riscv平台俺建议用glibc,软件包方 面这一步选一些需要的软件包
make
3.编译完成后在output/images/sdcard.img就是要烧入sdcard的img
sudo dd if=output/images/sdcard.img of=/dev/sdX
目前sdcard,sdio、usb host、user按键、wdt都能工作。
注1:因使用的是mainline的linux内核,sipeed wiki中的RGB LED WS2812 进行花式点灯需要改下:
点红灯:
echo 88 > /sys/class/leds/rgb\:indicator/brightness;echo 255 0 0 > /sys/class/leds/rgb\:indicator/multi_intensity
接着上面点绿灯:
echo 0 255 0 > /sys/class/leds/rgb\:indicator/multi_intensity
点蓝灯以此类推。
注2:此系统镜像也适用于只有Lichee RV核心模块的用户,当然usb host、RGB LED肯定不能用的,所以最好启动后修改/boot/extlinux/extlinux.conf文件,把其中的:
devicetree /boot/sun20i-d1-licheepi-rv-dock.dtb
换成
devicetree /boot/sun20i-d1-licheepi-rv.dtb
这两dtb文件镜像都自带了
上电后串口log如下:从此log可以看到opensbi升级到了0.9版本,uboot升级到了uboot-2022.01-rc1, linuxe内核是最新的linux-5.16
[180]HELLO! BOOT0 is starting!
[183]BOOT0 commit : 2b5f7ce292
[186]set pll start
[188]periph0 has been enabled
[191]set pll end
[192]board init ok
[194]DRAM only have internal ZQ!!
[197]get_pmu_exist() = -1
[200]ddr_efuse_type: 0x0
[203][AUTO DEBUG] single rank and full DQ!
[207]ddr_efuse_type: 0x0
[210][AUTO DEBUG] rank 0 row = 15
[213][AUTO DEBUG] rank 0 bank = 8
[216][AUTO DEBUG] rank 0 page size = 2 KB
[220]DRAM BOOT DRIVE INFO: V0.24
[223]DRAM CLK = 792 MHz
[225]DRAM Type = 3 (2:DDR2,3:DDR3)
[229]DRAMC ZQ value: 0x7b7bfb
[231]DRAM ODT value: 0x42.
[234]ddr_efuse_type: 0x0
[237]DRAM SIZE =512 M
[241]DRAM simple test OK.
[243]dram size =512
[245]card no is 0
[246]sdcard 0 line count 4
[249][mmc]: mmc driver ver 2021-04-2 16:45
[258][mmc]: Wrong media type 0x0
[261][mmc]: ***Try SD card 0***
[270][mmc]: HSSDR52/SDR25 4 bit
[273][mmc]: 50000000 Hz
[275][mmc]: 14840 MB
[277][mmc]: ***SD/MMC 0 init OK!!!***
[312]Loading boot-pkg Succeed(index=0).
[315]Entry_name = opensbi
[318]Entry_name = dtb
[321]Entry_name = u-boot
[324]Jump to second Boot.
OpenSBI v0.9
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|
Platform Name : Lichee Pi RV
Platform Features : medeleg
Platform HART Count : 1
Platform IPI Device : aclint-mswi
Platform Timer Device : aclint-mtimer @ 24000000Hz
Platform Console Device : uart8250
Platform HSM Device : ---
Platform Reboot Device : sunxi-wdt-reset
Platform Shutdown Device : ---
Firmware Base : 0x40000000
Firmware Size : 252 KB
Runtime SBI Version : 0.3
Domain0 Name : root
Domain0 Boot HART : 0
Domain0 HARTs : 0*
Domain0 Region00 : 0x0000000014008000-0x000000001400bfff (I)
Domain0 Region01 : 0x0000000014000000-0x0000000014007fff (I)
Domain0 Region02 : 0x0000000040000000-0x000000004003ffff ()
Domain0 Region03 : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address : 0x000000004a000000
Domain0 Next Arg1 : 0x0000000044000000
Domain0 Next Mode : S-mode
Domain0 SysReset : yes
Boot HART ID : 0
Boot HART Domain : root
Boot HART ISA : rv64imafdcvsux
Boot HART Features : scounteren,mcounteren,mcountinhibit,time
Boot HART PMP Count : 16
Boot HART PMP Granularity : 2048
Boot HART PMP Address Bits: 38
Boot HART MHPM Count : 0
Boot HART MIDELEG : 0x0000000000000222
Boot HART MEDELEG : 0x000000000000b109
U-Boot 2022.01-rc1 (Jan 15 2022 - 21:41:55 +0800)
DRAM: 512 MiB
WDT: Started watchdog@6011000 with servicing (16s timeout)
MMC: mmc@4020000: 0
Loading Environment from nowhere... OK
In: serial@2500000
Out: serial@2500000
Err: serial@2500000
Net: No ethernet found.
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
145 bytes read in 3 ms (46.9 KiB/s)
1: linux
Retrieving file: /boot/Image
15516984 bytes read in 1420 ms (10.4 MiB/s)
append: console=ttyS0,115200 root=/dev/mmcblk0p1 ro rootwait
Retrieving file: /boot/sun20i-d1-licheepi-rv-dock.dtb
22655 bytes read in 7 ms (3.1 MiB/s)
## Flattened Device Tree blob at 4fa00000
Booting using the fdt blob at 0x4fa00000
Loading Device Tree to 0000000049ff7000, end 0000000049fff87e ... OK
Starting kernel ...
[ 0.000000] Linux version 5.16.0 (zjs@xhacker) (riscv64-buildroot-linux-gnu-gcc.br_real
(Buildroot 2021.11-912-g2b5f7ce292) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 PREEMPT Sat Ja
n 15 21:22:13 CST 2022
[ 0.000000] OF: fdt: Ignoring memory range 0x40000000 - 0x40200000
[ 0.000000] Machine model: Lichee Pi RV Dock
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000040200000-0x000000005fffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000040200000-0x000000005fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000040200000-0x000000005fffffff]
[ 0.000000] SBI specification v0.3 detected
[ 0.000000] SBI implementation ID=0x1 Version=0x9
[ 0.000000] SBI TIME extension detected
[ 0.000000] SBI IPI extension detected
[ 0.000000] SBI RFENCE extension detected
[ 0.000000] SBI SRST extension detected
[ 0.000000] riscv: ISA extensions acdfim
[ 0.000000] riscv: ELF capabilities acdfim
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 128775
[ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p1 ro rootwait
[ 0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 497736K/522240K available (5976K kernel code, 4845K rwdata, 2048K r
odata, 2116K init, 268K bss, 24504K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] Trampoline variant of Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] OF: of_irq_init: found /cpus/cpu@0/interrupt-controller with parent (null)
[ 0.000000] OF: of_irq_init: found /soc/interrupt-controller@6010000 with parent /soc/i
nterrupt-controller@10000000
[ 0.000000] OF: of_irq_init: found /soc/interrupt-controller@10000000 with parent /cpus
/cpu@0/interrupt-controller
[ 0.000000] OF: of_irq_init: init /cpus/cpu@0/interrupt-controller with parent (null)
[ 0.000000] riscv-intc: 64 local interrupts mapped
[ 0.000000] OF: of_irq_init: init /soc/interrupt-controller@10000000 with parent /cpus/
cpu@0/interrupt-controller
[ 0.000000] plic: interrupt-controller@10000000: mapped 176 interrupts with 1 handlers
for 2 contexts.
[ 0.000000] OF: of_irq_init: init /soc/interrupt-controller@6010000 with parent /soc/in
terrupt-controller@10000000
[ 0.000000] riscv-sbi-ipi: registered IPI domain
[ 0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x588f
e9dc0, max_idle_ns: 440795202592 ns
[ 0.000000] sched_clock: 64 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000370] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7
9635851949 ns
[ 0.000767] Calibrating delay loop (skipped), value calculated using timer frequency..
48.00 BogoMIPS (lpj=96000)
[ 0.000802] pid_max: default: 32768 minimum: 301
[ 0.000954] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[ 0.000982] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[ 0.002861] ASID allocator using 16 bits (65536 entries)
[ 0.003036] rcu: Hierarchical SRCU implementation.
[ 0.003610] devtmpfs: initialized
[ 0.012486] random: get_random_bytes called from net_ns_init+0x9c/0x39c with crng_init=
0
[ 0.013129] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns:
7645041785100000 ns
[ 0.013173] futex hash table entries: 256 (order: 0, 6144 bytes, linear)
[ 0.013273] pinctrl core: initialized pinctrl subsystem
[ 0.014412] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 0.016901] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[ 0.017008] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[ 0.017518] thermal_sys: Registered thermal governor 'bang_bang'
[ 0.017533] thermal_sys: Registered thermal governor 'step_wise'
[ 0.017546] thermal_sys: Registered thermal governor 'user_space'
[ 0.043741] platform 7090000.rtc: Fixing up cyclic dependency with 7010000.clock-contro
ller
[ 0.058903] iommu: Default domain type: Translated
[ 0.058926] iommu: DMA domain TLB invalidation policy: strict mode
[ 0.059218] SCSI subsystem initialized
[ 0.059523] usbcore: registered new interface driver usbfs
[ 0.059601] usbcore: registered new interface driver hub
[ 0.059679] usbcore: registered new device driver usb
[ 0.060327] Advanced Linux Sound Architecture Driver Initialized.
[ 0.061505] clocksource: Switched to clocksource riscv_clocksource
[ 0.063718] NET: Registered PF_INET protocol family
[ 0.063944] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 0.065406] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, lin
ear)
[ 0.065472] TCP established hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.065590] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.065647] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.065781] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.065834] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.066039] NET: Registered PF_UNIX/PF_LOCAL protocol family
[ 0.067191] workingset: timestamp_bits=62 max_order=17 bucket_order=0
[ 0.075545] NET: Registered PF_ALG protocol family
[ 0.103933] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
[ 0.110296] libphy: Fixed MDIO Bus: probed
[ 0.111525] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.111546] ehci-platform: EHCI generic platform driver
[ 0.111825] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.111867] ohci-platform: OHCI generic platform driver
[ 0.112377] usbcore: registered new interface driver uas
[ 0.112454] usbcore: registered new interface driver usb-storage
[ 0.112607] usbcore: registered new interface driver ch341
[ 0.112677] usbserial: USB Serial support registered for ch341-uart
[ 0.113201] UDC core: couldn't find an available UDC - added [g_ether] to list of pendi
ng drivers
[ 0.113567] i2c_dev: i2c /dev entries driver
[ 0.115105] sunxi-wdt 6011000.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 0.116641] ledtrig-cpu: registered to indicate activity on CPUs
[ 0.116986] sun8i-ce 3040000.crypto: Set mod clock to 300000000 (300 Mhz) from 40000000
0 (400 Mhz)
[ 0.117331] sun8i-ce 3040000.crypto: will run requests pump with realtime priority
[ 0.117633] sun8i-ce 3040000.crypto: will run requests pump with realtime priority
[ 0.117850] sun8i-ce 3040000.crypto: will run requests pump with realtime priority
[ 0.118082] sun8i-ce 3040000.crypto: will run requests pump with realtime priority
[ 0.118225] sun8i-ce 3040000.crypto: Register cbc(aes)
[ 0.118269] sun8i-ce 3040000.crypto: Register ecb(aes)
[ 0.118290] sun8i-ce 3040000.crypto: Register cbc(des3_ede)
[ 0.118309] sun8i-ce 3040000.crypto: Register ecb(des3_ede)
[ 0.118330] sun8i-ce 3040000.crypto: Register md5
[ 0.118358] sun8i-ce 3040000.crypto: Register sha1
[ 0.118382] sun8i-ce 3040000.crypto: Register sha224
[ 0.118403] sun8i-ce 3040000.crypto: Register sha256
[ 0.118425] sun8i-ce 3040000.crypto: Register sha384
[ 0.118446] sun8i-ce 3040000.crypto: Register sha512
[ 0.118469] sun8i-ce 3040000.crypto: Register stdrng
[ 0.118980] sun8i-ce 3040000.crypto: CryptoEngine Die ID 0
[ 0.121640] usbcore: registered new interface driver snd-usb-audio
[ 0.124071] NET: Registered PF_INET6 protocol family
[ 0.125211] random: fast init done
[ 0.125816] Segment Routing with IPv6
[ 0.125881] In-situ OAM (IOAM) with IPv6
[ 0.125993] NET: Registered PF_PACKET protocol family
[ 0.126193] random: crng init done
[ 0.153435] phy phy-4100400.phy.0: Changing dr_mode to 1
[ 1.185654] ehci-platform 4101000.usb: EHCI Host Controller
[ 1.185717] ehci-platform 4101000.usb: new USB bus registered, assigned bus number 1
[ 1.185933] ehci-platform 4101000.usb: irq 102, io mem 0x04101000
[ 1.201565] ehci-platform 4101000.usb: USB 2.0 started, EHCI 1.00
[ 1.201872] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5
.16
[ 1.201900] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.201914] usb usb1: Product: EHCI Host Controller
[ 1.201925] usb usb1: Manufacturer: Linux 5.16.0 ehci_hcd
[ 1.201936] usb usb1: SerialNumber: 4101000.usb
[ 1.202775] hub 1-0:1.0: USB hub found
[ 1.202854] hub 1-0:1.0: 1 port detected
[ 1.204142] ehci-platform 4200000.usb: EHCI Host Controller
[ 1.204200] ehci-platform 4200000.usb: new USB bus registered, assigned bus number 2
[ 1.204432] ehci-platform 4200000.usb: irq 104, io mem 0x04200000
[ 1.217539] ehci-platform 4200000.usb: USB 2.0 started, EHCI 1.00
[ 1.217829] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5
.16
[ 1.217857] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.217871] usb usb2: Product: EHCI Host Controller
[ 1.217882] usb usb2: Manufacturer: Linux 5.16.0 ehci_hcd
[ 1.217894] usb usb2: SerialNumber: 4200000.usb
[ 1.218734] hub 2-0:1.0: USB hub found
[ 1.218812] hub 2-0:1.0: 1 port detected
[ 1.220067] ohci-platform 4101400.usb: Generic Platform OHCI controller
[ 1.220149] ohci-platform 4101400.usb: new USB bus registered, assigned bus number 3
[ 1.220334] ohci-platform 4101400.usb: irq 103, io mem 0x04101400
[ 1.281780] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 5
.16
[ 1.281809] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.281823] usb usb3: Product: Generic Platform OHCI controller
[ 1.281835] usb usb3: Manufacturer: Linux 5.16.0 ohci_hcd
[ 1.281846] usb usb3: SerialNumber: 4101400.usb
[ 1.282653] hub 3-0:1.0: USB hub found
[ 1.282731] hub 3-0:1.0: 1 port detected
[ 1.283984] ohci-platform 4200400.usb: Generic Platform OHCI controller
[ 1.284040] ohci-platform 4200400.usb: new USB bus registered, assigned bus number 4
[ 1.284209] ohci-platform 4200400.usb: irq 105, io mem 0x04200400
[ 1.345922] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 5
.16
[ 1.345951] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.345966] usb usb4: Product: Generic Platform OHCI controller
[ 1.345977] usb usb4: Manufacturer: Linux 5.16.0 ohci_hcd
[ 1.345989] usb usb4: SerialNumber: 4200400.usb
[ 1.346830] hub 4-0:1.0: USB hub found
[ 1.346910] hub 4-0:1.0: 1 port detected
[ 1.425648] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.425708] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 5
[ 1.425971] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5
.16
[ 1.425998] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.426012] usb usb5: Product: MUSB HDRC host driver
[ 1.426023] usb usb5: Manufacturer: Linux 5.16.0 musb-hcd
[ 1.426035] usb usb5: SerialNumber: musb-hdrc.1.auto
[ 1.426873] hub 5-0:1.0: USB hub found
[ 1.426952] hub 5-0:1.0: 1 port detected
[ 1.427921] using random self ethernet address
[ 1.427948] using random host ethernet address
[ 1.428786] usb0: HOST MAC ea:07:2d:f3:e4:5b
[ 1.428813] usb0: MAC ba:72:0c:85:0d:47
[ 1.428859] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[ 1.428902] g_ether gadget: g_ether ready
[ 1.434535] sun8i-dsp-rproc 1700000.dsp: error -ENOENT: Failed to get cfg reset
[ 1.434568] sun8i-dsp-rproc: probe of 1700000.dsp failed with error -2
[ 1.434601] remoteproc remoteproc0: releasing 1700000.dsp
[ 1.436335] sun20i-codec 2030000.audio-codec: ASoC: Adding component 2030000.audio-code
c for platform /soc/audio-codec@2030000
[ 1.436378] sun20i-codec 2030000.audio-codec: ASoC: Adding component 2030000.audio-code
c for platform /soc/audio-codec@2030000
[ 1.457136] sun20i-d1-pinctrl 2000000.pinctrl: initialized sunXi PIO driver
[ 1.459115] printk: console [ttyS0] disabled
[ 1.479476] usb 2-1: new high-speed USB device number 2 using ehci-platform
[ 1.479692] 2500000.serial: ttyS0 at MMIO 0x2500000 (irq = 88, base_baud = 1500000) is
a 16550A
[ 1.726360] usb 3-1: new low-speed USB device number 2 using ohci-platform
[ 1.726495] usb 2-1: New USB device found, idVendor=0781, idProduct=5151, bcdDevice= 2.
00
[ 1.726512] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1.726521] usb 2-1: Product: Cruzer Micro
[ 1.726528] usb 2-1: Manufacturer: SanDisk
[ 1.726535] usb 2-1: SerialNumber: 224283058B41E171
[ 1.732230] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 1.740111] scsi host0: usb-storage 2-1:1.0
[ 1.954074] usb 3-1: device descriptor read/64, error -62
[ 2.305172] usb 3-1: device descriptor read/64, error -62
[ 2.604098] usb 3-1: new low-speed USB device number 3 using ohci-platform
[ 2.688040] printk: console [ttyS0] enabled
[ 2.714182] 2500400.serial: ttyS1 at MMIO 0x2500400 (irq = 89, base_baud = 1500000) is
a 16550A
[ 2.724439] input: 2009800.keys as /devices/platform/soc/2009800.keys/input/input0
[ 2.735181] sun50i-r329-ledc 2008000.led-controller: Registered 1 LEDs
[ 2.745012] ALSA device list:
[ 2.749200] #0: sun20i-codec
[ 2.752547] sunxi-mmc 4020000.mmc: Got CD GPIO
[ 2.758209] scsi 0:0:0:0: Direct-Access SanDisk Cruzer 7.01 PQ: 0 ANSI:
0 CCS
[ 2.766779] sunxi-mmc 4021000.mmc: allocated mmc-pwrseq
[ 2.774279] scsi 0:0:0:0: Attached scsi generic sg0 type 0
[ 2.781051] sd 0:0:0:0: [sda] 3973119 512-byte logical blocks: (2.03 GB/1.89 GiB)
[ 2.789587] sd 0:0:0:0: [sda] Write Protect is off
[ 2.795173] sd 0:0:0:0: [sda] No Caching mode page found
[ 2.800646] sunxi-mmc 4021000.mmc: initialized, max. request size: 2047 KB, uses new ti
mings mode
[ 2.809739] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 2.815945] usb 3-1: device descriptor read/64, error -62
[ 2.821622] sunxi-mmc 4020000.mmc: initialized, max. request size: 2047 KB, uses new ti
mings mode
[ 2.830550] acked 134 in 0x000002b4, was 0x00000040, now 0x00000000
[ 2.842697] sunxi-mmc 4021000.mmc: card claims to support voltages below defined range
[ 2.853827] sda: sda1
[ 2.859702] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 2.865418] Waiting for root device /dev/mmcblk0p1...
[ 2.884717] mmc1: new high speed SDIO card at address 0001
[ 2.907813] mmc0: new high speed SDHC card at address 0007
[ 2.914281] mmcblk0: mmc0:0007 SD16G 14.5 GiB
[ 2.920801] mmcblk0: p1
[ 2.944190] EXT4-fs (mmcblk0p1): INFO: recovery required on readonly filesystem
[ 2.951796] EXT4-fs (mmcblk0p1): write access will be enabled during recovery
[ 3.116810] EXT4-fs (mmcblk0p1): recovery complete
[ 3.127035] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null
). Quota mode: disabled.
[ 3.137249] VFS: Mounted root (ext4 filesystem) readonly on device 179:1.
[ 3.144966] devtmpfs: mounted
[ 3.148023] usb 3-1: device descriptor read/64, error -62
[ 3.154875] Freeing unused kernel image (initmem) memory: 2116K
[ 3.160908] Run /sbin/init as init process
[ 3.265651] usb usb3-port1: attempt power cycle
[ 3.407948] EXT4-fs (mmcblk0p1): re-mounted. Opts: (null). Quota mode: disabled.
[ 3.485628] usb 3-1: new low-speed USB device number 4 using ohci-platform
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Initializing random number generator: OK
Saving random seed: OK
Starting network: OK
Welcome to Buildroot
buildroot login:
烧录img是LicheeRV_Tina_dock_hdmi_8723ds.img,启动后发现cpu占用率很高,且来自sdio中断数特别高,所以做benchmark前需要把这两都降下来,否则benchmark结果受影响 --- 去/etc/rc.d/目录下把WAFT、SWUPdate、wpa_supplicant、mtp啥的都禁用,方法是把那些刚才提到的S开头的脚本改名,以bak开头。最终结果大概是系统中除内核线程外userspace只有一个shell,中断方面只有display中断比较频繁,大概60个中断/s(display常见就是60个中断/s),除自己编译内核外目前还不知道怎么停掉display。
CPU部分:
Dhrystone: 2977963 Dhrystones/s, 因cpu频率1008MHZ,所以算得1.68 DMIPS/MHZ
coremark: 2323.960028 Iterations/s, 算得2.32 Iterations/s/MHZ
DDR部分:
D1 SoC的cpu支持RVV,所以测一下vector指令优化的memcpy以及glibc自带的std memcpy
这个性能结果不错RVV杠杠滴
注:这些数据都是linux下测得的虽然尽可能的去掉了操作系统系统影响因素但肯定比不过裸机环境的
俺长期从事linux内核和bsp开发,2021年一直口水D1哪吒开发板不过一直没舍得买,这次买了Lichee_RV_DOCK。开箱图就不贴了,烧Tina系统的img,用usb串口转接连EXTIO的GND、TX、RX引脚,串口可获得shell。下面做些官方wiki中https://wiki.sipeed.com/hardware/zh/lichee/RV/RV.html没有的小实验:
1.用户按键
在hdmi口边上下有两个键,一是RST,另一个即user按键
root@MaixLinux:/mnt/SDCARD# ./evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: sunxi-keyboard
/dev/input/event1: audiocodec sunxi Audio Jack
/dev/input/event2: fts_ts
Select the device event number [0-2]: 0
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "sunxi-keyboard"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 28 (KEY_ENTER)
Event code 114 (KEY_VOLUMEDOWN)
Event code 139 (KEY_MENU)
Event code 172 (KEY_HOMEPAGE)
Event code 352 (KEY_OK)
Properties:
Testing ... (interrupt to exit)
Event: time 6994.130779, type 1 (EV_KEY), code 352 (KEY_OK), value 1
Event: time 6994.130779, -------------- SYN_REPORT ------------
Event: time 6994.219394, type 1 (EV_KEY), code 352 (KEY_OK), value 0
Event: time 6994.219394, -------------- SYN_REPORT ------------
所以此用户按键默认键码是KEY_OK
2. rtc
root@MaixLinux:~# cat /sys/class/rtc/rtc0/time && sleep 10 && cat /sys/class/rtc/rtc0/time
01:58:24
01:58:33
root@MaixLinux:/mnt/SDCARD# ./rtctest
RTC Driver Test Example.
Counting 5 update (1/sec) interrupts from reading /dev/rtc0: 1 2 3 4 5
Again, from using select(2) on /dev/rtc: 1 2 3 4 5
Current RTC date/time is 1-1-1970, 01:52:04.
Alarm time now set to 01:52:09.
Waiting 5 seconds for alarm... okay. Alarm rang.
*** Test complete ***
3.watchdog
因watchdog被procd进程占用,故暂未测试wdt的功能,等用buildroot构建一个简单系统后可测
4.芯片里的温度sensor
root@MaixLinux:~# cat /sys/class/thermal/thermal_zone0/temp
30820
单位按linux惯例应该是毫摄氏度,所以这里报告温度是30.82度
5. sdcard和sdio的一些基本参数
root@MaixLinux:~# cat /sys/kernel/debug/mmc0/ios
clock: 50000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 2 (4 bits)
timing spec: 2 (sd high-speed)
signal voltage: 0 (3.30 V)
driver type: 0 (driver type B)
root@MaixLinux:~# cat /sys/kernel/debug/mmc1/ios
clock: 50000000 Hz
vdd: 21 (3.3 ~ 3.4 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 2 (4 bits)
timing spec: 2 (sd high-speed)
signal voltage: 0 (3.30 V)
driver type: 0 (driver type B)
所以sdcard也好,用于wifi的sdio也好,都是HS模式,时钟最高到50MHZ,工作电压3.3V,sd总线4位宽。
6. 各clock/pll基本情况
root@MaixLinux:~# cat /sys/kernel/debug/clk/clk_summary
...
pll-ddr0 2 2 0 1584000000 0 0 50
000
dram-clk 0 0 0 1584000000 0 0 50
000
...
pll-cpux 0 0 0 1008000000 0 0 50
000
riscv 0 0 0 1008000000 0 0 50
000
riscv-axi 0 0 0 504000000 0 0 50
000
pll-cpux-div 0 0 0 1008000000 0 0 50
000
...
这个列表好长,只把感兴趣的部分贴出。这表明那颗riscv cpu跑在1008MHZ频率下,DDR基础频率1584MHZ
注:evtest和rtctest是自己编译的程序,系统未自带。
页次: 1