Skip to contentSkip to conversation

Single binary kernel for all i.MX

DISCUSSION Sascha Hauer 7 participants 11 messages Nov 5, 2010 – Nov 13, 2010

lore
Share & tools
lore
#0 lore raw

Hi all,

We are talking about a single kernel for longer now, here is something to test for the ones interested:

git://git.pengutronix.de/git/imx/linux-2.6.git imx-single-kernel

Compiling the imx_defconfig will result in a kernel which works i.MX21, i.MX27, i.MX31, i.MX35 and i.MX51 (not tested on i.MX21). i.MX1 does not work mainly because the kernel build will use some ARMv5 and later instructions.
The branch is based on the patches recently posted. It contains some hacks, so it still needs to be worked on.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#1 lore raw

Hi Sascha,

Quoted 9 lines · Sascha Hauer

We are talking about a single kernel for longer now, here is something to test for the ones interested:

git://git.pengutronix.de/git/imx/linux-2.6.git imx-single-kernel

Compiling the imx_defconfig will result in a kernel which works i.MX21, i.MX27, i.MX31, i.MX35 and i.MX51 (not tested on i.MX21). i.MX1 does not work mainly because the kernel build will use some ARMv5 and later instructions.

What is blocking i.MX25 from being included?

baruch

Quoted 4 lines

The branch is based on the patches recently posted. It contains some hacks, so it still needs to be worked on.

Sascha

Signature · 3 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#2 lore raw
Quoted 6 lines · Baruch Siach

Hi Sascha,

Quoted 3 lines · Sascha Hauer

We are talking about a single kernel for longer now, here is something to test for the ones interested:

Quoted 8 lines
Quoted 6 lines

git://git.pengutronix.de/git/imx/linux-2.6.git imx-single-kernel

Compiling the imx_defconfig will result in a kernel which works i.MX21, i.MX27, i.MX31, i.MX35 and i.MX51 (not tested on i.MX21). i.MX1 does not work mainly because the kernel build will use some ARMv5 and later instructions.

What is blocking i.MX25 from being included?

It is. I just forgot to mention.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#3 lore raw
Quoted 9 lines · Sascha Hauer
Quoted 8 lines · Baruch Siach

Hi Sascha,

Quoted 5 lines · Sascha Hauer

We are talking about a single kernel for longer now, here is something to test for the ones interested:

git://git.pengutronix.de/git/imx/linux-2.6.git imx-single-kernel

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Compiling the imx_defconfig will result in a kernel which works i.MX21, i.MX27, i.MX31, i.MX35 and i.MX51 (not tested on i.MX21). i.MX1 does not work mainly because the kernel build will use some ARMv5 and later instructions.

What is blocking i.MX25 from being included?

It is. I just forgot to mention.

Hrm... the imx series is placing all header files in arch/arm/plat-mxc/include/plat
instead of within each mach-*. Most other sub-arch doesn't behave like that at this moment and getting them built together ain't easy.

BTW, did you get it tested on different boards, I'd be interested to see what could be the potential issues at run-time.

Quoted 15 lines

Sascha

--

Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 ? ?|
Amtsgericht Hildesheim, HRA 2686 ? ? ? ? ? | Fax: ? +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw

Hi Eric,

Quoted 15 lines · Eric Miao
Quoted 14 lines · Sascha Hauer
Quoted 13 lines · Baruch Siach

Hi Sascha,

Quoted 9 lines · Sascha Hauer

We are talking about a single kernel for longer now, here is something to test for the ones interested:

git://git.pengutronix.de/git/imx/linux-2.6.git imx-single-kernel

Compiling the imx_defconfig will result in a kernel which works i.MX21, i.MX27, i.MX31, i.MX35 and i.MX51 (not tested on i.MX21). i.MX1 does not work mainly because the kernel build will use some ARMv5 and later instructions.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

What is blocking i.MX25 from being included?

It is. I just forgot to mention.

Hrm... the imx series is placing all header files in arch/arm/plat-mxc/include/plat
instead of within each mach-*. Most other sub-arch doesn't behave like that at this moment and getting them built together ain't easy.

Indeed I had to move back one header file under mach-imx/include/mach back to plat-mxc/include/mach.

Quoted 3 lines

BTW, did you get it tested on different boards, I'd be interested to see what could be the potential issues at run-time.

I only booted up a root nfs on different boards and was happy that it worked so far. I have no experience with kernels supporting v5/v6/v7 in a single binary. Has anybody tried this before? At least the defconfigs don't show an example for this.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#5 lore raw
In reply to Sascha Hauer

Hi Sascha,

I'm studying at the implementation. Can you please help me understand how "addruart" in plat-mxc/include/mach/debug-macro.S works for single image?

        .macro  addruart, rp, rv
        ldr     \rp, =UART_PADDR        @ physical
        ldr     \rv, =UART_VADDR        @ virtual

.endm

We have this macro to get physical base address of UART. However UART_PADDR is defined as MX?_UART1_BASE_ADDR depending on CONFIG_ARCH_MX*. When all CONFIG_ARCH_MX* get defined in single image case, how does UART_PADDR work for all CONFIG_ARCH_MX*?

Thanks.

Quoted 27 lines · Sascha Hauer

Hi all,

We are talking about a single kernel for longer now, here is something to test for the ones interested:

git://git.pengutronix.de/git/imx/linux-2.6.git imx-single-kernel

Compiling the imx_defconfig will result in a kernel which works i.MX21, i.MX27, i.MX31, i.MX35 and i.MX51 (not tested on i.MX21). i.MX1 does not work mainly because the kernel build will use some ARMv5 and later instructions.
The branch is based on the patches recently posted. It contains some hacks, so it still needs to be worked on.

Sascha

--

Pengutronix e.K. ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Industrial Linux Solutions ? ? ? ? ? ? ? ? | http://www.pengutronix.de/ ?|
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 ? ?|
Amtsgericht Hildesheim, HRA 2686 ? ? ? ? ? | Fax: ? +49-5121-206917-5555 |

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Signature · 2 lines
Regards,
Shawn
#6 lore raw

Hi Shawn,

Quoted 7 lines · Shawn Guo

I'm studying at the implementation. Can you please help me understand how "addruart" in plat-mxc/include/mach/debug-macro.S works for single image?

        .macro  addruart, rp, rv
        ldr     \rp, =UART_PADDR        @ physical
        ldr     \rv, =UART_VADDR        @ virtual
Quoted 6 lines

.endm

We have this macro to get physical base address of UART. However UART_PADDR is defined as MX?_UART1_BASE_ADDR depending on CONFIG_ARCH_MX*. When all CONFIG_ARCH_MX* get defined in single image case, how does UART_PADDR work for all CONFIG_ARCH_MX*?

In a kernel that supports more than one SoC, DEBUG_LL won't work. This is generally OK, because DEBUG_LL is only needed when bringing up a machine. Therefor you can use a tailored kernel that only supports your shiny new machine.

Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#7 lore raw

2010/11/12 Uwe Kleine-K?nig <[email protected]>:

Quoted 16 lines

Hi Shawn,

Quoted 9 lines · Shawn Guo

I'm studying at the implementation. ?Can you please help me understand how "addruart" in plat-mxc/include/mach/debug-macro.S works for single image?

? ? ? ? .macro ?addruart, rp, rv
? ? ? ? ldr ? ? \rp, =UART_PADDR ? ? ? ?@ physical ? ? ? ? ldr ? ? \rv, =UART_VADDR ? ? ? ?@ virtual ? ? ? ? .endm

Quoted 4 lines

We have this macro to get physical base address of UART. ?However UART_PADDR is defined as MX?_UART1_BASE_ADDR depending on CONFIG_ARCH_MX*. ?When all CONFIG_ARCH_MX* get defined in single image case, how does UART_PADDR work for all CONFIG_ARCH_MX*?

Quoted 7 lines

In a kernel that supports more than one SoC, DEBUG_LL won't work. ?This is generally OK, because DEBUG_LL is only needed when bringing up a machine. ?Therefor you can use a tailored kernel that only supports your shiny new machine.

Uwe

Hi Uwe,

OMAP does have this working. For example, we can boot a single kernel image on OMAP2, OMAP3 and OMAP4 today, and we have DEBUG_LL working for sure on the last two - probably also on OMAP2.

I'm not exactly sure how this mechanism works, but for every new machine we add, we usually add an entry in arch/arm/plat-omap/include/plat/uncompress.h

- Anand

#8 lore raw

Hi Anand,

Quoted 25 lines · Anand

2010/11/12 Uwe Kleine-K?nig <[email protected]>:

Quoted 16 lines

Hi Shawn,

Quoted 9 lines · Shawn Guo

I'm studying at the implementation. ?Can you please help me understand how "addruart" in plat-mxc/include/mach/debug-macro.S works for single image?

? ? ? ? .macro ?addruart, rp, rv
? ? ? ? ldr ? ? \rp, =UART_PADDR ? ? ? ?@ physical ? ? ? ? ldr ? ? \rv, =UART_VADDR ? ? ? ?@ virtual ? ? ? ? .endm

Quoted 4 lines

We have this macro to get physical base address of UART. ?However UART_PADDR is defined as MX?_UART1_BASE_ADDR depending on CONFIG_ARCH_MX*. ?When all CONFIG_ARCH_MX* get defined in single image case, how does UART_PADDR work for all CONFIG_ARCH_MX*?

Quoted 7 lines

In a kernel that supports more than one SoC, DEBUG_LL won't work. ?This is generally OK, because DEBUG_LL is only needed when bringing up a machine. ?Therefor you can use a tailored kernel that only supports your shiny new machine.

Uwe

Quoted 8 lines

Hi Uwe,

OMAP does have this working. For example, we can boot a single kernel image on OMAP2, OMAP3 and OMAP4 today, and we have DEBUG_LL working for sure on the last two - probably also on OMAP2.

I'm not exactly sure how this mechanism works, but for every new machine we add, we usually add an entry in arch/arm/plat-omap/include/plat/uncompress.h

You're mixing things up, mach/uncompress.h is for the Uncompressing Linux message when booting a zImage, mach/debug-macro.S is for DEBUG_LL and used to get debug messages out of the serial interface (usually).

The former will work for a multi-soc-imx-image, the latter probably not.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#9 lore raw
Quoted 34 lines · Uwe Kleine-K?nig

Hi Anand,

Quoted 31 lines · Anand

2010/11/12 Uwe Kleine-K?nig <[email protected]>:

Quoted 16 lines

Hi Shawn,

Quoted 9 lines · Shawn Guo

I'm studying at the implementation. ?Can you please help me understand how "addruart" in plat-mxc/include/mach/debug-macro.S works for single image?

? ? ? ? .macro ?addruart, rp, rv
? ? ? ? ldr ? ? \rp, =UART_PADDR ? ? ? ?@ physical ? ? ? ? ldr ? ? \rv, =UART_VADDR ? ? ? ?@ virtual ? ? ? ? .endm

Quoted 4 lines

We have this macro to get physical base address of UART. ?However UART_PADDR is defined as MX?_UART1_BASE_ADDR depending on CONFIG_ARCH_MX*. ?When all CONFIG_ARCH_MX* get defined in single image case, how does UART_PADDR work for all CONFIG_ARCH_MX*?

Quoted 7 lines

In a kernel that supports more than one SoC, DEBUG_LL won't work. ?This is generally OK, because DEBUG_LL is only needed when bringing up a machine. ?Therefor you can use a tailored kernel that only supports your shiny new machine.

Uwe

Hi Uwe,

OMAP does have this working. For example, we can boot a single kernel image on OMAP2, OMAP3 and OMAP4 today, and we have DEBUG_LL working for sure on the last two - probably also on OMAP2.

Quoted 7 lines
Quoted 2 lines

I'm not exactly sure how this mechanism works, but for every new machine we add, we usually add an entry in arch/arm/plat-omap/include/plat/uncompress.h

You're mixing things up, mach/uncompress.h is for the Uncompressing Linux message when booting a zImage, mach/debug-macro.S is for DEBUG_LL and used to get debug messages out of the serial interface (usually).

The former will work for a multi-soc-imx-image, the latter probably not.

... and my previous comment applies to the later.

Nicolas

#10 lore raw
In reply to Gadiyar, Anand
Quoted 22 lines · Anand

2010/11/12 Uwe Kleine-K?nig <[email protected]>:

Quoted 21 lines

Hi Shawn,

Quoted 9 lines · Shawn Guo

I'm studying at the implementation. ?Can you please help me understand how "addruart" in plat-mxc/include/mach/debug-macro.S works for single image?

? ? ? ? .macro ?addruart, rp, rv
? ? ? ? ldr ? ? \rp, =UART_PADDR ? ? ? ?@ physical ? ? ? ? ldr ? ? \rv, =UART_VADDR ? ? ? ?@ virtual ? ? ? ? .endm

Quoted 4 lines

We have this macro to get physical base address of UART. ?However UART_PADDR is defined as MX?_UART1_BASE_ADDR depending on CONFIG_ARCH_MX*. ?When all CONFIG_ARCH_MX* get defined in single image case, how does UART_PADDR work for all CONFIG_ARCH_MX*?

In a kernel that supports more than one SoC, DEBUG_LL won't work. ?This is generally OK, because DEBUG_LL is only needed when bringing up a machine. ?Therefor you can use a tailored kernel that only supports your shiny new machine.

Quoted 8 lines
Quoted 2 lines

Uwe

Hi Uwe,

OMAP does have this working. For example, we can boot a single kernel image on OMAP2, OMAP3 and OMAP4 today, and we have DEBUG_LL working for sure on the last two - probably also on OMAP2.

Sure, but that mechanism is really too complicated for what is supposed to be a barebone debugging facility. If you have it on OMAP and it has been debugged already then fine. I don't encourage others to necessarily do the same though.

Nicolas