eNET_start16.S 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * (C) Copyright 2008
  3. * Graeme Russ, graeme.russ@gmail.com.
  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. /* #include <asm/ic/sc520_defs.h> */
  29. #include "config.h"
  30. #include "hardware.h"
  31. #include <asm/ic/sc520.h>
  32. .text
  33. .section .start16, "ax"
  34. .code16
  35. .globl board_init16
  36. board_init16:
  37. /* Alias MMCR to 0xdf000 */
  38. movw $0xfffc, %dx
  39. movl $0x800df0cb, %eax
  40. outl %eax, %dx
  41. /* Set ds to point to MMCR alias */
  42. movw $0xdf00, %ax
  43. movw %ax, %ds
  44. /* Map PAR for Boot Flash (BOOTCS, 512kB @ 0x380000000) */
  45. movl $(SC520_PAR14 - SC520_MMCR_BASE), %edi
  46. movl $CONFIG_SYS_SC520_BOOTCS_PAR, %eax
  47. movl %eax, (%di)
  48. /* Map PAR for LED, Hex Switches (GPCS6, 20 Bytes @ 0x1000) */
  49. movl $(SC520_PAR15 - SC520_MMCR_BASE), %edi
  50. movl $CONFIG_SYS_SC520_LLIO_PAR, %eax
  51. movl %eax, (%di)
  52. /* Disabe MMCR alias */
  53. movw $0xfffc, %dx
  54. movl $0x000000cb, %eax
  55. outl %eax, %dx
  56. jmp board_init16_ret
  57. .section .bios, "ax"
  58. .code16
  59. .globl realmode_reset
  60. .hidden realmode_reset
  61. .type realmode_reset, @function
  62. realmode_reset:
  63. /* Alias MMCR to 0xdf000 */
  64. movw $0xfffc, %dx
  65. movl $0x800df0cb, %eax
  66. outl %eax, %dx
  67. /* Set ds to point to MMCR alias */
  68. movw $0xdf00, %ax
  69. movw %ax, %ds
  70. /* issue software reset thorugh MMCR */
  71. movl $0xd72, %edi
  72. movb $0x01, %al
  73. movb %al, (%di)
  74. 1: hlt
  75. jmp 1