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.

AM335x EEPROM dependency in Linux

Hello,

I'm using Processor SDK 2.0.0.1 to develop a kernel and u-boot image for a custom board based on the BBB and I'd like to remove the dependency on the EEPROM. After much digging through the source code I've found the files in:

/ti-processor-sdk-linux-am335x-evm-02.00.01.07/board-support/u-boot-2015.07+gitAUTOINC+5922e09363/board/ti/common/ 

and 

/ti-processor-sdk-linux-am335x-evm-02.00.01.07/board-support/u-boot-2015.07+gitAUTOINC+5922e09363/board/ti/am335x/

which read the EEPROM and configure the U-boot accordingly. I see that it loads the values in EEPROM into the RAM at address OMAP_SRAM_SCRATCH_BOARD_EEPROM_START. Is this needed? Can I just force the board_is_bone_lt() to return true?

If the values in RAM are important what I should put in place of the other parts of the data (rev, config, mac addr's) in the EEPROM structure:

struct ti_am_eeprom {
unsigned int header;
char name[TI_EEPROM_HDR_NAME_LEN];
char version[TI_EEPROM_HDR_REV_LEN];
char serial[TI_EEPROM_HDR_SERIAL_LEN];
char config[TI_EEPROM_HDR_CONFIG_LEN];
char mac_addr[TI_EEPROM_HDR_NO_OF_MAC_ADDR][TI_EEPROM_HDR_ETH_ALEN];
} __attribute__ ((__packed__));

Is there anywhere that helps determine which files needed to be modified to port a custom board? I've searched everywhere and can't find anything that isn't deprecated (old Sitara Linux SDK). It looks like there was some good guides for the pre-devicetree days but I'm having a really hard time finding up-to-date information. 

For the Kernel is there any dependency on the EEPROM? If so, can you point me to the files I need to modify? It feels like it would have been taken care of in the devicetree but I'm new to Linux and I don't have my head wrapped around everything yet. I have had success modifying the devicetree on a BBB but I don't know what will happen when the EEPROM is not there.

Thanks,

Matt

  • Hi,

    I will ask the software team to comment.
  • Hello Matt,

    Here you can find the I2C ID Memory for AM335X-EVM processors.wiki.ti.com/.../AM335x_General_Purpose_EVM_HW_User_Guide and here for AM335X-EVMSK processors.wiki.ti.com/.../AM335xStarterKitHardwareUsersGuide and use them as reference. Instead of removing the eeprom part of your U-Boot you better hard code the I2C ID Memory settings, since later these changes will be in use if needed.

    Best regards,
    Kemal
  • Hi Kemal,

    Okay, that's what I ended up doing. I read the values from another Beaglebone Black's EEPROM and roughly copied those. Is there anywhere in the Linux source that I need to do similar things? I have been able to boot up successfully on a BBB on which I lifted the SDA pin to the EEPROM so I think I'm okay, I just don't know if there's something subtle I'm missing. 

    Thanks,

    Matt

  • Hi Matt,

    Could you share the BBB , EEPROM values ??
    I am working on BBB based board.

    Thanks and Regards,
    Ravikiran
  • Hi Ravikiran,

    I realize it's been a long time but in case it still helps here's what I did:
    in the u-boot source folder/board/ti/am335x/board.c I editted the read_eeprom function as such:

    static int __maybe_unused read_eeprom(struct ti_am_eeprom **header)
    {
    //was: return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR, header);
    char Name[] = "A335BNLT";
    char Ver[] = "000C";
    char Ser[] = "011600000001";
    char Config[] = "00000000000000000000000000000000";
    char mac_addr[] = {0xff,0xff,0xff,0xff,0xff,0xff};
    //Force to always report as BBB Rev C
    // EEPROM data gets stored in special place in the RAM
    *header = DERIVED_EEPROM_START;
    (*header)->header = TI_EEPROM_HEADER_MAGIC;
    //name is "A335BNLT"

    memcpy((*header)->name,Name,8);
    memcpy((*header)->version,Ver,8);
    memcpy((*header)->serial,Ser,8);
    memcpy((*header)->config,Config,8);
    memcpy(&(*header)->mac_addr[0][0],mac_addr,6);
    memcpy(&(*header)->mac_addr[0][0],mac_addr,6);
    memcpy(&(*header)->mac_addr[0][0],mac_addr,6);
    return 0;
    // ti_am_eeprom structure:
    //unsigned int header; //0 4
    //char name[8]; //4 8
    //char version[4]; //12 4
    //char serial[12]; //16 12
    //char config[32]; //28 32
    //char mac_addr[HDR_NO_OF_MAC_ADDR][HDR_ETH_ALEN]; //60 6
    }