How do you build and run the PM kernel?

How do you guys build the PM kernel by Kevin Hilman, and what .config-
file do you use?
http://git.kernel.org/?p=linux/kernel/git/khilman/linux-omap-pm.git;a=summary

I am able to build the kernel, and run it with "ramdisk.gz" and
"boot.scr" taken from:
http://code.google.com/p/beagleboard/wiki/BeagleboardRevCValidation

-but I do not have the features Kevin describe here, fx. "cpufreq-
info":
http://elinux.org/OMAP_Power_Management

My questions:
-How do you configure the kernel after checkout?
-What root-file-system do you use?
-What "bootcmd" and "bootargs" do you use?

Thanks,
Quist

This is what I do:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git
cd linux-omp-pm
git checkout -b pm origin/pm
#apply patch from http://patchwork.kernel.org/patch/47089/ (else it
will stall after "... done, booting the kernel")
ARCH=arm
PATH=/OE/angstrom-dev/cross/armv7a/bin:/OEangstrom-dev/staging/i686-
linux/usr/bin:$PATH
make CROSS_COMPILE=arm-angstrom-linux-gnueabi- distclean
make CROSS_COMPILE=arm-angstrom-linux-gnueabi- omap3_beagle_defconfig
make CROSS_COMPILE=arm-angstrom-linux-gnueabi- menuconfig # enable
all in "CPU Power Management" and "Power management options". Enable
"Kernel low-level debugging functions" and disable "USB Gadget
Support"
make CROSS_COMPILE=arm-angstrom-linux-gnueabi- uImage

I use openembedded to build pm and non-pm kernels. OE includes patches and known good configs to make them work.

regards,

Koen

Hi Koen,

Maybe you can write a short Wiki on how to choose which Kernel OE/Bitbake/Angstrom will build?
Default is a .21 kernel I believe?

If this already exist then a pointer of where would be great!

Wkr,
Joep

2009/9/24 Koen Kooi <koen@beagleboard.org>

That sounds good Koen, it makes it a lot easier!

How do I tell OE to use pm-kernel instead? Do I need to specify it in the local.conf file? And How?

Thanks,
Quist

2009/9/24 Koen Kooi <koen@beagleboard.org>

Hi Koen,

Maybe you can write a short Wiki on how to choose which Kernel OE/Bitbake/Angstrom will build?

I don't write wikis since they go out of date way too quickly to be usefull and I end up with people following outdated instructions.

Default is a .21 kernel I believe?

.21 is so 5 years ago, try .29.

Hi Koen,

ACK! The question is how to select which Kernel to build with
OE/BB/Angstrom?

-----Oorspronkelijk bericht-----

I got stuck in the same problem,the linux kernel isn't compatible
with the root file system,i want to build a root file system image
with the linux kernel i choose (enabled pm )

how ca I make tht???

plz helpppppppp

From: tarek.attia [mailto:tarek.m.attia@gmail.com]
Sent: Friday, November 13, 2009 9:44 AM
To: Beagle Board
Subject: [beagleboard] Re: How do you build and run the PM kernel?

I got stuck in the same problem,the linux kernel isn't compatible
with the root file system,i want to build a root file system image
with the linux kernel i choose (enabled pm )

how ca I make tht???

plz helpppppppp

The way this works is that we help you and then you get to write the wiki.
First, you have to give us some background on what it is that you want to
do. Also, tell us what you have tried so far and then we will help guide
you. If you want to build a PM kernel, you can do this using Angstrom, or
you can build the PM kernel directly from GIT and add the patches that
Angstrom use. If you have installed Angstrom, then the PM recipes in
openembedded/recipes/linux will show you how to build a PM kernel. Look at
linux-omap-pm_git.bb for example. The SRC_URI shows you the GIT used to
retrieve the source, the SRCREV gives you the Shar1 to checkout the correct
release in GIT, and the SRC_URI_append are the patches you should apply.

You should learn how to use Angstrom and also how to use GIT.

I think with Angstrom, you can just use
bitbake linux-omap-pm
and this will build the PM kernel for you.

If you want to do this manually, then it is a little more complicated:
Create a folder for your GIT repositories.
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/khlman/liinux-omap-pm.git;prot
ocol=git;branch=pm
cd linux-omap-pm
git checkout 7c5cb78 -b MyPMKernel
cp $OETREE/openembedded/recipes/linux/linux-omap-pm/beagleboard/defconfig
.config
make xconfig
"Make any changes you need, such as enabling specific drivers, etc"
make uImage
"The file you will need, which is uImage in this folder arch/arm/boot"

I hope this helps.

Regards
John

Hi John and everyone reading,

One question remains;
- Where/what do we need to change to build a linux-omap-pm instead of
linux-omap kernel when building e.g. beagleboard-demo-image ?

It should be defined somewhere, but can't find it :frowning:

Thanks for your time,
Joep

Hi John and everyone reading,

One question remains;
- Where/what do we need to change to build a linux-omap-pm instead of
linux-omap kernel when building e.g. beagleboard-demo-image ?

It should be defined somewhere, but can't find it :frowning:

conf/machine/beagleboard.conf

Philip

Philip,

I've added: PREFERRED_PROVIDER_virtual/kernel = "linux-omap-pm"
Should that work?

Wkr,
Joep

Finally… The solution that works for me:
/openembedded/conf/machine/include/omap3.inc → remove PREFERRED_PROVIDER_virtual/kernel line
/openembedded/conf/machine/beagleboard.conf → add PREFERRED_PROVIDER_virtual/kernel = “linux-omap-pm”
/openembedded/recipes/linux/linux-omap_2.6.29.bb → remove DEFAULT_PREFERENCE_beagleboard = "1
/openembedded/recipes/linux/linux-omap_2.26.27 till 2.26.28 → add DEFAULT_PREFERENCE = “-1”
/openembedded/recipes/linux/linux-omap-pm_git.bb → add DEFAULT_PREFERENCE_beagleboard = “1”

Can someone comment on this; Is this the “preferred way” of doing, or is there a better way?
I had to remove the PREFERRED line from omap3.inc otherwise both the normal and pm kernel got made (with an error that both provide virtual/kernel).

Wkr,
Joep

2009/12/11 Duckyduck <joepschroen@gmail.com>

With steps mentioned in my previous post I can now build a kernel that
identifies with:
Angstrom/2.6.30+2.6.31rc1-pm1+gi
[ 0.000000] Linux version 2.6.31-rc1-omap1 (beagle@localhost.localdomain)
(gcc version 4.3.1 (GCC) ) #1 Sat Dec 12 06:03:21 EST 2009

Unfortunately it doesn't do its job quite well, got these errors and
warnings during boot:
[ 0.000000] twl4030_usb twl4030_usb: Initialized TWL4030 USB module
[ 0.000000] nop_usb_xceiv nop_usb_xceiv: can't register transceiver, err:
-16
[ 0.000000] nop_usb_xceiv: probe of nop_usb_xceiv failed with error -16
[ 0.000000] usbcore: registered new interface driver usbfs
        
My USB hub connected to the HOST connection does not come up, maybe related
to this one?

Altough later I get this:
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
Clock usbhost_48m_fck didn't enable in 100000 tries
ehci-omap ehci-omap.0: OMAP-EHCI Host Controller
ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1

ehci-omap ehci-omap.0: irq 77, io mem 0x48064800
ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.0
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected

This suggests to me that the hub is found??

Beside that I also get warning like:

Platform driver 'musb_hdrc' needs updating - please use dev_pm_ops

Platform driver 'omapdss' needs updating - please use dev_pm_ops
Platform driver 'serial8250' needs updating - please use dev_pm_ops
Platform driver 'gpio-keys' needs updating - please use dev_pm_ops
Platform driver 'twl4030_rtc' needs updating - please use dev_pm_ops
Platform driver 'omap_wdt' needs updating - please use dev_pm_ops
Platform driver 'mmci-omap-hs' needs updating - please use dev_pm_ops
Platform driver 'omap-led' needs updating - please use dev_pm_ops
Platform driver 'soc-audio' needs updating - please use dev_pm_ops
             
Anyone that has some pointers on where to look?

@Joep:

  I tried building using your instructions and got the same Angstrom/
2.6.30+2.6.31rc1-pm1+gi image:

----console message----
## Booting kernel from Legacy Image at 80300000 ...
   Image Name: Angstrom/2.6.30+2.6.31rc1-pm1+gi
  ...

Dear All,
I've tried to build the pm kernel as well for the project I'm
currently working on, but as Hari mentioned, the "cpufreq" directory
and commands are not available. Here's what I've done so far:
- pulled both the main branch (2.6.33) and the pm branch (latest as of
this morning) from their respective git repositories;
- enabled all features in both CPU power management and power
management options;
- built both kernels' uImages using gcc (not using OE); and
- copied the uImages to SD card and ran them on beagleboard.

Both run properly and launch the shell, but somehow I can find neither
the cpufreq directory nor the cpufreq- commands in usr/bin. Did I miss
any steps along the way? Or do I need to use OE so that it builds the
file system required? Any help is appreciated. Thanks.

-Aji

Hi Aji.,

  I was working with OE/Angstrom environment and all I had to do was
to choose 2.6.29-r46 PM kernel instead of the default PM kernel (which
is 2.6.31 i guess). If you are not particular about using the latest
PM-kernel, mebbe this can work for you.

  For cpufreq-utils, you will have to install it separately. See
http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html.
If you succeed in installing it, please post back your solution. I am
facing the following problem with libtool:

  /usr/bin/libtool: line 371: CDPATH: not found
  /usr/bin/libtool: line 1079: func_opt_split: not found
  libtool: Version mismatch error. This is libtool 2.2.4, but the
  libtool: definition of this LT_INIT comes from an older release.
  libtool: You should recreate aclocal.m4 with macros from libtool
2.2.4
  libtool: and run autoconf again.

-hari

Hi All,

I have to config kernel:
1. enable [ CPU Power Management->CPU Frequency scaling ]
2. set [ Default CPUFreq governor->performance ]
        This sets the frequency statically to the highest frequency supported
by the CPU.
3. check cpufreq:
            cd /sys/devices/system/cpu/cpu0/cpufreq/
            cat scaling_available_frequencies
                550000 500000 250000 125000
            cat scaling_max_freq
                550000
            cat cpuinfo_cur_freq
                550000
            cat scaling_cur_freq
                550000
       so, cpufreq is 550Mhz now.

Best Regards,
George Qiao

I see u-boot is built using codesourcery, but the kernel using OE. I
tried to build the kernel
using codesourcery, build failed in some options. Why can't we build u-
boot and uImage using same cross compiler?

For angstrom everything is built with the same compiler

After quilting patches, I managed to build kernel image using
codesourcery, then copied Image as uImage.bin. After reboot, I got
Wrong Image Format for bootm command. What makes the kernel image
doesn't work as see follows?

U-Boot 2009.11-rc1 (Jan 08 2010 - 21:19:52)

OMAP3530-GP ES3.1, CPU-OPP2 L3-165MHz
OMAP3 Beagle board + LPDDR/NAND
I2C: ready
DRAM: 256 MB
NAND: 256 MiB
*** Warning - bad CRC or NAND, using default environment

In: serial
Out: serial
Err: serial
Board revision C4
Die ID #1978000400000000040365fa1700e01a
Hit any key to stop autoboot: 0
mmc1 is available
reading boot.scr

603 bytes read
Running bootscript from mmc ...
## Executing script at 82000000
reading uImage.bin

3812320 bytes read
***** Kernel: /dev/mmcblk0p1/uImage.bin *****
reading ramdisk.gz

7999649 bytes read
***** RootFS: /dev/mmcblk0p1/ramdisk.gz *****
Wrong Image Format for bootm command
ERROR: can't get kernel image!