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.

Adding a ti814x u-boot target which runs entirely from internal memory

Hello,

I am working with DM8148 evm and one of our requirements for the 1st stage boot-loader is the ability to run from OCMC RAM in order to ease debugging of DDR issues. I see commit 536fa0571b49372e350365b9483a61a99adae6c2 (from <http://arago-project.org/git/projects/u-boot-omap3.git>, full header pasted below) that the same functionality is available for TI816x. Looking at commits affecting Makefile I think something similar has been available for TI8148 at some point but was later removed, see commits e76867f02d51389b49211dbb845a2025fbf3952b and 895f7d5433d5a718a7867bb523e8f654c5712b2b where CONFIG_TI814X_STACK was respectively first introduced and later removed.

Is there a technical reason for not supporting the same feature on TI814X? If no, are there any plans to add support for it? and finally: if I wanted to implement it, would it be sufficient to add space for stack and heap in front of the image, define CONFIG_SKIP_RELOCATE_UBOOT and set TEXT_BASE to something like OCMC_BASE+STACK_SIZE+HEAP_SIZE?

Thank you in advance for you help.

Kind Regards
--
Delio Brignoli
Audioscience Inc

commit 536fa0571b49372e350365b9483a61a99adae6c2
Author: Vaibhav Bedia <vaibhav.bedia@ti.com>
Date:   Mon Oct 4 01:02:14 2010 +0530

   ti816x: Add target which runs out of internal memory

   Having a minimal build which runs out of internal memory
   is useful in debugging DDR related issues of EVMs.

   This patch adds a new target name "ti8168_evm_min_ocmc"
   which serves this purpose.

   Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>

---------------------------------------------------------------------------------------------

commit 895f7d5433d5a718a7867bb523e8f654c5712b2b
Author: Vaibhav Bedia <vaibhav.bedia@ti.com>
Date:   Wed Jun 29 15:28:54 2011 +0530

   tiimage: Remove padding for ti814x

   First stage of TI814x had a padding of 12K to accomodate the stack
   when running out of internal memory.

   With relocation to RAM this is no longer needed.

   Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>

--------------------------------------------------------------------------------------------

commit 536fa0571b49372e350365b9483a61a99adae6c2
Author: Vaibhav Bedia <vaibhav.bedia@ti.com>
Date:   Mon Oct 4 01:02:14 2010 +0530

   ti816x: Add target which runs out of internal memory

   Having a minimal build which runs out of internal memory
   is useful in debugging DDR related issues of EVMs.

   This patch adds a new target name "ti8168_evm_min_ocmc"
   which serves this purpose.

   Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>

  • Hello,

    Delio Brignoli said:
    Is there a technical reason for not supporting the same feature on TI814X?

    As you rightly pointed out, Initial versions of 1st stage of U-Boot for TI8148 did run out of internal RAM. However, when adding SD boot support we realized that the buffers that the driver uses does not fit into the internal memory. So the first stage will most probably boot but it won't be able to load the second stage from SD card. Same is the case with EMAC boot. Due to this reason we decided to relocate the 1st stage to DDR.

    You could try tinkering with buffer sizes in the SD/EMAC drivers to see if that works for you. if its just for debugging memory issues (which hopefully would be rare :), you also add a minimal configuration which runs completely out of OCMC similar to TI8168 and use it as a fallback option.

    Delio Brignoli said:
    if I wanted to implement it, would it be sufficient to add space for stack and heap in front of the image, define CONFIG_SKIP_RELOCATE_UBOOT and set TEXT_BASE to something like OCMC_BASE+STACK_SIZE+HEAP_SIZE?

    Yes, this is how it was implemented earlier. You could also try reverting the commits which removed the support for running the 1st stage out of internal memory.

    Regards,

    Vaibhav

  • Thank you for you answer Vaibhav,

    The issue with SD/EMAC buffers is unfortunate: I was also hoping to also to simplify boot and shorten boot times by not having a 2nd stage U-Boot. I am not familiar with those drivers' code so I will need to read up a bit before I can tackle this. Do you recall approximately by how much the memory footprint would have exceeded the memory budget?

    Kind Regards

    --

    Delio

  • It's been some time since i last worked on this so don't recall what the size was. Here's what you could do

    • Check out a branch previous to the commit which removed this feature
    • Build 1st stage U-Boot
    • Use readelf to look at the bss section of the image.

    Delio Brignoli said:
    I was also hoping to also to simplify boot and shorten boot times by not having a 2nd stage U-Boot.

    Hope you have looked at the quickboot section in the latest user-guides http://processors.wiki.ti.com/index.php/DM81XX_Quick_Boot_Measurements.With a few tweaks you get ~7secs to the linux prompt.

    Regards,

    Vaibhav

  • Yes, I did look at the "quick boot" page, still I was hoping to cut down time further. Thank you for the advice about inspecting the bootloader's image.

     

    Kind Regards

    --

    Delio

  • Delio,

    What is the boot time that you are targetting? We've developed single stage bootloader on DM8148 before. 

    We've done boot time optimization on different TI platforms and has achieved very good boot time numbers as good as 2.6 secs on Linux. We could boot linux kernel with boot loader and mount the file system in about 700ms on DM36x. 

    -Renjith

    www.pathpartnertech.com

  • Hello,

    We have a problem with the ti8168_evm_min_ocmc.

    It seems the u-boot get stuck and we haven't any response from UART.

    Is it way to resolve this issue ?

    BTW (with ti8168_config - everything OK)

    Thanks a lot for any help