Wednesday, June 13, 2018

A patch to enable EarlyPrintk in Linux Kernel

Below is the patch to enable earlyprintk in TI platforms.
Note that this is only for a present system that I am working
right now and may not apply/work straightaway in all platfrom.
Hence you may have to put effort to port this patch in your 
system.


diff --git a/arch/arm/configs/xyz-ed0-dbg_defconfig b/arch/arm/configs/xyz-ed0-dbg_defconfig
index 688316b..f2fed80 100644
--- a/arch/arm/configs/xyz-ed0-dbg_defconfig
+++ b/arch/arm/configs/xyz-ed0-dbg_defconfig
@@ -181,10 +181,17 @@ CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_STRICT_DEVMEM is not set
CONFIG_ARM_UNWIND=y
# CONFIG_DEBUG_USER is not set
-# CONFIG_DEBUG_LL is not set
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_LL_INCLUDE="debug/8250.S"
# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_DEBUG_LL_UART_8250=y
+CONFIG_DEBUG_UART_PHYS=0x48020000
+CONFIG_DEBUG_UART_VIRT=0xFA020000
+CONFIG_DEBUG_UART_8250_SHIFT=2
CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
+CONFIG_DEBUG_UNCOMPRESS=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_EARLY_PRINTK_DIRECT=y
# CONFIG_PID_IN_CONTEXTIDR is not set
# CONFIG_DEBUG_SET_MODULE_RONX is not set
# CONFIG_CORESIGHT is not set
diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index cc48abb..34331e9 100755
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -2950,7 +2950,8 @@ static struct omap_hwmod dra7xx_uart3_hwmod = {
    .class          = &dra7xx_uart_hwmod_class,
    .clkdm_name     = "l4per_clkdm",
    .main_clk  = "uart3_gfclk_mux",
-    .flags          = HWMOD_SWSUP_SIDLE_ACT | DEBUG_OMAP4UART3_FLAGS,
+    .flags          = HWMOD_SWSUP_SIDLE_ACT | DEBUG_OMAP4UART3_FLAGS |
+                    DEBUG_OMAPUART_FLAGS,
    .prcm = {
          .omap4 = {

               .clkctrl_offs = DRA7XX_CM_L4PER_UART3_CLKCTRL_OFFSET,

No comments:

Post a Comment