qemu-mips.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * (C) Copyright 2007
  3. * Vlad Lungu vlad.lungu@windriver.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. #include <common.h>
  24. #include <command.h>
  25. #include <asm/mipsregs.h>
  26. #include <asm/io.h>
  27. #include <netdev.h>
  28. phys_size_t initdram(int board_type)
  29. {
  30. /* Sdram is setup by assembler code */
  31. /* If memory could be changed, we should return the true value here */
  32. return MEM_SIZE*1024*1024;
  33. }
  34. int checkboard(void)
  35. {
  36. u32 proc_id;
  37. u32 config1;
  38. proc_id = read_c0_prid();
  39. printf("Board: Qemu -M mips CPU: ");
  40. switch (proc_id) {
  41. case 0x00018000:
  42. printf("4Kc");
  43. break;
  44. case 0x00018400:
  45. printf("4KEcR1");
  46. break;
  47. case 0x00019000:
  48. printf("4KEc");
  49. break;
  50. case 0x00019300:
  51. config1 = read_c0_config1();
  52. if (config1 & 1)
  53. printf("24Kf");
  54. else
  55. printf("24Kc");
  56. break;
  57. case 0x00019500:
  58. printf("34Kf");
  59. break;
  60. case 0x00000400:
  61. printf("R4000");
  62. break;
  63. case 0x00018100:
  64. config1 = read_c0_config1();
  65. if (config1 & 1)
  66. printf("5Kf");
  67. else
  68. printf("5Kc");
  69. break;
  70. case 0x000182a0:
  71. printf("20Kc");
  72. break;
  73. default:
  74. printf("unknown");
  75. }
  76. printf(" proc_id=0x%x\n", proc_id);
  77. return 0;
  78. }
  79. int misc_init_r(void)
  80. {
  81. set_io_port_base(0);
  82. return 0;
  83. }
  84. int board_eth_init(bd_t *bis)
  85. {
  86. return ne2k_register();
  87. }