From e0f7513837fb5eb98693cbd239691c494ce2ee01 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=99=88=E4=BA=AE?= Date: Thu, 17 Jul 2014 02:08:29 -0700 Subject: [PATCH] rk312x: modify ROCKCHIP_CPU_RK3126 to ROCKCHIP_CPU_RK312X, add rk3126 rk3128 DT_MACHINE MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈亮 --- arch/arm/boot/dts/rk3126-fpga.dts | 2 +- arch/arm/mach-rockchip/rk312x.c | 38 +++++++++++++++++++++++++++---- include/linux/rockchip/cpu.h | 8 +++---- 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/arch/arm/boot/dts/rk3126-fpga.dts b/arch/arm/boot/dts/rk3126-fpga.dts index e832e0a76263..59718dafc834 100644 --- a/arch/arm/boot/dts/rk3126-fpga.dts +++ b/arch/arm/boot/dts/rk3126-fpga.dts @@ -2,7 +2,7 @@ #include "rk312x.dtsi" / { - compatible = "rockchip,rk312x"; + compatible = "rockchip,rk3126"; memory { device_type = "memory"; diff --git a/arch/arm/mach-rockchip/rk312x.c b/arch/arm/mach-rockchip/rk312x.c index b7f244843930..34d3fc6c8a4b 100755 --- a/arch/arm/mach-rockchip/rk312x.c +++ b/arch/arm/mach-rockchip/rk312x.c @@ -48,8 +48,13 @@ .type = MT_DEVICE, \ } -static const char * const rk312x_dt_compat[] __initconst = { - "rockchip,rk312x", +static const char * const rk3126_dt_compat[] __initconst = { + "rockchip,rk3126", + NULL, +}; + +static const char * const rk3128_dt_compat[] __initconst = { + "rockchip,rk3128", NULL, }; @@ -77,6 +82,20 @@ static void __init rk312x_dt_map_io(void) dsb(); } +static void __init rk3126_dt_map_io(void) +{ + rockchip_soc_id = ROCKCHIP_SOC_RK3126; + + rk312x_dt_map_io(); +} + +static void __init rk3128_dt_map_io(void) +{ + rockchip_soc_id = ROCKCHIP_SOC_RK3128; + + rk312x_dt_map_io(); +} + static void __init rk312x_dt_init_timer(void) { clocksource_of_init(); @@ -94,13 +113,22 @@ static void rk312x_restart(char mode, const char *cmd) { } -DT_MACHINE_START(RK312X_DT, "Rockchip RK312X") +DT_MACHINE_START(RK3126_DT, "Rockchip RK3126") .smp = smp_ops(rockchip_smp_ops), - .map_io = rk312x_dt_map_io, + .map_io = rk3126_dt_map_io, .init_time = rk312x_dt_init_timer, - .dt_compat = rk312x_dt_compat, + .dt_compat = rk3126_dt_compat, .init_late = rk312x_init_late, .reserve = rk312x_reserve, .restart = rk312x_restart, MACHINE_END +DT_MACHINE_START(RK3128_DT, "Rockchip RK3128") + .smp = smp_ops(rockchip_smp_ops), + .map_io = rk3128_dt_map_io, + .init_time = rk312x_dt_init_timer, + .dt_compat = rk3128_dt_compat, + .init_late = rk312x_init_late, + .reserve = rk312x_reserve, + .restart = rk312x_restart, +MACHINE_END diff --git a/include/linux/rockchip/cpu.h b/include/linux/rockchip/cpu.h index 069dacb1c5f2..e5a541236f70 100644 --- a/include/linux/rockchip/cpu.h +++ b/include/linux/rockchip/cpu.h @@ -8,7 +8,7 @@ static inline bool cpu_is_rockchip(void) { return rockchip_soc_id; } #define ROCKCHIP_CPU_MASK 0xffff0000 #define ROCKCHIP_CPU_RK2928 0x29280000 #define ROCKCHIP_CPU_RK3026 0x30260000 -#define ROCKCHIP_CPU_RK3126 0x31260000 +#define ROCKCHIP_CPU_RK312X 0x31260000 #define ROCKCHIP_CPU_RK3036 0x30360000 #define ROCKCHIP_CPU_RK30XX 0x30660000 #define ROCKCHIP_CPU_RK3066B 0x31680000 @@ -18,7 +18,7 @@ static inline bool cpu_is_rockchip(void) { return rockchip_soc_id; } static inline bool cpu_is_rk2928(void) { return (rockchip_soc_id & ROCKCHIP_CPU_MASK) == ROCKCHIP_CPU_RK2928; } static inline bool cpu_is_rk3026(void) { return (rockchip_soc_id & ROCKCHIP_CPU_MASK) == ROCKCHIP_CPU_RK3026; } -static inline bool cpu_is_rk3126(void) { return (rockchip_soc_id & ROCKCHIP_CPU_MASK) == ROCKCHIP_CPU_RK3126; } +static inline bool cpu_is_rk312x(void) { return (rockchip_soc_id & ROCKCHIP_CPU_MASK) == ROCKCHIP_CPU_RK312X; } static inline bool cpu_is_rk3036(void) { return (rockchip_soc_id & ROCKCHIP_CPU_MASK) == ROCKCHIP_CPU_RK3036; } static inline bool cpu_is_rk30xx(void) { return (rockchip_soc_id & ROCKCHIP_CPU_MASK) == ROCKCHIP_CPU_RK30XX; } static inline bool cpu_is_rk3066b(void) { return (rockchip_soc_id & ROCKCHIP_CPU_MASK) == ROCKCHIP_CPU_RK3066B; } @@ -31,8 +31,8 @@ static inline bool cpu_is_rk3288(void) { return (rockchip_soc_id & ROCKCHIP_CPU #define ROCKCHIP_SOC_RK2928L (ROCKCHIP_CPU_RK2928 | 0x02) #define ROCKCHIP_SOC_RK3028A (ROCKCHIP_CPU_RK3026 | 0x03) #define ROCKCHIP_SOC_RK3026 (ROCKCHIP_CPU_RK3026 | 0x04) -#define ROCKCHIP_SOC_RK3126 (ROCKCHIP_CPU_RK3126 | 0x00) -#define ROCKCHIP_SOC_RK3128 (ROCKCHIP_CPU_RK3126 | 0x01) +#define ROCKCHIP_SOC_RK3126 (ROCKCHIP_CPU_RK312X | 0x00) +#define ROCKCHIP_SOC_RK3128 (ROCKCHIP_CPU_RK312X | 0x01) #define ROCKCHIP_SOC_RK3036 (ROCKCHIP_CPU_RK3036 | 0x00) #define ROCKCHIP_SOC_RK3000 (ROCKCHIP_CPU_RK30XX | 0x00) #define ROCKCHIP_SOC_RK3066 (ROCKCHIP_CPU_RK30XX | 0x01) -- 2.34.1