Skip to content

Commit

Permalink
ARM: SAMSUNG: Use debug_ll_addr() to get UART base address
Browse files Browse the repository at this point in the history
This patch modifies Samsung PM debug helpers to use a multiplatform
friendly way of getting base address of debug UART port, so instead
of using a per-mach static macro, a generic debug_ll_addr() helper
is used.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
  • Loading branch information
Tomasz Figa authored and kgene committed Mar 20, 2014
1 parent de7fe08 commit 99b2fc2
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions arch/arm/plat-samsung/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/io.h>

#include <asm/cacheflush.h>
#include <asm/mach/map.h>
#include <asm/suspend.h>

#include <plat/cpu.h>
Expand Down Expand Up @@ -74,9 +75,19 @@ static inline void s3c_pm_debug_init(void)

static struct pm_uart_save uart_save;

static inline void __iomem *s3c_pm_uart_base(void)
{
unsigned long paddr;
unsigned long vaddr;

debug_ll_addr(&paddr, &vaddr);

return (void __iomem *)vaddr;
}

static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save)
{
void __iomem *regs = S3C_VA_UARTx(uart);
void __iomem *regs = s3c_pm_uart_base();

save->ulcon = __raw_readl(regs + S3C2410_ULCON);
save->ucon = __raw_readl(regs + S3C2410_UCON);
Expand All @@ -98,7 +109,7 @@ static void s3c_pm_save_uarts(void)

static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save)
{
void __iomem *regs = S3C_VA_UARTx(uart);
void __iomem *regs = s3c_pm_uart_base();

s3c_pm_arch_update_uart(regs, save);

Expand Down

0 comments on commit 99b2fc2

Please sign in to comment.