eNET_start16.S 2.1 KB

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