kernel: move devicetree to machine files, include in sd-card

Move device tree configuration to machine files. Check for device tree
in sd card creation and include device tree file in first partition.

Signed-off-by: Jens Lucius <info@jenslucius.com>
This commit is contained in:
Jens Lucius 2015-06-10 22:01:18 +02:00
parent 38edd14b04
commit b10c844cb2
14 changed files with 41 additions and 15 deletions

View File

@ -67,7 +67,23 @@ IMAGE_CMD_sunxi-sdimg () {
# Create a vfat image with boot files
BOOT_BLOCKS=$(LC_ALL=C parted -s ${SDIMG} unit b print | awk '/ 1 / { print substr($4, 1, length($4 -1)) / 512 /2 }')
mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::uImage
# Copy device tree file
if test -n "${KERNEL_DEVICETREE}"; then
for DTS_FILE in ${KERNEL_DEVICETREE}; do
DTS_BASE_NAME=`basename ${DTS_FILE} | awk -F "." '{print $1}'`
if [ -e "${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb" ]; then
kernel_bin="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.bin`"
kernel_bin_for_dtb="`readlink ${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb | sed "s,$DTS_BASE_NAME,${MACHINE},g;s,\.dtb$,.bin,g"`"
if [ $kernel_bin = $kernel_bin_for_dtb ]; then
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb ::/${DTS_BASE_NAME}.dtb
fi
fi
done
fi
if [ -e "${DEPLOY_DIR_IMAGE}/fex.bin" ]
then
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/fex.bin ::script.bin

View File

@ -13,6 +13,8 @@ UBOOT_MACHINE = "Bananapi_config"
UBOOT_ENTRYPOINT = "0x40008000"
UBOOT_LOADADDRESS = "0x40008000"
KERNEL_DEVICETREE = "sun7i-a20-bananapi.dtb"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_FEATURES = "screen apm usbgadget usbhost vfat"

View File

@ -13,6 +13,8 @@ UBOOT_MACHINE = "Cubieboard_config"
UBOOT_ENTRYPOINT = "0x40008000"
UBOOT_LOADADDRESS = "0x40008000"
KERNEL_DEVICETREE = "sun4i-a10-cubieboard.dtb"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_FEATURES = "kernel26 screen apm usbgadget usbhost vfat alsa"

View File

@ -13,6 +13,8 @@ UBOOT_MACHINE = "Cubieboard2_config"
UBOOT_ENTRYPOINT = "0x40008000"
UBOOT_LOADADDRESS = "0x40008000"
KERNEL_DEVICETREE = "sun7i-a20-cubieboard2.dtb"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_FEATURES = "screen apm usbgadget usbhost vfat"

View File

@ -13,6 +13,8 @@ UBOOT_MACHINE = "Cubietruck_config"
UBOOT_ENTRYPOINT = "0x40008000"
UBOOT_LOADADDRESS = "0x40008000"
KERNEL_DEVICETREE = "sun7i-a20-cubietruck.dtb"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_FEATURES = "screen apm usbgadget usbhost vfat"

View File

@ -5,11 +5,11 @@ XSERVER = "xserver-xorg \
xf86-input-mouse \
xf86-input-keyboard"
PREFERRED_PROVIDER_virtual/kernel = "linux"
PREFERRED_PROVIDER_virtual/kernel = "linux-mainline"
PREFERRED_VERSION_linux-sunxi ?= "3.4.%"
PREFERRED_VERSION_linux-libc-headers = "3.4.61"
PREFERRED_PROVIDER_u-boot = "u-boot"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot"
PREFERRED_PROVIDER_u-boot = "u-boot-mainline"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-mainline"
KERNEL_IMAGETYPE = "uImage"

View File

@ -13,6 +13,8 @@ UBOOT_MACHINE = "Mele_A1000_config"
UBOOT_ENTRYPOINT = "0x40008000"
UBOOT_LOADADDRESS = "0x40008000"
KERNEL_DEVICETREE = "sun4i-a10-a1000.dtb"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_FEATURES = "kernel26 screen apm usbgadget usbhost vfat alsa"

View File

@ -11,6 +11,8 @@ UBOOT_MACHINE = "A10-OLinuXino-Lime_config"
UBOOT_ENTRYPOINT = "0x40008000"
UBOOT_LOADADDRESS = "0x40008000"
KERNEL_DEVICETREE = "sun4i-a10-olinuxino-lime.dtb"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_FEATURES = "kernel26 screen apm usbgadget usbhost vfat alsa"

View File

@ -14,6 +14,8 @@ UBOOT_MACHINE = "A10s-OLinuXino-Micro_config"
UBOOT_ENTRYPOINT = "0x40008000"
UBOOT_LOADADDRESS = "0x40008000"
KERNEL_DEVICETREE = "sun5i-a10s-olinuxino-micro.dtb"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_FEATURES = "kernel26 screen apm usbgadget usbhost vfat alsa"

View File

@ -14,6 +14,8 @@ UBOOT_MACHINE = "A13-OLinuXino_config"
UBOOT_ENTRYPOINT = "0x40008000"
UBOOT_LOADADDRESS = "0x40008000"
KERNEL_DEVICETREE = "sun5i-a13-olinuxino.dtb"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_FEATURES = "kernel26 screen apm usbgadget usbhost vfat alsa"

View File

@ -11,6 +11,8 @@ UBOOT_MACHINE = "A20-OLinuXino-Micro_config"
UBOOT_ENTRYPOINT = "0x40008000"
UBOOT_LOADADDRESS = "0x40008000"
KERNEL_DEVICETREE = "sun7i-a20-olinuxino-micro.dtb"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_FEATURES = "kernel26 screen apm usbgadget usbhost vfat alsa"

View File

@ -11,6 +11,8 @@ UBOOT_MACHINE = "A20-OLinuXino-Lime_config"
UBOOT_ENTRYPOINT = "0x40008000"
UBOOT_LOADADDRESS = "0x40008000"
KERNEL_DEVICETREE = "sun7i-a20-olinuxino-lime.dtb"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_FEATURES = "kernel26 screen apm usbgadget usbhost vfat alsa"

View File

@ -11,6 +11,8 @@ UBOOT_MACHINE = "A20-OLinuXino_Lime2_config"
UBOOT_ENTRYPOINT = "0x40008000"
UBOOT_LOADADDRESS = "0x40008000"
KERNEL_DEVICETREE = "sun7i-a20-olinuxino-lime2.dtb"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_FEATURES = "kernel26 screen apm usbgadget usbhost vfat alsa"

View File

@ -12,18 +12,6 @@ require linux.inc
# Pull in the devicetree files into the rootfs
RDEPENDS_kernel-base += "kernel-devicetree"
KERNEL_DEVICETREE_bananapi = "sun7i-a20-bananapi.dtb"
KERNEL_DEVICETREE_cubieboard = "sun4i-a10-cubieboard.dtb"
KERNEL_DEVICETREE_cubieboard2 = "sun7i-a20-cubieboard2.dtb"
KERNEL_DEVICETREE_cubietruck = "sun7i-a20-cubietruck.dtb"
KERNEL_DEVICETREE_mele = "sun4i-a10-a1000.dtb"
KERNEL_DEVICETREE_olinuxino-a10lime = "sun4i-a10-olinuxino-lime.dtb"
KERNEL_DEVICETREE_olinuxino-a10s = "sun5i-a10s-olinuxino-micro.dtb"
KERNEL_DEVICETREE_olinuxino-a13 = "sun5i-a13-olinuxino.dtb"
KERNEL_DEVICETREE_olinuxino-a20 = "sun7i-a20-olinuxino-micro.dtb"
KERNEL_DEVICETREE_olinuxino-a20lime = "sun7i-a20-olinuxino-lime.dtb"
KERNEL_DEVICETREE_olinuxino-a20lime2 = "sun7i-a20-olinuxino-lime2.dtb"
KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
PV = "4.0.5"