All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] at91sam9x5ek: Pass serial and revision tags to Linux
Date: Thu, 9 May 2013 11:18:56 +0800	[thread overview]
Message-ID: <518B15A0.9000806@atmel.com> (raw)
In-Reply-To: <CAFHsove+2GfS39EpnjMjae8tYbmANXn1MLDe5sLcOSDsT2qJ8g@mail.gmail.com>

Hi Julius,

On 5/3/2013 18:54, Julius Hemanth P wrote:
> This code is small snippet from patch
> ftp://ftp.linux4sam.org/pub/uboot/u-boot-v2010.06/u-boot-5series_1.0.patch
>
> Bug:-

I think this should not report bug, it should for compatible with old 
kernel (only for Linux 2.6.39 released on www.at91.com/linux4sam).

>   For board at91sam9x5ek, U-boot doesn't pass serial and revision tags
> to Linux kernel, hence kernel fails to identify correct revision and assumes
> as rev-A, resulting in failing to detect NAND device.
>
> This patch enables u-boot to pass serial and revision tags to Linux
> kernel, which helps Linux to detect NAND device.
>
> Signed-off-by: Julius Hemanth <juliushemanth@gmail.com>
> ---
> Changes for v2:
>          - access GPBR using c structure
>          - removed tailing 1 for #define
>          - s/Miscelaneous/Miscellaneous
>          - s/initialisations/initializations
>
>   board/atmel/at91sam9x5ek/at91sam9x5ek.c |   33 ++++++++++++++++++++++++++++++-
>   include/configs/at91sam9x5ek.h          |    5 ++++
>   2 files changed, 37 insertions(+), 1 deletions(-)

This patch can not be applied based on u-boot master branch or else on 
u-boot-atmel master branch.

Please re-generate this patch based on u-boot master branch or 
u-boot-atmel master branch.

> diff --git a/board/atmel/at91sam9x5ek/at91sam9x5ek.c
> b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
> index 8773e6f..c05bdb7 100644
> --- a/board/atmel/at91sam9x5ek/at91sam9x5ek.c
> +++ b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
> @@ -27,6 +27,7 @@
>   #include <asm/arch/at91_common.h>
>   #include <asm/arch/at91_pmc.h>
>   #include <asm/arch/at91_rstc.h>
> +#include <asm/arch/at91_gpbr.h>
>   #include <asm/arch/gpio.h>
>   #include <asm/arch/clk.h>
>   #include <lcd.h>
> @@ -48,8 +49,34 @@ DECLARE_GLOBAL_DATA_PTR;
>
>   /* ------------------------------------------------------------------------- */
>   /*
> - * Miscelaneous platform dependent initialisations
> + * Miscellaneous platform dependent initializations
>    */
> +
> +#ifdef CONFIG_LOAD_ONE_WIRE_INFO
> +static u32 system_rev;
> +static u32 system_serial_low;
> +
> +u32 get_board_rev(void)
> +{
> +       return system_rev;
> +}
> +
> +void get_board_serial(struct tag_serialnr *serialnr)
> +{
> +       serialnr->high = 0; /* Not used */
> +       serialnr->low = system_serial_low;
> +}
> +
> +void load_1wire_info(void)
> +{
> +       at91_gpbr_t *gpbr = (at91_gpbr_t *) ATMEL_BASE_GPBR;
> +
> +       /* serial is in GPBR #2 and revision is in GPBR #3 */
> +       system_serial_low = readl(gpbr->reg[2]);
> +       system_rev = readl(gpbr->reg[3]);
> +}

This is wrong which will cause u-boot hang up. It should be:

system_serial_low = readl(&gpbr->reg[2]);
system_rev = readl(&gpbr->reg[3]);

Best Regards,
Bo Shen

  reply	other threads:[~2013-05-09  3:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-03 10:54 [U-Boot] [PATCH v2] at91sam9x5ek: Pass serial and revision tags to Linux Julius Hemanth P
2013-05-09  3:18 ` Bo Shen [this message]
2013-05-09  7:02   ` Julius Hemanth P

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=518B15A0.9000806@atmel.com \
    --to=voice.shen@atmel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.