Skip to contentSkip to conversation

mips: If CONFIG_CMD_SPI is defined, call spi_init()

PATCH New Jason McMullan 2 participants 2 messages May 21, 2008 – May 22, 2008

lore
Share & tools
lore
#0 lore raw

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
index e33070d..be04f8d 100644
@@ -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
#1 lore raw

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 is CONFIG_CMD_SPI is defined.

This patch rectifies that problem.

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