Lines Matching refs:as_nr
29 static int wait_ready(struct panfrost_device *pfdev, u32 as_nr) in wait_ready() argument
36 ret = readl_relaxed_poll_timeout_atomic(pfdev->iomem + AS_STATUS(as_nr), in wait_ready()
45 static int write_cmd(struct panfrost_device *pfdev, u32 as_nr, u32 cmd) in write_cmd() argument
50 status = wait_ready(pfdev, as_nr); in write_cmd()
52 mmu_write(pfdev, AS_COMMAND(as_nr), cmd); in write_cmd()
57 static void lock_region(struct panfrost_device *pfdev, u32 as_nr, in lock_region() argument
71 mmu_write(pfdev, AS_LOCKADDR_LO(as_nr), region & 0xFFFFFFFFUL); in lock_region()
72 mmu_write(pfdev, AS_LOCKADDR_HI(as_nr), (region >> 32) & 0xFFFFFFFFUL); in lock_region()
73 write_cmd(pfdev, as_nr, AS_COMMAND_LOCK); in lock_region()
77 static int mmu_hw_do_operation_locked(struct panfrost_device *pfdev, int as_nr, in mmu_hw_do_operation_locked() argument
80 if (as_nr < 0) in mmu_hw_do_operation_locked()
84 lock_region(pfdev, as_nr, iova, size); in mmu_hw_do_operation_locked()
87 write_cmd(pfdev, as_nr, op); in mmu_hw_do_operation_locked()
90 return wait_ready(pfdev, as_nr); in mmu_hw_do_operation_locked()
107 int as_nr = mmu->as; in panfrost_mmu_enable() local
112 mmu_hw_do_operation_locked(pfdev, as_nr, 0, ~0ULL, AS_COMMAND_FLUSH_MEM); in panfrost_mmu_enable()
114 mmu_write(pfdev, AS_TRANSTAB_LO(as_nr), transtab & 0xffffffffUL); in panfrost_mmu_enable()
115 mmu_write(pfdev, AS_TRANSTAB_HI(as_nr), transtab >> 32); in panfrost_mmu_enable()
120 mmu_write(pfdev, AS_MEMATTR_LO(as_nr), memattr & 0xffffffffUL); in panfrost_mmu_enable()
121 mmu_write(pfdev, AS_MEMATTR_HI(as_nr), memattr >> 32); in panfrost_mmu_enable()
123 write_cmd(pfdev, as_nr, AS_COMMAND_UPDATE); in panfrost_mmu_enable()
126 static void panfrost_mmu_disable(struct panfrost_device *pfdev, u32 as_nr) in panfrost_mmu_disable() argument
128 mmu_hw_do_operation_locked(pfdev, as_nr, 0, ~0ULL, AS_COMMAND_FLUSH_MEM); in panfrost_mmu_disable()
130 mmu_write(pfdev, AS_TRANSTAB_LO(as_nr), 0); in panfrost_mmu_disable()
131 mmu_write(pfdev, AS_TRANSTAB_HI(as_nr), 0); in panfrost_mmu_disable()
133 mmu_write(pfdev, AS_MEMATTR_LO(as_nr), 0); in panfrost_mmu_disable()
134 mmu_write(pfdev, AS_MEMATTR_HI(as_nr), 0); in panfrost_mmu_disable()
136 write_cmd(pfdev, as_nr, AS_COMMAND_UPDATE); in panfrost_mmu_disable()