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.

How to disable network support in U-Boot?

Hi ALL.
Our custom board (based on DM365) has no Ethernet. No i2c-eeprom (MAC is not needed).
Our U-Boot is v2010.12_DAVINCIPSP_03.21.00.04
Config is 'include/configs/davinci_dm365evm.h'
I need to supress "Net:   Read from EEPROM @ 0x50 failed" message.
And also I need to reduce size of u-boot.bin.
No NETWORK support is needed. I want to exclude linkage for obj-files related to network.

In short, I need networkless U-Boot.

HOW I CAN SIMPLY DISABLE OVERALL NETWORK SUPPORT FOR U-BOOT BUILD?

Thanks in advance!

  • Hi Senchuss,

    To disable the ethernet  for dm365, int config ie in "include/configs/davinci_dm365evm.h"  remove the config

    "#define CONFIG_DRIVER_TI_EMAC" or make it as #undef , Correspondingly there will be no ethernet enabled and you wont get the message

    "Net:   Read from EEPROM @ 0x50 failed".

     

    Regards,

    Prabhakar Lad


  • Hi, Prabhakar

    I disabled 'CONFIG_DRIVER_TI_EMAC' in 'include/configs/davinci_dm365evm.h'

    But I can see now linker errors:

    drivers/net/libnet.o: In function `davinci_emac_initialize':
    drivers/net/davinci_emac.c:691: undefined reference to `lxt972_init_phy'
    drivers/net/davinci_emac.c:691: undefined reference to `lxt972_is_phy_connected'
    drivers/net/davinci_emac.c:691: undefined reference to `lxt972_get_link_speed'
    drivers/net/davinci_emac.c:691: undefined reference to `lxt972_auto_negotiate'
    drivers/net/davinci_emac.c:691: undefined reference to `dp83848_init_phy'
    drivers/net/davinci_emac.c:691: undefined reference to `dp83848_is_phy_connected'
    drivers/net/davinci_emac.c:691: undefined reference to `dp83848_get_link_speed'
    drivers/net/davinci_emac.c:691: undefined reference to `dp83848_auto_negotiate'
    drivers/net/davinci_emac.c:691: undefined reference to `et1011c_get_link_speed'

    make[1]: *** [u-boot] Error 1

  • Hi Senchuss,

    disabled in the sense you completely removed it right? I find no issue when i build(no linker errors).

    what is the source of your u-boot is denx git?

     

    Regards

    Prabhakar Lad

     

  • U-Boot sources used: http://arago-project.org/git/projects/?p=u-boot-davinci.git;a=commit;h=1254a0b58d900b7035cfb36bf4e1b05dfbf09997

    Compiler: Mentor CodeSourcery 2011.03-42 (arm-none-eabi), i.e. "bare metal" arm compiler (not for linux).

    Opppsss... i make rebuild now (i.e. make clean  before make build). It's built without errors!!!

    Yes! You are right!

    I can see now in U-Boot

    Net:   No ethernet found.

    Thank you. You've helped me!

    But output 'u-boot.bin' still looks like big ~288Kb.

    I'll try to disable something else (cmd_ping and etc)

    THANK YOU!

     

     

  • Here a small addition.

    in 'include/config_cmd_default.h'

    // #define CONFIG_CMD_NET        /* bootp, tftpboot, rarpboot    */
    // #define CONFIG_CMD_NFS        /* NFS support            */

    The size of 'u-boot.bin' decreased by 2 Kb.

    A string with the "Net: "-message is no longer printed on the U-Boot screen. Good!!!

  • A small note about U-Boot programming style. U-Boot tends to use #Undef instead of commenting out #define. This is required usually to undo a previous define, eg config_cmd_default.h. To remove most network stuff:

    #undef CONFIG_DRIVER_TI_EMAC
    #undef CONFIG_CMD_DHCP
    #undef CONFIG_CMD_MII
    #undef CONFIG_CMD_NET
    #undef CONFIG_CMD_PING
    #undef CONFIG_CMD_NFS

    If your platform has MAC in EEPROM. I believe the MAC address and EEPROM code still get included and executed. Removing thats takes a bit more hacking and slashing. My platform included USB host code. That takes up a lot of room as well.

  • Hi, Prabhakar !

    Hi, Norman !

    Excuse me please!
    The problem is again relevant.
    I just now discovered that if I disable the support of the network, it will crash i2c-subsystem.
    Unbelievable!

    I've restored all the definitions back as it was originally.

    We will now discuss only about the "CONFIG_DRIVER_TI_EMAC",
    all other 'defines' are not touched (all of them are restored to initial 'davinci_dm365evm.h' configuration).

    We are touch this line only.

    in "include/configs/davinci_dm365evm.h"
    #define CONFIG_DRIVER_TI_EMAC
    Build, Flash and Test.
    u-boot# i2c probe
    It's works. U-boot discovers my i2c-chips and shows their addresses (I can see three addresses, it's right). All is good.

    in "include/configs/davinci_dm365evm.h"
    #undef CONFIG_DRIVER_TI_EMAC
    Build, Flash and Test.
    u-boot# i2c probe
    Displays a sequence "01 02 03 04 ... 7F"
    This means that the u-boot can't finds i2c-devices, i.e. the i2c subsystem crashed.

    Unbelievable!
    The network subsystem has influence to i2c-subsytem?

     

  • I doubt the i2c subsystem has crashed. The i2c command appears to be working. Just that nobody is connected. Suggests a pinmux problem. From what I can see, configuring pinmux for I2C lines is buried in dm365r.c:board_eth_init(). Disabling the TI_EMAC disables pinmux config of the I2C lines. I think you will have to copy the pinmux code into the board_init() function.

    int board_init(void)
    {
        gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DM365_EVM;
        gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;

    #ifdef CONFIG_DRIVER_DAVINCI_i2C
        /* Configure I2C pins so that EEPROM can be read */
        writel((readl(PINMUX3) | 0x01400000), PINMUX3);
    #endif

        return 0;
    }

    Yeah, TI could have done a better job of scaleability in U-Boot and especially in the kernel. Removing network from the kernel is very grim.

  • Hi senchuss ,

    What Norman suggested should work out.

    hi Norman ,the piece of code you suggested might go as patch or is it a rare requirement of disabling the ethernet ?

    Regards

    --Prabhakar Lad

  • Hi Prabhakar,

    The modification I suggested is just a quick hack. A proper patch would move the I2C pinmux code out of board_eth_init() to avoid configuring the pinmux twice. Although there is probably no harm. The I2C pinmux code would need to test both I2C and EMAC flags. Ideally, a board_i2c_init() function is needed. Hooking that in would take quite a bit more work.

    Norman

     

  • Hi !

    That's right exactly.

    U-Boot: v2010.12_DAVINCIPSP_03.21.00.04 (from arago-project.org)

    File: board/davinci/dm365evm/dm365evm.c

    Lines: 43-81

    ---

      43 #ifdef CONFIG_DRIVER_TI_EMAC
      44 int board_eth_init(bd_t *bis)
      45 {
      46         uint8_t eeprom_enetaddr[6];
    ...
      70         /* Configure I2C pins so that EEPROM can be read */
      71         writel((readl(PINMUX3) | 0x01400000), PINMUX3);
    ...
      80 }
      81 #endif

    ---

    If we disable "CONFIG_DRIVER_TI_EMAC" then no PINMUX3 settings for I2C (GIO21=2=I2C_SDA, GIO20=2=I2C_SCL).

    Also, I confess that I2C-support in register 'pinmux3' is not enabled in my 'ubl'-code.

    There are two ways.

    1: Enable I2C in U-Boot ( "CONFIG_DRIVER_TI_EMAC" independent)

    in "board/davinci/dm365evm/dm365evm.c"

    int board_init(void)
    {
        gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DM365_EVM;
        gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100
    ;
    #ifdef CONFIG_DRIVER_DAVINCI_I2C
    // Configure I2C pins
        writel((readl(PINMUX3) | 0x01400000), PINMUX3);
    #endif

        return 0;
    }

     

    2. Enable I2C in your UBL-code

    (for example carefully check PINMUX3 in your 'flash-utils/DM36x/Common/src/device.c' file.

    ---

    I do not know what is more correct ideology.
    At first, 'U-boot' does everything right. I2C is enabled because it needs access to the EEPROM to read the MAC if "CONFIG_DRIVER_TI_EMAC" is defined.
    If not, there is no reason to read MAC from EEPROM.
    At second, UBL has main goal that is setup DDR and NAND and load U-Boot. I.e. there is no reason to enable I2C in UBL.

    But I think that if U-boot has i2c-commands (like 'i2c probe', 'i2c read' etc) then i2c must be enabled in U-boot.

     

    Thank you Prabhakar! Thank you Norman!

    Now it's works!

    You've helped me!