From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 01/14] ARM: i.MX: xload: Fix compiler warning
Date: Mon, 19 Mar 2018 10:11:33 +0100 [thread overview]
Message-ID: <20180319091146.4112-2-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20180319091146.4112-1-s.hauer@pengutronix.de>
the ESDHC controller is a 32bit device, so can do DMA only on the
lower 32bit. Fix the compiler warning about casting a pointer to integer
of different size on aarch64 by casting to unsigned long first. Error
out if the destination does not fit into 32bit though.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-imx/xload-esdhc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/xload-esdhc.c b/arch/arm/mach-imx/xload-esdhc.c
index e774e4e68c..bd58bdc644 100644
--- a/arch/arm/mach-imx/xload-esdhc.c
+++ b/arch/arm/mach-imx/xload-esdhc.c
@@ -109,8 +109,13 @@ esdhc_send_cmd(struct esdhc *esdhc, struct mci_cmd *cmd, struct mci_data *data)
__udelay(1);
if (data) {
+ unsigned long dest = (unsigned long)data->dest;
+
+ if (dest > 0xffffffff)
+ return -EINVAL;
+
/* Set up for a data transfer if we have one */
- esdhc_write32(regs + SDHCI_DMA_ADDRESS, (u32)data->dest);
+ esdhc_write32(regs + SDHCI_DMA_ADDRESS, (u32)dest);
esdhc_write32(regs + SDHCI_BLOCK_SIZE__BLOCK_COUNT, data->blocks << 16 | SECTOR_SIZE);
}
--
2.16.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-03-19 9:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-19 9:11 [PATCH 00/14] ARM: i.MX8MQ and EVK support Sascha Hauer
2018-03-19 9:11 ` Sascha Hauer [this message]
2018-03-19 9:11 ` [PATCH 02/14] ARM: i.MX: compile arm32 specific errata only for CPU32 Sascha Hauer
2018-03-19 9:11 ` [PATCH 03/14] ARM: Add i.MX8 support Sascha Hauer
2018-03-19 9:11 ` [PATCH 04/14] aarch64: Add i.MX8 debug UART support Sascha Hauer
2018-03-19 9:11 ` [PATCH 05/14] Include our own include/dt-bindings Sascha Hauer
2018-03-19 9:11 ` [PATCH 06/14] ARM: i.MX8: Add i.MX8mq EVK support Sascha Hauer
2018-03-19 9:11 ` [PATCH 07/14] mci: imx-esdhc: use dma mapping functions Sascha Hauer
2018-03-19 9:11 ` [PATCH 08/14] net: fec_imx: remove unnecessary DMA sync ops Sascha Hauer
2018-03-19 9:11 ` [PATCH 09/14] net: fec_imx: Use dma mapping functions Sascha Hauer
2018-03-19 9:11 ` [PATCH 10/14] clock: Add i.MX8MQ clock driver Sascha Hauer
2018-03-19 9:11 ` [PATCH 11/14] serial: i.MX: Add i.MX8 support Sascha Hauer
2018-03-19 9:11 ` [PATCH 12/14] mmc: i.MX esdhc: " Sascha Hauer
2018-03-19 9:11 ` [PATCH 13/14] gpio: i.MX: Add i.MX8mq support Sascha Hauer
2018-03-19 9:11 ` [PATCH 14/14] ARM: i.MX: ocotp: Add i.MX8MQ support Sascha Hauer
2018-03-21 5:41 ` [PATCH 00/14] ARM: i.MX8MQ and EVK support Andrey Smirnov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180319091146.4112-2-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox