imx6dl的管脚定义
其IO口宏定义在\arch\arm\plat-mxc\include\mach\iomux-mx6dl.h中,如CSI0_DAT10的定义。
/*管脚模式的命名规则为:MX6Q_PAD_<padname>__<padmode>_ padname为管脚名,padmode为管脚模式。*/
#define MX6DL_PAD_CSI0_DAT10__IPU1_CSI0_D_10 \
IOMUX_PAD(0x0360, 0x004C, 0, 0x0000, 0, NO_PAD_CTRL)
#define MX6DL_PAD_CSI0_DAT10__AUDMUX_AUD3_RXC \
IOMUX_PAD(0x0360, 0x004C, 1, 0x0000, 0, NO_PAD_CTRL)
#define MX6DL_PAD_CSI0_DAT10__ECSPI2_MISO \
IOMUX_PAD(0x0360, 0x004C, 2, 0x07F8, 0, MX6DL_ECSPI_PAD_CTRL)
#define MX6DL_PAD_CSI0_DAT10__UART1_TXD \
IOMUX_PAD(0x0360, 0x004C, 3, 0x0000, 0, MX6DL_UART_PAD_CTRL)
#define MX6DL_PAD_CSI0_DAT10__UART1_RXD \
IOMUX_PAD(0x0360, 0x004C, 3, 0x08FC, 0, MX6DL_UART_PAD_CTRL)
#define MX6DL_PAD_CSI0_DAT10__SDMA_DEBUG_PC_4 \
IOMUX_PAD(0x0360, 0x004C, 4, 0x0000, 0, NO_PAD_CTRL)
#define MX6DL_PAD_CSI0_DAT10__GPIO_5_28 \
IOMUX_PAD(0x0360, 0x004C, 5, 0x0000, 0, NO_PAD_CTRL)
#define MX6DL_PAD_CSI0_DAT10__MMDC_MMDC_DEBUG_33 \
IOMUX_PAD(0x0360, 0x004C, 6, 0x0000, 0, NO_PAD_CTRL)
#define MX6DL_PAD_CSI0_DAT10__SIMBA_TRACE_7 \
IOMUX_PAD(0x0360, 0x004C, 7, 0x0000, 0, NO_PAD_CTRL)
具体的可参考EthanYYYY的博客
board-mx6q_sabresd.c
在iomux-mx6dl.h定义的宏定义最终会在board-mx6q_sabresd.c进行调用。
static void __init mx6_sabresd_board_init(void)
{
int i;
int ret;
struct clk *clko2;
struct clk *new_parent;
int rate;
/*判断cpu类型和pad初始化*/
if (cpu_is_mx6q())
mxc_iomux_v3_setup_multiple_pads(mx6q_sabresd_pads,
ARRAY_SIZE(mx6q_sabresd_pads));
else if (cpu_is_mx6dl()) {
mxc_iomux_v3_setup_multiple_pads(mx6dl_sabresd_pads,
ARRAY_SIZE(mx6dl_sabresd_pads));
num_cpu_idle_lock = 0xffff0000;
}
#ifdef CONFIG_FEC_1588
/* Set GPIO_16 input for IEEE-1588 ts_clk and RMII reference clock
* For MX6 GPR1 bit21 meaning:
* Bit21: 0 - GPIO_16 pad output
* 1 - GPIO_16 pad input
*/
mxc_iomux_set_gpr_register(1, 21, 1, 1);
#endif
#ifdef CONFIG_FEC_1588
/* Set GPIO_16 input for IEEE-1588 ts_clk and RMII reference clock
* For MX6 GPR1 bit21 meaning:
* Bit21: 0 - GPIO_16 pad output
* 1 - GPIO_16 pad input
*/
mxc_iomux_set_gpr_register(1, 21, 1, 1);
#endif
gp_reg_id = sabresd_dvfscore_data.reg_id;
mx6q_sabresd_init_uart();
/*
* MX6DL/Solo only supports single IPU
* The following codes are used to change ipu id
* and display id information for MX6DL/Solo. Then
* register 1 IPU device and up to 2 displays for
* MX6DL/Solo
*/
if (cpu_is_mx6dl()) {
ldb_data.ipu_id = 0;
ldb_data.disp_id = 1;
hdmi_core_data.disp_id = 0;
mipi_dsi_pdata.ipu_id = 0;
mipi_dsi_pdata.disp_id = 1;
}
imx6q_add_mxc_hdmi_core(&hdmi_core_data);
imx6q_add_ipuv3(0, &ipu_data[0]);
if (cpu_is_mx6q())
imx6q_add_ipuv3(1, &ipu_data[1]);
for (i = 0; i < ARRAY_SIZE(sabresd_fb_data); i++)
imx6q_add_ipuv3fb(i, &sabresd_fb_data[i]);
imx6q_add_vdoa();
imx6q_add_mipi_dsi(&mipi_dsi_pdata);
imx6q_add_lcdif(&lcdif_data);
if (!disable_ldb)
imx6q_add_ldb(&ldb_data);
imx6q_add_v4l2_output(0);
imx6q_add_v4l2_capture(0);
imx6q_add_mipi_csi2(&mipi_csi2_pdata);
imx6q_add_imx_snvs_rtc();
if (board_is_mx6_reva()) {
strcpy(mxc_i2c0_board_info[0].type, "wm8958");
mxc_i2c0_board_info[0].platform_data = &wm8958_config_data;
} else {
strcpy(mxc_i2c0_board_info[0].type, "wm8962");
mxc_i2c0_board_info[0].platform_data = &wm8962_config_data;
}
imx6q_add_device_gpio_leds();
imx6q_add_imx_i2c(0, &mx6q_sabresd_i2c_data);
imx6q_add_imx_i2c(1, &mx6q_sabresd_i2c_data);
imx6q_add_imx_i2c(2, &mx6q_sabresd_i2c_data);
i2c_register_board_info(0, mxc_i2c0_board_info,
ARRAY_SIZE(mxc_i2c0_board_info));
i2c_register_board_info(1, mxc_i2c1_board_info,
ARRAY_SIZE(mxc_i2c1_board_info));
i2c_register_board_info(2, mxc_i2c2_board_info,
ARRAY_SIZE(mxc_i2c2_board_info));
ret = gpio_request(SABRESD_PFUZE_INT, "pFUZE-int");
if (ret) {
printk(KERN_ERR"request pFUZE-int error!!\n");
return;
} else {
gpio_direction_input(SABRESD_PFUZE_INT);
mx6q_sabresd_init_pfuze100(SABRESD_PFUZE_INT);
}
/* SPI */
imx6q_add_ecspi(0, &mx6q_sabresd_spi_data);
spi_device_init();
imx6q_add_mxc_hdmi(&hdmi_data);
imx6q_add_anatop_thermal_imx(1, &mx6q_sabresd_anatop_thermal_data);
imx6_init_fec(fec_data);
imx6q_add_pm_imx(0, &mx6q_sabresd_pm_data);
/* Move sd4 to first because sd4 connect to emmc.
Mfgtools want emmc is mmcblk0 and other sd card is mmcblk1.
*/
imx6q_add_sdhci_usdhc_imx(3, &mx6q_sabresd_sd4_data);
imx6q_add_sdhci_usdhc_imx(2, &mx6q_sabresd_sd3_data);
imx6q_add_sdhci_usdhc_imx(1, &mx6q_sabresd_sd2_data);
imx_add_viv_gpu(&imx6_gpu_data, &imx6q_gpu_pdata);
imx6q_sabresd_init_usb();
/* SATA is not supported by MX6DL/Solo */
if (cpu_is_mx6q())
imx6q_add_ahci(0, &mx6q_sabresd_sata_data);
imx6q_add_vpu();
imx6q_init_audio();
platform_device_register(&sabresd_vmmc_reg_devices);
imx_asrc_data.asrc_core_clk = clk_get(NULL, "asrc_clk");
imx_asrc_data.asrc_audio_clk = clk_get(NULL, "asrc_serial_clk");
imx6q_add_asrc(&imx_asrc_data);
imx6q_add_mxc_pwm(0);
imx6q_add_mxc_pwm(1);
imx6q_add_mxc_pwm(2);
imx6q_add_mxc_pwm(3);
imx6q_add_mxc_pwm_backlight(0, &mx6_sabresd_pwm_backlight_data);
imx6q_add_otp();
imx6q_add_viim();
imx6q_add_imx2_wdt(0, NULL);
imx6q_add_dma();
imx6q_add_dvfs_core(&sabresd_dvfscore_data);
mx6_cpu_regulator_init();
imx6q_add_ion(0, &imx_ion_data,
sizeof(imx_ion_data) + sizeof(struct ion_platform_heap));
imx6q_add_device_buttons();
/* enable sensor 3v3 and 1v8 */
gpio_request(SABRESD_SENSOR_EN, "sensor-en");
gpio_direction_output(SABRESD_SENSOR_EN, 1);
/* enable ecompass intr */
gpio_request(SABRESD_eCOMPASS_INT, "ecompass-int");
gpio_direction_input(SABRESD_eCOMPASS_INT);
/* enable light sensor intr */
gpio_request(SABRESD_ALS_INT, "als-int");
gpio_direction_input(SABRESD_ALS_INT);
imx6q_add_hdmi_soc();
imx6q_add_hdmi_soc_dai();
if (cpu_is_mx6dl()) {
imx6dl_add_imx_pxp();
imx6dl_add_imx_pxp_client();
if (epdc_enabled) {
mxc_register_device(&max17135_sensor_device, NULL);
imx6dl_add_imx_epdc(&epdc_data);
}
}
/*
ret = gpio_request_array(mx6q_sabresd_flexcan_gpios,
ARRAY_SIZE(mx6q_sabresd_flexcan_gpios));
if (ret)
pr_err("failed to request flexcan1-gpios: %d\n", ret);
else
imx6q_add_flexcan0(&mx6q_sabresd_flexcan0_pdata);
*/
clko2 = clk_get(NULL, "clko2_clk");
if (IS_ERR(clko2))
pr_err("can't get CLKO2 clock.\n");
new_parent = clk_get(NULL, "osc_clk");
if (!IS_ERR(new_parent)) {
clk_set_parent(clko2, new_parent);
clk_put(new_parent);
}
rate = clk_round_rate(clko2, 24000000);
clk_set_rate(clko2, rate);
clk_enable(clko2);
/* Enable Aux_5V */
gpio_request(SABRESD_AUX_5V_EN, "aux_5v_en");
gpio_direction_output(SABRESD_AUX_5V_EN, 1);
gpio_set_value(SABRESD_AUX_5V_EN, 1);
pcie_3v3_power(false);
msleep(10);
pcie_3v3_power(true);
msleep(10);
pcie_3v3_reset();
gps_power_on(true);
/* Register charger chips */
platform_device_register(&sabresd_max8903_charger_1);
pm_power_off = mx6_snvs_poweroff;
imx6q_add_busfreq();
imx6q_add_pcie(&mx6_sabresd_pcie_data);
}
可以看出,初始化的是mx6dl_sabresd_pads这个函数,下面的是各种驱动的初始化。