Welcome! Log In Create A New Profile

Advanced

ARCHIVED - Building the Linux kernel for the A10

Posted by gnexus 
ARCHIVED - Building the Linux kernel for the A10
July 16, 2012 08:49AM
This is the original kernel thread that has now been deprecated in favour of the new thread.
Re: Building the Linux kernel for the A10
June 24, 2012 11:26PM
The build has finished! It compiled natively on my A10 fairly quickly. I use a Debian hard float buildroot for my builds.

The use of native ARMv7 armhf to compile the kernel should help to optimize it for the A10 platform. It "should" be much better than the generic cross-compiled kernels that are currently available for the A10. I will do benchmarks once I get it installed on my tablet.

I will upload the kernel as a bz2 tar archive once I confirm that it is working well, and when Jeff gives the go ahead to u/l it.
UPDATED - Building the Linux kernel for the A10
June 24, 2012 06:27PM
IT IS IMPORTANT TO CLOSELY WATCH THIS THREAD.

Kernel development on the A10 is occurring at a rapid pace. Most of the information below is no longer relevant, but will remain as legacy information. The default config for the linux-allwinner kernel git source no longer includes Android configs. Use of the 3.0.8+ kernel has been deprecated, and is no longer recommended. We will be posting updated kernel images shortly.

This Linux-3.0.8+ image will be our current working linux-3.0.8+ uImage and modules for the A10 Ubuntu SD card image. This kernel has not been compiled by me. Notice it was compiled using Sourcery G++ Lite, which is not optimized for ARM hard float and does not use Arm VFP instructions. I am still working on my kernel version. In the meantime this kernel will get us started and going in Linux on the A10. But it is an Android kernel built with an Android configuration. That means it uses Android "Paranoid Networking" which, in GNU/LInux, means you need to be root to have network access. So don't blame me when Firefox won't connect to the 'Net. Just use sudo firefox for now. Running services seem not to be affected by the "Paranoid Networking". Only userspace seems to be affected. So server usage of this image seems to work okay. Here are the details for this kernel version:
# cat /proc/version
Linux version 3.0.8+ (tangliang@MServer) (gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50) ) #2 PREEMPT Fri Mar 2 14:28:08 CST 2012

NOTE: The kernel root device is hardcoded into this kernel: root=/dev/mmcblk0p2

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 first partition is a 16MB partition and should be created as linux partition type 83 and formatted as vfat for now. Yes, that is is a bit strange, but that makes the partition an RFS compatible partition, which the current u-boot version (may) need(s). The second partition MUST be the root partition. That is hardcoded into the current kernel and cannot be changed! I can't get another partition layout to work until I get a newer working kernel compiled. Until we get u-boot and the kernel happy with something else like ext2/3/4 for the kernel partition the above layout is what will need to be used.

The second partition can be any size, but must be formatted as ext4. You should make it at least 2 GB if you want to use the Ubuntu rootfs on this site. It should be 4GB or larger if you want to actually use Ubuntu for anything longer term.

You can put a swap partition and other partitions such as /home or a vfat partition after the first two.

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 linux-3.0.8+.a10.allwinnertech.tangliang@MServer.tar.bz2  
  • 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 linux-3.0.8+.Modules.a10.allwinnertech.tangliang@MServer.tar.bz2 /mnt/misc  

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

Please note that this kernel uses the name "a10.allwinnertech." That is only for the initial version here. People are currently unfamiliar with the Allwinner A10. So a longer name needs to be used for clarity. However, the proper Linux name for the platform is sun4i. That is the name which should be used henceforth for any builds. Until fully compatible stable A10 kernel code is achieved the build host should be included as part of the name of the kernel so that we may differentiate the builds. If multiple builds are performed on the same source by the same host the build date should also be included.

Supposedly, according to Rhombus Tech, you can get the git source to compile the kernel from:

Current stable version source is 3.0.8+

Edit:
The default config in that kernel source did not work for me. No framebuffer driver. No video!

I also tried this kernel tree: https://github.com/amery/linux-allwinner/tree/lichee-3.0.8-sun4i

The kernel and the sources above are all based on the Android kernel and have Android crap in them. Unfortunately that is all that is available at this point in time. If you want that to change please help us out. . .

A newer kernel is being worked on the people at the GitHub site above, along with the guys on arm-netbook.

I have successfully built the linux-3.0.8+ on a new debian armhf buildroot on my A10. It compiles and boots fine. but it missing the video output due to the issues noted above. See below for more details on how the kernel builds are progressing.



Edited 16 time(s). Last edit at 07/15/2012 06:53AM by gnexus.
Re: Building the Linux kernel for the A10
June 25, 2012 10:39AM
It works!!!

We now have a natively compiled kernel built on Debian Sid using armhf!

Linux T-01 3.0.8+ #6 PREEMPT Mon Jun 25 00:19:52 IST 2012 armv7l armv7l armv7l GNU/Linux

But does it have "Paranoid Networking?"

I am very paranoid to find out . . .

Time to go log in as a normal user.

Bye.
Re: Building the Linux kernel for the A10
June 25, 2012 10:43AM
$ ping google.com
ping: unknown host google.com

Crap!

Other network permissions errors:
Jun 25 16:43:48 T-01 ntpd[833]: ./../lib/isc/unix/ifiter_ioctl.c:348: unexpected error:
Jun 25 16:43:48 T-01 ntpd[833]: making interface scan socket: Permission denied

They don't tell you about any of these problems on all the fancy YouTube videos of the A10 running Linux. . .

Who knows how to patch the kernel to eliminate the Android configs?

root@T-01:/var/log# dmesg
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Linux version 3.0.8+ (root@T-01) (gcc version 4.6.3 (Debian 4.6.3-7) ) #6 PREEMPT Mon Jun 25 00:19:52 IST 2012
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387f
[    0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: sun4i
[    0.000000] Total Detected Memory: 512MB with 1 banks
[    0.000000] Ignoring unrecognised tag 0x00000000
[    0.000000] Memory Reserved(in bytes):
[    0.000000]  LCD: 0x5a000000, 0x02000000
[    0.000000]  SYS: 0x43000000, 0x00010000
[    0.000000]  G2D: 0x58000000, 0x01000000
[    0.000000]  VE : 0x44000000, 0x05000000
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] On node 0 totalpages: 114688
[    0.000000] free_area_init_node: node 0, pgdat c06f80d4, node_mem_map c08b2000
[    0.000000]   Normal zone: 896 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 113792 pages, LIFO batch:31
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 113792
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mmcblk0p2 init=/init loglevel=8 rootfstype=ext4 rootwait
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 448MB = 448MB total
[    0.000000] Memory: 331068k/331068k available, 127684k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
[    0.000000]     vmalloc : 0xdc800000 - 0xf0000000   ( 312 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xdc000000   ( 448 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .init : 0xc0008000 - 0xc002e000   ( 152 kB)
[    0.000000]       .text : 0xc002e000 - 0xc06bc000   (6712 kB)
[    0.000000]       .data : 0xc06bc000 - 0xc06ffd70   ( 272 kB)
[    0.000000]        .bss : 0xc06ffd94 - 0xc08b1c98   (1736 kB)
[    0.000000] SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:96 nr_irqs:96 96
[    0.000000] timer0: Periodic Mode
[    0.000000] Console: colour dummy device 80x30
[    0.000000] ram_console: buffer   (null), invalid size 0, datasize 4294967284
[    0.000000] Calibrating delay loop... 1001.88 BogoMIPS (lpj=5009408)
[    0.040000] pid_max: default: 32768 minimum: 301
[    0.040000] Mount-cache hash table entries: 512
[    0.040000] Initializing cgroup subsys cpuacct
[    0.040000] Initializing cgroup subsys devices
[    0.040000] Initializing cgroup subsys freezer
[    0.040000] Initializing cgroup subsys blkio
[    0.040000] CPU: Testing write buffer coherency: ok
[    0.040000] hw perfevents: enabled with ARMv7 Cortex-A8 PMU driver, 5 counters available
[    0.040000] devtmpfs: initialized
[    0.040000] print_constraints: dummy: 
[    0.040000] NET: Registered protocol family 16
[    0.040000] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.040000] SOFTWINNER DMA Driver, (c) 2003-2004,2006 Simtec Electronics
[    0.040000] Initialize DMAC OK
[    0.040000] bio: create slab <bio-0> at 0
[    0.040000] SCSI subsystem initialized
[    0.040000] usbcore: registered new interface driver usbfs
[    0.040000] usbcore: registered new interface driver hub
[    0.040000] usbcore: registered new device driver usb
[    0.040000] Advanced Linux Sound Architecture Driver Version 1.0.24.
[    0.040000] Bluetooth: Core ver 2.16
[    0.040000] NET: Registered protocol family 31
[    0.040000] Bluetooth: HCI device and connection manager initialized
[    0.040000] Bluetooth: HCI socket layer initialized
[    0.040000] Bluetooth: L2CAP socket layer initialized
[    0.040000] Bluetooth: SCO socket layer initialized
[    0.040000] Init eGon pin module V2.0
[    0.040000] Switching to clocksource aw 64bits couter
[    0.040000] FS-Cache: Loaded
[    0.040000] CacheFiles: Loaded
[    0.050000] Switched to NOHz mode on CPU #0
[    0.050000] cfg80211: Calling CRDA to update world regulatory domain
[    0.050000] [usb_manager]: CONFIG_USB_SW_SUN4I_USB0_OTG
[    0.050000] [sw_hcd0]: usb host driver initialize........
[    0.050000] [sw_hcd0]: open_usb_clock
[    0.060000] [sw_hcd0]: host_init_state = 0
[    0.060000] [sw_hcd0]: platform is usb host
[    0.060000] [sw_hcd0]: sw_hcd_init_controller: sw_hcd_host0: USB Host mode controller at f1c13000 using PIO, IRQ 38
[    0.060000] sw_hcd_host0 sw_hcd_host0: sw_hcd host driver
[    0.060000] sw_hcd_host0 sw_hcd_host0: new USB bus registered, assigned bus number 1
[    0.060000] hub 1-0:1.0: USB hub found
[    0.060000] hub 1-0:1.0: 1 port detected
[    0.060000] wrn: hcd is not enable, need not start hcd
[    0.060000] [sw_hcd0]: sw_usb_host0_disable start
[    0.060000] -------sw_hcd0_soft_disconnect---------
[    0.060000] [sw_hcd_host0]: Set USB Power OFF
[    0.060000] wrn: hcd is not enable, need not stop hcd
[    0.060000] [sw_hcd0]: close_usb_clock
[    0.060000] [sw_hcd0]: sw_usb_host0_disable end
[    0.060000] [sw_udc]: udc_init: version 20080411
[    0.060000] axp driver uning configuration failed(539)
[    0.060000] axp driver uning configuration failed(551)
[    0.060000] NET: Registered protocol family 2
[    0.060000] IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.060000] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    0.060000] TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
[    0.060000] TCP: Hash tables configured (established 16384 bind 16384)
[    0.060000] TCP reno registered
[    0.060000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.060000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.070000] NET: Registered protocol family 1
[    0.070000] RPC: Registered named UNIX socket transport module.
[    0.070000] RPC: Registered udp transport module.
[    0.070000] RPC: Registered tcp transport module.
[    0.070000] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.070000] [pm]aw_pm_init!
[    0.070000] audit: initializing netlink socket (disabled)
[    0.070000] type=2000 audit(0.069:1): initialized
[    0.080000] VFS: Disk quotas dquot_6.5.2
[    0.080000] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.080000] NTFS driver 2.1.30 [Flags: R/W].
[    0.080000] fuse init (API version 7.16)
[    0.080000] msgmni has been set to 646
[    0.090000] alg: No test for stdrng (krng)
[    0.090000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    0.090000] io scheduler noop registered
[    0.090000] io scheduler deadline registered
[    0.090000] io scheduler cfq registered (default)
[    0.090000] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.110000] serial8250.0: ttyS0 at MMIO 0x1c28000 (irq = 1) is a U6_16550A
[    0.110000] console [ttyS0] enabled
[    0.120000] [uart]: used uart info.: 0x05
[    0.140000] sunxi-uart.0: ttyS0 at MMIO 0x1c28000 (irq = 1) is a U6_16550A
[    0.140000] [uart]: serial probe 0, membase   (null) irq 1 mapbase 0x01c28000
[    0.160000] sunxi-uart.2: ttyS1 at MMIO 0x1c28800 (irq = 3) is a U6_16550A
[    0.160000] [uart]: serial probe 2, membase   (null) irq 3 mapbase 0x01c28800
[    0.160000] G2D: drv_g2d_init
[    0.160000] G2D: g2dmem: g2d_start=58000000, g2d_size=1000000
[    0.160000] G2D: head:d8000000,tail:d9000000
[    0.160000] G2D: Module initialized.major:252
[    0.160000] brd: module loaded
[    0.160000] loop: module loaded
[    0.160000] [NAND]nand driver, init.
[    0.160000] [NAND] nand gpio_request
[    0.160000] [NAND] nand driver version: 0x2 0x9 
[    0.160000] nand interrupte register ok
[    0.160000] ret of NFC_ChangMode is 0 
[    0.160000] dma_hdle  is 0 
[    0.160000] dma_hdle  is 10000008 
[    0.160000] [ccmu] set nfc clock rate to 60000000 failed!
[    0.160000] [NAND] nand_set_module_clk fail 
[    0.160000] [NAND]init_blklayer fail 
[    0.160000] wemac Ethernet Driver, V1.00 in file:drivers/net/sun4i/sun4i_wemac.c
[    0.160000] can't get information emac_power gpio
[    0.160000] [EMAC] ahb clk enable 
[    0.160000] [EMAC] ahb gate clk: 0x26140 
[    0.170000] wemac wemac.0: PHY SETUP, reg 0 value: 0
[    0.170000] emac MAC isn't valid!
[    0.170000] wemac wemac.0: resetting device
[    0.170000] release temp resource
[    0.170000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.170000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.170000] [sw-ehci1]: probe, pdev->name: sw-ehci, pdev->id: 1, sw_ehci: 0xc07a9a2c
[    0.170000] [sw-ehci1]: open clock
[    0.190000] [sw-ehci1]: Set USB Power ON
[    0.190000] sw-ehci sw-ehci.1: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.200000] sw-ehci sw-ehci.1: new USB bus registered, assigned bus number 2
[    0.200000] sw-ehci sw-ehci.1: irq 39, io mem 0xf1c14000
[    0.220000] sw-ehci sw-ehci.1: USB 0.0 started, EHCI 1.00
[    0.220000] hub 2-0:1.0: USB hub found
[    0.220000] hub 2-0:1.0: 1 port detected
[    0.220000] [sw-ohci1]: probe, pdev->name: sw-ohci, pdev->id: 1, sw_ohci: 0xc07a9b3c
[    0.220000] [sw-ohci1]: open clock
[    0.240000] sw-ohci sw-ohci.1: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    0.240000] sw-ohci sw-ohci.1: new USB bus registered, assigned bus number 3
[    0.240000] sw-ohci sw-ohci.1: irq 64, io mem 0xf1c14400
[    0.300000] hub 3-0:1.0: USB hub found
[    0.300000] hub 3-0:1.0: 1 port detected
[    0.300000] [sw-ehci2]: probe, pdev->name: sw-ehci, pdev->id: 2, sw_ehci: 0xc07a9c4c
[    0.300000] [sw-ehci2]: open clock
[    0.320000] [sw-ehci2]: Set USB Power ON
[    0.320000] sw-ehci sw-ehci.2: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.320000] sw-ehci sw-ehci.2: new USB bus registered, assigned bus number 4
[    0.320000] sw-ehci sw-ehci.2: irq 40, io mem 0xf1c1c000
[    0.340000] sw-ehci sw-ehci.2: USB 0.0 started, EHCI 1.00
[    0.340000] ehci_irq: port change detect
[    0.340000] hub 4-0:1.0: USB hub found
[    0.340000] hub 4-0:1.0: 1 port detected
[    0.340000] [sw-ohci2]: probe, pdev->name: sw-ohci, pdev->id: 2, sw_ohci: 0xc07a9d5c
[    0.340000] [sw-ohci2]: open clock
[    0.360000] sw-ohci sw-ohci.2: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    0.360000] sw-ohci sw-ohci.2: new USB bus registered, assigned bus number 5
[    0.360000] sw-ohci sw-ohci.2: irq 65, io mem 0xf1c1c400
[    0.420000] hub 5-0:1.0: USB hub found
[    0.420000] hub 5-0:1.0: 1 port detected
[    0.420000] Initializing USB Mass Storage driver...
[    0.420000] usbcore: registered new interface driver usb-storage
[    0.420000] USB Mass Storage support registered.
[    0.420000] usbcore: registered new interface driver ums-alauda
[    0.420000] usbcore: registered new interface driver ums-cypress
[    0.420000] usbcore: registered new interface driver ums-datafab
[    0.420000] usbcore: registered new interface driver ums_eneub6250
[    0.420000] usbcore: registered new interface driver ums-freecom
[    0.420000] usbcore: registered new interface driver ums-isd200
[    0.420000] usbcore: registered new interface driver ums-jumpshot
[    0.420000] usbcore: registered new interface driver ums-karma
[    0.420000] usbcore: registered new interface driver ums-onetouch
[    0.420000] usbcore: registered new interface driver ums-realtek
[    0.420000] usbcore: registered new interface driver ums-sddr09
[    0.420000] usbcore: registered new interface driver ums-sddr55
[    0.420000] usbcore: registered new interface driver ums-usbat
[    0.420000] mousedev: PS/2 mouse device common for all mice
[    0.420000] sunxi RTC version 0.1 
[    0.420000] sunxi-rtc sunxi-rtc: sunxi_rtc_probe tmp_data = 380239881
[    0.420000] sunxi-rtc sunxi-rtc: sunxi_rtc_gettime
[    0.420000] sunxi-rtc sunxi-rtc: read time 2012-6-25 15:34:23
[    0.420000] using rtc device, rtc, for alarms
[    0.420000] sunxi-rtc sunxi-rtc: rtc core: registered rtc as rtc0
[    0.420000] i2c /dev entries driver
[    0.420000] !!! base_Addr = 0xdc8d2c00 
[    0.420000] config i2c gpio with gpio_config api 
[    0.420000] twi0, apb clock = 24000000 
[    0.420000] axp_mfd 0-0034: AXP (CHIP ID: 0x21) detected
[    0.430000] [AXP]axp driver uning configuration failed(323)
[    0.430000] [AXP]power_start = 0
[    0.430000] I2C: i2c-0: AW16XX I2C adapter
[    0.430000] **********start************
[    0.430000] 0x40 
[    0.430000] 0xf8 
[    0.430000] 0x28 
[    0.430000] 0x0 
[    0.430000] 0x0 
[    0.430000] **********end************
[    0.430000] !!! base_Addr = 0xdc8d4000 
[    0.430000] twi1, apb clock = 24000000 
[    0.430000] I2C: i2c-1: AW16XX I2C adapter
[    0.430000] **********start************
[    0.430000] 0x40 
[    0.430000] 0xf8 
[    0.430000] 0x58 
[    0.430000] 0x0 
[    0.430000] 0x0 
[    0.430000] **********end************
[    0.430000] !!! base_Addr = 0xdc8d6400 
[    0.430000] twi2, apb clock = 24000000 
[    0.430000] I2C: i2c-2: AW16XX I2C adapter
[    0.430000] **********start************
[    0.430000] 0x40 
[    0.430000] 0xf8 
[    0.430000] 0x58 
[    0.430000] 0x0 
[    0.430000] 0x0 
[    0.430000] **********end************
[    0.430000] lirc_dev: IR Remote Control driver registered, major 251 
[    0.430000] IR NEC protocol handler initialized
[    0.430000] IR RC5(x) protocol handler initialized
[    0.430000] IR RC6 protocol handler initialized
[    0.430000] IR JVC protocol handler initialized
[    0.430000] IR Sony protocol handler initialized
[    0.430000] IR RC5 (streamzap) protocol handler initialized
[    0.430000] IR LIRC bridge handler initialized
[    0.430000] Linux video capture interface: v2.00
[    0.430000] [cedar dev]: install start!!!
[    0.430000] [cedar dev]: install end!!!
[    0.430000] [ace_drv] start!!!
[    0.430000] [ace_drv] init end!!!
[    0.430000] [pa_drv] start!!!
[    0.430000] [pa_drv] init end!!!
[    0.430000] print_constraints: axp20_ldo1: 1300 mV 
[    0.430000] print_constraints: axp20_ldo2: 1800 <--> 3300 mV at 3000 mV 
[    0.430000] print_constraints: axp20_ldo3: 700 <--> 3500 mV at 2800 mV 
[    0.430000] print_constraints: axp20_ldo4: 1250 <--> 3300 mV at 2800 mV 
[    0.430000] print_constraints: axp20_buck2: 700 <--> 2275 mV at 1400 mV 
[    0.430000] print_constraints: axp20_buck3: 700 <--> 3500 mV at 1250 mV 
[    0.440000] print_constraints: axp20_ldoio0: 1800 <--> 3300 mV at 2800 mV 
[    0.440000] input: axp20-supplyer as /devices/platform/sun4i-i2c.0/i2c-0/0-0034/axp20-supplyer.28/input/input0
[    0.450000] Bluetooth: HCI UART driver ver 2.2
[    0.450000] Bluetooth: HCI H4 protocol initialized
[    0.450000] Bluetooth: HCI BCSP protocol initialized
[    0.450000] Bluetooth: HCILL protocol initialized
[    0.450000] cpuidle: using governor ladder
[    0.450000] cpuidle: using governor menu
[    0.450000] [wifi]: Select sdio wifi: swl-n20 !!
[    0.450000] [mmc_pm]: SDIO card gpio init is OK !!
[    0.450000] [mmc]: sunximmc_init
[    0.450000] [mmc]: sunxi mmc controller using config : 0xb
[    0.450000] [mmc]: sunxi-mmc.0: pdev->name: sunxi-mmc, pdev->id: 0
[    0.450000] [mmc]: mmc 0 power off !!
[    0.450000] [mmc]: mmc0 Probe: base:0xdc8de000 irq:32 dma:0 pdes:0xd99d0000, ret 0.
[    0.450000] [mmc]: sunxi-mmc.1: pdev->name: sunxi-mmc, pdev->id: 1
[    0.450000] [mmc]: mmc 1 power off !!
[    0.450000] [mmc]: mmc1 Probe: base:0xdc8e0000 irq:33 dma:0 pdes:0xd99d4000, ret 0.
[    0.450000] [mmc]: sunxi-mmc.3: pdev->name: sunxi-mmc, pdev->id: 3
[    0.450000] [mmc]: mmc 3 power off !!
[    0.450000] [mmc]: mmc3 Probe: base:0xdc8e2000 irq:35 dma:0 pdes:0xd99d8000, ret 0.
[    0.450000] usbcore: registered new interface driver usbhid
[    0.450000] usbhid: USB HID core driver
[    0.450000] logger: created 256K log 'log_main'
[    0.450000] logger: created 256K log 'log_events'
[    0.450000] logger: created 256K log 'log_radio'
[    0.450000] logger: created 256K log 'log_system'
[    0.450000] enter sun4i Audio codec!!!
[    0.460000] sun4i audio support initialized
[    0.460000] audiocodec_adap_awxx_init: script_parser_fetch err. 
[    0.460000] sun4i Audio codec successfully loaded..
[    0.460000] asoc: sndhdmi <-> sun4i-hdmiaudio.0 mapping ok
[    0.460000] ALSA device list:
[    0.460000]   #0: sun4i-CODEC  Audio Codec
[    0.460000]   #1: sun4i-sndhdmi
[    0.460000] IPv4 over IPv4 tunneling driver
[    0.460000] TCP cubic registered
[    0.460000] Initializing XFRM netlink socket
[    0.460000] NET: Registered protocol family 17
[    0.460000] NET: Registered protocol family 15
[    0.460000] Bluetooth: RFCOMM TTY layer initialized
[    0.460000] Bluetooth: RFCOMM socket layer initialized
[    0.460000] Bluetooth: RFCOMM ver 1.11
[    0.460000] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    0.460000] Bluetooth: BNEP filters: protocol multicast
[    0.460000] 802.1Q VLAN Support v1.8
[    0.460000] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.460000] Registering SWP/SWPB emulation handler
[    0.460000] registered taskstats version 1
[    0.460000] regulator_init_complete: axp20_buck3: incomplete constraints, leaving on
[    0.460000] regulator_init_complete: axp20_buck2: incomplete constraints, leaving on
[    0.460000] regulator_init_complete: axp20_ldo4: incomplete constraints, leaving on
[    0.460000] regulator_init_complete: axp20_ldo3: incomplete constraints, leaving on
[    0.460000] regulator_init_complete: axp20_ldo2: incomplete constraints, leaving on
[    0.460000] sunxi-rtc sunxi-rtc: sunxi_rtc_gettime
[    0.460000] sunxi-rtc sunxi-rtc: read time 2012-6-25 15:34:23
[    0.460000] sunxi-rtc sunxi-rtc: setting system clock to 2012-06-25 15:34:23 UTC (1340638463)
[    0.460000] >>> bus busy...
[    0.460000] Waiting for root device /dev/mmcblk0p2...
[    0.660000] usb 4-1: new high speed USB device number 2 using sw-ehci
[    1.450000] [mmc]: mmc 0 detect change, present 1
[    1.750000] [mmc]: mmc 0 power on !!
[    1.790000] [mmc]: sdxc_request_done(L1114): smc 0 err, cmd 52,  RTO !!
[    1.790000] [mmc]: sdxc_request_done(L1114): smc 0 err, cmd 52,  RTO !!
[    1.800000] [mmc]: sdxc_request_done(L1114): smc 0 err, cmd 5,  RTO !!
[    1.810000] [mmc]: sdxc_request_done(L1114): smc 0 err, cmd 5,  RTO !!
[    1.820000] [mmc]: sdxc_request_done(L1114): smc 0 err, cmd 5,  RTO !!
[    1.830000] [mmc]: sdxc_request_done(L1114): smc 0 err, cmd 5,  RTO !!
[    1.870000] mmc0: new high speed SDHC card at address 0001
[    1.870000] mmcblk0: mmc0:0001 00000 29.6 GiB 
[    1.880000]  mmcblk0: p1 p2 p3 p4
[    1.920000] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.930000] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    1.940000] devtmpfs: mounted
[    1.950000] Freeing init memory: 152K

It doesn't even boot when the HDMI is connected. I don't even think there is a framebuffer driver in this code. No fb0 in /dev.
It boots fine if the HDMI is disconnected. But if you connect it it never boots. X, and even X11vnc, won't load because there is no framebuffer device. Mali source code, of course, is not released.

This is supposedly the stable code? WTF? Also no support from the CPU mfr. They originally did not even want to release the GPL kernel code.

Much work to do on this kernel. Back to the old one. How annoying. . .

At least I know the buildroot works.

Edit:
Okay. It could be my fault. I just made sun4i_defconfig. I did not do menuconfig also. Maybe for some reason the default config did not have the framebuffer enabled. I will try that branch again later. First I will build orig. released branch.



Edited 3 time(s). Last edit at 06/25/2012 05:06PM by gnexus.
Re: Building the Linux kernel for the A10
June 25, 2012 12:04PM
The kernel sources are all for Android kernels. Stupid!

The "recommended" code I used has been altered a lot from the original leaked Android kernel source. So I'm going to rebase on the leaked code and go from there. That's also the reason why building cifs.ko for my Android kernel did not work. The code has been molested. Updating the code is fine. But they should not be breaking the framebuffer driver.

Considering this, it is ridiculous the way these devices have been hyped as a better alternative to the pi. They say they are running Linux when they are not. Instead they are running some kind of AndroidLinux/GNU clusterfsck. The hardware is awesome, but the available code is rubbish.
Re: Building the Linux kernel for the A10
June 26, 2012 06:19AM
2nd A10 kernel build attempt

This one works too! (partially)

Lets just hope it works better than the last one.

This one is using the original lichee: https://github.com/amery/linux-allwinner/tree/lichee-3.0.8-sun4i

I made certain and used make menuconfig after the initial make_sun4i_defconfig. I made certain that cifs.ko was in there and that HDMI output was enabled. I also enabled the Ethernet driver and SATA driver. The LCD on the tablet is still, blank, however. I think it needs the particular framebuffer driver for that LCD. But maybe the HDMI will work. So far all I know is that I can ping the tablet. Here goes:

root@T-01:~# uname -a
Linux T-01 3.0.8+ #1 PREEMPT Tue Jun 26 00:40:03 IST 2012 armv7l armv7l armv7l GNU/Linux

I can login! That's a start. . .

SATA works:

root@T-01:~# dmesg |grep SATA
[    0.980000] SATA AHCI Phy Power Failed!!
[    1.050000] SATA AHCI Phy Calibration Failed!!
[    1.090000] ata1: SATA max UDMA/133 mmio [mem 0x01c18000-0x01c18fff] port 0x100 irq 56
[    1.450000] ata1: SATA link down (SStatus 0 SControl 300)

Ethernet works:
root@T-01:~# dmesg |grep Ethernet
[    1.100000] wemac Ethernet Driver, V1.00 in file:drivers/net/sun4i/sun4i_wemac.c
[    2.170000] Bluetooth: BNEP (Ethernet Emulation) ver 1.3

Still no X server running. . . guess it's common to this kernel tree also.
I will need to figure out what module is missing that X needs and build that module. Once I figure that out it looks like we are all set.

Hey. Poweroff command seems to work on this kernel! (It hasn't on any of the others.)

This one at least boots when HDMI is connected. But there is no HDMI output. Maybe the module needs to be inserted.
insmod: error inserting 'hdmi.ko': -1 Unknown symbol in module
Ahh. Okay. That explains something.
insmod disp.ko
insmod hdmi.ko
No errors.
Still no HDMI output, however. Turns out all the modules on the stock kernel are built-in except RTL8192 wifi module. So there is no way to see which ones are linked.

Question to somebody:
Why, on the default kernel config, is the framebuffer and HDMI not enabled? Without any documentation how do you expect anybody to use that config? Obviously somebody knows the correct config. Otherwise the stock kernel supplied would not work. So why is that not the default in the "recommended" kernel source, and why is the framebuffer not enabled? If the kernel source is to be useful it need to have a default config that enables the display, ethernet, and sata. It is not going to affect any device on which they are used. Also the kernel drivers need to be built as modules if possible. That is the normal way of doing things now.

It looks like the HDMI and framebuffer need to be compiled into the kernel and not as modules. In the meantime I'm going to use the existing working kernel to make an new bootable Ubuntu SD card image that people can use as a buildroot, and to use and test.

According to the kernel maintainers HDMI works with the default config. So there is likely an issue with the module ordering on my system. That is possible due to my building the kernel in a chroot. I do not know what the correct module ordering is. Please comment if you know the proper video module ordering.



Edited 5 time(s). Last edit at 06/28/2012 12:56PM by gnexus.
Vlad59
Re: Building the Linux kernel for the A10
June 26, 2012 08:17AM
Hi gnexus,

I'm not able to help you in any way. But my Mele A2000 is coming so I'll be happy to be running Linux in some days.

So thanks a lot for your time !!!

Vlad
Re: Building the Linux kernel for the A10
June 26, 2012 08:38AM
The drivers part of the git tree has some bits of documentation in xls, pdf format but you'll need to understand Chinese.

This is in English though.

The folks at arm-netbook have been at this for a while now. In fact they contributed many parts of this wiki. I subscribed to the mailing list archive while waiting for my melee a1000 to arrive. And it arrived today :)
Re: Building the Linux kernel for the A10
June 26, 2012 10:45AM
Quote

The folks at arm-netbook have been at this for a while now. In fact they contributed many parts of this wiki. I subscribed to the mailing list archive while waiting for my melee a1000 to arrive. And it arrived today :)

Hey. Thanks for the info and thanks for your post!

I didn't browse the sources enough to know that the driver file you link to is also in my git clone. I know about arm-netbook and have been following it. I purchased my Mele from hipboi (Tom Cubie). I have read the with at Rhombus-Tech, just haven't posted a link to it here yet. Many things to do. . .

I also have a Mele A2000 coming. Once that gets here it will make troubleshooting u-boot and the kernel much easier. Until then I must deal with using my tablet and an SSH console. Please help us out if you can and get more people using this forum. I am anxious to get a decent kernel image that fully supports all the native devices on the A10. I know that Mali support will be a while yet. But I would just be happy with getting the framebuffer going in something I can compile from source.

Thanks.
Re: Building the Linux kernel for the A10
June 28, 2012 11:44AM
Quote

root@T-01:/mnt/misc# kpartx SDcard.img
/proc/misc: No entry for device-mapper found
Is device-mapper driver missing from kernel?
Failure to communicate with kernel device-mapper driver.
loop0p1 : 0 32768 /dev/loop0 2048
loop0p2 : 0 6526976 /dev/loop0 34816
loop0p3 : 0 1048575 /dev/loop0 6561792
ioctl: LOOP_CLR_FD: Device or resource busy
root@T-01:/mnt/misc# modprobe dm_mod
FATAL: Module dm_mod not found.

Stupid android kernel config. . . no device mapper either.
Re: Building the Linux kernel for the A10
June 30, 2012 05:52AM
confirmed that the HDMI modules are built in for Android A10 kernels.
Re: Building the Linux kernel for the A10
July 08, 2012 03:41AM
I found this about creating the right Android/Linux groups to avoid running firefox as root. HTH
sudo groupadd -g 3003 inet
sudo groupadd -g 3005 inetadmin
sudo usermod -aG inet miniand
sudo usermod -aG inetadmin miniand
Re: Building the Linux kernel for the A10
July 08, 2012 08:43AM
Thanks!

I tried adding the Android inet user groups at one point, but it did not help. I will try it again. But it is not a high priority.
Removing the Android crap from the kernel is a higher priority. But it would be nice not to need root access for users.

Edit:

It would probably be better just to remove this line from the kernel config: ;)

CONFIG_ANDROID_PARANOID_NETWORK=y


Also:
Quote

sudo usermod -aG inet miniand
sudo usermod -aG inetadmin miniand

We don't have a "miniand" user or group. ;)

Therefore that usermod parameter would not apply.



Edited 1 time(s). Last edit at 07/12/2012 10:45AM by gnexus.
Re: Building the Linux kernel for the A10
July 08, 2012 09:05AM
Has anyone tried building a kernel from the Linux 3.0.8 mainline (the code on kernel.org, not the kernel+android source)? I would expect that none of the drivers would be there and so the screen/sounds/buttons/etc wouldn't work, but if it had a working serial port it could still be a useful starting point.
Re: Building the Linux kernel for the A10
July 08, 2012 09:58AM
Quote

Has anyone tried building a kernel from the Linux 3.0.8 mainline

No. Why would you do that, Jeff? If you were to use mainline why not just go with the latest?

Mnemoc (amery) has several branches in his Git repository. The latest is linux-3.4, which is a WIP (work-in-progress). The stable branch is linux-3.0.36. According to mnemoc the stable kernel works fine. But when I tried it on my first build the HDMI was not working. We came to the conclusion on IRC that the HDMI issue was due to the drivers being compiled as modules and not loading in the correct order.

Now that I have the Mele with a working serial port I can try various kernel builds. If all the linux-allwinner kernels have the Android configs we will need to diff it with the vanilla kernel to find which Android configs need to be removed. That should not be too difficult. It would be much more difficult to start with a vanilla kernel and then add the allwinner configs than the other way.

The biggest problem currently is that mnemoc only has limited time to work on the kernel, and that any other work being done with Allwinner kernels is spread out all over the 'net. We need many people working simultaneously on the kernel to get it current with mainline in a reasonable time frame. The reason I posted the SD images to this site is to encourage more developers to take part. The needed tools are already a part of the SD image.
Re: Building the Linux kernel for the A10
July 10, 2012 09:53PM
It looks like you can just undefine android in the config to disable the android subsystem. See here for an example.
Re: Building the Linux kernel for the A10
July 12, 2012 02:29PM
I have finally made some progress on a working compiled kernel. Thanks to Turl on IRC for sharing his kernel config which got my HDMI working. Using that config I now have working HDMI using the linux-allwinner source:
Linux T-01 3.0.36+ #1 PREEMPT Thu Jul 12 18:21:06 IST 2012 armv7l

Turl has a working IPv6 subsystem in his kernel config. My earlier config with no HDMI also had ipv6. My kernel config also has support for many additional features and drivers which Turl's config does not have. So now I will try to consolidate the two configs into a single functional kernel config. that we can use as a baseline.

Got it!
Linux T-01 3.0.36+ #1 PREEMPT Thu Jul 12 21:31:58 IST 2012 armv7l

I used my working non-HDMI config and changed only the video configs. Only about two lines in my kernel config were changed to correspond to Turl's config.

That means Android Paranoid Networking is now Gone!
All server daemons are now working with no issues.

This kernel config has extensive improvements over the sun4i_defconfig:
  • lzma compression (sun4i_defconfig is gzip)
  • 50+% smaller kernel size (currently about 2MB - target size = 1.5MB, it is getting closer every day :)
  • all drivers are built as modules if possible (ipv6 and many Allwinner drivers must currently be built-in)
  • kernel command line support for alternate drives and rootfs partitions (sun4i_defconfig)
  • NAND drivers for Linux access to the flash memory (sun4i_defconfig)
  • UBIFS, BTRFS, JFFS2, XFS, JFS, SQUASHFS, REISERFS support (not in sun4i_defconfig)
  • IPv6 support (not in sun4i_defconfig)
  • Netfilter support for IPv4 & IPv6 (not in sun4i_defconfig)
  • ThumbEE instructions support (not in sun4i_defconfig)
  • /dev/mapper support (not in sun4i_defconfig)
  • SE Linux support (not in sun4i_defconfig)
  • V4L support for addtl. devices such as TV tuners (not in sun4i_defconfig)
  • DVB support for devices such as TV tuners (not in sun4i_defconfig)
  • CIFS support (Samba) (not in sun4i_defconfig)
  • much more. . .

I will try to get a version this kernel released as soon as possible so people can start testing ;)

The new 3.0.36+ kernel is stable enough to get people away from using the 3.0.8+ kernel and into using a decent kernel.

Please see the updated kernel thread for the latest kernel information and kernel images.



Edited 7 time(s). Last edit at 07/16/2012 02:20PM by gnexus.
Sorry, you can't reply to this topic. It has been closed.