Skip to contentSkip to conversation

pico-imx6ul: Convert to distro config

PATCH New Otavio Salvador 4 participants 24 messages Sep 13, 2018 – Sep 14, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/14 pico-imx6ul: Convert to distro config

From: Fabio Estevam <[email protected]>

Instead of keeping a custom environment, use a more generic approach by switching to disto config.

---

Changes in v3: None
Changes in v2: None

 configs/pico-imx6ul_defconfig |  2 +
 include/configs/pico-imx6ul.h | 69 ++++++++++-------------------------
 2 files changed, 21 insertions(+), 50 deletions(-)
configs/pico-imx6ul_defconfig +2 -0
index 59ef7b7f22..3f969a2d6e 100644
@@ -4,7 +4,9 @@ CONFIG_SYS_TEXT_BASE=0x87800000
 CONFIG_TARGET_PICO_IMX6UL=y
 # CONFIG_CMD_BMODE is not set
 CONFIG_NR_DRAM_BANKS=1
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/technexion/pico-imx6ul/imximage.cfg"
+CONFIG_BOOTCOMMAND="run finduuid; run distro_bootcmd"
 CONFIG_BOOTDELAY=3
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_DEFAULT_FDT_FILE="imx6ul-pico-hobbit.dtb"
include/configs/pico-imx6ul.h +19 -50

83 lines not on this page · raw message

Signature · 1 line
2.19.0
#1 lore raw

PATCH v3 2/14 pico-imx6ul: Convert to SPL

From: Fabio Estevam <[email protected]>

There are two versions of imx6ul pico SOMs: one with 256MB and another one with 512MB of RAM.

Convert to SPL so that both versions can be supported. This patch doesn't rework the clock initialization to avoid changing the behavior in this same patch, so it will be cleaned up in future.

Currently only the 256MB is tested/supported.

---

Changes in v3: None
Changes in v2:
- add newline after SPDX header
- avoid initializing CCGR7 as UL does not have it
- mention clocks initialization will be cleaned up in future

 arch/arm/mach-imx/mx6/Kconfig         |   1 +
 board/technexion/pico-imx6ul/Makefile |   2 +-
 board/technexion/pico-imx6ul/spl.c    | 115 ++++++++++++++++++++++++++
 configs/pico-imx6ul_defconfig         |  14 +++-
 include/configs/pico-imx6ul.h         |   1 +
 5 files changed, 131 insertions(+), 2 deletions(-)
 create mode 100644 board/technexion/pico-imx6ul/spl.c
arch/arm/mach-imx/mx6/Kconfig +1 -0
index a2799c436e..06c25bae36 100644
@@ -402,6 +402,7 @@ config TARGET_OT1200
 config TARGET_PICO_IMX6UL
 	bool "PICO-IMX6UL-EMMC"
 	select MX6UL
+	select SUPPORT_SPL
 
 config TARGET_LITEBOARD
 	bool "Grinn liteBoard (i.MX6UL)"
board/technexion/pico-imx6ul/Makefile +1 -1
index 8fdb7875ac..b7493df01c 100644
@@ -2,4 +2,4 @@
 # (C) Copyright 2015 Technexion Ltd.
 # (C) Copyright 2015 Freescale Semiconductor, Inc.
 
-obj-y  := pico-imx6ul.o
+obj-y  := pico-imx6ul.o spl.o
board/technexion/pico-imx6ul/spl.c new file +115 -0

115 lines not on this page · raw message

configs/pico-imx6ul_defconfig +13 -1
index 3f969a2d6e..589e67be96 100644
@@ -1,12 +1,23 @@
 CONFIG_ARM=y
 CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x87800000
+CONFIG_SPL_GPIO_SUPPORT=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_TARGET_PICO_IMX6UL=y
+CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL=y
+CONFIG_SPL_LIBDISK_SUPPORT=y
 # CONFIG_CMD_BMODE is not set
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/technexion/pico-imx6ul/imximage.cfg"
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTCOMMAND="run finduuid; run distro_bootcmd"
+CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_USB_HOST_SUPPORT=y
+CONFIG_SPL_USB_GADGET_SUPPORT=y
+CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_BOOTDELAY=3
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_DEFAULT_FDT_FILE="imx6ul-pico-hobbit.dtb"
@@ -21,6 +32,7 @@ CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PART=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
include/configs/pico-imx6ul.h +1 -0
index 1a148bf1a6..14d5cc3ddb 100644
@@ -12,6 +12,7 @@
 #include <linux/sizes.h>
 #include "mx6_common.h"
 #include <asm/mach-imx/gpio.h>
+#include "imx6_spl.h"
 
 /* Network support */
 
Signature · 1 line
2.19.0
#2 lore raw

PATCH v3 3/14 pico-imx6ul: Add fastboot support

In reply to Otavio Salvador

From: Fabio Estevam <[email protected]>

fastboot tool is a convenient way to flash the eMMC, so add support for it.

Examples of usages:

On the pico-imx6ul U-Boot prompt:

=> fastboot 0

On the Linux PC connected via USB:

1. Retrieving the U-Boot version

$ sudo fastboot getvar bootloader-version -i 0x0525
bootloader-version: U-Boot 2018.07-rc2-00130-g0881835-dirty
finished. total time: 0.000s

2. Resetting the board

$ sudo fastboot reboot -i 0x0525

(this causes the pico-imx6ul to reboot)

---

Changes in v3: None
Changes in v2: None

 configs/pico-imx6ul_defconfig | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
configs/pico-imx6ul_defconfig +6 -1
index 589e67be96..cae7ded1fa 100644
@@ -45,6 +45,12 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DFU_MMC=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x82000000
+CONFIG_FASTBOOT_BUF_SIZE=0x10000000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
+CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
 CONFIG_FSL_ESDHC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MICREL=y
@@ -56,5 +62,4 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
-CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_OF_LIBFDT=y
Signature · 1 line
2.19.0
#3 lore raw

PATCH v3 4/14 pico-imx6ul: Add bmode support

In reply to Otavio Salvador

From: Fabio Estevam <[email protected]>

The 'bmode' command is helpful for switching the boot media.

In the case of pico-imx6ul there are two possible boot media:
eMMC or USB.

To boot from eMMC:

=> bmode emmc

To boot from USB (via Serial Download Protocol):

=> bmode usb

---

Changes in v3: None
Changes in v2: None

 configs/pico-imx6ul_defconfig | 1 -
 1 file changed, 1 deletion(-)
configs/pico-imx6ul_defconfig +0 -1
index cae7ded1fa..daa898fb22 100644
@@ -9,7 +9,6 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
-# CONFIG_CMD_BMODE is not set
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
Signature · 1 line
2.19.0
#4 lore raw

PATCH v3 5/14 pico-imx6ul: Add support for the 512MB module

In reply to Otavio Salvador

From: Fabio Estevam <[email protected]>

Currently only the module with 256MB of RAM is supported.

Add support for the 512MB of RAM variant as well.

---

Changes in v3: None
Changes in v2: None

 board/technexion/pico-imx6ul/spl.c | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)
board/technexion/pico-imx6ul/spl.c +24 -3
index 78c731fe7c..1819722024 100644
@@ -70,7 +70,6 @@ static struct mx6_ddr3_cfg mem_ddr = {
 	.density = 2,
 	.width = 16,
 	.banks = 8,
-	.rowaddr = 14,
 	.coladdr = 10,
 	.pagesz = 2,
 	.trcd = 1350,
@@ -91,12 +90,34 @@ static void ccgr_init(void)
 	writel(0xFFFFFFFF, &ccm->CCGR6);
 }
 
-static void spl_dram_init(void)
+static void imx6ul_spl_dram_cfg_size(u32 ram_size)
 {
+	if (ram_size == SZ_256M)
+		mem_ddr.rowaddr = 14;
+	else
+		mem_ddr.rowaddr = 15;
+
 	mx6ul_dram_iocfg(mem_ddr.width, &mx6_ddr_ioregs, &mx6_grp_ioregs);
 	mx6_dram_cfg(&ddr_sysinfo, &mx6_mmcd_calib, &mem_ddr);
 }
 
+static void imx6ul_spl_dram_cfg(void)
+{
+	ulong ram_size_test, ram_size = 0;
+
+	for (ram_size = SZ_512M; ram_size >= SZ_256M; ram_size >>= 1) {
+		imx6ul_spl_dram_cfg_size(ram_size);
+		ram_size_test = get_ram_size((long int *)PHYS_SDRAM, ram_size);
+		if (ram_size_test == ram_size)
+			break;
+	}
+
+	if (ram_size < SZ_256M) {
+		puts("ERROR: DRAM size detection failed\n");
+		hang();
+	}
+}
+
 void board_init_f(ulong dummy)
 {
 	ccgr_init();
@@ -104,7 +125,7 @@ void board_init_f(ulong dummy)
 	board_early_init_f();
 	timer_init();
 	preloader_console_init();
-	spl_dram_init();
+	imx6ul_spl_dram_cfg();
 	memset(__bss_start, 0, __bss_end - __bss_start);
 	board_init_r(NULL, 0);
 }
Signature · 1 line
2.19.0
#5 lore raw

PATCH v3 6/14 pico-imx6ul: Update the README file

In reply to Otavio Salvador

From: Fabio Estevam <[email protected]>

Update the README file to take into accound the switch to SPL.

---

Changes in v3: None
Changes in v2: None

 board/technexion/pico-imx6ul/README | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)
board/technexion/pico-imx6ul/README +20 -6
index 2f66095097..a5415714ee 100644
@@ -13,7 +13,13 @@ $ make mrproper
 $ make pico-imx6ul_defconfig
 $ make
 
-This will generate the U-Boot binary called u-boot.imx.
+This generates the SPL and u-boot.img binaries.
+
+1. Loading U-Boot via USB Serial Download Protocol
+
+Note: This method is convenient for development purposes.
+If the eMMC has already a U-Boot flashed with DFU support then
+the user can go to step 2 below in order to update U-Boot.
 
 Put pico board in USB download mode (refer to the document
 http://www.wandboard.org/images/hobbit/hobbitboard-imx6ul-reva1.pdf page 15)
@@ -24,11 +30,15 @@ Connect a USB cable between the OTG pico port and the host PC
 
 Open a terminal program such as minicom
 
-Copy u-boot.imx to the imx_usb_loader folder.
+Copy SPL and u-boot.img to the imx_usb_loader folder.
+
+Load the SPL binary via USB:
 
-Load u-boot.imx via USB:
+$ sudo ./imx_usb SPL
 
-$ sudo ./imx_usb u-boot.imx
+Load the u-boot.img binary via USB:
+
+$ sudo ./imx_usb u-boot.img
 
 Then U-Boot should start and its messages will appear in the console program.
 
@@ -37,12 +47,16 @@ Use the default environment variables:
 => env default -f -a
 => saveenv
 
+2. Flashing U-Boot into the eMMC
+
 Run the DFU command:
 => dfu 0 mmc 0
 
-Transfer u-boot.imx that will be flashed into the eMMC:
+Flash SPL and u-boot.img into the eMMC running the following commands on a PC:
+
+$ sudo dfu-util -D SPL -a spl
 
-$ sudo dfu-util -D u-boot.imx -a boot
+$ sudo dfu-util -D u-boot.img -a u-boot
 
 Then on the U-Boot prompt the following message should be seen after a
 successful upgrade:
Signature · 1 line
2.19.0
#6 lore raw

PATCH v3 7/14 pico-imx6ul: Sync defconfig with new changes

In reply to Otavio Salvador

Due the changes in previous commits, we need to resync the defconfig to reduce noise in next commits.

---

Changes in v3: None
Changes in v2: None

 configs/pico-imx6ul_defconfig | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)
configs/pico-imx6ul_defconfig +4 -16
index daa898fb22..56cb4810dc 100644
@@ -9,43 +9,31 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
-CONFIG_NR_DRAM_BANKS=1
 CONFIG_DISTRO_DEFAULTS=y
+CONFIG_NR_DRAM_BANKS=1
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
+CONFIG_BOOTDELAY=3
 CONFIG_BOOTCOMMAND="run finduuid; run distro_bootcmd"
+CONFIG_DEFAULT_FDT_FILE="imx6ul-pico-hobbit.dtb"
+CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_USB_HOST_SUPPORT=y
 CONFIG_SPL_USB_GADGET_SUPPORT=y
 CONFIG_SPL_USB_SDP_SUPPORT=y
-CONFIG_BOOTDELAY=3
-CONFIG_SUPPORT_RAW_INITRD=y
-CONFIG_DEFAULT_FDT_FILE="imx6ul-pico-hobbit.dtb"
-CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_HUSH_PARSER=y
-CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
-CONFIG_CMD_PART=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_SDP=y
 CONFIG_CMD_USB_MASS_STORAGE=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DFU_MMC=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
-CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_FASTBOOT_BUF_SIZE=0x10000000
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
Signature · 1 line
2.19.0
#7 lore raw

PATCH v3 8/14 pico-imx6ul: Add bootmenu to choose the baseboard

In reply to Otavio Salvador

Currently the baseboards do not offer a way to autodetect which one is in use, so we ask the user if no value has been set.

---

Changes in v3: None
Changes in v2: None

 configs/pico-imx6ul_defconfig |  5 +++--
 include/configs/pico-imx6ul.h | 10 ++++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)
configs/pico-imx6ul_defconfig +3 -2
index 56cb4810dc..3d4063b136 100644
@@ -13,13 +13,14 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
-CONFIG_BOOTCOMMAND="run finduuid; run distro_bootcmd"
-CONFIG_DEFAULT_FDT_FILE="imx6ul-pico-hobbit.dtb"
+CONFIG_BOOTCOMMAND="run findfdt; run finduuid; run distro_bootcmd"
+CONFIG_DEFAULT_FDT_FILE="ask"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_USB_HOST_SUPPORT=y
 CONFIG_SPL_USB_GADGET_SUPPORT=y
 CONFIG_SPL_USB_SDP_SUPPORT=y
+CONFIG_CMD_BOOTMENU=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
include/configs/pico-imx6ul.h +10 -0
index 14d5cc3ddb..2276f72bae 100644
@@ -50,6 +50,10 @@
 		"/imx6ul-pico-hobbit.dtb ext4 0 1;" \
 		"rootfs part 0 2\0" \
 
+#define BOOTMENU_ENV \
+	"bootmenu_0=Boot using PICO-Hobbit baseboard=" \
+		"setenv fdtfile imx6ul-pico-hobbit.dtb\0" \
+
 #define CONFIG_SYS_MMC_IMG_LOAD_PART	1
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
@@ -59,6 +63,7 @@
 	"fdt_high=0xffffffff\0" \
 	"initrd_high=0xffffffff\0" \
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
+	BOOTMENU_ENV \
 	"fdt_addr=0x83000000\0" \
 	"fdt_addr_r=0x83000000\0" \
 	"kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
@@ -67,6 +72,11 @@
 	"ramdiskaddr=0x83000000\0" \
 	"scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
 	CONFIG_DFU_ENV_SETTINGS \
+	"findfdt=" \
+		"if test $fdtfile = ask ; then " \
+			"bootmenu -1; fi;" \
+		"if test $fdtfile != ask ; then " \
+			"saveenv; fi;\0" \
 	"finduuid=part uuid mmc 0:1 uuid\0" \
 	"partitions=" \
 		"uuid_disk=${uuid_gpt_disk};" \
Signature · 1 line
2.19.0
#8 lore raw

PATCH v3 9/14 pico-imx6ul: Improve default DFU settings

In reply to Otavio Salvador

This rework the DFU settings so it supports the SPL and U-Boot image, as well as the single partition layout we are using by default.

---

Changes in v3: None
Changes in v2: None

 include/configs/pico-imx6ul.h | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
include/configs/pico-imx6ul.h +6 -5
index 2276f72bae..a510fd1554 100644
@@ -44,11 +44,12 @@
 #define DFU_DEFAULT_POLL_TIMEOUT 300
 
 #define CONFIG_DFU_ENV_SETTINGS \
-	"dfu_alt_info=uboot raw 0x2 0x400 mmcpart 1;" \
-		"boot part 0 1;" \
-		"/zImage ext4 0 1;" \
-		"/imx6ul-pico-hobbit.dtb ext4 0 1;" \
-		"rootfs part 0 2\0" \
+	"dfu_alt_info=" \
+		"spl raw 0x2 0x400 mmcpart 1;" \
+		"u-boot raw 0x8a 0x400 mmcpart 1;" \
+		"/boot/zImage ext4 0 1;" \
+		"/boot/imx6ul-pico-hobbit.dtb ext4 0 1;" \
+		"rootfs part 0 1\0" \
 
 #define BOOTMENU_ENV \
 	"bootmenu_0=Boot using PICO-Hobbit baseboard=" \
Signature · 1 line
2.19.0
#9 lore raw

PATCH v3 10/14 pico-imx6ul: Sync README with pico-imx7d

In reply to Otavio Salvador

---

Changes in v3: None
Changes in v2: None

 board/technexion/pico-imx6ul/README | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)
board/technexion/pico-imx6ul/README +9 -13
index a5415714ee..66dc977d49 100644
@@ -22,13 +22,14 @@ If the eMMC has already a U-Boot flashed with DFU support then
 the user can go to step 2 below in order to update U-Boot.
 
 Put pico board in USB download mode (refer to the document
-http://www.wandboard.org/images/hobbit/hobbitboard-imx6ul-reva1.pdf page 15)
+http://www.wandboard.org/images/hobbit/hobbitboard-imx6ul-reva1.pdf
+page 15).
 
-Connect a USB to serial adapter between the host PC and pico
+Connect a USB to serial adapter between the host PC and pico.
 
-Connect a USB cable between the OTG pico port and the host PC
+Connect a USB cable between the OTG pico port and the host PC.
 
-Open a terminal program such as minicom
+Open a terminal program such as minicom.
 
 Copy SPL and u-boot.img to the imx_usb_loader folder.
 
@@ -40,7 +41,7 @@ Load the u-boot.img binary via USB:
 
 $ sudo ./imx_usb u-boot.img
 
-Then U-Boot should start and its messages will appear in the console program.
+Then U-Boot starts and its messages appear in the console program.
 
 Use the default environment variables:
 
@@ -49,7 +50,8 @@ Use the default environment variables:
 
 2. Flashing U-Boot into the eMMC
 
-Run the DFU command:
+Run the DFU agent so we can flash the new images using dfu-util tool:
+
 => dfu 0 mmc 0
 
 Flash SPL and u-boot.img into the eMMC running the following commands on a PC:
@@ -58,14 +60,8 @@ $ sudo dfu-util -D SPL -a spl
 
 $ sudo dfu-util -D u-boot.img -a u-boot
 
-Then on the U-Boot prompt the following message should be seen after a
-successful upgrade:
-
-#DOWNLOAD ... OK
-Ctrl+C to exit ...
-
 Remove power from the pico board.
 
-Put pico board into normal boot mode
+Put pico board into normal boot mode.
 
 Power up the board and the new updated U-Boot should boot from eMMC.
Signature · 1 line
2.19.0
#10 lore raw

PATCH v3 11/14 pico-imx6ul: Add new pico-hobbit config

In reply to Otavio Salvador

The new config skips the boot menu which asks which board is in use. This is useful to allow direct booting of image without user iteration.

---

Changes in v3: None
Changes in v2: None

 board/technexion/pico-imx6ul/MAINTAINERS |  5 +++
 configs/pico-hobbit-imx6ul_defconfig     | 53 ++++++++++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 configs/pico-hobbit-imx6ul_defconfig
board/technexion/pico-imx6ul/MAINTAINERS +5 -0
index 594a883d15..334847cf71 100644
@@ -5,3 +5,8 @@ S:	Maintained
 F:	board/technexion/pico-imx6ul/
 F:	include/configs/pico-imx6ul.h
 F:	configs/pico-imx6ul_defconfig
+
+Technexion PICO-HOBBIT-IMX6UL
+M:	Otavio Salvador <[email protected]>
+S:	Maintained
+F:	configs/pico-hobbit-imx6ul_defconfig
configs/pico-hobbit-imx6ul_defconfig new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
2.19.0
#11 lore raw

PATCH v3 12/14 pico-imx6ul: Remove CONFIG_FSL_USDHC from .h

In reply to Otavio Salvador

The FSL_USDHC support is now handled by Kconfig and it is enabled on the respective defconfig so the setting in .h is pointless.

---

Changes in v3: None
Changes in v2: None

 include/configs/pico-imx6ul.h | 1 -
 1 file changed, 1 deletion(-)
include/configs/pico-imx6ul.h +0 -1
index a510fd1554..94c14a7a43 100644
@@ -28,7 +28,6 @@
 #define CONFIG_MXC_UART_BASE		UART6_BASE_ADDR
 
 /* MMC Configs */
-#define CONFIG_FSL_USDHC
 #define CONFIG_SYS_FSL_ESDHC_ADDR	USDHC1_BASE_ADDR
 #define CONFIG_SUPPORT_EMMC_BOOT
 
Signature · 1 line
2.19.0
reviewer
#12 lore raw

PATCH v3 12/14 pico-imx6ul: Remove CONFIG_FSL_USDHC from .h

Hi Otavio,

Quoted 2 lines · Otavio Salvador

The FSL_USDHC support is now handled by Kconfig and it is enabled on the respective defconfig so the setting in .h is pointless.

Just checked and I don't see FSL_USDHC option in Kconfig.

Quoted 14 lines

---

Changes in v3: None
Changes in v2: None

 include/configs/pico-imx6ul.h | 1 -
 1 file changed, 1 deletion(-)
include/configs/pico-imx6ul.h +0 -0
index a510fd1554..94c14a7a43 100644

include/configs/pico-imx6ul.h line 31

Quoted 4 lines
include/configs/pico-imx6ul.h +0 -1
@@ -28,7 +28,6 @@
 #define CONFIG_MXC_UART_BASE           UART6_BASE_ADDR
 
 /* MMC Configs */
-#define CONFIG_FSL_USDHC

I see that CONFIG_FSL_USDHC is defined inside "mx6_common.h", which is already included in this file, so the change looks good, but the commit message needs to be reworked.

Thanks

#13 lore raw

PATCH v3 12/14 pico-imx6ul: Remove CONFIG_FSL_USDHC from .h

Quoted 1 line · Fabio Estevam

...

Quoted 3 lines

I see that CONFIG_FSL_USDHC is defined inside "mx6_common.h", which is already included in this file, so the change looks good, but the commit message needs to be reworked.

Like:

pico-imx6ul: Remove CONFIG_FSL_USDHC from .h

The CONFIG_FSL_USDHC is defined inside "mx6_common.h", which is already included in this file.

?

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750
reviewer
#14 lore raw

PATCH v3 12/14 pico-imx6ul: Remove CONFIG_FSL_USDHC from .h

Quoted 7 lines · Otavio Salvador
Quoted 1 line · Fabio Estevam

...

Quoted 3 lines

I see that CONFIG_FSL_USDHC is defined inside "mx6_common.h", which is already included in this file, so the change looks good, but the commit message needs to be reworked.

Quoted 8 lines

Like:

pico-imx6ul: Remove CONFIG_FSL_USDHC from .h

The CONFIG_FSL_USDHC is defined inside "mx6_common.h", which is already included in this file.

Yes, this looks good.

You can also add:

#15 lore raw

PATCH v3 12/14 pico-imx6ul: Remove CONFIG_FSL_USDHC from .h

Quoted 17 lines · Fabio Estevam
Quoted 14 lines · Otavio Salvador
Quoted 1 line · Fabio Estevam

...

Quoted 3 lines

I see that CONFIG_FSL_USDHC is defined inside "mx6_common.h", which is already included in this file, so the change looks good, but the commit message needs to be reworked.

Like:

pico-imx6ul: Remove CONFIG_FSL_USDHC from .h

The CONFIG_FSL_USDHC is defined inside "mx6_common.h", which is already included in this file.

Quoted 7 lines
Quoted 1 line

Yes, this looks good.

You can also add:

I will wait until tomorrow to send v4.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750
#16 lore raw

PATCH v3 13/14 pico-imx6ul: Add Falcon mode support

In reply to Otavio Salvador

Falcon mode boots the kernel directly from SPL, without loading the full U-Boot.

As pico-imx6ul does not have a GPIO for selecting Falcon versus normal mode, enter in Falcon mode when the customer selects the CONFIG_SPL_OS_BOOT option in menuconfig.

---

Changes in v3:
- new patch

Changes in v2: None

 board/technexion/pico-imx6ul/spl.c |  8 ++++++++
 configs/pico-imx6ul_defconfig      |  2 ++
 include/configs/pico-imx6ul.h      | 12 ++++++++++++
 3 files changed, 22 insertions(+)
board/technexion/pico-imx6ul/spl.c +8 -0
index 1819722024..6464a32d3b 100644
@@ -14,6 +14,14 @@
 #include <spl.h>
 
 #if defined(CONFIG_SPL_BUILD)
+
+#ifdef CONFIG_SPL_OS_BOOT
+int spl_start_uboot(void)
+{
+	return 0;
+}
+#endif
+
 #include <asm/arch/mx6-ddr.h>
 
 static struct mx6ul_iomux_grp_regs mx6_grp_ioregs = {
configs/pico-imx6ul_defconfig +2 -0
index 3d4063b136..c8d58cbe71 100644
@@ -21,6 +21,8 @@ CONFIG_SPL_USB_HOST_SUPPORT=y
 CONFIG_SPL_USB_GADGET_SUPPORT=y
 CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_CMD_BOOTMENU=y
+CONFIG_CMD_SPL=y
+CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
include/configs/pico-imx6ul.h +12 -0
index 94c14a7a43..8855be107d 100644
@@ -14,6 +14,18 @@
 #include <asm/mach-imx/gpio.h>
 #include "imx6_spl.h"
 
+#ifdef CONFIG_SPL_OS_BOOT
+/* Falcon Mode */
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME   "args"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
+#define CONFIG_SYS_SPL_ARGS_ADDR   0x88000000
+
+/* Falcon Mode - MMC support: args at 1MB kernel at 2MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x800   /* 1MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
+#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR        0x1000  /* 2MB */
+#endif
+
 /* Network support */
 
 #define CONFIG_FEC_MXC
Signature · 1 line
2.19.0
#17 lore raw

PATCH v3 13/14 pico-imx6ul: Add Falcon mode support

Hi Otavio,

Quoted 7 lines · Otavio Salvador

Falcon mode boots the kernel directly from SPL, without loading the full U-Boot.

As pico-imx6ul does not have a GPIO for selecting Falcon versus normal mode, enter in Falcon mode when the customer selects the CONFIG_SPL_OS_BOOT option in menuconfig.

I merged two days ago V2 on my branch with just minor conflicts in ico-imx6ul.h on current tree. New version looks identical to V2 with exception of the last two patches. Is it enough I pick up the last two patches or is there something I am missing ?

Regards,
Stefano

Quoted 69 lines

---

Changes in v3:
- new patch

Changes in v2: None

 board/technexion/pico-imx6ul/spl.c |  8 ++++++++
 configs/pico-imx6ul_defconfig      |  2 ++
 include/configs/pico-imx6ul.h      | 12 ++++++++++++
 3 files changed, 22 insertions(+)
board/technexion/pico-imx6ul/spl.c +8 -0
index 1819722024..6464a32d3b 100644
@@ -14,6 +14,14 @@
 #include <spl.h>
 
 #if defined(CONFIG_SPL_BUILD)
+
+#ifdef CONFIG_SPL_OS_BOOT
+int spl_start_uboot(void)
+{
+	return 0;
+}
+#endif
+
 #include <asm/arch/mx6-ddr.h>
 
 static struct mx6ul_iomux_grp_regs mx6_grp_ioregs = {
configs/pico-imx6ul_defconfig +2 -0
index 3d4063b136..c8d58cbe71 100644
@@ -21,6 +21,8 @@ CONFIG_SPL_USB_HOST_SUPPORT=y
 CONFIG_SPL_USB_GADGET_SUPPORT=y
 CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_CMD_BOOTMENU=y
+CONFIG_CMD_SPL=y
+CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
include/configs/pico-imx6ul.h +12 -0
index 94c14a7a43..8855be107d 100644
@@ -14,6 +14,18 @@
 #include <asm/mach-imx/gpio.h>
 #include "imx6_spl.h"
 
+#ifdef CONFIG_SPL_OS_BOOT
+/* Falcon Mode */
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME   "args"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
+#define CONFIG_SYS_SPL_ARGS_ADDR   0x88000000
+
+/* Falcon Mode - MMC support: args at 1MB kernel at 2MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x800   /* 1MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
+#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR        0x1000  /* 2MB */
+#endif
+
 /* Network support */
 
 #define CONFIG_FEC_MXC
Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#18 lore raw

PATCH v3 13/14 pico-imx6ul: Add Falcon mode support

Quoted 9 lines · Stefano Babic
Quoted 7 lines · Otavio Salvador

Falcon mode boots the kernel directly from SPL, without loading the full U-Boot.

As pico-imx6ul does not have a GPIO for selecting Falcon versus normal mode, enter in Falcon mode when the customer selects the CONFIG_SPL_OS_BOOT option in menuconfig.

Quoted 4 lines

I merged two days ago V2 on my branch with just minor conflicts in ico-imx6ul.h on current tree. New version looks identical to V2 with exception of the last two patches. Is it enough I pick up the last two patches or is there something I am missing ?

Some commit log improvements. As it wasn't push to imx tree, do you want me to send v4 with all fixes?

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750
#19 lore raw

PATCH v3 13/14 pico-imx6ul: Add Falcon mode support

Quoted 10 lines · Otavio Salvador
Quoted 9 lines · Stefano Babic
Quoted 7 lines · Otavio Salvador

Falcon mode boots the kernel directly from SPL, without loading the full U-Boot.

As pico-imx6ul does not have a GPIO for selecting Falcon versus normal mode, enter in Falcon mode when the customer selects the CONFIG_SPL_OS_BOOT option in menuconfig.

Quoted 6 lines
Quoted 4 lines

I merged two days ago V2 on my branch with just minor conflicts in ico-imx6ul.h on current tree. New version looks identical to V2 with exception of the last two patches. Is it enough I pick up the last two patches or is there something I am missing ?

Some commit log improvements. As it wasn't push to imx tree,

Due to breakage before release, I was convinced by Tom to run a full travis before any PR (I push my local branch to github to let travis build it: https://github.com/sbabic/u-boot-imx)

Yes, that the reason my question: I am still able to change before merging.

Quoted 2 lines

do you
want me to send v4 with all fixes?

As far as I see, it is not required. I fixed myself the niptick in commit log for 1/14, and I have already rebase and fix the conflicts in pico-imx6ul - there is no need to redo the same work.

I cannot find any other changes between V2 and V3, so I am getting to pick up the last two commits before pushing to the server.

Best regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#20 lore raw

PATCH v3 13/14 pico-imx6ul: Add Falcon mode support

Quoted 27 lines · Stefano Babic
Quoted 10 lines · Otavio Salvador
Quoted 9 lines · Stefano Babic
Quoted 7 lines · Otavio Salvador

Falcon mode boots the kernel directly from SPL, without loading the full U-Boot.

As pico-imx6ul does not have a GPIO for selecting Falcon versus normal mode, enter in Falcon mode when the customer selects the CONFIG_SPL_OS_BOOT option in menuconfig.

Quoted 6 lines
Quoted 4 lines

I merged two days ago V2 on my branch with just minor conflicts in ico-imx6ul.h on current tree. New version looks identical to V2 with exception of the last two patches. Is it enough I pick up the last two patches or is there something I am missing ?

Some commit log improvements. As it wasn't push to imx tree,

Due to breakage before release, I was convinced by Tom to run a full travis before any PR (I push my local branch to github to let travis build it: https://github.com/sbabic/u-boot-imx)

Yes, that the reason my question: I am still able to change before merging.

Quoted 2 lines

do you
want me to send v4 with all fixes?

Quoted 6 lines

As far as I see, it is not required. I fixed myself the niptick in commit log for 1/14, and I have already rebase and fix the conflicts in pico-imx6ul - there is no need to redo the same work.

I cannot find any other changes between V2 and V3, so I am getting to pick up the last two commits before pushing to the server.

Great.

Please amend:

Author: Otavio Salvador <[email protected]>
Date:   Thu Aug 30 13:48:47 2018 -0300

pico-imx6ul: Remove CONFIG_FSL_USDHC from .h

The CONFIG_FSL_USDHC is defined inside "mx6_common.h", which is already included in this file.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750
#21 lore raw

PATCH v3 13/14 pico-imx6ul: Add Falcon mode support

Quoted 42 lines · Otavio Salvador
Quoted 27 lines · Stefano Babic
Quoted 10 lines · Otavio Salvador
Quoted 9 lines · Stefano Babic
Quoted 7 lines · Otavio Salvador

Falcon mode boots the kernel directly from SPL, without loading the full U-Boot.

As pico-imx6ul does not have a GPIO for selecting Falcon versus normal mode, enter in Falcon mode when the customer selects the CONFIG_SPL_OS_BOOT option in menuconfig.

Quoted 6 lines
Quoted 4 lines

I merged two days ago V2 on my branch with just minor conflicts in ico-imx6ul.h on current tree. New version looks identical to V2 with exception of the last two patches. Is it enough I pick up the last two patches or is there something I am missing ?

Some commit log improvements. As it wasn't push to imx tree,

Due to breakage before release, I was convinced by Tom to run a full travis before any PR (I push my local branch to github to let travis build it: https://github.com/sbabic/u-boot-imx)

Yes, that the reason my question: I am still able to change before merging.

Quoted 2 lines

do you
want me to send v4 with all fixes?

Quoted 6 lines

As far as I see, it is not required. I fixed myself the niptick in commit log for 1/14, and I have already rebase and fix the conflicts in pico-imx6ul - there is no need to redo the same work.

I cannot find any other changes between V2 and V3, so I am getting to pick up the last two commits before pushing to the server.

Great.

Please amend:

Author: Otavio Salvador <[email protected]>
Date:   Thu Aug 30 13:48:47 2018 -0300
Quoted 8 lines

pico-imx6ul: Remove CONFIG_FSL_USDHC from .h

The CONFIG_FSL_USDHC is defined inside "mx6_common.h", which is already included in this file.

ok, thanks, done.

Regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#22 lore raw

PATCH v3 14/14 pico-imx6ul: Add instructions for booting in Falcon mode

In reply to Otavio Salvador

From: Fabio Estevam <[email protected]>

Falcon mode allows the SPL to load and jump directly to the kernel, without loading U-Boot proper.

Add detailed step by step on how to use Falcon mode on pico-imx6ul.

---

Changes in v3:
- new patch

Changes in v2: None

 board/technexion/pico-imx6ul/README | 92 +++++++++++++++++++++++++++++
 1 file changed, 92 insertions(+)
board/technexion/pico-imx6ul/README +92 -0
index 66dc977d49..1cabd90759 100644
@@ -65,3 +65,95 @@ Remove power from the pico board.
 Put pico board into normal boot mode.
 
 Power up the board and the new updated U-Boot should boot from eMMC.
+
+Booting in Falcon mode
+======================
+
+Generate a uImage kernel:
+
+$ make imx_v6_v7_defconfig (Using the default imx_v6_v7_defconfig configuration
+just for an example. In order to boot faster the user should customize the
+defconfig by only enabling the minimal required drivers).
+
+$ make -j4 uImage LOADADDR=0x80800000
+
+$ cp arch/arm/boot/uImage /tftpboot
+$ cp arch/arm/boot/dts/imx6ul-pico-hobbit.dtb /tftpboot
+
+In the U-Boot prompt:
+
+Setup the server and board IP addresses:
+=> setenv serverip 192.168.0.10
+=> setenv ipaddr 192.168.0.11
+
+Get the dtb file:
+=> tftp ${fdt_addr} imx6ul-pico-hobbit.dtb
+
+Get the kernel:
+=> tftp ${loadaddr} uImage
+
+Write the kernel at 2MB offset:
+=> mmc write ${loadaddr} 0x1000 0x4000
+
+Setup the bootargs:
+=> setenv bootargs 'console=ttymxc5,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rw'
+
+Prepare args:
+=> spl export fdt ${loadaddr} - ${fdt_addr}
+## Booting kernel from Legacy Image at 82000000 ...
+   Image Name:   Linux-4.19.0-rc2-next-20180905-0
+   Image Type:   ARM Linux Kernel Image (uncompressed)
+   Data Size:    8365608 Bytes = 8 MiB
+   Load Address: 80800000
+   Entry Point:  80800000
+   Verifying Checksum ... OK
+## Flattened Device Tree blob at 83000000
+   Booting using the fdt blob at 0x83000000
+   Loading Kernel Image ... OK
+   Using Device Tree in place at 83000000, end 83009c63
+subcommand not supported
+subcommand not supported
+   Using Device Tree in place at 83000000, end 8300cc63
+Argument image is now in RAM: 0x83000000
+
+Write 1MB of args data (0x800 sectors) to 1MB offset (0x800 sectors):
+
+=> mmc write ${fdt_addr} 0x800 0x800
+
+In order to boot with Falcon mode, activate the CONFIG_SPL_OS_BOOT
+option in the defconfig
+
+--- a/configs/pico-hobbit-imx6ul_defconfig
++++ b/configs/pico-hobbit-imx6ul_defconfig
+@@ -53,3 +53,4 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+ CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+ CONFIG_CI_UDC=y
+ CONFIG_OF_LIBFDT=y
++CONFIG_SPL_OS_BOOT=y
+
+Then rebuild U-Boot:
+
+$ make pico-hobbit-imx6ul_defconfig
+$ make -j4
+
+Launch UMS:
+=> ums 0 mmc 0
+
+Flash the new binaries:
+
+$ sudo dd if=SPL of=/dev/sdX bs=1k seek=1; sync
+$ sudo dd if=u-boot.img  of=/dev/sdX bs=1k seek=69; sync
+
+And then SPL binary will load and jump directly to the kernel:
+
+U-Boot SPL 2018.09-rc2-00156-g8c46f15-dirty (Sep 05 2018 - 16:24:05 -0300)
+Trying to boot from MMC1
+[    0.000000] Booting Linux on physical CPU 0x0
+[    0.000000] Linux version 4.19.0-rc2-next-20180905-00001-gb805e2d (fabio at fabio-Latitude-E5450) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)) #533 SMP Wed Sep 5 16:21:03 -03 2018
+[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
+[    0.000000] CPU: div instructions available: patching division code
+[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
+[    0.000000] OF: fdt: Machine model: Technexion Pico i.MX6UL Board
+[    0.000000] Memory policy: Data cache writealloc
+[    0.000000] cma: Reserved 64 MiB at 0x8c000000
+...
Signature · 1 line
2.19.0
reviewer
#23 lore raw

PATCH v3 1/14 pico-imx6ul: Convert to distro config

In reply to Otavio Salvador

Hi Otavio,

Quoted 4 lines · Otavio Salvador

From: Fabio Estevam <[email protected]>

Instead of keeping a custom environment, use a more generic approach by switching to disto config.

If you send a new version, please fix the typo: it should be "distro", not "disto"

Thanks