cpufreq-info only 800MHz but I need 1GHz

Hi folks,

I can’t get 1GHz frequency out of my BBBW using 4.n kernel. The best I can get is 800MHz.

I am running on 5V feed direct feed to P8 and P9 (from my own cape design) and not just USB power connector. (Previous posts have shown USB powered BBB limits the speed to 500MHz due to maximum USB available current.

Any ideas on what to try? I’m running a RT process and it needs full 1GHz speed to run without ‘jitter’.

Many thanks!
Neil

NB I had a similar problem with a BBG last year running 4.9 kernel and had to revert to 3.8 to make it work for that application. I want to stick with 4.x kernel now…

root@beaglebone:/opt/scripts/tools# dmesg |grep freq
[ 1.578637] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 1000000 KHz
[ 1.578687] cpu cpu0: dev_pm_opp_set_rate: failed to find current OPP for freq 1000000000 (-34)
[ 1.589712] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 800000 KHz

root@beaglebone:/home/debian# cpufreq-set -f 1000mhz
root@beaglebone:/home/debian# cpufreq-info
cpufrequtils 008: cpufreq-info © Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: cpufreq-dt
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 300 us.
hardware limits: 300 MHz - 800 MHz
available frequency steps: 300 MHz, 600 MHz, 720 MHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 300 MHz and 800 MHz.
The governor “userspace” may decide which speed to use
within this range.
current CPU frequency is 800 MHz (asserted by call to hardware).
cpufreq stats: 300 MHz:0.00%, 600 MHz:0.00%, 720 MHz:0.00%, 800 MHz:100.00%

root@beaglebone:/opt/scripts/tools# ./version.sh
git:/opt/scripts/:[31292bce1d4b35b497cc7a013d6d57e7e1f4f5c4]
]eprom:[A335BNLTBBWG3997�O
model:[TI_AM335x_BeagleBone_Black_Wireless]
dogtag:[BeagleBoard.org Debian Image 2018-06-17]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
kernel:[4.14.49-ti-r54]
nodejs:[v6.14.3]
device-tree-override:[dtb=am335x-boneblack-wireless.dtb]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/BB-UART1-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr1=/lib/firmware/BB-UART2-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr2=/lib/firmware/BB-BONE-AUDI-01-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr3=/lib/firmware/BB-PWM2-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr4=/lib/firmware/BB-I2C1-FAST-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr5=/lib/firmware/PPS-00A0.dtbo]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.4.20180619.0-0rcnee0~stretch+20180619]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
pkg:[roboticscape]:[0.4.4-git20180608.0-0rcnee0~stretch+20180609]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpi
o pwm eqep admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M
net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 1.054887] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[ 1.056534] gpio-of-helper ocp:cape-universal: ready
END

^ remove this define in /boot/uEnv.txt

Regards,

and i see why you did that, broken eeprom:

GND TP1 and run:

sudo dd if=/opt/scripts/device/bone/bbbw-eeprom.dump
of=/sys/devices/platform/ocp/44e0b000.i2c/i2c-0/0-0050/eeprom

^that's "one" line...

then run:

sudo /opt/scripts/tools/version.sh | grep eeprom

and it "should" show:

A335BNLTBWA50000BBWG0000

Then it'll work out of the box..

Regards,

Thanks Robert.

I did the following with tp1 tied to GND:

NB the EEPROM line is slightly different.

I rebooted (with dtb= line removed from uEnv.txt) and it seems to have worked:

With TP1 tied to GND:

debian@beaglebone:~$ sudo dd if=/opt/scripts/device/bone/bbbw-eeprom.dump of=/sys/devices/platform/ocp/44e0b000.i2c/i2c-0/0-0050/eepro
m
0+1 records in
0+1 records out
28 bytes copied, 0.149895 s, 0.2 kB/s
debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh | grep eeprom
eeprom:[A335BNLTBWA50000BBWG*]

REBOOT

debian@beaglebone:~$ cpufreq-info
cpufrequtils 008: cpufreq-info © Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: cpufreq-dt
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 300 us.
hardware limits: 300 MHz - 1000 MHz
available frequency steps: 300 MHz, 600 MHz, 720 MHz, 800 MHz, 1000 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 300 MHz and 1000 MHz.
The governor “performance” may decide which speed to use
within this range.
current CPU frequency is 1000 MHz.
cpufreq stats: 300 MHz:0.00%, 600 MHz:0.00%, 720 MHz:0.00%, 800 MHz:0.00%, 1000 MHz:100.00%

THANKYOU!
:wink:

Neil

you can set clock after linux is booted, with a c program: http://nixdev.com/?p=330

I have tested before. but 1GHz need higher MPU/CPU core voltage, details can be found with u-boot source code or ref manual.

Hi Robert,

I have the same issue of no available 1000MHz. I have tried updating the eeprom as instructed in this post but no difference.

The output of version.sh is:

`

git:/opt/scripts/:[73593ebe3b7d3cc381eeb502d45ccb33a6ec5e78]
eeprom:[A335BNLTBWA50000BBWG*]
model:[TI_AM335x_BeagleBone_Black_Wireless]
dogtag:[BeagleBoard.org Debian Image 2018-08-30]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2017.01-00006-g55e748eda0]:[location: dd MBR]
kernel:[4.14.69-ti-r75]
nodejs:[v6.14.4]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.4.20180914.0-0rcnee0~stretch+20180914]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
pkg:[librobotcontrol]:[1.0.2-git20180829.0-0rcnee0~stretch+20180830]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 1.043241] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[ 1.044810] gpio-of-helper ocp:cape-universal: ready
END

`

Have you any suggestions? Thanks.
Alan

Hi Robert.

I’m wondering if you could help… I have a BBBW that I can’t get to run at 1000MHz. I tried updating the eeprom as suggested but no difference. Hardware still listed as max 800MHz.

Here is output of version.sh

`

git:/opt/scripts/:[73593ebe3b7d3cc381eeb502d45ccb33a6ec5e78]
eeprom:[A335BNLTBWA50000BBWG*]
model:[TI_AM335x_BeagleBone_Black_Wireless]
dogtag:[BeagleBoard.org Debian Image 2018-08-30]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2017.01-00006-g55e748eda0]:[location: dd MBR]
kernel:[4.14.69-ti-r75]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
pkg:[bb-cape-overlays]:[4.4.20180914.0-0rcnee0~stretch+20180914]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
pkg:[librobotcontrol]:[1.0.2-git20180829.0-0rcnee0~stretch+20180830]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
cmdline:[console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 quiet]
dmesg | grep pinctrl-single
[ 1.043845] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
dmesg | grep gpio-of-helper
[ 1.045079] gpio-of-helper ocp:cape-universal: ready
END

`

Would you have any further suggestions.

Thanks,
Alan

The really old version of U-Boot in the eMMC is blocking proper
construction of the Black Wireless device tree, thus breaking the cpu
node.

Just run:

sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100

and reboot..

Regards,

Wonderful! Thanks so much Robert. worked a charm

Hi Robert,

Having switched to uboot overlays, the kernel bot time has jumped from ~7 seconds to ~30 seconds.

It seems a lot of time is spent here:

`

[ 3.659960] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[ 3.677272] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[ 3.688950] random: udevadm: uninitialized urandom read (16 bytes read)
Begin: Loading essential drivers … done.
Begin: Running /scripts/init-premount … done.
Begin: Mounting root file system … Begin: Running /scripts/local-top … done.
Begin: Running /scripts/local-premount … Scanning for Btrfs filesystems
done.
Begin: Will now check root file system … fsck from util-linux 2.29.2
[/sbin/fsck.ext4 (1) – /dev/mmcblk0p1] fsck.ext4 -a -C0 /dev/mmcblk0p1
rootfs: clean, 59308/217728 files, 487239/869376 blocks
done.
[ 31.794718] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
done.
Begin: Running /scripts/local-bottom … done.
Begin: Running /scripts/init-bottom … done.
[ 32.588641] ip_tables: © 2000-2006 Netfilter Core Team

`

Would you have any suggestions as to why this might be?

It's the initrd, just remove it..

sudo rm /boot/initrd*

Regards,

I ran sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=100

Now my BBB will not boot. What do I do?

Thanks,
Blair

Well you erased the bootloader on the eMMC..

So stick in a new image onto a microSD and boot it..

Regards,

Robert: Thanks for explaining it. I am learning about Linux and BB. I wanted to increase MHz, but made a mistake. It boots from microSD.

How do I re-install the bootloader to the eMMC? I don’t want to write the whole image to eMMC and lose the existing data files.

How do I access the data files on the eMMC?

Thanks,

Simple, you "reflash" the eMMC.. You've nuke the first 100Mb of the
partition...

Regards,

you can mount the emmc and get your files off before you reflash

You should re-read what he actually wrote...

The first 100Mb of the eMMC is now trashed, so no partition table.. :wink:

Regards,

It looks bad, but I want to be sure. Is there any way I can access the data files on the eMMC? And to avoid rebuilding the entire BBB setup? Such as install U-Boot? Or is all BBB data lost?
Blair

On Sun, 23 Jun 2019 14:25:53 -0700 (PDT),
activewholefoods@gmail.com declaimed the
following:

It looks bad, but I want to be sure. Is there any way I can access the data
files on the eMMC? And to avoid rebuilding the entire BBB setup? Such as
install U-Boot? Or is all BBB data lost?

  If you knew what the partition table had been, it might be possible to
reflash the first part of the card restoring a partition table. BUT if the
data partition starts anywhere in the 100MB region, you've lost any data
blocks that had been stored there... And likely will spend hours in fsck
rebuilding whatever is still good, followed by copying everything off and
then reflashing the eMMC with a complete system which I believe will
restore a modern u-boot too (if it didn't, there'd be no way to update old
BBBs from kernel device tree loading to u-boot device tree loading).

Dennis, thanks for explaining an option. I have the original image on mSD. Can that be used to recreate (copy or build) the proper partition table on the eMMC? How is that done? Maybe the data will not be overwritten. If it does not work, I will lose all data anyway when reflash all.

Based on the above dd command (I ran by mistake), maybe from mSD run:
sudo mount /dev/mmcblk1

Then remove mSD and reboot.

But I don’t know if I have all the correct parameters such as block size or count or destination. Thanks for any help.

Blair