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.

TDA2EG: add new ddr3 support

Part Number: TDA2EG
Other Parts Discussed in Thread: DRA752, DRA722, PCF8575, PMP

Our custom board used 2*4GB DDR3 and the DDR3 type is V73CBG04168RC -J11. Where do I need revise the uboot code to adapt the new DDR3?

Please tell me the  tutorial or some advice.

My SDK version is 3.02.

  • Hi Denny,

    please check if this document can help you:
    www.ti.com/.../spraca1.pdf

    Regards,
    Yordan
  • HI,

    I made these changes in uboot code,but there's still something wrong.

    1.u-boot/board/ti/dra7xx/evm.c

    I add these :

    const struct emif_regs TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_emif_regs = {
    .sdram_config_init = 0x61873B32,
    .sdram_config = 0x61873B32,
    .sdram_config2 = 0x00000000,
    .ref_ctrl = 0x0000514D,
    .ref_ctrl_final = 0x0000144A,
    .sdram_tim1 = 0xD3337834,
    .sdram_tim2 = 0x30B37FE3,
    .sdram_tim3 = 0x407F8AD8,
    .read_idle_ctrl = 0x00050000,
    .zq_config = 0x5007190B,
    .temp_alert_config = 0x00000000,
    .emif_ddr_phy_ctlr_1_init = 0x08244010,
    .emif_ddr_phy_ctlr_1 = 0x0E244010,
    .emif_ddr_ext_phy_ctrl_1 = 0x04040100,
    .emif_ddr_ext_phy_ctrl_2 = 0x006B006B,
    .emif_ddr_ext_phy_ctrl_3 = 0x006B006B,
    .emif_ddr_ext_phy_ctrl_4 = 0x006B006B,
    .emif_ddr_ext_phy_ctrl_5 = 0x006B006B,
    .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
    };

    and

    void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs)
    {
    u64 ram_size;

    ram_size = board_ti_get_emif_size();

    switch (omap_revision()) {
    case DRA752_ES1_0:
    case DRA752_ES1_1:
    case DRA752_ES2_0:
    switch (emif_nr) {
    case 1:
    if (ram_size > CONFIG_MAX_MEM_MAPPED)
    *regs = &emif1_ddr3_532_mhz_1cs_2G;
    else
    *regs = &emif1_ddr3_532_mhz_1cs;
    break;
    case 2:
    if (ram_size > CONFIG_MAX_MEM_MAPPED)
    *regs = &emif2_ddr3_532_mhz_1cs_2G;
    else
    *regs = &emif2_ddr3_532_mhz_1cs;
    break;
    }
    break;
    case DRA762_ES1_0:
    if (emif_nr == 1)
    *regs = &emif_1_regs_ddr3_666_mhz_1cs_dra76;
    else
    *regs = &emif_2_regs_ddr3_666_mhz_1cs_dra76;
    break;
    case DRA722_ES1_0:
    case DRA722_ES2_0:
    case DRA722_ES2_1:
    if (ram_size < CONFIG_MAX_MEM_MAPPED)
    *regs = &emif_1_regs_ddr3_666_mhz_1cs_dra_es1;
    else
    *regs = &emif_1_regs_ddr3_666_mhz_1cs_dra_es2;
    break;
    default:
    *regs = &emif1_ddr3_532_mhz_1cs;
    }
    *regs = &TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_emif_regs; //new
    }

    void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs)
    {
    u64 ram_size;

    ram_size = board_ti_get_emif_size();

    switch (omap_revision()) {
    case DRA752_ES1_0:
    case DRA752_ES1_1:
    case DRA752_ES2_0:
    switch (emif_nr) {
    case 1:
    if (ram_size > CONFIG_MAX_MEM_MAPPED)
    *regs = &emif1_ddr3_532_mhz_1cs_2G;
    else
    *regs = &emif1_ddr3_532_mhz_1cs;
    break;
    case 2:
    if (ram_size > CONFIG_MAX_MEM_MAPPED)
    *regs = &emif2_ddr3_532_mhz_1cs_2G;
    else
    *regs = &emif2_ddr3_532_mhz_1cs;
    break;
    }
    break;
    case DRA762_ES1_0:
    if (emif_nr == 1)
    *regs = &emif_1_regs_ddr3_666_mhz_1cs_dra76;
    else
    *regs = &emif_2_regs_ddr3_666_mhz_1cs_dra76;
    break;
    case DRA722_ES1_0:
    case DRA722_ES2_0:
    case DRA722_ES2_1:
    if (ram_size < CONFIG_MAX_MEM_MAPPED)
    *regs = &emif_1_regs_ddr3_666_mhz_1cs_dra_es1;
    else
    *regs = &emif_1_regs_ddr3_666_mhz_1cs_dra_es2;
    break;
    default:
    *regs = &emif1_ddr3_532_mhz_1cs;
    }
    *regs = &TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_emif_regs; //new
    }

    and

    const struct dmm_lisa_map_regs TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_dmm_regs = {
    .dmm_lisa_map_0 = 0x00000000,
    .dmm_lisa_map_1 = 0x00000000,
    .dmm_lisa_map_2 = 0x80600100,
    .dmm_lisa_map_3 = 0xFF020100,
    .is_ma_present = 0x1
    };

    and

    void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs)
    {
    u64 ram_size;

    ram_size = board_ti_get_emif_size();

    switch (omap_revision()) {
    case DRA762_ES1_0:
    case DRA752_ES1_0:
    case DRA752_ES1_1:
    case DRA752_ES2_0:
    if (ram_size > CONFIG_MAX_MEM_MAPPED)
    *dmm_lisa_regs = &lisa_map_dra7_2GB;
    else
    *dmm_lisa_regs = &lisa_map_dra7_1536MB;
    break;
    case DRA722_ES1_0:
    case DRA722_ES2_0:
    case DRA722_ES2_1:
    default:
    if (ram_size < CONFIG_MAX_MEM_MAPPED)
    *dmm_lisa_regs = &lisa_map_2G_x_2;
    else
    *dmm_lisa_regs = &lisa_map_2G_x_4;
    break;
    }
    *dmm_lisa_regs = &TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_dmm_regs; //new
    }

    2.I can't find the DDR I/O Cells Configuration in u-boot/arch/arm/cpu/armv7/omap5/hw_init.c. Instead, I find it in uboot/arch/arm/cpu/armv7/omap5/hw_data.c .

    const struct ctrl_ioregs TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_ctrl_ioregs = {
    .ctrl_ddrch = 0x40404040,
    .ctrl_lpddr2ch = 0x40404040,
    .ctrl_ddr3ch = 0x40404040,
    .ctrl_ddrio_0 = 0x00094A40,
    .ctrl_ddrio_1 = 0x00000000,
    .ctrl_ddrio_2 = 0x84210000,
    .ctrl_emif_sdram_config_ext = 0x0000C123,
    .ctrl_emif_sdram_config_ext_final = 0x0001C1A7,
    .ctrl_ddr_ctrl_ext_0 = 0xA2000000,
    };

    and

    void get_ioregs(const struct ctrl_ioregs **regs)
    {
    u32 omap_rev = omap_revision();

    switch (omap_rev) {
    case OMAP5430_ES1_0:
    case OMAP5430_ES2_0:
    *regs = &ioregs_omap5430;
    break;
    case OMAP5432_ES1_0:
    *regs = &ioregs_omap5432_es1;
    break;
    case OMAP5432_ES2_0:
    *regs = &ioregs_omap5432_es2;
    break;
    case DRA752_ES1_0:
    case DRA752_ES1_1:
    case DRA752_ES2_0:
    case DRA762_ES1_0:
    *regs = &ioregs_dra7xx_es1;
    break;
    case DRA722_ES1_0:
    *regs = &ioregs_dra72x_es1;
    break;
    case DRA722_ES2_0:
    case DRA722_ES2_1:
    *regs = &ioregs_dra72x_es2;
    break;

    default:
    printf("\n INVALID OMAP REVISION ");
    }
    *regs = &TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_ctrl_ioregs;//new
    }

    I got these log:

    U-Boot SPL 2016.05-00008-g1fbee98-dirty (May 15 2018 - 10:03:58)
    DRA722-GP ES2.0
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    no pinctrl for hs200_1_8v
    no pinctrl for ddr_1_8v
    Timed out in wait_for_bb: status=0000
    tps65903x: could not set LDO1 voltage.
    Timed out in wait_for_bb: status=0000
    tps65903x: could not set LDO1 voltage.
    ** First descriptor is NOT a primary desc on 1:1 **
    *** Warning - bad CRC, using default environment

    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Trying to boot from MMC1
    reading dra7-ipu2-fw.lzop
    spl_load_file_fat: error reading file dra7-ipu2-fw.lzop, err - -1
    spl: error reading image dra7-ipu2-fw.lzop, err - -1
    Error loading remotecore IPU2!,Continuing with boot ...
    reading dra7-dsp1-fw.lzop
    spl_load_file_fat: error reading file dra7-dsp1-fw.lzop, err - -1
    spl: error reading image dra7-dsp1-fw.lzop, err - -1
    Error loading remotecore DSP1!,Continuing with boot ...
    reading dra7-dsp2-fw.lzop
    spl_load_file_fat: error reading file dra7-dsp2-fw.lzop, err - -1
    spl: error reading image dra7-dsp2-fw.lzop, err - -1
    Error loading remotecore DSP2!,Continuing with boot ...
    reading dra7-ipu1-fw.lzop
    spl_load_file_fat: error reading file dra7-ipu1-fw.lzop, err - -1
    spl: error reading image dra7-ipu1-fw.lzop, err - -1
    Error loading remotecore IPU1!,Continuing with boot ...
    *** Warning - bad CRC, using default environment

    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img


    U-Boot 2016.05-00008-g1fbee98-dirty (May 15 2018 - 10:03:58 +0800)

    CPU : DRA722-GP ES2.0
    Model: TI DRA722
    Board: DRA72x EVM REV
    DRAM: 1 GiB
    MMC: Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    OMAP SD/MMC: 0, OMAP SD/MMC: 1
    ** First descriptor is NOT a primary desc on 1:1 **
    *** Warning - bad CRC, using default environment

    Warning: fastboot.board_rev: unknown board revision
    GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
    part_get_info_efi: *** ERROR: Invalid GPT ***
    GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
    part_get_info_efi: *** ERROR: Invalid Backup GPT ***
    ERROR: cannot find partition: 'userdata'

    at arch/arm/cpu/armv7/omap-common/utils.c:195/mmc_get_part_size()
    Warning: fastboot.userdata_size: unable to calc
    SCSI: SATA link 0 timeout.
    AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
    flags: 64bit ncq stag pm led clo only pmp pio slum part ccc apst
    scanning bus for devices...
    Found 0 device(s).
    Net: Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Could not get PHY for ethernet@48484000: addr 3

    Warning: ethernet@48484000 using MAC address from ROM
    eth0: ethernet@48484000
    Hit any key to stop autoboot: 0
    Timed out in wait_for_bb: status=0000
    tps65903x: could not set LDO1 voltage.
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    switch to partitions #0, OK
    mmc0 is current device
    Timed out in wait_for_bb: status=0000
    tps65903x: could not set LDO1 voltage.
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    SD/MMC found on device 0
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    166 bytes read in 3 ms (53.7 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc0 ...
    Timed out in wait_for_bb: status=0000
    tps65903x: could not set LDO1 voltage.
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    switch to partitions #0, OK
    mmc0 is current device
    Timed out in wait_for_bb: status=0000
    tps65903x: could not set LDO1 voltage.
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    SD/MMC found on device 0
    4953640 bytes read in 234 ms (20.2 MiB/s)
    95041 bytes read in 22 ms (4.1 MiB/s)
    Booting from mmc0 ...
    Kernel image @ 0x82000000 [ 0x000000 - 0x4b9628 ]
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8ffe5000, end 8ffff340 ... OK

    Starting kernel ...

    It hang on Starting kernel.

    So I change the frequency 333 into 300 in u-boot/arch/arm/cpu/armv7/omap5/hw_init.c

    static const struct dpll_params ddr_dpll_params_2664mhz[NUM_SYS_CLKS] = {
    {111, 0, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 12 MHz */
    {300, 4, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 20 MHz */
    {555, 6, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 16.8 MHz */
    {555, 7, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 19.2 MHz */
    {666, 12, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 26 MHz */
    {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */
    {555, 15, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 38.4 MHz */
    };

    And then I got this log:

    U-Boot SPL 2016.05-00008-g1fbee98-dirty (May 15 2018 - 10:24:05)
    DRA722-GP ES2.0
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    no pinctrl for hs200_1_8v
    no pinctrl for ddr_1_8v
    Timed out in wait_for_bb: status=0000
    tps65903x: could not set LDO1 voltage.
    Timed out in wait_for_bb: status=0000
    tps65903x: could not set LDO1 voltage.
    ** First descriptor is NOT a primary desc on 1:1 **
    *** Warning - bad CRC, using default environment

    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Trying to boot from MMC1
    reading dra7-ipu2-fw.lzop
    spl_load_file_fat: error reading file dra7-ipu2-fw.lzop, err - -1
    spl: error reading image dra7-ipu2-fw.lzop, err - -1
    Error loading remotecore IPU2!,Continuing with boot ...
    reading dra7-dsp1-fw.lzop
    spl_load_file_fat: error reading file dra7-dsp1-fw.lzop, err - -1
    spl: error reading image dra7-dsp1-fw.lzop, err - -1
    Error loading remotecore DSP1!,Continuing with boot ...
    reading dra7-dsp2-fw.lzop
    spl_load_file_fat: error reading file dra7-dsp2-fw.lzop, err - -1
    spl: error reading image dra7-dsp2-fw.lzop, err - -1
    Error loading remotecore DSP2!,Continuing with boot ...
    reading dra7-ipu1-fw.lzop
    spl_load_file_fat: error reading file dra7-ipu1-fw.lzop, err - -1
    spl: error reading image dra7-ipu1-fw.lzop, err - -1
    Error loading remotecore IPU1!,Continuing with boot ...
    *** Warning - bad CRC, using default environment

    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img


    U-Boot 2016.05-00008-g1fbee98-dirty (May 15 2018 - 10:24:05 +0800)

    CPU : DRA722-GP ES2.0
    Model: TI DRA722
    Board: DRA72x EVM REV
    DRAM: 1 GiB
    MMC: Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    OMAP SD/MMC: 0, OMAP SD/MMC: 1
    ** First descriptor is NOT a primary desc on 1:1 **
    *** Warning - bad CRC, using default environment

    Warning: fastboot.board_rev: unknown board revision
    GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
    part_get_info_efi: *** ERROR: Invalid GPT ***
    GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
    part_get_info_efi: *** ERROR: Invalid Backup GPT ***
    ERROR: cannot find partition: 'userdata'

    at arch/arm/cpu/armv7/omap-common/utils.c:195/mmc_get_part_size()
    Warning: fastboot.userdata_size: unable to calc
    SCSI: SATA link 0 timeout.
    AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
    flags: 64bit ncq stag pm led clo only pmp pio slum part ccc apst
    scanning bus for devices...
    Found 0 device(s).
    Net: Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Could not get PHY for ethernet@48484000: addr 3

    Warning: ethernet@48484000 using MAC address from ROM
    eth0: ethernet@48484000
    Hit any key to stop autoboot: 0
    Timed out in wait_for_bb: status=0000
    tps65903x: could not set LDO1 voltage.
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    switch to partitions #0, OK
    mmc0 is current device
    Timed out in wait_for_bb: status=0000
    tps65903x: could not set LDO1 voltage.
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    SD/MMC found on device 0
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    166 bytes read in 3 ms (53.7 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc0 ...
    Timed out in wait_for_bb: status=0000
    tps65903x: could not set LDO1 voltage.
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    switch to partitions #0, OK
    mmc0 is current device
    Timed out in wait_for_bb: status=0000
    tps65903x: could not set LDO1 voltage.
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    Timed out in wait_for_bb: status=0000
    pcf8575_i2c_write_le16 i2c write failed to addr 21
    SD/MMC found on device 0
    4953640 bytes read in 234 ms (20.2 MiB/s)
    95041 bytes read in 22 ms (4.1 MiB/s)
    Booting from mmc0 ...
    Kernel image @ 0x82000000 [ 0x000000 - 0x4b9628 ]
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8ffe5000, end 8ffff340 ... OK

    Starting kernel ...

    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Initializing cgroup subsys cpuset
    [ 0.000000] Initializing cgroup subsys cpu
    [ 0.000000] Initializing cgroup subsys cpuacct
    [ 0.000000] Linux version 4.4.84-00018-gd326d64-dirty (root@autorad-VirtualBox) (gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02) ) #74 SMP PREEMPT Fri Apr 13 15:49:30 CST 2018
    [ 0.000000] CPU: ARMv7 Processor [412fc0f2] revision 2 (ARMv7), cr=30c5387d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
    [ 0.000000] Machine model: TI DRA722 Rev C EVM
    [ 0.000000] Reserved memory: created DMA memory pool at 0x0000000040300000, size 3 MiB
    [ 0.000000] Reserved memory: initialized node cmem@40300000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: regions without no-map are not yet supported
    [ 0.000000] Reserved memory: created CMA memory pool at 0x0000000099000000, size 80 MiB
    [ 0.000000] Reserved memory: initialized node ipu2_cma@95800000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created CMA memory pool at 0x000000009e000000, size 32 MiB
    [ 0.000000] Reserved memory: initialized node ipu1_cma@9d000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: regions without no-map are not yet supported
    [ 0.000000] Reserved memory: created CMA memory pool at 0x00000000a1000000, size 32 MiB
    [ 0.000000] Reserved memory: initialized node dsp1_cma@99000000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x00000000a9000000, size 64 MiB
    [ 0.000000] Reserved memory: initialized node cmem@A9000000, compatible id shared-dma-pool
    [ 0.000000] cma: Reserved 24 MiB at 0x00000000be400000
    [ 0.000000] Forcing write-allocate cache policy for SMP
    [ 0.000000] Memory policy: Data cache writealloc
    [ 0.000000] OMAP4: Map 0x00000000bfd00000 to fe600000 for dram barrier
    [ 0.000000] DRA722 ES2.0
    [ 0.000000] PERCPU: Embedded 11 pages/cpu @ef64f000 s14912 r8192 d21952 u45056
    [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 243264
    [ 0.000000] Kernel command line: console=ttyO0,115200n8 vram=16M root=PARTUUID=59cd0d56-02 rw rootwait ip=none mem=1024M
    [ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
    [ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [ 0.000000] BUG: Bad page state in process swapper pfn:81dc7
    [ 0.000000] page:ef6ecffc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:ef6ecffc r5:c089a100 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:000001c7 r4:ef6ecffc
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:ef6e9000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:ef6f1fdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:00000003 r5:00084000 r4:00082000
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] Disabling lock debugging due to kernel taint
    [ 0.000000] BUG: Bad page state in process swapper pfn:83557
    [ 0.000000] page:ef72203c count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:ef72203c r5:00000157 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:00000157 r4:ef72203c
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:ef71f000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:ef727fdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:00000003 r5:00084000 r4:00083800
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] BUG: Bad page state in process swapper pfn:83dc7
    [ 0.000000] page:ef734ffc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:ef734ffc r5:000001c7 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:000001c7 r4:ef734ffc
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:ef731000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:ef739fdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:00000003 r5:00084000 r4:00084000
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] BUG: Bad page state in process swapper pfn:949c7
    [ 0.000000] page:ef98fffc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:ef98fffc r5:000001c7 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:000001c7 r4:ef98fffc
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:ef98c000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:ef994fdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:000036d5 r5:00099000 r4:00094c00
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] BUG: Bad page state in process swapper pfn:959c7
    [ 0.000000] page:ef9b3ffc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:ef9b3ffc r5:000001c7 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:000001c7 r4:ef9b3ffc
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:ef9b0000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:ef9b8fdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:000036d5 r5:00099000 r4:00095c00
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] BUG: Bad page state in process swapper pfn:985c7
    [ 0.000000] page:efa16ffc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:efa16ffc r5:000001c7 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:000001c7 r4:efa16ffc
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:efa13000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:efa1bfdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:000036d5 r5:00099000 r4:00098800
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] BUG: Bad page state in process swapper pfn:98877
    [ 0.000000] page:efa1d0bc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:efa1d0bc r5:00000077 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:00000077 r4:efa1d0bc
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:efa1c000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:efa24fdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:000036d5 r5:00099000 r4:00098c00
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] BUG: Bad page state in process swapper pfn:a6877
    [ 0.000000] page:efc150bc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:efc150bc r5:00000077 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:00000077 r4:efc150bc
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:efc14000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:efc1cfdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:000086d5 r5:000a9000 r4:000a6c00
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] BUG: Bad page state in process swapper pfn:a6c77
    [ 0.000000] page:efc1e0bc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:efc1e0bc r5:00000077 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:00000077 r4:efc1e0bc
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:efc1d000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:efc25fdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:000086d5 r5:000a9000 r4:000a7000
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] BUG: Bad page state in process swapper pfn:a8157
    [ 0.000000] page:efc4d03c count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:efc4d03c r5:00000157 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:00000157 r4:efc4d03c
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:efc4a000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:efc52fdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:000086d5 r5:000a9000 r4:000a8400
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] BUG: Bad page state in process swapper pfn:ad077
    [ 0.000000] page:efcff0bc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:efcff0bc r5:00000077 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:00000077 r4:efcff0bc
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:efcfe000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:efd06fdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:0000e6d5 r5:000af58a r4:000ad400
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] BUG: Bad page state in process swapper pfn:ad477
    [ 0.000000] page:efd080bc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:efd080bc r5:00000077 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:00000077 r4:efd080bc
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:efd07000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:efd0ffdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:0000e6d5 r5:000af58a r4:000ad800
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] BUG: Bad page state in process swapper pfn:af077
    [ 0.000000] page:efd470bc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:efd470bc r5:00000077 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000400 r7:00000000 r6:0018bce1 r5:00000077 r4:efd470bc
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:0000000a r5:efd46000
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:efd4efdc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:0000e6d5 r5:000af58a r4:000af400
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] BUG: Bad page state in process swapper pfn:af557
    [ 0.000000] page:efd5203c count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()
    [ 0.000000] page dumped because: nonzero mapcount
    [ 0.000000] Modules linked in:
    [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.000000] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.000000] Backtrace:
    [ 0.000000] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.000000] r7:c079a3ac r6:200000d3 r5:00000000 r4:c08b77d0
    [ 0.000000] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.000000] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.000000] r7:c079a3ac r6:efd5203c r5:00000057 r4:c090bd4c
    [ 0.000000] [<c00d45b4>] (bad_page) from [<c00d48a8>] (free_pages_prepare+0x1c4/0x2b4)
    [ 0.000000] r9:c079a3ac r8:00000080 r7:00000000 r6:0018bce1 r5:00000057 r4:efd5203c
    [ 0.000000] [<c00d46e4>] (free_pages_prepare) from [<c00d6b5c>] (__free_pages_ok+0x34/0xc0)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:00080000 r6:00000007 r5:efd51400
    [ 0.000000] r4:ef6aa000
    [ 0.000000] [<c00d6b28>] (__free_pages_ok) from [<c00d6ccc>] (__free_pages+0x48/0x54)
    [ 0.000000] r10:c0910880 r9:c089d7d0 r8:c0899eb0 r7:efd525dc r6:00000000 r5:00000440
    [ 0.000000] r4:00000000
    [ 0.000000] [<c00d6c84>] (__free_pages) from [<c0859674>] (__free_pages_bootmem+0xb4/0xb8)
    [ 0.000000] r5:00000440 r4:00000001
    [ 0.000000] [<c08595c0>] (__free_pages_bootmem) from [<c085c010>] (free_all_bootmem+0x194/0x208)
    [ 0.000000] r7:c0899ea8 r6:0000e6d5 r5:000af58a r4:000af580
    [ 0.000000] [<c085be7c>] (free_all_bootmem) from [<c0849a80>] (mem_init+0x194/0x4d8)
    [ 0.000000] r10:c08b0598 r9:fffffc00 r8:c09115a0 r7:000c0000 r6:c0910880 r5:00000000
    [ 0.000000] r4:afcfe000
    [ 0.000000] [<c08498ec>] (mem_init) from [<c0843bc8>] (start_kernel+0x240/0x40c)
    [ 0.000000] r10:c0884a30 r9:c08e3000 r8:ffffffff r7:00000000 r6:ef65c080 r5:c08e3000
    [ 0.000000] r4:00000000
    [ 0.000000] [<c0843988>] (start_kernel) from [<80008090>] (0x80008090)
    [ 0.000000] r10:00000000 r9:412fc0f2 r8:80007000 r7:c089ed40 r6:c0884a2c r5:c089a484
    [ 0.000000] r4:c08e3214
    [ 0.000000] Memory: 456128K/979968K available (6239K kernel code, 295K rwdata, 2188K rodata, 340K init, 299K bss, 298048K reserved, 172032K cma-reserved, 234496K highmem)
    [ 0.000000] Virtual kernel memory layout:
    [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
    [ 0.000000] vmalloc : 0xf0800000 - 0xff800000 ( 240 MB)
    [ 0.000000] lowmem : 0xc0000000 - 0xf0000000 ( 768 MB)
    [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
    [ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
    [ 0.000000] .text : 0xc0008000 - 0xc0842ffc (8428 kB)
    [ 0.000000] .init : 0xc0843000 - 0xc0898000 ( 340 kB)
    [ 0.000000] .data : 0xc0898000 - 0xc08e1d20 ( 296 kB)
    [ 0.000000] .bss : 0xc08e3000 - 0xc092dfd4 ( 300 kB)
    [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [ 0.000000] Preemptible hierarchical RCU implementation.
    [ 0.000000] Build-time adjustment of leaf fanout to 32.
    [ 0.000000] RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
    [ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=1
    [ 0.000000] NR_IRQS:16 nr_irqs:16 16
    [ 0.000000] ti_dt_clocks_register: failed to lookup clock node gmac_gmii_ref_clk_div
    [ 0.000000] OMAP clockevent source: timer1 at 32786 Hz
    [ 0.000000] Architected cp15 timer(s) running at 6.14MHz (phys).
    [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x16af5adb9, max_idle_ns: 440795202250 ns
    [ 0.000004] sched_clock: 56 bits at 6MHz, resolution 162ns, wraps every 4398046511023ns
    [ 0.000016] Switching to timer-based delay loop, resolution 162ns
    [ 0.000333] clocksource: 32k_counter: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 58327039986419 ns
    [ 0.000341] OMAP clocksource: 32k_counter at 32768 Hz
    [ 0.000740] Console: colour dummy device 80x30
    [ 0.000756] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
    [ 0.000762] This ensures that you still see kernel messages. Please
    [ 0.000767] update your kernel commandline.
    [ 0.000780] Calibrating delay loop (skipped), value calculated using timer frequency.. 12.29 BogoMIPS (lpj=61475)
    [ 0.000792] pid_max: default: 32768 minimum: 301
    [ 0.000892] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [ 0.000903] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
    [ 0.001447] Initializing cgroup subsys io
    [ 0.001464] Initializing cgroup subsys memory
    [ 0.001489] Initializing cgroup subsys devices
    [ 0.001502] Initializing cgroup subsys freezer
    [ 0.001514] Initializing cgroup subsys perf_event
    [ 0.001525] Initializing cgroup subsys pids
    [ 0.001551] CPU: Testing write buffer coherency: ok
    [ 0.001756] /cpus/cpu@0 missing clock-frequency property
    [ 0.001768] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
    [ 0.001802] Setting up static identity map for 0x80008380 - 0x800083e0
    [ 0.050027] Brought up 1 CPUs
    [ 0.050039] SMP: Total of 1 processors activated (12.29 BogoMIPS).
    [ 0.050046] CPU: All CPU(s) started in HYP mode.
    [ 0.050052] CPU: Virtualization extensions available.
    [ 0.050369] devtmpfs: initialized
    [ 0.080053] VFP support v0.3: implementor 41 architecture 4 part 30 variant f rev 0
    [ 0.081058] omap_hwmod: l3_main_2 using broken dt data from ocp
    [ 0.260275] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [ 0.260300] futex hash table entries: 256 (order: 2, 16384 bytes)
    [ 0.273767] pinctrl core: initialized pinctrl subsystem
    [ 0.274705] NET: Registered protocol family 16
    [ 0.275271] BUG: Bad page state in process swapper/0 pfn:be69d
    [ 0.275283] page:eff70e14 count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.275290] flags: 0x80000000()
    [ 0.275299] page dumped because: nonzero mapcount
    [ 0.275305] Modules linked in:
    [ 0.275319] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 0.275326] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 0.275333] Backtrace:
    [ 0.275354] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 0.275361] r7:c079a3ac r6:60000013 r5:00000000 r4:c08b77d0
    [ 0.275388] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 0.275401] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 0.275407] r7:c079a3ac r6:eff70e14 r5:00000000 r4:c090bd4c
    [ 0.275430] [<c00d45b4>] (bad_page) from [<c00d4950>] (free_pages_prepare+0x26c/0x2b4)
    [ 0.275436] r9:80000000 r8:00000001 r7:00000001 r6:00080000 r5:00000000 r4:eff70e14
    [ 0.275463] [<c00d46e4>] (free_pages_prepare) from [<c00d6974>] (free_hot_cold_page+0x3c/0x1a0)
    [ 0.275469] r10:c011d7ac r9:80000000 r8:ef6aa000 r7:c089d7d0 r6:00080000 r5:00000000
    [ 0.275491] r4:eff70e14
    [ 0.275504] [<c00d6938>] (free_hot_cold_page) from [<c00d6cd4>] (__free_pages+0x50/0x54)
    [ 0.275510] r9:eec6e000 r8:c0910880 r7:c089d7d0 r6:000be800 r5:00000000 r4:00000000
    [ 0.275536] [<c00d6c84>] (__free_pages) from [<c00d9118>] (free_contig_range+0x6c/0x9c)
    [ 0.275542] r5:00000000 r4:000be69e
    [ 0.275558] [<c00d90ac>] (free_contig_range) from [<c00d9468>] (alloc_contig_range+0x320/0x330)
    [ 0.275564] r9:eec6e000 r8:000be440 r7:000be440 r6:00000000 r5:000be800 r4:000be400
    [ 0.275591] [<c00d9148>] (alloc_contig_range) from [<c011d944>] (cma_alloc+0xb8/0x1bc)
    [ 0.275597] r10:c08b2250 r9:00000040 r8:00001800 r7:000be400 r6:00000040 r5:c0912448
    [ 0.275618] r4:00000000
    [ 0.275635] [<c011d88c>] (cma_alloc) from [<c03e31dc>] (dma_alloc_from_contiguous+0x40/0x44)
    [ 0.275642] r10:00000001 r9:00000040 r8:00000092 r7:00c00000 r6:00000707 r5:00040000
    [ 0.275662] r4:00000001
    [ 0.275676] [<c03e319c>] (dma_alloc_from_contiguous) from [<c001bd20>] (__alloc_from_contiguous+0x44/0x128)
    [ 0.275688] [<c001bcdc>] (__alloc_from_contiguous) from [<c0849054>] (atomic_pool_init+0x9c/0x184)
    [ 0.275693] r10:00000000 r9:c0843600 r8:00000092 r7:00c00000 r6:00000707 r5:c089eff0
    [ 0.275713] r4:c08e3330
    [ 0.275726] [<c0848fb8>] (atomic_pool_init) from [<c000982c>] (do_one_initcall+0x98/0x1e4)
    [ 0.275732] r7:eed994c0 r6:c089d8f0 r5:c0848fb8 r4:c089d8f0
    [ 0.275753] [<c0009794>] (do_one_initcall) from [<c0843f68>] (kernel_init_freeable+0x1d4/0x268)
    [ 0.275758] r10:00000003 r9:c0843600 r8:00000092 r7:c0884824 r6:c0892104 r5:c08e3000
    [ 0.275778] r4:c08e3000
    [ 0.275793] [<c0843d94>] (kernel_init_freeable) from [<c0618dec>] (kernel_init+0x18/0xf4)
    [ 0.275799] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0618dd4
    [ 0.275818] r4:c08e3000
    [ 0.275832] [<c0618dd4>] (kernel_init) from [<c000fc08>] (ret_from_fork+0x14/0x2c)
    [ 0.275837] r5:c0618dd4 r4:00000000
    [ 0.276223] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [ 0.300205] cpuidle: using governor ladder
    [ 0.330231] cpuidle: using governor menu
    [ 0.338626] OMAP GPIO hardware version 0.1
    [ 0.344887] irq: no irq domain found for /ocp/l4@4a000000/scm@2000/pinmux@1400 !
    [ 0.366398] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
    [ 0.366409] hw-breakpoint: maximum watchpoint size is 8 bytes.
    [ 0.366810] omap4_sram_init:Unable to allocate sram needed to handle errata I688
    [ 0.366819] omap4_sram_init:Unable to get sram pool needed to handle errata I688
    [ 0.367410] OMAP DMA hardware revision 0.0
    [ 0.450523] omap-dma-engine 4a056000.dma-controller: OMAP DMA engine driver (LinkedList1/2/3 supported)
    [ 0.451680] edma 43300000.edma: memcpy is disabled
    [ 0.456384] edma 43300000.edma: TI EDMA DMA engine driver
    [ 0.460379] omap-iommu 40d01000.mmu: 40d01000.mmu registered
    [ 0.460593] omap-iommu 40d02000.mmu: 40d02000.mmu registered
    [ 0.460765] omap-iommu 58882000.mmu: 58882000.mmu registered
    [ 0.460926] omap-iommu 55082000.mmu: 55082000.mmu registered
    [ 0.463542] i2c i2c-0: of_i2c: modalias failure on /ocp/i2c@48070000/gpio@20
    [ 0.463556] i2c i2c-0: of_i2c: modalias failure on /ocp/i2c@48070000/gpio@21
    [ 0.463574] omap_i2c 48070000.i2c: bus 0 rev0.12 at 400 kHz
    [ 0.464003] omap_i2c 4807c000.i2c: bus 4 rev0.12 at 100 kHz
    [ 0.464164] media: Linux media interface: v0.10
    [ 0.464219] Linux video capture interface: v2.00
    [ 0.464260] pps_core: LinuxPPS API ver. 1 registered
    [ 0.464267] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [ 0.464291] PTP clock support registered
    [ 0.464340] EDAC MC: Ver: 3.0.0
    [ 0.471038] omap-mailbox 48840000.mailbox: omap mailbox rev 0x400
    [ 0.471235] omap-mailbox 48842000.mailbox: omap mailbox rev 0x400
    [ 0.472196] clocksource: Switched to clocksource arch_sys_counter
    [ 0.482079] NET: Registered protocol family 2
    [ 0.482598] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
    [ 0.482661] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
    [ 0.482786] TCP: Hash tables configured (established 8192 bind 8192)
    [ 0.482841] UDP hash table entries: 512 (order: 2, 16384 bytes)
    [ 0.482872] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
    [ 0.483084] NET: Registered protocol family 1
    [ 0.493382] RPC: Registered named UNIX socket transport module.
    [ 0.493392] RPC: Registered udp transport module.
    [ 0.493399] RPC: Registered tcp transport module.
    [ 0.493405] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [ 0.494411] hw perfevents: enabled with armv7_cortex_a15 PMU driver, 7 counters available
    [ 0.514172] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [ 0.524851] NFS: Registering the id_resolver key type
    [ 0.524884] Key type id_resolver registered
    [ 0.524892] Key type id_legacy registered
    [ 0.524957] ntfs: driver 2.1.32 [Flags: R/O].
    [ 0.526473] bounce: pool size: 64 pages
    [ 0.526627] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
    [ 0.526644] io scheduler noop registered
    [ 0.526657] io scheduler deadline registered
    [ 0.526691] io scheduler cfq registered (default)
    [ 0.531125] pinctrl-single 4a003400.pinmux: 282 pins at pa fc003400 size 1128
    [ 0.531243] pinctrl-single 4a002e8c.pinmux: 1 pins at pa fc002e8c size 4
    [ 0.534428] PCI host bridge /ocp/axi@0/pcie_rc@51000000 ranges:
    [ 0.534442] No bus range found for /ocp/axi@0/pcie_rc@51000000, using [bus 00-ff]
    [ 0.534475] IO 0x20003000..0x20012fff -> 0x00000000
    [ 0.534496] MEM 0x20013000..0x2fffffff -> 0x20013000
    [ 0.564377] dra7-pcie 51000000.pcie_rc: link is not up
    [ 0.564551] dra7-pcie 51000000.pcie_rc: PCI host bridge to bus 0000:00
    [ 0.564564] pci_bus 0000:00: root bus resource [bus 00-ff]
    [ 0.564574] pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
    [ 0.564584] pci_bus 0000:00: root bus resource [mem 0x20013000-0x2fffffff]
    [ 0.564996] PCI: bus0: Fast back to back transfers disabled
    [ 0.565113] PCI: bus1: Fast back to back transfers enabled
    [ 0.565205] pci 0000:00:00.0: BAR 0: assigned [mem 0x20100000-0x201fffff]
    [ 0.565220] pci 0000:00:00.0: BAR 1: assigned [mem 0x20020000-0x2002ffff]
    [ 0.565233] pci 0000:00:00.0: PCI bridge to [bus 01]
    [ 0.565456] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
    [ 0.620170] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled
    [ 0.623505] 4806a000.serial: ttyS0 at MMIO 0x4806a000 (irq = 301, base_baud = 3000000) is a 8250
    [ 4.757357] console [ttyS0] enabled
    [ 4.761774] 48020000.serial: ttyS2 at MMIO 0x48020000 (irq = 302, base_baud = 3000000) is a 8250
    [ 4.771524] 48066000.serial: ttyS4 at MMIO 0x48066000 (irq = 303, base_baud = 3000000) is a 8250
    [ 4.781506] [drm] Initialized drm 1.1.0 20060810
    [ 4.787121] 58000000.dss supply vdda_video not found, using dummy regulator
    [ 4.794314] OMAP DSS rev 6.1
    [ 4.798073] omapdss_dss 58000000.dss: bound 58001000.dispc (ops dispc_component_ops)
    [ 4.850712] brd: module loaded
    [ 4.938987] loop: module loaded
    [ 4.942486] vmemexp device MAJOR num = 246
    [ 4.946614] vmemexp class registered
    [ 4.950316] /dev/vmemexp device registered
    [ 4.954447] ioctl DBUFIOC_EXPORT_VIRTMEM = -1072899120
    [ 4.962096] libphy: Fixed MDIO Bus: probed
    [ 4.967535] i2c /dev entries driver
    [ 4.972217] cal: Neither port is configured, no point in staying up
    [ 4.982378] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [ 4.990429] omap_hsmmc 4809c000.mmc: Got CD GPIO
    [ 4.995493] vsys_3v3: supplied by evm_12v0
    [ 4.999658] evm_3v3: supplied by vsys_3v3
    [ 5.003743] evm_3v3_sd: supplied by evm_3v3
    [ 5.042937] omap_hsmmc 480b4000.mmc: no pinctrl state for sdr25 mode
    [ 5.049322] omap_hsmmc 480b4000.mmc: no pinctrl state for sdr12 mode
    [ 5.092553] omap_hsmmc 480d1000.mmc: no pinctrl state for sdr25 mode
    [ 5.098937] omap_hsmmc 480d1000.mmc: no pinctrl state for sdr12 mode
    [ 5.122192] omap_hsmmc 480d1000.mmc: no pinctrl state for hs mode
    [ 5.162876] ledtrig-cpu: registered to indicate activity on CPUs
    [ 5.170804] NET: Registered protocol family 10
    [ 5.202891] sit: IPv6 over IPv4 tunneling driver
    [ 5.208069] NET: Registered protocol family 17
    [ 5.222206] can: controller area network core (rev 20120528 abi 9)
    [ 5.228575] NET: Registered protocol family 29
    [ 5.242196] can: raw protocol (rev 20120528)
    [ 5.246487] can: broadcast manager protocol (rev 20120528 t)
    [ 5.262224] can: netlink gateway (rev 20130117) max_hops=1
    [ 5.267917] Key type dns_resolver registered
    [ 5.282289] omap_voltage_late_init: Voltage driver support not added
    [ 5.289345] Power Management for TI OMAP4+ devices.
    [ 5.312407] Registering SWP/SWPB emulation handler
    [ 5.322711] dmm 4e000000.dmm: initialized all PAT entries
    [ 5.339750] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
    [ 5.347463] [drm] No driver support for vblank timestamp query.
    [ 5.355987] [drm] Initialized omapdrm 1.0.0 20110917 on minor 0
    [ 5.382655] hctosys: unable to open rtc device (rtc0)
    [ 5.399931] aic_dvdd: disabling
    [ 5.404382] Waiting for root device PARTUUID=59cd0d56-02...
    [ 5.440991] mmc0: host does not support reading read-only switch, assuming write-enable
    [ 5.452366] mmc0: new high speed SDHC card at address aaaa
    [ 5.468383] mmcblk0: mmc0:aaaa SL08G 7.40 GiB
    [ 5.475197] mmcblk0: p1 p2
    [ 5.512899] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
    [ 5.521051] mmc1: MAN_BKOPS_EN bit is not set
    [ 5.530664] mmc1: new HS200 MMC card at address 0001
    [ 5.546289] mmcblk1: mmc1:0001 IS008G 7.28 GiB
    [ 5.550876] EXT4-fs (mmcblk0p2): warning: mounting fs with errors, running e2fsck is recommended
    [ 5.562858] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [ 5.571151] VFS: Mounted root (ext4 filesystem) on device 179:2.
    [ 5.577235] mmcblk1boot0: mmc1:0001 IS008G partition 1 4.00 MiB
    [ 5.593185] devtmpfs: mounted
    [ 5.596512] Freeing unused kernel memory: 340K
    [ 5.600975] This architecture does not have kernel memory protection.
    [ 5.607491] mmcblk1boot1: mmc1:0001 IS008G partition 2 4.00 MiB
    [ 5.839144] systemd[1]: System time before build time, advancing clock.
    [ 5.903944] random: systemd: uninitialized urandom read (16 bytes read, 6 bits of entropy available)
    [ 5.933772] random: systemd: uninitialized urandom read (16 bytes read, 6 bits of entropy available)
    [ 5.954590] systemd[1]: systemd 229 running in system mode. (+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN)
    [ 5.992632] systemd[1]: Detected architecture arm.

    Welcome to Arago 2016.12!

    [ 6.043152] systemd[1]: Set hostname to <dra7xx-evm>.
    [ 6.110889] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 7 bits of entropy available)
    [ 6.146448] random: systemd-gpt-aut: uninitialized urandom read (16 bytes read, 7 bits of entropy available)
    [ 6.161839] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 8 bits of entropy available)
    [ 6.182409] random: systemd-gpt-aut: uninitialized urandom read (16 bytes read, 8 bits of entropy available)
    [ 6.194589] random: systemd-sysv-ge: uninitialized urandom read (16 bytes read, 8 bits of entropy available)
    [ 6.299835] random: systemd: uninitialized urandom read (16 bytes read, 11 bits of entropy available)
    [ 6.322853] random: systemd: uninitialized urandom read (16 bytes read, 11 bits of entropy available)
    [ 6.342480] random: systemd: uninitialized urandom read (16 bytes read, 11 bits of entropy available)
    [ 6.702040] systemd[1]: Listening on udev Control Socket.
    [ OK ] Listening on udev Control Socket.
    [ 6.742593] systemd[1]: Listening on Journal Socket (/dev/log).
    [ OK ] Listening on Journal Socket (/dev/log).
    [ 6.784995] systemd[1]: Created slice User and Session Slice.
    [ OK ] Created slice User and Session Slice.
    [ 6.822577] systemd[1]: Listening on Journal Socket.
    [ OK ] Listening on Journal Socket.
    [ 6.852516] systemd[1]: Listening on udev Kernel Socket.
    [ OK ] Listening on udev Kernel Socket.
    [ 6.882686] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
    [ OK ] Started Dispatch Password Requests to Console Directory Watch.
    [ 6.912535] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
    [ OK ] Listening on /dev/initctl Compatibility Named Pipe.
    [ 6.942574] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
    [ OK ] Started Forward Password Requests to Wall Directory Watch.
    [ 6.974090] systemd[1]: Created slice System Slice.
    [ OK ] Created slice System Slice.
    [ 7.013613] systemd[1]: Starting Load Kernel Modules...
    Starting Load Kernel Modules...
    [ 7.055423] systemd[1]: Mounting Temporary Directory...
    Mounting Temporary Directory...
    [ 7.084862] systemd[1]: Starting Remount Root and Kernel File Systems...
    Starting Remount Root and Kernel File Systems...
    [ 7.116416] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
    [ 7.123341] systemd[1]: Created slice system-serial\x2dgetty.slice.
    [ OK ] Created slice system-serial\x2dgetty.slice.
    [ 7.154967] systemd[1]: Starting Setup Virtual Console...
    Starting Setup Virtual Console...
    [ 7.184978] systemd[1]: Mounting Debug File System...
    Mounting Debug File System...
    [ 7.212550] systemd[1]: Reached target Slices.
    [ OK ] Reached target Slices.
    [ 7.232467] systemd[1]: Reached target Paths.
    [ OK ] Reached target Paths.
    [ 7.252416] systemd[1]: Reached target Swap.
    [ OK ] Reached target Swap.
    [ 7.274896] systemd[1]: Starting Create list of required static device nodes for the current kernel...
    Starting Create list of required st... nodes for the current kernel...
    [ 7.314815] systemd[1]: Mounting POSIX Message Queue File System...
    Mounting POSIX Message Queue File System...
    [ 7.357649] systemd[1]: Starting Journal Service...
    Starting Journal Service...
    [ 7.390208] systemd[1]: Mounted POSIX Message Queue File System.
    [ OK ] Mounted POSIX Message Queue File System.
    [ 7.422576] systemd[1]: Mounted Debug File System.
    [ OK ] Mounted Debug File System.
    [ 7.452535] systemd[1]: Mounted Temporary Directory.
    [ OK ] Mounted Temporary Directory.
    [ 7.482959] systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
    [ 7.504579] systemd[1]: Failed to start Load Kernel Modules.
    [FAILED] Failed to start Load Kernel Modules.
    See 'systemctl status systemd-modules-load.service' for details.
    [ 7.562395] systemd[1]: systemd-modules-load.service: Unit entered failed state.
    [ 7.569842] systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'.
    [ 7.579298] systemd[1]: Started Remount Root and Kernel File Systems.
    [ OK ] Started Remount Root and Kernel File Systems.
    [ 7.613412] systemd[1]: Started Setup Virtual Console.
    [ OK ] Started Setup Virtual Console.
    [ 7.644113] systemd[1]: Started Create list of required static device nodes for the current kernel.
    [ OK ] Started Create list of required sta...ce nodes for the current kernel.
    [ 7.673675] systemd[1]: Started Journal Service.
    [ OK ] Started Journal Service.
    Starting Create Static Device Nodes in /dev...
    Starting udev Coldplug all Devices...
    Starting Flush Journal to Persistent Storage...
    Starting Load/Save Random Seed...
    Starting Apply Kernel Variables...
    [ OK ] Started Create Static Device Nodes in /dev.
    [ OK ] Started Load/Save Random Seed.
    [ OK ] Started Apply Kernel Variables.
    [ 8.390574] systemd-journald[125]: Received request to flush runtime journal from PID 1
    [ OK ] Started Flush Journal to Persistent Storage.
    Starting udev Kernel Device Manager...
    [ OK ] Reached target Local File Systems (Pre).
    Mounting /media/ram...
    Mounting /var/volatile...
    [ OK ] Mounted /var/volatile.
    [ OK ] Mounted /media/ram.
    [ OK ] Started udev Kernel Device Manager.
    [ OK ] Reached target Local File Systems.
    Starting Create Volatile Files and Directories...
    [ 9.239130] omap-rproc 55020000.ipu: assigned reserved memory node ipu2_cma@95800000
    [ 9.332438] remoteproc0: 55020000.ipu is available
    [ 9.337347] remoteproc0: Note: remoteproc is still under development and considered experimental.
    [ 9.430097] remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
    [ OK ] Started Create Volatile Files and Directories.
    [ 9.536437] omap-rproc 40800000.dsp: assigned reserved memory node dsp1_cma@99000000
    [ OK ] Started udev Coldplug all Devices.[ 9.611633] remoteproc1: 40800000.dsp is available

    [ 9.722541] remoteproc1: Note: remoteproc is still under development and considered experimental.
    [ 9.817404] remoteproc1: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
    [ 9.880111] remoteproc0: registered virtio0 (type 7)
    Starting Update UTMP about System Boot/Shutdown...
    [ 9.929869] omap_rng 48090000.rng: OMAP Random Number Generator ver. 20
    [ 10.000261] remoteproc1: registered virtio1 (type 7)
    [ 10.011413] omap-des 480a5000.des: OMAP DES hw accel rev: 2.2
    [ OK ] Found device /dev/ttyS0.
    [ 10.186133] omap_rtc 48838000.rtc: rtc core: registered 48838000.rtc as rtc0
    [ OK ] Started Update UTMP about System Boot/Shutdown.
    [ OK ] Reached target System Initialization.
    [ OK ] Listening on D-Bus System Message Bus Socket.
    [ OK ] Reached target Sockets.
    [ OK ] Started Daily Cleanup of Temporary Directories.
    [ OK ] Reached target Timers.
    [ OK ] Reached target Basic System.
    Starting Permit User Sessions...
    Starting Login Service...
    [ OK ] Started D-Bus System Message Bus.
    [ 10.996097] BUG: Bad page state in process systemd-udevd pfn:a8747
    [ 11.032062] SCSI subsystem initialized
    [ 11.044065] page:efc5a5fc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 11.066878] omap-sham 4b101000.sham: hw accel on OMAP rev 4.3
    [ 11.081847] CAN device driver interface
    [ 11.099331] flags: 0x0()
    [ 11.101905] page dumped because: nonzero mapcount
    [ 11.149072] Modules linked in: can_dev omap_aes_driver(+) omap_sham(+) scsi_mod omap_wdt(+) dwc3_omap extcon rtc_omap omap_des omap_rng rng_core omap_remoteproc remoteproc virtio virtio_ring sch_fq_codel
    [ 11.175313] omap-aes 4b500000.aes: OMAP AES hw accel rev: 3.3
    [ 11.208463] omap-aes 4b700000.aes: OMAP AES hw accel rev: 3.3
    [ 11.232965] libata: Unknown symbol glob_match (err 0)
    [ 11.247841]
    [ 11.249355] CPU: 0 PID: 215 Comm: systemd-udevd Tainted: G B 4.4.84-00018-gd326d64-dirty #74
    [ 11.258963] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 11.265080] Backtrace:
    [ 11.267556] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 11.275156] r7:c079a3ac r6:60010013 r5:00000000 r4:c08b77d0
    [ 11.280879] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 11.288137] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 11.295300] r7:c079a3ac r6:efc5a5fc r5:00000000 r4:c090bd4c
    [ 11.301019] [<c00d45b4>] (bad_page) from [<c00d4950>] (free_pages_prepare+0x26c/0x2b4)
    [ 11.308967] r9:00000000 r8:00000001 r7:00000001 r6:00080000 r5:00000000 r4:efc5a5fc
    [ 11.316788] [<c00d46e4>] (free_pages_prepare) from [<c00d6974>] (free_hot_cold_page+0x3c/0x1a0)
    [ 11.325521] r10:bf084b40 r9:00000000 r8:ef6aa000 r7:00000001 r6:00080000 r5:00000000
    [ 11.333424] r4:efc5a5fc
    [ 11.335977] [<c00d6938>] (free_hot_cold_page) from [<c00d6cd4>] (__free_pages+0x50/0x54)
    [ 11.344099] r9:ee276048 r8:11d89fdc r7:00000001 r6:f2931000 r5:e860cd40 r4:00000000
    [ 11.351920] [<c00d6c84>] (__free_pages) from [<c0105bbc>] (__vunmap+0x60/0xec)
    [ 11.359171] r5:e860cd40 r4:0000001a
    [ 11.362777] [<c0105b5c>] (__vunmap) from [<c0105ce4>] (vfree+0x4c/0x90)
    [ 11.369416] r7:00000001 r6:ee276040 r5:00000001 r4:ee337f44
    [ 11.375134] [<c0105c98>] (vfree) from [<c00aba18>] (load_module+0x1df0/0x2068)
    [ 11.382383] r5:00000001 r4:ee337f44
    [ 11.385992] [<c00a9c28>] (load_module) from [<c00abe60>] (SyS_finit_module+0x88/0x98)
    [ 11.393852] r10:00000000 r9:ee336000 r8:c000fd04 r7:0000017b r6:b6e5ad90 r5:00000007
    [ 11.401753] r4:00000000
    [ 11.404308] [<c00abdd8>] (SyS_finit_module) from [<c000fb60>] (ret_fast_syscall+0x0/0x34)
    [ 11.412517] r6:00000000 r5:004c8928 r4:00000000
    [ 11.478804] libata: Unknown symbol glob_match (err 0)
    [ 11.508327] c_can_platform 4ae3c000.can: c_can_platform device registered (regs=fce3c000, irq=351)
    [ 11.682611] [drm] Initialized pvr 1.14.3699939 20110701 on minor 1
    Starting rc.pvr.service...
    [ OK ] Started Permit User Sessions.
    [ 11.840343] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
    [ 11.935644] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]
    [ OK ] Started rc.pvr.service.
    [ 12.781510] Error: Driver 'omap_wdt' is already registered, aborting...
    [ 12.839277] Error: Driver 'omap_wdt' is already registered, aborting...
    [ 13.395191] BUG: Bad page state in process systemd-udevd pfn:9931d
    [ 13.401497] page:efa35014 count:0 mapcount:-16 mapping: (null) index:0x0
    [ 13.492364] flags: 0x0()
    [ 13.494924] page dumped because: nonzero mapcount
    [ 13.499647] Modules linked in: dwc3(+) udc_core virtio_rpmsg_bus(+) bc_example(O) extcon_usb_gpio pvrsrvkm(O) c_can_platform c_can can_dev omap_aes_driver omap_sham scsi_mod dwc3_omap extcon rtc_omap omap_des omap_rng rng_core omap_remoteproc remoteproc virtio virtio_ring sch_fq_codel
    [ 13.572933] CPU: 0 PID: 206 Comm: systemd-udevd Tainted: G B O 4.4.84-00018-gd326d64-dirty #74
    [ 13.582543] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 13.588661] Backtrace:
    [ 13.591138] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 13.598739] r7:c079a3ac r6:60030113 r5:00000000 r4:c08b77d0
    [ 13.604460] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 13.611718] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 13.618882] r7:c079a3ac r6:efa35014 r5:00000000 r4:c090bd4c
    [ 13.624600] [<c00d45b4>] (bad_page) from [<c00d4950>] (free_pages_prepare+0x26c/0x2b4)
    [ 13.632549] r9:00000000 r8:00000001 r7:00000001 r6:00080000 r5:00000000 r4:efa35014
    [ 13.640371] [<c00d46e4>] (free_pages_prepare) from [<c00d6974>] (free_hot_cold_page+0x3c/0x1a0)
    [ 13.649105] r10:c011d7ac r9:00000000 r8:ef6aa000 r7:c089d7d0 r6:00080000 r5:00000000
    [ 13.657008] r4:efa35014
    [ 13.659561] [<c00d6938>] (free_hot_cold_page) from [<c00d6cd4>] (__free_pages+0x50/0x54)
    [ 13.667683] r9:ee188000 r8:c0910880 r7:c089d7d0 r6:00099400 r5:00000000 r4:00000000
    [ 13.675504] [<c00d6c84>] (__free_pages) from [<c00d9118>] (free_contig_range+0x6c/0x9c)
    [ 13.683539] r5:00000000 r4:0009931e
    [ 13.687149] [<c00d90ac>] (free_contig_range) from [<c00d9468>] (alloc_contig_range+0x320/0x330)
    [ 13.695882] r9:ee188000 r8:00099003 r7:00099003 r6:00000000 r5:00099400 r4:00099000
    [ 13.703706] [<c00d9148>] (alloc_contig_range) from [<c011d944>] (cma_alloc+0xb8/0x1bc)
    [ 13.711653] r10:c08b2250 r9:00000003 r8:00005000 r7:00099000 r6:00000003 r5:c09123d0
    [ 13.719554] r4:00000000
    [ 13.722111] [<c011d88c>] (cma_alloc) from [<c03e31c8>] (dma_alloc_from_contiguous+0x2c/0x44)
    [ 13.730582] r10:00000001 r9:00000003 r8:ffffffff r7:00c00000 r6:00000707 r5:00003000
    [ 13.738483] r4:00000001
    [ 13.741038] [<c03e319c>] (dma_alloc_from_contiguous) from [<c001bd20>] (__alloc_from_contiguous+0x44/0x128)
    [ 13.750821] [<c001bcdc>] (__alloc_from_contiguous) from [<c001c1a4>] (__dma_alloc+0x278/0x2bc)
    [ 13.759466] r10:00000000 r9:00000000 r8:ffffffff r7:ee189b80 r6:024000c0 r5:eedf4810
    [ 13.767366] r4:00000000
    [ 13.769917] [<c001bf2c>] (__dma_alloc) from [<c001c2fc>] (arm_dma_alloc+0x64/0x6c)
    [ 13.777516] r10:c001c298 r9:eedf4810 r8:ee1cb400 r7:ee1cb800 r6:00000001 r5:00c00000
    [ 13.785414] r4:00000707
    [ 13.787981] [<c001c298>] (arm_dma_alloc) from [<bf022fac>] (rproc_alloc_vring+0x164/0x250 [remoteproc])
    [ 13.797412] r6:00000000 r5:ee1cb400 r4:00003000
    [ 13.802094] [<bf022e48>] (rproc_alloc_vring [remoteproc]) from [<bf0239e4>] (rproc_virtio_find_vqs+0x78/0x1f0 [remoteproc])
    [ 13.813268] r10:ee1cb820 r9:00000002 r8:bf1ffc94 r7:ee1cb410 r6:ee1cb5d0 r5:ee189c40
    [ 13.821168] r4:00000000
    [ 13.823743] [<bf02396c>] (rproc_virtio_find_vqs [remoteproc]) from [<bf1ff248>] (rpmsg_probe+0xbc/0x474 [virtio_rpmsg_bus])
    [ 13.834917] r10:00000000 r9:00000000 r8:ee1cb410 r7:ee189c38 r6:ee1cb800 r5:e8683f00
    [ 13.842818] r4:bf02396c
    [ 13.845385] [<bf1ff18c>] (rpmsg_probe [virtio_rpmsg_bus]) from [<bf01585c>] (virtio_dev_probe+0x230/0x310 [virtio])
    [ 13.855861] r10:00000000 r9:00000000 r8:00000000 r7:ee1cb420 r6:ee1cb410 r5:00000000
    [ 13.863761] r4:00000000
    [ 13.866318] [<bf01562c>] (virtio_dev_probe [virtio]) from [<c03dcd1c>] (driver_probe_device+0x204/0x2f8)
    [ 13.875835] r10:00000000 r9:e8650e08 r8:00000010 r7:bf1ffd3c r6:00000000 r5:ee1cb420
    [ 13.883736] r4:c091e71c
    [ 13.886286] [<c03dcb18>] (driver_probe_device) from [<c03dcea4>] (__driver_attach+0x94/0x98)
    [ 13.894758] r9:e8650e08 r8:179af21c r7:00000000 r6:ee1cb454 r5:bf1ffd3c r4:ee1cb420
    [ 13.902576] [<c03dce10>] (__driver_attach) from [<c03dafa4>] (bus_for_each_dev+0x70/0xa4)
    [ 13.910785] r7:00000000 r6:c03dce10 r5:bf1ffd3c r4:00000000
    [ 13.916504] [<c03daf34>] (bus_for_each_dev) from [<c03dc608>] (driver_attach+0x24/0x28)
    [ 13.924539] r6:bf015d58 r5:e8683100 r4:bf1ffd3c
    [ 13.929203] [<c03dc5e4>] (driver_attach) from [<c03dc244>] (bus_add_driver+0x1a8/0x220)
    [ 13.937243] [<c03dc09c>] (bus_add_driver) from [<c03dd644>] (driver_register+0x80/0x100)
    [ 13.945365] r7:e8650cc0 r6:c089d8f0 r5:bf203000 r4:bf1ffd3c
    [ 13.951084] [<c03dd5c4>] (driver_register) from [<bf015aa4>] (register_virtio_driver+0x30/0x44 [virtio])
    [ 13.960602] r5:bf203000 r4:00000000
    [ 13.964221] [<bf015a74>] (register_virtio_driver [virtio]) from [<bf203044>] (rpmsg_init+0x44/0x84 [virtio_rpmsg_bus])
    [ 13.974973] [<bf203000>] (rpmsg_init [virtio_rpmsg_bus]) from [<c000982c>] (do_one_initcall+0x98/0x1e4)
    [ 13.984403] r5:bf203000 r4:c089d8f0
    [ 13.988013] [<c0009794>] (do_one_initcall) from [<c00cee90>] (do_init_module+0x68/0x378)
    [ 13.996135] r10:bf1ffe40 r9:e8650e08 r8:179af21c r7:00000001 r6:e8650d00 r5:00000001
    [ 14.004036] r4:bf1ffe40
    [ 14.006590] [<c00cee28>] (do_init_module) from [<c00aba20>] (load_module+0x1df8/0x2068)
    [ 14.014625] r6:e8650e00 r5:00000001 r4:ee189f44
    [ 14.019287] [<c00a9c28>] (load_module) from [<c00abe60>] (SyS_finit_module+0x88/0x98)
    [ 14.027148] r10:00000000 r9:ee188000 r8:c000fd04 r7:0000017b r6:b6e5ad90 r5:00000007
    [ 14.035047] r4:00000000
    [ 14.037602] [<c00abdd8>] (SyS_finit_module) from [<c000fb60>] (ret_fast_syscall+0x0/0x34)
    [ 14.045811] r6:00000000 r5:004c8928 r4:00000000
    [ OK ] Started Login Service.[ 14.353118] remoteproc0: powering up 55020000.ipu

    Starting weston.service...
    [ 14.397639] remoteproc0: Booting fw image dra7-ipu2-fw.xem4, size 6071476
    Starting LSB: Dropbear Secure Shell server...
    [ OK ] Started Serial Getty on ttyS0.[ 14.447127] omap-iommu 55082000.mmu: 55082000.mmu: version 2.1

    [ OK ] Reached target Login Prompts.
    [ 14.522244] alloc_contig_range: [99300, 9af00) PFNs busy
    [ 14.656216] remoteproc0: remote processor 55020000.ipu is now up
    [ 14.707407] virtio_rpmsg_bus virtio0: rpmsg host is online
    [ OK ] Started weston.service.
    [ 14.737889] remoteproc1: powering up 40800000.dsp
    [ 14.746867] remoteproc1: Booting fw image dra7-dsp1-fw.xe66, size 1205069
    [ OK ] Started LSB: Dropbear Secure Shell server.
    [ 14.775291] omap_hwmod: mmu0_dsp1: _wait_target_disable failed
    [ 14.781190] omap-iommu 40d01000.mmu: 40d01000.mmu: version 3.0
    [ 14.787173] omap-iommu 40d02000.mmu: 40d02000.mmu: version 3.0
    [ 14.873773] BUG: Bad page state in process systemd-udevd pfn:a2b8d
    [ 14.880080] page:efb8bfd4 count:0 mapcount:-16 mapping: (null) index:0x0
    [ 14.924421] flags: 0x0()
    [ 14.926981] page dumped because: nonzero mapcount
    [ 14.931705] Modules linked in: dwc3(+) udc_core virtio_rpmsg_bus(+) bc_example(O) extcon_usb_gpio pvrsrvkm(O) c_can_platform c_can can_dev omap_aes_driver omap_sham scsi_mod dwc3_omap extcon rtc_omap omap_des omap_rng rng_core omap_remoteproc remoteproc virtio virtio_ring sch_fq_codel
    [ 15.006289] CPU: 0 PID: 206 Comm: systemd-udevd Tainted: G B O 4.4.84-00018-gd326d64-dirty #74
    [ 15.015899] Hardware name: Generic DRA72X (Flattened Device Tree)
    [ 15.022017] Backtrace:
    [ 15.024495] [<c0013254>] (dump_backtrace) from [<c0013450>] (show_stack+0x18/0x1c)
    [ 15.032094] r7:c079a3ac r6:60080013 r5:00000000 r4:c08b77d0
    [ 15.037818] [<c0013438>] (show_stack) from [<c02b1e88>] (dump_stack+0x8c/0xa0)
    [ 15.045076] [<c02b1dfc>] (dump_stack) from [<c00d4694>] (bad_page+0xe0/0x130)
    [ 15.052239] r7:c079a3ac r6:efb8bfd4 r5:00000000 r4:c090bd4c
    [ 15.057957] [<c00d45b4>] (bad_page) from [<c00d4950>] (free_pages_prepare+0x26c/0x2b4)
    [ 15.065906] r9:00000000 r8:00000001 r7:00000001 r6:00080000 r5:00000000 r4:efb8bfd4
    [ 15.073727] [<c00d46e4>] (free_pages_prepare) from [<c00d6974>] (free_hot_cold_page+0x3c/0x1a0)
    [ 15.082460] r10:c011d7ac r9:00000000 r8:ef6aa000 r7:c089d7d0 r6:00080000 r5:00000000
    [ 15.090363] r4:efb8bfd4
    [ 15.092915] [<c00d6938>] (free_hot_cold_page) from [<c00d6cd4>] (__free_pages+0x50/0x54)
    [ 15.101037] r9:ee188000 r8:c0910880 r7:c089d7d0 r6:000a2c00 r5:00000000 r4:00000000
    [ 15.108857] [<c00d6c84>] (__free_pages) from [<c00d9118>] (free_contig_range+0x6c/0x9c)
    [ 15.116893] r5:00000000 r4:000a2b8e
    [ 15.120502] [<c00d90ac>] (free_contig_range) from [<c00d9468>] (alloc_contig_range+0x320/0x330)
    [ 15.129234] r9:ee188000 r8:000a2b00 r7:000a2b00 r6:00000000 r5:000a2c00 r4:000a1300
    [ 15.137054] [<c00d9148>] (alloc_contig_range) from [<c011d944>] (cma_alloc+0xb8/0x1bc)
    [ 15.145002] r10:c08b2250 r9:00001800 r8:00002000 r7:000a1300 r6:00001800 r5:c0912420
    [ 15.152901] r4:00000300
    [ 15.155457] [<c011d88c>] (cma_alloc) from [<c03e31c8>] (dma_alloc_from_contiguous+0x2c/0x44)
    [ 15.163927] r10:00000001 r9:00001800 r8:ffffffff r7:00c00000 r6:00000707 r5:01800000
    [ 15.171829] r4:00000001
    [ 15.174382] [<c03e319c>] (dma_alloc_from_contiguous) from [<c001bd20>] (__alloc_from_contiguous+0x44/0x128)
    [ 15.184166] [<c001bcdc>] (__alloc_from_contiguous) from [<c001c1a4>] (__dma_alloc+0x278/0x2bc)
    [ 15.192811] r10:00000000 r9:00000000 r8:ffffffff r7:ee189b08 r6:024000c0 r5:eedf4a10
    [ 15.200714] r4:00000000
    [ 15.203265] [<c001bf2c>] (__dma_alloc) from [<c001c2fc>] (arm_dma_alloc+0x64/0x6c)
    [ 15.210864] r10:01800000 r9:c001c298 r8:eedf4a10 r7:c090bf94 r6:00000001 r5:00c00000
    [ 15.218766] r4:00000707
    [ 15.221333] [<c001c298>] (arm_dma_alloc) from [<bf021b14>] (rproc_handle_carveout+0x194/0x308 [remoteproc])
    [ 15.231113] r6:e731f000 r5:e86650f4 r4:ee1cac00
    [ 15.235793] [<bf021980>] (rproc_handle_carveout [remoteproc]) from [<bf0214d0>] (rproc_handle_resources+0x64/0xe8 [remoteproc])
    [ 15.247317] r10:bf021980 r9:ee1cac20 r8:bf024914 r7:bf025464 r6:000005f0 r5:ee1cac00
    [ 15.255217] r4:00000002
    [ 15.257789] [<bf02146c>] (rproc_handle_resources [remoteproc]) from [<bf022bf8>] (rproc_boot+0x30c/0x55c [remoteproc])
    [ 15.268527] r10:e71d0f00 r9:000005f0 r8:ee1cac20 r7:ee1cadac r6:ee1cadb4 r5:00000000
    [ 15.276430] r4:ee1cac00 r3:14bf2a9f
    [ 15.280056] [<bf0228ec>] (rproc_boot [remoteproc]) from [<bf023af8>] (rproc_virtio_find_vqs+0x18c/0x1f0 [remoteproc])
    [ 15.290707] r10:ee1cac20 r9:00000002 r8:bf1ffc9c r7:ee1c6410 r6:ee1c65f0 r5:ee189c44
    [ 15.298608] r4:00000002
    [ 15.301179] [<bf02396c>] (rproc_virtio_find_vqs [remoteproc]) from [<bf1ff248>] (rpmsg_probe+0xbc/0x474 [virtio_rpmsg_bus])
    [ 15.312354] r10:00000000 r9:00000000 r8:ee1c6410 r7:ee189c38 r6:ee1cac00 r5:ee339e80
    [ 15.320257] r4:bf02396c
    [ 15.322825] [<bf1ff18c>] (rpmsg_probe [virtio_rpmsg_bus]) from [<bf01585c>] (virtio_dev_probe+0x230/0x310 [virtio])
    [ 15.333303] r10:00000000 r9:00000000 r8:00000000 r7:ee1c6420 r6:ee1c6410 r5:00000000
    [ 15.341206] r4:00000000
    [ 15.343761] [<bf01562c>] (virtio_dev_probe [virtio]) from [<c03dcd1c>] (driver_probe_device+0x204/0x2f8)
    [ 15.353280] r10:00000000 r9:e8650e08 r8:00000011 r7:bf1ffd3c r6:00000000 r5:ee1c6420
    [ 15.361183] r4:c091e71c
    [ 15.363735] [<c03dcb18>] (driver_probe_device) from [<c03dcea4>] (__driver_attach+0x94/0x98)
    [ 15.372205] r9:e8650e08 r8:179af21c r7:00000000 r6:ee1c6454 r5:bf1ffd3c r4:ee1c6420
    [ 15.380026] [<c03dce10>] (__driver_attach) from [<c03dafa4>] (bus_for_each_dev+0x70/0xa4)
    [ 15.388235] r7:00000000 r6:c03dce10 r5:bf1ffd3c r4:00000000
    [ 15.393955] [<c03daf34>] (bus_for_each_dev) from [<c03dc608>] (driver_attach+0x24/0x28)
    [ 15.401990] r6:bf015d58 r5:e8683100 r4:bf1ffd3c
    [ 15.406654] [<c03dc5e4>] (driver_attach) from [<c03dc244>] (bus_add_driver+0x1a8/0x220)
    [ 15.414694] [<c03dc09c>] (bus_add_driver) from [<c03dd644>] (driver_register+0x80/0x100)
    [ 15.422817] r7:e8650cc0 r6:c089d8f0 r5:bf203000 r4:bf1ffd3c
    [ 15.428537] [<c03dd5c4>] (driver_register) from [<bf015aa4>] (register_virtio_driver+0x30/0x44 [virtio])
    [ 15.438055] r5:bf203000 r4:00000000
    [ 15.441675] [<bf015a74>] (register_virtio_driver [virtio]) from [<bf203044>] (rpmsg_init+0x44/0x84 [virtio_rpmsg_bus])
    [ 15.452428] [<bf203000>] (rpmsg_init [virtio_rpmsg_bus]) from [<c000982c>] (do_one_initcall+0x98/0x1e4)
    [ 15.461858] r5:bf203000 r4:c089d8f0
    [ 15.465471] [<c0009794>] (do_one_initcall) from [<c00cee90>] (do_init_module+0x68/0x378)
    [ 15.473593] r10:bf1ffe40 r9:e8650e08 r8:179af21c r7:00000001 r6:e8650d00 r5:00000001
    [ 15.481493] r4:bf1ffe40
    [ 15.484047] [<c00cee28>] (do_init_module) from [<c00aba20>] (load_module+0x1df8/0x2068)
    [ 15.492082] r6:e8650e00 r5:00000001 r4:ee189f44
    [ 15.496745] [<c00a9c28>] (load_module) from [<c00abe60>] (SyS_finit_module+0x88/0x98)
    [ 15.504606] r10:00000000 r9:ee188000 r8:c000fd04 r7:0000017b r6:b6e5ad90 r5:00000007
    [ 15.512509] r4:00000000
    [ 15.515063] [<c00abdd8>] (SyS_finit_module) from [<c000fb60>] (ret_fast_syscall+0x0/0x34)
    [ 15.523273] r6:00000000 r5:004c8928 r4:00000000
    [ OK ] Reached target Multi-User System.
    [ 15.589102] alloc_contig_range: [a2b00, a2bf0) PFNs busy
    [ OK ] Reached target Graphical Interface.
    Starting Update UTMP about System Runlevel Changes...
    [ 15.692703] remoteproc1: remote processor 40800000.dsp is now up
    [ 15.699428] virtio_rpmsg_bus virtio1: rpmsg host is online
    [ 15.705831] virtio_rpmsg_bus virtio0: creating channel rpmsg-proto addr 0x50
    [ 15.722655] virtio_rpmsg_bus virtio1: creating channel rpmsg-proto addr 0x50
    [ OK ] Started Update UTMP about System Runlevel Changes.
    [ 15.786619] NET: Registered protocol family 41
    [ 16.125114] usbcore: registered new interface driver usbfs
    [ 16.131435] usbcore: registered new interface driver hub
    [ 16.137986] usbcore: registered new device driver usb
    [ 16.208313] dwc3 488d0000.usb: otg: primary host xhci-hcd.0.auto registered
    [ 16.215414] dwc3 488d0000.usb: otg: shared host xhci-hcd.0.auto registered
    [ 16.223685] dwc3 488d0000.usb: otg: can't start till gadget registers
    [ 16.230548] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
    [ 16.237251] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 1
    [ 16.245837] xhci-hcd xhci-hcd.1.auto: hcc params 0x0220f04c hci version 0x100 quirks 0x00210010
    [ 16.255177] xhci-hcd xhci-hcd.1.auto: irq 459, io mem 0x48890000
    [ 16.264374] hub 1-0:1.0: USB hub found
    [ 16.268182] hub 1-0:1.0: 1 port detected
    [ 16.274253] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
    [ 16.279779] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 2
    [ 16.288608] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
    [ 16.298646] hub 2-0:1.0: USB hub found
    [ 16.303227] hub 2-0:1.0: 1 port detected

    _____ _____ _ _
    | _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_
    | | _| .'| . | . | | __| _| . | | | -_| _| _|
    |__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|
    |___| |___|

    Arago Project http://arago-project.org dra7xx-evm ttyS0

    Arago 2016.12 dra7xx-evm ttyS0

    dra7xx-evm login:

    I use 2*4GB DDR3,shuld the DRAM size be 8GB? The uboot only display 1GB.

    And the how to fixed the BUG:Bad page state in process swapper?

    It seems that there is still have problem in memory management.

    Did I do the right revision in uboot code? Is there something I need to change?

    Please help me solve the issue, thank you.
  • Please ignore my first question about the DRAM size configuration. I misunderstood the GB and Gb. Our custom board used 2*4Gb DDR3,so the DRAM size is 8G bits/8=1GiB. It was correct in LOG message. Other questions still bother me. Please help, thank you
  • Hi Yordan,

    The question was not answered.

    1. we saw system hang on Starting kernel. while configure the frequency as 333.

    So we change the frequency from 333 into 300 in u-boot/arch/arm/cpu/armv7/omap5/hw_init.c

    static const struct dpll_params ddr_dpll_params_2664mhz[NUM_SYS_CLKS] = {

    {111, 0, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 12 MHz */

    {300, 4, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 20 MHz */

    {555, 6, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 16.8 MHz */

    {555, 7, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 19.2 MHz */

    {666, 12, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 26 MHz */

    {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, /* 27 MHz */

    {555, 15, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1}, /* 38.4 MHz */

    };

    However with this setting it shows below BUG message at log (highlighted in red color). 

    :

     [0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [ 0.000000] BUG: Bad page state in process swapper pfn:81dc7
    [ 0.000000] page:ef6ecffc count:0 mapcount:-16 mapping: (null) index:0x0
    [ 0.000000] flags: 0x0()

    Can we have your suggestion,

    1. how to fix this BUG message? 

    2. are our configuration for frequency @ 300 looks ok? 

  • Hi Denny, PYTsai,

    I pinged uboot expert for further help.

    Regards,
    Yordan
  • Former Member
    0 Former Member in reply to Yordan Kamenov
    Hi,
    It's difficult to make out what are the changes in the source file. Please provide source file and boot log separately.
    Also, it's clear that your DDR3 configuration is still not correct. I think you need to refer the datasheet and place right timing values in the data structure. Make sure you populate the LISA registers properly.

    Regards,
    Somnth
  • /*
     * (C) Copyright 2013
     * Texas Instruments Incorporated, <www.ti.com>
     *
     * Lokesh Vutla <lokeshvutla@ti.com>
     *
     * Based on previous work by:
     * Aneesh V       <aneesh@ti.com>
     * Steve Sakoman  <steve@sakoman.com>
     *
     * SPDX-License-Identifier:	GPL-2.0+
     */
    #include <common.h>
    #include <palmas.h>
    #include <sata.h>
    #include <linux/string.h>
    #include <asm/gpio.h>
    #include <usb.h>
    #include <linux/usb/gadget.h>
    #include <asm/omap_common.h>
    #include <asm/omap_sec_common.h>
    #include <asm/arch/gpio.h>
    #include <asm/arch/dra7xx_iodelay.h>
    #include <asm/emif.h>
    #include <asm/arch/sys_proto.h>
    #include <asm/arch/mmc_host_def.h>
    #include <asm/arch/sata.h>
    #include <environment.h>
    #include <dwc3-uboot.h>
    #include <dwc3-omap-uboot.h>
    #include <ti-usb-phy-uboot.h>
    #include <miiphy.h>
    #include <spl.h>
    
    #include "mux_data.h"
    #include "../common/board_detect.h"
    
    #define board_is_dra76x_evm()		board_ti_is("DRA76/7x")
    #define board_is_dra74x_evm()		board_ti_is("5777xCPU")
    #define board_is_dra72x_evm()		board_ti_is("DRA72x-T")
    #define board_is_dra71x_evm()		board_ti_is("DRA79x,D")
    #define board_is_dra74x_revh_or_later() (board_is_dra74x_evm() &&	\
    				(strncmp("H", board_ti_get_rev(), 1) <= 0))
    #define board_is_dra72x_revc_or_later() (board_is_dra72x_evm() &&	\
    				(strncmp("C", board_ti_get_rev(), 1) <= 0))
    #define board_ti_get_emif_size()	board_ti_get_emif1_size() +	\
    					board_ti_get_emif2_size()
    
    #ifdef CONFIG_DRIVER_TI_CPSW
    #include <cpsw.h>
    #endif
    
    DECLARE_GLOBAL_DATA_PTR;
    
    /* GPIO 7_11 */
    #define GPIO_DDR_VTT_EN 203
    
    #define SYSINFO_BOARD_NAME_MAX_LEN	37
    
    const struct omap_sysinfo sysinfo = {
    	"Board: UNKNOWN(DRA7 EVM) REV UNKNOWN\n"
    };
    
    static const struct emif_regs emif1_ddr3_532_mhz_1cs = {
    	.sdram_config_init              = 0x61851ab2,
    	.sdram_config                   = 0x61851ab2,
    	.sdram_config2			= 0x08000000,
    	.ref_ctrl                       = 0x000040F1,
    	.ref_ctrl_final			= 0x00001035,
    	.sdram_tim1                     = 0xCCCF36B3,
    	.sdram_tim2                     = 0x308F7FDA,
    	.sdram_tim3                     = 0x427F88A8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x0007190B,
    	.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
    };
    
    static const struct emif_regs emif2_ddr3_532_mhz_1cs = {
    	.sdram_config_init              = 0x61851B32,
    	.sdram_config                   = 0x61851B32,
    	.sdram_config2			= 0x08000000,
    	.ref_ctrl                       = 0x000040F1,
    	.ref_ctrl_final			= 0x00001035,
    	.sdram_tim1                     = 0xCCCF36B3,
    	.sdram_tim2                     = 0x308F7FDA,
    	.sdram_tim3                     = 0x427F88A8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x0007190B,
    	.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
    };
    
    static const struct emif_regs emif_1_regs_ddr3_666_mhz_1cs_dra_es1 = {
    	.sdram_config_init              = 0x61862B32,
    	.sdram_config                   = 0x61862B32,
    	.sdram_config2			= 0x08000000,
    	.ref_ctrl                       = 0x0000514C,
    	.ref_ctrl_final			= 0x0000144A,
    	.sdram_tim1                     = 0xD113781C,
    	.sdram_tim2                     = 0x30717FE3,
    	.sdram_tim3                     = 0x409F86A8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x5007190B,
    	.temp_alert_config              = 0x00000000,
    	.emif_ddr_phy_ctlr_1_init       = 0x0024400D,
    	.emif_ddr_phy_ctlr_1            = 0x0E24400D,
    	.emif_ddr_ext_phy_ctrl_1        = 0x10040100,
    	.emif_ddr_ext_phy_ctrl_2        = 0x00A400A4,
    	.emif_ddr_ext_phy_ctrl_3        = 0x00A900A9,
    	.emif_ddr_ext_phy_ctrl_4        = 0x00B000B0,
    	.emif_ddr_ext_phy_ctrl_5        = 0x00B000B0,
    	.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
    };
    
    const struct emif_regs emif_1_regs_ddr3_666_mhz_1cs_dra_es2 = {
    	.sdram_config_init              = 0x61862BB2,
    	.sdram_config                   = 0x61862BB2,
    	.sdram_config2			= 0x00000000,
    	.ref_ctrl                       = 0x0000514D,
    	.ref_ctrl_final			= 0x0000144A,
    	.sdram_tim1                     = 0xD1137824,
    	.sdram_tim2                     = 0x30B37FE3,
    	.sdram_tim3                     = 0x409F8AD8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x5007190B,
    	.temp_alert_config              = 0x00000000,
    	.emif_ddr_phy_ctlr_1_init       = 0x0824400E,
    	.emif_ddr_phy_ctlr_1            = 0x0E24400E,
    	.emif_ddr_ext_phy_ctrl_1        = 0x04040100,
    	.emif_ddr_ext_phy_ctrl_2        = 0x006B009F,
    	.emif_ddr_ext_phy_ctrl_3        = 0x006B00A2,
    	.emif_ddr_ext_phy_ctrl_4        = 0x006B00A8,
    	.emif_ddr_ext_phy_ctrl_5        = 0x006B00A8,
    	.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
    };
    
    const struct emif_regs emif1_ddr3_532_mhz_1cs_2G = {
    	.sdram_config_init              = 0x61873332, //0x61851ab2,
    	.sdram_config                   = 0x61873332, //0x61851ab2,
    	.sdram_config2			= 0x00000000, //0x08000000,
    	.ref_ctrl                       = 0x0000514D, //0x000040F1,
    	.ref_ctrl_final			= 0x0000144A, //0x00001035,
    	.sdram_tim1                     = 0xD115887D, //0xCCCF36B3,
    	.sdram_tim2                     = 0x40B4802C, //0x30BF7FDA,
    	.sdram_tim3                     = 0x409F8AD8, //0x427F8BA8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x5007190B, //0x0007190B,
    	.temp_alert_config              = 0x00000000,
    	.emif_ddr_phy_ctlr_1_init       = 0x0824400F, //0x0024400B,
    	.emif_ddr_phy_ctlr_1            = 0x0E24400F, //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
    };
    
    const struct emif_regs emif2_ddr3_532_mhz_1cs_2G = {
    	.sdram_config_init              = 0x61873B32, //0x61851B32,
    	.sdram_config                   = 0x61873B32, //0x61851B32,
    	.sdram_config2			= 0x00000000, //0x08000000,
    	.ref_ctrl                       = 0x0000514D, //0x000040F1,
    	.ref_ctrl_final			= 0x0000144A, //0x00001035,
    	.sdram_tim1                     = 0xD3337834, //0xCCCF36B3,
    	.sdram_tim2                     = 0x30B37FE3, //0x308F7FDA,
    	.sdram_tim3                     = 0x407F88A8, //0x427F88A8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x5007190B, //0x0007190B,
    	.temp_alert_config              = 0x00000000,
    	.emif_ddr_phy_ctlr_1_init       = 0x08244010, //0x0024400B,
    	.emif_ddr_phy_ctlr_1            = 0x0E244010, //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
    };
    
    const struct emif_regs emif_1_regs_ddr3_666_mhz_1cs_dra76 = {
    	.sdram_config_init              = 0x61862B32,
    	.sdram_config                   = 0x61862B32,
    	.sdram_config2			= 0x00000000,
    	.ref_ctrl                       = 0x0000514C,
    	.ref_ctrl_final			= 0x0000144A,
    	.sdram_tim1                     = 0xD113783C,
    	.sdram_tim2                     = 0x30B47FE3,
    	.sdram_tim3                     = 0x409F8AD8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x5007190B,
    	.temp_alert_config              = 0x00000000,
    	.emif_ddr_phy_ctlr_1_init       = 0x0824400D,
    	.emif_ddr_phy_ctlr_1            = 0x0E24400D,
    	.emif_ddr_ext_phy_ctrl_1        = 0x04040100,
    	.emif_ddr_ext_phy_ctrl_2        = 0x006B009F,
    	.emif_ddr_ext_phy_ctrl_3        = 0x006B00A2,
    	.emif_ddr_ext_phy_ctrl_4        = 0x006B00A8,
    	.emif_ddr_ext_phy_ctrl_5        = 0x006B00A8,
    	.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
    };
    
    const struct emif_regs emif_2_regs_ddr3_666_mhz_1cs_dra76 = {
    	.sdram_config_init              = 0x61862B32,
    	.sdram_config                   = 0x61862B32,
    	.sdram_config2			= 0x00000000,
    	.ref_ctrl                       = 0x0000514C,
    	.ref_ctrl_final			= 0x0000144A,
    	.sdram_tim1                     = 0xD113781C,
    	.sdram_tim2                     = 0x30B47FE3,
    	.sdram_tim3                     = 0x409F8AD8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x5007190B,
    	.temp_alert_config              = 0x00000000,
    	.emif_ddr_phy_ctlr_1_init       = 0x0824400D,
    	.emif_ddr_phy_ctlr_1            = 0x0E24400D,
    	.emif_ddr_ext_phy_ctrl_1        = 0x04040100,
    	.emif_ddr_ext_phy_ctrl_2        = 0x006B009F,
    	.emif_ddr_ext_phy_ctrl_3        = 0x006B00A2,
    	.emif_ddr_ext_phy_ctrl_4        = 0x006B00A8,
    	.emif_ddr_ext_phy_ctrl_5        = 0x006B00A8,
    	.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
    };
    
    const struct emif_regs TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_emif_regs = {			
            .sdram_config_init 		= 0x61873B32,			
            .sdram_config 			= 0x61873B32,			
            .sdram_config2 			= 0x00000000,			
            .ref_ctrl 			= 0x0000514D,			
            .ref_ctrl_final 		= 0x0000144A,			
            .sdram_tim1 			= 0xD3337834,			
            .sdram_tim2 			= 0x30B37FE3,			
            .sdram_tim3 			= 0x407F8AD8,			
            .read_idle_ctrl 		= 0x00050000,			
            .zq_config 			= 0x5007190B,			 
            .temp_alert_config 		= 0x00000000,			
    	.emif_ddr_phy_ctlr_1_init       = 0x08244010,
    	.emif_ddr_phy_ctlr_1            = 0x0E244010,
    	.emif_ddr_ext_phy_ctrl_1        = 0x04040100,
    	.emif_ddr_ext_phy_ctrl_2        = 0x006B006B,
    	.emif_ddr_ext_phy_ctrl_3        = 0x006B006B,
    	.emif_ddr_ext_phy_ctrl_4        = 0x006B006B,
    	.emif_ddr_ext_phy_ctrl_5        = 0x006B006B,
    	.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			
    };			
    
    
    void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs)
    {
    	printf("Evm.c\n");
    	u64 ram_size;
    
    	ram_size = board_ti_get_emif_size();
    
    	switch (omap_revision()) {
    	case DRA752_ES1_0:
    	case DRA752_ES1_1:
    	case DRA752_ES2_0:
    		switch (emif_nr) {
    		case 1:
    			if (ram_size > CONFIG_MAX_MEM_MAPPED)
    				*regs = &emif1_ddr3_532_mhz_1cs_2G;
    			else
    				*regs = &emif1_ddr3_532_mhz_1cs;
    			break;
    		case 2:
    			if (ram_size > CONFIG_MAX_MEM_MAPPED)
    				*regs = &emif2_ddr3_532_mhz_1cs_2G;
    			else
    				*regs = &emif2_ddr3_532_mhz_1cs;
    			break;
    		}
    		break;
    	case DRA762_ES1_0:
    		if (emif_nr == 1)
    			*regs = &emif_1_regs_ddr3_666_mhz_1cs_dra76;
    		else
    			*regs = &emif_2_regs_ddr3_666_mhz_1cs_dra76;
    		break;
    	case DRA722_ES1_0:
    	case DRA722_ES2_0:
    	case DRA722_ES2_1:
    		if (ram_size < CONFIG_MAX_MEM_MAPPED)
    			*regs = &emif_1_regs_ddr3_666_mhz_1cs_dra_es1;
    		else
    			*regs = &emif_1_regs_ddr3_666_mhz_1cs_dra_es2;
    		break;
    	default:
    		*regs = &emif1_ddr3_532_mhz_1cs;
    	}
    	*regs = &TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_emif_regs; //new
    }
    
    static const struct dmm_lisa_map_regs lisa_map_dra7_1536MB = {
    	.dmm_lisa_map_0 = 0x0,
    	.dmm_lisa_map_1 = 0x80640300,
    	.dmm_lisa_map_2 = 0xC0500220,
    	.dmm_lisa_map_3 = 0xFF020100,
    	.is_ma_present	= 0x1
    };
    
    static const struct dmm_lisa_map_regs lisa_map_2G_x_2 = {
    	.dmm_lisa_map_0 = 0x0,
    	.dmm_lisa_map_1 = 0x0,
    	.dmm_lisa_map_2 = 0x80600100,
    	.dmm_lisa_map_3 = 0xFF020100,
    	.is_ma_present	= 0x1
    };
    
    const struct dmm_lisa_map_regs lisa_map_dra7_2GB = {
    	.dmm_lisa_map_0 = 0x0,
    	.dmm_lisa_map_1 = 0x0,
    	.dmm_lisa_map_2 = 0x80600100, //0x80740300,
    	.dmm_lisa_map_3 = 0xFF020100,
    	.is_ma_present	= 0x1
    };
    
    const struct dmm_lisa_map_regs TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_dmm_regs = {			
        .dmm_lisa_map_0 = 0x00000000,			
        .dmm_lisa_map_1 = 0x00000000,			
        .dmm_lisa_map_2 = 0x80600100,			
        .dmm_lisa_map_3 = 0xFF020100,			
        .is_ma_present = 0x1			
    };			
    
    /*
     * DRA722 EVM EMIF1 2GB CONFIGURATION
     * EMIF1 4 devices of 512Mb x 8 Micron
     */
    const struct dmm_lisa_map_regs lisa_map_2G_x_4 = {
    	.dmm_lisa_map_0 = 0x0,
    	.dmm_lisa_map_1 = 0x0,
    	.dmm_lisa_map_2 = 0x80700100,
    	.dmm_lisa_map_3 = 0xFF020100,
    	.is_ma_present	= 0x1
    };
    
    void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs)
    {
    	u64 ram_size;
    
    	ram_size = board_ti_get_emif_size();
    
    	switch (omap_revision()) {
    	case DRA762_ES1_0:
    	case DRA752_ES1_0:
    	case DRA752_ES1_1:
    	case DRA752_ES2_0:
    		if (ram_size > CONFIG_MAX_MEM_MAPPED)
    			*dmm_lisa_regs = &lisa_map_dra7_2GB;
    		else
    			*dmm_lisa_regs = &lisa_map_dra7_1536MB;
    		break;
    	case DRA722_ES1_0:
    	case DRA722_ES2_0:
    	case DRA722_ES2_1:
    	default:
    		if (ram_size < CONFIG_MAX_MEM_MAPPED)
    			*dmm_lisa_regs = &lisa_map_2G_x_2;
    		else
    			*dmm_lisa_regs = &lisa_map_2G_x_4;
    		break;
    	}
    	*dmm_lisa_regs = &TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_dmm_regs; //new
    }
    
    struct vcores_data dra752_volts = {
    	.mpu.value[OPP_NOM]	= VDD_MPU_DRA7_NOM,
    	.mpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_MPU_NOM,
    	.mpu.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.mpu.addr	= TPS659038_REG_ADDR_SMPS12,
    	.mpu.pmic	= &tps659038,
    	.mpu.abb_tx_done_mask = OMAP_ABB_MPU_TXDONE_MASK,
    
    	.eve.value[OPP_NOM]	= VDD_EVE_DRA7_NOM,
    	.eve.value[OPP_OD]	= VDD_EVE_DRA7_OD,
    	.eve.value[OPP_HIGH]	= VDD_EVE_DRA7_HIGH,
    	.eve.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_DSPEVE_NOM,
    	.eve.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_DSPEVE_OD,
    	.eve.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_DSPEVE_HIGH,
    	.eve.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.eve.addr	= TPS659038_REG_ADDR_SMPS45,
    	.eve.pmic	= &tps659038,
    	.eve.abb_tx_done_mask = OMAP_ABB_EVE_TXDONE_MASK,
    
    	.gpu.value[OPP_NOM]	= VDD_GPU_DRA7_NOM,
    	.gpu.value[OPP_OD]	= VDD_GPU_DRA7_OD,
    	.gpu.value[OPP_HIGH]	= VDD_GPU_DRA7_HIGH,
    	.gpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_GPU_NOM,
    	.gpu.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_GPU_OD,
    	.gpu.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_GPU_HIGH,
    	.gpu.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.gpu.addr	= TPS659038_REG_ADDR_SMPS6,
    	.gpu.pmic	= &tps659038,
    	.gpu.abb_tx_done_mask = OMAP_ABB_GPU_TXDONE_MASK,
    
    	.core.value[OPP_NOM]	= VDD_CORE_DRA7_NOM,
    	.core.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_CORE_NOM,
    	.core.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.core.addr	= TPS659038_REG_ADDR_SMPS7,
    	.core.pmic	= &tps659038,
    
    	.iva.value[OPP_NOM]	= VDD_IVA_DRA7_NOM,
    	.iva.value[OPP_OD]	= VDD_IVA_DRA7_OD,
    	.iva.value[OPP_HIGH]	= VDD_IVA_DRA7_HIGH,
    	.iva.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_IVA_NOM,
    	.iva.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_IVA_OD,
    	.iva.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_IVA_HIGH,
    	.iva.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.iva.addr	= TPS659038_REG_ADDR_SMPS8,
    	.iva.pmic	= &tps659038,
    	.iva.abb_tx_done_mask = OMAP_ABB_IVA_TXDONE_MASK,
    };
    
    struct vcores_data dra76x_volts = {
    	.mpu.value[OPP_NOM]	= VDD_MPU_DRA7_NOM,
    	.mpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_MPU_NOM,
    	.mpu.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.mpu.addr	= LP87565_REG_ADDR_BUCK01,
    	.mpu.pmic	= &lp87565,
    	.mpu.abb_tx_done_mask = OMAP_ABB_MPU_TXDONE_MASK,
    
    	.eve.value[OPP_NOM]	= VDD_EVE_DRA7_NOM,
    	.eve.value[OPP_OD]	= VDD_EVE_DRA7_OD,
    	.eve.value[OPP_HIGH]	= VDD_EVE_DRA7_HIGH,
    	.eve.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_DSPEVE_NOM,
    	.eve.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_DSPEVE_OD,
    	.eve.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_DSPEVE_HIGH,
    	.eve.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.eve.addr	= TPS65917_REG_ADDR_SMPS1,
    	.eve.pmic	= &tps659038,
    	.eve.abb_tx_done_mask = OMAP_ABB_EVE_TXDONE_MASK,
    
    	.gpu.value[OPP_NOM]	= VDD_GPU_DRA7_NOM,
    	.gpu.value[OPP_OD]	= VDD_GPU_DRA7_OD,
    	.gpu.value[OPP_HIGH]	= VDD_GPU_DRA7_HIGH,
    	.gpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_GPU_NOM,
    	.gpu.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_GPU_OD,
    	.gpu.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_GPU_HIGH,
    	.gpu.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.gpu.addr	= LP87565_REG_ADDR_BUCK23,
    	.gpu.pmic	= &lp87565,
    	.gpu.abb_tx_done_mask = OMAP_ABB_GPU_TXDONE_MASK,
    
    	.core.value[OPP_NOM]	= VDD_CORE_DRA7_NOM,
    	.core.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_CORE_NOM,
    	.core.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.core.addr	= TPS65917_REG_ADDR_SMPS3,
    	.core.pmic	= &tps659038,
    
    	.iva.value[OPP_NOM]	= VDD_IVA_DRA7_NOM,
    	.iva.value[OPP_OD]	= VDD_IVA_DRA7_OD,
    	.iva.value[OPP_HIGH]	= VDD_IVA_DRA7_HIGH,
    	.iva.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_IVA_NOM,
    	.iva.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_IVA_OD,
    	.iva.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_IVA_HIGH,
    	.iva.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.iva.addr	= TPS65917_REG_ADDR_SMPS4,
    	.iva.pmic	= &tps659038,
    	.iva.abb_tx_done_mask = OMAP_ABB_IVA_TXDONE_MASK,
    };
    
    struct vcores_data dra722_volts = {
    	.mpu.value[OPP_NOM]	= VDD_MPU_DRA7_NOM,
    	.mpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_MPU_NOM,
    	.mpu.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.mpu.addr	= TPS65917_REG_ADDR_SMPS1,
    	.mpu.pmic	= &tps659038,
    	.mpu.abb_tx_done_mask = OMAP_ABB_MPU_TXDONE_MASK,
    
    	.core.value[OPP_NOM]	= VDD_CORE_DRA7_NOM,
    	.core.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_CORE_NOM,
    	.core.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.core.addr	= TPS65917_REG_ADDR_SMPS2,
    	.core.pmic	= &tps659038,
    
    	/*
    	 * The DSPEVE, GPU and IVA rails are usually grouped on DRA72x
    	 * designs and powered by TPS65917 SMPS3, as on the J6Eco EVM.
    	 */
    	.gpu.value[OPP_NOM]	= VDD_GPU_DRA7_NOM,
    	.gpu.value[OPP_OD]	= VDD_GPU_DRA7_OD,
    	.gpu.value[OPP_HIGH]	= VDD_GPU_DRA7_HIGH,
    	.gpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_GPU_NOM,
    	.gpu.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_GPU_OD,
    	.gpu.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_GPU_HIGH,
    	.gpu.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.gpu.addr	= TPS65917_REG_ADDR_SMPS3,
    	.gpu.pmic	= &tps659038,
    	.gpu.abb_tx_done_mask = OMAP_ABB_GPU_TXDONE_MASK,
    
    	.eve.value[OPP_NOM]	= VDD_EVE_DRA7_NOM,
    	.eve.value[OPP_OD]	= VDD_EVE_DRA7_OD,
    	.eve.value[OPP_HIGH]	= VDD_EVE_DRA7_HIGH,
    	.eve.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_DSPEVE_NOM,
    	.eve.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_DSPEVE_OD,
    	.eve.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_DSPEVE_HIGH,
    	.eve.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.eve.addr	= TPS65917_REG_ADDR_SMPS3,
    	.eve.pmic	= &tps659038,
    	.eve.abb_tx_done_mask = OMAP_ABB_EVE_TXDONE_MASK,
    
    	.iva.value[OPP_NOM]	= VDD_IVA_DRA7_NOM,
    	.iva.value[OPP_OD]	= VDD_IVA_DRA7_OD,
    	.iva.value[OPP_HIGH]	= VDD_IVA_DRA7_HIGH,
    	.iva.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_IVA_NOM,
    	.iva.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_IVA_OD,
    	.iva.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_IVA_HIGH,
    	.iva.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.iva.addr	= TPS65917_REG_ADDR_SMPS3,
    	.iva.pmic	= &tps659038,
    	.iva.abb_tx_done_mask = OMAP_ABB_IVA_TXDONE_MASK,
    };
    
    struct vcores_data dra718_volts = {
    	/*
    	 * In the case of dra71x GPU MPU and CORE
    	 * are all powered up by BUCK0 of LP873X PMIC
    	 */
    	.mpu.value[OPP_NOM]	= VDD_MPU_DRA7_NOM,
    	.mpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_MPU_NOM,
    	.mpu.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.mpu.addr	= LP873X_REG_ADDR_BUCK0,
    	.mpu.pmic	= &lp8733,
    	.mpu.abb_tx_done_mask = OMAP_ABB_MPU_TXDONE_MASK,
    
    	.core.value[OPP_NOM]		= VDD_CORE_DRA7_NOM,
    	.core.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_CORE_NOM,
    	.core.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.core.addr	= LP873X_REG_ADDR_BUCK0,
    	.core.pmic	= &lp8733,
    
    	.gpu.value[OPP_NOM]	= VDD_GPU_DRA7_NOM,
    	.gpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_GPU_NOM,
    	.gpu.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.gpu.addr	= LP873X_REG_ADDR_BUCK0,
    	.gpu.pmic	= &lp8733,
    	.gpu.abb_tx_done_mask = OMAP_ABB_GPU_TXDONE_MASK,
    
    	/*
    	 * The DSPEVE and IVA rails are grouped on DRA71x-evm
    	 * and are powered by BUCK1 of LP873X PMIC
    	 */
    	.eve.value[OPP_NOM]	= VDD_EVE_DRA7_NOM,
    	.eve.value[OPP_HIGH]	= VDD_EVE_DRA7_HIGH,
    	.eve.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_DSPEVE_NOM,
    	.eve.efuse.reg[OPP_HIGH] = STD_FUSE_OPP_VMIN_DSPEVE_HIGH,
    	.eve.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.eve.addr	= LP873X_REG_ADDR_BUCK1,
    	.eve.pmic	= &lp8733,
    	.eve.abb_tx_done_mask = OMAP_ABB_EVE_TXDONE_MASK,
    
    	.iva.value[OPP_NOM]	= VDD_IVA_DRA7_NOM,
    	.iva.value[OPP_HIGH]	= VDD_IVA_DRA7_HIGH,
    	.iva.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_IVA_NOM,
    	.iva.efuse.reg[OPP_HIGH] = STD_FUSE_OPP_VMIN_IVA_HIGH,
    	.iva.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.iva.addr	= LP873X_REG_ADDR_BUCK1,
    	.iva.pmic	= &lp8733,
    	.iva.abb_tx_done_mask = OMAP_ABB_IVA_TXDONE_MASK,
    };
    
    int get_voltrail_opp(int rail_offset)
    {
    	int opp;
    
    	switch (rail_offset) {
    	case VOLT_MPU:
    		opp = DRA7_MPU_OPP;
    		/* DRA71x supports only OPP_NOM for MPU */
    		if (board_is_dra71x_evm())
    			opp = OPP_NOM;
    		break;
    	case VOLT_CORE:
    		opp = DRA7_CORE_OPP;
    		/* DRA71x supports only OPP_NOM for CORE */
    		if (board_is_dra71x_evm())
    			opp = OPP_NOM;
    		break;
    	case VOLT_GPU:
    		opp = DRA7_GPU_OPP;
    		/* DRA71x supports only OPP_NOM for GPU */
    		if (board_is_dra71x_evm())
    			opp = OPP_NOM;
    		break;
    	case VOLT_EVE:
    		opp = DRA7_DSPEVE_OPP;
    		/*
    		 * DRA71x does not support OPP_OD for EVE.
    		 * If OPP_OD is selected by menuconfig, fallback
    		 * to OPP_NOM.
    		 */
    		if (board_is_dra71x_evm() && opp == OPP_OD)
    			opp = OPP_NOM;
    		break;
    	case VOLT_IVA:
    		opp = DRA7_IVA_OPP;
    		/*
    		 * DRA71x does not support OPP_OD for IVA.
    		 * If OPP_OD is selected by menuconfig, fallback
    		 * to OPP_NOM.
    		 */
    		if (board_is_dra71x_evm() && opp == OPP_OD)
    			opp = OPP_NOM;
    		break;
    	default:
    		opp = OPP_NOM;
    	}
    
    	return opp;
    }
    
    /**
     * @brief board_init
     *
     * @return 0
     */
    int board_init(void)
    {
    #ifndef CONFIG_SPL_DFU_SUPPORT
    #ifdef CONFIG_SPL_ENV_SUPPORT
    #ifdef CONFIG_ENV_IS_IN_MMC
    	struct mmc *mmc;
    	spl_mmc_init(&mmc, UINT_MAX);
    #endif
    
    	env_init();
    	env_relocate_spec();
    	omap_die_id_serial();
    #endif
    #endif
    
    	gpmc_init();
    	gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
    
    	return 0;
    }
    
    void dram_init_banksize(void)
    {
    	u64 ram_size;
    
    	ram_size = board_ti_get_emif_size();
    
    	gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
    	gd->bd->bi_dram[0].size = get_effective_memsize();
    	if (ram_size > CONFIG_MAX_MEM_MAPPED) {
    		gd->bd->bi_dram[1].start = 0x200000000;
    		gd->bd->bi_dram[1].size = ram_size - CONFIG_MAX_MEM_MAPPED;
    	}
    }
    
    int board_late_init(void)
    {
    #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
    	char *name = "unknown";
    
    	if (is_dra72x()) {
    		if (board_is_dra72x_revc_or_later())
    			name = "dra72x-revc";
    		else if (board_is_dra71x_evm())
    			name = "dra71x";
    		else
    			name = "dra72x";
    	} else if (is_dra76x()) {
    		name = "dra76x";
    	} else {
    		name = "dra7xx";
    	}
    
    	set_board_info_env(name);
    
    	/*
    	 * Default FIT boot on HS devices. Non FIT images are not allowed
    	 * on HS devices.
    	 */
    	if (get_device_type() == HS_DEVICE)
    		setenv("boot_fit", "1");
    
    	omap_die_id_serial();
    	omap_set_fastboot_vars();
    #endif
    	return 0;
    }
    
    #ifdef CONFIG_SPL_BUILD
    void do_board_detect(void)
    {
    	int rc;
    
    	rc = ti_i2c_eeprom_dra7_get(CONFIG_EEPROM_BUS_ADDRESS,
    				    CONFIG_EEPROM_CHIP_ADDRESS);
    	if (rc)
    		printf("ti_i2c_eeprom_init failed %d\n", rc);
    }
    
    #else
    
    void do_board_detect(void)
    {
    	char *bname = NULL;
    	int rc;
    
    	rc = ti_i2c_eeprom_dra7_get(CONFIG_EEPROM_BUS_ADDRESS,
    				    CONFIG_EEPROM_CHIP_ADDRESS);
    	if (rc)
    		printf("ti_i2c_eeprom_init failed %d\n", rc);
    
    	if (board_is_dra74x_evm()) {
    		bname = "DRA74x EVM";
    	} else if (board_is_dra72x_evm()) {
    		bname = "DRA72x EVM";
    	} else if (board_is_dra71x_evm()) {
    		bname = "DRA71x EVM";
    	} else if (board_is_dra76x_evm()) {
    		bname = "DRA76x EVM";
    	} else {
    		/* If EEPROM is not populated */
    		if (is_dra72x())
    			bname = "DRA72x EVM";
    		else
    			bname = "DRA74x EVM";
    	}
    
    	if (bname)
    		snprintf(sysinfo.board_string, SYSINFO_BOARD_NAME_MAX_LEN,
    			 "Board: %s REV %s\n", bname, board_ti_get_rev());
    }
    #endif	/* CONFIG_SPL_BUILD */
    
    void vcores_update(void)
    {
    	if (board_is_dra74x_evm()) {
    		*omap_vcores = &dra752_volts;
    	} else if (board_is_dra72x_evm()) {
    		*omap_vcores = &dra722_volts;
    	} else if (board_is_dra71x_evm()) {
    		*omap_vcores = &dra718_volts;
    	} else if (board_is_dra76x_evm()) {
    		*omap_vcores = &dra76x_volts;
    	} else {
    		/* If EEPROM is not populated */
    		if (is_dra72x())
    			*omap_vcores = &dra722_volts;
    		else
    			*omap_vcores = &dra752_volts;
    	}
    }
    
    void set_muxconf_regs(void)
    {
    	do_set_mux32((*ctrl)->control_padconf_core_base,
    		     early_padconf, ARRAY_SIZE(early_padconf));
    }
    
    #ifdef CONFIG_IODELAY_RECALIBRATION
    void recalibrate_iodelay(void)
    {
    	struct pad_conf_entry const *pads, *delta_pads = NULL;
    	struct iodelay_cfg_entry const *iodelay;
    	int npads, niodelays, delta_npads = 0;
    	int ret;
    
    	switch (omap_revision()) {
    	case DRA722_ES1_0:
    	case DRA722_ES2_0:
    	case DRA722_ES2_1:
    		pads = dra72x_core_padconf_array_common;
    		npads = ARRAY_SIZE(dra72x_core_padconf_array_common);
    		if (board_is_dra71x_evm()) {
    			pads = dra71x_core_padconf_array;
    			npads = ARRAY_SIZE(dra71x_core_padconf_array);
    			iodelay = dra71_iodelay_cfg_array;
    			niodelays = ARRAY_SIZE(dra71_iodelay_cfg_array);
    		} else if (board_is_dra72x_revc_or_later()) {
    			delta_pads = dra72x_rgmii_padconf_array_revc;
    			delta_npads =
    				ARRAY_SIZE(dra72x_rgmii_padconf_array_revc);
    			iodelay = dra72_iodelay_cfg_array_revc;
    			niodelays = ARRAY_SIZE(dra72_iodelay_cfg_array_revc);
    		} else {
    			delta_pads = dra72x_rgmii_padconf_array_revb;
    			delta_npads =
    				ARRAY_SIZE(dra72x_rgmii_padconf_array_revb);
    			iodelay = dra72_iodelay_cfg_array_revb;
    			niodelays = ARRAY_SIZE(dra72_iodelay_cfg_array_revb);
    		}
    		break;
    	case DRA752_ES1_0:
    	case DRA752_ES1_1:
    		pads = dra74x_core_padconf_array;
    		npads = ARRAY_SIZE(dra74x_core_padconf_array);
    		iodelay = dra742_es1_1_iodelay_cfg_array;
    		niodelays = ARRAY_SIZE(dra742_es1_1_iodelay_cfg_array);
    		break;
    	case DRA762_ES1_0:
    		pads = dra76x_core_padconf_array;
    		npads = ARRAY_SIZE(dra76x_core_padconf_array);
    		iodelay = dra76x_es1_0_iodelay_cfg_array;
    		niodelays = ARRAY_SIZE(dra76x_es1_0_iodelay_cfg_array);
    		break;
    	default:
    	case DRA752_ES2_0:
    		pads = dra74x_core_padconf_array;
    		npads = ARRAY_SIZE(dra74x_core_padconf_array);
    		iodelay = dra742_es2_0_iodelay_cfg_array;
    		niodelays = ARRAY_SIZE(dra742_es2_0_iodelay_cfg_array);
    		/* Setup port1 and port2 for rgmii with 'no-id' mode */
    		clrset_spare_register(1, 0, RGMII2_ID_MODE_N_MASK |
    				      RGMII1_ID_MODE_N_MASK);
    		break;
    	}
    	/* Setup I/O isolation */
    	ret = __recalibrate_iodelay_start();
    	if (ret)
    		goto err;
    
    	/* Do the muxing here */
    	do_set_mux32((*ctrl)->control_padconf_core_base, pads, npads);
    
    	/* Now do the weird minor deltas that should be safe */
    	if (delta_npads)
    		do_set_mux32((*ctrl)->control_padconf_core_base,
    			     delta_pads, delta_npads);
    
    	/* Setup IOdelay configuration */
    	ret = do_set_iodelay((*ctrl)->iodelay_config_base, iodelay, niodelays);
    err:
    	/* Closeup.. remove isolation */
    	__recalibrate_iodelay_end(ret);
    }
    #endif
    
    #if defined(CONFIG_GENERIC_MMC)
    int board_mmc_init(bd_t *bis)
    {
    	omap_mmc_init(0, 0, 0, -1, -1);
    	omap_mmc_init(1, 0, 0, -1, -1);
    	return 0;
    }
    
    void board_mmc_poweron_ldo(uint voltage)
    {
    	if (board_is_dra71x_evm()) {
    		if (voltage == LDO_VOLT_3V0)
    			voltage = 0x19;
    		else if (voltage == LDO_VOLT_1V8)
    			voltage = 0xa;
    		lp873x_mmc1_poweron_ldo(voltage);
    	} else if (board_is_dra76x_evm()) {
    		palmas_mmc1_poweron_ldo(LDO4_VOLTAGE, LDO4_CTRL, voltage);
    	} else {
    		palmas_mmc1_poweron_ldo(LDO1_VOLTAGE, LDO1_CTRL, voltage);
    	}
    }
    #endif
    
    #ifdef CONFIG_OMAP_HSMMC
    #if defined(CONFIG_IODELAY_RECALIBRATION) && \
    	(defined(CONFIG_SPL_BUILD) || !defined(CONFIG_DM_MMC))
    
    struct pinctrl_desc {
    	const char *name;
    	struct omap_hsmmc_pinctrl_state *pinctrl;
    };
    
    static struct pinctrl_desc pinctrl_descs_hsmmc1[] = {
    	{"default", &hsmmc1_default},
    	{"hs", &hsmmc1_default},
    	{NULL}
    };
    
    static struct pinctrl_desc pinctrl_descs_hsmmc2_rev20[] = {
    	{"default", &hsmmc2_default_hs},
    	{"hs", &hsmmc2_default_hs},
    	{"ddr_1_8v", &hsmmc2_ddr_1v8_rev20},
    	{"hs200_1_8v", &hsmmc2_hs200_1v8_rev20},
    	{NULL}
    };
    
    static struct pinctrl_desc pinctrl_descs_hsmmc2_rev11[] = {
    	{"default", &hsmmc2_default_hs},
    	{"hs", &hsmmc2_default_hs},
    	{"ddr_1_8v", &hsmmc2_ddr_1v8_rev11},
    	{"hs200_1_8v", &hsmmc2_hs200_1v8_rev11},
    	{NULL}
    };
    
    static struct pinctrl_desc pinctrl_descs_hsmmc2_dra72x[] = {
    	{"default", &hsmmc2_default_hs},
    	{"hs", &hsmmc2_default_hs},
    	{"ddr_1_8v", &hsmmc2_ddr_1v8_dra72},
    	{"hs200_1_8v", &hsmmc2_hs200_1v8_dra72},
    	{NULL}
    };
    
    static struct pinctrl_desc pinctrl_descs_hsmmc2_dra76x[] = {
    	{"default", &hsmmc2_default_hs},
    	{"hs", &hsmmc2_default_hs},
    	{"ddr_1_8v", &hsmmc2_default_hs},
    	{"hs200_1_8v", &hsmmc2_hs200_1v8_dra76},
    	{NULL}
    };
    
    struct omap_hsmmc_pinctrl_state *platform_fixup_get_pinctrl_by_mode
    				  (struct hsmmc *base, const char *mode)
    {
    	struct pinctrl_desc *p = NULL;
    
    	switch ((uint32_t)base) {
    	case OMAP_HSMMC1_BASE:
    		p = pinctrl_descs_hsmmc1;
    		break;
    	case OMAP_HSMMC2_BASE:
    		if ((omap_revision() == DRA752_ES1_0) ||
    		    (omap_revision() == DRA752_ES1_1))
    			p = pinctrl_descs_hsmmc2_rev11;
    		else if (is_dra72x())
    			p = pinctrl_descs_hsmmc2_dra72x;
    		else if (is_dra76x())
    			p = pinctrl_descs_hsmmc2_dra76x;
    		else if (is_dra7xx())
    			p = pinctrl_descs_hsmmc2_rev20;
    		break;
    	default:
    		break;
    	}
    
    	if (!p) {
    		printf("%s no pinctrl defined for MMC@%p\n", __func__,
    		       base);
    		return NULL;
    	}
    	while (p->name) {
    		if (strcmp(mode, p->name) == 0)
    			return p->pinctrl;
    		p++;
    	}
    	return NULL;
    }
    #endif
    
    int platform_fixup_disable_uhs_mode(void)
    {
    	return omap_revision() == DRA752_ES1_1;
    }
    #endif
    
    #ifdef CONFIG_USB_DWC3
    static struct dwc3_device usb_otg_ss1 = {
    	.maximum_speed = USB_SPEED_SUPER,
    	.base = DRA7_USB_OTG_SS1_BASE,
    	.tx_fifo_resize = false,
    	.index = 0,
    };
    
    static struct dwc3_omap_device usb_otg_ss1_glue = {
    	.base = (void *)DRA7_USB_OTG_SS1_GLUE_BASE,
    	.utmi_mode = DWC3_OMAP_UTMI_MODE_SW,
    	.index = 0,
    };
    
    static struct ti_usb_phy_device usb_phy1_device = {
    	.pll_ctrl_base = (void *)DRA7_USB3_PHY1_PLL_CTRL,
    	.usb2_phy_power = (void *)DRA7_USB2_PHY1_POWER,
    	.usb3_phy_power = (void *)DRA7_USB3_PHY1_POWER,
    	.index = 0,
    };
    
    static struct dwc3_device usb_otg_ss2 = {
    	.maximum_speed = USB_SPEED_SUPER,
    	.base = DRA7_USB_OTG_SS2_BASE,
    	.tx_fifo_resize = false,
    	.index = 1,
    };
    
    static struct dwc3_omap_device usb_otg_ss2_glue = {
    	.base = (void *)DRA7_USB_OTG_SS2_GLUE_BASE,
    	.utmi_mode = DWC3_OMAP_UTMI_MODE_SW,
    	.index = 1,
    };
    
    static struct ti_usb_phy_device usb_phy2_device = {
    	.usb2_phy_power = (void *)DRA7_USB2_PHY2_POWER,
    	.index = 1,
    };
    
    int board_usb_init(int index, enum usb_init_type init)
    {
    	enable_usb_clocks(index);
    	switch (index) {
    	case 0:
    		if (init == USB_INIT_DEVICE) {
    			usb_otg_ss1.dr_mode = USB_DR_MODE_PERIPHERAL;
    			usb_otg_ss1_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID;
    		} else {
    			usb_otg_ss1.dr_mode = USB_DR_MODE_HOST;
    			usb_otg_ss1_glue.vbus_id_status = OMAP_DWC3_ID_GROUND;
    		}
    
    		ti_usb_phy_uboot_init(&usb_phy1_device);
    		dwc3_omap_uboot_init(&usb_otg_ss1_glue);
    		dwc3_uboot_init(&usb_otg_ss1);
    		break;
    	case 1:
    		if (init == USB_INIT_DEVICE) {
    			usb_otg_ss2.dr_mode = USB_DR_MODE_PERIPHERAL;
    			usb_otg_ss2_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID;
    		} else {
    			usb_otg_ss2.dr_mode = USB_DR_MODE_HOST;
    			usb_otg_ss2_glue.vbus_id_status = OMAP_DWC3_ID_GROUND;
    		}
    
    		ti_usb_phy_uboot_init(&usb_phy2_device);
    		dwc3_omap_uboot_init(&usb_otg_ss2_glue);
    		dwc3_uboot_init(&usb_otg_ss2);
    		break;
    	default:
    		printf("Invalid Controller Index\n");
    	}
    
    	return 0;
    }
    
    int board_usb_cleanup(int index, enum usb_init_type init)
    {
    	switch (index) {
    	case 0:
    	case 1:
    		ti_usb_phy_uboot_exit(index);
    		dwc3_uboot_exit(index);
    		dwc3_omap_uboot_exit(index);
    		break;
    	default:
    		printf("Invalid Controller Index\n");
    	}
    	disable_usb_clocks(index);
    	return 0;
    }
    
    int usb_gadget_handle_interrupts(int index)
    {
    	u32 status;
    
    	status = dwc3_omap_uboot_interrupt_status(index);
    	if (status)
    		dwc3_uboot_handle_interrupt(index);
    
    	return 0;
    }
    #endif
    
    #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_OS_BOOT)
    
    #define L4_CFG_TARG                  0x4A000000
    
    #define CTRL_MODULE_CORE             (L4_CFG_TARG + 0x2000)
    #define CM_CORE_AON                  (L4_CFG_TARG + 0x5000)
    #define CM_CORE                      (L4_CFG_TARG + 0x8000)
    
    #define CAM_CM_CORE                  (CM_CORE + 0x1000)
    #define DSS_CM_CORE                  (CM_CORE + 0x1100)
    #define CORE_CM_CORE                 (CM_CORE + 0x700)
    #define L4PER_CM_CORE                (CM_CORE + 0x1700)
    #define VPE_CM_CORE_AON              (CM_CORE_AON + 0x760)
    #define IPU_CM_CORE_AON              (CM_CORE_AON + 0x500)
    
    #define CM_L3INSTR_L3_MAIN_2_CLKCTRL (CORE_CM_CORE + 0x728)
    #define CM_DSS_DSS_CLKCTRL           (DSS_CM_CORE + 0x20)
    #define CM_DSS_CLKSTCTRL             (DSS_CM_CORE + 0x00)
    #define CM_VPE_CLKSTCTRL             (VPE_CM_CORE_AON + 0x00)
    #define CM_IPU_CLKSTCTRL             (0x4a005540)
    #define CM_CAM_VIP1_CLKCTRL          (CAM_CM_CORE + 0x20)
    #define CM_CAM_VIP2_CLKCTRL          (CAM_CM_CORE + 0x28)
    #define CM_CAM_VIP3_CLKCTRL          (CAM_CM_CORE + 0x30)
    #define CM_VPE_VPE_CLKCTRL           (VPE_CM_CORE_AON + 0x04)
    
    #define CTRL_CORE_CONTROL_IO_2       (CTRL_MODULE_CORE + 0x558)
    
    #define CM_L4PER_I2C1_CLKCTRL        (L4PER_CM_CORE + 0xA0)
    #define CM_L4PER_I2C2_CLKCTRL        (L4PER_CM_CORE + 0xA8)
    #define CM_IPU_I2C5_CLKCTRL				(0x4A005578)
    
    #define CTRL_CORE_L3_INITIATOR_PRESSURE			(0x4A002454)
    #define CM_EVE3_CLKSTCTRL				(0x4A0056C0)
    #define CM_EVE3_EVE3_CLKCTRL				(0x4A0056E0)
    #define PM_EVE3_PWRSTCTRL				(0x4AE07BC0)
    #define RM_EVE3_RSTCTRL					(0x4AE07BD0)
    #define CM_CAM_CLKSTCTRL				(0x4A009000)
    
    void spl_enable_clocks_for_vsdk(void)
    {
    	uint32_t reg, i;
    
    	/* enable CORE domain transitions */
    	__raw_writel(0x2, CM_DSS_CLKSTCTRL);
    
    	/* enable power domain transitions (sw_wkup mode) */
    	__raw_writel(0x2, CM_VPE_CLKSTCTRL);
    
    	reg = __raw_readl(CM_L3INSTR_L3_MAIN_2_CLKCTRL);
    	__raw_writel((reg & ~0x00000003)|0x1, CM_L3INSTR_L3_MAIN_2_CLKCTRL);
    
    	/* enable DSS */
    	reg = __raw_readl(CTRL_CORE_CONTROL_IO_2);
    	__raw_writel((reg | 0x1), CTRL_CORE_CONTROL_IO_2);
    	reg = __raw_readl(CM_DSS_DSS_CLKCTRL);
    	__raw_writel(((reg & ~0x00000003) | 0x00003F00 | 0x2), CM_DSS_DSS_CLKCTRL);
    
    	/* checking if DSS is enabled */
    	while ((__raw_readl(CM_DSS_DSS_CLKCTRL) & 0x00030000) != 0);
    
    	/* Common for all platforms - VIP1, VPE, I2C1 */
    	reg = __raw_readl(CM_CAM_VIP1_CLKCTRL);
    	__raw_writel((reg & ~0x00000003)|0x1, CM_CAM_VIP1_CLKCTRL);
    	reg = __raw_readl(CM_VPE_VPE_CLKCTRL);
    	__raw_writel((reg & ~0x00000003)|0x1, CM_VPE_VPE_CLKCTRL);
    	reg = __raw_readl(CM_L4PER_I2C1_CLKCTRL);
    	__raw_writel((reg & ~0x00000003)|0x2, CM_L4PER_I2C1_CLKCTRL);
    
    	/* Enable VIP clocks */
    	if (is_dra7xx() || is_dra76x()) {
    
    		reg = __raw_readl(CM_CAM_VIP2_CLKCTRL);
    		__raw_writel((reg & ~0x00000003)|0x1, CM_CAM_VIP2_CLKCTRL);
    
    		if (is_dra7xx()) {
    			reg = __raw_readl(CM_CAM_VIP3_CLKCTRL);
    			__raw_writel((reg & ~0x00000003)|0x1, CM_CAM_VIP3_CLKCTRL);
    		}
    	}
    
    	/* Enable I25 clocks */
    	if (is_dra72x() || is_dra76x()) {
    
    		reg = __raw_readl(CM_IPU_CLKSTCTRL);
    		__raw_writel((reg & ~0x00000003)|0x2, CM_IPU_CLKSTCTRL);
    		reg = __raw_readl(CM_IPU_I2C5_CLKCTRL);
    		__raw_writel((reg & ~0x00000003)|0x2, CM_IPU_I2C5_CLKCTRL);
    		while (((__raw_readl(CM_IPU_CLKSTCTRL) & 0x2000) >> 13) != 1);
    	}
    
    	/* Enable ISS clocks */
    	if (is_dra76x()) {
    
    		/* Register names are reused, they **actually** enable ISS */
    		__raw_writel(0x00600000, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x20600000, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x20600000, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x24600000, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x20600000, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x00600000, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x00600003, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x08600003, CTRL_CORE_L3_INITIATOR_PRESSURE);
    
    		__raw_writel(0x2, CM_EVE3_CLKSTCTRL);
    		for (i = 0; i < 100; i++) {
    			if ((__raw_readl(CM_EVE3_CLKSTCTRL) & 0x100) == 0)
    				break;
    			mdelay(1);
    		}
    		__raw_writel(0x1, CM_EVE3_EVE3_CLKCTRL);
    
    		__raw_writel(0x3, PM_EVE3_PWRSTCTRL);
    		__raw_writel(0x0, RM_EVE3_RSTCTRL);
    		for (i = 0; i < 100; i++) {
    			if ((__raw_readl(CM_EVE3_EVE3_CLKCTRL) & 0x30000) == 0)
    				break;
    			mdelay(1);
    		}
    	}
    
    	/* Enable CAL clocks */
    	if (is_dra72x() || is_dra76x()) {
    
    		__raw_writel(0x2, CM_CAM_CLKSTCTRL);
    		__raw_writel(0x1, CM_CAM_VIP3_CLKCTRL);
    		for (i = 0; i < 100; i++) {
    			if ((__raw_readl(CM_CAM_CLKSTCTRL) & 0x400) == 0)
    				break;
    			mdelay(1);
    		}
    	}
    }
    
    void spl_setup_board_muxes(void)
    {
    	uint8_t data[2];
    
    	if(is_dra72x()) {
    
    		/* Enable LCD power */
    		i2c_set_bus_num(0);
    		i2c_read(0x20, 0, 0, data, 2);
    		data[1] &= ~(1 << 5); /* CON_LCD_PWR_DN */
    		i2c_write(0x20, 0, 0, data, 2);
    
    		/*Select Vin1a betweeen GPMC and vout3*/
    		i2c_set_bus_num(0);
    		i2c_read(0x21, 0, 0, data, 2);
    		data[0] |=  (1 << 0);  /* SEL_GPMC_AD_VID_S0 */
    		data[1] &= ~(1 << 7); /* SEL_GPMC_AD_VID_S2 */
    		i2c_write(0x21,0,0,data,2);
    
    		/*Select ethernet betweeen emac[0] and vin4b */
    		i2c_set_bus_num(0);
    		i2c_read(0x21, 0, 0, data, 2);
    		data[0] |=  (1 << 4);  /* SEL_ENET_MUX_S0 */
    		i2c_write(0x21,0,0,data,2);
    
    		/*Select ethernet between emac[1] and vin2a[10-24]*/
    		i2c_set_bus_num(4);
    		i2c_read(0x26,0,0,data,2);
    		data[0] &= ~(1 << 1); /* EXVIN2_S0 */
    		data[1] &= ~(1 << 2); /* EXVIN2_S2 */
    		i2c_write(0x26,0,0,data,2);
    
    		/*Select vin2a between emac[0], onboard camera and vin2a[0:8] */
    		i2c_set_bus_num(4);
    		i2c_read(0x26,0,0,data,2);
    		data[0] &= ~(1 << 2); /* VIN2_S0 */
    		data[0] |=  (1 << 6); /* VIN2_S2 */
    		i2c_write(0x26,0,0,data,2);
    
    		/*Select vin2b between mmc3 and vin2b */
    		i2c_set_bus_num(4);
    		i2c_read(0x26,0,0,data,2);
    		data[1] &= ~(1 << 3); /* MMC3_SEL */
    		i2c_write(0x26,0,0,data,2);
    	}
    
    	if(is_dra76x()) {
    
    		/* enale vin3a */
    		i2c_set_bus_num(0);
    		i2c_read(0x26,0,0,data,2);
                    data[1] &= ~(1 << 1);   /* EXVIN2_S0 */
    		data[1] |=  (1 << 2 );  /* EXVIN2_S2 */
    		i2c_write(0x26,0,0,data,2);
    
    		/* enale vin2a */
    		i2c_set_bus_num(0);
    		i2c_read(0x26,0,0,data,2);
                    data[0] &= ~(1 << 2); /* VIN2_S0 */
    		data[0] |=  (1 << 6); /* VIN2_S2 */
    		i2c_write(0x26,0,0,data,2);
    	}
    }
    
    int spl_start_uboot(void)
    {
    	/* break into full u-boot on 'c' */
    	if (serial_tstc() && serial_getc() == 'c')
    		return 1;
    
    	if ((get_sysboot_value() & SYSBOOT_TYPE_MASK) == SYSBOOT_TYPE_PROD)
    		return 0;
    
    #ifdef CONFIG_SPL_ENV_SUPPORT
    	env_init();
    	env_relocate_spec();
    	if (getenv_yesno("boot_os") == 1)
    		return 0;
    #endif
    
    	return 1;
    }
    #endif
    
    #ifdef CONFIG_DRIVER_TI_CPSW
    extern u32 *const omap_si_rev;
    
    static void cpsw_control(int enabled)
    {
    	/* VTP can be added here */
    
    	return;
    }
    
    static struct cpsw_slave_data cpsw_slaves[] = {
    	{
    		.slave_reg_ofs	= 0x208,
    		.sliver_reg_ofs	= 0xd80,
    		.phy_addr	= 2,
    	},
    	{
    		.slave_reg_ofs	= 0x308,
    		.sliver_reg_ofs	= 0xdc0,
    		.phy_addr	= 3,
    	},
    };
    
    static struct cpsw_platform_data cpsw_data = {
    	.mdio_base		= CPSW_MDIO_BASE,
    	.cpsw_base		= CPSW_BASE,
    	.mdio_div		= 0xff,
    	.channels		= 8,
    	.cpdma_reg_ofs		= 0x800,
    	.slaves			= 2,
    	.slave_data		= cpsw_slaves,
    	.ale_reg_ofs		= 0xd00,
    	.ale_entries		= 1024,
    	.host_port_reg_ofs	= 0x108,
    	.hw_stats_reg_ofs	= 0x900,
    	.bd_ram_ofs		= 0x2000,
    	.mac_control		= (1 << 5),
    	.control		= cpsw_control,
    	.host_port_num		= 0,
    	.version		= CPSW_CTRL_VERSION_2,
    };
    
    int board_eth_init(bd_t *bis)
    {
    	int ret;
    	uint8_t mac_addr[6];
    	uint32_t mac_hi, mac_lo;
    	uint32_t ctrl_val;
    
    	/* try reading mac address from efuse */
    	mac_lo = readl((*ctrl)->control_core_mac_id_0_lo);
    	mac_hi = readl((*ctrl)->control_core_mac_id_0_hi);
    	mac_addr[0] = (mac_hi & 0xFF0000) >> 16;
    	mac_addr[1] = (mac_hi & 0xFF00) >> 8;
    	mac_addr[2] = mac_hi & 0xFF;
    	mac_addr[3] = (mac_lo & 0xFF0000) >> 16;
    	mac_addr[4] = (mac_lo & 0xFF00) >> 8;
    	mac_addr[5] = mac_lo & 0xFF;
    
    	if (!getenv("ethaddr")) {
    		printf("<ethaddr> not set. Validating first E-fuse MAC\n");
    
    		if (is_valid_ethaddr(mac_addr))
    			eth_setenv_enetaddr("ethaddr", mac_addr);
    	}
    
    	mac_lo = readl((*ctrl)->control_core_mac_id_1_lo);
    	mac_hi = readl((*ctrl)->control_core_mac_id_1_hi);
    	mac_addr[0] = (mac_hi & 0xFF0000) >> 16;
    	mac_addr[1] = (mac_hi & 0xFF00) >> 8;
    	mac_addr[2] = mac_hi & 0xFF;
    	mac_addr[3] = (mac_lo & 0xFF0000) >> 16;
    	mac_addr[4] = (mac_lo & 0xFF00) >> 8;
    	mac_addr[5] = mac_lo & 0xFF;
    
    	if (!getenv("eth1addr")) {
    		if (is_valid_ethaddr(mac_addr))
    			eth_setenv_enetaddr("eth1addr", mac_addr);
    	}
    
    	ctrl_val = readl((*ctrl)->control_core_control_io1) & (~0x33);
    	ctrl_val |= 0x22;
    	writel(ctrl_val, (*ctrl)->control_core_control_io1);
    
    	if (*omap_si_rev == DRA722_ES1_0)
    		cpsw_data.active_slave = 1;
    
    	if (board_is_dra72x_revc_or_later()) {
    		cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RGMII_ID;
    		cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_RGMII_ID;
    	}
    
    	ret = cpsw_register(&cpsw_data);
    	if (ret < 0)
    		printf("Error %d registering CPSW switch\n", ret);
    
    	return ret;
    }
    #endif
    
    #ifdef CONFIG_BOARD_EARLY_INIT_F
    /* VTT regulator enable */
    static inline void vtt_regulator_enable(void)
    {
    	if (omap_hw_init_context() == OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL)
    		return;
    
    	/* Do not enable VTT for DRA722 or DRA76x */
    	if (is_dra72x() || is_dra76x())
    		return;
    
    	/*
    	 * EVM Rev G and later use gpio7_11 for DDR3 termination.
    	 * This is safe enough to do on older revs.
    	 */
    	gpio_request(GPIO_DDR_VTT_EN, "ddr_vtt_en");
    	gpio_direction_output(GPIO_DDR_VTT_EN, 1);
    }
    
    int board_early_init_f(void)
    {
    	vtt_regulator_enable();
    	return 0;
    }
    #endif
    
    #ifdef CONFIG_SPL_LOAD_FIT
    int board_fit_config_name_match(const char *name)
    {
    	if (is_dra72x()) {
    		if (board_is_dra71x_evm()) {
    			if (!strcmp(name, "dra71-evm"))
    				return 0;
    		}else if(board_is_dra72x_revc_or_later()) {
    			if (!strcmp(name, "dra72-evm-revc"))
    				return 0;
    		} else if (!strcmp(name, "dra72-evm")) {
    			return 0;
    		}
    	} else if (is_dra76x() && !strcmp(name, "dra76-evm")) {
    		return 0;
    	} else if (!is_dra72x() && !is_dra76x() && !strcmp(name, "dra7-evm")) {
    		return 0;
    	}
    
    	return -1;
    }
    #endif
    
    #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
    int ft_board_setup(void *blob, bd_t *bd)
    {
    	ft_cpu_setup(blob, bd);
    
    	return 0;
    }
    #endif
    
    #ifdef CONFIG_TI_SECURE_DEVICE
    void board_fit_image_post_process(void **p_image, size_t *p_size)
    {
    	secure_boot_verify_image(p_image, p_size);
    }
    
    void board_tee_image_process(void *tee_image, size_t tee_size)
    {
    	secure_tee_install((u32)tee_image);
    }
    #endif
    /*
     * (C) Copyright 2013
     * Texas Instruments Incorporated, <www.ti.com>
     *
     * Lokesh Vutla <lokeshvutla@ti.com>
     *
     * Based on previous work by:
     * Aneesh V       <aneesh@ti.com>
     * Steve Sakoman  <steve@sakoman.com>
     *
     * SPDX-License-Identifier:	GPL-2.0+
     */
    #include <common.h>
    #include <palmas.h>
    #include <sata.h>
    #include <linux/string.h>
    #include <asm/gpio.h>
    #include <usb.h>
    #include <linux/usb/gadget.h>
    #include <asm/omap_common.h>
    #include <asm/omap_sec_common.h>
    #include <asm/arch/gpio.h>
    #include <asm/arch/dra7xx_iodelay.h>
    #include <asm/emif.h>
    #include <asm/arch/sys_proto.h>
    #include <asm/arch/mmc_host_def.h>
    #include <asm/arch/sata.h>
    #include <environment.h>
    #include <dwc3-uboot.h>
    #include <dwc3-omap-uboot.h>
    #include <ti-usb-phy-uboot.h>
    #include <miiphy.h>
    #include <spl.h>
    
    #include "mux_data.h"
    #include "../common/board_detect.h"
    
    #define board_is_dra76x_evm()		board_ti_is("DRA76/7x")
    #define board_is_dra74x_evm()		board_ti_is("5777xCPU")
    #define board_is_dra72x_evm()		board_ti_is("DRA72x-T")
    #define board_is_dra71x_evm()		board_ti_is("DRA79x,D")
    #define board_is_dra74x_revh_or_later() (board_is_dra74x_evm() &&	\
    				(strncmp("H", board_ti_get_rev(), 1) <= 0))
    #define board_is_dra72x_revc_or_later() (board_is_dra72x_evm() &&	\
    				(strncmp("C", board_ti_get_rev(), 1) <= 0))
    #define board_ti_get_emif_size()	board_ti_get_emif1_size() +	\
    					board_ti_get_emif2_size()
    
    #ifdef CONFIG_DRIVER_TI_CPSW
    #include <cpsw.h>
    #endif
    
    DECLARE_GLOBAL_DATA_PTR;
    
    /* GPIO 7_11 */
    #define GPIO_DDR_VTT_EN 203
    
    #define SYSINFO_BOARD_NAME_MAX_LEN	37
    
    const struct omap_sysinfo sysinfo = {
    	"Board: UNKNOWN(DRA7 EVM) REV UNKNOWN\n"
    };
    
    static const struct emif_regs emif1_ddr3_532_mhz_1cs = {
    	.sdram_config_init              = 0x61851ab2,
    	.sdram_config                   = 0x61851ab2,
    	.sdram_config2			= 0x08000000,
    	.ref_ctrl                       = 0x000040F1,
    	.ref_ctrl_final			= 0x00001035,
    	.sdram_tim1                     = 0xCCCF36B3,
    	.sdram_tim2                     = 0x308F7FDA,
    	.sdram_tim3                     = 0x427F88A8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x0007190B,
    	.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
    };
    
    static const struct emif_regs emif2_ddr3_532_mhz_1cs = {
    	.sdram_config_init              = 0x61851B32,
    	.sdram_config                   = 0x61851B32,
    	.sdram_config2			= 0x08000000,
    	.ref_ctrl                       = 0x000040F1,
    	.ref_ctrl_final			= 0x00001035,
    	.sdram_tim1                     = 0xCCCF36B3,
    	.sdram_tim2                     = 0x308F7FDA,
    	.sdram_tim3                     = 0x427F88A8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x0007190B,
    	.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
    };
    
    static const struct emif_regs emif_1_regs_ddr3_666_mhz_1cs_dra_es1 = {
    	.sdram_config_init              = 0x61862B32,
    	.sdram_config                   = 0x61862B32,
    	.sdram_config2			= 0x08000000,
    	.ref_ctrl                       = 0x0000514C,
    	.ref_ctrl_final			= 0x0000144A,
    	.sdram_tim1                     = 0xD113781C,
    	.sdram_tim2                     = 0x30717FE3,
    	.sdram_tim3                     = 0x409F86A8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x5007190B,
    	.temp_alert_config              = 0x00000000,
    	.emif_ddr_phy_ctlr_1_init       = 0x0024400D,
    	.emif_ddr_phy_ctlr_1            = 0x0E24400D,
    	.emif_ddr_ext_phy_ctrl_1        = 0x10040100,
    	.emif_ddr_ext_phy_ctrl_2        = 0x00A400A4,
    	.emif_ddr_ext_phy_ctrl_3        = 0x00A900A9,
    	.emif_ddr_ext_phy_ctrl_4        = 0x00B000B0,
    	.emif_ddr_ext_phy_ctrl_5        = 0x00B000B0,
    	.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
    };
    
    const struct emif_regs emif_1_regs_ddr3_666_mhz_1cs_dra_es2 = {
    	.sdram_config_init              = 0x61862BB2,
    	.sdram_config                   = 0x61862BB2,
    	.sdram_config2			= 0x00000000,
    	.ref_ctrl                       = 0x0000514D,
    	.ref_ctrl_final			= 0x0000144A,
    	.sdram_tim1                     = 0xD1137824,
    	.sdram_tim2                     = 0x30B37FE3,
    	.sdram_tim3                     = 0x409F8AD8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x5007190B,
    	.temp_alert_config              = 0x00000000,
    	.emif_ddr_phy_ctlr_1_init       = 0x0824400E,
    	.emif_ddr_phy_ctlr_1            = 0x0E24400E,
    	.emif_ddr_ext_phy_ctrl_1        = 0x04040100,
    	.emif_ddr_ext_phy_ctrl_2        = 0x006B009F,
    	.emif_ddr_ext_phy_ctrl_3        = 0x006B00A2,
    	.emif_ddr_ext_phy_ctrl_4        = 0x006B00A8,
    	.emif_ddr_ext_phy_ctrl_5        = 0x006B00A8,
    	.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
    };
    
    const struct emif_regs emif1_ddr3_532_mhz_1cs_2G = {
    	.sdram_config_init              = 0x61873332, //0x61851ab2,
    	.sdram_config                   = 0x61873332, //0x61851ab2,
    	.sdram_config2			= 0x00000000, //0x08000000,
    	.ref_ctrl                       = 0x0000514D, //0x000040F1,
    	.ref_ctrl_final			= 0x0000144A, //0x00001035,
    	.sdram_tim1                     = 0xD115887D, //0xCCCF36B3,
    	.sdram_tim2                     = 0x40B4802C, //0x30BF7FDA,
    	.sdram_tim3                     = 0x409F8AD8, //0x427F8BA8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x5007190B, //0x0007190B,
    	.temp_alert_config              = 0x00000000,
    	.emif_ddr_phy_ctlr_1_init       = 0x0824400F, //0x0024400B,
    	.emif_ddr_phy_ctlr_1            = 0x0E24400F, //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
    };
    
    const struct emif_regs emif2_ddr3_532_mhz_1cs_2G = {
    	.sdram_config_init              = 0x61873B32, //0x61851B32,
    	.sdram_config                   = 0x61873B32, //0x61851B32,
    	.sdram_config2			= 0x00000000, //0x08000000,
    	.ref_ctrl                       = 0x0000514D, //0x000040F1,
    	.ref_ctrl_final			= 0x0000144A, //0x00001035,
    	.sdram_tim1                     = 0xD3337834, //0xCCCF36B3,
    	.sdram_tim2                     = 0x30B37FE3, //0x308F7FDA,
    	.sdram_tim3                     = 0x407F88A8, //0x427F88A8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x5007190B, //0x0007190B,
    	.temp_alert_config              = 0x00000000,
    	.emif_ddr_phy_ctlr_1_init       = 0x08244010, //0x0024400B,
    	.emif_ddr_phy_ctlr_1            = 0x0E244010, //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
    };
    
    const struct emif_regs emif_1_regs_ddr3_666_mhz_1cs_dra76 = {
    	.sdram_config_init              = 0x61862B32,
    	.sdram_config                   = 0x61862B32,
    	.sdram_config2			= 0x00000000,
    	.ref_ctrl                       = 0x0000514C,
    	.ref_ctrl_final			= 0x0000144A,
    	.sdram_tim1                     = 0xD113783C,
    	.sdram_tim2                     = 0x30B47FE3,
    	.sdram_tim3                     = 0x409F8AD8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x5007190B,
    	.temp_alert_config              = 0x00000000,
    	.emif_ddr_phy_ctlr_1_init       = 0x0824400D,
    	.emif_ddr_phy_ctlr_1            = 0x0E24400D,
    	.emif_ddr_ext_phy_ctrl_1        = 0x04040100,
    	.emif_ddr_ext_phy_ctrl_2        = 0x006B009F,
    	.emif_ddr_ext_phy_ctrl_3        = 0x006B00A2,
    	.emif_ddr_ext_phy_ctrl_4        = 0x006B00A8,
    	.emif_ddr_ext_phy_ctrl_5        = 0x006B00A8,
    	.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
    };
    
    const struct emif_regs emif_2_regs_ddr3_666_mhz_1cs_dra76 = {
    	.sdram_config_init              = 0x61862B32,
    	.sdram_config                   = 0x61862B32,
    	.sdram_config2			= 0x00000000,
    	.ref_ctrl                       = 0x0000514C,
    	.ref_ctrl_final			= 0x0000144A,
    	.sdram_tim1                     = 0xD113781C,
    	.sdram_tim2                     = 0x30B47FE3,
    	.sdram_tim3                     = 0x409F8AD8,
    	.read_idle_ctrl                 = 0x00050000,
    	.zq_config                      = 0x5007190B,
    	.temp_alert_config              = 0x00000000,
    	.emif_ddr_phy_ctlr_1_init       = 0x0824400D,
    	.emif_ddr_phy_ctlr_1            = 0x0E24400D,
    	.emif_ddr_ext_phy_ctrl_1        = 0x04040100,
    	.emif_ddr_ext_phy_ctrl_2        = 0x006B009F,
    	.emif_ddr_ext_phy_ctrl_3        = 0x006B00A2,
    	.emif_ddr_ext_phy_ctrl_4        = 0x006B00A8,
    	.emif_ddr_ext_phy_ctrl_5        = 0x006B00A8,
    	.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
    };
    
    const struct emif_regs TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_emif_regs = {			
            .sdram_config_init 		= 0x61873B32,			
            .sdram_config 			= 0x61873B32,			
            .sdram_config2 			= 0x00000000,			
            .ref_ctrl 			= 0x0000514D,			
            .ref_ctrl_final 		= 0x0000144A,			
            .sdram_tim1 			= 0xD3337834,			
            .sdram_tim2 			= 0x30B37FE3,			
            .sdram_tim3 			= 0x407F8AD8,			
            .read_idle_ctrl 		= 0x00050000,			
            .zq_config 			= 0x5007190B,			 
            .temp_alert_config 		= 0x00000000,			
    	.emif_ddr_phy_ctlr_1_init       = 0x08244010,
    	.emif_ddr_phy_ctlr_1            = 0x0E244010,
    	.emif_ddr_ext_phy_ctrl_1        = 0x04040100,
    	.emif_ddr_ext_phy_ctrl_2        = 0x006B006B,
    	.emif_ddr_ext_phy_ctrl_3        = 0x006B006B,
    	.emif_ddr_ext_phy_ctrl_4        = 0x006B006B,
    	.emif_ddr_ext_phy_ctrl_5        = 0x006B006B,
    	.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			
    };			
    
    
    void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs)
    {
    	printf("Evm.c\n");
    	u64 ram_size;
    
    	ram_size = board_ti_get_emif_size();
    
    	switch (omap_revision()) {
    	case DRA752_ES1_0:
    	case DRA752_ES1_1:
    	case DRA752_ES2_0:
    		switch (emif_nr) {
    		case 1:
    			if (ram_size > CONFIG_MAX_MEM_MAPPED)
    				*regs = &emif1_ddr3_532_mhz_1cs_2G;
    			else
    				*regs = &emif1_ddr3_532_mhz_1cs;
    			break;
    		case 2:
    			if (ram_size > CONFIG_MAX_MEM_MAPPED)
    				*regs = &emif2_ddr3_532_mhz_1cs_2G;
    			else
    				*regs = &emif2_ddr3_532_mhz_1cs;
    			break;
    		}
    		break;
    	case DRA762_ES1_0:
    		if (emif_nr == 1)
    			*regs = &emif_1_regs_ddr3_666_mhz_1cs_dra76;
    		else
    			*regs = &emif_2_regs_ddr3_666_mhz_1cs_dra76;
    		break;
    	case DRA722_ES1_0:
    	case DRA722_ES2_0:
    	case DRA722_ES2_1:
    		if (ram_size < CONFIG_MAX_MEM_MAPPED)
    			*regs = &emif_1_regs_ddr3_666_mhz_1cs_dra_es1;
    		else
    			*regs = &emif_1_regs_ddr3_666_mhz_1cs_dra_es2;
    		break;
    	default:
    		*regs = &emif1_ddr3_532_mhz_1cs;
    	}
    	*regs = &TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_emif_regs; //new
    }
    
    static const struct dmm_lisa_map_regs lisa_map_dra7_1536MB = {
    	.dmm_lisa_map_0 = 0x0,
    	.dmm_lisa_map_1 = 0x80640300,
    	.dmm_lisa_map_2 = 0xC0500220,
    	.dmm_lisa_map_3 = 0xFF020100,
    	.is_ma_present	= 0x1
    };
    
    static const struct dmm_lisa_map_regs lisa_map_2G_x_2 = {
    	.dmm_lisa_map_0 = 0x0,
    	.dmm_lisa_map_1 = 0x0,
    	.dmm_lisa_map_2 = 0x80600100,
    	.dmm_lisa_map_3 = 0xFF020100,
    	.is_ma_present	= 0x1
    };
    
    const struct dmm_lisa_map_regs lisa_map_dra7_2GB = {
    	.dmm_lisa_map_0 = 0x0,
    	.dmm_lisa_map_1 = 0x0,
    	.dmm_lisa_map_2 = 0x80600100, //0x80740300,
    	.dmm_lisa_map_3 = 0xFF020100,
    	.is_ma_present	= 0x1
    };
    
    const struct dmm_lisa_map_regs TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_dmm_regs = {			
        .dmm_lisa_map_0 = 0x00000000,			
        .dmm_lisa_map_1 = 0x00000000,			
        .dmm_lisa_map_2 = 0x80600100,			
        .dmm_lisa_map_3 = 0xFF020100,			
        .is_ma_present = 0x1			
    };			
    
    /*
     * DRA722 EVM EMIF1 2GB CONFIGURATION
     * EMIF1 4 devices of 512Mb x 8 Micron
     */
    const struct dmm_lisa_map_regs lisa_map_2G_x_4 = {
    	.dmm_lisa_map_0 = 0x0,
    	.dmm_lisa_map_1 = 0x0,
    	.dmm_lisa_map_2 = 0x80700100,
    	.dmm_lisa_map_3 = 0xFF020100,
    	.is_ma_present	= 0x1
    };
    
    void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs)
    {
    	u64 ram_size;
    
    	ram_size = board_ti_get_emif_size();
    
    	switch (omap_revision()) {
    	case DRA762_ES1_0:
    	case DRA752_ES1_0:
    	case DRA752_ES1_1:
    	case DRA752_ES2_0:
    		if (ram_size > CONFIG_MAX_MEM_MAPPED)
    			*dmm_lisa_regs = &lisa_map_dra7_2GB;
    		else
    			*dmm_lisa_regs = &lisa_map_dra7_1536MB;
    		break;
    	case DRA722_ES1_0:
    	case DRA722_ES2_0:
    	case DRA722_ES2_1:
    	default:
    		if (ram_size < CONFIG_MAX_MEM_MAPPED)
    			*dmm_lisa_regs = &lisa_map_2G_x_2;
    		else
    			*dmm_lisa_regs = &lisa_map_2G_x_4;
    		break;
    	}
    	*dmm_lisa_regs = &TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_dmm_regs; //new
    }
    
    struct vcores_data dra752_volts = {
    	.mpu.value[OPP_NOM]	= VDD_MPU_DRA7_NOM,
    	.mpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_MPU_NOM,
    	.mpu.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.mpu.addr	= TPS659038_REG_ADDR_SMPS12,
    	.mpu.pmic	= &tps659038,
    	.mpu.abb_tx_done_mask = OMAP_ABB_MPU_TXDONE_MASK,
    
    	.eve.value[OPP_NOM]	= VDD_EVE_DRA7_NOM,
    	.eve.value[OPP_OD]	= VDD_EVE_DRA7_OD,
    	.eve.value[OPP_HIGH]	= VDD_EVE_DRA7_HIGH,
    	.eve.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_DSPEVE_NOM,
    	.eve.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_DSPEVE_OD,
    	.eve.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_DSPEVE_HIGH,
    	.eve.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.eve.addr	= TPS659038_REG_ADDR_SMPS45,
    	.eve.pmic	= &tps659038,
    	.eve.abb_tx_done_mask = OMAP_ABB_EVE_TXDONE_MASK,
    
    	.gpu.value[OPP_NOM]	= VDD_GPU_DRA7_NOM,
    	.gpu.value[OPP_OD]	= VDD_GPU_DRA7_OD,
    	.gpu.value[OPP_HIGH]	= VDD_GPU_DRA7_HIGH,
    	.gpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_GPU_NOM,
    	.gpu.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_GPU_OD,
    	.gpu.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_GPU_HIGH,
    	.gpu.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.gpu.addr	= TPS659038_REG_ADDR_SMPS6,
    	.gpu.pmic	= &tps659038,
    	.gpu.abb_tx_done_mask = OMAP_ABB_GPU_TXDONE_MASK,
    
    	.core.value[OPP_NOM]	= VDD_CORE_DRA7_NOM,
    	.core.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_CORE_NOM,
    	.core.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.core.addr	= TPS659038_REG_ADDR_SMPS7,
    	.core.pmic	= &tps659038,
    
    	.iva.value[OPP_NOM]	= VDD_IVA_DRA7_NOM,
    	.iva.value[OPP_OD]	= VDD_IVA_DRA7_OD,
    	.iva.value[OPP_HIGH]	= VDD_IVA_DRA7_HIGH,
    	.iva.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_IVA_NOM,
    	.iva.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_IVA_OD,
    	.iva.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_IVA_HIGH,
    	.iva.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.iva.addr	= TPS659038_REG_ADDR_SMPS8,
    	.iva.pmic	= &tps659038,
    	.iva.abb_tx_done_mask = OMAP_ABB_IVA_TXDONE_MASK,
    };
    
    struct vcores_data dra76x_volts = {
    	.mpu.value[OPP_NOM]	= VDD_MPU_DRA7_NOM,
    	.mpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_MPU_NOM,
    	.mpu.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.mpu.addr	= LP87565_REG_ADDR_BUCK01,
    	.mpu.pmic	= &lp87565,
    	.mpu.abb_tx_done_mask = OMAP_ABB_MPU_TXDONE_MASK,
    
    	.eve.value[OPP_NOM]	= VDD_EVE_DRA7_NOM,
    	.eve.value[OPP_OD]	= VDD_EVE_DRA7_OD,
    	.eve.value[OPP_HIGH]	= VDD_EVE_DRA7_HIGH,
    	.eve.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_DSPEVE_NOM,
    	.eve.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_DSPEVE_OD,
    	.eve.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_DSPEVE_HIGH,
    	.eve.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.eve.addr	= TPS65917_REG_ADDR_SMPS1,
    	.eve.pmic	= &tps659038,
    	.eve.abb_tx_done_mask = OMAP_ABB_EVE_TXDONE_MASK,
    
    	.gpu.value[OPP_NOM]	= VDD_GPU_DRA7_NOM,
    	.gpu.value[OPP_OD]	= VDD_GPU_DRA7_OD,
    	.gpu.value[OPP_HIGH]	= VDD_GPU_DRA7_HIGH,
    	.gpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_GPU_NOM,
    	.gpu.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_GPU_OD,
    	.gpu.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_GPU_HIGH,
    	.gpu.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.gpu.addr	= LP87565_REG_ADDR_BUCK23,
    	.gpu.pmic	= &lp87565,
    	.gpu.abb_tx_done_mask = OMAP_ABB_GPU_TXDONE_MASK,
    
    	.core.value[OPP_NOM]	= VDD_CORE_DRA7_NOM,
    	.core.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_CORE_NOM,
    	.core.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.core.addr	= TPS65917_REG_ADDR_SMPS3,
    	.core.pmic	= &tps659038,
    
    	.iva.value[OPP_NOM]	= VDD_IVA_DRA7_NOM,
    	.iva.value[OPP_OD]	= VDD_IVA_DRA7_OD,
    	.iva.value[OPP_HIGH]	= VDD_IVA_DRA7_HIGH,
    	.iva.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_IVA_NOM,
    	.iva.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_IVA_OD,
    	.iva.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_IVA_HIGH,
    	.iva.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.iva.addr	= TPS65917_REG_ADDR_SMPS4,
    	.iva.pmic	= &tps659038,
    	.iva.abb_tx_done_mask = OMAP_ABB_IVA_TXDONE_MASK,
    };
    
    struct vcores_data dra722_volts = {
    	.mpu.value[OPP_NOM]	= VDD_MPU_DRA7_NOM,
    	.mpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_MPU_NOM,
    	.mpu.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.mpu.addr	= TPS65917_REG_ADDR_SMPS1,
    	.mpu.pmic	= &tps659038,
    	.mpu.abb_tx_done_mask = OMAP_ABB_MPU_TXDONE_MASK,
    
    	.core.value[OPP_NOM]	= VDD_CORE_DRA7_NOM,
    	.core.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_CORE_NOM,
    	.core.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.core.addr	= TPS65917_REG_ADDR_SMPS2,
    	.core.pmic	= &tps659038,
    
    	/*
    	 * The DSPEVE, GPU and IVA rails are usually grouped on DRA72x
    	 * designs and powered by TPS65917 SMPS3, as on the J6Eco EVM.
    	 */
    	.gpu.value[OPP_NOM]	= VDD_GPU_DRA7_NOM,
    	.gpu.value[OPP_OD]	= VDD_GPU_DRA7_OD,
    	.gpu.value[OPP_HIGH]	= VDD_GPU_DRA7_HIGH,
    	.gpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_GPU_NOM,
    	.gpu.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_GPU_OD,
    	.gpu.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_GPU_HIGH,
    	.gpu.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.gpu.addr	= TPS65917_REG_ADDR_SMPS3,
    	.gpu.pmic	= &tps659038,
    	.gpu.abb_tx_done_mask = OMAP_ABB_GPU_TXDONE_MASK,
    
    	.eve.value[OPP_NOM]	= VDD_EVE_DRA7_NOM,
    	.eve.value[OPP_OD]	= VDD_EVE_DRA7_OD,
    	.eve.value[OPP_HIGH]	= VDD_EVE_DRA7_HIGH,
    	.eve.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_DSPEVE_NOM,
    	.eve.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_DSPEVE_OD,
    	.eve.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_DSPEVE_HIGH,
    	.eve.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.eve.addr	= TPS65917_REG_ADDR_SMPS3,
    	.eve.pmic	= &tps659038,
    	.eve.abb_tx_done_mask = OMAP_ABB_EVE_TXDONE_MASK,
    
    	.iva.value[OPP_NOM]	= VDD_IVA_DRA7_NOM,
    	.iva.value[OPP_OD]	= VDD_IVA_DRA7_OD,
    	.iva.value[OPP_HIGH]	= VDD_IVA_DRA7_HIGH,
    	.iva.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_IVA_NOM,
    	.iva.efuse.reg[OPP_OD]	= STD_FUSE_OPP_VMIN_IVA_OD,
    	.iva.efuse.reg[OPP_HIGH]	= STD_FUSE_OPP_VMIN_IVA_HIGH,
    	.iva.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.iva.addr	= TPS65917_REG_ADDR_SMPS3,
    	.iva.pmic	= &tps659038,
    	.iva.abb_tx_done_mask = OMAP_ABB_IVA_TXDONE_MASK,
    };
    
    struct vcores_data dra718_volts = {
    	/*
    	 * In the case of dra71x GPU MPU and CORE
    	 * are all powered up by BUCK0 of LP873X PMIC
    	 */
    	.mpu.value[OPP_NOM]	= VDD_MPU_DRA7_NOM,
    	.mpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_MPU_NOM,
    	.mpu.efuse.reg_bits	= DRA752_EFUSE_REGBITS,
    	.mpu.addr	= LP873X_REG_ADDR_BUCK0,
    	.mpu.pmic	= &lp8733,
    	.mpu.abb_tx_done_mask = OMAP_ABB_MPU_TXDONE_MASK,
    
    	.core.value[OPP_NOM]		= VDD_CORE_DRA7_NOM,
    	.core.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_CORE_NOM,
    	.core.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.core.addr	= LP873X_REG_ADDR_BUCK0,
    	.core.pmic	= &lp8733,
    
    	.gpu.value[OPP_NOM]	= VDD_GPU_DRA7_NOM,
    	.gpu.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_GPU_NOM,
    	.gpu.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.gpu.addr	= LP873X_REG_ADDR_BUCK0,
    	.gpu.pmic	= &lp8733,
    	.gpu.abb_tx_done_mask = OMAP_ABB_GPU_TXDONE_MASK,
    
    	/*
    	 * The DSPEVE and IVA rails are grouped on DRA71x-evm
    	 * and are powered by BUCK1 of LP873X PMIC
    	 */
    	.eve.value[OPP_NOM]	= VDD_EVE_DRA7_NOM,
    	.eve.value[OPP_HIGH]	= VDD_EVE_DRA7_HIGH,
    	.eve.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_DSPEVE_NOM,
    	.eve.efuse.reg[OPP_HIGH] = STD_FUSE_OPP_VMIN_DSPEVE_HIGH,
    	.eve.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.eve.addr	= LP873X_REG_ADDR_BUCK1,
    	.eve.pmic	= &lp8733,
    	.eve.abb_tx_done_mask = OMAP_ABB_EVE_TXDONE_MASK,
    
    	.iva.value[OPP_NOM]	= VDD_IVA_DRA7_NOM,
    	.iva.value[OPP_HIGH]	= VDD_IVA_DRA7_HIGH,
    	.iva.efuse.reg[OPP_NOM]	= STD_FUSE_OPP_VMIN_IVA_NOM,
    	.iva.efuse.reg[OPP_HIGH] = STD_FUSE_OPP_VMIN_IVA_HIGH,
    	.iva.efuse.reg_bits = DRA752_EFUSE_REGBITS,
    	.iva.addr	= LP873X_REG_ADDR_BUCK1,
    	.iva.pmic	= &lp8733,
    	.iva.abb_tx_done_mask = OMAP_ABB_IVA_TXDONE_MASK,
    };
    
    int get_voltrail_opp(int rail_offset)
    {
    	int opp;
    
    	switch (rail_offset) {
    	case VOLT_MPU:
    		opp = DRA7_MPU_OPP;
    		/* DRA71x supports only OPP_NOM for MPU */
    		if (board_is_dra71x_evm())
    			opp = OPP_NOM;
    		break;
    	case VOLT_CORE:
    		opp = DRA7_CORE_OPP;
    		/* DRA71x supports only OPP_NOM for CORE */
    		if (board_is_dra71x_evm())
    			opp = OPP_NOM;
    		break;
    	case VOLT_GPU:
    		opp = DRA7_GPU_OPP;
    		/* DRA71x supports only OPP_NOM for GPU */
    		if (board_is_dra71x_evm())
    			opp = OPP_NOM;
    		break;
    	case VOLT_EVE:
    		opp = DRA7_DSPEVE_OPP;
    		/*
    		 * DRA71x does not support OPP_OD for EVE.
    		 * If OPP_OD is selected by menuconfig, fallback
    		 * to OPP_NOM.
    		 */
    		if (board_is_dra71x_evm() && opp == OPP_OD)
    			opp = OPP_NOM;
    		break;
    	case VOLT_IVA:
    		opp = DRA7_IVA_OPP;
    		/*
    		 * DRA71x does not support OPP_OD for IVA.
    		 * If OPP_OD is selected by menuconfig, fallback
    		 * to OPP_NOM.
    		 */
    		if (board_is_dra71x_evm() && opp == OPP_OD)
    			opp = OPP_NOM;
    		break;
    	default:
    		opp = OPP_NOM;
    	}
    
    	return opp;
    }
    
    /**
     * @brief board_init
     *
     * @return 0
     */
    int board_init(void)
    {
    #ifndef CONFIG_SPL_DFU_SUPPORT
    #ifdef CONFIG_SPL_ENV_SUPPORT
    #ifdef CONFIG_ENV_IS_IN_MMC
    	struct mmc *mmc;
    	spl_mmc_init(&mmc, UINT_MAX);
    #endif
    
    	env_init();
    	env_relocate_spec();
    	omap_die_id_serial();
    #endif
    #endif
    
    	gpmc_init();
    	gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
    
    	return 0;
    }
    
    void dram_init_banksize(void)
    {
    	u64 ram_size;
    
    	ram_size = board_ti_get_emif_size();
    
    	gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
    	gd->bd->bi_dram[0].size = get_effective_memsize();
    	if (ram_size > CONFIG_MAX_MEM_MAPPED) {
    		gd->bd->bi_dram[1].start = 0x200000000;
    		gd->bd->bi_dram[1].size = ram_size - CONFIG_MAX_MEM_MAPPED;
    	}
    }
    
    int board_late_init(void)
    {
    #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
    	char *name = "unknown";
    
    	if (is_dra72x()) {
    		if (board_is_dra72x_revc_or_later())
    			name = "dra72x-revc";
    		else if (board_is_dra71x_evm())
    			name = "dra71x";
    		else
    			name = "dra72x";
    	} else if (is_dra76x()) {
    		name = "dra76x";
    	} else {
    		name = "dra7xx";
    	}
    
    	set_board_info_env(name);
    
    	/*
    	 * Default FIT boot on HS devices. Non FIT images are not allowed
    	 * on HS devices.
    	 */
    	if (get_device_type() == HS_DEVICE)
    		setenv("boot_fit", "1");
    
    	omap_die_id_serial();
    	omap_set_fastboot_vars();
    #endif
    	return 0;
    }
    
    #ifdef CONFIG_SPL_BUILD
    void do_board_detect(void)
    {
    	int rc;
    
    	rc = ti_i2c_eeprom_dra7_get(CONFIG_EEPROM_BUS_ADDRESS,
    				    CONFIG_EEPROM_CHIP_ADDRESS);
    	if (rc)
    		printf("ti_i2c_eeprom_init failed %d\n", rc);
    }
    
    #else
    
    void do_board_detect(void)
    {
    	char *bname = NULL;
    	int rc;
    
    	rc = ti_i2c_eeprom_dra7_get(CONFIG_EEPROM_BUS_ADDRESS,
    				    CONFIG_EEPROM_CHIP_ADDRESS);
    	if (rc)
    		printf("ti_i2c_eeprom_init failed %d\n", rc);
    
    	if (board_is_dra74x_evm()) {
    		bname = "DRA74x EVM";
    	} else if (board_is_dra72x_evm()) {
    		bname = "DRA72x EVM";
    	} else if (board_is_dra71x_evm()) {
    		bname = "DRA71x EVM";
    	} else if (board_is_dra76x_evm()) {
    		bname = "DRA76x EVM";
    	} else {
    		/* If EEPROM is not populated */
    		if (is_dra72x())
    			bname = "DRA72x EVM";
    		else
    			bname = "DRA74x EVM";
    	}
    
    	if (bname)
    		snprintf(sysinfo.board_string, SYSINFO_BOARD_NAME_MAX_LEN,
    			 "Board: %s REV %s\n", bname, board_ti_get_rev());
    }
    #endif	/* CONFIG_SPL_BUILD */
    
    void vcores_update(void)
    {
    	if (board_is_dra74x_evm()) {
    		*omap_vcores = &dra752_volts;
    	} else if (board_is_dra72x_evm()) {
    		*omap_vcores = &dra722_volts;
    	} else if (board_is_dra71x_evm()) {
    		*omap_vcores = &dra718_volts;
    	} else if (board_is_dra76x_evm()) {
    		*omap_vcores = &dra76x_volts;
    	} else {
    		/* If EEPROM is not populated */
    		if (is_dra72x())
    			*omap_vcores = &dra722_volts;
    		else
    			*omap_vcores = &dra752_volts;
    	}
    }
    
    void set_muxconf_regs(void)
    {
    	do_set_mux32((*ctrl)->control_padconf_core_base,
    		     early_padconf, ARRAY_SIZE(early_padconf));
    }
    
    #ifdef CONFIG_IODELAY_RECALIBRATION
    void recalibrate_iodelay(void)
    {
    	struct pad_conf_entry const *pads, *delta_pads = NULL;
    	struct iodelay_cfg_entry const *iodelay;
    	int npads, niodelays, delta_npads = 0;
    	int ret;
    
    	switch (omap_revision()) {
    	case DRA722_ES1_0:
    	case DRA722_ES2_0:
    	case DRA722_ES2_1:
    		pads = dra72x_core_padconf_array_common;
    		npads = ARRAY_SIZE(dra72x_core_padconf_array_common);
    		if (board_is_dra71x_evm()) {
    			pads = dra71x_core_padconf_array;
    			npads = ARRAY_SIZE(dra71x_core_padconf_array);
    			iodelay = dra71_iodelay_cfg_array;
    			niodelays = ARRAY_SIZE(dra71_iodelay_cfg_array);
    		} else if (board_is_dra72x_revc_or_later()) {
    			delta_pads = dra72x_rgmii_padconf_array_revc;
    			delta_npads =
    				ARRAY_SIZE(dra72x_rgmii_padconf_array_revc);
    			iodelay = dra72_iodelay_cfg_array_revc;
    			niodelays = ARRAY_SIZE(dra72_iodelay_cfg_array_revc);
    		} else {
    			delta_pads = dra72x_rgmii_padconf_array_revb;
    			delta_npads =
    				ARRAY_SIZE(dra72x_rgmii_padconf_array_revb);
    			iodelay = dra72_iodelay_cfg_array_revb;
    			niodelays = ARRAY_SIZE(dra72_iodelay_cfg_array_revb);
    		}
    		break;
    	case DRA752_ES1_0:
    	case DRA752_ES1_1:
    		pads = dra74x_core_padconf_array;
    		npads = ARRAY_SIZE(dra74x_core_padconf_array);
    		iodelay = dra742_es1_1_iodelay_cfg_array;
    		niodelays = ARRAY_SIZE(dra742_es1_1_iodelay_cfg_array);
    		break;
    	case DRA762_ES1_0:
    		pads = dra76x_core_padconf_array;
    		npads = ARRAY_SIZE(dra76x_core_padconf_array);
    		iodelay = dra76x_es1_0_iodelay_cfg_array;
    		niodelays = ARRAY_SIZE(dra76x_es1_0_iodelay_cfg_array);
    		break;
    	default:
    	case DRA752_ES2_0:
    		pads = dra74x_core_padconf_array;
    		npads = ARRAY_SIZE(dra74x_core_padconf_array);
    		iodelay = dra742_es2_0_iodelay_cfg_array;
    		niodelays = ARRAY_SIZE(dra742_es2_0_iodelay_cfg_array);
    		/* Setup port1 and port2 for rgmii with 'no-id' mode */
    		clrset_spare_register(1, 0, RGMII2_ID_MODE_N_MASK |
    				      RGMII1_ID_MODE_N_MASK);
    		break;
    	}
    	/* Setup I/O isolation */
    	ret = __recalibrate_iodelay_start();
    	if (ret)
    		goto err;
    
    	/* Do the muxing here */
    	do_set_mux32((*ctrl)->control_padconf_core_base, pads, npads);
    
    	/* Now do the weird minor deltas that should be safe */
    	if (delta_npads)
    		do_set_mux32((*ctrl)->control_padconf_core_base,
    			     delta_pads, delta_npads);
    
    	/* Setup IOdelay configuration */
    	ret = do_set_iodelay((*ctrl)->iodelay_config_base, iodelay, niodelays);
    err:
    	/* Closeup.. remove isolation */
    	__recalibrate_iodelay_end(ret);
    }
    #endif
    
    #if defined(CONFIG_GENERIC_MMC)
    int board_mmc_init(bd_t *bis)
    {
    	omap_mmc_init(0, 0, 0, -1, -1);
    	omap_mmc_init(1, 0, 0, -1, -1);
    	return 0;
    }
    
    void board_mmc_poweron_ldo(uint voltage)
    {
    	if (board_is_dra71x_evm()) {
    		if (voltage == LDO_VOLT_3V0)
    			voltage = 0x19;
    		else if (voltage == LDO_VOLT_1V8)
    			voltage = 0xa;
    		lp873x_mmc1_poweron_ldo(voltage);
    	} else if (board_is_dra76x_evm()) {
    		palmas_mmc1_poweron_ldo(LDO4_VOLTAGE, LDO4_CTRL, voltage);
    	} else {
    		palmas_mmc1_poweron_ldo(LDO1_VOLTAGE, LDO1_CTRL, voltage);
    	}
    }
    #endif
    
    #ifdef CONFIG_OMAP_HSMMC
    #if defined(CONFIG_IODELAY_RECALIBRATION) && \
    	(defined(CONFIG_SPL_BUILD) || !defined(CONFIG_DM_MMC))
    
    struct pinctrl_desc {
    	const char *name;
    	struct omap_hsmmc_pinctrl_state *pinctrl;
    };
    
    static struct pinctrl_desc pinctrl_descs_hsmmc1[] = {
    	{"default", &hsmmc1_default},
    	{"hs", &hsmmc1_default},
    	{NULL}
    };
    
    static struct pinctrl_desc pinctrl_descs_hsmmc2_rev20[] = {
    	{"default", &hsmmc2_default_hs},
    	{"hs", &hsmmc2_default_hs},
    	{"ddr_1_8v", &hsmmc2_ddr_1v8_rev20},
    	{"hs200_1_8v", &hsmmc2_hs200_1v8_rev20},
    	{NULL}
    };
    
    static struct pinctrl_desc pinctrl_descs_hsmmc2_rev11[] = {
    	{"default", &hsmmc2_default_hs},
    	{"hs", &hsmmc2_default_hs},
    	{"ddr_1_8v", &hsmmc2_ddr_1v8_rev11},
    	{"hs200_1_8v", &hsmmc2_hs200_1v8_rev11},
    	{NULL}
    };
    
    static struct pinctrl_desc pinctrl_descs_hsmmc2_dra72x[] = {
    	{"default", &hsmmc2_default_hs},
    	{"hs", &hsmmc2_default_hs},
    	{"ddr_1_8v", &hsmmc2_ddr_1v8_dra72},
    	{"hs200_1_8v", &hsmmc2_hs200_1v8_dra72},
    	{NULL}
    };
    
    static struct pinctrl_desc pinctrl_descs_hsmmc2_dra76x[] = {
    	{"default", &hsmmc2_default_hs},
    	{"hs", &hsmmc2_default_hs},
    	{"ddr_1_8v", &hsmmc2_default_hs},
    	{"hs200_1_8v", &hsmmc2_hs200_1v8_dra76},
    	{NULL}
    };
    
    struct omap_hsmmc_pinctrl_state *platform_fixup_get_pinctrl_by_mode
    				  (struct hsmmc *base, const char *mode)
    {
    	struct pinctrl_desc *p = NULL;
    
    	switch ((uint32_t)base) {
    	case OMAP_HSMMC1_BASE:
    		p = pinctrl_descs_hsmmc1;
    		break;
    	case OMAP_HSMMC2_BASE:
    		if ((omap_revision() == DRA752_ES1_0) ||
    		    (omap_revision() == DRA752_ES1_1))
    			p = pinctrl_descs_hsmmc2_rev11;
    		else if (is_dra72x())
    			p = pinctrl_descs_hsmmc2_dra72x;
    		else if (is_dra76x())
    			p = pinctrl_descs_hsmmc2_dra76x;
    		else if (is_dra7xx())
    			p = pinctrl_descs_hsmmc2_rev20;
    		break;
    	default:
    		break;
    	}
    
    	if (!p) {
    		printf("%s no pinctrl defined for MMC@%p\n", __func__,
    		       base);
    		return NULL;
    	}
    	while (p->name) {
    		if (strcmp(mode, p->name) == 0)
    			return p->pinctrl;
    		p++;
    	}
    	return NULL;
    }
    #endif
    
    int platform_fixup_disable_uhs_mode(void)
    {
    	return omap_revision() == DRA752_ES1_1;
    }
    #endif
    
    #ifdef CONFIG_USB_DWC3
    static struct dwc3_device usb_otg_ss1 = {
    	.maximum_speed = USB_SPEED_SUPER,
    	.base = DRA7_USB_OTG_SS1_BASE,
    	.tx_fifo_resize = false,
    	.index = 0,
    };
    
    static struct dwc3_omap_device usb_otg_ss1_glue = {
    	.base = (void *)DRA7_USB_OTG_SS1_GLUE_BASE,
    	.utmi_mode = DWC3_OMAP_UTMI_MODE_SW,
    	.index = 0,
    };
    
    static struct ti_usb_phy_device usb_phy1_device = {
    	.pll_ctrl_base = (void *)DRA7_USB3_PHY1_PLL_CTRL,
    	.usb2_phy_power = (void *)DRA7_USB2_PHY1_POWER,
    	.usb3_phy_power = (void *)DRA7_USB3_PHY1_POWER,
    	.index = 0,
    };
    
    static struct dwc3_device usb_otg_ss2 = {
    	.maximum_speed = USB_SPEED_SUPER,
    	.base = DRA7_USB_OTG_SS2_BASE,
    	.tx_fifo_resize = false,
    	.index = 1,
    };
    
    static struct dwc3_omap_device usb_otg_ss2_glue = {
    	.base = (void *)DRA7_USB_OTG_SS2_GLUE_BASE,
    	.utmi_mode = DWC3_OMAP_UTMI_MODE_SW,
    	.index = 1,
    };
    
    static struct ti_usb_phy_device usb_phy2_device = {
    	.usb2_phy_power = (void *)DRA7_USB2_PHY2_POWER,
    	.index = 1,
    };
    
    int board_usb_init(int index, enum usb_init_type init)
    {
    	enable_usb_clocks(index);
    	switch (index) {
    	case 0:
    		if (init == USB_INIT_DEVICE) {
    			usb_otg_ss1.dr_mode = USB_DR_MODE_PERIPHERAL;
    			usb_otg_ss1_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID;
    		} else {
    			usb_otg_ss1.dr_mode = USB_DR_MODE_HOST;
    			usb_otg_ss1_glue.vbus_id_status = OMAP_DWC3_ID_GROUND;
    		}
    
    		ti_usb_phy_uboot_init(&usb_phy1_device);
    		dwc3_omap_uboot_init(&usb_otg_ss1_glue);
    		dwc3_uboot_init(&usb_otg_ss1);
    		break;
    	case 1:
    		if (init == USB_INIT_DEVICE) {
    			usb_otg_ss2.dr_mode = USB_DR_MODE_PERIPHERAL;
    			usb_otg_ss2_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID;
    		} else {
    			usb_otg_ss2.dr_mode = USB_DR_MODE_HOST;
    			usb_otg_ss2_glue.vbus_id_status = OMAP_DWC3_ID_GROUND;
    		}
    
    		ti_usb_phy_uboot_init(&usb_phy2_device);
    		dwc3_omap_uboot_init(&usb_otg_ss2_glue);
    		dwc3_uboot_init(&usb_otg_ss2);
    		break;
    	default:
    		printf("Invalid Controller Index\n");
    	}
    
    	return 0;
    }
    
    int board_usb_cleanup(int index, enum usb_init_type init)
    {
    	switch (index) {
    	case 0:
    	case 1:
    		ti_usb_phy_uboot_exit(index);
    		dwc3_uboot_exit(index);
    		dwc3_omap_uboot_exit(index);
    		break;
    	default:
    		printf("Invalid Controller Index\n");
    	}
    	disable_usb_clocks(index);
    	return 0;
    }
    
    int usb_gadget_handle_interrupts(int index)
    {
    	u32 status;
    
    	status = dwc3_omap_uboot_interrupt_status(index);
    	if (status)
    		dwc3_uboot_handle_interrupt(index);
    
    	return 0;
    }
    #endif
    
    #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_OS_BOOT)
    
    #define L4_CFG_TARG                  0x4A000000
    
    #define CTRL_MODULE_CORE             (L4_CFG_TARG + 0x2000)
    #define CM_CORE_AON                  (L4_CFG_TARG + 0x5000)
    #define CM_CORE                      (L4_CFG_TARG + 0x8000)
    
    #define CAM_CM_CORE                  (CM_CORE + 0x1000)
    #define DSS_CM_CORE                  (CM_CORE + 0x1100)
    #define CORE_CM_CORE                 (CM_CORE + 0x700)
    #define L4PER_CM_CORE                (CM_CORE + 0x1700)
    #define VPE_CM_CORE_AON              (CM_CORE_AON + 0x760)
    #define IPU_CM_CORE_AON              (CM_CORE_AON + 0x500)
    
    #define CM_L3INSTR_L3_MAIN_2_CLKCTRL (CORE_CM_CORE + 0x728)
    #define CM_DSS_DSS_CLKCTRL           (DSS_CM_CORE + 0x20)
    #define CM_DSS_CLKSTCTRL             (DSS_CM_CORE + 0x00)
    #define CM_VPE_CLKSTCTRL             (VPE_CM_CORE_AON + 0x00)
    #define CM_IPU_CLKSTCTRL             (0x4a005540)
    #define CM_CAM_VIP1_CLKCTRL          (CAM_CM_CORE + 0x20)
    #define CM_CAM_VIP2_CLKCTRL          (CAM_CM_CORE + 0x28)
    #define CM_CAM_VIP3_CLKCTRL          (CAM_CM_CORE + 0x30)
    #define CM_VPE_VPE_CLKCTRL           (VPE_CM_CORE_AON + 0x04)
    
    #define CTRL_CORE_CONTROL_IO_2       (CTRL_MODULE_CORE + 0x558)
    
    #define CM_L4PER_I2C1_CLKCTRL        (L4PER_CM_CORE + 0xA0)
    #define CM_L4PER_I2C2_CLKCTRL        (L4PER_CM_CORE + 0xA8)
    #define CM_IPU_I2C5_CLKCTRL				(0x4A005578)
    
    #define CTRL_CORE_L3_INITIATOR_PRESSURE			(0x4A002454)
    #define CM_EVE3_CLKSTCTRL				(0x4A0056C0)
    #define CM_EVE3_EVE3_CLKCTRL				(0x4A0056E0)
    #define PM_EVE3_PWRSTCTRL				(0x4AE07BC0)
    #define RM_EVE3_RSTCTRL					(0x4AE07BD0)
    #define CM_CAM_CLKSTCTRL				(0x4A009000)
    
    void spl_enable_clocks_for_vsdk(void)
    {
    	uint32_t reg, i;
    
    	/* enable CORE domain transitions */
    	__raw_writel(0x2, CM_DSS_CLKSTCTRL);
    
    	/* enable power domain transitions (sw_wkup mode) */
    	__raw_writel(0x2, CM_VPE_CLKSTCTRL);
    
    	reg = __raw_readl(CM_L3INSTR_L3_MAIN_2_CLKCTRL);
    	__raw_writel((reg & ~0x00000003)|0x1, CM_L3INSTR_L3_MAIN_2_CLKCTRL);
    
    	/* enable DSS */
    	reg = __raw_readl(CTRL_CORE_CONTROL_IO_2);
    	__raw_writel((reg | 0x1), CTRL_CORE_CONTROL_IO_2);
    	reg = __raw_readl(CM_DSS_DSS_CLKCTRL);
    	__raw_writel(((reg & ~0x00000003) | 0x00003F00 | 0x2), CM_DSS_DSS_CLKCTRL);
    
    	/* checking if DSS is enabled */
    	while ((__raw_readl(CM_DSS_DSS_CLKCTRL) & 0x00030000) != 0);
    
    	/* Common for all platforms - VIP1, VPE, I2C1 */
    	reg = __raw_readl(CM_CAM_VIP1_CLKCTRL);
    	__raw_writel((reg & ~0x00000003)|0x1, CM_CAM_VIP1_CLKCTRL);
    	reg = __raw_readl(CM_VPE_VPE_CLKCTRL);
    	__raw_writel((reg & ~0x00000003)|0x1, CM_VPE_VPE_CLKCTRL);
    	reg = __raw_readl(CM_L4PER_I2C1_CLKCTRL);
    	__raw_writel((reg & ~0x00000003)|0x2, CM_L4PER_I2C1_CLKCTRL);
    
    	/* Enable VIP clocks */
    	if (is_dra7xx() || is_dra76x()) {
    
    		reg = __raw_readl(CM_CAM_VIP2_CLKCTRL);
    		__raw_writel((reg & ~0x00000003)|0x1, CM_CAM_VIP2_CLKCTRL);
    
    		if (is_dra7xx()) {
    			reg = __raw_readl(CM_CAM_VIP3_CLKCTRL);
    			__raw_writel((reg & ~0x00000003)|0x1, CM_CAM_VIP3_CLKCTRL);
    		}
    	}
    
    	/* Enable I25 clocks */
    	if (is_dra72x() || is_dra76x()) {
    
    		reg = __raw_readl(CM_IPU_CLKSTCTRL);
    		__raw_writel((reg & ~0x00000003)|0x2, CM_IPU_CLKSTCTRL);
    		reg = __raw_readl(CM_IPU_I2C5_CLKCTRL);
    		__raw_writel((reg & ~0x00000003)|0x2, CM_IPU_I2C5_CLKCTRL);
    		while (((__raw_readl(CM_IPU_CLKSTCTRL) & 0x2000) >> 13) != 1);
    	}
    
    	/* Enable ISS clocks */
    	if (is_dra76x()) {
    
    		/* Register names are reused, they **actually** enable ISS */
    		__raw_writel(0x00600000, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x20600000, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x20600000, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x24600000, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x20600000, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x00600000, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x00600003, CTRL_CORE_L3_INITIATOR_PRESSURE);
    		__raw_writel(0x08600003, CTRL_CORE_L3_INITIATOR_PRESSURE);
    
    		__raw_writel(0x2, CM_EVE3_CLKSTCTRL);
    		for (i = 0; i < 100; i++) {
    			if ((__raw_readl(CM_EVE3_CLKSTCTRL) & 0x100) == 0)
    				break;
    			mdelay(1);
    		}
    		__raw_writel(0x1, CM_EVE3_EVE3_CLKCTRL);
    
    		__raw_writel(0x3, PM_EVE3_PWRSTCTRL);
    		__raw_writel(0x0, RM_EVE3_RSTCTRL);
    		for (i = 0; i < 100; i++) {
    			if ((__raw_readl(CM_EVE3_EVE3_CLKCTRL) & 0x30000) == 0)
    				break;
    			mdelay(1);
    		}
    	}
    
    	/* Enable CAL clocks */
    	if (is_dra72x() || is_dra76x()) {
    
    		__raw_writel(0x2, CM_CAM_CLKSTCTRL);
    		__raw_writel(0x1, CM_CAM_VIP3_CLKCTRL);
    		for (i = 0; i < 100; i++) {
    			if ((__raw_readl(CM_CAM_CLKSTCTRL) & 0x400) == 0)
    				break;
    			mdelay(1);
    		}
    	}
    }
    
    void spl_setup_board_muxes(void)
    {
    	uint8_t data[2];
    
    	if(is_dra72x()) {
    
    		/* Enable LCD power */
    		i2c_set_bus_num(0);
    		i2c_read(0x20, 0, 0, data, 2);
    		data[1] &= ~(1 << 5); /* CON_LCD_PWR_DN */
    		i2c_write(0x20, 0, 0, data, 2);
    
    		/*Select Vin1a betweeen GPMC and vout3*/
    		i2c_set_bus_num(0);
    		i2c_read(0x21, 0, 0, data, 2);
    		data[0] |=  (1 << 0);  /* SEL_GPMC_AD_VID_S0 */
    		data[1] &= ~(1 << 7); /* SEL_GPMC_AD_VID_S2 */
    		i2c_write(0x21,0,0,data,2);
    
    		/*Select ethernet betweeen emac[0] and vin4b */
    		i2c_set_bus_num(0);
    		i2c_read(0x21, 0, 0, data, 2);
    		data[0] |=  (1 << 4);  /* SEL_ENET_MUX_S0 */
    		i2c_write(0x21,0,0,data,2);
    
    		/*Select ethernet between emac[1] and vin2a[10-24]*/
    		i2c_set_bus_num(4);
    		i2c_read(0x26,0,0,data,2);
    		data[0] &= ~(1 << 1); /* EXVIN2_S0 */
    		data[1] &= ~(1 << 2); /* EXVIN2_S2 */
    		i2c_write(0x26,0,0,data,2);
    
    		/*Select vin2a between emac[0], onboard camera and vin2a[0:8] */
    		i2c_set_bus_num(4);
    		i2c_read(0x26,0,0,data,2);
    		data[0] &= ~(1 << 2); /* VIN2_S0 */
    		data[0] |=  (1 << 6); /* VIN2_S2 */
    		i2c_write(0x26,0,0,data,2);
    
    		/*Select vin2b between mmc3 and vin2b */
    		i2c_set_bus_num(4);
    		i2c_read(0x26,0,0,data,2);
    		data[1] &= ~(1 << 3); /* MMC3_SEL */
    		i2c_write(0x26,0,0,data,2);
    	}
    
    	if(is_dra76x()) {
    
    		/* enale vin3a */
    		i2c_set_bus_num(0);
    		i2c_read(0x26,0,0,data,2);
                    data[1] &= ~(1 << 1);   /* EXVIN2_S0 */
    		data[1] |=  (1 << 2 );  /* EXVIN2_S2 */
    		i2c_write(0x26,0,0,data,2);
    
    		/* enale vin2a */
    		i2c_set_bus_num(0);
    		i2c_read(0x26,0,0,data,2);
                    data[0] &= ~(1 << 2); /* VIN2_S0 */
    		data[0] |=  (1 << 6); /* VIN2_S2 */
    		i2c_write(0x26,0,0,data,2);
    	}
    }
    
    int spl_start_uboot(void)
    {
    	/* break into full u-boot on 'c' */
    	if (serial_tstc() && serial_getc() == 'c')
    		return 1;
    
    	if ((get_sysboot_value() & SYSBOOT_TYPE_MASK) == SYSBOOT_TYPE_PROD)
    		return 0;
    
    #ifdef CONFIG_SPL_ENV_SUPPORT
    	env_init();
    	env_relocate_spec();
    	if (getenv_yesno("boot_os") == 1)
    		return 0;
    #endif
    
    	return 1;
    }
    #endif
    
    #ifdef CONFIG_DRIVER_TI_CPSW
    extern u32 *const omap_si_rev;
    
    static void cpsw_control(int enabled)
    {
    	/* VTP can be added here */
    
    	return;
    }
    
    static struct cpsw_slave_data cpsw_slaves[] = {
    	{
    		.slave_reg_ofs	= 0x208,
    		.sliver_reg_ofs	= 0xd80,
    		.phy_addr	= 2,
    	},
    	{
    		.slave_reg_ofs	= 0x308,
    		.sliver_reg_ofs	= 0xdc0,
    		.phy_addr	= 3,
    	},
    };
    
    static struct cpsw_platform_data cpsw_data = {
    	.mdio_base		= CPSW_MDIO_BASE,
    	.cpsw_base		= CPSW_BASE,
    	.mdio_div		= 0xff,
    	.channels		= 8,
    	.cpdma_reg_ofs		= 0x800,
    	.slaves			= 2,
    	.slave_data		= cpsw_slaves,
    	.ale_reg_ofs		= 0xd00,
    	.ale_entries		= 1024,
    	.host_port_reg_ofs	= 0x108,
    	.hw_stats_reg_ofs	= 0x900,
    	.bd_ram_ofs		= 0x2000,
    	.mac_control		= (1 << 5),
    	.control		= cpsw_control,
    	.host_port_num		= 0,
    	.version		= CPSW_CTRL_VERSION_2,
    };
    
    int board_eth_init(bd_t *bis)
    {
    	int ret;
    	uint8_t mac_addr[6];
    	uint32_t mac_hi, mac_lo;
    	uint32_t ctrl_val;
    
    	/* try reading mac address from efuse */
    	mac_lo = readl((*ctrl)->control_core_mac_id_0_lo);
    	mac_hi = readl((*ctrl)->control_core_mac_id_0_hi);
    	mac_addr[0] = (mac_hi & 0xFF0000) >> 16;
    	mac_addr[1] = (mac_hi & 0xFF00) >> 8;
    	mac_addr[2] = mac_hi & 0xFF;
    	mac_addr[3] = (mac_lo & 0xFF0000) >> 16;
    	mac_addr[4] = (mac_lo & 0xFF00) >> 8;
    	mac_addr[5] = mac_lo & 0xFF;
    
    	if (!getenv("ethaddr")) {
    		printf("<ethaddr> not set. Validating first E-fuse MAC\n");
    
    		if (is_valid_ethaddr(mac_addr))
    			eth_setenv_enetaddr("ethaddr", mac_addr);
    	}
    
    	mac_lo = readl((*ctrl)->control_core_mac_id_1_lo);
    	mac_hi = readl((*ctrl)->control_core_mac_id_1_hi);
    	mac_addr[0] = (mac_hi & 0xFF0000) >> 16;
    	mac_addr[1] = (mac_hi & 0xFF00) >> 8;
    	mac_addr[2] = mac_hi & 0xFF;
    	mac_addr[3] = (mac_lo & 0xFF0000) >> 16;
    	mac_addr[4] = (mac_lo & 0xFF00) >> 8;
    	mac_addr[5] = mac_lo & 0xFF;
    
    	if (!getenv("eth1addr")) {
    		if (is_valid_ethaddr(mac_addr))
    			eth_setenv_enetaddr("eth1addr", mac_addr);
    	}
    
    	ctrl_val = readl((*ctrl)->control_core_control_io1) & (~0x33);
    	ctrl_val |= 0x22;
    	writel(ctrl_val, (*ctrl)->control_core_control_io1);
    
    	if (*omap_si_rev == DRA722_ES1_0)
    		cpsw_data.active_slave = 1;
    
    	if (board_is_dra72x_revc_or_later()) {
    		cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RGMII_ID;
    		cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_RGMII_ID;
    	}
    
    	ret = cpsw_register(&cpsw_data);
    	if (ret < 0)
    		printf("Error %d registering CPSW switch\n", ret);
    
    	return ret;
    }
    #endif
    
    #ifdef CONFIG_BOARD_EARLY_INIT_F
    /* VTT regulator enable */
    static inline void vtt_regulator_enable(void)
    {
    	if (omap_hw_init_context() == OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL)
    		return;
    
    	/* Do not enable VTT for DRA722 or DRA76x */
    	if (is_dra72x() || is_dra76x())
    		return;
    
    	/*
    	 * EVM Rev G and later use gpio7_11 for DDR3 termination.
    	 * This is safe enough to do on older revs.
    	 */
    	gpio_request(GPIO_DDR_VTT_EN, "ddr_vtt_en");
    	gpio_direction_output(GPIO_DDR_VTT_EN, 1);
    }
    
    int board_early_init_f(void)
    {
    	vtt_regulator_enable();
    	return 0;
    }
    #endif
    
    #ifdef CONFIG_SPL_LOAD_FIT
    int board_fit_config_name_match(const char *name)
    {
    	if (is_dra72x()) {
    		if (board_is_dra71x_evm()) {
    			if (!strcmp(name, "dra71-evm"))
    				return 0;
    		}else if(board_is_dra72x_revc_or_later()) {
    			if (!strcmp(name, "dra72-evm-revc"))
    				return 0;
    		} else if (!strcmp(name, "dra72-evm")) {
    			return 0;
    		}
    	} else if (is_dra76x() && !strcmp(name, "dra76-evm")) {
    		return 0;
    	} else if (!is_dra72x() && !is_dra76x() && !strcmp(name, "dra7-evm")) {
    		return 0;
    	}
    
    	return -1;
    }
    #endif
    
    #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
    int ft_board_setup(void *blob, bd_t *bd)
    {
    	ft_cpu_setup(blob, bd);
    
    	return 0;
    }
    #endif
    
    #ifdef CONFIG_TI_SECURE_DEVICE
    void board_fit_image_post_process(void **p_image, size_t *p_size)
    {
    	secure_boot_verify_image(p_image, p_size);
    }
    
    void board_tee_image_process(void *tee_image, size_t tee_size)
    {
    	secure_tee_install((u32)tee_image);
    }
    #endif
    7041.LOG.txt

    (010-001-0035) DDR3_V73CBG04168RCJJ11I.pdf

    Here are all the files you've mentioned.

    I think I have already placed my LISA register in the right place.

    Please help me to check,thank you.

    My SDK version is 3.02 and DDR3 type is J11 2*4Gb.

     

  • I put the wrong hw_data.c file.Here is the new one.

    /*
     *
     * HW data initialization for OMAP5
     *
     * (C) Copyright 2013
     * Texas Instruments, <www.ti.com>
     *
     * Sricharan R <r.sricharan@ti.com>
     *
     * SPDX-License-Identifier:	GPL-2.0+
     */
    #include <common.h>
    #include <palmas.h>
    #include <asm/arch/omap.h>
    #include <asm/arch/sys_proto.h>
    #include <asm/omap_common.h>
    #include <asm/arch/clock.h>
    #include <asm/omap_gpio.h>
    #include <asm/io.h>
    #include <asm/emif.h>
    
    struct prcm_regs const **prcm =
    			(struct prcm_regs const **) OMAP_SRAM_SCRATCH_PRCM_PTR;
    struct dplls const **dplls_data =
    			(struct dplls const **) OMAP_SRAM_SCRATCH_DPLLS_PTR;
    struct vcores_data const **omap_vcores =
    		(struct vcores_data const **) OMAP_SRAM_SCRATCH_VCORES_PTR;
    struct omap_sys_ctrl_regs const **ctrl =
    	(struct omap_sys_ctrl_regs const **)OMAP_SRAM_SCRATCH_SYS_CTRL;
    
    /* OPP NOM FREQUENCY for ES1.0 */
    static const struct dpll_params mpu_dpll_params_800mhz[NUM_SYS_CLKS] = {
    	{200, 2, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 12 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 13 MHz   */
    	{1000, 20, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 16.8 MHz */
    	{375, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 19.2 MHz */
    	{400, 12, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{375, 17, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1}	/* 38.4 MHz */
    };
    
    /* OPP NOM FREQUENCY for OMAP5 ES2.0, and DRA7 ES1.0 */
    static const struct dpll_params mpu_dpll_params_1ghz[NUM_SYS_CLKS] = {
    	{250, 2, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 12 MHz   */
    	{500, 9, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 20 MHz   */
    	{119, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 16.8 MHz */
    	{625, 11, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 19.2 MHz */
    	{500, 12, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{625, 23, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 38.4 MHz */
    };
    
    static const struct dpll_params
    			core_dpll_params_2128mhz_ddr532[NUM_SYS_CLKS] = {
    	{266, 2, 2, 5, 8, 4, 62, 5, -1, 5, 7, -1},		/* 12 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 13 MHz   */
    	{443, 6, 2, 5, 8, 4, 62, 5, -1, 5, 7, -1},		/* 16.8 MHz */
    	{277, 4, 2, 5, 8, 4, 62, 5, -1, 5, 7, -1},		/* 19.2 MHz */
    	{368, 8, 2, 5, 8, 4, 62, 5, -1, 5, 7, -1},		/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{277, 9, 2, 5, 8, 4, 62, 5, -1, 5, 7, -1}		/* 38.4 MHz */
    };
    
    static const struct dpll_params
    			core_dpll_params_2128mhz_ddr532_es2[NUM_SYS_CLKS] = {
    	{266, 2, 2, 5, 8, 4, 62, 63, 6, 5, 7, 6},		/* 12 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 13 MHz   */
    	{443, 6, 2, 5, 8, 4, 62, 63, 6, 5, 7, 6},		/* 16.8 MHz */
    	{277, 4, 2, 5, 8, 4, 62, 63, 6, 5, 7, 6},		/* 19.2 MHz */
    	{368, 8, 2, 5, 8, 4, 62, 63, 6, 5, 7, 6},		/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{277, 9, 2, 5, 8, 4, 62, 63, 6, 5, 7, 6}		/* 38.4 MHz */
    };
    
    static const struct dpll_params
    		core_dpll_params_2128mhz_dra7xx[NUM_SYS_CLKS] = {
    	{266, 2, 2, 1, -1, 4, 62, 5, -1, 5, 4, 6},		/* 12 MHz   */
    	{266, 4, 2, 1, -1, 4, 62, 5, -1, 5, 4, 6},		/* 20 MHz   */
    	{443, 6, 2, 1, -1, 4, 62, 5, -1, 5, 4, 6},		/* 16.8 MHz */
    	{277, 4, 2, 1, -1, 4, 62, 5, -1, 5, 4, 6},		/* 19.2 MHz */
    	{368, 8, 2, 1, -1, 4, 62, 5, -1, 5, 4, 6},		/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{277, 9, 2, 1, -1, 4, 62, 5, -1, 5, 4, 6},		/* 38.4 MHz */
    };
    
    static const struct dpll_params per_dpll_params_768mhz[NUM_SYS_CLKS] = {
    	{32, 0, 4, 3, 6, 4, -1, 2, -1, -1, -1, -1},		/* 12 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 13 MHz   */
    	{160, 6, 4, 3, 6, 4, -1, 2, -1, -1, -1, -1},		/* 16.8 MHz */
    	{20, 0, 4, 3, 6, 4, -1, 2, -1, -1, -1, -1},		/* 19.2 MHz */
    	{192, 12, 4, 3, 6, 4, -1, 2, -1, -1, -1, -1},		/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{10, 0, 4, 3, 6, 4, -1, 2, -1, -1, -1, -1}		/* 38.4 MHz */
    };
    
    static const struct dpll_params per_dpll_params_768mhz_es2[NUM_SYS_CLKS] = {
    	{32, 0, 4, 3, 3, 4, -1, 2, -1, -1, -1, -1},		/* 12 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 13 MHz   */
    	{160, 6, 4, 3, 3, 4, -1, 2, -1, -1, -1, -1},		/* 16.8 MHz */
    	{20, 0, 4, 3, 3, 4, -1, 2, -1, -1, -1, -1},		/* 19.2 MHz */
    	{192, 12, 4, 3, 3, 4, -1, 2, -1, -1, -1, -1},		/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{10, 0, 4, 3, 3, 4, -1, 2, -1, -1, -1, -1}		/* 38.4 MHz */
    };
    
    static const struct dpll_params per_dpll_params_768mhz_dra7xx[NUM_SYS_CLKS] = {
    	{32, 0, 4, 1, 3, 4, 4, 2, -1, -1, -1, -1},		/* 12 MHz   */
    	{96, 4, 4, 1, 3, 4, 10, 2, -1, -1, -1, -1},		/* 20 MHz   */
    	{160, 6, 4, 1, 3, 4, 4, 2, -1, -1, -1, -1},		/* 16.8 MHz */
    	{20, 0, 4, 1, 3, 4, 4, 2, -1, -1, -1, -1},		/* 19.2 MHz */
    	{192, 12, 4, 1, 3, 4, 4, 2, -1, -1, -1, -1},		/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{10, 0, 4, 1, 3, 4, 4, 2, -1, -1, -1, -1},		/* 38.4 MHz */
    };
    
    static const struct dpll_params per_dpll_params_768mhz_dra76x[NUM_SYS_CLKS] = {
    	{32, 0, 4, 1, 3, 4, 8, 2, -1, -1, -1, -1},		/* 12 MHz   */
    	{96, 4, 4, 1, 3, 4, 8, 2, -1, -1, -1, -1},		/* 20 MHz   */
    	{160, 6, 4, 1, 3, 4, 8, 2, -1, -1, -1, -1},		/* 16.8 MHz */
    	{20, 0, 4, 1, 3, 4, 8, 2, -1, -1, -1, -1},		/* 19.2 MHz */
    	{192, 12, 4, 1, 3, 4, 8, 2, -1, -1, -1, -1},		/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{10, 0, 4, 1, 3, 4, 8, 2, -1, -1, -1, -1},		/* 38.4 MHz */
    };
    
    static const struct dpll_params iva_dpll_params_2330mhz[NUM_SYS_CLKS] = {
    	{1165, 11, -1, -1, 5, 6, -1, -1, -1, -1, -1, -1},	/* 12 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 13 MHz   */
    	{208, 2, -1, -1, 5, 6, -1, -1, -1, -1, -1, -1},		/* 16.8 MHz */
    	{182, 2, -1, -1, 5, 6, -1, -1, -1, -1, -1, -1},		/* 19.2 MHz */
    	{224, 4, -1, -1, 5, 6, -1, -1, -1, -1, -1, -1},		/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{91, 2, -1, -1, 5, 6, -1, -1, -1, -1, -1, -1}		/* 38.4 MHz */
    };
    
    static const struct dpll_params iva_dpll_params_2330mhz_dra7xx[NUM_SYS_CLKS] = {
    	{1165, 11, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 12 MHz   */
    	{233, 3, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 20 MHz */
    	{208, 2, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 16.8 MHz */
    	{182, 2, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 19.2 MHz */
    	{224, 4, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{91, 2, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 38.4 MHz */
    };
    
    #ifdef CONFIG_SYS_OMAP_ABE_SYSCK
    /* ABE M & N values with sys_clk as source */
    static const struct dpll_params
    		abe_dpll_params_sysclk_196608khz[NUM_SYS_CLKS] = {
    	{49, 5, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 12 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 13 MHz   */
    	{35, 5, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 16.8 MHz */
    	{46, 8, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 19.2 MHz */
    	{34, 8, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{64, 24, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1}		/* 38.4 MHz */
    };
    #endif
    
    #ifndef CONFIG_SYS_OMAP_ABE_SYSCK
    /* ABE M & N values with 32K clock as source */
    static const struct dpll_params abe_dpll_params_32k_196608khz = {
    	750, 0, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1
    };
    #endif
    
    /* ABE M & N values with sysclk2(22.5792 MHz) as input */
    static const struct dpll_params
    		abe_dpll_params_sysclk2_361267khz[NUM_SYS_CLKS] = {
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 12 MHz   */
    	{16, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1},		/* 20 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 16.8 MHz */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 19.2 MHz */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 38.4 MHz */
    };
    
    static const struct dpll_params usb_dpll_params_1920mhz[NUM_SYS_CLKS] = {
    	{400, 4, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 12 MHz   */
    	{480, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 20 MHz   */
    	{400, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 16.8 MHz */
    	{400, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 19.2 MHz */
    	{480, 12, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{400, 15, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 38.4 MHz */
    };
    
    static const struct dpll_params ddr_dpll_params_2664mhz[NUM_SYS_CLKS] = {
    	{111, 0, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 12 MHz   */
    	{200, 4, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 20 MHz   */
    	{555, 6, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 16.8 MHz */
    	{555, 7, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 19.2 MHz */
    	{666, 12, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{555, 15, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 38.4 MHz */
    };
    
    static const struct dpll_params ddr_dpll_params_2128mhz[NUM_SYS_CLKS] = {
    	{266, 2, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 12 MHz   */
    	{266, 4, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 20 MHz   */
    	{190, 2, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 16.8 MHz */
    	{665, 11, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 19.2 MHz */
    	{532, 12, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{665, 23, 2, 1, 8, -1, -1, -1, -1, -1, -1, -1},		/* 38.4 MHz */
    };
    
    static const struct dpll_params gmac_dpll_params_2000mhz[NUM_SYS_CLKS] = {
    	{250, 2, 4, 10, 40, 8, 10, -1, -1, -1, -1, -1},		/* 12 MHz   */
    	{250, 4, 4, 10, 40, 8, 10, -1, -1, -1, -1, -1},		/* 20 MHz   */
    	{119, 1, 4, 10, 40, 8, 10, -1, -1, -1, -1, -1},		/* 16.8 MHz */
    	{625, 11, 4, 10, 40, 8, 10, -1, -1, -1, -1, -1},	/* 19.2 MHz */
    	{500, 12, 4, 10, 40, 8, 10, -1, -1, -1, -1, -1},	/* 26 MHz   */
    	{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},	/* 27 MHz   */
    	{625, 23, 4, 10, 40, 8, 10, -1, -1, -1, -1, -1},	/* 38.4 MHz */
    };
    
    struct dplls omap5_dplls_es1 = {
    	.mpu = mpu_dpll_params_800mhz,
    	.core = core_dpll_params_2128mhz_ddr532,
    	.per = per_dpll_params_768mhz,
    	.iva = iva_dpll_params_2330mhz,
    #ifdef CONFIG_SYS_OMAP_ABE_SYSCK
    	.abe = abe_dpll_params_sysclk_196608khz,
    #else
    	.abe = &abe_dpll_params_32k_196608khz,
    #endif
    	.usb = usb_dpll_params_1920mhz,
    	.ddr = NULL
    };
    
    struct dplls omap5_dplls_es2 = {
    	.mpu = mpu_dpll_params_1ghz,
    	.core = core_dpll_params_2128mhz_ddr532_es2,
    	.per = per_dpll_params_768mhz_es2,
    	.iva = iva_dpll_params_2330mhz,
    #ifdef CONFIG_SYS_OMAP_ABE_SYSCK
    	.abe = abe_dpll_params_sysclk_196608khz,
    #else
    	.abe = &abe_dpll_params_32k_196608khz,
    #endif
    	.usb = usb_dpll_params_1920mhz,
    	.ddr = NULL
    };
    
    struct dplls dra76x_dplls = {
    	.mpu = mpu_dpll_params_1ghz,
    	.core = core_dpll_params_2128mhz_dra7xx,
    	.per = per_dpll_params_768mhz_dra76x,
    	.abe = abe_dpll_params_sysclk2_361267khz,
    	.iva = iva_dpll_params_2330mhz_dra7xx,
    	.usb = usb_dpll_params_1920mhz,
    	.ddr =	ddr_dpll_params_2664mhz,
    	.gmac = gmac_dpll_params_2000mhz,
    };
    
    struct dplls dra7xx_dplls = {
    	.mpu = mpu_dpll_params_1ghz,
    	.core = core_dpll_params_2128mhz_dra7xx,
    	.per = per_dpll_params_768mhz_dra7xx,
    	.abe = abe_dpll_params_sysclk2_361267khz,
    	.iva = iva_dpll_params_2330mhz_dra7xx,
    	.usb = usb_dpll_params_1920mhz,
    	.ddr = ddr_dpll_params_2128mhz,
    	.gmac = gmac_dpll_params_2000mhz,
    };
    
    struct dplls dra72x_dplls = {
    	.mpu = mpu_dpll_params_1ghz,
    	.core = core_dpll_params_2128mhz_dra7xx,
    	.per = per_dpll_params_768mhz_dra7xx,
    	.abe = abe_dpll_params_sysclk2_361267khz,
    	.iva = iva_dpll_params_2330mhz_dra7xx,
    	.usb = usb_dpll_params_1920mhz,
    	.ddr =	ddr_dpll_params_2664mhz,
    	.gmac = gmac_dpll_params_2000mhz,
    };
    
    struct pmic_data palmas = {
    	.base_offset = PALMAS_SMPS_BASE_VOLT_UV,
    	.step = 10000, /* 10 mV represented in uV */
    	/*
    	 * Offset codes 1-6 all give the base voltage in Palmas
    	 * Offset code 0 switches OFF the SMPS
    	 */
    	.start_code = 6,
    	.i2c_slave_addr	= SMPS_I2C_SLAVE_ADDR,
    	.pmic_bus_init	= sri2c_init,
    	.pmic_write	= omap_vc_bypass_send_value,
    	.gpio_en = 0,
    };
    
    /* The TPS659038 and TPS65917 are software-compatible, use common struct */
    struct pmic_data tps659038 = {
    	.base_offset = PALMAS_SMPS_BASE_VOLT_UV,
    	.step = 10000, /* 10 mV represented in uV */
    	/*
    	 * Offset codes 1-6 all give the base voltage in Palmas
    	 * Offset code 0 switches OFF the SMPS
    	 */
    	.start_code = 6,
    	.i2c_slave_addr	= TPS659038_I2C_SLAVE_ADDR,
    	.pmic_bus_init	= gpi2c_init,
    	.pmic_write	= palmas_i2c_write_u8,
    	.gpio_en = 0,
    };
    
    /* The LP87565*/
    struct pmic_data lp87565 = {
    	.base_offset = LP873X_BUCK_BASE_VOLT_UV,
    	.step = 5000, /* 5 mV represented in uV */
    	/*
    	 * Offset codes 0 - 0x13 Invalid.
    	 * Offset codes 0x14 0x17 give 10mV steps
    	 * Offset codes 0x17 through 0x9D give 5mV steps
    	 * So let us start with our operating range from .73V
    	 */
    	.start_code = 0x17,
    	.i2c_slave_addr = 0x60,
    	.pmic_bus_init  = gpi2c_init,
    	.pmic_write     = palmas_i2c_write_u8,
    };
    
    /* The LP8732 and LP8733 are software-compatible, use common struct */
    struct pmic_data lp8733 = {
    	.base_offset = LP873X_BUCK_BASE_VOLT_UV,
    	.step = 5000, /* 5 mV represented in uV */
    	/*
    	 * Offset codes 0 - 0x13 Invalid.
    	 * Offset codes 0x14 0x17 give 10mV steps
    	 * Offset codes 0x17 through 0x9D give 5mV steps
    	 * So let us start with our operating range from .73V
    	 */
    	.start_code = 0x17,
    	.i2c_slave_addr = 0x60,
    	.pmic_bus_init  = gpi2c_init,
    	.pmic_write     = palmas_i2c_write_u8,
    };
    
    struct vcores_data omap5430_volts = {
    	.mpu.value[OPP_NOM] = VDD_MPU,
    	.mpu.addr = SMPS_REG_ADDR_12_MPU,
    	.mpu.pmic = &palmas,
    
    	.core.value[OPP_NOM] = VDD_CORE,
    	.core.addr = SMPS_REG_ADDR_8_CORE,
    	.core.pmic = &palmas,
    
    	.mm.value[OPP_NOM] = VDD_MM,
    	.mm.addr = SMPS_REG_ADDR_45_IVA,
    	.mm.pmic = &palmas,
    };
    
    struct vcores_data omap5430_volts_es2 = {
    	.mpu.value[OPP_NOM] = VDD_MPU_ES2,
    	.mpu.addr = SMPS_REG_ADDR_12_MPU,
    	.mpu.pmic = &palmas,
    	.mpu.abb_tx_done_mask = OMAP_ABB_MPU_TXDONE_MASK,
    
    	.core.value[OPP_NOM] = VDD_CORE_ES2,
    	.core.addr = SMPS_REG_ADDR_8_CORE,
    	.core.pmic = &palmas,
    
    	.mm.value[OPP_NOM] = VDD_MM_ES2,
    	.mm.addr = SMPS_REG_ADDR_45_IVA,
    	.mm.pmic = &palmas,
    	.mm.abb_tx_done_mask = OMAP_ABB_MM_TXDONE_MASK,
    };
    
    /*
     * Enable essential clock domains, modules and
     * do some additional special settings needed
     */
    void enable_basic_clocks(void)
    {
    	u32 const clk_domains_essential[] = {
    		(*prcm)->cm_l4per_clkstctrl,
    		(*prcm)->cm_l3init_clkstctrl,
    		(*prcm)->cm_memif_clkstctrl,
    		(*prcm)->cm_l4cfg_clkstctrl,
    #ifdef CONFIG_DRIVER_TI_CPSW
    		(*prcm)->cm_gmac_clkstctrl,
    #endif
    		0
    	};
    
    	u32 const clk_modules_hw_auto_essential[] = {
    		(*prcm)->cm_l3_gpmc_clkctrl,
    		(*prcm)->cm_memif_emif_1_clkctrl,
    		(*prcm)->cm_memif_emif_2_clkctrl,
    		(*prcm)->cm_l4cfg_l4_cfg_clkctrl,
    		(*prcm)->cm_wkup_gpio1_clkctrl,
    		(*prcm)->cm_l4per_gpio2_clkctrl,
    		(*prcm)->cm_l4per_gpio3_clkctrl,
    		(*prcm)->cm_l4per_gpio4_clkctrl,
    		(*prcm)->cm_l4per_gpio5_clkctrl,
    		(*prcm)->cm_l4per_gpio6_clkctrl,
    		(*prcm)->cm_l4per_gpio7_clkctrl,
    		(*prcm)->cm_l4per_gpio8_clkctrl,
    #ifdef CONFIG_SCSI_AHCI_PLAT
    		(*prcm)->cm_l3init_ocp2scp3_clkctrl,
    #endif
    		0
    	};
    
    	u32 const clk_modules_explicit_en_essential[] = {
    		(*prcm)->cm_wkup_gptimer1_clkctrl,
    		(*prcm)->cm_l3init_hsmmc1_clkctrl,
    		(*prcm)->cm_l3init_hsmmc2_clkctrl,
    		(*prcm)->cm_l4per_gptimer2_clkctrl,
    		(*prcm)->cm_wkup_wdtimer2_clkctrl,
    		(*prcm)->cm_l4per_uart3_clkctrl,
    		(*prcm)->cm_l4per_i2c1_clkctrl,
    #ifdef CONFIG_DRIVER_TI_CPSW
    		(*prcm)->cm_gmac_gmac_clkctrl,
    #endif
    
    #ifdef CONFIG_TI_QSPI
    		(*prcm)->cm_l4per_qspi_clkctrl,
    #endif
    #ifdef CONFIG_SCSI_AHCI_PLAT
    		(*prcm)->cm_l3init_sata_clkctrl,
    #endif
    		0
    	};
    
    	/* Enable optional additional functional clock for GPIO4 */
    	setbits_le32((*prcm)->cm_l4per_gpio4_clkctrl,
    			GPIO4_CLKCTRL_OPTFCLKEN_MASK);
    
    	/* Enable 192 MHz clock for MMC1 & MMC2 */
    	setbits_le32((*prcm)->cm_l3init_hsmmc1_clkctrl,
    			HSMMC_CLKCTRL_CLKSEL_MASK);
    	setbits_le32((*prcm)->cm_l3init_hsmmc2_clkctrl,
    			HSMMC_CLKCTRL_CLKSEL_MASK);
    
    	/* Set the correct clock dividers for mmc */
    	clrbits_le32((*prcm)->cm_l3init_hsmmc1_clkctrl,
    		     HSMMC_CLKCTRL_CLKSEL_DIV_MASK);
    	clrbits_le32((*prcm)->cm_l3init_hsmmc2_clkctrl,
    		     HSMMC_CLKCTRL_CLKSEL_DIV_MASK);
    
    	/* Select 32KHz clock as the source of GPTIMER1 */
    	setbits_le32((*prcm)->cm_wkup_gptimer1_clkctrl,
    			GPTIMER1_CLKCTRL_CLKSEL_MASK);
    
    	do_enable_clocks(clk_domains_essential,
    			 clk_modules_hw_auto_essential,
    			 clk_modules_explicit_en_essential,
    			 1);
    
    #ifdef CONFIG_TI_QSPI
    	setbits_le32((*prcm)->cm_l4per_qspi_clkctrl, (1<<24));
    #endif
    
    #ifdef CONFIG_SCSI_AHCI_PLAT
    	/* Enable optional functional clock for SATA */
    	setbits_le32((*prcm)->cm_l3init_sata_clkctrl,
    		     SATA_CLKCTRL_OPTFCLKEN_MASK);
    #endif
    
    	/* Enable SCRM OPT clocks for PER and CORE dpll */
    	setbits_le32((*prcm)->cm_wkupaon_scrm_clkctrl,
    			OPTFCLKEN_SCRM_PER_MASK);
    	setbits_le32((*prcm)->cm_wkupaon_scrm_clkctrl,
    			OPTFCLKEN_SCRM_CORE_MASK);
    }
    
    void enable_basic_uboot_clocks(void)
    {
    	u32 const clk_domains_essential[] = {
    #if defined(CONFIG_DRA7XX)
    		(*prcm)->cm_ipu_clkstctrl,
    #endif
    		0
    	};
    
    	u32 const clk_modules_hw_auto_essential[] = {
    		(*prcm)->cm_l3init_hsusbtll_clkctrl,
    		0
    	};
    
    	u32 const clk_modules_explicit_en_essential[] = {
    		(*prcm)->cm_l4per_mcspi1_clkctrl,
    		(*prcm)->cm_l4per_i2c2_clkctrl,
    		(*prcm)->cm_l4per_i2c3_clkctrl,
    		(*prcm)->cm_l4per_i2c4_clkctrl,
    #if defined(CONFIG_DRA7XX)
    		(*prcm)->cm_ipu_i2c5_clkctrl,
    #else
    		(*prcm)->cm_l4per_i2c5_clkctrl,
    #endif
    		(*prcm)->cm_l3init_hsusbhost_clkctrl,
    		(*prcm)->cm_l3init_fsusb_clkctrl,
    		0
    	};
    	do_enable_clocks(clk_domains_essential,
    			 clk_modules_hw_auto_essential,
    			 clk_modules_explicit_en_essential,
    			 1);
    }
    
    #ifdef CONFIG_TI_EDMA3
    void enable_edma3_clocks(void)
    {
    	u32 const clk_domains_edma3[] = {
    		0
    	};
    
    	u32 const clk_modules_hw_auto_edma3[] = {
    		(*prcm)->cm_l3main1_tptc1_clkctrl,
    		(*prcm)->cm_l3main1_tptc2_clkctrl,
    		0
    	};
    
    	u32 const clk_modules_explicit_en_edma3[] = {
    		0
    	};
    
    	do_enable_clocks(clk_domains_edma3,
    			 clk_modules_hw_auto_edma3,
    			 clk_modules_explicit_en_edma3,
    			 1);
    }
    
    void disable_edma3_clocks(void)
    {
    	u32 const clk_domains_edma3[] = {
    		0
    	};
    
    	u32 const clk_modules_disable_edma3[] = {
    		(*prcm)->cm_l3main1_tptc1_clkctrl,
    		(*prcm)->cm_l3main1_tptc2_clkctrl,
    		0
    	};
    
    	do_disable_clocks(clk_domains_edma3,
    			  clk_modules_disable_edma3,
    			  1);
    }
    #endif
    
    #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)
    void enable_usb_clocks(int index)
    {
    	u32 cm_l3init_usb_otg_ss_clkctrl = 0;
    
    	if (index == 0) {
    		cm_l3init_usb_otg_ss_clkctrl =
    			(*prcm)->cm_l3init_usb_otg_ss1_clkctrl;
    		/* Enable 960 MHz clock for dwc3 */
    		setbits_le32((*prcm)->cm_l3init_usb_otg_ss1_clkctrl,
    			     OPTFCLKEN_REFCLK960M);
    
    		/* Enable 32 KHz clock for USB_PHY1 */
    		setbits_le32((*prcm)->cm_coreaon_usb_phy1_core_clkctrl,
    			     USBPHY_CORE_CLKCTRL_OPTFCLKEN_CLK32K);
    
    		/* Enable 32 KHz clock for USB_PHY3 */
    		if (is_dra7xx())
    			setbits_le32((*prcm)->cm_coreaon_usb_phy3_core_clkctrl,
    				     USBPHY_CORE_CLKCTRL_OPTFCLKEN_CLK32K);
    	} else if (index == 1) {
    		cm_l3init_usb_otg_ss_clkctrl =
    			(*prcm)->cm_l3init_usb_otg_ss2_clkctrl;
    		/* Enable 960 MHz clock for dwc3 */
    		setbits_le32((*prcm)->cm_l3init_usb_otg_ss2_clkctrl,
    			     OPTFCLKEN_REFCLK960M);
    
    		/* Enable 32 KHz clock for dwc3 */
    		setbits_le32((*prcm)->cm_coreaon_usb_phy2_core_clkctrl,
    			     USBPHY_CORE_CLKCTRL_OPTFCLKEN_CLK32K);
    
    		/* Enable 60 MHz clock for USB2PHY2 */
    		setbits_le32((*prcm)->cm_coreaon_l3init_60m_gfclk_clkctrl,
    			     L3INIT_CLKCTRL_OPTFCLKEN_60M_GFCLK);
    	}
    
    	u32 const clk_domains_usb[] = {
    		0
    	};
    
    	u32 const clk_modules_hw_auto_usb[] = {
    		(*prcm)->cm_l3init_ocp2scp1_clkctrl,
    		cm_l3init_usb_otg_ss_clkctrl,
    		0
    	};
    
    	u32 const clk_modules_explicit_en_usb[] = {
    		0
    	};
    
    	do_enable_clocks(clk_domains_usb,
    			 clk_modules_hw_auto_usb,
    			 clk_modules_explicit_en_usb,
    			 1);
    }
    
    void disable_usb_clocks(int index)
    {
    	u32 cm_l3init_usb_otg_ss_clkctrl = 0;
    
    	if (index == 0) {
    		cm_l3init_usb_otg_ss_clkctrl =
    			(*prcm)->cm_l3init_usb_otg_ss1_clkctrl;
    		/* Disable 960 MHz clock for dwc3 */
    		clrbits_le32((*prcm)->cm_l3init_usb_otg_ss1_clkctrl,
    			     OPTFCLKEN_REFCLK960M);
    
    		/* Disable 32 KHz clock for USB_PHY1 */
    		clrbits_le32((*prcm)->cm_coreaon_usb_phy1_core_clkctrl,
    			     USBPHY_CORE_CLKCTRL_OPTFCLKEN_CLK32K);
    
    		/* Disable 32 KHz clock for USB_PHY3 */
    		if (is_dra7xx())
    			clrbits_le32((*prcm)->cm_coreaon_usb_phy3_core_clkctrl,
    				     USBPHY_CORE_CLKCTRL_OPTFCLKEN_CLK32K);
    	} else if (index == 1) {
    		cm_l3init_usb_otg_ss_clkctrl =
    			(*prcm)->cm_l3init_usb_otg_ss2_clkctrl;
    		/* Disable 960 MHz clock for dwc3 */
    		clrbits_le32((*prcm)->cm_l3init_usb_otg_ss2_clkctrl,
    			     OPTFCLKEN_REFCLK960M);
    
    		/* Disable 32 KHz clock for dwc3 */
    		clrbits_le32((*prcm)->cm_coreaon_usb_phy2_core_clkctrl,
    			     USBPHY_CORE_CLKCTRL_OPTFCLKEN_CLK32K);
    
    		/* Disable 60 MHz clock for USB2PHY2 */
    		clrbits_le32((*prcm)->cm_coreaon_l3init_60m_gfclk_clkctrl,
    			     L3INIT_CLKCTRL_OPTFCLKEN_60M_GFCLK);
    	}
    
    	u32 const clk_domains_usb[] = {
    		0
    	};
    
    	u32 const clk_modules_disable[] = {
    		(*prcm)->cm_l3init_ocp2scp1_clkctrl,
    		cm_l3init_usb_otg_ss_clkctrl,
    		0
    	};
    
    	do_disable_clocks(clk_domains_usb,
    			  clk_modules_disable,
    			  1);
    }
    #endif
    
    const struct ctrl_ioregs ioregs_omap5430 = {
    	.ctrl_ddrch = DDR_IO_I_34OHM_SR_FASTEST_WD_DQ_NO_PULL_DQS_PULL_DOWN,
    	.ctrl_lpddr2ch = DDR_IO_I_34OHM_SR_FASTEST_WD_CK_CKE_NCS_CA_PULL_DOWN,
    	.ctrl_ddrio_0 = DDR_IO_0_DDR2_DQ_INT_EN_ALL_DDR3_CA_DIS_ALL,
    	.ctrl_ddrio_1 = DDR_IO_1_DQ_OUT_EN_ALL_DQ_INT_EN_ALL,
    	.ctrl_ddrio_2 = DDR_IO_2_CA_OUT_EN_ALL_CA_INT_EN_ALL,
    };
    
    const struct ctrl_ioregs ioregs_omap5432_es1 = {
    	.ctrl_ddrch = DDR_IO_I_40OHM_SR_FAST_WD_DQ_NO_PULL_DQS_NO_PULL,
    	.ctrl_lpddr2ch = 0x0,
    	.ctrl_ddr3ch = DDR_IO_I_40OHM_SR_SLOWEST_WD_DQ_NO_PULL_DQS_NO_PULL,
    	.ctrl_ddrio_0 = DDR_IO_0_VREF_CELLS_DDR3_VALUE,
    	.ctrl_ddrio_1 = DDR_IO_1_VREF_CELLS_DDR3_VALUE,
    	.ctrl_ddrio_2 = DDR_IO_2_VREF_CELLS_DDR3_VALUE,
    	.ctrl_emif_sdram_config_ext = SDRAM_CONFIG_EXT_RD_LVL_11_SAMPLES,
    	.ctrl_emif_sdram_config_ext_final = SDRAM_CONFIG_EXT_RD_LVL_4_SAMPLES,
    };
    
    const struct ctrl_ioregs ioregs_omap5432_es2 = {
    	.ctrl_ddrch = DDR_IO_I_40OHM_SR_FAST_WD_DQ_NO_PULL_DQS_NO_PULL_ES2,
    	.ctrl_lpddr2ch = 0x0,
    	.ctrl_ddr3ch = DDR_IO_I_40OHM_SR_SLOWEST_WD_DQ_NO_PULL_DQS_NO_PULL_ES2,
    	.ctrl_ddrio_0 = DDR_IO_0_VREF_CELLS_DDR3_VALUE_ES2,
    	.ctrl_ddrio_1 = DDR_IO_1_VREF_CELLS_DDR3_VALUE_ES2,
    	.ctrl_ddrio_2 = DDR_IO_2_VREF_CELLS_DDR3_VALUE_ES2,
    	.ctrl_emif_sdram_config_ext = SDRAM_CONFIG_EXT_RD_LVL_11_SAMPLES,
    	.ctrl_emif_sdram_config_ext_final = SDRAM_CONFIG_EXT_RD_LVL_4_SAMPLES,
    };
    
    const struct ctrl_ioregs ioregs_dra7xx_es1 = {
    	.ctrl_ddrch = 0x40404040,
    	.ctrl_lpddr2ch = 0x40404040,
    	.ctrl_ddr3ch = 0x80808080,
    	.ctrl_ddrio_0 = 0x00094A40,
    	.ctrl_ddrio_1 = 0x04A52000,
    	.ctrl_ddrio_2 = 0x84210000,
    	.ctrl_emif_sdram_config_ext = 0x0001C1A7,
    	.ctrl_emif_sdram_config_ext_final = 0x0001C1A7,
    	.ctrl_ddr_ctrl_ext_0 = 0xA2000000,
    };
    
    const struct ctrl_ioregs ioregs_dra72x_es1 = {
    	.ctrl_ddrch = 0x40404040,
    	.ctrl_lpddr2ch = 0x40404040,
    	.ctrl_ddr3ch = 0x60606080,
    	.ctrl_ddrio_0 = 0x00094A40,
    	.ctrl_ddrio_1 = 0x04A52000,
    	.ctrl_ddrio_2 = 0x84210000,
    	.ctrl_emif_sdram_config_ext = 0x0001C1A7,
    	.ctrl_emif_sdram_config_ext_final = 0x0001C1A7,
    	.ctrl_ddr_ctrl_ext_0 = 0xA2000000,
    };
    
    const struct ctrl_ioregs ioregs_dra72x_es2 = {
    	.ctrl_ddrch = 0x40404040,
    	.ctrl_lpddr2ch = 0x40404040,
    	.ctrl_ddr3ch = 0x60606060,
    	.ctrl_ddrio_0 = 0x00094A40,
    	.ctrl_ddrio_1 = 0x00000000,
    	.ctrl_ddrio_2 = 0x00000000,
    	.ctrl_emif_sdram_config_ext = 0x0001C1A7,
    	.ctrl_emif_sdram_config_ext_final = 0x0001C1A7,
    	.ctrl_ddr_ctrl_ext_0 = 0xA2000000,
    };
    
    const struct ctrl_ioregs TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_ctrl_ioregs = {
    .ctrl_ddrch = 0x40404040,
    .ctrl_lpddr2ch = 0x40404040, 
    .ctrl_ddr3ch = 0x40404040, 
    .ctrl_ddrio_0 = 0x00094A40, 
    .ctrl_ddrio_1 = 0x00000000, 
    .ctrl_ddrio_2 = 0x84210000, 
    .ctrl_emif_sdram_config_ext = 0x0000C123,
    .ctrl_emif_sdram_config_ext_final = 0x0001C1A7,
    .ctrl_ddr_ctrl_ext_0 = 0xA2000000, 
    };
    
    void __weak hw_data_init(void)
    {
    	u32 omap_rev = omap_revision();
    
    	switch (omap_rev) {
    
    	case OMAP5430_ES1_0:
    	case OMAP5432_ES1_0:
    	*prcm = &omap5_es1_prcm;
    	*dplls_data = &omap5_dplls_es1;
    	*omap_vcores = &omap5430_volts;
    	*ctrl = &omap5_ctrl;
    	break;
    
    	case OMAP5430_ES2_0:
    	case OMAP5432_ES2_0:
    	*prcm = &omap5_es2_prcm;
    	*dplls_data = &omap5_dplls_es2;
    	*omap_vcores = &omap5430_volts_es2;
    	*ctrl = &omap5_ctrl;
    	break;
    
    	case DRA762_ES1_0:
    	*prcm = &dra7xx_prcm;
    	*dplls_data = &dra76x_dplls;
    	*ctrl = &dra7xx_ctrl;
    	break;
    
    	case DRA752_ES1_0:
    	case DRA752_ES1_1:
    	case DRA752_ES2_0:
    	*prcm = &dra7xx_prcm;
    	*dplls_data = &dra7xx_dplls;
    	*ctrl = &dra7xx_ctrl;
    	break;
    
    	case DRA722_ES1_0:
    	case DRA722_ES2_0:
    	case DRA722_ES2_1:
    	*prcm = &dra7xx_prcm;
    	*dplls_data = &dra72x_dplls;
    	*ctrl = &dra7xx_ctrl;
    	break;
    
    	default:
    		printf("\n INVALID OMAP REVISION ");
    	}
    }
    
    void get_ioregs(const struct ctrl_ioregs **regs)
    {
    	u32 omap_rev = omap_revision();
    
    	switch (omap_rev) {
    	case OMAP5430_ES1_0:
    	case OMAP5430_ES2_0:
    		*regs = &ioregs_omap5430;
    		break;
    	case OMAP5432_ES1_0:
    		*regs = &ioregs_omap5432_es1;
    		break;
    	case OMAP5432_ES2_0:
    		*regs = &ioregs_omap5432_es2;
    		break;
    	case DRA752_ES1_0:
    	case DRA752_ES1_1:
    	case DRA752_ES2_0:
    	case DRA762_ES1_0:
    		*regs = &ioregs_dra7xx_es1;
    		break;
    	case DRA722_ES1_0:
    		*regs = &ioregs_dra72x_es1;
    		break;
    	case DRA722_ES2_0:
    	case DRA722_ES2_1:
    		*regs = &ioregs_dra72x_es2;
    		break;
    
    	default:
    		printf("\n INVALID OMAP REVISION ");
    	}
    	*regs = &TDA2Ex_DDR3L_666MHz_TI_EVM_revG3_ctrl_ioregs;//new
    }

  • Former Member
    0 Former Member in reply to Denny Zhuang

    Hi.
    How did you generate the EMIF configuration register values? Did you use the EMIF configuration tool, mentioned in the appnote? If not, please make use the EMIF configuration tool to generate the register values.

    If you are able to boot to the kernel prompt, I would also suggest running "memtester"?

    Regards,
    Somnath

  • Former Member
    0 Former Member in reply to Former Member
    Hi,
    Can you please get back on this issue and let us know if you need any further help?

    Regards,
    Somnath
  • Former Member
    0 Former Member in reply to Former Member
    Hi,
    Can you please get back on this issue and let us know if you need any further help?

    Regards,
    Somnath