public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* [patch v3 0/2] ARM: mach-shmobile: Add zboot support for SuperH Mobile ARM
@ 2010-10-14  9:12 Simon Horman
  2010-10-14  9:12 ` [patch v3 1/2] ARM: " Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Simon Horman @ 2010-10-14  9:12 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

this short patch series by Kuninori Morimoto and myself adds
zboot support to mach-shmobile.

This is v3 of this patch series. It implements Magnus's suggestion
of initialising atags directly rather than using assembly.

v2 implemented Magnus's suggestion of setting atags in the framework and
passing them to the kernel rather than using a board-specific fixup.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [patch v3 1/2] ARM: Add zboot support for SuperH Mobile ARM
  2010-10-14  9:12 [patch v3 0/2] ARM: mach-shmobile: Add zboot support for SuperH Mobile ARM Simon Horman
@ 2010-10-14  9:12 ` Simon Horman
  2010-10-14  9:12 ` [patch v3 2/2] ARM: mach-shmobile: " Simon Horman
  2010-11-06  0:28 ` [patch v3 0/2] " Simon Horman
  2 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2010-10-14  9:12 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

When CONFIG_ZBOOT_ROM is selected, the resulting zImage file will be small
boot loader and may be burned to rom or flash.

This is the non-board-specific framework portion of this patch-set.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

v2:
* As suggested by Magnus Damm; Implemented by Simon Horman
  - Initialise atags in framework and pass atags to kernel

v3:
* As suggested by Magnus Damm; Implemented by Simon Horman
  - Initialise atags directly rather than using assembly

Index: linux-2.6-arm/arch/arm/boot/compressed/Makefile
=================================--- linux-2.6-arm.orig/arch/arm/boot/compressed/Makefile	2010-10-14 16:47:47.000000000 +0900
+++ linux-2.6-arm/arch/arm/boot/compressed/Makefile	2010-10-14 16:47:53.000000000 +0900
@@ -45,6 +45,10 @@ else
 endif
 endif
 
+ifeq ($(CONFIG_ARCH_SHMOBILE),y)
+OBJS		+= head-shmobile.o
+endif
+
 #
 # We now have a PIC decompressor implementation.  Decompressors running
 # from RAM should not define ZTEXTADDR.  Decompressors running directly
Index: linux-2.6-arm/arch/arm/boot/compressed/head-shmobile.S
=================================--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6-arm/arch/arm/boot/compressed/head-shmobile.S	2010-10-14 16:57:54.000000000 +0900
@@ -0,0 +1,53 @@
+/*
+ * The head-file for SH-Mobile ARM platforms
+ *
+ * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+ * Simon Horman <horms@verge.net.au>
+ *
+ * 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; version 2 of the License.
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifdef CONFIG_ZBOOT_ROM
+
+	.section	".start", "ax"
+
+	/* load board-specific initialization code */
+#include <mach/zboot.h>
+
+	b	1f
+__atags:@ tag #1
+	.long	12			@ tag->hdr.size = tag_size(tag_core);
+	.long	0x54410001		@ tag->hdr.tag = ATAG_CORE;
+	.long   0			@ tag->u.core.flags = 0;
+	.long	0			@ tag->u.core.pagesize = 0;
+	.long	0			@ tag->u.core.rootdev = 0;
+	@ tag #2
+	.long	8			@ tag->hdr.size = tag_size(tag_mem32);
+	.long	0x54410002		@ tag->hdr.tag = ATAG_MEM;
+	.long	CONFIG_MEMORY_SIZE	@ tag->u.mem.size = CONFIG_MEMORY_SIZE;
+	.long	CONFIG_MEMORY_START	@ @ tag->u.mem.start = CONFIG_MEMORY_START;
+	@ tag #3
+	.long	0			@ tag->hdr.size = 0
+	.long	0			@ tag->hdr.tag = ATAG_NONE;
+1:
+
+	/* Set board ID necessary for boot */
+	ldr	r7, 1f				@ Set machine type register
+	adr	r8, __atags			@ Set atag register
+	b	2f
+
+1 :	.long MACH_TYPE
+2 :
+
+#endif /* CONFIG_ZBOOT_ROM */
Index: linux-2.6-arm/arch/arm/mach-shmobile/include/mach/zboot.h
=================================--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6-arm/arch/arm/mach-shmobile/include/mach/zboot.h	2010-10-14 16:55:20.000000000 +0900
@@ -0,0 +1,12 @@
+#ifndef ZBOOT_H
+#define ZBOOT_H
+
+/**************************************************
+ *
+ *		board specific settings
+ *
+ **************************************************/
+
+#error "unsupported board."
+
+#endif /* ZBOOT_H */


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [patch v3 2/2] ARM: mach-shmobile: Add zboot support for SuperH Mobile ARM
  2010-10-14  9:12 [patch v3 0/2] ARM: mach-shmobile: Add zboot support for SuperH Mobile ARM Simon Horman
  2010-10-14  9:12 ` [patch v3 1/2] ARM: " Simon Horman
@ 2010-10-14  9:12 ` Simon Horman
  2010-11-07 17:23   ` [patch v3 2/2] ARM: mach-shmobile: Add zboot support for Russell King - ARM Linux
  2010-11-06  0:28 ` [patch v3 0/2] " Simon Horman
  2 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2010-10-14  9:12 UTC (permalink / raw)
  To: linux-arm-kernel

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

When CONFIG_ZBOOT_ROM is selected, the resulting zImage file will be small
boot loader and may be burned to rom or flash.

This is the board-specific portion of this patch-set.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms@verge.net.au>

--- 

v2:
* As suggested by Magnus Damm; Implemented by Simon Horman
  - Initialise atags in framework and pass atags to kernel.
    This removes the need for board-specific fixup code.

Index: linux-2.6-arm/arch/arm/mach-shmobile/board-ap4evb.c
=================================--- linux-2.6-arm.orig/arch/arm/mach-shmobile/board-ap4evb.c	2010-10-14 16:55:20.000000000 +0900
+++ linux-2.6-arm/arch/arm/mach-shmobile/board-ap4evb.c	2010-10-14 16:58:11.000000000 +0900
@@ -58,6 +58,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
+#include <asm/setup.h>
 
 /*
  * Address	Interface		BusWidth	note
Index: linux-2.6-arm/arch/arm/mach-shmobile/include/mach/head-ap4evb.txt
=================================--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6-arm/arch/arm/mach-shmobile/include/mach/head-ap4evb.txt	2010-10-14 16:58:11.000000000 +0900
@@ -0,0 +1,87 @@
+LIST "partner-jet-setup.txt"
+LIST "(C) Copyright 2010 Renesas Solutions Corp"
+LIST "Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"
+
+LIST "RWT Setting"
+EW 0xE6020004, 0xA500
+EW 0xE6030004, 0xA500
+
+DD 0x01001000, 0x01001000
+
+LIST "GPIO Setting"
+EB 0xE6051013, 0xA2
+
+LIST "CPG"
+ED 0xE6150080, 0x00000180
+ED 0xE61500C0, 0x00000002
+
+WAIT 1, 0xFE40009C
+
+LIST "FRQCR"
+ED 0xE6150000, 0x2D1305C3
+ED 0xE61500E0, 0x9E40358E
+ED 0xE6150004, 0x80331050
+
+WAIT 1, 0xFE40009C
+
+ED 0xE61500E4, 0x00002000
+
+WAIT 1, 0xFE40009C
+
+LIST "PLL"
+ED 0xE6150028, 0x00004000
+
+WAIT 1, 0xFE40009C
+
+ED 0xE615002C, 0x93000040
+
+WAIT 1, 0xFE40009C
+
+LIST "BSC"
+ED 0xFEC10000, 0x00E0001B
+
+LIST "SBSC1"
+ED 0xFE400354, 0x01AD8000
+ED 0xFE400354, 0x01AD8001
+
+WAIT 5, 0xFE40009C
+
+ED 0xFE400008, 0xBCC90151
+ED 0xFE400040, 0x41774113
+ED 0xFE400044, 0x2712E229
+ED 0xFE400048, 0x20C18505
+ED 0xFE40004C, 0x00110209
+ED 0xFE400010, 0x00000087
+
+WAIT 10, 0xFE40009C
+
+ED 0xFE400084, 0x0000003F
+EB 0xFE500000, 0x00
+
+WAIT 5, 0xFE40009C
+
+ED 0xFE400084, 0x0000FF0A
+EB 0xFE500000, 0x00
+
+WAIT 1, 0xFE40009C
+
+ED 0xFE400084, 0x00002201
+EB 0xFE500000, 0x00
+ED 0xFE400084, 0x00000302
+EB 0xFE500000, 0x00
+EB 0xFE5C0000, 0x00
+ED 0xFE400008, 0xBCC90159
+ED 0xFE40008C, 0x88800004
+ED 0xFE400094, 0x00000004
+ED 0xFE400028, 0xA55A0032
+ED 0xFE40002C, 0xA55A000C
+ED 0xFE400020, 0xA55A2048
+ED 0xFE400008, 0xBCC90959
+
+LIST "Change CPGA setting"
+ED 0xE61500E0, 0x9E40352E
+ED 0xE6150004, 0x80331050
+
+WAIT 1, 0xFE40009C
+
+ED 0xE6150354, 0x00000002
Index: linux-2.6-arm/arch/arm/mach-shmobile/include/mach/zboot_macros.h
=================================--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6-arm/arch/arm/mach-shmobile/include/mach/zboot_macros.h	2010-10-14 16:58:11.000000000 +0900
@@ -0,0 +1,65 @@
+#ifndef __ZBOOT_MACRO_H
+#define __ZBOOT_MACRO_H
+
+/* The LIST command is used to include comments in the script */
+.macro	LIST comment
+.endm
+
+/* The ED command is used to write a 32-bit word */
+.macro ED, addr, data
+	LDR	r0, 1f
+	LDR	r1, 2f
+	STR	r1, [r0]
+	B	3f
+1 :	.long	\addr
+2 :	.long	\data
+3 :
+.endm
+
+/* The EW command is used to write a 16-bit word */
+.macro EW, addr, data
+	LDR	r0, 1f
+	LDR	r1, 2f
+	STRH	r1, [r0]
+	B	3f
+1 :	.long	\addr
+2 :	.long	\data
+3 :
+.endm
+
+/* The EB command is used to write an 8-bit word */
+.macro EB, addr, data
+	LDR	r0, 1f
+	LDR	r1, 2f
+	STRB	r1, [r0]
+	B	3f
+1 :	.long	\addr
+2 :	.long	\data
+3 :
+.endm
+
+/* The WAIT command is used to delay the execution */
+.macro  WAIT, time, reg
+	LDR	r1, 1f
+	LDR	r0, 2f
+	STR	r0, [r1]
+10 :
+	LDR	r0, [r1]
+	CMP	r0, #0x00000000
+	BNE	10b
+	NOP
+	B	3f
+1 :	.long	\reg
+2 :	.long	\time * 100
+3 :
+.endm
+
+/* The DD command is used to read a 32-bit word */
+.macro  DD, start, end
+	LDR	r1, 1f
+	B	2f
+1 :	.long	\start
+2 :
+.endm
+
+#endif /* __ZBOOT_MACRO_H */
Index: linux-2.6-arm/arch/arm/mach-shmobile/include/mach/zboot.h
=================================--- linux-2.6-arm.orig/arch/arm/mach-shmobile/include/mach/zboot.h	2010-10-14 16:55:20.000000000 +0900
+++ linux-2.6-arm/arch/arm/mach-shmobile/include/mach/zboot.h	2010-10-14 16:58:11.000000000 +0900
@@ -1,12 +1,20 @@
 #ifndef ZBOOT_H
 #define ZBOOT_H
 
+#include <asm/mach-types.h>
+#include <mach/zboot_macros.h>
+
 /**************************************************
  *
  *		board specific settings
  *
  **************************************************/
 
+#ifdef CONFIG_MACH_AP4EVB
+#define MACH_TYPE	MACH_TYPE_AP4EVB
+#include "mach/head-ap4evb.txt"
+#else
 #error "unsupported board."
+#endif
 
 #endif /* ZBOOT_H */


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch v3 0/2] ARM: mach-shmobile: Add zboot support for
  2010-10-14  9:12 [patch v3 0/2] ARM: mach-shmobile: Add zboot support for SuperH Mobile ARM Simon Horman
  2010-10-14  9:12 ` [patch v3 1/2] ARM: " Simon Horman
  2010-10-14  9:12 ` [patch v3 2/2] ARM: mach-shmobile: " Simon Horman
@ 2010-11-06  0:28 ` Simon Horman
  2 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2010-11-06  0:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 14, 2010 at 06:12:31PM +0900, Simon Horman wrote:
> Hi,
> 
> this short patch series by Kuninori Morimoto and myself adds
> zboot support to mach-shmobile.
> 
> This is v3 of this patch series. It implements Magnus's suggestion
> of initialising atags directly rather than using assembly.
> 
> v2 implemented Magnus's suggestion of setting atags in the framework and
> passing them to the kernel rather than using a board-specific fixup.

Russell, do you have any thoughts on this series?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch v3 2/2] ARM: mach-shmobile: Add zboot support for
  2010-10-14  9:12 ` [patch v3 2/2] ARM: mach-shmobile: " Simon Horman
@ 2010-11-07 17:23   ` Russell King - ARM Linux
  2010-11-08  1:57     ` Simon Horman
  0 siblings, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux @ 2010-11-07 17:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 14, 2010 at 06:12:33PM +0900, Simon Horman wrote:
> +LIST "partner-jet-setup.txt"
> +LIST "(C) Copyright 2010 Renesas Solutions Corp"
> +LIST "Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"
> +
> +LIST "RWT Setting"
> +EW 0xE6020004, 0xA500
> +EW 0xE6030004, 0xA500

Can you explain the necessity of this special scripting language, and
where it comes from?

It looks like the file implementing the scripting language comes from
something other than Linux, but it isn't clear what the licensing is
of that.  Please confirm that it is GPL'd.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch v3 2/2] ARM: mach-shmobile: Add zboot support for
  2010-11-07 17:23   ` [patch v3 2/2] ARM: mach-shmobile: Add zboot support for Russell King - ARM Linux
@ 2010-11-08  1:57     ` Simon Horman
  2010-11-14 23:22       ` Simon Horman
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2010-11-08  1:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Nov 07, 2010 at 05:23:10PM +0000, Russell King - ARM Linux wrote:
> On Thu, Oct 14, 2010 at 06:12:33PM +0900, Simon Horman wrote:
> > +LIST "partner-jet-setup.txt"
> > +LIST "(C) Copyright 2010 Renesas Solutions Corp"
> > +LIST "Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"
> > +
> > +LIST "RWT Setting"
> > +EW 0xE6020004, 0xA500
> > +EW 0xE6030004, 0xA500
> 
> Can you explain the necessity of this special scripting language, and
> where it comes from?
> 
> It looks like the file implementing the scripting language comes from
> something other than Linux, but it isn't clear what the licensing is
> of that.  Please confirm that it is GPL'd.

Hi Russell,

The aim is to allow JTAG scripts to be used in-place.
The script is constructed from ASM macros which are defined
in arch/arm/mach-shmobile/include/mach/zboot_macros.h which is
included later on in the patch. The same macros exist in SH assembly
in arch/sh/include/asm/romimage-macros.h.

With regards to the license, I have confirmed that it is GPL.
Would you be more comfortable if that was stated explicitly
in the new files?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch v3 2/2] ARM: mach-shmobile: Add zboot support for
  2010-11-08  1:57     ` Simon Horman
@ 2010-11-14 23:22       ` Simon Horman
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2010-11-14 23:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 08, 2010 at 10:57:14AM +0900, Simon Horman wrote:
> On Sun, Nov 07, 2010 at 05:23:10PM +0000, Russell King - ARM Linux wrote:
> > On Thu, Oct 14, 2010 at 06:12:33PM +0900, Simon Horman wrote:
> > > +LIST "partner-jet-setup.txt"
> > > +LIST "(C) Copyright 2010 Renesas Solutions Corp"
> > > +LIST "Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"
> > > +
> > > +LIST "RWT Setting"
> > > +EW 0xE6020004, 0xA500
> > > +EW 0xE6030004, 0xA500
> > 
> > Can you explain the necessity of this special scripting language, and
> > where it comes from?
> > 
> > It looks like the file implementing the scripting language comes from
> > something other than Linux, but it isn't clear what the licensing is
> > of that.  Please confirm that it is GPL'd.
> 
> Hi Russell,
> 
> The aim is to allow JTAG scripts to be used in-place.
> The script is constructed from ASM macros which are defined
> in arch/arm/mach-shmobile/include/mach/zboot_macros.h which is
> included later on in the patch. The same macros exist in SH assembly
> in arch/sh/include/asm/romimage-macros.h.
> 
> With regards to the license, I have confirmed that it is GPL.
> Would you be more comfortable if that was stated explicitly
> in the new files?

Hi Russell,

I'm wondering if you have had any time to consider this series again.

Thanks


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-11-14 23:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-14  9:12 [patch v3 0/2] ARM: mach-shmobile: Add zboot support for SuperH Mobile ARM Simon Horman
2010-10-14  9:12 ` [patch v3 1/2] ARM: " Simon Horman
2010-10-14  9:12 ` [patch v3 2/2] ARM: mach-shmobile: " Simon Horman
2010-11-07 17:23   ` [patch v3 2/2] ARM: mach-shmobile: Add zboot support for Russell King - ARM Linux
2010-11-08  1:57     ` Simon Horman
2010-11-14 23:22       ` Simon Horman
2010-11-06  0:28 ` [patch v3 0/2] " Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox