Commit 7ec80311 authored by David Howells's avatar David Howells Committed by Linus Torvalds

[PATCH] FRV: Fujitsu FR-V CPU arch implementation part 1

The attached patches provides part 1 of an architecture implementation
for the Fujitsu FR-V CPU series, configurably as Linux or uClinux.
Signed-Off-By: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2b837a9b
This diff is collapsed.
#
# frv/Makefile
#
# 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
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# 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) 2003, 2004 Red Hat Inc.
# - Written by David Howells <dhowells@redhat.com>
# - Derived from arch/m68knommu/Makefile,
# Copyright (c) 1999,2001 D. Jeff Dionne <jeff@lineo.ca>,
# Rt-Control Inc. / Lineo, Inc.
#
# Copyright (C) 1998,1999 D. Jeff Dionne <jeff@uclinux.org>,
# Kenneth Albanowski <kjahds@kjahds.com>,
#
# Based on arch/m68k/Makefile:
# Copyright (C) 1994 by Hamish Macdonald
#
CCSPECS := $(shell $(CC) -v 2>&1 | grep "^Reading specs from " | head -1 | cut -c20-)
CCDIR := $(strip $(patsubst %/specs,%,$(CCSPECS)))
CPUCLASS := fr400
# test for cross compiling
COMPILE_ARCH = $(shell uname -m)
ifdef CONFIG_MMU
UTS_SYSNAME = -DUTS_SYSNAME=\"Linux\"
else
UTS_SYSNAME = -DUTS_SYSNAME=\"uClinux\"
endif
ARCHMODFLAGS += -G0 -mlong-calls
ifdef CONFIG_GPREL_DATA_8
CFLAGS += -G8
else
ifdef CONFIG_GPREL_DATA_4
CFLAGS += -G4
else
ifdef CONFIG_GPREL_DATA_NONE
CFLAGS += -G0
endif
endif
endif
#LDFLAGS_vmlinux := -Map linkmap.txt
ifdef CONFIG_GC_SECTIONS
CFLAGS += -ffunction-sections -fdata-sections
LINKFLAGS += --gc-sections
endif
ifndef CONFIG_FRAME_POINTER
CFLAGS += -mno-linked-fp
endif
ifdef CONFIG_CPU_FR451_COMPILE
CFLAGS += -mcpu=fr450
AFLAGS += -mcpu=fr450
ASFLAGS += -mcpu=fr450
else
ifdef CONFIG_CPU_FR551_COMPILE
CFLAGS += -mcpu=fr550
AFLAGS += -mcpu=fr550
ASFLAGS += -mcpu=fr550
else
CFLAGS += -mcpu=fr400
AFLAGS += -mcpu=fr400
ASFLAGS += -mcpu=fr400
endif
endif
# pretend the kernel is going to run on an FR400 with no media-fp unit
# - reserve CC3 for use with atomic ops
# - all the extra registers are dealt with only at context switch time
CFLAGS += -mno-fdpic -mgpr-32 -msoft-float -mno-media
CFLAGS += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15
AFLAGS += -mno-fdpic
ASFLAGS += -mno-fdpic
# make sure the .S files get compiled with debug info
# and disable optimisations that are unhelpful whilst debugging
ifdef CONFIG_DEBUG_INFO
CFLAGS += -O1
AFLAGS += -Wa,--gdwarf2
ASFLAGS += -Wa,--gdwarf2
endif
head-y := arch/frv/kernel/head.o arch/frv/kernel/init_task.o
core-y += arch/frv/kernel/ arch/frv/mm/
libs-y += arch/frv/lib/
core-$(CONFIG_MB93090_MB00) += arch/frv/mb93090-mb00/
all: Image
Image: vmlinux
$(Q)$(MAKE) $(build)=arch/frv/boot $@
bootstrap:
$(Q)$(MAKEBOOT) bootstrap
archmrproper:
$(Q)$(MAKE) -C arch/frv/boot mrproper
archclean:
$(Q)$(MAKE) -C arch/frv/boot clean
archdep: scripts/mkdep symlinks
$(Q)$(MAKE) -C arch/frv/boot dep
#
# arch/arm/boot/Makefile
#
# 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) 1995-2000 Russell King
#
SYSTEM =$(TOPDIR)/$(LINUX)
ZTEXTADDR = 0x02080000
PARAMS_PHYS = 0x0207c000
INITRD_PHYS = 0x02180000
INITRD_VIRT = 0x02180000
#
# If you don't define ZRELADDR above,
# then it defaults to ZTEXTADDR
#
ifeq ($(ZRELADDR),)
ZRELADDR = $(ZTEXTADDR)
endif
export SYSTEM ZTEXTADDR ZBSSADDR ZRELADDR INITRD_PHYS INITRD_VIRT PARAMS_PHYS
Image: $(obj)/Image
targets: $(obj)/Image
$(obj)/Image: vmlinux FORCE
$(OBJCOPY) -O binary -R .note -R .comment -S vmlinux $@
#$(obj)/Image: $(CONFIGURE) $(SYSTEM)
# $(OBJCOPY) -O binary -R .note -R .comment -g -S $(SYSTEM) $@
bzImage: zImage
zImage: $(CONFIGURE) compressed/$(LINUX)
$(OBJCOPY) -O binary -R .note -R .comment -S compressed/$(LINUX) $@
bootpImage: bootp/bootp
$(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@
compressed/$(LINUX): $(TOPDIR)/$(LINUX) dep
@$(MAKE) -C compressed $(LINUX)
bootp/bootp: zImage initrd
@$(MAKE) -C bootp bootp
initrd:
@test "$(INITRD_VIRT)" != "" || (echo This architecture does not support INITRD; exit -1)
@test "$(INITRD)" != "" || (echo You must specify INITRD; exit -1)
#
# installation
#
install: $(CONFIGURE) Image
sh ./install.sh $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) Image $(TOPDIR)/System.map "$(INSTALL_PATH)"
zinstall: $(CONFIGURE) zImage
sh ./install.sh $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)"
#
# miscellany
#
mrproper clean:
$(RM) Image zImage bootpImage
# @$(MAKE) -C compressed clean
# @$(MAKE) -C bootp clean
dep:
/* ld script to make FRV Linux kernel -*- c -*-
* Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
*/
OUTPUT_FORMAT("elf32-frv", "elf32-frv", "elf32-frv")
OUTPUT_ARCH(frv)
ENTRY(_start)
#include <asm-generic/vmlinux.lds.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/cache.h>
#include <asm/thread_info.h>
jiffies = jiffies_64 + 4;
__page_offset = 0xc0000000; /* start of area covered by struct pages */
__kernel_image_start = __page_offset; /* address at which kernel image resides */
SECTIONS
{
. = __kernel_image_start;
/* discardable initialisation code and data */
. = ALIGN(PAGE_SIZE); /* Init code and data */
__init_begin = .;
_sinittext = .;
.init.text : {
*(.text.head)
#ifndef CONFIG_DEBUG_INFO
*(.init.text)
*(.exit.text)
*(.exit.data)
*(.exitcall.exit)
#endif
}
_einittext = .;
.init.data : { *(.init.data) }
. = ALIGN(8);
__setup_start = .;
.setup.init : { KEEP(*(.init.setup)) }
__setup_end = .;
__initcall_start = .;
.initcall.init : {
*(.initcall1.init)
*(.initcall2.init)
*(.initcall3.init)
*(.initcall4.init)
*(.initcall5.init)
*(.initcall6.init)
*(.initcall7.init)
}
__initcall_end = .;
__con_initcall_start = .;
.con_initcall.init : { *(.con_initcall.init) }
__con_initcall_end = .;
SECURITY_INIT
. = ALIGN(4);
__alt_instructions = .;
.altinstructions : { *(.altinstructions) }
__alt_instructions_end = .;
.altinstr_replacement : { *(.altinstr_replacement) }
__per_cpu_start = .;
.data.percpu : { *(.data.percpu) }
__per_cpu_end = .;
. = ALIGN(4096);
__initramfs_start = .;
.init.ramfs : { *(.init.ramfs) }
__initramfs_end = .;
. = ALIGN(THREAD_SIZE);
__init_end = .;
/* put sections together that have massive alignment issues */
. = ALIGN(THREAD_SIZE);
.data.init_task : {
/* init task record & stack */
*(.data.init_task)
}
.trap : {
/* trap table management - read entry-table.S before modifying */
. = ALIGN(8192);
__trap_tables = .;
*(.trap.user)
*(.trap.kernel)
. = ALIGN(4096);
*(.trap.break)
}
. = ALIGN(4096);
.data.page_aligned : { *(.data.idt) }
. = ALIGN(L1_CACHE_BYTES);
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
/* Text and read-only data */
. = ALIGN(4);
_text = .;
_stext = .;
.text : {
*(
.text.start .text .text.*
#ifdef CONFIG_DEBUG_INFO
.init.text
.exit.text
.exitcall.exit
#endif
)
SCHED_TEXT
*(.fixup)
*(.gnu.warning)
*(.exitcall.exit)
} = 0x9090
_etext = .; /* End of text section */
RODATA
.rodata : {
*(.trap.vector)
/* this clause must not be modified - the ordering and adjacency are imperative */
__trap_fixup_tables = .;
*(.trap.fixup.user .trap.fixup.kernel)
}
. = ALIGN(8); /* Exception table */
__start___ex_table = .;
__ex_table : { KEEP(*(__ex_table)) }
__stop___ex_table = .;
_sdata = .;
.data : { /* Data */
*(.data .data.*)
*(.exit.data)
CONSTRUCTORS
}
_edata = .; /* End of data section */
/* GP section */
. = ALIGN(L1_CACHE_BYTES);
_gp = . + 2048;
PROVIDE (gp = _gp);
.sdata : { *(.sdata .sdata.*) }
/* BSS */
. = ALIGN(L1_CACHE_BYTES);
__bss_start = .;
.sbss : { *(.sbss .sbss.*) }
.bss : { *(.bss .bss.*) }
.bss.stack : { *(.bss) }
__bss_stop = .;
_end = . ;
. = ALIGN(PAGE_SIZE);
__kernel_image_end = .;
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.debug_line 0 : { *(.debug_line) }
.debug_info 0 : { *(.debug_info) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_aranges 0 : { *(.debug_aranges) }
.debug_frame 0 : { *(.debug_frame) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_str 0 : { *(.debug_str) }
.debug_ranges 0 : { *(.debug_ranges) }
.comment 0 : { *(.comment) }
}
__kernel_image_size_no_bss = __bss_start - __kernel_image_start;
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