How to enable eMMC on CCiMX6UL SBC Pro?

I have a ConnectCore iMX6UL SBC Pro board, but I don’t know how to enable the onboard eMMC.

I’m using the default `imx6ul-ccimx6ulsbc.dtsi’ device tree file.

According to the docs, there’s a GPIO for switching between eMMC and microSD card. And it defaults to GPIO5_IO01 on the SBC Pro. And then the pin in Linux is (5-1)*32+1 = 129.

Then I tried to export the gpio 129 via the sysfs interface by running echo 129 > /sys/class/gpio/export', but it says Device or resource busy’.

What’s more, these lines in the file `/sys/kernel/debug/gpio’ says that gpio 129 is occupied by a unknown driver:
GPIOs 128-159, platform/20ac000.gpio, 20ac000.gpio:
gpio-129 (? ) out lo

I booted the kernel with the `init=/bin/ash’ to avoid any userspace programs that are started on boot to occupy this gpio. But it’s still occupied.

So how can I enable the eMMC on this board?

I assume you are trying to use eMMC on cc6ul SBC. Are you aware that it conflicts with uSD which has to be disabled in both U-boot and device tree ? Is this what you are doing? We are not officially supporting this but someone has tried it here and it work. I can provide his procedure on an "as is " basis if you’d like.
Enable eMMC on CC6UL SBC Pro
For someone who needs to expand storage size for application, data, logfile or audio/visual images on CC6UL SBC Pro.
This case provides you one example how to expand rootFS area in eMMC, based on DEY-2.0r4.

Step-by-step
Follow the steps to enable eMMC and configure partition, format and install firmware.

  1.  Build custom uboot image
    
  2.  Bring up CC6UL SBC Pro with pre-built image
    
  3.  Program new custom uboot image
    
  4.  Create partition and format eMMC
    

uSD and eMMC use same SDIO channel, then after enabling eMMC, uSD slot can NOT be used.

Build custom uboot image
uSD is enabled as default of DEY.
GPIO5_01 signal controls to select either SDIO control signals.
Signal Name State Device
GPIO5_01 Low uSD
GPIO5_01 High eMMC

You find the source of CC6UL SBC initialization code.
ls (your yocto project parent directory)/tmp/work/ccimx6ulsbc-dey-linux-gnueabi/u-boot-dey/2015.04-r0/git/board/digi/ccimx6ulsbc/ccimx6ulsbc.c
Edit the code to assert GPIO5_01 (high) in board_mmc_init routine.
int board_mmc_init(bd_t *bis)
{
int i, ret;

/*

  • According to the board_mmc_init() the following map is done:
  • (U-boot device node) (Physical Port)
  • mmc0 USDHC2
    */

gpio_set_value(IMX_GPIO_NR(5,1), 1);
gpio_direction_output(IMX_GPIO_NR(5,2), 1);

for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) {
swtich(i) {…

You also find the source of CC6UL SBC Pro device tree file.
ls (your yocto project parent directory)/tmp/work-shared-ccimx6ulsbc/kernel-source/arch/arm/boot/dts/imx6ul-ccimx6ulsbc-id135.dts
Edit the dts file. Find usdhc2 section and edit as below.
/* USDHC2 (microSD, conflicts with eMMC) /
//&usdhc2 {
// pinctrl-assert-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
// broken-cd; /
no carrier detect line (use polling) */
// status = “okay”;
//};

/* USDHC2 (eMMC, conflicts with microSD) /
&usdhc2
{
pinctrl-assert-gpios =<&gpio5 1 GPIO_ACTIVE_HIGH>;
non-removable;
// /

// * Comment these two lines for 4-bit data bus or leave uncommented
// * for 8-bit data bus
// */
pinctrl-0= <&pinctrl_usdhc2_8databits>;
bus-width= <8>;
status= “okay”;
};

Then compile u-boot and linux firstly and build images.

bitbake -c compile -f u-boot-dey
bitbake -c compile -f linux-dey
bitbake -c deploy linux-dey
bitbake dey-image-qt

Bring up CC6UL SBC Pro with pre-built image
Program CC6UL SBC Pro with pre-built image, which is available on Digi CC6UL SBC Pro support page.
https://www.digi.com/products/embedded-systems/system-on-modules/connectcore-for-i-mx6ul#productsupport
Now uSD is available.

Program new custom uboot image
Copy new custom uboot image into uSD card.
Insert uSD card into the slot on CC6UL SBC Pro.
Program uboot using “update” command into NAND flash on CC6UL module.
After completion of program, uSD card must be removed ( to prevent from conflict of SDIO communication. )
uSD and eMMC use same SDIO channel, then after enabling eMMC, uSD slot can NOT be used.

Push Reset buttom or apply power cycle.
Stop auto-boot and prompt with “=>” is displayed.
Confirm eMMC device and size by “mmcinfo” command.

Create partition and format eMMC
Push Reset buttom or apply power cycle to reboot system.
Use “fdisk” command to create parition in eMMC.

  1. fdisk /dev/mmcblk1
    After creating partition, format each partition by mkfs commands.
  2. mkfs.vfat -F 32 /dev/mmcblk1p1
  3. mkfs.ext4 /dev/mmcblk1p2
    If your firmware image has no “mkfs.ext4” command, rebuild firmware with following option in local.conf file.
    IMAGE_INSTALL_append = " e2fsprogs-mke2fs"

After fomatting, you can find expanded strage area in eMMC.
Confirm the size by “df” command.

1 Like