Skip to content

Instantly share code, notes, and snippets.

@Embedded-linux
Last active December 26, 2015 23:29
Show Gist options
  • Select an option

  • Save Embedded-linux/7230698 to your computer and use it in GitHub Desktop.

Select an option

Save Embedded-linux/7230698 to your computer and use it in GitHub Desktop.
Adding MMC support to beagle bone board
For Kerenl porting/u-boot porting there are 3 types of files added/changed
1.cpu spefic files [arm cortex-A8 processor]
2.Machine/architecture spefic files [AM335x ]
3.Board spefic files [Beagle bone]
Machine/Architecture spefic files are presented commonly in cpu and
board realted files for ex.arch/arm/cpu/armv7/am335x/*.c
[for armv7 processor --are cortex A8 and for am335x architecture spefic]
arch/arm/mach-omap2/board-am335x_evm.c having the macine spefic and
board related information.
Here in this post we are describing about ading MMC support in the kernel
[Normal template file is presented in earlier post]
and files changed for adding MMC support.
Patch for MMC support --One file is changed
"arch/arm/board-am335x_evm.c"
/* Beagle Bone has Micro-SD slot which doesn't have Write Protect pin */
am335x_mmc[0].gpio_wp = -EINVAL;
mmc0_init();
static void mmc0_init(void)
{
setup_pin_mux(mmc0_pin_mux); /* For chip spefic */
omap2_hsmmc_init(am335x_mmc); /* Platform spefic for machineor arch. */
return;
}
/* Module pin mux for mmc0 */
static struct pinmux_config mmc0_pin_mux[] = {
{"mmc0_dat3.mmc0_dat3", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"mmc0_dat2.mmc0_dat2", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"mmc0_dat1.mmc0_dat1", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"mmc0_dat0.mmc0_dat0", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"mmc0_clk.mmc0_clk", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"mmc0_cmd.mmc0_cmd", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
{"mcasp0_aclkr.mmc0_sdwp", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
{"spi0_cs1.mmc0_sdcd", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},
{NULL, 0},
};
/* Convert GPIO signal to GPIO pin number */
#define GPIO_TO_PIN(bank, gpio) (32 * (bank) + (gpio))
static struct omap2_hsmmc_info am335x_mmc[] __initdata = {
{
.mmc = 1,
.caps = MMC_CAP_4_BIT_DATA,
.gpio_cd = GPIO_TO_PIN(0, 6),
.gpio_wp = GPIO_TO_PIN(3, 18),
.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, /* 3V3 */
},
{
.mmc = 0, /* will be set at runtime */
},
{
.mmc = 0, /* will be set at runtime */
},
{} /* Terminator */
};
These changes are about adding mmc0_init () function , which calls
setup_pin_mux(mmc0_pin_mux); and omap2_hsmmc_init(am335x_mmc); .
These two functions are added to give the corrspending support for pin muxing and adding the MMC support to platform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment