AmigaOneG3SE.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 <netdev.h>
  29. #include "articiaS.h"
  30. #include "memio.h"
  31. #include "via686.h"
  32. __asm__(" .globl send_kb \n "
  33. "send_kb: \n "
  34. " lis r9, 0xfe00 \n "
  35. " \n "
  36. " li r4, 0x10 # retries \n "
  37. " mtctr r4 \n "
  38. " \n "
  39. "idle: \n "
  40. " lbz r4, 0x64(r9) \n "
  41. " andi. r4, r4, 0x02 \n "
  42. " bne idle \n "
  43. "ready: \n "
  44. " stb r3, 0x60(r9) \n "
  45. " \n "
  46. "check: \n "
  47. " lbz r4, 0x64(r9) \n "
  48. " andi. r4, r4, 0x01 \n "
  49. " beq check \n "
  50. " \n "
  51. " lbz r4, 0x60(r9) \n "
  52. " cmpwi r4, 0xfa \n "
  53. " beq done \n "
  54. " bdnz idle \n "
  55. " li r3, 0 \n "
  56. " blr \n "
  57. "done: \n "
  58. " li r3, 1 \n "
  59. " blr \n "
  60. ".globl test_kb \n "
  61. "test_kb: \n "
  62. " mflr r10 \n "
  63. " li r3, 0xed \n "
  64. " bl send_kb \n "
  65. " li r3, 0x01 \n "
  66. " bl send_kb \n "
  67. " mtlr r10 \n "
  68. " blr \n "
  69. );
  70. int checkboard (void)
  71. {
  72. printf ("Board: AmigaOneG3SE\n");
  73. return 0;
  74. }
  75. phys_size_t initdram (int board_type)
  76. {
  77. return articiaS_ram_init ();
  78. }
  79. void after_reloc (ulong dest_addr, gd_t *gd)
  80. {
  81. board_init_r (gd, dest_addr);
  82. }
  83. int misc_init_r (void)
  84. {
  85. extern pci_dev_t video_dev;
  86. extern void drv_video_init (void);
  87. if (video_dev != ~0)
  88. drv_video_init ();
  89. return (0);
  90. }
  91. void pci_init_board (void)
  92. {
  93. #ifndef CONFIG_RAMBOOT
  94. articiaS_pci_init ();
  95. #endif
  96. }
  97. int board_eth_init(bd_t *bis)
  98. {
  99. #if defined(CONFIG_3COM)
  100. eth_3com_initialize(bis);
  101. #endif
  102. return 0;
  103. }