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.

Booting U-boot for AM1705 and changing UART number for console

Other Parts Discussed in Thread: TLV320AIC3106, TPS65023, OMAP-L138, AM1705, AM1707, OMAP-L137

Hello Titus and Shankari,

I have been trying to run U-boot but I haven't had success.

First of all, my board has the following hardware:

SPI Flash : K0XMFI011 (Spansion) - 4MBytes - Connected to SPI0
Nand Flash: S34ML01G200TFI000 (Spansion) - 128MBytes - Connected to EMIFA
SDR SDRAM : AS4C16M16SA (Alliance Memory) - 32MBytes - Connected to EMIFB - Only one RAM chip
Ethernet  : LAN8720a
Audio     : TLV320AIC3106
Power     : TPS65023

Important : I need UART1 to be used for the console. This is for U-boot and Linux as well.

I understand that for changing the port from UART2 to UART1 I need to change some files. After lots of search I arrived at some instructions:
https://e2e.ti.com/support/dsp/omap_applications_processors/f/42/p/343979/1202078

https://e2e.ti.com/support/embedded/linux/f/354/t/155860#pi317016=1


Those instructions are for OMAP-L138, however I thought that similar instructions could apply to the AM1705 as well, so I tried to merge them.

I'm using DaVinci-PSP-SDK-03.20.00.14.
The U-boot directory is: DaVinci-PSP-SDK-03.20.00.14-custom/src/u-boot/uboot-03.20.00.14/

I did the following:

1) In file “include/asm-arm/arch-davinci/hardware.h”

/* Emulation suspend bits */
#define DAVINCI_SYSCFG_SUSPSRC_EMAC (1 << 5)
#define DAVINCI_SYSCFG_SUSPSRC_I2C (1 << 16)
#define DAVINCI_SYSCFG_SUSPSRC_SPI0 (1 << 21)
#define DAVINCI_SYSCFG_SUSPSRC_SPI1 (1 << 22)
#define DAVINCI_SYSCFG_SUSPSRC_UART2 (1 << 20)
#define DAVINCI_SYSCFG_SUSPSRC_UART1 (1 << 19) //Added this one
#define DAVINCI_SYSCFG_SUSPSRC_TIMER0 (1 << 27)

2) In file “include/configs/da830evm.h:”

-Mod1: Changed DAVINCI_UART2_BASE to DAVINCI_UART1_BASE
/*
* Serial Driver info
*/
#define CONFIG_SYS_NS16550
#define CONFIG_SYS_NS16550_SERIAL
#define CONFIG_SYS_NS16550_REG_SIZE -4 /* NS16550 register size */
#define CONFIG_SYS_NS16550_COM1 DAVINCI_UART1_BASE /* Base address of UART1 */
#define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
#define CONFIG_CONS_INDEX 1 /* use UART0 for console */
#define CONFIG_BAUDRATE 115200 /* Default baud rate */
#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }

-Mod2: Changed SDRAM memory size from 64Mbytes to 32Mbytes

/*
* Memory Info
*/
#define CONFIG_SYS_MALLOC_LEN (0x10000 + 1*1024*1024) /* malloc() len */
#define CONFIG_SYS_GBL_DATA_SIZE 128 /* reserved for initial data */
#define PHYS_SDRAM_1 DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
#define PHYS_SDRAM_1_SIZE (32 << 20) /* SDRAM size 32MB */
#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_1 + 0x2000000 /* memtest start addr */
#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x2000000 + 16*1024*1024) /* 16MB test */
#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
#define CONFIG_STACKSIZE (256*1024) /* regular stack */


3) In file “board/davinci/da8xxevm/da830evm.c”:

-Mod1: Changed pinmux settings from UART2 to UART1

/* UART pin muxer settings */
const struct pinmux_config uart_pins[] = {
{ pinmux[11], 1, 2 },
{ pinmux[11], 1, 3 }
};

-Mod2: Changed DAVINCI_LPSC_UART2 to DAVINCI_LPSC_UART1:
/*
* Power on required peripherals
* ARM does not have access by default to PSC0 and PSC1
* assuming here that the DSP bootloader has set the IOPU
* such that PSC access is available to ARM
*/
lpsc_on(DAVINCI_LPSC_AEMIF); /* NAND, NOR */
lpsc_on(DAVINCI_LPSC_SPI0); /* Serial Flash */
lpsc_on(DAVINCI_LPSC_EMAC); /* image download */
lpsc_on(DAVINCI_LPSC_UART1); /* console */
lpsc_on(DAVINCI_LPSC_GPIO);

-Mod3: Changed DAVINCI_SYSCFG_SUSPSRC_UART2 to DAVINCI_SYSCFG_SUSPSRC_UART1:

/* setup the SUSPSRC for ARM to control emulation suspend */
writel(readl(&davinci_syscfg_regs->suspsrc) &
~(DAVINCI_SYSCFG_SUSPSRC_EMAC | DAVINCI_SYSCFG_SUSPSRC_I2C |
DAVINCI_SYSCFG_SUSPSRC_SPI0 | DAVINCI_SYSCFG_SUSPSRC_TIMER0 |
DAVINCI_SYSCFG_SUSPSRC_UART1),
&davinci_syscfg_regs->suspsrc);

-Mod4: Changed davinci_uart2_ctrl_regs to davinci_uart1_ctrl_regs:


/* enable the console UART */
writel((DAVINCI_UART_PWREMU_MGMT_FREE | DAVINCI_UART_PWREMU_MGMT_URRST |
DAVINCI_UART_PWREMU_MGMT_UTRST),
&davinci_uart1_ctrl_regs->pwremu_mgmt);

4) Again in file “include/configs/da830evm.h:”

-Mod1: Changed the following line for LAN8720A
/*
* Network & Ethernet Configuration
*/
#define CONFIG_DRIVER_TI_EMAC
#ifdef CONFIG_DRIVER_TI_EMAC
#undef CONFIG_MII
#define CONFIG_DRIVER_TI_EMAC_USE_RMII
#define CONFIG_BOOTP_DEFAULT
#define CONFIG_BOOTP_DNS
#define CONFIG_BOOTP_DNS2
#define CONFIG_BOOTP_SEND_HOSTNAME
#define CONFIG_NET_RETRY_COUNT 10
#define CONFIG_NET_MULTI
#endif

After saving all the files, I compiled successfully by using:


make distclean CROSS_COMPILE=arm-none-linux-gnueabi-
make da830evm_config CROSS_COMPILE=arm-none-linux-gnueabi-
make all CROSS_COMPILE=arm-none-linux-gnueabi-

The result for this operation were 2 files: u-boot and u-boot.bin
Then using AISgen for D800K005 and the u-boot.bin image I created an AIS image. The settings are the following:


The message log was the following:


There is a WARNING: Entry point set to null pointer!
Is this a problem?


Once having the AIS file I did the following in a command window under Windows


1) I erased the SPI flash:

C:\AIS_Images>sfh_OMAP-L137.exe -targetType AM1707 -erase -p "COM6"
-----------------------------------------------------
TI Serial Flasher Host Program for OMAP-L137
(C) 2016, Texas Instruments, Inc.
Ver. 1.67
-----------------------------------------------------


[TYPE] Global erase
[TARGET] AM1707
[DEVICE] SPI_MEM
[SPI Block] 0


Attempting to connect to device COM6...
Press any key to end this program at any time.

(AIS Parse): Read magic word 0x41504954.
(AIS Parse): Waiting for BOOTME... (power on or reset target now)
(AIS Parse): BOOTME received!
(AIS Parse): Performing Start-Word Sync...
(AIS Parse): Performing Ping Opcode Sync...
(AIS Parse): Processing command 0: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 7968-Byte section to address 0x80000000.
(AIS Parse): Processing command 1: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 124-Byte section to address 0x80001F20.
(AIS Parse): Processing command 2: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 748-Byte section to address 0x80001F9C.
(AIS Parse): Processing command 3: 0x58535906.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Performing jump and close...
(AIS Parse): AIS complete. Jump to address 0x80000000.
(AIS Parse): Waiting for DONE...
(AIS Parse): Boot completed successfully.

Waiting for SFT on the OMAP-L137...

Erasing flash
100% [ ████████████████████████████████████████████████████████████ ]
Erase complete


Operation completed successfully.

2) Flashed u-boot-pato-ais.bin to the SPI flash:

C:\AIS_Images>sfh_OMAP-L137.exe -targetType AM1707 -flash_noubl -v -p "COM6" u-boot-pato-ais.bin
-----------------------------------------------------
TI Serial Flasher Host Program for OMAP-L137
(C) 2016, Texas Instruments, Inc.
Ver. 1.67
-----------------------------------------------------


[TYPE] Single boot image
[BOOT IMAGE] u-boot-pato-ais.bin
[TARGET] AM1707
[DEVICE] SPI_MEM
[SPI Block] 0


Attempting to connect to device COM6...
Press any key to end this program at any time.

(AIS Parse): Read magic word 0x41504954.
(AIS Parse): Waiting for BOOTME... (power on or reset target now)
(AIS Parse): BOOTME received!
(AIS Parse): Performing Start-Word Sync...
(AIS Parse): Performing Ping Opcode Sync...
(AIS Parse): Processing command 0: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 7968-Byte section to address 0x80000000.
(AIS Parse): Processing command 1: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 124-Byte section to address 0x80001F20.
(AIS Parse): Processing command 2: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 748-Byte section to address 0x80001F9C.
(AIS Parse): Processing command 3: 0x58535906.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Performing jump and close...
(AIS Parse): AIS complete. Jump to address 0x80000000.
(AIS Parse): Waiting for DONE...
(AIS Parse): Boot completed successfully.

Waiting for SFT on the OMAP-L137...
Target: BOOTUBL
Target: DONE

Flashing application u-boot-pato-ais.bin (157224 bytes)

Target: INFO: SPI Memory Initialization passed.
Target: SENDIMG
Target: BEGIN
100% [ ████████████████████████████████████████████████████████████ ]
Image data transmitted over UART.

Target: DONE
100% [ ████████████████████████████████████████████████████████████ ]
Application programming complete

Target: Doing block erase.Doing block erase.Doing block erase.SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SENDING
Target: SPI written correctly.
Target: DONE
Target: DONE

Operation completed successfully.


Then I powered off the board and changed the jumpers to SPI0 Flash setting.

I opened a serial terminal program on COM6 in my host PC.

I reapplied power to the PCB, but there is no activity in the terminal.

I do not know what else to do. Please help.

Best regards,

Patricio

  • Dear Patricio,

    Thanks for the detailed explanation of your problem.

    Can you please try to boot with UBL method ?

    Since you are using "DaVinci-PSP-SDK-03.20.00.14" SDK  package, it has the UBL in the below location.

    DaVinci-PSP-SDK-03.20.00.14-custom/src/boot-strap/armubl-03.20.00.14/

    ARM UBL CCS project:

    DaVinci-PSP-SDK-03.20.00.14-custom/src/boot-strap/armubl-03.20.00.14/ccsv3.3

    Import the above location as CCSv3 project in CCSv5 or CCSv6.

    1) Change to BOOT_SPI mode

    2) Change the "DEVICE_UART2_FOR_DEBUG" to "DEVICE_UART1_FOR_DEBUG"

    Rebuild the CCS project.

  • If you upload the ARM UBL project and make the above changes, build and debug the UBL code.

    if its worked and able to see the UART prints in your custom board's UART1 while running the code .out in CCS then you can convert into AIS binary without any PLL,SDRAM, PINMUX settings in AISgen tool.

    I just rebuild the ARM UBL code with UART1 change and SPI boot mode, attached .out and .ais file.

    Please try it and let me know.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/ubl_2D00_spi.out

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/ubl_2D00_spi.ais.bin

  • Your code changes look okay. I am guessing things break down at the AIS image creation. You changed a lot of things all at once. It would have been better to build your own version of the pre-built UART2 u-boot to test the entire build and program process. Then change one thing at a time. Some guesses...

    AISgen is graphical wrapper to the console program HexAIS. AISGen produces an INI file and command line for HexAIS. The command line is logged out to a TXT file. All these files are in the install directory. I experimented with feeding the command line and INI file to HexAIS in a command window. Seems that this verison of HexAIS
    - does not like .bin files.
    - does not support the @<Addr> for specifying a entry point.
    - does support -entrypoint <Addr>
    - does accept ELF files.
    - does accept .out(COFF?) files.
    The compilation of u-boot produces an ELF file by default. Rename u-boot to u-boot.elf and use that instead of u-boot.bin. The ELF file should define an entry point. You might be able to specify the entry point option as part of the file name in AISgen. Something like:
    u-boot.elf -entrypoint 0xC1080000
    or
    -entrypoint 0xC1080000 u-boot.elf

    The UBL approach suggested by Titus more closely matches the OMAP-L137 sequence of bootloading
    1. RBL (ROM Bootloader on the DSP)
    2. UBL (DSP)
    3. UBL (ARM)
    4. u-boot (ARM)
    5. linux (ARM)

    The AM17xx does not have an DSP, so a modified OMAP-L137 way would be
    1. RBL (ROM Bootloader on the ARM)
    2. UBL (ARM)
    3. u-boot (ARM)
    4. linux (ARM)
    In both cases, AISgen has been written to assume that first thing after RBL is a UBL in .out format. This version of AISgen has not been updated since 2012 to support removal of the redundant ARM UBL.

    The OMAP-L138 is an ARM boot device and I remember it's boot sequence originally has the ARM UBL. Later the sequence was eventually reduced to
    1. RBL (ROM Bootloader on the ARM)
    2. u-boot (ARM)
    3. linux (ARM)
    I think AISgen in this case supports a .bin format but the OMAP-L138 AISgen is not compatible with AM17xx devices.
  • Hello Titus and Norman,

    Thank you very much for your help.

    After some struggling before checking your advice,  I tried the to generate the AIS file without using the AISgen tool. I'm using Windows 10 right now and because I have experienced some trouble in the past with some programs, I decided to run HexAIS in a command window.

    HexAIS_OMAP-L137.exe -ini AISgen.ini -o u-boot-ais.bin -entrypoint 0xc1080000 u-boot.bin@0xc1080000

    The AISgen.ini file was taken from the AISgen tool directory.

    The file u-boot-ais.bin was created as a product of the HexAIS_OMAP-L137.exe execution, 

    Then it was sent to the AM1705 with the following line:

    sfh_OMAP-L137.exe -targetType AM1707 -flash_noubl -v -p "COM6" u-boot-ais.bin

    I changed the jumpers to boot from SPI0 source and re-applied power.

    This time the U-boot prompt was showing fine in a terminal application. It shows a lot of problems, as you can see below, but for this post the only goal was to be able to see the Uboot prompt sent from UART1.

    U-Boot 2009.11 (Sep 19 2016 - 17:36:38)

    I2C: ready
    DRAM: 32 MB
    *** Warning - bad CRC, using default environment

    In: serial
    Out: serial
    Err: serial
    ARM Clock : 300000000 Hz
    Read from EEPROM @ 0x50 failed
    Ethernet switch start failed!
    Net: Ethernet PHY: GENERIC @ 0x00

    Hit any key to stop autoboot: 0
    Failed to initialize SPI flash at 0:0
    No SPI flash selected. Please run `sf probe'
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    U-Boot >

    Thank you very much for your help

    Best regards,

    Patricio

  • Dear Patricio,
    Sounds good.
    Thanks for the update.
  • Hi Titus,
    We are using AM1705 with SPI flash as SPI boot and XDS100V2 for programming.
    We are not able to proceed further due to following issues:-
    1. When we try to download ramdisk image (ram_1) into ARM based processor using TFTP server, downloading is not successful which results in retries. After exceeding the retry count it starts again.
    2. Following is the Console output for your reference:

                Output console 

    Start of ARM UBL  

    U-Boot 2009.11 (Dec 15 2011 - 11:03:57) 

     
    U-Boot code: C1080000 -> C10A85F0  BSS: -> C10F0418 
    I2C:   ready 
    RAM Configuration:
    Bank #0: c0000000 64 MB 
    SF: Got idcode c2 20 19 c2 20 
    SF: Detected MX25L25635E with page size 256, total 33554432 bytes 
    RF: cmd = { 0x0b 0x040000 }  
     env_ptr->crc = -1091273969 , crc32(0, env_ptr->data, ENV_SIZE) = -1091273969In:    serial 
    Out:   serial 
    Err:   serial 
    ARM Clock : 300000000 Hz 
     aa 2 91 9 10 20 Ethernet address  
     
    Net:   More than one PHY detected. 
     
    ### main_loop entered: bootdelay=3 
     
    ### main_loop: bootcmd="tftp 0xc0700000 uImage; tftp 0xc1180000 ram_1; bootm 0xc0700000" 
    Hit any key to stop autoboot:  3 \0x08\0x08\0x08 2 \0x08\0x08\0x08 1 \0x08\0x08\0x08 0  
    Trying  
    tftp block size is 1468 
    Using  device 
    TFTP from server 192.168.1.51; our IP address is 192.168.1.53 
    Filename 'uImage'. 
    Load address: 0xc0700000 
    sending ARP for 3301a8c0 
    ARP broadcast 1 
    Got ARP REPLY, set server/gtwy eth addr (50:e5:49:18:90:4c) 
    Got it 
    #Server did not acknowledge timeout option! 
    ################################################################ 
    \0x09 ################################################################# 
    \0x09 ################################################################# 
    done 
    Bytes transferred = 2565920 (272720 hex) 
    Trying  
    tftp block size is 1468 
    Using  device 
    TFTP from server 192.168.1.51; our IP address is 192.168.1.53 
    Filename 'ram_1'. 
    Load address: 0xc1180000 

    sending ARP for 3301a8c0 
    ARP broadcast 1 
    Got ARP REPLY, set server/gtwy eth addr (50:e5:49:18:90:4c) 
    Got it 
    #Server did not acknowledge timeout option! 
    ################################################################ 
    \0x09 ################################################################# 
    \0x09 ###################################################T ############## 
    Retry count exceeded; starting again 
    Trying  
    Request you to please help us to resolve this issue and to proceed further.                                                                                                                                                                                                              
    Best Regards,
    Dhanraj Mane