Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/broadcom Translate bus addresses for SCB on BCM...



details:   https://anonhg.NetBSD.org/src/rev/7690d5c4c17f
branches:  trunk
changeset: 745034:7690d5c4c17f
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Feb 22 00:17:54 2020 +0000

description:
Translate bus addresses for SCB on BCM2711

diffstat:

 sys/arch/arm/broadcom/bcm2835reg.h       |  11 ++++++++++-
 sys/arch/arm/broadcom/bcm283x_platform.c |   8 ++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)

diffs (54 lines):

diff -r 578661cc92d4 -r 7690d5c4c17f sys/arch/arm/broadcom/bcm2835reg.h
--- a/sys/arch/arm/broadcom/bcm2835reg.h        Fri Feb 21 23:27:06 2020 +0000
+++ b/sys/arch/arm/broadcom/bcm2835reg.h        Sat Feb 22 00:17:54 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm2835reg.h,v 1.29 2019/12/30 16:19:27 skrll Exp $    */
+/*     $NetBSD: bcm2835reg.h,v 1.30 2020/02/22 00:17:54 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -124,6 +124,15 @@
 
 #define        BCM2835_INTC_BASE       (0x0)   /* Relative to BCM2835_ARMICU_BASE */
 
+#define        BCM2711_SCB_BASE        0xfc000000
+#define        BCM2711_SCB_SIZE        0x03800000
+#define        BCM2711_SCB_BASE_BUS    0x7c000000
+
+#define        BCM2711_SCB_PHYS_TO_BUS(a) \
+    ((a) - BCM2711_SCB_BASE + BCM2711_SCB_BASE_BUS)
+#define        BCM2711_SCB_BUS_TO_PHYS(a) \
+    ((a) - BCM2711_SCB_BASE_BUS + BCM2711_SCB_BASE)
+
 /* Interrupt controller */
 #define        BCM2835_INTC_IRQBPENDING        (BCM2835_INTC_BASE + 0x00)      /* IRQ Basic pending */
 #define        BCM2835_INTC_IRQ1PENDING        (BCM2835_INTC_BASE + 0x04)      /* IRQ pending 1 */
diff -r 578661cc92d4 -r 7690d5c4c17f sys/arch/arm/broadcom/bcm283x_platform.c
--- a/sys/arch/arm/broadcom/bcm283x_platform.c  Fri Feb 21 23:27:06 2020 +0000
+++ b/sys/arch/arm/broadcom/bcm283x_platform.c  Sat Feb 22 00:17:54 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm283x_platform.c,v 1.35 2020/02/20 01:43:07 jmcneill Exp $   */
+/*     $NetBSD: bcm283x_platform.c,v 1.36 2020/02/22 00:17:54 jmcneill Exp $   */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.35 2020/02/20 01:43:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.36 2020/02/22 00:17:54 jmcneill Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -187,6 +187,10 @@
            ba < BCM283X_PERIPHERALS_BASE_BUS + BCM283X_PERIPHERALS_SIZE)
                return BCM2711_PERIPHERALS_BUS_TO_PHYS(ba);
 
+       if (ba >= BCM2711_SCB_BASE_BUS &&
+           ba < BCM2711_SCB_BASE_BUS + BCM2711_SCB_SIZE)
+               return BCM2711_SCB_BUS_TO_PHYS(ba);
+
        if (ba >= BCM2711_ARM_LOCAL_BASE_BUS &&
            ba < BCM2711_ARM_LOCAL_BASE_BUS + BCM2711_ARM_LOCAL_SIZE)
                return BCM2711_ARM_LOCAL_BUS_TO_PHYS(ba);



Home | Main Index | Thread Index | Old Index