mips: If CONFIG_CMD_SPI is defined, call spi_init()
PATCH 1/1 mips: If CONFIG_CMD_SPI is defined, call spi_init()
The mips architecture currently does not call 'spi_init()' in the generic board initialization routine is CONFIG_CMD_SPI is defined.
This patch rectifies that problem.
--- lib_mips/board.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
lib_mips/board.c +7 -0
@@ -29,6 +29,7 @@#include <net.h> #include <environment.h> #include <nand.h> +#include <spi.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -422,6 +423,12 @@ void board_init_r (gd_t *id, ulong dest_addr)nand_init ();/* go init the NAND */ #endif +#ifdef CONFIG_CMD_SPI +puts ("SPI: " ); +spi_init ();/* go init the SPI */ +puts ("ready\n" ); +#endif +#if defined(CONFIG_MISC_INIT_R )/* miscellaneous platform dependent initialisations */ misc_init_r ();
Signature · 1 line
1.5.4.3
PATCH 1/1 mips: If CONFIG_CMD_SPI is defined, call spi_init()
Quoted 7 lines · Jason McMullan
The mips architecture currently does not call '
spi_init()' in the generic board initialization routine isCONFIG_CMD_SPIis defined.This patch rectifies that problem.
Signed-off-by Jason McMullan <[email protected]>
Applied with two CodingStyle fixes. See below.
lib_mips/board.c void board_init_r (gd_t *id, ulong dest_addr) · line 427
Quoted 6 lines
lib_mips/board.c +2
-0@@ -422,6 +423,12 @@ void board_init_r (gd_t *id, ulong dest_addr)nand_init ();/* go init the NAND */ #endif +#ifdef CONFIG_CMD_SPI +puts ("SPI: " );
^
lib_mips/board.c void board_init_r (gd_t *id, ulong dest_addr) · line 428
Quoted 1 line
lib_mips/board.c +1
-0+spi_init ();/* go init the SPI */
^
lib_mips/board.c void board_init_r (gd_t *id, ulong dest_addr) · line 434
Quoted 6 lines
lib_mips/board.c +3
-0+puts ("ready\n" ); +#endif +#if defined(CONFIG_MISC_INIT_R )/* miscellaneous platform dependent initialisations */ misc_init_r ();
Note that I'm Linux's CodingStyle lover. But in this case, we should use the same CodingStyle in a single file.
Thanks,
Shinya