Lines Matching full:memc
36 static int brcmstb_memc_uses_lpddr4(struct brcmstb_memc *memc) in brcmstb_memc_uses_lpddr4() argument
38 void __iomem *config = memc->ddr_ctrl + REG_MEMC_CNTRLR_CONFIG; in brcmstb_memc_uses_lpddr4()
46 static int brcmstb_memc_srpd_config(struct brcmstb_memc *memc, in brcmstb_memc_srpd_config() argument
49 void __iomem *cfg = memc->ddr_ctrl + memc->srpd_offset; in brcmstb_memc_srpd_config()
56 memc->timeout_cycles = cycles; in brcmstb_memc_srpd_config()
72 struct brcmstb_memc *memc = dev_get_drvdata(dev); in frequency_show() local
74 return sprintf(buf, "%d\n", memc->frequency); in frequency_show()
80 struct brcmstb_memc *memc = dev_get_drvdata(dev); in srpd_show() local
82 return sprintf(buf, "%d\n", memc->timeout_cycles); in srpd_show()
88 struct brcmstb_memc *memc = dev_get_drvdata(dev); in srpd_store() local
97 if (brcmstb_memc_uses_lpddr4(memc)) in srpd_store()
104 ret = brcmstb_memc_srpd_config(memc, val); in srpd_store()
131 struct brcmstb_memc *memc; in brcmstb_memc_probe() local
134 memc = devm_kzalloc(dev, sizeof(*memc), GFP_KERNEL); in brcmstb_memc_probe()
135 if (!memc) in brcmstb_memc_probe()
138 dev_set_drvdata(dev, memc); in brcmstb_memc_probe()
142 memc->srpd_offset = memc_data->srpd_offset; in brcmstb_memc_probe()
144 memc->ddr_ctrl = devm_platform_ioremap_resource(pdev, 0); in brcmstb_memc_probe()
145 if (IS_ERR(memc->ddr_ctrl)) in brcmstb_memc_probe()
146 return PTR_ERR(memc->ddr_ctrl); in brcmstb_memc_probe()
149 &memc->frequency); in brcmstb_memc_probe()
181 .compatible = "brcm,brcmstb-memc-ddr-rev-b.1.x",
185 .compatible = "brcm,brcmstb-memc-ddr-rev-b.2.0",
189 .compatible = "brcm,brcmstb-memc-ddr-rev-b.2.1",
193 .compatible = "brcm,brcmstb-memc-ddr-rev-b.2.2",
197 .compatible = "brcm,brcmstb-memc-ddr-rev-b.2.3",
201 .compatible = "brcm,brcmstb-memc-ddr-rev-b.2.5",
205 .compatible = "brcm,brcmstb-memc-ddr-rev-b.2.6",
209 .compatible = "brcm,brcmstb-memc-ddr-rev-b.2.7",
213 .compatible = "brcm,brcmstb-memc-ddr-rev-b.2.8",
217 .compatible = "brcm,brcmstb-memc-ddr-rev-b.3.0",
221 .compatible = "brcm,brcmstb-memc-ddr-rev-b.3.1",
225 .compatible = "brcm,brcmstb-memc-ddr-rev-c.1.0",
229 .compatible = "brcm,brcmstb-memc-ddr-rev-c.1.1",
233 .compatible = "brcm,brcmstb-memc-ddr-rev-c.1.2",
237 .compatible = "brcm,brcmstb-memc-ddr-rev-c.1.3",
241 .compatible = "brcm,brcmstb-memc-ddr-rev-c.1.4",
246 .compatible = "brcm,brcmstb-memc-ddr",
254 struct brcmstb_memc *memc = dev_get_drvdata(dev); in brcmstb_memc_suspend() local
255 void __iomem *cfg = memc->ddr_ctrl + memc->srpd_offset; in brcmstb_memc_suspend()
258 if (memc->timeout_cycles == 0) in brcmstb_memc_suspend()
277 struct brcmstb_memc *memc = dev_get_drvdata(dev); in brcmstb_memc_resume() local
279 if (memc->timeout_cycles == 0) in brcmstb_memc_resume()
282 return brcmstb_memc_srpd_config(memc, memc->timeout_cycles); in brcmstb_memc_resume()