sun50i target

- sun50i include
- added orange-pi-pc2.conf
- added u-boot and linux: mainline
- updated sdcard_image-sunxi.bbclass to build the image for sun50i board
This commit is contained in:
AD-Aleksandrov 2017-09-24 14:49:05 +03:00
parent fcda1c7baa
commit da7b459793
10 changed files with 5740 additions and 4 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*~

View File

@ -66,6 +66,12 @@ IMAGE_CMD_sunxi-sdimg () {
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::uImage
# Clean device tree dir target
if [ ${SOC_FAMILY} = "sun50i" ]; then
mkdir -p ${DEPLOY_DIR_IMAGE}/${MANUFACTURER}
rm -rf ${DEPLOY_DIR_IMAGE}/${MANUFACTURER}/*
fi
# Copy device tree file
if test -n "${KERNEL_DEVICETREE}"; then
for DTS_FILE in ${KERNEL_DEVICETREE}; do
@ -74,10 +80,17 @@ IMAGE_CMD_sunxi-sdimg () {
kernel_bin="`readlink ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin`"
kernel_bin_for_dtb="`readlink ${DEPLOY_DIR_IMAGE}/${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
if [ ${SOC_FAMILY} = "sun50i" ]; then
cp ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb ${DEPLOY_DIR_IMAGE}/${MANUFACTURER}/${DTS_BASE_NAME}.dtb
else
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTS_BASE_NAME}.dtb ::/${DTS_BASE_NAME}.dtb
fi
fi
fi
done
if [ ${SOC_FAMILY} = "sun50i" ]; then
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${MANUFACTURER} ::
fi
fi
if [ -e "${DEPLOY_DIR_IMAGE}/fex.bin" ]
@ -104,7 +117,12 @@ IMAGE_CMD_sunxi-sdimg () {
dd if=${SDIMG_ROOTFS} of=${SDIMG} conv=notrunc seek=1 bs=$(expr 1024 \* ${BOOT_SPACE_ALIGNED} + ${IMAGE_ROOTFS_ALIGNMENT} \* 1024) && sync && sync
fi
#write u-boot and spl at the beginint of sdcard in one shot
# Write u-boot and spl at the beginning of sdcard
if [ ${SOC_FAMILY} = "sun50i" ]
then
dd if=${DEPLOY_DIR_IMAGE}/sunxi-spl.bin of=${SDIMG} bs=1024 seek=8 conv=notrunc
dd if=${DEPLOY_DIR_IMAGE}/u-boot.itb of=${SDIMG} bs=1024 seek=40 conv=notrunc
else
dd if=${DEPLOY_DIR_IMAGE}/u-boot-sunxi-with-spl.bin of=${SDIMG} bs=1024 seek=8 conv=notrunc
fi
}

View File

@ -0,0 +1,11 @@
require conf/machine/include/sunxi.inc
require conf/machine/include/sunxi-mali.inc
require conf/machine/include/arm/arch-armv8.inc
SOC_FAMILY = "sun50i"
PREFERRED_PROVIDER_virtual/kernel = "linux-sun50i"
PREFERRED_PROVIDER_u-boot = "u-boot-sun50i"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-sun50i"
KERNEL_IMAGETYPE = "Image"

View File

@ -5,6 +5,8 @@ include conf/machine/include/soc-family.inc
MACHINE_SOCARCH_SUFFIX ?= ""
MACHINE_SOCARCH_SUFFIX_sun4i = "-sun4i"
MANUFACTURER ?= "allwinner"
PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg"
XSERVER = "xserver-xorg \
xf86-video-fbturbo \

View File

@ -0,0 +1,13 @@
#@TYPE: Machine
#@NAME: orange-pi-pc2
#@DESCRIPTION: Machine configuration for the orange-pi-pc2, base on allwinner H5 CPU
require conf/machine/include/sun50i.inc
PREFERRED_VERSION_linux = "4.13+git%"
PREFERRED_VERSION_u-boot = "v2017.09%"
KERNEL_DEVICETREE = "${MANUFACTURER}/sun50i-h5-orangepi-pc2.dtb"
UBOOT_MACHINE = "orangepi_pc2_defconfig"
DEFAULTTUNE = "aarch64"

Binary file not shown.

View File

@ -0,0 +1,11 @@
# Default to (primary) SD
rootdev=mmcblk0p2
if itest.b *0x28 == 0x02 ; then
# U-Boot loaded from eMMC or secondary SD so use it for rootfs too
echo "U-boot loaded from eMMC or secondary SD"
rootdev=mmcblk1p2
fi
setenv bootargs console=${console} console=tty1 root=/dev/${rootdev} panic=10
load mmc 0:1 ${fdt_addr_r} ${fdtfile} || load mmc 0:1 ${fdt_addr_r} boot/${fdtfile}
load mmc 0:1 ${kernel_addr_r} zImage || load mmc 0:1 ${kernel_addr_r} boot/zImage || load mmc 0:1 ${kernel_addr_r} uImage || load mmc 0:1 ${kernel_addr_r} boot/uImage
booti ${kernel_addr_r} - ${fdt_addr_r}

View File

@ -0,0 +1,52 @@
DESCRIPTION="Upstream's U-boot configured for sunxi devices"
FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot-sun50i/:"
require recipes-bsp/u-boot/u-boot.inc
DEPENDS += "dtc-native"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "\
file://Licenses/Exceptions;md5=338a7cb1e52d0d1951f83e15319a3fe7 \
file://Licenses/bsd-2-clause.txt;md5=6a31f076f5773aabd8ff86191ad6fdd5 \
file://Licenses/bsd-3-clause.txt;md5=4a1190eac56a9db675d58ebe86eaf50c \
file://Licenses/eCos-2.0.txt;md5=b338cb12196b5175acd3aa63b0a0805c \
file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://Licenses/ibm-pibs.txt;md5=c49502a55e35e0a8a1dc271d944d6dba \
file://Licenses/isc.txt;md5=ec65f921308235311f34b79d844587eb \
file://Licenses/lgpl-2.0.txt;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
file://Licenses/lgpl-2.1.txt;md5=4fbd65380cdd255951079008b364516c \
file://Licenses/x11.txt;md5=b46f176c847b8742db02126fb8af92e2 \
"
COMPATIBLE_MACHINE = "(sun50i)"
DEFAULT_PREFERENCE_sun50i="1"
SRC_URI = "git://git.denx.de/u-boot.git;branch=master \
file://boot.cmd \
file://bl31.bin \
"
SRCREV = "c98ac3487e413c71e5d36322ef3324b21c6f60f9"
PV = "v2017.9+git${SRCPV}"
PE = "2"
S = "${WORKDIR}/git"
SPL_BINARY = "spl/sunxi-spl.bin"
UBOOT_BINARY = "u-boot.itb"
UBOOT_ENV_SUFFIX = "scr"
UBOOT_ENV = "boot"
do_compile_prepend() {
cp ${WORKDIR}/bl31.bin ${B}
}
do_compile_append() {
${B}/tools/mkimage -C none -A arm -T script -d ${WORKDIR}/boot.cmd ${WORKDIR}/${UBOOT_ENV_BINARY}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
SECTION = "kernel"
DESCRIPTION = "Mainline Linux kernel"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
COMPATIBLE_MACHINE = "(sun50i)"
FILESEXTRAPATHS_prepend := "${THISDIR}/linux-sun50i/:"
inherit kernel
require recipes-kernel/linux/linux-dtb.inc
require linux.inc
# Pull in the devicetree files into the rootfs
RDEPENDS_kernel-base += "kernel-devicetree"
# Default is to use stable kernel version
# If you want to use latest git version set to "1"
DEFAULT_PREFERENCE = "-1"
KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
PV = "4.13+git${SRCPV}"
SRCREV_pn-${PN} = "569dbb88e80deb68974ef6fdd6a13edb9d686261"
SRC_URI = "git://github.com/torvalds/linux.git;protocol=https;branch=master \
file://defconfig \
"
S = "${WORKDIR}/git"