Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  Author: Nicolas Pitre
0004  *  Created:    Nov 14, 2002
0005  *  Copyright:  MontaVista Software Inc.
0006  */
0007 
0008 #ifndef ASM_ARCH_MAINSTONE_H
0009 #define ASM_ARCH_MAINSTONE_H
0010 
0011 #include "irqs.h"
0012 
0013 #define MST_ETH_PHYS        PXA_CS4_PHYS
0014 
0015 #define MST_FPGA_PHYS       PXA_CS2_PHYS
0016 #define MST_FPGA_VIRT       (0xf0000000)
0017 #define MST_P2V(x)      ((x) - MST_FPGA_PHYS + MST_FPGA_VIRT)
0018 #define MST_V2P(x)      ((x) - MST_FPGA_VIRT + MST_FPGA_PHYS)
0019 
0020 #ifndef __ASSEMBLY__
0021 # define __MST_REG(x)       (*((volatile unsigned long *)MST_P2V(x)))
0022 #else
0023 # define __MST_REG(x)       MST_P2V(x)
0024 #endif
0025 
0026 /* board level registers in the FPGA */
0027 
0028 #define MST_LEDDAT1     __MST_REG(0x08000010)
0029 #define MST_LEDDAT2     __MST_REG(0x08000014)
0030 #define MST_LEDCTRL     __MST_REG(0x08000040)
0031 #define MST_GPSWR       __MST_REG(0x08000060)
0032 #define MST_MSCWR1      __MST_REG(0x08000080)
0033 #define MST_MSCWR2      __MST_REG(0x08000084)
0034 #define MST_MSCWR3      __MST_REG(0x08000088)
0035 #define MST_MSCRD       __MST_REG(0x08000090)
0036 #define MST_INTMSKENA       __MST_REG(0x080000c0)
0037 #define MST_INTSETCLR       __MST_REG(0x080000d0)
0038 #define MST_PCMCIA0     __MST_REG(0x080000e0)
0039 #define MST_PCMCIA1     __MST_REG(0x080000e4)
0040 
0041 #define MST_MSCWR1_CAMERA_ON    (1 << 15)  /* Camera interface power control */
0042 #define MST_MSCWR1_CAMERA_SEL   (1 << 14)  /* Camera interface mux control */
0043 #define MST_MSCWR1_LCD_CTL  (1 << 13)  /* General-purpose LCD control */
0044 #define MST_MSCWR1_MS_ON    (1 << 12)  /* Memory Stick power control */
0045 #define MST_MSCWR1_MMC_ON   (1 << 11)  /* MultiMediaCard* power control */
0046 #define MST_MSCWR1_MS_SEL   (1 << 10)  /* SD/MS multiplexer control */
0047 #define MST_MSCWR1_BB_SEL   (1 << 9)   /* PCMCIA/Baseband multiplexer */
0048 #define MST_MSCWR1_BT_ON    (1 << 8)   /* Bluetooth UART transceiver */
0049 #define MST_MSCWR1_BTDTR    (1 << 7)   /* Bluetooth UART DTR */
0050 
0051 #define MST_MSCWR1_IRDA_MASK    (3 << 5)   /* IrDA transceiver mode */
0052 #define MST_MSCWR1_IRDA_FULL    (0 << 5)   /* full distance power */
0053 #define MST_MSCWR1_IRDA_OFF (1 << 5)   /* shutdown */
0054 #define MST_MSCWR1_IRDA_MED (2 << 5)   /* 2/3 distance power */
0055 #define MST_MSCWR1_IRDA_LOW (3 << 5)   /* 1/3 distance power */
0056 
0057 #define MST_MSCWR1_IRDA_FIR (1 << 4)   /* IrDA transceiver SIR/FIR */
0058 #define MST_MSCWR1_GREENLED (1 << 3)   /* LED D1 control */
0059 #define MST_MSCWR1_PDC_CTL  (1 << 2)   /* reserved */
0060 #define MST_MSCWR1_MTR_ON   (1 << 1)   /* Silent alert motor */
0061 #define MST_MSCWR1_SYSRESET (1 << 0)   /* System reset */
0062 
0063 #define MST_MSCWR2_USB_OTG_RST  (1 << 6)   /* USB On The Go reset */
0064 #define MST_MSCWR2_USB_OTG_SEL  (1 << 5)   /* USB On The Go control */
0065 #define MST_MSCWR2_nUSBC_SC (1 << 4)   /* USB client soft connect control */
0066 #define MST_MSCWR2_I2S_SPKROFF  (1 << 3)   /* I2S CODEC amplifier control */
0067 #define MST_MSCWR2_AC97_SPKROFF (1 << 2)   /* AC97 CODEC amplifier control */
0068 #define MST_MSCWR2_RADIO_PWR    (1 << 1)   /* Radio module power control */
0069 #define MST_MSCWR2_RADIO_WAKE   (1 << 0)   /* Radio module wake-up signal */
0070 
0071 #define MST_MSCWR3_GPIO_RESET_EN    (1 << 2) /* Enable GPIO Reset */
0072 #define MST_MSCWR3_GPIO_RESET       (1 << 1) /* Initiate a GPIO Reset */
0073 #define MST_MSCWR3_COMMS_SW_RESET   (1 << 0) /* Communications Processor Reset Control */
0074 
0075 #define MST_MSCRD_nPENIRQ   (1 << 9)   /* ADI7873* nPENIRQ signal */
0076 #define MST_MSCRD_nMEMSTK_CD    (1 << 8)   /* Memory Stick detection signal */
0077 #define MST_MSCRD_nMMC_CD   (1 << 7)   /* SD/MMC card detection signal */
0078 #define MST_MSCRD_nUSIM_CD  (1 << 6)   /* USIM card detection signal */
0079 #define MST_MSCRD_USB_CBL   (1 << 5)   /* USB client cable status */
0080 #define MST_MSCRD_TS_BUSY   (1 << 4)   /* ADI7873 busy */
0081 #define MST_MSCRD_BTDSR     (1 << 3)   /* Bluetooth UART DSR */
0082 #define MST_MSCRD_BTRI      (1 << 2)   /* Bluetooth UART Ring Indicator */
0083 #define MST_MSCRD_BTDCD     (1 << 1)   /* Bluetooth UART DCD */
0084 #define MST_MSCRD_nMMC_WP   (1 << 0)   /* SD/MMC write-protect status */
0085 
0086 #define MST_INT_S1_IRQ      (1 << 15)  /* PCMCIA socket 1 IRQ */
0087 #define MST_INT_S1_STSCHG   (1 << 14)  /* PCMCIA socket 1 status changed */
0088 #define MST_INT_S1_CD       (1 << 13)  /* PCMCIA socket 1 card detection */
0089 #define MST_INT_S0_IRQ      (1 << 11)  /* PCMCIA socket 0 IRQ */
0090 #define MST_INT_S0_STSCHG   (1 << 10)  /* PCMCIA socket 0 status changed */
0091 #define MST_INT_S0_CD       (1 << 9)   /* PCMCIA socket 0 card detection */
0092 #define MST_INT_nEXBRD_INT  (1 << 7)   /* Expansion board IRQ */
0093 #define MST_INT_MSINS       (1 << 6)   /* Memory Stick* detection */
0094 #define MST_INT_PENIRQ      (1 << 5)   /* ADI7873* touch-screen IRQ */
0095 #define MST_INT_AC97        (1 << 4)   /* AC'97 CODEC IRQ */
0096 #define MST_INT_ETHERNET    (1 << 3)   /* Ethernet controller IRQ */
0097 #define MST_INT_USBC        (1 << 2)   /* USB client cable detection IRQ */
0098 #define MST_INT_USIM        (1 << 1)   /* USIM card detection IRQ */
0099 #define MST_INT_MMC     (1 << 0)   /* MMC/SD card detection IRQ */
0100 
0101 #define MST_PCMCIA_nIRQ     (1 << 10)  /* IRQ / ready signal */
0102 #define MST_PCMCIA_nSPKR_BVD2   (1 << 9)   /* VDD sense / digital speaker */
0103 #define MST_PCMCIA_nSTSCHG_BVD1 (1 << 8)   /* VDD sense / card status changed */
0104 #define MST_PCMCIA_nVS2     (1 << 7)   /* VSS voltage sense */
0105 #define MST_PCMCIA_nVS1     (1 << 6)   /* VSS voltage sense */
0106 #define MST_PCMCIA_nCD      (1 << 5)   /* Card detection signal */
0107 #define MST_PCMCIA_RESET    (1 << 4)   /* Card reset signal */
0108 #define MST_PCMCIA_PWR_MASK (0x000f)   /* MAX1602 power-supply controls */
0109 
0110 #define MST_PCMCIA_PWR_VPP_0    0x0    /* voltage VPP = 0V */
0111 #define MST_PCMCIA_PWR_VPP_120  0x2        /* voltage VPP = 12V*/
0112 #define MST_PCMCIA_PWR_VPP_VCC  0x1    /* voltage VPP = VCC */
0113 #define MST_PCMCIA_PWR_VCC_0    0x0    /* voltage VCC = 0V */
0114 #define MST_PCMCIA_PWR_VCC_33   0x8    /* voltage VCC = 3.3V */
0115 #define MST_PCMCIA_PWR_VCC_50   0x4    /* voltage VCC = 5.0V */
0116 
0117 #define MST_PCMCIA_INPUTS \
0118     (MST_PCMCIA_nIRQ | MST_PCMCIA_nSPKR_BVD2 | MST_PCMCIA_nSTSCHG_BVD1 | \
0119      MST_PCMCIA_nVS2 | MST_PCMCIA_nVS1 | MST_PCMCIA_nCD)
0120 
0121 /* board specific IRQs */
0122 #define MAINSTONE_NR_IRQS   IRQ_BOARD_START
0123 
0124 #define MAINSTONE_IRQ(x)    (MAINSTONE_NR_IRQS + (x))
0125 #define MAINSTONE_MMC_IRQ   MAINSTONE_IRQ(0)
0126 #define MAINSTONE_USIM_IRQ  MAINSTONE_IRQ(1)
0127 #define MAINSTONE_USBC_IRQ  MAINSTONE_IRQ(2)
0128 #define MAINSTONE_ETHERNET_IRQ  MAINSTONE_IRQ(3)
0129 #define MAINSTONE_AC97_IRQ  MAINSTONE_IRQ(4)
0130 #define MAINSTONE_PEN_IRQ   MAINSTONE_IRQ(5)
0131 #define MAINSTONE_MSINS_IRQ MAINSTONE_IRQ(6)
0132 #define MAINSTONE_EXBRD_IRQ MAINSTONE_IRQ(7)
0133 #define MAINSTONE_S0_CD_IRQ MAINSTONE_IRQ(9)
0134 #define MAINSTONE_S0_STSCHG_IRQ MAINSTONE_IRQ(10)
0135 #define MAINSTONE_S0_IRQ    MAINSTONE_IRQ(11)
0136 #define MAINSTONE_S1_CD_IRQ MAINSTONE_IRQ(13)
0137 #define MAINSTONE_S1_STSCHG_IRQ MAINSTONE_IRQ(14)
0138 #define MAINSTONE_S1_IRQ    MAINSTONE_IRQ(15)
0139 
0140 #endif