spl_boot.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Freescale i.MX28 Boot setup
  3. *
  4. * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
  5. * on behalf of DENX Software Engineering GmbH
  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 <config.h>
  27. #include <asm/io.h>
  28. #include <asm/arch/iomux-mx28.h>
  29. #include <asm/arch/imx-regs.h>
  30. #include "mx28_init.h"
  31. /*
  32. * This delay function is intended to be used only in early stage of boot, where
  33. * clock are not set up yet. The timer used here is reset on every boot and
  34. * takes a few seconds to roll. The boot doesn't take that long, so to keep the
  35. * code simple, it doesn't take rolling into consideration.
  36. */
  37. #define HW_DIGCTRL_MICROSECONDS 0x8001c0c0
  38. void early_delay(int delay)
  39. {
  40. uint32_t st = readl(HW_DIGCTRL_MICROSECONDS);
  41. st += delay;
  42. while (st > readl(HW_DIGCTRL_MICROSECONDS))
  43. ;
  44. }
  45. void mx28_common_spl_init(const iomux_cfg_t *iomux_setup,
  46. const unsigned int iomux_size)
  47. {
  48. mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
  49. mx28_power_init();
  50. mx28_mem_init();
  51. mx28_power_wait_pswitch();
  52. }
  53. /* Support aparatus */
  54. inline void board_init_f(unsigned long bootflag)
  55. {
  56. for (;;)
  57. ;
  58. }
  59. inline void board_init_r(gd_t *id, ulong dest_addr)
  60. {
  61. for (;;)
  62. ;
  63. }
  64. void serial_putc(const char c) {}
  65. void serial_puts(const char *s) {}
  66. void hang(void) __attribute__ ((noreturn));
  67. void hang(void)
  68. {
  69. for (;;)
  70. ;
  71. }