WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Native sunxi kernel compile issues  (Read 19806 times)

Offline bitonator

  • Newbie
  • *
  • Posts: 6
Native sunxi kernel compile issues
« on: January 18, 2015, 01:41:49 AM »
I'm trying to compile the sunxi kernel natively on my Cubieboard A10.

The steps I followed were:

1. importsce build-essential
2. loadsce build-essential
3. cp a10Core-kernel-3.0.42.config (downloaded) .config
4. make oldconfig
5. make
6. mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n "Linux-
3.0.42" -d zImage uImage (I found the parameters by doing 'file uImage' on the tiny core kernel)

When I use this kernel, the bootloader detects the kernel images

## Booting kernel from Legacy Image at 48000000 ...
   Image Name:   Linux-3.0.42
   Created:      2015-01-18   6:05:28 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3959024 Bytes = 3.8 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 43100000 ...
   Image Name:   ramdisk
   Created:      2015-01-06  14:04:20 UTC
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    3052655 Bytes = 2.9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting Kernel...

Then, nothing, and after a while I get the bootloader again.

Am I doing something wrong?

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Native sunxi kernel compile issues
« Reply #1 on: January 28, 2015, 07:50:03 PM »
After step 2.
importsce uboot-mkimage
loadsce uboot-mkimage

.
.
.

Step 5 should be:
make uImage

Drop step 6.
« Last Edit: January 29, 2015, 11:44:45 AM by roberts »
10+ Years Contributing to Linux Open Source Projects.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 713
Re: Native sunxi kernel compile issues
« Reply #2 on: January 29, 2015, 04:17:30 AM »
U-boot.

Are you starting the kernel at correct entry point, as you enter in the mkimage.

bootm 0x40008000 0x00000000


Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Native sunxi kernel compile issues
« Reply #3 on: January 31, 2015, 04:25:28 PM »
@bitonator

I used your mkimage parameters directly on zImage to produce uImage.
The resulting uImage was the same as the one created via make uImage.
Booting from the manually created uImage was successful.

So something else must be awry. Did you use the linux-sunxi-g2d source tree?
Perhaps start clean via make sunxi_defconfig?
10+ Years Contributing to Linux Open Source Projects.

Offline expresspotato

  • Newbie
  • *
  • Posts: 11
Re: Native sunxi kernel compile issues
« Reply #4 on: February 16, 2015, 11:36:24 PM »
I have the same problem when compiling from Fedora, booting hangs with 'Starting Kernel...'

So the boot.scr, uCore, uEnv.txt are all the same from: http://tinycorelinux.net/5.x/armv7/Allwinner-A10/

This is when building the linux-3.0.42 folder. Building the sunxi-linux folder crashes on boot.

Offline expresspotato

  • Newbie
  • *
  • Posts: 11
Re: Native sunxi kernel compile issues
« Reply #5 on: February 17, 2015, 12:03:31 AM »
If the addresses are the same how come it doesn't load?

(Downloaded)
[root@localhost tmp]# file uImage
uImage: u-boot legacy uImage, Linux-3.0.42, Linux/ARM, OS Kernel Image (Not compressed), 4484772 bytes, Fri Feb  8 21:41:39 2013, Load Address: 0x40008000, Entry Point: 0x40008000, Header CRC: 0x0BDAA54E, Data CRC: 0xB8900C9B

(Compiled)
[root@localhost linux-sunxi-g2d]# file arch/arm/boot/uImage
arch/arm/boot/uImage: u-boot legacy uImage, Linux-3.0.42, Linux/ARM, OS Kernel Image (Not compressed), 4108952 bytes, Mon Feb 16 15:40:40 2015, Load Address: 0x40008000, Entry Point: 0x40008000, Header CRC: 0xEEDFEB9F, Data CRC: 0xD087A747

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 713
Re: Native sunxi kernel compile issues
« Reply #6 on: February 17, 2015, 10:45:03 AM »
I also get this behavior before with my guruplug, just forget to add console.

Maybe you also missed to add some console to cmdline..like bootargs for uboot.

env set bootargs 'console=ttyS0,115200'
I don't know what type of serial or another display supported in the kernel.
This line is for my guruplug and debian.


Offline expresspotato

  • Newbie
  • *
  • Posts: 11
Re: Native sunxi kernel compile issues
« Reply #7 on: February 17, 2015, 08:52:01 PM »
Hmm didn't help for me:

Code: [Select]
U-Boot SPL 2013.01 (Feb 11 2013 - 15:19:28)
Board: mk802ii
DRAM: 1024MB
SUNXI SD/MMC: 0


U-Boot 2013.01 (Feb 11 2013 - 15:19:28) Allwinner Technology

CPU:   SUNXI Family
Board: mk802ii
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   wemac
Hit any key to stop autoboot:  0
sun4i#env set bootargs 'console=ttyS0,115200'
sun4i#
sun4i#
sun4i#boot
reading uEnv.txt
117 bytes read in 3 ms (38.1 KiB/s)
Loaded environment from uEnv.txt
reading boot.scr
304 bytes read in 2 ms (148.4 KiB/s)
Jumping to boot.scr
## Executing script at 44000000
reading script.bin
42132 bytes read in 5 ms (8 MiB/s)
reading uImage
3913400 bytes read in 203 ms (18.4 MiB/s)
reading uCore
2951575 bytes read in 154 ms (18.3 MiB/s)
## Booting kernel from Legacy Image at 48000000 ...
   Image Name:   Linux-3.0.42
   Created:      2015-02-16  22:26:33 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3913336 Bytes = 3.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 43100000 ...
   Image Name:   uCore for Allwinner A10
   Created:      2014-12-26  21:12:42 UTC
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    2951511 Bytes = 2.8 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 713
Re: Native sunxi kernel compile issues
« Reply #8 on: February 18, 2015, 12:06:28 PM »
Have you some readout of the uEnv.txt and boot.scr files.
Have you seen this, i suppose it's using u-boot like this.
https://github.com/linux-sunxi/u-boot-sunxi/wiki
 

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Native sunxi kernel compile issues
« Reply #9 on: February 18, 2015, 12:12:38 PM »
I have only used linux-sunxi to build kernels and u-boot.

See: http://forum.tinycorelinux.net/index.php/topic,13827.msg78687.html#msg78687

You may want to use this forum's advanced search to search for code sourcery posts by roberts.

Here is why I only use linux-sunxi...

https://linux-sunxi.org/Linux_Kernel

Development for sunxi-based systems had originally begun based on an Allwinner android kernel. The linux-sunxi.org 3.4 kernel series is based on this android kernel and is maintained by a group of volunteers at linux-sunxi.org.

The mainline kernel is the "official" Linux kernel series released by Linus Torvalds. Beginning with kernel 3.8, several developers have been working on integrating sunxi support into the mainline kernel.

U-boot-sunxi is derived from the original Allwinner u-boot and is maintained by a group of volunteers at linux-sunxi.org. It contains an SPL component that takes care of the basic hardware initialization and therefore does not need the proprietary boot0/boot1 loaders from Allwinner. It can boot locally from MMC/SD card and over the network by TFTP, but it cannot access the NAND flash. The current version (as of 08/2014) has been updated to the featureset of mainline u-boot v2014.04; it does not have PSCI-, AHCI- and EHCI-support.

Mainline u-boot is the official upstream u-boot version. Work is currently in progress to integrate the sunxi-specific parts of u-boot-sunxi into mainline u-boot. When this process is completed, u-boot-sunxi can be replaced by mainline u-boot. Mainline u-boot as of release v2014.10 already supports several sunxi-based systems, although not yet all systems that are supported by u-boot-sunxi.

I have built 3.4 from linux-sunix and it also boots fine.

If your lucky and adventurous you may want to try mainline linux kernel 3.18 and mainline u-boot but first check to see if your device is in there!
10+ Years Contributing to Linux Open Source Projects.

Offline bitonator

  • Newbie
  • *
  • Posts: 6
Re: Native sunxi kernel compile issues
« Reply #10 on: February 22, 2015, 07:49:23 AM »
@roberts @patrikg

I tried using uboot-mkimage but no luck.

I downloaded the kernel source and kernel config from the tiny core linux download area for Alwinner A10 at http://distro.ibiblio.org/tinycorelinux/dCore/armv7/Allwinner-A10/

Offline bitonator

  • Newbie
  • *
  • Posts: 6
Re: Native sunxi kernel compile issues
« Reply #11 on: February 22, 2015, 12:25:14 PM »
@roberts thanks a bunch!

I noticed the linux-sunxi-g2d kernel source in the downloads area and used that. Works like a charm!

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Native sunxi kernel compile issues
« Reply #12 on: February 23, 2015, 11:15:55 AM »
Glad to hear!  :)
10+ Years Contributing to Linux Open Source Projects.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Native sunxi kernel compile issues
« Reply #13 on: March 02, 2015, 11:34:04 AM »
As I stated above I have been running on a 3.4.103 kernel It is now being further tested.
10+ Years Contributing to Linux Open Source Projects.

Offline bitonator

  • Newbie
  • *
  • Posts: 6
Re: Native sunxi kernel compile issues
« Reply #14 on: March 03, 2015, 11:55:54 PM »
@roberts any advantages in using the 3.4.103 kernel?