eNET_start16.S 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. /* Disable SDRAM write buffer */
  53. movw $(SC520_DBCTL - SC520_MMCR_BASE), %di
  54. xorw %ax, %ax
  55. movb %al, (%di)
  56. /* Disabe MMCR alias */
  57. movw $0xfffc, %dx
  58. movl $0x000000cb, %eax
  59. outl %eax, %dx
  60. jmp board_init16_ret
  61. .section .bios, "ax"
  62. .code16
  63. .globl realmode_reset
  64. .hidden realmode_reset
  65. .type realmode_reset, @function
  66. realmode_reset:
  67. /* Alias MMCR to 0xdf000 */
  68. movw $0xfffc, %dx
  69. movl $0x800df0cb, %eax
  70. outl %eax, %dx
  71. /* Set ds to point to MMCR alias */
  72. movw $0xdf00, %ax
  73. movw %ax, %ds
  74. /* issue software reset thorugh MMCR */
  75. movl $0xd72, %edi
  76. movb $0x01, %al
  77. movb %al, (%di)
  78. 1: hlt
  79. jmp 1