am335x mux配置

/****************************************************************
 *                  am335x mux配置
 *
 *    am335x的引脚复寄存器是CONTROL_MODULE Register(芯片手册Chapter 9)
 *    本文主要分析板级文件中如何实现复用。
 *
 *  参考链接:
 *        http://blog.chinaunix.net/uid-29745891-id-4348350.html
 *
 *                                Tony Liu, 2016-4-30, Shenzhen
 *****************************************************************/

MACHINE_START(AM335XEVM, "am335xevm")
    /* Maintainer: Texas Instruments */
    .atag_offset    = 0x100,
    .map_io        = am335x_evm_map_io,
    .init_early    = am33xx_init_early,
    .init_irq    = ti81xx_init_irq,
    .handle_irq     = omap3_intc_handle_irq,
    .timer        = &omap3_am33xx_timer,
    .init_machine    = am335x_evm_init,    ------+
MACHINE_END                                      |
                                                 |
static void __init am335x_evm_init(void)    <----+
{
    am33xx_cpuidle_init();
    am33xx_mux_init(board_mux);              ---------------------------+
    omap_serial_init();                                                 |
    am335x_evm_i2c_init();                                              |
    omap_sdrc_init(NULL, NULL);                                         |
    usb_musb_init(&musb_board_data);                                    |
                                                                        |
    omap_board_config = am335x_evm_config;                              |
    omap_board_config_size = ARRAY_SIZE(am335x_evm_config);             |
    ......                                                              |
}                                                                       |
                                                                        |
static struct omap_board_mux board_mux[] __initdata = {                 |
    AM33XX_MUX(XDMA_EVENT_INTR0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT),   |
    AM33XX_MUX(I2C0_SDA, OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW |        |
            AM33XX_INPUT_EN | AM33XX_PIN_OUTPUT),                       |
    AM33XX_MUX(I2C0_SCL, OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW |        |
            AM33XX_INPUT_EN | AM33XX_PIN_OUTPUT),                       |
    { .reg_offset = OMAP_MUX_TERMINATOR },                              |
};                                                                      |
                                                                        |
#define AM33XX_MUX(mode0, mux_value)                    \               |
{                                    \                                  |
    .reg_offset    = (AM33XX_CONTROL_PADCONF_##mode0##_OFFSET),    \    |
    .value        = (((mux_value) & AM33XX_INPUT_EN) ? (mux_value)\     |
                : ((mux_value) | AM33XX_PULL_DISA)),    \               |
}                                                                       |
以I2C为例,对上面的宏进行展开                                            |
    AM33XX_MUX(I2C0_SDA, OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW |        |
            AM33XX_INPUT_EN | AM33XX_PIN_OUTPUT),                       |
{                                                                       |
    .reg_offset = AM33XX_CONTROL_PADCONF_I2C0_SDA_OFFSET,               |
    .value      = I2C0_SDA, OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW |     |
                  AM33XX_INPUT_EN | AM33XX_PIN_OUTPUT,                  |
}                                                                       |
                                                                        |
// I2C0_SDA在CONTROL_MODULE的地址                                        |
#define AM33XX_CONTROL_PADCONF_I2C0_SDA_OFFSET            0x0988        |
// arch/arm/mach-omap2/mux33xx.c                                        |
int __init am33xx_mux_init(struct omap_board_mux *board_subset)     <---+
{
    return omap_mux_init("core", 0, AM33XX_CONTROL_PADCONF_MUX_PBASE, --+
            AM33XX_CONTROL_PADCONF_MUX_SIZE, am33xx_muxmodes,           |
            NULL, board_subset, NULL);                                  |
}                                                                       |
//CONTROL_MODULE寄存器地址                                               |
#define AM33XX_CONTROL_PADCONF_MUX_PBASE            0x44E10000LU        |
                                                                        |
int __init omap_mux_init(const char *name, u32 flags,            <------+
             u32 mux_pbase, u32 mux_size,
             struct omap_mux *superset,
             struct omap_mux *package_subset,
             struct omap_board_mux *board_mux,
             struct omap_ball *package_balls)
{
    struct omap_mux_partition *partition;

    partition = kzalloc(sizeof(struct omap_mux_partition), GFP_KERNEL);
    if (!partition)
        return -ENOMEM;

    partition->name = name;
    partition->flags = flags;
    partition->size = mux_size;
    partition->phys = mux_pbase;
    partition->base = ioremap(mux_pbase, mux_size);
    if (!partition->base) {
        pr_err("%s: Could not ioremap mux partition at 0x%08x\n",
            __func__, partition->phys);
        kfree(partition);
        return -ENODEV;
    }

    INIT_LIST_HEAD(&partition->muxmodes);

    list_add_tail(&partition->node, &mux_partitions);
    mux_partitions_cnt++;
    pr_info("%s: Add partition: #%d: %s, flags: %x\n", __func__,
        mux_partitions_cnt, partition->name, partition->flags);

    omap_mux_init_package(superset, package_subset, package_balls);
    omap_mux_init_list(partition, superset);
    omap_mux_init_signals(partition, board_mux);

    return 0;
}
// arch/arm/mach-omap2/mux33xx.c
/* 每个引脚最多右8中功能,都写在下面的结构体数组中
 * 所有引脚复用配置都会和这个结构体数组进行比对
 * 可以参考我上一篇文章am335x gpio中,关于配置引脚作为GPIO的部分
 */
#define _AM33XX_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7)        \
{                                        .reg_offset    = (AM33XX_CONTROL_PADCONF_##M0##_OFFSET),        .gpio        = (g),                            .muxnames    = { m0, m1, m2, m3, m4, m5, m6, m7 },        }

static struct omap_mux am33xx_muxmodes[] = {
    _AM33XX_MUXENTRY(GPMC_AD0, 0,
        "gpmc_ad0", "mmc1_dat0", NULL, NULL,
        NULL, NULL, NULL, "gpio1_0"),
    _AM33XX_MUXENTRY(GPMC_AD1, 0,
        "gpmc_ad1", "mmc1_dat1", NULL, NULL,
        NULL, NULL, NULL, "gpio1_1"),
    _AM33XX_MUXENTRY(GPMC_AD2, 0,
        "gpmc_ad2", "mmc1_dat2", NULL, NULL,
        NULL, NULL, NULL, "gpio1_2"),
    _AM33XX_MUXENTRY(GPMC_AD3, 0,
        "gpmc_ad3", "mmc1_dat3", NULL, NULL,
        NULL, NULL, NULL, "gpio1_3"),
    _AM33XX_MUXENTRY(GPMC_AD4, 0,
        "gpmc_ad4", "mmc1_dat4", NULL, NULL,
        NULL, NULL, NULL, "gpio1_4"),
    _AM33XX_MUXENTRY(GPMC_AD5, 0,
        "gpmc_ad5", "mmc1_dat5", NULL, NULL,
        NULL, NULL, NULL, "gpio1_5"),
    _AM33XX_MUXENTRY(GPMC_AD6, 0,
        "gpmc_ad6", "mmc1_dat6", NULL, NULL,
        NULL, NULL, NULL, "gpio1_6"),
    _AM33XX_MUXENTRY(GPMC_AD7, 0,
        "gpmc_ad7", "mmc1_dat7", NULL, NULL,
        NULL, NULL, NULL, "gpio1_7"),
    _AM33XX_MUXENTRY(GPMC_AD8, 0,
        "gpmc_ad8", "lcd_data23", "mmc1_dat0", "mmc2_dat4",
        NULL, NULL, NULL, "gpio0_22"),
    _AM33XX_MUXENTRY(GPMC_AD9, 0,
        "gpmc_ad9", "lcd_data22", "mmc1_dat1", "mmc2_dat5",
        "ehrpwm2B", NULL, NULL, "gpio0_23"),
    _AM33XX_MUXENTRY(GPMC_AD10, 0,
        "gpmc_ad10", "lcd_data21", "mmc1_dat2", "mmc2_dat6",
        NULL, NULL, NULL, "gpio0_26"),
    _AM33XX_MUXENTRY(GPMC_AD11, 0,
        "gpmc_ad11", "lcd_data20", "mmc1_dat3", "mmc2_dat7",
        NULL, NULL, NULL, "gpio0_27"),
    _AM33XX_MUXENTRY(GPMC_AD12, 0,
        "gpmc_ad12", "lcd_data19", "mmc1_dat4", "mmc2_dat0",
        NULL, NULL, NULL, "gpio1_12"),
    _AM33XX_MUXENTRY(GPMC_AD13, 0,
        "gpmc_ad13", "lcd_data18", "mmc1_dat5", "mmc2_dat1",
        NULL, NULL, NULL, "gpio1_13"),
    _AM33XX_MUXENTRY(GPMC_AD14, 0,
        "gpmc_ad14", "lcd_data17", "mmc1_dat6", "mmc2_dat2",
        NULL, NULL, NULL, "gpio1_14"),
    _AM33XX_MUXENTRY(GPMC_AD15, 0,
        "gpmc_ad15", "lcd_data16", "mmc1_dat7", "mmc2_dat3",
        NULL, NULL, NULL, "gpio1_15"),
    _AM33XX_MUXENTRY(GPMC_A0, 0,
        "gpmc_a0", "mii2_txen", "rgmii2_tctl", "rmii2_txen",
        NULL, NULL, NULL, "gpio1_16"),
    _AM33XX_MUXENTRY(GPMC_A1, 0,
        "gpmc_a1", "mii2_rxdv", "rgmii2_rctl", "mmc2_dat0",
        NULL, NULL, NULL, "gpio1_17"),
    _AM33XX_MUXENTRY(GPMC_A2, 0,
        "gpmc_a2", "mii2_txd3", "rgmii2_td3", "mmc2_dat1",
        NULL, NULL, "ehrpwm1A", "gpio1_18"),
    _AM33XX_MUXENTRY(GPMC_A3, 0,
        "gpmc_a3", "mii2_txd2", "rgmii2_td2", "mmc2_dat2",
        NULL, NULL, NULL, "gpio1_19"),
    _AM33XX_MUXENTRY(GPMC_A4, 0,
        "gpmc_a4", "mii2_txd1", "rgmii2_td1", "rmii2_txd1",
        "gpmc_a20", NULL, NULL, "gpio1_20"),
    _AM33XX_MUXENTRY(GPMC_A5, 0,
        "gpmc_a5", "mii2_txd0", "rgmii2_td0", "rmii2_txd0",
        "gpmc_a21", NULL, NULL, "gpio1_21"),
    _AM33XX_MUXENTRY(GPMC_A6, 0,
        "gpmc_a6", "mii2_txclk", "rgmii2_tclk", "mmc2_dat4",
        "gpmc_a22", NULL, NULL, "gpio1_22"),
    _AM33XX_MUXENTRY(GPMC_A7, 0,
        "gpmc_a7", "mii2_rxclk", "rgmii2_rclk", "mmc2_dat5",
        NULL, NULL, NULL, "gpio1_23"),
    _AM33XX_MUXENTRY(GPMC_A8, 0,
        "gpmc_a8", "mii2_rxd3", "rgmii2_rd3", "mmc2_dat6",
        NULL, NULL, "mcasp0_aclkx", "gpio1_24"),
    _AM33XX_MUXENTRY(GPMC_A9, 0,
        "gpmc_a9", "mii2_rxd2", "rgmii2_rd2", "mmc2_dat7",
        NULL, NULL, "mcasp0_fsx", "gpio1_25"),
    _AM33XX_MUXENTRY(GPMC_A10, 0,
        "gpmc_a10", "mii2_rxd1", "rgmii2_rd1", "rmii2_rxd1",
        NULL, NULL, "mcasp0_axr0", "gpio1_26"),
    _AM33XX_MUXENTRY(GPMC_A11, 0,
        "gpmc_a11", "mii2_rxd0", "rgmii2_rd0", "rmii2_rxd0",
        NULL, NULL, "mcasp0_axr1", "gpio1_27"),
    _AM33XX_MUXENTRY(GPMC_WAIT0, 0,
        "gpmc_wait0", "mii2_crs", NULL, "rmii2_crs_dv",
        "mmc1_sdcd", NULL, NULL, "gpio0_30"),
    _AM33XX_MUXENTRY(GPMC_WPN, 0,
        "gpmc_wpn", "mii2_rxerr", NULL, "rmii2_rxerr",
        "mmc2_sdcd", NULL, NULL, "gpio0_31"),
    _AM33XX_MUXENTRY(GPMC_BEN1, 0,
        "gpmc_ben1", "mii2_col", NULL, "mmc2_dat3",
        NULL, NULL, "mcasp0_aclkr", "gpio1_28"),
    _AM33XX_MUXENTRY(GPMC_CSN0, 0,
        "gpmc_csn0", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio1_29"),
    _AM33XX_MUXENTRY(GPMC_CSN1, 0,
        "gpmc_csn1", NULL, "mmc1_clk", NULL,
        NULL, NULL, NULL, "gpio1_30"),
    _AM33XX_MUXENTRY(GPMC_CSN2, 0,
        "gpmc_csn2", NULL, "mmc1_cmd", NULL,
        NULL, NULL, NULL, "gpio1_31"),
    _AM33XX_MUXENTRY(GPMC_CSN3, 0,
        "gpmc_csn3", NULL, NULL, "mmc2_cmd",
        NULL, NULL, NULL, "gpio2_0"),
    _AM33XX_MUXENTRY(GPMC_CLK, 0,
        "gpmc_clk", "lcd_memory_clk_mux", NULL, "mmc2_clk",
        NULL, NULL, "mcasp0_fsr", "gpio2_1"),
    _AM33XX_MUXENTRY(GPMC_ADVN_ALE, 0,
        "gpmc_advn_ale", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_2"),
    _AM33XX_MUXENTRY(GPMC_OEN_REN, 0,
        "gpmc_oen_ren", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_3"),
    _AM33XX_MUXENTRY(GPMC_WEN, 0,
        "gpmc_wen", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_4"),
    _AM33XX_MUXENTRY(GPMC_BEN0_CLE, 0,
        "gpmc_ben0_cle", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_5"),
    _AM33XX_MUXENTRY(LCD_DATA0, 0,
        "lcd_data0", "gpmc_a0", NULL, NULL,
        NULL, NULL, NULL, "gpio2_6"),
    _AM33XX_MUXENTRY(LCD_DATA1, 0,
        "lcd_data1", "gpmc_a1", NULL, NULL,
        NULL, NULL, NULL, "gpio2_7"),
    _AM33XX_MUXENTRY(LCD_DATA2, 0,
        "lcd_data2", "gpmc_a2", NULL, NULL,
        NULL, NULL, NULL, "gpio2_8"),
    _AM33XX_MUXENTRY(LCD_DATA3, 0,
        "lcd_data3", "gpmc_a3", NULL, NULL,
        NULL, NULL, NULL, "gpio2_9"),
    _AM33XX_MUXENTRY(LCD_DATA4, 0,
        "lcd_data4", "gpmc_a4", NULL, NULL,
        NULL, NULL, NULL, "gpio2_10"),
    _AM33XX_MUXENTRY(LCD_DATA5, 0,
        "lcd_data5", "gpmc_a5", NULL, NULL,
        NULL, NULL, NULL, "gpio2_11"),
    _AM33XX_MUXENTRY(LCD_DATA6, 0,
        "lcd_data6", "gpmc_a6", NULL, NULL,
        NULL, NULL, NULL, "gpio2_12"),
    _AM33XX_MUXENTRY(LCD_DATA7, 0,
        "lcd_data7", "gpmc_a7", NULL, NULL,
        NULL, NULL, NULL, "gpio2_13"),
    _AM33XX_MUXENTRY(LCD_DATA8, 0,
        "lcd_data8", "gpmc_a12", NULL, "mcasp0_aclkx",
        NULL, NULL, "uart2_ctsn", "gpio2_14"),
    _AM33XX_MUXENTRY(LCD_DATA9, 0,
        "lcd_data9", "gpmc_a13", NULL, "mcasp0_fsx",
        NULL, NULL, "uart2_rtsn", "gpio2_15"),
    _AM33XX_MUXENTRY(LCD_DATA10, 0,
        "lcd_data10", "gpmc_a14", NULL, "mcasp0_axr0",
        NULL, NULL, NULL, "gpio2_16"),
    _AM33XX_MUXENTRY(LCD_DATA11, 0,
        "lcd_data11", "gpmc_a15", NULL, "mcasp0_ahclkr",
        "mcasp0_axr2", NULL, NULL, "gpio2_17"),
    _AM33XX_MUXENTRY(LCD_DATA12, 0,
        "lcd_data12", "gpmc_a16", NULL, "mcasp0_aclkr",
        "mcasp0_axr2", NULL, NULL, "gpio0_8"),
    _AM33XX_MUXENTRY(LCD_DATA13, 0,
        "lcd_data13", "gpmc_a17", NULL, "mcasp0_fsr",
        "mcasp0_axr3", NULL, NULL, "gpio0_9"),
    _AM33XX_MUXENTRY(LCD_DATA14, 0,
        "lcd_data14", "gpmc_a18", NULL, "mcasp0_axr1",
        NULL, NULL, NULL, "gpio0_10"),
    _AM33XX_MUXENTRY(LCD_DATA15, 0,
        "lcd_data15", "gpmc_a19", NULL, "mcasp0_ahclkx",
        "mcasp0_axr3", NULL, NULL, "gpio0_11"),
    _AM33XX_MUXENTRY(LCD_VSYNC, 0,
        "lcd_vsync", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_22"),
    _AM33XX_MUXENTRY(LCD_HSYNC, 0,
        "lcd_hsync", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_23"),
    _AM33XX_MUXENTRY(LCD_PCLK, 0,
        "lcd_pclk", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_24"),
    _AM33XX_MUXENTRY(LCD_AC_BIAS_EN, 0,
        "lcd_ac_bias_en", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_25"),
    _AM33XX_MUXENTRY(MMC0_DAT3, 0,
        "mmc0_dat3", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_26"),
    _AM33XX_MUXENTRY(MMC0_DAT2, 0,
        "mmc0_dat2", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_27"),
    _AM33XX_MUXENTRY(MMC0_DAT1, 0,
        "mmc0_dat1", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_28"),
    _AM33XX_MUXENTRY(MMC0_DAT0, 0,
        "mmc0_dat0", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_29"),
    _AM33XX_MUXENTRY(MMC0_CLK, 0,
        "mmc0_clk", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_30"),
    _AM33XX_MUXENTRY(MMC0_CMD, 0,
        "mmc0_cmd", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio2_31"),
    _AM33XX_MUXENTRY(MII1_COL, 0,
        "mii1_col", "rmii2_refclk", "spi1_sclk", NULL,
        "mcasp1_axr2", "mmc2_dat3", "mcasp0_axr2", "gpio3_0"),
    _AM33XX_MUXENTRY(MII1_CRS, 0,
        "mii1_crs", "rmii1_crs_dv", "spi1_d0", "i2c1_sda",
        "mcasp1_aclkx", NULL, NULL, "gpio3_1"),
    _AM33XX_MUXENTRY(MII1_RXERR, 0,
        "mii1_rxerr", "rmii1_rxerr", "spi1_d1", "i2c1_scl",
        "mcasp1_fsx", NULL, NULL, "gpio3_2"),
    _AM33XX_MUXENTRY(MII1_TXEN, 0,
        "mii1_txen", "rmii1_txen", "rgmii1_tctl", NULL,
        "mcasp1_axr0", NULL, "mmc2_cmd", "gpio3_3"),
    _AM33XX_MUXENTRY(MII1_RXDV, 0,
        "mii1_rxdv", NULL, "rgmii1_rctl", NULL,
        "mcasp1_aclx", "mmc2_dat0", "mcasp0_aclkr", "gpio3_4"),
    _AM33XX_MUXENTRY(MII1_TXD3, 0,
        "mii1_txd3", NULL, "rgmii1_td3", NULL,
        "mcasp1_fsx", "mmc2_dat1", "mcasp0_fsr", "gpio0_16"),
    _AM33XX_MUXENTRY(MII1_TXD2, 0,
        "mii1_txd2", NULL, "rgmii1_td2", NULL,
        "mcasp1_axr0", "mmc2_dat2", "mcasp0_ahclkx", "gpio0_17"),
    _AM33XX_MUXENTRY(MII1_TXD1, 0,
        "mii1_txd1", "rmii1_txd1", "rgmii1_td1", "mcasp1_fsr",
        "mcasp1_axr1", NULL, "mmc1_cmd", "gpio0_21"),
    _AM33XX_MUXENTRY(MII1_TXD0, 0,
        "mii1_txd0", "rmii1_txd0", "rgmii1_td0", "mcasp1_axr2",
        "mcasp1_aclkr", NULL, "mmc1_clk", "gpio0_28"),
    _AM33XX_MUXENTRY(MII1_TXCLK, 0,
        "mii1_txclk", NULL, "rgmii1_tclk", "mmc0_dat7",
        "mmc1_dat0", NULL, "mcasp0_aclkx", "gpio3_9"),
    _AM33XX_MUXENTRY(MII1_RXCLK, 0,
        "mii1_rxclk", NULL, "rgmii1_rclk", "mmc0_dat6",
        "mmc1_dat1", NULL, "mcasp0_fsx", "gpio3_10"),
    _AM33XX_MUXENTRY(MII1_RXD3, 0,
        "mii1_rxd3", NULL, "rgmii1_rd3", "mmc0_dat5",
        "mmc1_dat2", NULL, "mcasp0_axr0", "gpio2_18"),
    _AM33XX_MUXENTRY(MII1_RXD2, 0,
        "mii1_rxd2", NULL, "rgmii1_rd2", "mmc0_dat4",
        "mmc1_dat3", NULL, "mcasp0_axr1", "gpio2_19"),
    _AM33XX_MUXENTRY(MII1_RXD1, 0,
        "mii1_rxd1", "rmii1_rxd1", "rgmii1_rd1", "mcasp1_axr3",
        "mcasp1_fsr", NULL, "mmc2_clk", "gpio2_20"),
    _AM33XX_MUXENTRY(MII1_RXD0, 0,
        "mii1_rxd0", "rmii1_rxd0", "rgmii1_rd0", "mcasp1_ahclkx",
        "mcasp1_ahclkr", "mcasp1_aclkr", "mcasp0_axr3", "gpio2_21"),
    _AM33XX_MUXENTRY(MII1_REFCLK, 0,
        "rmii1_refclk", NULL, "spi1_cs0", NULL,
        "mcasp1_axr3", "mmc0_pow", "mcasp1_ahclkx", "gpio0_29"),
    _AM33XX_MUXENTRY(MDIO_DATA, 0,
        "mdio_data", NULL, NULL, NULL,
        "mmc0_sdcd", "mmc1_cmd", "mmc2_cmd", "gpio0_0"),
    _AM33XX_MUXENTRY(MDIO_CLK, 0,
        "mdio_clk", NULL, NULL, NULL,
        "mmc0_sdwp", "mmc1_clk", "mmc2_clk", "gpio0_1"),
    _AM33XX_MUXENTRY(SPI0_SCLK, 0,
        "spi0_sclk", "uart2_rxd", "i2c2_sda", NULL,
        NULL, NULL, NULL, "gpio0_2"),
    _AM33XX_MUXENTRY(SPI0_D0, 0,
        "spi0_d0", "uart2_txd", "i2c2_scl", NULL,
        NULL, NULL, NULL, "gpio0_3"),
    _AM33XX_MUXENTRY(SPI0_D1, 0,
        "spi0_d1", "mmc1_sdwp", "i2c1_sda", NULL,
        NULL, NULL, NULL, "gpio0_4"),
    _AM33XX_MUXENTRY(SPI0_CS0, 0,
        "spi0_cs0", "mmc2_sdwp", "i2c1_scl", NULL,
        NULL, NULL, NULL, "gpio0_5"),
    _AM33XX_MUXENTRY(SPI0_CS1, 0,
        //"spi0_cs1", "uart3_rxd", NULL, "mmc0_pow",
        "spi0_cs1", "uart3_rxd", "ecap1_in_pwm1_out", "mmc0_pow",
        NULL, "mmc0_sdcd", NULL, "gpio0_6"),
    _AM33XX_MUXENTRY(ECAP0_IN_PWM0_OUT, 0,
        "ecap0_in_pwm0_out", "uart3_txd", "spi1_cs1", NULL,
        "spi1_sclk", "mmc0_sdwp", "xdma_event_intr2", "gpio0_7"),
    _AM33XX_MUXENTRY(UART0_CTSN, 0,
        "uart0_ctsn", "uart4_rxd", "d_can1_tx", "i2c1_sda",
        "spi1_d0", NULL, NULL, "gpio1_8"),
    _AM33XX_MUXENTRY(UART0_RTSN, 0,
        "uart0_rtsn","uart4_txd", "d_can1_rx", "i2c1_scl",
        "spi1_d1", "spi1_cs0", NULL, "gpio1_9"),
    _AM33XX_MUXENTRY(UART0_RXD, 0,
        "uart0_rxd", "spi1_cs0", "d_can0_tx", "i2c2_sda",
        NULL, NULL, NULL, "gpio1_10"),
    _AM33XX_MUXENTRY(UART0_TXD, 0,
        "uart0_txd", "spi1_cs1", "d_can0_rx", "i2c2_scl",
        NULL, NULL, NULL, "gpio1_11"),
    _AM33XX_MUXENTRY(UART1_CTSN, 0,
        "uart1_ctsn", NULL, "d_can0_tx", "i2c2_sda",
        "spi1_cs0", NULL, NULL, "gpio0_12"),
    _AM33XX_MUXENTRY(UART1_RTSN, 0,
        "uart1_rtsn", NULL, "d_can0_rx", "i2c2_scl",
        "spi1_cs1", NULL, NULL, "gpio0_13"),
    _AM33XX_MUXENTRY(UART1_RXD, 0,
        "uart1_rxd", "mmc1_sdwp", NULL, "i2c1_sda",
        NULL, "pr1_uart0_rxd_mux1", NULL, "gpio0_14"),
    _AM33XX_MUXENTRY(UART1_TXD, 0,
        "uart1_txd", "mmc2_sdwp", NULL, "i2c1_scl",
        NULL, "pr1_uart0_txd_mux1", NULL, "gpio0_15"),
    _AM33XX_MUXENTRY(I2C0_SDA, 0,
        "i2c0_sda", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio3_5"),
    _AM33XX_MUXENTRY(I2C0_SCL, 0,
        "i2c0_scl", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio3_6"),
    _AM33XX_MUXENTRY(MCASP0_ACLKX, 0,
        "mcasp0_aclkx", "ehrpwm0a", NULL, "spi1_sclk",
        "mmc0_sdcd", NULL, NULL, "gpio3_14"),
    _AM33XX_MUXENTRY(MCASP0_FSX, 0,
        "mcasp0_fsx", NULL, NULL, "spi1_d0",
        "mmc1_sdcd", NULL, NULL, "gpio3_15"),
    _AM33XX_MUXENTRY(MCASP0_AXR0, 0,
        "mcasp0_axr0", NULL, NULL, "spi1_d1",
        "mmc2_sdcd", NULL, NULL, "gpio3_16"),
    _AM33XX_MUXENTRY(MCASP0_AHCLKR, 0,
        "mcasp0_ahclkr", NULL, "mcasp0_axr2", "spi1_cs0",
        "ecap2_in_pwm2_out", NULL, NULL, "gpio3_17"),
    _AM33XX_MUXENTRY(MCASP0_ACLKR, 0,
        "mcasp0_aclkr", NULL, "mcasp0_axr2", "mcasp1_aclkx",
        "mmc0_sdwp", NULL, NULL, "gpio3_18"),
    _AM33XX_MUXENTRY(MCASP0_FSR, 0,
        "mcasp0_fsr", NULL, "mcasp0_axr3", "mcasp1_fsx",
        NULL, "pr1_pru0_pru_r30_5", NULL, "gpio3_19"),
    _AM33XX_MUXENTRY(MCASP0_AXR1, 0,
        "mcasp0_axr1", NULL, NULL, "mcasp1_axr0",
        NULL, NULL, NULL, "gpio3_20"),
    _AM33XX_MUXENTRY(MCASP0_AHCLKX, 0,
        "mcasp0_ahclkx", NULL, "mcasp0_axr3", "mcasp1_axr1",
        NULL, NULL, NULL, "gpio3_21"),
    _AM33XX_MUXENTRY(XDMA_EVENT_INTR0, 0,
        "xdma_event_intr0", NULL, NULL, "clkout1",
        "spi1_cs1", NULL, NULL, "gpio0_19"),
    _AM33XX_MUXENTRY(XDMA_EVENT_INTR1, 0,
        "xdma_event_intr1", NULL, NULL, "clkout2",
        NULL, NULL, NULL, "gpio0_20"),
    _AM33XX_MUXENTRY(WARMRSTN, 0,
        "warmrstn", NULL, NULL, NULL,
        NULL, NULL, NULL, NULL),
    _AM33XX_MUXENTRY(NMIN, 0,
        "nmin", NULL, NULL, NULL,
        NULL, NULL, NULL, NULL),
    _AM33XX_MUXENTRY(TMS, 0,
        "tms", NULL, NULL, NULL,
        NULL, NULL, NULL, NULL),
    _AM33XX_MUXENTRY(TDI, 0,
        "tdi", NULL, NULL, NULL,
        NULL, NULL, NULL, NULL),
    _AM33XX_MUXENTRY(TDO, 0,
        "tdo", NULL, NULL, NULL,
        NULL, NULL, NULL, NULL),
    _AM33XX_MUXENTRY(TCK, 0,
        "tck", NULL, NULL, NULL,
        NULL, NULL, NULL, NULL),
    _AM33XX_MUXENTRY(TRSTN, 0,
        "trstn", NULL, NULL, NULL,
        NULL, NULL, NULL, NULL),
    _AM33XX_MUXENTRY(EMU0, 0,
        "emu0", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio3_7"),
    _AM33XX_MUXENTRY(EMU1, 0,
        "emu1", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio3_8"),
    _AM33XX_MUXENTRY(RTC_PWRONRSTN, 0,
        "rtc_pwronrstn", NULL, NULL, NULL,
        NULL, NULL, NULL, NULL),
    _AM33XX_MUXENTRY(PMIC_POWER_EN, 0,
        "pmic_power_en", NULL, NULL, NULL,
        NULL, NULL, NULL, NULL),
    _AM33XX_MUXENTRY(EXT_WAKEUP, 0,
        "ext_wakeup", NULL, NULL, NULL,
        NULL, NULL, NULL, NULL),
    _AM33XX_MUXENTRY(RTC_KALDO_ENN, 0,
        "rtc_kaldo_enn", NULL, NULL, NULL,
        NULL, NULL, NULL, NULL),
    _AM33XX_MUXENTRY(USB0_DRVVBUS, 0,
        "usb0_drvvbus", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio0_18"),
    _AM33XX_MUXENTRY(USB1_DRVVBUS, 0,
        "usb1_drvvbus", NULL, NULL, NULL,
        NULL, NULL, NULL, "gpio3_13"),
    { .reg_offset = OMAP_MUX_TERMINATOR },
};

手册中的描述举例:

寄存器参考手册:

时间: 2024-10-13 21:57:25

am335x mux配置的相关文章

AM335x(TQ335x)学习笔记——u-boot-2014.10移植

最近移植了下u-boot-2014.10到TQ335x,如果基于am335x evm进行移植,需要修改的地方并不多. 由于TI的am335x evm开发使用了一个eeprom保存了板载配置信息,用来区分不同板子的型号的,而TQ335x没有这个eeprom,因此,需要修改eeprom相关的部分,使u-boot适应TQ335x开发板. 使用source insight查看代码,很容易发现,所有获取板载配置的部分都是通过读取eeprom获得的,因此,首选修改read_eeprom(board/ti/a

张高兴的 Windows 10 IoT 开发笔记:使用 ADS1115 读取模拟信号

原文:张高兴的 Windows 10 IoT 开发笔记:使用 ADS1115 读取模拟信号 考虑到 Raspberry Pi 读取模拟信号是很烦人的事情,更何况是在没人玩的 Windows 10 IoT 下,所以准备正儿八经的写点东西. 需求:使用 Raspberry Pi 读取输出模拟信号的 MQ 系列气体传感器.(GitHub:https://github.com/ZhangGaoxing/windows-iot-demo/tree/master/ADS1115) 由于 Raspberry

TI AM335x Linux MUX hacking

/********************************************************************************************* * TI AM335x Linux MUX hacking * 声明: * 1. 本文主要是对TI的AM335x Linux驱动中的引脚复用配置代码进行跟踪: * 2. 参考书籍:AM335x ARM® Cortex™-A8 Microprocessors (MPUs) Technical Reference

【华为】MUX VLAN配置详解

MUX VLAN应用场景 在企业网中实现客户与客户之间不可互相访问,客户与员工之间不可互相访问,员工与员工之间可以互相访问,员工与客户都可以访问服务器. MUX VLAN是一种二层流量隔离机制 MUX VLAN 分为 Principal VLAN (主VLAN)和 Subordinate VLAN(从VLAN),从VLAN分为Group VLAN(互通从VLAN) 和 Separate VLAN(隔离型从VLAN) 通信权限 一丶主VLAN端口可以和所有VLAN通信 二丶互通型从VLAN可以和自

实验:华为MUX VLAN配置与管理

以下实验摘自笔者为<华为交换机学习指南>设计的一个实验型视频教学课程,点击这里查看详情:http://edu.51cto.com/course/course_id-2091.html 华为的MUX VLAN功能既可以实现位于同一IP网段的不同VLAN间(所有从VLAN与主VLAN间)用户的二层互通,又可实现不同从VLAN间的二层隔离,以及同一交换机上同一VLAN内部用户之间的二层隔离,不同交换机上同一VLAN中的用户不隔离.通过这一技术可以实现在多VLAN用户服务器共享的同时,隔离相同VLAN

配置MUX VLAN示例(汇聚层设备)

配置MUX VLAN示例(汇聚层设备) 组网需求 在企业网络中,企业所有员工都可以访问企业的服务器.但对于企业来说,希望企业内部部分员工之间可以互相交流,而部分员工之间是隔离的,不能够互相访问. 如图1所示,Switch1位于网络的汇聚层,作为下挂终端设备的网关设备.Switch2.Switch3.Switch4.Switch5和Switch6为接入层设备.此时可在Switch1上部署MUX VLAN特性.MUX VLAN不但能够实现企业需求,同时也解决了VLAN ID紧缺问题,也便于网络管理者

AM335x关于LCD屏幕的时钟PLL配置

主要参考的是AM335x的TRM的第8章PRCM模块和13章LCD Controller. 这里在LCD Controller里面的配置描述的比较详细了,分频和像素.消影值的设置等等.不在赘述,很多人都会抱怨说,LCD_PCLK配置只能通过LCD_CLK经过一个分频而来,这样对于频率70~90MHz时配置很困难.但事实上,我们对LCD_CLK的设置,是比较灵活的,参考如下: 8.1.6.10节中:Display PLL Description 左边的部分我会慢慢解释,先看右边.右边的LCD_CL

华为的MUX VLAN功能及配置

华为的MUX VLAN功能 一: 可以实现位于同一IP网段的不同VLAN间(所有从VLAN与主VLAN间) 用户的二层互通,又可实现不同从VLAN间的二层隔离,以及同一 交换机上同一VLAN内部用户之间的二层隔离,不同交换机上同一 VLAN中的用户不隔离. 二: 通过这一技术可以实现在多VLAN用户服务器共享的同时, 隔离相同VLAN中的不同用户主机的目的. MUX VLAN 分类 Principal VLAN (主VLAN)和 Subordinate VLAN(从VLAN), 从VLAN分为G

am335x linux 网口配置

在  Device Drivers  -->Network device support下 配置了menuconfig  然后修改设备树 参考 https://www.cnblogs.com/chenfulin5/p/8384186.html https://www.cnblogs.com/chenfulin5/p/8144686.html 原文地址:https://www.cnblogs.com/ChenChangXiong/p/11288294.html