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 Fix up ARM_LOCAL for 2711 so that it w...



details:   https://anonhg.NetBSD.org/src/rev/1df5933b8234
branches:  trunk
changeset: 967977:1df5933b8234
user:      skrll <skrll%NetBSD.org@localhost>
date:      Mon Dec 30 16:19:27 2019 +0000

description:
Fix up ARM_LOCAL for 2711 so that it works now.

diffstat:

 sys/arch/arm/broadcom/bcm2835reg.h       |  10 ++++++++--
 sys/arch/arm/broadcom/bcm283x_platform.c |  12 ++++++------
 sys/arch/arm/broadcom/bcm283x_platform.h |   5 ++++-
 3 files changed, 18 insertions(+), 9 deletions(-)

diffs (82 lines):

diff -r ea3e47978663 -r 1df5933b8234 sys/arch/arm/broadcom/bcm2835reg.h
--- a/sys/arch/arm/broadcom/bcm2835reg.h        Mon Dec 30 16:06:29 2019 +0000
+++ b/sys/arch/arm/broadcom/bcm2835reg.h        Mon Dec 30 16:19:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm2835reg.h,v 1.28 2019/12/26 11:09:11 skrll Exp $    */
+/*     $NetBSD: bcm2835reg.h,v 1.29 2019/12/30 16:19:27 skrll Exp $    */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -202,8 +202,14 @@
 
 #define        BCM2835_UART0_CLK               3000000
 
+#define        BCM2711_ARM_LOCAL_BASE_BUS      0x40000000
 #define        BCM2711_ARM_LOCAL_BASE          0xff800000
-#define        BCM2711_ARM_LOCAL_SIZE          0x00100000      /* 1MByte */
+#define        BCM2711_ARM_LOCAL_SIZE          0x00100000      /* 1MBytes */
+
+#define        BCM2711_ARM_LOCAL_PHYS_TO_BUS(a) \
+    ((a) - BCM2711_ARM_LOCAL_BASE + BCM2711_ARM_LOCAL_BASE_BUS)
+#define        BCM2711_ARM_LOCAL_BUS_TO_PHYS(a) \
+    ((a) - BCM2711_ARM_LOCAL_BASE_BUS + BCM2711_ARM_LOCAL_BASE)
 
 #define        BCM2836_ARM_LOCAL_BASE          0x40000000
 #define        BCM2836_ARM_LOCAL_SIZE          0x00001000      /* 4KBytes */
diff -r ea3e47978663 -r 1df5933b8234 sys/arch/arm/broadcom/bcm283x_platform.c
--- a/sys/arch/arm/broadcom/bcm283x_platform.c  Mon Dec 30 16:06:29 2019 +0000
+++ b/sys/arch/arm/broadcom/bcm283x_platform.c  Mon Dec 30 16:19:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm283x_platform.c,v 1.30 2019/12/30 16:06:29 skrll Exp $      */
+/*     $NetBSD: bcm283x_platform.c,v 1.31 2019/12/30 16:19:27 skrll 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.30 2019/12/30 16:06:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.31 2019/12/30 16:19:27 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -187,9 +187,9 @@
            ba < BCM283X_PERIPHERALS_BASE_BUS + BCM283X_PERIPHERALS_SIZE)
                return BCM2711_PERIPHERALS_BUS_TO_PHYS(ba);
 
-       if (ba >= BCM2711_ARM_LOCAL_BASE &&
-           ba < BCM2711_ARM_LOCAL_BASE + BCM2711_ARM_LOCAL_SIZE)
-               return 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);
 
        return ba & ~BCM2835_BUSADDR_CACHE_MASK;
 }
@@ -333,7 +333,7 @@
                    BCM2711_ARM_LOCAL_SIZE),
 #if defined(MULTIPROCESSOR) && defined(__aarch64__)
                /* for fdt cpu spin-table */
-               DEVMAP_ENTRY(BCM2836_ARM_SMP_VBASE, BCM2836_ARM_SMP_BASE,
+               DEVMAP_ENTRY(BCM2711_ARM_SMP_VBASE, BCM2836_ARM_SMP_BASE,
                    BCM2836_ARM_SMP_SIZE),
 #endif
                DEVMAP_ENTRY_END
diff -r ea3e47978663 -r 1df5933b8234 sys/arch/arm/broadcom/bcm283x_platform.h
--- a/sys/arch/arm/broadcom/bcm283x_platform.h  Mon Dec 30 16:06:29 2019 +0000
+++ b/sys/arch/arm/broadcom/bcm283x_platform.h  Mon Dec 30 16:19:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm283x_platform.h,v 1.4 2019/12/24 14:10:51 skrll Exp $       */
+/*     $NetBSD: bcm283x_platform.h,v 1.5 2019/12/30 16:19:27 skrll Exp $       */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -58,4 +58,7 @@
 #define        BCM2711_ARM_LOCAL_VBASE \
        BCM2711_IOPHYSTOVIRT(BCM2711_ARM_LOCAL_BASE)
 
+#define        BCM2711_ARM_SMP_VBASE   \
+       BCM2711_IOPHYSTOVIRT(BCM2836_ARM_SMP_BASE)
+
 #endif /* _ARM_BCM2835REG_PLATFORM_H_ */



Home | Main Index | Thread Index | Old Index