[U-Boot] [PATCH 1/2] mmc: sunxi: Support cd-inverted DT property

Tuomas Tynkkynen tuomas at tuxera.com
Thu Dec 21 14:09:46 UTC 2017


On Thu, 2017-12-21 at 14:09 +0100, Maxime Ripard wrote:

> >  		sunxi_gpio_set_pull(cd_pin, SUNXI_GPIO_PULL_UP);
> >  	}
> >  
> > So: if the DT specifies GPIO_ACTIVE_LOW, dm_gpio_get_value()
> > does its own inversion of the GPIO level. Then, on top of that
> > we do another inversion if the "cd-inverted" property was
> > specified.
> > This matches what the Linux MMC driver does.
> 
> Hmmm, right.
> 
> I guess in your particular case then, you'd be better off droping the
> cd-inverted property. Like I said, it's really legacy these days.
> That
> of course doesn't prevent the rest of the patch to go in.

Yes, getting rid of the cd-inverted properties from the DTs should make
card detection work without any code changes. So the plan of action
will be:

- Drop cd-inverted from U-Boot's sun7i-a20-pcduino3.dts
- Flip the GPIO_ACTIVE_* around + drop cd-inverted from Linux DTs
- Re-sync DTs from Linux to U-Boot
- Finally switch all sunxi boards to DM_MMC in U-Boot


More information about the U-Boot mailing list