pdc.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _PARISC_PDC_H
  3. #define _PARISC_PDC_H
  4. #include <uapi/asm/pdc.h>
  5. #if !defined(__ASSEMBLY__)
  6. extern int parisc_narrow_firmware;
  7. extern int pdc_type;
  8. extern unsigned long parisc_cell_num; /* cell number the CPU runs on (PAT) */
  9. extern unsigned long parisc_cell_loc; /* cell location of CPU (PAT) */
  10. extern unsigned long parisc_pat_pdc_cap; /* PDC capabilities (PAT) */
  11. /* Values for pdc_type */
  12. #define PDC_TYPE_ILLEGAL -1
  13. #define PDC_TYPE_PAT 0 /* 64-bit PAT-PDC */
  14. #define PDC_TYPE_SYSTEM_MAP 1 /* 32-bit, but supports PDC_SYSTEM_MAP */
  15. #define PDC_TYPE_SNAKE 2 /* Doesn't support SYSTEM_MAP */
  16. void setup_pdc(void); /* in inventory.c */
  17. /* wrapper-functions from pdc.c */
  18. int pdc_add_valid(unsigned long address);
  19. int pdc_instr(unsigned int *instr);
  20. int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len);
  21. int pdc_chassis_disp(unsigned long disp);
  22. int pdc_chassis_warn(unsigned long *warn);
  23. int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info);
  24. int pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info);
  25. int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index,
  26. void *iodc_data, unsigned int iodc_data_size);
  27. int pdc_system_map_find_mods(struct pdc_system_map_mod_info *pdc_mod_info,
  28. struct pdc_module_path *mod_path, long mod_index);
  29. int pdc_system_map_find_addrs(struct pdc_system_map_addr_info *pdc_addr_info,
  30. long mod_index, long addr_index);
  31. int pdc_model_info(struct pdc_model *model);
  32. int pdc_model_sysmodel(char *name);
  33. int pdc_model_cpuid(unsigned long *cpu_id);
  34. int pdc_model_versions(unsigned long *versions, int id);
  35. int pdc_model_capabilities(unsigned long *capabilities);
  36. int pdc_model_platform_info(char *orig_prod_num, char *current_prod_num, char *serial_no);
  37. int pdc_cache_info(struct pdc_cache_info *cache);
  38. int pdc_spaceid_bits(unsigned long *space_bits);
  39. #ifndef CONFIG_PA20
  40. int pdc_btlb_info(struct pdc_btlb_info *btlb);
  41. int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path);
  42. #endif /* !CONFIG_PA20 */
  43. int pdc_pim_toc11(struct pdc_toc_pim_11 *ret);
  44. int pdc_pim_toc20(struct pdc_toc_pim_20 *ret);
  45. int pdc_lan_station_id(char *lan_addr, unsigned long net_hpa);
  46. int pdc_stable_read(unsigned long staddr, void *memaddr, unsigned long count);
  47. int pdc_stable_write(unsigned long staddr, void *memaddr, unsigned long count);
  48. int pdc_stable_get_size(unsigned long *size);
  49. int pdc_stable_verify_contents(void);
  50. int pdc_stable_initialize(void);
  51. int pdc_pci_irt_size(unsigned long *num_entries, unsigned long hpa);
  52. int pdc_pci_irt(unsigned long num_entries, unsigned long hpa, void *tbl);
  53. int pdc_get_initiator(struct hardware_path *, struct pdc_initiator *);
  54. int pdc_tod_read(struct pdc_tod *tod);
  55. int pdc_tod_set(unsigned long sec, unsigned long usec);
  56. void pdc_pdt_init(void); /* in pdt.c */
  57. int pdc_mem_pdt_info(struct pdc_mem_retinfo *rinfo);
  58. int pdc_mem_pdt_read_entries(struct pdc_mem_read_pdt *rpdt_read,
  59. unsigned long *pdt_entries_ptr);
  60. #ifdef CONFIG_64BIT
  61. int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr,
  62. struct pdc_memory_table *tbl, unsigned long entries);
  63. #endif
  64. void set_firmware_width(void);
  65. void set_firmware_width_unlocked(void);
  66. int pdc_do_firm_test_reset(unsigned long ftc_bitmap);
  67. int pdc_do_reset(void);
  68. int pdc_soft_power_info(unsigned long *power_reg);
  69. int pdc_soft_power_button(int sw_control);
  70. int pdc_soft_power_button_panic(int sw_control);
  71. void pdc_io_reset(void);
  72. void pdc_io_reset_devices(void);
  73. int pdc_iodc_getc(void);
  74. int pdc_iodc_print(const unsigned char *str, unsigned count);
  75. void pdc_emergency_unlock(void);
  76. int pdc_sti_call(unsigned long func, unsigned long flags,
  77. unsigned long inptr, unsigned long outputr,
  78. unsigned long glob_cfg);
  79. int __pdc_cpu_rendezvous(void);
  80. void pdc_cpu_rendezvous_lock(void);
  81. void pdc_cpu_rendezvous_unlock(void);
  82. static inline char * os_id_to_string(u16 os_id) {
  83. switch(os_id) {
  84. case OS_ID_NONE: return "No OS";
  85. case OS_ID_HPUX: return "HP-UX";
  86. case OS_ID_MPEXL: return "MPE-iX";
  87. case OS_ID_OSF: return "OSF";
  88. case OS_ID_HPRT: return "HP-RT";
  89. case OS_ID_NOVEL: return "Novell Netware";
  90. case OS_ID_LINUX: return "Linux";
  91. default: return "Unknown";
  92. }
  93. }
  94. #endif /* !defined(__ASSEMBLY__) */
  95. #endif /* _PARISC_PDC_H */