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.

AM3356: How to change CPU FREQ on demand

Part Number: AM3356
Other Parts Discussed in Thread: AM3352, TPS65910

Hi Experts,

Customer is developing their system with AM3356BZCZA80(Linux SDK version:06_03_00_106). Customer understands that they can configure the device-tree to change CPU-clock on demand. Customer is using this dts file( DTS_Excerpt.zip ) and this dts includes this dtsi file ( DTSI_Excerpt.zip ).  Customer would like to change ,for example, 300MHz. However, it seems they can only change this peed to three frequencies (600, 720 and 800Hz). How should customer change cpu speed to 300MHz?

Can I have your Expert's advice/comments on this, please?

Best regards,

Miyazaki

  • Hi Miyazaki-san,
    On AM335x, SPL sets the max speed supported by the device based on reading CM EFUSE_SMA register @44E107Fc.
    Additionally, PMIC is configured in SPL board file "/board/ti/am335x/board.c" based on the max speed detected.

    When Dynamic Voltage and Frequency Scaling (DVFS) is enabled, Linux kernel dynamically scale the voltage and frequency based on need,
    user preference, or other factors. Please refer the following link for details on DVFS framework.
    software-dl.ti.com/.../Power_Management.html
    I captured a sample log for DVFS on AM335x GP EVM with 1GHz part, and uploaded it in attachment for your reference.

    Best,

    -Hong

    devmem2 0x44e107fc
    /dev/mem opened.
    Memory mapped at address 0xb6efe000.
    Read at address  0x44E107FC (0xb6efe7fc): 0x00013C2F
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available__frequencies
    300000 600000 720000 800000 1000000 
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
    600000
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
    600000
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available__governors
    conservative userspace powersave ondemand performance 
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
    cpufreq-dt
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table 
       From  :    To
             :    300000    600000    720000    800000   1000000 
       300000:         0       129        14        15        59 
       600000:       126         0         9         7        44 
       720000:        20         7         0         4        21 
       800000:        22         9         2         0        29 
      1000000:        49        42        27        36         0 
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_statte
    300000 79303
    600000 610
    720000 131
    800000 186
    1000000 3556
    root@am335x-hs-evm:~# 

  • Hi Hong,

    I shared this information with customer. I'd like to wait for their feedback. for a while,

    Best regards,

    Miyazaki

  • Hi Miyazaki-san,

    Yes, please keep us updated with your feedback.

    Best,

    -Hong

  •  Hi Hong,

    I got customer’s feedback. Customer checked CM EFUSE_SMA register (0x44e107fc) as follows, however they were not able to see 300MHz frequency in trans_table with their system. Customer is asking the reason why “300MHz” does not exit . should customer set something like configuration?

    Customer is using AM3356BZCZA80. Can we have your advice/comments on this, please?

    1. ----------------------------------------------------------------------
    2. $ devmem2 0x44e107fc
    3. /dev/mem opened.
    4. Memory mapped at address 0xb6fbb000.
    5. Read at address  0x44E107FC (0xb6fbb7fc): 0x00013E2F $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    6. 600000 720000 800000
    7. $ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
    8. 720000
    9. $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
    10. 720000
    11. $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
    12. conservative userspace powersave ondemand performance $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
    13. cpufreq-dt
    14. $ cat /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table
    15.    From  :    To
    16.          :    600000    720000    800000
    17.    600000:         0       528        16
    18.    720000:       523         0       540
    19.    800000:        21       536         0
    20. root@am335x-evm:~
    21. $ cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
    22. 600000 54174
    23. 720000 24365
    24. 800000 11132
    25. ----------------------------------------------------------------------

    Best regards,

    Miyazaki

  • Hi Miyazaki-san,

    Thanks for your update.

    We'll take a closer look at the test log attached, and get back to you.

    Best,

    -Hong

  • Hi Miyazaki-san,
    I took a closer look at the device tree file in your first post, and noticed one of regulator node as listed below:

    vdd2_reg: regulator@3 { reg = ; regulator-compatible = "vdd2"; regulator-always-on; regulator-min-microvolt = ; regulator-max-microvolt = ; };

    Is vdd2_reg (PMIC) connected to VDD_MPU (AM335x) on your customer's schematics?
    If yes, can we make one change as listed below, and run a test?
    regulator-min-microvolt = <1100000>; to regulator-min-microvolt = <912500>;

    Best,
    -Hong

  • Hi, Hong Guan64-san

     I'm original questioner Katsuyama. Thank you for  replies.

    I tried  <912500> , but, following error occurs at boot time.

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

    Starting kernel ...

    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Linux version 4.19.94-gbe5389fd85 (oe-user@oe-host) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #1 PREEMPT Thu Jan 28 06:59:33 UTC 2021
    [ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] OF: fdt: Machine model: JRCM AM335x ITCONT
    [ 0.000000] Memory policy: Data cache writeback
    [ 0.000000] efi: Getting EFI parameters from FDT:
    [ 0.000000] efi: UEFI not found.
    [ 0.000000] cma: Reserved 48 MiB at 0x8a800000
    [ 0.000000] CPU: All CPU(s) started in SVC mode.
    [ 0.000000] AM335X ES2.1 (neon)
    [ 0.000000] random: get_random_bytes called from start_kernel+0xa4/0x434 with crng_init=0
    [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 64960
    [ 0.000000] Kernel command line: console=ttyO0,115200n8 root=PARTUUID=366319df-02 rw rootfstype=ext4 rootwait
    [ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    [ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [ 0.000000] Memory: 197344K/262144K available (8192K kernel code, 291K rwdata, 2552K rodata, 1024K init, 246K bss, 15648K reserved, 49152K cma-reserved, 0K highmem)
    [ 0.000000] Virtual kernel memory layout:
    [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
    [ 0.000000] vmalloc : 0xd0800000 - 0xff800000 ( 752 MB)
    [ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
    [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
    [ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
    [ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (9184 kB)
    [ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (1024 kB)
    [ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 292 kB)
    [ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 247 kB)
    [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [ 0.000000] rcu: Preemptible hierarchical RCU implementation.
    [ 0.000000] Tasks RCU enabled.
    [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
    [ 0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts
    [ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz
    [ 0.000022] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    [ 0.000054] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    [ 0.000070] OMAP clocksource: timer1 at 24000000 Hz
    [ 0.000327] timer_probe: no matching timers found
    [ 0.000579] Console: colour dummy device 80x30
    [ 0.000617] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
    [ 0.000626] This ensures that you still see kernel messages. Please
    [ 0.000635] update your kernel commandline.
    [ 0.000708] Calibrating delay loop... 597.60 BogoMIPS (lpj=2988032)
    [ 0.118629] pid_max: default: 32768 minimum: 301
    [ 0.118906] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 0.118927] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 0.120050] CPU: Testing write buffer coherency: ok
    [ 0.120139] CPU0: Spectre v2: using BPIALL workaround
    [ 0.121334] Setting up static identity map for 0x80100000 - 0x80100060
    [ 0.121549] rcu: Hierarchical SRCU implementation.
    [ 0.122030] EFI services will not be available.
    [ 0.123978] devtmpfs: initialized
    [ 0.135891] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [ 0.136423] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    [ 0.136459] futex hash table entries: 256 (order: -1, 3072 bytes)
    [ 0.141521] pinctrl core: initialized pinctrl subsystem
    [ 0.142547] DMI not present or invalid.
    [ 0.143145] NET: Registered protocol family 16
    [ 0.146462] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [ 0.179027] l4_wkup_cm:clk:0010:0: failed to disable
    [ 0.234164] cpuidle: using governor ladder
    [ 0.234220] cpuidle: using governor menu
    [ 0.241631] OMAP GPIO hardware version 0.1
    [ 0.257282] No ATAGs?
    [ 0.257297] hw-breakpoint: debug architecture 0x4 unsupported.
    [ 0.277413] edma 49000000.edma: TI EDMA DMA engine driver
    [ 0.282416] SCSI subsystem initialized
    [ 0.283126] media: Linux media interface: v0.10
    [ 0.283192] videodev: Linux video capture interface: v2.00
    [ 0.283335] pps_core: LinuxPPS API ver. 1 registered
    [ 0.283348] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [ 0.283382] PTP clock support registered
    [ 0.283431] EDAC MC: Ver: 3.0.0
    [ 0.284978] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
    [ 0.285787] Advanced Linux Sound Architecture Driver Initialized.
    [ 0.287447] clocksource: Switched to clocksource timer1
    [ 0.299661] NET: Registered protocol family 2
    [ 0.300820] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
    [ 0.300866] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
    [ 0.300907] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    [ 0.300945] TCP: Hash tables configured (established 2048 bind 2048)
    [ 0.301098] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [ 0.301130] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [ 0.301370] NET: Registered protocol family 1
    [ 0.302171] RPC: Registered named UNIX socket transport module.
    [ 0.302192] RPC: Registered udp transport module.
    [ 0.302201] RPC: Registered tcp transport module.
    [ 0.302211] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [ 0.303509] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
    [ 0.305334] Initialise system trusted keyrings
    [ 0.305797] workingset: timestamp_bits=14 max_order=16 bucket_order=2
    [ 0.312843] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [ 0.313901] NFS: Registering the id_resolver key type
    [ 0.313964] Key type id_resolver registered
    [ 0.313975] Key type id_legacy registered
    [ 0.314039] ntfs: driver 2.1.32 [Flags: R/O].
    [ 0.317321] Key type asymmetric registered
    [ 0.317350] Asymmetric key parser 'x509' registered
    [ 0.317593] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
    [ 0.317614] io scheduler noop registered
    [ 0.317626] io scheduler deadline registered
    [ 0.317976] io scheduler cfq registered (default)
    [ 0.317995] io scheduler mq-deadline registered
    [ 0.318008] io scheduler kyber registered
    [ 0.320699] pinctrl-single 44e10800.pinmux: 142 pins, size 568
    [ 0.394776] Serial: 8250/16550 driver, 10 ports, IRQ sharing enabled
    [ 0.400553] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 30, base_baud = 3000000) is a 8250
    [ 1.018294] console [ttyS0] enabled
    [ 1.023481] 48024000.serial: ttyS2 at MMIO 0x48024000 (irq = 31, base_baud = 3000000) is a 8250
    [ 1.033860] 481a6000.serial: ttyS3 at MMIO 0x481a6000 (irq = 32, base_baud = 3000000) is a 8250
    [ 1.044187] 481a8000.serial: ttyS4 at MMIO 0x481a8000 (irq = 33, base_baud = 3000000) is a 8250
    [ 1.054531] 481aa000.serial: ttyS5 at MMIO 0x481aa000 (irq = 34, base_baud = 3000000) is a 8250
    [ 1.066192] omap_rng 48310000.rng: Random Number Generator ver. 20
    [ 1.072681] random: fast init done
    [ 1.076375] random: crng init done
    [ 1.098999] brd: module loaded
    [ 1.111932] loop: module loaded
    [ 1.119286] libphy: Fixed MDIO Bus: probed
    [ 1.197559] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
    [ 1.205281] libphy: 4a101000.mdio: probed
    [ 1.210886] davinci_mdio 4a101000.mdio: phy[1]: device 4a101000.mdio:01, driver SMSC LAN8710/LAN8720
    [ 1.221309] cpsw 4a100000.ethernet: Detected MACID = 30:45:11:a3:b9:af
    [ 1.228225] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
    [ 1.234621] cpsw 4a100000.ethernet: ALE Table size 1024
    [ 1.240044] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
    [ 1.248835] PPP generic driver version 2.4.2
    [ 1.253950] i2c /dev entries driver
    [ 1.260494] cpuidle: enable-method property 'ti,am3352' found operations
    [ 1.268079] sdhci: Secure Digital Host Controller Interface driver
    [ 1.274299] sdhci: Copyright(c) Pierre Ossman
    [ 1.279878] omap_gpio 481ae000.gpio: Could not set line 14 debounce to 200000 microseconds (-22)
    [ 1.288786] omap_hsmmc 48060000.mmc: Got CD GPIO
    [ 1.296407] omap_hsmmc 47810000.mmc: Linked as a consumer to regulator.1
    [ 1.413248] sdhci-pltfm: SDHCI platform and OF driver helper
    [ 1.422306] ledtrig-cpu: registered to indicate activity on CPUs
    [ 1.429342] omap_hsmmc 47810000.mmc: card claims to support voltages below defined range
    [ 1.445253] NET: Registered protocol family 17
    [ 1.450460] Key type dns_resolver registered
    [ 1.455188] omap_voltage_late_init: Voltage driver support not added
    [ 1.463153] Loading compiled-in X.509 certificates
    [ 1.476439] mmc0: new high speed SDIO card at address 0001
    [ 1.492058] pca953x 1-0074: 1-0074 supply vcc not found, using dummy regulator
    [ 1.499642] pca953x 1-0074: Linked as a consumer to regulator.0
    [ 1.528528] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 400 kHz
    [ 1.557745] tps65910 2-002d: No interrupt support, no core IRQ
    [ 1.565846] vrtc: supplied by regulator-dummy
    [ 1.571605] vio: supplied by regulator-dummy
    [ 1.577528] vdd1: supplied by regulator-dummy
    [ 1.583769] vdd2: supplied by regulator-dummy
    [ 1.591019] vdig1: supplied by regulator-dummy
    [ 1.596929] vdig2: supplied by regulator-dummy
    [ 1.602995] vpll: supplied by regulator-dummy
    [ 1.608902] vdac: supplied by regulator-dummy
    [ 1.614729] vaux1: supplied by regulator-dummy
    [ 1.620697] vaux2: supplied by regulator-dummy
    [ 1.626631] vaux33: supplied by regulator-dummy
    [ 1.632662] vmmc: supplied by regulator-dummy
    [ 1.638478] vbb: supplied by regulator-dummy
    [ 1.644529] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 400 kHz
    [ 1.650669] cpu cpu0: Linked as a consumer to regulator.5
    [ 1.656202] cpu cpu0: Dropping the link to regulator.5
    [ 1.661777] cpu cpu0: Linked as a consumer to regulator.5
    [ 1.668065] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 1200000 KHz
    [ 1.675545] cpu cpu0: dev_pm_opp_set_rate: failed to find current OPP for freq 1200000000 (-34)
    [ 1.684588] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 800000 KHz
    [ 1.694928] omap_gpio 481ae000.gpio: Could not set line 14 debounce to 200000 microseconds (-22)
    [ 1.703906] omap_hsmmc 48060000.mmc: Got CD GPIO
    [ 1.709507] omap_hsmmc 48060000.mmc: Linked as a consumer to regulator.14
    [ 1.741229] Unable to handle kernel paging request at virtual address ffffe004
    [ 1.748577] pgd = bfc7fe91
    [ 1.751331] [ffffe004] *pgd=8ffe6861, *pte=00000000, *ppte=00000000
    [ 1.757721] Internal error: Oops: 37 [#1] PREEMPT ARM
    [ 1.762830] Modules linked in:
    [ 1.765972] CPU: 0 PID: 54 Comm: kthreadd Not tainted 4.19.94-gbe5389fd85 #1
    [ 1.773089] Hardware name: Generic AM33XX (Flattened Device Tree)
    [ 1.779295] PC is at complete+0x20/0x84
    [ 1.783196] LR is at kthread+0xec/0x160
    [ 1.787087] pc : [<c015f320>] lr : [<c0148e28>] psr: a0000093
    [ 1.793417] sp : cf62bf60 ip : cf62bf78 fp : cf62bf74
    [ 1.798701] r10: cf5edbb8 r9 : c0170b8c r8 : cf61e140
    [ 1.803986] r7 : ffffe000 r6 : 00000000 r5 : cf61e180 r4 : a0000013
    [ 1.810581] r3 : ffffe000 r2 : cf62a000 r1 : 00000002 r0 : cf5edbb8
    [ 1.817184] Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
    [ 1.824479] Control: 10c5387d Table: 80004019 DAC: 00000051
    [ 1.830293] Process kthreadd (pid: 54, stack limit = 0xa041c69a)
    [ 1.836365] Stack: (0xcf62bf60 to 0xcf62c000)
    [ 1.840817] bf60: cf61e1c0 cf61e180 cf62bfac cf62bf78 c0148e28 c015f30c cf61e1d8 cf61e1d8
    [ 1.849101] bf80: 00000000 cf61e180 c0148d3c 00000000 00000000 00000000 00000000 00000000
    [ 1.857383] bfa0: 00000000 cf62bfb0 c01010e8 c0148d48 00000000 00000000 00000000 00000000
    [ 1.865663] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 1.873943] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
    [ 1.882182] Backtrace:
    [ 1.884715] [<c015f300>] (complete) from [<c0148e28>] (kthread+0xec/0x160)
    [ 1.891665] r5:cf61e180 r4:cf61e1c0
    [ 1.895320] [<c0148d3c>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
    [ 1.902612] Exception stack(0xcf62bfb0 to 0xcf62bff8)
    [ 1.907737] bfa0: 00000000 00000000 00000000 00000000
    [ 1.916018] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 1.924288] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
    [ 1.930995] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0148d3c
    [ 1.938892] r4:cf61e180
    [ 1.941499] Code: f10c0080 e1a0300d e3c33d7f e3c7303f (e5932004)
    [ 1.947677] ---[ end trace e0720e6357a700cb ]---
    [ 1.952600] Unable to handle kernel paging request at virtual address bf000004
    [ 1.959906] pgd = bfc7fe91
    [ 1.962655] [bf000004] *pgd=00000000
    [ 1.966298] Internal error: Oops: 5 [#2] PREEMPT ARM
    [ 1.971316] Modules linked in:
    [ 1.974446] CPU: 0 PID: 54 Comm: kthreadd Tainted: G D 4.19.94-gbe5389fd85 #1
    [ 1.982956] Hardware name: Generic AM33XX (Flattened Device Tree)
    [ 1.989131] PC is at complete+0x20/0x84
    [ 1.993044] LR is at mm_release+0x94/0x160
    [ 1.997196] pc : [<c015f320>] lr : [<c0127cac>] psr: a0000193
    [ 2.003527] sp : cf62bd40 ip : cf62bd58 fp : cf62bd54
    [ 2.008807] r10: ffffe000 r9 : 00000000 r8 : 60000193
    [ 2.014093] r7 : bf000000 r6 : ffffe000 r5 : 00000000 r4 : a0000113
    [ 2.020686] r3 : bf000000 r2 : 00000001 r1 : 00000000 r0 : cf61e1d8
    [ 2.027284] Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none
    [ 2.034578] Control: 10c5387d Table: 80004019 DAC: 00000051
    [ 2.040390] Process kthreadd (pid: 54, stack limit = 0xa041c69a)
    [ 2.046459] Stack: (0xcf62bd40 to 0xcf62c000)
    [ 2.050906] bd40: cf277600 00000000 cf62bd8c cf62bd58 c0127cac c015f30c cf293bd8 0000000b
    [ 2.059189] bd60: c0d155c0 cf277600 cf277600 0000000b cf277600 00000000 ffffe000 bf000000
    [ 2.067473] bd80: cf62bdb4 cf62bd90 c012cf90 c0127c24 cf277600 ffffe000 cf62bdb4 18b781c6
    [ 2.075755] bda0: c012a934 bf000000 cf62bdec cf62bdb8 c010c144 c012cd6c cf62a208 0000000b
    [ 2.084038] bdc0: c0aa79fc ffffe004 cf62bf10 00000037 00000000 00000037 cf62a000 cf5edbb8
    [ 2.092322] bde0: cf62be04 cf62bdf0 c0112cc8 c010beac cf62bf10 ffffe004 cf62be54 cf62be08
    [ 2.100604] be00: c0113014 c0112c68 00000000 00000000 00000000 00000000 00000000 00000000
    [ 2.108885] be20: 00000000 00000000 00000000 c0d03048 00000037 c0d07374 ffffe004 cf62bf10
    [ 2.117170] be40: cf62a000 cf5edbb8 cf62bf0c cf62be58 c01131ac c0112ce4 00000000 00000000
    [ 2.125450] be60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 2.133729] be80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 2.142007] bea0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 2.150287] bec0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 2.158570] bee0: 00000000 18b781c6 c015f320 a0000093 ffffffff cf62bf44 cf61e140 cf62a000
    [ 2.166854] bf00: cf62bf74 cf62bf10 c0101978 c0113164 cf5edbb8 00000002 cf62a000 ffffe000
    [ 2.175136] bf20: a0000013 cf61e180 00000000 ffffe000 cf61e140 c0170b8c cf5edbb8 cf62bf74
    [ 2.183419] bf40: cf62bf78 cf62bf60 c0148e28 c015f320 a0000093 ffffffff 00000051 00000000
    [ 2.191704] bf60: cf61e1c0 cf61e180 cf62bfac cf62bf78 c0148e28 c015f30c cf61e1d8 cf61e1d8
    [ 2.199985] bf80: 00000000 cf61e180 c0148d3c 00000000 00000000 00000000 00000000 00000000
    [ 2.208266] bfa0: 00000000 cf62bfb0 c01010e8 c0148d48 00000000 00000000 00000000 00000000
    [ 2.216545] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 2.224824] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
    [ 2.233062] Backtrace:
    [ 2.235595] [<c015f300>] (complete) from [<c0127cac>] (mm_release+0x94/0x160)
    [ 2.242805] r5:00000000 r4:cf277600
    [ 2.246470] [<c0127c18>] (mm_release) from [<c012cf90>] (do_exit+0x230/0xb3c)
    [ 2.253690] r7:bf000000 r6:ffffe000 r5:00000000 r4:cf277600
    [ 2.259443] [<c012cd60>] (do_exit) from [<c010c144>] (die+0x2a4/0x2ac)
    [ 2.266034] r7:bf000000
    [ 2.268661] [<c010bea0>] (die) from [<c0112cc8>] (__do_kernel_fault.part.0+0x6c/0x7c)
    [ 2.276591] r10:cf5edbb8 r9:cf62a000 r8:00000037 r7:00000000 r6:00000037 r5:cf62bf10
    [ 2.284490] r4:ffffe004
    [ 2.287109] [<c0112c5c>] (__do_kernel_fault.part.0) from [<c0113014>] (do_bad_area+0x0/0x84)
    [ 2.295626] r7:ffffe004 r4:cf62bf10
    [ 2.299289] [<c0112cd8>] (do_page_fault) from [<c01131ac>] (do_DataAbort+0x54/0xec)
    [ 2.307045] r10:cf5edbb8 r9:cf62a000 r8:cf62bf10 r7:ffffe004 r6:c0d07374 r5:00000037
    [ 2.314943] r4:c0d03048
    [ 2.317553] [<c0113158>] (do_DataAbort) from [<c0101978>] (__dabt_svc+0x58/0x80)
    [ 2.325018] Exception stack(0xcf62bf10 to 0xcf62bf58)
    [ 2.330145] bf00: cf5edbb8 00000002 cf62a000 ffffe000
    [ 2.338428] bf20: a0000013 cf61e180 00000000 ffffe000 cf61e140 c0170b8c cf5edbb8 cf62bf74
    [ 2.346702] bf40: cf62bf78 cf62bf60 c0148e28 c015f320 a0000093 ffffffff
    [ 2.353410] r9:cf62a000 r8:cf61e140 r7:cf62bf44 r6:ffffffff r5:a0000093 r4:c015f320
    [ 2.361250] [<c015f300>] (complete) from [<c0148e28>] (kthread+0xec/0x160)
    [ 2.368195] r5:cf61e180 r4:cf61e1c0
    [ 2.371842] [<c0148d3c>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
    [ 2.379132] Exception stack(0xcf62bfb0 to 0xcf62bff8)
    [ 2.384256] bfa0: 00000000 00000000 00000000 00000000
    [ 2.392535] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 2.400807] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
    [ 2.407514] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0148d3c
    [ 2.415412] r4:cf61e180
    [ 2.418017] Code: f10c0080 e1a0300d e3c33d7f e3c7303f (e5932004)
    [ 2.424183] ---[ end trace e0720e6357a700cc ]---
    [ 2.428855] Fixing recursive fault but reboot is needed!

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

  • Hi Katsuyama-san,
    There seems mismatch somewhere on your kernel device tree configuration in OPP/regulator node vs VDD_MPU/VDD_CORE...
    I'm summarizing below my testing on AM335x EVM (1GHz part) for your reference:
    1. AM335x EVM with PMIC(tps65910)
    - VDD1 (tps65910) to VDD_MPU (AM335x)
    - VDD2 (tps65910) to VDD_CORE (AM335x)
    2. The regulator node in kernel device tree for VDD_MPU on AM335x EVM (/arch/arm/boot/dts/am335x-evm.dts)

    		vdd1_reg: regulator@2 {
    			/* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
    			regulator-name = "vdd_mpu";
    			regulator-min-microvolt = <912500>;
    			regulator-max-microvolt = <1351500>;
    			regulator-boot-on;
    			regulator-always-on;
    		};

    3. Two tests on AM335x EVM

    a). The default device tree from SDK 6.3
    - the log file (am3_6.3_regulator.txt) in attachment

    - root@am335x-hs-evm:~# cat /sys/kernel/debug/regulator/regulator_summary
        vdd_mpu                       0    1      0   950mV     0mA   912mV  1350mV 
        vdd_core                      0    0      0  1100mV     0mA   912mV  1150mV 
    - root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    300000 600000 720000 800000 1000000

    b). One change in kernel device tree on OPP/regulator node for VDD_MPU as listed below
    From "regulator-min-microvolt = <912500>;" to "regulator-min-microvolt = <1100000>;"
    - the log file (am3_6.3_regulator_No_300MHz.txt) in attachment

    - root@am335x-hs-evm:~# cat /sys/kernel/debug/regulator/regulator_summary
        vdd_mpu                       0    1      0  1200mV     0mA  1100mV  1350mV 
        vdd_core                      0    0      0  1100mV     0mA   912mV  1150mV 
    - root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    600000 720000 800000 1000000

    4. Some questions and checkpoints for you:
    a). Which PMIC is used on your board? is it tps65910?
    b). Check PMIC connection with AM335x SoC, especially on VDD_MPU, VDD_CORE...?
    c). Review kernel device tree configurations on OPP/regulator node, especially on VDD_MPU, VDD_CORE...
    d). Remove the last device tree change (or revert back to previous working kernel boot on your board), and
    check the output from running "cat /sys/kernel/debug/regulator/regulator_summary"
    Best,
    -Hong

    root@am335x-hs-evm:~# uname -a
    Linux am335x-hs-evm 4.19.94-gbe5389fd85 #1 PREEMPT Thu Oct 29 16:23:07 CDT 2020 armv7l GNU/Linux
    
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    300000 600000 720000 800000 1000000 
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table
       From  :    To
             :    300000    600000    720000    800000   1000000 
       300000:         0        26         3         5        19 
       600000:        29         0         7         4        11 
       720000:         4         2         0         6         9 
       800000:         6         3         3         0        22 
      1000000:        15        20         8        19         0 
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_statte
    300000 23150
    600000 175
    720000 59
    800000 179
    1000000 2902
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
    300000
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    1000000
    root@am335x-hs-evm:~# cat /sys/kernel/debug/regulator/regulator_summary
     regulator                      use open bypass voltage current     min     max
    -------------------------------------------------------------------------------
     regulator-dummy                  0    1      0     0mV     0mA     0mV     0mV 
        backlight                                                       0mV     0mV
     vbat                            14   15      0  5000mV     0mA  5000mV  5000mV 
        v1_8d                         0    0      0  1800mV     0mA  1800mV  1800mV 
        v3_3d                         0    0      0  3300mV     0mA  3300mV  3300mV 
        vrtc                          0    0      0     0mV     0mA  1800mV  1800mV 
        vio                           0    0      0  1500mV     0mA     0mV     0mV 
        vdd_mpu                       0    1      0   950mV     0mA   912mV  1350mV 
           cpu0                                                       950mV   969mV
        vdd_core                      0    0      0  1100mV     0mA   912mV  1150mV 
        vdig1                         0    0      0  1800mV     0mA     0mV     0mV 
        vdig2                         0    0      0  1800mV     0mA     0mV     0mV 
        vpll                          0    0      0  1800mV     0mA     0mV     0mV 
        vdac                          0    0      0  1800mV     0mA     0mV     0mV 
        vaux1                         0    0      0  1800mV     0mA     0mV     0mV 
        vaux2                         0    0      0  3300mV     0mA     0mV     0mV 
        vaux33                        0    0      0  3300mV     0mA     0mV     0mV 
        vmmc                          0    1      0  3300mV     0mA  1800mV  3300mV 
           48060000.mmc                                              3300mV  3300mV
        vbb                           0    0      0  3000mV     0mA     0mV     0mV 
     lis3_reg                         0    0      0     0mV     0mA     0mV     0mV 
     wlan-en-regulator                0    1      0  1800mV     0mA  1800mV  1800mV 
        47810000.mmc                                                 1650mV  1950mV
     vdd3                             0    0      0  5000mV     0mA  5000mV  5000mV 
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
    600000
    root@am335x-hs-evm:~# 

    root@am335x-evm:~# uname -a
    Linux am335x-evm 4.19.94-gbe5389fd85 #1 PREEMPT Thu Oct 29 16:23:07 CDT 2020 armv7l GNU/Linux
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    600000 720000 800000 1000000 
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
    720000
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
    720000
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
    conservative userspace powersave ondemand performance 
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
    cpufreq-dt
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table 
       From  :    To
             :    600000    720000    800000   1000000 
       600000:         0        86        24        22 
       720000:        71         0        29        30 
       800000:        21        21         0        54 
      1000000:        40        24        43         0 
    root@am335x-hs-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
    600000 53471
    720000 425
    800000 300
    1000000 3685
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
    600000
    root@am335x-evm:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    1000000
    root@am335x-evm:~# cat /sys/kernel/debug/regulator/regulator_summary
     regulator                      use open bypass voltage current     min     max
    -------------------------------------------------------------------------------
     regulator-dummy                  0    3      0     0mV     0mA     0mV     0mV 
        47401b00.usb-phy                                                0mV     0mV
        47401300.usb-phy                                                0mV     0mV
        backlight                                                       0mV     0mV
     vbat                            14   15      0  5000mV     0mA  5000mV  5000mV 
        v1_8d                         0    1      0  1800mV     0mA  1800mV  1800mV 
           1-001b                                                       0mV     0mV
        v3_3d                         0    3      0  3300mV     0mA  3300mV  3300mV 
           1-001b                                                       0mV     0mV
           1-001b                                                       0mV     0mV
           1-001b                                                       0mV     0mV
        vrtc                          0    0      0     0mV     0mA  1800mV  1800mV 
        vio                           0    0      0  1500mV     0mA     0mV     0mV 
        vdd_mpu                       0    1      0  1200mV     0mA  1100mV  1350mV 
           cpu0                                                      1200mV  1224mV
        vdd_core                      0    0      0  1100mV     0mA   912mV  1150mV 
        vdig1                         0    0      0  1800mV     0mA     0mV     0mV 
        vdig2                         0    0      0  1800mV     0mA     0mV     0mV 
        vpll                          0    0      0  1800mV     0mA     0mV     0mV 
        vdac                          0    0      0  1800mV     0mA     0mV     0mV 
        vaux1                         0    0      0  1800mV     0mA     0mV     0mV 
        vaux2                         0    0      0  3300mV     0mA     0mV     0mV 
        vaux33                        0    0      0  3300mV     0mA     0mV     0mV 
        vmmc                          0    1      0  3300mV     0mA  1800mV  3300mV 
           48060000.mmc                                              3300mV  3300mV
        vbb                           0    0      0  3000mV     0mA     0mV     0mV 
     lis3_reg                         0    0      0     0mV     0mA     0mV     0mV 
     wlan-en-regulator                0    1      0  1800mV     0mA  1800mV  1800mV 
        47810000.mmc                                                 1650mV  1950mV
     vdd3                             0    0      0  5000mV     0mA  5000mV  5000mV 
    root@am335x-evm:~# 

  • Hi, Hong Guan64-san,

    Thank you for your detail explanations.

    I set vdd1(VDD_MPU) as am335x-evm.dts and  tried some other value, but I can't get 300MHz.

    a). Which PMIC is used on your board? is it tps65910?
    b). Check PMIC connection with AM335x SoC, especially on VDD_MPU, VDD_CORE...?
    c). Review kernel device tree configurations on OPP/regulator node, especially on VDD_MPU, VDD_CORE...
    d). Remove the last device tree change (or revert back to previous working kernel boot on your board), and
    check the output from running "cat /sys/kernel/debug/regulator/regulator_summary"

    a) Yes.  TPS65910AA1RSLR is used.

    b) Maybe OK in schematic.

    c) I tried some combinations of VDD_MPU and VDD_CORE, but I can't get 300MHz.

    d) Please see bellow.

    device tree without vdd1_reg
            vdd1_reg: regulator@2 {
                  reg = <2>;
                  regulator-compatible = "vdd1";
                  regulator-always-on;
              };
    
              vdd2_reg: regulator@3 {
                  reg = <3>;
                  regulator-compatible = "vdd2";
                  regulator-always-on;
                  regulator-min-microvolt = <1100000>;
                  regulator-max-microvolt = <1285200>;
              };
    
    $ cat /sys/kernel/debug/regulator/regulator_summary
       vdd1                          0    0      0  1100mV     0mA     0mV     0mV
       vdd2                          0    1      0  1200mV     0mA  1100mV  1275mV
          cpu0                                                      1200mV  1224mV
    
    $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    600000 720000 800000
    
    $ dmesg
    [    1.557956] tps65910 2-002d: No interrupt support, no core IRQ
    [    1.564087] tps65910-gpio tps65910-gpio: ti,en-gpio-sleep not specified
    [    1.564119] gpiochip_find_base: found new base at 490
    [    1.564415] gpio gpiochip5: (tps65910): added GPIO chardev (254:5)
    [    1.564532] gpiochip_setup_dev: registered GPIOs 490 to 495 on device: gpiochip5 (tps65910)
    [    1.566286] vrtc: supplied by regulator-dummy
    [    1.572039] vio: supplied by regulator-dummy
    [    1.577974] vdd1: supplied by regulator-dummy
    [    1.584206] vdd2: supplied by regulator-dummy
    [    1.591460] vdig1: supplied by regulator-dummy
    [    1.597370] vdig2: supplied by regulator-dummy
    [    1.603433] vpll: supplied by regulator-dummy
    [    1.609336] vdac: supplied by regulator-dummy
    [    1.615171] vaux1: supplied by regulator-dummy
    [    1.621152] vaux2: supplied by regulator-dummy
    [    1.627067] vaux33: supplied by regulator-dummy
    [    1.633093] vmmc: supplied by regulator-dummy
    [    1.638957] vbb: supplied by regulator-dummy
    [    1.645026] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 400 kHz
    [    1.651175] cpu cpu0: Linked as a consumer to regulator.5
    [    1.656706] cpu cpu0: Dropping the link to regulator.5
    [    1.662285] cpu cpu0: Linked as a consumer to regulator.5
    [    1.668060] core: _opp_supported_by_regulators: OPP minuV: 931000 maxuV: 969000, not supported by regulator
    [    1.677948] cpu cpu0: _opp_add: OPP not supported by regulators (300000000)
    [    1.685504] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 1200000 KHz
    [    1.693028] cpu cpu0: dev_pm_opp_set_rate: failed to find current OPP for freq 1200000000 (-34)
    [    1.702214] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 800000 KHz

    And ones same as am335x-evm.dts

    device tree
            vdd1_reg: regulator@2 {
                  reg = <2>;
                  regulator-name = "vdd_mpu";
                  regulator-compatible = "vdd1";
                  regulator-always-on;
                  regulator-min-microvolt = <912500>;
                  regulator-max-microvolt = <1351500>;
              };
    
              vdd2_reg: regulator@3 {
                  reg = <3>;
                  regulator-name = "vdd_core";
                  regulator-compatible = "vdd2";
                  regulator-always-on;
                  regulator-min-microvolt = <1100000>;
                  regulator-max-microvolt = <1285200>;
              };
    
    $ cat /sys/kernel/debug/regulator/regulator_summary
        vdd_mpu                       0    0      0  1100mV     0mA   912mV  1350mV
        vdd_core                      0    1      0  1100mV     0mA  1100mV  1275mV
           cpu0                                                      1100mV  1122mV
    
     $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    600000 720000 800000

    Best regards.

  • Hi Katsuyama-san,
    Thanks for running test on your setup.
    As being said in my last reply, there seems mismatch in your kernel DT configuration in OPP/regulator node vs VDD_MPU/VDD_CORE...

    I set vdd1(VDD_MPU) as am335x-evm.dts

    Can you confirm vdd1_reg in your DT is connected to VDD_MPU on your board? it seems not matching from your log as listed below

    $ cat /sys/kernel/debug/regulator/regulator_summary
       vdd1                          0    0      0  1100mV     0mA     0mV     0mV
       vdd2                          0    1      0  1200mV     0mA  1100mV  1275mV
          cpu0                                                      1200mV  1224mV

    You may want to refer to AM335x EVM DT file "am335x-evm.dts", where "vdd1_reg" is for VDD_MPU on AM335x GP EVM.

    ...
    	cpus {
    		cpu@0 {
    			cpu0-supply = <&vdd1_reg>;
    		};
    	};
    ...
    		vdd1_reg: regulator@2 {
    			/* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
    			regulator-name = "vdd_mpu";
    			regulator-min-microvolt = <912500>;
    			regulator-max-microvolt = <1351500>;
    			regulator-boot-on;
    			regulator-always-on;
    		};
    
    		vdd2_reg: regulator@3 {
    			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
    			regulator-name = "vdd_core";
    			regulator-min-microvolt = <912500>;
    			regulator-max-microvolt = <1150000>;
    			regulator-boot-on;
    			regulator-always-on;
    		};

    Best,

    -Hong

  • Hi Katsuyama-san,
    One additional note. In you last reply, when you ran test using

    And ones same as am335x-evm.dts

    Did you change

    cpus {
    cpu@0 {
    cpu0-supply = <&vdd1_reg>;
    };
    };

    Best,

    -Hong

  • Hi Hong-san,

    I could get 300MHz!  Thank you very very much!

    cpu0-supply = <&vdd1_reg

    This line resolved it.

    I can get following result:

    $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
    300000 600000 720000 800000
    
    $ cat /sys/kernel/debug/regulator/regulator_summary
       vdd_mpu                       0    1      0   950mV     0mA   912mV  1350mV
          cpu0                                                       950mV   969mV
       vdd_core                      0    0      0  1100mV     0mA   912mV  1150mV
    
    $ cat /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table
      From  :    To
            :    300000    600000    720000    800000
      300000:         0        27         6        24
      600000:        33         0         6        13
      720000:         7         9         0        15
      800000:        18        16        19         0
    
    $ cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
    300000 37288
    600000 354
    720000 168
    800000 4976

    Best regards.

  • Hello Hong-san,

    we really appreciate your help. I closed this ticket. 

    Best regards,

    Miyazaki