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 Add another cache invalidation before ...



details:   https://anonhg.NetBSD.org/src/rev/8fa7c70237f1
branches:  trunk
changeset: 1006033:8fa7c70237f1
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Dec 31 08:01:19 2019 +0000

description:
Add another cache invalidation before reading memory for firmware query
results.

diffstat:

 sys/arch/arm/broadcom/bcm283x_platform.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 2729b38b9f76 -r 8fa7c70237f1 sys/arch/arm/broadcom/bcm283x_platform.c
--- a/sys/arch/arm/broadcom/bcm283x_platform.c  Tue Dec 31 05:01:49 2019 +0000
+++ b/sys/arch/arm/broadcom/bcm283x_platform.c  Tue Dec 31 08:01:19 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm283x_platform.c,v 1.31 2019/12/30 16:19:27 skrll Exp $      */
+/*     $NetBSD: bcm283x_platform.c,v 1.32 2019/12/31 08:01:19 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.31 2019/12/30 16:19:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.32 2019/12/31 08:01:19 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -671,6 +671,13 @@
 
        bcm2835_mbox_read(iot, ioh, BCMMBOX_CHANARM2VC, &res);
 
+       /*
+        * RPI4 has Cortex A72 processors which do speculation, so
+        * we need to invalidate the cache for an updates done by
+        * the firmware
+        */
+       cpu_dcache_inv_range((vaddr_t)&vb_uart, sizeof(vb_uart));
+
        if (vcprop_tag_success_p(&vb_uart.vbt_uartclockrate.tag))
                uart_clk = vb_uart.vbt_uartclockrate.rate;
        if (vcprop_tag_success_p(&vb_uart.vbt_vpuclockrate.tag))



Home | Main Index | Thread Index | Old Index