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