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.

DRA821U: How to disable main_sdhci1

Part Number: DRA821U

Tool/software:

Hi Team,

I am using PROCESSOR-SDK-LINUX-RT-J7200.

I would like to implement a function to switch between enabling and disabling main_sdhci1.

For a USB port, this can be achieved with the following command:

~# echo 0 > /sys/bus/usb/drivers/usb/usb1/1-0\:1.0/usb1-port1/disable
~# echo 0 > /sys/bus/usb/drivers/usb/usb2/2-0\:1.0/usb2-port1/disable

~# echo 1 > /sys/bus/usb/drivers/usb/usb1/1-0\:1.0/usb1-port1/disable
~# echo 1 > /sys/bus/usb/drivers/usb/usb2/2-0\:1.0/usb2-port1/disable

Is there a way to enable/disable main_sdhci1?

regards

  • Dear user,

    The engineer responsible is currently out of office. Please expect 1-2 day delay in response.

    Josue

  • Hi user,

    Sorry for the late reply.

    I would like to implement a function to switch between enabling and disabling main_sdhci1.

    You can enable or disable sdhci1 by adding the status=disabled in the corresponding device tree of the board which you are using.

    I am attaching a sample example below as well for reference.

    Regards

    Gokul

  • Hi,

    thank you for your reply.

    I'm sorry for not clearly stating the prerequisites.

    I want to switch it enable and disable without changing the fitImage.

    USB can be enabled and disabled in the terminal, is it possible to do something similar with main_sdhci1?

    regards

    mizutani

  • Hi User ,

    Can you try the following command:

    Unbinds SD card:

    echo -n mmc1:aaaa > /sys/bus/mmc/drivers/mmcblk/unbind

    Binds SD card:

    echo -n mmc1:aaaa > /sys/bus/mmc/drivers/mmcblk/bind

    Regards

    Gokul

  • Hi,

    I apologize for the late confirmation.

    I was able to confirm that I could enable or disable the function by using the commands you taught me while the SD card was inserted.

    However, when I remove and reinsert the SD card, the SD card is recognized.

    To improve security, I would like to disable the SD card slot by default, and enable it only if explicitly prompted in the settings.

    Is there any way to achieve this?

    regards

    mizutani

  • Hi user,

    Can you try the following:

    • Create /etc/udev/rules.d/99-disable-automount.rules
    • Add the below line:

                    ACTION=="add|change",KERNEL=="sdb",ENV{UDISKS_IGNORE}="1"

                       using whatever device the card reader mounts as for the "KERNEL==" section.

    • Then do udevadm control --reload

    Regards

    Gokul