parisc: BTLB: Add BTLB insert and purge firmware function wrappers

Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
Helge Deller 2023-09-07 08:06:37 +02:00
parent eda205211a
commit 510610f96d
2 changed files with 36 additions and 9 deletions

View File

@ -46,6 +46,9 @@ int pdc_cache_info(struct pdc_cache_info *cache);
int pdc_spaceid_bits(unsigned long *space_bits); int pdc_spaceid_bits(unsigned long *space_bits);
#ifndef CONFIG_PA20 #ifndef CONFIG_PA20
int pdc_btlb_info(struct pdc_btlb_info *btlb); 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); int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path);
#endif /* !CONFIG_PA20 */ #endif /* !CONFIG_PA20 */
int pdc_pim_toc11(struct pdc_toc_pim_11 *ret); int pdc_pim_toc11(struct pdc_toc_pim_11 *ret);

View File

@ -696,18 +696,42 @@ int pdc_spaceid_bits(unsigned long *space_bits)
*/ */
int pdc_btlb_info(struct pdc_btlb_info *btlb) int pdc_btlb_info(struct pdc_btlb_info *btlb)
{ {
int retval; int retval;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&pdc_lock, flags); spin_lock_irqsave(&pdc_lock, flags);
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0); retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_INFO, __pa(pdc_result), 0);
memcpy(btlb, pdc_result, sizeof(*btlb)); memcpy(btlb, pdc_result, sizeof(*btlb));
spin_unlock_irqrestore(&pdc_lock, flags); spin_unlock_irqrestore(&pdc_lock, flags);
if(retval < 0) { if(retval < 0) {
btlb->max_size = 0; btlb->max_size = 0;
} }
return retval; 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;
} }
/** /**