Skip to content

Commit

Permalink
ARM: SAMSUNG: Consolidate uncompress subroutine
Browse files Browse the repository at this point in the history
For mach-exynos, uart_base is a pointer and the value is calculated
in the machine folder. For other machines, uart_base is defined as
a macro in platform directory. For symmetry, the uart_base macro
definition is removed and the uart_base calculation is moved to
specific machine folders.

This would help us consolidating uncompress subroutine for s5p64x0.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
  • Loading branch information
Tushar Behera authored and Kukjin Kim committed Jun 18, 2013
1 parent 317ddd2 commit 76c1b83
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
3 changes: 0 additions & 3 deletions arch/arm/mach-exynos/include/mach/uncompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#include <asm/mach-types.h>

#include <mach/map.h>

volatile u8 *uart_base;

#include <plat/uncompress.h>

static unsigned int __raw_readl(unsigned int ptr)
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-s3c24xx/include/mach/uncompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ static void arch_detect_cpu(void)
fifo_mask = S3C2410_UFSTAT_TXMASK;
fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT;
}

uart_base = (volatile u8 *) S3C_PA_UART +
(S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
}

#endif /* __ASM_ARCH_UNCOMPRESS_H */
3 changes: 3 additions & 0 deletions arch/arm/mach-s3c64xx/include/mach/uncompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ static void arch_detect_cpu(void)
/* we do not need to do any cpu detection here at the moment. */
fifo_mask = S3C2440_UFSTAT_TXMASK;
fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;

uart_base = (volatile u8 *)S3C_PA_UART +
(S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
}

#endif /* __ASM_ARCH_UNCOMPRESS_H */
2 changes: 2 additions & 0 deletions arch/arm/mach-s5pc100/include/mach/uncompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ static void arch_detect_cpu(void)
/* we do not need to do any cpu detection here at the moment. */
fifo_mask = S3C2440_UFSTAT_TXMASK;
fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;

uart_base = (volatile u8 *)S5P_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT);
}

#endif /* __ASM_ARCH_UNCOMPRESS_H */
2 changes: 2 additions & 0 deletions arch/arm/mach-s5pv210/include/mach/uncompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ static void arch_detect_cpu(void)
/* we do not need to do any cpu detection here at the moment. */
fifo_mask = S5PV210_UFSTAT_TXMASK;
fifo_max = 63 << S5PV210_UFSTAT_TXSHIFT;

uart_base = (volatile u8 *)S5P_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT);
}

#endif /* __ASM_ARCH_UNCOMPRESS_H */
6 changes: 2 additions & 4 deletions arch/arm/plat-samsung/include/plat/uncompress.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
unsigned int fifo_mask;
unsigned int fifo_max;

volatile u8 *uart_base;

/* forward declerations */

static void arch_detect_cpu(void);
Expand All @@ -37,10 +39,6 @@ static void arch_detect_cpu(void);
/* how many bytes we allow into the FIFO at a time in FIFO mode */
#define FIFO_MAX (14)

#ifdef S3C_PA_UART
#define uart_base S3C_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT)
#endif

static __inline__ void
uart_wr(unsigned int reg, unsigned int val)
{
Expand Down

0 comments on commit 76c1b83

Please sign in to comment.