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.

AM4378: Can not set MAC addresses from EEPROM after upgrading TI SDK from Version 5 to Version 8 on AM437x Starter Kit

Part Number: AM4378


Our hardware design is based off TI AM437x Starter Kit. We used to use TI SDK version 05.02.00.10 (Dec 19, 2018). We are currently upgrading the TI SDK to 08.02.00.24 (Jun 6, 2022).
We had modified u-boot-2018.01+gitAUTOINC+313dcd69c2-g313dcd69c2 that comes with TI SDK versoin 05.02.00.10 by adding the function int board_eth_init(bd_t *bis) in board.c. We were then able to use the mac addresses set in the EEMPROM. 
However, the  u-boot-2021.01+gitAUTOINC+44a87e3ab8-g44a87e3ab8 that comes with TI SDK version 08.02.00.24 has a lot of changes and incorporating similar function to read the MAC addresses from the EEPROM and set the u-boot to pass those MAC addresses to the kernel has become challenging.
Do you have suggestions on how we can resolve and implement this?
A snippet of the changes we made in board.c that worked with TI SDK version 05.02.00.10 looks like this:

    // Modification: Added an option for reading mac address from EEPROM
    board_ti_get_eth_mac_addr(0, mac_addr);

    if (is_valid_ethaddr(mac_addr))
    {
        /* use mac from eeprom*/
        puts("using mac0 from eeprom\n");
    }
    else
    {
    /* try reading mac address from efuse */
    puts("using mac0 from efuse\n");
    mac_lo = readl(&cdev->macid0l);
    mac_hi = readl(&cdev->macid0h);
    mac_addr[0] = mac_hi & 0xFF;
    mac_addr[1] = (mac_hi & 0xFF00) >> 8;
    mac_addr[2] = (mac_hi & 0xFF0000) >> 16;
    mac_addr[3] = (mac_hi & 0xFF000000) >> 24;
    mac_addr[4] = mac_lo & 0xFF;
    mac_addr[5] = (mac_lo & 0xFF00) >> 8;
    }

#if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \
    (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
    if (!env_get("ethaddr")) {
        puts("<ethaddr> not set. Validating first E-fuse MAC\n");
        if (is_valid_ethaddr(mac_addr))
            eth_env_set_enetaddr("ethaddr", mac_addr);
    }
#ifndef CONFIG_SPL_BUILD
        board_ti_get_eth_mac_addr(1, mac_addr);

        if (is_valid_ethaddr(mac_addr))
        {
                /* use mac from eeprom*/
                puts("using mac1 from eeprom\n");
        }
        else
        {
    puts("using mac1 from efuse\n");
    mac_lo = readl(&cdev->macid1l);
    mac_hi = readl(&cdev->macid1h);
    mac_addr[0] = mac_hi & 0xFF;
    mac_addr[1] = (mac_hi & 0xFF00) >> 8;
    mac_addr[2] = (mac_hi & 0xFF0000) >> 16;
    mac_addr[3] = (mac_hi & 0xFF000000) >> 24;
    mac_addr[4] = mac_lo & 0xFF;
    mac_addr[5] = (mac_lo & 0xFF00) >> 8;
    }

    if (!env_get("eth1addr")) {
        if (is_valid_ethaddr(mac_addr))
            eth_env_set_enetaddr("eth1addr", mac_addr);
    }
Thanks,
Solan