Xenomai for A13 - A10

Started by crubille, February 04, 2013, 10:55:17 PM

Previous topic - Next topic

crubille

#75
So i test my patch for some hours without problems.

Running latency, worst case are not very low (100 us), but lower are a bit hight (11 us) and 25 average.
As i set options like ipipe/trace it can be a part of this delay.
In kernel mode, the delay are not a lot better, but in-kernel timer handler is around 4-5 us average and worst case around 40-50 us.

So, there is still things to do, but it is useable at least to play.
You can find the patch at this adress:

http://www.crubille.lautre.net/xenomai_sun5i/ipipe-core-3.4.6-sun5i.alpha.patch

The patch is for a sunxi 3.4.24, as the 3.4 kernel is not a stable version, if you get newer kernel, the patch would have some offset, which mostly dont care, but if it fail or you get problems, let me known.

There is nothing particular to do for installation, use the script as xenomai patch and apply the xenomai procedure.



crubille

I reread (part of) the post, as i am searching where you are with PLL6.

I read that uminded ask me where i found the procedure i apply to insert my code, here it is:
http://www.xenomai.org/index.php/I-pipe-core:ArmPorting#Timer_issues


About PLL6, i do first attempt to use it, changing only that from a running kernel, and in a second time adapting ticks on the timer, then reducing rate at 100MHz.
In any case, the kernel hang before sending me anything.

Has anybody see it working?

So, as PLL6 look to be used only for SATA, it is not sure it is configured at boot for sun5i, but even it is not sure it is not a collateral casualty from removing sata to get A13.

I think the good way to check it is to configure it in a standart kernel (no xenomai), and just read timer2 to check it has anything to count.



crubille

AT this time, i rebuild a kernel removing the potential source of low perfs (i am not sure A13 don't go to various sleep mode).

Then, i want to check if it is possible to use PLL6/6 as i say in the previous message.

And i get now all the info (http://dl.linux-sunxi.org/A10/A10%20User%20Manual%20-%20v1.20%20%282012-04-09,%20DECRYPTED%29.pdf) to program priority irq, which is an interesting issue.

uMinded

#78
Thanks for all the work, my board will be here tomorrow morning so when I get home I can start doing some serious testing.

github.com/iceblu3710/linux-sunxi-xenomai

The currently updated working branch is a13-olinuxino and it has the I-Pipe patch already applied. The current problem to work on is getting timer2 set up 100%

crubille

Hey i look at my script.fex:

PLL6 is defined at ... 720 ::) ???

So no chance to get a 200 MHz clock, PLL6/6 can be nothing else that 120 MHz!

PLL6 can be changed in the script, but it is used by MALI.


There is another point, but it is not only for this topic.

uMinded

Quote from: crubille on February 22, 2013, 09:00:06 PM
Hey i look at my script.fex:

PLL6 is defined at ... 720 ::) ???

So no chance to get a 200 MHz clock, PLL6/6 can be nothing else that 120 MHz!

PLL6 can be changed in the script, but it is used by MALI.


There is another point, but it is not only for this topic.

Where did you find this out?

If you read the A10 clock diagrams (pages 53-55) it shows that PLL6 is only used things like ATA interface, and SPI, SD.

I am going to build a kernel that debugs what these timers are actually doing, I got my board but my card reader doesn't read SDHC cards so I need to wait until after work to grab a new one...

uMinded

Well I finally have a day free to work on this after doing 22hrs of overtime at work this week... An after several computer issues and a dead card reader I have u-boot working.

I have the strangest problem though. I tried running several of my kernels and they all give the same error, I tried one of the pre-built ones with VGA support and it failed. I extracted its .config and built 3.4.24 based on it and it failed!

My kernel log


[    1.070000] registered taskstats version 1
[    1.080000] Unable to handle kernel NULL pointer dereference at virtual address 00000018


Have you guys seen this behaviour?

Tele

#82
Quote from: uMinded on February 24, 2013, 06:11:20 AM

[    1.070000] registered taskstats version 1
[    1.080000] Unable to handle kernel NULL pointer dereference at virtual address 00000018

Have you guys seen this behaviour?

Yes I have. Im very sorry but I dont remember what was the reason and the solution. I just remember this line, because its strange. Dont get mad on me please. Did I mention I was a noobcake?

My current config is:
http://pastebin.com/eCW0M2PZ
This works for me.

Other things:
Differeneces in script.bin
I use a stock script.bin downloaded from somewhere, forum or Olimex, for LCD 800x480.

Differences in rootfs
I use buildroot to build kernel and a simple rootfs with busybox and qt. It works like charm. If you wanna make a try I can send the .config files.

Differences in toolchain and glibc/eglibc/uclibc
I use a selfmade crosstoolNG toolchain. Very stable and knows good switches, like:
-march=armv7-a -mtune=cortex-a8 -mthumb -mfpu=neon or vfp3  -mfloat-abi=hard or soft or softfp
I use glibc 2.13 with it, oldie but goldie.
I have had problems with Linaro toolchain, I dont trust on it. I know its an optimzed and fancy thing for arm, but it doesnt works good, it fails too many times, simply it cant compile files.
I can send crosstool-ng .config file if you want. Building toolchain takes about 20 min on a good pc, 10 min on your 20cores supermachine, 45 mins on a usual pc.

Btw, what kind of partition is your rootfs? I had problems with ext3 or ext4, I got "Kernel too old" error, then panic. I have changed to ext2, for now it works, later I will investigate that, because its nonsense if 3.4.24 is too old if rootfs is not on ext2. Maybe this was my "NULL pointer dereference at virtual address" error I donno. Change your filesystem. Sounds silly I know, but its worth a try because its only 3 minutes.


crubille

#83
Hello,

about the PLL6, really nothing is clear:
- In the doc it is fixed at 1200 MHz. But, there is nothing fixed by hardware, there is div and mul factors to get it from the 24MHz. Fixed is for "decide so to FIX sata problems on a10".
- In the varions script.fex i saw for the A13, it is defined as 720 MHz.
- Printing a message from the kernel each time PLL6 rate change, i get one message:
"MY_MSG set PLL6 rate : 600000000"

But setting the clock at 100 MHz, it dont run ...

Perhaps, 24 MHz is a very good rate for a xenomai clock.

Tele

Quote from: crubille on February 24, 2013, 12:15:55 PM
Hello,

about the PLL6, really nothing is clear:
...
Perhaps, 24 MHz is a very good rate for a xenomai clock.

Why dont you make a try with 120MHz timer, if you think PLL6 goes with 720MHs -> PLL6/6=120MHz.
120 is still 5 times more than 24, isnt it ? Set your timer to 120MHz.
Its worth a try.

crubille

I check it 120, and now 100, and the same kernel that run fine with the 24 MHz clock, hang but not as soon as the clock is set on, at some time later when something do something (but the PLL6 rate is changed in the kernel before the ipipe clock start).

uMinded

#86
Quote from: Tele on February 24, 2013, 11:47:36 AM
Quote from: uMinded on February 24, 2013, 06:11:20 AM

[    1.070000] registered taskstats version 1
[    1.080000] Unable to handle kernel NULL pointer dereference at virtual address 00000018

Have you guys seen this behaviour?

Yes I have. Im very sorry but I dont remember what was the reason and the solution. I just remember this line, because its strange. Dont get mad on me please. Did I mention I was a noobcake?

My current config is:
http://pastebin.com/eCW0M2PZ
This works for me.

Other things:
Differeneces in script.bin
I use a stock script.bin downloaded from somewhere, forum or Olimex, for LCD 800x480.

Differences in rootfs
I use buildroot to build kernel and a simple rootfs with busybox and qt. It works like charm. If you wanna make a try I can send the .config files.

Differences in toolchain and glibc/eglibc/uclibc
I use a selfmade crosstoolNG toolchain. Very stable and knows good switches, like:
-march=armv7-a -mtune=cortex-a8 -mthumb -mfpu=neon or vfp3  -mfloat-abi=hard or soft or softfp
I use glibc 2.13 with it, oldie but goldie.
I have had problems with Linaro toolchain, I dont trust on it. I know its an optimzed and fancy thing for arm, but it doesnt works good, it fails too many times, simply it cant compile files.
I can send crosstool-ng .config file if you want. Building toolchain takes about 20 min on a good pc, 10 min on your 20cores supermachine, 45 mins on a usual pc.

Btw, what kind of partition is your rootfs? I had problems with ext3 or ext4, I got "Kernel too old" error, then panic. I have changed to ext2, for now it works, later I will investigate that, because its nonsense if 3.4.24 is too old if rootfs is not on ext2. Maybe this was my "NULL pointer dereference at virtual address" error I donno. Change your filesystem. Sounds silly I know, but its worth a try because its only 3 minutes.

I reformatted to ext2 and that didn't help. I downloaded Linux version 3.4.29-jwischka-3.4-video-20130214-R17+ from the forums and used dd to copy it and I get the same null pointer error. This is starting to feel like a hardware error....

Can you upload one of your kernels for me to try? That would completely eliminate my sources as a source of error. Thanks!

Tele

#87
Quote from: uMinded on February 24, 2013, 07:27:59 PM
Can you upload one of your kernels for me to try? That would completely eliminate my sources as a source of error. Thanks!

Sorry to hear that. Of course I will, but only in about 12 hours, from my workplace. Now Im at home.

EDIT:
What kind of board do you have ? A13-OLinuXino, A13-OLinuXino-WIFI or A13-OLinuXino-MICRO ? You never mentioned.
What kind of video will you use ? VGA connector, LCD 4.3 ... 7", or nothing just a console via serial?

uMinded

#88
I found out what was wrong, the script.bin had some wrong settings and was somehow looking for the root filesystem on the second non existent SD card.

The script.bin has quite a few anomalies, not to mention none of the GPIO definitions. Where did this script on the olimex github come from anyways?? One major thing is be default it is set up for 512mb ram as on the WIFI so the smaller boards won't boot.

I have a micro via UART1. I pruned the whole script.bin but is their documentation on the files variables and what sunxi supports?

Sure I will take your configs. I haven't used buildroot in years, totally forgot about it

Tele

Quote from: uMinded on February 24, 2013, 10:09:27 PM
I have a micro via UART1. I pruned the whole script.bin but is their documentation on the files variables and what sunxi supports?

http://linux-sunxi.org/Fex_Guide

And tools to compile, decompile: fex <-> bin
https://github.com/linux-sunxi/sunxi-tools.git