diff options
author | Julius Werner <jwerner@chromium.org> | 2015-02-19 20:19:23 -0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-04-21 08:22:40 +0200 |
commit | 941847652406982f3c9944fdd98cce4029b533fb (patch) | |
tree | af52ebeaa0245c9a3aa1e25c77f2271b67bff4a8 /src/soc/rockchip | |
parent | 2f37bd65518865688b9234afce0d467508d6f465 (diff) |
arm(64): Manually clean up the mess left by write32() transition
This patch is a manual cleanup of all the rubble left by coccinelle
waltzing through our code base. It's generally not very good with line
breaks and sometimes even eats comments, so this patch is my best
attempt at putting it all back together.
Also finally remove those hated writel()-style macros from the headers.
BRANCH=none
BUG=chromium:444723
TEST=None (depends on next patch)
Change-Id: Id572f69c420c35577701feb154faa5aaf79cd13e
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 817402a80ab77083728b55aed74b3b4202ba7f1d
Original-Change-Id: I3b0dcd6fe09fc4e3b83ee491625d6dced98e3047
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/254865
Reviewed-on: http://review.coreboot.org/9837
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc/rockchip')
-rw-r--r-- | src/soc/rockchip/rk3288/clock.c | 66 | ||||
-rw-r--r-- | src/soc/rockchip/rk3288/edp.c | 26 | ||||
-rw-r--r-- | src/soc/rockchip/rk3288/gpio.c | 3 | ||||
-rw-r--r-- | src/soc/rockchip/rk3288/pwm.c | 5 | ||||
-rw-r--r-- | src/soc/rockchip/rk3288/sdram.c | 31 | ||||
-rw-r--r-- | src/soc/rockchip/rk3288/uart.c | 4 | ||||
-rw-r--r-- | src/soc/rockchip/rk3288/vop.c | 28 |
7 files changed, 105 insertions, 58 deletions
diff --git a/src/soc/rockchip/rk3288/clock.c b/src/soc/rockchip/rk3288/clock.c index a9c888d631..89503e51db 100644 --- a/src/soc/rockchip/rk3288/clock.c +++ b/src/soc/rockchip/rk3288/clock.c @@ -220,7 +220,8 @@ static int rkclk_set_pll(u32 *pll_con, const struct pll_div *div) write32(&pll_con[3], RK_SETBITS(PLL_RESET_MSK)); write32(&pll_con[0], - RK_CLRSETBITS(PLL_NR_MSK, (div->nr - 1) << PLL_NR_SHIFT) | RK_CLRSETBITS(PLL_OD_MSK, (div->no - 1))); + RK_CLRSETBITS(PLL_NR_MSK, (div->nr - 1) << PLL_NR_SHIFT) | + RK_CLRSETBITS(PLL_OD_MSK, (div->no - 1))); write32(&pll_con[1], RK_CLRSETBITS(PLL_NF_MSK, (div->nf - 1))); @@ -259,7 +260,8 @@ void rkclk_init(void) /* pll enter slow-mode */ write32(&cru_ptr->cru_mode_con, - RK_CLRSETBITS(GPLL_MODE_MSK, GPLL_MODE_SLOW) | RK_CLRSETBITS(CPLL_MODE_MSK, CPLL_MODE_SLOW)); + RK_CLRSETBITS(GPLL_MODE_MSK, GPLL_MODE_SLOW) | + RK_CLRSETBITS(CPLL_MODE_MSK, CPLL_MODE_SLOW)); /* init pll */ rkclk_set_pll(&cru_ptr->cru_gpll_con[0], &gpll_init_cfg); @@ -288,8 +290,14 @@ void rkclk_init(void) assert((pclk_div + 1) * PD_BUS_PCLK_HZ == PD_BUS_ACLK_HZ && pclk_div < 0x7); - write32(&cru_ptr->cru_clksel_con[1], - RK_SETBITS(PD_BUS_SEL_GPLL) | RK_CLRSETBITS(PD_BUS_PCLK_DIV_MSK, pclk_div << PD_BUS_PCLK_DIV_SHIFT) | RK_CLRSETBITS(PD_BUS_HCLK_DIV_MSK, hclk_div << PD_BUS_HCLK_DIV_SHIFT) | RK_CLRSETBITS(PD_BUS_ACLK_DIV0_MASK, aclk_div << PD_BUS_ACLK_DIV0_SHIFT) | RK_CLRSETBITS(PD_BUS_ACLK_DIV1_MASK, 0 << 0)); + write32(&cru_ptr->cru_clksel_con[1], RK_SETBITS(PD_BUS_SEL_GPLL) | + RK_CLRSETBITS(PD_BUS_PCLK_DIV_MSK, + pclk_div << PD_BUS_PCLK_DIV_SHIFT) | + RK_CLRSETBITS(PD_BUS_HCLK_DIV_MSK, + hclk_div << PD_BUS_HCLK_DIV_SHIFT) | + RK_CLRSETBITS(PD_BUS_ACLK_DIV0_MASK, + aclk_div << PD_BUS_ACLK_DIV0_SHIFT) | + RK_CLRSETBITS(PD_BUS_ACLK_DIV1_MASK, 0 << 0)); /* * peri clock pll source selection and @@ -306,12 +314,18 @@ void rkclk_init(void) assert((1 << pclk_div) * PERI_PCLK_HZ == PERI_ACLK_HZ && (pclk_div < 0x4)); - write32(&cru_ptr->cru_clksel_con[10], - RK_SETBITS(PERI_SEL_GPLL) | RK_CLRSETBITS(PERI_PCLK_DIV_MSK, pclk_div << PERI_PCLK_DIV_SHIFT) | RK_CLRSETBITS(PERI_HCLK_DIV_MSK, hclk_div << PERI_HCLK_DIV_SHIFT) | RK_CLRSETBITS(PERI_ACLK_DIV_MSK, aclk_div << PERI_ACLK_DIV_SHIFT)); + write32(&cru_ptr->cru_clksel_con[10], RK_SETBITS(PERI_SEL_GPLL) | + RK_CLRSETBITS(PERI_PCLK_DIV_MSK, + pclk_div << PERI_PCLK_DIV_SHIFT) | + RK_CLRSETBITS(PERI_HCLK_DIV_MSK, + hclk_div << PERI_HCLK_DIV_SHIFT) | + RK_CLRSETBITS(PERI_ACLK_DIV_MSK, + aclk_div << PERI_ACLK_DIV_SHIFT)); /* PLL enter normal-mode */ write32(&cru_ptr->cru_mode_con, - RK_CLRSETBITS(GPLL_MODE_MSK, GPLL_MODE_NORM) | RK_CLRSETBITS(CPLL_MODE_MSK, CPLL_MODE_NORM)); + RK_CLRSETBITS(GPLL_MODE_MSK, GPLL_MODE_NORM) | + RK_CLRSETBITS(CPLL_MODE_MSK, CPLL_MODE_NORM)); } @@ -336,15 +350,19 @@ void rkclk_configure_cpu(void) * core clock select apll, apll clk = 1800MHz * arm clk = 1800MHz, mpclk = 450MHz, m0clk = 900MHz */ - write32(&cru_ptr->cru_clksel_con[0], - RK_CLRBITS(CORE_SEL_PLL_MSK) | RK_CLRSETBITS(A12_DIV_MSK, 0 << A12_DIV_SHIFT) | RK_CLRSETBITS(MP_DIV_MSK, 3 << MP_DIV_SHIFT) | RK_CLRSETBITS(M0_DIV_MSK, 1 << 0)); + write32(&cru_ptr->cru_clksel_con[0], RK_CLRBITS(CORE_SEL_PLL_MSK) | + RK_CLRSETBITS(A12_DIV_MSK, 0 << A12_DIV_SHIFT) | + RK_CLRSETBITS(MP_DIV_MSK, 3 << MP_DIV_SHIFT) | + RK_CLRSETBITS(M0_DIV_MSK, 1 << 0)); /* * set up dependent divisors for L2RAM/ATCLK and PCLK clocks. * l2ramclk = 900MHz, atclk = 450MHz, pclk_dbg = 450MHz */ write32(&cru_ptr->cru_clksel_con[37], - RK_CLRSETBITS(L2_DIV_MSK, 1 << 0) | RK_CLRSETBITS(ATCLK_DIV_MSK, (3 << ATCLK_DIV_SHIFT)) | RK_CLRSETBITS(PCLK_DBG_DIV_MSK, (3 << PCLK_DBG_DIV_SHIFT))); + RK_CLRSETBITS(L2_DIV_MSK, 1 << 0) | + RK_CLRSETBITS(ATCLK_DIV_MSK, (3 << ATCLK_DIV_SHIFT)) | + RK_CLRSETBITS(PCLK_DBG_DIV_MSK, (3 << PCLK_DBG_DIV_SHIFT))); /* PLL enter normal-mode */ write32(&cru_ptr->cru_mode_con, @@ -399,7 +417,12 @@ void rkclk_ddr_reset(u32 ch, u32 ctl, u32 phy) u32 phy_srstn_shift = 5 * ch; write32(&cru_ptr->cru_softrst_con[10], - RK_CLRSETBITS(1 << phy_ctl_srstn_shift, phy << phy_ctl_srstn_shift) | RK_CLRSETBITS(1 << ctl_psrstn_shift, ctl << ctl_psrstn_shift) | RK_CLRSETBITS(1 << ctl_srstn_shift, ctl << ctl_srstn_shift) | RK_CLRSETBITS(1 << phy_psrstn_shift, phy << phy_psrstn_shift) | RK_CLRSETBITS(1 << phy_srstn_shift, phy << phy_srstn_shift)); + RK_CLRSETBITS(1 << phy_ctl_srstn_shift, + phy << phy_ctl_srstn_shift) | + RK_CLRSETBITS(1 << ctl_psrstn_shift, ctl << ctl_psrstn_shift) | + RK_CLRSETBITS(1 << ctl_srstn_shift, ctl << ctl_srstn_shift) | + RK_CLRSETBITS(1 << phy_psrstn_shift, phy << phy_psrstn_shift) | + RK_CLRSETBITS(1 << phy_srstn_shift, phy << phy_srstn_shift)); } void rkclk_ddr_phy_ctl_reset(u32 ch, u32 n) @@ -407,7 +430,8 @@ void rkclk_ddr_phy_ctl_reset(u32 ch, u32 n) u32 phy_ctl_srstn_shift = 4 + 5 * ch; write32(&cru_ptr->cru_softrst_con[10], - RK_CLRSETBITS(1 << phy_ctl_srstn_shift, n << phy_ctl_srstn_shift)); + RK_CLRSETBITS(1 << phy_ctl_srstn_shift, + n << phy_ctl_srstn_shift)); } void rkclk_configure_spi(unsigned int bus, unsigned int hz) @@ -419,15 +443,18 @@ void rkclk_configure_spi(unsigned int bus, unsigned int hz) switch (bus) { /*select gpll as spi src clk, and set div*/ case 0: write32(&cru_ptr->cru_clksel_con[25], - RK_CLRSETBITS(1 << 7 | 0x1f << 0, 1 << 7 | (src_clk_div - 1) << 0)); + RK_CLRSETBITS(1 << 7 | 0x1f << 0, + 1 << 7 | (src_clk_div - 1) << 0)); break; case 1: write32(&cru_ptr->cru_clksel_con[25], - RK_CLRSETBITS(1 << 15 | 0x1f << 8, 1 << 15 | (src_clk_div - 1) << 8)); + RK_CLRSETBITS(1 << 15 | 0x1f << 8, + 1 << 15 | (src_clk_div - 1) << 8)); break; case 2: write32(&cru_ptr->cru_clksel_con[39], - RK_CLRSETBITS(1 << 7 | 0x1f << 0, 1 << 7 | (src_clk_div - 1) << 0)); + RK_CLRSETBITS(1 << 7 | 0x1f << 0, + 1 << 7 | (src_clk_div - 1) << 0)); break; default: printk(BIOS_ERR, "do not support this spi bus\n"); @@ -454,7 +481,8 @@ void rkclk_configure_i2s(unsigned int hz) i2s0_clk_sel: divider ouput from fraction i2s0_pll_div_con: 0*/ write32(&cru_ptr->cru_clksel_con[4], - RK_CLRSETBITS(1 << 15 | 1 << 12 | 3 << 8 | 0x7f << 0, 1 << 15 | 0 << 12 | 1 << 8 | 0 << 0)); + RK_CLRSETBITS(1 << 15 | 1 << 12 | 3 << 8 | 0x7f << 0, + 1 << 15 | 0 << 12 | 1 << 8 | 0 << 0)); /* set frac divider */ v = clk_gcd(GPLL_HZ, hz); @@ -569,12 +597,14 @@ void rkclk_configure_vop_aclk(u32 vop_id, u32 aclk_hz) switch (vop_id) { case 0: write32(&cru_ptr->cru_clksel_con[31], - RK_CLRSETBITS(3 << 6 | 0x1f << 0, 0 << 6 | (div - 1) << 0)); + RK_CLRSETBITS(3 << 6 | 0x1f << 0, + 0 << 6 | (div - 1) << 0)); break; case 1: write32(&cru_ptr->cru_clksel_con[31], - RK_CLRSETBITS(3 << 14 | 0x1f << 8, 0 << 14 | (div - 1) << 8)); + RK_CLRSETBITS(3 << 14 | 0x1f << 8, + 0 << 14 | (div - 1) << 8)); break; } } diff --git a/src/soc/rockchip/rk3288/edp.c b/src/soc/rockchip/rk3288/edp.c index 38e972d7cd..e0590ab97f 100644 --- a/src/soc/rockchip/rk3288/edp.c +++ b/src/soc/rockchip/rk3288/edp.c @@ -57,25 +57,27 @@ static void rk_edp_init_refclk(struct rk_edp *edp) write32(&edp->regs->pll_reg_1, REF_CLK_24M); /*initial value*/ - write32(&edp->regs->pll_reg_2, - LDO_OUTPUT_V_SEL_145 | KVCO_DEFALUT | CHG_PUMP_CUR_SEL_5US | V2L_CUR_SEL_1MA); + write32(&edp->regs->pll_reg_2, LDO_OUTPUT_V_SEL_145 | KVCO_DEFALUT | + CHG_PUMP_CUR_SEL_5US | V2L_CUR_SEL_1MA); - write32(&edp->regs->pll_reg_3, - LOCK_DET_CNT_SEL_256 | LOOP_FILTER_RESET | PALL_SSC_RESET | LOCK_DET_BYPASS | PLL_LOCK_DET_MODE | PLL_LOCK_DET_FORCE); + write32(&edp->regs->pll_reg_3, LOCK_DET_CNT_SEL_256 | + LOOP_FILTER_RESET | PALL_SSC_RESET | LOCK_DET_BYPASS | + PLL_LOCK_DET_MODE | PLL_LOCK_DET_FORCE); - write32(&edp->regs->pll_reg_5, - REGULATOR_V_SEL_950MV | STANDBY_CUR_SEL | CHG_PUMP_INOUT_CTRL_1200MV | CHG_PUMP_INPUT_CTRL_OP); + write32(&edp->regs->pll_reg_5, REGULATOR_V_SEL_950MV | STANDBY_CUR_SEL | + CHG_PUMP_INOUT_CTRL_1200MV | CHG_PUMP_INPUT_CTRL_OP); write32(&edp->regs->ssc_reg, SSC_OFFSET | SSC_MODE | SSC_DEPTH); - write32(&edp->regs->tx_common, - TX_SWING_PRE_EMP_MODE | PRE_DRIVER_PW_CTRL1 | LP_MODE_CLK_REGULATOR | RESISTOR_MSB_CTRL | RESISTOR_CTRL); + write32(&edp->regs->tx_common, TX_SWING_PRE_EMP_MODE | + PRE_DRIVER_PW_CTRL1 | LP_MODE_CLK_REGULATOR | + RESISTOR_MSB_CTRL | RESISTOR_CTRL); - write32(&edp->regs->dp_aux, - DP_AUX_COMMON_MODE | DP_AUX_EN | AUX_TERM_50OHM); + write32(&edp->regs->dp_aux, DP_AUX_COMMON_MODE | + DP_AUX_EN | AUX_TERM_50OHM); - write32(&edp->regs->dp_bias, - DP_BG_OUT_SEL | DP_DB_CUR_CTRL | DP_BG_SEL | DP_RESISTOR_TUNE_BG); + write32(&edp->regs->dp_bias, DP_BG_OUT_SEL | DP_DB_CUR_CTRL | + DP_BG_SEL | DP_RESISTOR_TUNE_BG); write32(&edp->regs->dp_reserv2, CH1_CH3_SWING_EMP_CTRL | CH0_CH2_SWING_EMP_CTRL); diff --git a/src/soc/rockchip/rk3288/gpio.c b/src/soc/rockchip/rk3288/gpio.c index 5fc9c7b185..96b8354087 100644 --- a/src/soc/rockchip/rk3288/gpio.c +++ b/src/soc/rockchip/rk3288/gpio.c @@ -53,7 +53,8 @@ static void __gpio_input(gpio_t gpio, u32 pull) 3 << (gpio.idx * 2), pull << (gpio.idx * 2)); else write32(&rk3288_grf->gpio1_p[(gpio.port - 1)][gpio.bank], - RK_CLRSETBITS(3 << (gpio.idx * 2), pull << (gpio.idx * 2))); + RK_CLRSETBITS(3 << (gpio.idx * 2), + pull << (gpio.idx * 2))); } void gpio_input(gpio_t gpio) diff --git a/src/soc/rockchip/rk3288/pwm.c b/src/soc/rockchip/rk3288/pwm.c index fb47dc8312..9f993f707f 100644 --- a/src/soc/rockchip/rk3288/pwm.c +++ b/src/soc/rockchip/rk3288/pwm.c @@ -75,8 +75,9 @@ void pwm_init(u32 id, u32 period_ns, u32 duty_ns) /*use rk pwm*/ write32(&rk3288_grf->soc_con2, RK_SETBITS(1 << 0)); - write32(&rk3288_pwm->pwm[id].pwm_ctrl, - PWM_SEL_SRC_CLK | PWM_OUTPUT_LEFT | PWM_LP_DISABLE | PWM_CONTINUOUS | PWM_DUTY_POSTIVE | PWM_INACTIVE_POSTIVE | RK_PWM_DISABLE); + write32(&rk3288_pwm->pwm[id].pwm_ctrl, PWM_SEL_SRC_CLK | + PWM_OUTPUT_LEFT | PWM_LP_DISABLE | PWM_CONTINUOUS | + PWM_DUTY_POSTIVE | PWM_INACTIVE_POSTIVE | RK_PWM_DISABLE); period = (PD_BUS_PCLK_HZ / 1000) * period_ns / USECS_PER_SEC; duty = (PD_BUS_PCLK_HZ / 1000) * duty_ns / USECS_PER_SEC; diff --git a/src/soc/rockchip/rk3288/sdram.c b/src/soc/rockchip/rk3288/sdram.c index 86acf6dc3f..e7d33ea3a6 100644 --- a/src/soc/rockchip/rk3288/sdram.c +++ b/src/soc/rockchip/rk3288/sdram.c @@ -609,12 +609,15 @@ static void pctl_cfg(u32 channel, sdram_params->pctl_timing.tcl - 1); write32(&ddr_pctl_regs->dfitphywrlat, sdram_params->pctl_timing.tcwl); - write32(&ddr_pctl_regs->mcfg, - LPDDR2_S4 | MDDR_LPDDR2_CLK_STOP_IDLE(0) | LPDDR2_EN | BURSTLENGTH_CFG(burstlen) | TFAW_CFG(6) | PD_EXIT_FAST | PD_TYPE(1) | PD_IDLE(0)); + write32(&ddr_pctl_regs->mcfg, LPDDR2_S4 | + MDDR_LPDDR2_CLK_STOP_IDLE(0) | LPDDR2_EN | + BURSTLENGTH_CFG(burstlen) | TFAW_CFG(6) | + PD_EXIT_FAST | PD_TYPE(1) | PD_IDLE(0)); write32(&rk3288_grf->soc_con0, MSCH_MAINDDR3(channel, 0)); - write32(&rk3288_grf->soc_con2, - PUBL_LPDDR3_EN(channel, 1) | PCTL_BST_DISABLE(channel, 1) | PCTL_LPDDR3_ODT_EN(channel, sdram_params->odt)); + write32(&rk3288_grf->soc_con2, PUBL_LPDDR3_EN(channel, 1) | + PCTL_BST_DISABLE(channel, 1) | + PCTL_LPDDR3_ODT_EN(channel, sdram_params->odt)); break; case DDR3: @@ -627,11 +630,14 @@ static void pctl_cfg(u32 channel, write32(&ddr_pctl_regs->dfitphywrlat, sdram_params->pctl_timing.tcwl - 1); write32(&ddr_pctl_regs->mcfg, - MDDR_LPDDR2_CLK_STOP_IDLE(0) | DDR3_EN | DDR2_DDR3_BL_8 | TFAW_CFG(6) | PD_EXIT_SLOW | PD_TYPE(1) | PD_IDLE(0)); + MDDR_LPDDR2_CLK_STOP_IDLE(0) | DDR3_EN | + DDR2_DDR3_BL_8 | TFAW_CFG(6) | + PD_EXIT_SLOW | PD_TYPE(1) | PD_IDLE(0)); write32(&rk3288_grf->soc_con0, MSCH_MAINDDR3(channel, 1)); - write32(&rk3288_grf->soc_con2, - PUBL_LPDDR3_EN(channel, 0) | PCTL_BST_DISABLE(channel, 0) | PCTL_LPDDR3_ODT_EN(channel, 0)); + write32(&rk3288_grf->soc_con2, PUBL_LPDDR3_EN(channel, 0) | + PCTL_BST_DISABLE(channel, 0) | + PCTL_LPDDR3_ODT_EN(channel, 0)); break; } @@ -656,11 +662,14 @@ static void phy_cfg(u32 channel, const struct rk3288_sdram_params *sdram_params) write32(&msch_regs->devtodev, BUSWRTORD(2) | BUSRDTOWR(2) | BUSRDTORD(1)); write32(&ddr_publ_regs->ptr[0], - PRT_DLLLOCK(div_round_up(sdram_params->ddr_freq / MHz * 5120, 1000)) | PRT_DLLSRST(div_round_up(sdram_params->ddr_freq / MHz * 50, 1000)) | PRT_ITMSRST(8)); + PRT_DLLLOCK(div_round_up(sdram_params->ddr_freq / MHz * 5120, 1000)) + | PRT_DLLSRST(div_round_up(sdram_params->ddr_freq / MHz * 50, 1000)) + | PRT_ITMSRST(8)); write32(&ddr_publ_regs->ptr[1], - PRT_DINIT0(div_round_up(sdram_params->ddr_freq / MHz * 500000, 1000)) | PRT_DINIT1(div_round_up(sdram_params->ddr_freq / MHz * 400, 1000))); - write32(&ddr_publ_regs->ptr[2], - PRT_DINIT2(MIN(dinit2, 0x1ffff)) | PRT_DINIT3(div_round_up(sdram_params->ddr_freq / MHz * 1000, 1000))); + PRT_DINIT0(div_round_up(sdram_params->ddr_freq / MHz * 500000, 1000)) + | PRT_DINIT1(div_round_up(sdram_params->ddr_freq / MHz * 400, 1000))); + write32(&ddr_publ_regs->ptr[2], PRT_DINIT2(MIN(dinit2, 0x1ffff)) + | PRT_DINIT3(div_round_up(sdram_params->ddr_freq / MHz * 1000, 1000))); switch (sdram_params->dramtype) { case LPDDR3: diff --git a/src/soc/rockchip/rk3288/uart.c b/src/soc/rockchip/rk3288/uart.c index 8ba1fdee73..7710c99760 100644 --- a/src/soc/rockchip/rk3288/uart.c +++ b/src/soc/rockchip/rk3288/uart.c @@ -103,8 +103,8 @@ static void rk3288_uart_init(void) // Hide the divisor latches. write32(&uart_ptr->lcr, line_config); // Enable FIFOs, and clear receive and transmit. - write32(&uart_ptr->fcr, - UART8250_FCR_FIFO_EN | UART8250_FCR_CLEAR_RCVR | UART8250_FCR_CLEAR_XMIT); + write32(&uart_ptr->fcr, UART8250_FCR_FIFO_EN | + UART8250_FCR_CLEAR_RCVR | UART8250_FCR_CLEAR_XMIT); } static void rk3288_uart_tx_byte(unsigned char data) diff --git a/src/soc/rockchip/rk3288/vop.c b/src/soc/rockchip/rk3288/vop.c index 915d452d4b..81fc41e991 100644 --- a/src/soc/rockchip/rk3288/vop.c +++ b/src/soc/rockchip/rk3288/vop.c @@ -51,11 +51,11 @@ void rkvop_enable(u32 vop_id, u32 fbbase, const struct edid *edid) write32(&preg->win0_act_info, V_ACT_WIDTH(hactive - 1) | V_ACT_HEIGHT(vactive - 1)); - write32(&preg->win0_dsp_st, - V_DSP_XST(xpos + hsync_len + hback_porch) | V_DSP_YST(ypos + vsync_len + vback_porch)); + write32(&preg->win0_dsp_st, V_DSP_XST(xpos + hsync_len + hback_porch) | + V_DSP_YST(ypos + vsync_len + vback_porch)); - write32(&preg->win0_dsp_info, - V_DSP_WIDTH(hactive - 1) | V_DSP_HEIGHT(vactive - 1)); + write32(&preg->win0_dsp_info, V_DSP_WIDTH(hactive - 1) | + V_DSP_HEIGHT(vactive - 1)); clrsetbits_le32(&preg->win0_color_key, M_WIN0_KEY_EN | M_WIN0_KEY_COLOR, V_WIN0_KEY_EN(0) | @@ -111,23 +111,27 @@ void rkvop_mode_set(u32 vop_id, const struct edid *edid) clrsetbits_le32(&preg->sys_ctrl, M_ALL_OUT_EN, V_EDP_OUT_EN(1)); clrsetbits_le32(&preg->dsp_ctrl0, M_DSP_OUT_MODE, V_DSP_OUT_MODE(15)); - write32(&preg->dsp_htotal_hs_end, - V_HSYNC(hsync_len) | V_HORPRD(hsync_len + hback_porch + hactive + hfront_porch)); + write32(&preg->dsp_htotal_hs_end, V_HSYNC(hsync_len) | + V_HORPRD(hsync_len + hback_porch + hactive + hfront_porch)); write32(&preg->dsp_hact_st_end, - V_HEAP(hsync_len + hback_porch + hactive) | V_HASP(hsync_len + hback_porch)); + V_HEAP(hsync_len + hback_porch + hactive) | + V_HASP(hsync_len + hback_porch)); - write32(&preg->dsp_vtotal_vs_end, - V_VSYNC(vsync_len) | V_VERPRD(vsync_len + vback_porch + vactive + vfront_porch)); + write32(&preg->dsp_vtotal_vs_end, V_VSYNC(vsync_len) | + V_VERPRD(vsync_len + vback_porch + vactive + vfront_porch)); write32(&preg->dsp_vact_st_end, - V_VAEP(vsync_len + vback_porch + vactive) | V_VASP(vsync_len + vback_porch)); + V_VAEP(vsync_len + vback_porch + vactive) | + V_VASP(vsync_len + vback_porch)); write32(&preg->post_dsp_hact_info, - V_HEAP(hsync_len + hback_porch + hactive) | V_HASP(hsync_len + hback_porch)); + V_HEAP(hsync_len + hback_porch + hactive) | + V_HASP(hsync_len + hback_porch)); write32(&preg->post_dsp_vact_info, - V_VAEP(vsync_len + vback_porch + vactive) | V_VASP(vsync_len + vback_porch)); + V_VAEP(vsync_len + vback_porch + vactive) | + V_VASP(vsync_len + vback_porch)); write32(&preg->reg_cfg_done, 0x01); /* enable reg config */ } |