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