Hi,
I'm using i.MX6UL processor. I want to enable write protection for the usdhc1 [mmc].
But setting the register MX6UL_PAD_CSI_DATA04__USDHC1_WP to proper value. but still seeing write protection is not enabled for the sd card connected.
I even tried adding following line to DTS file:
&usdhc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc1>;
cd-gpios = <&gpio2 21 0>;
wp-gpios = <&gpio4 25 0>;
no-1-8-v;
keep-power-in-suspend;
enable-sdio-wakeup;
status = "okay";
};
But still it didnt work.
Am I missing any setting further? Can you please help me out.
BR,
Anantha R
Hi Anantha
mmc wp-gpios usage is described in linux documentation
linux/Documentation/devicetree/bindings/mmc/mmc.txt
mmc.txt\mmc\bindings\devicetree\Documentation - linux-imx - i.MX Linux kernel
and one can check if valid gpio polarity used in the case.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor,
Thanks for the response.
Indeed I followed the linux documentation. [As I mentioned in my initial post]. But still I dont see wp enabled when the GPIO is set to high through hardware.
I configured the register MX6UL_PAD_CSI_DATA04__USDHC1_WP
[#define MX6UL_PAD_CSI_DATA04__USDHC1_WP 0x01F4 0x0480 0x0000 8 0] in DTB set to 0x17059.
& modified usdhc1 node as mentioned below.
&usdhc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc1>;
cd-gpios = <&gpio2 21 0>;
wp-gpios = <&gpio4 25 0>;
no-1-8-v;
keep-power-in-suspend;
enable-sdio-wakeup;
status = "okay";
};
Even polarity is checked - GPIO value toggles when pin input toggles. But WP functionality is not working as expected. [it allows file/folder creation still to the mmc]. Can you please let me know if I miss any further setting?
Thanks in advance for your support.
BR,
Anantha R
Hi Anantha
for using gpio4 25 as wp IOMUXC_SW_MUX_CTL_PAD_CSI_DATA04
should be configured as 0101 ALT5 — Select mux mode: ALT5 mux port: GPIO4_IO25 of instance: gpio4
not as 1000 ALT8 — Select mux mode: ALT8 mux port: USDHC1_WP of instance: usdhc1
Best regards
igor