Patches for 2.6.39 kernel

open-nandra
Attachment: mini2440_2.6.39.tar.gz (2.84 KB)
Hello,

I update patches to make mini2440 working on latest 2.6.39-rc kernel.
Patches are sent upstream. But as I know upstream have time ;) you can find
it in attachment.

There is update for all known displays, touchscreen and enable backlight
early at boot time. Enjoy.

marek

davef
I downloaded 2.6.38.2 from kernel.org a few nights ago and had a look at
that.

Where do you find 2.6.39-rc?

Thanks for posting it, when I find the kernel I'll give it a try.

Dave

open-nandra
It is applicable to latest git head. Well ok now is 39 merge window open (I
mixed it up in my head ;)).

marek

davef
Thank you for explaining.  I usually just download the latest stable to
have a look at what is going on.  I try git head as you suggest.

andret
Patches fine into latest stable 2.6.38.2 anyway :)

davef
It was actually 2.6.38.1 that I had downloaded, which now is not obvious on
kernel.org  I'll download 2.6.38.2 next week.

For now when I applied the patches to 2.6.38.1 I got the following:

davef@davef-desktop:~/linux-2.6.38.1/linux-2.6.38.1$ patch -p1 <
0002-s3c2440-mini2440-Add-touchscreen-support-for-mini244.patch
patching file arch/arm/mach-s3c2440/mach-mini2440.c
Hunk #2 succeeded at 544 with fuzz 1 (offset 13 lines).
Hunk #3 FAILED at 554.
Hunk #4 succeeded at 648 (offset 11 lines).
Hunk #5 succeeded at 725 (offset 15 lines).
1 out of 5 hunks FAILED -- saving rejects to file
arch/arm/mach-s3c2440/mach-mini2440.c.rej

In mach-mini2440.c.rej
****************
--- arch/arm/mach-s3c2440/mach-mini2440.c
+++ arch/arm/mach-s3c2440/mach-mini2440.c
@@ -554,6 +560,7 @@
   &uda1340_codec,
   &mini2440_audio,
   &samsung_asoc_dma,
+  &s3c_device_adc,
 };
 
 static void __init mini2440_map_io(void)
*****************

Is this a problem or should I just apply to 2.6.38.2 and forget about this?

Thanks,
Dave

andret
Try to apply kernel patch for 2.6.38.2 and then apply patches from marek...
mine patched and compiled fine on 2.6.38.2 but have not had time to
actually test to see if it boots.

This forum needs new software... hate this interface!

andret
[root@MiniFS ~]# uname -a
Linux MiniFS 2.6.38.2 #1 Tue Mar 29 18:50:53 SAST 2011 armv4tl GNU/Linux
[root@MiniFS ~]#

successful boot and X35LCD test OK

davef
Thanks for the tips, I'll try it after the weekend.

Dave

davef
Patches successfully applied to 2.6.38.2  Well, at least I thought so.

Running <make mini2440_defconfig> and make ./my-config (my configuration
which works fine on 2.6.32.2) fails.

/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:
In function 'bl_trig_invert_show':
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:66:
error: 'struct led_classdev' has no member named 'trigger_data'
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:
In function 'bl_trig_invert_store':
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:75:
error: 'struct led_classdev' has no member named 'trigger_data'
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:
In function 'bl_trig_activate':
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:105:
error: 'struct led_classdev' has no member named 'trigger_data'
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:127:
error: 'struct led_classdev' has no member named 'trigger_data'
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:
In function 'bl_trig_deactivate':
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:134:
error: 'struct led_classdev' has no member named 'trigger_data'
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:
At top level:
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:143:
error: variable 'bl_led_trigger' has initializer but incomplete type
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:144:
error: unknown field 'name' specified in initializer
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:144:
warning: excess elements in struct initializer
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:144:
warning: (near initialization for 'bl_led_trigger')
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:145:
error: unknown field 'activate' specified in initializer
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:145:
warning: excess elements in struct initializer
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:145:
warning: (near initialization for 'bl_led_trigger')
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:146:
error: unknown field 'deactivate' specified in initializer
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:147:
warning: excess elements in struct initializer
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:147:
warning: (near initialization for 'bl_led_trigger')
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:
In function 'bl_trig_init':
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:151:
error: implicit declaration of function 'led_trigger_register'
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:
In function 'bl_trig_exit':
/home/davef/linux-2.6.38.2/linux-2.6.38.2/drivers/leds/ledtrig-backlight.c:156:
error: implicit declaration of function 'led_trigger_unregister'
make[3]: *** [drivers/leds/ledtrig-backlight.o] Error 1
make[2]: *** [drivers/leds] Error 2
make[1]: *** [drivers] Error 2
make[1]: *** Waiting for unfinished jobs....

There are a few errors after this one.

Looks like a LED problem.  I applied the 4 patches is there something else
I should have done?

Thank you.

open-nandra
Well I test it now on 2.6.38.2 with mini2440_defconfig and everything is
builded fine (don;t test to run on target). Please use mini2440_defconfig
everything is enabled by default.

marek

andret
I did:

make mini2440_defconfig ARCH=arm
make menuconfig ARCH=arm

I then edited the cross compiler because I'm using arm-linux-gcc

Then:

make uImage ARCH=arm

Compiled and tested boots fine.. have since added webcam support to kernel
and recompiled fine.

davef
Marek,

Just running mini2440_defconfig completes without errors.

I was use to a different process.  Previously mini2440_defconfig in the
source appeared to be an initial setup file, which you ran and then ran
your own configuration file  (ie, config_mini2440_n35).

> everything is enabled by default

including Full NAT :)

Thanks for making the process clear.

Dave

andret
I'm waiting for my wifi adapter which I ordered off ebay to arrive...
should be here any day now then i will explore the drivers in the latest
kernel to see if i can get wifi to work :)

I am not sure if this has been done yet... seems most people use that one
single recommended wifi adapter.

Webcam is detected now by kernel... just need to figure out what software
to use to take snapshot of what camera see.

davef
Marek,

Just one more question?  As well as pushing the patches upstream you must
have also pushed a new mini2440_defconfig.  Or could you explain how that
gets generated.

Thanks,
Dave

P.S. I can do the Full NAT!

open-nandra
Hi davef,

well basic config is already in mainline. Other option are enabled by
default in Kconfig for mini2440 because Linus hate changing config files
(it's prohibited)

marek

davef
I was aware that all these xxx_defconfig files were placing undue stress on
the system.

I wasn't aware that there was another file that set up defaults for the
mini2440, the "Kconfig for mini2440" file.

Where does this specific Kconfig file reside?  I'll have a look and do some
more reading on the configuration process.

Dave

open-nandra
in arch/arm/mach-s3c2440/Kconfig (search for MINI2440).

marek

davef
I expected something more complex.

The mini2440_defconfig file in the FriendlyArm 2.6.32.2 distros are 50433
bytes, whereas the one in 2.6.38.2 is 8797. Appears that FA make their own
bigger mini2440_defconfig file.

Thanks.

Dave

fatbrain
HI,
I tried patching on 2.6.38.2 but failed. What do I need to do to apply the
patches successfully. Do I need to download another set of patches? If so
from where?

"
patch -p1 < 0001-s3c2440-mini2440-Add-support-for-new-LCD-panels.patch 
patching file arch/arm/mach-s3c2440/mach-mini2440.c
Hunk #1 FAILED at 167.
1 out of 1 hunk FAILED -- saving rejects to file
arch/arm/mach-s3c2440/mach-mini2440.c.rej
"


thanks
--fatbrain

davef
I was able to apply the four patches and enable full NAT.  Everything
booted up without any user intervention.

You put the extracted patches in the source directory?

I am having a small problem the backlight sometimes turns off after 5-10
minutes.

davef
Your command looks correct

davef
Backlight stopping:

running:

echo "1" > /sys/devices/platform/s3c24xx_led.5/leds/backlight/brightness

from a terminal turns the backlight back on, but this is rather difficult
to do on the mini2440 itself!

It there some power management thing that needed to be enabled in the
kernel or what?

Thanks,
Dave

open-nandra
Should be some fb thing. You can re-check (but not sure is backlight is
hooked to fbdev). 

marek

davef
2.6.38.2

Frame buffer hardware drivers

CONFIG_FB_S3C2410=y
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=y
CONFIG_LCD_PLATFORM=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_PWM=y


In the config file for the mini2440_n35 in 2.6.32.2

CONFIG_FB_S3C2410=y
CONFIG_FB_S3C2410_DEBUG=y
CONFIG_FB_S3C2410_N240320=y (for the 3.5" NEC LCD)
CONFIG_BACKLIGHT_MINI2440=y

davef
Doing:
# cat brightness

when in the /sys/devices/platform/s3c24xx_led.5/leds/brightness directory
after bootup shows a result of <0>

So, if you do:

echo "1" > /sys/devices/platform/s3c24xx_led.5/leds/backlight/brightness

within 5 minutes or so after bootup the backlight stays ON.

Where would you place the above line so that it is actioned during bootup? 
I have checked /etc/init.d/rcS and /etc/inittab but I can't find anything
that looks like it has ever been editted.

Thank you.

Dave

davef
Spoke too soon!

If after boot-up, you run the "workaround" above but haven't run an
application, ie just watching the touchscreen it will still go blank after
exactly 8 minutes.

If I run an application after the "workaround", in my case a full screen
web browser (Qt), then it appears to keep going.

andret
davef,

what size screen you using for full screen web browsing?

is the speed any good?

davef
Tried posting this 2 days ago, but website wouldn't accept:

3.5"

Speed quite adequate for my home automation setup.

Should correct my comment about "full screen".  My implementation still has
a navigation bar and tabs.  When I get Qt working I planned to delete the
tabbed function.

The full story is here:
http://www.friendlyarm.net/forum/topic/2106

I had to have a browser the supports the POST command.

Any comments on my backlight problem?

Thanks,
Dave

andret
No comment on the back light but I will probe around and see if I can see
what is happening.

I must admit that although I tested X35 compatibility with these latest set
of patches and confirmed it to be functional, that my current requirements
do not involve the display module and I have actually disconnected it from
the board :)

I know its not a perfect solution but perhaps for the interim setup a cron
to perform:

echo "1" > /sys/devices/platform/s3c24xx_led.5/leds/backlight/brightness

just until we've figured out where the setting is which causes the problem.

andret
also, have you tried to see if it cannot be overwritten with setterm as in:

setterm -blank 0

?

I am not sure... never tried it on the LCD....

andret
Patch & compile fine into 2.6.38.3 :)

[root@MiniFS ~]# uname -a
Linux MiniFS 2.6.38.3 #1 Sat Apr 16 17:49:09 SAST 2011 armv4tl GNU/Linux
[root@MiniFS ~]#

javieralso
Hi everybody.

I'm very interested in learn about kernel development and I have a mini2440
board. 

I'd like to know how to make some changes into the kernel tree in order to
include options for menuconfig for example and I think a good start point
maybe mini2440 kernel patches.

Where can I download the complete patches for apply to a kernel downloaded
from kernel.org? I'd like to examine it and learn.

Thanks in advance and happy 2012.

Cheers.

davef
One way would be to go to :

http://www.pengutronix.de/oselas/bsp/pengutronix/mini2440_bsp_en.html

and download OSELAS.BSP-Pengutronix-Mini2440-2011.12.0.tgz

Extract that and look in:

configs/platform-friendlyarm-mini2220/patches

There might be somewhere else to find them, but from memory finding a
definitive set of patches is "problematical".

javieralso
Hi Davef, thanks for your reply.

I was thingking about to download a patched sources for mini2440 and the
original sources for the same version of the kernel. Later with diff I
could obtain all the patches.

Neverless I'll try to download the patches you said.

Thanks a lot