Uboot Redirect to IRAM on MX6DL

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Uboot Redirect to IRAM on MX6DL

Jump to solution
7,266 Views
tony_l_cai
Contributor III

Hi, all

       I want to redirect the uboot to IRAM. The uboot has cut the size so small that it can be put into IRAM completely(IRAM is 128k, and uboot.imx is 119k). But when I change the  CONFIG_SYS_TEXT_BASE to 0x90 0000(the IRAM base addr). the system cannot work(no log output). So how to modify to redirect? Thank you ~

Labels (3)
1 Solution
5,553 Views
BiyongSUN
NXP Employee
NXP Employee

Tony,

I provided the way, you don't need to cut the uboot or any changes.

Just use the uboot running in the DDR then load the standalone uboot standalone application(for your is mtest) to the iram @0x900700.

mtest should do the write to the DDR, where is your uboot running. when you write the location of the uboot. the uboot is destroyed.

But the standalone application is still running in the iram.

Suggest you can try the example hello_world first.

That is alternative way as I mentioned for the further test. 

If you can fit the uboot in the iram. It is ok. but look, you are facing lots of problem now.

View solution in original post

32 Replies
1,486 Views
BiyongSUN
NXP Employee
NXP Employee

If you have done the calibration and uboot can run.

just for the further test by mtest.

you can try the uboot standalone mechanism.

That is the common technology for uboot.

The location is u-boot/examples/standalone

CONFIG_STANDALONE_LOAD_ADDR is for load address.

The default example/build is the hello world.

you can simply use the build command:

CONFIG_STANDALONE_LOAD_ADDR=0x900700 make

you will find the change by using readelf

suggest if you want to test the whole DDR, implement the "printf" inside the mtest.

Cause the test will destroy the uboot itself, which has some stubs and function calling.

Or you can carefully load the uboot at the beginning of the DDR or end of the DDR.

But you can skip that part of the DDR, just the small size of the uboot.

0 Kudos
Reply
1,486 Views
tony_l_cai
Contributor III

Thank you very much, Sun

I think your guide is imperative and very useful for me.

"

suggest if you want to test the whole DDR, implement the "printf" inside the mtest.

Cause the test will destroy the uboot itself, which has some stubs and function calling.

"

If I load the uboot in IRAM, and test DDR,why will destroy the uboot itself?

And my primary  idea is that uboot is loaded in IRAM, then test the whole DDR, this method is from IMX ddr stress tool.

And now my uboot has been cut to 79k,so it can be loaded in MX6DL IRAM(128k) completely.

0 Kudos
Reply
5,554 Views
BiyongSUN
NXP Employee
NXP Employee

Tony,

I provided the way, you don't need to cut the uboot or any changes.

Just use the uboot running in the DDR then load the standalone uboot standalone application(for your is mtest) to the iram @0x900700.

mtest should do the write to the DDR, where is your uboot running. when you write the location of the uboot. the uboot is destroyed.

But the standalone application is still running in the iram.

Suggest you can try the example hello_world first.

That is alternative way as I mentioned for the further test. 

If you can fit the uboot in the iram. It is ok. but look, you are facing lots of problem now.

1,486 Views
tony_l_cai
Contributor III

Sun,

       I think your method is a better way, and later I will try it,but could you help me to finish the my way,because this way is in process?now I have cut the uboot to 79K, MX6DL IRAM is 128K, the CONFIG_SYS_TEXT_BASE   is 0x907000(0x908000 is also tried failed),so what's wrong? How to solve it? And the uboot can work in ddr.

0 Kudos
Reply
1,486 Views
BiyongSUN
NXP Employee
NXP Employee

You need to check some definition in the head file.

The .text should not lower than the load address.

And please make sure only leave uart and its pad settings.

remove all the other pad settings.

#define CONFIG_LOADADDR 0x00907000

#define CONFIG_SYS_TEXT_BASE 0x00908000

#define CONFIG_NR_DRAM_BANKS  1

#define PHYS_SDRAM   0x908000

#define PHYS_SDRAM_SIZE   SZ_128K

also please make sure the uboot is not bigger than the size for OCRAM Free Area(68K)

Untitled.png

1,486 Views
tony_l_cai
Contributor III

Hi Sun,

       I have test the DDR by mtest(mem_test_alt), our DDR is 1GB,sou the addr is 0x1000 0000 - 0x3fff ffff, and the test is similar to the uboot load in DDR, I load uboot in IRAM,but still can not test the whole DDR,why?Could you help me ~

0 Kudos
Reply
1,486 Views
BiyongSUN
NXP Employee
NXP Employee

So far, the information from you is not enough, such as type of DDR. DDR3 or LPDDR2.

The memory address space depends on the hardware design.

DDR stress test reads from the script and configure that. the script is generated by aid. you don't need to worry about that.

But in the uboot, you need to change the code for that.

Untitled.png

Chapter 44

Multi Mode DDR Controller (MMDC)

44.4.4 MMDC Address Space
44.4.4.1 Address decoding

MDASP[CS0_END]

Untitled.png

BTW, commonly, the mtest is not stronger that the patterns in the DDR stress test.

If wants to give DDR more pressue, you need to run the linux then occupy all the cpu bandwidth, run gpu and vpu together.

That way, you may see whether like ripple is there to influence the performance. 

0 Kudos
Reply
1,486 Views
tony_l_cai
Contributor III

Hi, sun

Your guide makes my board work in IRAM. Thank you very much~~

Then I will try your another guide ~

0 Kudos
Reply
1,486 Views
tony_l_cai
Contributor III

Sun,thank you for your professional help, I'm "facing lots of problem now".

I will check your guide one by one, and could I contact with you by phone? If convenience, pls mail your number to me. thank you~

Cause I find some questions in your guide,I am a novince. Thank you~

0 Kudos
Reply
1,486 Views
igorpadykov
NXP Employee
NXP Employee

could you also try 0x00909000 ?

~igor

0 Kudos
Reply
1,486 Views
igorpadykov
NXP Employee
NXP Employee

if you have working option with ddr, one can easily debug it

running two boards (iRAM and ddr) and dump memory with jtag.

Best regards

igor

0 Kudos
Reply
1,486 Views
tony_l_cai
Contributor III

Thank you igor

And I have cut lot for uboot.bin, the follow is building log,But I think ,if the start addr is 0x900700, I still need to cut the uboot.imx, which part can I cut referring to the building log: Thank you ~

  CLEAN   tools

  CLEAN   u-boot.lds include/autoconf.mk include/autoconf.mk.dep

  CLEAN   u-boot u-boot.bin u-boot.imx u-boot.map u-boot.srec System.map

  CLEAN   scripts/basic

  CLEAN   include/config include/generated

  CLEAN   include/config.h include/config.mk

Configuring for mx6dlsabresdandroid - Board: mx6sabresd, Options: IMX_CONFIG=board/freescale/mx6sabresd/EM70_DDR.cfg,MX6DL,DEFAULT_FDT_FILE="imx6dl-sabresd.dtb",DDR_MB=1024

  GEN     include/autoconf.mk.dep

  GEN     include/autoconf.mk

  CHK     include/config/uboot.release

  UPD     include/config/uboot.release

  CHK     include/generated/version_autogenerated.h

  UPD     include/generated/version_autogenerated.h

  CHK     include/generated/timestamp_autogenerated.h

  UPD     include/generated/timestamp_autogenerated.h

  HOSTCC  scripts/basic/fixdep

  CC      lib/asm-offsets.s

  GEN     include/generated/generic-asm-offsets.h

  CC      arch/arm/lib/asm-offsets.s

  GEN     include/generated/asm-offsets.h

  HOSTCC  tools/gen_eth_addr

  HOSTCC  tools/img2srec

  HOSTCC  tools/aisimage.o

  HOSTCC  tools/crc32.o

  HOSTCC  tools/default_image.o

  HOSTCC  tools/dumpimage.o

  HOSTCC  tools/fdt.o

  HOSTCC  tools/fdt_ro.o

  HOSTCC  tools/fdt_rw.o

  HOSTCC  tools/fdt_strerror.o

  HOSTCC  tools/fdt_wip.o

  HOSTCC  tools/fit_image.o

  HOSTCC  tools/image-fit.o

  HOSTCC  tools/image-host.o

  HOSTCC  tools/image.o

  HOSTCC  tools/imagetool.o

  HOSTCC  tools/imximage.o

  HOSTCC  tools/kwbimage.o

  HOSTCC  tools/md5.o

  HOSTCC  tools/mkenvimage.o

  HOSTCC  tools/mkimage.o

  HOSTCC  tools/mxsimage.o

  HOSTCC  tools/omapimage.o

  HOSTCC  tools/os_support.o

  HOSTCC  tools/pblimage.o

  HOSTCC  tools/sha1.o

  HOSTCC  tools/ublimage.o

  HOSTLD  tools/mkenvimage

  HOSTLD  tools/dumpimage

  HOSTLD  tools/mkimage

  HOSTCC  tools/proftool

  LD      arch/arm/cpu/built-in.o

  CC      arch/arm/cpu/armv7/cache_v7.o

  CC      arch/arm/cpu/armv7/cpu.o

  CC      arch/arm/cpu/armv7/syslib.o

  AS      arch/arm/cpu/armv7/lowlevel_init.o

  LD      arch/arm/cpu/armv7/built-in.o

  AS      arch/arm/cpu/armv7/start.o

  CC      arch/arm/cpu/armv7/mx6/soc.o

  CC      arch/arm/cpu/armv7/mx6/clock.o

  LD      arch/arm/cpu/armv7/mx6/built-in.o

  CC      arch/arm/imx-common/iomux-v3.o

  CC      arch/arm/imx-common/timer.o

  CC      arch/arm/imx-common/cpu.o

  CC      arch/arm/imx-common/speed.o

  CC      arch/arm/imx-common/misc.o

  LD      arch/arm/imx-common/built-in.o

  AS      arch/arm/lib/crt0.o

  AS      arch/arm/lib/relocate.o

  CC      arch/arm/lib/bootm.o

  CC      arch/arm/lib/cache-pl310.o

  CC      arch/arm/lib/sections.o

  CC      arch/arm/lib/interrupts.o

  CC      arch/arm/lib/reset.o

  CC      arch/arm/lib/cache.o

  CC      arch/arm/lib/cache-cp15.o

  LD      arch/arm/lib/built-in.o

  AR      arch/arm/lib/lib.a

  CC      arch/arm/lib/eabi_compat.o

  LD      board/freescale/common/built-in.o

  CC      board/freescale/mx6sabresd/mx6sabresd_em70_L.o

board/freescale/mx6sabresd/mx6sabresd_em70_L.c: In function 'board_late_init':

board/freescale/mx6sabresd/mx6sabresd_em70_L.c:1173:6: warning: unused variable 'ret' [-Wunused-variable]

  LD      board/freescale/mx6sabresd/built-in.o

  CC      common/main.o

  CC      common/command.o

  CC      common/exports.o

  CC      common/hash.o

  CC      common/s_record.o

  CC      common/xyzModem.o

  CC      common/board_f.o

  CC      common/board_r.o

  CC      common/cmd_boot.o

  CC      common/cmd_bootm.o

  CC      common/cmd_help.o

  CC      common/env_attr.o

  CC      common/env_callback.o

  CC      common/env_flags.o

  CC      common/env_mmc.o

  CC      common/cmd_source.o

  CC      common/cmd_console.o

  CC      common/cmd_echo.o

  CC      common/cmd_flash.o

  CC      common/cmd_itest.o

  CC      common/cmd_load.o

  CC      common/cmd_mem.o

  CC      common/cmd_mmc.o

  CC      common/cmd_ximg.o

  CC      common/flash.o

  CC      common/cmd_nvedit.o

  CC      common/env_common.o

  CC      common/bouncebuf.o

  CC      common/console.o

  CC      common/dlmalloc.o

  CC      common/image.o

  CC      common/memsize.o

  CC      common/stdio.o

  LD      common/built-in.o

  CC      disk/part.o

  CC      disk/part_dos.o

  LD      disk/built-in.o

  CC      drivers/watchdog/imx_watchdog.o

  LD      drivers/watchdog/built-in.o

  LD      drivers/built-in.o

  LD      drivers/dma/built-in.o

  CC      drivers/gpio/mxc_gpio.o

  LD      drivers/gpio/built-in.o

  CC      drivers/input/input.o

  LD      drivers/input/built-in.o

  CC      drivers/mmc/fsl_esdhc.o

  CC      drivers/mmc/mmc.o

  CC      drivers/mmc/mmc_write.o

  LD      drivers/mmc/built-in.o

  LD      drivers/mtd/built-in.o

  LD      drivers/mtd/onenand/built-in.o

  LD      drivers/mtd/spi/built-in.o

  LD      drivers/pci/built-in.o

  CC      drivers/serial/serial.o

  CC      drivers/serial/serial_mxc.o

  LD      drivers/serial/built-in.o

  CC      drivers/spi/spi.o

  LD      drivers/spi/built-in.o

  CC      lib/zlib/zlib.o

  LD      lib/zlib/built-in.o

  CC      lib/crc16.o

  CC      lib/gunzip.o

  CC      lib/initcall.o

  CC      lib/lmb.o

  CC      lib/ldiv.o

  CC      lib/qsort.o

  CC      lib/strmhz.o

  CC      lib/hashtable.o

  CC      lib/errno.o

  CC      lib/display_options.o

  CC      lib/crc32.o

  CC      lib/ctype.o

  CC      lib/div64.o

  CC      lib/hang.o

  CC      lib/linux_string.o

  CC      lib/string.o

  CC      lib/time.o

  CC      lib/vsprintf.o

  LD      lib/built-in.o

  LDS     u-boot.lds

  LD      u-boot

  OBJCOPY u-boot.bin

  CFGS    board/freescale/mx6sabresd/EM70_DDR.cfg.cfgtmp

  MKIMAGE u-boot.imx

  OBJCOPY u-boot.srec

0 Kudos
Reply