pdc.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _UAPI_PARISC_PDC_H
  3. #define _UAPI_PARISC_PDC_H
  4. /*
  5. * PDC return values ...
  6. * All PDC calls return a subset of these errors.
  7. */
  8. #define PDC_WARN 3 /* Call completed with a warning */
  9. #define PDC_REQ_ERR_1 2 /* See above */
  10. #define PDC_REQ_ERR_0 1 /* Call would generate a requestor error */
  11. #define PDC_OK 0 /* Call completed successfully */
  12. #define PDC_BAD_PROC -1 /* Called non-existent procedure*/
  13. #define PDC_BAD_OPTION -2 /* Called with non-existent option */
  14. #define PDC_ERROR -3 /* Call could not complete without an error */
  15. #define PDC_NE_MOD -5 /* Module not found */
  16. #define PDC_NE_CELL_MOD -7 /* Cell module not found */
  17. #define PDC_NE_BOOTDEV -9 /* Cannot locate a console device or boot device */
  18. #define PDC_INVALID_ARG -10 /* Called with an invalid argument */
  19. #define PDC_BUS_POW_WARN -12 /* Call could not complete in allowed power budget */
  20. #define PDC_NOT_NARROW -17 /* Narrow mode not supported */
  21. /*
  22. * PDC entry points...
  23. */
  24. #define PDC_POW_FAIL 1 /* perform a power-fail */
  25. #define PDC_POW_FAIL_PREPARE 0 /* prepare for powerfail */
  26. #define PDC_CHASSIS 2 /* PDC-chassis functions */
  27. #define PDC_CHASSIS_DISP 0 /* update chassis display */
  28. #define PDC_CHASSIS_WARN 1 /* return chassis warnings */
  29. #define PDC_CHASSIS_DISPWARN 2 /* update&return chassis status */
  30. #define PDC_RETURN_CHASSIS_INFO 128 /* HVERSION dependent: return chassis LED/LCD info */
  31. #define PDC_PIM 3 /* Get PIM data */
  32. #define PDC_PIM_HPMC 0 /* Transfer HPMC data */
  33. #define PDC_PIM_RETURN_SIZE 1 /* Get Max buffer needed for PIM*/
  34. #define PDC_PIM_LPMC 2 /* Transfer HPMC data */
  35. #define PDC_PIM_SOFT_BOOT 3 /* Transfer Soft Boot data */
  36. #define PDC_PIM_TOC 4 /* Transfer TOC data */
  37. #define PDC_MODEL 4 /* PDC model information call */
  38. #define PDC_MODEL_INFO 0 /* returns information */
  39. #define PDC_MODEL_BOOTID 1 /* set the BOOT_ID */
  40. #define PDC_MODEL_VERSIONS 2 /* returns cpu-internal versions*/
  41. #define PDC_MODEL_SYSMODEL 3 /* return system model info */
  42. #define PDC_MODEL_ENSPEC 4 /* enable specific option */
  43. #define PDC_MODEL_DISPEC 5 /* disable specific option */
  44. #define PDC_MODEL_CPU_ID 6 /* returns cpu-id (only newer machines!) */
  45. #define PDC_MODEL_CAPABILITIES 7 /* returns OS32/OS64-flags */
  46. /* Values for PDC_MODEL_CAPABILITIES non-equivalent virtual aliasing support */
  47. #define PDC_MODEL_OS64 (1 << 0)
  48. #define PDC_MODEL_OS32 (1 << 1)
  49. #define PDC_MODEL_IOPDIR_FDC (1 << 2)
  50. #define PDC_MODEL_NVA_MASK (3 << 4)
  51. #define PDC_MODEL_NVA_SUPPORTED (0 << 4)
  52. #define PDC_MODEL_NVA_SLOW (1 << 4)
  53. #define PDC_MODEL_NVA_UNSUPPORTED (3 << 4)
  54. #define PDC_MODEL_GET_BOOT__OP 8 /* returns boot test options */
  55. #define PDC_MODEL_SET_BOOT__OP 9 /* set boot test options */
  56. #define PDC_MODEL_GET_PLATFORM_INFO 10 /* returns platform info */
  57. #define PDC_MODEL_GET_INSTALL_KERNEL 11 /* returns kernel for installation */
  58. #define PA89_INSTRUCTION_SET 0x4 /* capabilities returned */
  59. #define PA90_INSTRUCTION_SET 0x8
  60. #define PDC_CACHE 5 /* return/set cache (& TLB) info*/
  61. #define PDC_CACHE_INFO 0 /* returns information */
  62. #define PDC_CACHE_SET_COH 1 /* set coherence state */
  63. #define PDC_CACHE_RET_SPID 2 /* returns space-ID bits */
  64. #define PDC_HPA 6 /* return HPA of processor */
  65. #define PDC_HPA_PROCESSOR 0
  66. #define PDC_HPA_MODULES 1
  67. #define PDC_COPROC 7 /* Co-Processor (usually FP unit(s)) */
  68. #define PDC_COPROC_CFG 0 /* Co-Processor Cfg (FP unit(s) enabled?) */
  69. #define PDC_IODC 8 /* talk to IODC */
  70. #define PDC_IODC_READ 0 /* read IODC entry point */
  71. /* PDC_IODC_RI_ * INDEX parameter of PDC_IODC_READ */
  72. #define PDC_IODC_RI_DATA_BYTES 0 /* IODC Data Bytes */
  73. /* 1, 2 obsolete - HVERSION dependent*/
  74. #define PDC_IODC_RI_INIT 3 /* Initialize module */
  75. #define PDC_IODC_RI_IO 4 /* Module input/output */
  76. #define PDC_IODC_RI_SPA 5 /* Module input/output */
  77. #define PDC_IODC_RI_CONFIG 6 /* Module input/output */
  78. /* 7 obsolete - HVERSION dependent */
  79. #define PDC_IODC_RI_TEST 8 /* Module input/output */
  80. #define PDC_IODC_RI_TLB 9 /* Module input/output */
  81. #define PDC_IODC_NINIT 2 /* non-destructive init */
  82. #define PDC_IODC_DINIT 3 /* destructive init */
  83. #define PDC_IODC_MEMERR 4 /* check for memory errors */
  84. #define PDC_IODC_INDEX_DATA 0 /* get first 16 bytes from mod IODC */
  85. #define PDC_IODC_BUS_ERROR -4 /* bus error return value */
  86. #define PDC_IODC_INVALID_INDEX -5 /* invalid index return value */
  87. #define PDC_IODC_COUNT -6 /* count is too small */
  88. #define PDC_TOD 9 /* time-of-day clock (TOD) */
  89. #define PDC_TOD_READ 0 /* read TOD */
  90. #define PDC_TOD_WRITE 1 /* write TOD */
  91. #define PDC_TOD_CALIBRATE 2 /* calibrate timers */
  92. #define PDC_STABLE 10 /* stable storage (sprockets) */
  93. #define PDC_STABLE_READ 0
  94. #define PDC_STABLE_WRITE 1
  95. #define PDC_STABLE_RETURN_SIZE 2
  96. #define PDC_STABLE_VERIFY_CONTENTS 3
  97. #define PDC_STABLE_INITIALIZE 4
  98. #define PDC_NVOLATILE 11 /* often not implemented */
  99. #define PDC_NVOLATILE_READ 0
  100. #define PDC_NVOLATILE_WRITE 1
  101. #define PDC_NVOLATILE_RETURN_SIZE 2
  102. #define PDC_NVOLATILE_VERIFY_CONTENTS 3
  103. #define PDC_NVOLATILE_INITIALIZE 4
  104. #define PDC_ADD_VALID 12 /* Memory validation PDC call */
  105. #define PDC_ADD_VALID_VERIFY 0 /* Make PDC_ADD_VALID verify region */
  106. #define PDC_DEBUG 14 /* Obsolete */
  107. #define PDC_INSTR 15 /* get instr to invoke PDCE_CHECK() */
  108. #define PDC_PROC 16 /* (sprockets) */
  109. #define PDC_CONFIG 17 /* (sprockets) */
  110. #define PDC_CONFIG_DECONFIG 0
  111. #define PDC_CONFIG_DRECONFIG 1
  112. #define PDC_CONFIG_DRETURN_CONFIG 2
  113. #define PDC_BLOCK_TLB 18 /* manage hardware block-TLB */
  114. #define PDC_BTLB_INFO 0 /* returns parameter */
  115. #define PDC_BTLB_INSERT 1 /* insert BTLB entry */
  116. #define PDC_BTLB_PURGE 2 /* purge BTLB entries */
  117. #define PDC_BTLB_PURGE_ALL 3 /* purge all BTLB entries */
  118. #define PDC_TLB 19 /* manage hardware TLB miss handling */
  119. #define PDC_TLB_INFO 0 /* returns parameter */
  120. #define PDC_TLB_SETUP 1 /* set up miss handling */
  121. #define PDC_MEM 20 /* Manage memory */
  122. #define PDC_MEM_MEMINFO 0 /* Return PDT info */
  123. #define PDC_MEM_ADD_PAGE 1 /* Add page to PDT */
  124. #define PDC_MEM_CLEAR_PDT 2 /* Clear PDT */
  125. #define PDC_MEM_READ_PDT 3 /* Read PDT entry */
  126. #define PDC_MEM_RESET_CLEAR 4 /* Reset PDT clear flag */
  127. #define PDC_MEM_GOODMEM 5 /* Set good_mem value */
  128. #define PDC_MEM_TABLE 128 /* Non contig mem map (sprockets) */
  129. #define PDC_MEM_RETURN_ADDRESS_TABLE PDC_MEM_TABLE
  130. #define PDC_MEM_GET_MEMORY_SYSTEM_TABLES_SIZE 131
  131. #define PDC_MEM_GET_MEMORY_SYSTEM_TABLES 132
  132. #define PDC_MEM_GET_PHYSICAL_LOCATION_FROM_MEMORY_ADDRESS 133
  133. #define PDC_MEM_RET_SBE_REPLACED 5 /* PDC_MEM return values */
  134. #define PDC_MEM_RET_DUPLICATE_ENTRY 4
  135. #define PDC_MEM_RET_BUF_SIZE_SMALL 1
  136. #define PDC_MEM_RET_PDT_FULL -11
  137. #define PDC_MEM_RET_INVALID_PHYSICAL_LOCATION ~0ULL
  138. #define PDC_PSW 21 /* Get/Set default System Mask */
  139. #define PDC_PSW_MASK 0 /* Return mask */
  140. #define PDC_PSW_GET_DEFAULTS 1 /* Return defaults */
  141. #define PDC_PSW_SET_DEFAULTS 2 /* Set default */
  142. #define PDC_PSW_ENDIAN_BIT 1 /* set for big endian */
  143. #define PDC_PSW_WIDE_BIT 2 /* set for wide mode */
  144. #define PDC_SYSTEM_MAP 22 /* find system modules */
  145. #define PDC_FIND_MODULE 0
  146. #define PDC_FIND_ADDRESS 1
  147. #define PDC_TRANSLATE_PATH 2
  148. #define PDC_SOFT_POWER 23 /* soft power switch */
  149. #define PDC_SOFT_POWER_INFO 0 /* return info about the soft power switch */
  150. #define PDC_SOFT_POWER_ENABLE 1 /* enable/disable soft power switch */
  151. #define PDC_ALLOC 24 /* allocate static storage for PDC & IODC */
  152. #define PDC_CRASH_PREP 25 /* Prepare system for crash dump */
  153. #define PDC_CRASH_DUMP 0 /* Do platform specific preparations for dump */
  154. #define PDC_CRASH_LOG_CEC_ERROR 1 /* Dump hardware registers */
  155. #define PDC_SCSI_PARMS 26 /* Get and set SCSI parameters */
  156. #define PDC_SCSI_GET_PARMS 0 /* Get SCSI parameters for I/O device */
  157. #define PDC_SCSI_SET_PARMS 1 /* Set SCSI parameters for I/O device */
  158. /* HVERSION dependent */
  159. /* The PDC_MEM_MAP calls */
  160. #define PDC_MEM_MAP 128 /* on s700: return page info */
  161. #define PDC_MEM_MAP_HPA 0 /* returns hpa of a module */
  162. #define PDC_EEPROM 129 /* EEPROM access */
  163. #define PDC_EEPROM_READ_WORD 0
  164. #define PDC_EEPROM_WRITE_WORD 1
  165. #define PDC_EEPROM_READ_BYTE 2
  166. #define PDC_EEPROM_WRITE_BYTE 3
  167. #define PDC_EEPROM_EEPROM_PASSWORD -1000
  168. #define PDC_NVM 130 /* NVM (non-volatile memory) access */
  169. #define PDC_NVM_READ_WORD 0
  170. #define PDC_NVM_WRITE_WORD 1
  171. #define PDC_NVM_READ_BYTE 2
  172. #define PDC_NVM_WRITE_BYTE 3
  173. #define PDC_SEED_ERROR 132 /* (sprockets) */
  174. #define PDC_IO 135 /* log error info, reset IO system */
  175. #define PDC_IO_READ_AND_CLEAR_ERRORS 0
  176. #define PDC_IO_RESET 1
  177. #define PDC_IO_RESET_DEVICES 2
  178. /* sets bits 6&7 (little endian) of the HcControl Register */
  179. #define PDC_IO_USB_SUSPEND 0xC000000000000000
  180. #define PDC_IO_EEPROM_IO_ERR_TABLE_FULL -5 /* return value */
  181. #define PDC_IO_NO_SUSPEND -6 /* return value */
  182. #define PDC_BROADCAST_RESET 136 /* reset all processors */
  183. #define PDC_DO_RESET 0 /* option: perform a broadcast reset */
  184. #define PDC_DO_FIRM_TEST_RESET 1 /* Do broadcast reset with bitmap */
  185. #define PDC_BR_RECONFIGURATION 2 /* reset w/reconfiguration */
  186. #define PDC_FIRM_TEST_MAGIC 0xab9ec36fUL /* for this reboot only */
  187. #define PDC_LAN_STATION_ID 138 /* Hversion dependent mechanism for */
  188. #define PDC_LAN_STATION_ID_READ 0 /* getting the lan station address */
  189. #define PDC_LAN_STATION_ID_SIZE 6
  190. #define PDC_CHECK_RANGES 139 /* (sprockets) */
  191. #define PDC_NV_SECTIONS 141 /* (sprockets) */
  192. #define PDC_PERFORMANCE 142 /* performance monitoring */
  193. #define PDC_SYSTEM_INFO 143 /* system information */
  194. #define PDC_SYSINFO_RETURN_INFO_SIZE 0
  195. #define PDC_SYSINFO_RRETURN_SYS_INFO 1
  196. #define PDC_SYSINFO_RRETURN_ERRORS 2
  197. #define PDC_SYSINFO_RRETURN_WARNINGS 3
  198. #define PDC_SYSINFO_RETURN_REVISIONS 4
  199. #define PDC_SYSINFO_RRETURN_DIAGNOSE 5
  200. #define PDC_SYSINFO_RRETURN_HV_DIAGNOSE 1005
  201. #define PDC_RDR 144 /* (sprockets) */
  202. #define PDC_RDR_READ_BUFFER 0
  203. #define PDC_RDR_READ_SINGLE 1
  204. #define PDC_RDR_WRITE_SINGLE 2
  205. #define PDC_INTRIGUE 145 /* (sprockets) */
  206. #define PDC_INTRIGUE_WRITE_BUFFER 0
  207. #define PDC_INTRIGUE_GET_SCRATCH_BUFSIZE 1
  208. #define PDC_INTRIGUE_START_CPU_COUNTERS 2
  209. #define PDC_INTRIGUE_STOP_CPU_COUNTERS 3
  210. #define PDC_STI 146 /* STI access */
  211. /* same as PDC_PCI_XXX values (see below) */
  212. /* Legacy PDC definitions for same stuff */
  213. #define PDC_PCI_INDEX 147
  214. #define PDC_PCI_INTERFACE_INFO 0
  215. #define PDC_PCI_SLOT_INFO 1
  216. #define PDC_PCI_INFLIGHT_BYTES 2
  217. #define PDC_PCI_READ_CONFIG 3
  218. #define PDC_PCI_WRITE_CONFIG 4
  219. #define PDC_PCI_READ_PCI_IO 5
  220. #define PDC_PCI_WRITE_PCI_IO 6
  221. #define PDC_PCI_READ_CONFIG_DELAY 7
  222. #define PDC_PCI_UPDATE_CONFIG_DELAY 8
  223. #define PDC_PCI_PCI_PATH_TO_PCI_HPA 9
  224. #define PDC_PCI_PCI_HPA_TO_PCI_PATH 10
  225. #define PDC_PCI_PCI_PATH_TO_PCI_BUS 11
  226. #define PDC_PCI_PCI_RESERVED 12
  227. #define PDC_PCI_PCI_INT_ROUTE_SIZE 13
  228. #define PDC_PCI_GET_INT_TBL_SIZE PDC_PCI_PCI_INT_ROUTE_SIZE
  229. #define PDC_PCI_PCI_INT_ROUTE 14
  230. #define PDC_PCI_GET_INT_TBL PDC_PCI_PCI_INT_ROUTE
  231. #define PDC_PCI_READ_MON_TYPE 15
  232. #define PDC_PCI_WRITE_MON_TYPE 16
  233. #define PDC_RELOCATE 149 /* (sprockets) */
  234. #define PDC_RELOCATE_GET_RELOCINFO 0
  235. #define PDC_RELOCATE_CHECKSUM 1
  236. #define PDC_RELOCATE_RELOCATE 2
  237. /* Get SCSI Interface Card info: SDTR, SCSI ID, mode (SE vs LVD) */
  238. #define PDC_INITIATOR 163
  239. #define PDC_GET_INITIATOR 0
  240. #define PDC_SET_INITIATOR 1
  241. #define PDC_DELETE_INITIATOR 2
  242. #define PDC_RETURN_TABLE_SIZE 3
  243. #define PDC_RETURN_TABLE 4
  244. #define PDC_LINK 165 /* (sprockets) */
  245. #define PDC_LINK_PCI_ENTRY_POINTS 0 /* list (Arg1) = 0 */
  246. #define PDC_LINK_USB_ENTRY_POINTS 1 /* list (Arg1) = 1 */
  247. /* cl_class
  248. * page 3-33 of IO-Firmware ARS
  249. * IODC ENTRY_INIT(Search first) RET[1]
  250. */
  251. #define CL_NULL 0 /* invalid */
  252. #define CL_RANDOM 1 /* random access (as disk) */
  253. #define CL_SEQU 2 /* sequential access (as tape) */
  254. #define CL_DUPLEX 7 /* full-duplex point-to-point (RS-232, Net) */
  255. #define CL_KEYBD 8 /* half-duplex console (HIL Keyboard) */
  256. #define CL_DISPL 9 /* half-duplex console (display) */
  257. #define CL_FC 10 /* FiberChannel access media */
  258. /* IODC ENTRY_INIT() */
  259. #define ENTRY_INIT_SRCH_FRST 2
  260. #define ENTRY_INIT_SRCH_NEXT 3
  261. #define ENTRY_INIT_MOD_DEV 4
  262. #define ENTRY_INIT_DEV 5
  263. #define ENTRY_INIT_MOD 6
  264. #define ENTRY_INIT_MSG 9
  265. /* IODC ENTRY_IO() */
  266. #define ENTRY_IO_BOOTIN 0
  267. #define ENTRY_IO_BOOTOUT 1
  268. #define ENTRY_IO_CIN 2
  269. #define ENTRY_IO_COUT 3
  270. #define ENTRY_IO_CLOSE 4
  271. #define ENTRY_IO_GETMSG 9
  272. #define ENTRY_IO_BBLOCK_IN 16
  273. #define ENTRY_IO_BBLOCK_OUT 17
  274. /* IODC ENTRY_SPA() */
  275. /* IODC ENTRY_CONFIG() */
  276. /* IODC ENTRY_TEST() */
  277. /* IODC ENTRY_TLB() */
  278. /* constants for OS (NVM...) */
  279. #define OS_ID_NONE 0 /* Undefined OS ID */
  280. #define OS_ID_HPUX 1 /* HP-UX OS */
  281. #define OS_ID_MPEXL 2 /* MPE XL OS */
  282. #define OS_ID_OSF 3 /* OSF OS */
  283. #define OS_ID_HPRT 4 /* HP-RT OS */
  284. #define OS_ID_NOVEL 5 /* NOVELL OS */
  285. #define OS_ID_LINUX 6 /* Linux */
  286. /* constants for PDC_CHASSIS */
  287. #define OSTAT_OFF 0
  288. #define OSTAT_FLT 1
  289. #define OSTAT_TEST 2
  290. #define OSTAT_INIT 3
  291. #define OSTAT_SHUT 4
  292. #define OSTAT_WARN 5
  293. #define OSTAT_RUN 6
  294. #define OSTAT_ON 7
  295. /* Page Zero constant offsets used by the HPMC handler */
  296. #define BOOT_CONSOLE_HPA_OFFSET 0x3c0
  297. #define BOOT_CONSOLE_SPA_OFFSET 0x3c4
  298. #define BOOT_CONSOLE_PATH_OFFSET 0x3a8
  299. /* size of the pdc_result buffer for firmware.c */
  300. #define NUM_PDC_RESULT 32
  301. #if !defined(__ASSEMBLY__)
  302. /* flags for hardware_path */
  303. #define PF_AUTOBOOT 0x80
  304. #define PF_AUTOSEARCH 0x40
  305. #define PF_TIMER 0x0F
  306. struct hardware_path {
  307. unsigned char flags; /* see bit definitions below */
  308. signed char bc[6]; /* Bus Converter routing info to a specific */
  309. /* I/O adaptor (< 0 means none, > 63 resvd) */
  310. signed char mod; /* fixed field of specified module */
  311. };
  312. struct pdc_module_path { /* page 1-69 */
  313. struct hardware_path path;
  314. unsigned int layers[6]; /* device-specific info (ctlr #, unit # ...) */
  315. } __attribute__((aligned(8)));
  316. struct pz_device {
  317. struct pdc_module_path dp; /* see above */
  318. /* struct iomod *hpa; */
  319. unsigned int hpa; /* HPA base address */
  320. /* char *spa; */
  321. unsigned int spa; /* SPA base address */
  322. /* int (*iodc_io)(struct iomod*, ...); */
  323. unsigned int iodc_io; /* device entry point */
  324. short pad; /* reserved */
  325. unsigned short cl_class;/* see below */
  326. } __attribute__((aligned(8))) ;
  327. struct zeropage {
  328. /* [0x000] initialize vectors (VEC) */
  329. unsigned int vec_special; /* must be zero */
  330. /* int (*vec_pow_fail)(void);*/
  331. unsigned int vec_pow_fail; /* power failure handler */
  332. /* int (*vec_toc)(void); */
  333. unsigned int vec_toc;
  334. unsigned int vec_toclen;
  335. /* int (*vec_rendz)(void); */
  336. unsigned int vec_rendz;
  337. int vec_pow_fail_flen;
  338. int vec_pad0[3];
  339. unsigned int vec_toc_hi;
  340. int vec_pad1[6];
  341. /* [0x040] reserved processor dependent */
  342. int pad0[112]; /* in QEMU pad0[0] holds "SeaBIOS\0" */
  343. /* [0x200] reserved */
  344. int pad1[84];
  345. /* [0x350] memory configuration (MC) */
  346. int memc_cont; /* contiguous mem size (bytes) */
  347. int memc_phsize; /* physical memory size */
  348. int memc_adsize; /* additional mem size, bytes of SPA space used by PDC */
  349. unsigned int mem_pdc_hi; /* used for 64-bit */
  350. /* [0x360] various parameters for the boot-CPU */
  351. /* unsigned int *mem_booterr[8]; */
  352. unsigned int mem_booterr[8]; /* ptr to boot errors */
  353. unsigned int mem_free; /* first location, where OS can be loaded */
  354. /* struct iomod *mem_hpa; */
  355. unsigned int mem_hpa; /* HPA of the boot-CPU */
  356. /* int (*mem_pdc)(int, ...); */
  357. unsigned int mem_pdc; /* PDC entry point */
  358. unsigned int mem_10msec; /* number of clock ticks in 10msec */
  359. /* [0x390] initial memory module (IMM) */
  360. /* struct iomod *imm_hpa; */
  361. unsigned int imm_hpa; /* HPA of the IMM */
  362. int imm_soft_boot; /* 0 = was hard boot, 1 = was soft boot */
  363. unsigned int imm_spa_size; /* SPA size of the IMM in bytes */
  364. unsigned int imm_max_mem; /* bytes of mem in IMM */
  365. /* [0x3A0] boot console, display device and keyboard */
  366. struct pz_device mem_cons; /* description of console device */
  367. struct pz_device mem_boot; /* description of boot device */
  368. struct pz_device mem_kbd; /* description of keyboard device */
  369. /* [0x430] reserved */
  370. int pad430[116];
  371. /* [0x600] processor dependent */
  372. unsigned int pad600[1];
  373. unsigned int proc_sti; /* pointer to STI ROM */
  374. unsigned int pad608[126];
  375. };
  376. struct pdc_chassis_info { /* for PDC_CHASSIS_INFO */
  377. unsigned long actcnt; /* actual number of bytes returned */
  378. unsigned long maxcnt; /* maximum number of bytes that could be returned */
  379. };
  380. struct pdc_coproc_cfg { /* for PDC_COPROC_CFG */
  381. unsigned long ccr_functional;
  382. unsigned long ccr_present;
  383. unsigned long revision;
  384. unsigned long model;
  385. };
  386. struct pdc_model { /* for PDC_MODEL */
  387. unsigned long hversion;
  388. unsigned long sversion;
  389. unsigned long hw_id;
  390. unsigned long boot_id;
  391. unsigned long sw_id;
  392. unsigned long sw_cap;
  393. unsigned long arch_rev;
  394. unsigned long pot_key;
  395. unsigned long curr_key;
  396. unsigned long width; /* default of PSW_W bit (1=enabled) */
  397. };
  398. struct pdc_cache_cf { /* for PDC_CACHE (I/D-caches) */
  399. unsigned long
  400. #ifdef __LP64__
  401. cc_padW:32,
  402. #endif
  403. cc_alias: 4, /* alias boundaries for virtual addresses */
  404. cc_block: 4, /* to determine most efficient stride */
  405. cc_line : 3, /* maximum amount written back as a result of store (multiple of 16 bytes) */
  406. cc_shift: 2, /* how much to shift cc_block left */
  407. cc_wt : 1, /* 0 = WT-Dcache, 1 = WB-Dcache */
  408. cc_sh : 2, /* 0 = separate I/D-cache, else shared I/D-cache */
  409. cc_cst : 3, /* 0 = incoherent D-cache, 1=coherent D-cache */
  410. cc_pad1 : 10, /* reserved */
  411. cc_hv : 3; /* hversion dependent */
  412. };
  413. struct pdc_tlb_cf { /* for PDC_CACHE (I/D-TLB's) */
  414. unsigned long tc_pad0:12, /* reserved */
  415. #ifdef __LP64__
  416. tc_padW:32,
  417. #endif
  418. tc_sh : 2, /* 0 = separate I/D-TLB, else shared I/D-TLB */
  419. tc_hv : 1, /* HV */
  420. tc_page : 1, /* 0 = 2K page-size-machine, 1 = 4k page size */
  421. tc_cst : 3, /* 0 = incoherent operations, else coherent operations */
  422. tc_aid : 5, /* ITLB: width of access ids of processor (encoded!) */
  423. tc_sr : 8; /* ITLB: width of space-registers (encoded) */
  424. };
  425. struct pdc_cache_info { /* main-PDC_CACHE-structure (caches & TLB's) */
  426. /* I-cache */
  427. unsigned long ic_size; /* size in bytes */
  428. struct pdc_cache_cf ic_conf; /* configuration */
  429. unsigned long ic_base; /* base-addr */
  430. unsigned long ic_stride;
  431. unsigned long ic_count;
  432. unsigned long ic_loop;
  433. /* D-cache */
  434. unsigned long dc_size; /* size in bytes */
  435. struct pdc_cache_cf dc_conf; /* configuration */
  436. unsigned long dc_base; /* base-addr */
  437. unsigned long dc_stride;
  438. unsigned long dc_count;
  439. unsigned long dc_loop;
  440. /* Instruction-TLB */
  441. unsigned long it_size; /* number of entries in I-TLB */
  442. struct pdc_tlb_cf it_conf; /* I-TLB-configuration */
  443. unsigned long it_sp_base;
  444. unsigned long it_sp_stride;
  445. unsigned long it_sp_count;
  446. unsigned long it_off_base;
  447. unsigned long it_off_stride;
  448. unsigned long it_off_count;
  449. unsigned long it_loop;
  450. /* data-TLB */
  451. unsigned long dt_size; /* number of entries in D-TLB */
  452. struct pdc_tlb_cf dt_conf; /* D-TLB-configuration */
  453. unsigned long dt_sp_base;
  454. unsigned long dt_sp_stride;
  455. unsigned long dt_sp_count;
  456. unsigned long dt_off_base;
  457. unsigned long dt_off_stride;
  458. unsigned long dt_off_count;
  459. unsigned long dt_loop;
  460. };
  461. /* Might need adjustment to work with 64-bit firmware */
  462. struct pdc_iodc { /* PDC_IODC */
  463. unsigned char hversion_model;
  464. unsigned char hversion;
  465. unsigned char spa;
  466. unsigned char type;
  467. unsigned int sversion_rev:4;
  468. unsigned int sversion_model:19;
  469. unsigned int sversion_opt:8;
  470. unsigned char rev;
  471. unsigned char dep;
  472. unsigned char features;
  473. unsigned char pad1;
  474. unsigned int checksum:16;
  475. unsigned int length:16;
  476. unsigned int pad[15];
  477. } __attribute__((aligned(8))) ;
  478. /* no BLTBs in pa2.0 processors */
  479. struct pdc_btlb_info_range {
  480. unsigned char res00;
  481. unsigned char num_i;
  482. unsigned char num_d;
  483. unsigned char num_comb;
  484. };
  485. struct pdc_btlb_info { /* PDC_BLOCK_TLB, return of PDC_BTLB_INFO */
  486. unsigned int min_size; /* minimum size of BTLB in pages */
  487. unsigned int max_size; /* maximum size of BTLB in pages */
  488. struct pdc_btlb_info_range fixed_range_info;
  489. struct pdc_btlb_info_range variable_range_info;
  490. };
  491. struct pdc_mem_retinfo { /* PDC_MEM/PDC_MEM_MEMINFO (return info) */
  492. unsigned long pdt_size;
  493. unsigned long pdt_entries;
  494. unsigned long pdt_status;
  495. unsigned long first_dbe_loc;
  496. unsigned long good_mem;
  497. };
  498. struct pdc_mem_read_pdt { /* PDC_MEM/PDC_MEM_READ_PDT (return info) */
  499. unsigned long pdt_entries;
  500. };
  501. #ifdef __LP64__
  502. struct pdc_memory_table_raddr { /* PDC_MEM/PDC_MEM_TABLE (return info) */
  503. unsigned long entries_returned;
  504. unsigned long entries_total;
  505. };
  506. struct pdc_memory_table { /* PDC_MEM/PDC_MEM_TABLE (arguments) */
  507. unsigned long paddr;
  508. unsigned int pages;
  509. unsigned int reserved;
  510. };
  511. #endif /* __LP64__ */
  512. struct pdc_system_map_mod_info { /* PDC_SYSTEM_MAP/FIND_MODULE */
  513. unsigned long mod_addr;
  514. unsigned long mod_pgs;
  515. unsigned long add_addrs;
  516. };
  517. struct pdc_system_map_addr_info { /* PDC_SYSTEM_MAP/FIND_ADDRESS */
  518. unsigned long mod_addr;
  519. unsigned long mod_pgs;
  520. };
  521. struct pdc_initiator { /* PDC_INITIATOR */
  522. int host_id;
  523. int factor;
  524. int width;
  525. int mode;
  526. };
  527. /* Only used on some pre-PA2.0 boxes */
  528. struct pdc_memory_map { /* PDC_MEMORY_MAP */
  529. unsigned long hpa; /* mod's register set address */
  530. unsigned long more_pgs; /* number of additional I/O pgs */
  531. };
  532. struct pdc_tod {
  533. unsigned long tod_sec;
  534. unsigned long tod_usec;
  535. };
  536. /* architected results from PDC_PIM/transfer hpmc on a PA1.1 machine */
  537. struct pdc_hpmc_pim_11 { /* PDC_PIM */
  538. unsigned int gr[32];
  539. unsigned int cr[32];
  540. unsigned int sr[8];
  541. unsigned int iasq_back;
  542. unsigned int iaoq_back;
  543. unsigned int check_type;
  544. unsigned int cpu_state;
  545. unsigned int rsvd1;
  546. unsigned int cache_check;
  547. unsigned int tlb_check;
  548. unsigned int bus_check;
  549. unsigned int assists_check;
  550. unsigned int rsvd2;
  551. unsigned int assist_state;
  552. unsigned int responder_addr;
  553. unsigned int requestor_addr;
  554. unsigned int path_info;
  555. unsigned long long fr[32];
  556. };
  557. /*
  558. * architected results from PDC_PIM/transfer hpmc on a PA2.0 machine
  559. *
  560. * Note that PDC_PIM doesn't care whether or not wide mode was enabled
  561. * so the results are different on PA1.1 vs. PA2.0 when in narrow mode.
  562. *
  563. * Note also that there are unarchitected results available, which
  564. * are hversion dependent. Do a "ser pim 0 hpmc" after rebooting, since
  565. * the firmware is probably the best way of printing hversion dependent
  566. * data.
  567. */
  568. struct pdc_hpmc_pim_20 { /* PDC_PIM */
  569. unsigned long long gr[32];
  570. unsigned long long cr[32];
  571. unsigned long long sr[8];
  572. unsigned long long iasq_back;
  573. unsigned long long iaoq_back;
  574. unsigned int check_type;
  575. unsigned int cpu_state;
  576. unsigned int cache_check;
  577. unsigned int tlb_check;
  578. unsigned int bus_check;
  579. unsigned int assists_check;
  580. unsigned int assist_state;
  581. unsigned int path_info;
  582. unsigned long long responder_addr;
  583. unsigned long long requestor_addr;
  584. unsigned long long fr[32];
  585. };
  586. struct pim_cpu_state_cf {
  587. union {
  588. unsigned int
  589. iqv : 1, /* IIA queue Valid */
  590. iqf : 1, /* IIA queue Failure */
  591. ipv : 1, /* IPRs Valid */
  592. grv : 1, /* GRs Valid */
  593. crv : 1, /* CRs Valid */
  594. srv : 1, /* SRs Valid */
  595. trv : 1, /* CR24 through CR31 valid */
  596. pad : 24, /* reserved */
  597. td : 1; /* TOC did not cause any damage to the system state */
  598. unsigned int val;
  599. };
  600. };
  601. struct pdc_toc_pim_11 {
  602. unsigned int gr[32];
  603. unsigned int cr[32];
  604. unsigned int sr[8];
  605. unsigned int iasq_back;
  606. unsigned int iaoq_back;
  607. unsigned int check_type;
  608. struct pim_cpu_state_cf cpu_state;
  609. };
  610. struct pdc_toc_pim_20 {
  611. unsigned long long gr[32];
  612. unsigned long long cr[32];
  613. unsigned long long sr[8];
  614. unsigned long long iasq_back;
  615. unsigned long long iaoq_back;
  616. unsigned int check_type;
  617. struct pim_cpu_state_cf cpu_state;
  618. };
  619. #endif /* !defined(__ASSEMBLY__) */
  620. #endif /* _UAPI_PARISC_PDC_H */