freebsd-dev/sys/arm
Ian Lepore c5727c468f Revert to this driver's historic behavior: assume an sd card is writable
if the fdt data doesn't provide a gpio pin for reading the write protect
switch and also doesn't contain a "wp-disable" property.

In r311735 the long-bitrotted code in this driver for using the non-
standard fdt "mmchs-wp-gpio-pin" property was replaced with new common
support code for handling write-protect and card-detect gpio pins.  The
old code never found a property with that name, and the logic was to
assume that no gpio pin meant that the card was not write protected.

The new common code behaves differently.  If there is no fdt data saying
what to do about sensing write protect, the value in the standard SDHCI
PRESENT_STATE register is used.  On this hardware, if there is no signal
for write protect muxed into the sd controller then that bit in the
register indicates write protect.

The real problem here is the fdt data, which should contain "wp-disable"
properties for eMMC and micro-sd slots where write protect is not even
an option in the hardware, but we are not in control of that data, it
comes from linux.  So we have to make the same flawed assumption in our
driver that the corresponding linux driver has: no info means no protect.

Reported by:	several users on the arm@ list
Pointy hat:	me, for not testing enough before committing r311735
2017-02-22 03:49:46 +00:00
..
allwinner Rename timer.c to a10_timer.c 2017-02-07 19:28:32 +00:00
altera/socfpga Add support for PLATFORM and PLATFORM_SMP to the Altera SOCFPGA SoC. This 2017-02-07 12:04:04 +00:00
amlogic/aml8726 Remake support for SMP kernel on UP cpu: 2017-02-02 06:14:44 +00:00
annapurna/alpine Remake support for SMP kernel on UP cpu: 2017-02-02 06:14:44 +00:00
arm MFamd64 r313933: microoptimize pmap_protect_pte1(). 2017-02-19 20:40:07 +00:00
at91 ofw_spi: Parse property for the SPI mode and CS polarity. 2016-12-18 14:54:20 +00:00
broadcom/bcm2835 Remake support for SMP kernel on UP cpu: 2017-02-02 06:14:44 +00:00
cavium/cns11xx Fix device delete child function. 2016-10-17 10:20:38 +00:00
cloudabi32 Catch up with changes to structure member names. 2017-01-17 22:05:52 +00:00
conf Add support for PLATFORM and PLATFORM_SMP to the Altera SOCFPGA SoC. This 2017-02-07 12:04:04 +00:00
freescale Change the naming of imx{5,6} gpio pins to exactly match the names used in 2017-02-18 18:24:03 +00:00
include Stop including sys/types.h from arm's machine/atomic.h, fix the places 2017-02-11 01:07:46 +00:00
lpc ofw_spi: Parse property for the SPI mode and CS polarity. 2016-12-18 14:54:20 +00:00
mv Remake support for SMP kernel on UP cpu: 2017-02-02 06:14:44 +00:00
nvidia Remake support for SMP kernel on UP cpu: 2017-02-02 06:14:44 +00:00
qemu Remake support for SMP kernel on UP cpu: 2017-02-02 06:14:44 +00:00
rockchip Remake support for SMP kernel on UP cpu: 2017-02-02 06:14:44 +00:00
samsung/exynos Remake support for SMP kernel on UP cpu: 2017-02-02 06:14:44 +00:00
ti Revert to this driver's historic behavior: assume an sd card is writable 2017-02-22 03:49:46 +00:00
versatile Add the missing void to function signatures in much of the arm code. 2016-12-13 13:43:22 +00:00
xilinx Remake support for SMP kernel on UP cpu: 2017-02-02 06:14:44 +00:00
xscale Add the missing void to function signatures in much of the arm code. 2016-12-13 13:43:22 +00:00