On Tue, Jun 01, 2021 at 09:29:55AM BST, Patrick Wildt wrote:
> Am Mon, Feb 22, 2021 at 08:10:21PM +0100 schrieb Patrick Wildt:
> > Hi,
> > 
> > it seems like some eMMCs are not capable of doing 8-bit operation,
> > even if the controller supports it.  I was questioning our drivers
> > first, but it looks like it's the same on Linux.  In the case that
> > 8-bit doesn't work, they seem to fall back to lower values to make
> > that HW work.
> > 
> > This diff implements a mechanism that tries 8-bit, if available,
> > then 4-bit and in the end falls back to 1-bit.  This makes my HW
> > work, but I would like to have this tested by a broader audience.
> > 
> > Apparently there's a "bus test" command, but it isn't implemented
> > on all host controllers.  Hence I simply try to read the EXT_CSD
> > to make sure the transfer works.
> > 
> > For testing, a print like
> > 
> >     printf("%s: using %u-bit width\n", DEVNAME(sc), width);
> > 
> > could be added at line 928.
> > 
> > What could possible regressions be?  The width could become smaller
> > then previously.  This would reduce the read/write transfer speed.
> > Also it's possible that eMMCs are not recognized/initialized anymore.
> > 
> > What could possible improvements be?  eMMCs that previously didn't
> > work now work, with at least 1-bit or 4-bit wide transfers.
> > 
> > Please note that this only works for eMMCs.  SD cards are *not* using
> > this code path.  SD cards have a different initialization code path.
> > 
> > Please report any changes or non-changes.  If nothing changes, that's
> > perfect.
> > 
> > Patrick
> 
> Anyone want to give this a try?  It's basically relevant for all
> ARM machines with eMMC ('soldered SD cards'), and they should work
> as well as before.

Hi Patrick,

I've managed to build the kernel with your patch and the machine
booted up just fine the first time - it was as slow as before ;^)

Then, I rebooted to the old kernel to compare dmesg before and after
- they're identical, BTW - and I shut the machine down.

I got a crash (ddb) on the next boot - don't have the time to
transcribe it right now, I'm afraid.

https://photos.app.goo.gl/Kr54uoppT4b6gR179

On subsequent boot I got:

        ehci_device_bulk_start: not done, ex=0xffffff800800f378

scrolling(?) continuously on the screen.

Next boot, ddb again.

Old kernel booted up just fine.

Regards,

Raf

OpenBSD 6.9-current (GENERIC.MP) #0: Wed Jun  2 09:36:58 BST 2021
    [email protected]:/usr/src/sys/arch/arm64/compile/GENERIC.MP
real mem  = 2013835264 (1920MB)
avail mem = 1919496192 (1830MB)
random: good seed from bootblocks
mainbus0 at root: Pinebook
psci0 at mainbus0: PSCI 1.1, SMCCC 1.2
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
cpu0: CRC32,SHA2,SHA1,AES+PMULL,ASID16
cpu1 at mainbus0 mpidr 1: ARM Cortex-A53 r0p4
cpu1: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu1: 512KB 64b/line 16-way L2 cache
cpu1: CRC32,SHA2,SHA1,AES+PMULL,ASID16
cpu2 at mainbus0 mpidr 2: ARM Cortex-A53 r0p4
cpu2: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu2: 512KB 64b/line 16-way L2 cache
cpu2: CRC32,SHA2,SHA1,AES+PMULL,ASID16
cpu3 at mainbus0 mpidr 3: ARM Cortex-A53 r0p4
cpu3: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu3: 512KB 64b/line 16-way L2 cache
cpu3: CRC32,SHA2,SHA1,AES+PMULL,ASID16
efi0 at mainbus0: UEFI 2.8
efi0: Das U-Boot rev 0x20200400
apm0 at mainbus0
"osc24M_clk" at mainbus0 not configured
"osc32k_clk" at mainbus0 not configured
"internal-osc-clk" at mainbus0 not configured
simpleaudio0 at mainbus0
"spdif-out" at mainbus0 not configured
agtimer0 at mainbus0: 24000 kHz
simplebus0 at mainbus0: "soc"
sxisyscon0 at simplebus0
sxisid0 at simplebus0
sxiccmu0 at simplebus0
sxipio0 at simplebus0: 103 pins
ampintc0 at simplebus0 nirq 224, ncpu 4 ipi: 0, 1: "interrupt-controller"
sxirtc0 at simplebus0
sxiccmu1 at simplebus0
sxipio1 at simplebus0: 13 pins
sxirsb0 at simplebus0
axppmic0 at sxirsb0 addr 0x3a3: AXP803
"de2" at simplebus0 not configured
"dma-controller" at simplebus0 not configured
"lcd-controller" at simplebus0 not configured
"lcd-controller" at simplebus0 not configured
sximmc0 at simplebus0
sdmmc0 at sximmc0: 4-bit, sd high-speed, mmc high-speed, dma
sximmc1 at simplebus0
sdmmc1 at sximmc1: 4-bit, sd high-speed, mmc high-speed, dma
sximmc2 at simplebus0
sdmmc2 at sximmc2: 8-bit, sd high-speed, mmc high-speed, dma
"phy" at simplebus0 not configured
ehci0 at simplebus0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 
addr 1
ohci0 at simplebus0: version 1.0
ehci1 at simplebus0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 
addr 1
ohci1 at simplebus0: version 1.0
com0 at simplebus0: ns16550, no working fifo
sxipwm0 at simplebus0
"hdmi-phy" at simplebus0 not configured
"interrupt-controller" at simplebus0 not configured
sxitwi0 at simplebus0
iic0 at sxitwi0
"analogix,anx6345" at iic0 addr 0x38 not configured
sxidog0 at simplebus0
gpio0 at sxipio0: 32 pins
gpio1 at sxipio0: 32 pins
gpio2 at sxipio0: 32 pins
gpio3 at sxipio0: 32 pins
gpio4 at sxipio0: 32 pins
gpio5 at sxipio0: 32 pins
gpio6 at sxipio0: 32 pins
gpio7 at sxipio0: 32 pins
gpio8 at sxipio1: 32 pins
usb2 at ohci0: USB revision 1.0
uhub2 at usb2 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 
addr 1
usb3 at ohci1: USB revision 1.0
uhub3 at usb3 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 
addr 1
"regulator" at mainbus0 not configured
pwmbl0 at mainbus0
"gpio_keys" at mainbus0 not configured
"vcc3v3" at mainbus0 not configured
"wifi_pwrseq" at mainbus0 not configured
"binman" at mainbus0 not configured
simplefb0 at mainbus0: 1920x1080, 32bpp
wsdisplay0 at simplefb0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
dt: 443 probes
scsibus0 at sdmmc2: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <Sandisk, DF4016, 0000> removable
sd0: 15028MB, 512 bytes/sector, 30777344 sectors
scsibus1 at sdmmc0: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0: <SD/MMC, SD02G, 0020> removable
sd1: 1910MB, 512 bytes/sector, 3911680 sectors
manufacturer 0x024c, product 0xb703 at sdmmc1 function 1 not configured
uhub4 at uhub1 port 1 configuration 1 interface 0 "Genesys Logic USB2.0 Hub" 
rev 2.00/88.32 addr 2
uhidev0 at uhub4 port 1 configuration 1 interface 0 "HAILUCK CO.,LTD USB 
KEYBOARD" rev 1.10/1.00 addr 3
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd0 at ukbd0: console keyboard, using wsdisplay0
uhidev1 at uhub4 port 1 configuration 1 interface 1 "HAILUCK CO.,LTD USB 
KEYBOARD" rev 1.10/1.00 addr 3
uhidev1: iclass 3/0, 9 report ids
ums0 at uhidev1 reportid 1: 5 buttons, Z and W dir
wsmouse0 at ums0 mux 0
uhid0 at uhidev1 reportid 2: input=1, output=0, feature=0
uhid1 at uhidev1 reportid 3: input=3, output=0, feature=0
uhid2 at uhidev1 reportid 5: input=0, output=0, feature=5
uhid3 at uhidev1 reportid 6: input=0, output=0, feature=255
uhid4 at uhidev1 reportid 9: input=1, output=0, feature=0
urtwn0 at uhub4 port 2 configuration 1 interface 0 "Realtek 802.11n WLAN NIC" 
rev 2.00/0.00 addr 4
urtwn0: MAC/BB RTL8188EU, RF 6052 1T1R, address 00:ff:00:ff:00:ff
uvideo0 at uhub4 port 3 configuration 1 interface 0 "Generic USB2.0 PC CAMERA" 
rev 2.00/1.00 addr 5
video0 at uvideo0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on sd0a (a9dc5448c178ede8.a) swap on sd0b dump on sd0b

Reply via email to