162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * PCI Register definitions for the MIPS System Controller. 362306a36Sopenharmony_ci * 462306a36Sopenharmony_ci * Copyright (C) 2004 MIPS Technologies, Inc. All rights reserved. 562306a36Sopenharmony_ci * 662306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public 762306a36Sopenharmony_ci * License. See the file "COPYING" in the main directory of this archive 862306a36Sopenharmony_ci * for more details. 962306a36Sopenharmony_ci */ 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci#ifndef __ASM_MIPS_BOARDS_MSC01_IC_H 1262306a36Sopenharmony_ci#define __ASM_MIPS_BOARDS_MSC01_IC_H 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci/***************************************************************************** 1562306a36Sopenharmony_ci * Register offset addresses 1662306a36Sopenharmony_ci *****************************************************************************/ 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci#define MSC01_IC_RST_OFS 0x00008 /* Software reset */ 1962306a36Sopenharmony_ci#define MSC01_IC_ENAL_OFS 0x00100 /* Int_in enable mask 31:0 */ 2062306a36Sopenharmony_ci#define MSC01_IC_ENAH_OFS 0x00108 /* Int_in enable mask 63:32 */ 2162306a36Sopenharmony_ci#define MSC01_IC_DISL_OFS 0x00120 /* Int_in disable mask 31:0 */ 2262306a36Sopenharmony_ci#define MSC01_IC_DISH_OFS 0x00128 /* Int_in disable mask 63:32 */ 2362306a36Sopenharmony_ci#define MSC01_IC_ISBL_OFS 0x00140 /* Raw int_in 31:0 */ 2462306a36Sopenharmony_ci#define MSC01_IC_ISBH_OFS 0x00148 /* Raw int_in 63:32 */ 2562306a36Sopenharmony_ci#define MSC01_IC_ISAL_OFS 0x00160 /* Masked int_in 31:0 */ 2662306a36Sopenharmony_ci#define MSC01_IC_ISAH_OFS 0x00168 /* Masked int_in 63:32 */ 2762306a36Sopenharmony_ci#define MSC01_IC_LVL_OFS 0x00180 /* Disable priority int_out */ 2862306a36Sopenharmony_ci#define MSC01_IC_RAMW_OFS 0x00180 /* Shadow set RAM (EI) */ 2962306a36Sopenharmony_ci#define MSC01_IC_OSB_OFS 0x00188 /* Raw int_out */ 3062306a36Sopenharmony_ci#define MSC01_IC_OSA_OFS 0x00190 /* Masked int_out */ 3162306a36Sopenharmony_ci#define MSC01_IC_GENA_OFS 0x00198 /* Global HW int enable */ 3262306a36Sopenharmony_ci#define MSC01_IC_BASE_OFS 0x001a0 /* Base address of IC_VEC */ 3362306a36Sopenharmony_ci#define MSC01_IC_VEC_OFS 0x001b0 /* Active int's vector address */ 3462306a36Sopenharmony_ci#define MSC01_IC_EOI_OFS 0x001c0 /* Enable lower level ints */ 3562306a36Sopenharmony_ci#define MSC01_IC_CFG_OFS 0x001c8 /* Configuration register */ 3662306a36Sopenharmony_ci#define MSC01_IC_TRLD_OFS 0x001d0 /* Interval timer reload val */ 3762306a36Sopenharmony_ci#define MSC01_IC_TVAL_OFS 0x001e0 /* Interval timer current val */ 3862306a36Sopenharmony_ci#define MSC01_IC_TCFG_OFS 0x001f0 /* Interval timer config */ 3962306a36Sopenharmony_ci#define MSC01_IC_SUP_OFS 0x00200 /* Set up int_in line 0 */ 4062306a36Sopenharmony_ci#define MSC01_IC_ENA_OFS 0x00800 /* Int_in enable mask 63:0 */ 4162306a36Sopenharmony_ci#define MSC01_IC_DIS_OFS 0x00820 /* Int_in disable mask 63:0 */ 4262306a36Sopenharmony_ci#define MSC01_IC_ISB_OFS 0x00840 /* Raw int_in 63:0 */ 4362306a36Sopenharmony_ci#define MSC01_IC_ISA_OFS 0x00860 /* Masked int_in 63:0 */ 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci/***************************************************************************** 4662306a36Sopenharmony_ci * Register field encodings 4762306a36Sopenharmony_ci *****************************************************************************/ 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ci#define MSC01_IC_RST_RST_SHF 0 5062306a36Sopenharmony_ci#define MSC01_IC_RST_RST_MSK 0x00000001 5162306a36Sopenharmony_ci#define MSC01_IC_RST_RST_BIT MSC01_IC_RST_RST_MSK 5262306a36Sopenharmony_ci#define MSC01_IC_LVL_LVL_SHF 0 5362306a36Sopenharmony_ci#define MSC01_IC_LVL_LVL_MSK 0x000000ff 5462306a36Sopenharmony_ci#define MSC01_IC_LVL_SPUR_SHF 16 5562306a36Sopenharmony_ci#define MSC01_IC_LVL_SPUR_MSK 0x00010000 5662306a36Sopenharmony_ci#define MSC01_IC_LVL_SPUR_BIT MSC01_IC_LVL_SPUR_MSK 5762306a36Sopenharmony_ci#define MSC01_IC_RAMW_RIPL_SHF 0 5862306a36Sopenharmony_ci#define MSC01_IC_RAMW_RIPL_MSK 0x0000003f 5962306a36Sopenharmony_ci#define MSC01_IC_RAMW_DATA_SHF 6 6062306a36Sopenharmony_ci#define MSC01_IC_RAMW_DATA_MSK 0x00000fc0 6162306a36Sopenharmony_ci#define MSC01_IC_RAMW_ADDR_SHF 25 6262306a36Sopenharmony_ci#define MSC01_IC_RAMW_ADDR_MSK 0x7e000000 6362306a36Sopenharmony_ci#define MSC01_IC_RAMW_READ_SHF 31 6462306a36Sopenharmony_ci#define MSC01_IC_RAMW_READ_MSK 0x80000000 6562306a36Sopenharmony_ci#define MSC01_IC_RAMW_READ_BIT MSC01_IC_RAMW_READ_MSK 6662306a36Sopenharmony_ci#define MSC01_IC_OSB_OSB_SHF 0 6762306a36Sopenharmony_ci#define MSC01_IC_OSB_OSB_MSK 0x000000ff 6862306a36Sopenharmony_ci#define MSC01_IC_OSA_OSA_SHF 0 6962306a36Sopenharmony_ci#define MSC01_IC_OSA_OSA_MSK 0x000000ff 7062306a36Sopenharmony_ci#define MSC01_IC_GENA_GENA_SHF 0 7162306a36Sopenharmony_ci#define MSC01_IC_GENA_GENA_MSK 0x00000001 7262306a36Sopenharmony_ci#define MSC01_IC_GENA_GENA_BIT MSC01_IC_GENA_GENA_MSK 7362306a36Sopenharmony_ci#define MSC01_IC_CFG_DIS_SHF 0 7462306a36Sopenharmony_ci#define MSC01_IC_CFG_DIS_MSK 0x00000001 7562306a36Sopenharmony_ci#define MSC01_IC_CFG_DIS_BIT MSC01_IC_CFG_DIS_MSK 7662306a36Sopenharmony_ci#define MSC01_IC_CFG_SHFT_SHF 8 7762306a36Sopenharmony_ci#define MSC01_IC_CFG_SHFT_MSK 0x00000f00 7862306a36Sopenharmony_ci#define MSC01_IC_TCFG_ENA_SHF 0 7962306a36Sopenharmony_ci#define MSC01_IC_TCFG_ENA_MSK 0x00000001 8062306a36Sopenharmony_ci#define MSC01_IC_TCFG_ENA_BIT MSC01_IC_TCFG_ENA_MSK 8162306a36Sopenharmony_ci#define MSC01_IC_TCFG_INT_SHF 8 8262306a36Sopenharmony_ci#define MSC01_IC_TCFG_INT_MSK 0x00000100 8362306a36Sopenharmony_ci#define MSC01_IC_TCFG_INT_BIT MSC01_IC_TCFG_INT_MSK 8462306a36Sopenharmony_ci#define MSC01_IC_TCFG_EDGE_SHF 16 8562306a36Sopenharmony_ci#define MSC01_IC_TCFG_EDGE_MSK 0x00010000 8662306a36Sopenharmony_ci#define MSC01_IC_TCFG_EDGE_BIT MSC01_IC_TCFG_EDGE_MSK 8762306a36Sopenharmony_ci#define MSC01_IC_SUP_PRI_SHF 0 8862306a36Sopenharmony_ci#define MSC01_IC_SUP_PRI_MSK 0x00000007 8962306a36Sopenharmony_ci#define MSC01_IC_SUP_EDGE_SHF 8 9062306a36Sopenharmony_ci#define MSC01_IC_SUP_EDGE_MSK 0x00000100 9162306a36Sopenharmony_ci#define MSC01_IC_SUP_EDGE_BIT MSC01_IC_SUP_EDGE_MSK 9262306a36Sopenharmony_ci#define MSC01_IC_SUP_STEP 8 9362306a36Sopenharmony_ci 9462306a36Sopenharmony_ci/* 9562306a36Sopenharmony_ci * MIPS System controller interrupt register base. 9662306a36Sopenharmony_ci * 9762306a36Sopenharmony_ci */ 9862306a36Sopenharmony_ci 9962306a36Sopenharmony_ci/***************************************************************************** 10062306a36Sopenharmony_ci * Absolute register addresses 10162306a36Sopenharmony_ci *****************************************************************************/ 10262306a36Sopenharmony_ci 10362306a36Sopenharmony_ci#define MSC01_IC_RST (MSC01_IC_REG_BASE + MSC01_IC_RST_OFS) 10462306a36Sopenharmony_ci#define MSC01_IC_ENAL (MSC01_IC_REG_BASE + MSC01_IC_ENAL_OFS) 10562306a36Sopenharmony_ci#define MSC01_IC_ENAH (MSC01_IC_REG_BASE + MSC01_IC_ENAH_OFS) 10662306a36Sopenharmony_ci#define MSC01_IC_DISL (MSC01_IC_REG_BASE + MSC01_IC_DISL_OFS) 10762306a36Sopenharmony_ci#define MSC01_IC_DISH (MSC01_IC_REG_BASE + MSC01_IC_DISH_OFS) 10862306a36Sopenharmony_ci#define MSC01_IC_ISBL (MSC01_IC_REG_BASE + MSC01_IC_ISBL_OFS) 10962306a36Sopenharmony_ci#define MSC01_IC_ISBH (MSC01_IC_REG_BASE + MSC01_IC_ISBH_OFS) 11062306a36Sopenharmony_ci#define MSC01_IC_ISAL (MSC01_IC_REG_BASE + MSC01_IC_ISAL_OFS) 11162306a36Sopenharmony_ci#define MSC01_IC_ISAH (MSC01_IC_REG_BASE + MSC01_IC_ISAH_OFS) 11262306a36Sopenharmony_ci#define MSC01_IC_LVL (MSC01_IC_REG_BASE + MSC01_IC_LVL_OFS) 11362306a36Sopenharmony_ci#define MSC01_IC_RAMW (MSC01_IC_REG_BASE + MSC01_IC_RAMW_OFS) 11462306a36Sopenharmony_ci#define MSC01_IC_OSB (MSC01_IC_REG_BASE + MSC01_IC_OSB_OFS) 11562306a36Sopenharmony_ci#define MSC01_IC_OSA (MSC01_IC_REG_BASE + MSC01_IC_OSA_OFS) 11662306a36Sopenharmony_ci#define MSC01_IC_GENA (MSC01_IC_REG_BASE + MSC01_IC_GENA_OFS) 11762306a36Sopenharmony_ci#define MSC01_IC_BASE (MSC01_IC_REG_BASE + MSC01_IC_BASE_OFS) 11862306a36Sopenharmony_ci#define MSC01_IC_VEC (MSC01_IC_REG_BASE + MSC01_IC_VEC_OFS) 11962306a36Sopenharmony_ci#define MSC01_IC_EOI (MSC01_IC_REG_BASE + MSC01_IC_EOI_OFS) 12062306a36Sopenharmony_ci#define MSC01_IC_CFG (MSC01_IC_REG_BASE + MSC01_IC_CFG_OFS) 12162306a36Sopenharmony_ci#define MSC01_IC_TRLD (MSC01_IC_REG_BASE + MSC01_IC_TRLD_OFS) 12262306a36Sopenharmony_ci#define MSC01_IC_TVAL (MSC01_IC_REG_BASE + MSC01_IC_TVAL_OFS) 12362306a36Sopenharmony_ci#define MSC01_IC_TCFG (MSC01_IC_REG_BASE + MSC01_IC_TCFG_OFS) 12462306a36Sopenharmony_ci#define MSC01_IC_SUP (MSC01_IC_REG_BASE + MSC01_IC_SUP_OFS) 12562306a36Sopenharmony_ci#define MSC01_IC_ENA (MSC01_IC_REG_BASE + MSC01_IC_ENA_OFS) 12662306a36Sopenharmony_ci#define MSC01_IC_DIS (MSC01_IC_REG_BASE + MSC01_IC_DIS_OFS) 12762306a36Sopenharmony_ci#define MSC01_IC_ISB (MSC01_IC_REG_BASE + MSC01_IC_ISB_OFS) 12862306a36Sopenharmony_ci#define MSC01_IC_ISA (MSC01_IC_REG_BASE + MSC01_IC_ISA_OFS) 12962306a36Sopenharmony_ci 13062306a36Sopenharmony_ci/* 13162306a36Sopenharmony_ci * Soc-it interrupts are configurable. 13262306a36Sopenharmony_ci * Every board describes its IRQ mapping with this table. 13362306a36Sopenharmony_ci */ 13462306a36Sopenharmony_citypedef struct msc_irqmap { 13562306a36Sopenharmony_ci int im_irq; 13662306a36Sopenharmony_ci int im_type; 13762306a36Sopenharmony_ci int im_lvl; 13862306a36Sopenharmony_ci} msc_irqmap_t; 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ci/* im_type */ 14162306a36Sopenharmony_ci#define MSC01_IRQ_LEVEL 0 14262306a36Sopenharmony_ci#define MSC01_IRQ_EDGE 1 14362306a36Sopenharmony_ci 14462306a36Sopenharmony_ciextern void __init init_msc_irqs(unsigned long icubase, unsigned int base, msc_irqmap_t *imp, int nirq); 14562306a36Sopenharmony_ciextern void ll_msc_irq(void); 14662306a36Sopenharmony_ci 14762306a36Sopenharmony_ci#endif /* __ASM_MIPS_BOARDS_MSC01_IC_H */ 148