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.

Read smartreflex values and failed sr_init

Other Parts Discussed in Thread: TPS65910

We put an AM3354BZCZ60 on our board.  We tried viewing the smartreflex values in u-boot in 0x44e106a0-0x44e106f0 and 0x44e10770-ox44e10830.  We expected to see more non-zero values but it seemed to contain about the same data as in am3354zcz60 2BAR2PW that is on another board.

So the 1st question is, are we looking in the correct addresses for smartreflex values?

The next question is sr_init failing.  With the AM3354BZCZ60, we still see:

sr_init: platform driver register failed

In mach-omap2/am33xx-smartreflex-class2.c, I added some debug code:

static int __init sr_init(void)
{
   int ret;

   printk(KERN_INFO "--- sr_init c2");

   ret = platform_driver_probe(&smartreflex_driver, am33xx_sr_probe);
   if (ret)
   {
      pr_err("%s: platform driver register failed, err %d\n", __func__, ret);
      return ret;
   }

I see "--- sr_init c2" printed, so it is calling this version of sr_init.  the value of ret is -19.

This corresponds to -ENODEV in platform.c, line 530:

	if (code == 0 && list_empty(&drv->driver.p->klist_devices.k_list))
		retval = -ENODEV;

Supposedly, ENODEV means:

The device you are trying to access doesn't exist, or the drivers for this device aren't loaded. This can occur if you refer to a file in /dev that has no driver loaded for it, or when loading a driver if no hardware exists.

Our .config file has:

CONFIG_AM33XX_SMARTREFLEX=y
# CONFIG_OMAP_SMARTREFLEX is not set


CONFIG_GPIO_TPS65910=y
CONFIG_GENERIC_PWM=y
CONFIG_DAVINCI_EHRPWM=y
CONFIG_ECAP_PWM=y
# CONFIG_W1 is not set
# CONFIG_POWER_SUPPLY is not set
CONFIG_HWMON=y


Is there something else that needs to be configured in the kernel?

  • You are using a 600MHz processor that supports only OPP100 and OPP50. Registers for OPP120 and OPP Turbo should be empty. What is your PMIC? Do you have I2C0 connected to it? See this link: http://processors.wiki.ti.com/index.php/AM335x_Power_Management_User_Guide#SmartReflex
  • We are using TPS65910A3A1RSL on I2C0.  We can R/W the part via I2C0 in u-boot.  We manually change a voltage to 1.13 V in u-boot.  With the AM3354BZCZ60, we see a call to tps65910_set_voltage_dcdc() which writes to the PMIC and changes the voltage to 1.262 V.  When we try a board with the am3354zcz60,  there is no call to tps65910_set_voltage_dcdc(), so the voltage remains at 1.13 V.

    However, sr_init still fails with either AM3354BZCZ60 and am3354zcz60.

  • Can you please provide details on precisely which Linux kernel you're using, e.g. are you using the Linux kernel that came bundled with SDK 6.00 or did you download a kernel from a git tree somewhere?

  • The kernel is part of ti-sdk-am335x-evm-05.07.00.00.  The code is in linux-3.2.0-psp04.06.00.10

  • PG2.1 support (i.e. the 'B' devices) was introduced in SDK 6.00 with PSP 4.06.00.11.  I see there are patches specifically for Smart Reflex in that release.  Please update to SDK 6.00.

  • Thanks, I'll give that a try.  Is there a specific kernel config for PG2.1 support?

  • There's not a specific configuration.  In arch/arm/plat-omap/include/plat/cpu.h we have the following defined:

    #define AM335X_CLASS		0x33500034
    #define AM335X_REV_ES1_0	AM335X_CLASS
    #define AM335X_REV_ES2_0	(AM335X_CLASS | (0x1 << 8))
    #define AM335X_REV_ES2_1	(AM335X_CLASS | (0x2 << 8))
    

    Those definitions get used conditionally by the code at run-time.

  • After running the sdk 6/psp 4.6.0.11 kernel, the voltage is programmed to 1.1V instead of 1.26V with the 4.6.0.10 kernel, which is consistent with OPP100.  However, sr_init still reports 'register failed'. 

    While searching the web, I noticed that there was a change that moved the smartreflex code from arch/arm/mach-omap2 to drivers/power/avs which seems to have occured around kernel 3.6.  I see comments that say sr_init is a late_initcall().   Perhaps there's a race condition that interferes with the register?

  • Can you provide the kernel printout and corresponding voltages for each device (PG1.0 and 2.1)?  That will give a clear picture of where you currently stand using the latest software.  Thanks!

  • Kernel printout:

    e2e.ti.com/cfs-file.ashx/__key/communityserver-components-userfiles/00-00-11-04-58/kernel_5F00_boot_5F00_46010r3.txt

    This kernel is based on PSP 4.6.0.10 with the smartreflex changes from SDK 6.  In our case, in order for sr_init to register properly, am335x_opp_update() must be called before am33xx_sr_init().  If am335x_opp_update() is not called, or is called after am33xx_sr_init(), sr_init register fails.

    To test smartreflex, the voltage was monitored during boot and when sr_init  registered properly.  1.2 V was measured at the start of boot, and then changed to 0.9 at a successful sr_init register. We tried different governors.  The voltage was measured at idle and when  programs ran to load the CPU.  The voltage was adjusted with CPU load.

    Prior to merging in the smartreflex changes from SDK 6 and changing to Rev B silicon, the voltage stayed at 1.2 V regardless of idle and load.

    Thanks for all the help!