blob: 19bb2e46cd36cb942e275cc660f63d34fc1f0e09 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _PARISC_PDC_H
3#define _PARISC_PDC_H
4
David Howells70c1674f2012-10-16 21:28:05 +01005#include <uapi/asm/pdc.h>
Kyle McMartin6c86cb82008-07-28 22:52:18 -04006
Kyle McMartin218c9982007-10-18 00:03:34 -07007#if !defined(__ASSEMBLY__)
Kyle McMartin218c9982007-10-18 00:03:34 -07008
Helge Dellerf5213b22017-08-20 10:52:22 +02009extern int parisc_narrow_firmware;
10
Linus Torvalds1da177e2005-04-16 15:20:36 -070011extern int pdc_type;
Helge Dellerc9c28772017-05-11 22:24:15 +020012extern unsigned long parisc_cell_num; /* cell number the CPU runs on (PAT) */
13extern unsigned long parisc_cell_loc; /* cell location of CPU (PAT) */
Helge Dellere543b3a2018-10-19 22:13:49 +020014extern unsigned long parisc_pat_pdc_cap; /* PDC capabilities (PAT) */
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
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 Torvalds1da177e2005-04-16 15:20:36 -070022void pdc_console_init(void); /* in pdc_console.c */
23void pdc_console_restart(void);
24
25void setup_pdc(void); /* in inventory.c */
26
27/* wrapper-functions from pdc.c */
28
29int pdc_add_valid(unsigned long address);
Helge Deller77089c52017-09-17 21:15:09 +020030int pdc_instr(unsigned int *instr);
Linus Torvalds1da177e2005-04-16 15:20:36 -070031int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len);
32int pdc_chassis_disp(unsigned long disp);
Thibaut Varene8ffaeaf2006-05-03 17:27:35 -060033int pdc_chassis_warn(unsigned long *warn);
Linus Torvalds1da177e2005-04-16 15:20:36 -070034int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info);
Kyle McMartin24b574d2008-07-29 00:09:22 -040035int pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info);
Linus Torvalds1da177e2005-04-16 15:20:36 -070036int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index,
37 void *iodc_data, unsigned int iodc_data_size);
38int 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 McMartin218c9982007-10-18 00:03:34 -070040int pdc_system_map_find_addrs(struct pdc_system_map_addr_info *pdc_addr_info,
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 long mod_index, long addr_index);
42int pdc_model_info(struct pdc_model *model);
43int pdc_model_sysmodel(char *name);
44int pdc_model_cpuid(unsigned long *cpu_id);
45int pdc_model_versions(unsigned long *versions, int id);
46int pdc_model_capabilities(unsigned long *capabilities);
Helge Deller8207d4e2019-02-08 18:28:13 +010047int pdc_model_platform_info(char *orig_prod_num, char *current_prod_num, char *serial_no);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048int pdc_cache_info(struct pdc_cache_info *cache);
Kyle McMartina9d2d382006-06-16 18:20:00 -040049int pdc_spaceid_bits(unsigned long *space_bits);
Linus Torvalds1da177e2005-04-16 15:20:36 -070050#ifndef CONFIG_PA20
51int pdc_btlb_info(struct pdc_btlb_info *btlb);
52int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path);
53#endif /* !CONFIG_PA20 */
54int pdc_lan_station_id(char *lan_addr, unsigned long net_hpa);
55
56int pdc_stable_read(unsigned long staddr, void *memaddr, unsigned long count);
57int pdc_stable_write(unsigned long staddr, void *memaddr, unsigned long count);
58int pdc_stable_get_size(unsigned long *size);
59int pdc_stable_verify_contents(void);
60int pdc_stable_initialize(void);
61
62int pdc_pci_irt_size(unsigned long *num_entries, unsigned long hpa);
63int pdc_pci_irt(unsigned long num_entries, unsigned long hpa, void *tbl);
64
65int pdc_get_initiator(struct hardware_path *, struct pdc_initiator *);
66int pdc_tod_read(struct pdc_tod *tod);
67int pdc_tod_set(unsigned long sec, unsigned long usec);
68
Helge Dellerc9c28772017-05-11 22:24:15 +020069void pdc_pdt_init(void); /* in pdt.c */
70int pdc_mem_pdt_info(struct pdc_mem_retinfo *rinfo);
71int pdc_mem_pdt_read_entries(struct pdc_mem_read_pdt *rpdt_read,
72 unsigned long *pdt_entries_ptr);
Helge Deller513e7ec2007-01-28 15:09:20 +010073#ifdef CONFIG_64BIT
Linus Torvalds1da177e2005-04-16 15:20:36 -070074int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr,
75 struct pdc_memory_table *tbl, unsigned long entries);
76#endif
77
78void set_firmware_width(void);
Kyle McMartin24b574d2008-07-29 00:09:22 -040079void set_firmware_width_unlocked(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070080int pdc_do_firm_test_reset(unsigned long ftc_bitmap);
81int pdc_do_reset(void);
82int pdc_soft_power_info(unsigned long *power_reg);
83int pdc_soft_power_button(int sw_control);
84void pdc_io_reset(void);
85void pdc_io_reset_devices(void);
86int pdc_iodc_getc(void);
Kyle McMartinef1afd42008-02-18 23:34:34 -080087int pdc_iodc_print(const unsigned char *str, unsigned count);
Linus Torvalds1da177e2005-04-16 15:20:36 -070088
89void pdc_emergency_unlock(void);
90int pdc_sti_call(unsigned long func, unsigned long flags,
91 unsigned long inptr, unsigned long outputr,
92 unsigned long glob_cfg);
93
Kyle McMartinc1a7a7552006-06-26 11:28:09 -040094static 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 McMartin218c9982007-10-18 00:03:34 -0700106
Kyle McMartin218c9982007-10-18 00:03:34 -0700107#endif /* !defined(__ASSEMBLY__) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108#endif /* _PARISC_PDC_H */