From: Bo Shen <voice.shen@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] at91sam9x5ek: Pass serial and revision tags to Linux
Date: Fri, 26 Apr 2013 09:50:48 +0800 [thread overview]
Message-ID: <5179DD78.5050204@atmel.com> (raw)
In-Reply-To: <CAFHsovdgwvDLLozTRiZvV=whf=fGkKkyDTuhR_4Qq3YKj77=uQ@mail.gmail.com>
Hi Julius,
On 4/25/2013 13:59, 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:-
> 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.
It won't have issue work with mainline Linux kernel for at91sam9x5.
Actually, this only occur when mainline u-boot work with the Linux
kernel we released based on 2.6.39 (This is almost two years old). So,
for customer we suggest them upgrade the Linux kernel.
For compatible issue, add this won't hurt. Temporary, we can accept it.
if the GPBR will use for other function in future, this will be removed.
> 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>
> ---
> board/atmel/at91sam9x5ek/at91sam9x5ek.c | 28 ++++++++++++++++++++++++++++
> include/configs/at91sam9x5ek.h | 7 +++++++
> 2 files changed, 35 insertions(+)
>
> diff --git a/board/atmel/at91sam9x5ek/at91sam9x5ek.c
> b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
> index 8773e6f..43a55e4 100644
> --- a/board/atmel/at91sam9x5ek/at91sam9x5ek.c
> +++ b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
> @@ -50,6 +50,30 @@ DECLARE_GLOBAL_DATA_PTR;
> /*
> * Miscelaneous platform dependent initialisations
> */
s/Miscelaneous/Miscellaneous
s/initialisations/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)
> +{
> + /* serial is in GPBR #2 and revision is in GPBR #3 */
> + system_serial_low = readl(ATMEL_BASE_GPBR + 4 * 2);
> + system_rev = readl(ATMEL_BASE_GPBR + 4 * 3);
Please use c structure to access it.
> +}
> +#endif
> +
> #ifdef CONFIG_CMD_NAND
> static void at91sam9x5ek_nand_hw_init(void)
> {
> @@ -282,6 +306,10 @@ int board_init(void)
> /* adress of boot parameters */
> gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
>
> +#ifdef CONFIG_LOAD_ONE_WIRE_INFO
> + load_1wire_info();
> +#endif
> +
> #ifdef CONFIG_CMD_NAND
> at91sam9x5ek_nand_hw_init();
> #endif
> diff --git a/include/configs/at91sam9x5ek.h b/include/configs/at91sam9x5ek.h
> index ee6e3fc..b6236b8 100644
> --- a/include/configs/at91sam9x5ek.h
> +++ b/include/configs/at91sam9x5ek.h
> @@ -38,6 +38,13 @@
> #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
> #define CONFIG_SETUP_MEMORY_TAGS
> #define CONFIG_INITRD_TAG
> +
> +#define CONFIG_LOAD_ONE_WIRE_INFO 1
> +#ifdef CONFIG_LOAD_ONE_WIRE_INFO
> +#define CONFIG_REVISION_TAG 1
> +#define CONFIG_SERIAL_TAG 1
> +#endif
Address Tom Rini's comments.
> +
> #define CONFIG_SKIP_LOWLEVEL_INIT
> #define CONFIG_BOARD_EARLY_INIT_F
> #define CONFIG_DISPLAY_CPUINFO
> --
> 1.7.9.5
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
Best Regards,
Bo Shen
next prev parent reply other threads:[~2013-04-26 1:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-25 5:59 [U-Boot] [PATCH] at91sam9x5ek: Pass serial and revision tags to Linux Julius Hemanth P
2013-04-25 15:47 ` Tom Rini
2013-04-26 1:50 ` Bo Shen [this message]
2013-04-26 8:33 ` 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=5179DD78.5050204@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox