Commit 47050253 authored by Paul Mundt's avatar Paul Mundt Committed by Linus Torvalds

[PATCH] toplevel SH update

This gets the toplevel arch/sh stuff in sync with the current SH 2.5
tree.
parent 57069b8f
This diff is collapsed.
# $Id: Makefile,v 1.6 2000/06/10 03:03:52 gniibe Exp $
# $Id: Makefile,v 1.17 2003/05/20 03:12:54 lethal Exp $
#
# 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.
#
# Copyright (C) 1999 Kaz Kojima
# Copyright (C) 2002, 2003 Paul Mundt
# Copyright (C) 2002 M. R. Brown
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
......@@ -12,72 +14,116 @@
# this architecture
#
ifdef CONFIG_CPU_LITTLE_ENDIAN
CFLAGS += -ml
AFLAGS += -ml
# LDFLAGS_vmlinux += -EL
LDFLAGS := -EL
else
CFLAGS += -mb
AFLAGS += -mb
# LDFLAGS_vmlinux += -EB
LDFLAGS := -EB
#
# We don't necessarily agree with the top-level Makefile with regards to what
# does and does not qualify as a noconfig_targets rule. In this case, we're
# still dependant on .config settings in order for core-y (machdir-y in
# particular) to resolve the proper directory. So we just manually include it
# if it hasn't been already..
#
ifndef include_config
-include .config
endif
OBJCOPYFLAGS := -O binary -R .note -R .comment -R .stab -R .stabstr -S
MODFLAGS +=
cpu-y := -mb
cpu-$(CONFIG_CPU_LITTLE_ENDIAN) := -ml
#
#
cpu-$(CONFIG_CPU_SH2) += -m2
cpu-$(CONFIG_CPU_SH3) += -m3
cpu-$(CONFIG_CPU_SH4) += -m4 -mno-implicit-fp
ifdef CONFIG_CPU_SH3
CFLAGS += -m3
AFLAGS += -m3
ifdef CONFIG_SH_KGDB
CFLAGS :=$(CFLAGS:-fomit-frame-pointer=) -g
AFLAGS += -g
ifdef CONFIG_KGDB_MORE
CFLAGS += $(shell echo $(CONFIG_KGDB_OPTIONS) | sed -e 's/"//g')
endif
ifdef CONFIG_CPU_SH4
CFLAGS += -m4 -mno-implicit-fp
AFLAGS += -m4 -mno-implicit-fp
endif
OBJCOPYFLAGS := -O binary -R .note -R .comment -R .stab -R .stabstr -S
#
# Choosing incompatible machines durings configuration will result in
# error messages during linking.
#
LDFLAGS_vmlinux += -e _stext
ifdef LOADADDR
LDFLAGS_vmlinux += -Ttext $(word 1,$(LOADADDR))
ifdef CONFIG_CPU_LITTLE_ENDIAN
LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' -EL
LDFLAGS_BLOB :=--format binary --oformat elf32-sh-linux
else
LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' -EB
LDFLAGS_BLOB :=--format binary --oformat elf32-shbig-linux
endif
#
CFLAGS += -pipe
CFLAGS += -pipe $(cpu-y)
AFLAGS += $(cpu-y)
head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o
LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
core-y += arch/sh/kernel/ arch/sh/mm/
core-$(CONFIG_SH_GENERIC) += arch/sh/stboards/
core-$(CONFIG_SH_STB1_HARP) += arch/sh/stboards/
core-$(CONFIG_SH_STB1_OVERDRIVE)+= arch/sh/stboards/
# Boards
machdir-$(CONFIG_SH_SOLUTION_ENGINE) := se/770x
machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se/7751
machdir-$(CONFIG_SH_STB1_HARP) := harp
machdir-$(CONFIG_SH_STB1_OVERDRIVE) := overdrive
machdir-$(CONFIG_SH_HP620) := hp6xx/hp620
machdir-$(CONFIG_SH_HP680) := hp6xx/hp680
machdir-$(CONFIG_SH_HP690) := hp6xx/hp690
machdir-$(CONFIG_SH_CQREEK) := cqreek
machdir-$(CONFIG_SH_DMIDA) := dmida
machdir-$(CONFIG_SH_EC3104) := ec3104
machdir-$(CONFIG_SH_SATURN) := saturn
machdir-$(CONFIG_SH_DREAMCAST) := dreamcast
machdir-$(CONFIG_SH_CAT68701) := cat68701
machdir-$(CONFIG_SH_BIGSUR) := bigsur
machdir-$(CONFIG_SH_SH2000) := sh2000
machdir-$(CONFIG_SH_ADX) := adx
machdir-$(CONFIG_SH_MPC1211) := mpc1211
machdir-$(CONFIG_SH_UNKNOWN) := unknown
incdir-y := $(machdir-y)
incdir-$(CONFIG_SH_SOLUTION_ENGINE) := se
incdir-$(CONFIG_SH_7751_SOLUTION_ENGINE) := se7751
incdir-$(CONFIG_SH_HP600) := hp6xx
core-y += arch/sh/boards/$(machdir-y)/
# Companion chips
core-$(CONFIG_HD64461) += arch/sh/cchips/hd6446x/hd64461/
core-$(CONFIG_HD64465) += arch/sh/cchips/hd6446x/hd64465/
cpuincdir-$(CONFIG_CPU_SH2) := cpu-sh2
cpuincdir-$(CONFIG_CPU_SH3) := cpu-sh3
cpuincdir-$(CONFIG_CPU_SH4) := cpu-sh4
libs-y += arch/sh/lib/ $(LIBGCC)
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
boot := arch/sh/boot
AFLAGS_vmlinux.lds.o := -traditional
prepare: target_links
.PHONY: target_links FORCE
target_links:
@echo ' Making asm-sh/cpu -> asm-sh/$(cpuincdir-y) link'
@ln -sf $(cpuincdir-y) include/asm-sh/cpu
@echo ' Making asm-sh/mach -> asm-sh/$(incdir-y) link'
@ln -sf $(incdir-y) include/asm-sh/mach
$(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
BOOTIMAGE=arch/sh/boot/zImage
zImage: vmlinux
@$(MAKEBOOT) zImage
$(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE)
compressed: zImage
zdisk: vmlinux
@$(MAKEBOOT) zdisk
archclean:
@$(MAKEBOOT) clean
$(MAKE) -C arch/$(ARCH)/kernel clean
$(MAKE) -C arch/$(ARCH)/stboards clean
# $(MAKE) -C arch/$(ARCH)/tools clean
$(Q)$(MAKE) $(clean)=$(boot)
......@@ -4,40 +4,34 @@
# create a compressed vmlinux image from the original vmlinux
#
HEAD = head.o
SYSTEM = $(TOPDIR)/vmlinux
targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
EXTRA_AFLAGS := -traditional
OBJECTS = $(HEAD) misc.o
OBJECTS = $(obj)/head.o $(obj)/misc.o
ifdef CONFIG_SH_STANDARD_BIOS
OBJECTS += ../../kernel/sh_bios.o
OBJECTS += $(obj)/../../kernel/sh_bios.o
endif
ZLDFLAGS = -e startup -T $(TOPDIR)/arch/sh/vmlinux.lds
#
# ZIMAGE_OFFSET is the load offset of the compression loader
# IMAGE_OFFSET is the load offset of the compression loader
#
ZIMAGE_OFFSET = $(shell printf "0x%8x" $$[0x80000000+0x$(CONFIG_MEMORY_START)+0x200000+0x10000])
IMAGE_OFFSET = $(shell printf "0x%8x" $$[0x80000000+0x$(CONFIG_MEMORY_START)+0x200000+0x10000])
ZLINKFLAGS = -Ttext $(ZIMAGE_OFFSET) $(ZLDFLAGS)
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../vmlinux.lds.s
all: vmlinux
$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE
$(call if_changed,ld)
@:
vmlinux: piggy.o $(OBJECTS)
$(LD) $(LDFLAGS) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o
$(obj)/vmlinux.bin: vmlinux FORCE
$(call if_changed,objcopy)
head.o: head.S
$(CC) $(AFLAGS) -traditional -c head.S
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip)
piggy.o: $(SYSTEM)
tmppiggy=_tmp_$$$$piggy; \
rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk; \
$(OBJCOPY) $(OBJCOPYFLAGS) -R .empty_zero_page $(SYSTEM) $$tmppiggy; \
gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \
echo "SECTIONS { .data : { input_len = .; LONG(input_data_end - input_data) input_data = .; *(.data) input_data_end = .; }}" > $$tmppiggy.lnk; \
$(LD) $(LDFLAGS) -r -o piggy.o -b binary $$tmppiggy.gz -b elf32-sh-linux -T $$tmppiggy.lnk; \
rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk
LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh-linux -T
OBJCOPYFLAGS += -R .empty_zero_page
clean:
rm -f vmlinux _tmp_*
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
$(call if_changed,ld)
/* $Id: vmlinux.lds.in,v 1.5 2001/07/27 11:45:55 gniibe Exp $
/* $Id: vmlinux.lds.S,v 1.8 2003/05/16 17:18:14 lethal Exp $
* ld script to make SuperH Linux kernel
* Written by Niibe Yutaka
*/
......@@ -7,16 +7,14 @@
#ifdef CONFIG_CPU_LITTLE_ENDIAN
OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
jiffies = jiffies_64;
#else
OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux")
jiffies = jiffies_64 + 4;
#endif
OUTPUT_ARCH(sh)
ENTRY(_start)
SECTIONS
{
. = 0x80000000 + CONFIG_MEMORY_START + 0x1000;
. = 0x80000000 + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
_text = .; /* Text and read-only data */
text = .; /* Text and read-only data */
.empty_zero_page : {
......@@ -42,6 +40,15 @@ SECTIONS
CONSTRUCTORS
}
. = ALIGN(4096);
.data.page_aligned : { *(.data.idt) }
. = ALIGN(32);
__per_cpu_start = .;
.data.percpu : { *(.data.percpu) }
__per_cpu_end = .;
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
_edata = .; /* End of data section */
. = ALIGN(8192); /* init_task */
......@@ -51,12 +58,17 @@ SECTIONS
. = ALIGN(4096); /* Init code and data */
__init_begin = .;
.text.init : { *(.text.init) }
.data.init : { *(.data.init) }
_sinittext = .;
.init.text : { *(.init.text) }
_einittext = .;
.init.data : { *(.init.data) }
. = ALIGN(16);
__setup_start = .;
.setup.init : { *(.setup.init) }
.init.setup : { *(.init.setup) }
__setup_end = .;
__start___param = .;
__param : { *(__param) }
__stop___param = .;
__initcall_start = .;
.initcall.init : {
*(.initcall1.init)
......@@ -72,27 +84,19 @@ SECTIONS
.con_initcall.init : { *(.con_initcall.init) }
__con_initcall_end = .;
SECURITY_INIT
__initramfs_start = .;
.init.ramfs : { *(.init.ramfs) }
__initramfs_end = .;
__machvec_start = .;
.machvec.init : { *(.machvec.init) }
.init.machvec : { *(.init.machvec) }
__machvec_end = .;
. = ALIGN(4096);
__init_end = .;
. = ALIGN(4096);
.data.page_aligned : { *(.data.idt) }
#ifdef CONFIG_CPU_SH3
. = ALIGN(16);
#else
. = ALIGN(32);
#endif
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
. = ALIGN(4);
__bss_start = .; /* BSS */
.bss : {
*(.bss)
}
.bss : { *(.bss) }
. = ALIGN(4);
_end = . ;
......@@ -102,8 +106,8 @@ SECTIONS
* it's a module.
*/
/DISCARD/ : {
*(.text.exit)
*(.data.exit)
*(.exit.text)
*(.exit.data)
*(.exitcall.exit)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment