You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
memory: dsmc: fix bug in multi cs and region
Change-Id: I792667c6a4a7e9f120da29b1fef19cbd2b40ed9e Signed-off-by: Zhihuan He <huan.he@rock-chips.com>
This commit is contained in:
@@ -295,8 +295,12 @@ static int dsmc_ctrller_cfg_for_lb(struct rockchip_dsmc *dsmc, uint32_t cs)
|
||||
dsmc->regs + DSMC_RGN0_ATTR(cs) + 4 * i);
|
||||
}
|
||||
/* clear and enable interrupt */
|
||||
writel(INT_STATUS(cfg->int_en), dsmc->regs + DSMC_INT_STATUS);
|
||||
writel(INT_EN(cfg->int_en), dsmc->regs + DSMC_INT_EN);
|
||||
REG_CLRSETBITS(dsmc, DSMC_INT_STATUS,
|
||||
INT_STATUS_MASK(cfg->int_en),
|
||||
INT_STATUS(cfg->int_en));
|
||||
REG_CLRSETBITS(dsmc, DSMC_INT_EN,
|
||||
INT_EN_MASK(cfg->int_en),
|
||||
INT_EN(cfg->int_en));
|
||||
|
||||
if (dsmc->cfg.dma_req_mux_offset && (cs < 2))
|
||||
REG_CLRSETBITS(dsmc, dsmc->cfg.dma_req_mux_offset,
|
||||
|
||||
@@ -278,6 +278,7 @@ static int dsmc_reg_remap(struct device *dev, struct dsmc_ctrl_config *cfg,
|
||||
region_map->size,
|
||||
DSMC_MEM_ATTRIBUTE_NO_CACHE);
|
||||
} else if (cfg->cs_cfg[cs].device_type == DSMC_LB_DEVICE) {
|
||||
num = 0;
|
||||
for (rgn = 0; rgn < DSMC_LB_MAX_RGN; rgn++) {
|
||||
if (!cfg->cs_cfg[cs].slv_rgn[rgn].status)
|
||||
continue;
|
||||
|
||||
@@ -58,12 +58,12 @@
|
||||
|
||||
/* INT_EN */
|
||||
#define INT_EN_SHIFT 0
|
||||
#define INT_EN_MASK 0xf
|
||||
#define INT_EN_MASK(cs) (0x1 << (cs))
|
||||
#define INT_EN(cs) (0x1 << (cs))
|
||||
|
||||
/* INT_STATUS */
|
||||
#define INT_STATUS_SHIFT 0
|
||||
#define INT_STATUS_MASK 0xf
|
||||
#define INT_STATUS_MASK(cs) (0x1 << (cs))
|
||||
#define INT_STATUS(cs) (0x1 << (cs))
|
||||
|
||||
/* INT_MASK */
|
||||
|
||||
Reference in New Issue
Block a user