sc520_cdp_asm16.S 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * (C) Copyright 2002
  3. * Daniel Engström, Omicron Ceti AB <daniel@omicron.se>.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. /*
  24. * 16bit initialization code.
  25. * This code have to map the area of the boot flash
  26. * that is used by U-boot to its final destination.
  27. */
  28. .text
  29. .section .start16, "ax"
  30. .code16
  31. .globl board_init16
  32. board_init16:
  33. /* Alias MMCR to 0xdf000 */
  34. movw $0xfffc, %dx
  35. movl $0x800df0cb, %eax
  36. outl %eax, %dx
  37. /* Set ds to point to MMCR alias */
  38. movw $0xdf00, %ax
  39. movw %ax, %ds
  40. /* Map the entire flash at 0x38000000
  41. * (with BOOTCS and PAR14, use 0xabfff800 for ROMCS1) */
  42. movl $0xc0, %edi
  43. movl $0x8bfff800, %eax
  44. movl %eax, (%di)
  45. /* Disable SDRAM write buffer */
  46. movw $0x40,%di
  47. xorw %ax,%ax
  48. movb %al, (%di)
  49. /* Disabe MMCR alias */
  50. movw $0xfffc, %dx
  51. movl $0x000000cb, %eax
  52. outl %eax, %dx
  53. /* the return address is tored in bp */
  54. jmp *%bp