Skip to contentSkip to conversation

MIPS: add the initial support for lowlevel init

RFC In review Antony Pavlov 2 participants 8 messages May 13, 2012 – May 14, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover MIPS: add the initial support for lowlevel init

This patch series introduce the initial support for lowlevel init for the MIPS boards.

In the future low level initialization will be used for cache initialization.

[RFC 1/3] MIPS: move start.S code to .text_entry section [RFC 2/3] MIPS: add the initial support for lowlevel init [RFC 3/3] MIPS: malta: add bogus lowlevel init

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

RFC 1/3 MIPS: move start.S code to .text_entry section

This commit make possible lowlevel initialisation code in the text_bare_init section.

---
 arch/mips/boot/start.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/boot/start.S +1 -1
index e8868e1..6bf5baa 100644
@@ -50,7 +50,7 @@ _pc:	addiu	\rd, ra, \label - _pc		# label is assumed to be
 
 	.set noreorder
 	.text
-	.section ".text_bare_init"
+	.section ".text_entry"
 	.align 4
 
 EXPORT(_start)
Signature · 7 lines
1.7.10


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

RFC 2/3 MIPS: add the initial support for lowlevel init

In reply to Antony Pavlov

This commit introduce the initial support for
machine specific lowlevel initialization
(e.g. RAM controller or cache memory).

To return from mach_init_lowlevel() it uses explicit mach_init_lowlevel_return label.
This saves ra register for using inside mach_init_lowlevel()

---
 arch/mips/boot/start.S |    8 ++++++++
 1 file changed, 8 insertions(+)
arch/mips/boot/start.S +8 -0
index 6bf5baa..6db104b 100644
@@ -74,6 +74,14 @@ __start:
 	and	k0, k1
 	mtc0	k0, CP0_STATUS
 
+#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
+	b	mach_init_lowlevel
+	 nop
+
+mach_init_lowlevel_return:
+EXPORT(mach_init_lowlevel_return)
+#endif
+
 	/* copy barebox to link location */
 	ADR	a0, _start, t1	/* a0 <- pc-relative position of _start */
 
Signature · 7 lines
1.7.10


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

RFC 3/3 MIPS: malta: add bogus lowlevel init

In reply to Antony Pavlov
---
 arch/mips/Kconfig                    |    1 +
 arch/mips/mach-malta/Makefile        |    1 +
 arch/mips/mach-malta/lowlevel_init.S |   37 ++++++++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+)
 create mode 100644 arch/mips/mach-malta/lowlevel_init.S
arch/mips/Kconfig +1 -0
index 50d5c67..9e4bea1 100644
@@ -36,6 +36,7 @@ config MACH_MIPS_MALTA
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_BIG_ENDIAN
 	select HAS_DEBUG_LL
+	select MACH_HAS_LOWLEVEL_INIT
 
 config MACH_MIPS_BCM47XX
 	bool "Broadcom BCM47xx-based boards"
arch/mips/mach-malta/Makefile +1 -0
index f3cc668..f4cb8f2 100644
@@ -1 +1,2 @@
 obj-y += reset.o
+obj-$(CONFIG_MACH_DO_LOWLEVEL_INIT) += lowlevel_init.o
arch/mips/mach-malta/lowlevel_init.S new file +37 -0
new file mode 100644
index 0000000..a34de74
@@ -0,0 +1,37 @@
+/*
+ * Lowlevel init code for MIPS malta
+ *
+ * Copyright (C) 2012 Antony Pavlov <[email protected]>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <config.h>
+#include <asm/asm.h>
+#include <asm/regdef.h>
+#include <asm/mipsregs.h>
+
+	.section ".text_bare_init"
+
+LEAF(mach_init_lowlevel)
+
+	/* nothing special yet */
+
+	/* return */
+	b	mach_init_lowlevel_return
+	 nop
+END(mach_init_lowlevel)
Signature · 7 lines
1.7.10


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw
In reply to Antony Pavlov
Quoted 9 lines · Antony Pavlov

This patch series introduce the initial support for lowlevel init for the MIPS boards.

In the future low level initialization will be used for cache initialization.

[RFC 1/3] MIPS: move start.S code to .text_entry section [RFC 2/3] MIPS: add the initial support for lowlevel init [RFC 3/3] MIPS: malta: add bogus lowlevel init

Looks mostly good except that you have some whitespace damage in your patches. Can we drop 3/3 until we have something useful in the lowlevel init?

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw
Quoted 7 lines · Sascha Hauer
Quoted 6 lines · Antony Pavlov

This patch series introduce the initial support for lowlevel init for the MIPS boards.

In the future low level initialization will be used for cache initialization.

Quoted 6 lines
Quoted 3 lines

[RFC 1/3] MIPS: move start.S code to .text_entry section [RFC 2/3] MIPS: add the initial support for lowlevel init [RFC 3/3] MIPS: malta: add bogus lowlevel init

Looks mostly good except that you have some whitespace damage in your patches.

Hmm. checkpatch.pl didn't find anything. Can you give any sample, please.

Quoted 2 lines

Can we drop 3/3 until we have something useful in the lowlevel init?

Just now I'm working on cache support for MIPS. I think we can get useful in the lowlevel init in a few days :))

Signature · 7 lines
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw
In reply to Antony Pavlov
Quoted 18 lines · Antony Pavlov

This commit introduce the initial support for
machine specific lowlevel initialization
(e.g. RAM controller or cache memory).

To return from mach_init_lowlevel() it uses explicit mach_init_lowlevel_return label.
This saves ra register for using inside mach_init_lowlevel()

---
 arch/mips/boot/start.S |    8 ++++++++
 1 file changed, 8 insertions(+)
arch/mips/boot/start.S +0 -0
index 6bf5baa..6db104b 100644

arch/mips/boot/start.S __start: · line 79

Quoted 6 lines
arch/mips/boot/start.S +3 -0
@@ -74,6 +74,14 @@ __start:
 	and	k0, k1
 	mtc0	k0, CP0_STATUS
 
+#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
+	b	mach_init_lowlevel
+	 nop
       ^^^^

Space after tab.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw
Quoted 22 lines · Sascha Hauer
Quoted 21 lines · Antony Pavlov

This commit introduce the initial support for
machine specific lowlevel initialization
(e.g. RAM controller or cache memory).

To return from mach_init_lowlevel() it uses explicit mach_init_lowlevel_return label.
This saves ra register for using inside mach_init_lowlevel()

---
 arch/mips/boot/start.S |    8 ++++++++

 1 file changed, 8 insertions(+)
arch/mips/boot/start.S +0 -0
index 6bf5baa..6db104b 100644
@@ -74,6 +74,14 @@ __start:

      and     k0, k1
      mtc0    k0, CP0_STATUS

Quoted 6 lines
Quoted 3 lines

+#ifdef CONFIG_MACH_DO_LOWLEVEL_INIT
+     b       mach_init_lowlevel
+      nop

      ^^^^

Space after tab.

It not a bug, it is a feature! :))

The nop instruction is in a branch delay slot, so add a space before it.

Signature · 7 lines
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox