[U-Boot] [PATCH 2/5] usb: ehci: Use map_physmem in ehci-generic

Marek Vasut marex at denx.de
Wed Jan 27 03:14:00 CET 2016


Some architectures, like MIPS, require remapping of the registers.
Add the map_physmem() call to handle it.

Signed-off-by: Marek Vasut <marex at denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>
Cc: Hans de Goede <hdegoede at redhat.com>
Cc: Masahiro Yamada <yamada.masahiro at socionext.com>
Cc: Alexey Brodkin <abrodkin at synopsys.com>
---
 drivers/usb/host/ehci-generic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
index 1292caa..6d58ef8 100644
--- a/drivers/usb/host/ehci-generic.c
+++ b/drivers/usb/host/ehci-generic.c
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <asm/io.h>
 #include <dm.h>
 #include "ehci.h"
 
@@ -19,9 +20,10 @@ struct generic_ehci {
 
 static int ehci_usb_probe(struct udevice *dev)
 {
-	struct ehci_hccr *hccr = (struct ehci_hccr *)dev_get_addr(dev);
+	struct ehci_hccr *hccr;
 	struct ehci_hcor *hcor;
 
+	hccr = map_physmem(dev_get_addr(dev), 0x100, MAP_NOCACHE);
 	hcor = (struct ehci_hcor *)((uintptr_t)hccr +
 				    HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
 
-- 
2.1.4



More information about the U-Boot mailing list