Lines Matching full:adsp
27 #include "../mtk-adsp-common.h"
96 struct mtk_adsp_chip_info *adsp = data; in platform_parse_resource() local
118 adsp->pa_dram = (phys_addr_t)res.start; in platform_parse_resource()
119 if (adsp->pa_dram & DRAM_REMAP_MASK) { in platform_parse_resource()
120 dev_err(dev, "adsp memory(%#x) is not 4K-aligned\n", in platform_parse_resource()
121 (u32)adsp->pa_dram); in platform_parse_resource()
125 adsp->dramsize = resource_size(&res); in platform_parse_resource()
126 if (adsp->dramsize < TOTAL_SIZE_SHARED_DRAM_FROM_TAIL) { in platform_parse_resource()
127 dev_err(dev, "adsp memory(%#x) is not enough for share\n", in platform_parse_resource()
128 adsp->dramsize); in platform_parse_resource()
132 dev_dbg(dev, "dram pbase=%pa size=%#x\n", &adsp->pa_dram, adsp->dramsize); in platform_parse_resource()
136 dev_err(dev, "no ADSP-CFG register resource\n"); in platform_parse_resource()
140 adsp->va_cfgreg = devm_ioremap_resource(dev, mmio); in platform_parse_resource()
141 if (IS_ERR(adsp->va_cfgreg)) in platform_parse_resource()
142 return PTR_ERR(adsp->va_cfgreg); in platform_parse_resource()
144 adsp->pa_cfgreg = (phys_addr_t)mmio->start; in platform_parse_resource()
145 adsp->cfgregsize = resource_size(mmio); in platform_parse_resource()
147 dev_dbg(dev, "cfgreg pbase=%pa size=%#x\n", &adsp->pa_cfgreg, adsp->cfgregsize); in platform_parse_resource()
155 adsp->pa_sram = (phys_addr_t)mmio->start; in platform_parse_resource()
156 adsp->sramsize = resource_size(mmio); in platform_parse_resource()
158 dev_dbg(dev, "sram pbase=%pa size=%#x\n", &adsp->pa_sram, adsp->sramsize); in platform_parse_resource()
166 adsp->va_secreg = devm_ioremap_resource(dev, mmio); in platform_parse_resource()
167 if (IS_ERR(adsp->va_secreg)) in platform_parse_resource()
168 return PTR_ERR(adsp->va_secreg); in platform_parse_resource()
170 adsp->pa_secreg = (phys_addr_t)mmio->start; in platform_parse_resource()
171 adsp->secregsize = resource_size(mmio); in platform_parse_resource()
173 dev_dbg(dev, "secreg pbase=%pa size=%#x\n", &adsp->pa_secreg, adsp->secregsize); in platform_parse_resource()
181 adsp->va_busreg = devm_ioremap_resource(dev, mmio); in platform_parse_resource()
182 if (IS_ERR(adsp->va_busreg)) in platform_parse_resource()
183 return PTR_ERR(adsp->va_busreg); in platform_parse_resource()
185 adsp->pa_busreg = (phys_addr_t)mmio->start; in platform_parse_resource()
186 adsp->busregsize = resource_size(mmio); in platform_parse_resource()
188 dev_dbg(dev, "busreg pbase=%pa size=%#x\n", &adsp->pa_busreg, adsp->busregsize); in platform_parse_resource()
206 static int adsp_memory_remap_init(struct snd_sof_dev *sdev, struct mtk_adsp_chip_info *adsp) in adsp_memory_remap_init() argument
210 offset = adsp->pa_dram - DRAM_PHYS_BASE_FROM_DSP_VIEW; in adsp_memory_remap_init()
211 adsp->dram_offset = offset; in adsp_memory_remap_init()
214 dev_dbg(sdev->dev, "adsp->pa_dram %pa, offset %#x\n", &adsp->pa_dram, offset); in adsp_memory_remap_init()
253 priv->adsp = devm_kzalloc(&pdev->dev, sizeof(struct mtk_adsp_chip_info), GFP_KERNEL); in mt8186_dsp_probe()
254 if (!priv->adsp) in mt8186_dsp_probe()
257 ret = platform_parse_resource(pdev, priv->adsp); in mt8186_dsp_probe()
262 priv->adsp->pa_sram, in mt8186_dsp_probe()
263 priv->adsp->sramsize); in mt8186_dsp_probe()
266 &priv->adsp->pa_sram, priv->adsp->sramsize); in mt8186_dsp_probe()
270 priv->adsp->va_sram = sdev->bar[SOF_FW_BLK_TYPE_IRAM]; in mt8186_dsp_probe()
273 priv->adsp->pa_dram, in mt8186_dsp_probe()
274 priv->adsp->dramsize); in mt8186_dsp_probe()
278 &priv->adsp->pa_dram, priv->adsp->dramsize); in mt8186_dsp_probe()
282 priv->adsp->va_dram = sdev->bar[SOF_FW_BLK_TYPE_SRAM]; in mt8186_dsp_probe()
284 sdev->bar[DSP_REG_BAR] = priv->adsp->va_cfgreg; in mt8186_dsp_probe()
285 sdev->bar[DSP_SECREG_BAR] = priv->adsp->va_secreg; in mt8186_dsp_probe()
286 sdev->bar[DSP_BUSREG_BAR] = priv->adsp->va_busreg; in mt8186_dsp_probe()
294 ret = adsp_memory_remap_init(sdev, priv->adsp); in mt8186_dsp_probe()
300 /* enable adsp clock before touching registers */ in mt8186_dsp_probe()
315 priv->ipc_dev = platform_device_register_data(&pdev->dev, "mtk-adsp-ipc", in mt8186_dsp_probe()
320 dev_err(sdev->dev, "failed to create mtk-adsp-ipc device\n"); in mt8186_dsp_probe()
444 dev_info(sdev->dev, "adsp dump : pc %#x, data %#x, dbg_inst %#x,", in mt8186_adsp_dump()