blob: 2638ea67d3b0a177b8427549242f09fe72c35aa3 [file] [log] [blame]
Vlad Lungu635e76c2008-01-16 19:27:51 +02001/*
2 * (C) Copyright 2007
Vlad Lungu3987beb2008-05-05 14:20:03 +03003 * Vlad Lungu vlad.lungu@windriver.com
Vlad Lungu635e76c2008-01-16 19:27:51 +02004 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Vlad Lungu635e76c2008-01-16 19:27:51 +02006 */
7
8#include <common.h>
9#include <command.h>
10#include <asm/mipsregs.h>
11#include <asm/io.h>
Bernhard Kaindladb18ea2011-10-20 10:56:59 +000012#include <netdev.h>
Vlad Lungu635e76c2008-01-16 19:27:51 +020013
Simon Glass39f90ba2017-03-31 08:40:25 -060014DECLARE_GLOBAL_DATA_PTR;
15
16int initdram(void)
Vlad Lungu635e76c2008-01-16 19:27:51 +020017{
18 /* Sdram is setup by assembler code */
19 /* If memory could be changed, we should return the true value here */
Simon Glass39f90ba2017-03-31 08:40:25 -060020 gd->ram_size = MEM_SIZE * 1024 * 1024;
21
22 return 0;
Vlad Lungu635e76c2008-01-16 19:27:51 +020023}
24
25int checkboard(void)
26{
27 u32 proc_id;
28 u32 config1;
29
Shinya Kuribayashi0fdd27e2008-05-30 00:53:38 +090030 proc_id = read_c0_prid();
Vlad Lungu635e76c2008-01-16 19:27:51 +020031 printf("Board: Qemu -M mips CPU: ");
32 switch (proc_id) {
33 case 0x00018000:
34 printf("4Kc");
35 break;
36 case 0x00018400:
37 printf("4KEcR1");
38 break;
39 case 0x00019000:
40 printf("4KEc");
41 break;
42 case 0x00019300:
Shinya Kuribayashi0fdd27e2008-05-30 00:53:38 +090043 config1 = read_c0_config1();
Vlad Lungu635e76c2008-01-16 19:27:51 +020044 if (config1 & 1)
45 printf("24Kf");
46 else
47 printf("24Kc");
48 break;
49 case 0x00019500:
50 printf("34Kf");
51 break;
52 case 0x00000400:
53 printf("R4000");
54 break;
55 case 0x00018100:
Shinya Kuribayashi0fdd27e2008-05-30 00:53:38 +090056 config1 = read_c0_config1();
Vlad Lungu635e76c2008-01-16 19:27:51 +020057 if (config1 & 1)
58 printf("5Kf");
59 else
60 printf("5Kc");
61 break;
62 case 0x000182a0:
63 printf("20Kc");
64 break;
65
66 default:
67 printf("unknown");
68 }
69 printf(" proc_id=0x%x\n", proc_id);
70
71 return 0;
72}
73
74int misc_init_r(void)
75{
76 set_io_port_base(0);
77 return 0;
78}
Bernhard Kaindladb18ea2011-10-20 10:56:59 +000079
80int board_eth_init(bd_t *bis)
81{
82 return ne2k_register();
83}