* [RFC PATCH 0/6] ARM: Disintegrating mach/uncompress.h: low-level debug @ 2012-05-30 23:15 Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 1/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Inject the Earlycon drivers into the decompressor Domenico Andreoli ` (5 more replies) 0 siblings, 6 replies; 7+ messages in thread From: Domenico Andreoli @ 2012-05-30 23:15 UTC (permalink / raw) To: linux-arm-kernel Hi, Earlycon is a thin I/O layer used in the early stage of the kernel loading, before the kernel is decompressed. It provides basic functionality to output characters one by one and flush a queue/buffer. Such abstraction allows the management of multiple drivers and the runtime selection of the one to be used (ex. "earlyprintk=amba-pl011,0xc1000" on the cmdline). If no suitable driver is found, fallback ops are used. Mainline implementation of low-level debugging functionality is currently left to the machine specific uncompress.h header file, which greatly limits the usage of the kernel on multiple machines. Hence the need to remove any driver implementation detail from the said headers. The idea is to collect/refactor the various implementations into separate drivers which can coexist in the same kernel image. In the case of debug UARTs, the natural place for such drivers is the respective kernel serial driver. Some linker magics is used later to inject them into the decompressor. Here is a minimal (and very commmon) driver example: static void __earlyconinit minimal_earlycon_putc(struct earlycon_drv *drv, int ch) { while (STATUS_REG(drv->base) & BUSY_MASK) barrier(); DATA_REG(drv->base) = ch; } EARLYCON_START("minimal-uart") .putc = minimal_earlycon_putc, EARLYCON_END The EARLYCON_START's argument ("minimal-uart") is the name used to select this driver during the early boot process. The __earlyconinit and EARLYCON_START specifiers are defined to put all the related driver stuff into the sections designated to be injected. Besides some restrictions, the Earlycon driver is quite straightforward to code. Some effort has been spent also to lay down an easy migration path for the various platforms, each one independently from the others. The backward compatibility is granted by the fallback logics, which is controller by two pre-processor knobs: CONFIG_DEBUG_LL_EARLYCON and EARLYCON_STATIC_SETUP. The fallback logics is used when no suitable Earlycon driver is found or none is searched. In case neither CONFIG_DEBUG_LL_EARLYCON nor EARLYCON_STATIC_SETUP are defined, the fallback ops actually invoke the legacy putc/flush otherwise they don't do anything. CONFIG_DEBUG_LL_EARLYCON is a configuration option that says "whatever legacy putc/flush stuff is coming from uncompress.h, don't use it, use only the available Earlycom drivers". It's a global setting, it should help to simulate a world without uncompress.h. Actually it really removes the dependency on uncompress.h at the cost of breaking stuff depending on arch_decomp_setup(). EARLYCON_STATIC_SETUP instead is local, it's defined in the uncompress.h header itself. It is used by the driver writer to quickly go back and forth the "world without uncompress.h" and find his/her way out of the blank console. It also helps to identify the uncompress.h headers substantially ready to be removed. I'm surely missing something but I hope you'll spot it reading/testing the code, which is based on mainline commit f2fde3a. Thank you for reading so far. cheers, Domenico ^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH 1/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Inject the Earlycon drivers into the decompressor 2012-05-30 23:15 [RFC PATCH 0/6] ARM: Disintegrating mach/uncompress.h: low-level debug Domenico Andreoli @ 2012-05-30 23:15 ` Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 2/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Add Earlycon support to " Domenico Andreoli ` (4 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: Domenico Andreoli @ 2012-05-30 23:15 UTC (permalink / raw) To: linux-arm-kernel An embedded and charset-unspecified text was scrubbed... Name: earlycon-linker-magic.patch URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120531/b4ee79fe/attachment.ksh> ^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH 2/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Add Earlycon support to the decompressor 2012-05-30 23:15 [RFC PATCH 0/6] ARM: Disintegrating mach/uncompress.h: low-level debug Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 1/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Inject the Earlycon drivers into the decompressor Domenico Andreoli @ 2012-05-30 23:15 ` Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 3/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for AMBA PL010 UARTs Domenico Andreoli ` (3 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: Domenico Andreoli @ 2012-05-30 23:15 UTC (permalink / raw) To: linux-arm-kernel An embedded and charset-unspecified text was scrubbed... Name: earlycon-decompressor.patch URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120531/961f3c18/attachment.ksh> ^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH 3/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for AMBA PL010 UARTs 2012-05-30 23:15 [RFC PATCH 0/6] ARM: Disintegrating mach/uncompress.h: low-level debug Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 1/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Inject the Earlycon drivers into the decompressor Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 2/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Add Earlycon support to " Domenico Andreoli @ 2012-05-30 23:15 ` Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 4/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for AMBA PL011 UARTs Domenico Andreoli ` (2 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: Domenico Andreoli @ 2012-05-30 23:15 UTC (permalink / raw) To: linux-arm-kernel An embedded and charset-unspecified text was scrubbed... Name: earlycon-uart-amba-pl010.patch URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120531/f28fa18b/attachment.ksh> ^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH 4/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for AMBA PL011 UARTs 2012-05-30 23:15 [RFC PATCH 0/6] ARM: Disintegrating mach/uncompress.h: low-level debug Domenico Andreoli ` (2 preceding siblings ...) 2012-05-30 23:15 ` [RFC PATCH 3/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for AMBA PL010 UARTs Domenico Andreoli @ 2012-05-30 23:15 ` Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 5/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for Samsung UARTs Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 6/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for OMAP UARTs Domenico Andreoli 5 siblings, 0 replies; 7+ messages in thread From: Domenico Andreoli @ 2012-05-30 23:15 UTC (permalink / raw) To: linux-arm-kernel An embedded and charset-unspecified text was scrubbed... Name: earlycon-uart-amba-pl011.patch URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120531/1b354168/attachment.ksh> ^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH 5/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for Samsung UARTs 2012-05-30 23:15 [RFC PATCH 0/6] ARM: Disintegrating mach/uncompress.h: low-level debug Domenico Andreoli ` (3 preceding siblings ...) 2012-05-30 23:15 ` [RFC PATCH 4/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for AMBA PL011 UARTs Domenico Andreoli @ 2012-05-30 23:15 ` Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 6/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for OMAP UARTs Domenico Andreoli 5 siblings, 0 replies; 7+ messages in thread From: Domenico Andreoli @ 2012-05-30 23:15 UTC (permalink / raw) To: linux-arm-kernel An embedded and charset-unspecified text was scrubbed... Name: earlycon-uart-samsung.patch URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120531/d778806f/attachment.ksh> ^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH 6/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for OMAP UARTs 2012-05-30 23:15 [RFC PATCH 0/6] ARM: Disintegrating mach/uncompress.h: low-level debug Domenico Andreoli ` (4 preceding siblings ...) 2012-05-30 23:15 ` [RFC PATCH 5/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for Samsung UARTs Domenico Andreoli @ 2012-05-30 23:15 ` Domenico Andreoli 5 siblings, 0 replies; 7+ messages in thread From: Domenico Andreoli @ 2012-05-30 23:15 UTC (permalink / raw) To: linux-arm-kernel An embedded and charset-unspecified text was scrubbed... Name: earlycon-uart-omap.patch URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120531/a5140cbc/attachment.ksh> ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-05-30 23:15 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-05-30 23:15 [RFC PATCH 0/6] ARM: Disintegrating mach/uncompress.h: low-level debug Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 1/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Inject the Earlycon drivers into the decompressor Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 2/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Add Earlycon support to " Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 3/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for AMBA PL010 UARTs Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 4/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for AMBA PL011 UARTs Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 5/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for Samsung UARTs Domenico Andreoli 2012-05-30 23:15 ` [RFC PATCH 6/6] From: Domenico Andreoli <cavokz@gmail.com> ARM: Earlycon support for OMAP UARTs Domenico Andreoli
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).