Hi Matthijs,
Am 12.02.2017 um 12:57 schrieb H. Nikolaus Schaller hns@goldelico.com:
Hi Matthijs,
Am 12.02.2017 um 07:45 schrieb Matthijs van Duin matthijsvanduin@gmail.com:
The mmc switch was misbehaving for me. This fixes the problem: https://github.com/mvduin/u-boot/commit/fa320a46aa4ca37803d3b2262f4d60d34432...
Oh! Yes. Seems to be right.
I thought that setting a gpio to input is just a marker for the driver. But it seems to touch the gpio controller...
The only thing we want here is to read back in U-Boot the state that was set by MLO. But not modify anything. So your patch is doing the right thing and I have applied it so that you can rebase:
http://git.goldelico.com/?p=gta04-uboot.git;a=shortlog;h=refs/heads/letux-20...
I have played a little around and we seem to have a similar issue with the kernel. I don't see the eMMC, but if I insert a µSD card it is available.
Here is what U-Boot says:
... MMC: Found LC15 V5.1 board_mmc_init called (vers = 51) U-Boot soft: gpio82 = 0 (mmc1=eMMC) OMAP SD/MMC: 0, OMAP SD/MMC: 1, OMAP SD/MMC: 2 ** First descriptor is NOT a primary desc on 1:1 ** *** Warning - bad CRC, using default environment ...
But the kernel says this:
root@gta04:~# cd /sys/class/gpio/ root@gta04:/sys/class/gpio# echo 82 >export root@gta04:/sys/class/gpio# cd gpio82 root@gta04:/sys/class/gpio/gpio82# ls -l total 0 -rw-r--r-- 1 root root 4096 Jan 1 05:13 active_low lrwxrwxrwx 1 root root 0 Jan 1 05:13 device -> ../../../gpiochip2 -rw-r--r-- 1 root root 4096 Jan 1 05:13 direction -rw-r--r-- 1 root root 4096 Jan 1 05:13 edge drwxr-xr-x 2 root root 0 Jan 1 05:13 power lrwxrwxrwx 1 root root 0 Jan 1 05:13 subsystem -> ../../../../../../../class/gpio -rw-r--r-- 1 root root 4096 Jan 1 05:13 uevent -rw-r--r-- 1 root root 4096 Jan 1 05:13 value root@gta04:/sys/class/gpio/gpio82# cat direction in root@gta04:/sys/class/gpio/gpio82# cat value 1 root@gta04:/sys/class/gpio/gpio82#
Oops - it has been switched back to input and reads value "1"... Trying "echo out >dir" makes the mmc stack fail and return I/O errors.
So the switch works, is not used by any driver, but still reset to input.
Maybe we have to define the gpio or controller to inherit the initial value from u-boot?
And write a proper (or at least simple) txs02612 driver that better controls the µSD/eMMC switch (including reset of the mmc stack, i.e. simulate card removal and reinsertion). There is an entry in the issue tracker where I have written down what I think we need:
http://projects.goldelico.com/p/gta04-kernel/issues/698/
BR, Nikolaus