blob: 7553d0b00de55da86d404442f1d344a8b8c51a9a [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>
Simon Glass97589732020-05-10 11:40:02 -06009#include <init.h>
Simon Glass274e0b02020-05-10 11:39:56 -060010#include <net.h>
Vlad Lungu635e76c2008-01-16 19:27:51 +020011#include <asm/mipsregs.h>
12#include <asm/io.h>
Bernhard Kaindladb18ea2011-10-20 10:56:59 +000013#include <netdev.h>
Vlad Lungu635e76c2008-01-16 19:27:51 +020014
Simon Glass39f90ba2017-03-31 08:40:25 -060015DECLARE_GLOBAL_DATA_PTR;
16
Simon Glassd35f3382017-04-06 12:47:05 -060017int dram_init(void)
Vlad Lungu635e76c2008-01-16 19:27:51 +020018{
19 /* Sdram is setup by assembler code */
20 /* If memory could be changed, we should return the true value here */
Simon Glass39f90ba2017-03-31 08:40:25 -060021 gd->ram_size = MEM_SIZE * 1024 * 1024;
22
23 return 0;
Vlad Lungu635e76c2008-01-16 19:27:51 +020024}
25
26int checkboard(void)
27{
28 u32 proc_id;
29 u32 config1;
30
Shinya Kuribayashi0fdd27e2008-05-30 00:53:38 +090031 proc_id = read_c0_prid();
Vlad Lungu635e76c2008-01-16 19:27:51 +020032 printf("Board: Qemu -M mips CPU: ");
33 switch (proc_id) {
34 case 0x00018000:
35 printf("4Kc");
36 break;
37 case 0x00018400:
38 printf("4KEcR1");
39 break;
40 case 0x00019000:
41 printf("4KEc");
42 break;
43 case 0x00019300:
Shinya Kuribayashi0fdd27e2008-05-30 00:53:38 +090044 config1 = read_c0_config1();
Vlad Lungu635e76c2008-01-16 19:27:51 +020045 if (config1 & 1)
46 printf("24Kf");
47 else
48 printf("24Kc");
49 break;
50 case 0x00019500:
51 printf("34Kf");
52 break;
53 case 0x00000400:
54 printf("R4000");
55 break;
56 case 0x00018100:
Shinya Kuribayashi0fdd27e2008-05-30 00:53:38 +090057 config1 = read_c0_config1();
Vlad Lungu635e76c2008-01-16 19:27:51 +020058 if (config1 & 1)
59 printf("5Kf");
60 else
61 printf("5Kc");
62 break;
63 case 0x000182a0:
64 printf("20Kc");
65 break;
66
67 default:
68 printf("unknown");
69 }
70 printf(" proc_id=0x%x\n", proc_id);
71
72 return 0;
73}
74
75int misc_init_r(void)
76{
77 set_io_port_base(0);
78 return 0;
79}
Bernhard Kaindladb18ea2011-10-20 10:56:59 +000080
Masahiro Yamadaf7ed78b2020-06-26 15:13:33 +090081int board_eth_init(struct bd_info *bis)
Bernhard Kaindladb18ea2011-10-20 10:56:59 +000082{
83 return ne2k_register();
84}