aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-11-21 02:53:37 -0500
committerPaul Mundt <lethal@linux-sh.org>2008-01-27 23:18:52 -0500
commit71373068067b01c963eed1350909de81fc6a6d04 (patch)
tree46983ab00b37896519fd4833ed69eadfe618270f
parent55183e9bb2c2ce43d88eaa575c2d6d4fd6d865a3 (diff)
sh: Merge the sh64 zImage bits.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--arch/sh/boot/compressed/Makefile46
-rw-r--r--arch/sh/boot/compressed/Makefile_3243
-rw-r--r--arch/sh/boot/compressed/Makefile_64 (renamed from arch/sh64/boot/compressed/Makefile)15
-rw-r--r--arch/sh/boot/compressed/cache.c12
-rw-r--r--arch/sh/boot/compressed/head_32.S (renamed from arch/sh/boot/compressed/head.S)0
-rw-r--r--arch/sh/boot/compressed/head_64.S (renamed from arch/sh64/boot/compressed/head.S)29
-rw-r--r--arch/sh/boot/compressed/misc_32.c (renamed from arch/sh/boot/compressed/misc.c)0
-rw-r--r--arch/sh/boot/compressed/misc_64.c (renamed from arch/sh64/boot/compressed/misc.c)0
-rw-r--r--arch/sh/boot/compressed/vmlinux_64.lds (renamed from arch/sh64/boot/compressed/vmlinux.lds.S)0
-rw-r--r--arch/sh64/boot/Makefile20
-rw-r--r--arch/sh64/boot/compressed/cache.c39
-rw-r--r--arch/sh64/boot/compressed/install.sh56
12 files changed, 80 insertions, 180 deletions
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile
index 906a13f82fe0..efb01dc3c8c3 100644
--- a/arch/sh/boot/compressed/Makefile
+++ b/arch/sh/boot/compressed/Makefile
@@ -1,43 +1,5 @@
1# 1ifeq ($(CONFIG_SUPERH32),y)
2# linux/arch/sh/boot/compressed/Makefile 2include ${srctree}/arch/sh/boot/compressed/Makefile_32
3# 3else
4# create a compressed vmlinux image from the original vmlinux 4include ${srctree}/arch/sh/boot/compressed/Makefile_64
5#
6
7targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
8EXTRA_AFLAGS := -traditional
9
10OBJECTS = $(obj)/head.o $(obj)/misc.o
11
12ifdef CONFIG_SH_STANDARD_BIOS
13OBJECTS += $(obj)/../../kernel/sh_bios.o
14endif 5endif
15
16#
17# IMAGE_OFFSET is the load offset of the compression loader
18#
19IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
20 $$[$(CONFIG_PAGE_OFFSET) + \
21 $(CONFIG_MEMORY_START) + \
22 $(CONFIG_BOOT_LINK_OFFSET)]')
23
24LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
25
26LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds
27
28
29$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
30 $(call if_changed,ld)
31 @:
32
33$(obj)/vmlinux.bin: vmlinux FORCE
34 $(call if_changed,objcopy)
35
36$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
37 $(call if_changed,gzip)
38
39LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh-linux -T
40OBJCOPYFLAGS += -R .empty_zero_page
41
42$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
43 $(call if_changed,ld)
diff --git a/arch/sh/boot/compressed/Makefile_32 b/arch/sh/boot/compressed/Makefile_32
new file mode 100644
index 000000000000..6ac8d4a4ed1d
--- /dev/null
+++ b/arch/sh/boot/compressed/Makefile_32
@@ -0,0 +1,43 @@
1#
2# linux/arch/sh/boot/compressed/Makefile
3#
4# create a compressed vmlinux image from the original vmlinux
5#
6
7targets := vmlinux vmlinux.bin vmlinux.bin.gz \
8 head_32.o misc_32.o piggy.o
9EXTRA_AFLAGS := -traditional
10
11OBJECTS = $(obj)/head_32.o $(obj)/misc_32.o
12
13ifdef CONFIG_SH_STANDARD_BIOS
14OBJECTS += $(obj)/../../kernel/sh_bios.o
15endif
16
17#
18# IMAGE_OFFSET is the load offset of the compression loader
19#
20IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
21 $$[$(CONFIG_PAGE_OFFSET) + \
22 $(CONFIG_MEMORY_START) + \
23 $(CONFIG_BOOT_LINK_OFFSET)]')
24
25LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
26
27LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds
28
29$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
30 $(call if_changed,ld)
31 @:
32
33$(obj)/vmlinux.bin: vmlinux FORCE
34 $(call if_changed,objcopy)
35
36$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
37 $(call if_changed,gzip)
38
39LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh-linux -T
40OBJCOPYFLAGS += -R .empty_zero_page
41
42$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
43 $(call if_changed,ld)
diff --git a/arch/sh64/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile_64
index 9cd216718856..0b48ae99922b 100644
--- a/arch/sh64/boot/compressed/Makefile
+++ b/arch/sh/boot/compressed/Makefile_64
@@ -12,21 +12,21 @@
12# 12#
13 13
14targets := vmlinux vmlinux.bin vmlinux.bin.gz \ 14targets := vmlinux vmlinux.bin vmlinux.bin.gz \
15 head.o misc.o cache.o piggy.o vmlinux.lds 15 head_64.o misc_64.o cache.o piggy.o
16
17EXTRA_AFLAGS := -traditional 16EXTRA_AFLAGS := -traditional
18 17
19OBJECTS := $(obj)/head.o $(obj)/misc.o $(obj)/cache.o 18OBJECTS := $(obj)/vmlinux_64.lds $(obj)/head_64.o $(obj)/misc_64.o \
19 $(obj)/cache.o
20 20
21# 21#
22# ZIMAGE_OFFSET is the load offset of the compression loader 22# ZIMAGE_OFFSET is the load offset of the compression loader
23# (4M for the kernel plus 64K for this loader) 23# (4M for the kernel plus 64K for this loader)
24# 24#
25ZIMAGE_OFFSET = $(shell printf "0x%8x" $$[$(CONFIG_MEMORY_START)+0x400000+0x10000]) 25ZIMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
26 $$[$(CONFIG_PAGE_OFFSET)+0x400000+0x10000]')
26 27
27LDFLAGS_vmlinux := -Ttext $(ZIMAGE_OFFSET) -e startup \ 28LDFLAGS_vmlinux := -Ttext $(ZIMAGE_OFFSET) -e startup \
28 -T $(obj)/../../kernel/vmlinux.lds \ 29 -T $(obj)/../../kernel/vmlinux.lds
29 --no-warn-mismatch
30 30
31$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE 31$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE
32 $(call if_changed,ld) 32 $(call if_changed,ld)
@@ -41,6 +41,5 @@ $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
41LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh64-linux -T 41LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh64-linux -T
42OBJCOPYFLAGS += -R .empty_zero_page 42OBJCOPYFLAGS += -R .empty_zero_page
43 43
44$(obj)/piggy.o: $(obj)/vmlinux.lds $(obj)/vmlinux.bin.gz FORCE 44$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
45 $(call if_changed,ld) 45 $(call if_changed,ld)
46
diff --git a/arch/sh/boot/compressed/cache.c b/arch/sh/boot/compressed/cache.c
new file mode 100644
index 000000000000..e27fc74f228c
--- /dev/null
+++ b/arch/sh/boot/compressed/cache.c
@@ -0,0 +1,12 @@
1int cache_control(unsigned int command)
2{
3 volatile unsigned int *p = (volatile unsigned int *) 0x80000000;
4 int i;
5
6 for (i = 0; i < (32 * 1024); i += 32) {
7 (void)*p;
8 p += (32 / sizeof (int));
9 }
10
11 return 0;
12}
diff --git a/arch/sh/boot/compressed/head.S b/arch/sh/boot/compressed/head_32.S
index a8399b013729..a8399b013729 100644
--- a/arch/sh/boot/compressed/head.S
+++ b/arch/sh/boot/compressed/head_32.S
diff --git a/arch/sh64/boot/compressed/head.S b/arch/sh/boot/compressed/head_64.S
index 82040b1a29cf..1d4ecbfc767c 100644
--- a/arch/sh64/boot/compressed/head.S
+++ b/arch/sh/boot/compressed/head_64.S
@@ -13,11 +13,10 @@
13 * Modification for compressed loader: 13 * Modification for compressed loader:
14 * Copyright (C) 2002 Stuart Menefy (stuart.menefy@st.com) 14 * Copyright (C) 2002 Stuart Menefy (stuart.menefy@st.com)
15 */ 15 */
16
17#include <linux/linkage.h> 16#include <linux/linkage.h>
18#include <asm/registers.h>
19#include <asm/cache.h> 17#include <asm/cache.h>
20#include <asm/mmu_context.h> 18#include <asm/cpu/mmu_context.h>
19#include <asm/cpu/registers.h>
21 20
22/* 21/*
23 * Fixed TLB entries to identity map the beginning of RAM 22 * Fixed TLB entries to identity map the beginning of RAM
@@ -51,14 +50,14 @@ startup:
51 * uninitialized target registers. 50 * uninitialized target registers.
52 * This must be executed before the first branch. 51 * This must be executed before the first branch.
53 */ 52 */
54 ptabs/u ZERO, tr0 53 ptabs/u r63, tr0
55 ptabs/u ZERO, tr1 54 ptabs/u r63, tr1
56 ptabs/u ZERO, tr2 55 ptabs/u r63, tr2
57 ptabs/u ZERO, tr3 56 ptabs/u r63, tr3
58 ptabs/u ZERO, tr4 57 ptabs/u r63, tr4
59 ptabs/u ZERO, tr5 58 ptabs/u r63, tr5
60 ptabs/u ZERO, tr6 59 ptabs/u r63, tr6
61 ptabs/u ZERO, tr7 60 ptabs/u r63, tr7
62 synci 61 synci
63 62
64 /* 63 /*
@@ -69,7 +68,7 @@ startup:
69 pta 1f, tr1 68 pta 1f, tr1
70 movi ITLB_FIXED, r21 69 movi ITLB_FIXED, r21
71 movi ITLB_LAST_VAR_UNRESTRICTED+TLB_STEP, r22 70 movi ITLB_LAST_VAR_UNRESTRICTED+TLB_STEP, r22
721: putcfg r21, 0, ZERO /* Clear MMUIR[n].PTEH.V */ 711: putcfg r21, 0, r63 /* Clear MMUIR[n].PTEH.V */
73 addi r21, TLB_STEP, r21 72 addi r21, TLB_STEP, r21
74 bne r21, r22, tr1 73 bne r21, r22, tr1
75 74
@@ -77,7 +76,7 @@ startup:
77 pta 1f, tr1 76 pta 1f, tr1
78 movi DTLB_FIXED, r21 77 movi DTLB_FIXED, r21
79 movi DTLB_LAST_VAR_UNRESTRICTED+TLB_STEP, r22 78 movi DTLB_LAST_VAR_UNRESTRICTED+TLB_STEP, r22
801: putcfg r21, 0, ZERO /* Clear MMUDR[n].PTEH.V */ 791: putcfg r21, 0, r63 /* Clear MMUDR[n].PTEH.V */
81 addi r21, TLB_STEP, r21 80 addi r21, TLB_STEP, r21
82 bne r21, r22, tr1 81 bne r21, r22, tr1
83 82
@@ -133,7 +132,7 @@ startup:
133 pt 1f, tr1 132 pt 1f, tr1
134 movi datalabel __bss_start, r22 133 movi datalabel __bss_start, r22
135 movi datalabel _end, r23 134 movi datalabel _end, r23
1361: st.l r22, 0, ZERO 1351: st.l r22, 0, r63
137 addi r22, 4, r22 136 addi r22, 4, r22
138 bne r22, r23, tr1 137 bne r22, r23, tr1
139 138
@@ -161,4 +160,4 @@ startup:
161 160
162 /* Shouldn't return here, but just in case, loop forever */ 161 /* Shouldn't return here, but just in case, loop forever */
163 pt 1f, tr0 162 pt 1f, tr0
1641: blink tr0, ZERO 1631: blink tr0, r63
diff --git a/arch/sh/boot/compressed/misc.c b/arch/sh/boot/compressed/misc_32.c
index df65e305acf7..df65e305acf7 100644
--- a/arch/sh/boot/compressed/misc.c
+++ b/arch/sh/boot/compressed/misc_32.c
diff --git a/arch/sh64/boot/compressed/misc.c b/arch/sh/boot/compressed/misc_64.c
index aea00c53ce29..aea00c53ce29 100644
--- a/arch/sh64/boot/compressed/misc.c
+++ b/arch/sh/boot/compressed/misc_64.c
diff --git a/arch/sh64/boot/compressed/vmlinux.lds.S b/arch/sh/boot/compressed/vmlinux_64.lds
index 59c2ef4aeda5..59c2ef4aeda5 100644
--- a/arch/sh64/boot/compressed/vmlinux.lds.S
+++ b/arch/sh/boot/compressed/vmlinux_64.lds
diff --git a/arch/sh64/boot/Makefile b/arch/sh64/boot/Makefile
deleted file mode 100644
index fb71087b7b8a..000000000000
--- a/arch/sh64/boot/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
1#
2# arch/sh64/boot/Makefile
3#
4# This file is subject to the terms and conditions of the GNU General Public
5# License. See the file "COPYING" in the main directory of this archive
6# for more details.
7#
8# Copyright (C) 2002 Stuart Menefy
9#
10
11targets := zImage
12subdir- := compressed
13
14$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
15 $(call if_changed,objcopy)
16 @echo 'Kernel: $@ is ready'
17
18$(obj)/compressed/vmlinux: FORCE
19 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
20
diff --git a/arch/sh64/boot/compressed/cache.c b/arch/sh64/boot/compressed/cache.c
deleted file mode 100644
index 708707355ffa..000000000000
--- a/arch/sh64/boot/compressed/cache.c
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * arch/shmedia/boot/compressed/cache.c -- simple cache management functions
3 *
4 * Code extracted from sh-ipl+g, sh-stub.c, which has the copyright:
5 *
6 * This is originally based on an m68k software stub written by Glenn
7 * Engel at HP, but has changed quite a bit.
8 *
9 * Modifications for the SH by Ben Lee and Steve Chamberlain
10 *
11****************************************************************************
12
13 THIS SOFTWARE IS NOT COPYRIGHTED
14
15 HP offers the following for use in the public domain. HP makes no
16 warranty with regard to the software or it's performance and the
17 user accepts the software "AS IS" with all faults.
18
19 HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
20 TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
21 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22
23****************************************************************************/
24
25#define CACHE_ENABLE 0
26#define CACHE_DISABLE 1
27
28int cache_control(unsigned int command)
29{
30 volatile unsigned int *p = (volatile unsigned int *) 0x80000000;
31 int i;
32
33 for (i = 0; i < (32 * 1024); i += 32) {
34 (void *) *p;
35 p += (32 / sizeof (int));
36 }
37
38 return 0;
39}
diff --git a/arch/sh64/boot/compressed/install.sh b/arch/sh64/boot/compressed/install.sh
deleted file mode 100644
index 90589f0fec12..000000000000
--- a/arch/sh64/boot/compressed/install.sh
+++ /dev/null
@@ -1,56 +0,0 @@
1#!/bin/sh
2#
3# arch/sh/boot/install.sh
4#
5# This file is subject to the terms and conditions of the GNU General Public
6# License. See the file "COPYING" in the main directory of this archive
7# for more details.
8#
9# Copyright (C) 1995 by Linus Torvalds
10#
11# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
12# Adapted from code in arch/i386/boot/install.sh by Russell King
13# Adapted from code in arch/arm/boot/install.sh by Stuart Menefy
14#
15# "make install" script for sh architecture
16#
17# Arguments:
18# $1 - kernel version
19# $2 - kernel image file
20# $3 - kernel map file
21# $4 - default install path (blank if root directory)
22#
23
24# User may have a custom install script
25
26if [ -x /sbin/installkernel ]; then
27 exec /sbin/installkernel "$@"
28fi
29
30if [ "$2" = "zImage" ]; then
31# Compressed install
32 echo "Installing compressed kernel"
33 if [ -f $4/vmlinuz-$1 ]; then
34 mv $4/vmlinuz-$1 $4/vmlinuz.old
35 fi
36
37 if [ -f $4/System.map-$1 ]; then
38 mv $4/System.map-$1 $4/System.old
39 fi
40
41 cat $2 > $4/vmlinuz-$1
42 cp $3 $4/System.map-$1
43else
44# Normal install
45 echo "Installing normal kernel"
46 if [ -f $4/vmlinux-$1 ]; then
47 mv $4/vmlinux-$1 $4/vmlinux.old
48 fi
49
50 if [ -f $4/System.map ]; then
51 mv $4/System.map $4/System.old
52 fi
53
54 cat $2 > $4/vmlinux-$1
55 cp $3 $4/System.map
56fi