Welcome! Log In Create A New Profile

Advanced

UPDATED kernel image - Building the Linux kernel for the A10

Posted by gnexus 
UPDATED kernel image - Building the Linux kernel for the A10
July 16, 2012 09:00AM
IT IS IMPORTANT TO CLOSELY WATCH THIS THREAD.

Kernel development on the A10 is occurring at a rapid pace. The information in the archived thread is no longer relevant, but will remain as legacy information. The default config for the linux-allwinner kernel git source no longer includes the Android configs. Use of the 3.0.8+ kernel has been deprecated, and is no longer recommended. The version below has also been deprecated. Current a10linux.org kernels will be located at http://a10linux.org

This linux-3.0.36+ kernel image will be the current working linux uImage and modules for our updated Debian A10 SD card images coming soon. This kernel was compiled using the linux-allwinner kernel git source and this kernel config. For the features of this kernel please see the last post in this archived thread. Here are the details for this kernel version:
# cat /proc/version
Linux version 3.0.36+ (gnexus@a10linux.org) (gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-70) ) #34 PREEMPT
sha256sum: a9ffda1e8c92f3258d842c750031a08ff1c6dc5d6087515e03224976eb8fba10
individual shasums are included in the archive - you are strongly advised to check them all to ensure integrity

NOTE: The kernel root device is not hardcoded into this kernel. Thus it must be specified in the u-boot environment. Our u-boot version already has the correct default environment settings. But you can change the root partition to whatever location you want by changing the u-boot environment to suit your needs.

To use this kernel first you need to partition the SD card and install u-boot.

See this thread about installing u-boot to get your SD card able to boot.

The partition layout can now be whatever you like. But in order to use a different partition layout you will need to change the u-boot environment.

The first partition is either a FAT partition (recommended) or an ext2/3 partition (must use our unreleased new uboot version), and should be created as partition type c for FAT or 83 for ext2/3 and formatted as vfat or ext2/3 respectively. It must be at least 32MB and does not ever need to be larger than 100MB (32MB is now the recommended size). Do not make the first partition smaller than 32MB unless you want to reformat or resize the partitions later on. 16MB /boot is no longer supported.

The second partition MUST be an ext4 rootfs partition to be compatible with our existing u-boot environment. If you want to use an different partition layout currently you will need to edit the u-boot environment on the SD card (not the one in nvram!) to do so. Later we will release a more advanced u-boot environment that will allow you to automatically boot from additional devices and/or partitions.

The second partition can be any size and must be formatted as ext4. You should make it at least 1 GB if you want to use the rootfs images on this site. It should probably be 4GB or larger if you want to actually use it with a GUI for anything long term.

You can put a swap partition, and other partitions such as a /home or a vfat partition, after the first two. A 256 -512MB swap partition is recommended, but not absolutely necessary, as ARM processors tend to avoid swap usage.

If you just want a working SD card image see this thread.

If you want to try this kernel just extract the uImage to your SD card at /dev/mmcblk0 in the first partition:
  • First change into an empty Linux directory.
  • Then extract the archive.
      tar xjvf [kernelname]  
  • Mount the first partition on the SD card.
      mount /dev/mmcblk0p1 /mnt/misc  
  • Copy the kernel to the first SD card partition.
      cp uImage /mnt/misc  
  • unmount the first partition on the SD card.
      umount /mnt/misc  
  • Mount the second partition on the SD card.
      mount /dev/mmcblk0p2 /mnt/misc  
  • Extract the modules to the second partition on the SD card.
      tar xjvf [kernelname] /mnt/misc  

Now you can extract a rootfs to the second partition if you have not already done so.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------

You can get the git source to compile the kernel from:

Current stable version source is 3.0.36+

Use of this kernel config is recommended for best results. The sunxi kernel defconfig available with the kernel source is only a basic template with no additional drivers or network features. It should only be used if you have no need for extra drivers and decent networking, or if you wish to configure the kernel yourself manually.

(Note: The kernel config we use has all the available drivers built as modules - if possible. That is in line with all the standard mainstream Linux distros, such as the Debian ARM kernel config from which this kernel config was derived. This is done to have as many drivers as possible available for the majority of users, without the need for users to recompile or build extra kernel modules. The extra modules will only slightly affect the size of the module directory. The extra available unused modules do not impact on performance of this kernel, or its size. They only help certain users, and they do not hurt anything or detract on performance in any way.)

This kernel is now 50% smaller and significantly faster and more responsive than the previous 3.0.8+ A10 kernel.

Automatic module loading seems still a bit broken. Therefore you should have an /etc/modules file with the following:

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

8192cu
mali

# the following modules should only be enabled on the Mele or other devices that have the hardware support
# sw_ahci_platform
# sun4i_wemac

That will solve any module loading issues.



Edited 27 time(s). Last edit at 07/29/2012 05:00AM by gnexus.
Re: UPDATED kernel image - Building the Linux kernel for the A10
July 24, 2012 12:23PM
3.0.38 kernel

Looks like mnemoc has updated to 3.0.38. I will try to get a newer kernel built with it tested and benchmarked to ensure no regressions. The we can adopt it using Jeff's method. We will be using our own stable kernel based on linux-allwinner but with our own kernel config as above.
Hi, thanks again for the kernel building. I had posted in the sid image thread that I was downloading the SD image and giving it a go. I am attempting this on my MK802 but have not had success yet. I even took a working SD image from Miniand Tech have it working and attempted to use this kernel but not working either.... I ran accross this in a different form:
Quote

Hi Toby,
Just want to say thanks for all your great work on this armhf Ubuntu image. I have it working on both a 1GB MK802 and a 7" tablet with the A10 and 1GB ram. For the tablet, the only thing I had to do to boot your image was to change the evb.bin and script.bin files to the ones included with the tablet's Android distribution!
BTW you may be wondering why you had to disable the cpufreq code in your kernel build: it's because the MK802 doesn't have an AXP209 power controller and so basically you can't switch frequencies. If you have the cpufreq code enabled, the Linux kernel will oops during boot on the MK802.

Would it be possible to build your kernel to without cpufreq support so that your images and kernels also work on the MK802?

Domenic
Re: UPDATED kernel image - Building the Linux kernel for the A10
July 28, 2012 10:39AM
Quote

Would it be possible to build your kernel to without cpufreq support so that your images and kernels also work on the MK802?

No. The kernel must have cpufreq support so it won't drain the battery too fast on tablets. Sorry about that. I want my kernels to work on all A10 platforms, but I can't sacrifice the most popular A10 platform just because the MK802 is crippled in some way.

But, I WILL build an MK802 version on the next kernel revision. Is that satisfactory for you? It may still be a while. I'm sorry about any delay, but mnemoc has a newer kernel version that needs additional testing before I can consider it "stable." If I have the time I will try to compile an MK802 version of the existing current stable kernel. But I am very busy right now.

Unfortunately I don't have an MK802 to test the kernel on either. I will test it on my Mele. But the MK802 users should also assist me in verifying that it works fine with no issues.

Thanks for information and the request. I did not know there was a kernel issue on the MK802.
No problem, I will attempt to build your kernel without cpufreq in the config and see if works no harm in trying. I'll grab what you have above and give it a shot. Does the linux-allwinner kernel git source have the mali support built in or do I need to grab that from somewhere else?

Domenic
Re: UPDATED kernel image - Building the Linux kernel for the A10
July 29, 2012 04:53AM
Quote

I will attempt to build your kernel without cpufreq in the config

It's not "my" kernel and I take no credit for it. The linux-allwinner kernel is a "leaked" kernel from allwinner android version which has been updated due to the work of mnemoc (amery) and many others. I made the current config for the a10linux stable kernel. That was done over the course of several weeks and 30+ revisions using a diff of a Debian kernel, as we are hoping to eventually get the kernel mainlined and supported by major distros.

Please try compiling your own kernel. It is not hard to do and should solve your issue. The Mali support has always been in the kernel. It is the userspace libraries that still need work. The sunxi_defconfig has the Mali enabled. It is only a bare-bones config, however. So for best results I would advise starting with my config by copying it to .config in the main linux-allwinner directory. Then use "make menuconfig", edit the config, and disable cpufreq support for your device. No other changes!
Use the CodeSourcery toolchain for best results when croos-compiling the kernel.

If I had time, and/or the kernel images were not being updated, I would make a MK802 version for you. But I am extremely busy. The next version, however, will have a linux-*-a10linux.sun4i.mk802 version. The new versions will be posted at http://a10linux.org The kernel versions and other stuff in this forum, such as the SD images, have now been deprecated.

Good luck with your kernel build! If you have questions on it you can try IRC. Please check a10linux.org regularly for kernel, u-boot and SD image updates, but it is not yet active. We will be trying to get .deb versions of the kernel released shortly.
So looks like the MK802 has an issue with the defalt configuration of the ARCH_SUN4I in the current kernel.

The config file: arch/arm/Kconfig
Has this section:

config ARCH_SUN4I
        bool "AllWinner SUN4I Platform"
        select CPU_V7
        select ARM_AMBA
        select HAVE_CLK
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
        #select ARCH_HAS_CPUFREQ
        select ARM_L1_CACHE_SHIFT_6
        help
          This enables support for Allwinner Technology Co., Ltd A10 SoC based systems

As you can see I have comment out the "select ARCH_HAS_CPUFREQ" as it forces this selection

We will require a new section for the MK802

config ARCH_SUN4I
        bool "AllWinner SUN4I Platform MK802"
        select CPU_V7
        select ARM_AMBA
        select HAVE_CLK
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
        #select ARCH_HAS_CPUFREQ
        select ARM_L1_CACHE_SHIFT_6
        help
          This enables support for Allwinner Technology Co., Ltd A10 SoC based MK802 System

Domenic
One more thing nightly kernel builds can be found here (see the link on this page): http://www.cnx-software.com/2012/07/20/nightly-builds-for-allwinner-a10-u-boot-linux-kernel-and-hardware-packs/
Note that the MK802 build is broken but is being worked on. That discussion is here: https://github.com/amery/linux-allwinner/issues/46

Domenic
Is there a way to build or locate a working Kernel for the Mk802ii A10 which is a current Kernel bersion?
Re: UPDATED kernel image - Building the Linux kernel for the A10
April 27, 2016 05:44PM
Antonio Wrote:
-------------------------------------------------------
> Is there a way to build or locate a working Kernel
> for the Mk802ii A10 which is a current Kernel
> bersion?

yes - look here http://linux-sunxi.org/Linux_Kernel
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: