imx8/usdhc: work around broken multi-write for now

for unknown reasons, multiwrite is busted in usdhc:

sdhc: write error intr 10 stat ff88858e
usdhccmd: need to reset Datinhibit intr 10 stat ff88858e
usdhc: cmd 193a0027 arg 1e5b6b error intr 18010 stat ff88858f

i'm disabling it for now, adding a flag to the SDio struct.
This commit is contained in:
cinap_lenrek 2022-06-18 20:31:49 +00:00
parent 7bae48c452
commit 2b1ecbe87d
3 changed files with 7 additions and 6 deletions

View file

@ -219,16 +219,15 @@ dmaalloc(void *addr, int len)
uintptr a;
Adma *adma, *p;
a = (uintptr)addr;
a = PADDR(addr);
n = (len + Maxdma-1) / Maxdma;
adma = sdmalloc(n * sizeof(Adma));
for(p = adma; len > 0; p++){
p->desc = Valid | Tran;
if(n == 1)
p->desc |= len<<OLength | End | Int;
p->desc = len<<OLength | End | Int | Valid | Tran;
else
p->desc |= Maxdma<<OLength;
p->addr = PADDR(a);
p->desc = Maxdma<<OLength | Valid | Tran;
p->addr = a;
a += Maxdma;
len -= Maxdma;
n--;
@ -529,4 +528,5 @@ SDio sdio = {
usdhciosetup,
usdhcio,
.highspeed = 1,
.nomultiwrite = 1,
};

View file

@ -162,6 +162,7 @@ struct SDio {
void (*iosetup)(int, void*, int, int);
void (*io)(int, uchar*, int);
char highspeed;
char nomultiwrite; /* quirk for usdhc */
};
extern SDio sdio;

View file

@ -332,7 +332,7 @@ mmcbio(SDunit *unit, int lun, int write, void *data, long nb, uvlong bno)
error(Echange);
buf = data;
len = unit->secsize;
if(Multiblock){
if(Multiblock && (!write || !io->nomultiwrite)){
b = bno;
tries = 0;
while(waserror())