Re: [PATCH v2 2/2] x86: edison: Don't take SD card detect pin into consideration

2021-10-27 Thread Bin Meng
On Wed, Oct 27, 2021 at 7:28 PM Andy Shevchenko
 wrote:
>
> There are two PCB designs in the wild which use the opposite
> signaling for SD card detection. This makes U-Boot working
> in one case and failing in the other. Quirk this out by
> disconnecting SD card detection pin from the PCB by switching
> it to mode 3. In the disconnected state the read value is always
> the same and inverted to what we are expecting in the code.
>
> BugLink: https://github.com/edison-fw/meta-intel-edison/issues/136
> Signed-off-by: Andy Shevchenko 
> Reviewed-by: Bin Meng 
> ---
> v2: added tag, updated commit message and comments in DTS (Bin)
>  arch/x86/dts/edison.dts | 17 +
>  1 file changed, 17 insertions(+)
>

applied to u-boot-x86, thanks!


[PATCH v2 2/2] x86: edison: Don't take SD card detect pin into consideration

2021-10-27 Thread Andy Shevchenko
There are two PCB designs in the wild which use the opposite
signaling for SD card detection. This makes U-Boot working
in one case and failing in the other. Quirk this out by
disconnecting SD card detection pin from the PCB by switching
it to mode 3. In the disconnected state the read value is always
the same and inverted to what we are expecting in the code.

BugLink: https://github.com/edison-fw/meta-intel-edison/issues/136
Signed-off-by: Andy Shevchenko 
Reviewed-by: Bin Meng 
---
v2: added tag, updated commit message and comments in DTS (Bin)
 arch/x86/dts/edison.dts | 17 +
 1 file changed, 17 insertions(+)

diff --git a/arch/x86/dts/edison.dts b/arch/x86/dts/edison.dts
index 2c8cf6c07102..b3658b8c3049 100644
--- a/arch/x86/dts/edison.dts
+++ b/arch/x86/dts/edison.dts
@@ -94,6 +94,12 @@
sdcard: mmc@ff3fa000 {
compatible = "intel,sdhci-tangier";
reg = <0xff3fa000 0x1000>;
+   /*
+* In the disconnected state of the SD Card Detection pin
+* the read value is always the same and inverted to what
+* we are expecting in the code.
+*/
+   cd-inverted;
};
 
pmu: power@ff00b000 {
@@ -131,6 +137,17 @@
compatible = "intel,pinctrl-tangier";
reg = <0xff0c 0x8000>;
 
+   /*
+* Disconnect SD card detection pin, so it won't affect
+* the reality on two different PCB designs where it's
+* using the opposite signaling: Edison/Arduino uses
+* Active Low, while SparkFun went with Active High.
+*/
+   sd_cd@0 {
+   pad-offset = <37>;
+   mode-func = <3>;
+   };
+
/*
 * Initial configuration came from the firmware.
 * Which quite likely has been used in the phones, where I2C #8,
-- 
2.33.0