[rtems-libbsd commit] at91_mci: Fix for 32k buffer.

Sebastian Huber sebh at rtems.org
Fri Nov 17 13:29:23 UTC 2017


Module:    rtems-libbsd
Branch:    master
Commit:    9569b39515dc8a8e1e0381d45919c1ec296a7ea9
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=9569b39515dc8a8e1e0381d45919c1ec296a7ea9

Author:    Christian Mauderer <Christian.Mauderer at embedded-brains.de>
Date:      Fri Nov 17 14:23:55 2017 +0100

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 e4988cb..44772ae 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) {



More information about the vc mailing list