From 00077a7819043b1598f1f65bf1e66516d91400db Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Mon, 2 Jul 2012 19:48:45 +0800 Subject: [PATCH] rk: move clkdev.h debug-macro.S entry-macro.S timex.h uncompress.h from mach-rk30 to plat-rk --- arch/arm/mach-rk30/include/mach/clkdev.h | 14 +------- arch/arm/mach-rk30/include/mach/debug-macro.S | 36 +------------------ arch/arm/mach-rk30/include/mach/entry-macro.S | 16 ++------- arch/arm/mach-rk30/include/mach/timex.h | 7 +--- arch/arm/mach-rk30/include/mach/uncompress.h | 35 +----------------- arch/arm/plat-rk/include/plat/clkdev.h | 13 +++++++ arch/arm/plat-rk/include/plat/debug-macro.S | 34 ++++++++++++++++++ arch/arm/plat-rk/include/plat/entry-macro.S | 14 ++++++++ arch/arm/plat-rk/include/plat/timex.h | 6 ++++ arch/arm/plat-rk/include/plat/uncompress.h | 34 ++++++++++++++++++ 10 files changed, 107 insertions(+), 102 deletions(-) create mode 100644 arch/arm/plat-rk/include/plat/clkdev.h create mode 100644 arch/arm/plat-rk/include/plat/debug-macro.S create mode 100644 arch/arm/plat-rk/include/plat/entry-macro.S create mode 100644 arch/arm/plat-rk/include/plat/timex.h create mode 100644 arch/arm/plat-rk/include/plat/uncompress.h diff --git a/arch/arm/mach-rk30/include/mach/clkdev.h b/arch/arm/mach-rk30/include/mach/clkdev.h index 730c49d1ebd8..c0cf3286a662 100644 --- a/arch/arm/mach-rk30/include/mach/clkdev.h +++ b/arch/arm/mach-rk30/include/mach/clkdev.h @@ -1,13 +1 @@ -#ifndef __MACH_CLKDEV_H -#define __MACH_CLKDEV_H - -static inline int __clk_get(struct clk *clk) -{ - return 1; -} - -static inline void __clk_put(struct clk *clk) -{ -} - -#endif +#include diff --git a/arch/arm/mach-rk30/include/mach/debug-macro.S b/arch/arm/mach-rk30/include/mach/debug-macro.S index 2a57cc79fa7e..00d5467951fe 100644 --- a/arch/arm/mach-rk30/include/mach/debug-macro.S +++ b/arch/arm/mach-rk30/include/mach/debug-macro.S @@ -1,35 +1 @@ -/* arch/arm/mach-rk30/include/mach/debug-macro.S - * - * Copyright (C) 2012 ROCKCHIP, Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include - -#ifdef DEBUG_UART_PHYS - .macro addruart, rp, rv - ldr \rp, = DEBUG_UART_PHYS - ldr \rv, = DEBUG_UART_BASE - .endm - -#define UART_SHIFT 2 -#include -#else - .macro addruart, rp, rv - .endm - .macro senduart, rd, rx - .endm - .macro busyuart, rd, rx - .endm - .macro waituart, rd, rx - .endm -#endif +#include diff --git a/arch/arm/mach-rk30/include/mach/entry-macro.S b/arch/arm/mach-rk30/include/mach/entry-macro.S index 87b1727f00df..2cebce7a5717 100644 --- a/arch/arm/mach-rk30/include/mach/entry-macro.S +++ b/arch/arm/mach-rk30/include/mach/entry-macro.S @@ -1,14 +1,2 @@ -#include - -#define HAVE_GET_IRQNR_PREAMBLE -#include - - .macro disable_fiq - .endm - - .macro get_irqnr_preamble, base, tmp - ldr \base, =RK30_GICC_BASE - .endm - - .macro arch_ret_to_user, tmp1, tmp2 - .endm +#define GICC_BASE RK30_GICC_BASE +#include diff --git a/arch/arm/mach-rk30/include/mach/timex.h b/arch/arm/mach-rk30/include/mach/timex.h index baf144aae023..d2a02f98c397 100644 --- a/arch/arm/mach-rk30/include/mach/timex.h +++ b/arch/arm/mach-rk30/include/mach/timex.h @@ -1,6 +1 @@ -#ifndef __MACH_TIMEX_H -#define __MACH_TIMEX_H - -#define CLOCK_TICK_RATE (HZ * 100000UL) - -#endif /* __ASM_ARCH_TIMEX_H */ +#include diff --git a/arch/arm/mach-rk30/include/mach/uncompress.h b/arch/arm/mach-rk30/include/mach/uncompress.h index f165f074ee01..a4acb7198e1c 100644 --- a/arch/arm/mach-rk30/include/mach/uncompress.h +++ b/arch/arm/mach-rk30/include/mach/uncompress.h @@ -1,34 +1 @@ -#ifndef __MACH_UNCOMPRESS_H -#define __MACH_UNCOMPRESS_H - -#include -#include - -#ifdef DEBUG_UART_PHYS -static volatile u32 *UART = (u32 *)DEBUG_UART_PHYS; - -static void putc(int c) -{ - while (!(UART[UART_LSR] & UART_LSR_THRE)) - barrier(); - UART[UART_TX] = c; -} -#else -static inline void putc(int c) -{ -} -#endif - -static inline void flush(void) -{ -} - -static inline void arch_decomp_setup(void) -{ -} - -static inline void arch_decomp_wdog(void) -{ -} - -#endif +#include diff --git a/arch/arm/plat-rk/include/plat/clkdev.h b/arch/arm/plat-rk/include/plat/clkdev.h new file mode 100644 index 000000000000..2c2f0664ce3a --- /dev/null +++ b/arch/arm/plat-rk/include/plat/clkdev.h @@ -0,0 +1,13 @@ +#ifndef __PLAT_CLKDEV_H +#define __PLAT_CLKDEV_H + +static inline int __clk_get(struct clk *clk) +{ + return 1; +} + +static inline void __clk_put(struct clk *clk) +{ +} + +#endif diff --git a/arch/arm/plat-rk/include/plat/debug-macro.S b/arch/arm/plat-rk/include/plat/debug-macro.S new file mode 100644 index 000000000000..bb48d931a657 --- /dev/null +++ b/arch/arm/plat-rk/include/plat/debug-macro.S @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 ROCKCHIP, Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include + +#ifdef DEBUG_UART_PHYS + .macro addruart, rp, rv + ldr \rp, = DEBUG_UART_PHYS + ldr \rv, = DEBUG_UART_BASE + .endm + +#define UART_SHIFT 2 +#include +#else + .macro addruart, rp, rv + .endm + .macro senduart, rd, rx + .endm + .macro busyuart, rd, rx + .endm + .macro waituart, rd, rx + .endm +#endif diff --git a/arch/arm/plat-rk/include/plat/entry-macro.S b/arch/arm/plat-rk/include/plat/entry-macro.S new file mode 100644 index 000000000000..1a0ede5c8408 --- /dev/null +++ b/arch/arm/plat-rk/include/plat/entry-macro.S @@ -0,0 +1,14 @@ +#include + +#define HAVE_GET_IRQNR_PREAMBLE +#include + + .macro disable_fiq + .endm + + .macro get_irqnr_preamble, base, tmp + ldr \base, =GICC_BASE + .endm + + .macro arch_ret_to_user, tmp1, tmp2 + .endm diff --git a/arch/arm/plat-rk/include/plat/timex.h b/arch/arm/plat-rk/include/plat/timex.h new file mode 100644 index 000000000000..42db342760c1 --- /dev/null +++ b/arch/arm/plat-rk/include/plat/timex.h @@ -0,0 +1,6 @@ +#ifndef __PLAT_TIMEX_H +#define __PLAT_TIMEX_H + +#define CLOCK_TICK_RATE (HZ * 100000UL) + +#endif diff --git a/arch/arm/plat-rk/include/plat/uncompress.h b/arch/arm/plat-rk/include/plat/uncompress.h new file mode 100644 index 000000000000..9704769e6a42 --- /dev/null +++ b/arch/arm/plat-rk/include/plat/uncompress.h @@ -0,0 +1,34 @@ +#ifndef __PLAT_UNCOMPRESS_H +#define __PLAT_UNCOMPRESS_H + +#include +#include + +#ifdef DEBUG_UART_PHYS +static volatile u32 *UART = (u32 *)DEBUG_UART_PHYS; + +static void putc(int c) +{ + while (!(UART[UART_LSR] & UART_LSR_THRE)) + barrier(); + UART[UART_TX] = c; +} +#else +static inline void putc(int c) +{ +} +#endif + +static inline void flush(void) +{ +} + +static inline void arch_decomp_setup(void) +{ +} + +static inline void arch_decomp_wdog(void) +{ +} + +#endif -- 2.34.1