Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2007 |
Vlad Lungu | 045b4d2 | 2008-05-05 14:20:03 +0300 | [diff] [blame] | 3 | * Vlad Lungu vlad.lungu@windriver.com |
Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 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 | |
Becky Bruce | 9973e3c | 2008-06-09 16:03:40 -0500 | [diff] [blame] | 29 | phys_size_t initdram(int board_type) |
Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 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 | |
Shinya Kuribayashi | e2ad842 | 2008-05-30 00:53:38 +0900 | [diff] [blame] | 41 | proc_id = read_c0_prid(); |
Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 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: |
Shinya Kuribayashi | e2ad842 | 2008-05-30 00:53:38 +0900 | [diff] [blame] | 54 | config1 = read_c0_config1(); |
Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 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: |
Shinya Kuribayashi | e2ad842 | 2008-05-30 00:53:38 +0900 | [diff] [blame] | 67 | config1 = read_c0_config1(); |
Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 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 | } |