+++ /dev/null
-setenv finduuid "part uuid mmc 1:1 uuid"
-run finduuid
-run findfdt
-setenv bootargs "console=ttymxc0,115200 root=PARTUUID=${uuid} rootwait rootfstype=ext4"
-load mmc 1:1 ${fdt_addr} boot/${fdtfile}
-load mmc 1:1 ${loadaddr} boot/zImage
-bootz ${loadaddr} - ${fdt_addr}
+++ /dev/null
-# Minimal SD card image for the MX6 Cubox/Hummingboard
-#
-# U-Boot SPL and u-boot.img are flashed in the first 1MB raw partition.
-# A single root filesystem partition is used (Ext4 in this case).
-#
-
-image sdcard.img {
- hdimage {
- }
-
- partition spl {
- in-partition-table = "no"
- image = "SPL"
- offset = 1K
- }
-
- partition u-boot {
- in-partition-table = "no"
- image = "u-boot.img"
- offset = 69K
- }
-
- partition rootfs {
- partition-type = 0x83
- image = "rootfs.ext4"
- offset = 1M
- size = 512M
- }
-}
--- /dev/null
+From 96db7c072b96f9b7a1d9a986eff20353f7459004 Mon Sep 17 00:00:00 2001
+From: Fabio Estevam <festevam@gmail.com>
+Date: Sun, 18 Jul 2021 19:08:36 -0300
+Subject: [PATCH] mx6cuboxi: Fix the mmc device for the rootfs
+
+After the comversion to DM_MMC, the rootfs is mmc 1, so
+adjust it accordingly.
+
+Signed-off-by: Fabio Estevam <festevam@gmail.com>
+---
+ include/configs/mx6cuboxi.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h
+index 55717c77ab38..1a06f29b8c17 100644
+--- a/include/configs/mx6cuboxi.h
++++ b/include/configs/mx6cuboxi.h
+@@ -57,7 +57,7 @@
+ "console=" CONSOLE_DEV ",115200\0" \
+ "bootm_size=0x10000000\0" \
+ "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
+- "finduuid=part uuid mmc 0:1 uuid\0" \
++ "finduuid=part uuid mmc 1:1 uuid\0" \
+ "update_sd_firmware=" \
+ "if test ${ip_dyn} = yes; then " \
+ "setenv get_cmd dhcp; " \
+--
+2.25.1
+
--- /dev/null
+From ab1dd9332c379164925aee755a013dbd8839501b Mon Sep 17 00:00:00 2001
+From: Fabio Estevam <festevam@gmail.com>
+Date: Mon, 19 Jul 2021 16:48:07 -0300
+Subject: [PATCH 2/2] mx6cuboxi: Fix the console variable
+
+Do not pass the console baudrate to the 'console' variable
+to avoid the baudrate being passed twice when using extlinux.conf:
+
+cat /proc/cmdline
+root=PARTUUID=00000000-01 rootwait rw console=ttymxc0,115200,115200
+
+Signed-off-by: Fabio Estevam <festevam@gmail.com>
+---
+ include/configs/mx6cuboxi.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h
+index 1a06f29b8c17..9e5083b0d876 100644
+--- a/include/configs/mx6cuboxi.h
++++ b/include/configs/mx6cuboxi.h
+@@ -38,7 +38,6 @@
+ /* Command definition */
+
+ #define CONFIG_MXC_UART_BASE UART1_BASE
+-#define CONSOLE_DEV "ttymxc0"
+
+ #ifndef CONFIG_SPL_BUILD
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+@@ -54,7 +53,7 @@
+ "ramdiskaddr=0x13000000\0" \
+ "initrd_high=0xffffffff\0" \
+ "ip_dyn=yes\0" \
+- "console=" CONSOLE_DEV ",115200\0" \
++ "console=ttymxc0\0" \
+ "bootm_size=0x10000000\0" \
+ "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
+ "finduuid=part uuid mmc 1:1 uuid\0" \
+--
+2.25.1
+
+++ /dev/null
-#!/bin/sh
-
-BOARD_DIR="$(dirname $0)"
-
-install -d -m 755 $TARGET_DIR/boot
-
-$HOST_DIR/bin/mkimage -A arm -O linux -T script -C none \
- -n "boot script" -d $BOARD_DIR/boot.scr.txt $TARGET_DIR/boot/boot.scr
+++ /dev/null
-#!/usr/bin/env bash
-
-BOARD_DIR="$(dirname $0)"
-GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage \
- --rootpath "${TARGET_DIR}" \
- --tmppath "${GENIMAGE_TMP}" \
- --inputpath "${BINARIES_DIR}" \
- --outputpath "${BINARIES_DIR}" \
- --config "${GENIMAGE_CFG}"
--- /dev/null
+Label imx6qdl-cubox Buildroot
+ kernel ../zImage
+ fdtdir ../
+ append root=PARTUUID=${uuid} rootwait rw console=${console},${baudrate}
# System configuration
BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
-BR2_ROOTFS_POST_BUILD_SCRIPT="board/solidrun/mx6cubox/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/solidrun/mx6cubox/post-image.sh"
+BR2_ROOTFS_OVERLAY="board/solidrun/mx6cubox/rootfs_overlay"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
+BR2_GLOBAL_PATCH_DIR="board/solidrun/mx6cubox/patches"
# Kernel
BR2_LINUX_KERNEL=y