Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __ALPHA_HWRPB_H
0003 #define __ALPHA_HWRPB_H
0004 
0005 #define INIT_HWRPB ((struct hwrpb_struct *) 0x10000000)
0006 
0007 /*
0008  * DEC processor types for Alpha systems.  Found in HWRPB.
0009  * These values are architected.
0010  */
0011 
0012 #define EV3_CPU                 1       /* EV3                  */
0013 #define EV4_CPU                 2       /* EV4 (21064)          */
0014 #define LCA4_CPU                4       /* LCA4 (21066/21068)   */
0015 #define EV5_CPU                 5       /* EV5 (21164)          */
0016 #define EV45_CPU                6       /* EV4.5 (21064/xxx)    */
0017 #define EV56_CPU        7   /* EV5.6 (21164)    */
0018 #define EV6_CPU         8   /* EV6 (21264)      */
0019 #define PCA56_CPU       9   /* PCA56 (21164PC)  */
0020 #define PCA57_CPU       10  /* PCA57 (notyet)   */
0021 #define EV67_CPU        11  /* EV67 (21264A)    */
0022 #define EV68CB_CPU      12  /* EV68CB (21264C)  */
0023 #define EV68AL_CPU      13  /* EV68AL (21264B)  */
0024 #define EV68CX_CPU      14  /* EV68CX (21264D)  */
0025 #define EV7_CPU         15  /* EV7 (21364)      */
0026 #define EV79_CPU        16  /* EV79 (21364??)   */
0027 #define EV69_CPU        17  /* EV69 (21264/EV69A)   */
0028 
0029 /*
0030  * DEC system types for Alpha systems.  Found in HWRPB.
0031  * These values are architected.
0032  */
0033 
0034 #define ST_ADU            1 /* Alpha ADU systype    */
0035 #define ST_DEC_4000       2 /* Cobra systype    */
0036 #define ST_DEC_7000       3 /* Ruby systype     */
0037 #define ST_DEC_3000_500       4 /* Flamingo systype */
0038 #define ST_DEC_2000_300       6 /* Jensen systype   */
0039 #define ST_DEC_3000_300       7 /* Pelican systype  */
0040 #define ST_DEC_2100_A500      9 /* Sable systype    */
0041 #define ST_DEC_AXPVME_64     10 /* AXPvme system type   */
0042 #define ST_DEC_AXPPCI_33     11 /* NoName system type   */
0043 #define ST_DEC_TLASER        12 /* Turbolaser systype   */
0044 #define ST_DEC_2100_A50      13 /* Avanti systype   */
0045 #define ST_DEC_MUSTANG       14 /* Mustang systype  */
0046 #define ST_DEC_ALCOR         15 /* Alcor (EV5) systype  */
0047 #define ST_DEC_1000      17 /* Mikasa systype   */
0048 #define ST_DEC_EB64      18 /* EB64 systype     */
0049 #define ST_DEC_EB66      19 /* EB66 systype     */
0050 #define ST_DEC_EB64P         20 /* EB64+ systype    */
0051 #define ST_DEC_BURNS         21 /* laptop systype   */
0052 #define ST_DEC_RAWHIDE       22 /* Rawhide systype  */
0053 #define ST_DEC_K2        23 /* K2 systype       */
0054 #define ST_DEC_LYNX      24 /* Lynx systype     */
0055 #define ST_DEC_XL        25 /* Alpha XL systype */
0056 #define ST_DEC_EB164         26 /* EB164 systype    */
0057 #define ST_DEC_NORITAKE      27 /* Noritake systype */
0058 #define ST_DEC_CORTEX        28 /* Cortex systype   */
0059 #define ST_DEC_MIATA         30 /* Miata systype        */
0060 #define ST_DEC_XXM       31 /* XXM systype      */
0061 #define ST_DEC_TAKARA        32 /* Takara systype   */
0062 #define ST_DEC_YUKON         33 /* Yukon systype    */
0063 #define ST_DEC_TSUNAMI       34 /* Tsunami systype  */
0064 #define ST_DEC_WILDFIRE      35 /* Wildfire systype */
0065 #define ST_DEC_CUSCO         36 /* CUSCO systype    */
0066 #define ST_DEC_EIGER         37 /* Eiger systype    */
0067 #define ST_DEC_TITAN         38 /* Titan systype    */
0068 #define ST_DEC_MARVEL        39 /* Marvel systype   */
0069 
0070 /* UNOFFICIAL!!! */
0071 #define ST_UNOFFICIAL_BIAS  100
0072 #define ST_DTI_RUFFIAN      101 /* RUFFIAN systype  */
0073 
0074 /* Alpha Processor, Inc. systems */
0075 #define ST_API_BIAS     200
0076 #define ST_API_NAUTILUS     201 /* UP1000 systype   */
0077 
0078 struct pcb_struct {
0079     unsigned long ksp;
0080     unsigned long usp;
0081     unsigned long ptbr;
0082     unsigned int pcc;
0083     unsigned int asn;
0084     unsigned long unique;
0085     unsigned long flags;
0086     unsigned long res1, res2;
0087 };
0088 
0089 struct percpu_struct {
0090     unsigned long hwpcb[16];
0091     unsigned long flags;
0092     unsigned long pal_mem_size;
0093     unsigned long pal_scratch_size;
0094     unsigned long pal_mem_pa;
0095     unsigned long pal_scratch_pa;
0096     unsigned long pal_revision;
0097     unsigned long type;
0098     unsigned long variation;
0099     unsigned long revision;
0100     unsigned long serial_no[2];
0101     unsigned long logout_area_pa;
0102     unsigned long logout_area_len;
0103     unsigned long halt_PCBB;
0104     unsigned long halt_PC;
0105     unsigned long halt_PS;
0106     unsigned long halt_arg;
0107     unsigned long halt_ra;
0108     unsigned long halt_pv;
0109     unsigned long halt_reason;
0110     unsigned long res;
0111     unsigned long ipc_buffer[21];
0112     unsigned long palcode_avail[16];
0113     unsigned long compatibility;
0114     unsigned long console_data_log_pa;
0115     unsigned long console_data_log_length;
0116     unsigned long bcache_info;
0117 };
0118 
0119 struct procdesc_struct {
0120     unsigned long weird_vms_stuff;
0121     unsigned long address;
0122 };
0123 
0124 struct vf_map_struct {
0125     unsigned long va;
0126     unsigned long pa;
0127     unsigned long count;
0128 };
0129 
0130 struct crb_struct {
0131     struct procdesc_struct * dispatch_va;
0132     struct procdesc_struct * dispatch_pa;
0133     struct procdesc_struct * fixup_va;
0134     struct procdesc_struct * fixup_pa;
0135     /* virtual->physical map */
0136     unsigned long map_entries;
0137     unsigned long map_pages;
0138     struct vf_map_struct map[1];
0139 };
0140 
0141 struct memclust_struct {
0142     unsigned long start_pfn;
0143     unsigned long numpages;
0144     unsigned long numtested;
0145     unsigned long bitmap_va;
0146     unsigned long bitmap_pa;
0147     unsigned long bitmap_chksum;
0148     unsigned long usage;
0149 };
0150 
0151 struct memdesc_struct {
0152     unsigned long chksum;
0153     unsigned long optional_pa;
0154     unsigned long numclusters;
0155     struct memclust_struct cluster[];
0156 };
0157 
0158 struct dsr_struct {
0159     long smm;           /* SMM nubber used by LMF       */
0160     unsigned long  lurt_off;    /* offset to LURT table         */
0161     unsigned long  sysname_off; /* offset to sysname char count */
0162 };
0163 
0164 struct hwrpb_struct {
0165     unsigned long phys_addr;    /* check: physical address of the hwrpb */
0166     unsigned long id;       /* check: "HWRPB\0\0\0" */
0167     unsigned long revision; 
0168     unsigned long size;     /* size of hwrpb */
0169     unsigned long cpuid;
0170     unsigned long pagesize;     /* 8192, I hope */
0171     unsigned long pa_bits;      /* number of physical address bits */
0172     unsigned long max_asn;
0173     unsigned char ssn[16];      /* system serial number: big bother is watching */
0174     unsigned long sys_type;
0175     unsigned long sys_variation;
0176     unsigned long sys_revision;
0177     unsigned long intr_freq;    /* interval clock frequency * 4096 */
0178     unsigned long cycle_freq;   /* cycle counter frequency */
0179     unsigned long vptb;     /* Virtual Page Table Base address */
0180     unsigned long res1;
0181     unsigned long tbhb_offset;  /* Translation Buffer Hint Block */
0182     unsigned long nr_processors;
0183     unsigned long processor_size;
0184     unsigned long processor_offset;
0185     unsigned long ctb_nr;
0186     unsigned long ctb_size;     /* console terminal block size */
0187     unsigned long ctbt_offset;  /* console terminal block table offset */
0188     unsigned long crb_offset;   /* console callback routine block */
0189     unsigned long mddt_offset;  /* memory data descriptor table */
0190     unsigned long cdb_offset;   /* configuration data block (or NULL) */
0191     unsigned long frut_offset;  /* FRU table (or NULL) */
0192     void (*save_terminal)(unsigned long);
0193     unsigned long save_terminal_data;
0194     void (*restore_terminal)(unsigned long);
0195     unsigned long restore_terminal_data;
0196     void (*CPU_restart)(unsigned long);
0197     unsigned long CPU_restart_data;
0198     unsigned long res2;
0199     unsigned long res3;
0200     unsigned long chksum;
0201     unsigned long rxrdy;
0202     unsigned long txrdy;
0203     unsigned long dsr_offset;   /* "Dynamic System Recognition Data Block Table" */
0204 };
0205 
0206 #ifdef __KERNEL__
0207 
0208 extern struct hwrpb_struct *hwrpb;
0209 
0210 static inline void
0211 hwrpb_update_checksum(struct hwrpb_struct *h)
0212 {
0213     unsigned long sum = 0, *l;
0214         for (l = (unsigned long *) h; l < (unsigned long *) &h->chksum; ++l)
0215                 sum += *l;
0216         h->chksum = sum;
0217 }
0218 
0219 #endif /* __KERNEL__ */
0220 
0221 #endif /* __ALPHA_HWRPB_H */