From: Tomasz Jankowski <tomasz1.jankowski@xxxxxxxxx> Setup mmu in the driver with a new memory component. Signed-off-by: Tomasz Jankowski <tomasz1.jankowski@xxxxxxxxx> Tested-by: Savo Novakovic <savox.novakovic@xxxxxxxxx> Co-Developed-by: Maciej Kwapulinski <maciej.kwapulinski@xxxxxxxxxxxxxxx> Signed-off-by: Maciej Kwapulinski <maciej.kwapulinski@xxxxxxxxxxxxxxx> --- drivers/misc/intel/gna/device.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/misc/intel/gna/device.c b/drivers/misc/intel/gna/device.c index ed7d3c0223df..50cac8139dcc 100644 --- a/drivers/misc/intel/gna/device.c +++ b/drivers/misc/intel/gna/device.c @@ -59,6 +59,18 @@ int gna_probe(struct device *parent, struct gna_dev_info *dev_info, void __iomem bld_reg = gna_reg_read(gna_priv, GNA_MMIO_IBUFFS); gna_priv->hw_info.in_buf_s = bld_reg & GENMASK(7, 0); + ret = gna_mmu_alloc(gna_priv); + if (ret) { + dev_err(parent, "mmu allocation failed\n"); + return ret; + + } + dev_dbg(parent, "maximum memory size %llu num pd %d\n", + gna_priv->info.max_hw_mem, gna_priv->info.num_pagetables); + dev_dbg(parent, "desc rsvd size %d mmu vamax size %d\n", + gna_priv->info.desc_info.rsvd_size, + gna_priv->info.desc_info.mmu_info.vamax_size); + mutex_init(&gna_priv->mmu_lock); idr_init(&gna_priv->memory_idr); -- 2.28.0