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.

TI OMAP l138 LCDK /sys/devices/system/cpu/cpu0/cpufreq does not appear in Linux Kernel 3.18.19

Other Parts Discussed in Thread: OMAP-L138, AM1808, DA8XX, OMAPL138

I was assigned to get newer kernel version working in TI OMAP l138 LCDK. I used BuildRoot 2015.05 stable release to start with. The kernel image booted and root file system were compiled and running on it, but somehow I couldn't get CPU Frequency Scaling working in Kernel 3.18.19, which I neither find /sys/devices/system/cpu/cpu0/cpufreq directory nor I can see any information related to CPU frequency in /proc/cpuinfo. I searched on google for a week but I couldn't find any answers.

I use BuildRoot 2015.05 and built with linux-devkit in ti-sdk-omapl138-lcdk-01.00.00 under ubuntu 14.04

U-Boot 2010.12 (May 07 2012 - 16:09:45)

kernel compile options:

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

System Type  --->
ARM system type (TI DaVinci)  --->
TI DaVinci Implementations  --->
    *** DaVinci Core Type ***
[*] DA850/OMAP-L138/AM18x based system
    *** DaVinci Board Type ***
[*] TI DA850/OMAP-L138/AM18x Reference Platform
    Select peripherals connected to expander on UI board (No peripheral is enabled) --->
[*] TI AM1808 / OMAPL-138 Hawkboard platform
[*] DAVINCI multiplexing support
[*] Multiplexing debug output
[*] Warn about pins the bootloader didn't set up

[*] CPU Frequency scaling 
 <M> CPU frequency translation statistics
 [*] CPU frequency translation statistics details
 Default CPUFreq governor (userspace) ---> 
<M> 'performance' governor
<M> 'powersave' governor
-*- 'userspace' governor for userspace frequency scaling
<M> 'ondemand' cpufreq policy governor
<M> 'conservative' cpufreq governor
<M> Generic DT based cpufreq driver
ARM CPU frequency scaling drivers ----

[*] CPU idle PM support
[*] Ladder governor (for periodic timer tick)
-*- Menu governor (for tickless system)
ARM CPU Idle Drivers ----

Device Drivers  --->
Multifunction device drivers  --->
  <*> TI TPS6507x Power Management / Touch Screen chips

[*] Voltage and Current Regulator Support  --->
  <*>   TI TPS6507X Power regulators
--------------------------------------------------------------------------------------

u-boot parameters:

--------------------------------------------------------------------------------------
setenv serverip 192.168.100.32
setenv ipaddr 192.168.100.201
setenv bootfile /uImage
setenv kernel_addr_r 0xc0700000
setenv rootpath /rootfs
setenv bootargs console=ttyS2,115200n8 root=/dev/nfs nfsroot=${serverip}:${rootpath},nolock,nfsvers=3 rw mem=128M ip=dhcp eth=${ethaddr}
setenv net_nfs 'tftp ${kernel_addr_r} ${bootfile}; bootm ${kernel_addr_r}'
run net_nfs
--------------------------------------------------------------------------------------

Boot message:

--------------------------------------------------------------------------------------
Booting Linux on physical CPU 0x0
Linux version 3.18.19 (root@3a6f99f89e2b) (gcc version 4.5.3 20110311 (prerelease) (GCC) ) #1 PREEMPT Mon Jul 27 03:31:36 UTC 2015
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
CPU: VIVT data cache, VIVT instruction cache
Machine: AM18x/OMAP-L138 Hawkboard
da8xx_rproc_reserve_cma: 'rproc_mem=nn@address' badly specified
'nn' and 'address' must both be non-zero
Memory policy: Data cache writethrough
DaVinci da850/omap-l138/am18x variant 0x1
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: console=ttyS2,115200n8 root=/dev/nfs nfsroot=192.168.100.32:/rootfs,nolock,nfsvers=3 rw mem=128M ip=dhcp eth=00:00:a0:00:fb:c7
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 123920K/131072K available (4030K kernel code, 232K rwdata, 1316K rodata, 188K init, 184K bss, 7152K reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xffe00000 (2048 kB)
vmalloc : 0xc8800000 - 0xff000000 ( 872 MB)
lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc0540efc (5348 kB)
.init : 0xc0541000 - 0xc0570000 ( 188 kB)
.data : 0xc0570000 - 0xc05aa240 ( 233 kB)
.bss : 0xc05aa240 - 0xc05d82f4 ( 185 kB)
SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
NR_IRQS:245
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
Console: colour dummy device 80x30
Calibrating delay loop... 227.32 BogoMIPS (lpj=1136640)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0xc03f6138 - 0xc03f6190
devtmpfs: initialized
pinctrl core: initialized pinctrl subsystem
regulator-dummy: no parameters
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder | NOR | Minicom 2.7 | VT102 | 離線 | ttyUSB0 cpuidle: using governor menu
EMAC: MII PHY configured
MUX: initialized GPIO3_12
MUX: Setting register GPIO3_12
PINMUX7 (0x0000001c) = 0x10110110 -> 0x10118110
MUX: initialized GPIO3_13
MUX: Setting register GPIO3_13
PINMUX7 (0x0000001c) = 0x10118110 -> 0x10118810
MUX: initialized GPIO2_4
MUX: Setting register GPIO2_4
PINMUX6 (0x00000018) = 0x00000000 -> 0x00008000
MUX: initialized GPIO6_13
MUX: Setting register GPIO6_13
PINMUX13 (0x00000034) = 0x00000000 -> 0x00000800
edma-dma-engine edma-dma-engine.0: TI EDMA DMA engine driver
edma-dma-engine edma-dma-engine.1: TI EDMA DMA engine driver
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Advanced Linux Sound Architecture Driver Initialized.
Switched to clocksource timer0_1
NET: Registered protocol family 2
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
futex hash table entries: 256 (order: -1, 3072 bytes)
ntfs: driver 2.1.31 [Flags: R/O].
msgmni has been set to 242
io scheduler noop registered (default)
Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x1c42000 (irq = 25, base_baud = 14250000) is a 16550A
serial8250.1: ttyS1 at MMIO 0x1d0c000 (irq = 53, base_baud = 9375000) is a 16550A
console [ttyS2] disabled
serial8250.2: ttyS2 at MMIO 0x1d0d000 (irq = 61, base_baud = 9375000) is a 16550A
console [ttyS2] enabled
brd: module loaded
davinci_mdio davinci_mdio.0: davinci mdio revision 1.5
davinci_mdio davinci_mdio.0: detected phy mask ffffff7f
libphy: davinci_mdio.0: probed
davinci_mdio davinci_mdio.0: phy[7]: device davinci_mdio-0:07, driver unknown
i2c /dev entries driver
davinci_mmc da830-mmc.0: Using DMA, 4-bit mode
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
remoteproc0: dsp is available
remoteproc0: Note: remoteproc is still under development and considered experimental.
remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
remoteproc0: Direct firmware load for rproc-dsp-fw failed with error -2
remoteproc0: failed to load rproc-dsp-fw
no UART detected at 0x1
specify port
snd_mpu401: probe of snd_mpu401.0 failed with error -22
usbcore: registered new interface driver snd-usb-audio
TCP: cubic registered
NET: Registered protocol family 17
console [netcon0] enabled
netconsole: network logging started
davinci_emac davinci_emac.1: using random MAC addr: 4e:37:fc:28:45:1e
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
davinci_mdio davinci_mdio.0: resetting idled controller
net eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=davinci_mdio-0:07, id=7c0f1)
davinci_emac davinci_emac.1 eth0: Link is Up - 100Mbps/Full - flow control rx/tx
Sending DHCP requests ., OK
IP-Config: Got DHCP answer from 192.168.100.1, my address is 192.168.100.95
IP-Config: Complete:
device=eth0, hwaddr=4e:37:fc:28:45:1e, ipaddr=192.168.100.95, mask=255.255.255.0, gw=192.168.100.1
host=192.168.100.95, domain=, nis-domain=(none)
bootserver=0.0.0.0, rootserver=192.168.100.32, rootpath=
nameserver0=192.168.1.252
ALSA device list:
#0: Loopback 1
VFS: Mounted root (nfs filesystem) on device 0:13.
devtmpfs: mounted
Freeing unused kernel memory: 188K (c0541000 - c0570000)
Starting logging: OK
Initializing random number generator... urandom start: failed.
done.
Starting system message bus: random: dbus-uuidgen urandom read with 37 bits of entropy available
Failed to start message bus: The pid file "/var/run/messagebus.pid" exists, if the message bus is not running, remove this file
done
Starting network...
/bin/sh: run-parts: not found
/usr/sbin/avahi-daemon: error while loading shared libraries: libcap.so.2: cannot open shared object file: No such file or directory
/usr/sbin/avahi-daemon: error while loading shared libraries: libcap.so.2: cannot open shared object file: No such file or directory

Welcome to Buildroot
--------------------------------------------------------------------------------------

cat /proc/cpuinfo

processor : 0
model name : ARM926EJ-S rev 5 (v5l)
BogoMIPS : 227.32
Features : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant : 0x0
CPU part : 0x926
CPU revision : 5

Hardware : AM18x/OMAP-L138 Hawkboard
Revision : 0000
Serial : 0000000000000000

  • Hi,

    The "CPUFreq" initializing was missing in MCSDK releases for OMAPL138 LCDK board.

    I have modified the OMAPL138 LCDK board file and now I'm able to check/view the frequency through "CPUFreq" SYSFS entry.

    mcsdk_1_01_00_02/board-support/linux-3.3-psp03.22.00.06.sdk/arch/arm/mach-davinci/board-omapl138-lcdk.c

    cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed

    PFA of modified the board file and logs.

    2335.board-omapl138-lcdk.c

    3487.omapl138_lcdk_bootuplog_cpufreq.txt

  • Hi,
    The kernel version which you use seems to be the latest kernel 3.18 so, try to change the board file or device tree file accordingly.
  • Thank you very much! I will make a patch and give it a try!
  • Any updates here? I still can't get CPUFreq working on 3.18.x. Previous 3.3.0 works fine.
  • Hi Andrew,

    Did you try Titus' code? Cpufreq feature needs regulator module in order to work properly. I was studying the code, so I could try to modify the cpufreq driver from davinci to work with DT; however, I am currently supporting other team to debug the project and my code studying is pending now.

    You can study the code attached by Titus and compile with the current kernel source, or you can download the linux package from TI website and study the kernel source for l138 lcdk board source file "linux-3.1.10/arch/arm/mach-davinci/board-omapl138-hawk.c". Look for keyword "cpufreq" and "CONFIG_CPU_FREQ". The initialization is done by this function at line 502,

    ret = omapl138_lcdk_init_cpufreq();

    I couldn't find any place where the regulator module is initialized. Actually LCDK does NOT have an I2C regulator and it's wired with omap-l138 with fixed voltage, so that's why I don't understand how this can work.

    Try to compile the code and see if cpufreq is up, and try to change the frequecy to see if the board is freezing. If it is still not work maybe you can ask ppl on the site to see if they have better solution on this.

  • Looks like I have problem with voltage regulator init (from dmesg):

    [ 1.713645] ------------[ cut here ]------------
    [ 1.718506] WARNING: CPU: 0 PID: 1 at arch/arm/mach-davinci/da850.c:1058 0xc0014a98()
    [ 1.726339] Unable to obtain voltage regulator for CVDD; voltage scaling unsupported
    [ 1.734225] CPU: 0 PID: 1 Comm: swapper Not tainted 3.18.20 #17
    [ 1.740261] Backtrace:
    [ 1.742760] Function entered at [<c000b7a8>] from [<c000b938>]
    [ 1.748718] r6:c034e214 r5:00000009 r4:c7839cb8 r3:00200140
    [ 1.754447] Function entered at [<c000b920>] from [<c0323324>]
    [ 1.760410] Function entered at [<c0323304>] from [<c0017a24>]
    [ 1.766261] Function entered at [<c00179bc>] from [<c0017ab0>]
    [ 1.772208] r8:c03840d8 r7:00000000 r6:c04012e0 r5:c03b151c r4:c03d6a40
    [ 1.779105] Function entered at [<c0017a7c>] from [<c0014a98>]
    [ 1.784943] r3:c03c5464 r2:c034e232
    [ 1.788679] Function entered at [<c0014a60>] from [<c025a43c>]
    [ 1.794516] r4:c7ad3400 r3:c0014a60
    [ 1.798257] Function entered at [<c025a3e0>] from [<c025664c>]
    [ 1.804096] r6:00000000 r5:c0401250 r4:c7ad3400 r3:c025a3e0
    [ 1.809948] Function entered at [<c02564c4>] from [<c01ea468>]
    [ 1.815784] r10:c039fe70 r9:00000000 r8:c03840d8 r7:00000000 r6:c7839d44 r5:c03c9450
    [ 1.823812] r4:c03d0cc8 r3:c02564c4
    [ 1.827414] Function entered at [<c01ea3d8>] from [<c0257338>]
    [ 1.833369] r6:c03d13c4 r5:c03b13d8 r4:c04012e0
    [ 1.838164] Function entered at [<c02571b8>] from [<c0396cb4>]
    [ 1.844012] r4:c04012e0 r3:00000006
    [ 1.847619] Function entered at [<c0396c34>] from [<c01ebe3c>]
    [ 1.853570] r4:ffffffed r3:c0396c34
    [ 1.857193] Function entered at [<c01ebe04>] from [<c01eab80>]
    [ 1.863142] r6:c03d13c4 r5:c03b140c r4:c03b13d8 r3:c01ebe04
    [ 1.868997] Function entered at [<c01eaacc>] from [<c01ead48>]
    [ 1.874838] r7:c01eacd8 r6:c03d13c4 r5:c03b140c r4:c03b13d8
    [ 1.880691] Function entered at [<c01eacd8>] from [<c01e9478>]
    [ 1.886526] r6:c03d13c4 r5:c7839e00 r4:00000000 r3:c01eacd8
    [ 1.892372] Function entered at [<c01e941c>] from [<c01eae68>]
    [ 1.898325] r7:c03c93d0 r6:00000000 r5:c7aef2a0 r4:c03d13c4
    [ 1.904050] Function entered at [<c01eae48>] from [<c01e9c54>]
    [ 1.910005] Function entered at [<c01e9b8c>] from [<c01eb394>]
    [ 1.915853] r7:c03d67a0 r6:c03a4668 r5:c039fe68 r4:c03d13c4
    [ 1.921692] Function entered at [<c01eb2f0>] from [<c01ec6d4>]
    [ 1.927530] r5:c039fe68 r4:c03d13b0
    [ 1.931274] Function entered at [<c01ec684>] from [<c0394304>]
    [ 1.937117] Function entered at [<c03942dc>] from [<c0396cec>]
    [ 1.943064] r6:c03a4668 r5:c039fe68 r4:00000007 r3:c0387c28
    [ 1.948916] Function entered at [<c0396cd4>] from [<c0387c38>]
    [ 1.954761] Function entered at [<c0387c28>] from [<c03840fc>]
    [ 1.960711] Function entered at [<c03840d8>] from [<c0382cd0>]
    [ 1.966559] Function entered at [<c0382c34>] from [<c0382e74>]
    [ 1.972502] r10:c039fe70 r9:00000000 r8:00000068 r7:c03d67a0 r6:c03a4668 r5:c039fe68
    [ 1.980541] r4:00000007
    [ 1.983094] Function entered at [<c0382d80>] from [<c0320560>]
    [ 1.989042] r10:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0320550 r4:00000000
    [ 1.996948] Function entered at [<c0320550>] from [<c0009498>]
    [ 2.002902] r4:00000000 r3:c7838000
    [ 2.006613] ---[ end trace eebaed71237310cd ]---
  • Looks like voltage and current regulators support brakes davinci-cpufreq functionality.

    I've just compiled Kernel 3.18.20 without CONFIG_REGULATORS and got cpufreq working!

  • Nice job! Since the regulator cannot be controlled by the kernel I guess you don't need regulator on anyways. :D

  • Hi Andrew,
    Sounds good.
    Sorry, I don't have time to look into this issue.
    Thanks for your update.