Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *  linux/include/asm-arm/arch-pxa/balloon3.h
0004  *
0005  *  Authors:    Nick Bane and Wookey
0006  *  Created:    Oct, 2005
0007  *  Copyright:  Toby Churchill Ltd
0008  *  Cribbed from mainstone.c, by Nicholas Pitre
0009  */
0010 
0011 #ifndef ASM_ARCH_BALLOON3_H
0012 #define ASM_ARCH_BALLOON3_H
0013 
0014 #include "irqs.h" /* PXA_NR_BUILTIN_GPIO */
0015 
0016 enum balloon3_features {
0017     BALLOON3_FEATURE_OHCI,
0018     BALLOON3_FEATURE_MMC,
0019     BALLOON3_FEATURE_CF,
0020     BALLOON3_FEATURE_AUDIO,
0021     BALLOON3_FEATURE_TOPPOLY,
0022 };
0023 
0024 #define BALLOON3_FPGA_PHYS  PXA_CS4_PHYS
0025 #define BALLOON3_FPGA_VIRT  IOMEM(0xf1000000)   /* as per balloon2 */
0026 #define BALLOON3_FPGA_LENGTH    0x01000000
0027 
0028 #define BALLOON3_FPGA_SETnCLR       (0x1000)
0029 
0030 /* FPGA / CPLD registers for CF socket */
0031 #define BALLOON3_CF_STATUS_REG      (BALLOON3_FPGA_VIRT + 0x00e00008)
0032 #define BALLOON3_CF_CONTROL_REG     (BALLOON3_FPGA_VIRT + 0x00e00008)
0033 /* FPGA / CPLD version register */
0034 #define BALLOON3_FPGA_VER       (BALLOON3_FPGA_VIRT + 0x00e0001c)
0035 /* FPGA / CPLD registers for NAND flash */
0036 #define BALLOON3_NAND_BASE      (PXA_CS4_PHYS + 0x00e00000)
0037 #define BALLOON3_NAND_IO_REG        (BALLOON3_FPGA_VIRT + 0x00e00000)
0038 #define BALLOON3_NAND_CONTROL2_REG  (BALLOON3_FPGA_VIRT + 0x00e00010)
0039 #define BALLOON3_NAND_STAT_REG      (BALLOON3_FPGA_VIRT + 0x00e00014)
0040 #define BALLOON3_NAND_CONTROL_REG   (BALLOON3_FPGA_VIRT + 0x00e00014)
0041 
0042 /* fpga/cpld interrupt control register */
0043 #define BALLOON3_INT_CONTROL_REG    (BALLOON3_FPGA_VIRT + 0x00e0000C)
0044 #define BALLOON3_VERSION_REG        (BALLOON3_FPGA_VIRT + 0x00e0001c)
0045 
0046 #define BALLOON3_SAMOSA_ADDR_REG    (BALLOON3_FPGA_VIRT + 0x00c00000)
0047 #define BALLOON3_SAMOSA_DATA_REG    (BALLOON3_FPGA_VIRT + 0x00c00004)
0048 #define BALLOON3_SAMOSA_STATUS_REG  (BALLOON3_FPGA_VIRT + 0x00c0001c)
0049 
0050 /* CF Status Register bits (read-only) bits */
0051 #define BALLOON3_CF_nIRQ        (1 << 0)
0052 #define BALLOON3_CF_nSTSCHG_BVD1    (1 << 1)
0053 
0054 /* CF Control Set Register bits / CF Control Clear Register bits (write-only) */
0055 #define BALLOON3_CF_RESET       (1 << 0)
0056 #define BALLOON3_CF_ENABLE      (1 << 1)
0057 #define BALLOON3_CF_ADD_ENABLE      (1 << 2)
0058 
0059 /* CF Interrupt sources */
0060 #define BALLOON3_BP_CF_NRDY_IRQ     BALLOON3_IRQ(0)
0061 #define BALLOON3_BP_NSTSCHG_IRQ     BALLOON3_IRQ(1)
0062 
0063 /* NAND Control register */
0064 #define BALLOON3_NAND_CONTROL_FLWP  (1 << 7)
0065 #define BALLOON3_NAND_CONTROL_FLSE  (1 << 6)
0066 #define BALLOON3_NAND_CONTROL_FLCE3 (1 << 5)
0067 #define BALLOON3_NAND_CONTROL_FLCE2 (1 << 4)
0068 #define BALLOON3_NAND_CONTROL_FLCE1 (1 << 3)
0069 #define BALLOON3_NAND_CONTROL_FLCE0 (1 << 2)
0070 #define BALLOON3_NAND_CONTROL_FLALE (1 << 1)
0071 #define BALLOON3_NAND_CONTROL_FLCLE (1 << 0)
0072 
0073 /* NAND Status register */
0074 #define BALLOON3_NAND_STAT_RNB      (1 << 0)
0075 
0076 /* NAND Control2 register */
0077 #define BALLOON3_NAND_CONTROL2_16BIT    (1 << 0)
0078 
0079 /* GPIOs for irqs */
0080 #define BALLOON3_GPIO_AUX_NIRQ      (94)
0081 #define BALLOON3_GPIO_CODEC_IRQ     (95)
0082 
0083 /* Timer and Idle LED locations */
0084 #define BALLOON3_GPIO_LED_NAND      (9)
0085 #define BALLOON3_GPIO_LED_IDLE      (10)
0086 
0087 /* backlight control */
0088 #define BALLOON3_GPIO_RUN_BACKLIGHT (99)
0089 
0090 #define BALLOON3_GPIO_S0_CD     (105)
0091 
0092 /* NAND */
0093 #define BALLOON3_GPIO_RUN_NAND      (102)
0094 
0095 /* PCF8574A Leds */
0096 #define BALLOON3_PCF_GPIO_BASE      160
0097 #define BALLOON3_PCF_GPIO_LED0      (BALLOON3_PCF_GPIO_BASE + 0)
0098 #define BALLOON3_PCF_GPIO_LED1      (BALLOON3_PCF_GPIO_BASE + 1)
0099 #define BALLOON3_PCF_GPIO_LED2      (BALLOON3_PCF_GPIO_BASE + 2)
0100 #define BALLOON3_PCF_GPIO_LED3      (BALLOON3_PCF_GPIO_BASE + 3)
0101 #define BALLOON3_PCF_GPIO_LED4      (BALLOON3_PCF_GPIO_BASE + 4)
0102 #define BALLOON3_PCF_GPIO_LED5      (BALLOON3_PCF_GPIO_BASE + 5)
0103 #define BALLOON3_PCF_GPIO_LED6      (BALLOON3_PCF_GPIO_BASE + 6)
0104 #define BALLOON3_PCF_GPIO_LED7      (BALLOON3_PCF_GPIO_BASE + 7)
0105 
0106 /* FPGA Interrupt Mask/Acknowledge Register */
0107 #define BALLOON3_INT_S0_IRQ     (1 << 0)  /* PCMCIA 0 IRQ */
0108 #define BALLOON3_INT_S0_STSCHG      (1 << 1)  /* PCMCIA 0 status changed */
0109 
0110 /* CPLD (and FPGA) interface definitions */
0111 #define CPLD_LCD0_DATA_SET             0x00
0112 #define CPLD_LCD0_DATA_CLR             0x10
0113 #define CPLD_LCD0_COMMAND_SET          0x01
0114 #define CPLD_LCD0_COMMAND_CLR          0x11
0115 #define CPLD_LCD1_DATA_SET             0x02
0116 #define CPLD_LCD1_DATA_CLR             0x12
0117 #define CPLD_LCD1_COMMAND_SET          0x03
0118 #define CPLD_LCD1_COMMAND_CLR          0x13
0119 
0120 #define CPLD_MISC_SET                  0x07
0121 #define CPLD_MISC_CLR                  0x17
0122 #define CPLD_MISC_LOON_NRESET_BIT      0
0123 #define CPLD_MISC_LOON_UNSUSP_BIT      1
0124 #define CPLD_MISC_RUN_5V_BIT           2
0125 #define CPLD_MISC_CHG_D0_BIT           3
0126 #define CPLD_MISC_CHG_D1_BIT           4
0127 #define CPLD_MISC_DAC_NCS_BIT          5
0128 
0129 #define CPLD_LCD_SET                   0x08
0130 #define CPLD_LCD_CLR                   0x18
0131 #define CPLD_LCD_BACKLIGHT_EN_0_BIT    0
0132 #define CPLD_LCD_BACKLIGHT_EN_1_BIT    1
0133 #define CPLD_LCD_LED_RED_BIT           4
0134 #define CPLD_LCD_LED_GREEN_BIT         5
0135 #define CPLD_LCD_NRESET_BIT            7
0136 
0137 #define CPLD_LCD_RO_SET                0x09
0138 #define CPLD_LCD_RO_CLR                0x19
0139 #define CPLD_LCD_RO_LCD0_nWAIT_BIT     0
0140 #define CPLD_LCD_RO_LCD1_nWAIT_BIT     1
0141 
0142 #define CPLD_SERIAL_SET                0x0a
0143 #define CPLD_SERIAL_CLR                0x1a
0144 #define CPLD_SERIAL_GSM_RI_BIT         0
0145 #define CPLD_SERIAL_GSM_CTS_BIT        1
0146 #define CPLD_SERIAL_GSM_DTR_BIT        2
0147 #define CPLD_SERIAL_LPR_CTS_BIT        3
0148 #define CPLD_SERIAL_TC232_CTS_BIT      4
0149 #define CPLD_SERIAL_TC232_DSR_BIT      5
0150 
0151 #define CPLD_SROUTING_SET              0x0b
0152 #define CPLD_SROUTING_CLR              0x1b
0153 #define CPLD_SROUTING_MSP430_LPR       0
0154 #define CPLD_SROUTING_MSP430_TC232     1
0155 #define CPLD_SROUTING_MSP430_GSM       2
0156 #define CPLD_SROUTING_LOON_LPR         (0 << 4)
0157 #define CPLD_SROUTING_LOON_TC232       (1 << 4)
0158 #define CPLD_SROUTING_LOON_GSM         (2 << 4)
0159 
0160 #define CPLD_AROUTING_SET              0x0c
0161 #define CPLD_AROUTING_CLR              0x1c
0162 #define CPLD_AROUTING_MIC2PHONE_BIT    0
0163 #define CPLD_AROUTING_PHONE2INT_BIT    1
0164 #define CPLD_AROUTING_PHONE2EXT_BIT    2
0165 #define CPLD_AROUTING_LOONL2INT_BIT    3
0166 #define CPLD_AROUTING_LOONL2EXT_BIT    4
0167 #define CPLD_AROUTING_LOONR2PHONE_BIT  5
0168 #define CPLD_AROUTING_LOONR2INT_BIT    6
0169 #define CPLD_AROUTING_LOONR2EXT_BIT    7
0170 
0171 /* Balloon3 Interrupts */
0172 #define BALLOON3_IRQ(x)     (IRQ_BOARD_START + (x))
0173 
0174 #define BALLOON3_AUX_NIRQ   PXA_GPIO_TO_IRQ(BALLOON3_GPIO_AUX_NIRQ)
0175 #define BALLOON3_CODEC_IRQ  PXA_GPIO_TO_IRQ(BALLOON3_GPIO_CODEC_IRQ)
0176 
0177 #define BALLOON3_NR_IRQS    (IRQ_BOARD_START + 16)
0178 
0179 extern int balloon3_has(enum balloon3_features feature);
0180 
0181 #endif