Working mini2440 linux-2.6.37-1 kernel, files/patches/info included.

225 views
Skip to first unread message

chri...@christianroessler.net

unread,
Feb 22, 2011, 6:18:39 AM2/22/11
to mini...@googlegroups.com
Hello world,

I had time this weekend to review the current stable kernel which is
2.6.37-1 at the time of writing and created patches against buserrors
linux-2.6.32-rc8 version.

It was more or less easy. Lots of work was done by the kernel
maintainers to
include most of the ugly stuff into mainstream (ts), so "just" adding
touchscreen-activation by kernel-parameters (mini2440=...) and display
configurations had to be made.

A direct patch from buserrors kernel (2.6.32-x) against 2.6.37-1 was
not
successfull because a lot of work has undergone the ach/arm directories
after
Linus was mentioning the uglyness and sheer limitless arm-archs/plats
default-configs and what a mess this is.

Therefore arch/arm/plat-samsung and /arch/arm/mini-24xx was introduced
and many
23c* code had been moved from mini-24** into its correspndig locations,
made it
overall easier to create patches after this point.

I created patches from buserrors kernel against a vanilla 2.6.32-rc8,
manually
check the patches, google a bit, read some kernel-mailinglist entrys
and
finally patch the 2.6.37-1 with it. After several trial and error
make's i got
the thing up and running.

I want to thank buserror for his initial work bringing mini2440 to life
and
the arch/arm kernel maintainers to introduce a lot of patches into
mainstream
kernel over the last months, making it all a lot easier now.

=== Attached are a few files:

console-output
(http://www.christianroessler.net/downloads/mini2440/linux-2.6.37-1_mini2440/console-output)
The console output when booting mini2440, from uboot until login.
Just for documentation purposes. I know, my sd-card has a few bad
sectors.

devices-and-additonal-info
(http://www.christianroessler.net/downloads/mini2440/linux-2.6.37-1_mini2440/devices-and-additonal-info)
A simple ls /sys/... in the running system (which is a rather old
emdebian) to
see that (hopefully) all devices are there.

linux-2.6.37-1-mini2440.patch
(http://www.christianroessler.net/downloads/mini2440/linux-2.6.37-1_mini2440/linux-2.6.37-1-mini2440.patch)
The linux kernel 2.6.37-1 patchfile itself. Feel free to run it against
the
latest stable "2.6.37-1" available on www.kernel.org.

mini2440_defconfig
(http://www.christianroessler.net/downloads/mini2440/linux-2.6.37-1_mini2440/mini2440_defconfig)
This is my mini2440 kernel configuration file. I included some
nonsestuff here,
like powersaving-governors and ipv6. Just to play around. Feel free to
kick
this stuff out if you don't need it.

=== Questions
I don't know whether all mini2440 devices are recognized correctly and
if all
required modules are compiled either into the kernel or as module.
Can someone point me to details/readme's on how to determine a
successfull
build which includes all devices populated on the samsung SoC ?

=== Additional fix
I have had several problems getting the kernel to recognize my sdcard
which
holds my roofs. I made it "working" enabling "mmc debug". But this was
not a
nice thing to do, because it was utterly slow, filled my dmesg-log,
hitted
the /var/log partition on the card hard and was ugly.
I patched the sd-host-code after some googling
(drivers/mmc/host/s3cmci.c).
The sd/mmc patch is included in the big patchfile. Kudos to the
original author,
I don't know where i found the 2 lines of code anymore.

=== How to apply the patch / build your own kernel
Download vanilla / unpatched kernel from www.kernel.org
-> http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.37.1.tar.bz2

Extract into a folder, cd into it
run patch -p1 < PATH-TO-PATCHFILE.patch

Put "mini2440_defconfig" into arch/arm/configs folder,
overwriting existing configfiles. Or backup your existing file first,
it's up
to you.

Setup your toolchain.
Run "make mini2440_defconfig".
Run "make menuconfig" to refine the configuration or run simliar
commands.
Run "make" to compile
Run "make uImage" to create uImage for uboot or anything else, whatever
you
prefer and need.


Cheers,
Christian

M P

unread,
Feb 22, 2011, 6:38:08 AM2/22/11
to mini...@googlegroups.com
Good work Christian ! ;-)

Do you want to break these down into "manageable" patches using git
and re-post them ? I'll merge them with my stuff and push upstream if
you like. I got a few others that could be piggybacked.

FIY I use a much more recent kernel than the one in git myself, but I
had been reluctant to post it over the last year or so for "political"
reasons; now that at least one person made one effort to do stuff I
feel it could be time to relive this branch ;-) I got a rather
fantastic (or so I'm told) distro builder thede days called "minifs"
that I've meat to re-release. I can make a minimal distro in less than
2MB (including kernel!) and general boots in about 4 seconds..

Michael
PS: I also replied inline :

On Tue, Feb 22, 2011 at 11:18 AM, <chri...@christianroessler.net> wrote:
>
> === Questions
> I don't know whether all mini2440 devices are recognized correctly and if
> all
> required modules are compiled either into the kernel or as module.
> Can someone point me to details/readme's on how to determine a successfull
> build which includes all devices populated on the samsung SoC ?

I do have bits and pieces like PWM, ADC etc configured here. More or
less pretty much everything on the board. Did you do these ?

>
> === Additional fix
> I have had several problems getting the kernel to recognize my sdcard which
> holds my roofs. I made it "working" enabling "mmc debug". But this was not a
> nice thing to do, because it was utterly slow, filled my dmesg-log, hitted
> the /var/log partition on the card hard and was ugly.
> I patched the sd-host-code after some googling (drivers/mmc/host/s3cmci.c).
> The sd/mmc patch is included in the big patchfile. Kudos to the original
> author,
> I don't know where i found the 2 lines of code anymore.

I had a similar patch for another s3c project I'm working on. Also
have you tried "rootwait=" ? Also, SOME cards just won't work,
regardless of the efforts. It seems some take a long time to "power
up" and/or return invalid early replies thst screw up the driver..

Michael

Edwin van den Oetelaar

unread,
Feb 22, 2011, 7:37:13 AM2/22/11
to mini...@googlegroups.com
May thanks for your great effort.
This helps a lot of people (including me :-) )
Regards,
Edwin

Shannon Haworth

unread,
Feb 22, 2011, 8:26:03 AM2/22/11
to mini...@googlegroups.com
Many, many, many thanks! The community owes you and buserror a huge
debt of gratitude.

Thanks again,

Shannon

Christian Rößler

unread,
Feb 22, 2011, 8:36:08 AM2/22/11
to mini2440
On Feb 22, 12:38 pm, M P <buser...@gmail.com> wrote:
> Good work Christian ! ;-)
>
> Do you want to break these down into "manageable" patches using git
> and re-post them ? I'll merge them with my stuff and push upstream if
> you like. I got a few others that could be piggybacked.

Did you mean "one file one patch"?
git -diff against what repository? git.kernel.org or your repo? Well,
kernel.org's git makes more sense :)
Thats pretty simple to do, will do so tomorrow. Haven't got internet
@home because i moved a week ago, so have to use the net from @work.

> FIY I use a much more recent kernel than the one in git myself, but I
> had been reluctant to post it over the last year or so for "political"
> reasons; now that at least one person made one effort to do stuff I
> feel it could be time to relive this branch ;-)

Of course, feel free to update your repository. Your git-repo is
mentioned everywhere in any mini2440-tutorial i encountered, so this
makes sense.

> I got a rather
> fantastic (or so I'm told) distro builder thede days called "minifs"
> that I've meat to re-release. I can make a minimal distro in less than
> 2MB (including kernel!) and general boots in about 4 seconds..

That sounds great. I am pretty happy with my customized emdebian but
open for any new and great stuff. Let us hear about any progress you
make.
Is there any site available with more information yet? I did google
for it but found nothing to be mentioned.

> > === Questions
> > I don't know whether all mini2440 devices are recognized correctly and if
> > all
> > required modules are compiled either into the kernel or as module.
> > Can someone point me to details/readme's on how to determine a successfull
> > build which includes all devices populated on the samsung SoC ?
>
> I do have bits and pieces like PWM, ADC etc configured here. More or
> less pretty much everything on the board. Did you do these ?
>

Yes, I compiled any s3c24* stuff found. So I'm pretty sure anything is
compiled in and should work, but I want to be sure.
According to "devices and additonal info" file I linked I got anything
there:

----------------------
mini2440:/sys/devices# ls platform/
dm9000 s3c2410-rtc s3c2440-uart.0 s3c24xx-iis
s3c24xx_led.5
gpio-keys s3c2410-wdt s3c2440-uart.1 s3c24xx_led.1
s3c24xx_uda134x.0
power s3c2440-i2c s3c2440-uart.2 s3c24xx_led.2 uevent
s3c2410-lcd s3c2440-nand s3c2440-usbgadget s3c24xx_led.3
s3c2410-ohci s3c2440-sdi s3c24xx-adc s3c24xx_led.4

mini2440:/sys/devices# ls system/
clocksource cpu s3c2440-core s3c2442-core s3c24xx-dma timekeeping
timer

mini2440:/sys/devices# ls virtual/
bdi gpio input misc net tty vtconsole
block graphics mem mtd sound vc
--------------------

Should be everything ...

> > === Additional fix
> > I have had several problems getting the kernel to recognize my sdcard which
> > holds my roofs. I made it "working" enabling "mmc debug". But this was not a
> > nice thing to do, because it was utterly slow, filled my dmesg-log, hitted
> > the /var/log partition on the card hard and was ugly.
> > I patched the sd-host-code after some googling (drivers/mmc/host/s3cmci.c).
> > The sd/mmc patch is included in the big patchfile. Kudos to the original
> > author,
> > I don't know where i found the 2 lines of code anymore.
>
> I had a similar patch for another s3c project I'm working on. Also
> have you tried "rootwait=" ? Also, SOME cards just won't work,
> regardless of the efforts. It seems some take a long time to "power
> up" and/or return invalid early replies thst screw up the driver..

Yes, I was aware of that setting (rootwait=xx) and already using it.
Also tried with several new and used cards from different vendors and
sizes, some sdhc, some not. None of them worked unless activating "mmc
debug" or patching the kernel. Bill (from station51.net) had some
posts in his blog about this issue and recommended using rootwait,
this was the first post I encountered having the same problem.
Anyway, patching the file/kernel helped here. Not sure if it has any
side effects.
Currently i am using "rootwait=4" in uboot plus the patched kernel.
Any card I own is being recognized now. And despite some block-errors
on a very old/cheap card everything is good.

>
> Michael

Christian

PS: thanks for your feedback :)

Christian Rößler

unread,
Feb 22, 2011, 10:21:33 AM2/22/11
to mini2440

M P

unread,
Feb 22, 2011, 10:26:55 AM2/22/11
to mini...@googlegroups.com
Thanks for that. having a diff on -1 is not very practical, as you
can't easily rebase on further kernels...

Michael

Fundu

unread,
Feb 27, 2011, 5:46:49 PM2/27/11
to mini...@googlegroups.com
Thank you Christian and Buserror.



Thomas Martitz

unread,
Mar 5, 2011, 6:46:17 AM3/5/11
to mini...@googlegroups.com
Am 22.02.2011 16:26, schrieb M P:
> Thanks for that. having a diff on -1 is not very practical, as you
> can't easily rebase on further kernels...
>
> Michael
>
> On Tue, Feb 22, 2011 at 3:21 PM, Christian R��ler

I wonder if this work can be pushed to
http://repo.or.cz/w/linux-2.6/mini2440.git ?

Best regards.

Michel Pollet

unread,
Mar 5, 2011, 6:55:55 AM3/5/11
to mini...@googlegroups.com, mini...@googlegroups.com
It's on my plate, but I'm on holidays ATM :-)

M

--
Sent from the iPad

On 5 Mar 2011, at 11:46, Thomas Martitz <thomas....@student.htw-berlin.de> wrote:

> Am 22.02.2011 16:26, schrieb M P:
>> Thanks for that. having a diff on -1 is not very practical, as you
>> can't easily rebase on further kernels...
>>
>> Michael
>>

>> On Tue, Feb 22, 2011 at 3:21 PM, Christian Rößler

Reply all
Reply to author
Forward
0 new messages