public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Gabor Juhos <juhosg@openwrt.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] MIPS: start.S: unify and simplify reset vector handling
Date: Thu, 31 Jan 2013 11:35:06 +0100	[thread overview]
Message-ID: <510A48DA.3020806@openwrt.org> (raw)
In-Reply-To: <1359591991-15156-1-git-send-email-daniel.schwierzeck@gmail.com>

Hi Daniel,

> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> 
> Adopt reset vector handling from Yamon.
> 
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> ---
>  arch/mips/cpu/mips32/start.S | 185 +++++++++----------------------------------
>  arch/mips/cpu/mips64/start.S |  55 +++++++------
>  2 files changed, 64 insertions(+), 176 deletions(-)
> 
> diff --git a/arch/mips/cpu/mips32/start.S b/arch/mips/cpu/mips32/start.S
> index 65acf7d..a7cd2c4 100644
> --- a/arch/mips/cpu/mips32/start.S
> +++ b/arch/mips/cpu/mips32/start.S
> @@ -47,19 +47,16 @@
>  	.set	pop
>  	.endm
>  
> -#define RVECENT(f,n) \
> -   b f; nop
> -#define XVECENT(f,bev) \
> -   b f     ;           \
> -   li k0,bev
> -
>  	.set noreorder
>  
>  	.globl _start
>  	.text
>  _start:
> -	RVECENT(reset,0)			# U-boot entry point
> -	RVECENT(reset,1)			# software reboot
> +	/* U-boot entry point */
> +	b	reset
> +	 nop
> +	 nop
> +	 nop
>  #ifdef CONFIG_SYS_XWAY_EBU_BOOTCFG

We should use '.org 0x010' here, that would make it it consistent with the rest
of the code. Additionally, that would make it possible to remove the last two
'nop' instructions before the ifdef.

>  	/*
>  	 * Almost all Lantiq XWAY SoC devices have an external bus unit (EBU) to
> @@ -71,139 +68,40 @@ _start:
>  	.word CONFIG_SYS_XWAY_EBU_BOOTCFG
>  	.word 0x00000000
>  #else
> -	RVECENT(romReserved,2)
> +	.word 0xffffffff
> +	.word 0xffffffff

I assume that Yamon uses these two words to ensure that there will be no
instructions at this address because this overlaps with the REVISION register on
the MIPS boards. U-Boot does not support MIPS development boards yet, so
strictly speaking we don't need this at the moment.

>  #endif

<...>

> -	/*
> -	 * We hope there are no more reserved vectors!
> -	 * 128 * 8 == 1024 == 0x400
> -	 * so this is address R_VEC+0x400 == 0xbfc00400
> -	 */
> +.org 0x200

The indentation of this looks weird. All other pseudo op-codes are preceded by a
tab. It would be more consistent to add a tab before each '.org'.

> +	/* TLB refill, 32 bit task */
> +1:	b	1b
> +	 nop

<...>

> diff --git a/arch/mips/cpu/mips64/start.S b/arch/mips/cpu/mips64/start.S
> index 1522594..0628211 100644
> --- a/arch/mips/cpu/mips64/start.S
> +++ b/arch/mips/cpu/mips64/start.S
> @@ -52,40 +52,44 @@
>  	.globl _start
>  	.text
>  _start:
> -	.org 0x000
> +	/* U-boot entry point */
>  	b	reset
>  	 nop
> -	.org 0x080
> -	b	romReserved
>  	 nop
> -	.org 0x100
> -	b	romReserved
>  	 nop
> -	.org 0x180
> -	b	romReserved
> +	.word 0xffffffff
> +	.word 0xffffffff

These two words and the preceding two nop instructions should be removed as well.

> +
> +.org 0x200
> +	/* TLB refill, 32 bit task */
> +1:	b	1b
>  	 nop
> -	.org 0x200

The previous comment for the '.org' op-codes applies here as well. Even the
patch would be a bit simpler if you would not remove the leading tabs.

-Gabor

  reply	other threads:[~2013-01-31 10:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-31  0:26 [U-Boot] [PATCH] MIPS: start.S: unify and simplify reset vector handling daniel.schwierzeck at gmail.com
2013-01-31 10:35 ` Gabor Juhos [this message]
2013-02-01 20:48   ` Daniel Schwierzeck
2013-02-01 20:55 ` [U-Boot] [PATCH v2] " daniel.schwierzeck at gmail.com
2013-02-01 22:17   ` Gabor Juhos
2013-02-01 22:48     ` Daniel Schwierzeck
2013-02-01 23:16       ` Langer Thomas
2013-02-02  0:44       ` Gabor Juhos

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=510A48DA.3020806@openwrt.org \
    --to=juhosg@openwrt.org \
    --cc=u-boot@lists.denx.de \
    /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