AmigaOneG3SE.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * (C) Copyright 2002
  3. * Hyperion Entertainment, ThomasF@hyperion-entertainment.com
  4. * (C) Copyright 2006
  5. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #include <common.h>
  26. #include <command.h>
  27. #include <pci.h>
  28. #include "articiaS.h"
  29. #include "memio.h"
  30. #include "via686.h"
  31. __asm__(" .globl send_kb \n "
  32. "send_kb: \n "
  33. " lis r9, 0xfe00 \n "
  34. " \n "
  35. " li r4, 0x10 # retries \n "
  36. " mtctr r4 \n "
  37. " \n "
  38. "idle: \n "
  39. " lbz r4, 0x64(r9) \n "
  40. " andi. r4, r4, 0x02 \n "
  41. " bne idle \n "
  42. "ready: \n "
  43. " stb r3, 0x60(r9) \n "
  44. " \n "
  45. "check: \n "
  46. " lbz r4, 0x64(r9) \n "
  47. " andi. r4, r4, 0x01 \n "
  48. " beq check \n "
  49. " \n "
  50. " lbz r4, 0x60(r9) \n "
  51. " cmpwi r4, 0xfa \n "
  52. " beq done \n "
  53. " bdnz idle \n "
  54. " li r3, 0 \n "
  55. " blr \n "
  56. "done: \n "
  57. " li r3, 1 \n "
  58. " blr \n "
  59. ".globl test_kb \n "
  60. "test_kb: \n "
  61. " mflr r10 \n "
  62. " li r3, 0xed \n "
  63. " bl send_kb \n "
  64. " li r3, 0x01 \n "
  65. " bl send_kb \n "
  66. " mtlr r10 \n "
  67. " blr "
  68. );
  69. int checkboard (void)
  70. {
  71. printf ("Board: AmigaOneG3SE\n");
  72. return 0;
  73. }
  74. long initdram (int board_type)
  75. {
  76. return articiaS_ram_init ();
  77. }
  78. void after_reloc (ulong dest_addr, gd_t *gd)
  79. {
  80. board_init_r (gd, dest_addr);
  81. }
  82. int misc_init_r (void)
  83. {
  84. extern pci_dev_t video_dev;
  85. extern void drv_video_init (void);
  86. if (video_dev != ~0)
  87. drv_video_init ();
  88. return (0);
  89. }
  90. void pci_init_board (void)
  91. {
  92. #ifndef CONFIG_RAMBOOT
  93. articiaS_pci_init ();
  94. #endif
  95. }