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.

AM5728: understanding the code inside the code files related to am5728 GP EVM board inside u boot source code in ti sdk

Part Number: AM5728

inside the file am57xx_evm_defconfig

 

CONFIG_FASTBOOT_BUF_ADDR=0x82000000   <-----------------------------how 0x82000000  is obatined here and why the address should be for this line and not for other lines


CONFIG_FASTBOOT_BUF_SIZE=0x2F000000

CONFIG_USB_GADGET_VENDOR_NUM=0x0451  <------------------------how 0x0451 is obtained and what does this code line imply and where this is used in u boot source code in code files


CONFIG_USB_GADGET_PRODUCT_NUM=0xd022

inside am57xx_evm.h

#define CONFIG_SYS_I2C_EEPROM_ADDR    0x50

/* MMC ENV related defines */


#define CONFIG_SYS_MMC_ENV_DEV        1        /* eMMC */    <----------------what does this imply..i mean 1 in the line


#define CONFIG_SYS_MMC_ENV_PART        0        <------------------------------what does 0 imply here      


#define CONFIG_ENV_SIZE            SZ_128K


#define CONFIG_ENV_OFFSET        0x260000    <---------------------------------------------------------------------how 0x260000 is obtained and how it can used for calculating for custom board


#define CONFIG_ENV_OFFSET_REDUND    (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) <----------------definition of this line.. i mean why expression is defined here


#define CONFIG_SYS_REDUNDAND_ENVIRONMENT

i am also willing to know how the below values 0x1E0000, 0x140000,   0x80000 are obatined

#define CONFIG_SYS_SPI_KERNEL_OFFS      0x1E0000
#define CONFIG_SYS_SPI_ARGS_OFFS        0x140000
#define CONFIG_SYS_SPI_ARGS_SIZE        0x80000

inside board.c in u-boot-2018.01+gitAUTOINC+131dc82830-g131dc82830/board/ti/am57xx

static const struct emif_regs beagle_x15_emif1_ddr3_532mhz_emif_regs = {
    .sdram_config_init        = 0x61851b32,
    .sdram_config            = 0x61851b32,
    .sdram_config2            = 0x08000000,
    .ref_ctrl            = 0x000040F1,
    .ref_ctrl_final            = 0x00001035,
    .sdram_tim1            = 0xcccf36ab,
    .sdram_tim2            = 0x308f7fda,
    .sdram_tim3            = 0x409f88a8,
    .read_idle_ctrl            = 0x00050000,
    .zq_config            = 0x5007190b,
    .temp_alert_config        = 0x00000000,
    .emif_ddr_phy_ctlr_1_init     = 0x0024400b,
    .emif_ddr_phy_ctlr_1        = 0x0e24400b,
    .emif_ddr_ext_phy_ctrl_1     = 0x10040100,
    .emif_ddr_ext_phy_ctrl_2     = 0x00910091,
    .emif_ddr_ext_phy_ctrl_3     = 0x00950095,
    .emif_ddr_ext_phy_ctrl_4     = 0x009b009b,
    .emif_ddr_ext_phy_ctrl_5     = 0x009e009e,
    .emif_rd_wr_lvl_rmp_win        = 0x00000000,
    .emif_rd_wr_lvl_rmp_ctl        = 0x80000000,
    .emif_rd_wr_lvl_ctl        = 0x00000000,
    .emif_rd_wr_exec_thresh        = 0x00000305
};

i am unable to understand how the above values are obtained and why only these are declared here. is there any procedure to know how the values are calculated.

Regards

Deepto Bose

  • Hi Deepto,

    DEEPTO BOSE said:

    inside the file am57xx_evm_defconfig

     

    CONFIG_FASTBOOT_BUF_ADDR=0x82000000   <-----------------------------how 0x82000000  is obatined here and why the address should be for this line and not for other lines

    0x82000000 is buffer address in DDR-SDRAM address space, it is obtained from the AM57x memory map (see TRM, ch2 Memory Mapping, section 2.2 L3_MAIN Memory Map).

    Thus buffer address is used for Android fastboot feature, refer to the below fiels for more info:

    u-boot-2018.01/doc/README.android-fastboot

    u-boot-2018.01/drivers/usb/gadget/f_fastboot.c

    DEEPTO BOSE said:
    CONFIG_USB_GADGET_VENDOR_NUM=0x0451  <------------------------how 0x0451 is obtained and what does this code line imply and where this is used in u boot source code in code files

    The CONFIG_USB_GADGET_VENDOR_NUM must be one of the numbers supported by the fastboot client. The list of vendor IDs supported can be found in the
    fastboot client source code (fastboot.c)

    This is used in below files:

    u-boot-2018.01/drivers/usb/gadget/g_dnl.c

    u-boot-2018.01/drivers/usb/gadget/ether.c

    This 0x0451 value is obtained from AM572x TRM, sections 33.3.5.3.3 USB Driver Descriptors, 33.3.5.3.4 USB Customized Vendor and Product IDs

    idVendor - 0x0451 - Vendor ID (Texas Instruments), TI default value

    For rest of the values you are interested, I would suggest you to use grep tool in u-boot source code and search in AM57x TRM.

    Regards,
    Pavel

  • If you have no more questions related to the subject of this e2e thread, please close/verify/resolve this thread.

    Regards,
    Pavel