X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ftarget%2Farmv7a_cache_l2x.c;h=4c5dbeee69c96b9fc5712fd58c5b47db8c9ea649;hb=057e566097b41f9bfeee50e97ba6ef624189ae6a;hp=3b20fd87092d9062ea80cb7f1e09c2cc0d9c6453;hpb=480ba8ca88e3f12bb60498b35de5fc4b74d0511d;p=fw%2Fopenocd
diff --git a/src/target/armv7a_cache_l2x.c b/src/target/armv7a_cache_l2x.c
index 3b20fd870..4c5dbeee6 100644
--- a/src/target/armv7a_cache_l2x.c
+++ b/src/target/armv7a_cache_l2x.c
@@ -1,19 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
/***************************************************************************
* Copyright (C) 2015 by Oleksij Rempel *
* linux@rempel-privat.de *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see . *
***************************************************************************/
#ifdef HAVE_CONFIG_H
@@ -27,6 +16,7 @@
#include
#include "target.h"
#include "target_type.h"
+#include "smp.h"
static int arm7a_l2x_sanity_check(struct target *target)
{
@@ -185,7 +175,7 @@ static int arm7a_handle_l2x_cache_info_command(struct command_invocation *cmd,
}
command_print(cmd,
- "L2 unified cache Base Address 0x%" PRIx32 ", %" PRId32 " ways",
+ "L2 unified cache Base Address 0x%" PRIx32 ", %" PRIu32 " ways",
l2x_cache->base, l2x_cache->way);
return ERROR_OK;
@@ -194,8 +184,7 @@ static int arm7a_handle_l2x_cache_info_command(struct command_invocation *cmd,
static int armv7a_l2x_cache_init(struct target *target, uint32_t base, uint32_t way)
{
struct armv7a_l2x_cache *l2x_cache;
- struct target_list *head = target->head;
- struct target *curr;
+ struct target_list *head;
struct armv7a_common *armv7a = target_to_armv7a(target);
if (armv7a->armv7a_mmu.armv7a_cache.outer_cache) {
@@ -210,8 +199,8 @@ static int armv7a_l2x_cache_init(struct target *target, uint32_t base, uint32_t
/* initialize all targets in this cluster (smp target)
* l2 cache must be configured after smp declaration */
- while (head != (struct target_list *)NULL) {
- curr = head->target;
+ foreach_smp_target(head, target->smp_targets) {
+ struct target *curr = head->target;
if (curr != target) {
armv7a = target_to_armv7a(curr);
if (armv7a->armv7a_mmu.armv7a_cache.outer_cache) {
@@ -220,7 +209,6 @@ static int armv7a_l2x_cache_init(struct target *target, uint32_t base, uint32_t
}
armv7a->armv7a_mmu.armv7a_cache.outer_cache = l2x_cache;
}
- head = head->next;
}
return ERROR_OK;
}
@@ -325,7 +313,7 @@ static const struct command_registration arm7a_l2x_cache_commands[] = {
.name = "conf",
.handler = armv7a_l2x_cache_conf_cmd,
.mode = COMMAND_ANY,
- .help = "configure l2x cache ",
+ .help = "configure l2x cache",
.usage = " ",
},
{