summaryrefslogtreecommitdiff
path: root/sys/src/9
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2022-06-18 20:31:49 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2022-06-18 20:31:49 +0000
commit2b1ecbe87da757ddb12e38239773a05f816d03ae (patch)
tree731b7415708d1fac04de03d7e5b1aa59c631914d /sys/src/9
parent7bae48c452c75115a965aa13243c886a99cbf192 (diff)
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.
Diffstat (limited to 'sys/src/9')
-rw-r--r--sys/src/9/imx8/usdhc.c10
-rw-r--r--sys/src/9/port/sd.h1
-rw-r--r--sys/src/9/port/sdmmc.c2
3 files changed, 7 insertions, 6 deletions
diff --git a/sys/src/9/imx8/usdhc.c b/sys/src/9/imx8/usdhc.c
index ba3989211..8954ba8b9 100644
--- a/sys/src/9/imx8/usdhc.c
+++ b/sys/src/9/imx8/usdhc.c
@@ -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,
};
diff --git a/sys/src/9/port/sd.h b/sys/src/9/port/sd.h
index e4c567a17..0ef5dab33 100644
--- a/sys/src/9/port/sd.h
+++ b/sys/src/9/port/sd.h
@@ -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;
diff --git a/sys/src/9/port/sdmmc.c b/sys/src/9/port/sdmmc.c
index 34dbd046e..d7bd02d97 100644
--- a/sys/src/9/port/sdmmc.c
+++ b/sys/src/9/port/sdmmc.c
@@ -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())