[edk2-devel] [edk2-platforms][PATCH 01/15] Platform/RPi: Move DW USB base address to Silicon

Pete Batard pete at akeo.ie
Fri Feb 28 10:38:41 UTC 2020


The official BCM2835 ARM Peripherals guide lists the DW USB
controller as standard SoC device.
Treat is as such by adding its base address to Silicon.

Signed-off-by: Pete Batard <pete at akeo.ie>
---
 Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.c    | 3 ++-
 Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h           | 6 +-----
 Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 5 +++++
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.c b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.c
index 37ebf503fd60..4f6f60b1eb5f 100644
--- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.c
+++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwUsbHostDxe.c
@@ -7,6 +7,7 @@
  *
  **/
 
+#include <IndustryStandard/Bcm2836.h>
 #include "DwUsbHostDxe.h"
 #include "DwcHw.h"
 
@@ -1548,7 +1549,7 @@ CreateDwUsbHc (
   DwHc->DwUsbOtgHc.ClearRootHubPortFeature        = DwHcClearRootHubPortFeature;
   DwHc->DwUsbOtgHc.MajorRevision                  = 0x02;
   DwHc->DwUsbOtgHc.MinorRevision                  = 0x00;
-  DwHc->DwUsbBase                                 = DW2_USB_BASE_ADDRESS;
+  DwHc->DwUsbBase                                 = BCM2836_USB_BASE_ADDRESS;
 
   Pages = EFI_SIZE_TO_PAGES (DWC2_STATUS_BUF_SIZE);
   DwHc->StatusBuffer = AllocatePages (Pages);
diff --git a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h
index ddbf69a1d608..12fbde9ff6f2 100644
--- a/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h
+++ b/Platform/RaspberryPi/Drivers/DwUsbHostDxe/DwcHw.h
@@ -10,11 +10,7 @@
 #ifndef __DWCHW_H__
 #define __DWCHW_H__
 
-#define DW2_USB_OFFSET                  0x00980000
-#define DW2_USB_BASE_ADDRESS            (FixedPcdGet64 (PcdBcm283xRegistersAddress) \
-                                        + DW2_USB_OFFSET)
-
-#define HSOTG_REG(x)    (x)
+#define HSOTG_REG(x)                    (x)
 
 #define HCCHAR(_ch)                     HSOTG_REG(0x0500 + 0x20 * (_ch))
 #define HCSPLT(_ch)                     HSOTG_REG(0x0504 + 0x20 * (_ch))
diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h
index 7ba4877337a8..cee5fb6a4e15 100644
--- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h
+++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h
@@ -70,6 +70,11 @@
 #define BCM2836_INTC_TIMER_CONTROL_OFFSET                   0x00000040
 #define BCM2836_INTC_TIMER_PENDING_OFFSET                   0x00000060
 
+/* usb constants */
+#define BCM2836_USB_OFFSET                                  0x00980000
+#define BCM2836_USB_BASE_ADDRESS                            (BCM2836_SOC_REGISTERS + BCM2836_USB_OFFSET)
+#define BCM2836_USB_LENGTH                                  0x00010000
+
 /* uart constants */
 #define BCM2836_PL011_UART_OFFSET                           0x00201000
 #define BCM2836_PL011_UART_BASE_ADDRESS                     (BCM2836_SOC_REGISTERS + BCM2836_PL011_UART_OFFSET)
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55064): https://edk2.groups.io/g/devel/message/55064
Mute This Topic: https://groups.io/mt/71605839/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list