Looking for ARM SoC porting guidelines

Maxime Ripard maxime.ripard at free-electrons.com
Thu Nov 13 03:40:54 EST 2014


Hi Mike,

On Wed, Nov 12, 2014 at 09:45:58PM -0800, Mike Thompson wrote:
> I'm working on a port the latest Linux kernel to a Nuvoton N32905 - a very
> inexpensive ARM9 based SoC similar to the Freescale iMX23 in many
> respects.  My hope is that my code for this SoC will eventually reach the
> mainline kernel, but the whole process a fairly daunting task to a kernel
> newbie such as myself.

Been there... :)

> I do have a six year old port of the 2.6.35 kernel to this SoC to help as a
> reference, but it's pretty much a rewrite to support devicetree, the common
> clock framework, and a myriad of changes needed to get a new SoC supported
> in the mainline kernel.  Not to mention all the 2.6.35 code added for this
> chip isn't even close to the coding standards for the Kernel.
> 
> So far I got the 3.17 kernel running pretty well the baseline peripherals
> such as clocks, interrupt controller, UART, GPIO & pin muxing along with
> hire level peripherals such as MMC/SD card support, MTD NAND and NOR flash
> and USB host support.

Cool!

> As a guide, I've been using other ARM SoCs for examples and a number of
> very useful presentations on ARM SoC support from the Free Electron folks.
> Although presentations such as the "ARM SoC Linux Support Check-list" are
> very useful, they don't go into much detail.
> 
> My question is two fold.  Is there detailed information of all the things
> that need to be covered in the code to introduce a new ARM SoC into the
> kernel?

Usually "enough so that it boots", which means: timers, interrupts,
UARTs, and that's pretty much it.

Any additional feature is of course welcome, but I'd suggest to just
post that for the first set of patches. There will probably
significant changes to make to your base drivers (and I would include
clocks and pinctrl into these drivers), and these will impact any
further developments. You don't want to have too much dependency :)

Start small, then build on top of what's accepted.

> Then, is there a description of how I start to go about contributing
> support for this chip into the Linux kernel? I honestly don't really
> know where to begin.

Like I said, send the minimum amount of patches to have Linux boot an
initramfs on your SoC. Apart from that, there is nothing out of the
ordinary on how to submit patches, everything is detailed in
Documentation/SubmittingPatches. Basically, it will involve sending
patches to the linux-arm-kernel mailing list and the ARM SoC kernel
maintainers. Make sure that everything has no warning in
scripts/checkpatch.pl, and you're good to go.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20141113/9792e937/attachment.bin 


More information about the Kernelnewbies mailing list