Difference between revisions of "Panda How to kernel 3 5 rcx"

From eLinux.org
Jump to: navigation, search
(Created page with "== Introduction == Kernel 3.5 merge widow has closed and 3.5-rc1 has been released. You can download a tarball of the mainline kernel at http://kernel.org/ or you can clone a c...")
 
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
Kernel 3.5 merge widow has closed and 3.5-rc1 has been released.
+
Kernel 3.5 merge window has closed and 3.5-rc1 has been released.
  
 
You can download a tarball of the mainline kernel at http://kernel.org/
 
You can download a tarball of the mainline kernel at http://kernel.org/
Line 9: Line 9:
 
git clone http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 
git clone http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 
cd linux
 
cd linux
git checkout v3.5-rc1
+
git checkout v3.5-rcx
 
</pre>
 
</pre>
  
  
 
''' Important Note '''
 
''' Important Note '''
There has been a lot of work done on the HDMI interface and its related driver omapdrm. Between kernel 3.1 and 3.2-rc1 enough changed so that the Testing section on the HDMI interface is no longer correct. The hdmi init functions are no longer in arch/arm/mach_omap2/board-omap4panda.c. When this situation stabilises, the HDMI testing section below will be updated.  
+
There has been a lot of work done on the HDMI interface and its related driver omapdrm. Between kernel 3.1 and 3.2-rc1 enough changed so that the Testing section on the HDMI interface has been removed from this How-To. The HDMI testing section below will return when the code stabilises.  
  
 
=== rc1 ===
 
=== rc1 ===
  
''' The following seems to be only true for the PandaBoard ES. Tests with a PandaBoard EA3 confirm that the patch is still needed '''
+
Many changes in OMAP and Panda specific code since 3.4 was released. The HDMI, DVI interfaces both work under certain circumstances and properly read the EDID info from the monitor. HDMI sound is now functional. Changes to the WLAN code continue, and WLAN does function as well under the proper circumstances.
 
+
The WLAN no longer requires a patch! The WL12xx driver needs current firmware. When the driver isn't happy, the error messages are somewhat less than useful, however the drivers/firmware are being constantly improved and it would not be a good idea to have the driver support anything but the latest firmware. Still a work in progress.
+
  
 
=== rc4 ===
 
=== rc4 ===
  
resolve nebulous 'Error setting wl12xx data' fix to PandaBoard. "This should be fixed properly for the next merge window so we don't
+
-rc4 has a few omap4 related changes, but nothing specific to the PandaBoard.  
issue error messages merely because a driver is not configured."
+
  
Devicetree-enabled kernels crash during boot due to the UART driver (http://www.spinics.net/lists/linux-omap/msg64921.html). A patch has been proposed and was  merged into the release codebase.
+
=== rc5 ===
 +
 
 +
-rc5 does not have any OMAP or PandaBoard specific changes.  
 +
 
 +
=== rc6 ===
 +
 
 +
Several OMAP4 related changes, but not much, Closing in on the release according to Linus.
  
 
=== rc7 ===
 
=== rc7 ===
  
The WL12xx driver still needs the same patch as used for 3.1 and 3.2. when the driver isn't happy, the error messages are somewhat less than useful, however the drivers/firmware are being constantly improved and it would not be a good idea to have the driver support anything but the latest firmware.
+
Quite a few OMAP changes including:
The race issue that required building as a module has returned and with the modules built in, operation is not consistant.
+
 
 +
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=06b4ba529528fbf9c24ce37b7618f4b0264750e2
 +
 
 +
Which disables the EHCI driver in omap2plus_defconfig. The reasons being:
 +
 
 +
-warning dump during bootup
 +
-hang during suspend
 +
-prevents CORE powerdomain from entering retention during idle (even when no USB devices connected.)
 +
 
 +
I've never seen the warning dump during bootup on either PandaBoard or PandaBoard ES and have never tested for the other issues. So, EHCI is still enabled in the following .config.
 +
 
 +
 
 +
The WL12xx driver on a PandaBoard still needs the same patch as used for 3.1 and 3.2. When the driver isn't happy, the error messages are somewhat less than useful, however the drivers/firmware are being constantly improved and it would not be a good idea to have the driver support anything but the latest firmware.
 +
With the modules built in, operation is not consistent. The PandaBoard ES does not need the patch.
 +
 
  
 
== PandaBoard ES ==
 
== PandaBoard ES ==
Line 41: Line 58:
  
 
== wlan12xx patch ==
 
== wlan12xx patch ==
This patch is still necessary to resolve the issue noted in 3.0, 3.1 and 3.2, the code was moved to twl_common.c.
+
This patch is still necessary to resolve the issue noted in 3.2 and earlier
  
 
[[Media:0001a-omap4-pandaboard-wlan-fix.patch|0001a-omap4-pandaboard-wlan-fix.patch]]
 
[[Media:0001a-omap4-pandaboard-wlan-fix.patch|0001a-omap4-pandaboard-wlan-fix.patch]]
Line 49: Line 66:
 
  patch -p1 < 0001a-omap4-pandaboard-wlan-fix.patch
 
  patch -p1 < 0001a-omap4-pandaboard-wlan-fix.patch
  
The latest wlan firmware is available from git: git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git just copy the contents of the ti-connectivity folder to /lib/firmware/ti-connectivity.
+
NOTE: it applies with offsets which is ok.
  
The patch is no longer necessary for the PandaBoard ES but does not seem to hurt if applied. In addition, the race issue that required building as a module has returned. As part of the code cleanup, the wl12xx and wl12xx_sdio drivers no longer depend on each other. This creates an issue with systems that do not use udev or mdev (with as somewhat fiddly & slow script) to load MODALIAS drivers. The quick solution is to modprobe both, the order no longer matters. Just modprobing wl12xx_sdio will no longer automatically load wl12xx. It is suggested that these 2 drivers be built as modules.  
+
The latest wlan firmware is available from git: git://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git just copy the contents of the ti-connectivity folder to /lib/firmware/ti-connectivity.
 +
 
 +
 
 +
The patch is no longer necessary for the PandaBoard ES but does not seem to hurt if applied. In addition, the race issue that required building as a module has returned. As part of the code cleanup, the wl12xx and wl12xx_sdio drivers no longer depend on each other. This creates an issue with systems that do not use udev or mdev (with a somewhat fiddly & slow script) to load MODALIAS drivers. The quick solution is to modprobe both, the order no longer matters. Just modprobing wl12xx_sdio will no longer automatically load wl12xx.
 +
 
 +
Linaro has added the equivalent patch to their tilt tree:
 +
 
 +
http://git.linaro.org/gitweb?p=landing-teams/working/ti/kernel.git;a=blobdiff;f=arch/arm/mach-omap2/twl-common.c;h=3335b76826f3747013dbff6b7ed4da0d51ff0902;hp=36e05feb92c7e5aae030e0a23f5ef4929797077f;hb=a4b44dff1342b8dfecfed2929ccd58a08bafa964;hpb=2483a772da8c728bc35adad444a14c9d5ded9e70
 +
 
 +
In -rc1 there is an issue with wl12xx_sdio building as a module, so the recommended way (as implememted in the .config) is to build wl12xx as a single module which includes wl12xx, wl12xx_sdio and wl12xx_core. This can then be modprobed on either PandaBoard (with patch) or PandaBoard ES.  
  
  
 
== Building ==
 
== Building ==
Building 3.3 is fairly straight forward.
 
  
Grab the 3.3 sources and use [[Media:config.3.3.1|config.3.3.1]] as the .config  
+
Building 3.5-rc1/rc4/rc5/rc6/rc7 is fairly straight forward.
 +
Grab the 3.5-rc1/4/5/6/7 sources and use [[Media:config.3.5-rc1.1|config.3.5-rc1.1]], [[Media:config.3.5-rc4.1|config.3.5-rc4.1]], [[Media:config.3.5-rc5.1|config.3.5-rc5.1]], [[Media:config.3.5-rc6.1|config.3.5-rc6.1]] or [[Media:config.3.5-rc7.1|config.3.5-rc7.1]] as the .config  
  
The 3.3 .config enables Sound builtin and wl12xx as modules. The builtin sound does not presently work, but the enabled configuration allows USB sound devices, which function properly.
+
The 3.5-rc1/4/5/6/7 .config enables Sound builtin and wl12xx as a single module. The builtin sound works, as does HDMI sound. Note that the HDMI monitor must be plugged in and enabled for the HDMI sound to work.
  
 
Then compile like so:
 
Then compile like so:
Line 67: Line 93:
 
== Testing ==
 
== Testing ==
  
=== fbtest on DVI Port ===
+
=== CPU Frequency Control ===
  
After booting run fbtest to see a nice test pattern from the dvi port.
+
The 3.5-rc5/6/7 .config also enables SmartReflex as well as OMAP frequency scaling. Default governor is set to performance so the CPU will come up at 1008MHz.
  
[[File:fbtest.jpg|240px]]
+
Display the current cpu frequency.
  
=== Switching primary display to the HDMI port --> Currently not functional <-- ===
+
  # cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
Make sure that a monitor is plugged into the HDMI port before doing the following:
+
1008000
  
# Enable HDMI
+
Change to the ondemand governor which will reduce the cpu frequency to 300MHz when idle.
echo "1" > /sys/devices/platform/omapdss/display1/enabled
+
+
# Disable overlay0 (an overlay must be disabled before changing its properties)
+
echo "0" > /sys/devices/platform/omapdss/overlay0/enabled
+
+
# Set the manager of overlay0 to display1 which is HDMI
+
echo "tv" > /sys/devices/platform/omapdss/overlay0/manager
+
+
# Enable overlay0
+
echo "1" > /sys/devices/platform/omapdss/overlay0/enabled
+
  
And content on overlay 0 of primary lcd would be transferred to HDMI. It works similarly for all other overlay's.
+
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
 +
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
 +
300000
  
=== Switching primary display to the DVI port ===
+
The cpu governor seems to work, and on 4430 get stats, but not on 4460 ie. all zeros.
  
See: http://omappedia.org/wiki/Bootargs_for_enabling_display for lots of useful info on the display subsystem. Be aware that the display, manager and overlay numbers don't match the panda configuration.
+
# ls /sys/devices/system/cpu/cpu0/cpufreq/stats/
 +
time_in_state  total_trans    trans_table
  
Make sure that a monitor is plugged into the DVI port before doing the following:
+
For 4460:
  
  # Disable HDMI
+
  # echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "0" > /sys/devices/platform/omapdss/display1/enabled
+
  # cat /sys/devices/system/cpu/cpu0/cpufreq/stats/*
+
  300000 0
  # Disable overlay0 (an overlay must be disabled before changing its properties)
+
  600000 0
echo "0" > /sys/devices/platform/omapdss/overlay0/enabled
+
  800000 0
   
+
  1008000 0
  # Set the manager of overlay0 to display0 which is DVI
+
  0
  echo "lcd2" > /sys/devices/platform/omapdss/overlay0/manager
+
  From :    To
   
+
        :    300000    600000    800000  1008000
  # Enable overlay0
+
  300000:        0        0        0        0
  echo "1" > /sys/devices/platform/omapdss/overlay0/enabled
+
  600000:        0        0        0        0
 +
  800000:        0        0        0        0
 +
  1008000:        0        0        0        0
  
The above commands should be run from the serial console and the cable should be in the destination port before running the commands.
 
  
=== fbtest on HDMI Port --> Currently not functional <-- ===
+
for 4430:
  
Run fbtest to see a nice test pattern from the HDMI port.
+
# echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
 +
# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/*
 +
300000 299
 +
600000 0
 +
800000 1
 +
1008000 1755
 +
2
 +
  From  :    To
 +
        :    300000    600000    800000  1008000
 +
  300000:        0        0        0        0
 +
  600000:        0        0        0        0
 +
  800000:        0        0        0        1
 +
  1008000:        1        0        0        0
  
[[File:fbtest2.jpg|240px]]
+
# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/*
 +
300000 546
 +
600000 0
 +
800000 1
 +
1008000 1755
 +
2
 +
  From  :   To
 +
        :    300000    600000    800000  1008000
 +
  300000:        0        0        0        0
 +
  600000:        0        0        0        0
 +
  800000:        0        0        0        1
 +
  1008000:        1        0        0        0
  
 
=== i2cdetect ===
 
=== i2cdetect ===
Line 135: Line 178:
 
Run the following commands after the PandaBoard is booted:
 
Run the following commands after the PandaBoard is booted:
  
  modprobe wl12xx    ** only if you built the wl12xx drivers as modules
+
  modprobe wl12xx    ** only if you built the wl12xx drivers a module as recommended
modprobe wl12xx_sdio    ** only if you built the wl12xx drivers as module
+
 
  ifconfig wlan0 up
 
  ifconfig wlan0 up
 
  iwconfig wlan0 essid "Your AccessPoint Name"
 
  iwconfig wlan0 essid "Your AccessPoint Name"
Line 149: Line 191:
 
  64 bytes from 74.125.73.99: seq=2 ttl=43 time=51.484 ms
 
  64 bytes from 74.125.73.99: seq=2 ttl=43 time=51.484 ms
 
  64 bytes from 74.125.73.99: seq=3 ttl=43 time=54.108 ms
 
  64 bytes from 74.125.73.99: seq=3 ttl=43 time=54.108 ms
 +
 +
==== WEP ====
 +
Setting up a WEP key is fairly straightforward and is achieved by adding the command:
 +
 +
iwconfig wlan0 key C7EE546141233ECCF3FDF68897
 +
 +
after setting the essid
 +
 +
NOTE: the command:
 +
 +
iwconfig wlan0 key s:panda
 +
 +
would seem to set the key using the ascii passphrase "panda" However, the conversion is not implemented in iwlib (wireless-tools 30-pre9) and will result an a bogus key being set in the wlan.
 +
 +
http://www.powerdog.com/wepkey.cgi can generate hex keys from passphrases and was used to generate C7EE546141233ECCF3FDF68897 from panda.
 +
  
 
=== USB Performance ===
 
=== USB Performance ===

Latest revision as of 16:21, 16 July 2012

Introduction

Kernel 3.5 merge window has closed and 3.5-rc1 has been released.

You can download a tarball of the mainline kernel at http://kernel.org/

or you can clone a copy of mainline kernel with:

git clone http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
cd linux
git checkout v3.5-rcx


Important Note There has been a lot of work done on the HDMI interface and its related driver omapdrm. Between kernel 3.1 and 3.2-rc1 enough changed so that the Testing section on the HDMI interface has been removed from this How-To. The HDMI testing section below will return when the code stabilises.

rc1

Many changes in OMAP and Panda specific code since 3.4 was released. The HDMI, DVI interfaces both work under certain circumstances and properly read the EDID info from the monitor. HDMI sound is now functional. Changes to the WLAN code continue, and WLAN does function as well under the proper circumstances.

rc4

-rc4 has a few omap4 related changes, but nothing specific to the PandaBoard.

rc5

-rc5 does not have any OMAP or PandaBoard specific changes.

rc6

Several OMAP4 related changes, but not much, Closing in on the release according to Linus.

rc7

Quite a few OMAP changes including:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=06b4ba529528fbf9c24ce37b7618f4b0264750e2

Which disables the EHCI driver in omap2plus_defconfig. The reasons being:

-warning dump during bootup
-hang during suspend
-prevents CORE powerdomain from entering retention during idle (even when no USB devices connected.)

I've never seen the warning dump during bootup on either PandaBoard or PandaBoard ES and have never tested for the other issues. So, EHCI is still enabled in the following .config.


The WL12xx driver on a PandaBoard still needs the same patch as used for 3.1 and 3.2. When the driver isn't happy, the error messages are somewhat less than useful, however the drivers/firmware are being constantly improved and it would not be a good idea to have the driver support anything but the latest firmware. With the modules built in, operation is not consistent. The PandaBoard ES does not need the patch.


PandaBoard ES

There is now a PandaBoard ES http://pandaboard.org/content/pandaboard-es which includes an OMAP 4460 at up to 1.2GHz. Several important differences make it important (at the present time) that the MLO/u-boot be specifically crafted for the 4460. The thermal management is not in the mainline 4430 code as yet and therefore the max clock frequency when running the OMAP4460 on the PandaBoard ES with the mainline kernel is 920MHz(same as the OMAP4430).

wlan12xx

wlan12xx patch

This patch is still necessary to resolve the issue noted in 3.2 and earlier

0001a-omap4-pandaboard-wlan-fix.patch

Apply it like so: (from inside the kernel sources directory)

patch -p1 < 0001a-omap4-pandaboard-wlan-fix.patch

NOTE: it applies with offsets which is ok.

The latest wlan firmware is available from git: git://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git just copy the contents of the ti-connectivity folder to /lib/firmware/ti-connectivity.


The patch is no longer necessary for the PandaBoard ES but does not seem to hurt if applied. In addition, the race issue that required building as a module has returned. As part of the code cleanup, the wl12xx and wl12xx_sdio drivers no longer depend on each other. This creates an issue with systems that do not use udev or mdev (with a somewhat fiddly & slow script) to load MODALIAS drivers. The quick solution is to modprobe both, the order no longer matters. Just modprobing wl12xx_sdio will no longer automatically load wl12xx.

Linaro has added the equivalent patch to their tilt tree:

http://git.linaro.org/gitweb?p=landing-teams/working/ti/kernel.git;a=blobdiff;f=arch/arm/mach-omap2/twl-common.c;h=3335b76826f3747013dbff6b7ed4da0d51ff0902;hp=36e05feb92c7e5aae030e0a23f5ef4929797077f;hb=a4b44dff1342b8dfecfed2929ccd58a08bafa964;hpb=2483a772da8c728bc35adad444a14c9d5ded9e70

In -rc1 there is an issue with wl12xx_sdio building as a module, so the recommended way (as implememted in the .config) is to build wl12xx as a single module which includes wl12xx, wl12xx_sdio and wl12xx_core. This can then be modprobed on either PandaBoard (with patch) or PandaBoard ES.


Building

Building 3.5-rc1/rc4/rc5/rc6/rc7 is fairly straight forward. Grab the 3.5-rc1/4/5/6/7 sources and use config.3.5-rc1.1, config.3.5-rc4.1, config.3.5-rc5.1, config.3.5-rc6.1 or config.3.5-rc7.1 as the .config

The 3.5-rc1/4/5/6/7 .config enables Sound builtin and wl12xx as a single module. The builtin sound works, as does HDMI sound. Note that the HDMI monitor must be plugged in and enabled for the HDMI sound to work.

Then compile like so:

make ARCH=arm CROSS_COMPILE=Path_to_your/arm-2010q1/bin/arm-none-linux-gnueabi- uImage

Testing

CPU Frequency Control

The 3.5-rc5/6/7 .config also enables SmartReflex as well as OMAP frequency scaling. Default governor is set to performance so the CPU will come up at 1008MHz.

Display the current cpu frequency.

# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
1008000

Change to the ondemand governor which will reduce the cpu frequency to 300MHz when idle.

echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
# cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
300000

The cpu governor seems to work, and on 4430 get stats, but not on 4460 ie. all zeros.

# ls /sys/devices/system/cpu/cpu0/cpufreq/stats/
time_in_state  total_trans    trans_table

For 4460:

# echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/*
300000 0
600000 0
800000 0
1008000 0
0
  From  :    To
        :    300000    600000    800000   1008000 
  300000:         0         0         0         0 
  600000:         0         0         0         0 
  800000:         0         0         0         0 
 1008000:         0         0         0         0 


for 4430:

# echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/*
300000 299
600000 0
800000 1
1008000 1755
2
  From  :    To
        :    300000    600000    800000   1008000 
  300000:         0         0         0         0 
  600000:         0         0         0         0 
  800000:         0         0         0         1 
 1008000:         1         0         0         0 
# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/*
300000 546
600000 0
800000 1
1008000 1755
2
  From  :    To
        :    300000    600000    800000   1008000 
  300000:         0         0         0         0 
  600000:         0         0         0         0 
  800000:         0         0         0         1 
 1008000:         1         0         0         0 

i2cdetect

You can run i2cdetect and the results should look like this:

# i2cdetect -y -r 1
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- UU UU UU UU -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

wlan

Run the following commands after the PandaBoard is booted:

modprobe wl12xx    ** only if you built the wl12xx drivers a module as recommended
ifconfig wlan0 up
iwconfig wlan0 essid "Your AccessPoint Name"
udhcpc -i wlan0

If your network is set up to provide DHCP services, the PandaBoard will get all the "right stuff(tm)" and you will be able to access the Internet.

# ping www.google.com
PING www.google.com (74.125.73.99): 56 data bytes
64 bytes from 74.125.73.99: seq=0 ttl=43 time=62.683 ms
64 bytes from 74.125.73.99: seq=1 ttl=43 time=54.077 ms
64 bytes from 74.125.73.99: seq=2 ttl=43 time=51.484 ms
64 bytes from 74.125.73.99: seq=3 ttl=43 time=54.108 ms

WEP

Setting up a WEP key is fairly straightforward and is achieved by adding the command:

iwconfig wlan0 key C7EE546141233ECCF3FDF68897

after setting the essid

NOTE: the command:

iwconfig wlan0 key s:panda 

would seem to set the key using the ascii passphrase "panda" However, the conversion is not implemented in iwlib (wireless-tools 30-pre9) and will result an a bogus key being set in the wlan.

http://www.powerdog.com/wepkey.cgi can generate hex keys from passphrases and was used to generate C7EE546141233ECCF3FDF68897 from panda.


USB Performance

Insert a USB memory stick into one of the usb ports

Run dmesg to see what sdx the stick was recognised as, then:

hdparam -tT /dev/sdx

If you run the same command on a desktop Linux system, with the same USB memory stick, the PandaBoard's speed should roughly be the same.