You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

91 lines
2.7 KiB

  1. /*
  2. #####ECOSGPLCOPYRIGHTBEGIN####
  3. ## -------------------------------------------
  4. ## This file is part of eCos, the Embedded Configurable Operating System.
  5. ## Copyright (C) 2008 √ėyvind Harboe
  6. ##
  7. ## eCos is free software; you can redistribute it and/or modify it under
  8. ## the terms of the GNU General Public License as published by the Free
  9. ## Software Foundation; either version 2 or (at your option) any later version.
  10. ##
  11. ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
  12. ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  14. ## for more details.
  15. ##
  16. ## You should have received a copy of the GNU General Public License along
  17. ## with eCos; if not, write to the Free Software Foundation, Inc.,
  18. ## 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  19. ##
  20. ## As a special exception, if other files instantiate templates or use macros
  21. ## or inline functions from this file, or you compile this file and link it
  22. ## with other works to produce a work based on this file, this file does not
  23. ## by itself cause the resulting work to be covered by the GNU General Public
  24. ## License. However the source code for this file must still be made available
  25. ## in accordance with section (3) of the GNU General Public License.
  26. ##
  27. ## This exception does not invalidate any other reasons why a work based on
  28. ## this file might be covered by the GNU General Public License.
  29. ## -------------------------------------------
  30. #####ECOSGPLCOPYRIGHTEND####
  31. */
  32. /*
  33. Jump table for flash driver
  34. Registers in ARM callling convention is to place args in registers
  35. starting at r0.
  36. So for:
  37. void foo(int a, int b, int c).
  38. a=r0
  39. b=r1
  40. c=r2
  41. */
  42. .global _stack_base
  43. .global _stack_start
  44. .global _workarea
  45. .global _start
  46. .global _start_bss_clear
  47. _start:
  48. // offset=0
  49. // int erase(void *address, int len)
  50. ldr sp,=_stack_start
  51. bl erase
  52. nop // Stop CPU here using hw breakpoint
  53. // offset=0xc
  54. // int program(void *buffer, void *address, int len)
  55. ldr sp,=_stack_start
  56. bl program
  57. nop // Stop CPU here using hw breakpoint
  58. // offset=0x18
  59. ldr r0,=_workarea
  60. nop // Stop CPU here using hw breakpoint
  61. // offset=0x20
  62. // int init() - returns error message if the flash chip can't be detected
  63. ldr sp,=_stack_start
  64. bl init
  65. nop // Stop CPU here using hw breakpoint
  66. .section ".bss"
  67. .balign 4
  68. _stack_base:
  69. .rept 4096
  70. .byte 0
  71. .endr
  72. _stack_start:
  73. .balign 4
  74. _workarea:
  75. .rept 8192
  76. .byte 0
  77. .endr
  78. // NB!!! we clear bss while the stack is in use, so we start BSS clearing here !!! :-)
  79. _start_bss_clear: