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