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.

C6678EVM IBL TFTP Boot customization

Guru 15520 points

Hi,

I have question about C6678EVM and MCSDK.
The MCSDK version is "2.01.02.06".

C6678EVM are supporting IBL TFTP boot and we are using this boot mode.
So, I'm setting bootmode to I2C(addr:0x51) and boot parameter index 4
as written in BiosMulticoreSDK user guide.
And the TFTP boot are working fine. But its using default parameter table.

Now, I want to add 16 parameter tables for TFTP boot.
These each parameter tables contains different IP address etc..
And select these parameter table from boot parameter index pins.

I'm searching how to realize this.
I guess I need to customize the IBL program and flash each parameter tables to I2C EEPROM.
But I don't know which source code of IBL to customize.
Which source code should I customize and what kind of customize are needed?

best regards,
g.f.

  • Hi g.f,

    You can change ip address, hw address and file name etc through by programming the IBL source or by updating the configuration parameter using gel file.

    Refer ibl_single_binary.txt in ~\ti\mcsdk_2_01_02_06\tools\boot_loader\ibl\doc.

    1. Update ibl/src/util/iblConfig/src/device.c file appropriately.

    2. Update ~\ti\mcsdk_2_01_02_06\tools\boot_loader\ibl\src\make\bin\i2cConfig.gel appropriately.

    Please refer below FAQ for updatign IBL configurations:

    Thank you.

  • Hi Raja,

    Thank you for the reply.

    I understood the method.
    But I want to do more efficient way because we want to try 16 diffent settings.
    I think switching the TFTP boot parameter table via DIPSW of EVM is more efficient.

    In MCSDK file<ibl.h> there are structure "ibl_t".
    There are code "iblBoot_t bootModes[ibl_N_BOOT_MODES]" and this ibl_N_BOOT_MODES are defined as 3(number of bootmode which IBL support).
    Also there are code as following which defines the boot modes supported by the IBL in above ibl.h .
    #define ibl_BOOT_MODE_TFTP 10

    So, if I change ibl_N_BOOT_MODES to 18 and add following code(for example) would IBL support 18 boot parameter table?

    /////////////////////////////
    #define ibl_BOOT_MODE_TFTP_1 1
    #define ibl_BOOT_MODE_TFTP_2 2
    #define ibl_BOOT_MODE_TFTP_3 3
    *
    *
    *
    #define ibl_BOOT_MODE_TFTP_17 17
    #define ibl_BOOT_MODE_TFTP_18 18
    /////////////////////////////

    best regards,
    g.f.
  • Hi Raja,

    I need to add additional boot parameter table for TFTP Boot as I mentioned at above post.
    Can you please give me advises?

    best regards,
    g.f.
  • g.f,

    Instead of introducing more number of boot modes  in ibl.h, you can simply modify the function c6678_ibl_config function which is used to initialize the Ip addr, server IP, gateway IP and netmask. In that function, you can add a switch condition to check the boot switch settings to use one of the 16 TFTP settings instead of the fixed configuration used:

    Replace :

     

     SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.ipAddr,    192,168,1,3);
     SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.serverIp,  192,168,1,2);
     SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.gatewayIp, 192,168,1,1);
     SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.netmask,   255,255,255,

    Pseudo code for implementing multiple IP addr using IBL:

    switch (boot_switch_read() )
    
    {
    
    Case 1:
    
        SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.ipAddr,    <IP _ADDR_1>);
    
       SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.serverIp, <SERVER _ADDR_1>);
    
       SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.gatewayIp, <GATEWAY_1>);
    
       SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.netmask,   <MASK_1>);
    
    break;
    
    Case2:
    
        SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.ipAddr,    <IP _ADDR_2>);
    
       SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.serverIp, <SERVER _ADDR_2>);
    
       SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.gatewayIp, <GATEWAY_2>);
    
       SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.netmask,   <MASK_2>);
    
    break;
    
    ................
    
    ................
    
    default:
    
        SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.ipAddr,    192,168,1,3);
    
       SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.serverIp,  192,168,1,2);
    
       SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.gatewayIp, 192,168,1,1);
    
       SETIP(ibl.bootModes[2].u.ethBoot.ethInfo.netmask,   255,255,255,0
    
    }

    Hope this helps.

    Regards,

    Rahul

  • Hi Rahul,

    Thank you for the reply and I'm sorry for the delay.

    I understood how to modify the source code to realize the multiple parameter for TFTP boot.

    But I have question about switch API.
    I searched the boot_switch_read() but I can't find this API in MCSDK.
    Where are this API defined?

    And which switch of EVM is this API correspond to?

    best regards,
    g.f.
  • g.f,

    The code that I provided was pseudo code. The boot_switch_read is a dummy function that I provided which is not part of MCSDK. It will need to be a function that you will need to implement as part of your customization. You can use the unused switches on the boot mode switches (SW3-SW6) that are latched into DEVSTAT register or use GPIOs to determine which IP address needs to be configured.

    Regards,

    Rahul

  • Hi Rahul,

    Thank you for the reply.
    I understood that user need to implement the function which read the state of boot mode switched(SW3-SW6).
    But in this case, it seem that user can only use SW6[4:3] during TFTP boot via I2C IBL boot.
    Because SW3 is used as Endian & boot mode(in this case I2C), SW4[4:1]&SW5[4:1]&SW6[2:1] as Device configuration in I2C Master Boot mode.
    So, there are only SW6[4:3](2bit) and only 4 different TFTP IP address etc can be defined in switch case function.

    Is there any method to realize 16 different TFTP IP address etc?

    best regards,
    g.f.