qemu-mips.c 1.9 KB

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