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.

AM1808 reset lockup issue at 96MHz OPP

Other Parts Discussed in Thread: AM1808, OMAP-L138, AM1810, TPS65070

We are facing a reset problem on our custom AM1808 board designed using an AM1808 EVM as reference.
We are using UBL code shipped with ti-sdk-am180x-evm-05.02.00.00  SDK which sets ARM and DDR clocks to 456MHz and 150MHz respectively.
Cpuidle and Cpufreq are enabled and we are using the userspace governor.


Here comes the problem: if we set the operating frequency to 96MHz we are unable to reset the board, neither via console reboot command
nor via hardware reset (!).
It seems that the device resets but then remains stuck somewhere in the boot process in ROM or UBL because nothing is displayed
on the console.

If we substitute the UBL with an old version (dumped from the EVM spi flash) which sets the initial ARM clock to 300MHz there is no problem resetting
the board even at 96MHz.

We think this is what happens:

- On first boot the PMIC starts with a default core voltage of 1.2V with is enough for the core to bootstrap at 456MHz
- UBL boots U-UBOOT which boots the kernel, everything ok.
- Then we set the operating frequency to 96MHz (echo 96000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed) and the governor
then instructs the PMIC to lower the core voltage to 1.0V
- We issue a reset (via reboot command or hardware button reset)
- The ARM resets BUT the PMIC is still suppling 1.0V to the core
- Part of the UBL code wich sets the ARM clock to 456MHz is executed ...but the ARM core is unable to start operation at 456MHz with that voltage and the boot got stuck somewhere (Maybe PLL is not able to get a lock?)


The following points seems to back the above explanation of the problem:

- When we use an UBL code which sets the initial clock at 300Mhz the board is able to reset without problems even at 96MHz
We guess that at 300MHz 1.0 volts are sufficient for the ARM to bootstrap.

- We patched the 96MHz opp in da850.c to fix the PMIC voltage to 1.2 volt:
static const struct da850_opp da850_opp_96 = {
    .freq        = 96000,
    .prediv        = 1,
    .mult        = 20,
    .postdiv    = 5,
    //.cvdd_min    = 1000000,
    //.cvdd_max    = 1050000,
    .cvdd_min    = 1200000,    // <------
    .cvdd_max    = 1200000,    // <------
};
and as expected with this 'fix' we were are able to reset.


Questions:

1. Can you confirm that this is an expected behavior and that the correct solution is to
rebuild UBL with a different operating point with a lower ARM clock ?

2. Regarding question 1, we tried to change the UBL operating point as described here:
http://processors.wiki.ti.com/index.php/OMAPL1:_Changing_the_Operating_Point
but in our 'include/device.h' file there are no #define DEVICE_OPP_* macros as stated in the wiki page.
So instead we patched the function 'DEVICE_init()' in the file 'ti-sdk-am180x-evm-05.02.00.00/host-tools/flash_utils/OMAP-L138_FlashAndBootUtils_2_31/OMAP-L138/Common/src/device.c' this way:

Uint32 DEVICE_init()
{
  ....
  ....
  ....
  // System PLL Setup
  if (status == E_PASS)
  {
  #if defined(AM1808)
    // CPU(s) at 456 MHz
    // status |= DEVICE_PLL0Init(0, 18, 0, 0, 0, 18, 8);
    status |= DEVICE_PLL0Init(0, 24, 0, 1, 0, 11, 5);         // <--------  patch to force 300 MHz
  #elif defined(AM1810)
    // CPU(s) at 300 MHz
    status |= DEVICE_PLL0Init(0, 24, 0, 1, 0, 11, 5);    
  #else
    // CPU(s) at 300 MHz
    status |= DEVICE_PLL0Init(0, 24, 0, 1, 0, 11, 5);
  #endif  
  }
....
....

And again this solves the issue, but is this a correct approach?


Waiting for your response, thanks in advance. Gabriele.

  • Does the UBL not configure the PMIC via I2C commands to 1.3V? Unless the PMIC defaults to 1.3V out of reset, the UBL would have to configure the PMIC even after power on before changing the PLL to 456 MHz.

    Jeff

  • jc-ti said:


    Does the UBL not configure the PMIC via I2C commands to 1.3V?



    Nope! I can confirm that after setting the OPP to 96MHz and rebooting the core voltage is still at 1.0v.

    Let's name <utils> the directory 'ti-sdk-am180x-evm-05.02.00.00/host-tools/flash_utils/OMAP-L138_FlashAndBootUtils_2_31/' where the SDK installer put the code.

    I checked the startup code in '<utils>/common/ubl/src/device.c' and 'common/ubl/src/ubl.c' and find no code related to PMIC setup or I2C.

    So i searched all the sources and found a file named '<utils>/OMAP-L138/common/src/tps65070.c' which contains a series of TPS65070_* functions to set the PMIC operating point, but this file is not compiled and I grepped through all the sources in '<utils>'  and none of this functions is used anywhere.

    Do I need to use a more recent version of the flash_utils? Is the 2.31 versions supplied with the SDK PSP 3.21.00.04 outdated/bugged/incomplete or am I missing something?

    Thanks!

  • Nobody can comment or give advice for this?

    Am1808 not being able to reboot (or reset) from 96MHz opp with the standard shipped UBL code is a really serous issue from my point of view...  :-/

  • Gabriele

    I have forwarded your query to the AM18xx SDK team. I would recommend if the question is not addressed, please also escalate through your local TI field support team, providing information on the end application etc.

    Regards

    Mukul

  • I will respond to my own question for the benefit of all.

    I found that since a certain version of UBL, the code to set the OPP in the PMIC via I2C at boot was removed (I don't understand why, maybe not everyone uses a TPS to power the AM1808/L138...)

    The latest UBL version in which I was able to found such code is in the package 'armubl-03.20.00.14.tar.gz'.

    So i forward-ported that code to a more recent version of UBL and everithng works flawless since then.

    I've attached a patch to apply against the 'OMAP-L138_FlashAndBootUtils_2_31_a.tar.gz' source code, but I guess you can adapt it to any recent UBL version.

    I hope it will be useful for others suffering same issues :-)

    PLEASE NOTE: I'm not a TI FAE and this is NOT a TI approved patch, so use it at your risk (beware that it may even damage your CPU!).

    ubl.patch.tar.gz