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 the OMAP-L137 with SW5-2 on

Other Parts Discussed in Thread: OMAP-L137, OMAP-L138, DA8XX

Hi ALL,

I am trying to boot the OMAP-L137 with SW5-2 on (SW2- set to spi-flash boot mode)  to enable UART0.

By doing so i2c is disabled,and I receive:

EEPROM read @ 0x50 is failed

and

Ethernet switch start failed.

I tried to modified i2c_read and i2c_write functions in u-boot , but with no success.

My question is:

What's need to be done to be able to boot with SW5-2 on and still be able to load uImage and fs from Ethernet using tftp.

Thanks in advance,

Eyal


  • Eyal,

    Can you share the schematics of the board? 

  • Hi Thomas,

    Thanks for the reply.

    I am using evm omap-l137 board rev i.

    The schematics of rev g, which I guess is the same because it is the last rev available,  can be found here:

    http://support.spectrumdigital.com/boards/evmomapl137/revg/files/EVMOMAPL137_Schematics_revg.pdf

    Regards,

    Eyal

  • Hi Eyal,

    UART0 pins over lap with SPI flash CS0 that is required to read from flash. We have seen this issue before and have had to boot with the pin as SPI CS at the time of boot and then change the PINMUX to enable UART after the uboot has been copied. You can either have a kernel module or create an application that switches the pinmux to use UART0.

    Regards,

    Rahul

  • Hi Rahul,

    Good to hear from you.

    I have managed to boot with UART0 (SW5 with pin 2 on) after I changed the KSZ8893MQL ethernet switch external pins, ps0 and ps1, to (0,0),

    and after writing the mac address directly to u-boot.

    Anyway,

    Thanks and Regards,

    Eyal

  • Hi Eyal,

    Reading your post, I have seen you have been able to write the mac address at the u-boot. How did you get it?

    In my case, I am working with a based-OMAPL137 custom board, and unfortunately, I forgot to place the footprint for the on board EEPROM (CAT24C256 256-Kb I2C CMOS Serial EEPROM) where MAC address is obtained, I believe but I do not sure. Could you/anyone confirm if it is impossible to write the mac address without the on board EEPROM? Thanks in advance

    I tested a restoring MAC procedure for the OMAPL-138 from http://processors.wiki.ti.com/index.php/GSG:_OMAP-L138_DVEVM_Additional_Procedures#Restoring_MAC_address_on_SPI_Flash but it did not work for OMAPL137. I made changes suggested at the previous link, but I keep getting same errors...

    Read from EEPROM @ 0x50 failed                                                  
    Board Net Initialization Failed                                                 
    No ethernet found.  

    How could I solve the problem before doing a board redesign? Thanks in advance!

    Regards

    Óscar

  • Oscar,

    In your uboot environment add the setting

    setenv ethaddr XX:XX:XX:XX:XX:XX

    saveenv

    reset

    where XX:XX:XX:XX:XX:XX is the MAC address.

    Let us know if this doesn`t resolve the issue.

    Regards,

    Rahul

    PS: You can also hard code ethaddr variable in the default uboot arguments by changing the uboot header file that provide the default boot environment.

  • Hi Oscar,

    If setting the environment like Rahul suggested isn't working,

    try to set the ethaddr in u-boot config file: da8xx_evm.h 

    #define CONFIG_ETHADDR XX:XX:XX:XX:XX:XX

    In addition, to remove the error: Read from EEPROM @ 0x50 failed

    go to dv_board.c file and disable i2c_read (which read the address from the EEPROM)

    and provide the ethaddr to i2c_write (which write the address to the ethernet switch)


    Regards,

    Eyal



  • Hi Eyal,

    Sorry for delay, I was busy doing others things... Coming back that, I tested your suggestion and I was be able to read the MAC address correctly. However, I still have some doubts respect to this issue, I mean, right now I am working on a OMAPL137 custom board, so every component or IC of this board is virgin. At the MAC issue, I believe there are three elements playing each other: OMAPL137, MICREL (KSZ8893MQL) and I2C EEPROM (CAT24WC256). According to my knowledge, MICREL IC read MAC address from I2C EEPROM by means a function typed previously (i2c_read). Then, communication with OMAP and so on... But, at the beggining, how can I obtain information about MAC address?? If I have a new I2C EEPROM, that chip comes with a MAC address by default or nor? If it is right, how can I access to this information in order to configuring the uboot environment variable called 'ethaddr'? Can anyone help me or give any advise?? Thanks in advance!

    Regards

    Óscar

  • Oscar,

    From board design perspective the MAC address need to be programmed into the I2C EEPROM. Refer to page 18 of the following doc for the Spectrum digital EVM to see how this is done for the EVM kits.

    http://support.spectrumdigital.com/boards/evmomapl137/revd/files/EVMOMAPL137_TechRef_RevD.pdf

    Regards,

    Rahul

  • Thanks for your answer Rahul, but I have already seen that manual... Now, I am accessing to the OMAP drivers by means the next command:

    root@172.16.3.100:/sys/devices/platform/davinci_emac.1/driver/davinci_emac.1/net/eth0# ls

    addr_len   dev_id   features  iflink     speed         type
    address    device   flags     link_mode  statistics    uevent
    broadcast  dormant  ifalias   mtu        subsystem
    carrier    duplex   ifindex   operstate  tx_queue_len

    That address corresponds with the MAC address of the label written on the bottom of the board. At the EVM, everything is ok, both MAC are equal (obviously), but when I am working with the custom board (based OMAPL137 EVM) and I type the same commands, the result is 00:00:00:00:00:00. So, who is the source device for the MAC address?? Where does OMAP obtain that MAC address?? MICREL chip or I2C EEPROM?? How can I access to MICREL interface? Any help would be appreciated! Thanks in advance

    Regards

    Óscar

  • am using Concerto F28M35x card.......am trying to read/write the data EEPROM ........after writing if i read the data from EEPROM it is showinf 0xFF .........can any1 help me to slove this

    this is my code

    #define EEPROM_ADDRESS 0x50

    void simplewrite(unsigned char data);
    long simpleread();

    unsigned long result;

    int
    main(void)
    {
        unsigned char data = 'a';
        HWREG(SYSCTL_MWRALLOW) =  0xA5A5A5A5;
        SysCtlClockConfigSet(SYSCTL_SYSDIV_1 | SYSCTL_M3SSDIV_2 | SYSCTL_USE_PLL |
                             (SYSCTL_SPLLIMULT_M & 0x0F));
        SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);
        SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
        GPIOPinUnlock(GPIO_PORTB_BASE,GPIO_PIN_6);
        GPIOPinUnlock(GPIO_PORTB_BASE,GPIO_PIN_7);
        GPIOPinConfigure(GPIO_PB7_I2C0SCL);
        GPIOPinConfigure(GPIO_PB6_I2C0SDA);
        GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_6 | GPIO_PIN_7);
        HWREG(I2C0_MASTER_BASE + I2C_O_MCR) |= I2C_MCR_MFE;
        I2CMasterInitExpClk(I2C0_MASTER_BASE, SysCtlClockGet(SYSTEM_CLOCK_SPEED), false);
        I2CMasterEnable(I2C0_MASTER_BASE);

        simplewrite(data);
        result=simpleread();

    }

    void simplewrite(unsigned char data)
    {
        I2CMasterSlaveAddrSet(I2C0_MASTER_BASE, EEPROM_ADDRESS, false);
        I2CMasterDataPut(I2C0_MASTER_BASE, data);
        I2CMasterControl(I2C0_MASTER_BASE, I2C_MASTER_CMD_SINGLE_SEND);
        while (I2CMasterBusy(I2C0_MASTER_BASE)) {
        }
    }

    long simpleread()
    {
        I2CMasterSlaveAddrSet(I2C0_MASTER_BASE, EEPROM_ADDRESS, false);
        I2CMasterControl(I2C0_MASTER_BASE, I2C_MASTER_CMD_BURST_SEND_START);
        while (I2CMasterBusy(I2C0_MASTER_BASE)) {
        }
        I2CMasterSlaveAddrSet(I2C0_MASTER_BASE, EEPROM_ADDRESS, true);
        I2CMasterControl(I2C0_MASTER_BASE, I2C_MASTER_CMD_SINGLE_RECEIVE);
        while(I2CMasterBusy(I2C0_MASTER_BASE)){}
        return( I2CMasterDataGet(I2C0_MASTER_BASE));
    }

    thank in advance