M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions
@@ -0,0 +1,221 @@
/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MSM_AUDIO_DMA_H
#define BANK_OFFSET 0x1000
#define LPAIF_PCM_CTL_OFFSET 0x0000
#define CTRL_DATA_OE (1 << 18)
#define RATE_8KHZ (0 << 15)
#define RATE_16KHZ (1 << 15)
#define RATE_32KHZ (2 << 15)
#define RATE_64KHZ (4 << 15)
#define RATE_128KHZ (8 << 15)
#define RATE_256KHZ (9 << 15)
#define PCM_LOOPBACK (1 << 14)
#define SYNC_SRC_INT (0 << 13)
#define SYNC_SRC_EXT (1 << 13)
#define PCM_MODE (0 << 12)
#define AUX_MODE (1 << 12)
#define RPCM_WIDTH_8 (0 << 11)
#define RPCM_WIDTH_16 (1 << 11)
#define TPCM_WIDTH_8 (0 << 10)
#define TPCM_WIDTH_16 (1 << 10)
#define RPCM_SLOT(x) (x << 5)
#define TPCM_SLOT(x) x
#define LPAIF_I2S_CTL_OFFSET(x) (0x0004 + (0x4 * x))
#define I2S_LOOPBACK (1 << 15)
#define SPK_EN_DISABLE (0 << 14)
#define SPK_EN_ENABLE (1 << 14)
#define SPK_MODE_NONE (0 << 10)
#define SPK_MODE_SD0 (1 << 10)
#define SPK_MODE_SD1 (2 << 10)
#define SPK_MODE_SD2 (3 << 10)
#define SPK_MODE_SD3 (4 << 10)
#define SPK_MODE_QUAD01 (5 << 10)
#define SPK_MODE_QUAD23 (6 << 10)
#define SPK_MODE_6CH (7 << 10)
#define SPK_MODE_8CH (8 << 10)
#define SPK_MONO_STEREO (0 << 9)
#define SPK_MONO_MONO (1 << 9)
#define MIC_EN_DISABLE (0 << 8)
#define MIC_EN_ENABLE (1 << 8)
#define MIC_MODE_NONE (0 << 4)
#define MIC_MODE_SD0 (1 << 4)
#define MIC_MODE_SD1 (2 << 4)
#define MIC_MODE_SD2 (3 << 4)
#define MIC_MODE_SD3 (4 << 4)
#define MIC_MODE_QUAD01 (5 << 4)
#define MIC_MODE_QUAD23 (6 << 4)
#define MIC_MODE_6CH (7 << 4)
#define MIC_MODE_8CH (8 << 4)
#define MIC_MONO_STEREO (0 << 3)
#define MIC_MONO_MONO (1 << 3)
#define WS_SRC_INT (0 << 2)
#define WS_SRC_EXT (1 << 2)
#define BIT_WIDTH_16 (0 << 0)
#define BIT_WIDTH_24 (1 << 0)
#define BIT_WIDTH_32 (2 << 0)
#define LPAIF_DMIC_CTL 0x0018
#define DMIC_EN_DISABLE (0 << 4)
#define DMIC_EN_ENABLE (1 << 4)
#define DMIC_MODE_NONE (0 << 1)
#define DMIC_MODE_LEFT0 (1 << 1)
#define DMIC_MODE_RIGHT0 (2 << 1)
#define DMIC_MODE_LEFT1 (3 << 1)
#define DMIC_MODE_RIGHT1 (4 << 1)
#define DMIC_MODE_STEREO0 (5 << 1)
#define DMIC_MODE_STEREO1 (6 << 1)
#define DMIC_MODE_QUAD (7 << 1)
#define BIT_WIDTH_DMIC_16 (0 << 0)
#define BIT_WIDTH_DMIC_20 (1 << 0)
#define LPAIF_DMIC_VOL_CTL(x) (0x001c + (0x4 * x))
#define UPDATE_STATUS_COMP (0 << 20)
#define UPDATE_STATUS_PEND (1 << 20) /* Timeout or Zero Crossing */
#define UPDATE_GAIN_NO (0 << 19)
#define UPDATE_GAIN_YES (1 << 19)
#define TX_HPF_BP_DC_BLOCK (0 << 18)
#define TX_HPF_BP_BYPASS_DC_BLOCK (1 << 18)
#define DMIC_GAIN_BP_GAIN (0 << 17)
#define DMIC_GAIN_BP_BYPASS_GAIN (1 << 17)
#define MUTE_EN_NORMAL (0 << 16)
#define MUTE_EN_MUTE (1 << 16)
#define TIMEOUT_VAL(x) (x << 8)
#define DMIC_GAIN_MUL(x) (x << 0)
#define LPAIF_SPARE 0x0030
#define LPAIF_WRDMA_LPBK_MIX 0x1000
#define WRDMA_LPBK_MIX_BLOCK(x) (0 << (x - 5))
#define WRDMA_LPBK_MIX_ALLOW(x) (1 << (x - 5))
#define LPAIF_DEBUG_CTL 0x1004
#define TESTMODE_OFF (0 << 4)
#define TESTMODE_ON (1 << 4)
#define TESTSEL_CH0 (0 << 0)
#define TESTSEL_CH1 (1 << 0)
#define TESTSEL_CH2 (2 << 0)
#define TESTSEL_CH3 (3 << 0)
#define TESTSEL_CH4 (4 << 0)
#define TESTSEL_CH5 (5 << 0)
#define TESTSEL_CH6 (6 << 0)
#define TESTSEL_CH7 (7 << 0)
#define TESTSEL_CH8 (8 << 0)
#define TESTSEL_MIXER (9 << 0)
#define TESTSEL_CODEC_SPKR (10 << 0)
#define TESTSEL_CODEC_MIC (11 << 0)
#define TESTSEL_MI2S (12 << 0)
#define TESTSEL_SEC_SPKR (13 << 0)
#define TESTSEL_SEC_MIC (14 << 0)
#define TESTSEL_DMIC (15 << 0)
#define LPAIF_MIXER_CTL 0x2000
#define OVR_DETECTED_NO (0 << 10)
#define OVR_DETECTED_YES (1 << 10)
#define OVR_CLR_NO (0 << 9)
#define OVR_CLR_YES (1 << 9)
#define SAT_EN_DISABLE (0 << 8)
#define SAT_EN_ENABLE (1 << 8)
#define MIXER_BIT_WIDTH_8 (0 << 6)
#define MIXER_BIT_WIDTH_16 (1 << 6)
#define MIXER_BIT_WIDTH_24 (2 << 6)
#define MIXER_BIT_WIDTH_32 (3 << 6)
#define PORT1_CH_NONE (0 << 3)
#define PORT1_CH_0 (1 << 3)
#define PORT1_CH_1 (2 << 3)
#define PORT1_CH_2 (3 << 3)
#define PORT1_CH_3 (4 << 3)
#define PORT1_CH_4 (5 << 3)
#define PORT0_CH_NONE (0 << 0)
#define PORT0_CH_0 (1 << 0)
#define PORT0_CH_1 (2 << 0)
#define PORT0_CH_2 (3 << 0)
#define PORT0_CH_3 (4 << 0)
#define PORT0_CH_4 (5 << 0)
#define DMA_IRQ_BASE 0x3000
#define DMA_IRQ_INDEX(x) (BANK_OFFSET * x)
#define DMA_IRQ_ADDR(irq, addr) (DMA_IRQ_BASE \
+ DMA_IRQ_INDEX(irq) + addr)
/* Audio Interrupt registers for DMA channel confuguration */
#define LPAIF_IRQ_EN(x) DMA_IRQ_ADDR(x, 0x00)
#define LPAIF_IRQ_STAT(x) DMA_IRQ_ADDR(x, 0x04)
#define LPAIF_IRQ_RAW_STAT(x) DMA_IRQ_ADDR(x, 0x08)
#define LPAIF_IRQ_CLEAR(x) DMA_IRQ_ADDR(x, 0x0c)
#define LPAIF_IRQ_FORCE(x) DMA_IRQ_ADDR(x, 0x10)
#define PER_CH(x) (1 << (3 * x))
#define UNDER_CH(x) (2 << (3 * x))
#define ERR_CH(x) (4 << (3 * x))
/* Audio DMA registers for DMA channel confuguration */
#define DMA_CH_CTL_BASE 0x6000
#define DMA_CH_INDEX(ch) (BANK_OFFSET * ch)
#define DMA_CTRL_ADDR(ch, addr) (DMA_CH_CTL_BASE \
+ (DMA_CH_INDEX(ch) + addr))
#define LPAIF_DMA_CTL(x) DMA_CTRL_ADDR(x, 0x00)
#define BURST_EN (1 << 11)
#define WPSCNT_ONE (0 << 8)
#define WPSCNT_TWO (1 << 8)
#define WPSCNT_THREE (2 << 8)
#define WPSCNT_FOUR (3 << 8)
#define WPSCNT_SIX (5 << 8)
#define WPSCNT_EIGHT (7 << 8)
#define AUDIO_INTF_NONE (0 << 4)
#define AUDIO_INTF_CODEC (1 << 4)
#define AUDIO_INTF_PCM (2 << 4)
#define AUDIO_INTF_SEC_I2S (3 << 4)
#define AUDIO_INTF_MI2S (4 << 4)
#define AUDIO_INTF_HDMI (5 << 4)
#define AUDIO_INTF_MIXOUT (6 << 4)
#define AUDIO_INTF_LOOPBACK1 (7 << 4)
#define AUDIO_INTF_LOOPBACK2 (8 << 4)
#define FIFO_WATERMRK(x) ((x & 0x7) << 1)
#define ENABLE (1 << 0)
#define LPAIF_DMA_BASE(x) DMA_CTRL_ADDR(x, 0x04)
#define BASE_ADDR (0xFFFFFFFF << 4)
#define LPAIF_DMA_BUFF_LEN(x) DMA_CTRL_ADDR(x, 0x08)
#define LPAIF_DMA_CURR_ADDR(x) DMA_CTRL_ADDR(x, 0x0c)
#define LPAIF_DMA_PER_LEN(x) DMA_CTRL_ADDR(x, 0x10)
#define LPAIF_DMA_PER_CNT(x) DMA_CTRL_ADDR(x, 0x14)
#define LPAIF_DMA_FRM(x) DMA_CTRL_ADDR(x, 0x18)
#define LPAIF_DMA_FRMCLR(x) DMA_CTRL_ADDR(x, 0x1c)
#define LPAIF_DMA_SET_BUFF_CNT(x) DMA_CTRL_ADDR(x, 0x20)
#define LPAIF_DMA_SET_PER_CNT(x) DMA_CTRL_ADDR(x, 0x24)
#define LPAIF_DMA_PER_CNT_PER_CNT_MASK 0x000FFFFF
#define LPAIF_DMA_PER_CNT_PER_CNT_SHIFT 0
#define LPAIF_DMA_PER_CNT_FIFO_WORDCNT_MASK 0x00F00000
#define LPAIF_DMA_PER_CNT_FIFO_WORDCNT_SHIFT 20
/* channel assignments */
#define DMA_CH_0 0
#define DMA_CH_1 1
#define DMA_CH_2 2
#define DMA_CH_3 3
#define DMA_CH_4 4
#define DMA_CH_5 5
#define DMA_CH_6 6
#define DMA_CH_7 7
#endif
@@ -0,0 +1,136 @@
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/types.h>
#include <linux/skbuff.h>
#ifndef _BAM_DMUX_H
#define _BAM_DMUX_H
#define BAM_DMUX_CH_NAME_MAX_LEN 20
enum {
BAM_DMUX_DATA_RMNET_0,
BAM_DMUX_DATA_RMNET_1,
BAM_DMUX_DATA_RMNET_2,
BAM_DMUX_DATA_RMNET_3,
BAM_DMUX_DATA_RMNET_4,
BAM_DMUX_DATA_RMNET_5,
BAM_DMUX_DATA_RMNET_6,
BAM_DMUX_DATA_RMNET_7,
BAM_DMUX_USB_RMNET_0,
BAM_DMUX_RESERVED_0, /* 9..11 are reserved*/
BAM_DMUX_RESERVED_1,
BAM_DMUX_RESERVED_2,
BAM_DMUX_DATA_REV_RMNET_0,
BAM_DMUX_DATA_REV_RMNET_1,
BAM_DMUX_DATA_REV_RMNET_2,
BAM_DMUX_DATA_REV_RMNET_3,
BAM_DMUX_DATA_REV_RMNET_4,
BAM_DMUX_DATA_REV_RMNET_5,
BAM_DMUX_DATA_REV_RMNET_6,
BAM_DMUX_DATA_REV_RMNET_7,
BAM_DMUX_DATA_REV_RMNET_8,
BAM_DMUX_NUM_CHANNELS
};
/* event type enum */
enum {
BAM_DMUX_RECEIVE, /* data is struct sk_buff */
BAM_DMUX_WRITE_DONE, /* data is struct sk_buff */
BAM_DMUX_UL_CONNECTED, /* data is null */
BAM_DMUX_UL_DISCONNECTED, /*data is null */
};
/*
* Open a bam_dmux logical channel
* id - the logical channel to open
* priv - private data pointer to be passed to the notify callback
* notify - event callback function
* priv - private data pointer passed to msm_bam_dmux_open()
* event_type - type of event
* data - data relevant to event. May not be valid. See event_type
* enum for valid cases.
*/
#ifdef CONFIG_MSM_BAM_DMUX
int msm_bam_dmux_open(uint32_t id, void *priv,
void (*notify)(void *priv, int event_type,
unsigned long data));
int msm_bam_dmux_close(uint32_t id);
int msm_bam_dmux_write(uint32_t id, struct sk_buff *skb);
int msm_bam_dmux_kickoff_ul_wakeup(void);
int msm_bam_dmux_ul_power_vote(void);
int msm_bam_dmux_ul_power_unvote(void);
int msm_bam_dmux_is_ch_full(uint32_t id);
int msm_bam_dmux_is_ch_low(uint32_t id);
int msm_bam_dmux_reg_notify(void *priv,
void (*notify)(void *priv, int event_type,
unsigned long data));
#else
static inline int msm_bam_dmux_open(uint32_t id, void *priv,
void (*notify)(void *priv, int event_type,
unsigned long data))
{
return -ENODEV;
}
static inline int msm_bam_dmux_close(uint32_t id)
{
return -ENODEV;
}
static inline int msm_bam_dmux_write(uint32_t id, struct sk_buff *skb)
{
return -ENODEV;
}
static inline int msm_bam_dmux_kickoff_ul_wakeup(void)
{
return -ENODEV;
}
static inline int msm_bam_dmux_ul_power_vote(void)
{
return -ENODEV;
}
static inline int msm_bam_dmux_ul_power_unvote(void)
{
return -ENODEV;
}
static inline int msm_bam_dmux_is_ch_full(uint32_t id)
{
return -ENODEV;
}
static inline int msm_bam_dmux_is_ch_low(uint32_t id)
{
return -ENODEV;
}
static inline int msm_bam_dmux_reg_notify(void *priv,
void (*notify)(void *priv, int event_type,
unsigned long data))
{
return -ENODEV;
}
#endif
#endif /* _BAM_DMUX_H */
@@ -0,0 +1,22 @@
/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <mach/memory.h>
#define mb() do \
{ \
dsb();\
outer_sync(); \
write_to_strongly_ordered_memory(); \
} while (0)
#define rmb() do { dmb(); write_to_strongly_ordered_memory(); } while (0)
#define wmb() mb()
@@ -0,0 +1,36 @@
/*
* Copyright (C) 2009 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_BCM_BT_LPM_H
#define __ASM_ARCH_BCM_BT_LPM_H
#include <linux/serial_core.h>
/* Uart driver must call this every time it beings TX, to ensure
* this driver keeps WAKE asserted during TX. Called with uart
* spinlock held. */
extern void bcm_bt_lpm_exit_lpm_locked(struct uart_port *uport);
struct bcm_bt_lpm_platform_data {
unsigned int gpio_wake; /* CPU -> BCM wakeup gpio */
unsigned int gpio_host_wake; /* BCM -> CPU wakeup gpio */
/* Callback to request the uart driver to clock off.
* Called with uart spinlock held. */
void (*request_clock_off_locked)(struct uart_port *uport);
/* Callback to request the uart driver to clock on.
* Called with uart spinlock held. */
void (*request_clock_on_locked)(struct uart_port *uport);
};
#endif
@@ -0,0 +1,41 @@
/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ARCH_ARM_MACH_MSM_BOARD_MSM8660_H
#define __ARCH_ARM_MACH_MSM_BOARD_MSM8660_H
#include <linux/mfd/pmic8058.h>
#include <linux/mfd/pmic8901.h>
#include <mach/irqs.h>
/* Macros assume PMIC GPIOs start at 0 */
#define PM8058_GPIO_BASE NR_MSM_GPIOS
#define PM8058_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio + PM8058_GPIO_BASE)
#define PM8058_GPIO_SYS_TO_PM(sys_gpio) (sys_gpio - PM8058_GPIO_BASE)
#define PM8058_MPP_BASE (PM8058_GPIO_BASE + PM8058_GPIOS)
#define PM8058_MPP_PM_TO_SYS(pm_gpio) (pm_gpio + PM8058_MPP_BASE)
#define PM8058_MPP_SYS_TO_PM(sys_gpio) (sys_gpio - PM8058_MPP_BASE)
#define PM8058_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS)
#define PM8901_MPP_BASE (PM8058_GPIO_BASE + \
PM8058_GPIOS + PM8058_MPPS)
#define PM8901_MPP_PM_TO_SYS(pm_gpio) (pm_gpio + PM8901_MPP_BASE)
#define PM8901_MPP_SYS_TO_PM(sys_gpio) (sys_gpio - PM901_MPP_BASE)
#define PM8901_IRQ_BASE (PM8058_IRQ_BASE + \
NR_PMIC8058_IRQS)
#ifdef CONFIG_MSM_CAMERA_V4L2
extern struct msm_camera_board_info msm8x60_camera_board_info;
void msm8x60_init_cam(void);
#endif
#endif
@@ -0,0 +1,674 @@
/* arch/arm/mach-msm/include/mach/board.h
*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2008-2013, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MSM_BOARD_H
#define __ASM_ARCH_MSM_BOARD_H
#include <linux/types.h>
#include <linux/input.h>
#include <linux/usb.h>
#include <linux/leds-pmic8058.h>
#include <linux/clkdev.h>
#include <linux/of_platform.h>
#include <linux/msm_ssbi.h>
#include <mach/msm_bus.h>
struct msm_camera_io_ext {
uint32_t mdcphy;
uint32_t mdcsz;
uint32_t appphy;
uint32_t appsz;
uint32_t camifpadphy;
uint32_t camifpadsz;
uint32_t csiphy;
uint32_t csisz;
uint32_t csiirq;
uint32_t csiphyphy;
uint32_t csiphysz;
uint32_t csiphyirq;
uint32_t ispifphy;
uint32_t ispifsz;
uint32_t ispifirq;
};
struct msm_camera_io_clk {
uint32_t mclk_clk_rate;
uint32_t vfe_clk_rate;
};
struct msm_cam_expander_info {
struct i2c_board_info const *board_info;
int bus_id;
};
struct msm_camera_device_platform_data {
int (*camera_gpio_on) (void);
void (*camera_gpio_off)(void);
struct msm_camera_io_ext ioext;
struct msm_camera_io_clk ioclk;
uint8_t csid_core;
uint8_t is_vpe;
struct msm_bus_scale_pdata *cam_bus_scale_table;
uint8_t csiphy_core;
};
#ifdef CONFIG_SENSORS_MT9T013
struct msm_camera_legacy_device_platform_data {
int sensor_reset;
int sensor_pwd;
int vcm_pwd;
void (*config_gpio_on) (void);
void (*config_gpio_off)(void);
};
#endif
#define MSM_CAMERA_FLASH_NONE 0
#define MSM_CAMERA_FLASH_LED 1
#define MSM_CAMERA_FLASH_SRC_PMIC (0x00000001<<0)
#define MSM_CAMERA_FLASH_SRC_PWM (0x00000001<<1)
#define MSM_CAMERA_FLASH_SRC_CURRENT_DRIVER (0x00000001<<2)
#define MSM_CAMERA_FLASH_SRC_EXT (0x00000001<<3)
#define MSM_CAMERA_FLASH_SRC_LED (0x00000001<<3)
#define MSM_CAMERA_FLASH_SRC_LED1 (0x00000001<<4)
struct msm_camera_sensor_flash_pmic {
uint8_t num_of_src;
uint32_t low_current;
uint32_t high_current;
enum pmic8058_leds led_src_1;
enum pmic8058_leds led_src_2;
int (*pmic_set_current)(enum pmic8058_leds id, unsigned mA);
};
struct msm_camera_sensor_flash_pwm {
uint32_t freq;
uint32_t max_load;
uint32_t low_load;
uint32_t high_load;
uint32_t channel;
};
struct pmic8058_leds_platform_data;
struct msm_camera_sensor_flash_current_driver {
uint32_t low_current;
uint32_t high_current;
const struct pmic8058_leds_platform_data *driver_channel;
};
enum msm_camera_ext_led_flash_id {
MAM_CAMERA_EXT_LED_FLASH_SC628A,
MAM_CAMERA_EXT_LED_FLASH_TPS61310,
};
struct msm_camera_sensor_flash_external {
uint32_t led_en;
uint32_t led_flash_en;
enum msm_camera_ext_led_flash_id flash_id;
struct msm_cam_expander_info *expander_info;
};
struct msm_camera_sensor_flash_led {
const char *led_name;
const int led_name_len;
};
struct msm_camera_sensor_flash_src {
int flash_sr_type;
struct gpio *init_gpio_tbl;
uint8_t init_gpio_tbl_size;
struct msm_gpio_set_tbl *set_gpio_tbl;
uint8_t set_gpio_tbl_size;
union {
struct msm_camera_sensor_flash_pmic pmic_src;
struct msm_camera_sensor_flash_pwm pwm_src;
struct msm_camera_sensor_flash_current_driver
current_driver_src;
struct msm_camera_sensor_flash_external
ext_driver_src;
struct msm_camera_sensor_flash_led led_src;
} _fsrc;
};
struct msm_camera_sensor_flash_data {
int flash_type;
struct msm_camera_sensor_flash_src *flash_src;
struct i2c_board_info const *board_info;
int bus_id;
uint8_t flash_src_index;
};
struct msm_camera_sensor_strobe_flash_data {
uint8_t flash_trigger;
uint8_t flash_charge; /* pin for charge */
uint8_t flash_charge_done;
uint32_t flash_recharge_duration;
uint32_t irq;
spinlock_t spin_lock;
spinlock_t timer_lock;
int state;
};
enum msm_camera_type {
BACK_CAMERA_2D,
FRONT_CAMERA_2D,
BACK_CAMERA_3D,
BACK_CAMERA_INT_3D,
};
enum msm_sensor_type {
BAYER_SENSOR,
YUV_SENSOR,
};
struct msm_gpio_set_tbl {
unsigned gpio;
unsigned long flags;
uint32_t delay;
};
struct msm_camera_gpio_num_info {
uint16_t gpio_num[2];
};
struct msm_camera_gpio_conf {
void *cam_gpiomux_conf_tbl;
uint8_t cam_gpiomux_conf_tbl_size;
struct gpio *cam_gpio_common_tbl;
uint8_t cam_gpio_common_tbl_size;
struct gpio *cam_gpio_req_tbl;
uint8_t cam_gpio_req_tbl_size;
struct msm_gpio_set_tbl *cam_gpio_set_tbl;
uint8_t cam_gpio_set_tbl_size;
uint32_t gpio_no_mux;
uint32_t *camera_off_table;
uint8_t camera_off_table_size;
uint32_t *camera_on_table;
uint8_t camera_on_table_size;
struct msm_camera_gpio_num_info *gpio_num_info;
};
enum msm_camera_i2c_mux_mode {
MODE_R,
MODE_L,
MODE_DUAL
};
struct msm_camera_i2c_conf {
uint8_t use_i2c_mux;
struct platform_device *mux_dev;
enum msm_camera_i2c_mux_mode i2c_mux_mode;
};
struct msm_camera_sensor_platform_info {
int mount_angle;
int sensor_reset;
struct camera_vreg_t *cam_vreg;
int num_vreg;
int32_t (*ext_power_ctrl) (int enable);
struct msm_camera_gpio_conf *gpio_conf;
struct msm_camera_i2c_conf *i2c_conf;
struct msm_camera_csi_lane_params *csi_lane_params;
};
enum msm_camera_actuator_name {
MSM_ACTUATOR_MAIN_CAM_0,
MSM_ACTUATOR_MAIN_CAM_1,
MSM_ACTUATOR_MAIN_CAM_2,
MSM_ACTUATOR_MAIN_CAM_3,
MSM_ACTUATOR_MAIN_CAM_4,
MSM_ACTUATOR_MAIN_CAM_5,
MSM_ACTUATOR_WEB_CAM_0,
MSM_ACTUATOR_WEB_CAM_1,
MSM_ACTUATOR_WEB_CAM_2,
};
struct msm_actuator_info {
struct i2c_board_info const *board_info;
enum msm_camera_actuator_name cam_name;
int bus_id;
int vcm_pwd;
int vcm_enable;
};
struct msm_eeprom_info {
struct i2c_board_info const *board_info;
int bus_id;
int eeprom_reg_addr;
int eeprom_read_length;
int eeprom_i2c_slave_addr;
};
struct msm_camera_sensor_info {
const char *sensor_name;
int sensor_reset_enable;
int sensor_reset;
int sensor_pwd;
int vcm_pwd;
int vcm_enable;
int mclk;
int flash_type;
struct msm_camera_sensor_platform_info *sensor_platform_info;
struct msm_camera_device_platform_data *pdata;
struct resource *resource;
uint8_t num_resources;
struct msm_camera_sensor_flash_data *flash_data;
int csi_if;
struct msm_camera_sensor_strobe_flash_data *strobe_flash_data;
char *eeprom_data;
enum msm_camera_type camera_type;
enum msm_sensor_type sensor_type;
struct msm_actuator_info *actuator_info;
int pmic_gpio_enable;
struct msm_eeprom_info *eeprom_info;
};
struct msm_camera_board_info {
struct i2c_board_info *board_info;
uint8_t num_i2c_board_info;
};
int msm_get_cam_resources(struct msm_camera_sensor_info *);
struct clk_lookup;
struct snd_endpoint {
int id;
const char *name;
};
struct msm_snd_endpoints {
struct snd_endpoint *endpoints;
unsigned num;
};
struct cad_endpoint {
int id;
const char *name;
uint32_t capability;
};
struct msm_cad_endpoints {
struct cad_endpoint *endpoints;
unsigned num;
};
#define MSM_MAX_DEC_CNT 14
/* 7k target ADSP information */
/* Bit 23:0, for codec identification like mp3, wav etc *
* Bit 27:24, for mode identification like tunnel, non tunnel*
* bit 31:28, for operation support like DM, DMA */
enum msm_adspdec_concurrency {
MSM_ADSP_CODEC_WAV = 0,
MSM_ADSP_CODEC_ADPCM = 1,
MSM_ADSP_CODEC_MP3 = 2,
MSM_ADSP_CODEC_REALAUDIO = 3,
MSM_ADSP_CODEC_WMA = 4,
MSM_ADSP_CODEC_AAC = 5,
MSM_ADSP_CODEC_RESERVED = 6,
MSM_ADSP_CODEC_MIDI = 7,
MSM_ADSP_CODEC_YADPCM = 8,
MSM_ADSP_CODEC_QCELP = 9,
MSM_ADSP_CODEC_AMRNB = 10,
MSM_ADSP_CODEC_AMRWB = 11,
MSM_ADSP_CODEC_EVRC = 12,
MSM_ADSP_CODEC_WMAPRO = 13,
MSM_ADSP_CODEC_AC3 = 23,
MSM_ADSP_MODE_TUNNEL = 24,
MSM_ADSP_MODE_NONTUNNEL = 25,
MSM_ADSP_MODE_LP = 26,
MSM_ADSP_OP_DMA = 28,
MSM_ADSP_OP_DM = 29,
};
struct msm_adspdec_info {
const char *module_name;
unsigned module_queueid;
int module_decid; /* objid */
unsigned nr_codec_support;
};
/* Carries information about number codec
* supported if same codec or different codecs
*/
struct dec_instance_table {
uint8_t max_instances_same_dec;
uint8_t max_instances_diff_dec;
};
struct msm_adspdec_database {
unsigned num_dec;
unsigned num_concurrency_support;
unsigned int *dec_concurrency_table; /* Bit masked entry to *
* represents codec, mode etc */
struct msm_adspdec_info *dec_info_list;
struct dec_instance_table *dec_instance_list;
};
enum msm_mdp_hw_revision {
MDP_REV_20 = 1,
MDP_REV_22,
MDP_REV_30,
MDP_REV_303,
MDP_REV_31,
MDP_REV_40,
MDP_REV_41,
MDP_REV_42,
MDP_REV_43,
MDP_REV_44,
};
struct msm_panel_common_pdata {
uintptr_t hw_revision_addr;
int gpio;
bool bl_lock;
spinlock_t bl_spinlock;
int (*backlight_level)(int level, int max, int min);
int (*pmic_backlight)(int level);
int (*rotate_panel)(void);
int (*backlight) (int level, int mode);
int (*panel_num)(void);
void (*panel_config_gpio)(int);
int (*vga_switch)(int select_vga);
int *gpio_num;
u32 mdp_max_clk;
#ifdef CONFIG_MSM_BUS_SCALING
struct msm_bus_scale_pdata *mdp_bus_scale_table;
#endif
int mdp_rev;
u32 ov0_wb_size; /* overlay0 writeback size */
u32 ov1_wb_size; /* overlay1 writeback size */
u32 mem_hid;
char cont_splash_enabled;
u32 splash_screen_addr;
u32 splash_screen_size;
char mdp_iommu_split_domain;
u32 avtimer_phy;
};
struct lcdc_platform_data {
int (*lcdc_gpio_config)(int on);
int (*lcdc_power_save)(int);
unsigned int (*lcdc_get_clk)(void);
#ifdef CONFIG_MSM_BUS_SCALING
struct msm_bus_scale_pdata *bus_scale_table;
#endif
int (*lvds_pixel_remap)(void);
};
struct tvenc_platform_data {
int poll;
int (*pm_vid_en)(int on);
#ifdef CONFIG_MSM_BUS_SCALING
struct msm_bus_scale_pdata *bus_scale_table;
#endif
};
struct mddi_platform_data {
int (*mddi_power_save)(int on);
int (*mddi_sel_clk)(u32 *clk_rate);
int (*mddi_client_power)(u32 client_id);
};
struct mipi_dsi_platform_data {
int vsync_gpio;
int (*dsi_power_save)(int on);
int (*dsi_client_reset)(void);
int (*get_lane_config)(void);
char (*splash_is_enabled)(void);
int target_type;
};
enum mipi_dsi_3d_ctrl {
FPGA_EBI2_INTF,
FPGA_SPI_INTF,
};
/* DSI PHY configuration */
struct mipi_dsi_phy_ctrl {
uint32_t regulator[5];
uint32_t timing[12];
uint32_t ctrl[4];
uint32_t strength[4];
uint32_t pll[21];
};
struct mipi_dsi_panel_platform_data {
int fpga_ctrl_mode;
int fpga_3d_config_addr;
int *gpio;
struct mipi_dsi_phy_ctrl *phy_ctrl_settings;
char dlane_swap;
void (*dsi_pwm_cfg)(void);
char enable_wled_bl_ctrl;
void (*gpio_set_backlight)(int bl_level);
};
struct lvds_panel_platform_data {
int *gpio;
};
struct msm_wfd_platform_data {
char (*wfd_check_mdp_iommu_split)(void);
};
#define PANEL_NAME_MAX_LEN 50
struct msm_fb_platform_data {
int (*detect_client)(const char *name);
int mddi_prescan;
unsigned char ext_resolution;
int (*allow_set_offset)(void);
char prim_panel_name[PANEL_NAME_MAX_LEN];
char ext_panel_name[PANEL_NAME_MAX_LEN];
};
struct msm_hdmi_platform_data {
int irq;
int (*cable_detect)(int insert);
int (*comm_power)(int on, int show);
int (*enable_5v)(int on);
int (*core_power)(int on, int show);
int (*cec_power)(int on);
int (*panel_power)(int on);
int (*gpio_config)(int on);
int (*init_irq)(void);
bool (*check_hdcp_hw_support)(void);
bool is_mhl_enabled;
};
struct msm_mhl_platform_data {
int irq;
/* GPIO no. for mhl intr */
uint32_t gpio_mhl_int;
/* GPIO no. for mhl block reset */
uint32_t gpio_mhl_reset;
/*
* below gpios are specific to targets
* that have the integrated MHL soln.
*/
/* GPIO no. for mhl block power */
uint32_t gpio_mhl_power;
/* GPIO no. for hdmi-mhl mux */
uint32_t gpio_hdmi_mhl_mux;
bool mhl_enabled;
};
/**
* msm_i2c_platform_data: i2c-qup driver configuration data
*
* @active_only when set, votes when system active and removes the vote when
* system goes idle (optimises for performance). When unset, voting using
* runtime pm (optimizes for power).
* @master_id master id number of the i2c core or its wrapper (BLSP/GSBI).
* When zero, clock path voting is disabled.
*/
struct msm_i2c_platform_data {
int clk_freq;
uint32_t rmutex;
const char *rsl_id;
uint32_t pm_lat;
int pri_clk;
int pri_dat;
int aux_clk;
int aux_dat;
int src_clk_rate;
int use_gsbi_shared_mode;
int keep_ahb_clk_on;
void (*msm_i2c_config_gpio)(int iface, int config_type);
bool active_only;
uint32_t master_id;
};
struct msm_i2c_ssbi_platform_data {
const char *rsl_id;
enum msm_ssbi_controller_type controller_type;
};
struct msm_vidc_platform_data {
int memtype;
u32 enable_ion;
int disable_dmx;
int disable_fullhd;
u32 cp_enabled;
u32 secure_wb_heap;
#ifdef CONFIG_MSM_BUS_SCALING
struct msm_bus_scale_pdata *vidc_bus_client_pdata;
#endif
int cont_mode_dpb_count;
int disable_turbo;
unsigned long fw_addr;
};
enum msm_vidc_v4l2_iommu_map {
MSM_VIDC_V4L2_IOMMU_MAP_NS = 0,
MSM_VIDC_V4L2_IOMMU_MAP_CP,
MSM_VIDC_V4L2_IOMMU_MAP_MAX,
};
struct msm_vidc_v4l2_platform_data {
/*
* Should be a <num_iommu_table x 2> array where
* iommu_table[n][0] is the start address and
* iommu_table[n][1] is the size.
*/
int64_t **iommu_table;
int num_iommu_table;
/*
* Should be a <num_load_table x 2> array where
* load_table[n][0] is the load and load_table[n][1]
* is the desired clock rate.
*/
int64_t **load_table;
int num_load_table;
uint32_t max_load;
};
struct vcap_platform_data {
unsigned *gpios;
int num_gpios;
struct msm_bus_scale_pdata *bus_client_pdata;
};
#if defined(CONFIG_USB_PEHCI_HCD) || defined(CONFIG_USB_PEHCI_HCD_MODULE)
struct isp1763_platform_data {
unsigned reset_gpio;
int (*setup_gpio)(int enable);
};
#endif
/* common init routines for use by arch/arm/mach-msm/board-*.c */
#ifdef CONFIG_OF_DEVICE
void msm_8974_init(struct of_dev_auxdata **);
#endif
void msm_add_devices(void);
void msm_8974_add_devices(void);
void msm_8974_add_drivers(void);
void msm_map_common_io(void);
void msm_map_qsd8x50_io(void);
void msm_map_msm8x60_io(void);
void msm_map_msm8960_io(void);
void msm_map_msm8930_io(void);
void msm_map_apq8064_io(void);
void msm_map_msm7x30_io(void);
void msm_map_fsm9xxx_io(void);
void msm_map_fsm9900_io(void);
void fsm9900_init_gpiomux(void);
void msm_map_8974_io(void);
void msm_map_8084_io(void);
void msm_map_msmkrypton_io(void);
void msm_map_msmsamarium_io(void);
void msm_map_msm8625_io(void);
void msm_map_msm9625_io(void);
void msm_init_irq(void);
void msm_8974_init_irq(void);
void vic_handle_irq(struct pt_regs *regs);
void msm_8974_reserve(void);
void msm_8974_very_early(void);
void msm_8974_init_gpiomux(void);
void apq8084_init_gpiomux(void);
void msm9625_init_gpiomux(void);
void msmkrypton_init_gpiomux(void);
void msmsamarium_init_gpiomux(void);
void msm_map_mpq8092_io(void);
void mpq8092_init_gpiomux(void);
void msm_map_msm8226_io(void);
void msm8226_init_irq(void);
void msm8226_init_gpiomux(void);
void msm8610_init_gpiomux(void);
void msm_map_msm8610_io(void);
void msm8610_init_irq(void);
/* Dump debug info (states, rate, etc) of clocks */
#if defined(CONFIG_ARCH_MSM7X27)
void msm_clk_dump_debug_info(void);
#else
static inline void msm_clk_dump_debug_info(void) {}
#endif
struct mmc_platform_data;
int msm_add_sdcc(unsigned int controller,
struct mmc_platform_data *plat);
void msm_pm_register_irqs(void);
struct msm_usb_host_platform_data;
int msm_add_host(unsigned int host,
struct msm_usb_host_platform_data *plat);
#if defined(CONFIG_USB_FUNCTION_MSM_HSUSB) \
|| defined(CONFIG_USB_MSM_72K) || defined(CONFIG_USB_MSM_72K_MODULE)
void msm_hsusb_set_vbus_state(int online);
#else
static inline void msm_hsusb_set_vbus_state(int online) {}
#endif
void msm_snddev_init(void);
void msm_snddev_init_timpani(void);
void msm_snddev_poweramp_on(void);
void msm_snddev_poweramp_off(void);
void msm_snddev_hsed_voltage_on(void);
void msm_snddev_hsed_voltage_off(void);
void msm_snddev_tx_route_config(void);
void msm_snddev_tx_route_deconfig(void);
extern phys_addr_t msm_shared_ram_phys; /* defined in arch/arm/mach-msm/io.c */
#endif
@@ -0,0 +1,78 @@
/* arch/arm/mach-msm/include/mach/BOARD_HTC.h
* Copyright (C) 2007-2009 HTC Corporation.
* Author: Thomas Tsai <thomas_tsai@htc.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_BOARD_HTC_H
#define __ASM_ARCH_MSM_BOARD_HTC_H
#include <linux/types.h>
#include <linux/list.h>
#include <asm/setup.h>
struct msm_pmem_setting{
resource_size_t pmem_start;
resource_size_t pmem_size;
resource_size_t pmem_adsp_start;
resource_size_t pmem_adsp_size;
resource_size_t pmem_gpu0_start;
resource_size_t pmem_gpu0_size;
resource_size_t pmem_gpu1_start;
resource_size_t pmem_gpu1_size;
resource_size_t pmem_camera_start;
resource_size_t pmem_camera_size;
resource_size_t ram_console_start;
resource_size_t ram_console_size;
};
enum {
MSM_SERIAL_UART1 = 0,
MSM_SERIAL_UART2,
MSM_SERIAL_UART3,
#ifdef CONFIG_SERIAL_MSM_HS
MSM_SERIAL_UART1DM,
MSM_SERIAL_UART2DM,
#endif
MSM_SERIAL_NUM,
};
/* common init routines for use by arch/arm/mach-msm/board-*.c */
void __init msm_add_usb_devices(void (*phy_reset) (void));
void __init msm_add_mem_devices(struct msm_pmem_setting *setting);
void __init msm_init_pmic_vibrator(void);
struct mmc_platform_data;
int __init msm_add_sdcc_devices(unsigned int controller, struct mmc_platform_data *plat);
int __init msm_add_serial_devices(unsigned uart);
#if defined(CONFIG_USB_FUNCTION_MSM_HSUSB)
/* START: add USB connected notify function */
struct t_usb_status_notifier{
struct list_head notifier_link;
const char *name;
void (*func)(int online);
};
int usb_register_notifier(struct t_usb_status_notifier *);
static LIST_HEAD(g_lh_usb_notifier_list);
/* END: add USB connected notify function */
#endif
int __init board_mfg_mode(void);
int __init parse_tag_smi(const struct tag *tags);
int __init parse_tag_hwid(const struct tag * tags);
int __init parse_tag_skuid(const struct tag * tags);
int parse_tag_engineerid(const struct tag * tags);
char *board_serialno(void);
#endif
@@ -0,0 +1,685 @@
/* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM__ARCH_CAMERA_H
#define __ASM__ARCH_CAMERA_H
#include <linux/list.h>
#include <linux/poll.h>
#include <linux/cdev.h>
#include <linux/platform_device.h>
#include <linux/pm_qos.h>
#include <linux/regulator/consumer.h>
#include "linux/types.h"
#include <mach/board.h>
#include <media/msm_camera.h>
#include <linux/msm_ion.h>
#include <mach/iommu_domains.h>
#define CONFIG_MSM_CAMERA_DEBUG
#ifdef CONFIG_MSM_CAMERA_DEBUG
#define CDBG(fmt, args...) pr_debug(fmt, ##args)
#else
#define CDBG(fmt, args...) do { } while (0)
#endif
#define PAD_TO_2K(a, b) ((!b) ? a : (((a)+2047) & ~2047))
#define MSM_CAMERA_MSG 0
#define MSM_CAMERA_EVT 1
#define NUM_WB_EXP_NEUTRAL_REGION_LINES 4
#define NUM_WB_EXP_STAT_OUTPUT_BUFFERS 3
#define NUM_AUTOFOCUS_MULTI_WINDOW_GRIDS 16
#define NUM_STAT_OUTPUT_BUFFERS 3
#define NUM_AF_STAT_OUTPUT_BUFFERS 3
#define max_control_command_size 512
#define CROP_LEN 36
enum vfe_mode_of_operation{
VFE_MODE_OF_OPERATION_CONTINUOUS,
VFE_MODE_OF_OPERATION_SNAPSHOT,
VFE_MODE_OF_OPERATION_VIDEO,
VFE_MODE_OF_OPERATION_RAW_SNAPSHOT,
VFE_MODE_OF_OPERATION_ZSL,
VFE_MODE_OF_OPERATION_JPEG_SNAPSHOT,
VFE_LAST_MODE_OF_OPERATION_ENUM
};
enum msm_queue {
MSM_CAM_Q_CTRL, /* control command or control command status */
MSM_CAM_Q_VFE_EVT, /* adsp event */
MSM_CAM_Q_VFE_MSG, /* adsp message */
MSM_CAM_Q_V4L2_REQ, /* v4l2 request */
MSM_CAM_Q_VPE_MSG, /* vpe message */
MSM_CAM_Q_PP_MSG, /* pp message */
};
enum vfe_resp_msg {
VFE_EVENT,
VFE_MSG_GENERAL,
VFE_MSG_SNAPSHOT,
VFE_MSG_OUTPUT_P, /* preview (continuous mode ) */
VFE_MSG_OUTPUT_T, /* thumbnail (snapshot mode )*/
VFE_MSG_OUTPUT_S, /* main image (snapshot mode )*/
VFE_MSG_OUTPUT_V, /* video (continuous mode ) */
VFE_MSG_STATS_AEC,
VFE_MSG_STATS_AF,
VFE_MSG_STATS_AWB,
VFE_MSG_STATS_RS, /* 10 */
VFE_MSG_STATS_CS,
VFE_MSG_STATS_IHIST,
VFE_MSG_STATS_SKIN,
VFE_MSG_STATS_WE, /* AEC + AWB */
VFE_MSG_SYNC_TIMER0,
VFE_MSG_SYNC_TIMER1,
VFE_MSG_SYNC_TIMER2,
VFE_MSG_COMMON,
VFE_MSG_START,
VFE_MSG_START_RECORDING, /* 20 */
VFE_MSG_CAPTURE,
VFE_MSG_JPEG_CAPTURE,
VFE_MSG_OUTPUT_IRQ,
VFE_MSG_PREVIEW,
VFE_MSG_OUTPUT_PRIMARY,
VFE_MSG_OUTPUT_SECONDARY,
VFE_MSG_OUTPUT_TERTIARY1,
VFE_MSG_OUTPUT_TERTIARY2,
VFE_MSG_V2X_LIVESHOT_PRIMARY,
};
enum vpe_resp_msg {
VPE_MSG_GENERAL,
VPE_MSG_OUTPUT_V, /* video (continuous mode ) */
VPE_MSG_OUTPUT_ST_L,
VPE_MSG_OUTPUT_ST_R,
};
enum msm_stereo_state {
STEREO_VIDEO_IDLE,
STEREO_VIDEO_ACTIVE,
STEREO_SNAP_IDLE,
STEREO_SNAP_STARTED,
STEREO_SNAP_BUFFER1_PROCESSING,
STEREO_SNAP_BUFFER2_PROCESSING,
STEREO_RAW_SNAP_IDLE,
STEREO_RAW_SNAP_STARTED,
};
struct msm_vpe_phy_info {
uint32_t sbuf_phy;
uint32_t planar0_off;
uint32_t planar1_off;
uint32_t planar2_off;
uint32_t p0_phy;
uint32_t p1_phy;
uint32_t p2_phy;
uint8_t output_id; /* VFE31_OUTPUT_MODE_PT/S/V */
uint32_t frame_id;
};
#ifndef CONFIG_MSM_CAMERA_V4L2
#define VFE31_OUTPUT_MODE_PT (0x1 << 0)
#define VFE31_OUTPUT_MODE_S (0x1 << 1)
#define VFE31_OUTPUT_MODE_V (0x1 << 2)
#define VFE31_OUTPUT_MODE_P (0x1 << 3)
#define VFE31_OUTPUT_MODE_T (0x1 << 4)
#define VFE31_OUTPUT_MODE_P_ALL_CHNLS (0x1 << 5)
#endif
struct msm_vfe_phy_info {
uint32_t sbuf_phy;
uint32_t planar0_off;
uint32_t planar1_off;
uint32_t planar2_off;
uint32_t p0_phy;
uint32_t p1_phy;
uint32_t p2_phy;
uint8_t output_id; /* VFE31_OUTPUT_MODE_PT/S/V */
uint32_t frame_id;
};
struct msm_vfe_stats_msg {
uint8_t awb_ymin;
uint32_t aec_buff;
uint32_t awb_buff;
uint32_t af_buff;
uint32_t ihist_buff;
uint32_t rs_buff;
uint32_t cs_buff;
uint32_t skin_buff;
uint32_t status_bits;
uint32_t frame_id;
};
struct video_crop_t{
uint32_t in1_w;
uint32_t out1_w;
uint32_t in1_h;
uint32_t out1_h;
uint32_t in2_w;
uint32_t out2_w;
uint32_t in2_h;
uint32_t out2_h;
uint8_t update_flag;
};
struct msm_vpe_buf_info {
uint32_t p0_phy;
uint32_t p1_phy;
struct timespec ts;
uint32_t frame_id;
struct video_crop_t vpe_crop;
};
struct msm_vfe_resp {
enum vfe_resp_msg type;
struct msm_cam_evt_msg evt_msg;
struct msm_vfe_phy_info phy;
struct msm_vfe_stats_msg stats_msg;
struct msm_vpe_buf_info vpe_bf;
void *extdata;
int32_t extlen;
};
struct msm_vpe_resp {
enum vpe_resp_msg type;
struct msm_cam_evt_msg evt_msg;
struct msm_vpe_phy_info phy;
void *extdata;
int32_t extlen;
};
struct msm_vpe_callback {
void (*vpe_resp)(struct msm_vpe_resp *,
enum msm_queue, void *syncdata,
void *time_stamp, gfp_t gfp);
void* (*vpe_alloc)(int, void *syncdata, gfp_t gfp);
void (*vpe_free)(void *ptr);
};
struct msm_vfe_callback {
void (*vfe_resp)(struct msm_vfe_resp *,
enum msm_queue, void *syncdata,
gfp_t gfp);
void* (*vfe_alloc)(int, void *syncdata, gfp_t gfp);
void (*vfe_free)(void *ptr);
};
struct msm_camvfe_fn {
int (*vfe_init)(struct msm_vfe_callback *,
struct platform_device *);
int (*vfe_enable)(struct camera_enable_cmd *);
int (*vfe_config)(struct msm_vfe_cfg_cmd *, void *);
int (*vfe_disable)(struct camera_enable_cmd *,
struct platform_device *dev);
void (*vfe_release)(struct platform_device *);
void (*vfe_stop)(void);
};
struct msm_camvfe_params {
struct msm_vfe_cfg_cmd *vfe_cfg;
void *data;
};
struct msm_mctl_pp_params {
struct msm_mctl_pp_cmd *cmd;
void *data;
};
struct msm_camvpe_fn {
int (*vpe_reg)(struct msm_vpe_callback *);
int (*vpe_cfg_update) (void *);
void (*send_frame_to_vpe) (uint32_t planar0_off, uint32_t planar1_off,
struct timespec *ts, int output_id);
int (*vpe_config)(struct msm_vpe_cfg_cmd *, void *);
void (*vpe_cfg_offset)(int frame_pack, uint32_t pyaddr,
uint32_t pcbcraddr, struct timespec *ts, int output_id,
struct msm_st_half st_half, int frameid);
int *dis;
};
struct msm_sensor_ctrl {
int (*s_init)(const struct msm_camera_sensor_info *);
int (*s_release)(void);
int (*s_config)(void __user *);
enum msm_camera_type s_camera_type;
uint32_t s_mount_angle;
enum msm_st_frame_packing s_video_packing;
enum msm_st_frame_packing s_snap_packing;
};
struct msm_strobe_flash_ctrl {
int (*strobe_flash_init)
(struct msm_camera_sensor_strobe_flash_data *);
int (*strobe_flash_release)
(struct msm_camera_sensor_strobe_flash_data *, int32_t);
int (*strobe_flash_charge)(int32_t, int32_t, uint32_t);
};
enum cci_i2c_master_t {
MASTER_0,
MASTER_1,
};
enum cci_i2c_queue_t {
QUEUE_0,
QUEUE_1,
};
struct msm_camera_cci_client {
struct v4l2_subdev *cci_subdev;
uint32_t freq;
enum cci_i2c_master_t cci_i2c_master;
uint16_t sid;
uint16_t cid;
uint32_t timeout;
uint16_t retries;
uint16_t id_map;
};
enum msm_cci_cmd_type {
MSM_CCI_INIT,
MSM_CCI_RELEASE,
MSM_CCI_SET_SID,
MSM_CCI_SET_FREQ,
MSM_CCI_SET_SYNC_CID,
MSM_CCI_I2C_READ,
MSM_CCI_I2C_WRITE,
MSM_CCI_GPIO_WRITE,
};
struct msm_camera_cci_wait_sync_cfg {
uint16_t line;
uint16_t delay;
};
struct msm_camera_cci_gpio_cfg {
uint16_t gpio_queue;
uint16_t i2c_queue;
};
enum msm_camera_i2c_cmd_type {
MSM_CAMERA_I2C_CMD_WRITE,
MSM_CAMERA_I2C_CMD_POLL,
};
struct msm_camera_i2c_reg_conf {
uint16_t reg_addr;
uint16_t reg_data;
enum msm_camera_i2c_data_type dt;
enum msm_camera_i2c_cmd_type cmd_type;
int16_t mask;
};
struct msm_camera_cci_i2c_write_cfg {
struct msm_camera_i2c_reg_conf *reg_conf_tbl;
enum msm_camera_i2c_reg_addr_type addr_type;
enum msm_camera_i2c_data_type data_type;
uint16_t size;
};
struct msm_camera_cci_i2c_read_cfg {
uint16_t addr;
enum msm_camera_i2c_reg_addr_type addr_type;
uint8_t *data;
uint16_t num_byte;
};
struct msm_camera_cci_i2c_queue_info {
uint32_t max_queue_size;
uint32_t report_id;
uint32_t irq_en;
uint32_t capture_rep_data;
};
struct msm_camera_cci_ctrl {
int32_t status;
struct msm_camera_cci_client *cci_info;
enum msm_cci_cmd_type cmd;
union {
struct msm_camera_cci_i2c_write_cfg cci_i2c_write_cfg;
struct msm_camera_cci_i2c_read_cfg cci_i2c_read_cfg;
struct msm_camera_cci_wait_sync_cfg cci_wait_sync_cfg;
struct msm_camera_cci_gpio_cfg gpio_cfg;
} cfg;
};
/* this structure is used in kernel */
struct msm_queue_cmd {
struct list_head list_config;
struct list_head list_control;
struct list_head list_frame;
struct list_head list_pict;
struct list_head list_vpe_frame;
struct list_head list_eventdata;
enum msm_queue type;
void *command;
atomic_t on_heap;
struct timespec ts;
uint32_t error_code;
uint32_t trans_code;
};
struct msm_device_queue {
struct list_head list;
spinlock_t lock;
wait_queue_head_t wait;
int max;
int len;
const char *name;
};
struct msm_mctl_stats_t {
struct hlist_head pmem_stats_list;
spinlock_t pmem_stats_spinlock;
};
struct msm_sync {
/* These two queues are accessed from a process context only
* They contain pmem descriptors for the preview frames and the stats
* coming from the camera sensor.
*/
struct hlist_head pmem_frames;
struct hlist_head pmem_stats;
/* The message queue is used by the control thread to send commands
* to the config thread, and also by the DSP to send messages to the
* config thread. Thus it is the only queue that is accessed from
* both interrupt and process context.
*/
struct msm_device_queue event_q;
/* This queue contains preview frames. It is accessed by the DSP (in
* in interrupt context, and by the frame thread.
*/
struct msm_device_queue frame_q;
int unblock_poll_frame;
int unblock_poll_pic_frame;
/* This queue contains snapshot frames. It is accessed by the DSP (in
* interrupt context, and by the control thread.
*/
struct msm_device_queue pict_q;
int get_pic_abort;
struct msm_device_queue vpe_q;
struct msm_camera_sensor_info *sdata;
struct msm_camvfe_fn vfefn;
struct msm_camvpe_fn vpefn;
struct msm_sensor_ctrl sctrl;
struct msm_strobe_flash_ctrl sfctrl;
struct pm_qos_request idle_pm_qos;
struct platform_device *pdev;
int16_t ignore_qcmd_type;
uint8_t ignore_qcmd;
uint8_t opencnt;
void *cropinfo;
int croplen;
int core_powered_on;
struct fd_roi_info fdroiinfo;
atomic_t vpe_enable;
uint32_t pp_mask;
uint8_t pp_frame_avail;
struct msm_queue_cmd *pp_prev;
struct msm_queue_cmd *pp_snap;
struct msm_queue_cmd *pp_thumb;
int video_fd;
const char *apps_id;
struct mutex lock;
struct list_head list;
uint8_t liveshot_enabled;
struct msm_cam_v4l2_device *pcam_sync;
uint8_t stereocam_enabled;
struct msm_queue_cmd *pp_stereocam;
struct msm_queue_cmd *pp_stereocam2;
struct msm_queue_cmd *pp_stereosnap;
enum msm_stereo_state stereo_state;
int stcam_quality_ind;
uint32_t stcam_conv_value;
spinlock_t pmem_frame_spinlock;
spinlock_t pmem_stats_spinlock;
spinlock_t abort_pict_lock;
int snap_count;
int thumb_count;
};
#define MSM_APPS_ID_V4L2 "msm_v4l2"
#define MSM_APPS_ID_PROP "msm_qct"
struct msm_cam_device {
struct msm_sync *sync; /* most-frequently accessed */
struct device *device;
struct cdev cdev;
/* opened is meaningful only for the config and frame nodes,
* which may be opened only once.
*/
atomic_t opened;
};
struct msm_control_device {
struct msm_cam_device *pmsm;
/* Used for MSM_CAM_IOCTL_CTRL_CMD_DONE responses */
uint8_t ctrl_data[max_control_command_size];
struct msm_ctrl_cmd ctrl;
struct msm_queue_cmd qcmd;
/* This queue used by the config thread to send responses back to the
* control thread. It is accessed only from a process context.
*/
struct msm_device_queue ctrl_q;
};
struct register_address_value_pair {
uint16_t register_address;
uint16_t register_value;
};
struct msm_pmem_region {
struct hlist_node list;
unsigned long paddr;
unsigned long len;
struct file *file;
struct msm_pmem_info info;
struct ion_handle *handle;
};
struct axidata {
uint32_t bufnum1;
uint32_t bufnum2;
uint32_t bufnum3;
struct msm_pmem_region *region;
};
void msm_camvfe_init(void);
int msm_camvfe_check(void *);
void msm_camvfe_fn_init(struct msm_camvfe_fn *, void *);
void msm_camvpe_fn_init(struct msm_camvpe_fn *, void *);
int msm_camera_drv_start(struct platform_device *dev,
int (*sensor_probe)(const struct msm_camera_sensor_info *,
struct msm_sensor_ctrl *));
enum msm_camio_clk_type {
CAMIO_VFE_MDC_CLK,
CAMIO_MDC_CLK,
CAMIO_VFE_CLK,
CAMIO_VFE_AXI_CLK,
CAMIO_VFE_CAMIF_CLK,
CAMIO_VFE_PBDG_CLK,
CAMIO_CAM_MCLK_CLK,
CAMIO_CAMIF_PAD_PBDG_CLK,
CAMIO_CSI0_VFE_CLK,
CAMIO_CSI1_VFE_CLK,
CAMIO_VFE_PCLK,
CAMIO_CSI_SRC_CLK,
CAMIO_CSI0_CLK,
CAMIO_CSI1_CLK,
CAMIO_CSI0_PCLK,
CAMIO_CSI1_PCLK,
CAMIO_CSI1_SRC_CLK,
CAMIO_CSI_PIX_CLK,
CAMIO_CSI_PIX1_CLK,
CAMIO_CSI_RDI_CLK,
CAMIO_CSI_RDI1_CLK,
CAMIO_CSI_RDI2_CLK,
CAMIO_CSIPHY0_TIMER_CLK,
CAMIO_CSIPHY1_TIMER_CLK,
CAMIO_JPEG_CLK,
CAMIO_JPEG_PCLK,
CAMIO_VPE_CLK,
CAMIO_VPE_PCLK,
CAMIO_CSI0_PHY_CLK,
CAMIO_CSI1_PHY_CLK,
CAMIO_CSIPHY_TIMER_SRC_CLK,
CAMIO_IMEM_CLK,
CAMIO_MAX_CLK
};
enum msm_camio_clk_src_type {
MSM_CAMIO_CLK_SRC_INTERNAL,
MSM_CAMIO_CLK_SRC_EXTERNAL,
MSM_CAMIO_CLK_SRC_MAX
};
enum msm_s_test_mode {
S_TEST_OFF,
S_TEST_1,
S_TEST_2,
S_TEST_3
};
enum msm_s_resolution {
S_QTR_SIZE,
S_FULL_SIZE,
S_INVALID_SIZE
};
enum msm_s_reg_update {
/* Sensor egisters that need to be updated during initialization */
S_REG_INIT,
/* Sensor egisters that needs periodic I2C writes */
S_UPDATE_PERIODIC,
/* All the sensor Registers will be updated */
S_UPDATE_ALL,
/* Not valid update */
S_UPDATE_INVALID
};
enum msm_s_setting {
S_RES_PREVIEW,
S_RES_CAPTURE
};
enum msm_bus_perf_setting {
S_INIT,
S_PREVIEW,
S_VIDEO,
S_CAPTURE,
S_ZSL,
S_STEREO_VIDEO,
S_STEREO_CAPTURE,
S_DEFAULT,
S_LIVESHOT,
S_DUAL,
S_ADV_VIDEO,
S_EXIT
};
int msm_camio_enable(struct platform_device *dev);
int msm_camio_vpe_clk_enable(uint32_t);
int msm_camio_vpe_clk_disable(void);
void msm_camio_mode_config(enum msm_camera_i2c_mux_mode mode);
int msm_camio_clk_enable(enum msm_camio_clk_type clk);
int msm_camio_clk_disable(enum msm_camio_clk_type clk);
int msm_camio_clk_config(uint32_t freq);
void msm_camio_clk_rate_set(int rate);
int msm_camio_vfe_clk_rate_set(int rate);
void msm_camio_clk_rate_set_2(struct clk *clk, int rate);
void msm_camio_clk_axi_rate_set(int rate);
void msm_disable_io_gpio_clk(struct platform_device *);
void msm_camio_camif_pad_reg_reset(void);
void msm_camio_camif_pad_reg_reset_2(void);
void msm_camio_vfe_blk_reset(void);
void msm_camio_vfe_blk_reset_2(void);
void msm_camio_vfe_blk_reset_3(void);
int32_t msm_camio_3d_enable(const struct msm_camera_sensor_info *sinfo);
void msm_camio_3d_disable(void);
void msm_camio_clk_sel(enum msm_camio_clk_src_type);
void msm_camio_disable(struct platform_device *);
int msm_camio_probe_on(struct platform_device *);
int msm_camio_probe_off(struct platform_device *);
int msm_camio_sensor_clk_off(struct platform_device *);
int msm_camio_sensor_clk_on(struct platform_device *);
int msm_camio_csi_config(struct msm_camera_csi_params *csi_params);
int msm_camio_csiphy_config(struct msm_camera_csiphy_params *csiphy_params);
int msm_camio_csid_config(struct msm_camera_csid_params *csid_params);
int add_axi_qos(void);
int update_axi_qos(uint32_t freq);
void release_axi_qos(void);
void msm_camera_io_w(u32 data, void __iomem *addr);
void msm_camera_io_w_mb(u32 data, void __iomem *addr);
u32 msm_camera_io_r(void __iomem *addr);
u32 msm_camera_io_r_mb(void __iomem *addr);
void msm_camera_io_dump(void __iomem *addr, int size);
void msm_camera_io_memcpy(void __iomem *dest_addr,
void __iomem *src_addr, u32 len);
void msm_camio_set_perf_lvl(enum msm_bus_perf_setting);
void msm_camio_bus_scale_cfg(
struct msm_bus_scale_pdata *, enum msm_bus_perf_setting);
void *msm_isp_sync_alloc(int size, gfp_t gfp);
void msm_isp_sync_free(void *ptr);
int msm_cam_clk_enable(struct device *dev, struct msm_cam_clk_info *clk_info,
struct clk **clk_ptr, int num_clk, int enable);
int msm_cam_core_reset(void);
int msm_camera_config_vreg(struct device *dev, struct camera_vreg_t *cam_vreg,
int num_vreg, enum msm_camera_vreg_name_t *vreg_seq,
int num_vreg_seq, struct regulator **reg_ptr, int config);
int msm_camera_enable_vreg(struct device *dev, struct camera_vreg_t *cam_vreg,
int num_vreg, enum msm_camera_vreg_name_t *vreg_seq,
int num_vreg_seq, struct regulator **reg_ptr, int enable);
int msm_camera_config_gpio_table
(struct msm_camera_sensor_info *sinfo, int gpio_en);
int msm_camera_request_gpio_table
(struct msm_camera_sensor_info *sinfo, int gpio_en);
void msm_camera_bus_scale_cfg(uint32_t bus_perf_client,
enum msm_bus_perf_setting perf_setting);
int msm_camera_init_gpio_table(struct gpio *gpio_tbl, uint8_t gpio_tbl_size,
int gpio_en);
int msm_camera_set_gpio_table(struct msm_gpio_set_tbl *gpio_tbl,
uint8_t gpio_tbl_size, int gpio_en);
#endif
@@ -0,0 +1,140 @@
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __CAMERA2_H__
#define __CAMERA2_H__
#include <media/msm_cam_sensor.h>
#include <mach/board.h>
enum msm_camera_device_type_t {
MSM_CAMERA_I2C_DEVICE,
MSM_CAMERA_PLATFORM_DEVICE,
MSM_CAMERA_SPI_DEVICE,
};
enum msm_bus_perf_setting {
S_INIT,
S_PREVIEW,
S_VIDEO,
S_CAPTURE,
S_ZSL,
S_STEREO_VIDEO,
S_STEREO_CAPTURE,
S_DEFAULT,
S_LIVESHOT,
S_DUAL,
S_EXIT
};
enum cci_i2c_master_t {
MASTER_0,
MASTER_1,
};
struct msm_camera_slave_info {
uint16_t sensor_slave_addr;
uint16_t sensor_id_reg_addr;
uint16_t sensor_id;
};
struct msm_cam_clk_info {
const char *clk_name;
long clk_rate;
uint32_t delay;
};
struct msm_cam_clk_setting {
struct msm_cam_clk_info *clk_info;
uint16_t num_clk_info;
uint8_t enable;
};
struct v4l2_subdev_info {
enum v4l2_mbus_pixelcode code;
enum v4l2_colorspace colorspace;
uint16_t fmt;
uint16_t order;
};
struct msm_camera_sensor_board_info {
const char *sensor_name;
struct msm_camera_slave_info *slave_info;
struct msm_camera_csi_lane_params *csi_lane_params;
struct camera_vreg_t *cam_vreg;
int num_vreg;
struct msm_camera_sensor_strobe_flash_data *strobe_flash_data;
struct msm_camera_gpio_conf *gpio_conf;
struct msm_actuator_info *actuator_info;
struct msm_camera_i2c_conf *i2c_conf;
struct msm_sensor_info_t *sensor_info;
struct msm_sensor_init_params *sensor_init_params;
const char *misc_regulator;
};
enum msm_camera_i2c_cmd_type {
MSM_CAMERA_I2C_CMD_WRITE,
MSM_CAMERA_I2C_CMD_POLL,
};
struct msm_camera_i2c_reg_conf {
uint16_t reg_addr;
uint16_t reg_data;
enum msm_camera_i2c_data_type dt;
enum msm_camera_i2c_cmd_type cmd_type;
int16_t mask;
};
struct msm_camera_i2c_conf_array {
struct msm_camera_i2c_reg_conf *conf;
uint16_t size;
uint16_t delay;
enum msm_camera_i2c_data_type data_type;
};
struct eeprom_map_t {
uint32_t valid_size;
uint32_t addr;
uint32_t addr_t;
uint32_t data;
uint32_t data_t;
uint32_t delay;
};
struct eeprom_memory_map_t {
struct eeprom_map_t page;
struct eeprom_map_t poll;
struct eeprom_map_t mem;
};
struct msm_camera_power_ctrl_t {
struct device *dev;
struct msm_sensor_power_setting *power_setting;
uint16_t power_setting_size;
struct msm_camera_gpio_conf *gpio_conf;
struct camera_vreg_t *cam_vreg;
int num_vreg;
struct msm_camera_i2c_conf *i2c_conf;
struct msm_cam_clk_info *clk_info;
uint16_t clk_info_size;
};
struct msm_eeprom_board_info {
const char *eeprom_name;
uint16_t i2c_slaveaddr;
uint32_t num_blocks;
struct eeprom_memory_map_t *eeprom_map;
struct msm_camera_power_ctrl_t power_info;
};
#endif
@@ -0,0 +1,178 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2007-2013, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __MACH_CLK_PROVIDER_H
#define __MACH_CLK_PROVIDER_H
#include <linux/types.h>
#include <linux/list.h>
#include <linux/clkdev.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/regulator/consumer.h>
#include <mach/clk.h>
/*
* Bit manipulation macros
*/
#define BM(msb, lsb) (((((uint32_t)-1) << (31-msb)) >> (31-msb+lsb)) << lsb)
#define BVAL(msb, lsb, val) (((val) << lsb) & BM(msb, lsb))
/*
* Halt/Status Checking Mode Macros
*/
#define HALT 0 /* Bit pol: 1 = halted */
#define NOCHECK 1 /* No bit to check, do nothing */
#define HALT_VOTED 2 /* Bit pol: 1 = halted; delay on disable */
#define ENABLE 3 /* Bit pol: 1 = running */
#define ENABLE_VOTED 4 /* Bit pol: 1 = running; delay on disable */
#define DELAY 5 /* No bit to check, just delay */
/**
* struct clk_vdd_class - Voltage scaling class
* @class_name: name of the class
* @regulator: array of regulators.
* @num_regulators: size of regulator array. Standard regulator APIs will be
used if this field > 0.
* @set_vdd: function to call when applying a new voltage setting.
* @vdd_uv: sorted 2D array of legal voltage settings. Indexed by level, then
regulator.
* @vdd_ua: sorted 2D array of legal cureent settings. Indexed by level, then
regulator. Optional parameter.
* @level_votes: array of votes for each level.
* @num_levels: specifies the size of level_votes array.
* @cur_level: the currently set voltage level
* @lock: lock to protect this struct
*/
struct clk_vdd_class {
const char *class_name;
struct regulator **regulator;
int num_regulators;
int (*set_vdd)(struct clk_vdd_class *v_class, int level);
int *vdd_uv;
int *vdd_ua;
int *level_votes;
int num_levels;
unsigned long cur_level;
struct mutex lock;
};
#define DEFINE_VDD_CLASS(_name, _set_vdd, _num_levels) \
struct clk_vdd_class _name = { \
.class_name = #_name, \
.set_vdd = _set_vdd, \
.level_votes = (int [_num_levels]) {}, \
.num_levels = _num_levels, \
.cur_level = _num_levels, \
.lock = __MUTEX_INITIALIZER(_name.lock) \
}
#define DEFINE_VDD_REGULATORS(_name, _num_levels, _num_regulators, _vdd_uv, \
_vdd_ua) \
struct clk_vdd_class _name = { \
.class_name = #_name, \
.vdd_uv = _vdd_uv, \
.vdd_ua = _vdd_ua, \
.regulator = (struct regulator * [_num_regulators]) {}, \
.num_regulators = _num_regulators, \
.level_votes = (int [_num_levels]) {}, \
.num_levels = _num_levels, \
.cur_level = _num_levels, \
.lock = __MUTEX_INITIALIZER(_name.lock) \
}
enum handoff {
HANDOFF_ENABLED_CLK,
HANDOFF_DISABLED_CLK,
};
struct clk_ops {
int (*prepare)(struct clk *clk);
int (*enable)(struct clk *clk);
void (*disable)(struct clk *clk);
void (*unprepare)(struct clk *clk);
void (*enable_hwcg)(struct clk *clk);
void (*disable_hwcg)(struct clk *clk);
int (*in_hwcg_mode)(struct clk *clk);
enum handoff (*handoff)(struct clk *clk);
int (*reset)(struct clk *clk, enum clk_reset_action action);
int (*set_rate)(struct clk *clk, unsigned long rate);
int (*set_max_rate)(struct clk *clk, unsigned long rate);
int (*set_flags)(struct clk *clk, unsigned flags);
unsigned long (*get_rate)(struct clk *clk);
int (*list_rate)(struct clk *clk, unsigned n);
int (*is_enabled)(struct clk *clk);
long (*round_rate)(struct clk *clk, unsigned long rate);
int (*set_parent)(struct clk *clk, struct clk *parent);
struct clk *(*get_parent)(struct clk *clk);
bool (*is_local)(struct clk *clk);
};
/**
* struct clk
* @prepare_count: prepare refcount
* @prepare_lock: protects clk_prepare()/clk_unprepare() path and @prepare_count
* @count: enable refcount
* @lock: protects clk_enable()/clk_disable() path and @count
* @depends: non-direct parent of clock to enable when this clock is enabled
* @vdd_class: voltage scaling requirement class
* @fmax: maximum frequency in Hz supported at each voltage level
* @parent: the current source of this clock
*/
struct clk {
uint32_t flags;
struct clk_ops *ops;
const char *dbg_name;
struct clk *depends;
struct clk_vdd_class *vdd_class;
unsigned long *fmax;
int num_fmax;
unsigned long rate;
struct clk *parent;
struct list_head children;
struct list_head siblings;
unsigned count;
spinlock_t lock;
unsigned prepare_count;
struct mutex prepare_lock;
};
#define CLK_INIT(name) \
.lock = __SPIN_LOCK_UNLOCKED((name).lock), \
.prepare_lock = __MUTEX_INITIALIZER((name).prepare_lock), \
.children = LIST_HEAD_INIT((name).children), \
.siblings = LIST_HEAD_INIT((name).siblings)
int vote_vdd_level(struct clk_vdd_class *vdd_class, int level);
int unvote_vdd_level(struct clk_vdd_class *vdd_class, int level);
int __clk_pre_reparent(struct clk *c, struct clk *new, unsigned long *flags);
void __clk_post_reparent(struct clk *c, struct clk *old, unsigned long *flags);
/* Register clocks with the MSM clock driver */
int msm_clock_register(struct clk_lookup *table, size_t size);
extern struct clk dummy_clk;
#define CLK_DUMMY(clk_name, clk_id, clk_dev, flags) { \
.con_id = clk_name, \
.dev_id = clk_dev, \
.clk = &dummy_clk, \
}
#define CLK_LOOKUP(con, c, dev) { .con_id = con, .clk = &c, .dev_id = dev }
#endif
@@ -0,0 +1,47 @@
/* Copyright (c) 2009, 2012-2013 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MACH_CLK_H
#define __MACH_CLK_H
#define CLKFLAG_INVERT 0x00000001
#define CLKFLAG_NOINVERT 0x00000002
#define CLKFLAG_NONEST 0x00000004
#define CLKFLAG_NORESET 0x00000008
#define CLKFLAG_RETAIN_PERIPH 0x00000010
#define CLKFLAG_NORETAIN_PERIPH 0x00000020
#define CLKFLAG_RETAIN_MEM 0x00000040
#define CLKFLAG_NORETAIN_MEM 0x00000080
#define CLKFLAG_SKIP_HANDOFF 0x00000100
#define CLKFLAG_MIN 0x00000400
#define CLKFLAG_MAX 0x00000800
#define CLKFLAG_INIT_DONE 0x00001000
#define CLKFLAG_INIT_ERR 0x00002000
#define CLKFLAG_NO_RATE_CACHE 0x00004000
struct clk_lookup;
struct clk;
enum clk_reset_action {
CLK_RESET_DEASSERT = 0,
CLK_RESET_ASSERT = 1
};
/* Rate is maximum clock rate in Hz */
int clk_set_max_rate(struct clk *clk, unsigned long rate);
/* Assert/Deassert reset to a hardware block associated with a clock */
int clk_reset(struct clk *clk, enum clk_reset_action action);
/* Set clock-specific configuration parameters */
int clk_set_flags(struct clk *clk, unsigned long flags);
#endif
@@ -0,0 +1,129 @@
/*
* Copyright (c) 2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MACH_CLOCK_GENERIC_H
#define __MACH_CLOCK_GENERIC_H
#include <mach/clk-provider.h>
/* ==================== Mux clock ==================== */
struct clk_src {
struct clk *src;
int sel;
};
struct mux_clk;
struct clk_mux_ops {
int (*set_mux_sel)(struct mux_clk *clk, int sel);
int (*get_mux_sel)(struct mux_clk *clk);
/* Optional */
bool (*is_enabled)(struct mux_clk *clk);
int (*enable)(struct mux_clk *clk);
void (*disable)(struct mux_clk *clk);
};
#define MUX_SRC_LIST(...) \
.parents = (struct clk_src[]){__VA_ARGS__}, \
.num_parents = ARRAY_SIZE(((struct clk_src[]){__VA_ARGS__}))
struct mux_clk {
/* Parents in decreasing order of preference for obtaining rates. */
struct clk_src *parents;
int num_parents;
struct clk *safe_parent;
int safe_sel;
struct clk_mux_ops *ops;
/* Fields not used by helper function. */
void *const __iomem *base;
u32 offset;
u32 mask;
u32 shift;
u32 en_mask;
void *priv;
struct clk c;
};
static inline struct mux_clk *to_mux_clk(struct clk *c)
{
return container_of(c, struct mux_clk, c);
}
extern struct clk_ops clk_ops_gen_mux;
/* ==================== Divider clock ==================== */
struct div_clk;
struct clk_div_ops {
int (*set_div)(struct div_clk *clk, int div);
int (*get_div)(struct div_clk *clk);
/* Optional */
bool (*is_enabled)(struct div_clk *clk);
int (*enable)(struct div_clk *clk);
void (*disable)(struct div_clk *clk);
};
struct div_clk {
unsigned int div;
unsigned int min_div;
unsigned int max_div;
unsigned long rate_margin;
struct clk_div_ops *ops;
/* Fields not used by helper function. */
void *const __iomem *base;
u32 offset;
u32 mask;
u32 shift;
u32 en_mask;
void *priv;
struct clk c;
};
static inline struct div_clk *to_div_clk(struct clk *c)
{
return container_of(c, struct div_clk, c);
}
extern struct clk_ops clk_ops_div;
extern struct clk_ops clk_ops_slave_div;
#define DEFINE_FIXED_DIV_CLK(clk_name, _div, _parent) \
static struct div_clk clk_name = { \
.div = _div, \
.c = { \
.parent = _parent, \
.dbg_name = #clk_name, \
.ops = &clk_ops_div, \
CLK_INIT(clk_name.c), \
} \
}
#define DEFINE_FIXED_SLAVE_DIV_CLK(clk_name, _div, _parent) \
static struct div_clk clk_name = { \
.div = _div, \
.c = { \
.parent = _parent, \
.dbg_name = #clk_name, \
.ops = &clk_ops_slave_div, \
CLK_INIT(clk_name.c), \
} \
}
#endif
@@ -0,0 +1,42 @@
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ARCH_ARM_MACH_MSM_MACH_CPUFREQ_H
#define __ARCH_ARM_MACH_MSM_MACH_CPUFREQ_H
#define MSM_CPUFREQ_NO_LIMIT 0xFFFFFFFF
#ifdef CONFIG_CPU_FREQ_MSM
/**
* msm_cpufreq_set_freq_limit() - Set max/min freq limits on cpu
*
* @cpu: The cpu core for which the limits apply
* @max: The max frequency allowed
* @min: The min frequency allowed
*
* If the @max or @min is set to MSM_CPUFREQ_NO_LIMIT, the limit
* will default to the CPUFreq limit.
*
* returns 0 on success, errno on failure
*/
extern int msm_cpufreq_set_freq_limits(
uint32_t cpu, uint32_t min, uint32_t max);
#else
static inline int msm_cpufreq_set_freq_limits(
uint32_t cpu, uint32_t min, uint32_t max)
{
return -ENOSYS;
}
#endif
#endif /* __ARCH_ARM_MACH_MSM_MACH_CPUFREQ_H */
@@ -0,0 +1,40 @@
/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ARCH_ARM_MACH_MSM_CPUIDLE_H
#define __ARCH_ARM_MACH_MSM_CPUIDLE_H
#include <linux/notifier.h>
#include "../../pm.h"
struct msm_cpuidle_state {
unsigned int cpu;
int state_nr;
char *name;
char *desc;
enum msm_pm_sleep_mode mode_nr;
};
#ifdef CONFIG_PM
s32 msm_cpuidle_get_deep_idle_latency(void);
#else
static inline s32 msm_cpuidle_get_deep_idle_latency(void) { return 0; }
#endif
#ifdef CONFIG_CPU_IDLE
int msm_cpuidle_init(void);
#else
static inline int msm_cpuidle_init(void) { return -ENOSYS; }
#endif
#endif /* __ARCH_ARM_MACH_MSM_CPUIDLE_H */
+150
View File
@@ -0,0 +1,150 @@
/* Copyright (c) 2008-2009, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __DAL_H__
#define __DAL_H__
#include <linux/kernel.h>
#include <mach/msm_smd.h>
#define DALRPC_DEST_MODEM SMD_APPS_MODEM
#define DALRPC_DEST_QDSP SMD_APPS_QDSP
#define DALRPC_TIMEOUT_INFINITE -1
enum {
DALDEVICE_ATTACH_IDX = 0,
DALDEVICE_DETACH_IDX,
DALDEVICE_INIT_IDX,
DALDEVICE_DEINIT_IDX,
DALDEVICE_OPEN_IDX,
DALDEVICE_CLOSE_IDX,
DALDEVICE_INFO_IDX,
DALDEVICE_POWEREVENT_IDX,
DALDEVICE_SYSREQUEST_IDX,
DALDEVICE_FIRST_DEVICE_API_IDX
};
struct daldevice_info_t {
uint32_t size;
uint32_t version;
char name[32];
};
#define DAL_CHUNK_NAME_LENGTH 12
struct dal_chunk_header {
uint32_t size;
char name[DAL_CHUNK_NAME_LENGTH];
uint32_t lock;
uint32_t reserved;
uint32_t type;
uint32_t version;
};
int daldevice_attach(uint32_t device_id, char *port, int cpu,
void **handle_ptr);
/* The caller must ensure there are no outstanding dalrpc calls on
* the client before (and while) calling daldevice_detach. */
int daldevice_detach(void *handle);
uint32_t dalrpc_fcn_0(uint32_t ddi_idx, void *handle, uint32_t s1);
uint32_t dalrpc_fcn_1(uint32_t ddi_idx, void *handle, uint32_t s1,
uint32_t s2);
uint32_t dalrpc_fcn_2(uint32_t ddi_idx, void *handle, uint32_t s1,
uint32_t *p_s2);
uint32_t dalrpc_fcn_3(uint32_t ddi_idx, void *handle, uint32_t s1,
uint32_t s2, uint32_t s3);
uint32_t dalrpc_fcn_4(uint32_t ddi_idx, void *handle, uint32_t s1,
uint32_t s2, uint32_t *p_s3);
uint32_t dalrpc_fcn_5(uint32_t ddi_idx, void *handle, const void *ibuf,
uint32_t ilen);
uint32_t dalrpc_fcn_6(uint32_t ddi_idx, void *handle, uint32_t s1,
const void *ibuf, uint32_t ilen);
uint32_t dalrpc_fcn_7(uint32_t ddi_idx, void *handle, const void *ibuf,
uint32_t ilen, void *obuf, uint32_t olen,
uint32_t *oalen);
uint32_t dalrpc_fcn_8(uint32_t ddi_idx, void *handle, const void *ibuf,
uint32_t ilen, void *obuf, uint32_t olen);
uint32_t dalrpc_fcn_9(uint32_t ddi_idx, void *handle, void *obuf,
uint32_t olen);
uint32_t dalrpc_fcn_10(uint32_t ddi_idx, void *handle, uint32_t s1,
const void *ibuf, uint32_t ilen, void *obuf,
uint32_t olen, uint32_t *oalen);
uint32_t dalrpc_fcn_11(uint32_t ddi_idx, void *handle, uint32_t s1,
void *obuf, uint32_t olen);
uint32_t dalrpc_fcn_12(uint32_t ddi_idx, void *handle, uint32_t s1,
void *obuf, uint32_t olen, uint32_t *oalen);
uint32_t dalrpc_fcn_13(uint32_t ddi_idx, void *handle, const void *ibuf,
uint32_t ilen, const void *ibuf2, uint32_t ilen2,
void *obuf, uint32_t olen);
uint32_t dalrpc_fcn_14(uint32_t ddi_idx, void *handle, const void *ibuf,
uint32_t ilen, void *obuf1, uint32_t olen1,
void *obuf2, uint32_t olen2, uint32_t *oalen2);
uint32_t dalrpc_fcn_15(uint32_t ddi_idx, void *handle, const void *ibuf,
uint32_t ilen, const void *ibuf2, uint32_t ilen2,
void *obuf, uint32_t olen, uint32_t *oalen,
void *obuf2, uint32_t olen2);
static inline uint32_t daldevice_info(void *handle,
struct daldevice_info_t *info,
uint32_t info_size)
{
return dalrpc_fcn_9(DALDEVICE_INFO_IDX, handle, info, info_size);
}
static inline uint32_t daldevice_sysrequest(void *handle, uint32_t req_id,
const void *src_ptr,
uint32_t src_len, void *dest_ptr,
uint32_t dest_len,
uint32_t *dest_alen)
{
return dalrpc_fcn_10(DALDEVICE_SYSREQUEST_IDX, handle, req_id,
src_ptr, src_len, dest_ptr, dest_len, dest_alen);
}
static inline uint32_t daldevice_init(void *handle)
{
return dalrpc_fcn_0(DALDEVICE_INIT_IDX, handle, 0);
}
static inline uint32_t daldevice_deinit(void *handle)
{
return dalrpc_fcn_0(DALDEVICE_DEINIT_IDX, handle, 0);
}
static inline uint32_t daldevice_open(void *handle, uint32_t mode)
{
return dalrpc_fcn_0(DALDEVICE_OPEN_IDX, handle, mode);
}
static inline uint32_t daldevice_close(void *handle)
{
return dalrpc_fcn_0(DALDEVICE_CLOSE_IDX, handle, 0);
}
void *dalrpc_alloc_event(void *handle);
void *dalrpc_alloc_cb(void *handle,
void (*fn)(void *, uint32_t, void *, uint32_t),
void *context);
void dalrpc_dealloc_event(void *handle,
void *ev_h);
void dalrpc_dealloc_cb(void *handle,
void *cb_h);
#define dalrpc_event_wait(ev_h, timeout) \
dalrpc_event_wait_multiple(1, &ev_h, timeout)
int dalrpc_event_wait_multiple(int num, void **ev_h, int timeout);
#endif /* __DAL_H__ */
@@ -0,0 +1,23 @@
/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _DAL_AXI_H
#define _DAL_AXI_H
#include <mach/dal.h>
int set_grp2d_async(void);
int set_grp3d_async(void);
int set_grp_xbar_async(void);
int axi_allocate(int mode);
int axi_free(int mode);
#define AXI_FLOW_VIEWFINDER_HI 243
#endif /* _DAL_AXI_H */
@@ -0,0 +1,80 @@
/*
*
* Copyright (C) 2007 Google, Inc.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <mach/hardware.h>
#include <mach/msm_iomap.h>
#include <mach/msm_serial_hsl_regs.h>
#ifdef MSM_DEBUG_UART_PHYS
.macro addruart, rp, rv, tmp
ldr \rp, =MSM_DEBUG_UART_PHYS
ldr \rv, =MSM_DEBUG_UART_BASE
.endm
.macro senduart,rd,rx
#ifdef CONFIG_MSM_HAS_DEBUG_UART_HS
@ Clear TX_READY by writing to the UARTDM_CR register
mov r12, #0x300
str r12, [\rx, #UARTDM_CR_OFFSET]
@ Write 0x1 to NCF register
mov r12, #0x1
str r12, [\rx, #UARTDM_NCF_TX_OFFSET]
@ UARTDM reg. Read to induce delay
ldr r12, [\rx, #UARTDM_SR_OFFSET]
@ Write the 1 character to UARTDM_TF
str \rd, [\rx, #UARTDM_TF_OFFSET]
#else
teq \rx, #0
strne \rd, [\rx, #0x0C]
#endif
.endm
.macro waituart,rd,rx
#ifdef CONFIG_MSM_HAS_DEBUG_UART_HS
@ check for TX_EMT in UARTDM_SR
ldr \rd, [\rx, #UARTDM_SR_OFFSET]
tst \rd, #0x08
bne 1002f
@ wait for TXREADY in UARTDM_ISR
1001: ldreq \rd, [\rx, #UARTDM_ISR_OFFSET]
tst \rd, #0x80
dsb
beq 1001b
#else
@ wait for TX_READY
1001: ldr \rd, [\rx, #0x08]
tst \rd, #0x04
beq 1001b
#endif
1002:
.endm
#else
.macro addruart, rp, rv
.endm
.macro senduart,rd,rx
.endm
.macro waituart,rd,rx
.endm
#endif
.macro busyuart,rd,rx
.endm
@@ -0,0 +1,33 @@
/* Copyright (c) 2009, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ARCH_ARM_MACH_MSM_DEBUG_MM_H_
#define __ARCH_ARM_MACH_MSM_DEBUG_MM_H_
#include <linux/string.h>
/* The below macro removes the directory path name and retains only the
* file name to avoid long path names in log messages that comes as
* part of __FILE__ to compiler.
*/
#define __MM_FILE__ strrchr(__FILE__, '/') ? (strrchr(__FILE__, '/')+1) : \
__FILE__
#define MM_DBG(fmt, args...) pr_debug("[%s] " fmt,\
__func__, ##args)
#define MM_INFO(fmt, args...) pr_info("[%s:%s] " fmt,\
__MM_FILE__, __func__, ##args)
#define MM_ERR(fmt, args...) pr_err("[%s:%s] " fmt,\
__MM_FILE__, __func__, ##args)
#endif /* __ARCH_ARM_MACH_MSM_DEBUG_MM_H_ */
@@ -0,0 +1,54 @@
/* Copyright (c) 2011, 2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __LINUX_USB_DIAG_BRIDGE_H__
#define __LINUX_USB_DIAG_BRIDGE_H__
struct diag_bridge_ops {
void *ctxt;
void (*read_complete_cb)(void *ctxt, char *buf,
int buf_size, int actual);
void (*write_complete_cb)(void *ctxt, char *buf,
int buf_size, int actual);
int (*suspend)(void *ctxt);
void (*resume)(void *ctxt);
};
#if IS_ENABLED(CONFIG_USB_QCOM_DIAG_BRIDGE)
extern int diag_bridge_read(int id, char *data, int size);
extern int diag_bridge_write(int id, char *data, int size);
extern int diag_bridge_open(int id, struct diag_bridge_ops *ops);
extern void diag_bridge_close(int id);
#else
static int __maybe_unused diag_bridge_read(int id, char *data, int size)
{
return -ENODEV;
}
static int __maybe_unused diag_bridge_write(int id, char *data, int size)
{
return -ENODEV;
}
static int __maybe_unused diag_bridge_open(int id, struct diag_bridge_ops *ops)
{
return -ENODEV;
}
static void __maybe_unused diag_bridge_close(int id) { }
#endif
#endif
@@ -0,0 +1,32 @@
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __LINUX_DIAG_DLOAD_H__
#define __LINUX_DIAG_DLOAD_H__
#define PID_MAGIC_ID 0x71432909
#define SERIAL_NUM_MAGIC_ID 0x61945374
#define SERIAL_NUMBER_LENGTH 128
struct magic_num_struct {
uint32_t pid;
uint32_t serial_num;
};
struct dload_struct {
uint32_t pid;
char serial_number[SERIAL_NUMBER_LENGTH];
struct magic_num_struct magic_struct;
};
#endif
@@ -0,0 +1,56 @@
/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_DMA_FSM9XXX_H
#define __ASM_ARCH_MSM_DMA_FSM9XXX_H
/* DMA channels allocated to Scorpion */
#define DMOV_GP_CHAN 4
#define DMOV_CE1_IN_CHAN 5
#define DMOV_CE1_OUT_CHAN 6
#define DMOV_NAND_CHAN 7
#define DMOV_SDC1_CHAN 8
#define DMOV_GP2_CHAN 10
#define DMOV_CE2_IN_CHAN 12
#define DMOV_CE2_OUT_CHAN 13
#define DMOV_CE3_IN_CHAN 14
#define DMOV_CE3_OUT_CHAN 15
/* CRCIs */
#define DMOV_CE1_IN_CRCI 1
#define DMOV_CE1_OUT_CRCI 2
#define DMOV_CE1_HASH_CRCI 3
#define DMOV_NAND_CRCI_DATA 4
#define DMOV_NAND_CRCI_CMD 5
#define DMOV_SDC1_CRCI 6
#define DMOV_HSUART_TX_CRCI 7
#define DMOV_HSUART_RX_CRCI 8
#define DMOV_CE2_IN_CRCI 9
#define DMOV_CE2_OUT_CRCI 10
#define DMOV_CE2_HASH_CRCI 11
#define DMOV_CE3_IN_CRCI 12
#define DMOV_CE3_OUT_CRCI 13
#define DMOV_CE3_HASH_DONE_CRCI 14
/* Following CRCIs are not defined in FSM9XXX, but these are added to keep
* the existing SDCC host controller driver compatible with FSM9XXX.
*/
#define DMOV_SDC2_CRCI DMOV_SDC1_CRCI
#define DMOV_SDC3_CRCI DMOV_SDC1_CRCI
#define DMOV_SDC4_CRCI DMOV_SDC1_CRCI
#endif /* __ASM_ARCH_MSM_DMA_FSM9XXX_H */
+348
View File
@@ -0,0 +1,348 @@
/* linux/include/asm-arm/arch-msm/dma.h
*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2008-2012, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MSM_DMA_H
#define __ASM_ARCH_MSM_DMA_H
#include <linux/list.h>
#include <mach/msm_iomap.h>
#if defined(CONFIG_ARCH_FSM9XXX)
#include <mach/dma-fsm9xxx.h>
#endif
struct msm_dmov_errdata {
uint32_t flush[6];
};
struct msm_dmov_cmd {
struct list_head list;
unsigned int cmdptr;
void (*complete_func)(struct msm_dmov_cmd *cmd,
unsigned int result,
struct msm_dmov_errdata *err);
void (*exec_func)(struct msm_dmov_cmd *cmd);
struct work_struct work;
unsigned id; /* For internal use */
void *user; /* Pointer for caller's reference */
u8 toflush;
};
struct msm_dmov_pdata {
int sd;
size_t sd_size;
};
void msm_dmov_enqueue_cmd(unsigned id, struct msm_dmov_cmd *cmd);
void msm_dmov_enqueue_cmd_ext(unsigned id, struct msm_dmov_cmd *cmd);
void msm_dmov_flush(unsigned int id, int graceful);
int msm_dmov_exec_cmd(unsigned id, unsigned int cmdptr);
#define DMOV_CRCIS_PER_CONF 10
#define DMOV_ADDR(off, ch) ((off) + ((ch) << 2))
#define DMOV_CMD_PTR(ch) DMOV_ADDR(0x000, ch)
#define DMOV_CMD_LIST (0 << 29) /* does not work */
#define DMOV_CMD_PTR_LIST (1 << 29) /* works */
#define DMOV_CMD_INPUT_CFG (2 << 29) /* untested */
#define DMOV_CMD_OUTPUT_CFG (3 << 29) /* untested */
#define DMOV_CMD_ADDR(addr) ((addr) >> 3)
#define DMOV_RSLT(ch) DMOV_ADDR(0x040, ch)
#define DMOV_RSLT_VALID (1 << 31) /* 0 == host has empties result fifo */
#define DMOV_RSLT_ERROR (1 << 3)
#define DMOV_RSLT_FLUSH (1 << 2)
#define DMOV_RSLT_DONE (1 << 1) /* top pointer done */
#define DMOV_RSLT_USER (1 << 0) /* command with FR force result */
#define DMOV_FLUSH0(ch) DMOV_ADDR(0x080, ch)
#define DMOV_FLUSH1(ch) DMOV_ADDR(0x0C0, ch)
#define DMOV_FLUSH2(ch) DMOV_ADDR(0x100, ch)
#define DMOV_FLUSH3(ch) DMOV_ADDR(0x140, ch)
#define DMOV_FLUSH4(ch) DMOV_ADDR(0x180, ch)
#define DMOV_FLUSH5(ch) DMOV_ADDR(0x1C0, ch)
#define DMOV_FLUSH_TYPE (1 << 31)
#define DMOV_STATUS(ch) DMOV_ADDR(0x200, ch)
#define DMOV_STATUS_RSLT_COUNT(n) (((n) >> 29))
#define DMOV_STATUS_CMD_COUNT(n) (((n) >> 27) & 3)
#define DMOV_STATUS_RSLT_VALID (1 << 1)
#define DMOV_STATUS_CMD_PTR_RDY (1 << 0)
#define DMOV_CONF(ch) DMOV_ADDR(0x240, ch)
#define DMOV_CONF_SD(sd) (((sd & 4) << 11) | ((sd & 3) << 4))
#define DMOV_CONF_IRQ_EN (1 << 6)
#define DMOV_CONF_FORCE_RSLT_EN (1 << 7)
#define DMOV_CONF_SHADOW_EN (1 << 12)
#define DMOV_CONF_MPU_DISABLE (1 << 11)
#define DMOV_CONF_PRIORITY(n) (n << 0)
#define DMOV_DBG_ERR(ci) DMOV_ADDR(0x280, ci)
#define DMOV_RSLT_CONF(ch) DMOV_ADDR(0x300, ch)
#define DMOV_RSLT_CONF_FORCE_TOP_PTR_RSLT (1 << 2)
#define DMOV_RSLT_CONF_FORCE_FLUSH_RSLT (1 << 1)
#define DMOV_RSLT_CONF_IRQ_EN (1 << 0)
#define DMOV_ISR DMOV_ADDR(0x380, 0)
#define DMOV_CI_CONF(ci) DMOV_ADDR(0x390, ci)
#define DMOV_CI_CONF_RANGE_END(n) ((n) << 24)
#define DMOV_CI_CONF_RANGE_START(n) ((n) << 16)
#define DMOV_CI_CONF_MAX_BURST(n) ((n) << 0)
#define DMOV_CI_DBG_ERR(ci) DMOV_ADDR(0x3B0, ci)
#define DMOV_CRCI_CONF0 DMOV_ADDR(0x3D0, 0)
#define DMOV_CRCI_CONF1 DMOV_ADDR(0x3D4, 0)
#define DMOV_CRCI_CONF0_SD(crci, sd) (sd << (crci*3))
#define DMOV_CRCI_CONF1_SD(crci, sd) (sd << ((crci-DMOV_CRCIS_PER_CONF)*3))
#define DMOV_CRCI_CTL(crci) DMOV_ADDR(0x400, crci)
#define DMOV_CRCI_CTL_BLK_SZ(n) ((n) << 0)
#define DMOV_CRCI_CTL_RST (1 << 17)
#define DMOV_CRCI_MUX (1 << 18)
/* channel assignments */
/*
* Format of CRCI numbers: crci number + (muxsel << 4)
*/
#if defined(CONFIG_ARCH_MSM8X60)
#define DMOV_GP_CHAN 15
#define DMOV_NAND_CHAN 17
#define DMOV_NAND_CHAN_MODEM 26
#define DMOV_NAND_CHAN_Q6 27
#define DMOV_NAND_CRCI_CMD 15
#define DMOV_NAND_CRCI_DATA 3
#define DMOV_CE_IN_CHAN 2
#define DMOV_CE_IN_CRCI 4
#define DMOV_CE_OUT_CHAN 3
#define DMOV_CE_OUT_CRCI 5
#define DMOV_CE_HASH_CRCI 15
#define DMOV_SDC1_CHAN 18
#define DMOV_SDC1_CRCI 1
#define DMOV_SDC2_CHAN 19
#define DMOV_SDC2_CRCI 4
#define DMOV_SDC3_CHAN 20
#define DMOV_SDC3_CRCI 2
#define DMOV_SDC4_CHAN 21
#define DMOV_SDC4_CRCI 5
#define DMOV_SDC5_CHAN 21
#define DMOV_SDC5_CRCI 14
#define DMOV_TSIF_CHAN 4
#define DMOV_TSIF_CRCI 6
#define DMOV_HSUART1_TX_CHAN 22
#define DMOV_HSUART1_TX_CRCI 8
#define DMOV_HSUART1_RX_CHAN 23
#define DMOV_HSUART1_RX_CRCI 9
#define DMOV_HSUART2_TX_CHAN 8
#define DMOV_HSUART2_TX_CRCI 13
#define DMOV_HSUART2_RX_CHAN 8
#define DMOV_HSUART2_RX_CRCI 14
#elif defined(CONFIG_ARCH_MSM8960)
#define DMOV_GP_CHAN 9
#define DMOV_CE_IN_CHAN 0
#define DMOV_CE_IN_CRCI 2
#define DMOV_CE_OUT_CHAN 1
#define DMOV_CE_OUT_CRCI 3
#define DMOV_TSIF_CHAN 2
#define DMOV_TSIF_CRCI 11
#define DMOV_HSUART_GSBI6_TX_CHAN 7
#define DMOV_HSUART_GSBI6_TX_CRCI 6
#define DMOV_HSUART_GSBI6_RX_CHAN 8
#define DMOV_HSUART_GSBI6_RX_CRCI 11
#define DMOV_HSUART_GSBI8_TX_CHAN 7
#define DMOV_HSUART_GSBI8_TX_CRCI 10
#define DMOV_HSUART_GSBI8_RX_CHAN 8
#define DMOV_HSUART_GSBI8_RX_CRCI 9
#define DMOV_HSUART_GSBI9_TX_CHAN 4
#define DMOV_HSUART_GSBI9_TX_CRCI 13
#define DMOV_HSUART_GSBI9_RX_CHAN 3
#define DMOV_HSUART_GSBI9_RX_CRCI 12
#elif defined(CONFIG_ARCH_MSM9615)
#define DMOV_GP_CHAN 4
#define DMOV_CE_IN_CHAN 0
#define DMOV_CE_IN_CRCI 12
#define DMOV_CE_OUT_CHAN 1
#define DMOV_CE_OUT_CRCI 13
#define DMOV_NAND_CHAN 3
#define DMOV_NAND_CRCI_CMD 15
#define DMOV_NAND_CRCI_DATA 3
#elif defined(CONFIG_ARCH_FSM9XXX)
/* defined in dma-fsm9xxx.h */
#else
#define DMOV_GP_CHAN 4
#define DMOV_CE_IN_CHAN 5
#define DMOV_CE_IN_CRCI 1
#define DMOV_CE_OUT_CHAN 6
#define DMOV_CE_OUT_CRCI 2
#define DMOV_CE_HASH_CRCI 3
#define DMOV_NAND_CHAN 7
#define DMOV_NAND_CRCI_CMD 5
#define DMOV_NAND_CRCI_DATA 4
#define DMOV_SDC1_CHAN 8
#define DMOV_SDC1_CRCI 6
#define DMOV_SDC2_CHAN 8
#define DMOV_SDC2_CRCI 7
#define DMOV_SDC3_CHAN 8
#define DMOV_SDC3_CRCI 12
#define DMOV_SDC4_CHAN 8
#define DMOV_SDC4_CRCI 13
#define DMOV_TSIF_CHAN 10
#define DMOV_TSIF_CRCI 10
#define DMOV_USB_CHAN 11
#define DMOV_HSUART1_TX_CHAN 4
#define DMOV_HSUART1_TX_CRCI 8
#define DMOV_HSUART1_RX_CHAN 9
#define DMOV_HSUART1_RX_CRCI 9
#define DMOV_HSUART2_TX_CHAN 4
#define DMOV_HSUART2_TX_CRCI 14
#define DMOV_HSUART2_RX_CHAN 11
#define DMOV_HSUART2_RX_CRCI 15
#endif
/* channels for APQ8064 */
#define DMOV8064_CE_IN_CHAN 0
#define DMOV8064_CE_IN_CRCI 14
#define DMOV8064_CE_OUT_CHAN 1
#define DMOV8064_CE_OUT_CRCI 15
#define DMOV8064_TSIF_CHAN 4
#define DMOV8064_TSIF_CRCI 1
/* channels for MPQ8064 */
#define DMOV_MPQ8064_HSUART_GSBI6_TX_CHAN 7
#define DMOV_MPQ8064_HSUART_GSBI6_TX_CRCI 6
#define DMOV_MPQ8064_HSUART_GSBI6_RX_CHAN 6
#define DMOV_MPQ8064_HSUART_GSBI6_RX_CRCI 11
/* no client rate control ifc (eg, ram) */
#define DMOV_NONE_CRCI 0
/* If the CMD_PTR register has CMD_PTR_LIST selected, the data mover
* is going to walk a list of 32bit pointers as described below. Each
* pointer points to a *array* of dmov_s, etc structs. The last pointer
* in the list is marked with CMD_PTR_LP. The last struct in each array
* is marked with CMD_LC (see below).
*/
#define CMD_PTR_ADDR(addr) ((addr) >> 3)
#define CMD_PTR_LP (1 << 31) /* last pointer */
#define CMD_PTR_PT (3 << 29) /* ? */
/* Single Item Mode */
typedef struct {
unsigned cmd;
unsigned src;
unsigned dst;
unsigned len;
} dmov_s;
/* Scatter/Gather Mode */
typedef struct {
unsigned cmd;
unsigned src_dscr;
unsigned dst_dscr;
unsigned _reserved;
} dmov_sg;
/* Box mode */
typedef struct {
uint32_t cmd;
uint32_t src_row_addr;
uint32_t dst_row_addr;
uint32_t src_dst_len;
uint32_t num_rows;
uint32_t row_offset;
} dmov_box;
/* bits for the cmd field of the above structures */
#define CMD_LC (1 << 31) /* last command */
#define CMD_FR (1 << 22) /* force result -- does not work? */
#define CMD_OCU (1 << 21) /* other channel unblock */
#define CMD_OCB (1 << 20) /* other channel block */
#define CMD_TCB (1 << 19) /* ? */
#define CMD_DAH (1 << 18) /* destination address hold -- does not work?*/
#define CMD_SAH (1 << 17) /* source address hold -- does not work? */
#define CMD_MODE_SINGLE (0 << 0) /* dmov_s structure used */
#define CMD_MODE_SG (1 << 0) /* untested */
#define CMD_MODE_IND_SG (2 << 0) /* untested */
#define CMD_MODE_BOX (3 << 0) /* untested */
#define CMD_DST_SWAP_BYTES (1 << 14) /* exchange each byte n with byte n+1 */
#define CMD_DST_SWAP_SHORTS (1 << 15) /* exchange each short n with short n+1 */
#define CMD_DST_SWAP_WORDS (1 << 16) /* exchange each word n with word n+1 */
#define CMD_SRC_SWAP_BYTES (1 << 11) /* exchange each byte n with byte n+1 */
#define CMD_SRC_SWAP_SHORTS (1 << 12) /* exchange each short n with short n+1 */
#define CMD_SRC_SWAP_WORDS (1 << 13) /* exchange each word n with word n+1 */
#define CMD_DST_CRCI(n) (((n) & 15) << 7)
#define CMD_SRC_CRCI(n) (((n) & 15) << 3)
#endif
@@ -0,0 +1,52 @@
/* Copyright (c) 2008-2009, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __MSM_DMA_TEST__
#define __MSM_DMA_TEST__
#include <linux/ioctl.h>
#define MSM_DMA_IOC_MAGIC 0x83
/* The testing driver can manage a series of buffers. These are
* allocated and freed using these calls. */
struct msm_dma_alloc_req {
int size; /* Size of this request, in bytes. */
int bufnum; /* OUT: Number of buffer allocated. */
};
#define MSM_DMA_IOALLOC _IOWR(MSM_DMA_IOC_MAGIC, 2, struct msm_dma_alloc_req)
/* Free the specified buffer. */
#define MSM_DMA_IOFREE _IOW(MSM_DMA_IOC_MAGIC, 3, int)
/* Free all used buffers. */
#define MSM_DMA_IOFREEALL _IO(MSM_DMA_IOC_MAGIC, 7)
/* Read/write data into kernel buffer. */
struct msm_dma_bufxfer {
void *data;
int size;
int bufnum;
};
#define MSM_DMA_IOWBUF _IOW(MSM_DMA_IOC_MAGIC, 4, struct msm_dma_bufxfer)
#define MSM_DMA_IORBUF _IOW(MSM_DMA_IOC_MAGIC, 5, struct msm_dma_bufxfer)
/* Use the data mover to copy from one buffer to another. */
struct msm_dma_scopy {
int srcbuf;
int destbuf;
int size;
};
#define MSM_DMA_IOSCOPY _IOW(MSM_DMA_IOC_MAGIC, 6, struct msm_dma_scopy)
#endif /* __MSM_DMA_TEST__ */
@@ -0,0 +1,88 @@
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _ECM_IPA_H_
#define _ECM_IPA_H_
#include <mach/ipa.h>
/*
* @priv: private data given upon ipa_connect
* @evt: event enum, should be IPA_WRITE_DONE
* @data: for tx path the data field is the sent socket buffer.
*/
typedef void (*ecm_ipa_callback)(void *priv,
enum ipa_dp_evt_type evt,
unsigned long data);
/*
* struct ecm_ipa_params - parameters for ecm_ipa initialization API
*
* @ecm_ipa_rx_dp_notify: ecm_ipa will set this callback (out parameter).
* this callback shall be supplied for ipa_connect upon pipe
* connection (USB->IPA), once IPA driver receive data packets
* from USB pipe destined for Apps this callback will be called.
* @ecm_ipa_tx_dp_notify: ecm_ipa will set this callback (out parameter).
* this callback shall be supplied for ipa_connect upon pipe
* connection (IPA->USB), once IPA driver send packets destined
* for USB, IPA BAM will notify for Tx-complete.
* @priv: ecm_ipa will set this pointer (out parameter).
* This pointer will hold the network device for later interaction
* with ecm_ipa APIs
* @host_ethaddr: host Ethernet address in network order
* @device_ethaddr: device Ethernet address in network order
*/
struct ecm_ipa_params {
ecm_ipa_callback ecm_ipa_rx_dp_notify;
ecm_ipa_callback ecm_ipa_tx_dp_notify;
u8 host_ethaddr[ETH_ALEN];
u8 device_ethaddr[ETH_ALEN];
void *private;
};
#ifdef CONFIG_ECM_IPA
int ecm_ipa_init(struct ecm_ipa_params *params);
int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl,
void *priv);
int ecm_ipa_disconnect(void *priv);
void ecm_ipa_cleanup(void *priv);
#else /* CONFIG_ECM_IPA*/
int ecm_ipa_init(struct ecm_ipa_params *params)
{
return 0;
}
static inline int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl,
void *priv)
{
return 0;
}
static inline int ecm_ipa_disconnect(void *priv)
{
return 0;
}
static inline void ecm_ipa_cleanup(void *priv)
{
}
#endif /* CONFIG_ECM_IPA*/
#endif /* _ECM_IPA_H_ */
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2009-2010, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#if !defined(CONFIG_ARM_GIC)
#include <mach/msm_iomap.h>
.macro get_irqnr_preamble, base, tmp
@ enable imprecise aborts
cpsie a
mov \base, #MSM_VIC_BASE
.endm
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp
@ 0xD0 has irq# or old irq# if the irq has been handled
@ 0xD4 has irq# or -1 if none pending *but* if you just
@ read 0xD4 you never get the first irq for some reason
ldr \irqnr, [\base, #0xD0]
ldr \irqnr, [\base, #0xD4]
cmp \irqnr, #0xffffffff
.endm
#endif
@@ -0,0 +1,77 @@
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ARCH_ARM_MACH_MSM_EVENT_TIMER_H
#define __ARCH_ARM_MACH_MSM_EVENT_TIMER_H
#include <linux/hrtimer.h>
struct event_timer_info;
#ifdef CONFIG_MSM_EVENT_TIMER
/**
* add_event_timer() : Add a wakeup event. Intended to be called
* by clients once. Returns a handle to be used
* for future transactions.
* @function : The callback function will be called when event
* timer expires.
* @data : Callback data provided by client.
*/
struct event_timer_info *add_event_timer(void (*function)(void *), void *data);
/** activate_event_timer() : Set the expiration time for an event in absolute
* ktime. This is a oneshot event timer, clients
* should call this again to set another expiration.
* @event : Event handle.
* @event_time : Event time in absolute ktime.
*/
void activate_event_timer(struct event_timer_info *event, ktime_t event_time);
/**
* deactivate_event_timer() : Deactivate an event timer.
* @event: event handle.
*/
void deactivate_event_timer(struct event_timer_info *event);
/**
* destroy_event_timer() : Free the event info data structure allocated during
* add_event_timer().
* @event: event handle.
*/
void destroy_event_timer(struct event_timer_info *event);
/**
* get_next_event_timer() : Get the next wakeup event.
* returns a ktime value of the next
* expiring event.
*/
ktime_t get_next_event_time(void);
#else
static inline void *add_event_timer(void (*function)(void *), void *data)
{
return NULL;
}
static inline void activate_event_timer(void *event, ktime_t event_time) {}
static inline void deactivate_event_timer(void *event) {}
static inline void destroy_event_timer(void *event) {}
static inline ktime_t get_next_event_time(void)
{
return ns_to_ktime(0);
}
#endif /* CONFIG_MSM_EVENT_TIMER_MANAGER */
#endif /* __ARCH_ARM_MACH_MSM_EVENT_TIMER_H */
@@ -0,0 +1,33 @@
/* linux/include/asm-arm/arch-msm/irqs.h
*
* Copyright (C) 2008 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MSM_FIQ_H
#define __ASM_ARCH_MSM_FIQ_H
/* cause an interrupt to be an FIQ instead of a regular IRQ */
void msm_fiq_select(int number);
void msm_fiq_unselect(int number);
/* enable/disable an interrupt that is an FIQ (not safe from FIQ context) */
void msm_fiq_enable(int number);
void msm_fiq_disable(int number);
/* install an FIQ handler */
int msm_fiq_set_handler(void (*func)(void *data, void *regs), void *data);
/* cause an edge triggered interrupt to fire (safe from FIQ context */
void msm_trigger_irq(int number);
#endif
@@ -0,0 +1,72 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2009-2010, The Linux Foundation. All rights reserved.
* Author: Mike Lockwood <lockwood@android.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MSM_GPIO_TLMM_V1_H
#define __ASM_ARCH_MSM_GPIO_TLMM_V1_H
/* GPIO TLMM (Top Level Multiplexing) Definitions */
/* GPIO TLMM: Function -- GPIO specific */
/* GPIO TLMM: Direction */
enum {
GPIO_CFG_INPUT,
GPIO_CFG_OUTPUT,
};
/* GPIO TLMM: Pullup/Pulldown */
enum {
GPIO_CFG_NO_PULL,
GPIO_CFG_PULL_DOWN,
GPIO_CFG_KEEPER,
GPIO_CFG_PULL_UP,
};
/* GPIO TLMM: Drive Strength */
enum {
GPIO_CFG_2MA,
GPIO_CFG_4MA,
GPIO_CFG_6MA,
GPIO_CFG_8MA,
GPIO_CFG_10MA,
GPIO_CFG_12MA,
GPIO_CFG_14MA,
GPIO_CFG_16MA,
};
enum {
GPIO_CFG_ENABLE,
GPIO_CFG_DISABLE,
};
#define GPIO_CFG(gpio, func, dir, pull, drvstr) \
((((gpio) & 0x3FF) << 4) | \
((func) & 0xf) | \
(((dir) & 0x1) << 14) | \
(((pull) & 0x3) << 15) | \
(((drvstr) & 0xF) << 17))
/**
* extract GPIO pin from bit-field used for gpio_tlmm_config
*/
#define GPIO_PIN(gpio_cfg) (((gpio_cfg) >> 4) & 0x3ff)
#define GPIO_FUNC(gpio_cfg) (((gpio_cfg) >> 0) & 0xf)
#define GPIO_DIR(gpio_cfg) (((gpio_cfg) >> 14) & 0x1)
#define GPIO_PULL(gpio_cfg) (((gpio_cfg) >> 15) & 0x3)
#define GPIO_DRVSTR(gpio_cfg) (((gpio_cfg) >> 17) & 0xf)
int gpio_tlmm_config(unsigned config, unsigned disable);
#endif
@@ -0,0 +1,171 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2009-2010, The Linux Foundation. All rights reserved.
* Author: Mike Lockwood <lockwood@android.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MSM_GPIO_V1_H
#define __ASM_ARCH_MSM_GPIO_V1_H
#include <linux/interrupt.h>
#include <asm-generic/gpio.h>
#include <mach/irqs.h>
#define FIRST_BOARD_GPIO NR_GPIO_IRQS
static inline int gpio_get_value(unsigned gpio)
{
return __gpio_get_value(gpio);
}
static inline void gpio_set_value(unsigned gpio, int value)
{
__gpio_set_value(gpio, value);
}
static inline int gpio_cansleep(unsigned gpio)
{
return __gpio_cansleep(gpio);
}
static inline int gpio_to_irq(unsigned gpio)
{
return __gpio_to_irq(gpio);
}
void msm_gpio_enter_sleep(int from_idle);
void msm_gpio_exit_sleep(void);
/**
* struct msm_gpio - GPIO pin description
* @gpio_cfg - configuration bitmap, as per gpio_tlmm_config()
* @label - textual label
*
* Usually, GPIO's are operated by sets.
* This struct accumulate all GPIO information in single source
* and facilitete group operations provided by msm_gpios_xxx()
*/
struct msm_gpio {
u32 gpio_cfg;
const char *label;
};
/**
* msm_gpios_request_enable() - request and enable set of GPIOs
*
* Request and configure set of GPIO's
* In case of error, all operations rolled back.
* Return error code.
*
* @table: GPIO table
* @size: number of entries in @table
*/
int msm_gpios_request_enable(const struct msm_gpio *table, int size);
/**
* msm_gpios_disable_free() - disable and free set of GPIOs
*
* @table: GPIO table
* @size: number of entries in @table
*/
void msm_gpios_disable_free(const struct msm_gpio *table, int size);
/**
* msm_gpios_request() - request set of GPIOs
* In case of error, all operations rolled back.
* Return error code.
*
* @table: GPIO table
* @size: number of entries in @table
*/
int msm_gpios_request(const struct msm_gpio *table, int size);
/**
* msm_gpios_free() - free set of GPIOs
*
* @table: GPIO table
* @size: number of entries in @table
*/
void msm_gpios_free(const struct msm_gpio *table, int size);
/**
* msm_gpios_enable() - enable set of GPIOs
* In case of error, all operations rolled back.
* Return error code.
*
* @table: GPIO table
* @size: number of entries in @table
*/
int msm_gpios_enable(const struct msm_gpio *table, int size);
/**
* msm_gpios_disable() - disable set of GPIOs
*
* @table: GPIO table
* @size: number of entries in @table
*/
int msm_gpios_disable(const struct msm_gpio *table, int size);
/* GPIO TLMM (Top Level Multiplexing) Definitions */
/* GPIO TLMM: Function -- GPIO specific */
/* GPIO TLMM: Direction */
enum {
GPIO_CFG_INPUT,
GPIO_CFG_OUTPUT,
};
/* GPIO TLMM: Pullup/Pulldown */
enum {
GPIO_CFG_NO_PULL,
GPIO_CFG_PULL_DOWN,
GPIO_CFG_KEEPER,
GPIO_CFG_PULL_UP,
};
/* GPIO TLMM: Drive Strength */
enum {
GPIO_CFG_2MA,
GPIO_CFG_4MA,
GPIO_CFG_6MA,
GPIO_CFG_8MA,
GPIO_CFG_10MA,
GPIO_CFG_12MA,
GPIO_CFG_14MA,
GPIO_CFG_16MA,
};
enum {
GPIO_CFG_ENABLE,
GPIO_CFG_DISABLE,
};
#define GPIO_CFG(gpio, func, dir, pull, drvstr) \
((((gpio) & 0x3FF) << 4) | \
((func) & 0xf) | \
(((dir) & 0x1) << 14) | \
(((pull) & 0x3) << 15) | \
(((drvstr) & 0xF) << 17))
/**
* extract GPIO pin from bit-field used for gpio_tlmm_config
*/
#define GPIO_PIN(gpio_cfg) (((gpio_cfg) >> 4) & 0x3ff)
#define GPIO_FUNC(gpio_cfg) (((gpio_cfg) >> 0) & 0xf)
#define GPIO_DIR(gpio_cfg) (((gpio_cfg) >> 14) & 0x1)
#define GPIO_PULL(gpio_cfg) (((gpio_cfg) >> 15) & 0x3)
#define GPIO_DRVSTR(gpio_cfg) (((gpio_cfg) >> 17) & 0xf)
int gpio_tlmm_config(unsigned config, unsigned disable);
#endif /* __ASM_ARCH_MSM_GPIO_V1_H */
@@ -0,0 +1,236 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
* Author: Mike Lockwood <lockwood@android.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MSM_GPIO_H
#define __ASM_ARCH_MSM_GPIO_H
#define ARCH_NR_GPIOS 1024
#include <linux/interrupt.h>
#include <asm-generic/gpio.h>
#include <mach/irqs.h>
#define FIRST_BOARD_GPIO NR_GPIO_IRQS
extern struct irq_chip msm_gpio_irq_extn;
/**
* struct msm_gpio - GPIO pin description
* @gpio_cfg - configuration bitmap, as per gpio_tlmm_config()
* @label - textual label
*
* Usually, GPIO's are operated by sets.
* This struct accumulate all GPIO information in single source
* and facilitete group operations provided by msm_gpios_xxx()
*/
struct msm_gpio {
u32 gpio_cfg;
const char *label;
};
struct msm_gpio_pdata {
int ngpio;
int direct_connect_irqs;
};
/**
* msm_gpios_request_enable() - request and enable set of GPIOs
*
* Request and configure set of GPIO's
* In case of error, all operations rolled back.
* Return error code.
*
* @table: GPIO table
* @size: number of entries in @table
*/
int msm_gpios_request_enable(const struct msm_gpio *table, int size);
/**
* msm_gpios_disable_free() - disable and free set of GPIOs
*
* @table: GPIO table
* @size: number of entries in @table
*/
void msm_gpios_disable_free(const struct msm_gpio *table, int size);
/**
* msm_gpios_request() - request set of GPIOs
* In case of error, all operations rolled back.
* Return error code.
*
* @table: GPIO table
* @size: number of entries in @table
*/
int msm_gpios_request(const struct msm_gpio *table, int size);
/**
* msm_gpios_free() - free set of GPIOs
*
* @table: GPIO table
* @size: number of entries in @table
*/
void msm_gpios_free(const struct msm_gpio *table, int size);
/**
* msm_gpios_enable() - enable set of GPIOs
* In case of error, all operations rolled back.
* Return error code.
*
* @table: GPIO table
* @size: number of entries in @table
*/
int msm_gpios_enable(const struct msm_gpio *table, int size);
/**
* msm_gpios_disable() - disable set of GPIOs
*
* @table: GPIO table
* @size: number of entries in @table
*/
int msm_gpios_disable(const struct msm_gpio *table, int size);
/**
* msm_gpios_show_resume_irq() - show the interrupts that could have triggered
* resume
*/
void msm_gpio_show_resume_irq(void);
/* GPIO TLMM (Top Level Multiplexing) Definitions */
/* GPIO TLMM: Function -- GPIO specific */
/* GPIO TLMM: Direction */
enum {
GPIO_CFG_INPUT,
GPIO_CFG_OUTPUT,
};
/* GPIO TLMM: Pullup/Pulldown */
enum {
GPIO_CFG_NO_PULL,
GPIO_CFG_PULL_DOWN,
GPIO_CFG_KEEPER,
GPIO_CFG_PULL_UP,
};
/* GPIO TLMM: Drive Strength */
enum {
GPIO_CFG_2MA,
GPIO_CFG_4MA,
GPIO_CFG_6MA,
GPIO_CFG_8MA,
GPIO_CFG_10MA,
GPIO_CFG_12MA,
GPIO_CFG_14MA,
GPIO_CFG_16MA,
};
enum {
GPIO_CFG_ENABLE,
GPIO_CFG_DISABLE,
};
#define GPIO_CFG(gpio, func, dir, pull, drvstr) \
((((gpio) & 0x3FF) << 4) | \
((func) & 0xf) | \
(((dir) & 0x1) << 14) | \
(((pull) & 0x3) << 15) | \
(((drvstr) & 0xF) << 17))
/**
* extract GPIO pin from bit-field used for gpio_tlmm_config
*/
#define GPIO_PIN(gpio_cfg) (((gpio_cfg) >> 4) & 0x3ff)
#define GPIO_FUNC(gpio_cfg) (((gpio_cfg) >> 0) & 0xf)
#define GPIO_DIR(gpio_cfg) (((gpio_cfg) >> 14) & 0x1)
#define GPIO_PULL(gpio_cfg) (((gpio_cfg) >> 15) & 0x3)
#define GPIO_DRVSTR(gpio_cfg) (((gpio_cfg) >> 17) & 0xf)
int gpio_tlmm_config(unsigned config, unsigned disable);
enum msm_tlmm_hdrive_tgt {
TLMM_HDRV_SDC4_CLK = 0,
TLMM_HDRV_SDC4_CMD,
TLMM_HDRV_SDC4_DATA,
TLMM_HDRV_SDC3_CLK,
TLMM_HDRV_SDC3_CMD,
TLMM_HDRV_SDC3_DATA,
TLMM_HDRV_SDC2_CLK,
TLMM_HDRV_SDC2_CMD,
TLMM_HDRV_SDC2_DATA,
TLMM_HDRV_SDC1_CLK,
TLMM_HDRV_SDC1_CMD,
TLMM_HDRV_SDC1_DATA,
};
enum msm_tlmm_pull_tgt {
TLMM_PULL_SDC4_CLK = 0,
TLMM_PULL_SDC4_CMD,
TLMM_PULL_SDC4_DATA,
TLMM_PULL_SDC3_CLK,
TLMM_PULL_SDC3_CMD,
TLMM_PULL_SDC3_DATA,
TLMM_PULL_SDC2_CLK,
TLMM_PULL_SDC2_CMD,
TLMM_PULL_SDC2_DATA,
TLMM_PULL_SDC1_CLK,
TLMM_PULL_SDC1_CMD,
TLMM_PULL_SDC1_DATA,
};
#if defined(CONFIG_GPIO_MSM_V2) || defined(CONFIG_GPIO_MSM_V3)
void msm_tlmm_set_hdrive(enum msm_tlmm_hdrive_tgt tgt, int drv_str);
void msm_tlmm_set_pull(enum msm_tlmm_pull_tgt tgt, int pull);
/*
* A GPIO can be set as a direct-connect IRQ. This can be used to bypass
* the normal summary-interrupt mechanism for those GPIO lines deemed to be
* higher priority or otherwise worthy of special treatment, but resources
* are limited: only a few DC interrupt lines are available.
* Care must be taken when usurping a GPIO in this manner, as the summary
* interrupt controller has no idea that the GPIO has been taken away from it.
* Clients can still register to receive the summary interrupt assigned
* to that GPIO, which will uninstall it as a direct connect IRQ with
* no warning.
*
* The irq passed to this function is the DC IRQ number, not the
* irq number seen by the scorpion when the interrupt triggers. For example,
* if 0 is specified, then when DC IRQ 0 triggers, the scorpion will see
* interrupt TLMM_MSM_DIR_CONN_IRQ_0.
*
* input_polarity parameter specifies when the gpio should raise the direct
* interrupt. A value of 0 means that it is active low, anything else means
* active high
*
*/
int msm_gpio_install_direct_irq(unsigned gpio, unsigned irq,
unsigned int input_polarity);
#else
static inline void msm_tlmm_set_hdrive(enum msm_tlmm_hdrive_tgt tgt,
int drv_str) {}
static inline void msm_tlmm_set_pull(enum msm_tlmm_pull_tgt tgt, int pull) {}
static inline int msm_gpio_install_direct_irq(unsigned gpio, unsigned irq,
unsigned int input_polarity)
{
return -ENOSYS;
}
#endif
#ifdef CONFIG_OF
int __init msm_gpio_of_init(struct device_node *node,
struct device_node *parent);
#endif
#endif /* __ASM_ARCH_MSM_GPIO_H */
@@ -0,0 +1,196 @@
/* Copyright (c) 2010-2011,2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ARCH_ARM_MACH_MSM_GPIOMUX_H
#define __ARCH_ARM_MACH_MSM_GPIOMUX_H
#include <linux/bitops.h>
#include <linux/errno.h>
enum msm_gpiomux_setting {
GPIOMUX_ACTIVE = 0,
GPIOMUX_SUSPENDED,
GPIOMUX_NSETTINGS
};
enum gpiomux_drv {
GPIOMUX_DRV_2MA = 0,
GPIOMUX_DRV_4MA,
GPIOMUX_DRV_6MA,
GPIOMUX_DRV_8MA,
GPIOMUX_DRV_10MA,
GPIOMUX_DRV_12MA,
GPIOMUX_DRV_14MA,
GPIOMUX_DRV_16MA,
};
enum gpiomux_func {
GPIOMUX_FUNC_GPIO = 0,
GPIOMUX_FUNC_1,
GPIOMUX_FUNC_2,
GPIOMUX_FUNC_3,
GPIOMUX_FUNC_4,
GPIOMUX_FUNC_5,
GPIOMUX_FUNC_6,
GPIOMUX_FUNC_7,
GPIOMUX_FUNC_8,
GPIOMUX_FUNC_9,
GPIOMUX_FUNC_A,
GPIOMUX_FUNC_B,
GPIOMUX_FUNC_C,
GPIOMUX_FUNC_D,
GPIOMUX_FUNC_E,
GPIOMUX_FUNC_F,
};
enum gpiomux_pull {
GPIOMUX_PULL_NONE = 0,
GPIOMUX_PULL_DOWN,
GPIOMUX_PULL_KEEPER,
GPIOMUX_PULL_UP,
};
/* Direction settings are only meaningful when GPIOMUX_FUNC_GPIO is selected.
* This element is ignored for all other FUNC selections, as the output-
* enable pin is not under software control in those cases. See the SWI
* for your target for more details.
*/
enum gpiomux_dir {
GPIOMUX_IN = 0,
GPIOMUX_OUT_HIGH,
GPIOMUX_OUT_LOW,
};
struct gpiomux_setting {
enum gpiomux_func func;
enum gpiomux_drv drv;
enum gpiomux_pull pull;
enum gpiomux_dir dir;
};
/**
* struct msm_gpiomux_config: gpiomux settings for one gpio line.
*
* A complete gpiomux config is the combination of a drive-strength,
* function, pull, and (sometimes) direction. For functions other than GPIO,
* the input/output setting is hard-wired according to the function.
*
* @gpio: The index number of the gpio being described.
* @settings: The settings to be installed, specifically:
* GPIOMUX_ACTIVE: The setting to be installed when the
* line is active, or its reference count is > 0.
* GPIOMUX_SUSPENDED: The setting to be installed when
* the line is suspended, or its reference count is 0.
*/
struct msm_gpiomux_config {
unsigned gpio;
struct gpiomux_setting *settings[GPIOMUX_NSETTINGS];
};
/**
* struct msm_gpiomux_configs: a collection of gpiomux configs.
*
* It is so common to manage blocks of gpiomux configs that the data structure
* for doing so has been standardized here as a convenience.
*
* @cfg: A pointer to the first config in an array of configs.
* @ncfg: The number of configs in the array.
*/
struct msm_gpiomux_configs {
struct msm_gpiomux_config *cfg;
size_t ncfg;
};
/* Provide an enum and an API to write to misc TLMM registers */
enum msm_tlmm_misc_reg {
TLMM_ETM_MODE_REG = 0x2014,
TLMM_SDC2_HDRV_PULL_CTL = 0x2048,
};
void msm_tlmm_misc_reg_write(enum msm_tlmm_misc_reg misc_reg, int val);
#ifdef CONFIG_MSM_GPIOMUX
/* Before using gpiomux, initialize the subsystem by telling it how many
* gpios are going to be managed. Calling any other gpiomux functions before
* msm_gpiomux_init is unsupported.
*/
int msm_gpiomux_init(size_t ngpio);
/* DT Variant of msm_gpiomux_init. This will look up the number of gpios from
* device tree rather than relying on NR_GPIO_IRQS
*/
int msm_gpiomux_init_dt(void);
/* Install a block of gpiomux configurations in gpiomux. This is functionally
* identical to calling msm_gpiomux_write many times.
*/
void msm_gpiomux_install(struct msm_gpiomux_config *configs, unsigned nconfigs);
/* Install a block of gpiomux configurations in gpiomux. Do not however write
* to hardware. Just store the settings to be retrieved at a later time
*/
void msm_gpiomux_install_nowrite(struct msm_gpiomux_config *configs,
unsigned nconfigs);
/* Increment a gpio's reference count, possibly activating the line. */
int __must_check msm_gpiomux_get(unsigned gpio);
/* Decrement a gpio's reference count, possibly suspending the line. */
int msm_gpiomux_put(unsigned gpio);
/* Install a new setting in a gpio. To erase a slot, use NULL.
* The old setting that was overwritten can be passed back to the caller
* old_setting can be NULL if the caller is not interested in the previous
* setting
* If a previous setting was not available to return (NULL configuration)
* - the function returns 1
* else function returns 0
*/
int msm_gpiomux_write(unsigned gpio, enum msm_gpiomux_setting which,
struct gpiomux_setting *setting, struct gpiomux_setting *old_setting);
/* Architecture-internal function for use by the framework only.
* This function can assume the following:
* - the gpio value has passed a bounds-check
* - the gpiomux spinlock has been obtained
*
* This function is not for public consumption. External users
* should use msm_gpiomux_write.
*/
void __msm_gpiomux_write(unsigned gpio, struct gpiomux_setting val);
#else
static inline int msm_gpiomux_init(size_t ngpio)
{
return -ENOSYS;
}
static inline void
msm_gpiomux_install(struct msm_gpiomux_config *configs, unsigned nconfigs) {}
static inline int __must_check msm_gpiomux_get(unsigned gpio)
{
return -ENOSYS;
}
static inline int msm_gpiomux_put(unsigned gpio)
{
return -ENOSYS;
}
static inline int msm_gpiomux_write(unsigned gpio,
enum msm_gpiomux_setting which, struct gpiomux_setting *setting,
struct gpiomux_setting *old_setting)
{
return -ENOSYS;
}
#endif
#endif
@@ -0,0 +1,22 @@
/* arch/arm/mach-msm/include/mach/hardware.h
*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MSM_HARDWARE_H
#define __ASM_ARCH_MSM_HARDWARE_H
#define pcibios_assign_all_busses() 1
#endif
@@ -0,0 +1,31 @@
/* arch/arm/mach-msm/include/mach/htc_35mm_jack.h
*
* Copyright (C) 2009 HTC, Inc.
* Author: Arec Kao <Arec_Kao@htc.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef HTC_35MM_REMOTE_H
#define HTC_35MM_REMOTE_H
/* Driver interfaces */
int htc_35mm_jack_plug_event(int insert, int *hpin_stable);
int htc_35mm_key_event(int key, int *hpin_stable);
/* Platform Specific Callbacks */
struct h35mm_platform_data {
int (*plug_event_enable)(void);
int (*headset_has_mic)(void);
int (*key_event_enable)(void);
int (*key_event_disable)(void);
};
#endif
@@ -0,0 +1,29 @@
/* include/asm/mach-msm/htc_acoustic_qsd.h
*
* Copyright (C) 2009 HTC Corporation.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _ARCH_ARM_MACH_MSM_HTC_ACOUSTIC_QSD_H_
#define _ARCH_ARM_MACH_MSM_HTC_ACOUSTIC_QSD_H_
struct qsd_acoustic_ops {
void (*enable_mic_bias)(int en);
};
void acoustic_register_ops(struct qsd_acoustic_ops *ops);
int turn_mic_bias_on(int on);
int force_headset_speaker_on(int enable);
int enable_aux_loopback(uint32_t enable);
#endif
@@ -0,0 +1,173 @@
/*
* Copyright (C) 2008 HTC, Inc.
* Copyright (C) 2008 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_HTC_HEADSET_H
#define __ASM_ARCH_HTC_HEADSET_H
struct h2w_platform_data {
char *power_name;
int cable_in1;
int cable_in2;
int h2w_clk;
int h2w_data;
int debug_uart;
void (*config_cpld)(int);
void (*init_cpld)(void);
void (*set_dat)(int);
void (*set_clk)(int);
void (*set_dat_dir)(int);
void (*set_clk_dir)(int);
int (*get_dat)(void);
int (*get_clk)(void);
};
#define BIT_HEADSET (1 << 0)
#define BIT_HEADSET_NO_MIC (1 << 1)
#define BIT_TTY (1 << 2)
#define BIT_FM_HEADSET (1 << 3)
#define BIT_FM_SPEAKER (1 << 4)
enum {
H2W_NO_DEVICE = 0,
H2W_HTC_HEADSET = 1,
/* H2W_TTY_DEVICE = 2,*/
NORMAL_HEARPHONE= 2,
H2W_DEVICE = 3,
H2W_USB_CRADLE = 4,
H2W_UART_DEBUG = 5,
};
enum {
H2W_GPIO = 0,
H2W_UART1 = 1,
H2W_UART3 = 2,
H2W_BT = 3
};
#define RESEND_DELAY (3) /* ms */
#define MAX_ACK_RESEND_TIMES (6) /* follow spec */
#define MAX_HOST_RESEND_TIMES (3) /* follow spec */
#define MAX_HYGEIA_RESEND_TIMES (5)
#define H2W_ASCR_DEVICE_INI (0x01)
#define H2W_ASCR_ACT_EN (0x02)
#define H2W_ASCR_PHONE_IN (0x04)
#define H2W_ASCR_RESET (0x08)
#define H2W_ASCR_AUDIO_IN (0x10)
#define H2W_LED_OFF (0x0)
#define H2W_LED_BKL (0x1)
#define H2W_LED_MTL (0x2)
typedef enum {
/* === system group 0x0000~0x00FF === */
/* (R) Accessory type register */
H2W_SYSTEM = 0x0000,
/* (R) Maximum group address */
H2W_MAX_GP_ADD = 0x0001,
/* (R/W) Accessory system control register0 */
H2W_ASCR0 = 0x0002,
/* === key group 0x0100~0x01FF === */
/* (R) Key group maximum sub address */
H2W_KEY_MAXADD = 0x0100,
/* (R) ASCII key press down flag */
H2W_ASCII_DOWN = 0x0101,
/* (R) ASCII key release up flag */
H2W_ASCII_UP = 0x0102,
/* (R) Function key status flag */
H2W_FNKEY_UPDOWN = 0x0103,
/* (R/W) Key device status */
H2W_KD_STATUS = 0x0104,
/* === led group 0x0200~0x02FF === */
/* (R) LED group maximum sub address */
H2W_LED_MAXADD = 0x0200,
/* (R/W) LED control register0 */
H2W_LEDCT0 = 0x0201,
/* === crdl group 0x0300~0x03FF === */
/* (R) Cardle group maximum sub address */
H2W_CRDL_MAXADD = 0x0300,
/* (R/W) Cardle group function control register0 */
H2W_CRDLCT0 = 0x0301,
/* === car kit group 0x0400~0x04FF === */
H2W_CARKIT_MAXADD = 0x0400,
/* === usb host group 0x0500~0x05FF === */
H2W_USBHOST_MAXADD = 0x0500,
/* === medical group 0x0600~0x06FF === */
H2W_MED_MAXADD = 0x0600,
H2W_MED_CONTROL = 0x0601,
H2W_MED_IN_DATA = 0x0602,
} H2W_ADDR;
typedef struct H2W_INFO {
/* system group */
unsigned char CLK_SP;
int SLEEP_PR;
unsigned char HW_REV;
int AUDIO_DEVICE;
unsigned char ACC_CLASS;
unsigned char MAX_GP_ADD;
/* key group */
int KEY_MAXADD;
int ASCII_DOWN;
int ASCII_UP;
int FNKEY_UPDOWN;
int KD_STATUS;
/* led group */
int LED_MAXADD;
int LEDCT0;
/* medical group */
int MED_MAXADD;
unsigned char AP_ID;
unsigned char AP_EN;
unsigned char DATA_EN;
} H2W_INFO;
typedef enum {
H2W_500KHz = 1,
H2W_250KHz = 2,
H2W_166KHz = 3,
H2W_125KHz = 4,
H2W_100KHz = 5,
H2W_83KHz = 6,
H2W_71KHz = 7,
H2W_62KHz = 8,
H2W_55KHz = 9,
H2W_50KHz = 10,
} H2W_SPEED;
typedef enum {
H2W_KEY_INVALID = -1,
H2W_KEY_PLAY = 0,
H2W_KEY_FORWARD = 1,
H2W_KEY_BACKWARD = 2,
H2W_KEY_VOLUP = 3,
H2W_KEY_VOLDOWN = 4,
H2W_KEY_PICKUP = 5,
H2W_KEY_HANGUP = 6,
H2W_KEY_MUTE = 7,
H2W_KEY_HOLD = 8,
H2W_NUM_KEYFUNC = 9,
} KEYFUNC;
#endif
@@ -0,0 +1,87 @@
/* include/asm/mach-msm/htc_pwrsink.h
*
* Copyright (C) 2007 Google, Inc.
* Copyright (C) 2008 HTC Corporation.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _ARCH_ARM_MACH_MSM_HTC_PWRSINK_H_
#define _ARCH_ARM_MACH_MSM_HTC_PWRSINK_H_
#include <linux/platform_device.h>
#include <linux/earlysuspend.h>
typedef enum {
PWRSINK_AUDIO_PCM = 0,
PWRSINK_AUDIO_MP3,
PWRSINK_AUDIO_AAC,
PWRSINK_AUDIO_LAST = PWRSINK_AUDIO_AAC,
PWRSINK_AUDIO_INVALID
} pwrsink_audio_id_type;
struct pwr_sink_audio {
unsigned volume;
unsigned percent;
};
typedef enum {
PWRSINK_SYSTEM_LOAD = 0,
PWRSINK_AUDIO,
PWRSINK_BACKLIGHT,
PWRSINK_LED_BUTTON,
PWRSINK_LED_KEYBOARD,
PWRSINK_GP_CLK,
PWRSINK_BLUETOOTH,
PWRSINK_CAMERA,
PWRSINK_SDCARD,
PWRSINK_VIDEO,
PWRSINK_WIFI,
PWRSINK_LAST = PWRSINK_WIFI,
PWRSINK_INVALID
} pwrsink_id_type;
struct pwr_sink {
pwrsink_id_type id;
unsigned ua_max;
unsigned percent_util;
};
struct pwr_sink_platform_data {
unsigned num_sinks;
struct pwr_sink *sinks;
int (*suspend_late)(struct platform_device *, pm_message_t state);
int (*resume_early)(struct platform_device *);
void (*suspend_early)(struct early_suspend *);
void (*resume_late)(struct early_suspend *);
};
#ifndef CONFIG_HTC_PWRSINK
static inline int htc_pwrsink_set(pwrsink_id_type id, unsigned percent)
{
return 0;
}
static inline int htc_pwrsink_audio_set(pwrsink_audio_id_type id,
unsigned percent_utilized) { return 0; }
static inline int htc_pwrsink_audio_volume_set(
pwrsink_audio_id_type id, unsigned volume) { return 0; }
static inline int htc_pwrsink_audio_path_set(unsigned path) { return 0; }
#else
extern int htc_pwrsink_set(pwrsink_id_type id, unsigned percent);
extern int htc_pwrsink_audio_set(pwrsink_audio_id_type id,
unsigned percent_utilized);
extern int htc_pwrsink_audio_volume_set(pwrsink_audio_id_type id,
unsigned volume);
extern int htc_pwrsink_audio_path_set(unsigned path);
#endif
#endif
@@ -0,0 +1,23 @@
/*
* Copyright (C) 2007 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARM_ARCH_IO_H
#define __ASM_ARM_ARCH_IO_H
#define IO_SPACE_LIMIT 0xffffffff
#define __io(a) __typesafe_io(a)
#define __mem_pci(a) (a)
#endif
@@ -0,0 +1,329 @@
/* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef MSM_IOMMU_H
#define MSM_IOMMU_H
#include <linux/interrupt.h>
#include <linux/clk.h>
#include <linux/list.h>
#include <linux/regulator/consumer.h>
#include <mach/socinfo.h>
extern pgprot_t pgprot_kernel;
extern struct bus_type msm_iommu_sec_bus_type;
extern struct iommu_access_ops iommu_access_ops_v0;
extern struct iommu_access_ops iommu_access_ops_v1;
/* Domain attributes */
#define MSM_IOMMU_DOMAIN_PT_CACHEABLE 0x1
#define MSM_IOMMU_DOMAIN_PT_SECURE 0x2
/* Mask for the cache policy attribute */
#define MSM_IOMMU_CP_MASK 0x03
/* Maximum number of Machine IDs that we are allowing to be mapped to the same
* context bank. The number of MIDs mapped to the same CB does not affect
* performance, but there is a practical limit on how many distinct MIDs may
* be present. These mappings are typically determined at design time and are
* not expected to change at run time.
*/
#define MAX_NUM_MIDS 32
/* Maximum number of SMT entries allowed by the system */
#define MAX_NUM_SMR 128
#define MAX_NUM_BFB_REGS 32
/**
* struct msm_iommu_dev - a single IOMMU hardware instance
* name Human-readable name given to this IOMMU HW instance
* ncb Number of context banks present on this IOMMU HW instance
*/
struct msm_iommu_dev {
const char *name;
int ncb;
int ttbr_split;
};
/**
* struct msm_iommu_ctx_dev - an IOMMU context bank instance
* name Human-readable name given to this context bank
* num Index of this context bank within the hardware
* mids List of Machine IDs that are to be mapped into this context
* bank, terminated by -1. The MID is a set of signals on the
* AXI bus that identifies the function associated with a specific
* memory request. (See ARM spec).
*/
struct msm_iommu_ctx_dev {
const char *name;
int num;
int mids[MAX_NUM_MIDS];
};
/**
* struct msm_iommu_bfb_settings - a set of IOMMU BFB tuning parameters
* regs An array of register offsets to configure
* data Values to write to corresponding registers
* length Number of valid entries in the offset/val arrays
*/
struct msm_iommu_bfb_settings {
unsigned int regs[MAX_NUM_BFB_REGS];
unsigned int data[MAX_NUM_BFB_REGS];
int length;
};
/**
* struct msm_iommu_drvdata - A single IOMMU hardware instance
* @base: IOMMU config port base address (VA)
* @glb_base: IOMMU config port base address for global register space (VA)
* @ncb The number of contexts on this IOMMU
* @irq: Interrupt number
* @clk: The bus clock for this IOMMU hardware instance
* @pclk: The clock for the IOMMU bus interconnect
* @aclk: Alternate clock for this IOMMU core, if any
* @name: Human-readable name of this IOMMU device
* @gdsc: Regulator needed to power this HW block (v2 only)
* @bfb_settings: Optional BFB performance tuning parameters
* @dev: Struct device this hardware instance is tied to
* @list: List head to link all iommus together
* @clk_reg_virt: Optional clock register virtual address.
* @halt_enabled: Set to 1 if IOMMU halt is supported in the IOMMU, 0 otherwise.
* @asid: List of ASID and their usage count (index is ASID value).
* @ctx_attach_count: Count of how many context are attached.
* @bus_client : Bus client needed to vote for bus bandwidth.
*
* A msm_iommu_drvdata holds the global driver data about a single piece
* of an IOMMU hardware instance.
*/
struct msm_iommu_drvdata {
void __iomem *base;
void __iomem *glb_base;
int ncb;
int ttbr_split;
struct clk *clk;
struct clk *pclk;
struct clk *aclk;
const char *name;
struct regulator *gdsc;
struct regulator *alt_gdsc;
struct msm_iommu_bfb_settings *bfb_settings;
int sec_id;
struct device *dev;
struct list_head list;
void __iomem *clk_reg_virt;
int halt_enabled;
int *asid;
unsigned int ctx_attach_count;
unsigned int bus_client;
};
/**
* struct iommu_access_ops - Callbacks for accessing IOMMU
* @iommu_power_on: Turn on power to unit
* @iommu_power_off: Turn off power to unit
* @iommu_bus_vote: Vote for bus bandwidth
* @iommu_clk_on: Turn on clks to unit
* @iommu_clk_off: Turn off clks to unit
* @iommu_lock_initialize: Initialize the remote lock
* @iommu_lock_acquire: Acquire any locks needed
* @iommu_lock_release: Release locks needed
*/
struct iommu_access_ops {
int (*iommu_power_on)(struct msm_iommu_drvdata *);
void (*iommu_power_off)(struct msm_iommu_drvdata *);
int (*iommu_bus_vote)(struct msm_iommu_drvdata *drvdata,
unsigned int vote);
int (*iommu_clk_on)(struct msm_iommu_drvdata *);
void (*iommu_clk_off)(struct msm_iommu_drvdata *);
void * (*iommu_lock_initialize)(void);
void (*iommu_lock_acquire)(void);
void (*iommu_lock_release)(void);
};
void msm_iommu_add_drv(struct msm_iommu_drvdata *drv);
void msm_iommu_remove_drv(struct msm_iommu_drvdata *drv);
void program_iommu_bfb_settings(void __iomem *base,
const struct msm_iommu_bfb_settings *bfb_settings);
void iommu_halt(const struct msm_iommu_drvdata *iommu_drvdata);
void iommu_resume(const struct msm_iommu_drvdata *iommu_drvdata);
/**
* struct msm_iommu_ctx_drvdata - an IOMMU context bank instance
* @num: Hardware context number of this context
* @pdev: Platform device associated wit this HW instance
* @attached_elm: List element for domains to track which devices are
* attached to them
* @attached_domain Domain currently attached to this context (if any)
* @name Human-readable name of this context device
* @sids List of Stream IDs mapped to this context
* @nsid Number of Stream IDs mapped to this context
* @secure_context true if this is a secure context programmed by
the secure environment, false otherwise
* @asid ASID used with this context.
* @attach_count Number of time this context has been attached.
*
* A msm_iommu_ctx_drvdata holds the driver data for a single context bank
* within each IOMMU hardware instance
*/
struct msm_iommu_ctx_drvdata {
int num;
struct platform_device *pdev;
struct list_head attached_elm;
struct iommu_domain *attached_domain;
const char *name;
u32 sids[MAX_NUM_SMR];
unsigned int nsid;
unsigned int secure_context;
int asid;
int attach_count;
};
struct msm_iommu_context_regs {
uint32_t far;
uint32_t par;
uint32_t fsr;
uint32_t fsynr0;
uint32_t fsynr1;
uint32_t ttbr0;
uint32_t ttbr1;
uint32_t sctlr;
uint32_t actlr;
uint32_t prrr;
uint32_t nmrr;
};
void print_ctx_regs(struct msm_iommu_context_regs *regs);
/*
* Interrupt handler for the IOMMU context fault interrupt. Hooking the
* interrupt is not supported in the API yet, but this will print an error
* message and dump useful IOMMU registers.
*/
irqreturn_t msm_iommu_fault_handler(int irq, void *dev_id);
irqreturn_t msm_iommu_fault_handler_v2(int irq, void *dev_id);
irqreturn_t msm_iommu_secure_fault_handler_v2(int irq, void *dev_id);
enum {
PROC_APPS,
PROC_GPU,
PROC_MAX
};
/* Expose structure to allow kgsl iommu driver to use the same structure to
* communicate to GPU the addresses of the flag and turn variables.
*/
struct remote_iommu_petersons_spinlock {
uint32_t flag[PROC_MAX];
uint32_t turn;
};
#ifdef CONFIG_MSM_IOMMU
void *msm_iommu_lock_initialize(void);
void msm_iommu_mutex_lock(void);
void msm_iommu_mutex_unlock(void);
void msm_set_iommu_access_ops(struct iommu_access_ops *ops);
struct iommu_access_ops *msm_get_iommu_access_ops(void);
#else
static inline void *msm_iommu_lock_initialize(void)
{
return NULL;
}
static inline void msm_iommu_mutex_lock(void) { }
static inline void msm_iommu_mutex_unlock(void) { }
static inline void msm_set_iommu_access_ops(struct iommu_access_ops *ops)
{
}
static inline struct iommu_access_ops *msm_get_iommu_access_ops(void)
{
return NULL;
}
#endif
#ifdef CONFIG_MSM_IOMMU_GPU_SYNC
void msm_iommu_remote_p0_spin_lock(void);
void msm_iommu_remote_p0_spin_unlock(void);
#define msm_iommu_remote_lock_init() _msm_iommu_remote_spin_lock_init()
#define msm_iommu_remote_spin_lock() msm_iommu_remote_p0_spin_lock()
#define msm_iommu_remote_spin_unlock() msm_iommu_remote_p0_spin_unlock()
#else
#define msm_iommu_remote_lock_init()
#define msm_iommu_remote_spin_lock()
#define msm_iommu_remote_spin_unlock()
#endif
/* Allows kgsl iommu driver to acquire lock */
#define msm_iommu_lock() \
do { \
msm_iommu_mutex_lock(); \
msm_iommu_remote_spin_lock(); \
} while (0)
#define msm_iommu_unlock() \
do { \
msm_iommu_remote_spin_unlock(); \
msm_iommu_mutex_unlock(); \
} while (0)
#ifdef CONFIG_MSM_IOMMU
/*
* Look up an IOMMU context device by its context name. NULL if none found.
* Useful for testing and drivers that do not yet fully have IOMMU stuff in
* their platform devices.
*/
struct device *msm_iommu_get_ctx(const char *ctx_name);
#else
static inline struct device *msm_iommu_get_ctx(const char *ctx_name)
{
return NULL;
}
#endif
/*
* Function to program the global registers of an IOMMU securely.
* This should only be called on IOMMUs for which kernel programming
* of global registers is not possible
*/
void msm_iommu_sec_set_access_ops(struct iommu_access_ops *access_ops);
int msm_iommu_sec_program_iommu(int sec_id);
static inline int msm_soc_version_supports_iommu_v0(void)
{
#ifdef CONFIG_OF
struct device_node *node;
node = of_find_compatible_node(NULL, NULL, "qcom,msm-smmu-v1");
if (node) {
of_node_put(node);
return 0;
}
node = of_find_compatible_node(NULL, NULL, "qcom,msm-smmu-v0");
if (node) {
of_node_put(node);
return 1;
}
#endif
if (cpu_is_msm8960() &&
SOCINFO_VERSION_MAJOR(socinfo_get_version()) < 2)
return 0;
if (cpu_is_msm8x60() &&
(SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 2 ||
SOCINFO_VERSION_MINOR(socinfo_get_version()) < 1)) {
return 0;
}
return 1;
}
#endif
@@ -0,0 +1,206 @@
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _ARCH_IOMMU_DOMAINS_H
#define _ARCH_IOMMU_DOMAINS_H
#include <linux/errno.h>
#include <linux/memory_alloc.h>
#define MSM_IOMMU_DOMAIN_SECURE 0x1
enum {
VIDEO_DOMAIN,
CAMERA_DOMAIN,
DISPLAY_READ_DOMAIN,
DISPLAY_WRITE_DOMAIN,
ROTATOR_SRC_DOMAIN,
ROTATOR_DST_DOMAIN,
MAX_DOMAINS
};
enum {
VIDEO_FIRMWARE_POOL,
VIDEO_MAIN_POOL,
GEN_POOL,
};
struct msm_iommu_domain_name {
char *name;
int domain;
};
struct msm_iommu_domain {
/* iommu domain to map in */
struct iommu_domain *domain;
/* total number of allocations from this domain */
atomic_t allocation_cnt;
/* number of iova pools */
int npools;
/*
* array of gen_pools for allocating iovas.
* behavior is undefined if these overlap
*/
struct mem_pool *iova_pools;
};
struct iommu_domains_pdata {
struct msm_iommu_domain *domains;
int ndomains;
struct msm_iommu_domain_name *domain_names;
int nnames;
unsigned int domain_alloc_flags;
};
struct msm_iova_partition {
unsigned long start;
unsigned long size;
};
struct msm_iova_layout {
struct msm_iova_partition *partitions;
int npartitions;
const char *client_name;
unsigned int domain_flags;
unsigned int is_secure;
};
#if defined(CONFIG_MSM_IOMMU)
extern void msm_iommu_set_client_name(struct iommu_domain *domain,
char const *name);
extern struct iommu_domain *msm_get_iommu_domain(int domain_num);
extern int msm_find_domain_no(const struct iommu_domain *domain);
extern int msm_allocate_iova_address(unsigned int iommu_domain,
unsigned int partition_no,
unsigned long size,
unsigned long align,
unsigned long *iova);
extern void msm_free_iova_address(unsigned long iova,
unsigned int iommu_domain,
unsigned int partition_no,
unsigned long size);
extern int msm_use_iommu(void);
extern int msm_iommu_map_extra(struct iommu_domain *domain,
unsigned long start_iova,
phys_addr_t phys_addr,
unsigned long size,
unsigned long page_size,
int cached);
extern void msm_iommu_unmap_extra(struct iommu_domain *domain,
unsigned long start_iova,
unsigned long size,
unsigned long page_size);
extern int msm_iommu_map_contig_buffer(phys_addr_t phys,
unsigned int domain_no,
unsigned int partition_no,
unsigned long size,
unsigned long align,
unsigned long cached,
unsigned long *iova_val);
extern void msm_iommu_unmap_contig_buffer(unsigned long iova,
unsigned int domain_no,
unsigned int partition_no,
unsigned long size);
extern int msm_register_domain(struct msm_iova_layout *layout);
extern int msm_unregister_domain(struct iommu_domain *domain);
#else
static inline void msm_iommu_set_client_name(struct iommu_domain *domain,
char const *name)
{
}
static inline struct iommu_domain
*msm_get_iommu_domain(int subsys_id) { return NULL; }
static inline int msm_find_domain_no(const struct iommu_domain *domain)
{
return -EINVAL;
}
static inline int msm_allocate_iova_address(unsigned int iommu_domain,
unsigned int partition_no,
unsigned long size,
unsigned long align,
unsigned long *iova) { return -ENOMEM; }
static inline void msm_free_iova_address(unsigned long iova,
unsigned int iommu_domain,
unsigned int partition_no,
unsigned long size) { return; }
static inline int msm_use_iommu(void)
{
return 0;
}
static inline int msm_iommu_map_extra(struct iommu_domain *domain,
unsigned long start_iova,
phys_addr_t phys_addr,
unsigned long size,
unsigned long page_size,
int cached)
{
return -ENODEV;
}
static inline void msm_iommu_unmap_extra(struct iommu_domain *domain,
unsigned long start_iova,
unsigned long size,
unsigned long page_size)
{
}
static inline int msm_iommu_map_contig_buffer(phys_addr_t phys,
unsigned int domain_no,
unsigned int partition_no,
unsigned long size,
unsigned long align,
unsigned long cached,
unsigned long *iova_val)
{
*iova_val = phys;
return 0;
}
static inline void msm_iommu_unmap_contig_buffer(unsigned long iova,
unsigned int domain_no,
unsigned int partition_no,
unsigned long size)
{
return;
}
static inline int msm_register_domain(struct msm_iova_layout *layout)
{
return -ENODEV;
}
static inline int msm_unregister_domain(struct iommu_domain *domain)
{
return -ENODEV;
}
#endif
#endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,233 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/irqreturn.h>
#ifndef MSM_IOMMU_PERFMON_H
#define MSM_IOMMU_PERFMON_H
/**
* struct iommu_pmon_counter - container for a performance counter.
* @counter_no: counter number within the group
* @absolute_counter_no: counter number within IOMMU PMU
* @value: cached counter value
* @overflow_count: no of times counter has overflowed
* @enabled: indicates whether counter is enabled or not
* @current_event_class: current selected event class, -1 if none
* @counter_dir: debugfs directory for this counter
* @cnt_group: group this counter belongs to
*/
struct iommu_pmon_counter {
unsigned int counter_no;
unsigned int absolute_counter_no;
unsigned long value;
unsigned long overflow_count;
unsigned int enabled;
int current_event_class;
struct dentry *counter_dir;
struct iommu_pmon_cnt_group *cnt_group;
};
/**
* struct iommu_pmon_cnt_group - container for a perf mon counter group.
* @grp_no: group number
* @num_counters: number of counters in this group
* @counters: list of counter in this group
* @group_dir: debugfs directory for this group
* @pmon: pointer to the iommu_pmon object this group belongs to
*/
struct iommu_pmon_cnt_group {
unsigned int grp_no;
unsigned int num_counters;
struct iommu_pmon_counter *counters;
struct dentry *group_dir;
struct iommu_pmon *pmon;
};
/**
* struct iommu_info - container for a perf mon iommu info.
* @iommu_name: name of the iommu from device tree
* @base: virtual base address for this iommu
* @evt_irq: irq number for event overflow interrupt
* @iommu_dev: pointer to iommu device
* @ops: iommu access operations pointer.
* @hw_ops: iommu pm hw access operations pointer.
* @always_on: 1 if iommu is always on, 0 otherwise.
*/
struct iommu_info {
const char *iommu_name;
void *base;
int evt_irq;
struct device *iommu_dev;
struct iommu_access_ops *ops;
struct iommu_pm_hw_ops *hw_ops;
unsigned int always_on;
};
/**
* struct iommu_pmon - main container for a perf mon data.
* @iommu_dir: debugfs directory for this iommu
* @iommu: iommu_info instance
* @iommu_list: iommu_list head
* @cnt_grp: list of counter groups
* @num_groups: number of counter groups
* @num_counters: number of counters per group
* @event_cls_supported: an array of event classes supported for this PMU
* @nevent_cls_supported: number of event classes supported.
* @enabled: Indicates whether perf. mon is enabled or not
* @iommu_attached Indicates whether iommu is attached or not.
* @lock: mutex used to synchronize access to shared data
*/
struct iommu_pmon {
struct dentry *iommu_dir;
struct iommu_info iommu;
struct list_head iommu_list;
struct iommu_pmon_cnt_group *cnt_grp;
u32 num_groups;
u32 num_counters;
u32 *event_cls_supported;
u32 nevent_cls_supported;
unsigned int enabled;
unsigned int iommu_attach_count;
struct mutex lock;
};
/**
* struct iommu_hw_ops - Callbacks for accessing IOMMU HW
* @initialize_hw: Call to do any initialization before enabling ovf interrupts
* @is_hw_access_ok: Returns 1 if we can access HW, 0 otherwise
* @grp_enable: Call to enable a counter group
* @grp_disable: Call to disable a counter group
* @enable_pm: Call to enable PM
* @disable_pm: Call to disable PM
* @reset_counters: Call to reset counters
* @check_for_overflow: Call to check for overflow
* @evt_ovfl_int_handler: Overflow interrupt handler callback
* @counter_enable: Call to enable counters
* @counter_disable: Call to disable counters
* @ovfl_int_enable: Call to enable overflow interrupts
* @ovfl_int_disable: Call to disable overflow interrupts
* @set_event_class: Call to set event class
* @read_counter: Call to read a counter value
*/
struct iommu_pm_hw_ops {
void (*initialize_hw)(const struct iommu_pmon *);
unsigned int (*is_hw_access_OK)(const struct iommu_pmon *);
void (*grp_enable)(struct iommu_info *, unsigned int);
void (*grp_disable)(struct iommu_info *, unsigned int);
void (*enable_pm)(struct iommu_info *);
void (*disable_pm)(struct iommu_info *);
void (*reset_counters)(const struct iommu_info *);
void (*check_for_overflow)(struct iommu_pmon *);
irqreturn_t (*evt_ovfl_int_handler)(int, void *);
void (*counter_enable)(struct iommu_info *,
struct iommu_pmon_counter *);
void (*counter_disable)(struct iommu_info *,
struct iommu_pmon_counter *);
void (*ovfl_int_enable)(struct iommu_info *,
const struct iommu_pmon_counter *);
void (*ovfl_int_disable)(struct iommu_info *,
const struct iommu_pmon_counter *);
void (*set_event_class)(struct iommu_pmon *pmon, unsigned int,
unsigned int);
unsigned int (*read_counter)(struct iommu_pmon_counter *);
};
#define MSM_IOMMU_PMU_NO_EVENT_CLASS -1
#ifdef CONFIG_MSM_IOMMU_PMON
/**
* Get pointer to PMU hardware access functions for IOMMUv0 PMU
*/
struct iommu_pm_hw_ops *iommu_pm_get_hw_ops_v0(void);
/**
* Get pointer to PMU hardware access functions for IOMMUv1 PMU
*/
struct iommu_pm_hw_ops *iommu_pm_get_hw_ops_v1(void);
/**
* Allocate memory for performance monitor structure. Must
* be called before iommu_pm_iommu_register
*/
struct iommu_pmon *msm_iommu_pm_alloc(struct device *iommu_dev);
/**
* Free memory previously allocated with iommu_pm_alloc
*/
void msm_iommu_pm_free(struct device *iommu_dev);
/**
* Register iommu with the performance monitor module.
*/
int msm_iommu_pm_iommu_register(struct iommu_pmon *info);
/**
* Unregister iommu with the performance monitor module.
*/
void msm_iommu_pm_iommu_unregister(struct device *dev);
/**
* Called by iommu driver when attaching is complete
* Must NOT be called with IOMMU mutexes held.
* @param iommu_dev IOMMU device that is attached
*/
void msm_iommu_attached(struct device *dev);
/**
* Called by iommu driver before detaching.
* Must NOT be called with IOMMU mutexes held.
* @param iommu_dev IOMMU device that is going to be detached
*/
void msm_iommu_detached(struct device *dev);
#else
static inline struct iommu_pm_hw_ops *iommu_pm_get_hw_ops_v0(void)
{
return NULL;
}
static inline struct iommu_pm_hw_ops *iommu_pm_get_hw_ops_v1(void)
{
return NULL;
}
static inline struct iommu_pmon *msm_iommu_pm_alloc(struct device *iommu_dev)
{
return NULL;
}
static inline void msm_iommu_pm_free(struct device *iommu_dev)
{
return;
}
static inline int msm_iommu_pm_iommu_register(struct iommu_pmon *info)
{
return -EIO;
}
static inline void msm_iommu_pm_iommu_unregister(struct device *dev)
{
}
static inline void msm_iommu_attached(struct device *dev)
{
}
static inline void msm_iommu_detached(struct device *dev)
{
}
#endif
#endif
@@ -0,0 +1,29 @@
/**
*
* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MACH_ION_H_
#define __MACH_ION_H_
enum ion_memory_types {
ION_EBI_TYPE,
ION_SMI_TYPE,
};
enum ion_permission_type {
IPT_TYPE_MM_CARVEOUT = 0,
IPT_TYPE_MFC_SHAREDMEM = 1,
IPT_TYPE_MDP_WRITEBACK = 2,
};
#endif
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,77 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2009-2010, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*/
#ifndef __ASM_ARCH_MSM_IRQS_7X00_H
#define __ASM_ARCH_MSM_IRQS_7X00_H
/* MSM ARM11 Interrupt Numbers */
/* See 80-VE113-1 A, pp219-221 */
#define INT_A9_M2A_0 0
#define INT_A9_M2A_1 1
#define INT_A9_M2A_2 2
#define INT_A9_M2A_3 3
#define INT_A9_M2A_4 4
#define INT_A9_M2A_5 5
#define INT_A9_M2A_6 6
#define INT_GP_TIMER_EXP 7
#define INT_DEBUG_TIMER_EXP 8
#define INT_UART1 9
#define INT_UART2 10
#define INT_UART3 11
#define INT_UART1_RX 12
#define INT_UART2_RX 13
#define INT_UART3_RX 14
#define INT_USB_OTG 15
#define INT_MDDI_PRI 16
#define INT_MDDI_EXT 17
#define INT_MDDI_CLIENT 18
#define INT_MDP 19
#define INT_GRAPHICS 20
#define INT_ADM_AARM 21
#define INT_ADSP_A11 22
#define INT_ADSP_A9_A11 23
#define INT_SDC1_0 24
#define INT_SDC1_1 25
#define INT_SDC2_0 26
#define INT_SDC2_1 27
#define INT_KEYSENSE 28
#define INT_TCHSCRN_SSBI 29
#define INT_TCHSCRN1 30
#define INT_TCHSCRN2 31
#define INT_GPIO_GROUP1 (32 + 0)
#define INT_GPIO_GROUP2 (32 + 1)
#define INT_PWB_I2C (32 + 2)
#define INT_SOFTRESET (32 + 3)
#define INT_NAND_WR_ER_DONE (32 + 4)
#define INT_NAND_OP_DONE (32 + 5)
#define INT_PBUS_ARM11 (32 + 6)
#define INT_AXI_MPU_SMI (32 + 7)
#define INT_AXI_MPU_EBI1 (32 + 8)
#define INT_AD_HSSD (32 + 9)
#define INT_ARM11_PMU (32 + 10)
#define INT_ARM11_DMA (32 + 11)
#define INT_TSIF_IRQ (32 + 12)
#define INT_UART1DM_IRQ (32 + 13)
#define INT_UART1DM_RX (32 + 14)
#define INT_USB_HS (32 + 15)
#define INT_SDC3_0 (32 + 16)
#define INT_SDC3_1 (32 + 17)
#define INT_SDC4_0 (32 + 18)
#define INT_SDC4_1 (32 + 19)
#define INT_UART2DM_RX (32 + 20)
#define INT_UART2DM_IRQ (32 + 21)
/* 22-31 are reserved */
#define NR_MSM_IRQS 64
#define NR_GPIO_IRQS 122
#define NR_BOARD_IRQS 64
#define NR_SIRC_IRQS 0
#define INT_ADSP_A11_SMSM INT_ADSP_A11
#endif
@@ -0,0 +1,150 @@
/* Copyright (c) 2009-2010, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IRQS_7X30_H
#define __ASM_ARCH_MSM_IRQS_7X30_H
/* MSM ACPU Interrupt Numbers */
#define INT_DEBUG_TIMER_EXP 0
#define INT_GPT0_TIMER_EXP 1
#define INT_GPT1_TIMER_EXP 2
#define INT_WDT0_ACCSCSSBARK 3
#define INT_WDT1_ACCSCSSBARK 4
#define INT_AVS_SVIC 5
#define INT_AVS_SVIC_SW_DONE 6
#define INT_SC_DBG_RX_FULL 7
#define INT_SC_DBG_TX_EMPTY 8
#define INT_ARMQC_PERFMON 9
#define INT_AVS_REQ_DOWN 10
#define INT_AVS_REQ_UP 11
#define INT_SC_ACG 12
/* SCSS_VICFIQSTS0[13:15] are RESERVED */
#define INT_L2_SVICCPUIRPTREQ 16
#define INT_L2_SVICDMANSIRPTREQ 17
#define INT_L2_SVICDMASIRPTREQ 18
#define INT_L2_SVICSLVIRPTREQ 19
#define INT_AD5A_MPROC_APPS_0 20
#define INT_AD5A_MPROC_APPS_1 21
#define INT_A9_M2A_0 22
#define INT_A9_M2A_1 23
#define INT_A9_M2A_2 24
#define INT_A9_M2A_3 25
#define INT_A9_M2A_4 26
#define INT_A9_M2A_5 27
#define INT_A9_M2A_6 28
#define INT_A9_M2A_7 29
#define INT_A9_M2A_8 30
#define INT_A9_M2A_9 31
#define INT_AXI_EBI1_SC (32 + 0)
#define INT_IMEM_ERR (32 + 1)
#define INT_AXI_EBI0_SC (32 + 2)
#define INT_PBUS_SC_IRQC (32 + 3)
#define INT_PERPH_BUS_BPM (32 + 4)
#define INT_CC_TEMP_SENSE (32 + 5)
#define INT_UXMC_EBI0 (32 + 6)
#define INT_UXMC_EBI1 (32 + 7)
#define INT_EBI2_OP_DONE (32 + 8)
#define INT_EBI2_WR_ER_DONE (32 + 9)
#define INT_TCSR_SPSS_CE (32 + 10)
#define INT_EMDH (32 + 11)
#define INT_PMDH (32 + 12)
#define INT_MDC (32 + 13)
#define INT_MIDI_TO_SUPSS (32 + 14)
#define INT_LPA_2 (32 + 15)
#define INT_GPIO_GROUP1_SECURE (32 + 16)
#define INT_GPIO_GROUP2_SECURE (32 + 17)
#define INT_GPIO_GROUP1 (32 + 18)
#define INT_GPIO_GROUP2 (32 + 19)
#define INT_MPRPH_SOFTRESET (32 + 20)
#define INT_PWB_I2C (32 + 21)
#define INT_PWB_I2C_2 (32 + 22)
#define INT_TSSC_SAMPLE (32 + 23)
#define INT_TSSC_PENUP (32 + 24)
#define INT_TCHSCRN_SSBI (32 + 25)
#define INT_FM_RDS (32 + 26)
#define INT_KEYSENSE (32 + 27)
#define INT_USB_OTG_HS (32 + 28)
#define INT_USB_OTG_HS2 (32 + 29)
#define INT_USB_OTG_HS3 (32 + 30)
#define INT_CSI (32 + 31)
#define INT_SPI_OUTPUT (64 + 0)
#define INT_SPI_INPUT (64 + 1)
#define INT_SPI_ERROR (64 + 2)
#define INT_UART1 (64 + 3)
#define INT_UART1_RX (64 + 4)
#define INT_UART2 (64 + 5)
#define INT_UART2_RX (64 + 6)
#define INT_UART3 (64 + 7)
#define INT_UART3_RX (64 + 8)
#define INT_UART1DM_IRQ (64 + 9)
#define INT_UART1DM_RX (64 + 10)
#define INT_UART2DM_IRQ (64 + 11)
#define INT_UART2DM_RX (64 + 12)
#define INT_TSIF (64 + 13)
#define INT_ADM_SC1 (64 + 14)
#define INT_ADM_SC2 (64 + 15)
#define INT_MDP (64 + 16)
#define INT_VPE (64 + 17)
#define INT_GRP_2D (64 + 18)
#define INT_GRP_3D (64 + 19)
#define INT_ROTATOR (64 + 20)
#define INT_MFC720 (64 + 21)
#define INT_JPEG (64 + 22)
#define INT_VFE (64 + 23)
#define INT_TV_ENC (64 + 24)
#define INT_PMIC_SSBI (64 + 25)
#define INT_MPM_1 (64 + 26)
#define INT_TCSR_SPSS_SAMPLE (64 + 27)
#define INT_TCSR_SPSS_PENUP (64 + 28)
#define INT_MPM_2 (64 + 29)
#define INT_SDC1_0 (64 + 30)
#define INT_SDC1_1 (64 + 31)
#define INT_SDC3_0 (96 + 0)
#define INT_SDC3_1 (96 + 1)
#define INT_SDC2_0 (96 + 2)
#define INT_SDC2_1 (96 + 3)
#define INT_SDC4_0 (96 + 4)
#define INT_SDC4_1 (96 + 5)
#define INT_PWB_QUP_IN (96 + 6)
#define INT_PWB_QUP_OUT (96 + 7)
#define INT_PWB_QUP_ERR (96 + 8)
#define INT_SCSS_WDT0_BITE (96 + 9)
/* SCSS_VICFIQSTS3[10:31] are RESERVED */
/* Retrofit universal macro names */
#define INT_ADM_AARM INT_ADM_SC2
#define INT_USB_HS INT_USB_OTG_HS
#define INT_USB_OTG INT_USB_OTG_HS
#define INT_TCHSCRN1 INT_TSSC_SAMPLE
#define INT_TCHSCRN2 INT_TSSC_PENUP
#define INT_GP_TIMER_EXP INT_GPT0_TIMER_EXP
#define INT_ADSP_A9_A11 INT_AD5A_MPROC_APPS_0
#define INT_ADSP_A11 INT_AD5A_MPROC_APPS_1
#define INT_MDDI_EXT INT_EMDH
#define INT_MDDI_PRI INT_PMDH
#define INT_MDDI_CLIENT INT_MDC
#define INT_NAND_WR_ER_DONE INT_EBI2_WR_ER_DONE
#define INT_NAND_OP_DONE INT_EBI2_OP_DONE
#define NR_MSM_IRQS 128
#define NR_GPIO_IRQS 182
#define PMIC8058_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS)
#define NR_PMIC8058_IRQS 256
#define NR_BOARD_IRQS NR_PMIC8058_IRQS
#define INT_ADSP_A11_SMSM INT_ADSP_A11
#endif /* __ASM_ARCH_MSM_IRQS_7X30_H */
@@ -0,0 +1,83 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*/
#ifndef __ASM_ARCH_MSM_IRQS_7XXX_H
#define __ASM_ARCH_MSM_IRQS_7XXX_H
/* MSM ARM11 Interrupt Numbers */
/* See 80-VE113-1 A, pp219-221 */
#define INT_A9_M2A_0 0
#define INT_A9_M2A_1 1
#define INT_A9_M2A_2 2
#define INT_A9_M2A_3 3
#define INT_A9_M2A_4 4
#define INT_A9_M2A_5 5
#define INT_A9_M2A_6 6
#define INT_GP_TIMER_EXP 7
#define INT_DEBUG_TIMER_EXP 8
#define INT_UART1 9
#define INT_UART2 10
#define INT_UART3 11
#define INT_UART1_RX 12
#define INT_UART2_RX 13
#define INT_UART3_RX 14
#define INT_USB_OTG 15
#if defined(CONFIG_ARCH_MSM7X27A)
#define INT_DSI_IRQ 16
#define INT_CSI_IRQ_1 17
#define INT_CSI_IRQ_0 18
#else
#define INT_MDDI_PRI 16
#define INT_MDDI_EXT 17
#define INT_MDDI_CLIENT 18
#endif
#define INT_MDP 19
#define INT_GRAPHICS 20
#define INT_ADM_AARM 21
#define INT_ADSP_A11 22
#define INT_ADSP_A9_A11 23
#define INT_SDC1_0 24
#define INT_SDC1_1 25
#define INT_SDC2_0 26
#define INT_SDC2_1 27
#define INT_KEYSENSE 28
#define INT_TCHSCRN_SSBI 29
#define INT_TCHSCRN1 30
#define INT_TCHSCRN2 31
#define INT_GPIO_GROUP1 (32 + 0)
#define INT_GPIO_GROUP2 (32 + 1)
#define INT_PWB_I2C (32 + 2)
#define INT_SOFTRESET (32 + 3)
#define INT_NAND_WR_ER_DONE (32 + 4)
#define INT_NAND_OP_DONE (32 + 5)
#define INT_PBUS_ARM11 (32 + 6)
#define INT_AXI_MPU_SMI (32 + 7)
#define INT_AXI_MPU_EBI1 (32 + 8)
#define INT_AD_HSSD (32 + 9)
#define INT_ARMQC_PERFMON (32 + 10)
#define INT_ARM11_DMA (32 + 11)
#define INT_TSIF_IRQ (32 + 12)
#define INT_UART1DM_IRQ (32 + 13)
#define INT_UART1DM_RX (32 + 14)
#define INT_USB_HS (32 + 15)
#define INT_SDC3_0 (32 + 16)
#define INT_SDC3_1 (32 + 17)
#define INT_SDC4_0 (32 + 18)
#define INT_SDC4_1 (32 + 19)
#define INT_UART2DM_IRQ (32 + 20)
#define INT_UART2DM_RX (32 + 21)
/* 22-31 are reserved except 7x27a*/
#if defined(CONFIG_ARCH_MSM7X27A)
#define INT_L2CC_EM (32 + 22)
#define SC_SICL2PERFMONIRPTREQ (32 + 23)
#define INT_CE_IRQ (32 + 24)
#endif
#define INT_ADSP_A11_SMSM INT_ADSP_A11
#endif
@@ -0,0 +1,304 @@
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IRQS_8064_H
#define __ASM_ARCH_MSM_IRQS_8064_H
/* MSM ACPU Interrupt Numbers */
#define INT_VGIC (GIC_PPI_START + 0)
#define INT_DEBUG_TIMER_EXP (GIC_PPI_START + 1)
#define INT_GP_TIMER_EXP (GIC_PPI_START + 2)
#define INT_GP_TIMER2_EXP (GIC_PPI_START + 3)
#define WDT0_ACCSCSSNBARK_INT (GIC_PPI_START + 4)
#define WDT1_ACCSCSSNBARK_INT (GIC_PPI_START + 5)
#define AVS_SVICINT (GIC_PPI_START + 6)
#define AVS_SVICINTSWDONE (GIC_PPI_START + 7)
#define CPU_DBGCPUXCOMMRXFULL (GIC_PPI_START + 8)
#define CPU_DBGCPUXCOMMTXEMPTY (GIC_PPI_START + 9)
#define INT_ARMQC_PERFMON (GIC_PPI_START + 10)
#define SC_AVSCPUXDOWN (GIC_PPI_START + 11)
#define SC_AVSCPUXUP (GIC_PPI_START + 12)
#define SC_SICCPUXACGIRPTREQ (GIC_PPI_START + 13)
#define SC_SICCPUXEXTFAULTIRPTREQ (GIC_PPI_START + 14)
/* PPI 15 is unused */
#define APCC_QGICACGIRPTREQ (GIC_SPI_START + 0)
#define APCC_QGICL2PERFMONIRPTREQ (GIC_SPI_START + 1)
#define SC_SICL2PERFMONIRPTREQ APCC_QGICL2PERFMONIRPTREQ
#define APCC_QGICL2IRPTREQ (GIC_SPI_START + 2)
#define APCC_QGICMPUIRPTREQ (GIC_SPI_START + 3)
#define TLMM_MSM_DIR_CONN_IRQ_0 (GIC_SPI_START + 4)
#define TLMM_MSM_DIR_CONN_IRQ_1 (GIC_SPI_START + 5)
#define TLMM_MSM_DIR_CONN_IRQ_2 (GIC_SPI_START + 6)
#define TLMM_MSM_DIR_CONN_IRQ_3 (GIC_SPI_START + 7)
#define TLMM_MSM_DIR_CONN_IRQ_4 (GIC_SPI_START + 8)
#define TLMM_MSM_DIR_CONN_IRQ_5 (GIC_SPI_START + 9)
#define TLMM_MSM_DIR_CONN_IRQ_6 (GIC_SPI_START + 10)
#define TLMM_MSM_DIR_CONN_IRQ_7 (GIC_SPI_START + 11)
#define TLMM_MSM_DIR_CONN_IRQ_8 (GIC_SPI_START + 12)
#define TLMM_MSM_DIR_CONN_IRQ_9 (GIC_SPI_START + 13)
#define PM8921_SEC_IRQ_N (GIC_SPI_START + 14)
#define PM8821_SEC_IRQ_N (GIC_SPI_START + 15)
#define TLMM_MSM_SUMMARY_IRQ (GIC_SPI_START + 16)
#define SPDM_RT_1_IRQ (GIC_SPI_START + 17)
#define SPDM_DIAG_IRQ (GIC_SPI_START + 18)
#define RPM_APCC_CPU0_GP_HIGH_IRQ (GIC_SPI_START + 19)
#define RPM_APCC_CPU0_GP_MEDIUM_IRQ (GIC_SPI_START + 20)
#define RPM_APCC_CPU0_GP_LOW_IRQ (GIC_SPI_START + 21)
#define RPM_APCC_CPU0_WAKE_UP_IRQ (GIC_SPI_START + 22)
#define RPM_APCC_CPU1_GP_HIGH_IRQ (GIC_SPI_START + 23)
#define RPM_APCC_CPU1_GP_MEDIUM_IRQ (GIC_SPI_START + 24)
#define RPM_APCC_CPU1_GP_LOW_IRQ (GIC_SPI_START + 25)
#define RPM_APCC_CPU1_WAKE_UP_IRQ (GIC_SPI_START + 26)
#define SSBI2_2_SC_CPU0_SECURE_IRQ (GIC_SPI_START + 27)
#define SSBI2_2_SC_CPU0_NON_SECURE_IRQ (GIC_SPI_START + 28)
#define SSBI2_1_SC_CPU0_SECURE_IRQ (GIC_SPI_START + 29)
#define SSBI2_1_SC_CPU0_NON_SECURE_IRQ (GIC_SPI_START + 30)
#define MSMC_SC_SEC_CE_IRQ (GIC_SPI_START + 31)
#define MSMC_SC_PRI_CE_IRQ (GIC_SPI_START + 32)
#define SLIMBUS0_CORE_EE1_IRQ (GIC_SPI_START + 33)
#define SLIMBUS0_BAM_EE1_IRQ (GIC_SPI_START + 34)
#define KPSS_SPARE_0 (GIC_SPI_START + 35)
#define GSS_A5_WDOG_EXPIRED (GIC_SPI_START + 36)
#define GSS_TO_APPS_IRQ_0 (GIC_SPI_START + 37)
#define GSS_TO_APPS_IRQ_1 (GIC_SPI_START + 38)
#define GSS_TO_APPS_IRQ_2 (GIC_SPI_START + 39)
#define GSS_TO_APPS_IRQ_3 (GIC_SPI_START + 40)
#define GSS_TO_APPS_IRQ_4 (GIC_SPI_START + 41)
#define GSS_TO_APPS_IRQ_5 (GIC_SPI_START + 42)
#define GSS_TO_APPS_IRQ_6 (GIC_SPI_START + 43)
#define GSS_TO_APPS_IRQ_7 (GIC_SPI_START + 44)
#define GSS_TO_APPS_IRQ_8 (GIC_SPI_START + 45)
#define GSS_TO_APPS_IRQ_9 (GIC_SPI_START + 46)
#define VPE_IRQ (GIC_SPI_START + 47)
#define VFE_IRQ (GIC_SPI_START + 48)
#define VCODEC_IRQ (GIC_SPI_START + 49)
#define KPSS_SPARE_1 (GIC_SPI_START + 50)
#define SMMU_VPE_CB_SC_SECURE_IRQ (GIC_SPI_START + 51)
#define SMMU_VPE_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 52)
#define SMMU_VFE_CB_SC_SECURE_IRQ (GIC_SPI_START + 53)
#define SMMU_VFE_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 54)
#define SMMU_VCODEC_B_CB_SC_SECURE_IRQ (GIC_SPI_START + 55)
#define SMMU_VCODEC_B_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 56)
#define SMMU_VCODEC_A_CB_SC_SECURE_IRQ (GIC_SPI_START + 57)
#define SMMU_VCODEC_A_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 58)
#define SMMU_ROT_CB_SC_SECURE_IRQ (GIC_SPI_START + 59)
#define SMMU_ROT_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 60)
#define SMMU_MDP1_CB_SC_SECURE_IRQ (GIC_SPI_START + 61)
#define SMMU_MDP1_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 62)
#define SMMU_MDP0_CB_SC_SECURE_IRQ (GIC_SPI_START + 63)
#define SMMU_MDP0_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 64)
#define SMMU_JPEGD_CB_SC_SECURE_IRQ (GIC_SPI_START + 65)
#define SMMU_JPEGD_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 66)
#define SMMU_IJPEG_CB_SC_SECURE_IRQ (GIC_SPI_START + 67)
#define SMMU_IJPEG_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 68)
#define SMMU_GFX3D_CB_SC_SECURE_IRQ (GIC_SPI_START + 69)
#define SMMU_GFX3D_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 70)
#define VCAP_VP (GIC_SPI_START + 71)
#define VCAP_VC (GIC_SPI_START + 72)
#define ROT_IRQ (GIC_SPI_START + 73)
#define MMSS_FABRIC_IRQ (GIC_SPI_START + 74)
#define MDP_IRQ (GIC_SPI_START + 75)
#define JPEGD_IRQ (GIC_SPI_START + 76)
#define JPEG_IRQ (GIC_SPI_START + 77)
#define MMSS_IMEM_IRQ (GIC_SPI_START + 78)
#define HDMI_IRQ (GIC_SPI_START + 79)
#define GFX3D_IRQ (GIC_SPI_START + 80)
#define GFX3d_VBIF_IRQ (GIC_SPI_START + 81)
#define DSI1_IRQ (GIC_SPI_START + 82)
#define CSI_1_IRQ (GIC_SPI_START + 83)
#define CSI_0_IRQ (GIC_SPI_START + 84)
#define LPASS_SCSS_AUDIO_IF_OUT0_IRQ (GIC_SPI_START + 85)
#define LPASS_SCSS_MIDI_IRQ (GIC_SPI_START + 86)
#define LPASS_Q6SS_WDOG_EXPIRED (GIC_SPI_START + 87)
#define LPASS_SCSS_GP_LOW_IRQ (GIC_SPI_START + 88)
#define LPASS_SCSS_GP_MEDIUM_IRQ (GIC_SPI_START + 89)
#define LPASS_SCSS_GP_HIGH_IRQ (GIC_SPI_START + 90)
#define TOP_IMEM_IRQ (GIC_SPI_START + 91)
#define FABRIC_SYS_IRQ (GIC_SPI_START + 92)
#define FABRIC_APPS_IRQ (GIC_SPI_START + 93)
#define USB1_HS_BAM_IRQ (GIC_SPI_START + 94)
#define SDC4_BAM_IRQ (GIC_SPI_START + 95)
#define SDC3_BAM_IRQ (GIC_SPI_START + 96)
#define SDC2_BAM_IRQ (GIC_SPI_START + 97)
#define SDC1_BAM_IRQ (GIC_SPI_START + 98)
#define FABRIC_SPS_IRQ (GIC_SPI_START + 99)
#define USB1_HS_IRQ (GIC_SPI_START + 100)
#define SDC4_IRQ_0 (GIC_SPI_START + 101)
#define SDC3_IRQ_0 (GIC_SPI_START + 102)
#define SDC2_IRQ_0 (GIC_SPI_START + 103)
#define SDC1_IRQ_0 (GIC_SPI_START + 104)
#define SPS_BAM_DMA_IRQ (GIC_SPI_START + 105)
#define SPS_SEC_VIOL_IRQ (GIC_SPI_START + 106)
#define SPS_MTI_0 (GIC_SPI_START + 107)
#define SPS_MTI_1 (GIC_SPI_START + 108)
#define SPS_MTI_2 (GIC_SPI_START + 109)
#define SPS_MTI_3 (GIC_SPI_START + 110)
#define SPS_MTI_4 (GIC_SPI_START + 111)
#define SPS_MTI_5 (GIC_SPI_START + 112)
#define SPS_MTI_6 (GIC_SPI_START + 113)
#define SPS_MTI_7 (GIC_SPI_START + 114)
#define SPS_MTI_8 (GIC_SPI_START + 115)
#define SPS_MTI_9 (GIC_SPI_START + 116)
#define SPS_MTI_10 (GIC_SPI_START + 117)
#define SPS_MTI_11 (GIC_SPI_START + 118)
#define SPS_MTI_12 (GIC_SPI_START + 119)
#define SPS_MTI_13 (GIC_SPI_START + 120)
#define SPS_MTI_14 (GIC_SPI_START + 121)
#define SPS_MTI_15 (GIC_SPI_START + 122)
#define SPS_MTI_16 (GIC_SPI_START + 123)
#define SPS_MTI_17 (GIC_SPI_START + 124)
#define SPS_MTI_18 (GIC_SPI_START + 125)
#define SPS_MTI_19 (GIC_SPI_START + 126)
#define SPS_MTI_20 (GIC_SPI_START + 127)
#define SPS_MTI_21 (GIC_SPI_START + 128)
#define SPS_MTI_22 (GIC_SPI_START + 129)
#define SPS_MTI_23 (GIC_SPI_START + 130)
#define SPS_MTI_24 (GIC_SPI_START + 131)
#define SPS_MTI_25 (GIC_SPI_START + 132)
#define SPS_MTI_26 (GIC_SPI_START + 133)
#define SPS_MTI_27 (GIC_SPI_START + 134)
#define SPS_MTI_28 (GIC_SPI_START + 135)
#define SPS_MTI_29 (GIC_SPI_START + 136)
#define SPS_MTI_30 (GIC_SPI_START + 137)
#define SPS_MTI_31 (GIC_SPI_START + 138)
#define CSIPHY_0_4LN_IRQ (GIC_SPI_START + 139)
#define CSIPHY_1_2LN_IRQ (GIC_SPI_START + 140)
#define KPSS_SPARE_2 (GIC_SPI_START + 141)
#define USB1_IRQ (GIC_SPI_START + 142)
#define TSSC_SSBI_IRQ (GIC_SPI_START + 143)
#define TSSC_SAMPLE_IRQ (GIC_SPI_START + 144)
#define TSSC_PENUP_IRQ (GIC_SPI_START + 145)
#define KPSS_SPARE_3 (GIC_SPI_START + 146)
#define KPSS_SPARE_4 (GIC_SPI_START + 147)
#define KPSS_SPARE_5 (GIC_SPI_START + 148)
#define KPSS_SPARE_6 (GIC_SPI_START + 149)
#define GSBI3_UARTDM_IRQ (GIC_SPI_START + 150)
#define GSBI3_QUP_IRQ (GIC_SPI_START + 151)
#define GSBI4_UARTDM_IRQ (GIC_SPI_START + 152)
#define GSBI4_QUP_IRQ (GIC_SPI_START + 153)
#define GSBI5_UARTDM_IRQ (GIC_SPI_START + 154)
#define GSBI5_QUP_IRQ (GIC_SPI_START + 155)
#define GSBI6_UARTDM_IRQ (GIC_SPI_START + 156)
#define GSBI6_QUP_IRQ (GIC_SPI_START + 157)
#define GSBI7_UARTDM_IRQ (GIC_SPI_START + 158)
#define GSBI7_QUP_IRQ (GIC_SPI_START + 159)
#define KPSS_SPARE_7 (GIC_SPI_START + 160)
#define KPSS_SPARE_8 (GIC_SPI_START + 161)
#define TSIF_TSPP_IRQ (GIC_SPI_START + 162)
#define TSIF_BAM_IRQ (GIC_SPI_START + 163)
#define TSIF2_IRQ (GIC_SPI_START + 164)
#define TSIF1_IRQ (GIC_SPI_START + 165)
#define DSI2_IRQ (GIC_SPI_START + 166)
#define ISPIF_IRQ (GIC_SPI_START + 167)
#define MSMC_SC_SEC_TMR_IRQ (GIC_SPI_START + 168)
#define MSMC_SC_SEC_WDOG_BARK_IRQ (GIC_SPI_START + 169)
#define ADM_0_SCSS_0_IRQ (GIC_SPI_START + 170)
#define ADM_0_SCSS_1_IRQ (GIC_SPI_START + 171)
#define ADM_0_SCSS_2_IRQ (GIC_SPI_START + 172)
#define ADM_0_SCSS_3_IRQ (GIC_SPI_START + 173)
#define CC_SCSS_WDT1CPU1BITEEXPIRED (GIC_SPI_START + 174)
#define CC_SCSS_WDT1CPU0BITEEXPIRED (GIC_SPI_START + 175)
#define CC_SCSS_WDT0CPU1BITEEXPIRED (GIC_SPI_START + 176)
#define CC_SCSS_WDT0CPU0BITEEXPIRED (GIC_SPI_START + 177)
#define TSENS_UPPER_LOWER_INT (GIC_SPI_START + 178)
#define SSBI2_2_SC_CPU1_SECURE_INT (GIC_SPI_START + 179)
#define SSBI2_2_SC_CPU1_NON_SECURE_INT (GIC_SPI_START + 180)
#define SSBI2_1_SC_CPU1_SECURE_INT (GIC_SPI_START + 181)
#define SSBI2_1_SC_CPU1_NON_SECURE_INT (GIC_SPI_START + 182)
#define XPU_SUMMARY_IRQ (GIC_SPI_START + 183)
#define BUS_EXCEPTION_SUMMARY_IRQ (GIC_SPI_START + 184)
#define HSDDRX_EBI1CH0_IRQ (GIC_SPI_START + 185)
#define HSDDRX_EBI1CH1_IRQ (GIC_SPI_START + 186)
#define USB3_HS_BAM_IRQ (GIC_SPI_START + 187)
#define USB3_HS_IRQ (GIC_SPI_START + 188)
#define CC_SCSS_WDT1CPU3BITEEXPIRED (GIC_SPI_START + 189)
#define CC_SCSS_WDT1CPU2BITEEXPIRED (GIC_SPI_START + 190)
#define CC_SCSS_WDT0CPU3BITEEXPIRED (GIC_SPI_START + 191)
#define CC_SCSS_WDT0CPU2BITEEXPIRED (GIC_SPI_START + 192)
#define APQ8064_GSBI1_UARTDM_IRQ (GIC_SPI_START + 193)
#define APQ8064_GSBI1_QUP_IRQ (GIC_SPI_START + 194)
#define APQ8064_GSBI2_UARTDM_IRQ (GIC_SPI_START + 195)
#define APQ8064_GSBI2_QUP_IRQ (GIC_SPI_START + 196)
#define RIVA_APSS_LTECOEX_IRQ (GIC_SPI_START + 197)
#define RIVA_APSS_SPARE_IRQ (GIC_SPI_START + 198)
#define RIVA_APSS_WDOG_BITE_RESET_RDY_IRQ (GIC_SPI_START + 199)
#define RIVA_APSS_RESET_DONE_IRQ (GIC_SPI_START + 200)
#define RIVA_APSS_ASIC_IRQ (GIC_SPI_START + 201)
#define RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ (GIC_SPI_START + 202)
#define RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ (GIC_SPI_START + 203)
#define RIVA_APPS_WLAN_SMSM_IRQ (GIC_SPI_START + 204)
#define RIVA_APPS_LOG_CTRL_IRQ (GIC_SPI_START + 205)
#define RIVA_APPS_FM_CTRL_IRQ (GIC_SPI_START + 206)
#define RIVA_APPS_HCI_IRQ (GIC_SPI_START + 207)
#define RIVA_APPS_WLAN_CTRL_IRQ (GIC_SPI_START + 208)
#define SATA_CONTROLLER_IRQ (GIC_SPI_START + 209)
#define SMMU_GFX3D1_CB_SC_SECURE_IRQ (GIC_SPI_START + 210)
#define SMMU_GFX3D1_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 211)
#define KPSS_SPARE_9 (GIC_SPI_START + 212)
#define PPSS_WDOG_TIMER_IRQ (GIC_SPI_START + 213)
#define USB4_HS_BAM_IRQ (GIC_SPI_START + 214)
#define USB4_HS_IRQ (GIC_SPI_START + 215)
#define QDSS_ETB_IRQ (GIC_SPI_START + 216)
#define QDSS_CTI2KPSS_CPU1_IRQ (GIC_SPI_START + 217)
#define QDSS_CTI2KPSS_CPU0_IRQ (GIC_SPI_START + 218)
#define TLMM_MSM_DIR_CONN_IRQ_16 (GIC_SPI_START + 219)
#define TLMM_MSM_DIR_CONN_IRQ_17 (GIC_SPI_START + 220)
#define TLMM_MSM_DIR_CONN_IRQ_18 (GIC_SPI_START + 221)
#define TLMM_MSM_DIR_CONN_IRQ_19 (GIC_SPI_START + 222)
#define TLMM_MSM_DIR_CONN_IRQ_20 (GIC_SPI_START + 223)
#define TLMM_MSM_DIR_CONN_IRQ_21 (GIC_SPI_START + 224)
#define PM8921_USR_IRQ_N (GIC_SPI_START + 225)
#define PM8821_USR_IRQ_N (GIC_SPI_START + 226)
#define CSI_2_IRQ (GIC_SPI_START + 227)
#define APQ8064_CSIPHY_2LN_IRQ (GIC_SPI_START + 228)
#define USB2_HSIC_IRQ (GIC_SPI_START + 229)
#define CE2_BAM_XPU_IRQ (GIC_SPI_START + 230)
#define CE1_BAM_XPU_IRQ (GIC_SPI_START + 231)
#define RPM_SCSS_CPU2_WAKE_UP_IRQ (GIC_SPI_START + 232)
#define RPM_SCSS_CPU3_WAKE_UP_IRQ (GIC_SPI_START + 233)
#define CS3_BAM_XPU_IRQ (GIC_SPI_START + 234)
#define CE3_IRQ (GIC_SPI_START + 235)
#define SMMU_VCAP_CB_SC_SECURE_IRQ (GIC_SPI_START + 236)
#define SMMU_VCAP_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 237)
#define PCIE20_INT_MSI (GIC_SPI_START + 238)
#define PCIE20_INTA (GIC_SPI_START + 239)
#define PCIE20_INTB (GIC_SPI_START + 240)
#define PCIE20_INTC (GIC_SPI_START + 241)
#define PCIE20_INTD (GIC_SPI_START + 242)
#define PCIE20_INT_PLS_HP (GIC_SPI_START + 243)
#define PCIE20_INT_PLS_ERR (GIC_SPI_START + 244)
#define PCIE20_INT_PLS_PME (GIC_SPI_START + 245)
#define PCIE20_INT_LINK_UP (GIC_SPI_START + 246)
#define PCIE20_INT_LINK_DOWN (GIC_SPI_START + 247)
#define PCIE20_INT_HP_LEGACY (GIC_SPI_START + 248)
#define PCIE20_INT_AER_LEGACY (GIC_SPI_START + 249)
#define PCIE20_INT_PME_LEGACY (GIC_SPI_START + 250)
#define PCIE20_INT_BRIDGE_FLUSH_N (GIC_SPI_START + 251)
/* Backwards compatible IRQ macros. */
#define INT_ADM_AARM ADM_0_SCSS_0_IRQ
/* smd/smsm interrupts */
#define INT_A9_M2A_0 (GIC_SPI_START + 37) /*GSS_TO_APPS_IRQ_0*/
#define INT_A9_M2A_5 (GIC_SPI_START + 38) /*GSS_TO_APPS_IRQ_1*/
#define INT_ADSP_A11 LPASS_SCSS_GP_HIGH_IRQ
#define INT_ADSP_A11_SMSM LPASS_SCSS_GP_MEDIUM_IRQ
#define INT_DSPS_A11 SPS_MTI_31
#define INT_DSPS_A11_SMSM SPS_MTI_30
#define INT_WCNSS_A11 RIVA_APSS_SPARE_IRQ
#define INT_WCNSS_A11_SMSM RIVA_APPS_WLAN_SMSM_IRQ
#endif
@@ -0,0 +1,26 @@
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IRQS_8092_H
#define __ASM_ARCH_MSM_IRQS_8092_H
/* MSM ACPU Interrupt Numbers */
#define INT_ARMQC_PERFMON (GIC_PPI_START + 10)
/* PPI 15 is unused */
#define APCC_QGICL2PERFMONIRPTREQ (GIC_SPI_START + 1)
#define SC_SICL2PERFMONIRPTREQ APCC_QGICL2PERFMONIRPTREQ
#define TLMM_MSM_SUMMARY_IRQ (GIC_SPI_START + 208)
#endif
@@ -0,0 +1,95 @@
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IRQS_8625_H
#define __ASM_ARCH_MSM_IRQS_8625_H
#ifdef CONFIG_MSM_FIQ
#define FIQ_START 0
#endif
/* As per QGIC2 PPI 16 aka 0 is reserved */
#define MSM8625_INT_ARMQC_PERFMON (GIC_PPI_START + 1)
#define MSM8625_INT_DEBUG_TIMER_EXP (GIC_PPI_START + 2)
#define MSM8625_INT_GP_TIMER_EXP (GIC_PPI_START + 3)
#define MSM8625_INT_COMMRX (GIC_PPI_START + 4)
#define MSM8625_INT_COMMTX (GIC_PPI_START + 5)
/* rest of the PPI's not used
*/
#define MSM8625_INT_A9_M2A_0 (GIC_SPI_START + 0)
#define MSM8625_INT_A9_M2A_1 (GIC_SPI_START + 1)
#define MSM8625_INT_A9_M2A_2 (GIC_SPI_START + 2)
#define MSM8625_INT_A9_M2A_3 (GIC_SPI_START + 3)
#define MSM8625_INT_A9_M2A_4 (GIC_SPI_START + 4)
#define MSM8625_INT_A9_M2A_5 (GIC_SPI_START + 5)
#define MSM8625_INT_A9_M2A_6 (GIC_SPI_START + 6)
#define MSM8625_INT_ACSR_MP_CORE_IPC0 (GIC_SPI_START + 7)
#define MSM8625_INT_ACSR_MP_CORE_IPC1 (GIC_SPI_START + 8)
#define MSM8625_INT_UART1 (GIC_SPI_START + 9)
#define MSM8625_INT_UART2 (GIC_SPI_START + 10)
#define MSM8625_INT_UART3 (GIC_SPI_START + 11)
#define MSM8625_INT_UART1_RX (GIC_SPI_START + 12)
#define MSM8625_INT_UART2_RX (GIC_SPI_START + 13)
#define MSM8625_INT_UART3_RX (GIC_SPI_START + 14)
#define MSM8625_INT_USB_OTG (GIC_SPI_START + 15)
#define MSM8625_INT_DSI_IRQ (GIC_SPI_START + 16)
#define MSM8625_INT_CSI_IRQ_1 (GIC_SPI_START + 17)
#define MSM8625_INT_CSI_IRQ_0 (GIC_SPI_START + 18)
#define MSM8625_INT_MDP (GIC_SPI_START + 19)
#define MSM8625_INT_GRAPHICS (GIC_SPI_START + 20)
#define MSM8625_INT_ADM_AARM (GIC_SPI_START + 21)
#define MSM8625_INT_ADSP_A11 (GIC_SPI_START + 22)
#define MSM8625_INT_ADSP_A9_A11 (GIC_SPI_START + 23)
#define MSM8625_INT_SDC1_0 (GIC_SPI_START + 24)
#define MSM8625_INT_SDC1_1 (GIC_SPI_START + 25)
#define MSM8625_INT_SDC2_0 (GIC_SPI_START + 26)
#define MSM8625_INT_SDC2_1 (GIC_SPI_START + 27)
#define MSM8625_INT_KEYSENSE (GIC_SPI_START + 28)
#define MSM8625_INT_TCHSCRN_SSBI (GIC_SPI_START + 29)
#define MSM8625_INT_TCHSCRN1 (GIC_SPI_START + 30)
#define MSM8625_INT_TCHSCRN2 (GIC_SPI_START + 31)
#define MSM8625_INT_GPIO_GROUP1 (GIC_SPI_START + 32 + 0)
#define MSM8625_INT_GPIO_GROUP2 (GIC_SPI_START + 32 + 1)
#define MSM8625_INT_PWB_I2C (GIC_SPI_START + 32 + 2)
#define MSM8625_INT_SOFTRESET (GIC_SPI_START + 32 + 3)
#define MSM8625_INT_NAND_WR_ER_DONE (GIC_SPI_START + 32 + 4)
#define MSM8625_INT_NAND_OP_DONE (GIC_SPI_START + 32 + 5)
#define MSM8625_INT_PBUS_ARM11 (GIC_SPI_START + 32 + 6)
#define MSM8625_INT_AXI_MPU_SMI (GIC_SPI_START + 32 + 7)
#define MSM8625_INT_AXI_MPU_EBI1 (GIC_SPI_START + 32 + 8)
#define MSM8625_INT_AD_HSSD (GIC_SPI_START + 32 + 9)
#define MSM8625_INT_NOTUSED (GIC_SPI_START + 32 + 10)
#define MSM8625_INT_ARM11_DMA (GIC_SPI_START + 32 + 11)
#define MSM8625_INT_TSIF_IRQ (GIC_SPI_START + 32 + 12)
#define MSM8625_INT_UART1DM_IRQ (GIC_SPI_START + 32 + 13)
#define MSM8625_INT_UART1DM_RX (GIC_SPI_START + 32 + 14)
#define MSM8625_INT_USB_HS (GIC_SPI_START + 32 + 15)
#define MSM8625_INT_SDC3_0 (GIC_SPI_START + 32 + 16)
#define MSM8625_INT_SDC3_1 (GIC_SPI_START + 32 + 17)
#define MSM8625_INT_SDC4_0 (GIC_SPI_START + 32 + 18)
#define MSM8625_INT_SDC4_1 (GIC_SPI_START + 32 + 19)
#define MSM8625_INT_UART2DM_IRQ (GIC_SPI_START + 32 + 20)
#define MSM8625_INT_UART2DM_RX (GIC_SPI_START + 32 + 21)
#define MSM8625_INT_L2CC_EM (GIC_SPI_START + 32 + 22)
#define MSM8625_INT_SC_SICL2PERFMONIRPTREQ (GIC_SPI_START + 32 + 23)
#define MSM8625_INT_CE_IRQ (GIC_SPI_START + 32 + 24)
#define MSM8625_INT_CPR_IRQ0 (GIC_SPI_START + 32 + 25)
#define MSM8625_INT_CPR_IRQ1 (GIC_SPI_START + 32 + 26)
#define MSM8625_INT_CPR_IRQ2 (GIC_SPI_START + 32 + 27)
#define MSM8625_INT_ACSR_MP_CORE_IPC2 (GIC_SPI_START + 32 + 28)
#define MSM8625_INT_ACSR_MP_CORE_IPC3 (GIC_SPI_START + 32 + 29)
#define MSM8625_INT_ADSP_A11_SMSM MSM8625_INT_ADSP_A11
#endif
@@ -0,0 +1,285 @@
/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IRQS_8930_H
#define __ASM_ARCH_MSM_IRQS_8930_H
/* MSM ACPU Interrupt Numbers */
#define INT_VGIC (GIC_PPI_START + 0)
#define INT_DEBUG_TIMER_EXP (GIC_PPI_START + 1)
#define INT_GP_TIMER_EXP (GIC_PPI_START + 2)
#define INT_GP_TIMER2_EXP (GIC_PPI_START + 3)
#define WDT0_ACCSCSSNBARK_INT (GIC_PPI_START + 4)
#define WDT1_ACCSCSSNBARK_INT (GIC_PPI_START + 5)
#define AVS_SVICINT (GIC_PPI_START + 6)
#define AVS_SVICINTSWDONE (GIC_PPI_START + 7)
#define CPU_DBGCPUXCOMMRXFULL (GIC_PPI_START + 8)
#define CPU_DBGCPUXCOMMTXEMPTY (GIC_PPI_START + 9)
#define INT_ARMQC_PERFMON (GIC_PPI_START + 10)
#define SC_AVSCPUXDOWN (GIC_PPI_START + 11)
#define SC_AVSCPUXUP (GIC_PPI_START + 12)
#define SC_SICCPUXACGIRPTREQ (GIC_PPI_START + 13)
#define SC_SICCPUXEXTFAULTIRPTREQ (GIC_PPI_START + 14)
/* PPI 15 is unused */
#define APCC_QGICACGIRPTREQ (GIC_SPI_START + 0)
#define APCC_QGICL2PERFMONIRPTREQ (GIC_SPI_START + 1)
#define SC_SICL2PERFMONIRPTREQ APCC_QGICL2PERFMONIRPTREQ
#define APCC_QGICL2IRPTREQ (GIC_SPI_START + 2)
#define APCC_QGICMPUIRPTREQ (GIC_SPI_START + 3)
#define TLMM_MSM_DIR_CONN_IRQ_0 (GIC_SPI_START + 4)
#define TLMM_MSM_DIR_CONN_IRQ_1 (GIC_SPI_START + 5)
#define TLMM_MSM_DIR_CONN_IRQ_2 (GIC_SPI_START + 6)
#define TLMM_MSM_DIR_CONN_IRQ_3 (GIC_SPI_START + 7)
#define TLMM_MSM_DIR_CONN_IRQ_4 (GIC_SPI_START + 8)
#define TLMM_MSM_DIR_CONN_IRQ_5 (GIC_SPI_START + 9)
#define TLMM_MSM_DIR_CONN_IRQ_6 (GIC_SPI_START + 10)
#define TLMM_MSM_DIR_CONN_IRQ_7 (GIC_SPI_START + 11)
#define TLMM_MSM_DIR_CONN_IRQ_8 (GIC_SPI_START + 12)
#define TLMM_MSM_DIR_CONN_IRQ_9 (GIC_SPI_START + 13)
#define PM8921_SEC_IRQ_103 (GIC_SPI_START + 14)
#define PM8018_SEC_IRQ_106 (GIC_SPI_START + 15)
#define TLMM_MSM_SUMMARY_IRQ (GIC_SPI_START + 16)
#define SPDM_RT_1_IRQ (GIC_SPI_START + 17)
#define SPDM_DIAG_IRQ (GIC_SPI_START + 18)
#define RPM_APCC_CPU0_GP_HIGH_IRQ (GIC_SPI_START + 19)
#define RPM_APCC_CPU0_GP_MEDIUM_IRQ (GIC_SPI_START + 20)
#define RPM_APCC_CPU0_GP_LOW_IRQ (GIC_SPI_START + 21)
#define RPM_APCC_CPU0_WAKE_UP_IRQ (GIC_SPI_START + 22)
#define RPM_APCC_CPU1_GP_HIGH_IRQ (GIC_SPI_START + 23)
#define RPM_APCC_CPU1_GP_MEDIUM_IRQ (GIC_SPI_START + 24)
#define RPM_APCC_CPU1_GP_LOW_IRQ (GIC_SPI_START + 25)
#define RPM_APCC_CPU1_WAKE_UP_IRQ (GIC_SPI_START + 26)
#define SSBI2_2_SC_CPU0_SECURE_IRQ (GIC_SPI_START + 27)
#define SSBI2_2_SC_CPU0_NON_SECURE_IRQ (GIC_SPI_START + 28)
#define SSBI2_1_SC_CPU0_SECURE_IRQ (GIC_SPI_START + 29)
#define SSBI2_1_SC_CPU0_NON_SECURE_IRQ (GIC_SPI_START + 30)
#define MSMC_SC_SEC_CE_IRQ (GIC_SPI_START + 31)
#define MSMC_SC_PRI_CE_IRQ (GIC_SPI_START + 32)
#define SLIMBUS0_CORE_EE1_IRQ (GIC_SPI_START + 33)
#define SLIMBUS0_BAM_EE1_IRQ (GIC_SPI_START + 34)
#define Q6FW_WDOG_EXPIRED_IRQ (GIC_SPI_START + 35)
#define Q6SW_WDOG_EXPIRED_IRQ (GIC_SPI_START + 36)
#define MSS_TO_APPS_IRQ_0 (GIC_SPI_START + 37)
#define MSS_TO_APPS_IRQ_1 (GIC_SPI_START + 38)
#define MSS_TO_APPS_IRQ_2 (GIC_SPI_START + 39)
#define MSS_TO_APPS_IRQ_3 (GIC_SPI_START + 40)
#define MSS_TO_APPS_IRQ_4 (GIC_SPI_START + 41)
#define MSS_TO_APPS_IRQ_5 (GIC_SPI_START + 42)
#define MSS_TO_APPS_IRQ_6 (GIC_SPI_START + 43)
#define MSS_TO_APPS_IRQ_7 (GIC_SPI_START + 44)
#define MSS_TO_APPS_IRQ_8 (GIC_SPI_START + 45)
#define MSS_TO_APPS_IRQ_9 (GIC_SPI_START + 46)
#define VPE_IRQ (GIC_SPI_START + 47)
#define VFE_IRQ (GIC_SPI_START + 48)
#define VCODEC_IRQ (GIC_SPI_START + 49)
/* SPI IRQ 50 is unused */
#define SMMU_VPE_CB_SC_SECURE_IRQ (GIC_SPI_START + 51)
#define SMMU_VPE_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 52)
#define SMMU_VFE_CB_SC_SECURE_IRQ (GIC_SPI_START + 53)
#define SMMU_VFE_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 54)
#define SMMU_VCODEC_B_CB_SC_SECURE_IRQ (GIC_SPI_START + 55)
#define SMMU_VCODEC_B_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 56)
#define SMMU_VCODEC_A_CB_SC_SECURE_IRQ (GIC_SPI_START + 57)
#define SMMU_VCODEC_A_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 58)
#define SMMU_ROT_CB_SC_SECURE_IRQ (GIC_SPI_START + 59)
#define SMMU_ROT_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 60)
#define SMMU_MDP1_CB_SC_SECURE_IRQ (GIC_SPI_START + 61)
#define SMMU_MDP1_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 62)
#define SMMU_MDP0_CB_SC_SECURE_IRQ (GIC_SPI_START + 63)
#define SMMU_MDP0_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 64)
/* SPI IRQ 65 is unused */
/* SPI IRQ 66 is unused */
#define SMMU_IJPEG_CB_SC_SECURE_IRQ (GIC_SPI_START + 67)
#define SMMU_IJPEG_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 68)
#define SMMU_GFX3D_CB_SC_SECURE_IRQ (GIC_SPI_START + 69)
#define SMMU_GFX3D_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 70)
/* SPI IRQ 71 is unused */
/* SPI IRQ 72 is unused */
#define ROT_IRQ (GIC_SPI_START + 73)
#define MMSS_FABRIC_IRQ (GIC_SPI_START + 74)
#define MDP_IRQ (GIC_SPI_START + 75)
/* SPI IRQ 76 is unused */
#define JPEG_IRQ (GIC_SPI_START + 77)
#define MMSS_IMEM_IRQ (GIC_SPI_START + 78)
#define HDMI_IRQ (GIC_SPI_START + 79)
#define GFX3D_IRQ (GIC_SPI_START + 80)
/* SPI IRQ 81 is unused */
#define DSI1_IRQ (GIC_SPI_START + 82)
#define CSI_1_IRQ (GIC_SPI_START + 83)
#define CSI_0_IRQ (GIC_SPI_START + 84)
#define LPASS_SCSS_AUDIO_IF_OUT0_IRQ (GIC_SPI_START + 85)
#define LPASS_SCSS_MIDI_IRQ (GIC_SPI_START + 86)
#define LPASS_Q6SS_WDOG_EXPIRED (GIC_SPI_START + 87)
#define LPASS_SCSS_GP_LOW_IRQ (GIC_SPI_START + 88)
#define LPASS_SCSS_GP_MEDIUM_IRQ (GIC_SPI_START + 89)
#define LPASS_SCSS_GP_HIGH_IRQ (GIC_SPI_START + 90)
#define TOP_IMEM_IRQ (GIC_SPI_START + 91)
#define FABRIC_SYS_IRQ (GIC_SPI_START + 92)
#define FABRIC_APPS_IRQ (GIC_SPI_START + 93)
#define USB1_HS_BAM_IRQ (GIC_SPI_START + 94)
#define SDC4_BAM_IRQ (GIC_SPI_START + 95)
#define SDC3_BAM_IRQ (GIC_SPI_START + 96)
#define SDC2_BAM_IRQ (GIC_SPI_START + 97)
#define SDC1_BAM_IRQ (GIC_SPI_START + 98)
#define FABRIC_SPS_IRQ (GIC_SPI_START + 99)
#define USB1_HS_IRQ (GIC_SPI_START + 100)
#define SDC4_IRQ_0 (GIC_SPI_START + 101)
#define SDC3_IRQ_0 (GIC_SPI_START + 102)
#define SDC2_IRQ_0 (GIC_SPI_START + 103)
#define SDC1_IRQ_0 (GIC_SPI_START + 104)
#define SPS_BAM_DMA_IRQ (GIC_SPI_START + 105)
#define SPS_SEC_VIOL_IRQ (GIC_SPI_START + 106)
#define SPS_MTI_0 (GIC_SPI_START + 107)
#define SPS_MTI_1 (GIC_SPI_START + 108)
#define SPS_MTI_2 (GIC_SPI_START + 109)
#define SPS_MTI_3 (GIC_SPI_START + 110)
#define GPS_PPS_OUT (GIC_SPI_START + 111)
/* SPI IRQ 112 is unused */
/* SPI IRQ 113 is unused */
/* SPI IRQ 114 is unused */
/* SPI IRQ 115 is unused */
#define TLMM_MSM_DIR_CONN_IRQ_11 (GIC_SPI_START + 116)
#define TLMM_MSM_DIR_CONN_IRQ_10 (GIC_SPI_START + 117)
#define BAM_DMA1 (GIC_SPI_START + 118)
#define BAM_DMA2 (GIC_SPI_START + 119)
#define SDC1_IRQ (GIC_SPI_START + 120)
#define SDC2_IRQ (GIC_SPI_START + 121)
#define SDC3_IRQ (GIC_SPI_START + 122)
#define SPS_MTI_16 (GIC_SPI_START + 123)
#define SPS_MTI_17 (GIC_SPI_START + 124)
#define SPS_MTI_18 (GIC_SPI_START + 125)
#define SPS_MTI_19 (GIC_SPI_START + 126)
#define SPS_MTI_20 (GIC_SPI_START + 127)
#define SPS_MTI_21 (GIC_SPI_START + 128)
#define SPS_MTI_22 (GIC_SPI_START + 129)
#define SPS_MTI_23 (GIC_SPI_START + 130)
#define SPS_MTI_24 (GIC_SPI_START + 131)
#define SPS_MTI_25 (GIC_SPI_START + 132)
#define SPS_MTI_26 (GIC_SPI_START + 133)
#define SPS_MTI_27 (GIC_SPI_START + 134)
#define SPS_MTI_28 (GIC_SPI_START + 135)
#define SPS_MTI_29 (GIC_SPI_START + 136)
#define SPS_MTI_30 (GIC_SPI_START + 137)
#define SPS_MTI_31 (GIC_SPI_START + 138)
#define CSIPHY_4LN_IRQ (GIC_SPI_START + 139)
#define MSM8930_CSIPHY_2LN_IRQ (GIC_SPI_START + 140)
#define USB2_IRQ (GIC_SPI_START + 141)
#define USB1_IRQ (GIC_SPI_START + 142)
#define TSSC_SSBI_IRQ (GIC_SPI_START + 143)
#define TSSC_SAMPLE_IRQ (GIC_SPI_START + 144)
#define TSSC_PENUP_IRQ (GIC_SPI_START + 145)
#define MSM8930_GSBI1_UARTDM_IRQ (GIC_SPI_START + 146)
#define MSM8930_GSBI1_QUP_IRQ (GIC_SPI_START + 147)
#define MSM8930_GSBI2_UARTDM_IRQ (GIC_SPI_START + 148)
#define MSM8930_GSBI2_QUP_IRQ (GIC_SPI_START + 149)
#define GSBI3_UARTDM_IRQ (GIC_SPI_START + 150)
#define GSBI3_QUP_IRQ (GIC_SPI_START + 151)
#define GSBI4_UARTDM_IRQ (GIC_SPI_START + 152)
#define GSBI4_QUP_IRQ (GIC_SPI_START + 153)
#define GSBI5_UARTDM_IRQ (GIC_SPI_START + 154)
#define GSBI5_QUP_IRQ (GIC_SPI_START + 155)
#define GSBI6_UARTDM_IRQ (GIC_SPI_START + 156)
#define GSBI6_QUP_IRQ (GIC_SPI_START + 157)
#define GSBI7_UARTDM_IRQ (GIC_SPI_START + 158)
#define GSBI7_QUP_IRQ (GIC_SPI_START + 159)
#define GSBI8_UARTDM_IRQ (GIC_SPI_START + 160)
#define GSBI8_QUP_IRQ (GIC_SPI_START + 161)
#define TSIF_TSPP_IRQ (GIC_SPI_START + 162)
#define TSIF_BAM_IRQ (GIC_SPI_START + 163)
#define TSIF2_IRQ (GIC_SPI_START + 164)
#define TSIF1_IRQ (GIC_SPI_START + 165)
/* SPI IRQ 166 is unused */
#define ISPIF_IRQ (GIC_SPI_START + 167)
#define MSMC_SC_SEC_TMR_IRQ (GIC_SPI_START + 168)
#define MSMC_SC_SEC_WDOG_BARK_IRQ (GIC_SPI_START + 169)
#define ADM_0_SCSS_0_IRQ (GIC_SPI_START + 170)
#define ADM_0_SCSS_1_IRQ (GIC_SPI_START + 171)
#define ADM_0_SCSS_2_IRQ (GIC_SPI_START + 172)
#define ADM_0_SCSS_3_IRQ (GIC_SPI_START + 173)
#define CC_SCSS_WDT1CPU1BITEEXPIRED (GIC_SPI_START + 174)
#define CC_SCSS_WDT1CPU0BITEEXPIRED (GIC_SPI_START + 175)
#define CC_SCSS_WDT0CPU1BITEEXPIRED (GIC_SPI_START + 176)
#define CC_SCSS_WDT0CPU0BITEEXPIRED (GIC_SPI_START + 177)
#define TSENS_UPPER_LOWER_INT (GIC_SPI_START + 178)
#define SSBI2_2_SC_CPU1_SECURE_INT (GIC_SPI_START + 179)
#define SSBI2_2_SC_CPU1_NON_SECURE_INT (GIC_SPI_START + 180)
#define SSBI2_1_SC_CPU1_SECURE_INT (GIC_SPI_START + 181)
#define SSBI2_1_SC_CPU1_NON_SECURE_INT (GIC_SPI_START + 182)
#define XPU_SUMMARY_IRQ (GIC_SPI_START + 183)
#define BUS_EXCEPTION_SUMMARY_IRQ (GIC_SPI_START + 184)
#define HSDDRX_EBI1CH0_IRQ (GIC_SPI_START + 185)
/* SPI IRQ 186 is unused */
#define SDC5_BAM_IRQ (GIC_SPI_START + 187)
#define SDC5_IRQ_0 (GIC_SPI_START + 188)
#define GSBI9_UARTDM_IRQ (GIC_SPI_START + 189)
#define GSBI9_QUP_IRQ (GIC_SPI_START + 190)
#define GSBI10_UARTDM_IRQ (GIC_SPI_START + 191)
#define GSBI10_QUP_IRQ (GIC_SPI_START + 192)
#define GSBI11_UARTDM_IRQ (GIC_SPI_START + 193)
#define GSBI11_QUP_IRQ (GIC_SPI_START + 194)
#define GSBI12_UARTDM_IRQ (GIC_SPI_START + 195)
#define GSBI12_QUP_IRQ (GIC_SPI_START + 196)
#define RIVA_APSS_LTECOEX_IRQ (GIC_SPI_START + 197)
#define RIVA_APSS_SPARE_IRQ (GIC_SPI_START + 198)
#define RIVA_APSS_WDOG_BITE_RESET_RDY_IRQ (GIC_SPI_START + 199)
#define RIVA_APSS_RESET_DONE_IRQ (GIC_SPI_START + 200)
#define RIVA_APSS_ASIC_IRQ (GIC_SPI_START + 201)
#define RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ (GIC_SPI_START + 202)
#define RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ (GIC_SPI_START + 203)
#define RIVA_APPS_WLAN_SMSM_IRQ (GIC_SPI_START + 204)
#define RIVA_APPS_LOG_CTRL_IRQ (GIC_SPI_START + 205)
#define RIVA_APPS_FM_CTRL_IRQ (GIC_SPI_START + 206)
#define RIVA_APPS_HCI_IRQ (GIC_SPI_START + 207)
#define RIVA_APPS_WLAN_CTRL_IRQ (GIC_SPI_START + 208)
#define A2_BAM_IRQ (GIC_SPI_START + 209)
/* SPI IRQ 210 is unused */
/* SPI IRQ 211 is unused */
/* SPI IRQ 212 is unused */
#define PPSS_WDOG_TIMER_IRQ (GIC_SPI_START + 213)
#define SPS_SLIMBUS_CORE_EE0_IRQ (GIC_SPI_START + 214)
#define SPS_SLIMBUS_BAM_EE0_IRQ (GIC_SPI_START + 215)
#define QDSS_ETB_IRQ (GIC_SPI_START + 216)
#define QDSS_CTI2KPSS_CPU1_IRQ (GIC_SPI_START + 217)
#define QDSS_CTI2KPSS_CPU0_IRQ (GIC_SPI_START + 218)
#define TLMM_MSM_DIR_CONN_IRQ_16 (GIC_SPI_START + 219)
#define TLMM_MSM_DIR_CONN_IRQ_17 (GIC_SPI_START + 220)
#define TLMM_MSM_DIR_CONN_IRQ_18 (GIC_SPI_START + 221)
#define TLMM_MSM_DIR_CONN_IRQ_19 (GIC_SPI_START + 222)
#define TLMM_MSM_DIR_CONN_IRQ_20 (GIC_SPI_START + 223)
#define TLMM_MSM_DIR_CONN_IRQ_21 (GIC_SPI_START + 224)
#define PM8921_SEC_IRQ_104 (GIC_SPI_START + 225)
#define PM8018_SEC_IRQ_107 (GIC_SPI_START + 226)
#define USB_HSIC_IRQ (GIC_SPI_START + 229)
#define CE2_BAM_XPU_IRQ (GIC_SPI_START + 230)
#define CE1_BAM_XPU_IRQ (GIC_SPI_START + 231)
#define GFX3D_VBIF_IRPT (GIC_SPI_START + 232)
#define RBIF_IRQ_0 (GIC_SPI_START + 233)
#define RBIF_IRQ_1 (GIC_SPI_START + 234)
#define RBIF_IRQ_2 (GIC_SPI_START + 235)
/* Backwards compatible IRQ macros. */
#define INT_ADM_AARM ADM_0_SCSS_0_IRQ
/* smd/smsm interrupts */
#define INT_A9_M2A_0 (GIC_SPI_START + 37) /*MSS_TO_APPS_IRQ_0*/
#define INT_A9_M2A_5 (GIC_SPI_START + 38) /*MSS_TO_APPS_IRQ_1*/
#define INT_ADSP_A11 LPASS_SCSS_GP_HIGH_IRQ
#define INT_ADSP_A11_SMSM LPASS_SCSS_GP_MEDIUM_IRQ
#define INT_DSPS_A11 SPS_MTI_31
#define INT_DSPS_A11_SMSM SPS_MTI_30
#define INT_WCNSS_A11 RIVA_APSS_SPARE_IRQ
#define INT_WCNSS_A11_SMSM RIVA_APPS_WLAN_SMSM_IRQ
#endif
@@ -0,0 +1,281 @@
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IRQS_8960_H
#define __ASM_ARCH_MSM_IRQS_8960_H
/* MSM ACPU Interrupt Numbers */
#define INT_VGIC (GIC_PPI_START + 0)
#define INT_DEBUG_TIMER_EXP (GIC_PPI_START + 1)
#define INT_GP_TIMER_EXP (GIC_PPI_START + 2)
#define INT_GP_TIMER2_EXP (GIC_PPI_START + 3)
#define WDT0_ACCSCSSNBARK_INT (GIC_PPI_START + 4)
#define WDT1_ACCSCSSNBARK_INT (GIC_PPI_START + 5)
#define AVS_SVICINT (GIC_PPI_START + 6)
#define AVS_SVICINTSWDONE (GIC_PPI_START + 7)
#define CPU_DBGCPUXCOMMRXFULL (GIC_PPI_START + 8)
#define CPU_DBGCPUXCOMMTXEMPTY (GIC_PPI_START + 9)
#define INT_ARMQC_PERFMON (GIC_PPI_START + 10)
#define SC_AVSCPUXDOWN (GIC_PPI_START + 11)
#define SC_AVSCPUXUP (GIC_PPI_START + 12)
#define SC_SICCPUXACGIRPTREQ (GIC_PPI_START + 13)
#define SC_SICCPUXEXTFAULTIRPTREQ (GIC_PPI_START + 14)
/* PPI 15 is unused */
#define APCC_QGICACGIRPTREQ (GIC_SPI_START + 0)
#define APCC_QGICL2PERFMONIRPTREQ (GIC_SPI_START + 1)
#define SC_SICL2PERFMONIRPTREQ APCC_QGICL2PERFMONIRPTREQ
#define APCC_QGICL2IRPTREQ (GIC_SPI_START + 2)
#define APCC_QGICMPUIRPTREQ (GIC_SPI_START + 3)
#define TLMM_MSM_DIR_CONN_IRQ_0 (GIC_SPI_START + 4)
#define TLMM_MSM_DIR_CONN_IRQ_1 (GIC_SPI_START + 5)
#define TLMM_MSM_DIR_CONN_IRQ_2 (GIC_SPI_START + 6)
#define TLMM_MSM_DIR_CONN_IRQ_3 (GIC_SPI_START + 7)
#define TLMM_MSM_DIR_CONN_IRQ_4 (GIC_SPI_START + 8)
#define TLMM_MSM_DIR_CONN_IRQ_5 (GIC_SPI_START + 9)
#define TLMM_MSM_DIR_CONN_IRQ_6 (GIC_SPI_START + 10)
#define TLMM_MSM_DIR_CONN_IRQ_7 (GIC_SPI_START + 11)
#define TLMM_MSM_DIR_CONN_IRQ_8 (GIC_SPI_START + 12)
#define TLMM_MSM_DIR_CONN_IRQ_9 (GIC_SPI_START + 13)
#define PM8921_SEC_IRQ_103 (GIC_SPI_START + 14)
#define PM8018_SEC_IRQ_106 (GIC_SPI_START + 15)
#define TLMM_MSM_SUMMARY_IRQ (GIC_SPI_START + 16)
#define SPDM_RT_1_IRQ (GIC_SPI_START + 17)
#define SPDM_DIAG_IRQ (GIC_SPI_START + 18)
#define RPM_APCC_CPU0_GP_HIGH_IRQ (GIC_SPI_START + 19)
#define RPM_APCC_CPU0_GP_MEDIUM_IRQ (GIC_SPI_START + 20)
#define RPM_APCC_CPU0_GP_LOW_IRQ (GIC_SPI_START + 21)
#define RPM_APCC_CPU0_WAKE_UP_IRQ (GIC_SPI_START + 22)
#define RPM_APCC_CPU1_GP_HIGH_IRQ (GIC_SPI_START + 23)
#define RPM_APCC_CPU1_GP_MEDIUM_IRQ (GIC_SPI_START + 24)
#define RPM_APCC_CPU1_GP_LOW_IRQ (GIC_SPI_START + 25)
#define RPM_APCC_CPU1_WAKE_UP_IRQ (GIC_SPI_START + 26)
#define SSBI2_2_SC_CPU0_SECURE_IRQ (GIC_SPI_START + 27)
#define SSBI2_2_SC_CPU0_NON_SECURE_IRQ (GIC_SPI_START + 28)
#define SSBI2_1_SC_CPU0_SECURE_IRQ (GIC_SPI_START + 29)
#define SSBI2_1_SC_CPU0_NON_SECURE_IRQ (GIC_SPI_START + 30)
#define MSMC_SC_SEC_CE_IRQ (GIC_SPI_START + 31)
#define MSMC_SC_PRI_CE_IRQ (GIC_SPI_START + 32)
#define SLIMBUS0_CORE_EE1_IRQ (GIC_SPI_START + 33)
#define SLIMBUS0_BAM_EE1_IRQ (GIC_SPI_START + 34)
#define Q6FW_WDOG_EXPIRED_IRQ (GIC_SPI_START + 35)
#define Q6SW_WDOG_EXPIRED_IRQ (GIC_SPI_START + 36)
#define MSS_TO_APPS_IRQ_0 (GIC_SPI_START + 37)
#define MSS_TO_APPS_IRQ_1 (GIC_SPI_START + 38)
#define MSS_TO_APPS_IRQ_2 (GIC_SPI_START + 39)
#define MSS_TO_APPS_IRQ_3 (GIC_SPI_START + 40)
#define MSS_TO_APPS_IRQ_4 (GIC_SPI_START + 41)
#define MSS_TO_APPS_IRQ_5 (GIC_SPI_START + 42)
#define MSS_TO_APPS_IRQ_6 (GIC_SPI_START + 43)
#define MSS_TO_APPS_IRQ_7 (GIC_SPI_START + 44)
#define MSS_TO_APPS_IRQ_8 (GIC_SPI_START + 45)
#define MSS_TO_APPS_IRQ_9 (GIC_SPI_START + 46)
#define VPE_IRQ (GIC_SPI_START + 47)
#define VFE_IRQ (GIC_SPI_START + 48)
#define VCODEC_IRQ (GIC_SPI_START + 49)
#define TV_ENC_IRQ (GIC_SPI_START + 50)
#define SMMU_VPE_CB_SC_SECURE_IRQ (GIC_SPI_START + 51)
#define SMMU_VPE_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 52)
#define SMMU_VFE_CB_SC_SECURE_IRQ (GIC_SPI_START + 53)
#define SMMU_VFE_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 54)
#define SMMU_VCODEC_B_CB_SC_SECURE_IRQ (GIC_SPI_START + 55)
#define SMMU_VCODEC_B_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 56)
#define SMMU_VCODEC_A_CB_SC_SECURE_IRQ (GIC_SPI_START + 57)
#define SMMU_VCODEC_A_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 58)
#define SMMU_ROT_CB_SC_SECURE_IRQ (GIC_SPI_START + 59)
#define SMMU_ROT_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 60)
#define SMMU_MDP1_CB_SC_SECURE_IRQ (GIC_SPI_START + 61)
#define SMMU_MDP1_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 62)
#define SMMU_MDP0_CB_SC_SECURE_IRQ (GIC_SPI_START + 63)
#define SMMU_MDP0_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 64)
#define SMMU_JPEGD_CB_SC_SECURE_IRQ (GIC_SPI_START + 65)
#define SMMU_JPEGD_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 66)
#define SMMU_IJPEG_CB_SC_SECURE_IRQ (GIC_SPI_START + 67)
#define SMMU_IJPEG_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 68)
#define SMMU_GFX3D_CB_SC_SECURE_IRQ (GIC_SPI_START + 69)
#define SMMU_GFX3D_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 70)
#define SMMU_GFX2D0_CB_SC_SECURE_IRQ (GIC_SPI_START + 71)
#define SMMU_GFX2D0_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 72)
#define ROT_IRQ (GIC_SPI_START + 73)
#define MMSS_FABRIC_IRQ (GIC_SPI_START + 74)
#define MDP_IRQ (GIC_SPI_START + 75)
#define JPEGD_IRQ (GIC_SPI_START + 76)
#define JPEG_IRQ (GIC_SPI_START + 77)
#define MMSS_IMEM_IRQ (GIC_SPI_START + 78)
#define HDMI_IRQ (GIC_SPI_START + 79)
#define GFX3D_IRQ (GIC_SPI_START + 80)
#define GFX2D0_IRQ (GIC_SPI_START + 81)
#define DSI1_IRQ (GIC_SPI_START + 82)
#define CSI_1_IRQ (GIC_SPI_START + 83)
#define CSI_0_IRQ (GIC_SPI_START + 84)
#define LPASS_SCSS_AUDIO_IF_OUT0_IRQ (GIC_SPI_START + 85)
#define LPASS_SCSS_MIDI_IRQ (GIC_SPI_START + 86)
#define LPASS_Q6SS_WDOG_EXPIRED (GIC_SPI_START + 87)
#define LPASS_SCSS_GP_LOW_IRQ (GIC_SPI_START + 88)
#define LPASS_SCSS_GP_MEDIUM_IRQ (GIC_SPI_START + 89)
#define LPASS_SCSS_GP_HIGH_IRQ (GIC_SPI_START + 90)
#define TOP_IMEM_IRQ (GIC_SPI_START + 91)
#define FABRIC_SYS_IRQ (GIC_SPI_START + 92)
#define FABRIC_APPS_IRQ (GIC_SPI_START + 93)
#define USB1_HS_BAM_IRQ (GIC_SPI_START + 94)
#define SDC4_BAM_IRQ (GIC_SPI_START + 95)
#define SDC3_BAM_IRQ (GIC_SPI_START + 96)
#define SDC2_BAM_IRQ (GIC_SPI_START + 97)
#define SDC1_BAM_IRQ (GIC_SPI_START + 98)
#define FABRIC_SPS_IRQ (GIC_SPI_START + 99)
#define USB1_HS_IRQ (GIC_SPI_START + 100)
#define SDC4_IRQ_0 (GIC_SPI_START + 101)
#define SDC3_IRQ_0 (GIC_SPI_START + 102)
#define SDC2_IRQ_0 (GIC_SPI_START + 103)
#define SDC1_IRQ_0 (GIC_SPI_START + 104)
#define SPS_BAM_DMA_IRQ (GIC_SPI_START + 105)
#define SPS_SEC_VIOL_IRQ (GIC_SPI_START + 106)
#define SPS_MTI_0 (GIC_SPI_START + 107)
#define SPS_MTI_1 (GIC_SPI_START + 108)
#define SPS_MTI_2 (GIC_SPI_START + 109)
#define SPS_MTI_3 (GIC_SPI_START + 110)
#define SPS_MTI_4 (GIC_SPI_START + 111)
#define SPS_MTI_5 (GIC_SPI_START + 112)
#define SPS_MTI_6 (GIC_SPI_START + 113)
#define SPS_MTI_7 (GIC_SPI_START + 114)
#define SPS_MTI_8 (GIC_SPI_START + 115)
#define SPS_MTI_9 (GIC_SPI_START + 116)
#define SPS_MTI_10 (GIC_SPI_START + 117)
#define SPS_MTI_11 (GIC_SPI_START + 118)
#define SPS_MTI_12 (GIC_SPI_START + 119)
#define SPS_MTI_13 (GIC_SPI_START + 120)
#define SPS_MTI_14 (GIC_SPI_START + 121)
#define SPS_MTI_15 (GIC_SPI_START + 122)
#define SPS_MTI_16 (GIC_SPI_START + 123)
#define SPS_MTI_17 (GIC_SPI_START + 124)
#define SPS_MTI_18 (GIC_SPI_START + 125)
#define SPS_MTI_19 (GIC_SPI_START + 126)
#define SPS_MTI_20 (GIC_SPI_START + 127)
#define SPS_MTI_21 (GIC_SPI_START + 128)
#define SPS_MTI_22 (GIC_SPI_START + 129)
#define SPS_MTI_23 (GIC_SPI_START + 130)
#define SPS_MTI_24 (GIC_SPI_START + 131)
#define SPS_MTI_25 (GIC_SPI_START + 132)
#define SPS_MTI_26 (GIC_SPI_START + 133)
#define SPS_MTI_27 (GIC_SPI_START + 134)
#define SPS_MTI_28 (GIC_SPI_START + 135)
#define SPS_MTI_29 (GIC_SPI_START + 136)
#define SPS_MTI_30 (GIC_SPI_START + 137)
#define SPS_MTI_31 (GIC_SPI_START + 138)
#define CSIPHY_4LN_IRQ (GIC_SPI_START + 139)
#define MSM8960_CSIPHY_2LN_IRQ (GIC_SPI_START + 140)
#define USB2_IRQ (GIC_SPI_START + 141)
#define USB1_IRQ (GIC_SPI_START + 142)
#define TSSC_SSBI_IRQ (GIC_SPI_START + 143)
#define TSSC_SAMPLE_IRQ (GIC_SPI_START + 144)
#define TSSC_PENUP_IRQ (GIC_SPI_START + 145)
#define MSM8960_GSBI1_UARTDM_IRQ (GIC_SPI_START + 146)
#define MSM8960_GSBI1_QUP_IRQ (GIC_SPI_START + 147)
#define MSM8960_GSBI2_UARTDM_IRQ (GIC_SPI_START + 148)
#define MSM8960_GSBI2_QUP_IRQ (GIC_SPI_START + 149)
#define GSBI3_UARTDM_IRQ (GIC_SPI_START + 150)
#define GSBI3_QUP_IRQ (GIC_SPI_START + 151)
#define GSBI4_UARTDM_IRQ (GIC_SPI_START + 152)
#define GSBI4_QUP_IRQ (GIC_SPI_START + 153)
#define GSBI5_UARTDM_IRQ (GIC_SPI_START + 154)
#define GSBI5_QUP_IRQ (GIC_SPI_START + 155)
#define GSBI6_UARTDM_IRQ (GIC_SPI_START + 156)
#define GSBI6_QUP_IRQ (GIC_SPI_START + 157)
#define GSBI7_UARTDM_IRQ (GIC_SPI_START + 158)
#define GSBI7_QUP_IRQ (GIC_SPI_START + 159)
#define GSBI8_UARTDM_IRQ (GIC_SPI_START + 160)
#define GSBI8_QUP_IRQ (GIC_SPI_START + 161)
#define TSIF_TSPP_IRQ (GIC_SPI_START + 162)
#define TSIF_BAM_IRQ (GIC_SPI_START + 163)
#define TSIF2_IRQ (GIC_SPI_START + 164)
#define TSIF1_IRQ (GIC_SPI_START + 165)
#define DSI2_IRQ (GIC_SPI_START + 166)
#define ISPIF_IRQ (GIC_SPI_START + 167)
#define MSMC_SC_SEC_TMR_IRQ (GIC_SPI_START + 168)
#define MSMC_SC_SEC_WDOG_BARK_IRQ (GIC_SPI_START + 169)
#define ADM_0_SCSS_0_IRQ (GIC_SPI_START + 170)
#define ADM_0_SCSS_1_IRQ (GIC_SPI_START + 171)
#define ADM_0_SCSS_2_IRQ (GIC_SPI_START + 172)
#define ADM_0_SCSS_3_IRQ (GIC_SPI_START + 173)
#define CC_SCSS_WDT1CPU1BITEEXPIRED (GIC_SPI_START + 174)
#define CC_SCSS_WDT1CPU0BITEEXPIRED (GIC_SPI_START + 175)
#define CC_SCSS_WDT0CPU1BITEEXPIRED (GIC_SPI_START + 176)
#define CC_SCSS_WDT0CPU0BITEEXPIRED (GIC_SPI_START + 177)
#define TSENS_UPPER_LOWER_INT (GIC_SPI_START + 178)
#define SSBI2_2_SC_CPU1_SECURE_INT (GIC_SPI_START + 179)
#define SSBI2_2_SC_CPU1_NON_SECURE_INT (GIC_SPI_START + 180)
#define SSBI2_1_SC_CPU1_SECURE_INT (GIC_SPI_START + 181)
#define SSBI2_1_SC_CPU1_NON_SECURE_INT (GIC_SPI_START + 182)
#define XPU_SUMMARY_IRQ (GIC_SPI_START + 183)
#define BUS_EXCEPTION_SUMMARY_IRQ (GIC_SPI_START + 184)
#define HSDDRX_EBI1CH0_IRQ (GIC_SPI_START + 185)
#define HSDDRX_EBI1CH1_IRQ (GIC_SPI_START + 186)
#define SDC5_BAM_IRQ (GIC_SPI_START + 187)
#define SDC5_IRQ_0 (GIC_SPI_START + 188)
#define GSBI9_UARTDM_IRQ (GIC_SPI_START + 189)
#define GSBI9_QUP_IRQ (GIC_SPI_START + 190)
#define GSBI10_UARTDM_IRQ (GIC_SPI_START + 191)
#define GSBI10_QUP_IRQ (GIC_SPI_START + 192)
#define GSBI11_UARTDM_IRQ (GIC_SPI_START + 193)
#define GSBI11_QUP_IRQ (GIC_SPI_START + 194)
#define GSBI12_UARTDM_IRQ (GIC_SPI_START + 195)
#define GSBI12_QUP_IRQ (GIC_SPI_START + 196)
#define RIVA_APSS_LTECOEX_IRQ (GIC_SPI_START + 197)
#define RIVA_APSS_SPARE_IRQ (GIC_SPI_START + 198)
#define RIVA_APSS_WDOG_BITE_RESET_RDY_IRQ (GIC_SPI_START + 199)
#define RIVA_APSS_RESET_DONE_IRQ (GIC_SPI_START + 200)
#define RIVA_APSS_ASIC_IRQ (GIC_SPI_START + 201)
#define RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ (GIC_SPI_START + 202)
#define RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ (GIC_SPI_START + 203)
#define RIVA_APPS_WLAN_SMSM_IRQ (GIC_SPI_START + 204)
#define RIVA_APPS_LOG_CTRL_IRQ (GIC_SPI_START + 205)
#define RIVA_APPS_FM_CTRL_IRQ (GIC_SPI_START + 206)
#define RIVA_APPS_HCI_IRQ (GIC_SPI_START + 207)
#define RIVA_APPS_WLAN_CTRL_IRQ (GIC_SPI_START + 208)
#define A2_BAM_IRQ (GIC_SPI_START + 209)
#define SMMU_GFX2D1_CB_SC_SECURE_IRQ (GIC_SPI_START + 210)
#define SMMU_GFX2D1_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 211)
#define GFX2D1_IRQ (GIC_SPI_START + 212)
#define PPSS_WDOG_TIMER_IRQ (GIC_SPI_START + 213)
#define SPS_SLIMBUS_CORE_EE0_IRQ (GIC_SPI_START + 214)
#define SPS_SLIMBUS_BAM_EE0_IRQ (GIC_SPI_START + 215)
#define QDSS_ETB_IRQ (GIC_SPI_START + 216)
#define QDSS_CTI2KPSS_CPU1_IRQ (GIC_SPI_START + 217)
#define QDSS_CTI2KPSS_CPU0_IRQ (GIC_SPI_START + 218)
#define TLMM_MSM_DIR_CONN_IRQ_16 (GIC_SPI_START + 219)
#define TLMM_MSM_DIR_CONN_IRQ_17 (GIC_SPI_START + 220)
#define TLMM_MSM_DIR_CONN_IRQ_18 (GIC_SPI_START + 221)
#define TLMM_MSM_DIR_CONN_IRQ_19 (GIC_SPI_START + 222)
#define TLMM_MSM_DIR_CONN_IRQ_20 (GIC_SPI_START + 223)
#define TLMM_MSM_DIR_CONN_IRQ_21 (GIC_SPI_START + 224)
#define PM8921_SEC_IRQ_104 (GIC_SPI_START + 225)
#define PM8018_SEC_IRQ_107 (GIC_SPI_START + 226)
#define USB_HSIC_IRQ (GIC_SPI_START + 229)
#define MSM8960_CSIPHY_2_2LN_IRQ (GIC_SPI_START + 228)
#define CSI_2_IRQ (GIC_SPI_START + 227)
/* Backwards compatible IRQ macros. */
#define INT_ADM_AARM ADM_0_SCSS_0_IRQ
/* smd/smsm interrupts */
#define INT_A9_M2A_0 (GIC_SPI_START + 37) /*MSS_TO_APPS_IRQ_0*/
#define INT_A9_M2A_5 (GIC_SPI_START + 38) /*MSS_TO_APPS_IRQ_1*/
#define INT_ADSP_A11 LPASS_SCSS_GP_HIGH_IRQ
#define INT_ADSP_A11_SMSM LPASS_SCSS_GP_MEDIUM_IRQ
#define INT_DSPS_A11 SPS_MTI_31
#define INT_DSPS_A11_SMSM SPS_MTI_30
#define INT_WCNSS_A11 RIVA_APSS_SPARE_IRQ
#define INT_WCNSS_A11_SMSM RIVA_APPS_WLAN_SMSM_IRQ
#endif
@@ -0,0 +1,25 @@
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IRQS_8974_H
#define __ASM_ARCH_MSM_IRQS_8974_H
/* MSM ACPU Interrupt Numbers */
#define INT_ARMQC_PERFMON (GIC_PPI_START + 7)
/* PPI 15 is unused */
#define APCC_QGICL2PERFMONIRPTREQ (GIC_SPI_START + 1)
#define SC_SICL2PERFMONIRPTREQ APCC_QGICL2PERFMONIRPTREQ
#endif
@@ -0,0 +1,89 @@
/* Copyright (c) 2008-2010, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IRQS_8XXX_H
#define __ASM_ARCH_MSM_IRQS_8XXX_H
/* MSM ACPU Interrupt Numbers */
#define INT_A9_M2A_0 0
#define INT_A9_M2A_1 1
#define INT_A9_M2A_2 2
#define INT_A9_M2A_3 3
#define INT_A9_M2A_4 4
#define INT_A9_M2A_5 5
#define INT_A9_M2A_6 6
#define INT_GP_TIMER_EXP 7
#define INT_DEBUG_TIMER_EXP 8
#define INT_SIRC_0 9
#define INT_SDC3_0 10
#define INT_SDC3_1 11
#define INT_SDC4_0 12
#define INT_SDC4_1 13
#define INT_AD6_EXT_VFR 14
#define INT_USB_OTG 15
#define INT_MDDI_PRI 16
#define INT_MDDI_EXT 17
#define INT_MDDI_CLIENT 18
#define INT_MDP 19
#define INT_GRAPHICS 20
#define INT_ADM_AARM 21
#define INT_ADSP_A11 22
#define INT_ADSP_A9_A11 23
#define INT_SDC1_0 24
#define INT_SDC1_1 25
#define INT_SDC2_0 26
#define INT_SDC2_1 27
#define INT_KEYSENSE 28
#define INT_TCHSCRN_SSBI 29
#define INT_TCHSCRN1 30
#define INT_TCHSCRN2 31
#define INT_TCSR_MPRPH_SC1 (32 + 0)
#define INT_USB_FS2 (32 + 1)
#define INT_PWB_I2C (32 + 2)
#define INT_SOFTRESET (32 + 3)
#define INT_NAND_WR_ER_DONE (32 + 4)
#define INT_NAND_OP_DONE (32 + 5)
#define INT_TCSR_MPRPH_SC2 (32 + 6)
#define INT_OP_PEN (32 + 7)
#define INT_AD_HSSD (32 + 8)
#define INT_ARMQC_PERFMON (32 + 9)
#define INT_SDMA_NON_SECURE (32 + 10)
#define INT_TSIF_IRQ (32 + 11)
#define INT_UART1DM_IRQ (32 + 12)
#define INT_UART1DM_RX (32 + 13)
#define INT_SDMA_SECURE (32 + 14)
#define INT_SI2S_SLAVE (32 + 15)
#define INT_SC_I2CPU (32 + 16)
#define INT_SC_DBG_RDTRFULL (32 + 17)
#define INT_SC_DBG_WDTRFULL (32 + 18)
#define INT_SCPLL_CTL_DONE (32 + 19)
#define INT_UART2DM_IRQ (32 + 20)
#define INT_UART2DM_RX (32 + 21)
#define INT_VDC_MEC (32 + 22)
#define INT_VDC_DB (32 + 23)
#define INT_VDC_AXI (32 + 24)
#define INT_VFE (32 + 25)
#define INT_USB_HS (32 + 26)
#define INT_AUDIO_OUT0 (32 + 27)
#define INT_AUDIO_OUT1 (32 + 28)
#define INT_CRYPTO (32 + 29)
#define INT_AD6M_IDLE (32 + 30)
#define INT_SIRC_1 (32 + 31)
#define NR_GPIO_IRQS 165
#define NR_MSM_IRQS 64
#define NR_BOARD_IRQS 64
#define INT_ADSP_A11_SMSM INT_ADSP_A11
#endif
@@ -0,0 +1,261 @@
/* Copyright (c) 2010-2011 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MSM_IRQS_8X60_H
#define __ASM_ARCH_MSM_IRQS_8X60_H
/* MSM ACPU Interrupt Numbers */
#define INT_DEBUG_TIMER_EXP (GIC_PPI_START + 0)
#define INT_GP_TIMER_EXP (GIC_PPI_START + 1)
#define INT_GP_TIMER2_EXP (GIC_PPI_START + 2)
#define WDT0_ACCSCSSNBARK_INT (GIC_PPI_START + 3)
#define WDT1_ACCSCSSNBARK_INT (GIC_PPI_START + 4)
#define AVS_SVICINT (GIC_PPI_START + 5)
#define AVS_SVICINTSWDONE (GIC_PPI_START + 6)
#define CPU_DBGCPUXCOMMRXFULL (GIC_PPI_START + 7)
#define CPU_DBGCPUXCOMMTXEMPTY (GIC_PPI_START + 8)
#define INT_ARMQC_PERFMON (GIC_PPI_START + 9)
#define SC_AVSCPUXDOWN (GIC_PPI_START + 10)
#define SC_AVSCPUXUP (GIC_PPI_START + 11)
#define SC_SICCPUXACGIRPTREQ (GIC_PPI_START + 12)
/* PPI 13 to 15 are unused */
#define SC_SICMPUIRPTREQ (GIC_SPI_START + 0)
#define SC_SICL2IRPTREQ (GIC_SPI_START + 1)
#define SC_SICL2PERFMONIRPTREQ (GIC_SPI_START + 2)
#define NC (GIC_SPI_START + 3)
#define TLMM_MSM_DIR_CONN_IRQ_0 (GIC_SPI_START + 4)
#define TLMM_MSM_DIR_CONN_IRQ_1 (GIC_SPI_START + 5)
#define TLMM_MSM_DIR_CONN_IRQ_2 (GIC_SPI_START + 6)
#define TLMM_MSM_DIR_CONN_IRQ_3 (GIC_SPI_START + 7)
#define TLMM_MSM_DIR_CONN_IRQ_4 (GIC_SPI_START + 8)
#define TLMM_MSM_DIR_CONN_IRQ_5 (GIC_SPI_START + 9)
#define TLMM_MSM_DIR_CONN_IRQ_6 (GIC_SPI_START + 10)
#define TLMM_MSM_DIR_CONN_IRQ_7 (GIC_SPI_START + 11)
#define TLMM_MSM_DIR_CONN_IRQ_8 (GIC_SPI_START + 12)
#define TLMM_MSM_DIR_CONN_IRQ_9 (GIC_SPI_START + 13)
#define PM8058_SEC_IRQ_N (GIC_SPI_START + 14)
#define PM8901_SEC_IRQ_N (GIC_SPI_START + 15)
#define TLMM_MSM_SUMMARY_IRQ (GIC_SPI_START + 16)
#define SPDM_RT_1_IRQ (GIC_SPI_START + 17)
#define SPDM_DIAG_IRQ (GIC_SPI_START + 18)
#define RPM_SCSS_CPU0_GP_HIGH_IRQ (GIC_SPI_START + 19)
#define RPM_SCSS_CPU0_GP_MEDIUM_IRQ (GIC_SPI_START + 20)
#define RPM_SCSS_CPU0_GP_LOW_IRQ (GIC_SPI_START + 21)
#define RPM_SCSS_CPU0_WAKE_UP_IRQ (GIC_SPI_START + 22)
#define RPM_SCSS_CPU1_GP_HIGH_IRQ (GIC_SPI_START + 23)
#define RPM_SCSS_CPU1_GP_MEDIUM_IRQ (GIC_SPI_START + 24)
#define RPM_SCSS_CPU1_GP_LOW_IRQ (GIC_SPI_START + 25)
#define RPM_SCSS_CPU1_WAKE_UP_IRQ (GIC_SPI_START + 26)
#define SSBI2_2_SC_CPU0_SECURE_INT (GIC_SPI_START + 27)
#define SSBI2_2_SC_CPU0_NON_SECURE_INT (GIC_SPI_START + 28)
#define SSBI2_1_SC_CPU0_SECURE_INT (GIC_SPI_START + 29)
#define SSBI2_1_SC_CPU0_NON_SECURE_INT (GIC_SPI_START + 30)
#define MSMC_SC_SEC_CE_IRQ (GIC_SPI_START + 31)
#define MSMC_SC_PRI_CE_IRQ (GIC_SPI_START + 32)
#define MARM_FIQ (GIC_SPI_START + 33)
#define MARM_IRQ (GIC_SPI_START + 34)
#define MARM_L2CC_IRQ (GIC_SPI_START + 35)
#define MARM_WDOG_EXPIRED (GIC_SPI_START + 36)
#define MARM_SCSS_GP_IRQ_0 (GIC_SPI_START + 37)
#define MARM_SCSS_GP_IRQ_1 (GIC_SPI_START + 38)
#define MARM_SCSS_GP_IRQ_2 (GIC_SPI_START + 39)
#define MARM_SCSS_GP_IRQ_3 (GIC_SPI_START + 40)
#define MARM_SCSS_GP_IRQ_4 (GIC_SPI_START + 41)
#define MARM_SCSS_GP_IRQ_5 (GIC_SPI_START + 42)
#define MARM_SCSS_GP_IRQ_6 (GIC_SPI_START + 43)
#define MARM_SCSS_GP_IRQ_7 (GIC_SPI_START + 44)
#define MARM_SCSS_GP_IRQ_8 (GIC_SPI_START + 45)
#define MARM_SCSS_GP_IRQ_9 (GIC_SPI_START + 46)
#define INT_VPE (GIC_SPI_START + 47)
#define VFE_IRQ (GIC_SPI_START + 48)
#define VCODEC_IRQ (GIC_SPI_START + 49)
#define TV_ENC_IRQ (GIC_SPI_START + 50)
#define SMMU_VPE_CB_SC_SECURE_IRQ (GIC_SPI_START + 51)
#define SMMU_VPE_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 52)
#define SMMU_VFE_CB_SC_SECURE_IRQ (GIC_SPI_START + 53)
#define SMMU_VFE_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 54)
#define SMMU_VCODEC_B_CB_SC_SECURE_IRQ (GIC_SPI_START + 55)
#define SMMU_VCODEC_B_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 56)
#define SMMU_VCODEC_A_CB_SC_SECURE_IRQ (GIC_SPI_START + 57)
#define SMMU_VCODEC_A_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 58)
#define SMMU_ROT_CB_SC_SECURE_IRQ (GIC_SPI_START + 59)
#define SMMU_ROT_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 60)
#define SMMU_MDP1_CB_SC_SECURE_IRQ (GIC_SPI_START + 61)
#define SMMU_MDP1_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 62)
#define SMMU_MDP0_CB_SC_SECURE_IRQ (GIC_SPI_START + 63)
#define SMMU_MDP0_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 64)
#define SMMU_JPEGD_CB_SC_SECURE_IRQ (GIC_SPI_START + 65)
#define SMMU_JPEGD_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 66)
#define SMMU_IJPEG_CB_SC_SECURE_IRQ (GIC_SPI_START + 67)
#define SMMU_IJPEG_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 68)
#define SMMU_GFX3D_CB_SC_SECURE_IRQ (GIC_SPI_START + 69)
#define SMMU_GFX3D_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 70)
#define SMMU_GFX2D0_CB_SC_SECURE_IRQ (GIC_SPI_START + 71)
#define SMMU_GFX2D0_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 72)
#define ROT_IRQ (GIC_SPI_START + 73)
#define MMSS_FABRIC_IRQ (GIC_SPI_START + 74)
#define INT_MDP (GIC_SPI_START + 75)
#define JPEGD_IRQ (GIC_SPI_START + 76)
#define INT_JPEG (GIC_SPI_START + 77)
#define MMSS_IMEM_IRQ (GIC_SPI_START + 78)
#define HDMI_IRQ (GIC_SPI_START + 79)
#define GFX3D_IRQ (GIC_SPI_START + 80)
#define GFX2D0_IRQ (GIC_SPI_START + 81)
#define DSI_IRQ (GIC_SPI_START + 82)
#define CSI_1_IRQ (GIC_SPI_START + 83)
#define CSI_0_IRQ (GIC_SPI_START + 84)
#define LPASS_SCSS_AUDIO_IF_OUT0_IRQ (GIC_SPI_START + 85)
#define LPASS_SCSS_MIDI_IRQ (GIC_SPI_START + 86)
#define LPASS_Q6SS_WDOG_EXPIRED (GIC_SPI_START + 87)
#define LPASS_SCSS_GP_LOW_IRQ (GIC_SPI_START + 88)
#define LPASS_SCSS_GP_MEDIUM_IRQ (GIC_SPI_START + 89)
#define LPASS_SCSS_GP_HIGH_IRQ (GIC_SPI_START + 90)
#define TOP_IMEM_IRQ (GIC_SPI_START + 91)
#define FABRIC_SYS_IRQ (GIC_SPI_START + 92)
#define FABRIC_APPS_IRQ (GIC_SPI_START + 93)
#define USB1_HS_BAM_IRQ (GIC_SPI_START + 94)
#define SDC4_BAM_IRQ (GIC_SPI_START + 95)
#define SDC3_BAM_IRQ (GIC_SPI_START + 96)
#define SDC2_BAM_IRQ (GIC_SPI_START + 97)
#define SDC1_BAM_IRQ (GIC_SPI_START + 98)
#define FABRIC_SPS_IRQ (GIC_SPI_START + 99)
#define USB1_HS_IRQ (GIC_SPI_START + 100)
#define SDC4_IRQ_0 (GIC_SPI_START + 101)
#define SDC3_IRQ_0 (GIC_SPI_START + 102)
#define SDC2_IRQ_0 (GIC_SPI_START + 103)
#define SDC1_IRQ_0 (GIC_SPI_START + 104)
#define SPS_BAM_DMA_IRQ (GIC_SPI_START + 105)
#define SPS_SEC_VIOL_IRQ (GIC_SPI_START + 106)
#define SPS_MTI_0 (GIC_SPI_START + 107)
#define SPS_MTI_1 (GIC_SPI_START + 108)
#define SPS_MTI_2 (GIC_SPI_START + 109)
#define SPS_MTI_3 (GIC_SPI_START + 110)
#define SPS_MTI_4 (GIC_SPI_START + 111)
#define SPS_MTI_5 (GIC_SPI_START + 112)
#define SPS_MTI_6 (GIC_SPI_START + 113)
#define SPS_MTI_7 (GIC_SPI_START + 114)
#define SPS_MTI_8 (GIC_SPI_START + 115)
#define SPS_MTI_9 (GIC_SPI_START + 116)
#define SPS_MTI_10 (GIC_SPI_START + 117)
#define SPS_MTI_11 (GIC_SPI_START + 118)
#define SPS_MTI_12 (GIC_SPI_START + 119)
#define SPS_MTI_13 (GIC_SPI_START + 120)
#define SPS_MTI_14 (GIC_SPI_START + 121)
#define SPS_MTI_15 (GIC_SPI_START + 122)
#define SPS_MTI_16 (GIC_SPI_START + 123)
#define SPS_MTI_17 (GIC_SPI_START + 124)
#define SPS_MTI_18 (GIC_SPI_START + 125)
#define SPS_MTI_19 (GIC_SPI_START + 126)
#define SPS_MTI_20 (GIC_SPI_START + 127)
#define SPS_MTI_21 (GIC_SPI_START + 128)
#define SPS_MTI_22 (GIC_SPI_START + 129)
#define SPS_MTI_23 (GIC_SPI_START + 130)
#define SPS_MTI_24 (GIC_SPI_START + 131)
#define SPS_MTI_25 (GIC_SPI_START + 132)
#define SPS_MTI_26 (GIC_SPI_START + 133)
#define SPS_MTI_27 (GIC_SPI_START + 134)
#define SPS_MTI_28 (GIC_SPI_START + 135)
#define SPS_MTI_29 (GIC_SPI_START + 136)
#define SPS_MTI_30 (GIC_SPI_START + 137)
#define SPS_MTI_31 (GIC_SPI_START + 138)
#define UXMC_EBI2_WR_ER_DONE_IRQ (GIC_SPI_START + 139)
#define UXMC_EBI2_OP_DONE_IRQ (GIC_SPI_START + 140)
#define USB2_IRQ (GIC_SPI_START + 141)
#define USB1_IRQ (GIC_SPI_START + 142)
#define TSSC_SSBI_IRQ (GIC_SPI_START + 143)
#define TSSC_SAMPLE_IRQ (GIC_SPI_START + 144)
#define TSSC_PENUP_IRQ (GIC_SPI_START + 145)
#define GSBI1_UARTDM_IRQ (GIC_SPI_START + 146)
#define GSBI1_QUP_IRQ (GIC_SPI_START + 147)
#define GSBI2_UARTDM_IRQ (GIC_SPI_START + 148)
#define GSBI2_QUP_IRQ (GIC_SPI_START + 149)
#define GSBI3_UARTDM_IRQ (GIC_SPI_START + 150)
#define GSBI3_QUP_IRQ (GIC_SPI_START + 151)
#define GSBI4_UARTDM_IRQ (GIC_SPI_START + 152)
#define GSBI4_QUP_IRQ (GIC_SPI_START + 153)
#define GSBI5_UARTDM_IRQ (GIC_SPI_START + 154)
#define GSBI5_QUP_IRQ (GIC_SPI_START + 155)
#define GSBI6_UARTDM_IRQ (GIC_SPI_START + 156)
#define GSBI6_QUP_IRQ (GIC_SPI_START + 157)
#define GSBI7_UARTDM_IRQ (GIC_SPI_START + 158)
#define GSBI7_QUP_IRQ (GIC_SPI_START + 159)
#define GSBI8_UARTDM_IRQ (GIC_SPI_START + 160)
#define GSBI8_QUP_IRQ (GIC_SPI_START + 161)
#define TSIF_TSPP_IRQ (GIC_SPI_START + 162)
#define TSIF_BAM_IRQ (GIC_SPI_START + 163)
#define TSIF2_IRQ (GIC_SPI_START + 164)
#define TSIF1_IRQ (GIC_SPI_START + 165)
#define INT_ADM1_MASTER (GIC_SPI_START + 166)
#define INT_ADM1_AARM (GIC_SPI_START + 167)
#define INT_ADM1_SD2 (GIC_SPI_START + 168)
#define INT_ADM1_SD3 (GIC_SPI_START + 169)
#define INT_ADM0_MASTER (GIC_SPI_START + 170)
#define INT_ADM0_AARM (GIC_SPI_START + 171)
#define INT_ADM0_SD2 (GIC_SPI_START + 172)
#define INT_ADM0_SD3 (GIC_SPI_START + 173)
#define CC_SCSS_WDT1CPU1BITEEXPIRED (GIC_SPI_START + 174)
#define CC_SCSS_WDT1CPU0BITEEXPIRED (GIC_SPI_START + 175)
#define CC_SCSS_WDT0CPU1BITEEXPIRED (GIC_SPI_START + 176)
#define CC_SCSS_WDT0CPU0BITEEXPIRED (GIC_SPI_START + 177)
#define TSENS_UPPER_LOWER_INT (GIC_SPI_START + 178)
#define SSBI2_2_SC_CPU1_SECURE_INT (GIC_SPI_START + 179)
#define SSBI2_2_SC_CPU1_NON_SECURE_INT (GIC_SPI_START + 180)
#define SSBI2_1_SC_CPU1_SECURE_INT (GIC_SPI_START + 181)
#define SSBI2_1_SC_CPU1_NON_SECURE_INT (GIC_SPI_START + 182)
#define XPU_SUMMARY_IRQ (GIC_SPI_START + 183)
#define BUS_EXCEPTION_SUMMARY_IRQ (GIC_SPI_START + 184)
#define HSDDRX_SMICH0_IRQ (GIC_SPI_START + 185)
#define HSDDRX_EBI1_IRQ (GIC_SPI_START + 186)
#define SDC5_BAM_IRQ (GIC_SPI_START + 187)
#define SDC5_IRQ_0 (GIC_SPI_START + 188)
#define GSBI9_UARTDM_IRQ (GIC_SPI_START + 189)
#define GSBI9_QUP_IRQ (GIC_SPI_START + 190)
#define GSBI10_UARTDM_IRQ (GIC_SPI_START + 191)
#define GSBI10_QUP_IRQ (GIC_SPI_START + 192)
#define GSBI11_UARTDM_IRQ (GIC_SPI_START + 193)
#define GSBI11_QUP_IRQ (GIC_SPI_START + 194)
#define GSBI12_UARTDM_IRQ (GIC_SPI_START + 195)
#define GSBI12_QUP_IRQ (GIC_SPI_START + 196)
#define SMMU_GFX2D1_CB_SC_SECURE_IRQ (GIC_SPI_START + 210)
#define SMMU_GFX2D1_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 211)
#define GFX2D1_IRQ (GIC_SPI_START + 212)
#define SMPSS_SPARE_1 (GIC_SPI_START + 217)
#define SMPSS_SPARE_2 (GIC_SPI_START + 218)
#define SMPSS_SPARE_3 (GIC_SPI_START + 219)
#define SMPSS_SPARE_4 (GIC_SPI_START + 220)
#define SMPSS_SPARE_5 (GIC_SPI_START + 221)
#define SMPSS_SPARE_6 (GIC_SPI_START + 222)
#define SMPSS_SPARE_7 (GIC_SPI_START + 223)
#define NR_GPIO_IRQS 173
#define NR_MSM_GPIOS NR_GPIO_IRQS
#define NR_MSM_IRQS 256
#define NR_PMIC8058_IRQS 256
#define NR_PMIC8901_IRQS 72
#define NR_GPIO_EXPANDER_IRQS 98
#define NR_BOARD_IRQS (NR_PMIC8058_IRQS + NR_PMIC8901_IRQS +\
NR_GPIO_EXPANDER_IRQS)
/* smd/smsm interrupts */
#define INT_A9_M2A_0 MARM_SCSS_GP_IRQ_0
#define INT_A9_M2A_5 MARM_SCSS_GP_IRQ_1
#define INT_ADSP_A11 LPASS_SCSS_GP_HIGH_IRQ
#define INT_ADSP_A11_SMSM LPASS_SCSS_GP_MEDIUM_IRQ
#define INT_DSPS_A11 SPS_MTI_31
#endif
@@ -0,0 +1,195 @@
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IRQS_9615_H
#define __ASM_ARCH_MSM_IRQS_9615_H
/* MSM ACPU Interrupt Numbers */
#define FIQ_START 16
#define INT_DEBUG_TIMER_EXP (GIC_PPI_START + 1)
#define INT_GP_TIMER_EXP (GIC_PPI_START + 2)
#define INT_GP_TIMER2_EXP (GIC_PPI_START + 3)
#define WDT0_ACCSCSSNBARK_INT (GIC_PPI_START + 4)
#define WDT1_ACCSCSSNBARK_INT (GIC_PPI_START + 5)
#define AVS_SVICINT (GIC_PPI_START + 6)
#define AVS_SVICINTSWDONE (GIC_PPI_START + 7)
#define CPU_DBGCPUXCOMMRXFULL (GIC_PPI_START + 8)
#define CPU_DBGCPUXCOMMTXEMPTY (GIC_PPI_START + 9)
#define INT_ARMQC_PERFMON (GIC_PPI_START + 10)
#define SC_AVSCPUXDOWN (GIC_PPI_START + 11)
#define SC_AVSCPUXUP (GIC_PPI_START + 12)
#define SC_SICCPUXACGIRPTREQ (GIC_PPI_START + 13)
#define SC_SICCPUXEXTFAULTIRPTREQ (GIC_PPI_START + 14)
/* PPI 15 is unused */
#define APCC_QGICACGIRPTREQ (GIC_SPI_START + 0)
#define APCC_QGICL2PERFMONIRPTREQ (GIC_SPI_START + 1)
#define SC_SICL2PERFMONIRPTREQ APCC_QGICL2PERFMONIRPTREQ
#define APCC_QGICL2IRPTREQ (GIC_SPI_START + 2)
#define APCC_QGICMPUIRPTREQ (GIC_SPI_START + 3)
#define TLMM_MSM_DIR_CONN_IRQ_0 (GIC_SPI_START + 4)
#define TLMM_MSM_DIR_CONN_IRQ_1 (GIC_SPI_START + 5)
#define TLMM_MSM_DIR_CONN_IRQ_2 (GIC_SPI_START + 6)
#define TLMM_MSM_DIR_CONN_IRQ_3 (GIC_SPI_START + 7)
#define TLMM_MSM_DIR_CONN_IRQ_4 (GIC_SPI_START + 8)
#define TLMM_MSM_DIR_CONN_IRQ_5 (GIC_SPI_START + 9)
#define TLMM_MSM_DIR_CONN_IRQ_6 (GIC_SPI_START + 10)
#define TLMM_MSM_DIR_CONN_IRQ_7 (GIC_SPI_START + 11)
#define TLMM_MSM_DIR_CONN_IRQ_8 (GIC_SPI_START + 12)
#define TLMM_MSM_DIR_CONN_IRQ_9 (GIC_SPI_START + 13)
/* 14 Reserved */
#define PM8018_SEC_IRQ_N (GIC_SPI_START + 15)
#define TLMM_MSM_SUMMARY_IRQ (GIC_SPI_START + 16)
#define SPDM_RT_1_IRQ (GIC_SPI_START + 17)
#define SPDM_DIAG_IRQ (GIC_SPI_START + 18)
#define RPM_APCC_CPU0_GP_HIGH_IRQ (GIC_SPI_START + 19)
#define RPM_APCC_CPU0_GP_MEDIUM_IRQ (GIC_SPI_START + 20)
#define RPM_APCC_CPU0_GP_LOW_IRQ (GIC_SPI_START + 21)
#define RPM_APCC_CPU0_WAKE_UP_IRQ (GIC_SPI_START + 22)
/* 23-28 Reserved */
#define SSBI2_1_SC_CPU0_SECURE_IRQ (GIC_SPI_START + 29)
#define SSBI2_1_SC_CPU0_NON_SECURE_IRQ (GIC_SPI_START + 30)
/* 31 Reserved */
#define MSMC_SC_PRI_CE_IRQ (GIC_SPI_START + 32)
#define SLIMBUS0_CORE_EE1_IRQ (GIC_SPI_START + 33)
#define SLIMBUS0_BAM_EE1_IRQ (GIC_SPI_START + 34)
#define Q6FW_WDOG_EXPIRED_IRQ (GIC_SPI_START + 35)
#define Q6SW_WDOG_EXPIRED_IRQ (GIC_SPI_START + 36)
#define MSS_TO_APPS_IRQ_0 (GIC_SPI_START + 37)
#define MSS_TO_APPS_IRQ_1 (GIC_SPI_START + 38)
#define MSS_TO_APPS_IRQ_2 (GIC_SPI_START + 39)
#define MSS_TO_APPS_IRQ_3 (GIC_SPI_START + 40)
#define MSS_TO_APPS_IRQ_4 (GIC_SPI_START + 41)
#define MSS_TO_APPS_IRQ_5 (GIC_SPI_START + 42)
#define MSS_TO_APPS_IRQ_6 (GIC_SPI_START + 43)
#define MSS_TO_APPS_IRQ_7 (GIC_SPI_START + 44)
#define MSS_TO_APPS_IRQ_8 (GIC_SPI_START + 45)
#define MSS_TO_APPS_IRQ_9 (GIC_SPI_START + 46)
/* 47-84 Reserved */
#define LPASS_SCSS_AUDIO_IF_OUT0_IRQ (GIC_SPI_START + 85)
#define LPASS_SCSS_MIDI_IRQ (GIC_SPI_START + 86)
#define LPASS_Q6SS_WDOG_EXPIRED (GIC_SPI_START + 87)
#define LPASS_SCSS_GP_LOW_IRQ (GIC_SPI_START + 88)
#define LPASS_SCSS_GP_MEDIUM_IRQ (GIC_SPI_START + 89)
#define LPASS_SCSS_GP_HIGH_IRQ (GIC_SPI_START + 90)
#define TOP_IMEM_IRQ (GIC_SPI_START + 91)
#define FABRIC_SYS_IRQ (GIC_SPI_START + 92)
/* 93 Reserved */
#define USB1_HS_BAM_IRQ (GIC_SPI_START + 94)
/* 95,96 unnamed */
#define SDC2_BAM_IRQ (GIC_SPI_START + 97)
#define SDC1_BAM_IRQ (GIC_SPI_START + 98)
#define FABRIC_SPS_IRQ (GIC_SPI_START + 99)
#define USB1_HS_IRQ (GIC_SPI_START + 100)
/* 101,102 unnamed */
#define SDC2_IRQ_0 (GIC_SPI_START + 103)
#define SDC1_IRQ_0 (GIC_SPI_START + 104)
#define SPS_BAM_DMA_IRQ (GIC_SPI_START + 105)
#define SPS_SEC_VIOL_IRQ (GIC_SPI_START + 106)
#define SPS_MTI_0 (GIC_SPI_START + 107)
#define SPS_MTI_1 (GIC_SPI_START + 108)
#define SPS_MTI_2 (GIC_SPI_START + 109)
#define SPS_MTI_3 (GIC_SPI_START + 110)
#define SPS_MTI_4 (GIC_SPI_START + 111)
#define SPS_MTI_5 (GIC_SPI_START + 112)
#define SPS_MTI_6 (GIC_SPI_START + 113)
#define SPS_MTI_7 (GIC_SPI_START + 114)
#define SPS_MTI_8 (GIC_SPI_START + 115)
#define SPS_MTI_9 (GIC_SPI_START + 116)
#define SPS_MTI_10 (GIC_SPI_START + 117)
#define SPS_MTI_11 (GIC_SPI_START + 118)
#define SPS_MTI_12 (GIC_SPI_START + 119)
#define SPS_MTI_13 (GIC_SPI_START + 120)
#define SPS_MTI_14 (GIC_SPI_START + 121)
#define SPS_MTI_15 (GIC_SPI_START + 122)
#define SPS_MTI_16 (GIC_SPI_START + 123)
#define SPS_MTI_17 (GIC_SPI_START + 124)
#define SPS_MTI_18 (GIC_SPI_START + 125)
#define SPS_MTI_19 (GIC_SPI_START + 126)
#define SPS_MTI_20 (GIC_SPI_START + 127)
#define SPS_MTI_21 (GIC_SPI_START + 128)
#define SPS_MTI_22 (GIC_SPI_START + 129)
#define SPS_MTI_23 (GIC_SPI_START + 130)
#define SPS_MTI_24 (GIC_SPI_START + 131)
#define SPS_MTI_25 (GIC_SPI_START + 132)
#define SPS_MTI_26 (GIC_SPI_START + 133)
#define SPS_MTI_27 (GIC_SPI_START + 134)
#define SPS_MTI_28 (GIC_SPI_START + 135)
#define SPS_MTI_29 (GIC_SPI_START + 136)
#define SPS_MTI_30 (GIC_SPI_START + 137)
#define SPS_MTI_31 (GIC_SPI_START + 138)
#define CSIPHY_0_4LN_IRQ (GIC_SPI_START + 139)
#define CSIPHY_1_2LN_IRQ (GIC_SPI_START + 140)
/* 141-145 Reserved */
#define GSBI1_UARTDM_IRQ (GIC_SPI_START + 146)
#define GSBI1_QUP_IRQ (GIC_SPI_START + 147)
#define GSBI2_UARTDM_IRQ (GIC_SPI_START + 148)
#define GSBI2_QUP_IRQ (GIC_SPI_START + 149)
#define GSBI3_UARTDM_IRQ (GIC_SPI_START + 150)
#define GSBI3_QUP_IRQ (GIC_SPI_START + 151)
#define GSBI4_UARTDM_IRQ (GIC_SPI_START + 152)
#define GSBI4_QUP_IRQ (GIC_SPI_START + 153)
#define GSBI5_UARTDM_IRQ (GIC_SPI_START + 154)
#define GSBI5_QUP_IRQ (GIC_SPI_START + 155)
/* 156-167 Reserved */
#define MSMC_SC_SEC_TMR_IRQ (GIC_SPI_START + 168)
#define MSMC_SC_SEC_WDOG_BARK_IRQ (GIC_SPI_START + 169)
#define ADM_0_SCSS_0_IRQ (GIC_SPI_START + 170)
#define ADM_0_SCSS_1_IRQ (GIC_SPI_START + 171)
#define ADM_0_SCSS_2_IRQ (GIC_SPI_START + 172)
#define ADM_0_SCSS_3_IRQ (GIC_SPI_START + 173)
/* 174 Reserved */
#define CC_SCSS_WDT1CPU0BITEEXPIRED (GIC_SPI_START + 175)
/* 176 Reserved */
#define CC_SCSS_WDT0CPU0BITEEXPIRED (GIC_SPI_START + 177)
#define TSENS_UPPER_LOWER_INT (GIC_SPI_START + 178)
/* 179-182 Reserved */
#define XPU_SUMMARY_IRQ (GIC_SPI_START + 183)
#define BUS_EXCEPTION_SUMMARY_IRQ (GIC_SPI_START + 184)
#define HSDDRX_EBI1CH0_IRQ (GIC_SPI_START + 185)
/* 186-208 Reserved */
#define A2_BAM_IRQ (GIC_SPI_START + 209)
/* 210-215 Reserved */
#define QDSS_ETB_IRQ (GIC_SPI_START + 216)
/* 216 Reserved */
#define QDSS_CTI2KPSS_CPU0_IRQ (GIC_SPI_START + 218)
#define TLMM_MSM_DIR_CONN_IRQ_16 (GIC_SPI_START + 219)
#define TLMM_MSM_DIR_CONN_IRQ_17 (GIC_SPI_START + 220)
#define TLMM_MSM_DIR_CONN_IRQ_18 (GIC_SPI_START + 221)
#define TLMM_MSM_DIR_CONN_IRQ_19 (GIC_SPI_START + 222)
#define TLMM_MSM_DIR_CONN_IRQ_20 (GIC_SPI_START + 223)
#define TLMM_MSM_DIR_CONN_IRQ_21 (GIC_SPI_START + 224)
#define MSM_SPARE0_IRQ (GIC_SPI_START + 225)
#define PMIC_SEC_IRQ_N (GIC_SPI_START + 226)
#define USB_HSIC_BAM_IRQ (GIC_SPI_START + 231)
#define USB_HSIC_IRQ (GIC_SPI_START + 232)
#define NR_MSM_IRQS 288
#define NR_GPIO_IRQS 88
#define NR_PM8018_IRQS 256
#define NR_WCD9XXX_IRQS 49
#define NR_TABLA_IRQS NR_WCD9XXX_IRQS
#define NR_BOARD_IRQS (NR_PM8018_IRQS + NR_WCD9XXX_IRQS)
#define NR_MSM_GPIOS NR_GPIO_IRQS
/* Backwards compatible IRQ macros. */
#define INT_ADM_AARM ADM_0_SCSS_0_IRQ
/* smd/smsm interrupts */
#define INT_A9_M2A_0 MSS_TO_APPS_IRQ_0
#define INT_A9_M2A_5 MSS_TO_APPS_IRQ_1
#define INT_ADSP_A11 LPASS_SCSS_GP_HIGH_IRQ
#define INT_ADSP_A11_SMSM LPASS_SCSS_GP_MEDIUM_IRQ
#endif
@@ -0,0 +1,25 @@
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IRQS_9625_H
#define __ASM_ARCH_MSM_IRQS_9625_H
/* MSM ACPU Interrupt Numbers */
#define INT_ARMQC_PERFMON (GIC_PPI_START + 7)
#define APCC_QGICL2PERFMONIRPTREQ (GIC_SPI_START + 1)
#define SC_SICL2PERFMONIRPTREQ APCC_QGICL2PERFMONIRPTREQ
#define NR_TLMM_MSM_DIR_CONN_IRQ 8 /*Need to Verify this Count*/
#endif
@@ -0,0 +1,99 @@
/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MSM_IRQS_FSM9XXX_H
#define __ASM_ARCH_MSM_IRQS_FSM9XXX_H
/* MSM ACPU Interrupt Numbers */
#define INT_DEBUG_TIMER_EXP 0
#define INT_GPT0_TIMER_EXP 1
#define INT_GPT1_TIMER_EXP 2
#define INT_WDT0_ACCSCSSBARK 3
#define INT_WDT1_ACCSCSSBARK 4
#define INT_AVS_SVIC 5
#define INT_AVS_SVIC_SW_DONE 6
#define INT_SC_DBG_RX_FULL 7
#define INT_SC_DBG_TX_EMPTY 8
#define INT_ARMQC_PERFMON 9
#define INT_AVS_REQ_DOWN 10
#define INT_AVS_REQ_UP 11
#define INT_SC_ACG 12
/* SCSS_VICFIQSTS0[13:15] are RESERVED */
#define INT_BPU_CPU 16
#define INT_L2_SVICDMANSIRPTREQ 17
#define INT_L2_SVICDMASIRPTREQ 18
#define INT_L2_SVICSLVIRPTREQ 19
#define INT_SEAWOLF_IRQ0 20
#define INT_SEAWOLF_IRQ1 21
#define INT_SEAWOLF_IRQ2 22
#define INT_SEAWOLF_IRQ3 23
#define INT_CARIBE_SUPSS_IRQ 24
#define INT_ADM_SEC0_IRQ 25
/* SCSS_VICFIQSTS0[26] is RESERVED */
#define INT_GMII_PHY 27
#define INT_SBD_IRQ 28
#define INT_HH_SUPSS_IRQ 29
#define INT_EMAC_SBD_IRQ 30
#define INT_PERPH_SUPSS_IRQ 31
#define INT_Q6_SW_IRQ_0 (32 + 0)
#define INT_Q6_SW_IRQ_1 (32 + 1)
#define INT_Q6_SW_IRQ_2 (32 + 2)
#define INT_Q6_SW_IRQ_3 (32 + 3)
#define INT_Q6_SW_IRQ_4 (32 + 4)
#define INT_Q6_SW_IRQ_5 (32 + 5)
#define INT_Q6_SW_IRQ_6 (32 + 6)
#define INT_Q6_SW_IRQ_7 (32 + 7)
#define INT_IMEM_IRQ (32 + 8)
#define INT_IMEM_ECC_IRQ (32 + 9)
#define INT_HSDDRX_IRQ (32 + 10)
#define INT_BUFMEM_XPU_IRQ (32 + 11)
#define INT_A9_M2A_0 (32 + 12)
#define INT_A9_M2A_1 (32 + 13)
#define INT_A9_M2A_2 (32 + 14)
#define INT_A9_M2A_3 (32 + 15)
#define INT_A9_M2A_4 (32 + 16)
#define INT_A9_M2A_5 (32 + 17)
#define INT_A9_M2A_6 (32 + 18)
#define INT_A9_M2A_7 (32 + 19)
#define INT_SC_PRI_IRQ (32 + 20)
#define INT_SC_SEC_IRQ (32 + 21)
#define INT_Q6_WDOG_IRQ (32 + 22)
#define INT_ADM_SEC3_IRQ (32 + 23)
#define INT_ARM_WAKE_IRQ (32 + 24)
#define INT_ARM_WDOG_IRQ (32 + 25)
#define INT_SUPSS_CFG_XPU_IRQ (32 + 26)
#define INT_SPB_XPU_IRQ (32 + 27)
#define INT_FPB_XPU_IRQ (32 + 28)
#define INT_Q6_XPU_IRQ (32 + 29)
/* SCSS_VICFIQSTS1[30:31] are RESERVED */
/* SCSS_VICFIQSTS2[0:31] are RESERVED */
/* SCSS_VICFIQSTS3[0:31] are RESERVED */
/* Retrofit universal macro names */
#define INT_ADM_AARM INT_ADM_SEC3_IRQ
#define INT_GP_TIMER_EXP INT_GPT0_TIMER_EXP
#define INT_ADSP_A11 INT_Q6_SW_IRQ_0
#define INT_ADSP_A11_SMSM INT_ADSP_A11
#define INT_SIRC_0 INT_PERPH_SUPSS_IRQ
#define WDT0_ACCSCSSNBARK_INT INT_WDT0_ACCSCSSBARK
#define NR_MSM_IRQS 128
#define NR_GPIO_IRQS 0
#define PMIC8058_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_SIRC_IRQS)
#define NR_PMIC8058_IRQS 256
#define NR_BOARD_IRQS (NR_SIRC_IRQS + NR_PMIC8058_IRQS)
#define NR_MSM_GPIOS 168
#endif /* __ASM_ARCH_MSM_IRQS_FSM9XXX_H */
@@ -0,0 +1,136 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2008-2013, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MSM_IRQS_H
#define __ASM_ARCH_MSM_IRQS_H
/*
* 0-15: STI/SGI (software triggered/generated interrupts)
* 16-31: PPI (private peripheral interrupts)
* 32+: SPI (shared peripheral interrupts)
*/
#define GIC_PPI_START 16
#define GIC_SPI_START 32
#define MSM_IRQ_BIT(irq) (1 << ((irq) & 31))
#if defined(CONFIG_ARCH_MSM8974) || defined(CONFIG_ARCH_MPQ8092)
#ifdef CONFIG_ARCH_MSM8974
#include "irqs-8974.h"
#endif
#ifdef CONFIG_ARCH_MPQ8092
#include "irqs-8092.h"
#endif
#elif defined(CONFIG_ARCH_MSM8960) || defined(CONFIG_ARCH_APQ8064) || \
defined(CONFIG_ARCH_MSM8930)
#ifdef CONFIG_ARCH_MSM8960
#include "irqs-8960.h"
#endif
#ifdef CONFIG_ARCH_MSM8930
#include "irqs-8930.h"
#endif
#ifdef CONFIG_ARCH_APQ8064
#include "irqs-8064.h"
#endif
/* For now, use the maximum number of interrupts until a pending GIC issue
* is sorted out */
#define NR_MSM_IRQS 288
#define NR_GPIO_IRQS 152
#define NR_PM8921_IRQS 256
#define NR_PM8821_IRQS 112
#define NR_WCD9XXX_IRQS 49
#define NR_TABLA_IRQS NR_WCD9XXX_IRQS
#define NR_GPIO_EXPANDER_IRQS 64
#ifdef CONFIG_PCI_MSI
#define NR_PCIE_MSI_IRQS 256
#define NR_BOARD_IRQS (NR_PM8921_IRQS + NR_PM8821_IRQS + \
NR_WCD9XXX_IRQS + NR_GPIO_EXPANDER_IRQS + NR_PCIE_MSI_IRQS)
#else
#define NR_BOARD_IRQS (NR_PM8921_IRQS + NR_PM8821_IRQS + \
NR_WCD9XXX_IRQS + NR_GPIO_EXPANDER_IRQS)
#endif
#define NR_MSM_GPIOS NR_GPIO_IRQS
#else
#if defined(CONFIG_ARCH_MSM9615)
#include "irqs-9615.h"
#elif defined(CONFIG_ARCH_MSM9625)
#include "irqs-9625.h"
#elif defined(CONFIG_ARCH_MSM7X30)
#include "irqs-7x30.h"
#elif defined(CONFIG_ARCH_QSD8X50)
#include "irqs-8x50.h"
#include "sirc.h"
#elif defined(CONFIG_ARCH_MSM8X60)
#include "irqs-8x60.h"
#elif defined(CONFIG_ARCH_MSM7X01A) || defined(CONFIG_ARCH_MSM7X25) \
|| defined(CONFIG_ARCH_MSM7X27) || defined(CONFIG_ARCH_MSM8625)
#include "irqs-8625.h"
#include "irqs-7xxx.h"
#define NR_GPIO_IRQS 133
#define NR_MSM_IRQS 256
#define NR_BOARD_IRQS 256
#define NR_MSM_GPIOS NR_GPIO_IRQS
#elif defined(CONFIG_ARCH_FSM9XXX)
#include "irqs-fsm9xxx.h"
#include "sirc.h"
#endif
#endif
#if !defined(CONFIG_SPARSE_IRQ)
#if defined(CONFIG_ARCH_MSM8974) || defined(CONFIG_ARCH_MPQ8092)
#define NR_MSM_IRQS 1020 /* Should be 256 - but higher due to bug in sim */
#define NR_GPIO_IRQS 146
#define NR_QPNP_IRQS 32768
#define NR_BOARD_IRQS NR_QPNP_IRQS
#elif defined(CONFIG_ARCH_MSM8610) || defined(CONFIG_ARCH_MSM8226)
#define NR_MSM_IRQS 256
#define NR_GPIO_IRQS 117
#define NR_QPNP_IRQS 32768
#define NR_BOARD_IRQS NR_QPNP_IRQS
#elif defined(CONFIG_ARCH_MSM9625)
#define NR_MSM_IRQS 288
#define NR_GPIO_IRQS 76
#define NR_BOARD_IRQS 0
#endif
#define NR_IRQS (NR_MSM_IRQS + NR_GPIO_IRQS + NR_BOARD_IRQS)
#define MSM_GPIO_TO_INT(n) (NR_MSM_IRQS + (n))
#define FIRST_GPIO_IRQ MSM_GPIO_TO_INT(0)
#define MSM_INT_TO_REG(base, irq) (base + irq / 32)
#endif
#if defined(CONFIG_PCI_MSI) && defined(CONFIG_MSM_PCIE)
#define MSM_PCIE_MSI_INT(n) (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS + \
NR_PM8821_IRQS + NR_TABLA_IRQS + NR_GPIO_EXPANDER_IRQS + (n))
#endif
#endif
@@ -0,0 +1,24 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MACH_JTAG_H
#define __MACH_JTAG_H
#if defined(CONFIG_MSM_JTAG) || defined(CONFIG_MSM_JTAG_MM)
extern void msm_jtag_save_state(void);
extern void msm_jtag_restore_state(void);
#else
static inline void msm_jtag_save_state(void) {}
static inline void msm_jtag_restore_state(void) {}
#endif
#endif
@@ -0,0 +1,96 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _ARCH_ARM_MACH_KGSL_H
#define _ARCH_ARM_MACH_KGSL_H
/* Clock flags to show which clocks should be controled by a given platform */
#define KGSL_CLK_SRC 0x00000001
#define KGSL_CLK_CORE 0x00000002
#define KGSL_CLK_IFACE 0x00000004
#define KGSL_CLK_MEM 0x00000008
#define KGSL_CLK_MEM_IFACE 0x00000010
#define KGSL_CLK_AXI 0x00000020
#define KGSL_CLK_ALT_MEM_IFACE 0x00000040
#define KGSL_MAX_PWRLEVELS 10
#define KGSL_CONVERT_TO_MBPS(val) \
(val*1000*1000U)
#define KGSL_3D0_REG_MEMORY "kgsl_3d0_reg_memory"
#define KGSL_3D0_SHADER_MEMORY "kgsl_3d0_shader_memory"
#define KGSL_3D0_IRQ "kgsl_3d0_irq"
#define KGSL_2D0_REG_MEMORY "kgsl_2d0_reg_memory"
#define KGSL_2D0_IRQ "kgsl_2d0_irq"
#define KGSL_2D1_REG_MEMORY "kgsl_2d1_reg_memory"
#define KGSL_2D1_IRQ "kgsl_2d1_irq"
#define ADRENO_CHIPID(_co, _ma, _mi, _pa) \
((((_co) & 0xFF) << 24) | \
(((_ma) & 0xFF) << 16) | \
(((_mi) & 0xFF) << 8) | \
((_pa) & 0xFF))
enum kgsl_iommu_context_id {
KGSL_IOMMU_CONTEXT_USER = 0,
KGSL_IOMMU_CONTEXT_PRIV = 1,
};
struct kgsl_iommu_ctx {
const char *iommu_ctx_name;
enum kgsl_iommu_context_id ctx_id;
};
/*
* struct kgsl_device_iommu_data - Struct holding iommu context data obtained
* from dtsi file
* @iommu_ctxs: Pointer to array of struct hoding context name and id
* @iommu_ctx_count: Number of contexts defined in the dtsi file
* @iommu_halt_enable: Indicated if smmu halt h/w feature is supported
* @physstart: Start of iommu registers physical address
* @physend: End of iommu registers physical address
*/
struct kgsl_device_iommu_data {
const struct kgsl_iommu_ctx *iommu_ctxs;
int iommu_ctx_count;
int iommu_halt_enable;
unsigned int physstart;
unsigned int physend;
};
struct kgsl_pwrlevel {
unsigned int gpu_freq;
unsigned int bus_freq;
unsigned int io_fraction;
};
struct kgsl_device_platform_data {
struct kgsl_pwrlevel pwrlevel[KGSL_MAX_PWRLEVELS];
int init_level;
int num_levels;
int (*set_grp_async)(void);
unsigned int idle_timeout;
bool strtstp_sleepwake;
unsigned int clk_map;
unsigned int idle_needed;
unsigned int step_mul;
struct msm_bus_scale_pdata *bus_scale_table;
struct kgsl_device_iommu_data *iommu_data;
int iommu_count;
struct msm_dcvs_core_info *core_info;
struct coresight_device *csdev;
struct coresight_platform_data *coresight_pdata;
unsigned int chipid;
};
#endif
@@ -0,0 +1,19 @@
/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _ARCH_ARM_MACH_MSM_MDM_PERIPHERAL_H
#define _ARCH_ARM_MACH_MSM_MDM_PERIPHERAL_H_
extern void peripheral_connect(void);
extern void peripheral_disconnect(void);
#endif
@@ -0,0 +1,35 @@
/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _ARCH_ARM_MACH_MSM_MDM_H
#define _ARXH_ARM_MACH_MSM_MDM_H
struct charm_platform_data {
void (*charm_modem_on)(void);
void (*charm_modem_off)(void);
};
#define AP2MDM_STATUS 136
#define MDM2AP_STATUS 134
#define MDM2AP_WAKEUP 40
#define MDM2AP_ERRFATAL 133
#define AP2MDM_ERRFATAL 93
#define AP2MDM_PMIC_RESET_N 131
#define AP2MDM_KPDPWR_N 132
#define AP2PMIC_TMPNI_CKEN 141
#define AP2MDM_WAKEUP 135
extern void (*charm_intentional_reset)(void);
#endif
@@ -0,0 +1,45 @@
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _ARCH_ARM_MACH_MSM_MDM2_H
#define _ARCH_ARM_MACH_MSM_MDM2_H
#include "sysmon.h"
struct mdm_vddmin_resource {
int rpm_id;
int ap2mdm_vddmin_gpio;
unsigned int modes;
unsigned int drive_strength;
int mdm2ap_vddmin_gpio;
};
struct mdm_platform_data {
char *mdm_version;
int ramdump_delay_ms;
int ps_hold_delay_ms;
int soft_reset_inverted;
int early_power_on;
int sfr_query;
int no_powerdown_after_ramdumps;
struct mdm_vddmin_resource *vddmin_resource;
struct platform_device *peripheral_platform_device;
const unsigned int ramdump_timeout_ms;
int image_upgrade_supported;
struct gpiomux_setting *mdm2ap_status_gpio_run_cfg;
int send_shdn;
int cascading_ssr;
int sysmon_subsys_id_valid;
enum subsys_id sysmon_subsys_id;
};
#endif
@@ -0,0 +1,157 @@
/* arch/arm/mach-msm/include/mach/memory.h
*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MEMORY_H
#define __ASM_ARCH_MEMORY_H
#include <linux/types.h>
/* physical offset of RAM */
#define PLAT_PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)
#define MAX_PHYSMEM_BITS 32
#define SECTION_SIZE_BITS 28
/* Maximum number of Memory Regions
* The largest system can have 4 memory banks, each divided into 8 regions
*/
#define MAX_NR_REGIONS 32
/* The number of regions each memory bank is divided into */
#define NR_REGIONS_PER_BANK 8
/* Certain configurations of MSM7x30 have multiple memory banks.
* One or more of these banks can contain holes in the memory map as well.
* These macros define appropriate conversion routines between the physical
* and virtual address domains for supporting these configurations using
* SPARSEMEM and a 3G/1G VM split.
*/
#if defined(CONFIG_ARCH_MSM7X30)
#define EBI0_PHYS_OFFSET PHYS_OFFSET
#define EBI0_PAGE_OFFSET PAGE_OFFSET
#define EBI0_SIZE 0x10000000
#ifndef __ASSEMBLY__
extern unsigned long ebi1_phys_offset;
#define EBI1_PHYS_OFFSET (ebi1_phys_offset)
#define EBI1_PAGE_OFFSET (EBI0_PAGE_OFFSET + EBI0_SIZE)
#if (defined(CONFIG_SPARSEMEM) && defined(CONFIG_VMSPLIT_3G))
#define __phys_to_virt(phys) \
((phys) >= EBI1_PHYS_OFFSET ? \
(phys) - EBI1_PHYS_OFFSET + EBI1_PAGE_OFFSET : \
(phys) - EBI0_PHYS_OFFSET + EBI0_PAGE_OFFSET)
#define __virt_to_phys(virt) \
((virt) >= EBI1_PAGE_OFFSET ? \
(virt) - EBI1_PAGE_OFFSET + EBI1_PHYS_OFFSET : \
(virt) - EBI0_PAGE_OFFSET + EBI0_PHYS_OFFSET)
#endif
#endif
#endif
#ifndef __ASSEMBLY__
void *allocate_contiguous_ebi(unsigned long, unsigned long, int);
phys_addr_t allocate_contiguous_ebi_nomap(unsigned long, unsigned long);
void clean_and_invalidate_caches(unsigned long, unsigned long, unsigned long);
void clean_caches(unsigned long, unsigned long, unsigned long);
void invalidate_caches(unsigned long, unsigned long, unsigned long);
int msm_get_memory_type_from_name(const char *memtype_name);
unsigned long get_ddr_size(void);
#if defined(CONFIG_ARCH_MSM_ARM11) || defined(CONFIG_ARCH_MSM_CORTEX_A5)
void write_to_strongly_ordered_memory(void);
void map_page_strongly_ordered(void);
#endif
#ifdef CONFIG_CACHE_L2X0
extern void l2x0_cache_sync(void);
#define finish_arch_switch(prev) do { l2x0_cache_sync(); } while (0)
#endif
#if defined(CONFIG_ARCH_MSM8X60) || defined(CONFIG_ARCH_MSM8960)
extern void store_ttbr0(void);
#define finish_arch_switch(prev) do { store_ttbr0(); } while (0)
#endif
#define MAX_HOLE_ADDRESS (PHYS_OFFSET + 0x10000000)
extern phys_addr_t memory_hole_offset;
extern phys_addr_t memory_hole_start;
extern phys_addr_t memory_hole_end;
extern unsigned long memory_hole_align;
extern unsigned long virtual_hole_start;
extern unsigned long virtual_hole_end;
#ifdef CONFIG_DONT_MAP_HOLE_AFTER_MEMBANK0
void find_memory_hole(void);
#define MEM_HOLE_END_PHYS_OFFSET (memory_hole_end)
#define MEM_HOLE_PAGE_OFFSET (PAGE_OFFSET + memory_hole_offset + \
memory_hole_align)
#define __phys_to_virt(phys) \
(unsigned long)\
((MEM_HOLE_END_PHYS_OFFSET && ((phys) >= MEM_HOLE_END_PHYS_OFFSET)) ? \
(phys) - MEM_HOLE_END_PHYS_OFFSET + MEM_HOLE_PAGE_OFFSET : \
(phys) - PHYS_OFFSET + PAGE_OFFSET)
#define __virt_to_phys(virt) \
(unsigned long)\
((MEM_HOLE_END_PHYS_OFFSET && ((virt) >= MEM_HOLE_PAGE_OFFSET)) ? \
(virt) - MEM_HOLE_PAGE_OFFSET + MEM_HOLE_END_PHYS_OFFSET : \
(virt) - PAGE_OFFSET + PHYS_OFFSET)
#endif
/*
* Need a temporary unique variable that no one will ever see to
* hold the compat string. Line number gives this easily.
* Need another layer of indirection to get __LINE__ to expand
* properly as opposed to appending and ending up with
* __compat___LINE__
*/
#define __CONCAT(a, b) ___CONCAT(a, b)
#define ___CONCAT(a, b) a ## b
#define EXPORT_COMPAT(com) \
static char *__CONCAT(__compat_, __LINE__) __used \
__attribute((__section__(".exportcompat.init"))) = com
extern char *__compat_exports_start[];
extern char *__compat_exports_end[];
#endif
#if defined CONFIG_ARCH_MSM_SCORPION || defined CONFIG_ARCH_MSM_KRAIT
#define arch_has_speculative_dfetch() 1
#endif
#endif
/* these correspond to values known by the modem */
#define MEMORY_DEEP_POWERDOWN 0
#define MEMORY_SELF_REFRESH 1
#define MEMORY_ACTIVE 2
#define NPA_MEMORY_NODE_NAME "/mem/apps/ddr_dpd"
#ifndef CONFIG_ARCH_MSM7X27
#define CONSISTENT_DMA_SIZE (SZ_1M * 14)
#endif
@@ -0,0 +1,30 @@
/*
* arch/arm/include/asm/mach/mmc.h
*/
#ifndef ASMARM_MACH_MMC_H
#define ASMARM_MACH_MMC_H
#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
#include <linux/mmc/sdio_func.h>
struct msm_mmc_gpio {
unsigned no;
const char *name;
};
struct msm_mmc_gpio_data {
struct msm_mmc_gpio *gpio;
u8 size;
};
struct msm_mmc_platform_data {
unsigned int ocr_mask; /* available voltages */
u32 (*translate_vdd)(struct device *, unsigned int);
unsigned int (*status)(struct device *);
int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id);
struct msm_mmc_gpio_data *gpio_data;
void (*init_card)(struct mmc_card *card);
};
#endif
+166
View File
@@ -0,0 +1,166 @@
/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ARCH_ARM_MACH_MSM_MPM_H
#define __ARCH_ARM_MACH_MSM_MPM_H
#include <linux/types.h>
#include <linux/list.h>
#define MSM_MPM_NR_MPM_IRQS 64
struct msm_mpm_device_data {
uint16_t *irqs_m2a;
unsigned int irqs_m2a_size;
uint16_t *bypassed_apps_irqs;
unsigned int bypassed_apps_irqs_size;
void __iomem *mpm_request_reg_base;
void __iomem *mpm_status_reg_base;
void __iomem *mpm_apps_ipc_reg;
unsigned int mpm_apps_ipc_val;
unsigned int mpm_ipc_irq;
};
extern struct msm_mpm_device_data msm8660_mpm_dev_data;
extern struct msm_mpm_device_data msm8960_mpm_dev_data;
extern struct msm_mpm_device_data msm9615_mpm_dev_data;
extern struct msm_mpm_device_data apq8064_mpm_dev_data;
void msm_mpm_irq_extn_init(struct msm_mpm_device_data *mpm_data);
#if defined(CONFIG_MSM_MPM) || defined(CONFIG_MSM_MPM_OF)
/**
* msm_mpm_enable_pin() - Enable/Disable a MPM pin for idle wakeups.
*
* @pin: MPM pin to set
* @enable: enable/disable the pin
*
* returns 0 on success or errorno
*
* Drivers can call the function to configure MPM pins for wakeup from idle low
* power modes. The API provides a direct access to the configuring MPM pins
* that are not connected to a IRQ/GPIO
*/
int msm_mpm_enable_pin(unsigned int pin, unsigned int enable);
/**
* msm_mpm_set_pin_wake() - Enable/Disable a MPM pin during suspend
*
* @pin: MPM pin to set
* @enable: enable/disable the pin as wakeup
*
* returns 0 on success or errorno
*
* Drivers can call the function to configure MPM pins for wakeup from suspend
* low power modes. The API provides a direct access to the configuring MPM pins
* that are not connected to a IRQ/GPIO
*/
int msm_mpm_set_pin_wake(unsigned int pin, unsigned int on);
/**
* msm_mpm_set_pin_type() - Set the flowtype of a MPM pin.
*
* @pin: MPM pin to configure
* @flow_type: flowtype of the MPM pin.
*
* returns 0 on success or errorno
*
* Drivers can call the function to configure the flowtype of the MPM pins
* The API provides a direct access to the configuring MPM pins that are not
* connected to a IRQ/GPIO
*/
int msm_mpm_set_pin_type(unsigned int pin, unsigned int flow_type);
/**
* msm_mpm_irqs_detectable() - Check if active irqs can be monitored by MPM
*
* @from_idle: indicates if the sytem is entering low power mode as a part of
* suspend/idle task.
*
* returns true if all active interrupts can be monitored by the MPM
*
* Low power management code calls into this API to check if all active
* interrupts can be monitored by MPM and choose a level such that all active
* interrupts can wake the system up from low power mode.
*/
bool msm_mpm_irqs_detectable(bool from_idle);
/**
* msm_mpm_gpio_detectable() - Check if active gpio irqs can be monitored by
* MPM
*
* @from_idle: indicates if the sytem is entering low power mode as a part of
* suspend/idle task.
*
* returns true if all active GPIO interrupts can be monitored by the MPM
*
* Low power management code calls into this API to check if all active
* GPIO interrupts can be monitored by MPM and choose a level such that all
* active interrupts can wake the system up from low power mode.
*/
bool msm_mpm_gpio_irqs_detectable(bool from_idle);
/**
* msm_mpm_enter_sleep() -Called from PM code before entering low power mode
*
* @sclk_count: wakeup time in sclk counts for programmed RPM wakeup
* @from_idle: indicates if the sytem is entering low power mode as a part of
* suspend/idle task.
*
* Low power management code calls into this API to configure the MPM to
* monitor the active irqs before going to sleep.
*/
void msm_mpm_enter_sleep(uint32_t sclk_count, bool from_idle);
/**
* msm_mpm_exit_sleep() -Called from PM code after resuming from low power mode
*
* @from_idle: indicates if the sytem is entering low power mode as a part of
* suspend/idle task.
*
* Low power management code calls into this API to query the MPM for the
* wakeup source and retriggering the appropriate interrupt.
*/
void msm_mpm_exit_sleep(bool from_idle);
/**
* of_mpm_init() - Device tree initialization function
*
* @node: MPM device tree node.
*
* The initialization function is called from the machine irq function after
* GPIO/GIC device initialization routines are called. MPM driver keeps track
* of all enabled/wakeup interrupts in the system to be able to configure MPM
* when entering a system wide low power mode. The MPM is a alway-on low power
* hardware block that monitors 64 wakeup interrupts when the system is in a
* low power mode. The initialization function constructs the MPM mapping
* between the IRQs and the MPM pin based on data in the device tree.
*/
void __init of_mpm_init(struct device_node *node);
#else
static inline int msm_mpm_enable_irq(unsigned int irq, unsigned int enable)
{ return -ENODEV; }
static inline int msm_mpm_set_irq_wake(unsigned int irq, unsigned int on)
{ return -ENODEV; }
static inline int msm_mpm_set_irq_type(unsigned int irq, unsigned int flow_type)
{ return -ENODEV; }
static inline int msm_mpm_enable_pin(unsigned int pin, unsigned int enable)
{ return -ENODEV; }
static inline int msm_mpm_set_pin_wake(unsigned int pin, unsigned int on)
{ return -ENODEV; }
static inline int msm_mpm_set_pin_type(unsigned int pin,
unsigned int flow_type)
{ return -ENODEV; }
static inline bool msm_mpm_irqs_detectable(bool from_idle)
{ return false; }
static inline bool msm_mpm_gpio_irqs_detectable(bool from_idle)
{ return false; }
static inline void msm_mpm_enter_sleep(uint32_t sclk_count, bool from_idle) {}
static inline void msm_mpm_exit_sleep(bool from_idle) {}
static inline void __init of_mpm_init(struct device_node *node) {}
#endif
#endif /* __ARCH_ARM_MACH_MSM_MPM_H */
+276
View File
@@ -0,0 +1,276 @@
/* Copyright (c) 2008-2010, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ARCH_ARM_MACH_MSM_MPP_H
#define __ARCH_ARM_MACH_MSM_MPP_H
#ifdef CONFIG_PMIC8058
#define MPPS 12
#else
#define MPPS 22
#endif
/* Digital Logical Output Level */
enum {
MPP_DLOGIC_LVL_MSME,
MPP_DLOGIC_LVL_MSMP,
MPP_DLOGIC_LVL_RUIM,
MPP_DLOGIC_LVL_MMC,
MPP_DLOGIC_LVL_VDD,
};
/* Digital Logical Output Control Value */
enum {
MPP_DLOGIC_OUT_CTRL_LOW,
MPP_DLOGIC_OUT_CTRL_HIGH,
MPP_DLOGIC_OUT_CTRL_MPP, /* MPP Output = MPP Input */
MPP_DLOGIC_OUT_CTRL_NOT_MPP, /* MPP Output = Inverted MPP Input */
};
/* Digital Logical Input Value */
enum {
MPP_DLOGIC_IN_DBUS_NONE,
MPP_DLOGIC_IN_DBUS_1,
MPP_DLOGIC_IN_DBUS_2,
MPP_DLOGIC_IN_DBUS_3,
};
#define MPP_CFG(level, control) ((((level) & 0x0FFFF) << 16) | \
((control) & 0x0FFFF))
#define MPP_CFG_INPUT(level, dbus) ((((level) & 0x0FFFF) << 16) | \
((dbus) & 0x0FFFF))
/* Use mpp number starting from 0 */
int mpp_config_digital_out(unsigned mpp, unsigned config);
int mpp_config_digital_in(unsigned mpp, unsigned config);
/* PM8058/PM8901 definitions */
/* APIs */
#ifdef CONFIG_PMIC8058
int pm8058_mpp_config(unsigned mpp, unsigned type, unsigned level,
unsigned control);
#else
static inline int pm8058_mpp_config(unsigned mpp, unsigned type,
unsigned level, unsigned control)
{
return -EINVAL;
}
#endif
#ifdef CONFIG_PMIC8901
int pm8901_mpp_config(unsigned mpp, unsigned type, unsigned level,
unsigned control);
#else
static inline int pm8901_mpp_config(unsigned mpp, unsigned type,
unsigned level, unsigned control)
{
return -EINVAL;
}
#endif
/* MPP Type: type */
#define PM_MPP_TYPE_D_INPUT 0
#define PM_MPP_TYPE_D_OUTPUT 1
#define PM_MPP_TYPE_D_BI_DIR 2
#define PM_MPP_TYPE_A_INPUT 3
#define PM_MPP_TYPE_A_OUTPUT 4
#define PM_MPP_TYPE_SINK 5
#define PM_MPP_TYPE_DTEST_SINK 6
#define PM_MPP_TYPE_DTEST_OUTPUT 7
/* Digital Input/Output: level [8058] */
#define PM8058_MPP_DIG_LEVEL_VPH 0
#define PM8058_MPP_DIG_LEVEL_S3 1
#define PM8058_MPP_DIG_LEVEL_L2 2
#define PM8058_MPP_DIG_LEVEL_L3 3
/* Digital Input/Output: level [8901] */
#define PM8901_MPP_DIG_LEVEL_MSMIO 0
#define PM8901_MPP_DIG_LEVEL_DIG 1
#define PM8901_MPP_DIG_LEVEL_L5 2
#define PM8901_MPP_DIG_LEVEL_S4 3
#define PM8901_MPP_DIG_LEVEL_VPH 4
/* Digital Input: control */
#define PM_MPP_DIN_TO_INT 0
#define PM_MPP_DIN_TO_DBUS1 1
#define PM_MPP_DIN_TO_DBUS2 2
#define PM_MPP_DIN_TO_DBUS3 3
/* Digital Output: control */
#define PM_MPP_DOUT_CTL_LOW 0
#define PM_MPP_DOUT_CTL_HIGH 1
#define PM_MPP_DOUT_CTL_MPP 2
#define PM_MPP_DOUT_CTL_INV_MPP 3
/* Bidirectional: control */
#define PM_MPP_BI_PULLUP_1KOHM 0
#define PM_MPP_BI_PULLUP_OPEN 1
#define PM_MPP_BI_PULLUP_10KOHM 2
#define PM_MPP_BI_PULLUP_30KOHM 3
/* Analog Input: level */
#define PM_MPP_AIN_AMUX_CH5 0
#define PM_MPP_AIN_AMUX_CH6 1
#define PM_MPP_AIN_AMUX_CH7 2
#define PM_MPP_AIN_AMUX_CH8 3
#define PM_MPP_AIN_AMUX_CH9 4
#define PM_MPP_AIN_AMUX_ABUS1 5
#define PM_MPP_AIN_AMUX_ABUS2 6
#define PM_MPP_AIN_AMUX_ABUS3 7
/* Analog Output: level */
#define PM_MPP_AOUT_LVL_1V25 0
#define PM_MPP_AOUT_LVL_1V25_2 1
#define PM_MPP_AOUT_LVL_0V625 2
#define PM_MPP_AOUT_LVL_0V3125 3
#define PM_MPP_AOUT_LVL_MPP 4
#define PM_MPP_AOUT_LVL_ABUS1 5
#define PM_MPP_AOUT_LVL_ABUS2 6
#define PM_MPP_AOUT_LVL_ABUS3 7
/* Analog Output: control */
#define PM_MPP_AOUT_CTL_DISABLE 0
#define PM_MPP_AOUT_CTL_ENABLE 1
#define PM_MPP_AOUT_CTL_MPP_HIGH_EN 2
#define PM_MPP_AOUT_CTL_MPP_LOW_EN 3
/* Current Sink: level */
#define PM_MPP_CS_OUT_5MA 0
#define PM_MPP_CS_OUT_10MA 1
#define PM_MPP_CS_OUT_15MA 2
#define PM_MPP_CS_OUT_20MA 3
#define PM_MPP_CS_OUT_25MA 4
#define PM_MPP_CS_OUT_30MA 5
#define PM_MPP_CS_OUT_35MA 6
#define PM_MPP_CS_OUT_40MA 7
/* Current Sink: control */
#define PM_MPP_CS_CTL_DISABLE 0
#define PM_MPP_CS_CTL_ENABLE 1
#define PM_MPP_CS_CTL_MPP_HIGH_EN 2
#define PM_MPP_CS_CTL_MPP_LOW_EN 3
/* DTEST Current Sink: control */
#define PM_MPP_DTEST_CS_CTL_EN1 0
#define PM_MPP_DTEST_CS_CTL_EN2 1
#define PM_MPP_DTEST_CS_CTL_EN3 2
#define PM_MPP_DTEST_CS_CTL_EN4 3
/* DTEST Digital Output: control */
#define PM_MPP_DTEST_DBUS1 0
#define PM_MPP_DTEST_DBUS2 1
#define PM_MPP_DTEST_DBUS3 2
#define PM_MPP_DTEST_DBUS4 3
/* Helper APIs */
static inline int pm8058_mpp_config_digital_in(unsigned mpp, unsigned level,
unsigned control)
{
return pm8058_mpp_config(mpp, PM_MPP_TYPE_D_INPUT, level, control);
}
static inline int pm8058_mpp_config_digital_out(unsigned mpp, unsigned level,
unsigned control)
{
return pm8058_mpp_config(mpp, PM_MPP_TYPE_D_OUTPUT, level, control);
}
static inline int pm8058_mpp_config_bi_dir(unsigned mpp, unsigned level,
unsigned control)
{
return pm8058_mpp_config(mpp, PM_MPP_TYPE_D_BI_DIR, level, control);
}
static inline int pm8058_mpp_config_analog_input(unsigned mpp, unsigned level,
unsigned control)
{
return pm8058_mpp_config(mpp, PM_MPP_TYPE_A_INPUT, level, control);
}
static inline int pm8058_mpp_config_analog_output(unsigned mpp, unsigned level,
unsigned control)
{
return pm8058_mpp_config(mpp, PM_MPP_TYPE_A_OUTPUT, level, control);
}
static inline int pm8058_mpp_config_current_sink(unsigned mpp, unsigned level,
unsigned control)
{
return pm8058_mpp_config(mpp, PM_MPP_TYPE_SINK, level, control);
}
static inline int pm8058_mpp_config_dtest_sink(unsigned mpp, unsigned level,
unsigned control)
{
return pm8058_mpp_config(mpp, PM_MPP_TYPE_DTEST_SINK, level, control);
}
static inline int pm8058_mpp_config_dtest_output(unsigned mpp, unsigned level,
unsigned control)
{
return pm8058_mpp_config(mpp, PM_MPP_TYPE_DTEST_OUTPUT,
level, control);
}
static inline int pm8901_mpp_config_digital_in(unsigned mpp, unsigned level,
unsigned control)
{
return pm8901_mpp_config(mpp, PM_MPP_TYPE_D_INPUT, level, control);
}
static inline int pm8901_mpp_config_digital_out(unsigned mpp, unsigned level,
unsigned control)
{
return pm8901_mpp_config(mpp, PM_MPP_TYPE_D_OUTPUT, level, control);
}
static inline int pm8901_mpp_config_bi_dir(unsigned mpp, unsigned level,
unsigned control)
{
return pm8901_mpp_config(mpp, PM_MPP_TYPE_D_BI_DIR, level, control);
}
static inline int pm8901_mpp_config_analog_input(unsigned mpp, unsigned level,
unsigned control)
{
return pm8901_mpp_config(mpp, PM_MPP_TYPE_A_INPUT, level, control);
}
static inline int pm8901_mpp_config_analog_output(unsigned mpp, unsigned level,
unsigned control)
{
return pm8901_mpp_config(mpp, PM_MPP_TYPE_A_OUTPUT, level, control);
}
static inline int pm8901_mpp_config_current_sink(unsigned mpp, unsigned level,
unsigned control)
{
return pm8901_mpp_config(mpp, PM_MPP_TYPE_SINK, level, control);
}
static inline int pm8901_mpp_config_dtest_sink(unsigned mpp, unsigned level,
unsigned control)
{
return pm8901_mpp_config(mpp, PM_MPP_TYPE_DTEST_SINK, level, control);
}
static inline int pm8901_mpp_config_dtest_output(unsigned mpp, unsigned level,
unsigned control)
{
return pm8901_mpp_config(mpp, PM_MPP_TYPE_DTEST_OUTPUT,
level, control);
}
#endif
@@ -0,0 +1,33 @@
#ifndef __ASM_ARCH_MSM_MSM_KRAIT_L2_ACCESSORS_H
#define __ASM_ARCH_MSM_MSM_KRAIT_L2_ACCESSORS_H
/*
* Copyright (c) 2011,2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifdef CONFIG_ARCH_MSM_KRAIT
extern void set_l2_indirect_reg(u32 reg_addr, u32 val);
extern u32 get_l2_indirect_reg(u32 reg_addr);
extern u32 set_get_l2_indirect_reg(u32 reg_addr, u32 val);
#else
static inline void set_l2_indirect_reg(u32 reg_addr, u32 val) {}
static inline u32 get_l2_indirect_reg(u32 reg_addr)
{
return 0;
}
static inline u32 set_get_l2_indirect_reg(u32 reg_addr, u32 val)
{
return 0;
}
#endif
#endif
@@ -0,0 +1,172 @@
/* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __LINUX_USB_GADGET_MSM72K_OTG_H__
#define __LINUX_USB_GADGET_MSM72K_OTG_H__
#include <linux/usb.h>
#include <linux/usb/gadget.h>
#include <linux/usb/otg.h>
#include <linux/wakelock.h>
#include <mach/msm_hsusb.h>
#include <asm/mach-types.h>
#include <mach/msm_hsusb.h>
#define OTGSC_BSVIE (1 << 27)
#define OTGSC_IDIE (1 << 24)
#define OTGSC_IDPU (1 << 5)
#define OTGSC_BSVIS (1 << 19)
#define OTGSC_ID (1 << 8)
#define OTGSC_IDIS (1 << 16)
#define OTGSC_BSV (1 << 11)
#define OTGSC_DPIE (1 << 30)
#define OTGSC_DPIS (1 << 22)
#define OTGSC_HADP (1 << 6)
#define OTGSC_IDPU (1 << 5)
#define ULPI_STP_CTRL (1 << 30)
#define ASYNC_INTR_CTRL (1 << 29)
#define ULPI_SYNC_STATE (1 << 27)
#define PORTSC_PHCD (1 << 23)
#define PORTSC_CSC (1 << 1)
#define disable_phy_clk() (writel(readl(USB_PORTSC) | PORTSC_PHCD, USB_PORTSC))
#define enable_phy_clk() (writel(readl(USB_PORTSC) & ~PORTSC_PHCD, USB_PORTSC))
#define is_phy_clk_disabled() (readl(USB_PORTSC) & PORTSC_PHCD)
#define is_phy_active() (readl_relaxed(USB_ULPI_VIEWPORT) &\
ULPI_SYNC_STATE)
#define is_usb_active() (!(readl(USB_PORTSC) & PORTSC_SUSP))
/* Timeout (in msec) values (min - max) associated with OTG timers */
#define TA_WAIT_VRISE 100 /* ( - 100) */
#define TA_WAIT_VFALL 500 /* ( - 1000) */
/*
* This option is set for embedded hosts or OTG devices in which leakage
* currents are very minimal.
*/
#ifdef CONFIG_MSM_OTG_ENABLE_A_WAIT_BCON_TIMEOUT
#define TA_WAIT_BCON 30000 /* (1100 - 30000) */
#else
#define TA_WAIT_BCON -1
#endif
/* AIDL_BDIS should be 500 */
#define TA_AIDL_BDIS 200 /* (200 - ) */
#define TA_BIDL_ADIS 155 /* (155 - 200) */
#define TB_SRP_FAIL 6000 /* (5000 - 6000) */
#define TB_ASE0_BRST 155 /* (155 - ) */
/* TB_SSEND_SRP and TB_SE0_SRP are combined */
#define TB_SRP_INIT 2000 /* (1500 - ) */
/* Timeout variables */
#define A_WAIT_VRISE 0
#define A_WAIT_VFALL 1
#define A_WAIT_BCON 2
#define A_AIDL_BDIS 3
#define A_BIDL_ADIS 4
#define B_SRP_FAIL 5
#define B_ASE0_BRST 6
/* Internal flags like a_set_b_hnp_en, b_hnp_en are maintained
* in usb_bus and usb_gadget
*/
#define A_BUS_DROP 0
#define A_BUS_REQ 1
#define A_SRP_DET 2
#define A_VBUS_VLD 3
#define B_CONN 4
#define ID 5
#define ADP_CHANGE 6
#define POWER_UP 7
#define A_CLR_ERR 8
#define A_BUS_RESUME 9
#define A_BUS_SUSPEND 10
#define A_CONN 11
#define B_BUS_REQ 12
#define B_SESS_VLD 13
#define ID_A 14
#define ID_B 15
#define ID_C 16
#define USB_IDCHG_MIN 500
#define USB_IDCHG_MAX 1500
#define USB_IB_UNCFG 2
#define OTG_ID_POLL_MS 1000
struct msm_otg {
struct usb_phy phy;
/* usb clocks */
struct clk *alt_core_clk;
struct clk *iface_clk;
struct clk *core_clk;
/* clk regime has created dummy clock id for phy so
* that generic clk_reset api can be used to reset phy
*/
struct clk *phy_reset_clk;
int irq;
int vbus_on_irq;
int id_irq;
void __iomem *regs;
atomic_t in_lpm;
/* charger-type is modified by gadget for legacy chargers
* and OTG modifies it for ACA
*/
atomic_t chg_type;
void (*start_host) (struct usb_bus *bus, int suspend);
/* Enable/disable the clocks */
int (*set_clk) (struct usb_phy *phy, int on);
/* Reset phy and link */
void (*reset) (struct usb_phy *phy, int phy_reset);
/* pmic notfications apis */
u8 pmic_vbus_notif_supp;
u8 pmic_id_notif_supp;
struct msm_otg_platform_data *pdata;
spinlock_t lock; /* protects OTG state */
struct wake_lock wlock;
unsigned long b_last_se0_sess; /* SRP initial condition check */
unsigned long inputs;
unsigned long tmouts;
u8 active_tmout;
struct hrtimer timer;
struct workqueue_struct *wq;
struct work_struct sm_work; /* state machine work */
struct work_struct otg_resume_work;
struct notifier_block usbdev_nb;
struct msm_xo_voter *xo_handle; /*handle to vote for TCXO D1 buffer*/
unsigned curr_power;
#ifdef CONFIG_USB_MSM_ACA
struct timer_list id_timer; /* drives id_status polling */
unsigned b_max_power; /* ACA: max power of accessory*/
#endif
};
static inline int can_phy_power_collapse(struct msm_otg *dev)
{
if (!dev || !dev->pdata)
return -ENODEV;
return dev->pdata->phy_can_powercollapse;
}
#endif
@@ -0,0 +1,112 @@
/* include/asm-arm/arch-msm/msm_adsp.h
*
* Copyright (C) 2008 Google, Inc.
* Copyright (c) 2009-2010, 2012 The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM__ARCH_MSM_ADSP_H
#define __ASM__ARCH_MSM_ADSP_H
struct msm_adsp_module;
struct msm_adsp_ops {
/* event is called from interrupt context when a message
* arrives from the DSP. Use the provided function pointer
* to copy the message into a local buffer. Do NOT call
* it multiple times.
*/
void (*event)(void *driver_data, unsigned id, size_t len,
void (*getevent)(void *ptr, size_t len));
};
/* Get, Put, Enable, and Disable are synchronous and must only
* be called from thread context. Enable and Disable will block
* up to one second in the event of a fatal DSP error but are
* much faster otherwise.
*/
int msm_adsp_get(const char *name, struct msm_adsp_module **module,
struct msm_adsp_ops *ops, void *driver_data);
void msm_adsp_put(struct msm_adsp_module *module);
int msm_adsp_enable(struct msm_adsp_module *module);
int msm_adsp_disable(struct msm_adsp_module *module);
int msm_adsp_dump(struct msm_adsp_module *module);
int adsp_set_clkrate(struct msm_adsp_module *module, unsigned long clk_rate);
int msm_adsp_disable_event_rsp(struct msm_adsp_module *module);
int32_t get_adsp_resource(unsigned short client_idx,
void *cmd_buf, size_t cmd_size);
int32_t put_adsp_resource(unsigned short client_idx,
void *cmd_buf, size_t cmd_size);
/* Write is safe to call from interrupt context.
*/
int msm_adsp_write(struct msm_adsp_module *module,
unsigned queue_id,
void *data, size_t len);
/*Explicitly gererate adsp event */
int msm_adsp_generate_event(void *data,
struct msm_adsp_module *mod,
unsigned event_id,
unsigned event_length,
unsigned event_size,
void *msg);
#define ADSP_MESSAGE_ID 0xFFFF
/* Command Queue Indexes */
#define QDSP_lpmCommandQueue 0
#define QDSP_mpuAfeQueue 1
#define QDSP_mpuGraphicsCmdQueue 2
#define QDSP_mpuModmathCmdQueue 3
#define QDSP_mpuVDecCmdQueue 4
#define QDSP_mpuVDecPktQueue 5
#define QDSP_mpuVEncCmdQueue 6
#define QDSP_rxMpuDecCmdQueue 7
#define QDSP_rxMpuDecPktQueue 8
#define QDSP_txMpuEncQueue 9
#define QDSP_uPAudPPCmd1Queue 10
#define QDSP_uPAudPPCmd2Queue 11
#define QDSP_uPAudPPCmd3Queue 12
#define QDSP_uPAudPlay0BitStreamCtrlQueue 13
#define QDSP_uPAudPlay1BitStreamCtrlQueue 14
#define QDSP_uPAudPlay2BitStreamCtrlQueue 15
#define QDSP_uPAudPlay3BitStreamCtrlQueue 16
#define QDSP_uPAudPlay4BitStreamCtrlQueue 17
#define QDSP_uPAudPreProcCmdQueue 18
#define QDSP_uPAudRecBitStreamQueue 19
#define QDSP_uPAudRecCmdQueue 20
#define QDSP_uPDiagQueue 21
#define QDSP_uPJpegActionCmdQueue 22
#define QDSP_uPJpegCfgCmdQueue 23
#define QDSP_uPVocProcQueue 24
#define QDSP_vfeCommandQueue 25
#define QDSP_vfeCommandScaleQueue 26
#define QDSP_vfeCommandTableQueue 27
#define QDSP_vfeFtmCmdQueue 28
#define QDSP_vfeFtmCmdScaleQueue 29
#define QDSP_vfeFtmCmdTableQueue 30
#define QDSP_uPJpegFtmCfgCmdQueue 31
#define QDSP_uPJpegFtmActionCmdQueue 32
#define QDSP_apuAfeQueue 33
#define QDSP_mpuRmtQueue 34
#define QDSP_uPAudPreProcAudRecCmdQueue 35
#define QDSP_uPAudRec0BitStreamQueue 36
#define QDSP_uPAudRec0CmdQueue 37
#define QDSP_uPAudRec1BitStreamQueue 38
#define QDSP_uPAudRec1CmdQueue 39
#define QDSP_apuRmtQueue 40
#define QDSP_uPAudRec2BitStreamQueue 41
#define QDSP_uPAudRec2CmdQueue 42
#define QDSP_MAX_NUM_QUEUES 43
#endif
@@ -0,0 +1,71 @@
/* arch/arm/mach-msm/include/mach/msm_audio_aac.h
*
* Copyright (c) 2009 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MSM_AUDIO_AAC_H
#define __MSM_AUDIO_AAC_H
#include <linux/msm_audio.h>
#define AUDIO_SET_AAC_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \
(AUDIO_MAX_COMMON_IOCTL_NUM+0), unsigned)
#define AUDIO_GET_AAC_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
(AUDIO_MAX_COMMON_IOCTL_NUM+1), unsigned)
#define AUDIO_AAC_FORMAT_ADTS -1
#define AUDIO_AAC_FORMAT_RAW 0x0000
#define AUDIO_AAC_FORMAT_PSUEDO_RAW 0x0001
#define AUDIO_AAC_FORMAT_LOAS 0x0002
#define AUDIO_AAC_OBJECT_LC 0x0002
#define AUDIO_AAC_OBJECT_LTP 0x0004
#define AUDIO_AAC_OBJECT_ERLC 0x0011
#define AUDIO_AAC_SEC_DATA_RES_ON 0x0001
#define AUDIO_AAC_SEC_DATA_RES_OFF 0x0000
#define AUDIO_AAC_SCA_DATA_RES_ON 0x0001
#define AUDIO_AAC_SCA_DATA_RES_OFF 0x0000
#define AUDIO_AAC_SPEC_DATA_RES_ON 0x0001
#define AUDIO_AAC_SPEC_DATA_RES_OFF 0x0000
#define AUDIO_AAC_SBR_ON_FLAG_ON 0x0001
#define AUDIO_AAC_SBR_ON_FLAG_OFF 0x0000
#define AUDIO_AAC_SBR_PS_ON_FLAG_ON 0x0001
#define AUDIO_AAC_SBR_PS_ON_FLAG_OFF 0x0000
/* Primary channel on both left and right channels */
#define AUDIO_AAC_DUAL_MONO_PL_PR 0
/* Secondary channel on both left and right channels */
#define AUDIO_AAC_DUAL_MONO_SL_SR 1
/* Primary channel on right channel and 2nd on left channel */
#define AUDIO_AAC_DUAL_MONO_SL_PR 2
/* 2nd channel on right channel and primary on left channel */
#define AUDIO_AAC_DUAL_MONO_PL_SR 3
struct msm_audio_aac_config {
signed short format;
unsigned short audio_object;
unsigned short ep_config; /* 0 ~ 3 useful only obj = ERLC */
unsigned short aac_section_data_resilience_flag;
unsigned short aac_scalefactor_data_resilience_flag;
unsigned short aac_spectral_data_resilience_flag;
unsigned short sbr_on_flag;
unsigned short sbr_ps_on_flag;
unsigned short dual_mono_mode;
unsigned short channel_configuration;
};
#endif /* __MSM_AUDIO_AAC_H */
@@ -0,0 +1,30 @@
/* Copyright (c) 2009, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __MSM_BATTERY_H__
#define __MSM_BATTERY_H__
#define AC_CHG 0x00000001
#define USB_CHG 0x00000002
struct msm_psy_batt_pdata {
u32 voltage_max_design;
u32 voltage_min_design;
u32 voltage_fail_safe;
u32 avail_chg_sources;
u32 batt_technology;
u32 (*calculate_capacity)(u32 voltage);
};
#endif
@@ -0,0 +1,136 @@
/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _ARCH_ARM_MACH_MSM_BUS_H
#define _ARCH_ARM_MACH_MSM_BUS_H
#include <linux/types.h>
#include <linux/input.h>
#include <linux/platform_device.h>
/*
* Macros for clients to convert their data to ib and ab
* Ws : Time window over which to transfer the data in SECONDS
* Bs : Size of the data block in bytes
* Per : Recurrence period
* Tb : Throughput bandwidth to prevent stalling
* R : Ratio of actual bandwidth used to Tb
* Ib : Instantaneous bandwidth
* Ab : Arbitrated bandwidth
*
* IB_RECURRBLOCK and AB_RECURRBLOCK:
* These are used if the requirement is to transfer a
* recurring block of data over a known time window.
*
* IB_THROUGHPUTBW and AB_THROUGHPUTBW:
* These are used for CPU style masters. Here the requirement
* is to have minimum throughput bandwidth available to avoid
* stalling.
*/
#define IB_RECURRBLOCK(Ws, Bs) ((Ws) == 0 ? 0 : ((Bs)/(Ws)))
#define AB_RECURRBLOCK(Ws, Per) ((Ws) == 0 ? 0 : ((Bs)/(Per)))
#define IB_THROUGHPUTBW(Tb) (Tb)
#define AB_THROUGHPUTBW(Tb, R) ((Tb) * (R))
struct msm_bus_vectors {
int src; /* Master */
int dst; /* Slave */
uint64_t ab; /* Arbitrated bandwidth */
uint64_t ib; /* Instantaneous bandwidth */
};
struct msm_bus_paths {
int num_paths;
struct msm_bus_vectors *vectors;
};
struct msm_bus_scale_pdata {
struct msm_bus_paths *usecase;
int num_usecases;
const char *name;
/*
* If the active_only flag is set to 1, the BW request is applied
* only when at least one CPU is active (powered on). If the flag
* is set to 0, then the BW request is always applied irrespective
* of the CPU state.
*/
unsigned int active_only;
};
/* Scaling APIs */
/*
* This function returns a handle to the client. This should be used to
* call msm_bus_scale_client_update_request.
* The function returns 0 if bus driver is unable to register a client
*/
#ifdef CONFIG_MSM_BUS_SCALING
uint32_t msm_bus_scale_register_client(struct msm_bus_scale_pdata *pdata);
int msm_bus_scale_client_update_request(uint32_t cl, unsigned int index);
void msm_bus_scale_unregister_client(uint32_t cl);
/* AXI Port configuration APIs */
int msm_bus_axi_porthalt(int master_port);
int msm_bus_axi_portunhalt(int master_port);
#else
static inline uint32_t
msm_bus_scale_register_client(struct msm_bus_scale_pdata *pdata)
{
return 1;
}
static inline int
msm_bus_scale_client_update_request(uint32_t cl, unsigned int index)
{
return 0;
}
static inline void
msm_bus_scale_unregister_client(uint32_t cl)
{
}
static inline int msm_bus_axi_porthalt(int master_port)
{
return 0;
}
static inline int msm_bus_axi_portunhalt(int master_port)
{
return 0;
}
#endif
#if defined(CONFIG_OF) && defined(CONFIG_MSM_BUS_SCALING)
struct msm_bus_scale_pdata *msm_bus_pdata_from_node(
struct platform_device *pdev, struct device_node *of_node);
struct msm_bus_scale_pdata *msm_bus_cl_get_pdata(struct platform_device *pdev);
void msm_bus_cl_clear_pdata(struct msm_bus_scale_pdata *pdata);
#else
static inline struct msm_bus_scale_pdata
*msm_bus_cl_get_pdata(struct platform_device *pdev)
{
return NULL;
}
static inline struct msm_bus_scale_pdata *msm_bus_pdata_from_node(
struct platform_device *pdev, struct device_node *of_node)
{
return NULL;
}
static inline void msm_bus_cl_clear_pdata(struct msm_bus_scale_pdata *pdata)
{
}
#endif
#endif /*_ARCH_ARM_MACH_MSM_BUS_H*/
@@ -0,0 +1,473 @@
/* Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_BUS_BOARD_H
#define __ASM_ARCH_MSM_BUS_BOARD_H
#include <linux/types.h>
#include <linux/input.h>
enum context {
DUAL_CTX,
ACTIVE_CTX,
NUM_CTX
};
struct msm_bus_fabric_registration {
unsigned int id;
const char *name;
struct msm_bus_node_info *info;
unsigned int len;
int ahb;
const char *fabclk[NUM_CTX];
const char *iface_clk;
unsigned int offset;
unsigned int haltid;
unsigned int rpm_enabled;
unsigned int nmasters;
unsigned int nslaves;
unsigned int ntieredslaves;
bool il_flag;
const struct msm_bus_board_algorithm *board_algo;
int hw_sel;
void *hw_data;
uint32_t qos_freq;
bool virt;
};
enum msm_bus_bw_tier_type {
MSM_BUS_BW_TIER1 = 1,
MSM_BUS_BW_TIER2,
MSM_BUS_BW_COUNT,
MSM_BUS_BW_SIZE = 0x7FFFFFFF,
};
struct msm_bus_halt_vector {
uint32_t haltval;
uint32_t haltmask;
};
extern struct msm_bus_fabric_registration msm_bus_apps_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_sys_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_mm_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_sys_fpb_pdata;
extern struct msm_bus_fabric_registration msm_bus_cpss_fpb_pdata;
extern struct msm_bus_fabric_registration msm_bus_def_fab_pdata;
extern struct msm_bus_fabric_registration msm_bus_8960_apps_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_8960_sys_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_8960_mm_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_8960_sg_mm_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_8960_sys_fpb_pdata;
extern struct msm_bus_fabric_registration msm_bus_8960_cpss_fpb_pdata;
extern struct msm_bus_fabric_registration msm_bus_8064_apps_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_8064_sys_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_8064_mm_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_8064_sys_fpb_pdata;
extern struct msm_bus_fabric_registration msm_bus_8064_cpss_fpb_pdata;
extern struct msm_bus_fabric_registration msm_bus_9615_sys_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_9615_def_fab_pdata;
extern struct msm_bus_fabric_registration msm_bus_8930_apps_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_8930_sys_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_8930_mm_fabric_pdata;
extern struct msm_bus_fabric_registration msm_bus_8930_sys_fpb_pdata;
extern struct msm_bus_fabric_registration msm_bus_8930_cpss_fpb_pdata;
extern struct msm_bus_fabric_registration msm_bus_8974_sys_noc_pdata;
extern struct msm_bus_fabric_registration msm_bus_8974_mmss_noc_pdata;
extern struct msm_bus_fabric_registration msm_bus_8974_bimc_pdata;
extern struct msm_bus_fabric_registration msm_bus_8974_ocmem_noc_pdata;
extern struct msm_bus_fabric_registration msm_bus_8974_periph_noc_pdata;
extern struct msm_bus_fabric_registration msm_bus_8974_config_noc_pdata;
extern struct msm_bus_fabric_registration msm_bus_8974_ocmem_vnoc_pdata;
extern struct msm_bus_fabric_registration msm_bus_9625_sys_noc_pdata;
extern struct msm_bus_fabric_registration msm_bus_9625_bimc_pdata;
extern struct msm_bus_fabric_registration msm_bus_9625_periph_noc_pdata;
extern struct msm_bus_fabric_registration msm_bus_9625_config_noc_pdata;
void msm_bus_rpm_set_mt_mask(void);
int msm_bus_board_rpm_get_il_ids(uint16_t *id);
int msm_bus_board_get_iid(int id);
#define NFAB_MSM8226 6
#define NFAB_MSM8610 5
/*
* These macros specify the convention followed for allocating
* ids to fabrics, masters and slaves for 8x60.
*
* A node can be identified as a master/slave/fabric by using
* these ids.
*/
#define FABRIC_ID_KEY 1024
#define SLAVE_ID_KEY ((FABRIC_ID_KEY) >> 1)
#define MAX_FAB_KEY 7168 /* OR(All fabric ids) */
#define GET_FABID(id) ((id) & MAX_FAB_KEY)
#define NODE_ID(id) ((id) & (FABRIC_ID_KEY - 1))
#define IS_SLAVE(id) ((NODE_ID(id)) >= SLAVE_ID_KEY ? 1 : 0)
#define CHECK_ID(iid, id) (((iid & id) != id) ? -ENXIO : iid)
/*
* The following macros are used to format the data for port halt
* and unhalt requests.
*/
#define MSM_BUS_CLK_HALT 0x1
#define MSM_BUS_CLK_HALT_MASK 0x1
#define MSM_BUS_CLK_HALT_FIELDSIZE 0x1
#define MSM_BUS_CLK_UNHALT 0x0
#define MSM_BUS_MASTER_SHIFT(master, fieldsize) \
((master) * (fieldsize))
#define MSM_BUS_SET_BITFIELD(word, fieldmask, fieldvalue) \
{ \
(word) &= ~(fieldmask); \
(word) |= (fieldvalue); \
}
#define MSM_BUS_MASTER_HALT(u32haltmask, u32haltval, master) \
MSM_BUS_SET_BITFIELD(u32haltmask, \
MSM_BUS_CLK_HALT_MASK<<MSM_BUS_MASTER_SHIFT((master),\
MSM_BUS_CLK_HALT_FIELDSIZE), \
MSM_BUS_CLK_HALT_MASK<<MSM_BUS_MASTER_SHIFT((master),\
MSM_BUS_CLK_HALT_FIELDSIZE))\
MSM_BUS_SET_BITFIELD(u32haltval, \
MSM_BUS_CLK_HALT_MASK<<MSM_BUS_MASTER_SHIFT((master),\
MSM_BUS_CLK_HALT_FIELDSIZE), \
MSM_BUS_CLK_HALT<<MSM_BUS_MASTER_SHIFT((master),\
MSM_BUS_CLK_HALT_FIELDSIZE))\
#define MSM_BUS_MASTER_UNHALT(u32haltmask, u32haltval, master) \
MSM_BUS_SET_BITFIELD(u32haltmask, \
MSM_BUS_CLK_HALT_MASK<<MSM_BUS_MASTER_SHIFT((master),\
MSM_BUS_CLK_HALT_FIELDSIZE), \
MSM_BUS_CLK_HALT_MASK<<MSM_BUS_MASTER_SHIFT((master),\
MSM_BUS_CLK_HALT_FIELDSIZE))\
MSM_BUS_SET_BITFIELD(u32haltval, \
MSM_BUS_CLK_HALT_MASK<<MSM_BUS_MASTER_SHIFT((master),\
MSM_BUS_CLK_HALT_FIELDSIZE), \
MSM_BUS_CLK_UNHALT<<MSM_BUS_MASTER_SHIFT((master),\
MSM_BUS_CLK_HALT_FIELDSIZE))\
#define RPM_BUS_SLAVE_REQ 0x766c7362
#define RPM_BUS_MASTER_REQ 0x73616d62
enum msm_bus_rpm_slave_field_type {
RPM_SLAVE_FIELD_BW = 0x00007762,
};
enum msm_bus_rpm_mas_field_type {
RPM_MASTER_FIELD_BW = 0x00007762,
RPM_MASTER_FIELD_BW_T0 = 0x30747762,
RPM_MASTER_FIELD_BW_T1 = 0x31747762,
RPM_MASTER_FIELD_BW_T2 = 0x32747762,
};
/* Topology related enums */
enum msm_bus_fabric_type {
MSM_BUS_FAB_DEFAULT = 0,
MSM_BUS_FAB_APPSS = 0,
MSM_BUS_FAB_SYSTEM = 1024,
MSM_BUS_FAB_MMSS = 2048,
MSM_BUS_FAB_SYSTEM_FPB = 3072,
MSM_BUS_FAB_CPSS_FPB = 4096,
};
enum msm_bus_fab_noc_bimc_type {
MSM_BUS_FAB_BIMC = 0,
MSM_BUS_FAB_SYS_NOC = 1024,
MSM_BUS_FAB_MMSS_NOC = 2048,
MSM_BUS_FAB_OCMEM_NOC = 3072,
MSM_BUS_FAB_PERIPH_NOC = 4096,
MSM_BUS_FAB_CONFIG_NOC = 5120,
MSM_BUS_FAB_OCMEM_VNOC = 6144,
};
enum msm_bus_fabric_master_type {
MSM_BUS_MASTER_FIRST = 1,
MSM_BUS_MASTER_AMPSS_M0 = 1,
MSM_BUS_MASTER_AMPSS_M1,
MSM_BUS_APPSS_MASTER_FAB_MMSS,
MSM_BUS_APPSS_MASTER_FAB_SYSTEM,
MSM_BUS_SYSTEM_MASTER_FAB_APPSS,
MSM_BUS_MASTER_SPS,
MSM_BUS_MASTER_ADM_PORT0,
MSM_BUS_MASTER_ADM_PORT1,
MSM_BUS_SYSTEM_MASTER_ADM1_PORT0,
MSM_BUS_MASTER_ADM1_PORT1,
MSM_BUS_MASTER_LPASS_PROC,
MSM_BUS_MASTER_MSS_PROCI,
MSM_BUS_MASTER_MSS_PROCD,
MSM_BUS_MASTER_MSS_MDM_PORT0,
MSM_BUS_MASTER_LPASS,
MSM_BUS_SYSTEM_MASTER_CPSS_FPB,
MSM_BUS_SYSTEM_MASTER_SYSTEM_FPB,
MSM_BUS_SYSTEM_MASTER_MMSS_FPB,
MSM_BUS_MASTER_ADM1_CI,
MSM_BUS_MASTER_ADM0_CI,
MSM_BUS_MASTER_MSS_MDM_PORT1,
MSM_BUS_MASTER_MDP_PORT0,
MSM_BUS_MASTER_MDP_PORT1,
MSM_BUS_MMSS_MASTER_ADM1_PORT0,
MSM_BUS_MASTER_ROTATOR,
MSM_BUS_MASTER_GRAPHICS_3D,
MSM_BUS_MASTER_JPEG_DEC,
MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
MSM_BUS_MASTER_VFE,
MSM_BUS_MASTER_VPE,
MSM_BUS_MASTER_JPEG_ENC,
MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
MSM_BUS_MMSS_MASTER_APPS_FAB,
MSM_BUS_MASTER_HD_CODEC_PORT0,
MSM_BUS_MASTER_HD_CODEC_PORT1,
MSM_BUS_MASTER_SPDM,
MSM_BUS_MASTER_RPM,
MSM_BUS_MASTER_MSS,
MSM_BUS_MASTER_RIVA,
MSM_BUS_SYSTEM_MASTER_UNUSED_6,
MSM_BUS_MASTER_MSS_SW_PROC,
MSM_BUS_MASTER_MSS_FW_PROC,
MSM_BUS_MMSS_MASTER_UNUSED_2,
MSM_BUS_MASTER_GSS_NAV,
MSM_BUS_MASTER_PCIE,
MSM_BUS_MASTER_SATA,
MSM_BUS_MASTER_CRYPTO,
MSM_BUS_MASTER_VIDEO_CAP,
MSM_BUS_MASTER_GRAPHICS_3D_PORT1,
MSM_BUS_MASTER_VIDEO_ENC,
MSM_BUS_MASTER_VIDEO_DEC,
MSM_BUS_MASTER_LPASS_AHB,
MSM_BUS_MASTER_QDSS_BAM,
MSM_BUS_MASTER_SNOC_CFG,
MSM_BUS_MASTER_CRYPTO_CORE0,
MSM_BUS_MASTER_CRYPTO_CORE1,
MSM_BUS_MASTER_MSS_NAV,
MSM_BUS_MASTER_OCMEM_DMA,
MSM_BUS_MASTER_WCSS,
MSM_BUS_MASTER_QDSS_ETR,
MSM_BUS_MASTER_USB3,
MSM_BUS_MASTER_JPEG,
MSM_BUS_MASTER_VIDEO_P0,
MSM_BUS_MASTER_VIDEO_P1,
MSM_BUS_MASTER_MSS_PROC,
MSM_BUS_MASTER_JPEG_OCMEM,
MSM_BUS_MASTER_MDP_OCMEM,
MSM_BUS_MASTER_VIDEO_P0_OCMEM,
MSM_BUS_MASTER_VIDEO_P1_OCMEM,
MSM_BUS_MASTER_VFE_OCMEM,
MSM_BUS_MASTER_CNOC_ONOC_CFG,
MSM_BUS_MASTER_RPM_INST,
MSM_BUS_MASTER_RPM_DATA,
MSM_BUS_MASTER_RPM_SYS,
MSM_BUS_MASTER_DEHR,
MSM_BUS_MASTER_QDSS_DAP,
MSM_BUS_MASTER_TIC,
MSM_BUS_MASTER_SDCC_1,
MSM_BUS_MASTER_SDCC_3,
MSM_BUS_MASTER_SDCC_4,
MSM_BUS_MASTER_SDCC_2,
MSM_BUS_MASTER_TSIF,
MSM_BUS_MASTER_BAM_DMA,
MSM_BUS_MASTER_BLSP_2,
MSM_BUS_MASTER_USB_HSIC,
MSM_BUS_MASTER_BLSP_1,
MSM_BUS_MASTER_USB_HS,
MSM_BUS_MASTER_PNOC_CFG,
MSM_BUS_MASTER_V_OCMEM_GFX3D,
MSM_BUS_MASTER_IPA,
MSM_BUS_MASTER_QPIC,
MSM_BUS_MASTER_MDPE,
MSM_BUS_MASTER_USB_HS2,
MSM_BUS_MASTER_LAST,
MSM_BUS_SYSTEM_FPB_MASTER_SYSTEM =
MSM_BUS_SYSTEM_MASTER_SYSTEM_FPB,
MSM_BUS_CPSS_FPB_MASTER_SYSTEM =
MSM_BUS_SYSTEM_MASTER_CPSS_FPB,
};
enum msm_bus_fabric_slave_type {
MSM_BUS_SLAVE_FIRST = SLAVE_ID_KEY,
MSM_BUS_SLAVE_EBI_CH0 = SLAVE_ID_KEY,
MSM_BUS_SLAVE_EBI_CH1,
MSM_BUS_SLAVE_AMPSS_L2,
MSM_BUS_APPSS_SLAVE_FAB_MMSS,
MSM_BUS_APPSS_SLAVE_FAB_SYSTEM,
MSM_BUS_SYSTEM_SLAVE_FAB_APPS,
MSM_BUS_SLAVE_SPS,
MSM_BUS_SLAVE_SYSTEM_IMEM,
MSM_BUS_SLAVE_AMPSS,
MSM_BUS_SLAVE_MSS,
MSM_BUS_SLAVE_LPASS,
MSM_BUS_SYSTEM_SLAVE_CPSS_FPB,
MSM_BUS_SYSTEM_SLAVE_SYSTEM_FPB,
MSM_BUS_SYSTEM_SLAVE_MMSS_FPB,
MSM_BUS_SLAVE_CORESIGHT,
MSM_BUS_SLAVE_RIVA,
MSM_BUS_SLAVE_SMI,
MSM_BUS_MMSS_SLAVE_FAB_APPS,
MSM_BUS_MMSS_SLAVE_FAB_APPS_1,
MSM_BUS_SLAVE_MM_IMEM,
MSM_BUS_SLAVE_CRYPTO,
MSM_BUS_SLAVE_SPDM,
MSM_BUS_SLAVE_RPM,
MSM_BUS_SLAVE_RPM_MSG_RAM,
MSM_BUS_SLAVE_MPM,
MSM_BUS_SLAVE_PMIC1_SSBI1_A,
MSM_BUS_SLAVE_PMIC1_SSBI1_B,
MSM_BUS_SLAVE_PMIC1_SSBI1_C,
MSM_BUS_SLAVE_PMIC2_SSBI2_A,
MSM_BUS_SLAVE_PMIC2_SSBI2_B,
MSM_BUS_SLAVE_GSBI1_UART,
MSM_BUS_SLAVE_GSBI2_UART,
MSM_BUS_SLAVE_GSBI3_UART,
MSM_BUS_SLAVE_GSBI4_UART,
MSM_BUS_SLAVE_GSBI5_UART,
MSM_BUS_SLAVE_GSBI6_UART,
MSM_BUS_SLAVE_GSBI7_UART,
MSM_BUS_SLAVE_GSBI8_UART,
MSM_BUS_SLAVE_GSBI9_UART,
MSM_BUS_SLAVE_GSBI10_UART,
MSM_BUS_SLAVE_GSBI11_UART,
MSM_BUS_SLAVE_GSBI12_UART,
MSM_BUS_SLAVE_GSBI1_QUP,
MSM_BUS_SLAVE_GSBI2_QUP,
MSM_BUS_SLAVE_GSBI3_QUP,
MSM_BUS_SLAVE_GSBI4_QUP,
MSM_BUS_SLAVE_GSBI5_QUP,
MSM_BUS_SLAVE_GSBI6_QUP,
MSM_BUS_SLAVE_GSBI7_QUP,
MSM_BUS_SLAVE_GSBI8_QUP,
MSM_BUS_SLAVE_GSBI9_QUP,
MSM_BUS_SLAVE_GSBI10_QUP,
MSM_BUS_SLAVE_GSBI11_QUP,
MSM_BUS_SLAVE_GSBI12_QUP,
MSM_BUS_SLAVE_EBI2_NAND,
MSM_BUS_SLAVE_EBI2_CS0,
MSM_BUS_SLAVE_EBI2_CS1,
MSM_BUS_SLAVE_EBI2_CS2,
MSM_BUS_SLAVE_EBI2_CS3,
MSM_BUS_SLAVE_EBI2_CS4,
MSM_BUS_SLAVE_EBI2_CS5,
MSM_BUS_SLAVE_USB_FS1,
MSM_BUS_SLAVE_USB_FS2,
MSM_BUS_SLAVE_TSIF,
MSM_BUS_SLAVE_MSM_TSSC,
MSM_BUS_SLAVE_MSM_PDM,
MSM_BUS_SLAVE_MSM_DIMEM,
MSM_BUS_SLAVE_MSM_TCSR,
MSM_BUS_SLAVE_MSM_PRNG,
MSM_BUS_SLAVE_GSS,
MSM_BUS_SLAVE_SATA,
MSM_BUS_SLAVE_USB3,
MSM_BUS_SLAVE_WCSS,
MSM_BUS_SLAVE_OCIMEM,
MSM_BUS_SLAVE_SNOC_OCMEM,
MSM_BUS_SLAVE_SERVICE_SNOC,
MSM_BUS_SLAVE_QDSS_STM,
MSM_BUS_SLAVE_CAMERA_CFG,
MSM_BUS_SLAVE_DISPLAY_CFG,
MSM_BUS_SLAVE_OCMEM_CFG,
MSM_BUS_SLAVE_CPR_CFG,
MSM_BUS_SLAVE_CPR_XPU_CFG,
MSM_BUS_SLAVE_MISC_CFG,
MSM_BUS_SLAVE_MISC_XPU_CFG,
MSM_BUS_SLAVE_VENUS_CFG,
MSM_BUS_SLAVE_MISC_VENUS_CFG,
MSM_BUS_SLAVE_GRAPHICS_3D_CFG,
MSM_BUS_SLAVE_MMSS_CLK_CFG,
MSM_BUS_SLAVE_MMSS_CLK_XPU_CFG,
MSM_BUS_SLAVE_MNOC_MPU_CFG,
MSM_BUS_SLAVE_ONOC_MPU_CFG,
MSM_BUS_SLAVE_SERVICE_MNOC,
MSM_BUS_SLAVE_OCMEM,
MSM_BUS_SLAVE_SERVICE_ONOC,
MSM_BUS_SLAVE_SDCC_1,
MSM_BUS_SLAVE_SDCC_3,
MSM_BUS_SLAVE_SDCC_2,
MSM_BUS_SLAVE_SDCC_4,
MSM_BUS_SLAVE_BAM_DMA,
MSM_BUS_SLAVE_BLSP_2,
MSM_BUS_SLAVE_USB_HSIC,
MSM_BUS_SLAVE_BLSP_1,
MSM_BUS_SLAVE_USB_HS,
MSM_BUS_SLAVE_PDM,
MSM_BUS_SLAVE_PERIPH_APU_CFG,
MSM_BUS_SLAVE_PNOC_MPU_CFG,
MSM_BUS_SLAVE_PRNG,
MSM_BUS_SLAVE_SERVICE_PNOC,
MSM_BUS_SLAVE_CLK_CTL,
MSM_BUS_SLAVE_CNOC_MSS,
MSM_BUS_SLAVE_SECURITY,
MSM_BUS_SLAVE_TCSR,
MSM_BUS_SLAVE_TLMM,
MSM_BUS_SLAVE_CRYPTO_0_CFG,
MSM_BUS_SLAVE_CRYPTO_1_CFG,
MSM_BUS_SLAVE_IMEM_CFG,
MSM_BUS_SLAVE_MESSAGE_RAM,
MSM_BUS_SLAVE_BIMC_CFG,
MSM_BUS_SLAVE_BOOT_ROM,
MSM_BUS_SLAVE_CNOC_MNOC_MMSS_CFG,
MSM_BUS_SLAVE_PMIC_ARB,
MSM_BUS_SLAVE_SPDM_WRAPPER,
MSM_BUS_SLAVE_DEHR_CFG,
MSM_BUS_SLAVE_QDSS_CFG,
MSM_BUS_SLAVE_RBCPR_CFG,
MSM_BUS_SLAVE_RBCPR_QDSS_APU_CFG,
MSM_BUS_SLAVE_SNOC_MPU_CFG,
MSM_BUS_SLAVE_CNOC_ONOC_CFG,
MSM_BUS_SLAVE_CNOC_MNOC_CFG,
MSM_BUS_SLAVE_PNOC_CFG,
MSM_BUS_SLAVE_SNOC_CFG,
MSM_BUS_SLAVE_EBI1_DLL_CFG,
MSM_BUS_SLAVE_PHY_APU_CFG,
MSM_BUS_SLAVE_EBI1_PHY_CFG,
MSM_BUS_SLAVE_SERVICE_CNOC,
MSM_BUS_SLAVE_IPS_CFG,
MSM_BUS_SLAVE_QPIC,
MSM_BUS_SLAVE_DSI_CFG,
MSM_BUS_SLAVE_LAST,
MSM_BUS_SYSTEM_FPB_SLAVE_SYSTEM =
MSM_BUS_SYSTEM_SLAVE_SYSTEM_FPB,
MSM_BUS_CPSS_FPB_SLAVE_SYSTEM =
MSM_BUS_SYSTEM_SLAVE_CPSS_FPB,
};
#endif /*__ASM_ARCH_MSM_BUS_BOARD_H */
@@ -0,0 +1,69 @@
/*
* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _MACH_MSM_CACHE_DUMP_
#define _MACH_MSM_CACHE_DUMP_
#include <asm-generic/sizes.h>
struct l2_cache_line_dump {
unsigned int l2dcrtr0_val;
unsigned int l2dcrtr1_val;
unsigned int cache_line_data[32];
unsigned int ddr_data[32];
} __packed;
struct l2_cache_dump {
unsigned int magic_number;
unsigned int version;
unsigned int tag_size;
unsigned int line_size;
unsigned int total_lines;
struct l2_cache_line_dump cache[8*1024];
unsigned int l2esr;
} __packed;
struct l1_cache_dump {
unsigned int magic;
unsigned int version;
unsigned int flags;
unsigned int cpu_count;
unsigned int i_tag_size;
unsigned int i_line_size;
unsigned int i_num_sets;
unsigned int i_num_ways;
unsigned int d_tag_size;
unsigned int d_line_size;
unsigned int d_num_sets;
unsigned int d_num_ways;
unsigned int spare[32];
unsigned int lines[];
} __packed;
struct msm_cache_dump_platform_data {
unsigned int l1_size;
unsigned int l2_size;
};
#define CACHE_BUFFER_DUMP_SIZE (L1_BUFFER_SIZE + L2_BUFFER_SIZE)
#define L1C_SERVICE_ID 3
#define L1C_BUFFER_SET_COMMAND_ID 4
#define CACHE_BUFFER_DUMP_COMMAND_ID 5
#define L1C_BUFFER_GET_SIZE_COMMAND_ID 6
#define L2C_BUFFER_SET_COMMAND_ID 7
#define L2C_BUFFER_GET_SIZE_COMMAND_ID 8
#endif
@@ -0,0 +1,177 @@
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _ARCH_ARM_MACH_MSM_MSM_DCVS_H
#define _ARCH_ARM_MACH_MSM_MSM_DCVS_H
#include <mach/msm_dcvs_scm.h>
#define CORE_NAME_MAX (32)
#define CORES_MAX (10)
#define CPU_OFFSET 1 /* used to notify TZ the core number */
#define GPU_OFFSET (CORES_MAX * 2/3) /* there will be more cpus than gpus,
* let the GPU be assigned fewer core
* elements and start later
*/
enum msm_core_idle_state {
MSM_DCVS_IDLE_ENTER,
MSM_DCVS_IDLE_EXIT,
};
enum msm_core_control_event {
MSM_DCVS_ENABLE_IDLE_PULSE,
MSM_DCVS_DISABLE_IDLE_PULSE,
MSM_DCVS_ENABLE_HIGH_LATENCY_MODES,
MSM_DCVS_DISABLE_HIGH_LATENCY_MODES,
};
struct msm_dcvs_sync_rule {
unsigned long cpu_khz;
unsigned long gpu_floor_khz;
};
struct msm_dcvs_platform_data {
struct msm_dcvs_sync_rule *sync_rules;
unsigned num_sync_rules;
unsigned long gpu_max_nom_khz;
};
struct msm_gov_platform_data {
struct msm_dcvs_core_info *info;
int latency;
};
/**
* msm_dcvs_register_cpu_freq
* @freq: the frequency value to register
* @voltage: the operating voltage (in mV) associated with the above frequency
*
* Register a cpu frequency and its operating voltage with dcvs.
*/
#ifdef CONFIG_MSM_DCVS
void msm_dcvs_register_cpu_freq(uint32_t freq, uint32_t voltage);
#else
static inline void msm_dcvs_register_cpu_freq(uint32_t freq, uint32_t voltage)
{}
#endif
/**
* msm_dcvs_idle
* @dcvs_core_id: The id returned by msm_dcvs_register_core
* @state: The enter/exit idle state the core is in
* @iowaited: iowait in us
* on iMSM_DCVS_IDLE_EXIT.
* @return:
* 0 on success,
* -ENOSYS,
* -EINVAL,
* SCM return values
*
* Send idle state notifications to the msm_dcvs driver
*/
int msm_dcvs_idle(int dcvs_core_id, enum msm_core_idle_state state,
uint32_t iowaited);
/**
* struct msm_dcvs_core_info
*
* Core specific information used by algorithm. Need to provide this
* before the sink driver can be registered.
*/
struct msm_dcvs_core_info {
int num_cores;
int *sensors;
int thermal_poll_ms;
struct msm_dcvs_freq_entry *freq_tbl;
struct msm_dcvs_core_param core_param;
struct msm_dcvs_algo_param algo_param;
struct msm_dcvs_energy_curve_coeffs energy_coeffs;
struct msm_dcvs_power_params power_param;
};
/**
* msm_dcvs_register_core
* @type: whether this is a CPU or a GPU
* @type_core_num: The number of the core for a type
* @info: The core specific algorithm parameters.
* @sensor: The thermal sensor number of the core in question
* @return :
* 0 on success,
* -ENOSYS,
* -ENOMEM
*
* Register the core with msm_dcvs driver. Done once at init before calling
* msm_dcvs_freq_sink_register
* Cores that need to run synchronously must share the same group id.
*/
extern int msm_dcvs_register_core(
enum msm_dcvs_core_type type,
int type_core_num,
struct msm_dcvs_core_info *info,
int (*set_frequency)(int type_core_num, unsigned int freq),
unsigned int (*get_frequency)(int type_core_num),
int (*idle_enable)(int type_core_num,
enum msm_core_control_event event),
int (*set_floor_frequency)(int type_core_num, unsigned int freq),
int sensor);
/**
* msm_dcvs_freq_sink_start
* @drv: The sink driver
* @return: Handle unique to the core.
*
* Register the clock driver code with the msm_dvs driver to get notified about
* frequency change requests.
*/
extern int msm_dcvs_freq_sink_start(int dcvs_core_id);
/**
* msm_dcvs_freq_sink_stop
* @drv: The sink driver
* @return:
* 0 on success,
* -EINVAL
*
* Unregister the sink driver for the core. This will cause the source driver
* for the core to stop sending idle pulses.
*/
extern int msm_dcvs_freq_sink_stop(int dcvs_core_id);
/**
* msm_dcvs_update_limits
* @drv: The sink driver
*
* Update the frequency known to dcvs when the limits are changed.
*/
extern void msm_dcvs_update_limits(int dcvs_core_id);
/**
* msm_dcvs_apply_gpu_floor
* @cpu_freq: CPU frequency to compare to GPU sync rules
*
* Apply a GPU floor frequency if the corresponding CPU frequency,
* or the number of CPUs online, requires it.
*/
extern void msm_dcvs_apply_gpu_floor(unsigned long cpu_freq);
/**
* msm_dcvs_update_algo_params
* @return:
* 0 on success, < 0 on error
*
* Updates the DCVS algorithm with parameters depending on the
* number of CPUs online.
*/
extern int msm_dcvs_update_algo_params(void);
#endif
@@ -0,0 +1,262 @@
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _ARCH_ARM_MACH_MSM_MSM_DCVS_SCM_H
#define _ARCH_ARM_MACH_MSM_MSM_DCVS_SCM_H
enum msm_dcvs_core_type {
MSM_DCVS_CORE_TYPE_CPU = 0,
MSM_DCVS_CORE_TYPE_GPU = 1,
};
enum msm_dcvs_algo_param_type {
MSM_DCVS_ALGO_DCVS_PARAM = 0,
MSM_DCVS_ALGO_MPD_PARAM = 1,
};
enum msm_dcvs_scm_event {
MSM_DCVS_SCM_IDLE_ENTER = 0, /* Core enters idle */
MSM_DCVS_SCM_IDLE_EXIT = 1, /* Core exits idle */
MSM_DCVS_SCM_QOS_TIMER_EXPIRED = 2, /* Core slack timer expired */
MSM_DCVS_SCM_CLOCK_FREQ_UPDATE = 3, /* Core freq change complete */
MSM_DCVS_SCM_CORE_ONLINE = 4, /* Core is online */
MSM_DCVS_SCM_CORE_OFFLINE = 5, /* Core is offline */
MSM_DCVS_SCM_CORE_UNAVAILABLE = 6, /* Core is offline + unavailable */
MSM_DCVS_SCM_DCVS_ENABLE = 7, /* DCVS is enabled/disabled for core */
MSM_DCVS_SCM_MPD_ENABLE = 8, /* Enable/disable MP Decision */
MSM_DCVS_SCM_RUNQ_UPDATE = 9, /* Update running threads */
MSM_DCVS_SCM_MPD_QOS_TIMER_EXPIRED = 10, /* MPDecision slack timer */
};
struct msm_dcvs_algo_param {
uint32_t disable_pc_threshold;
uint32_t em_win_size_min_us;
uint32_t em_win_size_max_us;
uint32_t em_max_util_pct;
uint32_t group_id;
uint32_t max_freq_chg_time_us;
uint32_t slack_mode_dynamic;
uint32_t slack_time_min_us;
uint32_t slack_time_max_us;
uint32_t slack_weight_thresh_pct;
uint32_t ss_no_corr_below_freq;
uint32_t ss_win_size_min_us;
uint32_t ss_win_size_max_us;
uint32_t ss_util_pct;
};
struct msm_dcvs_freq_entry {
uint32_t freq;
uint32_t voltage;
uint32_t is_trans_level;
uint32_t active_energy_offset;
uint32_t leakage_energy_offset;
};
struct msm_dcvs_energy_curve_coeffs {
int32_t active_coeff_a;
int32_t active_coeff_b;
int32_t active_coeff_c;
int32_t leakage_coeff_a;
int32_t leakage_coeff_b;
int32_t leakage_coeff_c;
int32_t leakage_coeff_d;
};
struct msm_dcvs_power_params {
uint32_t current_temp;
uint32_t num_freq; /* number of msm_dcvs_freq_entry passed */
};
struct msm_dcvs_core_param {
uint32_t core_type;
uint32_t core_bitmask_id;
};
struct msm_mpd_algo_param {
uint32_t em_win_size_min_us;
uint32_t em_win_size_max_us;
uint32_t em_max_util_pct;
uint32_t mp_em_rounding_point_min;
uint32_t mp_em_rounding_point_max;
uint32_t online_util_pct_min;
uint32_t online_util_pct_max;
uint32_t slack_time_min_us;
uint32_t slack_time_max_us;
};
#ifdef CONFIG_MSM_DCVS
/**
* Initialize DCVS algorithm in TrustZone.
* Must call before invoking any other DCVS call into TZ.
*
* @size: Size of buffer in bytes
*
* @return:
* 0 on success.
* -EEXIST: DCVS algorithm already initialized.
* -EINVAL: Invalid args.
*/
extern int msm_dcvs_scm_init(size_t size);
/**
* Registers cores with the DCVS algo.
*
* @core_id: The core identifier that will be used for communication with DCVS
* @param: The core parameters
* @freq: Array of frequency and energy values
*
* @return:
* 0 on success.
* -ENOMEM: Insufficient memory.
* -EINVAL: Invalid args.
*/
extern int msm_dcvs_scm_register_core(uint32_t core_id,
struct msm_dcvs_core_param *param);
/**
* Set DCVS algorithm parameters
*
* @core_id: The algorithm parameters specific for the core
* @param: The param data structure
*
* @return:
* 0 on success.
* -EINVAL: Invalid args.
*/
extern int msm_dcvs_scm_set_algo_params(uint32_t core_id,
struct msm_dcvs_algo_param *param);
/**
* Set MPDecision algorithm parameters
*
* @param: The param data structure
* 0 on success.
* -EINVAL: Invalid args.
*/
extern int msm_mpd_scm_set_algo_params(struct msm_mpd_algo_param *param);
/**
* Set frequency and power characteristics for the core.
*
* @param core_id: The core identifier that will be used to interace with the
* DCVS algo.
* @param pwr_param: power params
* @param freq_entry: frequency characteristics desired
* @param coeffs: Coefficients that will describe the power curve
*
* @return int
* 0 on success.
* -EINVAL: Invalid args.
*/
extern int msm_dcvs_scm_set_power_params(uint32_t core_id,
struct msm_dcvs_power_params *pwr_param,
struct msm_dcvs_freq_entry *freq_entry,
struct msm_dcvs_energy_curve_coeffs *coeffs);
/**
* Do an SCM call.
*
* @core_id: The core identifier.
* @event_id: The event that occured.
* Possible values:
* MSM_DCVS_SCM_IDLE_ENTER
* @param0: unused
* @param1: unused
* @ret0: unused
* @ret1: unused
* MSM_DCVS_SCM_IDLE_EXIT
* @param0: Did the core iowait
* @param1: unused
* @ret0: New clock frequency for the core in KHz
* @ret1: New QoS timer value for the core in usec
* MSM_DCVS_SCM_QOS_TIMER_EXPIRED
* @param0: unused
* @param1: unused
* @ret0: New clock frequency for the core in KHz
* @ret1: unused
* MSM_DCVS_SCM_CLOCK_FREQ_UPDATE
* @param0: active clock frequency of the core in KHz
* @param1: time taken in usec to switch to the frequency
* @ret0: New QoS timer value for the core in usec
* @ret1: unused
* MSM_DCVS_SCM_CORE_ONLINE
* @param0: active clock frequency of the core in KHz
* @param1: time taken to online the core
* @ret0: unused
* @ret1: unused
* MSM_DCVS_SCM_CORE_OFFLINE
* @param0: time taken to offline the core
* @param1: unused
* @ret0: unused
* @ret1: unused
* MSM_DCVS_SCM_CORE_UNAVAILABLE
* @param0: TODO:bitmask
* @param1: unused
* @ret0: Bitmask of cores to bring online/offline.
* @ret1: Mp Decision slack time. Common to all cores.
* MSM_DCVS_SCM_DCVS_ENABLE
* @param0: 1 to enable; 0 to disable DCVS
* @param1: unused
* @ret0: New clock frequency for the core in KHz
* @ret1: unused
* MSM_DCVS_SCM_MPD_ENABLE
* @param0: 1 to enable; 0 to disable MP Decision
* @param1: unused
* @ret0: unused
* @ret1: unused
* MSM_DCVS_SCM_RUNQ_UPDATE
* @param0: run q value
* @param1: unused
* @ret0: Bitmask of cores online
* @ret1: New QoS timer for MP Decision (usec)
* MSM_DCVS_SCM_MPD_QOS_TIMER_EXPIRED
* @param0: unused
* @param1: unused
* @ret0: Bitmask of cores online
* @ret1: New QoS timer for MP Decision (usec)
* @return:
* 0 on success,
* SCM return values
*/
extern int msm_dcvs_scm_event(uint32_t core_id,
enum msm_dcvs_scm_event event_id,
uint32_t param0, uint32_t param1,
uint32_t *ret0, uint32_t *ret1);
#else
static inline int msm_dcvs_scm_init(uint32_t phy, size_t bytes)
{ return -ENOSYS; }
static inline int msm_dcvs_scm_register_core(uint32_t core_id,
struct msm_dcvs_core_param *param,
struct msm_dcvs_freq_entry *freq)
{ return -ENOSYS; }
static inline int msm_dcvs_scm_set_algo_params(uint32_t core_id,
struct msm_dcvs_algo_param *param)
{ return -ENOSYS; }
static inline int msm_mpd_scm_set_algo_params(
struct msm_mpd_algo_param *param)
{ return -ENOSYS; }
static inline int msm_dcvs_set_power_params(uint32_t core_id,
struct msm_dcvs_power_params *pwr_param,
struct msm_dcvs_freq_entry *freq_entry,
struct msm_dcvs_energy_curve_coeffs *coeffs)
{ return -ENOSYS; }
static inline int msm_dcvs_scm_event(uint32_t core_id,
enum msm_dcvs_scm_event event_id,
uint32_t param0, uint32_t param1,
uint32_t *ret0, uint32_t *ret1)
{ return -ENOSYS; }
#endif
#endif
@@ -0,0 +1,97 @@
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _MSM_DSPS_H_
#define _MSM_DSPS_H_
#include <linux/types.h>
#include <linux/clk.h>
#include <linux/regulator/consumer.h>
#define DSPS_SIGNATURE 0x12345678
/**
* DSPS Clocks Platform data.
*
* @name - clock name.
* @rate - rate to set. zero if not relevant.
* @clock - clock handle, reserved for the driver.
*/
struct dsps_clk_info {
const char *name;
u32 rate;
struct clk *clock;
};
/**
* DSPS GPIOs Platform data.
*
* @name - clock name.
* @num - GPIO number.
* @on_val - value to ouptput for ON (depends on polarity).
* @off_val - value to ouptput for OFF (depends on polarity).
* @is_owner - reserved for the driver.
*/
struct dsps_gpio_info {
const char *name;
int num;
int on_val;
int off_val;
int is_owner;
};
/**
* DSPS Power regulators Platform data.
*
* @name - regulator name.
* @volt - required voltage (in uV).
* @reg - reserved for the driver.
*/
struct dsps_regulator_info {
const char *name;
int volt;
struct regulator *reg;
};
/**
* DSPS Platform data.
*
* @pil_name - peripheral image name
* @clks - array of clocks.
* @clks_num - number of clocks in array.
* @gpios - array of gpios.
* @gpios_num - number of gpios.
* @regs - array of regulators.
* @regs_num - number of regulators.
* @dsps_pwr_ctl_en - to enable DSPS to do power control if set 1
* otherwise the apps will do power control
* @ppss_pause_reg - Offset to the PPSS_PAUSE register
* @ppss_wdog_unmasked_int_en_reg - Offset to PPSS_WDOG_UNMASKED_INT_EN register
* @signature - signature for validity check.
*/
struct msm_dsps_platform_data {
const char *pil_name;
struct dsps_clk_info *clks;
int clks_num;
struct dsps_gpio_info *gpios;
int gpios_num;
struct dsps_regulator_info *regs;
int regs_num;
int dsps_pwr_ctl_en;
void (*init)(struct msm_dsps_platform_data *data);
int ppss_pause_reg;
int ppss_wdog_unmasked_int_en_reg;
u32 signature;
};
#endif /* _MSM_DSPS_H_ */
@@ -0,0 +1,19 @@
/* arch/arm/mach-msm/include/mach/msm_fast_timer.h
*
* Copyright (C) 2009 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
void msm_enable_fast_timer(void);
void msm_disable_fast_timer(void);
u32 msm_read_fast_timer(void);
@@ -0,0 +1,198 @@
/* arch/arm/mach-msm/include/mach/msm_fb.h
*
* Internal shared definitions for various MSM framebuffer parts.
*
* Copyright (C) 2007 Google Incorporated
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _MSM_FB_H_
#define _MSM_FB_H_
#include <linux/device.h>
struct mddi_info;
/* output interface format */
#define MSM_MDP_OUT_IF_FMT_RGB565 0
#define MSM_MDP_OUT_IF_FMT_RGB666 1
struct msm_fb_data {
int xres; /* x resolution in pixels */
int yres; /* y resolution in pixels */
int width; /* disply width in mm */
int height; /* display height in mm */
unsigned output_format;
};
struct msmfb_callback {
void (*func)(struct msmfb_callback *);
};
enum {
MSM_MDDI_PMDH_INTERFACE = 0,
MSM_MDDI_EMDH_INTERFACE,
MSM_EBI2_INTERFACE,
MSM_LCDC_INTERFACE,
MSM_MDP_NUM_INTERFACES = MSM_LCDC_INTERFACE + 1,
};
#define MSMFB_CAP_PARTIAL_UPDATES (1 << 0)
struct msm_panel_data {
/* turns off the fb memory */
int (*suspend)(struct msm_panel_data *);
/* turns on the fb memory */
int (*resume)(struct msm_panel_data *);
/* turns off the panel */
int (*blank)(struct msm_panel_data *);
/* turns on the panel */
int (*unblank)(struct msm_panel_data *);
void (*wait_vsync)(struct msm_panel_data *);
void (*request_vsync)(struct msm_panel_data *, struct msmfb_callback *);
void (*clear_vsync)(struct msm_panel_data *);
/* from the enum above */
unsigned interface_type;
/* data to be passed to the fb driver */
struct msm_fb_data *fb_data;
/* capabilities supported by the panel */
uint32_t caps;
};
struct msm_mddi_client_data {
void (*suspend)(struct msm_mddi_client_data *);
void (*resume)(struct msm_mddi_client_data *);
void (*activate_link)(struct msm_mddi_client_data *);
void (*remote_write)(struct msm_mddi_client_data *, uint32_t val,
uint32_t reg);
uint32_t (*remote_read)(struct msm_mddi_client_data *, uint32_t reg);
void (*auto_hibernate)(struct msm_mddi_client_data *, int);
/* custom data that needs to be passed from the board file to a
* particular client */
void *private_client_data;
struct resource *fb_resource;
/* from the list above */
unsigned interface_type;
};
struct msm_mddi_platform_data {
unsigned int clk_rate;
void (*power_client)(struct msm_mddi_client_data *, int on);
/* fixup the mfr name, product id */
void (*fixup)(uint16_t *mfr_name, uint16_t *product_id);
int vsync_irq;
struct resource *fb_resource; /*optional*/
/* number of clients in the list that follows */
int num_clients;
/* array of client information of clients */
struct {
unsigned product_id; /* mfr id in top 16 bits, product id
* in lower 16 bits
*/
char *name; /* the device name will be the platform
* device name registered for the client,
* it should match the name of the associated
* driver
*/
unsigned id; /* id for mddi client device node, will also
* be used as device id of panel devices, if
* the client device will have multiple panels
* space must be left here for them
*/
void *client_data; /* required private client data */
unsigned int clk_rate; /* optional: if the client requires a
* different mddi clk rate
*/
} client_platform_data[];
};
struct msm_lcdc_timing {
unsigned int clk_rate; /* dclk freq */
unsigned int hsync_pulse_width; /* in dclks */
unsigned int hsync_back_porch; /* in dclks */
unsigned int hsync_front_porch; /* in dclks */
unsigned int hsync_skew; /* in dclks */
unsigned int vsync_pulse_width; /* in lines */
unsigned int vsync_back_porch; /* in lines */
unsigned int vsync_front_porch; /* in lines */
/* control signal polarity */
unsigned int vsync_act_low:1;
unsigned int hsync_act_low:1;
unsigned int den_act_low:1;
};
struct msm_lcdc_panel_ops {
int (*init)(struct msm_lcdc_panel_ops *);
int (*uninit)(struct msm_lcdc_panel_ops *);
int (*blank)(struct msm_lcdc_panel_ops *);
int (*unblank)(struct msm_lcdc_panel_ops *);
};
struct msm_lcdc_platform_data {
struct msm_lcdc_panel_ops *panel_ops;
struct msm_lcdc_timing *timing;
int fb_id;
struct msm_fb_data *fb_data;
struct resource *fb_resource;
};
struct mdp_blit_req;
struct fb_info;
struct mdp_device {
struct device dev;
void (*dma)(struct mdp_device *mdp, uint32_t addr,
uint32_t stride, uint32_t w, uint32_t h, uint32_t x,
uint32_t y, struct msmfb_callback *callback, int interface);
void (*dma_wait)(struct mdp_device *mdp, int interface);
int (*blit)(struct mdp_device *mdp, struct fb_info *fb,
struct mdp_blit_req *req);
void (*set_grp_disp)(struct mdp_device *mdp, uint32_t disp_id);
int (*check_output_format)(struct mdp_device *mdp, int bpp);
int (*set_output_format)(struct mdp_device *mdp, int bpp);
};
struct class_interface;
int register_mdp_client(struct class_interface *class_intf);
/**** private client data structs go below this line ***/
struct msm_mddi_bridge_platform_data {
/* from board file */
int (*init)(struct msm_mddi_bridge_platform_data *,
struct msm_mddi_client_data *);
int (*uninit)(struct msm_mddi_bridge_platform_data *,
struct msm_mddi_client_data *);
/* passed to panel for use by the fb driver */
int (*blank)(struct msm_mddi_bridge_platform_data *,
struct msm_mddi_client_data *);
int (*unblank)(struct msm_mddi_bridge_platform_data *,
struct msm_mddi_client_data *);
struct msm_fb_data fb_data;
/* board file will identify what capabilities the panel supports */
uint32_t panel_caps;
};
struct mdp_v4l2_req;
int msm_fb_v4l2_enable(struct mdp_overlay *req, bool enable, void **par);
int msm_fb_v4l2_update(void *par, bool bUserPtr,
unsigned long srcp0_addr, unsigned long srcp0_size,
unsigned long srcp1_addr, unsigned long srcp1_size,
unsigned long srcp2_addr, unsigned long srcp2_size);
#endif
@@ -0,0 +1,38 @@
/* Copyright (c) 2011, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef _LINUX_MSM_GPIOMUX_H
#define _LINUX_MSM_GPIOMUX_H
#ifdef CONFIG_MSM_GPIOMUX
/* Increment a gpio's reference count, possibly activating the line. */
int __must_check msm_gpiomux_get(unsigned gpio);
/* Decrement a gpio's reference count, possibly suspending the line. */
int msm_gpiomux_put(unsigned gpio);
#else
static inline int __must_check msm_gpiomux_get(unsigned gpio)
{
return -ENOSYS;
}
static inline int msm_gpiomux_put(unsigned gpio)
{
return -ENOSYS;
}
#endif
#endif /* _LINUX_MSM_GPIOMUX_H */
@@ -0,0 +1,52 @@
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MSM_HDMI_AUDIO_H
#define __MSM_HDMI_AUDIO_H
/* Supported HDMI Audio channels */
#define MSM_HDMI_AUDIO_CHANNEL_2 0
#define MSM_HDMI_AUDIO_CHANNEL_4 1
#define MSM_HDMI_AUDIO_CHANNEL_6 2
#define MSM_HDMI_AUDIO_CHANNEL_8 3
#define TRUE 1
#define FALSE 0
enum hdmi_supported_sample_rates {
HDMI_SAMPLE_RATE_32KHZ,
HDMI_SAMPLE_RATE_44_1KHZ,
HDMI_SAMPLE_RATE_48KHZ,
HDMI_SAMPLE_RATE_88_2KHZ,
HDMI_SAMPLE_RATE_96KHZ,
HDMI_SAMPLE_RATE_176_4KHZ,
HDMI_SAMPLE_RATE_192KHZ,
HDMI_SAMPLE_RATE_MAX
};
int hdmi_audio_enable(bool on , u32 fifo_water_mark);
int hdmi_audio_packet_enable(bool on);
void hdmi_msm_audio_sample_rate_reset(int rate);
int hdmi_msm_audio_get_sample_rate(void);
#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
int hdmi_msm_audio_info_setup(bool enabled, u32 num_of_channels,
u32 channel_allocation, u32 level_shift, bool down_mix);
#else
static inline int hdmi_msm_audio_info_setup(bool enabled,
u32 num_of_channels, u32 channel_allocation, u32 level_shift,
bool down_mix)
{
return 0;
}
#endif
#endif /* __MSM_HDMI_AUDIO_H*/
@@ -0,0 +1,37 @@
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MSM_HDMI_AUDIO_CODEC_H__
#define __MSM_HDMI_AUDIO_CODEC_H__
#include <linux/device.h>
#include <linux/platform_device.h>
struct msm_hdmi_audio_edid_blk {
u8 *audio_data_blk;
unsigned int audio_data_blk_size; /* in bytes */
u8 *spk_alloc_data_blk;
unsigned int spk_alloc_data_blk_size; /* in bytes */
};
struct msm_hdmi_audio_codec_ops {
int (*audio_info_setup)(struct platform_device *pdev,
u32 num_of_channels, u32 channel_allocation, u32 level_shift,
bool down_mix);
int (*get_audio_edid_blk) (struct platform_device *pdev,
struct msm_hdmi_audio_edid_blk *blk);
};
int msm_hdmi_register_audio_codec(struct platform_device *pdev,
struct msm_hdmi_audio_codec_ops *ops);
#endif /* __MSM_HDMI_AUDIO_CODEC_H__ */
@@ -0,0 +1,206 @@
/* linux/include/mach/hsusb.h
*
* Copyright (C) 2008 Google, Inc.
* Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_MSM_HSUSB_H
#define __ASM_ARCH_MSM_HSUSB_H
#include <linux/types.h>
#include <linux/pm_qos.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#define PHY_TYPE_MASK 0x0F
#define PHY_TYPE_MODE 0xF0
#define PHY_MODEL_MASK 0xFF00
#define PHY_TYPE(x) ((x) & PHY_TYPE_MASK)
#define PHY_MODEL(x) ((x) & PHY_MODEL_MASK)
#define USB_PHY_MODEL_65NM 0x100
#define USB_PHY_MODEL_180NM 0x200
#define USB_PHY_MODEL_45NM 0x400
#define USB_PHY_UNDEFINED 0x00
#define USB_PHY_INTEGRATED 0x01
#define USB_PHY_EXTERNAL 0x02
#define USB_PHY_SERIAL_PMIC 0x04
#define REQUEST_STOP 0
#define REQUEST_START 1
#define REQUEST_RESUME 2
#define REQUEST_HNP_SUSPEND 3
#define REQUEST_HNP_RESUME 4
/* Flags required to read ID state of PHY for ACA */
#define PHY_ID_MASK 0xB0
#define PHY_ID_GND 0
#define PHY_ID_C 0x10
#define PHY_ID_B 0x30
#define PHY_ID_A 0x90
#define phy_id_state(ints) ((ints) & PHY_ID_MASK)
#define phy_id_state_gnd(ints) (phy_id_state((ints)) == PHY_ID_GND)
#define phy_id_state_a(ints) (phy_id_state((ints)) == PHY_ID_A)
/* RID_B and RID_C states does not exist with standard ACA */
#ifdef CONFIG_USB_MSM_STANDARD_ACA
#define phy_id_state_b(ints) 0
#define phy_id_state_c(ints) 0
#else
#define phy_id_state_b(ints) (phy_id_state((ints)) == PHY_ID_B)
#define phy_id_state_c(ints) (phy_id_state((ints)) == PHY_ID_C)
#endif
/*
* The following are bit fields describing the usb_request.udc_priv word.
* These bit fields are set by function drivers that wish to queue
* usb_requests with sps/bam parameters.
*/
#define MSM_PIPE_ID_MASK (0x1F)
#define MSM_TX_PIPE_ID_OFS (16)
#define MSM_SPS_MODE BIT(5)
#define MSM_IS_FINITE_TRANSFER BIT(6)
#define MSM_PRODUCER BIT(7)
#define MSM_DISABLE_WB BIT(8)
#define MSM_ETD_IOC BIT(9)
#define MSM_INTERNAL_MEM BIT(10)
#define MSM_VENDOR_ID BIT(16)
/* used to detect the OTG Mode */
enum otg_mode {
OTG_ID = 0, /* ID pin detection */
OTG_USER_CONTROL, /* User configurable */
OTG_VCHG, /* Based on VCHG interrupt */
};
/* used to configure the default mode,if otg_mode is USER_CONTROL */
enum usb_mode {
USB_HOST_MODE,
USB_PERIPHERAL_MODE,
};
enum chg_type {
USB_CHG_TYPE__SDP,
USB_CHG_TYPE__CARKIT,
USB_CHG_TYPE__WALLCHARGER,
USB_CHG_TYPE__INVALID
};
enum pre_emphasis_level {
PRE_EMPHASIS_DEFAULT,
PRE_EMPHASIS_DISABLE,
PRE_EMPHASIS_WITH_10_PERCENT = (1 << 5),
PRE_EMPHASIS_WITH_20_PERCENT = (3 << 4),
};
enum cdr_auto_reset {
CDR_AUTO_RESET_DEFAULT,
CDR_AUTO_RESET_ENABLE,
CDR_AUTO_RESET_DISABLE,
};
enum se1_gate_state {
SE1_GATING_DEFAULT,
SE1_GATING_ENABLE,
SE1_GATING_DISABLE,
};
enum hs_drv_amplitude {
HS_DRV_AMPLITUDE_DEFAULT,
HS_DRV_AMPLITUDE_ZERO_PERCENT,
HS_DRV_AMPLITUDE_25_PERCENTI = (1 << 2),
HS_DRV_AMPLITUDE_5_PERCENT = (1 << 3),
HS_DRV_AMPLITUDE_75_PERCENT = (3 << 2),
};
#define HS_DRV_SLOPE_DEFAULT (-1)
/* used to configure the analog switch to select b/w host and peripheral */
enum usb_switch_control {
USB_SWITCH_PERIPHERAL = 0, /* Configure switch in peripheral mode*/
USB_SWITCH_HOST, /* Host mode */
USB_SWITCH_DISABLE, /* No mode selected, shutdown power */
};
struct msm_hsusb_gadget_platform_data {
int *phy_init_seq;
void (*phy_reset)(void);
int self_powered;
int is_phy_status_timer_on;
bool prop_chg;
};
struct msm_otg_platform_data {
int (*rpc_connect)(int);
int (*phy_reset)(void __iomem *);
int pmic_vbus_irq;
int pmic_id_irq;
/* if usb link is in sps there is no need for
* usb pclk as dayatona fabric clock will be
* used instead
*/
int usb_in_sps;
enum pre_emphasis_level pemp_level;
enum cdr_auto_reset cdr_autoreset;
enum hs_drv_amplitude drv_ampl;
enum se1_gate_state se1_gating;
int hsdrvslope;
int phy_reset_sig_inverted;
int phy_can_powercollapse;
int pclk_required_during_lpm;
int bam_disable;
/* HSUSB core in 8660 has the capability to gate the
* pclk when not being used. Though this feature is
* now being disabled because of H/w issues
*/
int pclk_is_hw_gated;
int (*ldo_init) (int init);
int (*ldo_enable) (int enable);
int (*ldo_set_voltage) (int mV);
u32 swfi_latency;
/* pmic notfications apis */
int (*pmic_vbus_notif_init) (void (*callback)(int online), int init);
int (*pmic_id_notif_init) (void (*callback)(int online), int init);
int (*phy_id_setup_init) (int init);
int (*pmic_register_vbus_sn) (void (*callback)(int online));
void (*pmic_unregister_vbus_sn) (void (*callback)(int online));
int (*pmic_enable_ldo) (int);
int (*init_gpio)(int on);
void (*setup_gpio)(enum usb_switch_control mode);
u8 otg_mode;
u8 usb_mode;
void (*vbus_power) (unsigned phy_info, int on);
/* charger notification apis */
void (*chg_connected)(enum chg_type chg_type);
void (*chg_vbus_draw)(unsigned ma);
int (*chg_init)(int init);
int (*config_vddcx)(int high);
int (*init_vddcx)(int init);
struct pm_qos_request pm_qos_req_dma;
};
struct msm_usb_host_platform_data {
unsigned phy_info;
unsigned int power_budget;
void (*config_gpio)(unsigned int config);
void (*vbus_power) (unsigned phy_info, int on);
int (*vbus_init)(int init);
struct clk *ebi1_clk;
};
#endif
@@ -0,0 +1,288 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2008-2009, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __LINUX_USB_GADGET_MSM72K_UDC_H__
#define __LINUX_USB_GADGET_MSM72K_UDC_H__
#define USB_ID (MSM_USB_BASE + 0x0000)
#define USB_HWGENERAL (MSM_USB_BASE + 0x0004)
#define USB_HWHOST (MSM_USB_BASE + 0x0008)
#define USB_HWDEVICE (MSM_USB_BASE + 0x000C)
#define USB_HWTXBUF (MSM_USB_BASE + 0x0010)
#define USB_HWRXBUF (MSM_USB_BASE + 0x0014)
#define USB_AHB_BURST (MSM_USB_BASE + 0x0090)
#define USB_AHB_MODE (MSM_USB_BASE + 0x0098)
#define USB_GEN_CONFIG (MSM_USB_BASE + 0x009C)
#define USB_BAM_DISABLE (1 << 13)
#define USB_ROC_AHB_MODE (MSM_USB_BASE + 0x0090)
#define USB_SBUSCFG (MSM_USB_BASE + 0x0090)
#define USB_CAPLENGTH (MSM_USB_BASE + 0x0100) /* 8 bit */
#define USB_HCIVERSION (MSM_USB_BASE + 0x0102) /* 16 bit */
#define USB_HCSPARAMS (MSM_USB_BASE + 0x0104)
#define USB_HCCPARAMS (MSM_USB_BASE + 0x0108)
#define USB_DCIVERSION (MSM_USB_BASE + 0x0120) /* 16 bit */
#define USB_USBCMD (MSM_USB_BASE + 0x0140)
#define USB_USBSTS (MSM_USB_BASE + 0x0144)
#define USB_USBINTR (MSM_USB_BASE + 0x0148)
#define USB_FRINDEX (MSM_USB_BASE + 0x014C)
#define USB_DEVICEADDR (MSM_USB_BASE + 0x0154)
#define USB_ENDPOINTLISTADDR (MSM_USB_BASE + 0x0158)
#define USB_BURSTSIZE (MSM_USB_BASE + 0x0160)
#define USB_TXFILLTUNING (MSM_USB_BASE + 0x0164)
#define USB_ULPI_VIEWPORT (MSM_USB_BASE + 0x0170)
#define USB_ENDPTNAK (MSM_USB_BASE + 0x0178)
#define USB_ENDPTNAKEN (MSM_USB_BASE + 0x017C)
#define USB_PORTSC (MSM_USB_BASE + 0x0184)
#define USB_OTGSC (MSM_USB_BASE + 0x01A4)
#define USB_USBMODE (MSM_USB_BASE + 0x01A8)
#define USB_ENDPTSETUPSTAT (MSM_USB_BASE + 0x01AC)
#define USB_ENDPTPRIME (MSM_USB_BASE + 0x01B0)
#define USB_ENDPTFLUSH (MSM_USB_BASE + 0x01B4)
#define USB_ENDPTSTAT (MSM_USB_BASE + 0x01B8)
#define USB_ENDPTCOMPLETE (MSM_USB_BASE + 0x01BC)
#define USB_ENDPTCTRL(n) (MSM_USB_BASE + 0x01C0 + (4 * (n)))
#define USBCMD_RESET 2
#define USBCMD_ATTACH 1
#define USBCMD_RS (1 << 0) /* run/stop bit */
#define USBCMD_ATDTW (1 << 14)
#define USBCMD_ITC(n) (n << 16)
#define USBCMD_ITC_MASK (0xFF << 16)
#define ASYNC_INTR_CTRL (1 << 29)
#define ULPI_STP_CTRL (1 << 30)
#define USBMODE_DEVICE 2
#define USBMODE_HOST 3
#define USBMODE_VBUS (1 << 5) /* vbus power select */
/* Redefining SDIS bit as it defined incorrectly in ehci.h. */
#ifdef USBMODE_SDIS
#undef USBMODE_SDIS
#endif
#define USBMODE_SDIS (1 << 4) /* stream disable */
struct ept_queue_head {
unsigned config;
unsigned active; /* read-only */
unsigned next;
unsigned info;
unsigned page0;
unsigned page1;
unsigned page2;
unsigned page3;
unsigned page4;
unsigned reserved_0;
unsigned char setup_data[8];
unsigned reserved_1;
unsigned reserved_2;
unsigned reserved_3;
unsigned reserved_4;
};
#define CONFIG_MAX_PKT(n) ((n) << 16)
#define CONFIG_ZLT (1 << 29) /* stop on zero-len xfer */
#define CONFIG_IOS (1 << 15) /* IRQ on setup */
#define CONFIG_MULT (3 << 30)
#define CONFIG_MULT_SHIFT 11
struct ept_queue_item {
unsigned next;
unsigned info;
unsigned page0;
unsigned page1;
unsigned page2;
unsigned page3;
unsigned page4;
unsigned reserved;
};
#define TERMINATE 1
#define INFO_BYTES(n) ((n) << 16)
#define INFO_IOC (1 << 15)
#define INFO_ACTIVE (1 << 7)
#define INFO_HALTED (1 << 6)
#define INFO_BUFFER_ERROR (1 << 5)
#define INFO_TXN_ERROR (1 << 3)
#define STS_NAKI (1 << 16) /* */
#define STS_SLI (1 << 8) /* R/WC - suspend state entered */
#define STS_SRI (1 << 7) /* R/WC - SOF recv'd */
#define STS_URI (1 << 6) /* R/WC - RESET recv'd */
#define STS_FRI (1 << 3) /* R/WC - Frame List Rollover */
#define STS_PCI (1 << 2) /* R/WC - Port Change Detect */
#define STS_UEI (1 << 1) /* R/WC - USB Error */
#define STS_UI (1 << 0) /* R/WC - USB Transaction Complete */
/* bits used in all the endpoint status registers */
#define EPT_TX(n) (1 << ((n) + 16))
#define EPT_RX(n) (1 << (n))
#define CTRL_TXE (1 << 23)
#define CTRL_TXR (1 << 22)
#define CTRL_TXI (1 << 21)
#define CTRL_TXD (1 << 17)
#define CTRL_TXS (1 << 16)
#define CTRL_RXE (1 << 7)
#define CTRL_RXR (1 << 6)
#define CTRL_RXI (1 << 5)
#define CTRL_RXD (1 << 1)
#define CTRL_RXS (1 << 0)
#define CTRL_TXT_MASK (3 << 18)
#define CTRL_TXT_CTRL (0 << 18)
#define CTRL_TXT_ISOCH (1 << 18)
#define CTRL_TXT_BULK (2 << 18)
#define CTRL_TXT_INT (3 << 18)
#define CTRL_TXT_EP_TYPE_SHIFT 18
#define CTRL_RXT_MASK (3 << 2)
#define CTRL_RXT_CTRL (0 << 2)
#define CTRL_RXT_ISOCH (1 << 2)
#define CTRL_RXT_BULK (2 << 2)
#define CTRL_RXT_INT (3 << 2)
#define CTRL_RXT_EP_TYPE_SHIFT 2
#define ULPI_CONFIG_REG 0x31
#if (defined(CONFIG_ARCH_MSM7X27) && !defined(CONFIG_ARCH_MSM7X27A)) \
|| defined(CONFIG_ARCH_QSD8X50)
#define ULPI_DIGOUT_CTRL 0X31
#define ULPI_CDR_AUTORESET (1 << 5)
#else
#define ULPI_DIGOUT_CTRL 0X36
#define ULPI_CDR_AUTORESET (1 << 1)
#endif
#define ULPI_SE1_GATE (1 << 2)
#define ULPI_CONFIG_REG1 0x30
#define ULPI_CONFIG_REG2 0X31
#define ULPI_CONFIG_REG3 0X32
#define ULPI_IFC_CTRL_CLR 0x09
#define ULPI_AMPLITUDE_MAX 0x0C
#define ULPI_OTG_CTRL 0x0B
#define ULPI_OTG_CTRL_CLR 0x0C
#define ULPI_INT_RISE_CLR 0x0F
#define ULPI_INT_FALL_CLR 0x12
#define ULPI_PRE_EMPHASIS_MASK (3 << 4)
#define ULPI_HSDRVSLOPE_MASK (0x0F)
#define ULPI_DRV_AMPL_MASK (3 << 2)
#define ULPI_ONCLOCK (1 << 6)
#define ULPI_IDPU (1 << 0)
#define ULPI_HOST_DISCONNECT (1 << 0)
#define ULPI_VBUS_VALID (1 << 1)
#define ULPI_SESS_END (1 << 3)
#define ULPI_ID_GND (1 << 4)
#define ULPI_WAKEUP (1 << 31)
#define ULPI_RUN (1 << 30)
#define ULPI_WRITE (1 << 29)
#define ULPI_READ (0 << 29)
#define ULPI_STATE_NORMAL (1 << 27)
#define ULPI_ADDR(n) (((n) & 255) << 16)
#define ULPI_DATA(n) ((n) & 255)
#define ULPI_DATA_READ(n) (((n) >> 8) & 255)
/* USB_PORTSC bits for determining port speed */
#define PORTSC_PSPD_FS (0 << 26)
#define PORTSC_PSPD_LS (1 << 26)
#define PORTSC_PSPD_HS (2 << 26)
#define PORTSC_PSPD_MASK (3 << 26)
#define OTGSC_BSVIE (1 << 27) /* R/W - BSV Interrupt Enable */
#define OTGSC_DPIE (1 << 30) /* R/W - DataPulse Interrupt Enable */
#define OTGSC_1MSE (1 << 29) /* R/W - 1ms Interrupt Enable */
#define OTGSC_BSEIE (1 << 28) /* R/W - BSE Interrupt Enable */
#define OTGSC_ASVIE (1 << 26) /* R/W - ASV Interrupt Enable */
#define OTGSC_ASEIE (1 << 25) /* R/W - ASE Interrupt Enable */
#define OTGSC_IDIE (1 << 24) /* R/W - ID Interrupt Enable */
#define OTGSC_BSVIS (1 << 19) /* R/W - BSV Interrupt Status */
#define OTGSC_IDPU (1 << 5)
#define OTGSC_ID (1 << 8)
#define OTGSC_IDIS (1 << 16)
#define B_SESSION_VALID (1 << 11)
#define OTGSC_INTR_MASK (OTGSC_BSVIE | OTGSC_DPIE | OTGSC_1MSE | \
OTGSC_BSEIE | OTGSC_ASVIE | OTGSC_ASEIE | \
OTGSC_IDIE)
#define OTGSC_INTR_STS_MASK (0x7f << 16)
#define CURRENT_CONNECT_STATUS (1 << 0)
#define PORTSC_FPR (1 << 6) /* R/W - State normal => suspend */
#define PORTSC_SUSP (1 << 7) /* Read - Port in suspend state */
#define PORTSC_LS (3 << 10) /* Read - Port's Line status */
#define PORTSC_PHCD (1 << 23) /* phy suspend mode */
#define PORTSC_CCS (1 << 0) /* current connect status */
#define PORTSC_PORT_RESET 0x00000100
#define PORTSC_PTS (3 << 30)
#define PORTSC_PTS_ULPI (2 << 30)
#define PORTSC_PTS_SERIAL (3 << 30)
#define PORTSC_PORT_SPEED_FULL 0x00000000
#define PORTSC_PORT_SPEED_LOW 0x04000000
#define PORTSC_PORT_SPEED_HIGH 0x08000000
#define PORTSC_PORT_SPEED_MASK 0x0c000000
#define SBUSCFG_AHBBRST_INCR4 0x01
#define ULPI_USBINTR_ENABLE_RASING_C 0x0F
#define ULPI_USBINTR_ENABLE_FALLING_C 0x12
#define ULPI_USBINTR_STATUS 0x13
#define ULPI_USBINTR_ENABLE_RASING_S 0x0E
#define ULPI_USBINTR_ENABLE_FALLING_S 0x11
#define ULPI_SESSION_END_RAISE (1 << 3)
#define ULPI_SESSION_END_FALL (1 << 3)
#define ULPI_SESSION_VALID_RAISE (1 << 2)
#define ULPI_SESSION_VALID_FALL (1 << 2)
#define ULPI_VBUS_VALID_RAISE (1 << 1)
#define ULPI_VBUS_VALID_FALL (1 << 1)
#define ULPI_CHG_DETECT_REG 0x34
/* control charger detection by ULPI or externally */
#define ULPI_EXTCHGCTRL_65NM (1 << 2)
#define ULPI_EXTCHGCTRL_180NM (1 << 3)
/* charger detection power on control */
#define ULPI_CHGDETON (1 << 1)
/* enable charger detection */
#define ULPI_CHGDETEN (1 << 0)
#define ULPI_CHGTYPE_65NM (1 << 3)
#define ULPI_CHGTYPE_180NM (1 << 4)
/* test mode support */
#define J_TEST (0x0100)
#define K_TEST (0x0200)
#define SE0_NAK_TEST (0x0300)
#define TST_PKT_TEST (0x0400)
#define PORTSC_PTC (0xf << 16)
#define PORTSC_PTC_J_STATE (0x01 << 16)
#define PORTSC_PTC_K_STATE (0x02 << 16)
#define PORTSC_PTC_SE0_NAK (0x03 << 16)
#define PORTSC_PTC_TST_PKT (0x04 << 16)
#define USBH (1 << 15)
#define USB_PHY (1 << 18)
#define ULPI_DEBUG 0x15
#define ULPI_FUNC_CTRL_CLR 0x06
#define ULPI_SUSPENDM (1 << 6)
#define ULPI_CLOCK_SUSPENDM (1 << 3)
#define ULPI_CALIB_STS (1 << 7)
#define ULPI_CALIB_VAL(x) (x & 0x7C)
#endif /* __LINUX_USB_GADGET_MSM72K_UDC_H__ */
@@ -0,0 +1,27 @@
/* Copyright (c) 2008-2009, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _MSM_I2CKBD_H_
#define _MSM_I2CKBD_H_
struct msm_i2ckbd_platform_data {
uint8_t hwrepeat;
uint8_t scanset1;
int gpioreset;
int gpioirq;
int (*gpio_setup) (void);
void (*gpio_shutdown)(void);
void (*hw_reset) (int);
};
#endif
@@ -0,0 +1,136 @@
/* arch/arm/mach-msm/include/mach/msm_iomap.h
*
* Copyright (C) 2007 Google, Inc.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* The MSM peripherals are spread all over across 768MB of physical
* space, which makes just having a simple IO_ADDRESS macro to slide
* them into the right virtual location rough. Instead, we will
* provide a master phys->virt mapping for peripherals here.
*
*/
#ifndef __ASM_ARCH_MSM_IOMAP_7X00_H
#define __ASM_ARCH_MSM_IOMAP_7X00_H
#include <asm/sizes.h>
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* MSM_VIC_BASE must be an value that can be loaded via a "mov"
* instruction, otherwise entry-macro.S will not compile.
*
* If you add or remove entries here, you'll want to edit the
* msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define MSM_VIC_BASE IOMEM(0xF8000000)
#define MSM_VIC_PHYS 0xC0000000
#define MSM_VIC_SIZE SZ_4K
#define MSM_CSR_BASE IOMEM(0xF8001000)
#define MSM_CSR_PHYS 0xC0100000
#define MSM_CSR_SIZE SZ_4K
#define MSM_TMR_PHYS MSM_CSR_PHYS
#define MSM_TMR_BASE MSM_CSR_BASE
#define MSM_TMR_SIZE SZ_4K
#define MSM_GPT_BASE MSM_TMR_BASE
#define MSM_DGT_BASE (MSM_TMR_BASE + 0x10)
#define MSM_GPIO1_BASE IOMEM(0xF8003000)
#define MSM_GPIO1_PHYS 0xA9200000
#define MSM_GPIO1_SIZE SZ_4K
#define MSM_GPIO2_BASE IOMEM(0xF8004000)
#define MSM_GPIO2_PHYS 0xA9300000
#define MSM_GPIO2_SIZE SZ_4K
#define MSM_CLK_CTL_BASE IOMEM(0xF8005000)
#define MSM_CLK_CTL_PHYS 0xA8600000
#define MSM_CLK_CTL_SIZE SZ_4K
#define MSM_SHARED_RAM_BASE IOMEM(0xF8100000)
#define MSM_SHARED_RAM_PHYS 0x01F00000
#define MSM_SHARED_RAM_SIZE SZ_1M
#define MSM_UART1_PHYS 0xA9A00000
#define MSM_UART1_SIZE SZ_4K
#define MSM_UART2_PHYS 0xA9B00000
#define MSM_UART2_SIZE SZ_4K
#define MSM_UART3_PHYS 0xA9C00000
#define MSM_UART3_SIZE SZ_4K
#define MSM_SDC1_PHYS 0xA0400000
#define MSM_SDC1_SIZE SZ_4K
#define MSM_SDC2_PHYS 0xA0500000
#define MSM_SDC2_SIZE SZ_4K
#define MSM_SDC3_PHYS 0xA0600000
#define MSM_SDC3_SIZE SZ_4K
#define MSM_SDC4_PHYS 0xA0700000
#define MSM_SDC4_SIZE SZ_4K
#define MSM_NAND_PHYS 0xA0A00000
#define MSM_NAND_SIZE SZ_4K
#define MSM_I2C_PHYS 0xA9900000
#define MSM_I2C_SIZE SZ_4K
#define MSM_HSUSB_PHYS 0xA0800000
#define MSM_HSUSB_SIZE SZ_4K
#define MSM_PMDH_PHYS 0xAA600000
#define MSM_PMDH_SIZE SZ_4K
#define MSM_EMDH_PHYS 0xAA700000
#define MSM_EMDH_SIZE SZ_4K
#define MSM_MDP_PHYS 0xAA200000
#define MSM_MDP_SIZE 0x000F0000
#define MSM_MDC_BASE IOMEM(0xF8200000)
#define MSM_MDC_PHYS 0xAA500000
#define MSM_MDC_SIZE SZ_1M
#define MSM_AD5_BASE IOMEM(0xF8300000)
#define MSM_AD5_PHYS 0xAC000000
#define MSM_AD5_SIZE (SZ_1M*13)
#define MSM_VFE_PHYS 0xA0F00000
#define MSM_VFE_SIZE SZ_1M
#define MSM_UART1DM_PHYS 0xA0200000
#define MSM_UART2DM_PHYS 0xA0300000
#define MSM_SSBI_PHYS 0xA8100000
#define MSM_SSBI_SIZE SZ_4K
#define MSM_TSSC_PHYS 0xAA300000
#define MSM_TSSC_SIZE SZ_4K
#if defined(CONFIG_ARCH_MSM7X30)
#define MSM_GCC_BASE IOMEM(0xF8009000)
#define MSM_GCC_PHYS 0xC0182000
#define MSM_GCC_SIZE SZ_4K
#endif
#endif
@@ -0,0 +1,90 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2008-2012 The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* The MSM peripherals are spread all over across 768MB of physical
* space, which makes just having a simple IO_ADDRESS macro to slide
* them into the right virtual location rough. Instead, we will
* provide a master phys->virt mapping for peripherals here.
*
*/
#ifndef __ASM_ARCH_MSM_IOMAP_7X30_H
#define __ASM_ARCH_MSM_IOMAP_7X30_H
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* MSM_VIC_BASE must be an value that can be loaded via a "mov"
* instruction, otherwise entry-macro.S will not compile.
*
* If you add or remove entries here, you'll want to edit the
* msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define MSM7X30_VIC_PHYS 0xC0080000
#define MSM7X30_VIC_SIZE SZ_4K
#define MSM7X30_CSR_PHYS 0xC0100000
#define MSM7X30_CSR_SIZE SZ_4K
#define MSM7X30_TMR_PHYS MSM7X30_CSR_PHYS
#define MSM7X30_TMR_SIZE SZ_4K
#define MSM7X30_GPIO1_PHYS 0xAC001000
#define MSM7X30_GPIO1_SIZE SZ_4K
#define MSM7X30_GPIO2_PHYS 0xAC101000
#define MSM7X30_GPIO2_SIZE SZ_4K
#define MSM7X30_CLK_CTL_PHYS 0xAB800000
#define MSM7X30_CLK_CTL_SIZE SZ_4K
#define MSM7X30_CLK_CTL_SH2_PHYS 0xABA01000
#define MSM7X30_CLK_CTL_SH2_SIZE SZ_4K
#define MSM7X30_ACC0_PHYS 0xC0101000
#define MSM7X30_ACC0_SIZE SZ_4K
#define MSM7X30_SAW0_PHYS 0xC0102000
#define MSM7X30_SAW0_SIZE SZ_4K
#define MSM7X30_APCS_GCC_PHYS 0xC0182000
#define MSM7X30_APCS_GCC_SIZE SZ_4K
#define MSM7X30_TCSR_PHYS 0xAB600000
#define MSM7X30_TCSR_SIZE SZ_4K
#define MSM7X30_UART1_PHYS 0xACA00000
#define MSM7X30_UART1_SIZE SZ_4K
#define MSM7X30_UART2_PHYS 0xACB00000
#define MSM7X30_UART2_SIZE SZ_4K
#define MSM7X30_UART3_PHYS 0xACC00000
#define MSM7X30_UART3_SIZE SZ_4K
#define MSM7X30_MDC_PHYS 0xAA500000
#define MSM7X30_MDC_SIZE SZ_1M
#define MSM7X30_AD5_PHYS 0xA7000000
#define MSM7X30_AD5_SIZE (SZ_1M*13)
#ifndef __ASSEMBLY__
extern void msm_map_msm7x30_io(void);
#endif
#endif
@@ -0,0 +1,74 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2008-2012, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* The MSM peripherals are spread all over across 768MB of physical
* space, which makes just having a simple IO_ADDRESS macro to slide
* them into the right virtual location rough. Instead, we will
* provide a master phys->virt mapping for peripherals here.
*
*/
#ifndef __ASM_ARCH_MSM_IOMAP_7XXX_H
#define __ASM_ARCH_MSM_IOMAP_7XXX_H
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* MSM_VIC_BASE must be an value that can be loaded via a "mov"
* instruction, otherwise entry-macro.S will not compile.
*
* If you add or remove entries here, you'll want to edit the
* msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define MSM7XXX_VIC_PHYS 0xC0000000
#define MSM7XXX_VIC_SIZE SZ_4K
#define MSM7XXX_CSR_PHYS 0xC0100000
#define MSM7XXX_CSR_SIZE SZ_4K
#define MSM7XXX_TMR_PHYS MSM7XXX_CSR_PHYS
#define MSM7XXX_TMR_SIZE SZ_4K
#define MSM7XXX_GPIO1_PHYS 0xA9200000
#define MSM7XXX_GPIO1_SIZE SZ_4K
#define MSM7XXX_GPIO2_PHYS 0xA9300000
#define MSM7XXX_GPIO2_SIZE SZ_4K
#define MSM7XXX_CLK_CTL_PHYS 0xA8600000
#define MSM7XXX_CLK_CTL_SIZE SZ_4K
#define MSM7XXX_L2CC_PHYS 0xC0400000
#define MSM7XXX_L2CC_SIZE SZ_4K
#define MSM7XXX_UART1_PHYS 0xA9A00000
#define MSM7XXX_UART1_SIZE SZ_4K
#define MSM7XXX_UART2_PHYS 0xA9B00000
#define MSM7XXX_UART2_SIZE SZ_4K
#define MSM7XXX_UART3_PHYS 0xA9C00000
#define MSM7XXX_UART3_SIZE SZ_4K
#define MSM7XXX_MDC_PHYS 0xAA500000
#define MSM7XXX_MDC_SIZE SZ_1M
#define MSM7XXX_AD5_PHYS 0xAC000000
#define MSM7XXX_AD5_SIZE (SZ_1M*13)
#endif
@@ -0,0 +1,114 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2008-2012, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* The MSM peripherals are spread all over across 768MB of physical
* space, which makes just having a simple IO_ADDRESS macro to slide
* them into the right virtual location rough. Instead, we will
* provide a master phys->virt mapping for peripherals here.
*
*/
#ifndef __ASM_ARCH_MSM_IOMAP_8064_H
#define __ASM_ARCH_MSM_IOMAP_8064_H
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* If you add or remove entries here, you'll want to edit the
* msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define APQ8064_TMR_PHYS 0x0200A000
#define APQ8064_TMR_SIZE SZ_4K
#define APQ8064_TMR0_PHYS 0x0208A000
#define APQ8064_TMR0_SIZE SZ_4K
#define APQ8064_QGIC_DIST_PHYS 0x02000000
#define APQ8064_QGIC_DIST_SIZE SZ_4K
#define APQ8064_QGIC_CPU_PHYS 0x02002000
#define APQ8064_QGIC_CPU_SIZE SZ_4K
#define APQ8064_TLMM_PHYS 0x00800000
#define APQ8064_TLMM_SIZE SZ_16K
#define APQ8064_ACC0_PHYS 0x02088000
#define APQ8064_ACC0_SIZE SZ_4K
#define APQ8064_ACC1_PHYS 0x02098000
#define APQ8064_ACC1_SIZE SZ_4K
#define APQ8064_ACC2_PHYS 0x020A8000
#define APQ8064_ACC2_SIZE SZ_4K
#define APQ8064_ACC3_PHYS 0x020B8000
#define APQ8064_ACC3_SIZE SZ_4K
#define APQ8064_APCS_GCC_PHYS 0x02011000
#define APQ8064_APCS_GCC_SIZE SZ_4K
#define APQ8064_CLK_CTL_PHYS 0x00900000
#define APQ8064_CLK_CTL_SIZE SZ_16K
#define APQ8064_MMSS_CLK_CTL_PHYS 0x04000000
#define APQ8064_MMSS_CLK_CTL_SIZE SZ_4K
#define APQ8064_LPASS_CLK_CTL_PHYS 0x28000000
#define APQ8064_LPASS_CLK_CTL_SIZE SZ_4K
#define APQ8064_HFPLL_PHYS 0x00903000
#define APQ8064_HFPLL_SIZE SZ_4K
#define APQ8064_IMEM_PHYS 0x2A03F000
#define APQ8064_IMEM_SIZE SZ_4K
#define APQ8064_RPM_PHYS 0x00108000
#define APQ8064_RPM_SIZE SZ_4K
#define APQ8064_RPM_MPM_PHYS 0x00200000
#define APQ8064_RPM_MPM_SIZE SZ_4K
#define APQ8064_SAW0_PHYS 0x02089000
#define APQ8064_SAW0_SIZE SZ_4K
#define APQ8064_SAW1_PHYS 0x02099000
#define APQ8064_SAW1_SIZE SZ_4K
#define APQ8064_SAW2_PHYS 0x020A9000
#define APQ8064_SAW2_SIZE SZ_4K
#define APQ8064_SAW3_PHYS 0x020B9000
#define APQ8064_SAW3_SIZE SZ_4K
#define APQ8064_SAW_L2_PHYS 0x02012000
#define APQ8064_SAW_L2_SIZE SZ_4K
#define APQ8064_QFPROM_PHYS 0x00700000
#define APQ8064_QFPROM_SIZE SZ_4K
#define APQ8064_SIC_NON_SECURE_PHYS 0x12100000
#define APQ8064_SIC_NON_SECURE_SIZE SZ_64K
#define APQ8064_HDMI_PHYS 0x04A00000
#define APQ8064_HDMI_SIZE SZ_4K
#ifdef CONFIG_DEBUG_APQ8064_UART
#define MSM_DEBUG_UART_BASE IOMEM(0xFA740000)
#define MSM_DEBUG_UART_PHYS 0x16640000
#endif
#endif
@@ -0,0 +1,39 @@
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IOMAP_8084_H
#define __ASM_ARCH_MSM_IOMAP_8084_H
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* If you add or remove entries here, you'll want to edit the
* io desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define APQ8084_SHARED_RAM_PHYS 0x0FA00000
#define APQ8084_QGIC_DIST_PHYS 0xF9000000
#define APQ8084_QGIC_DIST_SIZE SZ_4K
#define APQ8084_TLMM_PHYS 0xFD510000
#define APQ8084_TLMM_SIZE SZ_16K
#ifdef CONFIG_DEBUG_APQ8084_UART
#define MSM_DEBUG_UART_BASE IOMEM(0xFA71E000)
#define MSM_DEBUG_UART_PHYS 0xF991E000
#endif
#endif
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IOMAP_8092_H
#define __ASM_ARCH_MSM_IOMAP_8092_H
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* If you add or remove entries here, you'll want to edit the
* io desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define MPQ8092_MSM_SHARED_RAM_PHYS 0x0FA00000
#define MPQ8092_QGIC_DIST_PHYS 0xF9000000
#define MPQ8092_QGIC_DIST_SIZE SZ_4K
#define MPQ8092_TLMM_PHYS 0xFD510000
#define MPQ8092_TLMM_SIZE SZ_16K
#ifdef CONFIG_DEBUG_MPQ8092_UART
#define MSM_DEBUG_UART_BASE IOMEM(0xFA71E000)
#define MSM_DEBUG_UART_PHYS 0xF991E000
#endif
#endif
@@ -0,0 +1,45 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IOMAP_MSM8226_H
#define __ASM_ARCH_MSM_IOMAP_MSM8226_H
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* If you add or remove entries here, you'll want to edit the
* io desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define MSM8226_MSM_SHARED_RAM_PHYS 0x0FA00000
#define MSM8226_QGIC_DIST_PHYS 0xF9000000
#define MSM8226_QGIC_DIST_SIZE SZ_4K
#define MSM8226_APCS_GCC_PHYS 0xF9011000
#define MSM8226_APCS_GCC_SIZE SZ_4K
#define MSM8226_TLMM_PHYS 0xFD510000
#define MSM8226_TLMM_SIZE SZ_16K
#define MSM8226_MPM2_PSHOLD_PHYS 0xFC4AB000
#define MSM8226_MPM2_PSHOLD_SIZE SZ_4K
#ifdef CONFIG_DEBUG_MSM8226_UART
#define MSM_DEBUG_UART_BASE IOMEM(0xFA71E000)
#define MSM_DEBUG_UART_PHYS 0xF991E000
#endif
#endif
@@ -0,0 +1,44 @@
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IOMAP_8610_H
#define __ASM_ARCH_MSM_IOMAP_8610_H
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* If you add or remove entries here, you'll want to edit the
* io desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define MSM8610_MSM_SHARED_RAM_PHYS 0x0D900000
#define MSM8610_QGIC_DIST_PHYS 0xF9000000
#define MSM8610_QGIC_DIST_SIZE SZ_4K
#define MSM8610_APCS_GCC_PHYS 0xF9011000
#define MSM8610_APCS_GCC_SIZE SZ_4K
#define MSM8610_TLMM_PHYS 0xFD510000
#define MSM8610_TLMM_SIZE SZ_16K
#define MSM8610_MPM2_PSHOLD_PHYS 0xFC4AB000
#define MSM8610_MPM2_PSHOLD_SIZE SZ_4K
#ifdef CONFIG_DEBUG_MSM8610_UART
#define MSM_DEBUG_UART_BASE IOMEM(0xFA71E000)
#define MSM_DEBUG_UART_PHYS 0xF991E000
#endif
#endif
@@ -0,0 +1,69 @@
/*
* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* The MSM peripherals are spread all over across 768MB of physical
* space, which makes just having a simple IO_ADDRESS macro to slide
* them into the right virtual location rough. Instead, we will
* provide a master phys->virt mapping for peripherals here.
*
*/
#ifndef __ASM_ARCH_MSM_IOMAP_8625_H
#define __ASM_ARCH_MSM_IOMAP_8625_H
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* If you add or remove entries here, you'll want to edit the
* msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define MSM8625_TMR_PHYS 0xC0800000
#define MSM8625_TMR_SIZE SZ_4K
#define MSM8625_TMR0_PHYS 0xC0100000
#define MSM8625_TMR0_SIZE SZ_4K
#define MSM8625_CLK_CTL_PHYS 0xA8600000
#define MSM8625_CLK_CTL_SIZE SZ_4K
#define MSM8625_QGIC_DIST_PHYS 0xC0000000
#define MSM8625_QGIC_DIST_SIZE SZ_4K
#define MSM8625_QGIC_CPU_PHYS 0xC0002000
#define MSM8625_QGIC_CPU_SIZE SZ_4K
#define MSM8625_SCU_PHYS 0xC0600000
#define MSM8625_SCU_SIZE SZ_256
#define MSM8625_SAW0_PHYS 0xC0200000
#define MSM8625_SAW0_SIZE SZ_4K
#define MSM8625_SAW1_PHYS 0xC0700000
#define MSM8625_SAW1_SIZE SZ_4K
#define MSM8625_SAW2_PHYS 0xC0A00000
#define MSM8625_SAW2_SIZE SZ_4K
#define MSM8625_SAW3_PHYS 0xC0B00000
#define MSM8625_SAW3_SIZE SZ_4K
#define MSM8625_CFG_CTL_PHYS 0xA9800000
#define MSM8625_CFG_CTL_SIZE SZ_4K
#define MSM8625_CPR_PHYS 0xC0900000
#define MSM8625_CPR_SIZE SZ_4K
#endif
@@ -0,0 +1,112 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2008-2011, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* The MSM peripherals are spread all over across 768MB of physical
* space, which makes just having a simple IO_ADDRESS macro to slide
* them into the right virtual location rough. Instead, we will
* provide a master phys->virt mapping for peripherals here.
*
*/
#ifndef __ASM_ARCH_MSM_IOMAP_8930_H
#define __ASM_ARCH_MSM_IOMAP_8930_H
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* If you add or remove entries here, you'll want to edit the
* msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define MSM8930_TMR_PHYS 0x0200A000
#define MSM8930_TMR_SIZE SZ_4K
#define MSM8930_TMR0_PHYS 0x0208A000
#define MSM8930_TMR0_SIZE SZ_4K
#define MSM8930_RPM_PHYS 0x00108000
#define MSM8930_RPM_SIZE SZ_4K
#define MSM8930_RPM_MPM_PHYS 0x00200000
#define MSM8930_RPM_MPM_SIZE SZ_4K
#define MSM8930_TCSR_PHYS 0x1A400000
#define MSM8930_TCSR_SIZE SZ_4K
#define MSM8930_APCS_GCC_PHYS 0x02011000
#define MSM8930_APCS_GCC_SIZE SZ_4K
#define MSM8930_SAW_L2_PHYS 0x02012000
#define MSM8930_SAW_L2_SIZE SZ_4K
#define MSM8930_SAW0_PHYS 0x02089000
#define MSM8930_SAW0_SIZE SZ_4K
#define MSM8930_SAW1_PHYS 0x02099000
#define MSM8930_SAW1_SIZE SZ_4K
#define MSM8930_IMEM_PHYS 0x2A03F000
#define MSM8930_IMEM_SIZE SZ_4K
#define MSM8930_ACC0_PHYS 0x02088000
#define MSM8930_ACC0_SIZE SZ_4K
#define MSM8930_ACC1_PHYS 0x02098000
#define MSM8930_ACC1_SIZE SZ_4K
#define MSM8930_QGIC_DIST_PHYS 0x02000000
#define MSM8930_QGIC_DIST_SIZE SZ_4K
#define MSM8930_QGIC_CPU_PHYS 0x02002000
#define MSM8930_QGIC_CPU_SIZE SZ_4K
#define MSM8930_CLK_CTL_PHYS 0x00900000
#define MSM8930_CLK_CTL_SIZE SZ_16K
#define MSM8930_MMSS_CLK_CTL_PHYS 0x04000000
#define MSM8930_MMSS_CLK_CTL_SIZE SZ_4K
#define MSM8930_LPASS_CLK_CTL_PHYS 0x28000000
#define MSM8930_LPASS_CLK_CTL_SIZE SZ_4K
#define MSM8930_HFPLL_PHYS 0x00903000
#define MSM8930_HFPLL_SIZE SZ_4K
#define MSM8930_TLMM_PHYS 0x00800000
#define MSM8930_TLMM_SIZE SZ_16K
#define MSM8930_DMOV_PHYS 0x18320000
#define MSM8930_DMOV_SIZE SZ_1M
#define MSM8930_SIC_NON_SECURE_PHYS 0x12100000
#define MSM8930_SIC_NON_SECURE_SIZE SZ_64K
#define MSM_GPT_BASE (MSM_TMR_BASE + 0x4)
#define MSM_DGT_BASE (MSM_TMR_BASE + 0x24)
#define MSM8930_HDMI_PHYS 0x04A00000
#define MSM8930_HDMI_SIZE SZ_4K
#ifdef CONFIG_DEBUG_MSM8930_UART
#define MSM_DEBUG_UART_BASE IOMEM(0xFA740000)
#define MSM_DEBUG_UART_PHYS 0x16440000
#endif
#define MSM8930_QFPROM_PHYS 0x00700000
#define MSM8930_QFPROM_SIZE SZ_4K
#endif
@@ -0,0 +1,113 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2008-2011, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* The MSM peripherals are spread all over across 768MB of physical
* space, which makes just having a simple IO_ADDRESS macro to slide
* them into the right virtual location rough. Instead, we will
* provide a master phys->virt mapping for peripherals here.
*
*/
#ifndef __ASM_ARCH_MSM_IOMAP_8960_H
#define __ASM_ARCH_MSM_IOMAP_8960_H
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* If you add or remove entries here, you'll want to edit the
* msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define MSM8960_TMR_PHYS 0x0200A000
#define MSM8960_TMR_SIZE SZ_4K
#define MSM8960_TMR0_PHYS 0x0208A000
#define MSM8960_TMR0_SIZE SZ_4K
#define MSM8960_RPM_PHYS 0x00108000
#define MSM8960_RPM_SIZE SZ_4K
#define MSM8960_RPM_MPM_PHYS 0x00200000
#define MSM8960_RPM_MPM_SIZE SZ_4K
#define MSM8960_TCSR_PHYS 0x1A400000
#define MSM8960_TCSR_SIZE SZ_4K
#define MSM8960_APCS_GCC_PHYS 0x02011000
#define MSM8960_APCS_GCC_SIZE SZ_4K
#define MSM8960_SAW_L2_PHYS 0x02012000
#define MSM8960_SAW_L2_SIZE SZ_4K
#define MSM8960_SAW0_PHYS 0x02089000
#define MSM8960_SAW0_SIZE SZ_4K
#define MSM8960_SAW1_PHYS 0x02099000
#define MSM8960_SAW1_SIZE SZ_4K
#define MSM8960_IMEM_PHYS 0x2A03F000
#define MSM8960_IMEM_SIZE SZ_4K
#define MSM8960_ACC0_PHYS 0x02088000
#define MSM8960_ACC0_SIZE SZ_4K
#define MSM8960_ACC1_PHYS 0x02098000
#define MSM8960_ACC1_SIZE SZ_4K
#define MSM8960_QGIC_DIST_PHYS 0x02000000
#define MSM8960_QGIC_DIST_SIZE SZ_4K
#define MSM8960_QGIC_CPU_PHYS 0x02002000
#define MSM8960_QGIC_CPU_SIZE SZ_4K
#define MSM8960_CLK_CTL_PHYS 0x00900000
#define MSM8960_CLK_CTL_SIZE SZ_16K
#define MSM8960_MMSS_CLK_CTL_PHYS 0x04000000
#define MSM8960_MMSS_CLK_CTL_SIZE SZ_4K
#define MSM8960_LPASS_CLK_CTL_PHYS 0x28000000
#define MSM8960_LPASS_CLK_CTL_SIZE SZ_4K
#define MSM8960_HFPLL_PHYS 0x00903000
#define MSM8960_HFPLL_SIZE SZ_4K
#define MSM8960_TLMM_PHYS 0x00800000
#define MSM8960_TLMM_SIZE SZ_16K
#define MSM8960_SIC_NON_SECURE_PHYS 0x12100000
#define MSM8960_SIC_NON_SECURE_SIZE SZ_64K
#define MSM_GPT_BASE (MSM_TMR_BASE + 0x4)
#define MSM_DGT_BASE (MSM_TMR_BASE + 0x24)
#define MSM8960_HDMI_PHYS 0x04A00000
#define MSM8960_HDMI_SIZE SZ_4K
#ifdef CONFIG_DEBUG_MSM8960_UART
#define MSM_DEBUG_UART_BASE IOMEM(0xFA740000)
#define MSM_DEBUG_UART_PHYS 0x16440000
#endif
#define MSM8960_QFPROM_PHYS 0x00700000
#define MSM8960_QFPROM_SIZE SZ_4K
#ifndef __ASSEMBLY__
extern void msm_map_msm8960_io(void);
#endif
#endif
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2008-2013, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __ASM_ARCH_MSM_IOMAP_8974_H
#define __ASM_ARCH_MSM_IOMAP_8974_H
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* If you add or remove entries here, you'll want to edit the
* io desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define MSM8974_MSM_SHARED_RAM_PHYS 0x0FA00000
#define MSM8974_QGIC_DIST_PHYS 0xF9000000
#define MSM8974_QGIC_DIST_SIZE SZ_4K
#define MSM8974_TLMM_PHYS 0xFD510000
#define MSM8974_TLMM_SIZE SZ_16K
#define MSM8974_MPM2_PSHOLD_PHYS 0xFC4AB000
#define MSM8974_MPM2_PSHOLD_SIZE SZ_4K
#ifdef CONFIG_DEBUG_MSM8974_UART
#define MSM_DEBUG_UART_BASE IOMEM(0xFA71E000)
#define MSM_DEBUG_UART_PHYS 0xF991E000
#endif
#endif
@@ -0,0 +1,94 @@
/*
* Copyright (C) 2007 Google, Inc.
* Copyright (c) 2008-2010, The Linux Foundation. All rights reserved.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* The MSM peripherals are spread all over across 768MB of physical
* space, which makes just having a simple IO_ADDRESS macro to slide
* them into the right virtual location rough. Instead, we will
* provide a master phys->virt mapping for peripherals here.
*
*/
#ifndef __ASM_ARCH_MSM_IOMAP_8X50_H
#define __ASM_ARCH_MSM_IOMAP_8X50_H
/* Physical base address and size of peripherals.
* Ordered by the virtual base addresses they will be mapped at.
*
* MSM_VIC_BASE must be an value that can be loaded via a "mov"
* instruction, otherwise entry-macro.S will not compile.
*
* If you add or remove entries here, you'll want to edit the
* msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
* changes.
*
*/
#define MSM_VIC_BASE IOMEM(0xFA000000)
#define MSM_VIC_PHYS 0xAC000000
#define MSM_VIC_SIZE SZ_4K
#define MSM_CSR_BASE IOMEM(0xFA001000)
#define MSM_CSR_PHYS 0xAC100000
#define MSM_CSR_SIZE SZ_4K
#define MSM_TMR_PHYS MSM_CSR_PHYS
#define MSM_TMR_BASE MSM_CSR_BASE
#define MSM_TMR_SIZE SZ_4K
#define MSM_GPIO1_BASE IOMEM(0xFA003000)
#define MSM_GPIO1_PHYS 0xA9000000
#define MSM_GPIO1_SIZE SZ_4K
#define MSM_GPIO2_BASE IOMEM(0xFA004000)
#define MSM_GPIO2_PHYS 0xA9100000
#define MSM_GPIO2_SIZE SZ_4K
#define MSM_CLK_CTL_BASE IOMEM(0xFA005000)
#define MSM_CLK_CTL_PHYS 0xA8600000
#define MSM_CLK_CTL_SIZE SZ_4K
#define MSM_SIRC_BASE IOMEM(0xFB006000)
#define MSM_SIRC_PHYS 0xAC200000
#define MSM_SIRC_SIZE SZ_4K
#define MSM_SCPLL_BASE IOMEM(0xFB007000)
#define MSM_SCPLL_PHYS 0xA8800000
#define MSM_SCPLL_SIZE SZ_4K
#define MSM_TCSR_BASE IOMEM(0xFB008000)
#define MSM_TCSR_PHYS 0xA8700000
#define MSM_TCSR_SIZE SZ_4K
#define MSM_SHARED_RAM_BASE IOMEM(0xFA100000)
#define MSM_SHARED_RAM_SIZE SZ_1M
#define MSM_UART1_PHYS 0xA9A00000
#define MSM_UART1_SIZE SZ_4K
#define MSM_UART2_PHYS 0xA9B00000
#define MSM_UART2_SIZE SZ_4K
#define MSM_UART3_PHYS 0xA9C00000
#define MSM_UART3_SIZE SZ_4K
#define MSM_MDC_BASE IOMEM(0xFA200000)
#define MSM_MDC_PHYS 0xAA500000
#define MSM_MDC_SIZE SZ_1M
#define MSM_AD5_BASE IOMEM(0xFA300000)
#define MSM_AD5_PHYS 0xAC000000
#define MSM_AD5_SIZE (SZ_1M*13)
#endif

Some files were not shown because too many files have changed in this diff Show More