From 9569b39515dc8a8e1e0381d45919c1ec296a7ea9 Mon Sep 17 00:00:00 2001 From: Christian Mauderer Date: Fri, 17 Nov 2017 14:23:55 +0100 Subject: at91_mci: Fix for 32k buffer. --- freebsd/sys/arm/at91/at91_mci.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/freebsd/sys/arm/at91/at91_mci.c b/freebsd/sys/arm/at91/at91_mci.c index e4988cb9..44772ae5 100644 --- a/freebsd/sys/arm/at91/at91_mci.c +++ b/freebsd/sys/arm/at91/at91_mci.c @@ -140,8 +140,15 @@ static sXdmad *pXdmad = &XDMAD_Instance; * entire data cache, impacting overall system performance. */ #define BBCOUNT 2 +#ifndef __rtems__ #define BBSIZE (16*1024) #define MAX_BLOCKS ((BBSIZE*BBCOUNT)/512) +#else /* __rtems__ */ +#define BBSIZE (32*1024) +#define MAX_BLOCKS ((BBSIZE)/512) +/* FIXME: It would be better to split the DMA up in that case like in the + * original driver. But that would need some rework. */ +#endif /* __rtems__ */ static int mci_debug; @@ -935,7 +942,11 @@ at91_mci_start_cmd(struct at91_mci_softc *sc, struct mmc_command *cmd) bus_addr_t paddr; int err; +#ifndef __rtems__ if (remaining > (BBCOUNT*BBSIZE)) +#else /* __rtems__ */ + if (remaining > (BBSIZE)) +#endif /* __rtems__ */ panic("IO read size exceeds MAXDATA\n"); if (data->flags & MMC_DATA_READ) { -- cgit v1.2.3