From: Simon Horman <horms@verge.net.au>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] mmc, ARM: Add zboot from MMC support for SuperH Mobile
Date: Sun, 09 Jan 2011 23:52:27 +0000 [thread overview]
Message-ID: <20110109235224.GA3730@verge.net.au> (raw)
In-Reply-To: <20110109231239.GE31708@n2100.arm.linux.org.uk>
On Sun, Jan 09, 2011 at 11:12:39PM +0000, Russell King - ARM Linux wrote:
> On Sun, Jan 09, 2011 at 09:49:28PM +0900, Simon Horman wrote:
> > diff --git a/arch/arm/boot/compressed/head-shmobile.S b/arch/arm/boot/compressed/head-shmobile.S
> > index 30973b7..de83c5a 100644
> > --- a/arch/arm/boot/compressed/head-shmobile.S
> > +++ b/arch/arm/boot/compressed/head-shmobile.S
> > @@ -25,6 +25,37 @@
> > /* load board-specific initialization code */
> > #include <mach/zboot.h>
> >
> > +#ifdef CONFIG_ZBOOT_ROM_MMCIF
> > + /* Load image from MMC */
> > + adr sp, __tmp_stack
> > + add sp, sp, #128
>
> This can be replaced with:
>
> adr sp, __tmp_stack + 128 ?
Thanks, changed.
> > + ldr r0, __image_start
> > + ldr r1, __image_end
> > + subs r1, r1, r0
> > + ldr r0, __load_base
>
> > + mov lr, pc
> > + b mmcif_loader
>
> No need for a separate mov instruction - this will do both in one go:
> bl mmcif_loader
Also changed.
> > +
> > + /* Jump to loaded code */
> > + ldr r0, __loaded
> > + ldr r1, __image_start
> > + sub r0, r0, r1
> > + ldr r1, __load_base
> > + add pc, r0, r1
>
> *__loaded - *__image_start + *__load_base
>
> &__loaded - &_start + CONFIG_MEMORY_START + 0x02000000
>
> So this jumps to the '__loaded' label in the just loaded image - are you
> sure you want to jump to a location that contains an address rather than
> code? I think you want the two changes below to correct that.
Thanks, I have verified that your change is correct.
Actually, I'm rather unsure how my (broken) code got this far.
I suspect that I moved __tmp_stack late in the game and
forgot to re-test the code. My bad.
> > +
> > +__image_start:
> > + .long _start
> > +__image_end:
> > + .long _got_end
> > +__load_base:
> > + .long CONFIG_MEMORY_START + 0x02000000 @ Load at 32Mb into SDRAM
> > +__loaded:
> > + .long __loaded
>
> change to
> .long __continue
>
> > + .align
> > +__tmp_stack:
> > + .space 128
>
> add __continue
>
> > +#endif /* CONFIG_ZBOOT_ROM_MMCIF */
> > +
> > b 1f
> > __atags:@ tag #1
> > .long 12 @ tag->hdr.size = tag_size(tag_core);
> > diff --git a/arch/arm/boot/compressed/mmcif-sh7372.c b/arch/arm/boot/compressed/mmcif-sh7372.c
> > new file mode 100644
> > index 0000000..c54df5c
> > --- /dev/null
> > +++ b/arch/arm/boot/compressed/mmcif-sh7372.c
> > @@ -0,0 +1,87 @@
> > +/*
> > + * sh7372 MMCIF loader
> > + *
> > + * Copyright (C) 2010 Magnus Damm
> > + * Copyright (C) 2010 Simon Horman
> > + *
> > + * 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.
> > + */
> > +
> > +#include <linux/mmc/sh_mmcif.h>
> > +#include <mach/mmcif.h>
> > +
> > +#define MMCIF_BASE (void __iomem *)0xe6bd0000
> > +
> > +#define PORT84CR 0xe6050054
> > +#define PORT85CR 0xe6050055
> > +#define PORT86CR 0xe6050056
> > +#define PORT87CR 0xe6050057
> > +#define PORT88CR 0xe6050058
> > +#define PORT89CR 0xe6050059
> > +#define PORT90CR 0xe605005a
> > +#define PORT91CR 0xe605005b
> > +#define PORT92CR 0xe605005c
> > +#define PORT99CR 0xe6050063
> > +
> > +#define SMSTPCR3 0xe615013c
>
> These should also be (void __iomem *).
>
> > diff --git a/arch/arm/mach-shmobile/include/mach/mmcif-ap4eb.h b/arch/arm/mach-shmobile/include/mach/mmcif-ap4eb.h
> > new file mode 100644
> > index 0000000..c6b10ee
> > --- /dev/null
> > +++ b/arch/arm/mach-shmobile/include/mach/mmcif-ap4eb.h
> > @@ -0,0 +1,29 @@
> > +#ifndef MMCIF_AP4EB_H
> > +#define MMCIF_AP4EB_H
> > +
> > +#define PORT185CR 0xe60520b9
> > +#define PORT186CR 0xe60520ba
> > +#define PORT187CR 0xe60520bb
> > +#define PORT188CR 0xe60520bc
> > +
> > +#define PORTR191_160DR 0xe6056014
>
> Ditto.
Thanks, I've fixed these.
prev parent reply other threads:[~2011-01-09 23:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-09 12:39 [PATCH] mmc, ARM: Add zboot from MMC support for SuperH Mobile ARM Simon Horman
2011-01-09 12:49 ` Simon Horman
2011-01-09 16:12 ` [PATCH] mmc, ARM: Add zboot from MMC support for SuperH Mobile Paweł Moll
2011-01-09 22:50 ` Simon Horman
2011-01-10 10:10 ` Pawel Moll
2011-01-10 15:45 ` [PATCH] mmc, ARM: Add zboot from MMC support for SuperH Mobile ARM Paul Mundt
2011-01-10 22:41 ` [PATCH] mmc, ARM: Add zboot from MMC support for SuperH Mobile Simon Horman
2011-01-09 23:12 ` Russell King - ARM Linux
2011-01-09 23:52 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110109235224.GA3730@verge.net.au \
--to=horms@verge.net.au \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).