From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 03/17] fsl_udc: make it work with MMU on
Date: Thu, 29 Apr 2010 09:52:01 +0200 [thread overview]
Message-ID: <1272527535-17527-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1272527535-17527-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/usb/gadget/fsl_udc.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/gadget/fsl_udc.c b/drivers/usb/gadget/fsl_udc.c
index 95f3bdd..119afcb 100644
--- a/drivers/usb/gadget/fsl_udc.c
+++ b/drivers/usb/gadget/fsl_udc.c
@@ -560,7 +560,7 @@ static void done(struct fsl_ep *ep, struct fsl_req *req, int status)
if (j != req->dtd_count - 1) {
next_td = curr_td->next_td_virt;
}
- free(curr_td);
+ dma_free_coherent(curr_td);
}
dma_inv_range(req->req.buf, req->req.buf + req->req.length);
@@ -1112,11 +1112,11 @@ static struct ep_td_struct *fsl_build_dtd(struct fsl_req *req, unsigned *length,
*length = min(req->req.length - req->req.actual,
(unsigned)EP_MAX_LENGTH_TRANSFER);
- dtd = memalign(32, sizeof(struct ep_td_struct));
+ dtd = dma_alloc_coherent(sizeof(struct ep_td_struct));
if (dtd == NULL)
return dtd;
- *dma = (dma_addr_t)dtd;
+ *dma = (dma_addr_t)virt_to_phys(dtd);
dtd->td_dma = *dma;
/* Clear reserved field */
swap_temp = cpu_to_le32(dtd->size_ioc_sts);
@@ -2078,13 +2078,14 @@ static int struct_udc_setup(struct fsl_udc *udc,
size += QH_ALIGNMENT + 1;
size &= ~(QH_ALIGNMENT - 1);
}
- udc->ep_qh = memalign(2048, size);
+
+ udc->ep_qh = dma_alloc_coherent(size);
if (!udc->ep_qh) {
ERR("malloc QHs for udc failed\n");
kfree(udc->eps);
return -1;
}
- udc->ep_qh_dma = (dma_addr_t)udc->ep_qh;
+ udc->ep_qh_dma = (dma_addr_t)virt_to_phys(udc->ep_qh);
udc->ep_qh_size = size;
--
1.7.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2010-04-29 7:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-29 7:51 patches for next v2 Sascha Hauer
2010-04-29 7:51 ` [PATCH 01/17] i.MX35 stack: Fix mc9sdz60 reset register offset Sascha Hauer
2010-04-29 7:52 ` [PATCH 02/17] ARM: use memalign in dma_alloc_coherent to assure alignment Sascha Hauer
2010-04-29 7:52 ` Sascha Hauer [this message]
2010-04-29 7:52 ` [PATCH 04/17] Increase MAX_FILES to 128 Sascha Hauer
2010-04-29 7:52 ` [PATCH 05/17] fix _update scripts Sascha Hauer
2010-04-29 7:52 ` [PATCH 06/17] define __LINUX_ARM_ARCH__ for armv6 processors Sascha Hauer
2010-04-29 7:52 ` [PATCH 07/17] ARM: Add get_cr/set_cr functions Sascha Hauer
2010-04-29 7:52 ` [PATCH 08/17] ARM: update icache functions to use get_cr/set_cr Sascha Hauer
2010-04-29 7:52 ` [PATCH 09/17] pcm043: Speed up NAND controller before copying barebox image Sascha Hauer
2010-05-03 11:29 ` Peter Korsgaard
2010-05-03 13:09 ` Sascha Hauer
2010-04-29 7:52 ` [PATCH 10/17] add arm helper function to determine the program counter Sascha Hauer
2010-04-29 7:52 ` [PATCH 11/17] arm: remove unused variables from header file Sascha Hauer
2010-04-29 7:52 ` [PATCH 12/17] arm: move __mmu_cache_flush to bare_init section Sascha Hauer
2010-04-29 7:52 ` [PATCH 13/17] arm: reimplement startup code in C Sascha Hauer
2010-04-29 7:52 ` [PATCH 14/17] i.MX: remove __REG from esd controller regs. use readl/writel instead Sascha Hauer
2010-04-29 7:52 ` [PATCH 15/17] pcm043: reimplement lowlevel code in C Sascha Hauer
2010-04-29 7:52 ` [PATCH 16/17] i.MX35: Fix ahbclock calculation Sascha Hauer
2010-04-29 7:52 ` [PATCH 17/17] pcm038: reimplement lowlevel code in C Sascha Hauer
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=1272527535-17527-4-git-send-email-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