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 # 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 # License. See the file "COPYING" in the main directory of this archive
# for more details. # for more details.
# #
# Copyright (C) 1999 Kaz Kojima # 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 # 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 # architecture-specific flags and dependencies. Remember to do have actions
...@@ -12,72 +14,116 @@ ...@@ -12,72 +14,116 @@
# this architecture # this architecture
# #
ifdef CONFIG_CPU_LITTLE_ENDIAN #
CFLAGS += -ml # We don't necessarily agree with the top-level Makefile with regards to what
AFLAGS += -ml # does and does not qualify as a noconfig_targets rule. In this case, we're
# LDFLAGS_vmlinux += -EL # still dependant on .config settings in order for core-y (machdir-y in
LDFLAGS := -EL # particular) to resolve the proper directory. So we just manually include it
else # if it hasn't been already..
CFLAGS += -mb #
AFLAGS += -mb ifndef include_config
# LDFLAGS_vmlinux += -EB -include .config
LDFLAGS := -EB
endif endif
OBJCOPYFLAGS := -O binary -R .note -R .comment -R .stab -R .stabstr -S cpu-y := -mb
cpu-$(CONFIG_CPU_LITTLE_ENDIAN) := -ml
MODFLAGS += cpu-$(CONFIG_CPU_SH2) += -m2
cpu-$(CONFIG_CPU_SH3) += -m3
cpu-$(CONFIG_CPU_SH4) += -m4 -mno-implicit-fp
# ifdef CONFIG_SH_KGDB
# CFLAGS :=$(CFLAGS:-fomit-frame-pointer=) -g
AFLAGS += -g
ifdef CONFIG_CPU_SH3 ifdef CONFIG_KGDB_MORE
CFLAGS += -m3 CFLAGS += $(shell echo $(CONFIG_KGDB_OPTIONS) | sed -e 's/"//g')
AFLAGS += -m3
endif endif
ifdef CONFIG_CPU_SH4
CFLAGS += -m4 -mno-implicit-fp
AFLAGS += -m4 -mno-implicit-fp
endif endif
OBJCOPYFLAGS := -O binary -R .note -R .comment -R .stab -R .stabstr -S
# #
# Choosing incompatible machines durings configuration will result in # Choosing incompatible machines durings configuration will result in
# error messages during linking. # error messages during linking.
# #
LDFLAGS_vmlinux += -e _stext LDFLAGS_vmlinux += -e _stext
ifdef LOADADDR ifdef CONFIG_CPU_LITTLE_ENDIAN
LDFLAGS_vmlinux += -Ttext $(word 1,$(LOADADDR)) 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 endif
# CFLAGS += -pipe $(cpu-y)
CFLAGS += -pipe AFLAGS += $(cpu-y)
head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o
LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
core-y += arch/sh/kernel/ arch/sh/mm/ core-y += arch/sh/kernel/ arch/sh/mm/
core-$(CONFIG_SH_GENERIC) += arch/sh/stboards/
core-$(CONFIG_SH_STB1_HARP) += arch/sh/stboards/ # Boards
core-$(CONFIG_SH_STB1_OVERDRIVE)+= arch/sh/stboards/ 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) libs-y += arch/sh/lib/ $(LIBGCC)
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot boot := arch/sh/boot
AFLAGS_vmlinux.lds.o := -traditional 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 zImage: vmlinux
@$(MAKEBOOT) zImage $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE)
compressed: zImage compressed: zImage
zdisk: vmlinux
@$(MAKEBOOT) zdisk
archclean: archclean:
@$(MAKEBOOT) clean $(Q)$(MAKE) $(clean)=$(boot)
$(MAKE) -C arch/$(ARCH)/kernel clean
$(MAKE) -C arch/$(ARCH)/stboards clean
# $(MAKE) -C arch/$(ARCH)/tools clean
...@@ -4,40 +4,34 @@ ...@@ -4,40 +4,34 @@
# create a compressed vmlinux image from the original vmlinux # create a compressed vmlinux image from the original vmlinux
# #
HEAD = head.o targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
SYSTEM = $(TOPDIR)/vmlinux EXTRA_AFLAGS := -traditional
OBJECTS = $(HEAD) misc.o OBJECTS = $(obj)/head.o $(obj)/misc.o
ifdef CONFIG_SH_STANDARD_BIOS ifdef CONFIG_SH_STANDARD_BIOS
OBJECTS += ../../kernel/sh_bios.o OBJECTS += $(obj)/../../kernel/sh_bios.o
endif 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) $(obj)/vmlinux.bin: vmlinux FORCE
$(LD) $(LDFLAGS) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o $(call if_changed,objcopy)
head.o: head.S $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
$(CC) $(AFLAGS) -traditional -c head.S $(call if_changed,gzip)
piggy.o: $(SYSTEM) LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh-linux -T
tmppiggy=_tmp_$$$$piggy; \ OBJCOPYFLAGS += -R .empty_zero_page
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
clean: $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
rm -f vmlinux _tmp_* $(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 * ld script to make SuperH Linux kernel
* Written by Niibe Yutaka * Written by Niibe Yutaka
*/ */
...@@ -7,16 +7,14 @@ ...@@ -7,16 +7,14 @@
#ifdef CONFIG_CPU_LITTLE_ENDIAN #ifdef CONFIG_CPU_LITTLE_ENDIAN
OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
jiffies = jiffies_64;
#else #else
OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux") OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux")
jiffies = jiffies_64 + 4;
#endif #endif
OUTPUT_ARCH(sh) OUTPUT_ARCH(sh)
ENTRY(_start) ENTRY(_start)
SECTIONS 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 */
text = .; /* Text and read-only data */ text = .; /* Text and read-only data */
.empty_zero_page : { .empty_zero_page : {
...@@ -42,6 +40,15 @@ SECTIONS ...@@ -42,6 +40,15 @@ SECTIONS
CONSTRUCTORS 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 */ _edata = .; /* End of data section */
. = ALIGN(8192); /* init_task */ . = ALIGN(8192); /* init_task */
...@@ -51,12 +58,17 @@ SECTIONS ...@@ -51,12 +58,17 @@ SECTIONS
. = ALIGN(4096); /* Init code and data */ . = ALIGN(4096); /* Init code and data */
__init_begin = .; __init_begin = .;
.text.init : { *(.text.init) } _sinittext = .;
.data.init : { *(.data.init) } .init.text : { *(.init.text) }
_einittext = .;
.init.data : { *(.init.data) }
. = ALIGN(16); . = ALIGN(16);
__setup_start = .; __setup_start = .;
.setup.init : { *(.setup.init) } .init.setup : { *(.init.setup) }
__setup_end = .; __setup_end = .;
__start___param = .;
__param : { *(__param) }
__stop___param = .;
__initcall_start = .; __initcall_start = .;
.initcall.init : { .initcall.init : {
*(.initcall1.init) *(.initcall1.init)
...@@ -72,27 +84,19 @@ SECTIONS ...@@ -72,27 +84,19 @@ SECTIONS
.con_initcall.init : { *(.con_initcall.init) } .con_initcall.init : { *(.con_initcall.init) }
__con_initcall_end = .; __con_initcall_end = .;
SECURITY_INIT SECURITY_INIT
__initramfs_start = .;
.init.ramfs : { *(.init.ramfs) }
__initramfs_end = .;
__machvec_start = .; __machvec_start = .;
.machvec.init : { *(.machvec.init) } .init.machvec : { *(.init.machvec) }
__machvec_end = .; __machvec_end = .;
. = ALIGN(4096); . = ALIGN(4096);
__init_end = .; __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); . = ALIGN(4);
__bss_start = .; /* BSS */ __bss_start = .; /* BSS */
.bss : { .bss : { *(.bss) }
*(.bss)
}
. = ALIGN(4); . = ALIGN(4);
_end = . ; _end = . ;
...@@ -102,8 +106,8 @@ SECTIONS ...@@ -102,8 +106,8 @@ SECTIONS
* it's a module. * it's a module.
*/ */
/DISCARD/ : { /DISCARD/ : {
*(.text.exit) *(.exit.text)
*(.data.exit) *(.exit.data)
*(.exitcall.exit) *(.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