spl.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * (C) Copyright 2010
  3. * Texas Instruments, <www.ti.com>
  4. *
  5. * Aneesh V <aneesh@ti.com>
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #include <common.h>
  26. #include <asm/u-boot.h>
  27. #include <asm/arch/sys_proto.h>
  28. #include <timestamp_autogenerated.h>
  29. #include <version_autogenerated.h>
  30. DECLARE_GLOBAL_DATA_PTR;
  31. /* Define global data structure pointer to it*/
  32. static gd_t gdata __attribute__ ((section(".data")));
  33. static bd_t bdata __attribute__ ((section(".data")));
  34. inline void hang(void)
  35. {
  36. puts("### ERROR ### Please RESET the board ###\n");
  37. for (;;)
  38. ;
  39. }
  40. void board_init_f(ulong dummy)
  41. {
  42. /*
  43. * We call relocate_code() with relocation target same as the
  44. * CONFIG_SYS_SPL_TEXT_BASE. This will result in relocation getting
  45. * skipped. Instead, only .bss initialization will happen. That's
  46. * all we need
  47. */
  48. debug(">>board_init_f()\n");
  49. relocate_code(CONFIG_SPL_STACK, &gdata, CONFIG_SPL_TEXT_BASE);
  50. }
  51. void board_init_r(gd_t *id, ulong dummy)
  52. {
  53. for (;;)
  54. ;
  55. }
  56. void preloader_console_init(void)
  57. {
  58. const char *u_boot_rev = U_BOOT_VERSION;
  59. char rev_string_buffer[50];
  60. gd = &gdata;
  61. gd->bd = &bdata;
  62. gd->flags |= GD_FLG_RELOC;
  63. gd->baudrate = CONFIG_BAUDRATE;
  64. setup_clocks_for_console();
  65. serial_init(); /* serial communications setup */
  66. /* Avoid a second "U-Boot" coming from this string */
  67. u_boot_rev = &u_boot_rev[7];
  68. printf("\nU-Boot SPL %s (%s - %s)\n", u_boot_rev, U_BOOT_DATE,
  69. U_BOOT_TIME);
  70. omap_rev_string(rev_string_buffer);
  71. printf("Texas Instruments %s\n", rev_string_buffer);
  72. }