summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Grosser <jeremy@synack.me>2018-10-18 13:35:23 +0000
committerDenys Dmytriyenko <denys@ti.com>2018-10-18 22:51:45 +0000
commite3e20300d40e0d3577d0d25af151c9d4b69cf44b (patch)
tree2cb2d6c1c9d1b8a4ff011fbb4e1a5284604fbfef
parentfab8b9c0331533cfdf02a390bd1d2bcfce557c95 (diff)
downloadmeta-ti-e3e20300d40e0d3577d0d25af151c9d4b69cf44b.tar.gz
lego-ev3: Add support for LEGO Mindstorms EV3 (AM1808)
Thanks for the feedback! Updated patch below. Changes: - Change SERIAL_CONSOLE to new SERIAL_CONSOLES format. - Move SPL_BINARY variable into lego-ev3 machine config - Check for KERNEL_DEVICETREE_BUNDLE before uImage manipulation. - Fix line wrapping errors introduced by MUA Signed-off-by: Jeremy Grosser <jeremy@synack.me> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
-rw-r--r--conf/machine/lego-ev3.conf22
-rw-r--r--recipes-bsp/u-boot/u-boot-ti.inc1
-rw-r--r--recipes-kernel/linux/bundle-devicetree.inc26
-rw-r--r--recipes-kernel/linux/linux-ti-staging_4.14.bb1
4 files changed, 50 insertions, 0 deletions
diff --git a/conf/machine/lego-ev3.conf b/conf/machine/lego-ev3.conf
new file mode 100644
index 00000000..5c425221
--- /dev/null
+++ b/conf/machine/lego-ev3.conf
@@ -0,0 +1,22 @@
1#@TYPE: Machine
2#@NAME: LEGO Mindstorms EV3
3#@DESCRIPTION: Machine configuration for the LEGO Mindstorms EV3
4
5require conf/machine/include/davinci.inc
6require conf/machine/include/omapl138.inc
7
8UBOOT_MACHINE = "legoev3_config"
9UBOOT_SUFFIX = "bin"
10UBOOT_ENTRYPOINT = "0xC0008000"
11UBOOT_LOADADDRESS = "0xC0008000"
12SPL_BINARY = ""
13
14KERNEL_DEVICETREE = "da850-lego-ev3.dtb"
15KERNEL_IMAGETYPES = "uImage"
16KERNEL_DEVICETREE_BUNDLE = "1"
17SERIAL_CONSOLES = "115200;ttyS1"
18
19IMAGE_FSTYPES += " wic"
20WKS_FILE = "sdimage-bootpart.wks"
21WIC_CREATE_EXTRA_ARGS += " --no-fstab-update"
22IMAGE_BOOT_FILES = "${KERNEL_IMAGETYPES}"
diff --git a/recipes-bsp/u-boot/u-boot-ti.inc b/recipes-bsp/u-boot/u-boot-ti.inc
index d3267be1..62f04f7c 100644
--- a/recipes-bsp/u-boot/u-boot-ti.inc
+++ b/recipes-bsp/u-boot/u-boot-ti.inc
@@ -55,6 +55,7 @@ export TI_SECURE_DEV_PKG
55SPL_UART_BINARY = "u-boot-spl.bin" 55SPL_UART_BINARY = "u-boot-spl.bin"
56SPL_UART_BINARY_keystone = "" 56SPL_UART_BINARY_keystone = ""
57SPL_UART_BINARY_k3 = "" 57SPL_UART_BINARY_k3 = ""
58SPL_UART_BINARY_lego-ev3 = ""
58 59
59SPL_UART_IMAGE ?= "${SPL_UART_BINARY}-${MACHINE}-${PV}-${PR}" 60SPL_UART_IMAGE ?= "${SPL_UART_BINARY}-${MACHINE}-${PV}-${PR}"
60SPL_UART_SYMLINK ?= "${SPL_UART_BINARY}-${MACHINE}" 61SPL_UART_SYMLINK ?= "${SPL_UART_BINARY}-${MACHINE}"
diff --git a/recipes-kernel/linux/bundle-devicetree.inc b/recipes-kernel/linux/bundle-devicetree.inc
new file mode 100644
index 00000000..4d450374
--- /dev/null
+++ b/recipes-kernel/linux/bundle-devicetree.inc
@@ -0,0 +1,26 @@
1# Upstream kernel-devicetree.bbclass only supports bundling the DTB with
2# zImage. The factory u-boot on lego-ev3 EEPROM only supports uImage, so we
3# append the DTB to the final uImage here.
4
5do_deploy_append() {
6 if [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
7 install -d ${DEPLOYDIR}
8 for dtbf in ${KERNEL_DEVICETREE}; do
9 dtb=`normalize_dtb "$dtbf"`
10 dtb_ext=${dtb##*.}
11 dtb_base_name=`basename $dtb .$dtb_ext`
12 for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
13 if [ "$type" = "uImage" ]; then
14 cat ${D}/${KERNEL_IMAGEDEST}/$type \
15 ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext \
16 > ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin
17 ln -sf $type-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin \
18 ${DEPLOYDIR}/$type-$dtb_base_name-${KERNEL_DTB_LINK_NAME}.$dtb_ext.bin
19 cat ${D}/${KERNEL_IMAGEDEST}/$type \
20 ${DEPLOYDIR}/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext \
21 > ${DEPLOYDIR}/$type
22 fi
23 done
24 done
25 fi
26}
diff --git a/recipes-kernel/linux/linux-ti-staging_4.14.bb b/recipes-kernel/linux/linux-ti-staging_4.14.bb
index 5ee206ec..13b94ffe 100644
--- a/recipes-kernel/linux/linux-ti-staging_4.14.bb
+++ b/recipes-kernel/linux/linux-ti-staging_4.14.bb
@@ -8,6 +8,7 @@ inherit kernel
8require recipes-kernel/linux/setup-defconfig.inc 8require recipes-kernel/linux/setup-defconfig.inc
9require recipes-kernel/linux/cmem.inc 9require recipes-kernel/linux/cmem.inc
10require recipes-kernel/linux/ti-uio.inc 10require recipes-kernel/linux/ti-uio.inc
11require recipes-kernel/linux/bundle-devicetree.inc
11 12
12# Look in the generic major.minor directory for files 13# Look in the generic major.minor directory for files
13FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-4.14:" 14FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-4.14:"