This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS: Uboot (configured ad SPL) is blocked from start to SPI after relocationg phase running on custom AK2H14

Tool/software: Code Composer Studio

Hi experts.

  I have seen (another) strange behaviour during uboot's SPI startup in our custom board.

I had added some debug printout to show the problem.

In custom board ((I have saved  u-boot-spi.gph at the SF's offset 0) afrer reboot from POR:

U-Boot SPL 2018.01-00558-gafce7b16cd-dirty (Dec 16 2019 - 13:46:22)
Trying to boot from SPI
initcall: 0c0b68cd


U-Boot 2018.01-00558-gafce7b16cd-dirty (Dec 16 2019 - 13:46:22 +0100)

initcall: 0c022149
U-Boot code: 0C000000 -> 0C107DE8  BSS: -> 0C169448
initcall: 0c002ddd
CPU: 66AK2Hx Rev11 (DRSP)
initcall: 0c006bb9
initcall: 0c022a31
Model: Rheinmetall DRSP board (UBoot)
initcall: 0c022181
DRAM:  initcall: 0c006399
DDR3A Speed will be configured for 1600 Operation.
DDR3A memory bank [DRSP-K2H-2G1600SED]
DDR3 speed 1600
DRAM: 2 GiB (includes reported below)
initcall: 0c0222a1
Monitor len: 00169448
Ram size: 80000000
Ram top: 00000000
initcall: 0c02230d
initcall: 0c02232d
TLB table from ffff0000 to ffff4000
initcall: 0c022389
initcall: 0c022397
initcall: 0c0223a5
Reserving 1445k for U-Boot at: ffe86000
initcall: 0c0223ed
Reserving 32832k for malloc() at: fde76000
initcall: 0c02241d
Reserving 88 Bytes for Board Info at: fde75fa8
initcall: 0c022471
initcall: 0c022481
Reserving 208 Bytes for Global Data at: fde75ed8
initcall: 0c0224bd
initcall: 0c0224cb
initcall: 0c022691
initcall: 0c0224d9
initcall: 0c022231
initcall: 0c022195

RAM Configuration:
Bank #0: 80000000 Bank #1: 0 DRAM: 2 GiB
initcall: 0c0224fd
New Stack Pointer is: fde75eb0
initcall: 0c022519
initcall: 0c022527
initcall: 0c022535
***************************************************************
Relocation Offset is: f3e86000
Relocating to ffe86000, new gd at fde75ed8, sp at fde75eb0
***************************************************************
.... nothing else.

It seems the jump in third stage (U-BOOT) is not done when start from SPL.

In the previous log we can see the RAM inizialized from SPL as to as from u-boot with emulator.

In the same board I obtain after RAM download with CCS (using build/uboot/u-boot file
the same file downloaded from SPL stage):

U-Boot 2018.01-00558-gafce7b16cd-dirty (Dec 16 2019 - 13:46:22 +0100)

initcall: 0c022149
U-Boot code: 0C000000 -> 0C107DE8  BSS: -> 0C169448
initcall: 0c002ddd
CPU: 66AK2Hx Rev11 (DRSP)
initcall: 0c006bb9
initcall: 0c022a31
Model: Rheinmetall DRSP board (UBoot)
initcall: 0c022181
DRAM:  initcall: 0c006399
DDR3A Speed will be configured for 1600 Operation.
DDR3A memory bank [DRSP-K2H-2G1600SED]
DDR3 speed 1600
DRAM: 2 GiB (includes reported below)
initcall: 0c0222a1
Monitor len: 00169448
Ram size: 80000000
Ram top: 00000000
initcall: 0c02230d
initcall: 0c02232d
TLB table from ffff0000 to ffff4000
initcall: 0c022389
initcall: 0c022397
initcall: 0c0223a5
Reserving 1445k for U-Boot at: ffe86000
initcall: 0c0223ed
Reserving 32832k for malloc() at: fde76000
initcall: 0c02241d
Reserving 88 Bytes for Board Info at: fde75fa8
initcall: 0c022471
initcall: 0c022481
Reserving 208 Bytes for Global Data at: fde75ed8
initcall: 0c0224bd
initcall: 0c0224cb
initcall: 0c022691
initcall: 0c0224d9
initcall: 0c022231
initcall: 0c022195

RAM Configuration:
Bank #0: 80000000 Bank #1: 0 DRAM: 2 GiB
initcall: 0c0224fd
New Stack Pointer is: fde75eb0
initcall: 0c022519
initcall: 0c022527
initcall: 0c022535
***************************************************************
Relocation Offset is: f3e86000
Relocating to ffe86000, new gd at fde75ed8, sp at fde75eb0
***************************************************************
initcall: ffea8705  ---- initr_trace
initcall: ffea8713  ---- initr_reloc
initcall: 0c022731  ---- initr_caches
initcall: 0c022741  ---- initr_reloc_global_data
initcall: 0c02278b  ---- initr_barrier
initcall: 0c022799  ---- initr_malloc
Pre-reloc malloc() used 0x90 bytes (0 KB)
initcall: 0c034aa5  ---- log_init
initcall: 0c022851  ---- initr_bootstage
initcall: 0c0227ed  ---- initr_console_record
initcall: 0c0226dd  ---- bootstage_relocate
initcall: 0c0227fd  ---- initr_dm
initr_dm@292: Called
dm_init@156: Called
dm_init@171: Called
lists_driver_lookup_name@28: Called
lists_driver_lookup_name@33: Called foud
device_bind_by_name@245: Called
device_bind_by_name@249: Called
device_bind_common@40: Called
device_bind_common@48: Called
uclass.c@246: uclass_find_device_by_seq: 0 -1
uclass.c@246: uclass_find_device_by_seq: 0 0
uclass.c@254:    - -1 -1 'root_driver'
uclass.c@262:    - not found
....
genphy_config_aneg: return 1 0x0
genphy_config_aneg: return 2 0x0
phy_read: devad=0xFFFFFFFF phydev->addr=0x0000 regnum=0x0000 val=0x0000
genphy_restart_aneg: Called
phy_read: devad=0xFFFFFFFF phydev->addr=0x0000 regnum=0x0000 val=0x0000
phy_write: devad=0xFFFFFFFF phydev->addr=0x0000 regnum=0x0000 val=0x1200
phy_read: devad=0xFFFFFFFF phydev->addr=0x0000 regnum=0x0000 val=0x1000
phy_write: devad=0xFFFFFFFF phydev->addr=0x0000 regnum=0x0000 val=0x9000
eth_post_probe: Called
ks2_eth_read_rom_hwaddr: Called
eth0: netcp@2000000ks2_eth_write_hwaddr: Called


Net IF Nr: 1
initcall: 0c0229e5
Hit any key to stop autoboot:  0
ubi0: attaching mtd1
....
ubifsload <addr> <filename> [bytes]
    - load file 'filename' to address 'addr'
## Error: "run_kern" not defined
DRSP_UBoot>

I have already checked the SPI data contents (is correct), I suppose something in make
environment is misconfigured or some config options miss or remov.

Follows the uboot config (only the actived lines) catched from uboot console.

CONFIG_CREATE_ARCH_SYMLINK=y
CONFIG_ARM=y
CONFIG_SYS_ARCH="arm"
CONFIG_SYS_CPU="armv7"
CONFIG_SYS_SOC="keystone"
CONFIG_SYS_VENDOR="ti"
CONFIG_SYS_BOARD="ks2_evm"
CONFIG_SYS_CONFIG_NAME="k2hk_evm"
CONFIG_HAS_VBAR=y
CONFIG_HAS_THUMB2=y
CONFIG_ARM_ASM_UNIFIED=y
CONFIG_SYS_ARM_CACHE_CP15=y
CONFIG_SYS_ARM_MMU=y
CONFIG_CPU_V7A=y
CONFIG_SYS_ARM_ARCH=7
CONFIG_SYS_CACHE_SHIFT_6=y
CONFIG_SYS_CACHELINE_SIZE=64
CONFIG_SYS_THUMB_BUILD=y
CONFIG_SPL_SYS_THUMB_BUILD=y
CONFIG_USE_ARCH_MEMCPY=y
CONFIG_SPL_USE_ARCH_MEMCPY=y
CONFIG_USE_ARCH_MEMSET=y
CONFIG_SPL_USE_ARCH_MEMSET=y
CONFIG_ARCH_KEYSTONE=y
CONFIG_SPL_LDSCRIPT="arch/$(ARCH)/cpu/u-boot-spl.lds"
CONFIG_SYS_TEXT_BASE=0x0c000000
CONFIG_EEPROM_BUS_ADDRESS=0
CONFIG_EEPROM_CHIP_ADDRESS=0x50
CONFIG_TI_COMMON_CMD_OPTIONS=y
CONFIG_SPL_GPIO_SUPPORT=y
CONFIG_SPL_LIBCOMMON_SUPPORT=y
CONFIG_SPL_LIBGENERIC_SUPPORT=y
CONFIG_SYS_MALLOC_F_LEN=0x400
CONFIG_TARGET_K2HK_EVM=y
CONFIG_SPL_SERIAL_SUPPORT=y
CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
CONFIG_SPL_LIBDISK_SUPPORT=y
CONFIG_SPL_SPI_FLASH_SUPPORT=y
CONFIG_SPL_SPI_SUPPORT=y
CONFIG_SPL_WATCHDOG_SUPPORT=y
CONFIG_IDENT_STRING=""
CONFIG_DEFAULT_DEVICE_TREE=""
CONFIG_SMBIOS_PRODUCT_NAME="ks2_evm"
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYS_MALLOC_F=y
CONFIG_SPL_SYS_MALLOC_F_LEN=0x400
CONFIG_TPL_SYS_MALLOC_F_LEN=0x400
CONFIG_EXPERT=y
CONFIG_TOOLS_DEBUG=y
CONFIG_FIT=y
CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_SYS_EXTRA_OPTIONS=""
CONFIG_ARCH_FIXUP_FDT_MEMORY=y
CONFIG_API=y
CONFIG_BOOTSTAGE_RECORD_COUNT=30
CONFIG_SPL_BOOTSTAGE_RECORD_COUNT=5
CONFIG_BOOTSTAGE_STASH_ADDR=0
CONFIG_BOOTSTAGE_STASH_SIZE=0x1000
CONFIG_SPI_BOOT=y
CONFIG_BOOTDELAY=50
CONFIG_MENU=y
CONFIG_LOGLEVEL=4
CONFIG_SPL_LOGLEVEL=4
CONFIG_SYS_CONSOLE_INFO_QUIET=y
CONFIG_LOG=y
CONFIG_LOG_MAX_LEVEL=5
CONFIG_LOG_CONSOLE=y
CONFIG_DEFAULT_FDT_FILE=""
CONFIG_VERSION_VARIABLE=y
CONFIG_DISPLAY_CPUINFO=y
CONFIG_DISPLAY_BOARDINFO=y
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_HASH=y
CONFIG_SUPPORT_SPL=y
CONFIG_SPL=y
CONFIG_SPL_BOARD_INIT=y
CONFIG_SPL_LEGACY_IMAGE_SUPPORT=y
CONFIG_SPL_SEPARATE_BSS=y
CONFIG_SPL_DISPLAY_PRINT=y
CONFIG_SPL_CPU_SUPPORT=y
CONFIG_SPL_DMA_SUPPORT=y
CONFIG_SPL_MTD_SUPPORT=y
CONFIG_SPL_NOR_SUPPORT=y
CONFIG_SPL_RAM_SUPPORT=y
CONFIG_SPL_RAM_DEVICE=y
CONFIG_CMDLINE=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="DRSP_UBoot> "
CONFIG_AUTOBOOT=y
CONFIG_BUILD_BIN2C=y
CONFIG_CMD_BDI=y
CONFIG_CMD_CONFIG=y
CONFIG_CMD_CONSOLE=y
CONFIG_CMD_BOOTD=y
CONFIG_CMD_BOOTM=y
CONFIG_CMD_BOOTZ=y
CONFIG_CMD_BOOTEFI=y
CONFIG_CMD_BOOTEFI_HELLO_COMPILE=y
CONFIG_CMD_BOOTMENU=y
CONFIG_CMD_ELF=y
CONFIG_CMD_FDT=y
CONFIG_CMD_GO=y
CONFIG_CMD_RUN=y
CONFIG_CMD_IMI=y
CONFIG_CMD_XIMG=y
CONFIG_CMD_POWEROFF=y
CONFIG_CMD_ASKENV=y
CONFIG_CMD_EXPORTENV=y
CONFIG_CMD_IMPORTENV=y
CONFIG_CMD_EDITENV=y
CONFIG_CMD_SAVEENV=y
CONFIG_CMD_ENV_EXISTS=y
CONFIG_CMD_CRC32=y
CONFIG_CRC32_VERIFY=y
CONFIG_CMD_EEPROM=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MEMORY=y
CONFIG_CMD_MEMTEST=y
CONFIG_CMD_MX_CYCLIC=y
CONFIG_CMD_DM=y
CONFIG_CMD_FLASH=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_GPT=y
CONFIG_RANDOM_UUID=y
CONFIG_CMD_I2C=y
CONFIG_CMD_LOADB=y
CONFIG_CMD_LOADS=y
CONFIG_CMD_MMC=y
CONFIG_CMD_NAND=y
CONFIG_CMD_PART=y
CONFIG_CMD_SAVES=y
CONFIG_CMD_SDRAM=y
CONFIG_CMD_SF=y
CONFIG_CMD_SPI=y
CONFIG_CMD_USB=y
CONFIG_CMD_ECHO=y
CONFIG_CMD_ITEST=y
CONFIG_CMD_SOURCE=y
CONFIG_CMD_SETEXPR=y
CONFIG_CMD_NET=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_NFS=y
CONFIG_CMD_MII=y
CONFIG_CMD_PING=y
CONFIG_CMD_BSP=y
CONFIG_CMD_TIME=y
CONFIG_CMD_MISC=y
CONFIG_CMD_DDR3=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_EXT4_WRITE=y
CONFIG_CMD_FAT=y
CONFIG_CMD_FS_GENERIC=y
CONFIG_CMD_MTDPARTS=y
CONFIG_MTDIDS_DEFAULT="nand0=davinci_nand.0"
CONFIG_MTDPARTS_DEFAULT="mtdparts=davinci_nand.0:1024k(bootloader)ro,512k(params)ro,-(ubifs)"
CONFIG_CMD_UBI=y
CONFIG_CMD_UBIFS=y
CONFIG_PARTITIONS=y
CONFIG_DOS_PARTITION=y
CONFIG_SPL_DOS_PARTITION=y
CONFIG_ISO_PARTITION=y
CONFIG_SPL_ISO_PARTITION=y
CONFIG_EFI_PARTITION=y
CONFIG_EFI_PARTITION_ENTRIES_NUMBERS=128
CONFIG_EFI_PARTITION_ENTRIES_OFF=0
CONFIG_SPL_EFI_PARTITION=y
CONFIG_PARTITION_UUIDS=y
CONFIG_SPL_PARTITION_UUIDS=y
CONFIG_SUPPORT_OF_CONTROL=y
CONFIG_DTC=y
CONFIG_OF_CONTROL=y
CONFIG_OF_EMBED=y
CONFIG_OF_LIST="keystone-k2hk-drsp keystone-k2hk-evm"
CONFIG_DTB_RESELECT=y
CONFIG_MULTI_DTB_FIT=y
CONFIG_MKIMAGE_DTC_PATH="dtc"
CONFIG_ENV_IS_IN_SPI_FLASH=y
CONFIG_NET=y
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_NETCONSOLE=y
CONFIG_NET_TFTP_VARS=y
CONFIG_BOOTP_PXE_CLIENTARCH=0x15
CONFIG_BOOTP_VCI_STRING="U-Boot.armv7"
CONFIG_DM=y
CONFIG_DM_WARN=y
CONFIG_DM_DEBUG=y
CONFIG_DM_DEVICE_REMOVE=y
CONFIG_DM_STDIO=y
CONFIG_DM_SEQ_ALIAS=y
CONFIG_REGMAP=y
CONFIG_SYSCON=y
CONFIG_DEVRES=y
CONFIG_SIMPLE_BUS=y
CONFIG_OF_TRANSLATE=y
CONFIG_DM_DEV_READ_INLINE=y
CONFIG_CLK=y
CONFIG_DM_GPIO=y
CONFIG_DM_I2C=y
CONFIG_DM_I2C_GPIO=y
CONFIG_SYS_I2C_DW=y
CONFIG_SYS_I2C_BUS_MAX=3
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_PCA954x=y
CONFIG_TI_AEMIF=y
CONFIG_MMC=y
CONFIG_MMC_WRITE=y
CONFIG_MMC_QUIRKS=y
CONFIG_MMC_HW_PARTITIONING=y
CONFIG_NAND=y
CONFIG_DM_SPI_FLASH=y
CONFIG_SPI_FLASH=y
CONFIG_SPI_FLASH_BAR=y
CONFIG_SPI_FLASH_STMICRO=y
CONFIG_MTD_UBI=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
CONFIG_MTD_UBI_BEB_LIMIT=20
CONFIG_PHYLIB=y
CONFIG_PHYLIB_10G=y
CONFIG_PHY_MARVELL=y
CONFIG_PHY_TI=y
CONFIG_DM_ETH=y
CONFIG_NETDEVICES=y
CONFIG_PHY_GIGE=y
CONFIG_PHY=y
CONFIG_RAM=y
CONFIG_REMOTEPROC=y
CONFIG_REMOTEPROC_TI_POWER=y
CONFIG_BAUDRATE=115200
CONFIG_SYS_NS16550=y
CONFIG_SOC_TI=y
CONFIG_DM_SPI=y
CONFIG_USB=y
CONFIG_USB_HOST=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DWC3=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_HOST=y
CONFIG_USB_STORAGE=y
CONFIG_FS_FAT=y
CONFIG_FAT_WRITE=y
CONFIG_FS_FAT_MAX_CLUSTSIZE=65536
CONFIG_HAVE_PRIVATE_LIBGCC=y
CONFIG_USE_PRIVATE_LIBGCC=y
CONFIG_SYS_HZ=1000
CONFIG_REGEX=y
CONFIG_LIB_RAND=y
CONFIG_RBTREE=y
CONFIG_SHA1=y
CONFIG_SHA256=y
CONFIG_MD5=y
CONFIG_LZ4=y
CONFIG_LZMA=y
CONFIG_LZO=y
CONFIG_SPL_LZO=y
CONFIG_SPL_GZIP=y
CONFIG_SPL_ZLIB=y
CONFIG_OF_LIBFDT=y
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_SPL_OF_LIBFDT=y
CONFIG_GENERATE_SMBIOS_TABLE=y
CONFIG_SMBIOS_MANUFACTURER="ti"
CONFIG_EFI_LOADER=y

Another strange behaviour is that if I remove the USB debugger the SPL stops before
....
initcall: 0c022181
DRAM:  initcall: 0c006399
DDR3A Speed will be configured for 1600 Operation.
DDR3A memory bank [DRSP-K2H-2G1600SED]
DDR3 speed 1600
DRAM: 2 GiB (includes reported below)

here....

I have seen thats behaviour a couple of times (now), I don't know if the problem is correlated with the previous one.

MCS 5.2.0.10  with u-boot-2018.01+gitAUTOINC+313dcd69c2-g313dcd69c2 patched for handle our custom board.

I hope it's a my misconfiration.

Best regards,

Dario

  • Hi,

    I see you get to u-boot console. Can you execute printenv and share the result?

    Also have you modified anything in u-boot/include/configs/k2hk_evm.h & ti_armv7_common.h?

    Best Regards,
    Yordan

  • Hi Yordan.

    1) printenv result:

    DRSP_UBoot> printenv
    addr_fs=0x82000000
    addr_initrd=0x82000000
    addr_kern=0x80000000
    addr_load_sec_bm=0x0c08c000
    addr_mon=0x0c5f0000
    addr_non_sec_mon=0x0c087fc0
    addr_secdb_key=0xc000000
    addr_ubi=0x80000000
    api_address=fde7bcc8
    arch=arm
    args_all=setenv bootargs console=ttyS0,115200n8 rootwait=1 mtdparts=spi0.0:2m(u-boot-spl)ro,30m(misc),512k(params),-(norTest);
    args_net=setenv bootargs ${bootargs} rootfstype=nfs root=/dev/nfs rw nfsroot=${serverip}:${nfs_root},${nfs_options} ip=dhcp
    args_ramfs=setenv bootargs ${bootargs} rdinit=/sbin/init rw root=/dev/ram0 initrd=0x808080000,80M
    args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,2048
    baudrate=115200
    board=ks2_evm
    board_name=ks2_evm
    boot=ubi
    boot_fdt=try
    bootcmd=run init_${boot}; run get_mon_${boot} run_mon; run get_kern_${boot}; run init_fw_rd_${boot}; run get_fdt_${boot}; run run_kern
    bootcmd1='run init_${boot} get_image_${boot}'
    bootdelay=50
    bootdir=/boot
    bootm_size=0x10000000
    burn_ubi=nand erase.part ubifs; nand write ${addr_ubi} ubifs ${filesize}
    burn_uboot_nand=nand erase 0 0x200000; nand write ${loadaddr} 0 ${filesize}
    burn_uboot_spi=sf probe; sf erase 0 0x200000; sf write ${loadaddr} 0 ${filesize}
    cpu=armv7
    default=-f -a
    eth1addr=50:33:8b:6b:35:7d
    eth2addr=50:33:8b:6b:35:7e
    eth3addr=50:33:8b:6b:35:7f
    ethact=netcp@2000000
    ethaddr=50:33:8b:6b:35:7c
    fdt_addr_r=0x88000000
    fdtaddr=0x87000000
    fdtcontroladdr=fff7c8d0
    gatewayip=192.168.111.150
    get_fdt_net=imxtract ${loadaddr} fdt-1 ${fdtaddr}
    get_fdt_nfs=nfs ${fdtaddr} ${nfs_root}/boot/${name_fdt}
    get_fdt_ramfs=dhcp ${fdtaddr} ${tftp_root}/${name_fdt}
    get_fdt_ubi=ubifsload ${fdtaddr} ${bootdir}/${name_fdt}
    get_fit_mmc=load mmc ${bootpart} ${fit_loadaddr} ${bootdir}/${fit_bootfile}
    get_fit_net=dhcp ${fit_loadaddr} ${tftp_root}/${fit_bootfile}
    get_fit_nfs=nfs ${fit_loadaddr} ${nfs_root}/boot/${fit_bootfile}
    get_fit_ramfs=dhcp ${fit_loadaddr} ${tftp_root}/${fit_bootfile}
    get_fit_ubi=ubifsload ${fit_loadaddr} ${bootdir}/${fit_bootfile}
    get_fs_ramfs=dhcp ${rdaddr} ${tftp_root}/${name_fs}
    get_image_net=tftpboot ${loadaddr} ${tftp_root}/${image_name}
    get_kern_net=imxtract ${loadaddr} kernel-1 ${addr_kern}
    get_kern_nfs=nfs ${loadaddr} ${nfs_root}/boot/${name_kern}
    get_kern_ramfs=dhcp ${loadaddr} ${tftp_root}/${name_kern}
    get_kern_ubi=ubifsload ${loadaddr} ${bootdir}/${name_kern}
    get_mon_net=imxtract ${loadaddr} firmware-1 ${addr_mon}
    get_mon_nfs=nfs ${addr_mon} ${nfs_root}/boot/${name_mon}
    get_mon_ramfs=dhcp ${addr_mon} ${tftp_root}/${name_mon}
    get_mon_ubi=ubifsload ${addr_mon} ${bootdir}/${name_mon}
    get_ubi_net=dhcp ${addr_ubi} ${tftp_root}/${name_ubi}
    get_ubi_nfs=nfs ${addr_ubi} ${nfs_root}/boot/${name_ubi}
    get_uboot_net=dhcp ${loadaddr} ${tftp_root}/${name_uboot}
    get_uboot_nfs=nfs ${loadaddr} ${nfs_root}/boot/${name_uboot}
    hostname=DRSP
    image_name=DRSP_multi.itb
    init_fw_rd_net=dhcp ${rdaddr} ${tftp_root}/${name_fw_rd}; run set_rd_spec
    init_fw_rd_nfs=nfs ${rdaddr} ${nfs_root}/boot/${name_fw_rd}; run set_rd_spec
    init_fw_rd_ramfs=setenv rd_spec -
    init_fw_rd_ubi=ubifsload ${rdaddr} ${bootdir}/${name_fw_rd}; run set_rd_spec
    init_net=run args_all args_net
    init_nfs=setenv autoload no; dhcp; run args_all args_net
    init_ramfs=run args_all args_ramfs get_fs_ramfs
    init_ubi=run args_all args_ubi; ubi part ubifs; ubifsmount ubi:rootfs;
    ipaddr=192.168.111.23
    kernel_addr_r=0x82000000
    loadaddr=0x90000000
    mem_lpae=1
    mtdparts=mtdparts=davinci_nand.0:128m(ubifs),200m(ubifs2),692m(User_Data),-(Nand_Test)
    name_fdt=keystone-k2hk-evm.dtb
    name_fs=arago-console-image-k2hk-evm.cpio.gz
    name_fw_rd=k2-fw-initrd.cpio.gz
    name_kern=zImage
    name_mon=skern-k2hk.bin
    name_ubi=k2hk-evm-ubifs.ubi
    name_uboot=u-boot-spi-k2hk-evm.gph
    netmask=255.255.255.0
    nfs_options=v3,tcp,rsize=4096,wsize=4096
    nfs_root=/mnt/sda3/sda2/Shared/Projects/Rheinmetall/DRSP/SVN/DRSP/sdk/targetNFS
    no_post=1
    pxefile_addr_r=0x80100000
    ramdisk_addr_r=0x88080000
    rdaddr=0x88080000
    run_kern_net=bootm ${loadaddr} - ${fdtaddr}
    run_mon=mon_install ${addr_mon}
    run_mon_hs=mon_install ${addr_non_sec_mon} ${addr_load_sec_bm}
    scriptaddr=0x80000000
    serverip=192.168.99.150
    set_rd_spec=setenv rd_spec ${rdaddr}:${filesize}
    soc=keystone
    static_ip=${ipaddr}:${serverip}:${gatewayip}:255.255.255.0:eth0:off
    stderr=serial
    stdin=serial
    stdout=serial
    tftp_root=/tftpboot/DRSP
    vendor=ti
    ver=U-Boot 2018.01-00558-gafce7b16cd-dirty (Dec 16 2019 - 22:19:18 +0100)

    Environment size: 4579/65532 bytes

    2a)  Added lines in k2hk_evm.h file:

    #define CONFIG_REMAKE_ELF
    #define CONFIG_SYS_MEMTEST_START    0x80000000
    #define CONFIG_SYS_MEMTEST_END        0xFFFF0000
    #define CONFIG_SYS_MAX_FLASH_BANKS    1
    #define CONFIG_SF_DEFAULT_BUS          0
    #define CONFIG_SF_DEFAULT_CS          0
    #define CONFIG_SYS_UBOOT_BASE         (64*1024)
    #ifndef CONFIG_DM_ETH
    #ifndef TESTBENCH
    #define CONFIG_KSNET_MDIO_PHY_CONFIG_ENABLE
    #endif
    #endif

    2b)  Changed lines in k2hk_evm.h file:

    #define CONFIG_ENV_OFFSET            0x1f60000
    #define CONFIG_ENV_SIZE                (64 << 10)
    #ifdef DRSP
    #define CONFIG_EXTRA_ENV_SETTINGS                    \
        DEFAULT_LINUX_BOOT_ENV                        \
        CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                \
        "bootdir=/boot\0" \
        "tftp_root=/tftpboot/DRSP\0"                            \
        "nfs_root=/mnt/sda3/sda2/Shared/Projects/Rheinmetall/DRSP/SVN/DRSP/sdk/targetNFS\0"    \
        "mem_lpae=1\0"                            \
        "addr_ubi=0x80000000\0"                        \
        "addr_secdb_key=0xc000000\0"                    \
        "name_kern=zImage\0"                        \
        "addr_mon=0x87000000\0"                        \
        "addr_non_sec_mon=0x0c087fc0\0"                    \
        "addr_load_sec_bm=0x0c08c000\0"                    \
        "run_mon=mon_install ${addr_mon}\0"                \
        "run_mon_hs=mon_install ${addr_non_sec_mon} "            \
            "${addr_load_sec_bm}\0"                \
        "run_kern_net=bootm ${loadaddr} - ${fdtaddr}\0"        \
        "init_net=run args_all args_net\0"                \
        "init_nfs=setenv autoload no; dhcp; run args_all args_net\0"    \
        "init_ubi=run args_all args_ubi; "                \
            "ubi part ubifs; ubifsmount ubi:rootfs;\0"            \
        "static_ip=${ipaddr}:${serverip}:${gatewayip}:255.255.255.0:eth0:off\0" \
        "get_image_net=tftpboot ${loadaddr} ${tftp_root}/${image_name}\0" \
        "get_fdt_net=imxtract ${loadaddr} fdt-1 ${fdtaddr}\0"    \
        "get_fdt_nfs=nfs ${fdtaddr} ${nfs_root}/boot/${name_fdt}\0"    \
        "get_fdt_ubi=ubifsload ${fdtaddr} ${bootdir}/${name_fdt}\0"        \
        "get_kern_net=imxtract ${loadaddr} kernel-1 ${addr_kern}\0"    \
        "get_kern_nfs=nfs ${loadaddr} ${nfs_root}/boot/${name_kern}\0"    \
        "get_kern_ubi=ubifsload ${loadaddr} ${bootdir}/${name_kern}\0"        \
        "get_mon_net=imxtract ${loadaddr} firmware-1 ${addr_mon}\0"    \
        "get_mon_nfs=nfs ${addr_mon} ${nfs_root}/boot/${name_mon}\0"    \
        "get_mon_ubi=ubifsload ${addr_mon} ${bootdir}/${name_mon}\0"    \
        "get_fit_net=dhcp ${fit_loadaddr} ${tftp_root}"            \
                            "/${fit_bootfile}\0"    \
        "get_fit_nfs=nfs ${fit_loadaddr} ${nfs_root}/boot/${fit_bootfile}\0"\
        "get_fit_ubi=ubifsload ${fit_loadaddr} ${bootdir}/${fit_bootfile}\0"\
        "get_fit_mmc=load mmc ${bootpart} ${fit_loadaddr} "        \
                        "${bootdir}/${fit_bootfile}\0"    \
        "get_uboot_net=dhcp ${loadaddr} ${tftp_root}/${name_uboot}\0"    \
        "get_uboot_nfs=nfs ${loadaddr} ${nfs_root}/boot/${name_uboot}\0" \
        "burn_uboot_spi=sf probe; sf erase 0 0x200000; "        \
            "sf write ${loadaddr} 0 ${filesize}\0"        \
        "burn_uboot_nand=nand erase 0 0x200000; "            \
            "nand write ${loadaddr} 0 ${filesize}\0"        \
        "args_all=setenv bootargs console=ttyS0,115200n8 rootwait=1 "    \
            KERNEL_MTD_PARTS                    \
        "args_net=setenv bootargs ${bootargs} rootfstype=nfs "        \
            "root=/dev/nfs rw nfsroot=${serverip}:${nfs_root},"    \
            "${nfs_options} ip=dhcp\0"                \
        "nfs_options=v3,tcp,rsize=4096,wsize=4096\0"            \
        "get_fdt_ramfs=dhcp ${fdtaddr} ${tftp_root}/${name_fdt}\0"    \
        "get_kern_ramfs=dhcp ${loadaddr} ${tftp_root}/${name_kern}\0"    \
        "get_mon_ramfs=dhcp ${addr_mon} ${tftp_root}/${name_mon}\0"    \
        "get_fit_ramfs=dhcp ${fit_loadaddr} ${tftp_root}"        \
                            "/${fit_bootfile}\0"    \
        "get_fs_ramfs=dhcp ${rdaddr} ${tftp_root}/${name_fs}\0"    \
        "get_ubi_net=dhcp ${addr_ubi} ${tftp_root}/${name_ubi}\0"    \
        "get_ubi_nfs=nfs ${addr_ubi} ${nfs_root}/boot/${name_ubi}\0"    \
        "burn_ubi=nand erase.part ubifs; "                \
            "nand write ${addr_ubi} ubifs ${filesize}\0"        \
        "init_ramfs=run args_all args_ramfs get_fs_ramfs\0"        \
        "args_ramfs=setenv bootargs ${bootargs} "            \
            "rdinit=/sbin/init rw root=/dev/ram0 "            \
            "initrd=0x808080000,80M\0"                \
        "no_post=1\0"                            \
        "mtdparts=mtdparts=davinci_nand.0:"                \
            "128m(ubifs),200m(ubifs2),692m(User_Data),-(Nand_Test)\0" \
        "eth1addr=50:33:8b:6b:35:7d\0" \
        "eth2addr=50:33:8b:6b:35:7e\0" \
        "eth3addr=50:33:8b:6b:35:7f\0" \
        "image_name=DRSP_multi.itb\0" \
        "fdtaddr=0x87000000\0" \
        "addr_mon=0x0c5f0000\0" \
        "addr_initrd=0x82000000\0" \
        "addr_fs=0x82000000\0" \
        "addr_initrd=0x82000000\0" \
        "addr_kern=0x80000000\0" \
        "loadaddr=0x90000000\0" \
        "serverip=192.168.99.150\0" \
        "ipaddr=192.168.99.23\0" \
        "gatewayip=192.168.99.1\0" \
        "netmask=255.255.255.0\0" \
        "hostname=DRSP\0" \
        "bootcmd1='run init_${boot} get_image_${boot}'\0"

    #else
    #define CONFIG_EXTRA_ENV_SETTING (as to developed)
    ....
    #endif

    2c)  Changed lines ti_armv7_common.h file:

    changes:
    #ifdef CONFIG_PHY_MARVELL
    #else
    #define CONFIG_PHY_MARVELL
    #endif

    BR

    Dario

  • Hi Dario,

    I see you've modified the u-boot base addresses & env variables (loadaddr, addrmon, etc..). I think you've may have set wrong values for some of the addresses in the config .h files (k2hk_evm.h & ti_armv7_common.h). Looping the design team for help, in case I can't provide more detailed answer in time.

    Best Regards,
    Yordan

  • Hi, Dario,

    I saw your printenv output and suspect that you upgraded your u-boot from MCSDK to the current version. Is that the case? The u-boot version of 2018.01 is from Processor SDK Linux 5.2 which is not the same as MCSDK 5.2. The last MCSDK release is 3.1.4.7, and then migrated to PLSDK. If you upgraded the u-boot from MCSDK, had you done a reset, "env default -f -a" in 2018.01 u-boot to reset the u-boot environment variables? These u-boot env variables are not compatible between the 2 SDKs. One of those is using bootz to boot kernel instead of bootm in MCSDK.

    Besides, in your printenv, there isn't run_kern defined. Hence, you are getting the following error:

    ## Error: "run_kern" not defined
    DRSP_UBoot>

    Rex

  • Hi Yordan,


      I have seen that the parameters are loaded later where the SPL is blocked:

    ***************************************************************
    Relocation Offset is: f3c9c000
    Relocating to ffe9c000, new gd at fde8bed8, sp at fde8beb0
    *************************************************************** <<<< SPL blocked here
    initcall: ffebd795
    initcall: ffebd7a3
    initcall: 0c2217c1
    initcall: 0c2217d1
    initcall: 0c221813
    initcall: 0c221821
    initcall: 0c233bc5
    initcall: 0c2218f9
    initcall: 0c221895
    initcall: 0c22176d
    initcall: 0c2218a5
    initr_dm@292: Called
    dm_init@156: Called
    dm_init@171: Called
    lists_driver_lookup_name@28: Called
    lists_driver_lookup_name@33: Called foud
    device_bind_by_name@245: Called
    device_bind_by_name@249: Called
    device_bind_common@40: Called
    device_bind_common@48: Called
    uclass.c@246: uclass_find_device_by_seq: 0 -1
    uclass.c@246: uclass_find_device_by_seq: 0 0
    uclass.c@254:    - -1 -1 'root_driver'
    uclass.c@262:    - not found
    device_bind_common@40: Called
    device_bind_common@48: Called
    ofnode.c@136: ofnode_read_u32_array: ranges: device_bind_common@40: Called
    device_bind_common@48: Called
    device_bind_common@40: Called
    device_bind_common@48: Called
    device_bind_common@40: Called
    device_bind_common@48: Called
    device_bind_common@40: Called
    device_bind_common@48: Called
    device_bind_common@40: Called
    device_bind_common@48: Called
    device_bind_common@40: Called
    device_bind_common@48: Called
    device_bind_common@40: Called
    device_bind_common@48: Called
    ofnode.c@22: ofnode_read_u32: reg: ofnode.c@38: 0x0 (0)
    ofnode.c@22: ofnode_read_u32: spi-max-frequency: ofnode.c@38: 0x337f980 (54000000)
    ofnode.c@64: ofnode_read_bool: spi-cpol: ofnode.c@68: true
    ofnode.c@64: ofnode_read_bool: spi-cpha: ofnode.c@68: true
    ofnode.c@64: ofnode_read_bool: spi-cs-high: ofnode.c@68: false
    ofnode.c@64: ofnode_read_bool: spi-3wire: ofnode.c@68: false
    ofnode.c@64: ofnode_read_bool: spi-half-duplex: ofnode.c@68: false
    ofnode.c@22: ofnode_read_u32: spi-tx-bus-width: ofnode.c@38: 0x1 (1)
    ofnode.c@22: ofnode_read_u32: spi-rx-bus-width: ofnode.c@38: 0x1 (1)
    device_bind_common@40: Called
    device_bind_common@48: Called
    device_bind_common@40: Called
    device_bind_common@48: Called
    device_bind_common@40: Called
    device_bind_common@48: Called
    device_bind_common@40: Called
    device_bind_common@48: Called
    eth_post_bind: Called
    initcall: 0c2063a5
    initcall: 0c232a61
    initcall: 0c221805
    initcall: 0c22192d
    initcall: 0c22191d
    initcall: 0c221971
    NAND:  1024 MiB
    initcall: 0c22199d
    MMC:   
    initcall: 0c2219d9
    uclass.c@246: uclass_find_device_by_seq: 0 0
    uclass.c@254:    - 0 -1 'spi@21000400'
    uclass.c@254:    - 1 -1 'spi@21000600'
    uclass.c@254:    - 2 -1 'spi@21000800'
    uclass.c@262:    - not found
    uclass.c@246: uclass_find_device_by_seq: 1 0
    uclass.c@254:    - 0 -1 'spi@21000400'
    uclass.c@258:    - found
    uclass.c@246: uclass_find_device_by_seq: 0 -1
    uclass.c@246: uclass_find_device_by_seq: 0 0
    uclass.c@254:    - -1 -1 'soc'
    uclass.c@262:    - not found
    uclass.c@246: uclass_find_device_by_seq: 0 0
    uclass.c@254:    - 0 -1 'spi@21000400'
    uclass.c@254:    - 1 -1 'spi@21000600'
    uclass.c@254:    - 2 -1 'spi@21000800'
    uclass.c@262:    - not found
    ofnode.c@22: ofnode_read_u32: spi-max-frequency: ofnode.c@33: (not found)
    uclass.c@246: uclass_find_device_by_seq: 0 -1
    uclass.c@246: uclass_find_device_by_seq: 0 0
    uclass.c@254:    - -1 -1 'mt25qu256a@0'
    uclass.c@262:    - not found
    SF: Detected mt25qu256a with page size 256 Bytes, erase size 64 KiB, total 32 MiB
    uclass.c@246: uclass_find_device_by_seq: 0 1  <<< here parameters are loaded
    ...

    In custom u-boot configuration the executable file and its parameters are stored in NOR device.
    Now I try to remove my specific parameters and erase all NOR device, but I think, the SPL block remain in the same place.
    My uboot file is enought big:

    1230824 Dec 23 12:23 u-boot-spi.gph

    The SPL start from 0 and u-boot start from 0x10000.

    Is it possible that SPL is not able to load it because too larger file?

    PS: I'm sorry for delayed answer but I have had a big problem with my environment (for three days I was not able to build/debug/run anything).

    BR,

    Dario

  • Hi Rex,

      I have downloaded the SDK linux environment from TI home site about in Sept/Oct 2018.
    I haven't update this environment later till now and I am not use github site.

    Same days ago I have erased all the NOR device (content uboot, SPL and their patameters),
    removed my special parameters (left only TI) and run "evm default -f -a" command,
    after that I have saved on NOR the default parameters.

    The uboot stop in the same position.

    My problem "now" is uboot from SPI/NOR device, not the Linux starting (not now,
    if the 1G ethernet will work I will be able to store linux FS on NAND device, etc...).

    Could you try to build your uboot with my .config file? and to try if SPL start uboot part
    on evm board? I cant' find any parameter that define uboot size, I think that this info is taken
    from mtd partition but I am not sure of that, or SPL load only a part of uboot (< 1.2M)
    or use external DDR memory instead of internal memory.

    My NOR device is little different (respect EVM device) infacts it use the extended
    address mode (4 byte address) on standard 4 line SPI bus (BUS0 CS0), but I think
    it is not important (becouse my patch in TI code handles this specific mode).

    Changes:

    A) k2hk_evm.h
    #define CONFIG_ENV_SIZE              (256 << 10)  /* 256 KB */
    #define CONFIG_ENV_OFFSET            0x200000
    #define CONFIG_SF_DEFAULT_BUS        0
    #define CONFIG_SF_DEFAULT_CS         0
    #define CONFIG_SYS_UBOOT_BASE        (64*1024)
    #include <configs/ti_armv7_keystone2.h>
    /* this value can't are 0x0c000000 infact spl not start at all */
    #define CONFIG_SPL_TEXT_BASE        0x0c100000

    B) ti_armv7_keystone2.h
    #define CONFIG_SPL_PAD_TO           65536
    #define CONFIG_SPL_MAX_SIZE         (CONFIG_SPL_PAD_TO - 8)
    #define CONFIG_SPL_BSS_START_ADDR   (CONFIG_SPL_TEXT_BASE + CONFIG_SPL_MAX_SIZE)
    #define CONFIG_SPL_BSS_MAX_SIZE     (32 * 1024)
    #define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SPL_BSS_START_ADDR + CONFIG_SPL_BSS_MAX_SIZE)
    #define CONFIG_SYS_SPL_MALLOC_SIZE  CONFIG_SPL_BSS_MAX_SIZE

    C) sf_internal.h (to handle nor extended address commands)
    #define CMD_4_READ_ARRAY_SLOW     0x13
    #define CMD_4_READ_ARRAY_FAST     0x0c

    D) spi_flash.c (to handle nor extended address commands)
        if (flash->size > SZ_16M)
          {
            flash->read_cmd = CMD_4_READ_ARRAY_FAST;
            if (spi->mode & SPI_RX_SLOW)
               flash->read_cmd = CMD_4_READ_ARRAY_SLOW;
        }
        else
        {/*original code*/
           flash->read_cmd = CMD_READ_ARRAY_FAST;
           if (spi->mode & SPI_RX_SLOW)
            flash->read_cmd = CMD_READ_ARRAY_SLOW;
           else if (spi->mode & SPI_RX_QUAD && info->flags & RD_QUAD)
            flash->read_cmd = CMD_READ_QUAD_OUTPUT_FAST;
           else if (spi->mode & SPI_RX_OCTAL && info->flags & RD_OCTAL)
            flash->read_cmd = CMD_READ_OCTAL_OUTPUT;
           else if (spi->mode & SPI_RX_DUAL && info->flags & RD_DUAL)
            flash->read_cmd = CMD_READ_DUAL_OUTPUT_FAST;
        }

    E) spi_flash_ids.c
    #ifdef CONFIG_SPI_FLASH_STMICRO    
    ...
     {"mt25qu256a",     INFO(0x20bb19, 0x0,  64 * 1024,   512, E_FSR | SECT_4K) },
    ...

    F) keystone-k2hk-drsp.dts (this file replace keystone-k2hk-evm.dts) only spi section:
    &spi0 {
        status = "okay";
        nor_flash: mt25qu256a@0
        {
            #address-cells = <1>;
            #size-cells = <1>;
            compatible = "Micron,mt25qu256a", "spi-flash";
            spi-max-frequency = <54000000>;
            m25p,fast-read;
            spi-cpha=<1>;
            spi-cpol=<1>;
            spi-tx-bus-width=<1>;
            spi-rx-bus-width=<1>;
            reg = <0>;
            partition@0 {
                label = "u-boot-spl";
                reg = <0x0 0x200000>;
                read-only;
            };
            partition@1 {
                label = "params";
                reg = <0x200000 0x80000>;
            };
            partition@2 {
                label = "misc";
                reg = <0x280000 0x1D60000>;
            };
            partition@3 {
                label = "norTest";
                reg = <0x1FE0000 0x20000>;
            };
        };
    };

    G) added dt.setup.c (stub function only to build, if I remember well)
    #include <common.h>
    int ft_system_setup(void *blob, bd_t *bd)
    {
        return 0;
    }

    The other changes only to support DDR3A&B @1600MHz without ECC and NAND on 16 bit bus
    and some patches to NOR etended address and some debug printout (for eth, NOR, NAND etc)
    as in spl.c
    #ifdef spl_display_print
        spl_display_print();
    #endif

    or other changes to able to build (related environemnt saved on SPI/NOR) or to eth debugging.


    Thank you for your help.

    BR,
    Dario

  • Hi, Dario,

    You mentioned that you can’t find any parameter that define uboot size. What is the uboot size used for, to program the NOR? When programming u-boot to NOR, the filesize env variable will be set after you download the u-boot image. It usually is the true file size rounded up to the next hex 0x10000.

     I have some questions on your changes. You have SPL_TEXT_BASE changed from 0x0c200000 to 0x0c100000. What's the reason? Also, your code seems to be a mix of mcsdk and psdk. I can't find spi_flash.c in PSDK, nor the flash id file in MCSDK.( spi_flash_ids.c or spi-nor-ids.c). I am a bit confused here.

    Your ENV_OFFSET is also changed. Have you tried with the default offset as in released PSDK?

    Rex

  • Hi Rex,

       I have changed the following function to print the u-boot size (catched from binary header stored on NOR)
    and some other parametes:

    int spl_spi_load(struct spl_image_info *spl_image,
             struct spl_boot_device *bootdev,
             unsigned int offs_override,
             void *buffer)
    {
        int err = 0;
        unsigned payload_offs = CONFIG_SYS_SPI_U_BOOT_OFFS;
        static struct spi_flash *flash;
        struct image_header *header;

        printf("%s: Called\n", __func__);

    ....

        /* Allow overwriting load address */
        if (buffer)
            header = buffer;
        else
            /* use CONFIG_SYS_TEXT_BASE as temporary storage area */
            header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);

    #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
        payload_offs = fdtdec_get_config_int(gd->fdt_blob,
                             "u-boot,spl-payload-offset",
                             payload_offs);
        printf("%s: 000 payload_offs 0x%X\n", __func__, payload_offs);
    #endif

        if (offs_override)
            payload_offs = offs_override;

    #ifdef CONFIG_SPL_OS_BOOT
        if (spl_start_uboot() || spi_load_image_os(spl_image, flash, header))
    #endif
        {
    ...
         } else {

                err = spl_parse_image_header(spl_image, header);

    printf("%s: parse header Size=0x%x, Laddress=0x%x  error=%d\n",
           __func__, spl_image->size, spl_image->load_addr, err);

                if (err)
                    return err;

                /* Allow overwriting load address */
                if (buffer)
                    spl_image->load_addr = (uintptr_t)buffer;

    printf("%s: 2222  Laddress=0x%x buffer=0x%p payload_offs=0x%p\n",
                       __func__, spl_image->load_addr, buffer, payload_offs );

                err = spi_flash_read(flash, payload_offs,
                             spl_image->size,
                             (void *)spl_image->load_addr);

    printf("%s: Size=0x%x, Laddress=0x%x  error=%d\n",
                       __func__, spl_image->size, spl_image->load_addr, err );
            }
        }

        return err;
    }

    I have changed CONFIG_SYS_UBOOT_START value In

    u-boot-2018.01+gitAUTOINC+313dcd69c2-g313dcd69c2/Makefile

    becouse otherwise I think uboot-spl use
    internal register area instead of internal mempory to store u-boot applciation:


    # U-Boot entry point, needed for booting of full-blown U-Boot
    # from the SPL U-Boot version.
    #
    ifndef CONFIG_SYS_UBOOT_START
    #CONFIG_SYS_UBOOT_START := 0 --- original line
    CONFIG_SYS_UBOOT_START := $(CONFIG_SYS_TEXT_BASE)
    endif

    I have noted that load_addr is wrong number (now I can't put the log becouse
    I haven't the custom board with me), I was waiting SPL_TEXT_BASE + some bytes
    instead I have see SPL_TEXT_BASE - 0x40 (I don't sure of the number),

    I have no "strange" mix in nor code, I had use ti-processor-sdk-linux-k2hk-evm-05.02.00.10-Linux-x86-Install.bin

    3490520560 Jan 15  2019 ti-processor-sdk-linux-k2hk-evm-05.02.00.10-Linux-x86-Install.bin

    downloaded from TI site, for a couple of months I had used a previous sdk version:

    ti-processor-sdk-rtos-k2hk-evm-05.01.00.11-Linux-x86-Install.bin

    but I have replaced all files in SVN server.

    The spi_flash_ids.c and spi_flash.c files are here:

    [ xxx ~ ]: ls u-boot-2018.01+gitAUTOINC+313dcd69c2-g313dcd69c2/drivers/mtd/spi/
    total 140
     4096 Jan  2 06:54 .
     4096 Jan  2 06:27 ..
     2266 Dec 16  2018 fsl_espi_spl.c
     4975 Dec 16  2018 Kconfig
     518 Dec 28 01:23 Makefile
    17557 Dec 16  2018 sandbox.c
     1327 Dec 16  2018 sf.c
     18864 Dec 16  2018 sf_dataflash.c
      7154 Dec 28 01:20 sf_internal.h
    2264 Jan  2 18:58 sf_mtd.c
      4021 Jan  2 18:16 sf_probe.c
     2261 Jan  2 06:54 sf-uclass.c
    24589 Dec 24 15:16 spi_flash.c
    10218 Nov 19 13:13 spi_flash_ids.c
      9383 Dec 16  2018 sunxi_spi_spl.c

    Regards,
    Dario

  • Hi, Dario,

    I am not sure how to handle the mixing code from 2 different u-boot baselines. The code has been changed in the new baseline and I am not sure what implication it has when mixing them together.

    Rex

  • Hi Rex.

      I have solved the problem. I have used Uboot 2019.01 (using the same enviroment tools 5.2.0.10) I have port my changes (environment + spi flash + marvell 1584, and so on) and nor boot works (and also eths works).

    The new uboot's size now is < 700k (I suppose the real problem was the debugger symbos).

    Thanks you.

    Dario