On 6/21/19 9:09 AM, Peng Fan wrote: >> Subject: [PATCH v2 1/3] mmc: Read sd card detect properties from DT >> >> From: T Karthik Reddy <t.karthik.re...@xilinx.com> >> >> This patch reads card detect properties from device tree & added mmc >> capability macros in mmc.h. >> >> Signed-off-by: T Karthik Reddy <t.karthik.re...@xilinx.com> >> Signed-off-by: Michal Simek <michal.si...@xilinx.com>
Since we're discussing CD handling, I think I might add a bit of an unrelated idea here, which I was mulling about for a while. I was pondering about mmc rescan. When you do something like mmc rescan mmc part <remove the card, insert different card> mmc part Then the last "mmc part" still prints the partition table of the previous card, because it's cached. Maybe we can add a hook into the U-Boot main loop to poll the CD and if CD change is detected, deregister the card ? That way, we would have a simple way to detect that card was changed and it would be nicer for the user too. Polling the CD should not be expensive either, so it shouldn't cause any problems with interactivity of the U-Boot shell. Similar approach could possibly be extended to other subsystems, e.g. USB for USB device insertion/removal detection. Thoughts ? -- Best regards, Marek Vasut _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot