summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDong Aisheng <b29396@freescale.com>2011-11-22 15:59:51 +0800
committerDong Aisheng <b29396@freescale.com>2011-11-22 22:19:21 +0800
commited5a15000f0a8c09b68bdff46906790dcbd01a0a (patch)
tree30adb1c7c9b703232acd2a803a5fff6093763245
parent9fa0f9350b2d4024adcde34fa4cd1375fe337a89 (diff)
ENGR00162885 mx6q: sabrelite: add flexcan supportrel_imx_2.6.38_11.11.01
Add flexcan support. Signed-off-by: Dong Aisheng <b29396@freescale.com>
-rw-r--r--arch/arm/mach-mx6/Kconfig1
-rwxr-xr-xarch/arm/mach-mx6/board-mx6q_sabrelite.c31
2 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-mx6/Kconfig b/arch/arm/mach-mx6/Kconfig
index 6a1a99dd7d17..5b8366e6f1fb 100644
--- a/arch/arm/mach-mx6/Kconfig
+++ b/arch/arm/mach-mx6/Kconfig
@@ -85,6 +85,7 @@ config MACH_MX6Q_SABRELITE
select IMX_HAVE_PLATFORM_IMX_PM
select IMX_HAVE_PLATFORM_MXC_HDMI
select IMX_HAVE_PLATFORM_IMX_ASRC
+ select IMX_HAVE_PLATFORM_FLEXCAN
help
Include support for i.MX 6Quad SABRE Lite platform. This includes specific
configurations for the board and its peripherals.
diff --git a/arch/arm/mach-mx6/board-mx6q_sabrelite.c b/arch/arm/mach-mx6/board-mx6q_sabrelite.c
index 994426e43af4..86bb06d79905 100755
--- a/arch/arm/mach-mx6/board-mx6q_sabrelite.c
+++ b/arch/arm/mach-mx6/board-mx6q_sabrelite.c
@@ -80,6 +80,8 @@
#define MX6Q_SABRELITE_USB_OTG_PWR IMX_GPIO_NR(3, 22)
#define MX6Q_SABRELITE_CAP_TCH_INT1 IMX_GPIO_NR(1, 9)
#define MX6Q_SABRELITE_USB_HUB_RESET IMX_GPIO_NR(7, 12)
+#define MX6Q_SABRELITE_CAN1_STBY IMX_GPIO_NR(1, 25)
+#define MX6Q_SABRELITE_CAN1_EN IMX_GPIO_NR(1, 27)
#define MX6Q_SABRELITE_SD3_WP_PADCFG (PAD_CTL_PKE | PAD_CTL_PUE | \
PAD_CTL_PUS_22K_UP | PAD_CTL_SPEED_MED | \
@@ -581,6 +583,27 @@ static void __init imx6q_sabrelite_init_usb(void)
mx6_usb_h1_init();
}
+static struct gpio mx6q_sabrelite_flexcan_gpios[] = {
+ { MX6Q_SABRELITE_CAN1_EN, GPIOF_OUT_INIT_LOW, "flexcan1-en" },
+ { MX6Q_SABRELITE_CAN1_STBY, GPIOF_OUT_INIT_LOW, "flexcan1-stby" },
+};
+
+static void mx6q_sabrelite_flexcan0_switch(int enable)
+{
+ if (enable) {
+ gpio_set_value(MX6Q_SABRELITE_CAN1_EN, 1);
+ gpio_set_value(MX6Q_SABRELITE_CAN1_STBY, 1);
+ } else {
+ gpio_set_value(MX6Q_SABRELITE_CAN1_EN, 0);
+ gpio_set_value(MX6Q_SABRELITE_CAN1_STBY, 0);
+ }
+}
+
+static const struct flexcan_platform_data
+ mx6q_sabrelite_flexcan0_pdata __initconst = {
+ .transceiver_switch = mx6q_sabrelite_flexcan0_switch,
+};
+
static struct viv_gpu_platform_data imx6q_gpu_pdata __initdata = {
.reserved_mem_size = SZ_128M,
};
@@ -858,6 +881,7 @@ static void __init fixup_mxc_board(struct machine_desc *desc, struct tag *tags,
static void __init mx6_sabrelite_board_init(void)
{
int i;
+ int ret;
mxc_iomux_v3_setup_multiple_pads(mx6q_sabrelite_pads,
ARRAY_SIZE(mx6q_sabrelite_pads));
@@ -925,6 +949,13 @@ static void __init mx6_sabrelite_board_init(void)
imx6q_add_hdmi_soc();
imx6q_add_hdmi_soc_dai();
+
+ ret = gpio_request_array(mx6q_sabrelite_flexcan_gpios,
+ ARRAY_SIZE(mx6q_sabrelite_flexcan_gpios));
+ if (ret)
+ pr_err("failed to request flexcan1-gpios: %d\n", ret);
+ else
+ imx6q_add_flexcan0(&mx6q_sabrelite_flexcan0_pdata);
}
extern void __iomem *twd_base;