Home | History | Annotate | Line # | Download | only in pci
      1  1.10  thorpej /* $NetBSD: lcareg.h,v 1.10 2021/07/16 17:09:33 thorpej Exp $ */
      2   1.1      cgd 
      3   1.1      cgd /*
      4   1.1      cgd  * Copyright (c) 1995 Carnegie-Mellon University.
      5   1.1      cgd  * All rights reserved.
      6   1.1      cgd  *
      7   1.7  thorpej  * Authors: Jeffrey Hsu, Jason R. Thorpe
      8   1.9     matt  *
      9   1.1      cgd  * Permission to use, copy, modify and distribute this software and
     10   1.1      cgd  * its documentation is hereby granted, provided that both the copyright
     11   1.1      cgd  * notice and this permission notice appear in all copies of the
     12   1.1      cgd  * software, derivative works or modified versions, and any portions
     13   1.1      cgd  * thereof, and that both notices appear in supporting documentation.
     14   1.9     matt  *
     15   1.9     matt  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     16   1.9     matt  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     17   1.1      cgd  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     18   1.9     matt  *
     19   1.1      cgd  * Carnegie Mellon requests users of this software to return to
     20   1.1      cgd  *
     21   1.1      cgd  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     22   1.1      cgd  *  School of Computer Science
     23   1.1      cgd  *  Carnegie Mellon University
     24   1.1      cgd  *  Pittsburgh PA 15213-3890
     25   1.1      cgd  *
     26   1.1      cgd  * any improvements or extensions that they make and grant Carnegie the
     27   1.1      cgd  * rights to redistribute these changes.
     28   1.1      cgd  */
     29   1.1      cgd 
     30   1.1      cgd /*
     31   1.1      cgd  * 21066 chip registers
     32   1.1      cgd  */
     33   1.1      cgd 
     34   1.6      cgd #define REGVAL(r)	(*(volatile int32_t *)ALPHA_PHYS_TO_K0SEG(r))
     35   1.6      cgd #define REGVAL64(r)	(*(volatile int64_t *)ALPHA_PHYS_TO_K0SEG(r))
     36   1.1      cgd 
     37   1.1      cgd /*
     38   1.1      cgd  * Base addresses
     39   1.1      cgd  */
     40  1.10  thorpej #define	LCA_MEMC_BASE	0x120000000L		/* LCA memory controller regs */
     41   1.1      cgd #define LCA_IOC_BASE	0x180000000L		/* LCA IOC Regs */
     42   1.1      cgd #define LCA_PCI_SIO	0x1c0000000L		/* PCI Sp. I/O Space */
     43   1.1      cgd #define LCA_PCI_CONF	0x1e0000000L		/* PCI Conf. Space */
     44   1.1      cgd #define LCA_PCI_SPARSE	0x200000000L		/* PCI Sparse Space */
     45   1.1      cgd #define LCA_PCI_DENSE	0x300000000L		/* PCI Dense Space */
     46   1.1      cgd 
     47  1.10  thorpej #define LCA_MEMC_BCR0	(LCA_MEMC_BASE + 0x00)	/* Bank Configuration 0 */
     48  1.10  thorpej #define LCA_MEMC_BCR1	(LCA_MEMC_BASE + 0x08)	/* Bank Configuration 1 */
     49  1.10  thorpej #define LCA_MEMC_BCR2	(LCA_MEMC_BASE + 0x10)	/* Bank Configuration 2 */
     50  1.10  thorpej #define LCA_MEMC_BCR3	(LCA_MEMC_BASE + 0x18)	/* Bank Configuration 3 */
     51  1.10  thorpej #define LCA_MEMC_BMR0	(LCA_MEMC_BASE + 0x20)	/* Bank Address Mask 0 */
     52  1.10  thorpej #define LCA_MEMC_BMR1	(LCA_MEMC_BASE + 0x28)	/* Bank Address Mask 1 */
     53  1.10  thorpej #define LCA_MEMC_BMR2	(LCA_MEMC_BASE + 0x30)	/* Bank Address Mask 2 */
     54  1.10  thorpej #define LCA_MEMC_BMR3	(LCA_MEMC_BASE + 0x38)	/* Bank Address Mask 3 */
     55  1.10  thorpej #define LCA_MEMC_BTR0	(LCA_MEMC_BASE + 0x40)	/* Bank Timing 0 */
     56  1.10  thorpej #define LCA_MEMC_BTR1	(LCA_MEMC_BASE + 0x48)	/* Bank Timing 1 */
     57  1.10  thorpej #define LCA_MEMC_BTR2	(LCA_MEMC_BASE + 0x50)	/* Bank Timing 2 */
     58  1.10  thorpej #define LCA_MEMC_BTR3	(LCA_MEMC_BASE + 0x58)	/* Bank Timing 3 */
     59  1.10  thorpej #define LCA_MEMC_GTR	(LCA_MEMC_BASE + 0x60)	/* Global Timing */
     60  1.10  thorpej #define LCA_MEMC_ESR	(LCA_MEMC_BASE + 0x68)	/* Error Status */
     61  1.10  thorpej #define LCA_MEMC_EAR	(LCA_MEMC_BASE + 0x70)	/* Error Address */
     62  1.10  thorpej #define LCA_MEMC_CAR	(LCA_MEMC_BASE + 0x78)	/* Cache */
     63  1.10  thorpej #define LCA_MEMC_VGR	(LCA_MEMC_BASE + 0x80)	/* Video and Graphics Control */
     64  1.10  thorpej #define LCA_MEMC_PLM	(LCA_MEMC_BASE + 0x88)	/* Plane mask */
     65  1.10  thorpej #define LCA_MEMC_FOR	(LCA_MEMC_BASE + 0x90)	/* Foreground */
     66  1.10  thorpej 
     67  1.10  thorpej #define MEMC_CAR_BCE	__BIT(0)	/* Bcache enable */
     68  1.10  thorpej #define MEMC_CAR_ETP	__BIT(2)	/* Enable tag parity check */
     69  1.10  thorpej #define MEMC_CAR_WWP	__BIT(3)	/* Write wrong tag parity */
     70  1.10  thorpej #define MEMC_CAR_ECE	__BIT(4)	/* Enable Bcache ECC */
     71  1.10  thorpej #define MEMC_CAR_BCS	__BITS(5,7)	/* Bcache size */
     72  1.10  thorpej #define MEMC_CAR_RCC	__BITS(8,10)	/* Read Cycle Count */
     73  1.10  thorpej #define MEMC_CAR_WCC	__BITS(11,13)	/* Write Cycle Count */
     74  1.10  thorpej #define MEMC_CAR_WHD	__BIT(14)	/* Write Hold Time */
     75  1.10  thorpej #define MEMC_CAR_PWR	__BIT(15)	/* Power Saving */
     76  1.10  thorpej #define MEMC_CAR_TAG	__BITS(16,30)	/* latched Bcache tag value */
     77  1.10  thorpej #define MEMC_CAR_HIT	__BIT(31)	/* Bcache hit */
     78  1.10  thorpej 
     79  1.10  thorpej #define BCS_64K		0
     80  1.10  thorpej #define BCS_128K	1
     81  1.10  thorpej #define BCS_256K	2
     82  1.10  thorpej #define BCS_512K	3
     83  1.10  thorpej #define BCS_1M		4
     84  1.10  thorpej #define BCS_2M		5
     85  1.10  thorpej 
     86   1.4      cgd #define LCA_IOC_HAE	LCA_IOC_BASE		/* Host Address Ext. (64) */
     87   1.4      cgd #define	IOC_HAE_ADDREXT	0x00000000f8000000UL
     88   1.4      cgd #define	IOC_HAE_RSVSD	0xffffffff07ffffffUL
     89   1.1      cgd 
     90   1.1      cgd #define LCA_IOC_CONF	(LCA_IOC_BASE + 0x020)	/* Configuration Cycle Type */
     91   1.8  thorpej 
     92   1.2      cgd #define LCA_IOC_STAT0	(LCA_IOC_BASE + 0x040)	/* Status 0 */
     93   1.8  thorpej #define	IOC_STAT0_CMD	0x000000000000000fUL	/* PCI command mask */
     94   1.8  thorpej #define	IOC_STAT0_ERR	0x0000000000000010UL	/* IOC error indicator R/W1C */
     95   1.8  thorpej #define	IOC_STAT0_LOST	0x0000000000000020UL	/* IOC lose error info R/W1C */
     96   1.8  thorpej #define	IOC_STAT0_THIT	0x0000000000000040UL	/* test hit */
     97   1.8  thorpej #define	IOC_STAT0_TREF	0x0000000000000080UL	/* test reference */
     98   1.8  thorpej #define	IOC_STAT0_CODE	0x0000000000000700UL	/* code mask */
     99   1.8  thorpej #define	IOC_STAT0_CODESHIFT 8
    100   1.8  thorpej #define	IOC_STAT0_P_NBR	0x00000000ffffe000UL	/* page number mask */
    101   1.8  thorpej 
    102   1.2      cgd #define LCA_IOC_STAT1	(LCA_IOC_BASE + 0x060)	/* Status 1 */
    103   1.8  thorpej #define	IOC_STAT1_ADDR	0x00000000ffffffffUL	/* PCI address mask */
    104   1.1      cgd 
    105   1.7  thorpej #define	LCA_IOC_TBIA	(LCA_IOC_BASE + 0x080)	/* TLB Invalidate All */
    106   1.7  thorpej #define	LCA_IOC_TB_ENA	(LCA_IOC_BASE + 0x0a0)	/* TLB Enable */
    107   1.7  thorpej #define	IOC_TB_ENA_TEN	0x0000000000000080UL
    108   1.7  thorpej 
    109   1.1      cgd #define LCA_IOC_W_BASE0	(LCA_IOC_BASE + 0x100)	/* Window Base */
    110   1.1      cgd #define LCA_IOC_W_MASK0	(LCA_IOC_BASE + 0x140)	/* Window Mask */
    111   1.1      cgd #define LCA_IOC_W_T_BASE0 (LCA_IOC_BASE + 0x180) /* Translated Base */
    112   1.1      cgd 
    113   1.1      cgd #define LCA_IOC_W_BASE1	(LCA_IOC_BASE + 0x120)	/* Window Base */
    114   1.1      cgd #define LCA_IOC_W_MASK1	(LCA_IOC_BASE + 0x160)	/* Window Mask */
    115   1.1      cgd #define LCA_IOC_W_T_BASE1 (LCA_IOC_BASE + 0x1a0) /* Translated Base */
    116   1.7  thorpej 
    117   1.7  thorpej #define	IOC_W_BASE_W_BASE 0x00000000fff00000UL	/* Window base value */
    118   1.7  thorpej #define	IOC_W_BASE_SG	  0x0000000100000000UL	/* Window uses SGMAPs */
    119   1.7  thorpej #define	IOC_W_BASE_WEN	  0x0000000200000000UL	/* Window enable */
    120   1.7  thorpej 
    121   1.7  thorpej #define	IOC_W_MASK_1M	0x0000000000000000UL	/* 1MB window */
    122   1.7  thorpej #define	IOC_W_MASK_2M	0x0000000000100000UL	/* 2MB window */
    123   1.7  thorpej #define	IOC_W_MASK_4M	0x0000000000300000UL	/* 4MB window */
    124   1.7  thorpej #define	IOC_W_MASK_8M	0x0000000000700000UL	/* 8MB window */
    125   1.7  thorpej #define	IOC_W_MASK_16M	0x0000000000f00000UL	/* 16MB window */
    126   1.7  thorpej #define	IOC_W_MASK_32M	0x0000000001f00000UL	/* 32MB window */
    127   1.7  thorpej #define	IOC_W_MASK_64M	0x0000000003f00000UL	/* 64MB window */
    128   1.7  thorpej #define	IOC_W_MASK_128M	0x0000000007f00000UL	/* 128M window */
    129   1.7  thorpej #define	IOC_W_MASK_256M	0x000000000ff00000UL	/* 256M window */
    130   1.7  thorpej #define	IOC_W_MASK_512M	0x000000001ff00000UL	/* 512M window */
    131   1.7  thorpej #define	IOC_W_MASK_1G	0x000000003ff00000UL	/* 1GB window */
    132   1.7  thorpej #define	IOC_W_MASK_2G	0x000000007ff00000UL	/* 2GB window */
    133   1.7  thorpej #define	IOC_W_MASK_4G	0x00000000fff00000UL	/* 4GB window */
    134   1.7  thorpej 
    135   1.7  thorpej #define	IOC_W_T_BASE	0x00000000fffffc00UL	/* page table base */
    136