mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Subject: [PATCH v3 2/3] MIPS: move r4k_cache_init in to cpu_probe function
Date: Mon, 21 Oct 2019 13:50:20 +0200	[thread overview]
Message-ID: <20191021115021.3129-2-o.rempel@pengutronix.de> (raw)
In-Reply-To: <20191021115021.3129-1-o.rempel@pengutronix.de>

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 arch/mips/boot/main_entry.c   | 6 ------
 arch/mips/include/asm/cache.h | 1 +
 arch/mips/lib/cpu-probe.c     | 5 +++++
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/mips/boot/main_entry.c b/arch/mips/boot/main_entry.c
index 4ae4457e7e..2c18bc81c3 100644
--- a/arch/mips/boot/main_entry.c
+++ b/arch/mips/boot/main_entry.c
@@ -77,12 +77,6 @@ void __bare_init main_entry(void *fdt, u32 fdt_size)
 
 	cpu_probe();
 
-	if (cpu_has_4k_cache) {
-		extern void r4k_cache_init(void);
-
-		r4k_cache_init();
-	}
-
 	trap_init();
 
 	malloc_end = (unsigned long)_stext;
diff --git a/arch/mips/include/asm/cache.h b/arch/mips/include/asm/cache.h
index cceba0acc0..4bb39b1cd4 100644
--- a/arch/mips/include/asm/cache.h
+++ b/arch/mips/include/asm/cache.h
@@ -2,5 +2,6 @@
 #define _ASM_MIPS_CACHE_H
 
 void flush_cache_all(void);
+void r4k_cache_init(void);
 
 #endif /* _ASM_MIPS_CACHE_H */
diff --git a/arch/mips/lib/cpu-probe.c b/arch/mips/lib/cpu-probe.c
index 2556a8b240..ddabddd466 100644
--- a/arch/mips/lib/cpu-probe.c
+++ b/arch/mips/lib/cpu-probe.c
@@ -9,6 +9,8 @@
  */
 #include <common.h>
 #include <asm/mipsregs.h>
+#include <asm/cache.h>
+#include <asm/cpu-features.h>
 #include <asm/cpu-info.h>
 #include <asm/cpu.h>
 #include <memory.h>
@@ -163,6 +165,9 @@ void cpu_probe(void)
 		cpu_probe_ingenic(c);
 		break;
 	}
+
+	if (cpu_has_4k_cache)
+		r4k_cache_init();
 }
 
 unsigned long mips_stack_top;
-- 
2.23.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2019-10-21 11:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 11:50 [PATCH v3 1/3] MIPS: reloc: remove init of relocated bss Oleksij Rempel
2019-10-21 11:50 ` Oleksij Rempel [this message]
2019-10-21 11:50 ` [PATCH v3 3/3] MIPS: reloc: init bss and cpu Oleksij Rempel
2019-10-23  7:06 ` [PATCH v3 1/3] MIPS: reloc: remove init of relocated bss Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191021115021.3129-2-o.rempel@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox