WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Alwinner A20  (Read 61728 times)

Offline beerstein

  • Hero Member
  • *****
  • Posts: 530
Re: Alwinner A20
« Reply #15 on: February 16, 2014, 12:53:15 PM »
thanx Robert. Where can I learn or find info about how to turn that /lib/modules/3.4.75-sun4i+/kernel/fs/squashfs/squashfs.ko into a .gz extension. Do I need the complete folder /lib/modules or just the squashfs.ko file?
I looked at the wiki.
t(w)o be(ers) or not t(w)o be(ers) that is the question

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Alwinner A20
« Reply #16 on: February 17, 2014, 11:50:33 AM »
Hi beerstein,

Creating a cpio.gz archive is covered in the Remastering section of the wiki under the Packing title.  It can be done the same way as creating the main core.gz.



Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Alwinner A20
« Reply #17 on: May 29, 2014, 12:31:37 PM »
The goal of dCore is to be generic and able to run on various Arm devices. The fact that these scripts run on Allwinner A10, iMX GK802, and X86 shows it is successful in achieving this goal. dCore saves the Team and Community from having to compile hundreds, if not thousands of extensions.
 
A simple adjustment of boot.scr and the use of gz style extensions often times allows the use of vendor supplied uboot, kernel and associated modules without the need to compile a kernel and modules. Case in point, the BananaPi Arm Computer. Tiny Core X desktop now booting on the BananaPi A20 single board computer. So should the other various A20 and possibly other Allwinner devices. More to come as I am able to post. I will also post the various tools needed for such adjustments.
10+ Years Contributing to Linux Open Source Projects.

Offline MilosK

  • Newbie
  • *
  • Posts: 1
Re: Alwinner A20
« Reply #18 on: July 01, 2014, 11:45:16 PM »
I installed dCore to my Yarvik Velocity 264 Tablet - it is AllWinner A10 tablet - I like it very much - its stability and modular approach. However A10 is  one SoC of bigger family. Fedora Arm Allwinner Remixes has an universal image supporting almost whole Allwinner SoC family: A10, A13 (A10s), A20 and A31 - single image only multiple HW folders (very similar to dCore but more SoCs) - HW depended part seems be rather small. [In the past, I used Fedora 19 ARM remix-R3 on multiple devices - A10 tablet (Yarvik), A13 tablet (myAudio), mk-802S (A10S - A13 family SoC), A20 tablet (LTM7)]
Please could you check Readme (HW list) here - http://fedorapeople.org/~lkundrak/a10-images/README

I am not sure how difficult could be to re-use HW depended part from Fedora Arm Remix for dCore?
« Last Edit: July 02, 2014, 12:06:30 AM by MilosK »

Offline petrasl

  • Newbie
  • *
  • Posts: 2
Re: Alwinner A20
« Reply #19 on: December 01, 2014, 02:22:56 PM »
Hi guys,
Is there any 'step by step" instructions on how to run PiCore on BananaPI. I used RaspberryP before, did some development stuff. Now my BananaPI just arrived and would like to test this on It.

Thanks

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Alwinner A20
« Reply #20 on: December 02, 2014, 04:44:35 PM »
Hi petrasl,

This is the dCore section, you would be better to ask in the PiCore section the link is below.

http://forum.tinycorelinux.net/index.php/board,57.0.html

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Alwinner A20
« Reply #21 on: January 05, 2015, 01:49:15 PM »
Hi All,

is there any progress in the Tiny Core implementation into the A20 Banana Pi?

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Alwinner A20
« Reply #22 on: January 10, 2015, 01:51:27 PM »
Here are my notes on such matter:

When trying to use an existing kernel from another Arm Linux device: 

Requirements:
=============
The native kernel must support initrd.
Boot your vendor supplied arm device. Then check kernel by:

gunzip -c /proc/config.gz | grep INITRD

We are looking for the result of:
   CONFIG_BLK_DEV_INITRD=y
   
If this is not the case then you will have to build a new kernel to support Tiny Core.
Note: Sometimes the kernel configuration file is located the /boot directory or may be available on the device support website.

Note: Sometimes an additional "recovery kernel" in included with initrd support and can be used.

Additionally:
=============

loopback block device as a module or in kernel.
squashfs file system as a module or in kernel.

are both required to use any Tiny Core extensions.

If included in the kernel great, if not the above modules can be packed into a .gz extension.
Since all .gz extensions are loaded before any other extensions this should be an easy task.
Optionally you could unpack the uCore and repack to include these modules.

Allwinner Configuration files.
==============================
Configuration file: boot.scr
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The "compiled" boot.scr file contains instructions to uboot for kernel and initrd.

To decrypt boot.scr use:

dd if=boot.scr of=boot.script bs=1 skip=72

The resulting boot.script is a plain text file that you can edit.
Add the initrd boot specifications and, as needed, typically change fatload to ext2load to match existing vendor supplied kernel boot specifications.

To "compile" back to a useable boot.scr do:

./mkimage -C none -A arm -T script -d boot.script boot.scr

Next copy this new boot.scr together with the uEnv.txt to target SDCARD.

Configuration file script.bin:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Often with Allwinner devices there is a script.bin file. This is a "compiled" configuration file of key=value pairs. It is typically placed alongside the kernel, i.e., same partition. The exact name of this file can vary and is specified via uboot.

To decrypt script.bin use: bin2fex

./bin2fex script.bin > script.fex

The resulting script.fex can now be edited with a simple text editor.

When finished convert back via fex2bin

./fex2bin script.fex > script.bin

Reboot to effect.
==================
After any changes to any configuration file a reboot is required.

If it does not boot to a prompt then kernel may not support initrd. In this case you must compile a kernel. Otherwise...

At the boot prompt (see readme 1st for further explanation):
$ tce-setdrive

For a trivial example try:
$ importsce sl
$ loadsce sl
$ sl

If sl fails to load then likely you need the squashfs and loopback modules. Look for it from the vendor supplied SDCARD. If vendor supplied such modules then make a cpio gz and place into the tce-dir and reboot.

As root:
# depmod -a
#exit
$ loadsce sl
$ sl

If successful then proceed with X desktop as explained in the readme files.

10+ Years Contributing to Linux Open Source Projects.

Offline keksl22

  • Newbie
  • *
  • Posts: 8
Re: Alwinner A20
« Reply #23 on: June 11, 2015, 06:16:21 PM »
Hi!
Gents, two questions:
- do you plan to open a dCore HW section for Banana-PI or even a "banana-core"?
- is there a chance to get a BananaPi boot using e.g. a Cubietruck uImage - just for testing? As far as I read both run on Allwinner A20 ARMs, and the A20 should be able to run the A10 compiled code.

Well, reason for asking:
I'd like to run the B-Pi as a samba server (in parallel to a R-PI having a UMTS stick connected for internet access) using the SATA connector. Would be great if dCore or a piCore-variant  ;)  could do the OS job!
To get myself started I downloaded the cubieboard uImage, uCore etc.
I used the original Bananian uBoot and exchanged the uImage + edit the uEnv.txt.
Unfortunately the green LED remains on (no heartbeat) and in the /dev/ttyS0 I see it got stuck calibrating the delay loop...
So I updated and tried a uImage from the release candidate section. (/tinycorelinux/dCore/armv7/Allwinner-A10/release_candidates/)

What I see is:
U-Boot 2014.04-10694-g2ae8b32 (Sep 03 2014 - 20:53:14) Allwinner Technology
CPU:   Allwinner A20 (SUN7I)
Board: Bananapi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
In:    serial
Out:   serial
Err:   serial
Net:   dwmac.1c50000

[...]
Starting kernel ...
<5>Linux version 3.4.103 (root@box) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 PREEMPT Thu Feb 26 11:30:43 PST 2015
CPU: ARMv7 Processor [410fc...] revision 4 (ARMv7), cr=10c53...
<6>sunxi: Allwinner A20 (AW1651/sun7i) detected.
[..]
<6>sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
<6>Calibrating delay loop...

no more ttyS0 output ... no HDMI screen, LEDs red + green are active

If you need the full log, please let me know. I just copied - as I think - the most interesting sections
Any ideas / updates on A20 dCore?

Thanks,
Axel.




« Last Edit: June 11, 2015, 06:20:29 PM by keksl22 »

Offline vdelf

  • Newbie
  • *
  • Posts: 8
Re: Alwinner A20
« Reply #24 on: July 07, 2015, 05:30:01 PM »
I am now running dCore on a BananaPi using selfbuild mainline u-boot, mainline selfbuild zImage 4.0.5 and uCore from downloads section. HDMI, Framebuffer, USB, network works.
I can post/send kernel config and Boot.scr if someone wants to try.

Sent from my Nexus 4 using Forum Fiend v1.3.3.

Offline keksl22

  • Newbie
  • *
  • Posts: 8
Re: Alwinner A20
« Reply #25 on: July 10, 2015, 08:02:01 AM »
Yes, please share it with us!
Do you have Gigabit LAN up & running?

Thanks!

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Alwinner A20
« Reply #26 on: July 10, 2015, 12:34:16 PM »
I am not able to test anything outside of A10 but I am very interested in any success with dCore and other hardware.  I only wish I had the time and means to invest further in A20 and other boards.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Alwinner A20
« Reply #27 on: July 10, 2015, 12:37:15 PM »
And I would be happy to host files in an A20 section for others to test and use.

Offline vdelf

  • Newbie
  • *
  • Posts: 8
Re: Alwinner A20
« Reply #28 on: July 13, 2015, 04:54:49 AM »
Hi @all!

Okay, i will try to show what i did:

Get the source for uboot bootloader, i used 2015.4
Code: [Select]
wget ftp://ftp.denx.de/pub/u-boot/u-boot-2015.04.tar.bz2Extract it an look for a matching config in configs/. I used Bananapi_defconfig
Code: [Select]
make CROSS_COMPILE=arm-linux-gnueabihf- Bananapi_defconfigI did no modifications, so just compile it
Code: [Select]
make CROSS_COMPILE=arm-linux-gnueabihf- after that you got the u-boot-sunxi-with-spl.bin.

Now to the kernel. Since v4.0 there is some good support for the allwinner cpu, thats why i tried to build and run a kernel. First i tried a debian system, and after i got it running, i tried tinycore/dcore on top. So my kernel config changes may not all be nessessary for dcore. Feel free to try for yourself.
First download kernel source, i started with 4.0.5. Newer kernels will likely work, but i didnt tried
Code: [Select]
wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.0.5.tar.xzextract it an clean up
Code: [Select]
make mrproperFor the allwinner, there is the sunxi_defconfig, so use it
Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfigNow do the changes. I use the script in ./scripts/config so i dont need to go to all the menus. But you can use it, too. From extracted root directory do
Code: [Select]
./scripts/config --enable CONFIG_AUTOFS4_FSbluetooth is optional, i wanted it
Code: [Select]
./scripts/config --enable CONFIG_BT
./scripts/config --enable CONFIG_BT_RFCOMM
./scripts/config --enable CONFIG_BT_RFCOMM_TTY
./scripts/config --enable CONFIG_BT_BNEP
./scripts/config --enable CONFIG_BT_BNEP_MC_FILTER
./scripts/config --enable CONFIG_BT_BNEP_PROTO_FILTER
./scripts/config --enable CONFIG_BT_HIDP
./scripts/config --enable CONFIG_BT_HCIBTUSB
Code: [Select]
./scripts/config --enable CONFIG_CGROUPScifs is optional, i needed it to use some windows shares
Code: [Select]
./scripts/config --enable CONFIG_CIFS
./scripts/config --enable CONFIG_CIFS_WEAK_PW_HASH
./scripts/config --enable CONFIG_CIFS_SMB2
Code: [Select]
./scripts/config --enable CONFIG_INPUT_EVDEV
Code: [Select]
./scripts/config --enable CONFIG_FHANDLE
Code: [Select]
./scripts/config --enable CONFIG_FB
./scripts/config --enable CONFIG_FRAMEBUFFER_CONSOLE
./scripts/config --enable CONFIG_FB_SIMPLE
kernel config in /proc is optional, i liked it
Code: [Select]
./scripts/config --enable CONFIG_IKCONFIG
./scripts/config --enable CONFIG_IKCONFIG_PROC
i mainly enabled ipv6 because of errors during boot of debian, i think its optional
Code: [Select]
./scripts/config --enable CONFIG_IPV6
Code: [Select]
./scripts/config --enable CONFIG_BLK_DEV_LOOPntfs support is optional
Code: [Select]
./scripts/config --enable CONFIG_NTFS_FS
./scripts/config --enable CONFIG_NTFS_RW
squashfs is needed for dcore. I was not sure about the compression methods, i included all to be on the safe side
Code: [Select]
./scripts/config --enable CONFIG_SQUASHFS
./scripts/config --enable CONFIG_SQUASHFS_XATTR
./scripts/config --enable CONFIG_SQUASHFS_LZ4
./scripts/config --enable CONFIG_SQUASHFS_LZO
./scripts/config --enable CONFIG_SQUASHFS_XZ
After all changes do
Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- olddefconfignow build the kernel
Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage dtbsi used the -j8 option to speed things up. compiling takes 1:49 minutes on my i7

Now we got the arch/arm/boot/zImage, and the arch/arm/boot/dts/sun7i-a20-<yourboard>.dtb. I used of course the sun7i-a20-bananapi.dtb

Okay, now we need to put it all together. Use an empty sdcard. First install bootloader
Code: [Select]
dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=1
dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8
Then create a ext4-partition, and copy the zImage and the sun7i-a20-<yourboard>.dtb to the root directory of the sdcard.

Now get the uCore ramdisk image from dcore A10 download section
Code: [Select]
wget http://distro.ibiblio.org/tinycorelinux/dCore/armv7/Allwinner-A10/uCoreput it into root of sdcard.

Last step is to create the boot.scr. First create a plan text file, like boot.txt with the following content
Code: [Select]
ext4load mmc 0 0x46000000 zImage
ext4load mmc 0 0x49000000 sun7i-a20-<yourboard>.dtb
ext4load mmc 0 0x41000000 uCore
setenv bootargs console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p1 rootwait panic=10 ${extra}
bootz 0x46000000 0x41000000 0x49000000
Now compile it with the tool in the u-boot-directory tools/mkimage
Code: [Select]
./tools/mkimage -C none -A arm -T script -d boot.txt boot.scrThis creates the boot.scr, put it into the sdcard root directory, too.

Done. If i didnt miss something, then you can put the sdcard into your bord and boot it.

Christof

Offline vdelf

  • Newbie
  • *
  • Posts: 8
Re: Alwinner A20
« Reply #29 on: July 13, 2015, 08:33:32 AM »
@keks22

yes, gigabit lan is up and running, but i didnt test the performance yet. Only used ssh and rdesktop so far without any hiccups.