#define REGVAL(r) (*(volatile int32_t *)ALPHA_PHYS_TO_K0SEG(r))
#define REGVAL64(r) (*(volatile int64_t *)ALPHA_PHYS_TO_K0SEG(r))
#define LCA_MEMC_BASE 0x120000000L
#define LCA_IOC_BASE 0x180000000L
#define LCA_PCI_SIO 0x1c0000000L
#define LCA_PCI_CONF 0x1e0000000L
#define LCA_PCI_SPARSE 0x200000000L
#define LCA_PCI_DENSE 0x300000000L
#define LCA_MEMC_BCR0 (LCA_MEMC_BASE + 0x00)
#define LCA_MEMC_BCR1 (LCA_MEMC_BASE + 0x08)
#define LCA_MEMC_BCR2 (LCA_MEMC_BASE + 0x10)
#define LCA_MEMC_BCR3 (LCA_MEMC_BASE + 0x18)
#define LCA_MEMC_BMR0 (LCA_MEMC_BASE + 0x20)
#define LCA_MEMC_BMR1 (LCA_MEMC_BASE + 0x28)
#define LCA_MEMC_BMR2 (LCA_MEMC_BASE + 0x30)
#define LCA_MEMC_BMR3 (LCA_MEMC_BASE + 0x38)
#define LCA_MEMC_BTR0 (LCA_MEMC_BASE + 0x40)
#define LCA_MEMC_BTR1 (LCA_MEMC_BASE + 0x48)
#define LCA_MEMC_BTR2 (LCA_MEMC_BASE + 0x50)
#define LCA_MEMC_BTR3 (LCA_MEMC_BASE + 0x58)
#define LCA_MEMC_GTR (LCA_MEMC_BASE + 0x60)
#define LCA_MEMC_ESR (LCA_MEMC_BASE + 0x68)
#define LCA_MEMC_EAR (LCA_MEMC_BASE + 0x70)
#define LCA_MEMC_CAR (LCA_MEMC_BASE + 0x78)
#define LCA_MEMC_VGR (LCA_MEMC_BASE + 0x80)
#define LCA_MEMC_PLM (LCA_MEMC_BASE + 0x88)
#define LCA_MEMC_FOR (LCA_MEMC_BASE + 0x90)
#define MEMC_CAR_BCE __BIT(0)
#define MEMC_CAR_ETP __BIT(2)
#define MEMC_CAR_WWP __BIT(3)
#define MEMC_CAR_ECE __BIT(4)
#define MEMC_CAR_BCS __BITS(5,7)
#define MEMC_CAR_RCC __BITS(8,10)
#define MEMC_CAR_WCC __BITS(11,13)
#define MEMC_CAR_WHD __BIT(14)
#define MEMC_CAR_PWR __BIT(15)
#define MEMC_CAR_TAG __BITS(16,30)
#define MEMC_CAR_HIT __BIT(31)
#define BCS_64K 0
#define BCS_128K 1
#define BCS_256K 2
#define BCS_512K 3
#define BCS_1M 4
#define BCS_2M 5
#define LCA_IOC_HAE LCA_IOC_BASE
#define IOC_HAE_ADDREXT 0x00000000f8000000UL
#define IOC_HAE_RSVSD 0xffffffff07ffffffUL
#define LCA_IOC_CONF (LCA_IOC_BASE + 0x020)
#define LCA_IOC_STAT0 (LCA_IOC_BASE + 0x040)
#define IOC_STAT0_CMD 0x000000000000000fUL
#define IOC_STAT0_ERR 0x0000000000000010UL
#define IOC_STAT0_LOST 0x0000000000000020UL
#define IOC_STAT0_THIT 0x0000000000000040UL
#define IOC_STAT0_TREF 0x0000000000000080UL
#define IOC_STAT0_CODE 0x0000000000000700UL
#define IOC_STAT0_CODESHIFT 8
#define IOC_STAT0_P_NBR 0x00000000ffffe000UL
#define LCA_IOC_STAT1 (LCA_IOC_BASE + 0x060)
#define IOC_STAT1_ADDR 0x00000000ffffffffUL
#define LCA_IOC_TBIA (LCA_IOC_BASE + 0x080)
#define LCA_IOC_TB_ENA (LCA_IOC_BASE + 0x0a0)
#define IOC_TB_ENA_TEN 0x0000000000000080UL
#define LCA_IOC_W_BASE0 (LCA_IOC_BASE + 0x100)
#define LCA_IOC_W_MASK0 (LCA_IOC_BASE + 0x140)
#define LCA_IOC_W_T_BASE0 (LCA_IOC_BASE + 0x180)
#define LCA_IOC_W_BASE1 (LCA_IOC_BASE + 0x120)
#define LCA_IOC_W_MASK1 (LCA_IOC_BASE + 0x160)
#define LCA_IOC_W_T_BASE1 (LCA_IOC_BASE + 0x1a0)
#define IOC_W_BASE_W_BASE 0x00000000fff00000UL
#define IOC_W_BASE_SG 0x0000000100000000UL
#define IOC_W_BASE_WEN 0x0000000200000000UL
#define IOC_W_MASK_1M 0x0000000000000000UL
#define IOC_W_MASK_2M 0x0000000000100000UL
#define IOC_W_MASK_4M 0x0000000000300000UL
#define IOC_W_MASK_8M 0x0000000000700000UL
#define IOC_W_MASK_16M 0x0000000000f00000UL
#define IOC_W_MASK_32M 0x0000000001f00000UL
#define IOC_W_MASK_64M 0x0000000003f00000UL
#define IOC_W_MASK_128M 0x0000000007f00000UL
#define IOC_W_MASK_256M 0x000000000ff00000UL
#define IOC_W_MASK_512M 0x000000001ff00000UL
#define IOC_W_MASK_1G 0x000000003ff00000UL
#define IOC_W_MASK_2G 0x000000007ff00000UL
#define IOC_W_MASK_4G 0x00000000fff00000UL
#define IOC_W_T_BASE 0x00000000fffffc00UL