From 3c928320b2254cb6c8d8a7919a1fcf94ca7cae66 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Wed, 29 Jul 2009 15:04:05 +0000 Subject: sh: romImage support V2 This patch contains support for the romImage build target V2. The resulting romImage file should be burned to rom or flash and could be used as small boot loader. Board code should keep their setup code in the file romimage.h located in their mach include directory. Signed-off-by: Magnus Damm Signed-off-by: Paul Mundt --- arch/sh/include/mach-common/romimage.h | 1 + 1 file changed, 1 insertion(+) create mode 100644 arch/sh/include/mach-common/romimage.h (limited to 'arch/sh/include/mach-common') diff --git a/arch/sh/include/mach-common/romimage.h b/arch/sh/include/mach-common/romimage.h new file mode 100644 index 000000000000..267e24112d82 --- /dev/null +++ b/arch/sh/include/mach-common/romimage.h @@ -0,0 +1 @@ +/* do nothing here by default */ -- cgit v1.2.3-59-g8ed1b From 2d2bcd319a3d1412999cdfc72ad64eec992dc37e Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 7 Aug 2009 03:58:38 +0900 Subject: sh: fix romImage mach dir usage This patch moves all the romImage related header files into the mach/ directory. Signed-off-by: Magnus Damm Signed-off-by: Paul Mundt --- arch/sh/boot/romimage/head.S | 2 +- arch/sh/include/mach-common/mach/romimage.h | 1 + arch/sh/include/mach-common/romimage.h | 1 - .../mach-kfr2r09/mach/partner-jet-setup.txt | 134 +++++++++++++++++++++ arch/sh/include/mach-kfr2r09/mach/romimage.h | 75 ++++++++++++ arch/sh/include/mach-kfr2r09/partner-jet-setup.txt | 134 --------------------- arch/sh/include/mach-kfr2r09/romimage.h | 75 ------------ 7 files changed, 211 insertions(+), 211 deletions(-) create mode 100644 arch/sh/include/mach-common/mach/romimage.h delete mode 100644 arch/sh/include/mach-common/romimage.h create mode 100644 arch/sh/include/mach-kfr2r09/mach/partner-jet-setup.txt create mode 100644 arch/sh/include/mach-kfr2r09/mach/romimage.h delete mode 100644 arch/sh/include/mach-kfr2r09/partner-jet-setup.txt delete mode 100644 arch/sh/include/mach-kfr2r09/romimage.h (limited to 'arch/sh/include/mach-common') diff --git a/arch/sh/boot/romimage/head.S b/arch/sh/boot/romimage/head.S index 97a087bc9c4a..219bc626dd71 100644 --- a/arch/sh/boot/romimage/head.S +++ b/arch/sh/boot/romimage/head.S @@ -7,4 +7,4 @@ .text .global romstart romstart: -#include +#include diff --git a/arch/sh/include/mach-common/mach/romimage.h b/arch/sh/include/mach-common/mach/romimage.h new file mode 100644 index 000000000000..267e24112d82 --- /dev/null +++ b/arch/sh/include/mach-common/mach/romimage.h @@ -0,0 +1 @@ +/* do nothing here by default */ diff --git a/arch/sh/include/mach-common/romimage.h b/arch/sh/include/mach-common/romimage.h deleted file mode 100644 index 267e24112d82..000000000000 --- a/arch/sh/include/mach-common/romimage.h +++ /dev/null @@ -1 +0,0 @@ -/* do nothing here by default */ diff --git a/arch/sh/include/mach-kfr2r09/mach/partner-jet-setup.txt b/arch/sh/include/mach-kfr2r09/mach/partner-jet-setup.txt new file mode 100644 index 000000000000..9c85088728a7 --- /dev/null +++ b/arch/sh/include/mach-kfr2r09/mach/partner-jet-setup.txt @@ -0,0 +1,134 @@ +LIST "partner-jet-setup.txt - 20090729 Magnus Damm" +LIST "set up enough of the kfr2r09 hardware to boot the kernel" + +LIST "zImage (RAM boot)" +LIST "This script can be used to boot the kernel from RAM via JTAG:" +LIST "> < partner-jet-setup.txt" +LIST "> RD zImage, 0xa8800000" +LIST "> G=0xa8800000" + +LIST "romImage (Flash boot)" +LIST "Use the following command to burn the zImage to flash via JTAG:" +LIST "> RD romImage, 0" + +LIST "--------------------------------" + +LIST "disable watchdog" +EW 0xa4520004, 0xa507 + +LIST "select mode for cs5 + cs6" +ED 0xff800020, 0xa5a50001 +ED 0xfec10000, 0x0000001b + +LIST "setup clocks" +ED 0xa4150004, 0x00000050 +ED 0xa4150000, 0x91053508 +WAIT 1 +ED 0xa4150024, 0x00005000 + +LIST "setup pins" +EB 0xa4050120, 0x00 +EB 0xa4050122, 0x00 +EB 0xa4050124, 0x00 +EB 0xa4050126, 0x00 +EB 0xa4050128, 0xA0 +EB 0xa405012A, 0x10 +EB 0xa405012C, 0x00 +EB 0xa405012E, 0x00 +EB 0xa4050130, 0x00 +EB 0xa4050132, 0x00 +EB 0xa4050134, 0x01 +EB 0xa4050136, 0x40 +EB 0xa4050138, 0x00 +EB 0xa405013A, 0x00 +EB 0xa405013C, 0x00 +EB 0xa405013E, 0x20 +EB 0xa4050160, 0x00 +EB 0xa4050162, 0x40 +EB 0xa4050164, 0x03 +EB 0xa4050166, 0x00 +EB 0xa4050168, 0x00 +EB 0xa405016A, 0x00 +EB 0xa405016C, 0x00 + +EW 0xa405014E, 0x5660 +EW 0xa4050150, 0x0145 +EW 0xa4050152, 0x1550 +EW 0xa4050154, 0x0200 +EW 0xa4050156, 0x0040 + +EW 0xa4050158, 0x0000 +EW 0xa405015a, 0x0000 +EW 0xa405015c, 0x0000 +EW 0xa405015e, 0x0000 + +EW 0xa4050180, 0x0000 +EW 0xa4050182, 0x8002 +EW 0xa4050184, 0x0000 + +EW 0xa405018a, 0x9991 +EW 0xa405018c, 0x8011 +EW 0xa405018e, 0x9550 + +EW 0xa4050100, 0x0000 +EW 0xa4050102, 0x5540 +EW 0xa4050104, 0x0000 +EW 0xa4050106, 0x0000 +EW 0xa4050108, 0x4550 +EW 0xa405010a, 0x0130 +EW 0xa405010c, 0x0555 +EW 0xa405010e, 0x0000 +EW 0xa4050110, 0x0000 +EW 0xa4050112, 0xAAA8 +EW 0xa4050114, 0x8305 +EW 0xa4050116, 0x10F0 +EW 0xa4050118, 0x0F50 +EW 0xa405011a, 0x0000 +EW 0xa405011c, 0x0000 +EW 0xa405011e, 0x0555 +EW 0xa4050140, 0x0000 +EW 0xa4050142, 0x5141 +EW 0xa4050144, 0x5005 +EW 0xa4050146, 0xAAA9 +EW 0xa4050148, 0xFAA9 +EW 0xa405014a, 0x3000 +EW 0xa405014c, 0x0000 + +LIST "setup sdram" +ED 0xFD000108, 0x40000301 +ED 0xFD000020, 0x011B0002 +ED 0xFD000030, 0x03060E02 +ED 0xFD000034, 0x01020102 +ED 0xFD000038, 0x01090406 +ED 0xFD000008, 0x00000004 +ED 0xFD000040, 0x00000001 +ED 0xFD000040, 0x00000000 +ED 0xFD000018, 0x00000001 + +WAIT 1 + +ED 0xFD000014, 0x00000002 +ED 0xFD000060, 0x00000032 +ED 0xFD000060, 0x00020000 +ED 0xFD000014, 0x00000004 +ED 0xFD000014, 0x00000004 +ED 0xFD000010, 0x00000001 +ED 0xFD000044, 0x000004AF +ED 0xFD000048, 0x20CF0037 + +LIST "read 16 bytes from sdram" +DD 0xa8000000, 0xa8000000, 1 +DD 0xa8000004, 0xa8000004, 1 +DD 0xa8000008, 0xa8000008, 1 +DD 0xa800000c, 0xa800000c, 1 + +ED 0xFD000014, 0x00000002 +ED 0xFD000014, 0x00000004 +ED 0xFD000108, 0x40000300 +ED 0xFD000040, 0x00010000 + +LIST "write to internal ram" +ED 0xfd8007fc, 0 + +LIST "setup cache" +ED 0xff00001c, 0x0000090b diff --git a/arch/sh/include/mach-kfr2r09/mach/romimage.h b/arch/sh/include/mach-kfr2r09/mach/romimage.h new file mode 100644 index 000000000000..f5aa8e16770c --- /dev/null +++ b/arch/sh/include/mach-kfr2r09/mach/romimage.h @@ -0,0 +1,75 @@ +/* kfr2r09 board specific boot code: + * converts the "partner-jet-script.txt" script into assembly + * the assembly code is the first code to be executed in the romImage + */ + +/* 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 + mov.l 1f ,r1 + mov.l 2f ,r0 + mov.l r0, @r1 + bra 3f + nop + .align 2 +1: .long \addr +2: .long \data +3: +.endm + +/* The EW command is used to write a 16-bit word */ +.macro EW, addr, data + mov.l 1f ,r1 + mov.l 2f ,r0 + mov.w r0, @r1 + bra 3f + nop + .align 2 +1: .long \addr +2: .long \data +3: +.endm + +/* The EB command is used to write an 8-bit word */ +.macro EB, addr, data + mov.l 1f ,r1 + mov.l 2f ,r0 + mov.b r0, @r1 + bra 3f + nop + .align 2 +1: .long \addr +2: .long \data +3: +.endm + +/* The WAIT command is used to delay the execution */ +.macro WAIT, time + mov.l 2f ,r3 +1: + nop + tst r3, r3 + bf/s 1b + dt r3 + bra 3f + nop + .align 2 +2: .long \time * 100 +3: +.endm + +/* The DD command is used to read a 32-bit word */ +.macro DD, addr, addr2, nr + mov.l 1f ,r1 + mov.l @r1, r0 + bra 2f + nop + .align 2 +1: .long \addr +2: +.endm + +#include "partner-jet-setup.txt" diff --git a/arch/sh/include/mach-kfr2r09/partner-jet-setup.txt b/arch/sh/include/mach-kfr2r09/partner-jet-setup.txt deleted file mode 100644 index 9c85088728a7..000000000000 --- a/arch/sh/include/mach-kfr2r09/partner-jet-setup.txt +++ /dev/null @@ -1,134 +0,0 @@ -LIST "partner-jet-setup.txt - 20090729 Magnus Damm" -LIST "set up enough of the kfr2r09 hardware to boot the kernel" - -LIST "zImage (RAM boot)" -LIST "This script can be used to boot the kernel from RAM via JTAG:" -LIST "> < partner-jet-setup.txt" -LIST "> RD zImage, 0xa8800000" -LIST "> G=0xa8800000" - -LIST "romImage (Flash boot)" -LIST "Use the following command to burn the zImage to flash via JTAG:" -LIST "> RD romImage, 0" - -LIST "--------------------------------" - -LIST "disable watchdog" -EW 0xa4520004, 0xa507 - -LIST "select mode for cs5 + cs6" -ED 0xff800020, 0xa5a50001 -ED 0xfec10000, 0x0000001b - -LIST "setup clocks" -ED 0xa4150004, 0x00000050 -ED 0xa4150000, 0x91053508 -WAIT 1 -ED 0xa4150024, 0x00005000 - -LIST "setup pins" -EB 0xa4050120, 0x00 -EB 0xa4050122, 0x00 -EB 0xa4050124, 0x00 -EB 0xa4050126, 0x00 -EB 0xa4050128, 0xA0 -EB 0xa405012A, 0x10 -EB 0xa405012C, 0x00 -EB 0xa405012E, 0x00 -EB 0xa4050130, 0x00 -EB 0xa4050132, 0x00 -EB 0xa4050134, 0x01 -EB 0xa4050136, 0x40 -EB 0xa4050138, 0x00 -EB 0xa405013A, 0x00 -EB 0xa405013C, 0x00 -EB 0xa405013E, 0x20 -EB 0xa4050160, 0x00 -EB 0xa4050162, 0x40 -EB 0xa4050164, 0x03 -EB 0xa4050166, 0x00 -EB 0xa4050168, 0x00 -EB 0xa405016A, 0x00 -EB 0xa405016C, 0x00 - -EW 0xa405014E, 0x5660 -EW 0xa4050150, 0x0145 -EW 0xa4050152, 0x1550 -EW 0xa4050154, 0x0200 -EW 0xa4050156, 0x0040 - -EW 0xa4050158, 0x0000 -EW 0xa405015a, 0x0000 -EW 0xa405015c, 0x0000 -EW 0xa405015e, 0x0000 - -EW 0xa4050180, 0x0000 -EW 0xa4050182, 0x8002 -EW 0xa4050184, 0x0000 - -EW 0xa405018a, 0x9991 -EW 0xa405018c, 0x8011 -EW 0xa405018e, 0x9550 - -EW 0xa4050100, 0x0000 -EW 0xa4050102, 0x5540 -EW 0xa4050104, 0x0000 -EW 0xa4050106, 0x0000 -EW 0xa4050108, 0x4550 -EW 0xa405010a, 0x0130 -EW 0xa405010c, 0x0555 -EW 0xa405010e, 0x0000 -EW 0xa4050110, 0x0000 -EW 0xa4050112, 0xAAA8 -EW 0xa4050114, 0x8305 -EW 0xa4050116, 0x10F0 -EW 0xa4050118, 0x0F50 -EW 0xa405011a, 0x0000 -EW 0xa405011c, 0x0000 -EW 0xa405011e, 0x0555 -EW 0xa4050140, 0x0000 -EW 0xa4050142, 0x5141 -EW 0xa4050144, 0x5005 -EW 0xa4050146, 0xAAA9 -EW 0xa4050148, 0xFAA9 -EW 0xa405014a, 0x3000 -EW 0xa405014c, 0x0000 - -LIST "setup sdram" -ED 0xFD000108, 0x40000301 -ED 0xFD000020, 0x011B0002 -ED 0xFD000030, 0x03060E02 -ED 0xFD000034, 0x01020102 -ED 0xFD000038, 0x01090406 -ED 0xFD000008, 0x00000004 -ED 0xFD000040, 0x00000001 -ED 0xFD000040, 0x00000000 -ED 0xFD000018, 0x00000001 - -WAIT 1 - -ED 0xFD000014, 0x00000002 -ED 0xFD000060, 0x00000032 -ED 0xFD000060, 0x00020000 -ED 0xFD000014, 0x00000004 -ED 0xFD000014, 0x00000004 -ED 0xFD000010, 0x00000001 -ED 0xFD000044, 0x000004AF -ED 0xFD000048, 0x20CF0037 - -LIST "read 16 bytes from sdram" -DD 0xa8000000, 0xa8000000, 1 -DD 0xa8000004, 0xa8000004, 1 -DD 0xa8000008, 0xa8000008, 1 -DD 0xa800000c, 0xa800000c, 1 - -ED 0xFD000014, 0x00000002 -ED 0xFD000014, 0x00000004 -ED 0xFD000108, 0x40000300 -ED 0xFD000040, 0x00010000 - -LIST "write to internal ram" -ED 0xfd8007fc, 0 - -LIST "setup cache" -ED 0xff00001c, 0x0000090b diff --git a/arch/sh/include/mach-kfr2r09/romimage.h b/arch/sh/include/mach-kfr2r09/romimage.h deleted file mode 100644 index f5aa8e16770c..000000000000 --- a/arch/sh/include/mach-kfr2r09/romimage.h +++ /dev/null @@ -1,75 +0,0 @@ -/* kfr2r09 board specific boot code: - * converts the "partner-jet-script.txt" script into assembly - * the assembly code is the first code to be executed in the romImage - */ - -/* 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 - mov.l 1f ,r1 - mov.l 2f ,r0 - mov.l r0, @r1 - bra 3f - nop - .align 2 -1: .long \addr -2: .long \data -3: -.endm - -/* The EW command is used to write a 16-bit word */ -.macro EW, addr, data - mov.l 1f ,r1 - mov.l 2f ,r0 - mov.w r0, @r1 - bra 3f - nop - .align 2 -1: .long \addr -2: .long \data -3: -.endm - -/* The EB command is used to write an 8-bit word */ -.macro EB, addr, data - mov.l 1f ,r1 - mov.l 2f ,r0 - mov.b r0, @r1 - bra 3f - nop - .align 2 -1: .long \addr -2: .long \data -3: -.endm - -/* The WAIT command is used to delay the execution */ -.macro WAIT, time - mov.l 2f ,r3 -1: - nop - tst r3, r3 - bf/s 1b - dt r3 - bra 3f - nop - .align 2 -2: .long \time * 100 -3: -.endm - -/* The DD command is used to read a 32-bit word */ -.macro DD, addr, addr2, nr - mov.l 1f ,r1 - mov.l @r1, r0 - bra 2f - nop - .align 2 -1: .long \addr -2: -.endm - -#include "partner-jet-setup.txt" -- cgit v1.2.3-59-g8ed1b From b4a757367d36cebddcd332a4024d92f1e87af370 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Thu, 6 Aug 2009 15:16:29 +0000 Subject: sh: clean up Migo-R header file This patch moves the Migo-R specific header file from mach-common/ into mach-migor/ and removes unused cruft. Signed-off-by: Magnus Damm Signed-off-by: Paul Mundt --- arch/sh/include/mach-common/mach/migor.h | 64 -------------------------------- arch/sh/include/mach-migor/mach/migor.h | 14 +++++++ 2 files changed, 14 insertions(+), 64 deletions(-) delete mode 100644 arch/sh/include/mach-common/mach/migor.h create mode 100644 arch/sh/include/mach-migor/mach/migor.h (limited to 'arch/sh/include/mach-common') diff --git a/arch/sh/include/mach-common/mach/migor.h b/arch/sh/include/mach-common/mach/migor.h deleted file mode 100644 index e451f0229e00..000000000000 --- a/arch/sh/include/mach-common/mach/migor.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __ASM_SH_MIGOR_H -#define __ASM_SH_MIGOR_H - -/* - * linux/include/asm-sh/migor.h - * - * Copyright (C) 2008 Renesas Solutions - * - * Portions Copyright (C) 2007 Nobuhiro Iwamatsu - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - */ -#include - -/* GPIO */ -#define PORT_PACR 0xa4050100 -#define PORT_PDCR 0xa4050106 -#define PORT_PECR 0xa4050108 -#define PORT_PHCR 0xa405010e -#define PORT_PJCR 0xa4050110 -#define PORT_PKCR 0xa4050112 -#define PORT_PLCR 0xa4050114 -#define PORT_PMCR 0xa4050116 -#define PORT_PRCR 0xa405011c -#define PORT_PTCR 0xa4050140 -#define PORT_PUCR 0xa4050142 -#define PORT_PVCR 0xa4050144 -#define PORT_PWCR 0xa4050146 -#define PORT_PXCR 0xa4050148 -#define PORT_PYCR 0xa405014a -#define PORT_PZCR 0xa405014c -#define PORT_PADR 0xa4050120 -#define PORT_PHDR 0xa405012e -#define PORT_PTDR 0xa4050160 -#define PORT_PWDR 0xa4050166 - -#define PORT_HIZCRA 0xa4050158 -#define PORT_HIZCRC 0xa405015c - -#define PORT_MSELCRB 0xa4050182 - -#define PORT_PSELA 0xa405014e -#define PORT_PSELB 0xa4050150 -#define PORT_PSELC 0xa4050152 -#define PORT_PSELD 0xa4050154 -#define PORT_PSELE 0xa4050156 - -#define PORT_HIZCRA 0xa4050158 -#define PORT_HIZCRB 0xa405015a -#define PORT_HIZCRC 0xa405015c - -#define BSC_CS4BCR 0xfec10010 -#define BSC_CS6ABCR 0xfec1001c -#define BSC_CS4WCR 0xfec10030 - -#include