From: 黄涛 Date: Tue, 22 Apr 2014 07:17:10 +0000 (+0800) Subject: ARM: rockchip: rk3288: enable jtag support when rockchip_jtag in kernel cmdline X-Git-Tag: firefly_0821_release~5474 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a840a0c862373e755fba4769d3aaa8e212ed7eef;p=firefly-linux-kernel-4.4.55.git ARM: rockchip: rk3288: enable jtag support when rockchip_jtag in kernel cmdline --- diff --git a/arch/arm/boot/dts/rk3288-clocks.dtsi b/arch/arm/boot/dts/rk3288-clocks.dtsi index cfbd99291c4d..38fad817c1ca 100755 --- a/arch/arm/boot/dts/rk3288-clocks.dtsi +++ b/arch/arm/boot/dts/rk3288-clocks.dtsi @@ -2536,8 +2536,8 @@ <&clk_l2ram>, <&aclk_core_m0>, <&aclk_core_mp>, <&atclk_core>, - <&pclk_dbg_src>, <&clk_gates12 8>, - <&clk_gates12 8>, <&clk_gates12 8>, + <&pclk_dbg_src>, <&pclk_dbg_src>, + <&pclk_dbg_src>, <&pclk_dbg_src>, <&dummy>, <&dummy>, <&dummy>, <&dummy>; @@ -2549,8 +2549,8 @@ "clk_l2ram", "aclk_core_m0", "aclk_core_mp", "atclk_core", - "pclk_dbg_src", "reserved", /*"g_dbg_core_clk",*/ - "reserved", "reserved", /*"g_cs_dbg_clk", "g_pclk_core_niu",*/ + "pclk_dbg_src", "g_dbg_core_clk", + "g_cs_dbg_clk", "g_pclk_core_niu", "reserved", "reserved", "reserved", "reserved"; diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index 4a1e0d801e7d..545c5af90eaa 100755 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -500,6 +500,8 @@ <&clk_core3>, <&clk_l2ram>, <&aclk_core_m0>, <&aclk_core_mp>, <&atclk_core>, <&pclk_dbg_src>, + <&clk_gates12 9>, <&clk_gates12 10>, + <&clk_gates12 11>, /*PD_BUS*/ <&aclk_bus>, <&clk_gates0 3>, diff --git a/arch/arm/mach-rockchip/common.c b/arch/arm/mach-rockchip/common.c index 44abfc4fa7c6..e3dce56e33bf 100755 --- a/arch/arm/mach-rockchip/common.c +++ b/arch/arm/mach-rockchip/common.c @@ -272,3 +272,11 @@ void __init rockchip_ion_reserve(void) #endif } +bool rockchip_jtag_enabled = false; +static int __init rockchip_jtag_enable(char *__unused) +{ + rockchip_jtag_enabled = true; + printk("rockchip jtag enabled\n"); + return 1; +} +__setup("rockchip_jtag", rockchip_jtag_enable); diff --git a/arch/arm/mach-rockchip/rk3288.c b/arch/arm/mach-rockchip/rk3288.c index c35572632cbe..4299020808ec 100644 --- a/arch/arm/mach-rockchip/rk3288.c +++ b/arch/arm/mach-rockchip/rk3288.c @@ -454,7 +454,8 @@ static void __init rk3288_init_cpuidle(void) { int ret; - rk3288_cpuidle_driver.states[0].enter = rk3288_cpuidle_enter; + if (!rockchip_jtag_enabled) + rk3288_cpuidle_driver.states[0].enter = rk3288_cpuidle_enter; ret = cpuidle_register(&rk3288_cpuidle_driver, NULL); if (ret) pr_err("%s: failed to register cpuidle driver: %d\n", __func__, ret); @@ -470,6 +471,8 @@ static void __init rk3288_init_late(void) #ifdef CONFIG_CPU_IDLE rk3288_init_cpuidle(); #endif + if (rockchip_jtag_enabled) + clk_prepare_enable(clk_get_sys(NULL, "clk_jtag")); } DT_MACHINE_START(RK3288_DT, "Rockchip RK3288 (Flattened Device Tree)") diff --git a/include/linux/rockchip/common.h b/include/linux/rockchip/common.h index 9dbbe4ef8a2f..c61d19079c97 100644 --- a/include/linux/rockchip/common.h +++ b/include/linux/rockchip/common.h @@ -9,6 +9,7 @@ .type = MT_DEVICE, \ } +extern bool rockchip_jtag_enabled; extern unsigned long rockchip_boot_fn; extern struct smp_operations rockchip_smp_ops;