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 adsp->dramsize = resource_size(&res); in platform_parse_resource()
120 if (adsp->pa_dram & DRAM_REMAP_MASK) { in platform_parse_resource()
121 dev_err(dev, "adsp memory(%#x) is not 4K-aligned\n", in platform_parse_resource()
122 (u32)adsp->pa_dram); 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()
133 &adsp->pa_dram, adsp->dramsize); in platform_parse_resource()
138 dev_err(dev, "no ADSP-CFG register resource\n"); in platform_parse_resource()
142 adsp->va_cfgreg = devm_ioremap_resource(dev, mmio); in platform_parse_resource()
143 if (IS_ERR(adsp->va_cfgreg)) in platform_parse_resource()
144 return PTR_ERR(adsp->va_cfgreg); in platform_parse_resource()
146 adsp->pa_cfgreg = (phys_addr_t)mmio->start; in platform_parse_resource()
147 adsp->cfgregsize = resource_size(mmio); in platform_parse_resource()
150 adsp->va_cfgreg, adsp->cfgregsize); in platform_parse_resource()
159 adsp->pa_sram = (phys_addr_t)mmio->start; in platform_parse_resource()
160 adsp->sramsize = resource_size(mmio); in platform_parse_resource()
162 dev_dbg(dev, "sram pbase=%pa,%#x\n", &adsp->pa_sram, adsp->sramsize); in platform_parse_resource()
190 static int adsp_memory_remap_init(struct device *dev, struct mtk_adsp_chip_info *adsp) in adsp_memory_remap_init() argument
195 if (!adsp) in adsp_memory_remap_init()
205 offset = adsp->pa_dram - DRAM_PHYS_BASE_FROM_DSP_VIEW; in adsp_memory_remap_init()
206 adsp->dram_offset = offset; in adsp_memory_remap_init()
208 dev_dbg(dev, "adsp->pa_dram %pa, offset %#x\n", &adsp->pa_dram, offset); in adsp_memory_remap_init()
243 priv->adsp = devm_kzalloc(&pdev->dev, sizeof(struct mtk_adsp_chip_info), GFP_KERNEL); in mt8195_dsp_probe()
244 if (!priv->adsp) in mt8195_dsp_probe()
247 ret = platform_parse_resource(pdev, priv->adsp); in mt8195_dsp_probe()
269 ret = adsp_memory_remap_init(&pdev->dev, priv->adsp); in mt8195_dsp_probe()
276 priv->adsp->pa_sram, in mt8195_dsp_probe()
277 priv->adsp->sramsize); in mt8195_dsp_probe()
280 &priv->adsp->pa_sram, priv->adsp->sramsize); in mt8195_dsp_probe()
285 priv->adsp->va_sram = sdev->bar[SOF_FW_BLK_TYPE_IRAM]; in mt8195_dsp_probe()
288 priv->adsp->pa_dram, in mt8195_dsp_probe()
289 priv->adsp->dramsize); in mt8195_dsp_probe()
292 &priv->adsp->pa_dram, priv->adsp->dramsize); in mt8195_dsp_probe()
296 priv->adsp->va_dram = sdev->bar[SOF_FW_BLK_TYPE_SRAM]; in mt8195_dsp_probe()
298 sdev->bar[DSP_REG_BAR] = priv->adsp->va_cfgreg; in mt8195_dsp_probe()
306 priv->ipc_dev = platform_device_register_data(&pdev->dev, "mtk-adsp-ipc", in mt8195_dsp_probe()
311 dev_err(sdev->dev, "failed to register mtk-adsp-ipc device\n"); in mt8195_dsp_probe()
373 /* power down adsp sram */ in mt8195_dsp_suspend()
380 /* turn off adsp clock */ in mt8195_dsp_suspend()
388 /* turn on adsp clock */ in mt8195_dsp_resume()
395 /* power on adsp sram */ in mt8195_dsp_resume()
468 dev_info(sdev->dev, "adsp dump : pc %#x, data %#x, bus0 %#x, bus1 %#x, swrest %#x", in mt8195_adsp_dump()