From patchwork Wed Jul 29 15:04:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 38169 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6TFELVP005656 for ; Wed, 29 Jul 2009 15:14:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754510AbZG2PN2 (ORCPT ); Wed, 29 Jul 2009 11:13:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754598AbZG2PN2 (ORCPT ); Wed, 29 Jul 2009 11:13:28 -0400 Received: from ey-out-2122.google.com ([74.125.78.26]:47622 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754510AbZG2PN0 (ORCPT ); Wed, 29 Jul 2009 11:13:26 -0400 Received: by ey-out-2122.google.com with SMTP id 9so217532eyd.37 for ; Wed, 29 Jul 2009 08:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=sNpTpp1XjQxhJNOo94ta8wngAAW6B2XcpKGVc063zFc=; b=AXwxR1KlmgnyI4JO+JTg6172+mM3lVzYfUzbiKRo6asCqryRFchdvt+RAgVP3fkUHO cCdwnAVNYKseVjIYOwrfkj2IaUmMlawOWL0/3swsvhpCrwsVATwS5VPdsR9JJcznWkh2 PBKLBEt96vmxinQ/d5ShMsorWvGZx2xvZ3ETU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=hQKikGICYXKZtYZGlkno0RNGXaurx9OxjXNcMJwt9hF7IKnYUeTDhre+IfCseiQmoG O2rYcr7IjA9PF1zI4rmGIW9jOj5+oRNdPuhqhjBRGhc4+2PDeeJSHwHLhlfrPx1LgXtw QvDxCskdq2JAYg1DwQ4m9SZHjkUeAJHOjLYFw= Received: by 10.211.178.12 with SMTP id f12mr69497ebp.98.1248880090544; Wed, 29 Jul 2009 08:08:10 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id 5sm1093650eyh.36.2009.07.29.08.08.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 29 Jul 2009 08:08:09 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Thu, 30 Jul 2009 00:04:05 +0900 Message-Id: <20090729150405.4599.87883.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: romImage support V2 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm 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 --- arch/sh/Makefile | 2 +- arch/sh/boot/Makefile | 11 +++++++++-- arch/sh/boot/romimage/Makefile | 19 +++++++++++++++++++ arch/sh/boot/romimage/head.S | 10 ++++++++++ arch/sh/boot/romimage/vmlinux.scr | 6 ++++++ arch/sh/include/mach-common/romimage.h | 1 + 6 files changed, 46 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/arch/sh/Makefile +++ work/arch/sh/Makefile 2009-07-29 22:59:44.000000000 +0900 @@ -195,7 +195,7 @@ libs-$(CONFIG_SUPERH32) := arch/sh/lib/ libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.srec \ - zImage vmlinux.srec + zImage vmlinux.srec romImage PHONY += maketools $(BOOT_TARGETS) FORCE maketools: include/linux/version.h FORCE --- 0001/arch/sh/boot/Makefile +++ work/arch/sh/boot/Makefile 2009-07-29 23:45:42.000000000 +0900 @@ -24,9 +24,9 @@ suffix-$(CONFIG_KERNEL_GZIP) := gz suffix-$(CONFIG_KERNEL_BZIP2) := bz2 suffix-$(CONFIG_KERNEL_LZMA) := lzma -targets := zImage vmlinux.srec uImage uImage.srec uImage.gz uImage.bz2 uImage.lzma +targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz uImage.bz2 uImage.lzma extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma -subdir- := compressed +subdir- := compressed romimage $(obj)/zImage: $(obj)/compressed/vmlinux FORCE $(call if_changed,objcopy) @@ -35,6 +35,13 @@ $(obj)/zImage: $(obj)/compressed/vmlinux $(obj)/compressed/vmlinux: FORCE $(Q)$(MAKE) $(build)=$(obj)/compressed $@ +$(obj)/romImage: $(obj)/romimage/vmlinux FORCE + $(call if_changed,objcopy) + @echo ' Kernel: $@ is ready' + +$(obj)/romimage/vmlinux: $(obj)/zImage FORCE + $(Q)$(MAKE) $(build)=$(obj)/romimage $@ + KERNEL_MEMORY := 0x00000000 ifeq ($(CONFIG_PMB_FIXED),y) KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \ --- /dev/null +++ work/arch/sh/boot/romimage/Makefile 2009-07-29 23:45:42.000000000 +0900 @@ -0,0 +1,19 @@ +# +# linux/arch/sh/boot/romimage/Makefile +# +# create an image suitable for burning to flash from zImage +# + +targets := vmlinux head.o + +OBJECTS = $(obj)/head.o +LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext 0 -e romstart + +$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE + $(call if_changed,ld) + @: + +LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T + +$(obj)/piggy.o: $(obj)/vmlinux.scr arch/sh/boot/zImage FORCE + $(call if_changed,ld) --- /dev/null +++ work/arch/sh/boot/romimage/head.S 2009-07-29 22:59:44.000000000 +0900 @@ -0,0 +1,10 @@ +/* + * linux/arch/sh/boot/romimage/head.S + * + * Board specific setup code, executed before zImage loader + */ + +.text + .global romstart +romstart: +#include --- /dev/null +++ work/arch/sh/boot/romimage/vmlinux.scr 2009-07-29 23:45:42.000000000 +0900 @@ -0,0 +1,6 @@ +SECTIONS +{ + .text : { + *(.data) + } +} --- /dev/null +++ work/arch/sh/include/mach-common/romimage.h 2009-07-29 22:59:44.000000000 +0900 @@ -0,0 +1 @@ +/* do nothing here by default */