This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM1808 EVM - How to disable only davinci_mmc.1 for gaining access to GPIO control?

Other Parts Discussed in Thread: AM1808, DA8XX

Hi all,

on my AM1808 EVM board I neet to get access both to MMC/SD_0 and to some gpio pins that are multiplexed with port MMC/SD_1.

However, during kernel boot (SDK 5.02), I see

 

davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode

davinci_mmc davinci_mmc.1: Using DMA, 4-bit mode

 

In other words, the linux kernel turns on BOTH interface ports, MMC/SD_0 AND MMC/SD_1, preventing me to gain access to needed GPIO resources.

Can I disable ONLY MMC/SD_1 ? How ?

 

Thanks a lot,

Gabriele 

  • I don't have an AM1808 EVM but I took a look at the kernel source at arago-project.org. The source code there does not turn on the second SD card controller. Your SDK 5.02 must be patched to register MMC/SD1. Look in arch/arm/mach-davinci/board-da850-evm.c and see if there is call to da8xx_register_mmcsd1(). I might have got the board file wrong. It'll be the compiled one with a associated  ".o" file.

  • Hi Norman,

    Taking a look in arch/arm/mach-davinci/board-da850-evm.c I can read this code

     if (HAS_MMC) {
      ret = davinci_cfg_reg_list(da850_mmcsd0_pins);
      if (ret)
       pr_warning("da850_evm_init: mmcsd0 mux setup failed:"
         " %d\n", ret);

      ret = davinci_cfg_reg_list(da850_mmcsd1_pins);               <--------------
      if (ret)
       pr_warning("da850_evm_init: mmcsd1 mux setup failed:"
         " %d\n", ret);

      ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n");
      if (ret)
       pr_warning("da850_evm_init: can not open GPIO %d\n",
         DA850_MMCSD_CD_PIN);
      gpio_direction_input(DA850_MMCSD_CD_PIN);

      ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n");
      if (ret)
       pr_warning("da850_evm_init: can not open GPIO %d\n",
         DA850_MMCSD_WP_PIN);
      gpio_direction_input(DA850_MMCSD_WP_PIN);

      ret = da8xx_register_mmcsd0(&da850_mmc_config[0]);
      if (ret)
       pr_warning("da850_evm_init: mmcsd0 registration failed:"
         " %d\n", ret);
      ret = da850_register_mmcsd1(&da850_mmc_config[1]);           <--------------
      if (ret)
       pr_warning("da850_evm_init: mmcsd0 registration failed:"
         " %d\n", ret);

      da850_wl12xx_init();
     }

    There is not a call to da8xx_register_mmcsd1(), but there is a call to da850_register_mmcsd1, and it turns on the second SD card controller.
    Anyway, I've commented out those two lines and recompiled the kernel.
    In this way, for those GPIOs muxed with MMC/SD_1, the kernel startup doesn't affect anymore the logic state originally set from within u-boot.
    This solve the issue.

    Thanks a lot and happy new year,
    Gabriele

    P.S. This is the original source code of SDK 5.02, but I don't know if this has been patched later in this sense. Do you know?

  • No idea about SDK 5.02 and patching. Hopefull some TI guys at speak up. I was looking at the repository at:

    http://arago-project.org/git/projects/?p=linux-davinci.git;a=tree

    I thought the Arago repository is supposed to be most up to date. Maybe not. Checked other projects at Arago. Same. Maybe in personal repository. Lot of maybes.

    Version 2.6.39 at kernel.org has the da850_register_mmcsd1() call but the call is inside da850_wl12xx_init((). The function da850_wl12xx_init() is conditionally compiled depending on CONFIG_DA850_WL12XX. I think that the kernel.org version looks more correct than the SDK 5.02 version. Assuming that MMC/SD1 if and ony if WL12XX. In theory, if the SDK 5.02 kernel was like the kernel.org version, you could have removed the MMC/SD1 usage by configuring the kernel without WL12XX support.