From b96e2b20b226f0e346f6e1b3e5263fb7ab2da3e0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Tue, 22 Mar 2011 12:05:50 +0800 Subject: [PATCH] rk29: add ddr.h --- arch/arm/mach-rk29/include/mach/ddr.h | 27 ++++++++++++++++++++++++++ arch/arm/mach-rk29/include/mach/sram.h | 3 +++ arch/arm/mach-rk29/pm.c | 6 +----- 3 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 arch/arm/mach-rk29/include/mach/ddr.h diff --git a/arch/arm/mach-rk29/include/mach/ddr.h b/arch/arm/mach-rk29/include/mach/ddr.h new file mode 100644 index 000000000000..0616bdef530c --- /dev/null +++ b/arch/arm/mach-rk29/include/mach/ddr.h @@ -0,0 +1,27 @@ +/* arch/arm/mach-rk29/include/mach/ddr.h + * + * Copyright (C) 2011 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. + * + */ + +#ifndef __ARCH_ARM_MACH_RK29_DDR_H +#define __ARCH_ARM_MACH_RK29_DDR_H + +#include +#include + +void __sramfunc ddr_suspend(void); +void __sramfunc ddr_resume(void); +void __sramlocalfunc delayus(uint32_t us); +void __sramfunc ddr_change_freq(uint32_t nMHz); + +#endif diff --git a/arch/arm/mach-rk29/include/mach/sram.h b/arch/arm/mach-rk29/include/mach/sram.h index a7f91498420c..27d403c62e43 100644 --- a/arch/arm/mach-rk29/include/mach/sram.h +++ b/arch/arm/mach-rk29/include/mach/sram.h @@ -7,6 +7,8 @@ * Author: Rickard Andersson */ +#ifndef __ARCH_ARM_MACH_RK29_SRAM_H +#define __ARCH_ARM_MACH_RK29_SRAM_H #ifdef CONFIG_ARCH_RK29 /* Tag variables with this */ @@ -34,4 +36,5 @@ static inline unsigned long ddr_save_sp(unsigned long new_sp) #define DDR_RESTORE_SP(save_sp) do { ddr_save_sp(save_sp); } while (0) #endif +#endif diff --git a/arch/arm/mach-rk29/pm.c b/arch/arm/mach-rk29/pm.c index db339c485cdf..84c5b9866fb4 100755 --- a/arch/arm/mach-rk29/pm.c +++ b/arch/arm/mach-rk29/pm.c @@ -24,6 +24,7 @@ #include #include #include +#include #define cru_readl(offset) readl(RK29_CRU_BASE + offset) #define cru_writel(v, offset) do { writel(v, RK29_CRU_BASE + offset); readl(RK29_CRU_BASE + offset); } while (0) @@ -44,11 +45,6 @@ static inline void delay_300us(void) LOOP(300 * LOOPS_PER_USEC); } -extern void ddr_suspend(void); -extern void ddr_resume(void); -extern void delayus(uint32_t us); -extern void ddr_change_freq(uint32_t nMHz); - #ifdef DEBUG static void/* inline*/ __sramfunc printch(char byte) { -- 2.34.1