Odroid-U2/X2 on Linux 3.10 port - need info

Post Reply
Posts: 2
Joined: Sun Dec 29, 2013 9:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0

Odroid-U2/X2 on Linux 3.10 port - need info

Unread post by obeny » Sun Dec 29, 2013 11:08 am

Hello everyone!

This is my first post, so I'll shortly introduce myself. I'm using Odroid as server machine providing various services: www with php, mail, databases, svn repositories wifi accesspoint and so on running Gentoo linux and it works perfect so far ;) I like it so much. It offers very good performance with very low power consumption and it's extremely silent - of course no mechanical parts at all. I want to help somehow with Odroid linux kernel development.

I've merged existing kernel with grsecurity to improve system security, however I want to have stable kernel e.g. 3.10.y with long term upstream support (for bug-fixes, security issues fixes and driver updates).

I'm not familiar with linux kernel too much, but i think it is a very good opportunity to delve into linux kernel development just for fun.

My goal is to port Odroid to latest stable Linux Kernel with support of all peripherals and merge it with grsecurity.

OK, let's start.

Test system:
Odroid-U2, 8GB MMC class 10, fused with u-boot, bl1 and bl2 from http://dev.odroid.com/projects/4412boot ... oot.tar.gz. Complete system is present on MMC. Everything works perfect with kernel from HK git repository and custom kernel .config file (removing unneeded drivers and functionalities). System is able to boot, prints kernel diagnostic messages via USB-UART and blinks with blue LED indicating system heartbeat.

And now the adventure begins ;)

I've started with vanilla 3.8, 3.10 and 3.12 kernels - none of them is able to boot, it is not able even to print anything to UART. Configuration based on previously used .config.
To figure what is missing I've compared latest changes made in HK kernel repository to ubuntu Differences are very huge, so i decided to look into arch/arm/mach-exynos and arch/arm/plat-samsung. After excluding changes made to drivers, firmware and so on I've started merging those simple changes to 3.10.
Here is the patch I've made:
http://obeny.obeny.net/odroid/linux-3.1 ... 4x_1.patch
Kernel compiles cleanly, but still it is not able to boot or print anything via UART.

Here is the boot log:

Code: Select all


U-Boot 2010.12-00000-g29d4c3b (Oct 17 2013 - 02:46:38) for Exynox4412

CPU: S5PC220 [Samsung SOC on SMP Platform Base on ARM CortexA9]
APLL = 1000MHz, MPLL = 880MHz
DRAM:  2 GiB

TrustZone Enabled BSP
BL1 version: 20121128

Checking Boot Mode ... SDMMC
MMC Device 0: 7547 MB
MMC Device 1 not found
*** Warning - using default environment

In:    serial
Out:   serial
Err:   serial
ModeKey Check... run normal_boot 
No ethernet found.
Hit any key to stop autoboot:  0 
>>> Load Boot Script from mmc 0:1 <<<
reading boot.scr
355 bytes read in 22 ms (15.6 KiB/s)
## Executing script at 40008000
reading zImage
1608600 bytes read in 40 ms (38.4 MiB/s)
reading uInitrd.gz
2201395 bytes read in 34 ms (61.7 MiB/s)
Boot with zImage
## Loading init Ramdisk from Legacy Image at 42000000 ...
   Image Name:   initramfs
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    2201331 Bytes = 2.1 MiB
   Load Address: 00000000
   Entry Point:  00000000

Starting kernel ...
After "Starting kernel ..." printed by u-boot system hangs, blue LED is still on, not blinking, no messages are print via UART.

What changes are included in the patch above:
1. irq definitions
2. usb-phy definitions (no implementation)
3. added exynos_firmware_init
4. initialization of L2 cache
5. ported mach-hkdk4412.c (based on from HK repo)
6. added setup-dwmci-gpio.c
7. added CPU revision definitions plat/cpu.h
8. added drivers gpio, hardkernel, mmc driver, applied changes made to i2c, regulator, thermal
9. switched gpio functions in tty/serial/samsung.c
10. adapted to api changes

Finally I've got few questions:
1. What is the main reason that kernel is not able to start? What is missing in vanilla kernel and what is required to achieve bootable kernel that is able to print anything to UART? It is not possible to do anything while kernel cannot even complain what is the problem ;)
2. I've searched the forum for any possibility to attach JTAG debugger to Odroid-U2. It's not possible, so please tell me how do you debug the kernel?
3. Is USB phy required to be setup to get UART working? USB phy is not set correctly at the moment.

I hope anyone have reached this point and have an idea how to start with making vanilla kernel bootable.

With Best Regards,

Posts: 1093
Joined: Fri Oct 11, 2013 11:07 pm
languages_spoken: english
Has thanked: 0
Been thanked: 1 time

Re: Odroid-U2/X2 on Linux 3.10 port - need info

Unread post by LiquidAcid » Sun Dec 29, 2013 11:33 am

The 3.10.y release is right in the middle of the migration to DT-only. You won't get very far there, without rewriting large parts of the code. Something that won't pay off at all.

If you want to use vanilla/mainline, you should take a look at prahal's kernel tree, which is a 3.13-rc with a bunch of patches on top of it, to let (at least) the U2 boot. You can contact prahal on IRC.

Posts: 2
Joined: Sun Dec 29, 2013 9:08 am
languages_spoken: english
Has thanked: 0
Been thanked: 0

Re: Odroid-U2/X2 on Linux 3.10 port - need info

Unread post by obeny » Sun Dec 29, 2013 9:33 pm

Thanks a lot LiquidAcid for pointing this repository, I'm checking it out to see prahal changes. Repo is located on incredibly slow server ... download speed is about 3 kBps

I've decided to work on 3.10 because it still supports device configuration out of DT but it still is intentended to have LTS.

I'll look into prahal's changes and decide what to do...

What about debug? Have you got any idea how to do it ?

Site Admin
Posts: 11735
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
Location: Brazil
Has thanked: 1 time
Been thanked: 17 times

Re: Odroid-U2/X2 on Linux 3.10 port - need info

Unread post by mdrjr » Sun Dec 29, 2013 10:25 pm

Enable DEBUG_LL, earlyprintk and Samsung UART :)

Post Reply

Return to “Others”

Who is online

Users browsing this forum: No registered users and 1 guest