pdc.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. #ifndef _PARISC_PDC_H
  2. #define _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_IOPDIR_FDC (1 << 2)
  46. #define PDC_MODEL_NVA_MASK (3 << 4)
  47. #define PDC_MODEL_NVA_SUPPORTED (0 << 4)
  48. #define PDC_MODEL_NVA_SLOW (1 << 4)
  49. #define PDC_MODEL_NVA_UNSUPPORTED (3 << 4)
  50. #define PDC_MODEL_GET_BOOT__OP 8 /* returns boot test options */
  51. #define PDC_MODEL_SET_BOOT__OP 9 /* set boot test options */
  52. #define PA89_INSTRUCTION_SET 0x4 /* capatibilies returned */
  53. #define PA90_INSTRUCTION_SET 0x8
  54. #define PDC_CACHE 5 /* return/set cache (& TLB) info*/
  55. #define PDC_CACHE_INFO 0 /* returns information */
  56. #define PDC_CACHE_SET_COH 1 /* set coherence state */
  57. #define PDC_CACHE_RET_SPID 2 /* returns space-ID bits */
  58. #define PDC_HPA 6 /* return HPA of processor */
  59. #define PDC_HPA_PROCESSOR 0
  60. #define PDC_HPA_MODULES 1
  61. #define PDC_COPROC 7 /* Co-Processor (usually FP unit(s)) */
  62. #define PDC_COPROC_CFG 0 /* Co-Processor Cfg (FP unit(s) enabled?) */
  63. #define PDC_IODC 8 /* talk to IODC */
  64. #define PDC_IODC_READ 0 /* read IODC entry point */
  65. /* PDC_IODC_RI_ * INDEX parameter of PDC_IODC_READ */
  66. #define PDC_IODC_RI_DATA_BYTES 0 /* IODC Data Bytes */
  67. /* 1, 2 obsolete - HVERSION dependent*/
  68. #define PDC_IODC_RI_INIT 3 /* Initialize module */
  69. #define PDC_IODC_RI_IO 4 /* Module input/output */
  70. #define PDC_IODC_RI_SPA 5 /* Module input/output */
  71. #define PDC_IODC_RI_CONFIG 6 /* Module input/output */
  72. /* 7 obsolete - HVERSION dependent */
  73. #define PDC_IODC_RI_TEST 8 /* Module input/output */
  74. #define PDC_IODC_RI_TLB 9 /* Module input/output */
  75. #define PDC_IODC_NINIT 2 /* non-destructive init */
  76. #define PDC_IODC_DINIT 3 /* destructive init */
  77. #define PDC_IODC_MEMERR 4 /* check for memory errors */
  78. #define PDC_IODC_INDEX_DATA 0 /* get first 16 bytes from mod IODC */
  79. #define PDC_IODC_BUS_ERROR -4 /* bus error return value */
  80. #define PDC_IODC_INVALID_INDEX -5 /* invalid index return value */
  81. #define PDC_IODC_COUNT -6 /* count is too small */
  82. #define PDC_TOD 9 /* time-of-day clock (TOD) */
  83. #define PDC_TOD_READ 0 /* read TOD */
  84. #define PDC_TOD_WRITE 1 /* write TOD */
  85. #define PDC_STABLE 10 /* stable storage (sprockets) */
  86. #define PDC_STABLE_READ 0
  87. #define PDC_STABLE_WRITE 1
  88. #define PDC_STABLE_RETURN_SIZE 2
  89. #define PDC_STABLE_VERIFY_CONTENTS 3
  90. #define PDC_STABLE_INITIALIZE 4
  91. #define PDC_NVOLATILE 11 /* often not implemented */
  92. #define PDC_ADD_VALID 12 /* Memory validation PDC call */
  93. #define PDC_ADD_VALID_VERIFY 0 /* Make PDC_ADD_VALID verify region */
  94. #define PDC_INSTR 15 /* get instr to invoke PDCE_CHECK() */
  95. #define PDC_PROC 16 /* (sprockets) */
  96. #define PDC_CONFIG 16 /* (sprockets) */
  97. #define PDC_CONFIG_DECONFIG 0
  98. #define PDC_CONFIG_DRECONFIG 1
  99. #define PDC_CONFIG_DRETURN_CONFIG 2
  100. #define PDC_BLOCK_TLB 18 /* manage hardware block-TLB */
  101. #define PDC_BTLB_INFO 0 /* returns parameter */
  102. #define PDC_BTLB_INSERT 1 /* insert BTLB entry */
  103. #define PDC_BTLB_PURGE 2 /* purge BTLB entries */
  104. #define PDC_BTLB_PURGE_ALL 3 /* purge all BTLB entries */
  105. #define PDC_TLB 19 /* manage hardware TLB miss handling */
  106. #define PDC_TLB_INFO 0 /* returns parameter */
  107. #define PDC_TLB_SETUP 1 /* set up miss handling */
  108. #define PDC_MEM 20 /* Manage memory */
  109. #define PDC_MEM_MEMINFO 0
  110. #define PDC_MEM_ADD_PAGE 1
  111. #define PDC_MEM_CLEAR_PDT 2
  112. #define PDC_MEM_READ_PDT 3
  113. #define PDC_MEM_RESET_CLEAR 4
  114. #define PDC_MEM_GOODMEM 5
  115. #define PDC_MEM_TABLE 128 /* Non contig mem map (sprockets) */
  116. #define PDC_MEM_RETURN_ADDRESS_TABLE PDC_MEM_TABLE
  117. #define PDC_MEM_GET_MEMORY_SYSTEM_TABLES_SIZE 131
  118. #define PDC_MEM_GET_MEMORY_SYSTEM_TABLES 132
  119. #define PDC_MEM_GET_PHYSICAL_LOCATION_FROM_MEMORY_ADDRESS 133
  120. #define PDC_MEM_RET_SBE_REPLACED 5 /* PDC_MEM return values */
  121. #define PDC_MEM_RET_DUPLICATE_ENTRY 4
  122. #define PDC_MEM_RET_BUF_SIZE_SMALL 1
  123. #define PDC_MEM_RET_PDT_FULL -11
  124. #define PDC_MEM_RET_INVALID_PHYSICAL_LOCATION ~0ULL
  125. #define PDC_PSW 21 /* Get/Set default System Mask */
  126. #define PDC_PSW_MASK 0 /* Return mask */
  127. #define PDC_PSW_GET_DEFAULTS 1 /* Return defaults */
  128. #define PDC_PSW_SET_DEFAULTS 2 /* Set default */
  129. #define PDC_PSW_ENDIAN_BIT 1 /* set for big endian */
  130. #define PDC_PSW_WIDE_BIT 2 /* set for wide mode */
  131. #define PDC_SYSTEM_MAP 22 /* find system modules */
  132. #define PDC_FIND_MODULE 0
  133. #define PDC_FIND_ADDRESS 1
  134. #define PDC_TRANSLATE_PATH 2
  135. #define PDC_SOFT_POWER 23 /* soft power switch */
  136. #define PDC_SOFT_POWER_INFO 0 /* return info about the soft power switch */
  137. #define PDC_SOFT_POWER_ENABLE 1 /* enable/disable soft power switch */
  138. /* HVERSION dependent */
  139. /* The PDC_MEM_MAP calls */
  140. #define PDC_MEM_MAP 128 /* on s700: return page info */
  141. #define PDC_MEM_MAP_HPA 0 /* returns hpa of a module */
  142. #define PDC_EEPROM 129 /* EEPROM access */
  143. #define PDC_EEPROM_READ_WORD 0
  144. #define PDC_EEPROM_WRITE_WORD 1
  145. #define PDC_EEPROM_READ_BYTE 2
  146. #define PDC_EEPROM_WRITE_BYTE 3
  147. #define PDC_EEPROM_EEPROM_PASSWORD -1000
  148. #define PDC_NVM 130 /* NVM (non-volatile memory) access */
  149. #define PDC_NVM_READ_WORD 0
  150. #define PDC_NVM_WRITE_WORD 1
  151. #define PDC_NVM_READ_BYTE 2
  152. #define PDC_NVM_WRITE_BYTE 3
  153. #define PDC_SEED_ERROR 132 /* (sprockets) */
  154. #define PDC_IO 135 /* log error info, reset IO system */
  155. #define PDC_IO_READ_AND_CLEAR_ERRORS 0
  156. #define PDC_IO_RESET 1
  157. #define PDC_IO_RESET_DEVICES 2
  158. /* sets bits 6&7 (little endian) of the HcControl Register */
  159. #define PDC_IO_USB_SUSPEND 0xC000000000000000
  160. #define PDC_IO_EEPROM_IO_ERR_TABLE_FULL -5 /* return value */
  161. #define PDC_IO_NO_SUSPEND -6 /* return value */
  162. #define PDC_BROADCAST_RESET 136 /* reset all processors */
  163. #define PDC_DO_RESET 0 /* option: perform a broadcast reset */
  164. #define PDC_DO_FIRM_TEST_RESET 1 /* Do broadcast reset with bitmap */
  165. #define PDC_BR_RECONFIGURATION 2 /* reset w/reconfiguration */
  166. #define PDC_FIRM_TEST_MAGIC 0xab9ec36fUL /* for this reboot only */
  167. #define PDC_LAN_STATION_ID 138 /* Hversion dependent mechanism for */
  168. #define PDC_LAN_STATION_ID_READ 0 /* getting the lan station address */
  169. #define PDC_LAN_STATION_ID_SIZE 6
  170. #define PDC_CHECK_RANGES 139 /* (sprockets) */
  171. #define PDC_NV_SECTIONS 141 /* (sprockets) */
  172. #define PDC_PERFORMANCE 142 /* performance monitoring */
  173. #define PDC_SYSTEM_INFO 143 /* system information */
  174. #define PDC_SYSINFO_RETURN_INFO_SIZE 0
  175. #define PDC_SYSINFO_RRETURN_SYS_INFO 1
  176. #define PDC_SYSINFO_RRETURN_ERRORS 2
  177. #define PDC_SYSINFO_RRETURN_WARNINGS 3
  178. #define PDC_SYSINFO_RETURN_REVISIONS 4
  179. #define PDC_SYSINFO_RRETURN_DIAGNOSE 5
  180. #define PDC_SYSINFO_RRETURN_HV_DIAGNOSE 1005
  181. #define PDC_RDR 144 /* (sprockets) */
  182. #define PDC_RDR_READ_BUFFER 0
  183. #define PDC_RDR_READ_SINGLE 1
  184. #define PDC_RDR_WRITE_SINGLE 2
  185. #define PDC_INTRIGUE 145 /* (sprockets) */
  186. #define PDC_INTRIGUE_WRITE_BUFFER 0
  187. #define PDC_INTRIGUE_GET_SCRATCH_BUFSIZE 1
  188. #define PDC_INTRIGUE_START_CPU_COUNTERS 2
  189. #define PDC_INTRIGUE_STOP_CPU_COUNTERS 3
  190. #define PDC_STI 146 /* STI access */
  191. /* same as PDC_PCI_XXX values (see below) */
  192. /* Legacy PDC definitions for same stuff */
  193. #define PDC_PCI_INDEX 147
  194. #define PDC_PCI_INTERFACE_INFO 0
  195. #define PDC_PCI_SLOT_INFO 1
  196. #define PDC_PCI_INFLIGHT_BYTES 2
  197. #define PDC_PCI_READ_CONFIG 3
  198. #define PDC_PCI_WRITE_CONFIG 4
  199. #define PDC_PCI_READ_PCI_IO 5
  200. #define PDC_PCI_WRITE_PCI_IO 6
  201. #define PDC_PCI_READ_CONFIG_DELAY 7
  202. #define PDC_PCI_UPDATE_CONFIG_DELAY 8
  203. #define PDC_PCI_PCI_PATH_TO_PCI_HPA 9
  204. #define PDC_PCI_PCI_HPA_TO_PCI_PATH 10
  205. #define PDC_PCI_PCI_PATH_TO_PCI_BUS 11
  206. #define PDC_PCI_PCI_RESERVED 12
  207. #define PDC_PCI_PCI_INT_ROUTE_SIZE 13
  208. #define PDC_PCI_GET_INT_TBL_SIZE PDC_PCI_PCI_INT_ROUTE_SIZE
  209. #define PDC_PCI_PCI_INT_ROUTE 14
  210. #define PDC_PCI_GET_INT_TBL PDC_PCI_PCI_INT_ROUTE
  211. #define PDC_PCI_READ_MON_TYPE 15
  212. #define PDC_PCI_WRITE_MON_TYPE 16
  213. /* Get SCSI Interface Card info: SDTR, SCSI ID, mode (SE vs LVD) */
  214. #define PDC_INITIATOR 163
  215. #define PDC_GET_INITIATOR 0
  216. #define PDC_SET_INITIATOR 1
  217. #define PDC_DELETE_INITIATOR 2
  218. #define PDC_RETURN_TABLE_SIZE 3
  219. #define PDC_RETURN_TABLE 4
  220. #define PDC_LINK 165 /* (sprockets) */
  221. #define PDC_LINK_PCI_ENTRY_POINTS 0 /* list (Arg1) = 0 */
  222. #define PDC_LINK_USB_ENTRY_POINTS 1 /* list (Arg1) = 1 */
  223. /* cl_class
  224. * page 3-33 of IO-Firmware ARS
  225. * IODC ENTRY_INIT(Search first) RET[1]
  226. */
  227. #define CL_NULL 0 /* invalid */
  228. #define CL_RANDOM 1 /* random access (as disk) */
  229. #define CL_SEQU 2 /* sequential access (as tape) */
  230. #define CL_DUPLEX 7 /* full-duplex point-to-point (RS-232, Net) */
  231. #define CL_KEYBD 8 /* half-duplex console (HIL Keyboard) */
  232. #define CL_DISPL 9 /* half-duplex console (display) */
  233. #define CL_FC 10 /* FiberChannel access media */
  234. /* IODC ENTRY_INIT() */
  235. #define ENTRY_INIT_SRCH_FRST 2
  236. #define ENTRY_INIT_SRCH_NEXT 3
  237. #define ENTRY_INIT_MOD_DEV 4
  238. #define ENTRY_INIT_DEV 5
  239. #define ENTRY_INIT_MOD 6
  240. #define ENTRY_INIT_MSG 9
  241. /* IODC ENTRY_IO() */
  242. #define ENTRY_IO_BOOTIN 0
  243. #define ENTRY_IO_BOOTOUT 1
  244. #define ENTRY_IO_CIN 2
  245. #define ENTRY_IO_COUT 3
  246. #define ENTRY_IO_CLOSE 4
  247. #define ENTRY_IO_GETMSG 9
  248. #define ENTRY_IO_BBLOCK_IN 16
  249. #define ENTRY_IO_BBLOCK_OUT 17
  250. /* IODC ENTRY_SPA() */
  251. /* IODC ENTRY_CONFIG() */
  252. /* IODC ENTRY_TEST() */
  253. /* IODC ENTRY_TLB() */
  254. /* constants for OS (NVM...) */
  255. #define OS_ID_NONE 0 /* Undefined OS ID */
  256. #define OS_ID_HPUX 1 /* HP-UX OS */
  257. #define OS_ID_MPEXL 2 /* MPE XL OS */
  258. #define OS_ID_OSF 3 /* OSF OS */
  259. #define OS_ID_HPRT 4 /* HP-RT OS */
  260. #define OS_ID_NOVEL 5 /* NOVELL OS */
  261. #define OS_ID_LINUX 6 /* Linux */
  262. /* constants for PDC_CHASSIS */
  263. #define OSTAT_OFF 0
  264. #define OSTAT_FLT 1
  265. #define OSTAT_TEST 2
  266. #define OSTAT_INIT 3
  267. #define OSTAT_SHUT 4
  268. #define OSTAT_WARN 5
  269. #define OSTAT_RUN 6
  270. #define OSTAT_ON 7
  271. /* Page Zero constant offsets used by the HPMC handler */
  272. #define BOOT_CONSOLE_HPA_OFFSET 0x3c0
  273. #define BOOT_CONSOLE_SPA_OFFSET 0x3c4
  274. #define BOOT_CONSOLE_PATH_OFFSET 0x3a8
  275. /* size of the pdc_result buffer for firmware.c */
  276. #define NUM_PDC_RESULT 32
  277. #if !defined(__ASSEMBLY__)
  278. #include <linux/types.h>
  279. #ifdef __KERNEL__
  280. extern int pdc_type;
  281. /* Values for pdc_type */
  282. #define PDC_TYPE_ILLEGAL -1
  283. #define PDC_TYPE_PAT 0 /* 64-bit PAT-PDC */
  284. #define PDC_TYPE_SYSTEM_MAP 1 /* 32-bit, but supports PDC_SYSTEM_MAP */
  285. #define PDC_TYPE_SNAKE 2 /* Doesn't support SYSTEM_MAP */
  286. struct pdc_chassis_info { /* for PDC_CHASSIS_INFO */
  287. unsigned long actcnt; /* actual number of bytes returned */
  288. unsigned long maxcnt; /* maximum number of bytes that could be returned */
  289. };
  290. struct pdc_coproc_cfg { /* for PDC_COPROC_CFG */
  291. unsigned long ccr_functional;
  292. unsigned long ccr_present;
  293. unsigned long revision;
  294. unsigned long model;
  295. };
  296. struct pdc_model { /* for PDC_MODEL */
  297. unsigned long hversion;
  298. unsigned long sversion;
  299. unsigned long hw_id;
  300. unsigned long boot_id;
  301. unsigned long sw_id;
  302. unsigned long sw_cap;
  303. unsigned long arch_rev;
  304. unsigned long pot_key;
  305. unsigned long curr_key;
  306. };
  307. struct pdc_cache_cf { /* for PDC_CACHE (I/D-caches) */
  308. unsigned long
  309. #ifdef CONFIG_64BIT
  310. cc_padW:32,
  311. #endif
  312. cc_alias: 4, /* alias boundaries for virtual addresses */
  313. cc_block: 4, /* to determine most efficient stride */
  314. cc_line : 3, /* maximum amount written back as a result of store (multiple of 16 bytes) */
  315. cc_shift: 2, /* how much to shift cc_block left */
  316. cc_wt : 1, /* 0 = WT-Dcache, 1 = WB-Dcache */
  317. cc_sh : 2, /* 0 = separate I/D-cache, else shared I/D-cache */
  318. cc_cst : 3, /* 0 = incoherent D-cache, 1=coherent D-cache */
  319. cc_pad1 : 10, /* reserved */
  320. cc_hv : 3; /* hversion dependent */
  321. };
  322. struct pdc_tlb_cf { /* for PDC_CACHE (I/D-TLB's) */
  323. unsigned long tc_pad0:12, /* reserved */
  324. #ifdef CONFIG_64BIT
  325. tc_padW:32,
  326. #endif
  327. tc_sh : 2, /* 0 = separate I/D-TLB, else shared I/D-TLB */
  328. tc_hv : 1, /* HV */
  329. tc_page : 1, /* 0 = 2K page-size-machine, 1 = 4k page size */
  330. tc_cst : 3, /* 0 = incoherent operations, else coherent operations */
  331. tc_aid : 5, /* ITLB: width of access ids of processor (encoded!) */
  332. tc_pad1 : 8; /* ITLB: width of space-registers (encoded) */
  333. };
  334. struct pdc_cache_info { /* main-PDC_CACHE-structure (caches & TLB's) */
  335. /* I-cache */
  336. unsigned long ic_size; /* size in bytes */
  337. struct pdc_cache_cf ic_conf; /* configuration */
  338. unsigned long ic_base; /* base-addr */
  339. unsigned long ic_stride;
  340. unsigned long ic_count;
  341. unsigned long ic_loop;
  342. /* D-cache */
  343. unsigned long dc_size; /* size in bytes */
  344. struct pdc_cache_cf dc_conf; /* configuration */
  345. unsigned long dc_base; /* base-addr */
  346. unsigned long dc_stride;
  347. unsigned long dc_count;
  348. unsigned long dc_loop;
  349. /* Instruction-TLB */
  350. unsigned long it_size; /* number of entries in I-TLB */
  351. struct pdc_tlb_cf it_conf; /* I-TLB-configuration */
  352. unsigned long it_sp_base;
  353. unsigned long it_sp_stride;
  354. unsigned long it_sp_count;
  355. unsigned long it_off_base;
  356. unsigned long it_off_stride;
  357. unsigned long it_off_count;
  358. unsigned long it_loop;
  359. /* data-TLB */
  360. unsigned long dt_size; /* number of entries in D-TLB */
  361. struct pdc_tlb_cf dt_conf; /* D-TLB-configuration */
  362. unsigned long dt_sp_base;
  363. unsigned long dt_sp_stride;
  364. unsigned long dt_sp_count;
  365. unsigned long dt_off_base;
  366. unsigned long dt_off_stride;
  367. unsigned long dt_off_count;
  368. unsigned long dt_loop;
  369. };
  370. #if 0
  371. /* If you start using the next struct, you'll have to adjust it to
  372. * work with 64-bit firmware I think -PB
  373. */
  374. struct pdc_iodc { /* PDC_IODC */
  375. unsigned char hversion_model;
  376. unsigned char hversion;
  377. unsigned char spa;
  378. unsigned char type;
  379. unsigned int sversion_rev:4;
  380. unsigned int sversion_model:19;
  381. unsigned int sversion_opt:8;
  382. unsigned char rev;
  383. unsigned char dep;
  384. unsigned char features;
  385. unsigned char pad1;
  386. unsigned int checksum:16;
  387. unsigned int length:16;
  388. unsigned int pad[15];
  389. } __attribute__((aligned(8))) ;
  390. #endif
  391. #ifndef CONFIG_PA20
  392. /* no BLTBs in pa2.0 processors */
  393. struct pdc_btlb_info_range {
  394. __u8 res00;
  395. __u8 num_i;
  396. __u8 num_d;
  397. __u8 num_comb;
  398. };
  399. struct pdc_btlb_info { /* PDC_BLOCK_TLB, return of PDC_BTLB_INFO */
  400. unsigned int min_size; /* minimum size of BTLB in pages */
  401. unsigned int max_size; /* maximum size of BTLB in pages */
  402. struct pdc_btlb_info_range fixed_range_info;
  403. struct pdc_btlb_info_range variable_range_info;
  404. };
  405. #endif /* !CONFIG_PA20 */
  406. #ifdef CONFIG_64BIT
  407. struct pdc_memory_table_raddr { /* PDC_MEM/PDC_MEM_TABLE (return info) */
  408. unsigned long entries_returned;
  409. unsigned long entries_total;
  410. };
  411. struct pdc_memory_table { /* PDC_MEM/PDC_MEM_TABLE (arguments) */
  412. unsigned long paddr;
  413. unsigned int pages;
  414. unsigned int reserved;
  415. };
  416. #endif /* CONFIG_64BIT */
  417. struct pdc_system_map_mod_info { /* PDC_SYSTEM_MAP/FIND_MODULE */
  418. unsigned long mod_addr;
  419. unsigned long mod_pgs;
  420. unsigned long add_addrs;
  421. };
  422. struct pdc_system_map_addr_info { /* PDC_SYSTEM_MAP/FIND_ADDRESS */
  423. unsigned long mod_addr;
  424. unsigned long mod_pgs;
  425. };
  426. struct pdc_initiator { /* PDC_INITIATOR */
  427. int host_id;
  428. int factor;
  429. int width;
  430. int mode;
  431. };
  432. struct hardware_path {
  433. char flags; /* see bit definitions below */
  434. char bc[6]; /* Bus Converter routing info to a specific */
  435. /* I/O adaptor (< 0 means none, > 63 resvd) */
  436. char mod; /* fixed field of specified module */
  437. };
  438. /*
  439. * Device path specifications used by PDC.
  440. */
  441. struct pdc_module_path {
  442. struct hardware_path path;
  443. unsigned int layers[6]; /* device-specific info (ctlr #, unit # ...) */
  444. };
  445. #ifndef CONFIG_PA20
  446. /* Only used on some pre-PA2.0 boxes */
  447. struct pdc_memory_map { /* PDC_MEMORY_MAP */
  448. unsigned long hpa; /* mod's register set address */
  449. unsigned long more_pgs; /* number of additional I/O pgs */
  450. };
  451. #endif
  452. struct pdc_tod {
  453. unsigned long tod_sec;
  454. unsigned long tod_usec;
  455. };
  456. /* architected results from PDC_PIM/transfer hpmc on a PA1.1 machine */
  457. struct pdc_hpmc_pim_11 { /* PDC_PIM */
  458. __u32 gr[32];
  459. __u32 cr[32];
  460. __u32 sr[8];
  461. __u32 iasq_back;
  462. __u32 iaoq_back;
  463. __u32 check_type;
  464. __u32 cpu_state;
  465. __u32 rsvd1;
  466. __u32 cache_check;
  467. __u32 tlb_check;
  468. __u32 bus_check;
  469. __u32 assists_check;
  470. __u32 rsvd2;
  471. __u32 assist_state;
  472. __u32 responder_addr;
  473. __u32 requestor_addr;
  474. __u32 path_info;
  475. __u64 fr[32];
  476. };
  477. /*
  478. * architected results from PDC_PIM/transfer hpmc on a PA2.0 machine
  479. *
  480. * Note that PDC_PIM doesn't care whether or not wide mode was enabled
  481. * so the results are different on PA1.1 vs. PA2.0 when in narrow mode.
  482. *
  483. * Note also that there are unarchitected results available, which
  484. * are hversion dependent. Do a "ser pim 0 hpmc" after rebooting, since
  485. * the firmware is probably the best way of printing hversion dependent
  486. * data.
  487. */
  488. struct pdc_hpmc_pim_20 { /* PDC_PIM */
  489. __u64 gr[32];
  490. __u64 cr[32];
  491. __u64 sr[8];
  492. __u64 iasq_back;
  493. __u64 iaoq_back;
  494. __u32 check_type;
  495. __u32 cpu_state;
  496. __u32 cache_check;
  497. __u32 tlb_check;
  498. __u32 bus_check;
  499. __u32 assists_check;
  500. __u32 assist_state;
  501. __u32 path_info;
  502. __u64 responder_addr;
  503. __u64 requestor_addr;
  504. __u64 fr[32];
  505. };
  506. void pdc_console_init(void); /* in pdc_console.c */
  507. void pdc_console_restart(void);
  508. void setup_pdc(void); /* in inventory.c */
  509. /* wrapper-functions from pdc.c */
  510. int pdc_add_valid(unsigned long address);
  511. int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len);
  512. int pdc_chassis_disp(unsigned long disp);
  513. int pdc_chassis_warn(unsigned long *warn);
  514. int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info);
  515. int pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info);
  516. int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index,
  517. void *iodc_data, unsigned int iodc_data_size);
  518. int pdc_system_map_find_mods(struct pdc_system_map_mod_info *pdc_mod_info,
  519. struct pdc_module_path *mod_path, long mod_index);
  520. int pdc_system_map_find_addrs(struct pdc_system_map_addr_info *pdc_addr_info,
  521. long mod_index, long addr_index);
  522. int pdc_model_info(struct pdc_model *model);
  523. int pdc_model_sysmodel(char *name);
  524. int pdc_model_cpuid(unsigned long *cpu_id);
  525. int pdc_model_versions(unsigned long *versions, int id);
  526. int pdc_model_capabilities(unsigned long *capabilities);
  527. int pdc_cache_info(struct pdc_cache_info *cache);
  528. int pdc_spaceid_bits(unsigned long *space_bits);
  529. #ifndef CONFIG_PA20
  530. int pdc_btlb_info(struct pdc_btlb_info *btlb);
  531. int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path);
  532. #endif /* !CONFIG_PA20 */
  533. int pdc_lan_station_id(char *lan_addr, unsigned long net_hpa);
  534. int pdc_stable_read(unsigned long staddr, void *memaddr, unsigned long count);
  535. int pdc_stable_write(unsigned long staddr, void *memaddr, unsigned long count);
  536. int pdc_stable_get_size(unsigned long *size);
  537. int pdc_stable_verify_contents(void);
  538. int pdc_stable_initialize(void);
  539. int pdc_pci_irt_size(unsigned long *num_entries, unsigned long hpa);
  540. int pdc_pci_irt(unsigned long num_entries, unsigned long hpa, void *tbl);
  541. int pdc_get_initiator(struct hardware_path *, struct pdc_initiator *);
  542. int pdc_tod_read(struct pdc_tod *tod);
  543. int pdc_tod_set(unsigned long sec, unsigned long usec);
  544. #ifdef CONFIG_64BIT
  545. int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr,
  546. struct pdc_memory_table *tbl, unsigned long entries);
  547. #endif
  548. void set_firmware_width(void);
  549. void set_firmware_width_unlocked(void);
  550. int pdc_do_firm_test_reset(unsigned long ftc_bitmap);
  551. int pdc_do_reset(void);
  552. int pdc_soft_power_info(unsigned long *power_reg);
  553. int pdc_soft_power_button(int sw_control);
  554. void pdc_io_reset(void);
  555. void pdc_io_reset_devices(void);
  556. int pdc_iodc_getc(void);
  557. int pdc_iodc_print(const unsigned char *str, unsigned count);
  558. void pdc_emergency_unlock(void);
  559. int pdc_sti_call(unsigned long func, unsigned long flags,
  560. unsigned long inptr, unsigned long outputr,
  561. unsigned long glob_cfg);
  562. static inline char * os_id_to_string(u16 os_id) {
  563. switch(os_id) {
  564. case OS_ID_NONE: return "No OS";
  565. case OS_ID_HPUX: return "HP-UX";
  566. case OS_ID_MPEXL: return "MPE-iX";
  567. case OS_ID_OSF: return "OSF";
  568. case OS_ID_HPRT: return "HP-RT";
  569. case OS_ID_NOVEL: return "Novell Netware";
  570. case OS_ID_LINUX: return "Linux";
  571. default: return "Unknown";
  572. }
  573. }
  574. #endif /* __KERNEL__ */
  575. #define PAGE0 ((struct zeropage *)__PAGE_OFFSET)
  576. /* DEFINITION OF THE ZERO-PAGE (PAG0) */
  577. /* based on work by Jason Eckhardt (jason@equator.com) */
  578. /* flags of the device_path */
  579. #define PF_AUTOBOOT 0x80
  580. #define PF_AUTOSEARCH 0x40
  581. #define PF_TIMER 0x0F
  582. struct device_path { /* page 1-69 */
  583. unsigned char flags; /* flags see above! */
  584. unsigned char bc[6]; /* bus converter routing info */
  585. unsigned char mod;
  586. unsigned int layers[6];/* device-specific layer-info */
  587. } __attribute__((aligned(8))) ;
  588. struct pz_device {
  589. struct device_path dp; /* see above */
  590. /* struct iomod *hpa; */
  591. unsigned int hpa; /* HPA base address */
  592. /* char *spa; */
  593. unsigned int spa; /* SPA base address */
  594. /* int (*iodc_io)(struct iomod*, ...); */
  595. unsigned int iodc_io; /* device entry point */
  596. short pad; /* reserved */
  597. unsigned short cl_class;/* see below */
  598. } __attribute__((aligned(8))) ;
  599. struct zeropage {
  600. /* [0x000] initialize vectors (VEC) */
  601. unsigned int vec_special; /* must be zero */
  602. /* int (*vec_pow_fail)(void);*/
  603. unsigned int vec_pow_fail; /* power failure handler */
  604. /* int (*vec_toc)(void); */
  605. unsigned int vec_toc;
  606. unsigned int vec_toclen;
  607. /* int (*vec_rendz)(void); */
  608. unsigned int vec_rendz;
  609. int vec_pow_fail_flen;
  610. int vec_pad[10];
  611. /* [0x040] reserved processor dependent */
  612. int pad0[112];
  613. /* [0x200] reserved */
  614. int pad1[84];
  615. /* [0x350] memory configuration (MC) */
  616. int memc_cont; /* contiguous mem size (bytes) */
  617. int memc_phsize; /* physical memory size */
  618. int memc_adsize; /* additional mem size, bytes of SPA space used by PDC */
  619. unsigned int mem_pdc_hi; /* used for 64-bit */
  620. /* [0x360] various parameters for the boot-CPU */
  621. /* unsigned int *mem_booterr[8]; */
  622. unsigned int mem_booterr[8]; /* ptr to boot errors */
  623. unsigned int mem_free; /* first location, where OS can be loaded */
  624. /* struct iomod *mem_hpa; */
  625. unsigned int mem_hpa; /* HPA of the boot-CPU */
  626. /* int (*mem_pdc)(int, ...); */
  627. unsigned int mem_pdc; /* PDC entry point */
  628. unsigned int mem_10msec; /* number of clock ticks in 10msec */
  629. /* [0x390] initial memory module (IMM) */
  630. /* struct iomod *imm_hpa; */
  631. unsigned int imm_hpa; /* HPA of the IMM */
  632. int imm_soft_boot; /* 0 = was hard boot, 1 = was soft boot */
  633. unsigned int imm_spa_size; /* SPA size of the IMM in bytes */
  634. unsigned int imm_max_mem; /* bytes of mem in IMM */
  635. /* [0x3A0] boot console, display device and keyboard */
  636. struct pz_device mem_cons; /* description of console device */
  637. struct pz_device mem_boot; /* description of boot device */
  638. struct pz_device mem_kbd; /* description of keyboard device */
  639. /* [0x430] reserved */
  640. int pad430[116];
  641. /* [0x600] processor dependent */
  642. __u32 pad600[1];
  643. __u32 proc_sti; /* pointer to STI ROM */
  644. __u32 pad608[126];
  645. };
  646. #endif /* !defined(__ASSEMBLY__) */
  647. #endif /* _PARISC_PDC_H */