From 636941ff4dc54289c3a0bcc792c3fcd04893a65d Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Tue, 4 Sep 2018 10:23:07 -0300 Subject: pico-imx6ul: Convert to distro config Instead of keeping a custom environment, use a more generic approach by switching to distro config. Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador --- include/configs/pico-imx6ul.h | 69 ++++++++++++------------------------------- 1 file changed, 19 insertions(+), 50 deletions(-) (limited to 'include') diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h index 34ba53a2a9d..e8e4c876140 100644 --- a/include/configs/pico-imx6ul.h +++ b/include/configs/pico-imx6ul.h @@ -52,65 +52,34 @@ #define CONFIG_SYS_MMC_IMG_LOAD_PART 1 #define CONFIG_EXTRA_ENV_SETTINGS \ + "script=boot.scr\0" \ "image=zImage\0" \ "console=ttymxc5\0" \ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \ - "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ "fdt_addr=0x83000000\0" \ - "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \ - "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \ + "fdt_addr_r=0x83000000\0" \ + "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \ + "ramdisk_addr_r=0x83000000\0" \ + "ramdiskaddr=0x83000000\0" \ + "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ "mmcautodetect=yes\0" \ CONFIG_DFU_ENV_SETTINGS \ - "finduuid=part uuid mmc 0:2 uuid\0" \ + "finduuid=part uuid mmc 0:1 uuid\0" \ "partitions=" \ "uuid_disk=${uuid_gpt_disk};" \ - "name=boot,size=16MiB;name=rootfs,size=0,uuid=${uuid_gpt_rootfs}\0" \ - "setup_emmc=gpt write mmc 0 $partitions; reset;\0" \ - "mmcargs=setenv bootargs console=${console},${baudrate} " \ - "root=PARTUUID=${uuid} rootwait rw\0" \ - "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ - "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ - "mmcboot=echo Booting from mmc ...; " \ - "run finduuid; " \ - "run mmcargs; " \ - "if run loadfdt; then " \ - "bootz ${loadaddr} - ${fdt_addr}; " \ - "else " \ - "echo WARN: Cannot load the DT; " \ - "fi;\0" \ - "netargs=setenv bootargs console=${console},${baudrate} " \ - "root=/dev/nfs " \ - "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ - "netboot=echo Booting from net ...; " \ - "run netargs; " \ - "if test ${ip_dyn} = yes; then " \ - "setenv get_cmd dhcp; " \ - "else " \ - "setenv get_cmd tftp; " \ - "fi; " \ - "${get_cmd} ${image}; " \ - "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ - "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ - "bootz ${loadaddr} - ${fdt_addr}; " \ - "else " \ - "if test ${boot_fdt} = try; then " \ - "bootz; " \ - "else " \ - "echo WARN: Cannot load the DT; " \ - "fi; " \ - "fi; " \ - "else " \ - "bootz; " \ - "fi;\0" \ - -#define CONFIG_BOOTCOMMAND \ - "if mmc rescan; then " \ - "if run loadimage; then " \ - "run mmcboot; " \ - "else run netboot; " \ - "fi; " \ - "else run netboot; fi" + "name=rootfs,size=0,uuid=${uuid_gpt_rootfs}\0" \ + "fastboot_partition_alias_system=rootfs\0" \ + "setup_emmc=mmc dev 0; gpt write mmc 0 $partitions; reset;\0" \ + BOOTENV + +#define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, 0) \ + func(DHCP, dhcp, na) + +#include #define CONFIG_SYS_MEMTEST_START 0x80000000 #define CONFIG_SYS_MEMTEST_END CONFIG_SYS_MEMTEST_START + SZ_128M -- cgit v1.2.3 From 82a8a93327077046d3ede01aea5984ffcc019f5c Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Tue, 4 Sep 2018 10:23:08 -0300 Subject: pico-imx6ul: Convert to SPL 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. Signed-off-by: Fabio Estevam Signed-off-by: Fabio Berton Signed-off-by: Otavio Salvador --- include/configs/pico-imx6ul.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h index e8e4c876140..5fdbff93e0a 100644 --- a/include/configs/pico-imx6ul.h +++ b/include/configs/pico-imx6ul.h @@ -12,6 +12,7 @@ #include #include "mx6_common.h" #include +#include "imx6_spl.h" /* Network support */ -- cgit v1.2.3 From f6d805504b6fcc6c6e7d3eb0aed6b7c07ce33e53 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 4 Sep 2018 10:23:15 -0300 Subject: pico-imx6ul: Add bootmenu to choose the baseboard 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. Signed-off-by: Otavio Salvador --- include/configs/pico-imx6ul.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h index 5fdbff93e0a..9905b1eebb5 100644 --- a/include/configs/pico-imx6ul.h +++ b/include/configs/pico-imx6ul.h @@ -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" \ @@ -68,6 +73,11 @@ "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \ "mmcautodetect=yes\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};" \ -- cgit v1.2.3 From 313d02b6b4b2c6d2527b116af2c698b0a412e246 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 4 Sep 2018 10:23:16 -0300 Subject: pico-imx6ul: Improve default DFU settings 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. Signed-off-by: Otavio Salvador --- include/configs/pico-imx6ul.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h index 9905b1eebb5..535f0b26dff 100644 --- a/include/configs/pico-imx6ul.h +++ b/include/configs/pico-imx6ul.h @@ -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=" \ -- cgit v1.2.3 From ba5fd0af0fb04dda4ca25f2af29dbafc8d884727 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 4 Sep 2018 10:23:19 -0300 Subject: 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. Signed-off-by: Otavio Salvador Reviewed-by: Fabio Estevam --- include/configs/pico-imx6ul.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h index 535f0b26dff..ead242d2ff6 100644 --- a/include/configs/pico-imx6ul.h +++ b/include/configs/pico-imx6ul.h @@ -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 -- cgit v1.2.3 From 9ddd1cd596b5d825a53265c267d9322f2af0f4d1 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Thu, 13 Sep 2018 16:57:05 -0300 Subject: pico-imx6ul: Add Falcon mode support 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. Signed-off-by: Otavio Salvador --- include/configs/pico-imx6ul.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h index ead242d2ff6..8c657c13ac4 100644 --- a/include/configs/pico-imx6ul.h +++ b/include/configs/pico-imx6ul.h @@ -14,6 +14,18 @@ #include #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@1MB kernel@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 -- cgit v1.2.3 From 3a8932b6f67e055111472b4ec7d1f3d56ddc5664 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Fri, 14 Sep 2018 15:53:32 -0300 Subject: pico-imx6ul: Add PICO-Pi baseboard support This adds the device tree to the DFU and bootmenu environment setting. Signed-off-by: Otavio Salvador --- include/configs/pico-imx6ul.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h index 8c657c13ac4..3d932055354 100644 --- a/include/configs/pico-imx6ul.h +++ b/include/configs/pico-imx6ul.h @@ -60,11 +60,14 @@ "u-boot raw 0x8a 0x400 mmcpart 1;" \ "/boot/zImage ext4 0 1;" \ "/boot/imx6ul-pico-hobbit.dtb ext4 0 1;" \ + "/boot/imx6ul-pico-pi.dtb ext4 0 1;" \ "rootfs part 0 1\0" \ #define BOOTMENU_ENV \ "bootmenu_0=Boot using PICO-Hobbit baseboard=" \ "setenv fdtfile imx6ul-pico-hobbit.dtb\0" \ + "bootmenu_1=Boot using PICO-Pi baseboard=" \ + "setenv fdtfile imx6ul-pico-pi.dtb\0" \ #define CONFIG_SYS_MMC_IMG_LOAD_PART 1 -- cgit v1.2.3 From 130f03a7af9ee7cfeb6d515faf5841226410a623 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Fri, 14 Sep 2018 15:53:35 -0300 Subject: pico-imx7d: Add PICO-Hobbit baseboard support This adds the device tree to the DFU and bootmenu environment setting. Signed-off-by: Otavio Salvador --- include/configs/pico-imx7d.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h index 4cc84ff5d44..0e770bf41f2 100644 --- a/include/configs/pico-imx7d.h +++ b/include/configs/pico-imx7d.h @@ -48,11 +48,14 @@ "spl raw 0x2 0x400 mmcpart 1;" \ "u-boot raw 0x8a 0x400 mmcpart 1;" \ "/boot/zImage ext4 0 1;" \ + "/boot/imx7d-pico-hobbit.dtb ext4 0 1;" \ "/boot/imx7d-pico-pi.dtb ext4 0 1;" \ "rootfs part 0 1\0" \ #define BOOTMENU_ENV \ - "bootmenu_0=Boot using PICO-PI baseboard=" \ + "bootmenu_0=Boot using PICO-Hobbit baseboard=" \ + "setenv fdtfile imx7d-pico-hobbit.dtb\0" \ + "bootmenu_1=Boot using PICO-Pi baseboard=" \ "setenv fdtfile imx7d-pico-pi.dtb\0" \ #define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */ -- cgit v1.2.3