pdc.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. #ifndef _UAPI_PARISC_PDC_H
  2. #define _UAPI_PARISC_PDC_H
  3. /*
  4. * PDC return values ...
  5. * All PDC calls return a subset of these errors.
  6. */
  7. #define PDC_WARN 3 /* Call completed with a warning */
  8. #define PDC_REQ_ERR_1 2 /* See above */
  9. #define PDC_REQ_ERR_0 1 /* Call would generate a requestor error */
  10. #define PDC_OK 0 /* Call completed successfully */
  11. #define PDC_BAD_PROC -1 /* Called non-existent procedure*/
  12. #define PDC_BAD_OPTION -2 /* Called with non-existent option */
  13. #define PDC_ERROR -3 /* Call could not complete without an error */
  14. #define PDC_NE_MOD -5 /* Module not found */
  15. #define PDC_NE_CELL_MOD -7 /* Cell module not found */
  16. #define PDC_INVALID_ARG -10 /* Called with an invalid argument */
  17. #define PDC_BUS_POW_WARN -12 /* Call could not complete in allowed power budget */
  18. #define PDC_NOT_NARROW -17 /* Narrow mode not supported */
  19. /*
  20. * PDC entry points...
  21. */
  22. #define PDC_POW_FAIL 1 /* perform a power-fail */
  23. #define PDC_POW_FAIL_PREPARE 0 /* prepare for powerfail */
  24. #define PDC_CHASSIS 2 /* PDC-chassis functions */
  25. #define PDC_CHASSIS_DISP 0 /* update chassis display */
  26. #define PDC_CHASSIS_WARN 1 /* return chassis warnings */
  27. #define PDC_CHASSIS_DISPWARN 2 /* update&return chassis status */
  28. #define PDC_RETURN_CHASSIS_INFO 128 /* HVERSION dependent: return chassis LED/LCD info */
  29. #define PDC_PIM 3 /* Get PIM data */
  30. #define PDC_PIM_HPMC 0 /* Transfer HPMC data */
  31. #define PDC_PIM_RETURN_SIZE 1 /* Get Max buffer needed for PIM*/
  32. #define PDC_PIM_LPMC 2 /* Transfer HPMC data */
  33. #define PDC_PIM_SOFT_BOOT 3 /* Transfer Soft Boot data */
  34. #define PDC_PIM_TOC 4 /* Transfer TOC data */
  35. #define PDC_MODEL 4 /* PDC model information call */
  36. #define PDC_MODEL_INFO 0 /* returns information */
  37. #define PDC_MODEL_BOOTID 1 /* set the BOOT_ID */
  38. #define PDC_MODEL_VERSIONS 2 /* returns cpu-internal versions*/
  39. #define PDC_MODEL_SYSMODEL 3 /* return system model info */
  40. #define PDC_MODEL_ENSPEC 4 /* enable specific option */
  41. #define PDC_MODEL_DISPEC 5 /* disable specific option */
  42. #define PDC_MODEL_CPU_ID 6 /* returns cpu-id (only newer machines!) */
  43. #define PDC_MODEL_CAPABILITIES 7 /* returns OS32/OS64-flags */
  44. /* Values for PDC_MODEL_CAPABILITIES non-equivalent virtual aliasing support */
  45. #define PDC_MODEL_OS64 (1 << 0)
  46. #define PDC_MODEL_OS32 (1 << 1)
  47. #define PDC_MODEL_IOPDIR_FDC (1 << 2)
  48. #define PDC_MODEL_NVA_MASK (3 << 4)
  49. #define PDC_MODEL_NVA_SUPPORTED (0 << 4)
  50. #define PDC_MODEL_NVA_SLOW (1 << 4)
  51. #define PDC_MODEL_NVA_UNSUPPORTED (3 << 4)
  52. #define PDC_MODEL_GET_BOOT__OP 8 /* returns boot test options */
  53. #define PDC_MODEL_SET_BOOT__OP 9 /* set boot test options */
  54. #define PA89_INSTRUCTION_SET 0x4 /* capabilities returned */
  55. #define PA90_INSTRUCTION_SET 0x8
  56. #define PDC_CACHE 5 /* return/set cache (& TLB) info*/
  57. #define PDC_CACHE_INFO 0 /* returns information */
  58. #define PDC_CACHE_SET_COH 1 /* set coherence state */
  59. #define PDC_CACHE_RET_SPID 2 /* returns space-ID bits */
  60. #define PDC_HPA 6 /* return HPA of processor */
  61. #define PDC_HPA_PROCESSOR 0
  62. #define PDC_HPA_MODULES 1
  63. #define PDC_COPROC 7 /* Co-Processor (usually FP unit(s)) */
  64. #define PDC_COPROC_CFG 0 /* Co-Processor Cfg (FP unit(s) enabled?) */
  65. #define PDC_IODC 8 /* talk to IODC */
  66. #define PDC_IODC_READ 0 /* read IODC entry point */
  67. /* PDC_IODC_RI_ * INDEX parameter of PDC_IODC_READ */
  68. #define PDC_IODC_RI_DATA_BYTES 0 /* IODC Data Bytes */
  69. /* 1, 2 obsolete - HVERSION dependent*/
  70. #define PDC_IODC_RI_INIT 3 /* Initialize module */
  71. #define PDC_IODC_RI_IO 4 /* Module input/output */
  72. #define PDC_IODC_RI_SPA 5 /* Module input/output */
  73. #define PDC_IODC_RI_CONFIG 6 /* Module input/output */
  74. /* 7 obsolete - HVERSION dependent */
  75. #define PDC_IODC_RI_TEST 8 /* Module input/output */
  76. #define PDC_IODC_RI_TLB 9 /* Module input/output */
  77. #define PDC_IODC_NINIT 2 /* non-destructive init */
  78. #define PDC_IODC_DINIT 3 /* destructive init */
  79. #define PDC_IODC_MEMERR 4 /* check for memory errors */
  80. #define PDC_IODC_INDEX_DATA 0 /* get first 16 bytes from mod IODC */
  81. #define PDC_IODC_BUS_ERROR -4 /* bus error return value */
  82. #define PDC_IODC_INVALID_INDEX -5 /* invalid index return value */
  83. #define PDC_IODC_COUNT -6 /* count is too small */
  84. #define PDC_TOD 9 /* time-of-day clock (TOD) */
  85. #define PDC_TOD_READ 0 /* read TOD */
  86. #define PDC_TOD_WRITE 1 /* write TOD */
  87. #define PDC_STABLE 10 /* stable storage (sprockets) */
  88. #define PDC_STABLE_READ 0
  89. #define PDC_STABLE_WRITE 1
  90. #define PDC_STABLE_RETURN_SIZE 2
  91. #define PDC_STABLE_VERIFY_CONTENTS 3
  92. #define PDC_STABLE_INITIALIZE 4
  93. #define PDC_NVOLATILE 11 /* often not implemented */
  94. #define PDC_ADD_VALID 12 /* Memory validation PDC call */
  95. #define PDC_ADD_VALID_VERIFY 0 /* Make PDC_ADD_VALID verify region */
  96. #define PDC_INSTR 15 /* get instr to invoke PDCE_CHECK() */
  97. #define PDC_PROC 16 /* (sprockets) */
  98. #define PDC_CONFIG 16 /* (sprockets) */
  99. #define PDC_CONFIG_DECONFIG 0
  100. #define PDC_CONFIG_DRECONFIG 1
  101. #define PDC_CONFIG_DRETURN_CONFIG 2
  102. #define PDC_BLOCK_TLB 18 /* manage hardware block-TLB */
  103. #define PDC_BTLB_INFO 0 /* returns parameter */
  104. #define PDC_BTLB_INSERT 1 /* insert BTLB entry */
  105. #define PDC_BTLB_PURGE 2 /* purge BTLB entries */
  106. #define PDC_BTLB_PURGE_ALL 3 /* purge all BTLB entries */
  107. #define PDC_TLB 19 /* manage hardware TLB miss handling */
  108. #define PDC_TLB_INFO 0 /* returns parameter */
  109. #define PDC_TLB_SETUP 1 /* set up miss handling */
  110. #define PDC_MEM 20 /* Manage memory */
  111. #define PDC_MEM_MEMINFO 0
  112. #define PDC_MEM_ADD_PAGE 1
  113. #define PDC_MEM_CLEAR_PDT 2
  114. #define PDC_MEM_READ_PDT 3
  115. #define PDC_MEM_RESET_CLEAR 4
  116. #define PDC_MEM_GOODMEM 5
  117. #define PDC_MEM_TABLE 128 /* Non contig mem map (sprockets) */
  118. #define PDC_MEM_RETURN_ADDRESS_TABLE PDC_MEM_TABLE
  119. #define PDC_MEM_GET_MEMORY_SYSTEM_TABLES_SIZE 131
  120. #define PDC_MEM_GET_MEMORY_SYSTEM_TABLES 132
  121. #define PDC_MEM_GET_PHYSICAL_LOCATION_FROM_MEMORY_ADDRESS 133
  122. #define PDC_MEM_RET_SBE_REPLACED 5 /* PDC_MEM return values */
  123. #define PDC_MEM_RET_DUPLICATE_ENTRY 4
  124. #define PDC_MEM_RET_BUF_SIZE_SMALL 1
  125. #define PDC_MEM_RET_PDT_FULL -11
  126. #define PDC_MEM_RET_INVALID_PHYSICAL_LOCATION ~0ULL
  127. #define PDC_PSW 21 /* Get/Set default System Mask */
  128. #define PDC_PSW_MASK 0 /* Return mask */
  129. #define PDC_PSW_GET_DEFAULTS 1 /* Return defaults */
  130. #define PDC_PSW_SET_DEFAULTS 2 /* Set default */
  131. #define PDC_PSW_ENDIAN_BIT 1 /* set for big endian */
  132. #define PDC_PSW_WIDE_BIT 2 /* set for wide mode */
  133. #define PDC_SYSTEM_MAP 22 /* find system modules */
  134. #define PDC_FIND_MODULE 0
  135. #define PDC_FIND_ADDRESS 1
  136. #define PDC_TRANSLATE_PATH 2
  137. #define PDC_SOFT_POWER 23 /* soft power switch */
  138. #define PDC_SOFT_POWER_INFO 0 /* return info about the soft power switch */
  139. #define PDC_SOFT_POWER_ENABLE 1 /* enable/disable soft power switch */
  140. /* HVERSION dependent */
  141. /* The PDC_MEM_MAP calls */
  142. #define PDC_MEM_MAP 128 /* on s700: return page info */
  143. #define PDC_MEM_MAP_HPA 0 /* returns hpa of a module */
  144. #define PDC_EEPROM 129 /* EEPROM access */
  145. #define PDC_EEPROM_READ_WORD 0
  146. #define PDC_EEPROM_WRITE_WORD 1
  147. #define PDC_EEPROM_READ_BYTE 2
  148. #define PDC_EEPROM_WRITE_BYTE 3
  149. #define PDC_EEPROM_EEPROM_PASSWORD -1000
  150. #define PDC_NVM 130 /* NVM (non-volatile memory) access */
  151. #define PDC_NVM_READ_WORD 0
  152. #define PDC_NVM_WRITE_WORD 1
  153. #define PDC_NVM_READ_BYTE 2
  154. #define PDC_NVM_WRITE_BYTE 3
  155. #define PDC_SEED_ERROR 132 /* (sprockets) */
  156. #define PDC_IO 135 /* log error info, reset IO system */
  157. #define PDC_IO_READ_AND_CLEAR_ERRORS 0
  158. #define PDC_IO_RESET 1
  159. #define PDC_IO_RESET_DEVICES 2
  160. /* sets bits 6&7 (little endian) of the HcControl Register */
  161. #define PDC_IO_USB_SUSPEND 0xC000000000000000
  162. #define PDC_IO_EEPROM_IO_ERR_TABLE_FULL -5 /* return value */
  163. #define PDC_IO_NO_SUSPEND -6 /* return value */
  164. #define PDC_BROADCAST_RESET 136 /* reset all processors */
  165. #define PDC_DO_RESET 0 /* option: perform a broadcast reset */
  166. #define PDC_DO_FIRM_TEST_RESET 1 /* Do broadcast reset with bitmap */
  167. #define PDC_BR_RECONFIGURATION 2 /* reset w/reconfiguration */
  168. #define PDC_FIRM_TEST_MAGIC 0xab9ec36fUL /* for this reboot only */
  169. #define PDC_LAN_STATION_ID 138 /* Hversion dependent mechanism for */
  170. #define PDC_LAN_STATION_ID_READ 0 /* getting the lan station address */
  171. #define PDC_LAN_STATION_ID_SIZE 6
  172. #define PDC_CHECK_RANGES 139 /* (sprockets) */
  173. #define PDC_NV_SECTIONS 141 /* (sprockets) */
  174. #define PDC_PERFORMANCE 142 /* performance monitoring */
  175. #define PDC_SYSTEM_INFO 143 /* system information */
  176. #define PDC_SYSINFO_RETURN_INFO_SIZE 0
  177. #define PDC_SYSINFO_RRETURN_SYS_INFO 1
  178. #define PDC_SYSINFO_RRETURN_ERRORS 2
  179. #define PDC_SYSINFO_RRETURN_WARNINGS 3
  180. #define PDC_SYSINFO_RETURN_REVISIONS 4
  181. #define PDC_SYSINFO_RRETURN_DIAGNOSE 5
  182. #define PDC_SYSINFO_RRETURN_HV_DIAGNOSE 1005
  183. #define PDC_RDR 144 /* (sprockets) */
  184. #define PDC_RDR_READ_BUFFER 0
  185. #define PDC_RDR_READ_SINGLE 1
  186. #define PDC_RDR_WRITE_SINGLE 2
  187. #define PDC_INTRIGUE 145 /* (sprockets) */
  188. #define PDC_INTRIGUE_WRITE_BUFFER 0
  189. #define PDC_INTRIGUE_GET_SCRATCH_BUFSIZE 1
  190. #define PDC_INTRIGUE_START_CPU_COUNTERS 2
  191. #define PDC_INTRIGUE_STOP_CPU_COUNTERS 3
  192. #define PDC_STI 146 /* STI access */
  193. /* same as PDC_PCI_XXX values (see below) */
  194. /* Legacy PDC definitions for same stuff */
  195. #define PDC_PCI_INDEX 147
  196. #define PDC_PCI_INTERFACE_INFO 0
  197. #define PDC_PCI_SLOT_INFO 1
  198. #define PDC_PCI_INFLIGHT_BYTES 2
  199. #define PDC_PCI_READ_CONFIG 3
  200. #define PDC_PCI_WRITE_CONFIG 4
  201. #define PDC_PCI_READ_PCI_IO 5
  202. #define PDC_PCI_WRITE_PCI_IO 6
  203. #define PDC_PCI_READ_CONFIG_DELAY 7
  204. #define PDC_PCI_UPDATE_CONFIG_DELAY 8
  205. #define PDC_PCI_PCI_PATH_TO_PCI_HPA 9
  206. #define PDC_PCI_PCI_HPA_TO_PCI_PATH 10
  207. #define PDC_PCI_PCI_PATH_TO_PCI_BUS 11
  208. #define PDC_PCI_PCI_RESERVED 12
  209. #define PDC_PCI_PCI_INT_ROUTE_SIZE 13
  210. #define PDC_PCI_GET_INT_TBL_SIZE PDC_PCI_PCI_INT_ROUTE_SIZE
  211. #define PDC_PCI_PCI_INT_ROUTE 14
  212. #define PDC_PCI_GET_INT_TBL PDC_PCI_PCI_INT_ROUTE
  213. #define PDC_PCI_READ_MON_TYPE 15
  214. #define PDC_PCI_WRITE_MON_TYPE 16
  215. /* Get SCSI Interface Card info: SDTR, SCSI ID, mode (SE vs LVD) */
  216. #define PDC_INITIATOR 163
  217. #define PDC_GET_INITIATOR 0
  218. #define PDC_SET_INITIATOR 1
  219. #define PDC_DELETE_INITIATOR 2
  220. #define PDC_RETURN_TABLE_SIZE 3
  221. #define PDC_RETURN_TABLE 4
  222. #define PDC_LINK 165 /* (sprockets) */
  223. #define PDC_LINK_PCI_ENTRY_POINTS 0 /* list (Arg1) = 0 */
  224. #define PDC_LINK_USB_ENTRY_POINTS 1 /* list (Arg1) = 1 */
  225. /* cl_class
  226. * page 3-33 of IO-Firmware ARS
  227. * IODC ENTRY_INIT(Search first) RET[1]
  228. */
  229. #define CL_NULL 0 /* invalid */
  230. #define CL_RANDOM 1 /* random access (as disk) */
  231. #define CL_SEQU 2 /* sequential access (as tape) */
  232. #define CL_DUPLEX 7 /* full-duplex point-to-point (RS-232, Net) */
  233. #define CL_KEYBD 8 /* half-duplex console (HIL Keyboard) */
  234. #define CL_DISPL 9 /* half-duplex console (display) */
  235. #define CL_FC 10 /* FiberChannel access media */
  236. /* IODC ENTRY_INIT() */
  237. #define ENTRY_INIT_SRCH_FRST 2
  238. #define ENTRY_INIT_SRCH_NEXT 3
  239. #define ENTRY_INIT_MOD_DEV 4
  240. #define ENTRY_INIT_DEV 5
  241. #define ENTRY_INIT_MOD 6
  242. #define ENTRY_INIT_MSG 9
  243. /* IODC ENTRY_IO() */
  244. #define ENTRY_IO_BOOTIN 0
  245. #define ENTRY_IO_BOOTOUT 1
  246. #define ENTRY_IO_CIN 2
  247. #define ENTRY_IO_COUT 3
  248. #define ENTRY_IO_CLOSE 4
  249. #define ENTRY_IO_GETMSG 9
  250. #define ENTRY_IO_BBLOCK_IN 16
  251. #define ENTRY_IO_BBLOCK_OUT 17
  252. /* IODC ENTRY_SPA() */
  253. /* IODC ENTRY_CONFIG() */
  254. /* IODC ENTRY_TEST() */
  255. /* IODC ENTRY_TLB() */
  256. /* constants for OS (NVM...) */
  257. #define OS_ID_NONE 0 /* Undefined OS ID */
  258. #define OS_ID_HPUX 1 /* HP-UX OS */
  259. #define OS_ID_MPEXL 2 /* MPE XL OS */
  260. #define OS_ID_OSF 3 /* OSF OS */
  261. #define OS_ID_HPRT 4 /* HP-RT OS */
  262. #define OS_ID_NOVEL 5 /* NOVELL OS */
  263. #define OS_ID_LINUX 6 /* Linux */
  264. /* constants for PDC_CHASSIS */
  265. #define OSTAT_OFF 0
  266. #define OSTAT_FLT 1
  267. #define OSTAT_TEST 2
  268. #define OSTAT_INIT 3
  269. #define OSTAT_SHUT 4
  270. #define OSTAT_WARN 5
  271. #define OSTAT_RUN 6
  272. #define OSTAT_ON 7
  273. /* Page Zero constant offsets used by the HPMC handler */
  274. #define BOOT_CONSOLE_HPA_OFFSET 0x3c0
  275. #define BOOT_CONSOLE_SPA_OFFSET 0x3c4
  276. #define BOOT_CONSOLE_PATH_OFFSET 0x3a8
  277. /* size of the pdc_result buffer for firmware.c */
  278. #define NUM_PDC_RESULT 32
  279. #if !defined(__ASSEMBLY__)
  280. #include <linux/types.h>
  281. /* flags of the device_path */
  282. #define PF_AUTOBOOT 0x80
  283. #define PF_AUTOSEARCH 0x40
  284. #define PF_TIMER 0x0F
  285. struct device_path { /* page 1-69 */
  286. unsigned char flags; /* flags see above! */
  287. unsigned char bc[6]; /* bus converter routing info */
  288. unsigned char mod;
  289. unsigned int layers[6];/* device-specific layer-info */
  290. } __attribute__((aligned(8))) ;
  291. struct pz_device {
  292. struct device_path dp; /* see above */
  293. /* struct iomod *hpa; */
  294. unsigned int hpa; /* HPA base address */
  295. /* char *spa; */
  296. unsigned int spa; /* SPA base address */
  297. /* int (*iodc_io)(struct iomod*, ...); */
  298. unsigned int iodc_io; /* device entry point */
  299. short pad; /* reserved */
  300. unsigned short cl_class;/* see below */
  301. } __attribute__((aligned(8))) ;
  302. struct zeropage {
  303. /* [0x000] initialize vectors (VEC) */
  304. unsigned int vec_special; /* must be zero */
  305. /* int (*vec_pow_fail)(void);*/
  306. unsigned int vec_pow_fail; /* power failure handler */
  307. /* int (*vec_toc)(void); */
  308. unsigned int vec_toc;
  309. unsigned int vec_toclen;
  310. /* int (*vec_rendz)(void); */
  311. unsigned int vec_rendz;
  312. int vec_pow_fail_flen;
  313. int vec_pad[10];
  314. /* [0x040] reserved processor dependent */
  315. int pad0[112];
  316. /* [0x200] reserved */
  317. int pad1[84];
  318. /* [0x350] memory configuration (MC) */
  319. int memc_cont; /* contiguous mem size (bytes) */
  320. int memc_phsize; /* physical memory size */
  321. int memc_adsize; /* additional mem size, bytes of SPA space used by PDC */
  322. unsigned int mem_pdc_hi; /* used for 64-bit */
  323. /* [0x360] various parameters for the boot-CPU */
  324. /* unsigned int *mem_booterr[8]; */
  325. unsigned int mem_booterr[8]; /* ptr to boot errors */
  326. unsigned int mem_free; /* first location, where OS can be loaded */
  327. /* struct iomod *mem_hpa; */
  328. unsigned int mem_hpa; /* HPA of the boot-CPU */
  329. /* int (*mem_pdc)(int, ...); */
  330. unsigned int mem_pdc; /* PDC entry point */
  331. unsigned int mem_10msec; /* number of clock ticks in 10msec */
  332. /* [0x390] initial memory module (IMM) */
  333. /* struct iomod *imm_hpa; */
  334. unsigned int imm_hpa; /* HPA of the IMM */
  335. int imm_soft_boot; /* 0 = was hard boot, 1 = was soft boot */
  336. unsigned int imm_spa_size; /* SPA size of the IMM in bytes */
  337. unsigned int imm_max_mem; /* bytes of mem in IMM */
  338. /* [0x3A0] boot console, display device and keyboard */
  339. struct pz_device mem_cons; /* description of console device */
  340. struct pz_device mem_boot; /* description of boot device */
  341. struct pz_device mem_kbd; /* description of keyboard device */
  342. /* [0x430] reserved */
  343. int pad430[116];
  344. /* [0x600] processor dependent */
  345. __u32 pad600[1];
  346. __u32 proc_sti; /* pointer to STI ROM */
  347. __u32 pad608[126];
  348. };
  349. #endif /* !defined(__ASSEMBLY__) */
  350. #endif /* _UAPI_PARISC_PDC_H */