rk2928: add mach/cpu.h: soc_is_rk2926, soc_is_rk2928g, soc_is_rk2928l

This commit is contained in:
kfx
2012-09-27 14:27:54 +08:00
parent ec125b2e97
commit 89e8fbc260
2 changed files with 30 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
#include <mach/fiq.h>
#include <mach/loader.h>
#include <mach/ddr.h>
#include <mach/cpu.h>
static void __init rk2928_cpu_axi_init(void)
{
@@ -109,6 +110,7 @@ void __init rk2928_init_irq(void)
rk_fiq_init();
#endif
rk30_gpio_init();
soc_gpio_init();
}
extern void __init rk2928_map_common_io(void);

View File

@@ -0,0 +1,28 @@
#ifndef __MACH_CPU_H
#define __MACH_CPU_H
#include <mach/io.h>
#include <linux/io.h>
#define SOC_RK2928G 0x01
#define SOC_RK2928L 0x02
#define SOC_RK2926 0x00
static inline void soc_gpio_init(void)
{
writel_relaxed(readl_relaxed(RK2928_GPIO3_BASE + 0x04) & (~0x07), RK2928_GPIO3_BASE + 0x04);
}
static inline int soc_is_rk2928g(void)
{
return ((readl_relaxed(RK2928_GPIO3_BASE + 0x50) & 0x07) == SOC_RK2928G);
}
static inline int soc_is_rk2928l(void)
{
return ((readl_relaxed(RK2928_GPIO3_BASE + 0x50) & 0x07) == SOC_RK2928L);
}
static inline int soc_is_rk2926(void)
{
return ((readl_relaxed(RK2928_GPIO3_BASE + 0x50) & 0x07) == SOC_RK2926);
}
#endif