/* save double buffer select regs */
ipu_cha_db_mode_reg[0] = __raw_readl(IPU_CHA_DB_MODE_SEL(0));
ipu_cha_db_mode_reg[1] = __raw_readl(IPU_CHA_DB_MODE_SEL(32));
ipu_cha_db_mode_reg[2] =
__raw_readl(IPU_ALT_CHA_DB_MODE_SEL(0));
ipu_cha_db_mode_reg[3] =
__raw_readl(IPU_ALT_CHA_DB_MODE_SEL(32));
/* save triple buffer select regs */
ipu_cha_trb_mode_reg[0] = __raw_readl(IPU_CHA_TRB_MODE_SEL(0));
ipu_cha_trb_mode_reg[1] = __raw_readl(IPU_CHA_TRB_MODE_SEL(32));
/* save current buffer regs */
ipu_cha_cur_buf_reg[0] = __raw_readl(IPU_CHA_CUR_BUF(0));
ipu_cha_cur_buf_reg[1] = __raw_readl(IPU_CHA_CUR_BUF(32));
ipu_cha_cur_buf_reg[2] = __raw_readl(IPU_ALT_CUR_BUF0);
ipu_cha_cur_buf_reg[3] = __raw_readl(IPU_ALT_CUR_BUF1);
/* save current triple buffer regs */
ipu_cha_triple_cur_buf_reg[0] =
__raw_readl(IPU_CHA_TRIPLE_CUR_BUF(0));
ipu_cha_triple_cur_buf_reg[1] =
__raw_readl(IPU_CHA_TRIPLE_CUR_BUF(32));
ipu_cha_triple_cur_buf_reg[2] =
__raw_readl(IPU_CHA_TRIPLE_CUR_BUF(64));
ipu_cha_triple_cur_buf_reg[3] =
__raw_readl(IPU_CHA_TRIPLE_CUR_BUF(96));
/* save idamc sub addr regs */
idma_sub_addr_reg[0] = __raw_readl(IDMAC_SUB_ADDR_0);
idma_sub_addr_reg[1] = __raw_readl(IDMAC_SUB_ADDR_1);
idma_sub_addr_reg[2] = __raw_readl(IDMAC_SUB_ADDR_2);
idma_sub_addr_reg[3] = __raw_readl(IDMAC_SUB_ADDR_3);
idma_sub_addr_reg[4] = __raw_readl(IDMAC_SUB_ADDR_4);
/* save sub-modules status and disable all */
ic_conf_reg = __raw_readl(IC_CONF);
__raw_writel(0, IC_CONF);
ipu_conf_reg = __raw_readl(IPU_CONF);
__raw_writel(0, IPU_CONF);
/* save buf ready regs */
buf_ready_reg[0] = __raw_readl(IPU_CHA_BUF0_RDY(0));
buf_ready_reg[1] = __raw_readl(IPU_CHA_BUF0_RDY(32));
buf_ready_reg[2] = __raw_readl(IPU_CHA_BUF1_RDY(0));
buf_ready_reg[3] = __raw_readl(IPU_CHA_BUF1_RDY(32));
buf_ready_reg[4] = __raw_readl(IPU_ALT_CHA_BUF0_RDY(0));
buf_ready_reg[5] = __raw_readl(IPU_ALT_CHA_BUF0_RDY(32));
buf_ready_reg[6] = __raw_readl(IPU_ALT_CHA_BUF1_RDY(0));
buf_ready_reg[7] = __raw_readl(IPU_ALT_CHA_BUF1_RDY(32));
buf_ready_reg[8] = __raw_readl(IPU_CHA_BUF2_RDY(0));
buf_ready_reg[9] = __raw_readl(IPU_CHA_BUF2_RDY(32));
uninit_channel MEM_PRP_VF_MEM 時,有寫到的 register:
/* Reset the double buffer */
reg = __raw_readl(IPU_CHA_DB_MODE_SEL(in_dma));
__raw_writel(reg & ~idma_mask(in_dma), IPU_CHA_DB_MODE_SEL(in_dma));
reg = __raw_readl(IPU_CHA_DB_MODE_SEL(out_dma));
__raw_writel(reg & ~idma_mask(out_dma), IPU_CHA_DB_MODE_SEL(out_dma));
/* Reset the triple buffer */
reg = __raw_readl(IPU_CHA_TRB_MODE_SEL(in_dma));
__raw_writel(reg & ~idma_mask(in_dma), IPU_CHA_TRB_MODE_SEL(in_dma));
reg = __raw_readl(IPU_CHA_TRB_MODE_SEL(out_dma));
__raw_writel(reg & ~idma_mask(out_dma), IPU_CHA_TRB_MODE_SEL(out_dma));
/* case MEM_PRP_VF_MEM */
_ipu_ic_uninit_prpvf();
_ipu_vdi_uninit();
reg = __raw_readl(IPU_FS_PROC_FLOW1);
__raw_writel(reg & ~FS_VF_IN_VALID, IPU_FS_PROC_FLOW1);
/* misc */
__raw_writel(ipu_conf, IPU_CONF);
結果重點是最後的 clk_disable,只要clk 沒關,就resume 不起來..
沒有留言:
張貼留言