0018-MIPS-add-SPI-flash-init-hook.patch 1.2 KB

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