head-shmobile.S 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. adr r0, dtb_info
  25. ldmia r0, {r1, r3, r4, r5, r7}
  26. sub r0, r0, r1 @ calculate the delta offset
  27. add r5, r5, r0 @ _edata
  28. ldr lr, [r5, #0] @ check if valid DTB is present
  29. cmp lr, r3
  30. bne 0f
  31. add r9, r7, #31 @ rounded up to a multiple
  32. bic r9, r9, #31 @ ... of 32 bytes
  33. add r6, r9, r5 @ copy from _edata
  34. add r9, r9, r4 @ to MEMORY_START
  35. 1: ldmdb r6!, {r0 - r3, r10 - r12, lr}
  36. cmp r6, r5
  37. stmdb r9!, {r0 - r3, r10 - r12, lr}
  38. bhi 1b
  39. /* Success: Zero board ID, pointer to start of memory for atag/dtb */
  40. mov r7, #0
  41. mov r8, r4
  42. b 2f
  43. .align 2
  44. dtb_info:
  45. .word dtb_info
  46. #ifndef __ARMEB__
  47. .word 0xedfe0dd0 @ sig is 0xd00dfeed big endian
  48. #else
  49. .word 0xd00dfeed
  50. #endif
  51. .word MEMORY_START
  52. .word _edata
  53. .word 0x4000 @ maximum DTB size
  54. 0:
  55. /* Failure: Zero board ID, NULL atag/dtb */
  56. mov r7, #0
  57. mov r8, #0 @ pass null pointer as atag
  58. 2 :
  59. #endif /* CONFIG_ZBOOT_ROM */