head-shmobile.S 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * The head-file for SH-Mobile ARM platforms
  3. *
  4. * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
  5. * Simon Horman <horms@verge.net.au>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; version 2 of the License.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifdef CONFIG_ZBOOT_ROM
  21. .section ".start", "ax"
  22. /* load board-specific initialization code */
  23. #include <mach/zboot.h>
  24. #if defined(CONFIG_ZBOOT_ROM_MMCIF) || defined(CONFIG_ZBOOT_ROM_SH_MOBILE_SDHI)
  25. /* Load image from MMC/SD */
  26. adr sp, __tmp_stack + 256
  27. ldr r0, __image_start
  28. ldr r1, __image_end
  29. subs r1, r1, r0
  30. ldr r0, __load_base
  31. bl mmc_loader
  32. /* Jump to loaded code */
  33. ldr r0, __loaded
  34. ldr r1, __image_start
  35. sub r0, r0, r1
  36. ldr r1, __load_base
  37. add pc, r0, r1
  38. __image_start:
  39. .long _start
  40. __image_end:
  41. .long _got_end
  42. __load_base:
  43. .long CONFIG_MEMORY_START + 0x02000000 @ Load at 32Mb into SDRAM
  44. __loaded:
  45. .long __continue
  46. .align
  47. __tmp_stack:
  48. .space 256
  49. __continue:
  50. #endif /* CONFIG_ZBOOT_ROM_MMC || CONFIG_ZBOOT_ROM_SH_MOBILE_SDHI */
  51. b 1f
  52. __atags:@ tag #1
  53. .long 12 @ tag->hdr.size = tag_size(tag_core);
  54. .long 0x54410001 @ tag->hdr.tag = ATAG_CORE;
  55. .long 0 @ tag->u.core.flags = 0;
  56. .long 0 @ tag->u.core.pagesize = 0;
  57. .long 0 @ tag->u.core.rootdev = 0;
  58. @ tag #2
  59. .long 8 @ tag->hdr.size = tag_size(tag_mem32);
  60. .long 0x54410002 @ tag->hdr.tag = ATAG_MEM;
  61. .long CONFIG_MEMORY_SIZE @ tag->u.mem.size = CONFIG_MEMORY_SIZE;
  62. .long CONFIG_MEMORY_START @ @ tag->u.mem.start = CONFIG_MEMORY_START;
  63. @ tag #3
  64. .long 0 @ tag->hdr.size = 0
  65. .long 0 @ tag->hdr.tag = ATAG_NONE;
  66. 1:
  67. /* Set board ID necessary for boot */
  68. ldr r7, 1f @ Set machine type register
  69. adr r8, __atags @ Set atag register
  70. b 2f
  71. 1 : .long MACH_TYPE
  72. 2 :
  73. #endif /* CONFIG_ZBOOT_ROM */