blob: 414a9c001dcc08ff9e307f9b666e76e89503d4ab [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Vlad Lungu635e76c2008-01-16 19:27:51 +02002/*
3 * (C) Copyright 2007
Vlad Lungu3987beb2008-05-05 14:20:03 +03004 * Vlad Lungu vlad.lungu@windriver.com
Vlad Lungu635e76c2008-01-16 19:27:51 +02005 */
6
7#include <common.h>
8#include <command.h>
9#include <asm/mipsregs.h>
10#include <asm/io.h>
Bernhard Kaindladb18ea2011-10-20 10:56:59 +000011#include <netdev.h>
Vlad Lungu635e76c2008-01-16 19:27:51 +020012
Simon Glass39f90ba2017-03-31 08:40:25 -060013DECLARE_GLOBAL_DATA_PTR;
14
Simon Glassd35f3382017-04-06 12:47:05 -060015int dram_init(void)
Vlad Lungu635e76c2008-01-16 19:27:51 +020016{
17 /* Sdram is setup by assembler code */
18 /* If memory could be changed, we should return the true value here */
Simon Glass39f90ba2017-03-31 08:40:25 -060019 gd->ram_size = MEM_SIZE * 1024 * 1024;
20
21 return 0;
Vlad Lungu635e76c2008-01-16 19:27:51 +020022}
23
24int checkboard(void)
25{
26 u32 proc_id;
27 u32 config1;
28
Shinya Kuribayashi0fdd27e2008-05-30 00:53:38 +090029 proc_id = read_c0_prid();
Vlad Lungu635e76c2008-01-16 19:27:51 +020030 printf("Board: Qemu -M mips CPU: ");
31 switch (proc_id) {
32 case 0x00018000:
33 printf("4Kc");
34 break;
35 case 0x00018400:
36 printf("4KEcR1");
37 break;
38 case 0x00019000:
39 printf("4KEc");
40 break;
41 case 0x00019300:
Shinya Kuribayashi0fdd27e2008-05-30 00:53:38 +090042 config1 = read_c0_config1();
Vlad Lungu635e76c2008-01-16 19:27:51 +020043 if (config1 & 1)
44 printf("24Kf");
45 else
46 printf("24Kc");
47 break;
48 case 0x00019500:
49 printf("34Kf");
50 break;
51 case 0x00000400:
52 printf("R4000");
53 break;
54 case 0x00018100:
Shinya Kuribayashi0fdd27e2008-05-30 00:53:38 +090055 config1 = read_c0_config1();
Vlad Lungu635e76c2008-01-16 19:27:51 +020056 if (config1 & 1)
57 printf("5Kf");
58 else
59 printf("5Kc");
60 break;
61 case 0x000182a0:
62 printf("20Kc");
63 break;
64
65 default:
66 printf("unknown");
67 }
68 printf(" proc_id=0x%x\n", proc_id);
69
70 return 0;
71}
72
73int misc_init_r(void)
74{
75 set_io_port_base(0);
76 return 0;
77}
Bernhard Kaindladb18ea2011-10-20 10:56:59 +000078
79int board_eth_init(bd_t *bis)
80{
81 return ne2k_register();
82}