From 20c152bbc7ce67df062ca803063e8fcc204f1e32 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Tue, 27 May 2014 18:33:26 +0800 Subject: [PATCH] ARM: rockchip: fix for function tracer --- arch/arm/mach-rockchip/pm-rk3188.c | 9 ++++++--- arch/arm/mach-rockchip/pm-rk3288.c | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-rockchip/pm-rk3188.c b/arch/arm/mach-rockchip/pm-rk3188.c index 68cb66d51ee6..cf41244442f6 100755 --- a/arch/arm/mach-rockchip/pm-rk3188.c +++ b/arch/arm/mach-rockchip/pm-rk3188.c @@ -167,6 +167,7 @@ static void inline uart_printch(char byte) rkpm_udelay(1); +write_uart: writel_relaxed(byte, RK_DEBUG_UART_VIRT); dsb(); @@ -174,11 +175,13 @@ static void inline uart_printch(char byte) while (!(readl_relaxed(RK_DEBUG_UART_VIRT + 0x14) & 0x40)) barrier(); + if (byte == '\n') { + byte = '\r'; + goto write_uart; + } + cru_writel(reg_save[0]|0x1<<((u_pclk_id%16)+16),RK3188_CRU_GATEID_CONS(u_clk_id)); cru_writel(reg_save[1]|0x1<<((u_pclk_id%16)+16),RK3188_CRU_GATEID_CONS(u_pclk_id)); - - if (byte == '\n') - uart_printch('\r'); } void PIE_FUNC(sram_printch)(char byte) diff --git a/arch/arm/mach-rockchip/pm-rk3288.c b/arch/arm/mach-rockchip/pm-rk3288.c index f1db7b488277..2aa551f38538 100755 --- a/arch/arm/mach-rockchip/pm-rk3288.c +++ b/arch/arm/mach-rockchip/pm-rk3288.c @@ -1223,6 +1223,7 @@ static void inline uart_printch(char byte) rkpm_udelay(1); +write_uart: writel_relaxed(byte, RK_DEBUG_UART_VIRT); dsb(); @@ -1230,11 +1231,13 @@ static void inline uart_printch(char byte) while (!(readl_relaxed(RK_DEBUG_UART_VIRT + 0x14) & 0x40)) barrier(); + if (byte == '\n') { + byte = '\r'; + goto write_uart; + } + cru_writel(reg_save[0]|CRU_W_MSK(u_clk_id%16,0x1),RK3288_CRU_GATEID_CONS(u_clk_id)); cru_writel(reg_save[1]|CRU_W_MSK(u_pclk_id%16,0x1),RK3288_CRU_GATEID_CONS(u_pclk_id)); - - if (byte == '\n') - uart_printch('\r'); } void PIE_FUNC(sram_printch)(char byte) -- 2.34.1