AmigaOneG3SE.c 3.3 KB

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