Lines Matching refs:chan

40 	struct chan_info chan[2];  member
294 static void phy_cfg(const struct chan_info *chan, int channel, in phy_cfg() argument
297 struct rk3288_ddr_publ *publ = chan->publ; in phy_cfg()
298 struct rk3288_msch *msch = chan->msch; in phy_cfg()
439 static void set_bandwidth_ratio(const struct chan_info *chan, int channel, in set_bandwidth_ratio() argument
442 struct rk3288_ddr_pctl *pctl = chan->pctl; in set_bandwidth_ratio()
443 struct rk3288_ddr_publ *publ = chan->publ; in set_bandwidth_ratio()
444 struct rk3288_msch *msch = chan->msch; in set_bandwidth_ratio()
477 static int data_training(const struct chan_info *chan, int channel, in data_training() argument
485 struct rk3288_ddr_publ *publ = chan->publ; in data_training()
486 struct rk3288_ddr_pctl *pctl = chan->pctl; in data_training()
540 static void move_to_access_state(const struct chan_info *chan) in move_to_access_state() argument
542 struct rk3288_ddr_publ *publ = chan->publ; in move_to_access_state()
543 struct rk3288_ddr_pctl *pctl = chan->pctl; in move_to_access_state()
580 static void dram_cfg_rbc(const struct chan_info *chan, u32 chnum, in dram_cfg_rbc() argument
583 struct rk3288_ddr_publ *publ = chan->publ; in dram_cfg_rbc()
591 writel(sdram_params->base.ddrconfig, &chan->msch->ddrconf); in dram_cfg_rbc()
597 unsigned int chan; in dram_all_config() local
602 for (chan = 0; chan < sdram_params->num_channels; chan++) { in dram_all_config()
604 &sdram_params->ch[chan]; in dram_all_config()
606 sys_reg |= info->row_3_4 << SYS_REG_ROW_3_4_SHIFT(chan); in dram_all_config()
607 sys_reg |= 1 << SYS_REG_CHINFO_SHIFT(chan); in dram_all_config()
608 sys_reg |= (info->rank - 1) << SYS_REG_RANK_SHIFT(chan); in dram_all_config()
609 sys_reg |= (info->col - 9) << SYS_REG_COL_SHIFT(chan); in dram_all_config()
610 sys_reg |= info->bk == 3 ? 0 : 1 << SYS_REG_BK_SHIFT(chan); in dram_all_config()
611 sys_reg |= (info->cs0_row - 13) << SYS_REG_CS0_ROW_SHIFT(chan); in dram_all_config()
612 sys_reg |= (info->cs1_row - 13) << SYS_REG_CS1_ROW_SHIFT(chan); in dram_all_config()
613 sys_reg |= (2 >> info->bw) << SYS_REG_BW_SHIFT(chan); in dram_all_config()
614 sys_reg |= (2 >> info->dbw) << SYS_REG_DBW_SHIFT(chan); in dram_all_config()
616 dram_cfg_rbc(&dram->chan[chan], chan, sdram_params); in dram_all_config()
627 const struct chan_info *chan = &dram->chan[channel]; in sdram_rank_bw_detect() local
628 struct rk3288_ddr_publ *publ = chan->publ; in sdram_rank_bw_detect()
630 if (data_training(chan, channel, sdram_params) < 0) { in sdram_rank_bw_detect()
651 set_bandwidth_ratio(chan, channel, in sdram_rank_bw_detect()
661 (data_training(chan, channel, sdram_params) < 0)) { in sdram_rank_bw_detect()
680 const struct chan_info *chan = &dram->chan[channel]; in sdram_col_row_detect() local
681 struct rk3288_ddr_pctl *pctl = chan->pctl; in sdram_col_row_detect()
682 struct rk3288_ddr_publ *publ = chan->publ; in sdram_col_row_detect()
704 writel(4, &chan->msch->ddrconf); in sdram_col_row_detect()
705 move_to_access_state(chan); in sdram_col_row_detect()
810 const struct chan_info *chan = &dram->chan[channel]; in sdram_init() local
811 struct rk3288_ddr_pctl *pctl = chan->pctl; in sdram_init()
812 struct rk3288_ddr_publ *publ = chan->publ; in sdram_init()
826 phy_cfg(chan, channel, sdram_params); in sdram_init()
857 set_bandwidth_ratio(chan, channel, in sdram_init()
903 writel(15, &chan->msch->ddrconf); in sdram_init()
904 move_to_access_state(chan); in sdram_init()
1062 priv->chan[0].msch = regmap_get_range(map, 0); in rk3288_dmc_probe()
1063 priv->chan[1].msch = (struct rk3288_msch *) in rk3288_dmc_probe()
1069 priv->chan[0].pctl = regmap_get_range(plat->map, 0); in rk3288_dmc_probe()
1070 priv->chan[0].publ = regmap_get_range(plat->map, 1); in rk3288_dmc_probe()
1071 priv->chan[1].pctl = regmap_get_range(plat->map, 2); in rk3288_dmc_probe()
1072 priv->chan[1].publ = regmap_get_range(plat->map, 3); in rk3288_dmc_probe()