71f094b65a13bb8a4c5a9693f95fd80f28b35409
[openwrt/staging/wigyori.git] / package / boot / uboot-lantiq / patches / 0018-MIPS-add-SPI-flash-init-hook.patch
1 From 888b33e84082fe72d60d528c05c885c0c9d70bc4 Mon Sep 17 00:00:00 2001
2 From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
3 Date: Tue, 6 Nov 2012 21:19:43 +0100
4 Subject: MIPS: add SPI flash init hook
5
6 Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
7
8 --- a/arch/mips/lib/board.c
9 +++ b/arch/mips/lib/board.c
10 @@ -32,6 +32,7 @@
11 #include <nand.h>
12 #include <onenand_uboot.h>
13 #include <spi.h>
14 +#include <spi_flash.h>
15
16 #ifdef CONFIG_BITBANGMII
17 #include <miiphy.h>
18 @@ -312,6 +313,16 @@ void board_init_r(gd_t *id, ulong dest_a
19 onenand_init();
20 #endif
21
22 +#ifdef CONFIG_CMD_SPI
23 + puts("SPI: ");
24 + spi_init(); /* go init the SPI */
25 + puts("ready\n");
26 +#endif
27 +
28 +#if defined(CONFIG_SPI_FLASH)
29 + spi_flash_init();
30 +#endif
31 +
32 /* relocate environment function pointers etc. */
33 env_relocate();
34
35 @@ -335,12 +346,6 @@ void board_init_r(gd_t *id, ulong dest_a
36 /* Initialize from environment */
37 load_addr = getenv_ulong("loadaddr", 16, load_addr);
38
39 -#ifdef CONFIG_CMD_SPI
40 - puts("SPI: ");
41 - spi_init(); /* go init the SPI */
42 - puts("ready\n");
43 -#endif
44 -
45 #if defined(CONFIG_MISC_INIT_R)
46 /* miscellaneous platform dependent initialisations */
47 misc_init_r();