Skip to content

Commit

Permalink
parisc: firmware: Simplify calling non-PA20 functions
Browse files Browse the repository at this point in the history
Instead of usig #ifdefs, simply return PDC_BAD_PROC for functions
which aren't available on 64-bit CPUs.

Signed-off-by: Helge Deller <deller@gmx.de>
  • Loading branch information
Helge Deller committed Sep 7, 2023
1 parent 4695e45 commit 3756597
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 0 additions & 2 deletions arch/parisc/include/asm/pdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ int pdc_model_capabilities(unsigned long *capabilities);
int pdc_model_platform_info(char *orig_prod_num, char *current_prod_num, char *serial_no);
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);
int pdc_pim_toc20(struct pdc_toc_pim_20 *ret);
int pdc_lan_station_id(char *lan_addr, unsigned long net_hpa);
Expand Down
14 changes: 12 additions & 2 deletions arch/parisc/kernel/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ int pdc_spaceid_bits(unsigned long *space_bits)
return retval;
}

#ifndef CONFIG_PA20
/**
* pdc_btlb_info - Return block TLB information.
* @btlb: The return buffer.
Expand All @@ -699,6 +698,9 @@ int pdc_btlb_info(struct pdc_btlb_info *btlb)
int retval;
unsigned long flags;

if (IS_ENABLED(CONFIG_PA20))
return PDC_BAD_PROC;

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));
Expand All @@ -716,6 +718,9 @@ int pdc_btlb_insert(unsigned long long vpage, unsigned long physpage, unsigned l
int retval;
unsigned long flags;

if (IS_ENABLED(CONFIG_PA20))
return PDC_BAD_PROC;

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);
Expand All @@ -728,6 +733,9 @@ int pdc_btlb_purge_all(void)
int retval;
unsigned long flags;

if (IS_ENABLED(CONFIG_PA20))
return PDC_BAD_PROC;

spin_lock_irqsave(&pdc_lock, flags);
retval = mem_pdc_call(PDC_BLOCK_TLB, PDC_BTLB_PURGE_ALL);
spin_unlock_irqrestore(&pdc_lock, flags);
Expand All @@ -752,6 +760,9 @@ int pdc_mem_map_hpa(struct pdc_memory_map *address,
int retval;
unsigned long flags;

if (IS_ENABLED(CONFIG_PA20))
return PDC_BAD_PROC;

spin_lock_irqsave(&pdc_lock, flags);
memcpy(pdc_result2, mod_path, sizeof(*mod_path));
retval = mem_pdc_call(PDC_MEM_MAP, PDC_MEM_MAP_HPA, __pa(pdc_result),
Expand All @@ -761,7 +772,6 @@ int pdc_mem_map_hpa(struct pdc_memory_map *address,

return retval;
}
#endif /* !CONFIG_PA20 */

/**
* pdc_lan_station_id - Get the LAN address.
Expand Down

0 comments on commit 3756597

Please sign in to comment.