Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A13 => Topic started by: elrix2004 on January 04, 2013, 09:03:41 PM

Title: Kernel source code for A13 MICRO
Post by: elrix2004 on January 04, 2013, 09:03:41 PM
I owned a A13 Micro and a 7" LCD with touchscreen with kernel 2.6.X (kernel give by olimex). After some works i can use my touchscreen under X : good.
Now i would like to test some personnal electronics cards. Some of them use an FTDI FT232 USB-serial converter. But the kernel didn't have the driver !
So i've dowloaded a kernel 3.X branch from linux-sunxi, recompile with my needed drivers and then test on A13 Micro... all the time the kernel crash...
After reading the olimex wiki and forum : apparently there is no 3.X kernel for this card just a 2.6.X kernel because this card doesn't have the chip for power management.

So i've two questions :
1- Where can we dowload the 2.6.X patched kernel for A13 _MICRO_ ?
2- and better : Where can we dowload the 3.X kernel for A13 _MICRO_ ?

Thanks in advance for your replies

Olivier
Title: Re: Kernel source code for A13 MICRO
Post by: olimex on January 04, 2013, 11:30:36 PM
you are confused, A13 never used to run with Kernel 2.x
kernel sources are at linux-sunxi.org you have to build it for MICRO there is option for this
use kernel 3.0.x as other kernel branches there are still incomplete and work in progress
Title: Re: Kernel source code for A13 MICRO
Post by: elrix2004 on January 05, 2013, 01:28:59 AM
Thank you for your rapid answer !
I've just check the version of the kernel : 3.0.52+ ... so sorry for the 2.6 version, i don't know why i think it was a 2.6 kernel (well maybe as i use a 2.6 kernel on iMX233)!

I've just read again the news on the wiki :

http://olimex.wordpress.com/2012/11/30/a13-olinuxinio-micro-euro-28-open-source-single-board-computer-is-for-sale/#comments (http://olimex.wordpress.com/2012/11/30/a13-olinuxinio-micro-euro-28-open-source-single-board-computer-is-for-sale/#comments)

and

http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ (http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/)

I use as cross compiler gcc4.7 (armhf) from emdebian and debian wheezy as buid station.
I've clone the u-boot from linux-sunxi and build u-boot , tested on A13 MICRO : all ok
I've clone the linux-sunxi sunxi-3.0 branch and use the default configuration for A13 (A13_defconfig) but 'i've not found a "A13_MICRO_defconfig" :
https://github.com/linux-sunxi/linux-sunxi/tree/sunxi-3.0/arch/arm/configs (https://github.com/linux-sunxi/linux-sunxi/tree/sunxi-3.0/arch/arm/configs)

The build of the kernel with A13_defconfig is OK.
U-boot launch the kernel and the kernel start for approximately 2s and then crash with error : null pointer

Quote[    1.940000] NET: Registered protocol family 15
<6>802.1Q VLAN Support v1.8
[    1.950000] 802.1Q VLAN Support v1.8
<6>VFP support v0.3: [    1.950000] VFP support v0.3: implementor 41 architectur
e 3 part 30 variant c rev 3
implementor 41 architecture 3 part 30 variant c rev 3
<5>Registering SWP/SWPB emulation handler
[    1.970000] Registering SWP/SWPB emulation handler
<6>registered taskstats version 1
[    1.980000] registered taskstats version 1
<1>Unable to handle kernel NULL pointer dereference at virtual address 00000018
[    1.980000] Unable to handle kernel NULL pointer dereference at virtual addre
ss 00000018
<1>pgd = c0004000
[    1.990000] pgd = c0004000
<1>[00000018] *pgd=00000000[    1.990000] [00000018] *pgd=00000000

<0>Internal error: Oops: 5 [#1] PREEMPT
[    2.000000] Internal error: Oops: 5 [#1] PREEMPT
<d>Modules linked in:[    2.000000] Modules linked in:

CPU: 0    Not tainted  (3.0.52 #7)
[    2.000000] CPU: 0    Not tainted  (3.0.52 #7)

So that's the reason of my previous question. As Olimex has compiled a kernel for A13 _MICRO_ where i can find this kernel with the patches ?

On 1st december:
Fadil Berisha ask : Can you post link to kernel sources and patch for PMU removal?
Olimex said : Dimitar submited the patch to Linux-Sunxi mailing list, I don't know if it's included now in the Linux-Sunxi tree

Do you have a response ?

Or maybe i've to change the version of cross compiler (use linaro version) ?
Another solution is buying a "normal" not MICRO A13 but the price of MICRO is the right argument !
May i ask the lunix sunxi guys ?

I've a deadline for a project in July 2013 and i must choose the "right" card now...but i think A13 MICRO + lcd + touchscreen is a good choice

thanks for your awnser...

Olivier
Title: Re: Kernel source code for A13 MICRO
Post by: olimex on January 07, 2013, 09:35:30 AM
I check and linux-sunxi indeed have no MICRO configuration which is odd as Dimitar submited the changes
nevermind you can use https://github.com/hehopmajieh/linux-sunxi to get them
Title: Re: Kernel source code for A13 MICRO
Post by: elrix2004 on January 07, 2013, 11:53:34 AM
Ok thanks for your awnser.
I will try to recompile the kernel this week.

Olivier
Title: Re: Kernel source code for A13 MICRO
Post by: lordlothar on January 08, 2013, 02:27:13 AM
Quote from: olimex on January 07, 2013, 09:35:30 AM
I check and linux-sunxi indeed have no MICRO configuration which is odd as Dimitar submited the changes
nevermind you can use https://github.com/hehopmajieh/linux-sunxi to get them

As I have a similar problem, can you upload a working image on the wiki? The one for A13-olinuxino-micro seems not to work...Isn't it the same which comes with the bootable microSD?
Title: Re: Kernel source code for A13 MICRO
Post by: olimex on January 08, 2013, 10:47:06 AM
just added to the Wiki MD5 chksum
make sure the image you downloaded is with same chksum
and do not forget to sync and umount after you dd your image
Title: Re: Kernel source code for A13 MICRO
Post by: vinifr on January 08, 2013, 01:43:24 PM
Well, I may be wrong. But this problem may be related to the configuration, not the kernel itself.

I am currently developing device drivers linux and I have seen many errors of the type "Unable to handle kernel NULL pointer dereference at virtual address 000000xx", is a very common error. Example: https://github.com/linux-sunxi/linux-sunxi/issues/82#issuecomment-9529037 (https://github.com/linux-sunxi/linux-sunxi/issues/82#issuecomment-9529037)

So, you're enabling a problematic driver in .config, try disabling this driver or use other .config

I use this: http://dl.dropbox.com/u/22273442/A13/.config
Title: Re: Kernel source code for A13 MICRO
Post by: lordlothar on January 08, 2013, 09:16:30 PM
Thanks for the replies.

@viniciusfre

Is that a configuration working with A13-Micro?

Edit: just checked the md5 hash of the wiki image, seems correct.

Edit2: just compiled my own u-boot,my own kernel with a13om_defconfig,built bootable sd, still no luck...Still hangs on 'Starting Kernel...'
Title: Re: Kernel source code for A13 MICRO
Post by: vinifr on January 09, 2013, 03:28:30 PM
This config is for A13-OLinuXino-WIFI. It should also work for MICRO, because wifi driver is marked as module. Do you tried it?

If dont work, you need to make a list of devices that are not present in MICRO and disable these devices. But would not just wifi?
Title: Re: Kernel source code for A13 MICRO
Post by: agross on January 19, 2013, 05:58:34 PM
Hello, I have the same problem.
I've bought a micro, but all the info and config on the net if for its bigger brothers.

If I build the sunxi uboot and kernel, and load them up i get :

CPU: SUNXI Family
Board: A13-OLinuXino
I2C: ready
DRAM: 512 MiB


which is clearly wrong. The board should be A13-OlinuXinoM and dram is 256.

The kernel panics with "Unable to handle kernel NULL pointer dereference at virtual address 000000xx" which seems to be related to how the memory is mapped. I think it has 512M hardcoded all over the place, from the Olinuxino "normal" configurations.

I tried to fiddle with the config in  include/configs/sunxi-common.h amd make a custom bin file with sunxi-tools from the olimex fex, to no avail.

Can anyone help ?
Thanks.
Title: Re: Kernel source code for A13 MICRO
Post by: JohnS on January 19, 2013, 06:19:27 PM
First thing I notice is:

that is the same crash I get with my WIFI board!

I think the RAM amount is not the problem... something else is.

John
Title: Re: Kernel source code for A13 MICRO
Post by: vinifr on January 20, 2013, 04:39:58 PM
Interesting observation of agross! Really this is a big BIG problem,the kernel thinks it has 512MB but actually has only 256MB. My script.fex show:

[dram_para]
dram_baseaddr = 0x40000000
dram_clk = 408
dram_type = 3
dram_rank_num = 1
dram_chip_density = 2048
dram_io_width = 8
dram_bus_width = 16
dram_cas = 9
dram_zq = 0x7b
dram_odt_en = 0
dram_size = 512
dram_tpr0 = 0x42d899b7
dram_tpr1 = 0xa090
dram_tpr2 = 0x22a00
dram_tpr3 = 0x0
dram_tpr4 = 0x0
dram_tpr5 = 0x0
dram_emr1 = 0x0
dram_emr2 = 0x10
dram_emr3 = 0x0

Look dram_size = 512, this may be the problem! Try to generate a new script.fex with the information in your memory, considering 256MB. Tools for this: https://github.com/linux-sunxi/sunxi-tools (https://github.com/linux-sunxi/sunxi-tools)
Title: Re: Kernel source code for A13 MICRO
Post by: vinifr on January 20, 2013, 05:30:00 PM
A possible solution:

Quote
<xman> hi, What happens if my dram_size = 512 in [dram_para], but my board have only 256MB?
<WarheadsSE> xman: which board ?
<xman> https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-MICRO/
...
techn_> with 256MB ram you propably need to disable mali, framebuffer and g2d.. memmap hard coded to somewhere 400-500MB
<techn_> example: https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.0/arch/arm/mach-sun5i/core.c#L222
xman> 64M and 32M is for what?
techn_> 64M mali, 32M for reserved framebuffer(for mali use)
...
<WarheadsSE> xman: then you should be enable appropriately adjust the dram para, but you might need an updated uboot that has a 256M SPL
..
<WarheadsSE> the Wifi has an AXP, which the Mirco doesn't.
<WarheadsSE> That's a big difference.
...
<xman> so, you edit fex, uptade kernel and update u-boot?
<WarheadsSE> yes, fex change, kernel source change, u-boot source change
<WarheadsSE> recompile all.
..
<WarheadsSE> For the moment, they need to use the provided kernel source repository, and the associated uboot.

Chat: http://dl.dropbox.com/u/22273442/A13/micro_fix (http://dl.dropbox.com/u/22273442/A13/micro_fix)
Title: Re: Kernel source code for A13 MICRO
Post by: vinifr on January 24, 2013, 08:07:18 AM
Hi guys,

WarheadsSE' patch was accepted: https://github.com/linux-sunxi/u-boot-sunxi/commit/dcd5ba6ce61b48bfba12d142281924ef1a344fae (https://github.com/linux-sunxi/u-boot-sunxi/commit/dcd5ba6ce61b48bfba12d142281924ef1a344fae)

Now lack kernel patch.  :)
Title: Re: Kernel source code for A13 MICRO
Post by: Cure on January 24, 2013, 03:46:02 PM
Has anyone been able to build their own kernel yet?  If so what exactly did you do to get uboot to show up as 256MB?
Title: Re: Kernel source code for A13 MICRO
Post by: JohnS on January 24, 2013, 04:36:27 PM
I don't think you actually need u-boot to know.  You need the kernel command line to be right.

You can fix u-boot fairly easily: look in board/allwinner/a13_olinuxino
make a similar target and change dram.c so size is 256 instead of 512

I think you'll find hno has already done this and the result is part of Olimex's Linux image.  You can of course copy the part of that image to extract a (binary, ready-made) copy of u-boot.  Look at the u-boot sources to see where it's stored and its length.  But you can avoid all this if you just use Olimex image and replace the kernel on it if you build your own (replace modules and so on as you make changes).

The kernel boot line contains a string like 512@... so you want 256@...

See the earlier posts about this and the page(s) on google such as https://groups.google.com/forum/?fromgroups=#!topic/linux-sunxi/ojjdt4EzH48
Title: Re: Kernel source code for A13 MICRO
Post by: Cure on January 25, 2013, 02:11:54 AM
I tried just now and it booted up, but unfortunatley just replacing the kernel wasn't enough.  The provided image does not not support "every feature", it's still missing UVC video support.  I guess the struggle goes on.
Title: Re: Kernel source code for A13 MICRO
Post by: vinifr on January 25, 2013, 03:02:59 AM
Hi,

WarheadsSE said that successfully booted your olimex-micro, after the changes that he himself made.

He said is needed change uboot(done), kernel(lack) and script.fex. He has not had time to submit the kernel patch...
Title: Re: Kernel source code for A13 MICRO
Post by: Cure on January 25, 2013, 06:53:32 AM
I finally got the uboot to show 256MB.  I'm not familiar with .fex files, can you explain where it goes?  Is there a special way to build it or can I just copy from the /script_GPIO_VGA_800x600 folder?

I compared the boot results from the Olimex image and mine, mine stops booting at the part where it loads SWP/SWPB:


<5>Registering SWP/SWPB emulation handler
[    1.850000] Registering SWP/SWPB emulation handler
<6>registered taskstats version 1
[    1.860000] registered taskstats version 1
<1>Unable to handle kernel NULL pointer dereference at virtual address 00000018
[    1.860000] Unable to handle kernel NULL pointer dereference at virtual address 00000018
<1>pgd = c0004000
[    1.870000] pgd = c0004000
<1>[00000018] *pgd=00000000[    1.870000] [00000018] *pgd=00000000
<0>Internal error: Oops: 5 [#1] PREEMPT
[    1.880000] Internal error: Oops: 5 [#1] PREEMPT
<d>Modules linked in:[    1.880000] Modules linked in:
CPU: 0    Not tainted  (3.0.57 #12)
[    1.880000] CPU: 0    Not tainted  (3.0.57 #12)
PC is at mutex_lock+0x10/0x4c
[    1.880000] PC is at mutex_lock+0x10/0x4c
LR is at axp_clr_bits+0x2c/0xb8
[    1.880000] LR is at axp_clr_bits+0x2c/0xb8
pc : [<c05146c8>]    lr : [<c0398bd8>]    psr: a0000013
sp : cf82bd38  ip : cf82bd48  fp : cf82bd44
[    1.880000] pc : [<c05146c8>]    lr : [<c0398bd8>]    psr: a0000013
[    1.880000] sp : cf82bd38  ip : cf82bd48  fp : cf82bd44
r10: 00000a68  r9 : 00000006  r8 : 00000092
[    1.880000] r10: 00000a68  r9 : 00000006  r8 : 00000092
r7 : 00000092  r6 : 00000018  r5 : 00000000  r4 : cf82bdd0
[    1.880000] r7 : 00000092  r6 : 00000018  r5 : 00000000  r4 :

Title: Re: Kernel source code for A13 MICRO
Post by: JohnS on January 25, 2013, 10:14:04 AM
Make sure you do NOT have config for AXP209.  There is a post on here about where to find the kernel source that Olimex used for the Micro and it allows for the board properly.

There is a guide to FEX on the net if you google for it.

John
Title: Re: Kernel source code for A13 MICRO
Post by: Cure on January 25, 2013, 01:51:55 PM
Can you tell me which uboot git we're supposed to use?

git clone https://github.com/hno/uboot-allwinner.git
or
git clone git://github.com/linux-sunxi/u-boot-sunxi.git

Thanks,
Rob
Title: Re: Kernel source code for A13 MICRO
Post by: JohnS on January 25, 2013, 02:33:27 PM
I don't have Micro but I recall reading about this on here so just look and read.
Or copy working uboot from Olimex SD image for Micro.
Title: Re: Kernel source code for A13 MICRO
Post by: jwischka on January 25, 2013, 03:02:21 PM
Quote from: Cure on January 25, 2013, 01:51:55 PM
Can you tell me which uboot git we're supposed to use?

git clone https://github.com/hno/uboot-allwinner.git
or
git clone git://github.com/linux-sunxi/u-boot-sunxi.git

Thanks,
Rob

The second one is newer, and is probably the one to use going forward.
Title: Re: Kernel source code for A13 MICRO
Post by: Nico on January 25, 2013, 08:18:20 PM
The second one is the one to use, I successfully compile uboot using a13_olinuxino_micro configuration and make it work on my A13 Micro.
I was also able to compile a running kernel for the A13 Micro using the hehopmajieh git repository.
Only doing:
git clone https://github.com/hehopmajieh/linux-sunxi
make ARCH=arm a13om_defconfig
After that I was able to follow the "how to build a bootable debian sd card" of the wiki.
In order to do so I used the script.bin I found on the Debian prebuild image.
And if I boot without the 7 inches being plugged I get to the login part and it works fine.

Now I'd like to make it work with the 7 inches LCD Screen, but that's another story  ;D