2023-02-07记录使用TF卡,烧录uboot后启动kernel。
去年为了学MIPI,花了很多时间,放下了Linux,今年开始又要在这上面努力了。
之前在荔枝派Zero小白(二)_a11999114的博客-CSDN博客_weixin_37214729中烧录了uboot和kernel,也有文件系统,当时太小白了,也没注意到,在启动后,实际只是运行了uboot,实际并没有启动kernel。有一次无意间在F1C200S上发现,要运行kernel还有boot指令脚本。
这次移植时特别注意了一下,但由于参数不确定,就只是改变了文件名,没有改变mmc地址,最后在网上找到了正确的。
在F1C200s中,boot.cmd中脚本如下:
setenv bootargs console=tty0 console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 rw
load mmc 0:1 0x80C00000 suniv-f1c100s-licheepi-nano.dtb
load mmc 0:1 0x80008000 zImage
bootz 0x80008000 - 0x80C00000
在V3s中,boot.cmd中脚本如下:
setenv bootargs console=tty0 console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw
load mmc 0:1 0x41800000 sun8i-v3s-licheepi-zero-with-800x480-lcd.dtb
load mmc 0:1 0x41000000 zImage
bootz 0x41000000 - 0x41800000
实际上,这两个地址在uboot指令中,用printenv打印信息后也有。
荔枝派zero移植_wrmtl的博客-CSDN博客 感谢这个博主。
[23:31:20.926]收←◆
U-Boot SPL 2017.01-rc2-00057-g32ab1804cd (Feb 04 2023 - 23:51:18)
DRAM: 64 MiB
Trying to boot from MMC1
[23:31:21.123]收←◆
U-Boot 2017.01-rc2-00057-g32ab1804cd (Feb 04 2023 - 23:51:18 +0800) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
[23:31:21.158]收←◆MMC: SUNXI SD/MMC: 0
[23:31:21.233]收←◆*** Warning - bad CRC, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
[23:31:21.284]收←◆dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
[23:31:21.331]收←◆In: serial@01c28000
Out: serial@01c28000
Err: serial@01c28000
U-Boot 2017.01-rc2-00057-g32ab1804cd (Feb 04 2023 - 23:51:18 +0800) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28000
Out: serial@01c28000
Err: serial@01c28000
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 2
[23:31:22.381]收←◆ 1
[23:31:23.381]收←◆ 0
[23:31:23.447]收←◆switch to partitions #0, OK
mmc0 is current device
[23:31:24.001]收←◆Scanning mmc 0:1...
[23:31:24.224]收←◆Found U-Boot script /boot.scr
[23:31:24.301]收←◆275 bytes read in 54 ms (4.9 KiB/s)
## Executing script at 41900000
[23:31:24.395]收←◆6607 bytes read in 67 ms (95.7 KiB/s)
[23:31:24.660]收←◆4157608 bytes read in 240 ms (16.5 MiB/s)
## Flattened Device Tree blob at 41800000
Booting using the fdt blob at 0x41800000
Loading Device Tree to 42dfb000, end 42dff9ce ... OK
Cannot setup simplefb: node not found
Starting kernel ...
[23:31:25.084]收←◆[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.2.0-licheepi-zero+ (root@one-BT3-PRO) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)) #1 SMP Sun Feb 5 20:01:50 CST 2023
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Lichee Pi Zero
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] percpu: Embedded 16 pages/cpu s34508 r8192 d22836 u65536
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16256
[ 0.000000] Kernel command line: console=tty0 console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 rw
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 55072K/65536K available (6144K kernel code, 301K rwdata, 1676K rodata, 1024K init, 252K bss, 10464K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x2fc/0x488 with crng_init=0
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000021] Switching to timer-based delay loop, resolution 41ns
[ 0.000174] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000379] Console: colour dummy device 80x30
[ 0.000674] printk: console [tty0] enabled
[ 0.000733] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.000762] pid_max: default: 32768 minimum: 301
[ 0.000932] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.000964] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.001792] CPU: Testing write buffer coherency: ok
[ 0.002348] /cpus/cpu@0 missing clock-frequency property
[ 0.002396] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.003229] Setting up static identity map for 0x40100000 - 0x40100060
[ 0.003483] rcu: Hierarchical SRCU implementation.
[ 0.003995] smp: Bringing up secondary CPUs ...
[ 0.004034] smp: Brought up 1 node, 1 CPU
[ 0.004050] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.004064] CPU: All CPU(s) started in SVC mode.
[ 0.005184] devtmpfs: initialized
[ 0.007616] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.007957] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.008007] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[ 0.008279] pinctrl core: initialized pinctrl subsystem
[ 0.009347] NET: Registered protocol family 16
[ 0.009856] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.011247] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.011294] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.033196] SCSI subsystem initialized
[ 0.033408] usbcore: registered new interface driver usbfs
[ 0.033494] usbcore: registered new interface driver hub
[ 0.033610] usbcore: registered new device driver usb
[ 0.033803] mc: Linux media interface: v0.10
[ 0.033860] videodev: Linux video capture interface: v2.00
[ 0.034136] Advanced Linux Sound Architecture Driver Initialized.
[ 0.035442] clocksource: Switched to clocksource arch_sys_counter
[ 0.047111] NET: Registered protocol family 2
[ 0.048000] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[ 0.048071] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.048111] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[ 0.048143] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.048311] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.048378] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 0.048700] NET: Registered protocol family 1
[ 0.050487] Initialise system trusted keyrings
[ 0.050893] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.093761] Key type asymmetric registered
[ 0.093808] Asymmetric key parser 'x509' registered
[ 0.093924] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[ 0.093951] io scheduler mq-deadline registered
[ 0.093965] io scheduler kyber registered
[ 0.094927] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 0.098777] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.163734] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.166259] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[ 0.167420] printk: console [ttyS0] disabled
[ 0.187756] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 30, base_baud = 1500000) is a U6_16550A
[ 0.699711] printk: console [ttyS0] enabled
[ 0.706886] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.713449] ehci-platform: EHCI generic platform driver
[ 0.718868] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.725089] ohci-platform: OHCI generic platform driver
[ 0.730508] usbcore: registered new interface driver usb-storage
[ 0.737740] sun6i-rtc 1c20400.rtc: registered as rtc0
[ 0.742827] sun6i-rtc 1c20400.rtc: RTC enabled
[ 0.748197] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 0.756783] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[23:31:25.690]收←◆[ 0.793270] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[ 0.801316] usbcore: registered new interface driver usbhid
[ 0.806990] usbhid: USB HID core driver
[ 0.812778] Initializing XFRM netlink socket
[ 0.817241] NET: Registered protocol family 17
[ 0.822256] Registering SWP/SWPB emulation handler
[ 0.828294] Loading compiled-in X.509 certificates
[ 0.839422] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 0.850986] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 0.856874] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[ 0.866311] hub 1-0:1.0: USB hub found
[ 0.870304] hub 1-0:1.0: 1 port detected
[ 0.875929] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T01:17:04 UTC (4624)
[ 0.884393] vcc3v0: disabling
[ 0.887480] vcc5v0: disabling
[ 0.890460] ALSA device list:
[ 0.893430] No soundcards found.
[ 0.897948] Waiting for root device /dev/mmcblk0p2...
[ 0.929072] mmc0: host does not support reading read-only switch, assuming write-enable
[ 0.939109] mmc0: new high speed SDHC card at address 5048
[ 0.946445] mmcblk0: mmc0:5048 SD16G 14.4 GiB
[ 0.953175] mmcblk0: p1 p2
[23:31:25.893]收←◆[ 0.996647] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.004888] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 1.013429] devtmpfs: mounted
[ 1.017808] Freeing unused kernel memory: 1024K
[ 1.022525] Run /sbin/init as init process
[23:31:26.032]收←◆[ 1.135166] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[23:31:26.081]收←◆Starting logging: OK
[23:31:26.130]收←◆Initializing random number generator... [ 1.251513] random: dd: uninitialized urandom read (512 bytes read)
done.
Starting network:
[23:31:26.223]收←◆OK
[23:31:26.330]收←◆
Welcome to Buildroot
buildroot login:
[23:31:30.987]收←◆[ 6.090584] random: fast init done
查阅后,发现登录用户为root,无密码。输入root带换行后,出现#号。再输入ls带换行,没有显示文件。再输入cd ..带换行,然后输入ls带换行,出现文件系统的内容。即可以正常使用Linux。