parisc: BTLB: Add BTLB insert and purge firmware function wrappers
authorHelge Deller <deller@gmx.de>
Thu, 7 Sep 2023 06:06:37 +0000 (08:06 +0200)
committerHelge Deller <deller@gmx.de>
Thu, 7 Sep 2023 07:12:20 +0000 (09:12 +0200)
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/include/asm/pdc.h
arch/parisc/kernel/firmware.c

index 269b9a159f01fbec54e164d7baaffcf629c1ce6e..2fd7eb2f374655e6cf794b3d5d8b4498cb3f436d 100644 (file)
@@ -46,6 +46,9 @@ int pdc_cache_info(struct pdc_cache_info *cache);
 int pdc_spaceid_bits(unsigned long *space_bits);
 #ifndef CONFIG_PA20
 int pdc_btlb_info(struct pdc_btlb_info *btlb);
+int pdc_btlb_insert(unsigned long long vpage, unsigned long physpage, unsigned long len,
+                    unsigned long entry_info, unsigned long slot);
+int pdc_btlb_purge_all(void);
 int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path);
 #endif /* !CONFIG_PA20 */
 int pdc_pim_toc11(struct pdc_toc_pim_11 *ret);
index 8f37e75f2fb9caf51557d46fb7ee6070845e6bba..79bf44d04aa85e96f90cce038778e7fac79f33db 100644 (file)
@@ -696,18 +696,42 @@ int pdc_spaceid_bits(unsigned long *space_bits)
  */
 int pdc_btlb_info(struct pdc_btlb_info *btlb) 
 {
-        int retval;
+       int retval;
        unsigned long flags;
 
-        spin_lock_irqsave(&pdc_lock, flags);
-        retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0);
-        memcpy(btlb, pdc_result, sizeof(*btlb));
-        spin_unlock_irqrestore(&pdc_lock, flags);
+       spin_lock_irqsave(&pdc_lock, flags);
+       retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0);
+       memcpy(btlb, pdc_result, sizeof(*btlb));
+       spin_unlock_irqrestore(&pdc_lock, flags);
 
-        if(retval < 0) {
-                btlb->max_size = 0;
-        }
-        return retval;
+       if(retval < 0) {
+               btlb->max_size = 0;
+       }
+       return retval;
+}
+
+int pdc_btlb_insert(unsigned long long vpage, unsigned long physpage, unsigned long len,
+                   unsigned long entry_info, unsigned long slot)
+{
+       int retval;
+       unsigned long flags;
+
+       spin_lock_irqsave(&pdc_lock, flags);
+       retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INSERT, (unsigned long) (vpage >> 32),
+                             (unsigned long) vpage, physpage, len, entry_info, slot);
+       spin_unlock_irqrestore(&pdc_lock, flags);
+       return retval;
+}
+
+int pdc_btlb_purge_all(void)
+{
+       int retval;
+       unsigned long flags;
+
+       spin_lock_irqsave(&pdc_lock, flags);
+       retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_PURGE_ALL);
+       spin_unlock_irqrestore(&pdc_lock, flags);
+       return retval;
 }
 
 /**