summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx6/board-mx6q_sabreauto.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mx6/board-mx6q_sabreauto.c')
-rw-r--r--arch/arm/mach-mx6/board-mx6q_sabreauto.c108
1 files changed, 104 insertions, 4 deletions
diff --git a/arch/arm/mach-mx6/board-mx6q_sabreauto.c b/arch/arm/mach-mx6/board-mx6q_sabreauto.c
index fb590f576a0d..45f4af592ab9 100644
--- a/arch/arm/mach-mx6/board-mx6q_sabreauto.c
+++ b/arch/arm/mach-mx6/board-mx6q_sabreauto.c
@@ -46,6 +46,7 @@
#include <linux/fec.h>
#include <linux/memblock.h>
#include <linux/gpio.h>
+#include <linux/ion.h>
#include <linux/etherdevice.h>
#include <linux/regulator/anatop-regulator.h>
#include <linux/regulator/consumer.h>
@@ -92,7 +93,7 @@
#define SABREAUTO_USB_OTG_OC IMX_GPIO_NR(2, 8)
#define SABREAUTO_LDB_BACKLIGHT3 IMX_GPIO_NR(2, 9)
#define SABREAUTO_LDB_BACKLIGHT4 IMX_GPIO_NR(2, 10)
-#define SABREAUTO_ANDROID_MENU IMX_GPIO_NR(2, 12)
+#define SABREAUTO_ANDROID_POWER IMX_GPIO_NR(2, 12)
#define SABREAUTO_ANDROID_VOLUP IMX_GPIO_NR(2, 15)
#define SABREAUTO_CAP_TCH_INT IMX_GPIO_NR(2, 28)
#define SABREAUTO_eCOMPASS_INT IMX_GPIO_NR(2, 29)
@@ -201,9 +202,9 @@ enum sd_pad_mode {
static struct gpio_keys_button ard_buttons[] = {
GPIO_BUTTON(SABREAUTO_ANDROID_HOME, KEY_HOME, 1, "home", 0),
GPIO_BUTTON(SABREAUTO_ANDROID_BACK, KEY_BACK, 1, "back", 0),
- GPIO_BUTTON(SABREAUTO_ANDROID_MENU, KEY_MENU, 1, "menu", 0),
GPIO_BUTTON(SABREAUTO_ANDROID_VOLUP, KEY_VOLUMEUP, 1, "volume-up", 0),
GPIO_BUTTON(SABREAUTO_ANDROID_VOLDOWN, KEY_VOLUMEDOWN, 1, "volume-down", 0),
+ GPIO_BUTTON(SABREAUTO_ANDROID_POWER, KEY_POWER, 1, "power-key", 1),
};
static struct gpio_keys_platform_data ard_android_button_data = {
@@ -296,12 +297,16 @@ static const struct esdhc_platform_data mx6q_sabreauto_sd3_data __initconst = {
.support_8bit = 1,
.delay_line = 0,
.platform_pad_change = plt_sd_pad_change,
+ .cd_type = ESDHC_CD_CONTROLLER,
+ .runtime_pm = 1,
};
static const struct esdhc_platform_data mx6q_sabreauto_sd1_data __initconst = {
.cd_gpio = SABREAUTO_SD1_CD,
.wp_gpio = SABREAUTO_SD1_WP,
.keep_power_at_suspend = 1,
+ .cd_type = ESDHC_CD_CONTROLLER,
+ .runtime_pm = 1,
};
@@ -873,7 +878,7 @@ static void __init imx6q_sabreauto_init_usb(void)
}
static struct viv_gpu_platform_data imx6q_gpu_pdata __initdata = {
- .reserved_mem_size = SZ_128M,
+ .reserved_mem_size = SZ_128M + SZ_64M,
};
/* HW Initialization, if return 0, initialization is successful. */
@@ -1014,6 +1019,8 @@ static struct ipuv3_fb_platform_data sabr_fb_data[] = {
static void hdmi_init(int ipu_id, int disp_id)
{
int hdmi_mux_setting;
+ char ipu_di_clk[] = "ipu1_di0_clk";
+ struct clk *di_clk, *pll5_clk;
if ((ipu_id > 1) || (ipu_id < 0)) {
printk(KERN_ERR"Invalid IPU select for HDMI: %d. Set to 0\n",
@@ -1036,6 +1043,16 @@ static void hdmi_init(int ipu_id, int disp_id)
/* Set HDMI event as SDMA event2 while Chip version later than TO1.2 */
if (hdmi_SDMA_check())
mxc_iomux_set_gpr_register(0, 0, 1, 1);
+
+ ipu_di_clk[3] += ipu_id;
+ ipu_di_clk[7] += disp_id;
+ di_clk = clk_get(NULL, ipu_di_clk);
+ if (IS_ERR(di_clk))
+ printk(KERN_ERR "Cannot get %s clock\n", ipu_di_clk);
+ pll5_clk = clk_get(NULL, "pll5");
+ if (IS_ERR(pll5_clk))
+ printk(KERN_ERR "Cannot get pll5 clock\n");
+ clk_set_parent(di_clk, pll5_clk);
}
/* On mx6x sabreauto board i2c2 iomux with hdmi ddc,
@@ -1106,6 +1123,17 @@ static struct platform_pwm_backlight_data mx6_arm2_pwm_backlight_data3 = {
.pwm_period_ns = 50000,
};
+static struct ion_platform_data imx_ion_data = {
+ .nr = 1,
+ .heaps = {
+ {
+ .type = ION_HEAP_TYPE_CARVEOUT,
+ .name = "vpu_ion",
+ .size = SZ_64M,
+ },
+ },
+};
+
/* Backlight PWM for Main board lvds*/
static struct platform_pwm_backlight_data mx6_arm2_pwm_backlight_data4 = {
.pwm_id = 3,
@@ -1402,6 +1430,34 @@ static struct mxc_dvfs_platform_data sabreauto_dvfscore_data = {
static void __init fixup_mxc_board(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
+ char *str;
+ struct tag *t;
+ int i = 0;
+ struct ipuv3_fb_platform_data *pdata_fb = sabr_fb_data;
+
+ for_each_tag(t, tags) {
+ if (t->hdr.tag == ATAG_CMDLINE) {
+ str = t->u.cmdline.cmdline;
+ str = strstr(str, "fbmem=");
+ if (str != NULL) {
+ str += 6;
+ pdata_fb[i++].res_size[0] = memparse(str, &str);
+ while (*str == ',' &&
+ i < ARRAY_SIZE(sabr_fb_data)) {
+ str++;
+ pdata_fb[i++].res_size[0] = memparse(str, &str);
+ }
+ }
+ /* GPU reserved memory */
+ str = t->u.cmdline.cmdline;
+ str = strstr(str, "gpumem=");
+ if (str != NULL) {
+ str += 7;
+ imx6q_gpu_pdata.reserved_mem_size = memparse(str, &str);
+ }
+ break;
+ }
+ }
}
static int __init early_enable_mipi_sensor(char *p)
@@ -1736,6 +1792,8 @@ static void __init mx6_board_init(void)
imx6q_add_dvfs_core(&sabreauto_dvfscore_data);
+ imx6q_add_ion(0, &imx_ion_data,
+ sizeof(imx_ion_data) + sizeof(struct ion_platform_heap));
imx6q_add_mxc_pwm(2);
imx6q_add_mxc_pwm(3);
imx6q_add_mxc_pwm_backlight(2, &mx6_arm2_pwm_backlight_data3);
@@ -1767,6 +1825,14 @@ static void __init mx6_board_init(void)
imx6q_add_perfmon(0);
imx6q_add_perfmon(1);
imx6q_add_perfmon(2);
+
+ /* acquire this irq is want to let touch driver failed to
+ * request this irq gpio, and the driver will disable suspend
+ * funtion, to workaround sabreauto board have isssue on gpio
+ * of touch use. */
+ gpio_request(SABREAUTO_CAP_TCH_INT, "touch irq");
+ gpio_direction_input(SABREAUTO_CAP_TCH_INT);
+
}
extern void __iomem *twd_base;
@@ -1789,9 +1855,34 @@ static struct sys_timer mxc_timer = {
static void __init mx6q_reserve(void)
{
-#if defined(CONFIG_MXC_GPU_VIV) || defined(CONFIG_MXC_GPU_VIV_MODULE)
phys_addr_t phys;
+ int i, fb0_reserved = 0, fb_array_size;
+ /*
+ * Reserve primary framebuffer memory if its base address
+ * is set by kernel command line.
+ */
+ fb_array_size = ARRAY_SIZE(sabr_fb_data);
+ if (fb_array_size > 0 && sabr_fb_data[0].res_base[0] &&
+ sabr_fb_data[0].res_size[0]) {
+ memblock_reserve(sabr_fb_data[0].res_base[0],
+ sabr_fb_data[0].res_size[0]);
+ memblock_remove(sabr_fb_data[0].res_base[0],
+ sabr_fb_data[0].res_size[0]);
+ sabr_fb_data[0].late_init = true;
+ ipu_data[ldb_data.ipu_id].bypass_reset = true;
+ fb0_reserved = 1;
+ }
+ for (i = fb0_reserved; i < fb_array_size; i++)
+ if (sabr_fb_data[i].res_size[0]) {
+ /* Reserve for other background buffer. */
+ phys = memblock_alloc(sabr_fb_data[i].res_size[0],
+ SZ_4K);
+ memblock_remove(phys, sabr_fb_data[i].res_size[0]);
+ sabr_fb_data[i].res_base[0] = phys;
+ }
+
+#if defined(CONFIG_MXC_GPU_VIV) || defined(CONFIG_MXC_GPU_VIV_MODULE)
if (imx6q_gpu_pdata.reserved_mem_size) {
phys = memblock_alloc_base(imx6q_gpu_pdata.reserved_mem_size,
SZ_4K, SZ_2G);
@@ -1799,6 +1890,15 @@ static void __init mx6q_reserve(void)
imx6q_gpu_pdata.reserved_mem_base = phys;
}
#endif
+
+#if defined(CONFIG_ION)
+ if (imx_ion_data.heaps[0].size) {
+ phys = memblock_alloc(imx_ion_data.heaps[0].size, SZ_4K);
+ memblock_free(phys, imx_ion_data.heaps[0].size);
+ memblock_remove(phys, imx_ion_data.heaps[0].size);
+ imx_ion_data.heaps[0].base = phys;
+ }
+#endif
}
MACHINE_START(MX6Q_SABREAUTO, "Freescale i.MX 6Quad/DualLite/Solo Sabre Auto Board")