Skip to content

linux allwinner h616 kernel based on the orangepi zero 2 version of the legacy allwinner 4.9 bsp kernel

Notifications You must be signed in to change notification settings

hexdump0815/linux-allwinner-h616-kernel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# directories:
# - /compile/doc/orangepi - the files in this dir
# - /compile/source/linux-orangepi - the kernel sources checked out from gitrepo
# - /compile/result/orangepi - the resulting kernel, modules etc. tar.gz files
# name: bsp-616

# patches:
# fix allwinner uart compile errors
patch -p1 < /compile/doc/orangepi/misc.616/patches/fix-allwinner-uart-compile-errors.patch
# add extra and adjusted dts files
patch -p1 < /compile/doc/orangepi/misc.616/patches/add-new-dtbs-to-Makefile.patch
cp /compile/doc/orangepi/misc.616/dtb/*.dts arch/arm64/boot/dts/sunxi
# fix perf compile
patch -p1 < /compile/doc/orangepi/misc.616/patches/fix-perf-compile.patch

cp /compile/doc/orangepi/config.616 /compile/source/linux-orangepi/.config
cd /compile/source/linux-orangepi

# git pull --force origin orange-pi-4.9-sun50iw9
export ARCH=arm64
# no defconfig as it is based on a handcrafted config
# /compile/doc/orangepi/misc.616/options/enable-docker-options.sh
# /compile/doc/orangepi/misc.616/options/enable-additional-options.sh
make oldconfig
make -j 4 Image dtbs modules
cd tools/perf
# without this it would fail on warnings
export WERROR=0
make
cd ../power/cpupower
make
cd ../../..
export kver=`make kernelrelease`
echo ${kver}
# remove debug info if there and wanted
# find . -type f -name '*.ko' | sudo xargs -n 1 objcopy --strip-unneeded
make modules_install
mkdir -p /lib/modules/${kver}/tools
cp -v tools/perf/perf /lib/modules/${kver}/tools
cp -v tools/power/cpupower/cpupower /lib/modules/${kver}/tools
cp -v tools/power/cpupower/libcpupower.so.0.0.1 /lib/modules/${kver}/tools/libcpupower.so.0
# make headers_install INSTALL_HDR_PATH=/usr
cp -v .config /boot/config-${kver}
cp -v arch/arm64/boot/Image /boot/Image-${kver}
mkdir /boot/dtb-${kver}
cp -v arch/arm64/boot/dts/sunxi/sun50i*.dtb /boot/dtb-${kver}/
cp -v System.map /boot/System.map-${kver}
cd /boot
update-initramfs -c -k ${kver}
mkimage -A arm -O linux -T ramdisk -a 0x0 -e 0x0 -n initrd.img-${kver} -d initrd.img-${kver} uInitrd-${kver}
mkimage -A arm -O linux -T kernel -C none -a 0x41000000 -e 0x41000000 -n linux-${kver} -d Image-${kver} uImage-${kver}
tar cvzf /compile/source/linux-orangepi/${kver}.tar.gz /boot/*-${kver} /lib/modules/${kver}
cp -v /compile/doc/orangepi/config.616 /compile/doc/orangepi/config.616.old
cp -v /compile/source/linux-orangepi/.config /compile/doc/orangepi/config.616
cp -v /compile/source/linux-orangepi/.config /compile/doc/orangepi/config.616-${kver}
cp -v /compile/source/linux-orangepi/*.tar.gz /compile/result/orangepi


# my boot scripts

# cat /boot/boot.txt
# call sysboot to use the boot options defined in /boot/menu/extlinux.conf
sysboot mmc 0 any ${scriptaddr} /menu/extlinux.conf

# activate via: mkimage -A arm -T script -O linux -d boot.txt boot.scr


# cat /boot/menu/extlinux.conf
TIMEOUT 50

DEFAULT v49170

MENU TITLE x96q boot options
 
LABEL v49170
      MENU LABEL linux v4.9.170 kernel
      LINUX ../uImage-4.9.170-bsp-616+
      INITRD ../uInitrd-4.9.170-bsp-616+
      FDT ../dtb-4.9.170-bsp-616+/sun50i-h313-x96q.dtb
      APPEND earlyprintk=sunxi-uart,0x05000000 earlycon=uart,mmio32,0x5000000 console=tty1 console=ttyS0,115200 root=/dev/mmcblk1p2 rootwait ro fsck.fix=yes fsck.repair=yes net.ifnames=0 ipv6.disable=1 noresume


# orange pi zero 2 boot scripts

# cat /boot/boot.cmd
# DO NOT EDIT THIS FILE
#
# Please edit /boot/orangepiEnv.txt to set supported parameters
#

# default values
setenv load_addr "0x45000000"
setenv rootdev "/dev/mmcblk0p1"
setenv verbosity "1"
setenv rootfstype "ext4"
setenv console "both"
setenv docker_optimizations "off"
setenv bootlogo "false"

# Print boot source
itest.b *0x10028 == 0x00 && echo "U-boot loaded from SD"
itest.b *0x10028 == 0x02 && echo "U-boot loaded from eMMC or secondary SD"
itest.b *0x10028 == 0x03 && echo "U-boot loaded from SPI"

echo "Boot script loaded from ${devtype}"

if test -e ${devtype} ${devnum} ${prefix}orangepiEnv.txt; then
	load ${devtype} ${devnum} ${load_addr} ${prefix}orangepiEnv.txt
	env import -t ${load_addr} ${filesize}
fi

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "earlycon=uart,mmio32,0x5000000 console=ttyS0,115200 console=tty1"; fi
if test "${console}" = "serial"; then setenv consoleargs "earlycon=uart,mmio32,0x5000000 console=ttyS0,115200"; fi
if test "${bootlogo}" = "true"; then setenv consoleargs "bootsplash.bootfile=bootsplash.orangepi ${consoleargs}"; fi

# get PARTUUID of first partition on SD/eMMC it was loaded from
# mmc 0 is always mapped to device u-boot (2016.09+) was loaded from
if test "${devtype}" = "mmc"; then part uuid mmc 0:1 partuuid; fi

setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} disp_reserve=${disp_reserve} ${extraargs} ${extraboardargs}"

if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi

#load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile}
#fdt addr -c ${fdt_addr_r}
#fdt addr ${fdt_addr_r}
#fdt resize 65536

fdt set disp boot_fb0 ${boot_fb0}
fdt set disp boot_disp <${boot_disp}>
fdt set disp boot_disp1 <${boot_disp1}>
fdt set disp boot_disp2 <${boot_disp2}>
fdt set disp tv_vdid <${tv_vdid}>

fdt set disp fb0_width <${fb0_width}>
fdt set disp fb0_height <${fb0_height}>

load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}uImage

bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr


# cat /boot/orangepiEnv.txt
verbosity=8
console=both
disp_mode=1080p60
fb0_width=1280
fb0_height=720
rootdev=/dev/mmcblk1p2
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

About

linux allwinner h616 kernel based on the orangepi zero 2 version of the legacy allwinner 4.9 bsp kernel

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages