|
|
# kernel
|
|
|
## compiling
|
|
|
```
|
|
|
git clone https://github.com/jwrdegoede/linux-sunxi.git -b sunxi-wip --depth 1
|
|
|
cd linux-sunxi
|
|
|
cp $config .config
|
|
|
make -j4 zImage sun8i-h3-orangepi-pc.dtb modules
|
|
|
INSTALL_MOD_PATH=<any-path-you-like> make modules_install
|
|
|
```
|
|
|
|
|
|
## installation
|
|
|
```
|
|
|
cp arch/arm/boot/dts/sun8i-h3-orangepi-pc.dtb /boot/
|
|
|
cp arch/arm/boot/zImage /boot/
|
|
|
cp $modules$ /lib/modules/
|
|
|
```
|
|
|
|
|
|
# uboot
|
|
|
```
|
|
|
git clone git://git.denx.de/u-boot.git
|
|
|
git checkout v2016.03-rc3
|
|
|
make orangepi_pc_defconfig
|
|
|
make
|
|
|
```
|
|
|
*3.4 kernel needs "Enable workarounds for booting old kernels" in menuconfig*
|
|
|
|
|
|
create a file boot.cmd on the first partition (content below)
|
|
|
```
|
|
|
mkimage -C none -A arm -T script -d boot.cmd boot.scr
|
|
|
dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
|
|
|
```
|
|
|
|
|
|
copy kernel files to the first partition
|
|
|
* For a 3.4 kernel you need uImage (linux kernel) and script.bin (binary representation of FEX).
|
|
|
* For a device tree based kernel ("mainline", 4.x) you need the kernel image (uImage or zImage) and the device-specific .dtb file that is generated as part of your kernel compilation.
|
|
|
|
|
|
## boot.cmd - mainline
|
|
|
```
|
|
|
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10
|
|
|
load mmc 0:1 0x43000000 sun8i-h3-orangepi-pc.dtb || load mmc 0:1 0x43000000 boot/sun8i-h3-orangepi-pc.dtb
|
|
|
load mmc 0:1 0x42000000 zImage || load mmc 0:1 0x42000000 boot/zImage
|
|
|
bootz 0x42000000 - 0x43000000
|
|
|
```
|
|
|
|
|
|
## boot.cmd - 3.4
|
|
|
```
|
|
|
setenv bootm_boot_mode sec
|
|
|
setenv machid 1029
|
|
|
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10
|
|
|
load mmc 0:1 0x43000000 script.bin || load mmc 0:1 0x43000000 boot/script.bin
|
|
|
load mmc 0:1 0x42000000 uImage || load mmc 0:1 0x42000000 boot/uImage
|
|
|
bootm 0x42000000
|
|
|
``` |