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