
Hi Peng,
On Tue, Apr 26, 2016 at 3:54 AM, Peng Fan van.freenix@gmail.com wrote:
Introudce wp_enable. If want to check WPSPL, then in board code, need to set wp_enable to 1.
Take i.MX6UL for example, to some boards, they do not use WP singal, so they does not configure USDHC1_WP_SELECT_INPUT, and its default value is 0(GPIO1_IO02). However GPIO1_IO02 is muxed for i2c usage and SION bit set. So USDHC controller can always get wp signal and WPSPL shows write protect and blocks driver continuing. This is not what we want to see, so add wp_enable, and if set to 0, just omit the WPSPL checking and this does not effect normal working of usdhc controller.
To DT case, add wp_gpio, if there is wp-gpios provided in dts, wp_enable is set to 1; if no, set to 0.
Signed-off-by: Peng Fan van.freenix@gmail.com Cc: Pantelis Antoniou panto@antoniou-consulting.com Cc: York Sun york.sun@nxp.com Cc: Stefano Babic sbabic@denx.de
Just saw this issue on a mx6ul pico board: after adding I2C support then the eMMC could not longer be written:
=> saveenv Saving Environment to MMC... Writing to MMC(0)... The SD card is locked. Can not write to a locked card.
mmc write failed failed
Your patch allows me to write to the eMMC succesfully:
Tested-by: Fabio Estevam fabio.estevam@nxp.com