From patchwork Fri Dec 4 06:42:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 64793 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 nB46mBSA007941 for ; Fri, 4 Dec 2009 06:48:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751975AbZLDGsD (ORCPT ); Fri, 4 Dec 2009 01:48:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752126AbZLDGsD (ORCPT ); Fri, 4 Dec 2009 01:48:03 -0500 Received: from mail-yx0-f187.google.com ([209.85.210.187]:64115 "EHLO mail-yx0-f187.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751975AbZLDGsB (ORCPT ); Fri, 4 Dec 2009 01:48:01 -0500 Received: by yxe17 with SMTP id 17so1866452yxe.33 for ; Thu, 03 Dec 2009 22:48:08 -0800 (PST) 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=b4x6iSq1TIkN+dStE6cB1Y1MRdksLU5t4X/ZYuyCFUQ=; b=eOGU5g3EJhMiwAswssK0P+Ogv2p/JM+MUVltLl0e/GyhAxLrQ5mgDp6DvSq1IaBR1h uC4wH8HOpbEtL4N2KBSQXYI7DlyX2rLYRFoBSNJJdsOzQRczCXXjE2rLpirvHD+Y73Wi yl1JeXWtXclmNEg0eqdft/7cJ2qb0qM1MuAJc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=X+fARhIb2/m+eYXK6d2tWBBdrEKZQQCIr8jg5ycP09xebUk2EvQgaX28RlQP9urN4b Dn/awezq8fUdo77Ju+CQzdkl6tTSQO6tv4lG1Z4Ak1Gca020Qz/QQwJNw9DSgfGuXMwV UpAEH4UkaPhYiGlFK1iFBlYDtPF9gXVhWihIs= Received: by 10.101.138.22 with SMTP id q22mr3325377ann.99.1259909288373; Thu, 03 Dec 2009 22:48:08 -0800 (PST) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 4sm1430866yxd.34.2009.12.03.22.48.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 03 Dec 2009 22:48:07 -0800 (PST) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Fri, 04 Dec 2009 15:42:35 +0900 Message-Id: <20091204064235.7674.79539.sendpatchset@rxone.opensource.se> Subject: [PATCH] sh: include empty zero page in romImage Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org --- 0001/arch/sh/boot/romimage/Makefile +++ work/arch/sh/boot/romimage/Makefile 2009-12-04 15:14:05.000000000 +0900 @@ -4,16 +4,22 @@ # create an image suitable for burning to flash from zImage # -targets := vmlinux head.o +targets := vmlinux head.o zeropage.bin piggy.o OBJECTS = $(obj)/head.o -LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext 0 -e romstart +LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext 0 -e romstart \ + -T $(obj)/../../kernel/vmlinux.lds $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE $(call if_changed,ld) @: +OBJCOPYFLAGS += -j .empty_zero_page + +$(obj)/zeropage.bin: vmlinux FORCE + $(call if_changed,objcopy) + LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T -$(obj)/piggy.o: $(obj)/vmlinux.scr arch/sh/boot/zImage FORCE +$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/zeropage.bin arch/sh/boot/zImage FORCE $(call if_changed,ld) --- 0001/arch/sh/boot/romimage/head.S +++ work/arch/sh/boot/romimage/head.S 2009-12-04 15:21:49.000000000 +0900 @@ -5,6 +5,44 @@ */ .text + #include + .global romstart romstart: + /* include board specific setup code */ #include + + /* copy the empty_zero_page contents to where vmlinux expects it */ + mova empty_zero_page_src, r0 + mov.l empty_zero_page_dst, r1 + mov #(PAGE_SHIFT - 4), r4 + mov #1, r3 + shld r4, r3 /* r3 = PAGE_SIZE / 16 */ + +1: + mov.l @r0, r4 + mov.l @(4, r0), r5 + mov.l @(8, r0), r6 + mov.l @(12, r0), r7 + add #16,r0 + mov.l r4, @r1 + mov.l r5, @(4, r1) + mov.l r6, @(8, r1) + mov.l r7, @(12, r1) + dt r3 + add #16,r1 + bf 1b + + /* jump to the zImage entry point located after the zero page data */ + mov #PAGE_SHIFT, r4 + mov #1, r1 + shld r4, r1 + mova empty_zero_page_src, r0 + add r1, r0 + jmp @r0 + nop + + .align 2 +empty_zero_page_dst: + .long _text +empty_zero_page_src: