From: Antony Pavlov <antonynpavlov@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org, Peter Mamonov <pmamonov@gmail.com>
Subject: Re: [RFC 3/9] MIPS: add virt_to_phys() and phys_to_virt()
Date: Fri, 4 Sep 2015 10:27:40 +0300 [thread overview]
Message-ID: <20150904102740.4a6f5b564126416e83c98a5b@gmail.com> (raw)
In-Reply-To: <20150904062048.GT18700@pengutronix.de>
On Fri, 4 Sep 2015 08:20:48 +0200
Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Fri, Aug 28, 2015 at 06:46:14PM +0300, Antony Pavlov wrote:
> > On Fri, 28 Aug 2015 08:34:32 +0200
> > Sascha Hauer <s.hauer@pengutronix.de> wrote:
> >
> > > On Fri, Aug 28, 2015 at 01:24:04AM +0300, Antony Pavlov wrote:
> > > > N.B. phys_to_virt() translates phys address
> > > > to KSEG1 (uncached) address as barebox mips
> > > > has no cache support.
> > >
> > > What would it take to implement cache support for mips?
> > lack of the cache support is critical problem for current barebox mips support.
> > I'm planning to add cache support in several weeks.
> > This task needs much test efforts for different boards.
> >
> > Anyway I can't carry out cache adding work at one.
> > But adding virt_to_phys and DMA support will help to add cache support one day anyway.
>
> Looking at this again the virt_to_phys/phys_to_virt macros are not
> necessary. dma_alloc_coherent() already returns both the virtual address
> and the DMA address. It should be possible to replace DMA_ADDRESS_BROKEN
> in the ehci driver with a real pointer and use it appropriatly in the
> driver.
Here is a fragment of drivers/usb/host/ehci-hcd.c:
while (td != (void *)QT_NEXT_TERMINATE) {
qh->qt_next = td->qt_next;
td = (void *)hc32_to_cpu(qh->qt_next);
}
qh->qt_next contains physical memory address for EHCI controller,
so after 'td = (void *)hc32_to_cpu(qh->qt_next)' contains physical address.
But latter we can use 'td->qt_next'. If physical address != virtual address
then we will fail. So we need addition phys_to_virt() call here.
Some addition workaround is needed here because phys_to_virt(QT_NEXT_TERMINATE) != QT_NEXT_TERMINATE.
--
--
Best regards,
Antony Pavlov
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-09-04 7:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-27 22:24 [RFC 0/9] ehci-hcd.c: make it works on big-endian mips (AR9331) Antony Pavlov
2015-08-27 22:24 ` [RFC 1/9] WIP: make ehci-hcd.c happy on big-endian MIPS Antony Pavlov
2015-08-27 22:24 ` [RFC 2/9] WIP: fix drivers/usb/core/usb.c Antony Pavlov
2015-08-28 6:11 ` Sascha Hauer
2015-08-28 15:51 ` Antony Pavlov
2015-08-31 6:45 ` Sascha Hauer
2015-08-27 22:24 ` [RFC 3/9] MIPS: add virt_to_phys() and phys_to_virt() Antony Pavlov
2015-08-28 6:34 ` Sascha Hauer
2015-08-28 15:46 ` Antony Pavlov
2015-09-04 6:20 ` Sascha Hauer
2015-09-04 7:27 ` Antony Pavlov [this message]
2015-09-04 8:44 ` Sascha Hauer
2015-12-06 14:50 ` Antony Pavlov
2015-12-07 10:27 ` Sascha Hauer
2015-12-08 9:11 ` Antony Pavlov
2015-12-08 11:46 ` Peter Mamonov
2015-12-09 13:03 ` Sascha Hauer
2015-08-27 22:24 ` [RFC 4/9] MIPS: add trivial dma support Antony Pavlov
2015-08-27 22:24 ` [RFC 5/9] ehci-hcd.c: make it works on mips Antony Pavlov
2015-08-27 22:24 ` [RFC 6/9] usb: ehci: drop unusable CONFIG_EHCI_MMIO_BIG_ENDIAN condition Antony Pavlov
2015-08-27 22:24 ` [RFC 7/9] usb: ehci: add big-endian registers support Antony Pavlov
2015-08-28 6:19 ` Sascha Hauer
2015-08-28 15:49 ` Antony Pavlov
2015-08-27 22:24 ` [RFC 8/9] MIPS: tplink-mr3020: select big-endian EHCI support Antony Pavlov
2015-08-27 22:24 ` [RFC 9/9] MIPS: tplink-mr3020_defconfig: enable usb stuff Antony Pavlov
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=20150904102740.4a6f5b564126416e83c98a5b@gmail.com \
--to=antonynpavlov@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=pmamonov@gmail.com \
--cc=s.hauer@pengutronix.de \
/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