2

I'm trying to get kernel 4.6 running on an S3C6410 board.

In order to complete the port and to boot fully, I need to configure the kernel to work with the NAND flash and the SD controller on the board.

This is my first try at porting/cross-compiling a kernel, so I'm more looking for advice on how to approach and diagnose the problem rather than an exact solution.

I've got the board to boot kernel 4.6, but I can't get it to see the NAND flash or SD card (so no rootfs).

Supplied kernel which works

The board came with "2.6.38-GZSD", which when diff'd against plain 2.6.38, includes:

  • some audio/video/tv/LCDtouchscreen drivers, which I don't care about

  • character device drivers for buttons/gpio/pwm/adc, which I don't care about

  • yaffs2 filesystem (which I've already ported to 4.6)

  • a machine definition gzsd4610 within arch/arm/mach/mach-s3c64xx, for this board

  • a NAND driver at drivers/mtd/nand/s3c_nand.c. Kernel 4.6 has NAND and ONENAND drivers for this platform, so I'm trying to use those instead of porting the old driver from 2.6.38.

Set-up

I'm uploading the software on the board via a bootloader built-into the board. It loads into NAND flash from the SD card: a u-boot image, a kernel image, and a rootfs image.

I'm communicating with the board via serial.

I'm compiling kernel 4.6 using GCC 6.1.1. The 2.6.38-GZSD kernel was supplied compiled. I'd need some version of GCC 4 in order to compile it myself.


I've tried using the 4.6 kernel source with no source modification - so only via the configuration UI (make nconfig in this case). I've set the platform, and enabled all relevant drivers (I hope).

The machine is set to SMDK6410 rather than GZSD6410, since GZSD6410 isn't in the mainline (and porting that from 2.6.38 would require a better knowledge of the kernel than I currently have). This, and possibly the NAND driver are what I assume to be the cause of my boot failure.

I'm currently using command line:

init=/linuxrc console=ttySAC0,115200 root=/dev/mtdblock2 loglevel=7 earlyprintk

In contrast, the command line from the working 2.6.38-GZSD kernel is:

init=/linuxrc console=ttySAC0,115200 root=/dev/mtdblock2

Specific issues (and logs)

The kernel fails to initialise the SD card reader.

It also fails to initialise ONENAND.

If I try to use NAND instead of ONENAND then that also fails.

In any case, this leads to the kernel being unable to mount rootfs and panicking.

In contrast, the log from a successful boot with 2.6.38-GZSD looks like this.

  • I wonder how to undo a wrong edit...I did another edit on top of it. – Rui F Ribeiro Aug 25 '16 at 6:56
  • 1
    Hacked kernel versions by the vendor is a known problem in the SBC community, and we tend to avoid buying boards that are know to be stuck in an old version. Nevertheless, it seems an interesting project. – Rui F Ribeiro Aug 25 '16 at 6:59
  • An embedded guy at work was getting rid of stuff and I figured this would be an interesting project. Is there some list maintained online of boards which will run with vanilla kernels? – Mark K Cowan Aug 25 '16 at 7:25
  • Unfortunately, not really. Lately I check them first in the Armbian page, but I am starting to eye SBCs compatible with *BSD. – Rui F Ribeiro Aug 25 '16 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.