mach-k3: common: correct the calculations for determining firewalls
authorManorit Chawdhry <m-chawdhry@ti.com>
Fri, 14 Jul 2023 05:52:27 +0000 (11:22 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 21 Jul 2023 23:37:58 +0000 (19:37 -0400)
The background firewall calculations were wrong, fix that to determine
both the background and foreground correctly.

Fixes: 8bfce2f9989f ("arm: mach-k3: common: reorder removal of firewalls")

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
arch/arm/mach-k3/common.c
arch/arm/mach-k3/common.h

index 450c7b7..a351104 100644 (file)
@@ -497,8 +497,7 @@ static void remove_fwl_regions(struct fwl_data fwl_data, size_t num_regions,
 
                /* Don't disable the background regions */
                if (region.control != 0 &&
-                   ((region.control & K3_FIREWALL_BACKGROUND_BIT) ==
-                    fwl_type)) {
+                   ((region.control >> K3_FIREWALL_BACKGROUND_BIT) & 1) == fwl_type) {
                        pr_debug("Attempting to disable firewall %5d (%25s)\n",
                                 region.fwl_id, fwl_data.name);
                        region.control = 0;
index 6cffbd4..9bd9ad6 100644 (file)
@@ -9,7 +9,7 @@
 #include <asm/armv7_mpu.h>
 #include <asm/hardware.h>
 
-#define K3_FIREWALL_BACKGROUND_BIT BIT(8)
+#define K3_FIREWALL_BACKGROUND_BIT (8)
 
 struct fwl_data {
        const char *name;