@@ -19,3 +19,5 @@ XSERVER = " \
# misc
SERIAL_CONSOLES ?= "1500000;ttyS2"
+RK_CONSOLE_BAUD ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[0]}"
+RK_CONSOLE_DEVICE ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[1].split()[0]}"
new file mode 100644
@@ -0,0 +1,24 @@
+# KERNEL_DEVICETREE follows the pattern of
+# 'rockchip/${SOC_FAMILY}-${BOARD}.dtb' which is required when compiling
+# the kernel so the kernel's Makefile can find the device tree
+#
+# when using extlinux with a fitImage the device tree is contained in the
+# fitImage
+#
+# however for non-fitImages it is not found at
+# $UBOOT_EXTLINUX_FDTDIR/rockchip/$KERNEL_DEVICETREE but rather at
+# $UBOOT_EXTLINUX_FDTDIR/$KERNEL_DEVICETREE therefore we need to strip off
+# the 'rockchip/' part for extlinux non-fitImage builds
+NONFITDT ?= "${@d.getVar('KERNEL_DEVICETREE').split('/')[1]}"
+
+UBOOT_EXTLINUX ?= "1"
+UBOOT_EXTLINUX_ROOT ?= "root=PARTLABEL=root"
+UBOOT_EXTLINUX_FDTDIR ?= "${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', '/boot', d)}"
+UBOOT_EXTLINUX_FDT ?= "${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', '${NONFITDT}', d)}"
+UBOOT_EXTLINUX_CONSOLE ?= "earlycon console=tty1 console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8"
+UBOOT_EXTLINUX_KERNEL_ARGS ?= "rootwait rw rootfstype=ext4"
+UBOOT_EXTLINUX_KERNEL_IMAGE ?= "/boot/${KERNEL_IMAGETYPE}"
+UBOOT_EXTLINUX_LABELS ?= "default"
+UBOOT_EXTLINUX_MENU_DESCRIPTION:default ?= "${MACHINE}"
+
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "u-boot-extlinux"
@@ -1,33 +1,17 @@
# common meta-rockchip wic/wks items
+require conf/machine/include/rockchip-extlinux.inc
+
SPL_BINARY ?= "idbloader.img"
IMAGE_FSTYPES += "wic wic.bmap"
WKS_FILE ?= "rockchip.wks"
WKS_FILE_DEPENDS ?= " \
- mtools-native \
- dosfstools-native \
e2fsprogs-native \
virtual/bootloader \
- virtual/kernel \
- "
-# KERNEL_DEVICETREE follows the pattern of 'rockchip/${SOC_FAMILY}-${BOARD}.dtb'
-# but is placed in the deploy directory as simply '${SOC_FAMILY}-${BOARD}.dtb'
-# therefore we have to strip off the 'rockchip/' for IMAGE_BOOT_FILES
-NONFITDT="${@d.getVar('KERNEL_DEVICETREE').split('/')[1]}"
-IMAGE_BOOT_FILES = " \
- ${KERNEL_IMAGETYPE} \
- ${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', '${NONFITDT}', d)} \
"
-# use the first-defined <baud>;<device> pair in SERIAL_CONSOLES
-# for the console parameter in the wks files
-RK_CONSOLE_BAUD ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[0]}"
-RK_CONSOLE_DEVICE ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[1].split()[0]}"
-
WICVARS:append = " \
- RK_CONSOLE_BAUD \
- RK_CONSOLE_DEVICE \
SPL_BINARY \
UBOOT_SUFFIX \
"
@@ -16,18 +16,16 @@
# reserved2 8192 8192 (legacy parameters, ATAGS, etc)
# loader2 16384 8192 (U-Boot proper)
# atf 24576 8192 (trusted OS e.g. ATF, OP-TEE, etc)
-# boot 32768 229376
-# root 262144 - (suggested)
+# root 32768 -
-part loader1 --offset 64s --fixed-size 3552K --fstype=none --source rawcopy --sourceparams="file=${SPL_BINARY}"
+part loader1 --offset 64s --fixed-size 3552K --fstype=none --source rawcopy --sourceparams="file=${SPL_BINARY}"
part v_storage --offset 7168s --fixed-size 256K --fstype=none
part reserved --offset 7680s --fixed-size 192K --fstype=none
part reserved1 --offset 8064s --fixed-size 32K --fstype=none
part uboot_env --offset 8128s --fixed-size 32K --fstype=none
part reserved2 --offset 8192s --fixed-size 4096K --fstype=none
-part loader2 --offset 16384s --fixed-size 4096K --fstype=none --source rawcopy --sourceparams="file=u-boot.${UBOOT_SUFFIX}"
+part loader2 --offset 16384s --fixed-size 4096K --fstype=none --source rawcopy --sourceparams="file=u-boot.${UBOOT_SUFFIX}"
part atf --offset 24576s --fixed-size 4096K --fstype=none
-part /boot --offset 32768s --size 114688K --fstype=vfat --active --source bootimg-partition --label boot --use-uuid --sourceparams="loader=u-boot"
-part / --fstype=ext4 --source rootfs --label root --use-uuid
+part / --fstype=ext4 --active --source rootfs --label root
-bootloader --ptable gpt --append="console=tty1 console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8 rw rootfstype=ext4 init=/sbin/init"
+bootloader --ptable gpt