at91sam9x5ek: Pass serial and revision tags to Linux
PATCH 1/1 at91sam9x5ek: Pass serial and revision tags to Linux
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.
This patch enables u-boot to pass serial and revision tags to Linux kernel, which helps Linux to detect NAND device.
--- board/atmel/at91sam9x5ek/at91sam9x5ek.c | 28 ++++++++++++++++++++++++++++ include/configs/at91sam9x5ek.h | 7 +++++++ 2 files changed, 35 insertions(+)
(quoted diff) +0 -0
b/board/atmel/at91sam9x5ek/at91sam9x5ek.c
index 8773e6f..43a55e4 100644
board/atmel/at91sam9x5ek/at91sam9x5ek.c +28 -0
@@ -50,6 +50,30 @@ DECLARE_GLOBAL_DATA_PTR;/* * Miscelaneous platform dependent initialisations */ + +#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 ); +} +#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
include/configs/at91sam9x5ek.h +7 -0
@@ -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 +#define CONFIG_SKIP_LOWLEVEL_INIT #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_DISPLAY_CPUINFO
--
1.7.9.5
PATCH 1/1 at91sam9x5ek: Pass serial and revision tags to Linux
Quoted 12 lines · Julius Hemanth P
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.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 <[email protected]>
[snip]
include/configs/at91sam9x5ek.h line 46
Quoted 5 lines
include/configs/at91sam9x5ek.h +5
-0+#define CONFIG_LOAD_ONE_WIRE_INFO 1 +#ifdef CONFIG_LOAD_ONE_WIRE_INFO +#define CONFIG_REVISION_TAG 1 +#define CONFIG_SERIAL_TAG 1 +#endif
No trailing '1' and you don't need the ifdef right after you set it in this case. Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130425/5005d1f7/attachment.pgp>
PATCH 1/1 at91sam9x5ek: Pass serial and revision tags to Linux
In reply to Julius Hemanth PHi Julius,
Quoted 7 lines · Julius Hemanth P
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.
Quoted 15 lines
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 <[email protected]>--- board/atmel/at91sam9x5ek/at91sam9x5ek.c | 28 ++++++++++++++++++++++++++++ include/configs/at91sam9x5ek.h | 7 +++++++ 2 files changed, 35 insertions(+)board/atmel/at91sam9x5ek/at91sam9x5ek.c +0
-0
board/atmel/at91sam9x5ek/at91sam9x5ek.c DECLARE_GLOBAL_DATA_PTR; · line 52
Quoted 3 lines
board/atmel/at91sam9x5ek/at91sam9x5ek.c +0
-0@@ -50,6 +50,30 @@ DECLARE_GLOBAL_DATA_PTR;/* * Miscelaneous platform dependent initialisations */
s/Miscelaneous/Miscellaneous
s/initialisations/initializations
Quoted 11 lines
board/atmel/at91sam9x5ek/at91sam9x5ek.c +11
-0+ +#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)
board/atmel/at91sam9x5ek/at91sam9x5ek.c DECLARE_GLOBAL_DATA_PTR; · line 73
Quoted 10 lines
board/atmel/at91sam9x5ek/at91sam9x5ek.c +10
-0+{ + 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.
Quoted 22 lines
board/atmel/at91sam9x5ek/at91sam9x5ek.c +7
-0+} +#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 include/configs/at91sam9x5ek.h +0
-0
include/configs/at91sam9x5ek.h line 46
Quoted 9 lines
include/configs/at91sam9x5ek.h +6
-0@@ -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.
Quoted 11 lines
include/configs/at91sam9x5ek.h +1
-1+#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
PATCH 1/1 at91sam9x5ek: Pass serial and revision tags to Linux
Thanks Bo and Tom.
I shall modify patch as suggested and will send it again.
Quoted 127 lines · Bo Shen
Hi Julius,
Quoted 9 lines · Julius Hemanth P
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.
Quoted 16 lines
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 <[email protected]>--- board/atmel/at91sam9x5ek/at91sam9x5ek.c | 28 ++++++++++++++++++++++++++++ include/configs/at91sam9x5ek.h | 7 +++++++ 2 files changed, 35 insertions(+)board/atmel/at91sam9x5ek/at91sam9x5ek.c +0
-0board/atmel/at91sam9x5ek/at91sam9x5ek.c DECLARE_GLOBAL_DATA_PTR; · line 52
Quoted 3 lines
board/atmel/at91sam9x5ek/at91sam9x5ek.c +0
-0@@ -50,6 +50,30 @@ DECLARE_GLOBAL_DATA_PTR;/* * Miscelaneous platform dependent initialisations */ s/Miscelaneous/Miscellaneous
s/initialisations/initializationsQuoted 11 lines
board/atmel/at91sam9x5ek/at91sam9x5ek.c +11
-0+ +#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)board/atmel/at91sam9x5ek/at91sam9x5ek.c DECLARE_GLOBAL_DATA_PTR; · line 73
Quoted 10 lines
board/atmel/at91sam9x5ek/at91sam9x5ek.c +10
-0+{ + 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.
Quoted 23 lines
board/atmel/at91sam9x5ek/at91sam9x5ek.c +7
-0+} +#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 include/configs/at91sam9x5ek.h +0
-0include/configs/at91sam9x5ek.h line 46
Quoted 9 lines
include/configs/at91sam9x5ek.h +6
-0@@ -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.
Quoted 11 lines
include/configs/at91sam9x5ek.h +1
-1+#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-bootBest Regards,
Bo Shen