[U-Boot] imx7d SPL driver fails to allocate memory.

Rens Dol rens.dol at opticon.com
Wed Jan 9 17:31:58 UTC 2019


Hi all,

I am trying to get SPL working on a imx7 based board. I need to 
configure the DDR voltage before u-boot can be loaded from NAND. I am 
using the pico-imx7_defconfig as a starting point. It already has SPL 
configured to initialize ddr.

 From board_init_f I call spl_early_init() to initialize malloc_simple 
so that I can use the pmic driver to set the DDR voltage and configure 
DDR . So far everything is working as expected, I can write/read from DDR.

But this is as far as SPL wants to go.. my guess is that switching from 
malloc_simple in board_init_f() to the full malloc implementation is not 
working.

- I use boundarydevices/imx_usb_loader to load u-boot-nand-spl.imx -

- git.denx.de/u-boot-imx version 2019.01-rc1 -

This what my debug output shows.

U-Boot SPL 2019.01-rc1-dirty (Jan 09 2019 - 16:07:51 +0100)
spl_early_init
power_init Set ddr regulator to 1.50V
  -- mALLOc --
00000040
pmic_alloc: new pmic struct: 0x009467b0
pmic_get: pmic BD71815 -> 0x009467b0
Bus: 1 PMIC:BD71815 probed!
i2c_write_data: chip=0x4b, len=0x0
write_data:
i2c_read_data: chip=0x4b, len=0x1
  0x41
PMIC:  BD71815 DEV_ID=0x41
i2c_write_data: chip=0x4b, len=0x1
write_data:  0x10
setup drr controller!
  Testing ram
 >>SPL: board_init_r()
using memory 0x88300000-0x88400000 for malloc()
spl_init
spl_board_init
Trying to boot from NAND
spl: nand - using hw ecc
  Trying to load image from CONFIG_SYS_NAND_U_BOOT_OFFS 400000 87800000
nand_spl_load_image
mxs_nand_init
  -- mALLOc --
00000598
  -- malloc_extend_top --  pagesz  = 00001000
  nb  = 000005A0
  top  = 0091F010
-- sbrk
  increment = 000005B0 returns  = 88300000-- sbrk end
  brk  = 88300000
-- sbrk
  increment = 00000A50 returns  = 883005B0-- sbrk end
top = 88300000
old_top = 0091F010
old_top_size = 00000000
top_size = 00001000

MXS NAND: Failed to allocate private data.

Attached the spl/u-boot.cfg  and pico-imx7d.h files.

Here are my questions.

- Has anyone tried this before on a imx7d?

- Do I have conflicting configuration options?

- Do I need to relocate the complete SPL from SRAM to DDR to make this work?

- Should malloc be available in spl_board_init()?

By enabling CONFIG_SPL_SYS_MALLOC_SIMPLE it boots a little further, but 
gets stuck in the nand driver after reading the onfi data and searching 
for a bad block table.

Should it be possible to have usb + nand + i2c working using only 
CONFIG_SPL_SYS_MALLOC_SIMPLE?


Met vriendelijke groeten
Kind regards,

Rens Dol
Software Engineer
Opticon Sensors Europe B.V.
Opaallaan 35
2132 XV  HOOFDDORP
The Netherlands
Tel.+31(0)235692720
rens.dol at opticon.com 1

-------------- next part --------------
#define CONFIG_CMD_FAT 1
#define CONFIG_SYS_BOOT_GET_CMDLINE 1
#define CONFIG_HAS_CAAM 1
#define CONFIG_BOOTM_NETBSD 1
#define CONFIG_BOARD_EARLY_INIT_F 1
#define CONFIG_CMD_FDT 1
#define CONFIG_USB_GADGET_DOWNLOAD 1
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x400000
#define CONFIG_MXC_USB_FLAGS 0
#define CONFIG_IMX_CONFIG arch/arm/mach-imx/spl_nand.cfg
#define CONFIG_CMD_ITEST 1
#define CONFIG_BOOTM_VXWORKS 1
#define CONFIG_CMD_EDITENV 1
#define CONFIG_SPL_SPRINTF 1
#define CONFIG_FASTBOOT_GPT_NAME "gpt"
#define CONFIG_SPL_NAND_SUPPORT 1
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define CONFIG_CPU_V7_HAS_NONSEC 1
#define CONFIG_CMD_PART 1
#define CONFIG_DFU_OVER_USB 1
#define CONFIG_SPL_LOGLEVEL 4
#define CONFIG_SPL_USE_ARCH_MEMSET 1
#define CONFIG_HAS_VBAR 1
#define CONFIG_CMD_ENV_EXISTS 1
#define CONFIG_CMD_CRC32 1
#define CONFIG_SYS_LONGHELP 1
#define CONFIG_SYS_NAND_5_ADDR_CYCLE 
#define CONFIG_IS_MODULE(option) config_enabled(CONFIG_VAL(option ##_MODULE))
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
#define CONFIG_FASTBOOT_BUF_SIZE 0x10000000
#define CONFIG_HASH 1
#define CONFIG_SYS_FSL_MAX_NUM_OF_SEC 1
#define CONFIG_USE_ARCH_MEMSET 1
#define CONFIG_DISPLAY_BOARDINFO 1
#define CONFIG_CMD_CACHE 1
#define CONFIG_OPTEE_TZDRAM_BASE 0x00000000
#define CONFIG_EXPERT 1
#define CONFIG_CMDLINE 1
#define CONFIG_BOOTDELAY 3
#define CONFIG_SYS_NAND_BASE 0x40000000
#define CONFIG_MX7D 1
#define CONFIG_POWER_BD71815 
#define CONFIG_CMD_BOOTEFI 1
#define CONFIG_SYS_HELP_CMD_WIDTH 8
#define CONFIG_NR_DRAM_BANKS 1
#define CONFIG_EFI_PARTITION 1
#define CONFIG_FS_FAT 1
#define CONFIG_SYS_ARM_CACHE_CP15 1
#define CONFIG_BOOTM_RTEMS 1
#define CONFIG_SYS_CBSIZE 512
#define CONFIG_SYS_NAND_ONFI_DETECTION 
#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
#define CONFIG_ARMV7_LPAE 1
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET 
#define CONFIG_BOOTM_LINUX 1
#define CONFIG_ARCH_MX7 1
#define CONFIG_DEFAULT_FDT_FILE ""
#define CONFIG_TARGET_PICO_IMX7D 1
#define CONFIG_BOARD_LATE_INIT 1
#define CONFIG_CREATE_ARCH_SYMLINK 1
#define CONFIG_CMD_CONSOLE 1
#define CONFIG_SUPPORT_OF_CONTROL 1
#define CONFIG_SPL_STRTO 1
#define CONFIG_SYS_CPU "armv7"
#define CONFIG_SPL_BOARD_INIT 1
#define CONFIG_BOOTP_PXE_CLIENTARCH 0x15
#define CONFIG_SYS_CACHELINE_SIZE 64
#define CONFIG_MMC 1
#define CONFIG_BOARD_SIZE_LIMIT 715776
#define CONFIG_CMD_USB_MASS_STORAGE 1
#define CONFIG_SMBIOS_PRODUCT_NAME "pico-imx7d"
#define CONFIG_SYS_FSL_CLK 
#define CONFIG_SYS_FSL_SEC_ADDR (CAAM_IPS_BASE_ADDR + CONFIG_SYS_FSL_SEC_OFFSET)
#define CONFIG_SPL_USB_HOST_SUPPORT 1
#define CONFIG_CMD_MISC 1
#define CONFIG_SYSCOUNTER_TIMER 1
#define CONFIG_SPL_LIBCOMMON_SUPPORT 1
#define CONFIG_ENV_OFFSET (12 * SZ_64K)
#define CONFIG_MXC_OCOTP 
#define CONFIG_DISTRO_DEFAULTS 1
#define CONFIG_DM_DEVICE_REMOVE 1
#define CONFIG_MX7 1
#define CONFIG_ENV_OVERWRITE 
#define CONFIG_CMD_NET 1
#define CONFIG_USB_GADGET_VBUS_DRAW 2
#define CONFIG_CMD_NFS 1
#define CONFIG_ENV_SIZE SZ_8K
#define CONFIG_IMX_WATCHDOG 1
#define CONFIG_SUPPORT_RAW_INITRD 1
#define CONFIG_CMD_FS_GENERIC 1
#define CONFIG_CMD_PING 1
#define CONFIG_SPL_BUILD 1
#define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
#define CONFIG_NAND_MXS_USE_MINIMUM_ECC 1
#define CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET 0x0
#define CONFIG_SYS_MMC_ENV_DEV 0
#define CONFIG_SYS_I2C_SPEED 100000
#define CONFIG_LOCALVERSION ""
#define CONFIG_SYS_BOOTM_LEN 0x1000000
#define CONFIG_SYS_TEXT_BASE 0x87800000
#define CONFIG_CC_OPTIMIZE_FOR_SIZE 1
#define CONFIG_REGEX 1
#define CONFIG_EFI_PARTITION_ENTRIES_NUMBERS 128
#define CONFIG_SYS_CONFIG_NAME "pico-imx7d"
#define CONFIG_CMD_FLASH 1
#define CONFIG_BOOTSTAGE_RECORD_COUNT 30
#define CONFIG_USB_FUNCTION_MASS_STORAGE 1
#define CONFIG_HW_WATCHDOG 1
#define CONFIG_CMD_SAVEENV 1
#define CONFIG_MXC_GPT_HCLK 
#define CONFIG_MKIMAGE_DTC_PATH "dtc"
#define CONFIG_SYS_ARM_MMU 1
#define CONFIG_MXC_UART 
#define CONFIG_BOOTM_PLAN9 1
#define CONFIG_IS_BUILTIN(option) config_enabled(CONFIG_VAL(option))
#define CONFIG_SPL_TEXT_BASE 0x00911000
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
#define CONFIG_SPL_EFI_PARTITION 1
#define CONFIG_CMD_GPT 1
#define CONFIG_MMC_WRITE 1
#define CONFIG_TPL_SYS_MALLOC_F_LEN 0x400
#define CONFIG_ANDROID_BOOT_IMAGE 1
#define CONFIG_IMX_BOOTAUX 1
#define CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND 0x600000
#define CONFIG_DM_DEV_READ_INLINE 1
#define CONFIG_SYS_FSL_JR0_ADDR (CONFIG_SYS_FSL_SEC_ADDR + CONFIG_SYS_FSL_JR0_OFFSET)
#define CONFIG_POWER_I2C 
#define CONFIG_BOOTP_DNS 1
#define CONFIG_SYS_CACHE_SHIFT_6 1
#define CONFIG_CMD_MEMORY 1
#define CONFIG_SYS_MAXARGS 32
#define CONFIG_ARMV7_NONSEC 1
#define CONFIG_MMC_HW_PARTITIONING 1
#define CONFIG_SUPPORT_SPL 1
#define CONFIG_CMD_RUN 1
#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
#define CONFIG_ENV_VARS_UBOOT_CONFIG 1
#define CONFIG_NAND_BOOT 1
#define CONFIG_SYS_FSL_SEC_COMPAT_4 1
#define CONFIG_USB 1
#define CONFIG_ARMV7_PSCI 1
#define CONFIG_FEC_XCV_TYPE RGMII
#define CONFIG_OPTEE_TZDRAM_SIZE 0x0000000
#define CONFIG_MXC_GPIO 1
#define CONFIG_BOOTP_HOSTNAME 1
#define CONFIG_BOARDDIR board/technexion/pico-imx7d
#define CONFIG_USB_EHCI_HCD 1
#define CONFIG_TPL_LOGLEVEL 4
#define CONFIG_POWER 
#define CONFIG_SPL_LEGACY_IMAGE_SUPPORT 1
#define CONFIG_CPU_V7A 1
#define CONFIG_SYS_FSL_SEC_LE 1
#define CONFIG_CPU_V7_HAS_VIRT 1
#define CONFIG_SPL_BOOTSTAGE_RECORD_COUNT 5
#define CONFIG_NET 1
#define CONFIG_BOUNCE_BUFFER 
#define CONFIG_OF_LIBFDT 1
#define CONFIG_SPL_STACK 0x00946BB8
#define CONFIG_SYS_MAX_FLASH_SECT 512
#define CONFIG_PHYLIB 1
#define CONFIG_GENERATE_SMBIOS_TABLE 1
#define CONFIG_CMD_SPL_WRITE_SIZE 0x20000
#define CONFIG_CMDLINE_EDITING 1
#define CONFIG_CMD_USB 1
#define CONFIG_CMD_EXT2 1
#define CONFIG_CMD_EXT4 1
#define CONFIG_BOOTCOMMAND "run findfdt; run finduuid; run distro_bootcmd"
#define CONFIG_ARCH_FIXUP_FDT_MEMORY 1
#define CONFIG_USB_GADGET_VENDOR_NUM 0x0525
#define CONFIG_SPL_I2C_SUPPORT 1
#define CONFIG_ISO_PARTITION 1
#define CONFIG_DFU_ENV_SETTINGS "dfu_alt_info=" "spl raw 0x2 0x400;" "u-boot raw 0x8a 0x400;" "/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 CONFIG_SYS_MALLOC_CLEAR_ON_INIT 1
#define CONFIG_SPL_USB_SDP_SUPPORT 1
#define CONFIG_SYS_EXTRA_OPTIONS "IMX_CONFIG=arch/arm/mach-imx/spl_nand.cfg"
#define CONFIG_CMD_DFU 1
#define CONFIG_SPL_GPIO_SUPPORT 1
#define CONFIG_CMD_BOOTEFI_HELLO_COMPILE 1
#define CONFIG_HUSH_PARSER 1
#define CONFIG_CMD_DM 1
#define CONFIG_BOOTP_VCI_STRING "U-Boot.armv7"
#define CONFIG_DM 1
#define CONFIG_ZLIB 1
#define CONFIG_LOADADDR 0x80800000
#define CONFIG_USB_GADGET_DUALSPEED 1
#define CONFIG_LIB_UUID 1
#define CONFIG_ETHPRIME "FEC"
#define CONFIG_CMD_GO 1
#define CONFIG_USB_HOST 1
#define CONFIG_CMD_BOOTM 1
#define CONFIG_CMD_BOOTP 1
#define CONFIG_CMD_BOOTZ 1
#define CONFIG_SYS_MALLOC_F 1
#define CONFIG_MXC_USB_OTG_HACTIVE 1
#define CONFIG_AUTO_COMPLETE 1
#define CONFIG_PANIC_HANG 
#define CONFIG_SPRINTF 1
#define CONFIG_ARMV7_BOOT_SEC_DEFAULT 1
#define CONFIG_TPL_BANNER_PRINT 1
#define CONFIG_SYS_SOC "mx7"
#define CONFIG_FSL_USDHC 
#define CONFIG_SYS_HZ 1000
#define CONFIG_SYS_MALLOC_F_LEN 0x400
#define CONFIG_ARMV7_SECURE_BASE 0x00900000
#define CONFIG_DOS_PARTITION 1
#define CONFIG_SYS_FSL_SEC_OFFSET 0
#define CONFIG_GZIP 1
#define CONFIG_SYS_VENDOR "technexion"
#define CONFIG_DFU_MMC 1
#define CONFIG_CMD_BOOTMENU 1
#define CONFIG_APBH_DMA 1
#define CONFIG_SC_TIMER_CLK 8000000
#define CONFIG_SYS_FSL_ESDHC_ADDR 0
#define CONFIG_SYS_NAND_SELF_INIT 1
#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
#define CONFIG_IDENT_STRING ""
#define CONFIG_IOMUX_LPSR 
#define CONFIG_SPL_PRINTF 1
#define CONFIG_MTDIDS_DEFAULT ""
#define CONFIG_PRINTF 1
#define CONFIG_CMD_USB_SDP 1
#define CONFIG_FEC_MXC_PHYADDR 1
#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
#define CONFIG_CMD_SPL_NAND_OFS 0x0
#define CONFIG_VAL(option) config_val(option)
#define CONFIG_DM_THERMAL 1
#define CONFIG_SPL_LIBGENERIC_SUPPORT 1
#define CONFIG_LOCALVERSION_AUTO 1
#define CONFIG_FASTBOOT_FLASH_MMC_DEV 0
#define CONFIG_FASTBOOT_USB_DEV 0
#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
#define CONFIG_IMAGE_FORMAT_LEGACY 1
#define CONFIG_ARCH_MISC_INIT 1
#define CONFIG_MMC_VERBOSE 1
#define CONFIG_PHY_ATHEROS 
#define CONFIG_SPL_DMA_SUPPORT 1
#define CONFIG_FASTBOOT_BUF_ADDR 0x82000000
#define CONFIG_NET_TFTP_VARS 1
#define CONFIG_SPL_LDSCRIPT "arch/$(ARCH)/cpu/u-boot-spl.lds"
#define CONFIG_USE_PRIVATE_LIBGCC 1
#define CONFIG_CMD_SPL 1
#define CONFIG_CMD_DHCP 1
#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
#define CONFIG_SPL_SERIAL_SUPPORT 1
#define CONFIG_FASTBOOT_CMD_OEM_FORMAT 1
#define CONFIG_CMD_ECHO 1
#define CONFIG_USB_FUNCTION_SDP 1
#define CONFIG_STRTO 1
#define CONFIG_SYS_SPL_MALLOC_START 0x88300000
#define CONFIG_SPL_WATCHDOG_SUPPORT 1
#define CONFIG_USE_ARCH_MEMCPY 1
#define CONFIG_SYS_I2C 
#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
#define CONFIG_DFU 1
#define CONFIG_BOOTP_GATEWAY 1
#define CONFIG_SPL_BSS_MAX_SIZE 0x100000
#define CONFIG_CI_UDC 1
#define CONFIG_SPL_BSS_START_ADDR 0x88200000
#define CONFIG_SPL_PAD_TO 0x10000
#define CONFIG_EXTRA_ENV_SETTINGS "script=boot.scr\0" "image=zImage\0" "console=ttymxc1\0" "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" "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" "ramdisk_addr_r=0x83000000\0" "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};" "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 CONFIG_EFI_PARTITION_ENTRIES_OFF 0
#define CONFIG_BOOTP_PXE 1
#define CONFIG_INPUT 1
#define CONFIG_CMD_FASTBOOT 1
#define CONFIG_HAS_THUMB2 1
#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
#define CONFIG_FSL_ESDHC 1
#define CONFIG_SYS_ARCH "arm"
#define CONFIG_IMX_THERMAL 
#define CONFIG_BAUDRATE 115200
#define CONFIG_SPL_PARTITION_UUIDS 1
#define CONFIG_SYS_BOARD "pico-imx7d"
#define CONFIG_PARTITION_UUIDS 1
#define CONFIG_FASTBOOT 1
#define CONFIG_MTDPARTS_DEFAULT ""
#define CONFIG_SYS_ARM_ARCH 7
#define CONFIG_SPL_USE_ARCH_MEMCPY 1
#define CONFIG_BOOTSTAGE_STASH_SIZE 0x1000
#define CONFIG_ROM_UNIFIED_SECTIONS 1
#define CONFIG_ENV_IS_NOWHERE 1
#define CONFIG_FASTBOOT_FLASH 1
#define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR
#define CONFIG_CMD_IMPORTENV 1
#define CONFIG_MMC_QUIRKS 1
#define CONFIG_SYS_BOOT_RAMDISK_HIGH 
#define CONFIG_HAVE_PRIVATE_LIBGCC 1
#define CONFIG_CMD_EXPORTENV 1
#define CONFIG_SYS_FSL_USDHC_NUM 1
#define CONFIG_PARTITIONS 1
#define CONFIG_SPL_DOS_PARTITION 1
#define CONFIG_CMD_I2C 1
#define CONFIG_SYS_MMC_ENV_PART 0
#define CONFIG_CMD_ELF 1
#define CONFIG_IMX_RDC 1
#define CONFIG_EFI_LOADER 1
#define CONFIG_NAND_MXS 1
#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
#define CONFIG_SMBIOS_MANUFACTURER "technexion"
#define CONFIG_RANDOM_UUID 1
#define CONFIG_NAND 1
#define CONFIG_POWER_BD71815_I2C_ADDR 0x4B
#define CONFIG_DM_SEQ_ALIAS 1
#define CONFIG_FS_EXT4 1
#define CONFIG_SPL_MAX_SIZE 0x10000
#define CONFIG_SPL_FRAMEWORK 1
#define CONFIG_BOOTSTAGE_STASH_ADDR 0x0
#define CONFIG_ARMV7_PSCI_1_0 
#define CONFIG_SPL 1
#define CONFIG_CMD_SOURCE 1
#define CONFIG_SYS_PROMPT "=> "
#define CONFIG_BOOTP_BOOTPATH 1
#define CONFIG_CMD_PXE 1
#define CONFIG_USB_EHCI_MX7 1
#define CONFIG_APBH_DMA_BURST8 1
#define CONFIG_ARMV7_VIRT 1
#define CONFIG_IMAGE_SPARSE 1
#define CONFIG_DISPLAY_CPUINFO 1
#define CONFIG_LOGLEVEL 4
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x20000000)
#define CONFIG_ARMV7_PSCI_NR_CPUS 4
#define CONFIG_EXT4_WRITE 1
#define CONFIG_SYS_MEMTEST_START 0x80000000
#define CONFIG_SPL_SYS_MALLOC_F_LEN 0x400
#define CONFIG_CMD_LOADB 1
#define CONFIG_CMD_LOADS 1
#define CONFIG_FS_FAT_MAX_CLUSTSIZE 65536
#define CONFIG_USE_BOOTCOMMAND 1
#define CONFIG_SPL_PAYLOAD "u-boot.bin"
#define CONFIG_CMD_EXT4_WRITE 1
#define CONFIG_CONS_INDEX 1
#define CONFIG_LMB 
#define CONFIG_AUTOBOOT 1
#define CONFIG_APBH_DMA_BURST 1
#define CONFIG_ARCH_SUPPORT_PSCI 1
#define CONFIG_SPL_BANNER_PRINT 1
#define CONFIG_ARM 1
#define CONFIG_FASTBOOT_MBR_NAME "mbr"
#define CONFIG_SYS_I2C_MXC 
#define CONFIG_HAVE_BLOCK_DEVICE 1
#define CONFIG_SPL_USB_GADGET_SUPPORT 1
#define CONFIG_IS_ENABLED(option) (config_enabled(CONFIG_VAL(option)) || config_enabled(CONFIG_VAL(option ##_MODULE)))
#define CONFIG_EFI_UNICODE_CAPITALIZATION 1
#define CONFIG_CMD_GPIO 1
#define CONFIG_CMD_BDI 1
#define CONFIG_SYS_I2C_MXC_I2C1 
#define CONFIG_SYS_I2C_MXC_I2C2 
#define CONFIG_SYS_FSL_JR0_OFFSET 0x1000
#define CONFIG_BOOTP_SUBNETMASK 1
#define CONFIG_MENU 1
#define CONFIG_SPL_RAW_IMAGE_SUPPORT 1
#define CONFIG_USB_FUNCTION_FASTBOOT 1
#define CONFIG_USB_GADGET_MANUFACTURER "FSL"
#define CONFIG_USB_GADGET 1
#define CONFIG_LIB_RAND 1
#define CONFIG_IMAGE_SPARSE_FILLBUF_SIZE 0x80000
#define CONFIG_USB_GADGET_PRODUCT_NUM 0xa4a5
#define CONFIG_ARM_ASM_UNIFIED 1
#define CONFIG_FASTBOOT_FLASH_MMC 1
#define CONFIG_CMD_MMC 1
#define CONFIG_SPL_POWER_SUPPORT 1
#define CONFIG_CMD_FUSE 1
#define CONFIG_CMD_TFTPBOOT 1
#define CONFIG_SPECIFY_CONSOLE_INDEX 1
#define CONFIG_SAVED_DRAM_TIMING_BASE 0x180000
-------------- next part --------------
/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * Copyright (C) 2017 NXP Semiconductors
 *
 * Configuration settings for the i.MX7D Pico board.
 */

#ifndef __PICO_IMX7D_CONFIG_H
#define __PICO_IMX7D_CONFIG_H

#define  DEBUG
#define  CONFIG_PANIC_HANG

#include "mx7_common.h"

#include "imx7_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

/* Size of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN		(32 * SZ_1M)
//#define CONFIG_SYS_SPL_MALLOC_LEN		(1 * SZ_1M)

#define CONFIG_MXC_UART_BASE		UART1_IPS_BASE_ADDR

/* Network */
//#define CONFIG_FEC_MXC
#define CONFIG_FEC_XCV_TYPE		RGMII
#define CONFIG_ETHPRIME			"FEC"
#define CONFIG_FEC_MXC_PHYADDR		1

#define CONFIG_PHY_ATHEROS

/* ENET1 */
#define IMX_FEC_BASE			ENET_IPS_BASE_ADDR

/* MMC Config */
#define CONFIG_SYS_FSL_ESDHC_ADDR	0

#define CONFIG_DFU_ENV_SETTINGS \
	"dfu_alt_info=" \
		"spl raw 0x2 0x400;" \
		"u-boot raw 0x8a 0x400;" \
		"/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 "\0"
/*
#define BOOTMENU_ENV \
	"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 */
//#define CONFIG_SYS_MMC_IMG_LOAD_PART	1

#define CONFIG_EXTRA_ENV_SETTINGS \
	"script=boot.scr\0" \
	"image=zImage\0" \
	"console=ttymxc1\0" \
	"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" \
	"pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
	"ramdisk_addr_r=0x83000000\0" \
	"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};" \
		"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, na) \
	func(USB, usb, 0) \
	func(PXE, pxe, na) \
	func(DHCP, dhcp, na)

#include <config_distro_bootcmd.h>

#define CONFIG_SYS_MEMTEST_START	0x80000000
#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_MEMTEST_START + 0x20000000)

#define CONFIG_SYS_LOAD_ADDR		CONFIG_LOADADDR
#define CONFIG_SYS_HZ				1000

/* Physical Memory Map */
#define PHYS_SDRAM					MMDC0_ARB_BASE_ADDR

#define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM
#define CONFIG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
#define CONFIG_SYS_INIT_RAM_SIZE	IRAM_SIZE

#define CONFIG_SYS_INIT_SP_OFFSET \
	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
#define CONFIG_SYS_INIT_SP_ADDR \
	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)

/* I2C configs */
#define CONFIG_SYS_I2C
#define CONFIG_SYS_I2C_MXC
#define CONFIG_SYS_I2C_MXC_I2C1
#define CONFIG_SYS_I2C_MXC_I2C2
//#define CONFIG_SYS_I2C_MXC_I2C3
//#define CONFIG_SYS_I2C_MXC_I2C4
#define CONFIG_SYS_I2C_SPEED		100000

/* PMIC */
#define SPL_POWER_SUPPORT

#define CONFIG_POWER
#define CONFIG_POWER_I2C
#define CONFIG_POWER_BD71815
#define CONFIG_POWER_BD71815_I2C_ADDR 0x4B

/* FLASH and environment organization */
#define CONFIG_ENV_SIZE			SZ_8K

/* Environment starts at 768k = 768 * 1024 = 786432 */
//#define CONFIG_ENV_OFFSET		0x0C0000
/*
 * Detect overlap between U-Boot image and environment area in build-time
 *
 * CONFIG_BOARD_SIZE_LIMIT = CONFIG_ENV_OFFSET - u-boot.img offset
 * CONFIG_BOARD_SIZE_LIMIT = 768k - 69k = 699k = 715776
 *
 * Currently CONFIG_BOARD_SIZE_LIMIT does not handle expressions, so
 * write the direct value here
 */
#define CONFIG_BOARD_SIZE_LIMIT		715776

#define CONFIG_SYS_FSL_USDHC_NUM		1

#define CONFIG_SYS_MMC_ENV_DEV			0
#define CONFIG_SYS_MMC_ENV_PART			0

/* USB Configs */
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
#define CONFIG_MXC_USB_PORTSC			(PORT_PTS_UTMI | PORT_PTS_PTW)
#define CONFIG_MXC_USB_FLAGS			0
#define CONFIG_USB_MAX_CONTROLLER_COUNT	1

#define CONFIG_IMX_THERMAL

/*
    u-boot is located in raw nand, 
    Assuming an erase page size of 2MByte
    page 0,1 SPL
    page 2,3 u-boot
    ubifs partitions start at  16Mbyte 0x400000    
*/

#define CONFIG_SYS_NAND_U_BOOT_OFFS         0x400000
#define CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND  0x600000

/* 
	NAND stuff 
*/

//#define CONFIG_NAND_MXS

#define CONFIG_SYS_NAND_ONFI_DETECTION
#define CONFIG_SYS_MAX_NAND_DEVICE	1
#define CONFIG_SYS_NAND_BASE		0x40000000
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
#define CONFIG_SYS_NAND_ONFI_DETECTION


#define CONFIG_ENV_OFFSET		(12 * SZ_64K)
#define CONFIG_SYS_FSL_USDHC_NUM	1


//#define SYS_MALLOC_F_LEN 
//#define SPL_SYS_MALLOC_SIMPLE

//#define SYS_MALLOC_F_LEN		0x001000
//#define CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN 0x2000


//#define CONFIG_SPL_STACK_R
//#define CONFIG_SPL_STACK_R_ADDR 0x88100000


#endif


More information about the U-Boot mailing list