Orange Pi Zero - (1)

Orange Pi Zero - (1)

一、接口资源

两路串口,一路SPI,两路I2C,一路PWM,2路普通IO,4路USB,1路红外接收,一路声卡

二、u-boot-sunxi-with-spl.bin生成分析

./u-boot.bin
./u-boot-nodtb.bin
./u-boot-sunxi-with-spl.bin
./u-boot-dtb.bin

-rw-rw-r-- 1 cuihq cuihq 421977 6月   9 23:20 u-boot.bin
-rw-rw-r-- 1 cuihq cuihq 421977 6月   9 23:20 u-boot-dtb.bin
-rwxrwxr-x 1 cuihq cuihq 399376 6月   9 23:20 u-boot-nodtb.bin
-rw-rw-r-- 1 cuihq cuihq 454809 6月   9 23:20 u-boot-sunxi-with-spl.bin

cat arch/arm/dts/sun8i-h2-plus-orangepi-zero.dtb > dts/dt.dtb
./tools/fdtgrep -b u-boot,dm-pre-reloc -b u-boot,dm-spl -RT arch/arm/dts/sun8i-h2-plus-orangepi-zero.dtb -n /chosen -n /config -O dtb | ./tools/fdtgrep -r -O dtb - -o dts/dt-spl.dtb -P u-boot,dm-pre-reloc -P u-boot,dm-spl -P u-boot,dm-tpl 
make obj=spl -f ./scripts/Makefile.spl all
cat u-boot-nodtb.bin dts/dt.dtb > u-boot-dtb.bin
cp dts/dt.dtb u-boot.dtb
cp u-boot-dtb.bin u-boot.bin

u-boot-nodtb.bin + u-boot.dtb == u-boot-dtb.bin == u-boot.bin 

./spl/sunxi-spl.bin
./spl/u-boot-spl-nodtb.bin
./spl/u-boot-spl.bin

-rw-rw-r-- 1 cuihq cuihq 24576 6月   9 23:20 sunxi-spl.bin
-rwxrwxr-x 1 cuihq cuihq 17912 6月   9 23:20 u-boot-spl.bin
-rwxrwxr-x 1 cuihq cuihq 17912 6月   9 23:20 u-boot-spl-nodtb.bin

cp spl/u-boot-spl-nodtb.bin spl/u-boot-spl.bin
./tools/mksunxiboot --default-dt "sun8i-h2-plus-orangepi-zero" spl/u-boot-spl.bin spl/sunxi-spl.bin

u-boot-spl-nodtb.bin == u-boot-spl.bin => sunxi-spl.bin

sunxi-spl.bin(32 * 1024) + 64字节 + u-boot.bin == u-boot-sunxi-with-spl.bin
其中64字节是什么东西,还需要进一步分析
sudo ./build.sh BOARD=orangepizero BRANCH=current BUILD_OPT=u-boot KERNEL_CONFIGURE=yes
sudo ./build.sh BOARD=orangepizero BRANCH=current BUILD_OPT=kernel KERNEL_CONFIGURE=yes

TF卡分区

https://www.cnblogs.com/yuwl26/p/14344452.html

sudo mkfs.fat /dev/sdb1
sudo mkfs.ext4 /dev/sdb2

sudo mount /dev/sdb1 /mnt
sudo umount /dev/sdb1
linux-sunxi-current.config
make linux-sunxi-current_defconfig
make all -j4
make uImage LOADADDR=0x46000000 -j4
make dtbs
make linux-sunxi-current_nfs_defconfig
make uImage LOADADDR=0x46000000 -j4 && make dtbs
sudo cp -rf arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dtb /mnt/
sudo cp -rf arch/arm/boot/uImage /mnt/

TF卡方式运行

load mmc 0:1 0x42000000 uImage
load mmc 0:1 0x43000000 sun8i-h2-plus-orangepi-zero.dtb
bootm 0x42000000 - 0x43000000

TFTP方式运行

tftp 0x42000000 orangepi_zero/uImage
tftp 0x43000000 orangepi_zero/sun8i-h2-plus-orangepi-zero.dtb
bootm 0x42000000 - 0x43000000

tftp 0x42000000 orangepi_zero/uImage;tftp 0x43000000 orangepi_zero/sun8i-h2-plus-orangepi-zero.dtb;bootm 0x42000000 - 0x43000000

设置IP信息

setenv ipaddr 192.168.1.141
setenv serverip 192.168.1.140
saveenv

/* 挂载失败 */

Waiting for root device /dev/mmcblk0p2...
setenv bootargs 'console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait rw panic=10'

NFS方式运行

setenv bootargs 'root=/dev/nfs rw nfsroot=192.168.1.140:/home/cuihq/linux/nfs/orangepi_zero ip=192.168.1.141:192.168.1.140:192.168.1.1:255.255.255.0::eth0:off rootfstype=ext4 init=/linuxrc console=ttyS0,115200'

六、buildroot-2019.02.6

Target options  --->
	Target Architecture (ARM (little endian))  --->
	Target Binary Format (ELF)  --->
	Target Architecture Variant (cortex-A7)  --->
	Target ABI (EABI)  --->
	Target ABI (EABIhf)  --->
	Floating point strategy (Soft float)  --->
	Floating point strategy (NEON/VFPv4)  --->
	ARM instruction set (ARM)  --->
Toolchain  --->
	 Toolchain type (External toolchain)  --->
	 Toolchain (Custom toolchain)  --->
	 Toolchain origin (Pre-installed toolchain)  --->
	 (/usr/local/arm/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi) Toolchain path
	 ($(ARCH)-linux-gnueabi) Toolchain prefix
	 External toolchain gcc version (7.x)  --->
	 External toolchain kernel headers series (4.10.x)  --->
	 External toolchain C library (glibc/eglibc)  --->
	 [*] Toolchain has SSP support?
	 [*] Toolchain has RPC support?
	 [*] Toolchain has C++ support?
	 [*] Enable MMU support
System configuration  --->
	/dev management (Dynamic using devtmpfs + mdev)  --->
	[ ] Enable root login with password
	[*] Run a getty (login prompt) after boot  --->
		(ttyS0) TTY port
Filesystem images  --->
	[*] ext2/3/4 root filesystem
			ext2/3/4 variant (ext4)  --->
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值