From 03e76f6fc4456bbe540e28380a00ca991963a4ca Mon Sep 17 00:00:00 2001 From: chenxing Date: Sat, 27 Apr 2013 17:18:27 +0800 Subject: [PATCH] add rk3188 avs print support You need to add operation in your vdd_core init as follows: // set vdd_log = 1.1V; avs_init_val_get(1, 1100000, "PMIC init"); --- arch/arm/mach-rk30/board-rk3168-tb.c | 2 +- arch/arm/mach-rk3188/clock_data.c | 2 +- arch/arm/mach-rk3188/dvfs.c | 12 ++++-------- arch/arm/plat-rk/dvfs.c | 5 ++++- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-rk30/board-rk3168-tb.c b/arch/arm/mach-rk30/board-rk3168-tb.c index ede01b60625b..dac7fbd3ca9b 100644 --- a/arch/arm/mach-rk30/board-rk3168-tb.c +++ b/arch/arm/mach-rk30/board-rk3168-tb.c @@ -2395,7 +2395,7 @@ static void rk30_pm_power_off(void) static void __init machine_rk30_board_init(void) { - //avs_init(); + avs_init(); gpio_request(POWER_ON_PIN, "poweronpin"); gpio_direction_output(POWER_ON_PIN, GPIO_HIGH); diff --git a/arch/arm/mach-rk3188/clock_data.c b/arch/arm/mach-rk3188/clock_data.c index 78e75a0b33b2..7e3ef5ed9550 100755 --- a/arch/arm/mach-rk3188/clock_data.c +++ b/arch/arm/mach-rk3188/clock_data.c @@ -2992,7 +2992,7 @@ static void __init rk30_init_enable_clocks(void) clk_enable_nolock(&clk_hclk_peri_ahb_arbi); clk_enable_nolock(&clk_hclk_emem_peri); //clk_enable_nolock(&clk_hclk_mac); - //clk_enable_nolock(&clk_nandc); + clk_enable_nolock(&clk_nandc); clk_enable_nolock(&clk_hclk_usb_peri); #if 0 clk_enable_nolock(&clk_hclk_otg0); diff --git a/arch/arm/mach-rk3188/dvfs.c b/arch/arm/mach-rk3188/dvfs.c index a228645cf56d..d88b47a68410 100755 --- a/arch/arm/mach-rk3188/dvfs.c +++ b/arch/arm/mach-rk3188/dvfs.c @@ -701,7 +701,7 @@ static struct depend_lookup rk30_depends[] = { //RK_DEPPENDS("gpu", &vd_cpu, NULL), }; #endif -//static struct avs_ctr_st rk30_avs_ctr; +static struct avs_ctr_st rk30_avs_ctr; int rk3188_dvfs_init(void) { @@ -723,16 +723,13 @@ int rk3188_dvfs_init(void) #ifndef NO_VOLT_DIFF dvfs_clk_cpu = dvfs_get_dvfs_clk_byname("cpu"); #endif - //avs_board_init(&rk30_avs_ctr); + avs_board_init(&rk30_avs_ctr); return 0; } /******************************rk30 avs**************************************************/ - -#if 0 - static void __iomem *rk30_nandc_base=NULL; #define nandc_readl(offset) readl_relaxed(rk30_nandc_base + offset) @@ -757,8 +754,8 @@ static u8 rk30_get_avs_val(void) nandc_writel(nanc_save_reg[0] | 0x1 << 14, 0); nandc_writel(0x5, 0x130); - nandc_writel(3, 0x158); - nandc_writel(1, 0x134); + nandc_writel(0x3, 0x158); + nandc_writel(0x21, 0x134); while(count--) { paramet = nandc_readl(0x138); @@ -786,6 +783,5 @@ static struct avs_ctr_st rk30_avs_ctr= { .avs_init =rk30_avs_init, .avs_get_val = rk30_get_avs_val, }; -#endif diff --git a/arch/arm/plat-rk/dvfs.c b/arch/arm/plat-rk/dvfs.c index 3551288cf9c8..ab554b3b0c2c 100644 --- a/arch/arm/plat-rk/dvfs.c +++ b/arch/arm/plat-rk/dvfs.c @@ -1237,7 +1237,7 @@ void avs_init(void) memset(&init_avs_paramet[0].is_set, 0, sizeof(init_avs_paramet)); if(avs_ctr_data&&avs_ctr_data->avs_init) avs_ctr_data->avs_init(); - avs_init_val_get(0,1150000,"board_init"); + //avs_init_val_get(0,1150000,"board_init"); } static u8 rk_get_avs_val(void) { @@ -1258,10 +1258,13 @@ void avs_init_val_get(int index, int vol, char *s) init_avs_paramet[index].vol = vol; init_avs_paramet[index].s = s; init_avs_paramet[index].is_set++; + printk("DVFS MSG:\tAVS Value(index=%d): ", index); for(i = 0; i < init_avs_times; i++) { init_avs_paramet[index].paramet[i] = rk_get_avs_val(); mdelay(1); + printk("%d ", init_avs_paramet[index].paramet[i]); } + printk("\n"); } int avs_set_scal_val(u8 avs_base) { -- 2.34.1