2010-04-01 05:30:58 -06:00
|
|
|
/*
|
|
|
|
* arch/arm/mach-spear3xx/spear300.c
|
|
|
|
*
|
|
|
|
* SPEAr300 machine source file
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 ST Microelectronics
|
|
|
|
* Viresh Kumar<viresh.kumar@st.com>
|
|
|
|
*
|
|
|
|
* This file is licensed under the terms of the GNU General Public
|
|
|
|
* License version 2. This program is licensed "as is" without any
|
|
|
|
* warranty of any kind, whether express or implied.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/amba/pl061.h>
|
|
|
|
#include <linux/ptrace.h>
|
|
|
|
#include <asm/irq.h>
|
2011-03-06 21:57:01 -07:00
|
|
|
#include <plat/shirq.h>
|
2010-04-01 05:30:58 -06:00
|
|
|
#include <mach/generic.h>
|
2011-03-06 21:57:02 -07:00
|
|
|
#include <mach/hardware.h>
|
2010-04-01 05:30:58 -06:00
|
|
|
|
2010-04-01 05:31:29 -06:00
|
|
|
/* pad multiplexing support */
|
|
|
|
/* muxing registers */
|
|
|
|
#define PAD_MUX_CONFIG_REG 0x00
|
|
|
|
#define MODE_CONFIG_REG 0x04
|
|
|
|
|
|
|
|
/* modes */
|
|
|
|
#define NAND_MODE (1 << 0)
|
|
|
|
#define NOR_MODE (1 << 1)
|
|
|
|
#define PHOTO_FRAME_MODE (1 << 2)
|
|
|
|
#define LEND_IP_PHONE_MODE (1 << 3)
|
|
|
|
#define HEND_IP_PHONE_MODE (1 << 4)
|
|
|
|
#define LEND_WIFI_PHONE_MODE (1 << 5)
|
|
|
|
#define HEND_WIFI_PHONE_MODE (1 << 6)
|
|
|
|
#define ATA_PABX_WI2S_MODE (1 << 7)
|
|
|
|
#define ATA_PABX_I2S_MODE (1 << 8)
|
|
|
|
#define CAML_LCDW_MODE (1 << 9)
|
|
|
|
#define CAMU_LCD_MODE (1 << 10)
|
|
|
|
#define CAMU_WLCD_MODE (1 << 11)
|
|
|
|
#define CAML_LCD_MODE (1 << 12)
|
|
|
|
#define ALL_MODES 0x1FFF
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_nand_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = NAND_MODE,
|
|
|
|
.name = "nand mode",
|
|
|
|
.mask = 0x00,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_nor_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = NOR_MODE,
|
|
|
|
.name = "nor mode",
|
|
|
|
.mask = 0x01,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_photo_frame_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = PHOTO_FRAME_MODE,
|
|
|
|
.name = "photo frame mode",
|
|
|
|
.mask = 0x02,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_lend_ip_phone_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = LEND_IP_PHONE_MODE,
|
|
|
|
.name = "lend ip phone mode",
|
|
|
|
.mask = 0x03,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_hend_ip_phone_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = HEND_IP_PHONE_MODE,
|
|
|
|
.name = "hend ip phone mode",
|
|
|
|
.mask = 0x04,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_lend_wifi_phone_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = LEND_WIFI_PHONE_MODE,
|
|
|
|
.name = "lend wifi phone mode",
|
|
|
|
.mask = 0x05,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_hend_wifi_phone_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = HEND_WIFI_PHONE_MODE,
|
|
|
|
.name = "hend wifi phone mode",
|
|
|
|
.mask = 0x06,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_ata_pabx_wi2s_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = ATA_PABX_WI2S_MODE,
|
|
|
|
.name = "ata pabx wi2s mode",
|
|
|
|
.mask = 0x07,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_ata_pabx_i2s_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = ATA_PABX_I2S_MODE,
|
|
|
|
.name = "ata pabx i2s mode",
|
|
|
|
.mask = 0x08,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_caml_lcdw_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = CAML_LCDW_MODE,
|
|
|
|
.name = "caml lcdw mode",
|
|
|
|
.mask = 0x0C,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_camu_lcd_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = CAMU_LCD_MODE,
|
|
|
|
.name = "camu lcd mode",
|
|
|
|
.mask = 0x0D,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_camu_wlcd_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = CAMU_WLCD_MODE,
|
|
|
|
.name = "camu wlcd mode",
|
|
|
|
.mask = 0x0E,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_mode spear300_caml_lcd_mode = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.id = CAML_LCD_MODE,
|
|
|
|
.name = "caml lcd mode",
|
|
|
|
.mask = 0x0F,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* devices */
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_fsmc_2_chips_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE |
|
|
|
|
ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE,
|
|
|
|
.mask = PMX_FIRDA_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_fsmc_2_chips = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.name = "fsmc_2_chips",
|
|
|
|
.modes = pmx_fsmc_2_chips_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_fsmc_2_chips_modes),
|
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_fsmc_4_chips_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE |
|
|
|
|
ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE,
|
|
|
|
.mask = PMX_FIRDA_MASK | PMX_UART0_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_fsmc_4_chips = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.name = "fsmc_4_chips",
|
|
|
|
.modes = pmx_fsmc_4_chips_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_fsmc_4_chips_modes),
|
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_keyboard_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE |
|
|
|
|
LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE |
|
|
|
|
CAML_LCDW_MODE | CAMU_LCD_MODE | CAMU_WLCD_MODE |
|
|
|
|
CAML_LCD_MODE,
|
|
|
|
.mask = 0x0,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_keyboard = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.name = "keyboard",
|
|
|
|
.modes = pmx_keyboard_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_keyboard_modes),
|
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_clcd_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = PHOTO_FRAME_MODE,
|
|
|
|
.mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK ,
|
|
|
|
}, {
|
|
|
|
.ids = HEND_IP_PHONE_MODE | HEND_WIFI_PHONE_MODE |
|
|
|
|
CAMU_LCD_MODE | CAML_LCD_MODE,
|
|
|
|
.mask = PMX_TIMER_3_4_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_clcd = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.name = "clcd",
|
|
|
|
.modes = pmx_clcd_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_clcd_modes),
|
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_telecom_gpio_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = PHOTO_FRAME_MODE | CAMU_LCD_MODE | CAML_LCD_MODE,
|
|
|
|
.mask = PMX_MII_MASK,
|
|
|
|
}, {
|
|
|
|
.ids = LEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE,
|
|
|
|
.mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK,
|
|
|
|
}, {
|
|
|
|
.ids = ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_WLCD_MODE,
|
|
|
|
.mask = PMX_MII_MASK | PMX_TIMER_3_4_MASK,
|
|
|
|
}, {
|
|
|
|
.ids = HEND_IP_PHONE_MODE | HEND_WIFI_PHONE_MODE,
|
|
|
|
.mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK,
|
|
|
|
}, {
|
|
|
|
.ids = ATA_PABX_WI2S_MODE,
|
|
|
|
.mask = PMX_MII_MASK | PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK
|
|
|
|
| PMX_UART0_MODEM_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_telecom_gpio = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.name = "telecom_gpio",
|
|
|
|
.modes = pmx_telecom_gpio_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_telecom_gpio_modes),
|
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_telecom_tdm_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE |
|
|
|
|
HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE
|
|
|
|
| HEND_WIFI_PHONE_MODE | ATA_PABX_WI2S_MODE
|
|
|
|
| ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE
|
|
|
|
| CAMU_WLCD_MODE | CAML_LCD_MODE,
|
|
|
|
.mask = PMX_UART0_MODEM_MASK | PMX_SSP_CS_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_telecom_tdm = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.name = "telecom_tdm",
|
|
|
|
.modes = pmx_telecom_tdm_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_telecom_tdm_modes),
|
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_telecom_spi_cs_i2c_clk_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE |
|
|
|
|
LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE
|
|
|
|
| ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE |
|
|
|
|
CAML_LCDW_MODE | CAML_LCD_MODE,
|
|
|
|
.mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_telecom_spi_cs_i2c_clk = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.name = "telecom_spi_cs_i2c_clk",
|
|
|
|
.modes = pmx_telecom_spi_cs_i2c_clk_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_telecom_spi_cs_i2c_clk_modes),
|
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_telecom_camera_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = CAML_LCDW_MODE | CAML_LCD_MODE,
|
|
|
|
.mask = PMX_MII_MASK,
|
|
|
|
}, {
|
|
|
|
.ids = CAMU_LCD_MODE | CAMU_WLCD_MODE,
|
|
|
|
.mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK | PMX_MII_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_telecom_camera = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.name = "telecom_camera",
|
|
|
|
.modes = pmx_telecom_camera_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_telecom_camera_modes),
|
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_telecom_dac_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE
|
|
|
|
| CAMU_WLCD_MODE | CAML_LCD_MODE,
|
|
|
|
.mask = PMX_TIMER_1_2_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_telecom_dac = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.name = "telecom_dac",
|
|
|
|
.modes = pmx_telecom_dac_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_telecom_dac_modes),
|
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_telecom_i2s_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE
|
|
|
|
| LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE |
|
|
|
|
ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE
|
|
|
|
| CAMU_WLCD_MODE | CAML_LCD_MODE,
|
|
|
|
.mask = PMX_UART0_MODEM_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_telecom_i2s = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.name = "telecom_i2s",
|
|
|
|
.modes = pmx_telecom_i2s_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_telecom_i2s_modes),
|
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_telecom_boot_pins_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = NAND_MODE | NOR_MODE,
|
|
|
|
.mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK |
|
|
|
|
PMX_TIMER_3_4_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_telecom_boot_pins = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.name = "telecom_boot_pins",
|
|
|
|
.modes = pmx_telecom_boot_pins_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_telecom_boot_pins_modes),
|
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_telecom_sdhci_4bit_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE |
|
|
|
|
HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE |
|
|
|
|
HEND_WIFI_PHONE_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE |
|
|
|
|
CAMU_WLCD_MODE | CAML_LCD_MODE | ATA_PABX_WI2S_MODE |
|
|
|
|
ATA_PABX_I2S_MODE,
|
|
|
|
.mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK |
|
|
|
|
PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK |
|
|
|
|
PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_telecom_sdhci_4bit = {
|
2011-03-06 21:57:03 -07:00
|
|
|
.name = "telecom_sdhci_4bit",
|
|
|
|
.modes = pmx_telecom_sdhci_4bit_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_telecom_sdhci_4bit_modes),
|
2010-04-01 05:31:29 -06:00
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_telecom_sdhci_8bit_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE |
|
|
|
|
HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE |
|
|
|
|
HEND_WIFI_PHONE_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE |
|
|
|
|
CAMU_WLCD_MODE | CAML_LCD_MODE,
|
|
|
|
.mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK |
|
|
|
|
PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK |
|
|
|
|
PMX_GPIO_PIN4_MASK | PMX_GPIO_PIN5_MASK | PMX_MII_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_telecom_sdhci_8bit = {
|
2011-03-06 21:57:03 -07:00
|
|
|
.name = "telecom_sdhci_8bit",
|
|
|
|
.modes = pmx_telecom_sdhci_8bit_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_telecom_sdhci_8bit_modes),
|
2010-04-01 05:31:29 -06:00
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_dev_mode pmx_gpio1_modes[] = {
|
2010-04-01 05:31:29 -06:00
|
|
|
{
|
|
|
|
.ids = PHOTO_FRAME_MODE,
|
|
|
|
.mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK |
|
|
|
|
PMX_TIMER_3_4_MASK,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:22 -06:00
|
|
|
struct pmx_dev spear300_pmx_gpio1 = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.name = "arm gpio1",
|
|
|
|
.modes = pmx_gpio1_modes,
|
|
|
|
.mode_count = ARRAY_SIZE(pmx_gpio1_modes),
|
|
|
|
.enb_on_reset = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* pmx driver structure */
|
2011-05-20 01:34:22 -06:00
|
|
|
static struct pmx_driver pmx_driver = {
|
2010-04-01 05:31:29 -06:00
|
|
|
.mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x0000000f},
|
|
|
|
.mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff},
|
|
|
|
};
|
|
|
|
|
2010-05-03 02:24:30 -06:00
|
|
|
/* spear3xx shared irq */
|
2011-05-20 01:34:20 -06:00
|
|
|
static struct shirq_dev_config shirq_ras1_config[] = {
|
2010-05-03 02:24:30 -06:00
|
|
|
{
|
2011-05-20 01:34:21 -06:00
|
|
|
.virq = SPEAR300_VIRQ_IT_PERS_S,
|
|
|
|
.enb_mask = SPEAR300_IT_PERS_S_IRQ_MASK,
|
|
|
|
.status_mask = SPEAR300_IT_PERS_S_IRQ_MASK,
|
2010-05-03 02:24:30 -06:00
|
|
|
}, {
|
2011-05-20 01:34:21 -06:00
|
|
|
.virq = SPEAR300_VIRQ_IT_CHANGE_S,
|
|
|
|
.enb_mask = SPEAR300_IT_CHANGE_S_IRQ_MASK,
|
|
|
|
.status_mask = SPEAR300_IT_CHANGE_S_IRQ_MASK,
|
2010-05-03 02:24:30 -06:00
|
|
|
}, {
|
2011-05-20 01:34:21 -06:00
|
|
|
.virq = SPEAR300_VIRQ_I2S,
|
|
|
|
.enb_mask = SPEAR300_I2S_IRQ_MASK,
|
|
|
|
.status_mask = SPEAR300_I2S_IRQ_MASK,
|
2010-05-03 02:24:30 -06:00
|
|
|
}, {
|
2011-05-20 01:34:21 -06:00
|
|
|
.virq = SPEAR300_VIRQ_TDM,
|
|
|
|
.enb_mask = SPEAR300_TDM_IRQ_MASK,
|
|
|
|
.status_mask = SPEAR300_TDM_IRQ_MASK,
|
2010-05-03 02:24:30 -06:00
|
|
|
}, {
|
2011-05-20 01:34:21 -06:00
|
|
|
.virq = SPEAR300_VIRQ_CAMERA_L,
|
|
|
|
.enb_mask = SPEAR300_CAMERA_L_IRQ_MASK,
|
|
|
|
.status_mask = SPEAR300_CAMERA_L_IRQ_MASK,
|
2010-05-03 02:24:30 -06:00
|
|
|
}, {
|
2011-05-20 01:34:21 -06:00
|
|
|
.virq = SPEAR300_VIRQ_CAMERA_F,
|
|
|
|
.enb_mask = SPEAR300_CAMERA_F_IRQ_MASK,
|
|
|
|
.status_mask = SPEAR300_CAMERA_F_IRQ_MASK,
|
2010-05-03 02:24:30 -06:00
|
|
|
}, {
|
2011-05-20 01:34:21 -06:00
|
|
|
.virq = SPEAR300_VIRQ_CAMERA_V,
|
|
|
|
.enb_mask = SPEAR300_CAMERA_V_IRQ_MASK,
|
|
|
|
.status_mask = SPEAR300_CAMERA_V_IRQ_MASK,
|
2010-05-03 02:24:30 -06:00
|
|
|
}, {
|
2011-05-20 01:34:21 -06:00
|
|
|
.virq = SPEAR300_VIRQ_KEYBOARD,
|
|
|
|
.enb_mask = SPEAR300_KEYBOARD_IRQ_MASK,
|
|
|
|
.status_mask = SPEAR300_KEYBOARD_IRQ_MASK,
|
2010-05-03 02:24:30 -06:00
|
|
|
}, {
|
2011-05-20 01:34:21 -06:00
|
|
|
.virq = SPEAR300_VIRQ_GPIO1,
|
|
|
|
.enb_mask = SPEAR300_GPIO1_IRQ_MASK,
|
|
|
|
.status_mask = SPEAR300_GPIO1_IRQ_MASK,
|
2010-05-03 02:24:30 -06:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2011-05-20 01:34:20 -06:00
|
|
|
static struct spear_shirq shirq_ras1 = {
|
2011-05-20 01:34:21 -06:00
|
|
|
.irq = SPEAR3XX_IRQ_GEN_RAS_1,
|
2010-05-03 02:24:30 -06:00
|
|
|
.dev_config = shirq_ras1_config,
|
|
|
|
.dev_count = ARRAY_SIZE(shirq_ras1_config),
|
|
|
|
.regs = {
|
2011-05-20 01:34:21 -06:00
|
|
|
.enb_reg = SPEAR300_INT_ENB_MASK_REG,
|
|
|
|
.status_reg = SPEAR300_INT_STS_MASK_REG,
|
|
|
|
.status_reg_mask = SPEAR300_SHIRQ_RAS1_MASK,
|
2010-05-03 02:24:30 -06:00
|
|
|
.clear_reg = -1,
|
|
|
|
},
|
2010-04-01 05:30:58 -06:00
|
|
|
};
|
|
|
|
|
2011-03-06 21:57:05 -07:00
|
|
|
/* Add spear300 specific devices here */
|
|
|
|
/* arm gpio1 device registration */
|
|
|
|
static struct pl061_platform_data gpio1_plat_data = {
|
|
|
|
.gpio_base = 8,
|
2011-05-20 01:34:21 -06:00
|
|
|
.irq_base = SPEAR300_GPIO1_INT_BASE,
|
2011-03-06 21:57:05 -07:00
|
|
|
};
|
|
|
|
|
2012-01-20 02:14:14 -07:00
|
|
|
AMBA_APB_DEVICE(spear300_gpio1, "gpio1", 0, SPEAR300_GPIO_BASE,
|
|
|
|
{SPEAR300_VIRQ_GPIO1}, &gpio1_plat_data);
|
2011-03-06 21:57:05 -07:00
|
|
|
|
2010-04-01 05:31:29 -06:00
|
|
|
/* spear300 routines */
|
2011-05-20 01:34:22 -06:00
|
|
|
void __init spear300_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
|
|
|
|
u8 pmx_dev_count)
|
2010-04-01 05:30:58 -06:00
|
|
|
{
|
2010-05-03 02:24:30 -06:00
|
|
|
int ret = 0;
|
|
|
|
|
2010-04-01 05:30:58 -06:00
|
|
|
/* call spear3xx family common init function */
|
|
|
|
spear3xx_init();
|
2010-05-03 02:24:30 -06:00
|
|
|
|
tree-wide: fix comment/printk typos
"gadget", "through", "command", "maintain", "maintain", "controller", "address",
"between", "initiali[zs]e", "instead", "function", "select", "already",
"equal", "access", "management", "hierarchy", "registration", "interest",
"relative", "memory", "offset", "already",
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-11-01 13:38:34 -06:00
|
|
|
/* shared irq registration */
|
2011-03-06 21:57:06 -07:00
|
|
|
shirq_ras1.regs.base = ioremap(SPEAR300_TELECOM_BASE, SZ_4K);
|
2010-05-03 02:24:30 -06:00
|
|
|
if (shirq_ras1.regs.base) {
|
|
|
|
ret = spear_shirq_register(&shirq_ras1);
|
|
|
|
if (ret)
|
|
|
|
printk(KERN_ERR "Error registering Shared IRQ\n");
|
|
|
|
}
|
2010-04-01 05:31:29 -06:00
|
|
|
|
2011-02-15 23:40:30 -07:00
|
|
|
/* pmx initialization */
|
2011-05-20 01:34:22 -06:00
|
|
|
pmx_driver.mode = pmx_mode;
|
|
|
|
pmx_driver.devs = pmx_devs;
|
|
|
|
pmx_driver.devs_count = pmx_dev_count;
|
|
|
|
|
2011-03-06 21:57:06 -07:00
|
|
|
pmx_driver.base = ioremap(SPEAR300_SOC_CONFIG_BASE, SZ_4K);
|
2011-02-15 23:40:30 -07:00
|
|
|
if (pmx_driver.base) {
|
|
|
|
ret = pmx_register(&pmx_driver);
|
|
|
|
if (ret)
|
2012-02-14 07:35:42 -07:00
|
|
|
printk(KERN_ERR "padmux: registration failed. err no"
|
2011-02-15 23:40:30 -07:00
|
|
|
": %d\n", ret);
|
|
|
|
/* Free Mapping, device selection already done */
|
|
|
|
iounmap(pmx_driver.base);
|
|
|
|
}
|
2010-04-01 05:31:29 -06:00
|
|
|
}
|