blob: f57091739ec916a0b365a0128bf32343fda75e01 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Vlad Lungu0764c162008-01-16 19:27:51 +02002/*
3 * (C) Copyright 2007
Vlad Lungu045b4d22008-05-05 14:20:03 +03004 * Vlad Lungu vlad.lungu@windriver.com
Vlad Lungu0764c162008-01-16 19:27:51 +02005 */
6
7#include <common.h>
8#include <command.h>
Simon Glass691d7192020-05-10 11:40:02 -06009#include <init.h>
Simon Glass90526e92020-05-10 11:39:56 -060010#include <net.h>
Simon Glass401d1c42020-10-30 21:38:53 -060011#include <asm/global_data.h>
Vlad Lungu0764c162008-01-16 19:27:51 +020012#include <asm/mipsregs.h>
13#include <asm/io.h>
Bernhard Kaindld0201692011-10-20 10:56:59 +000014#include <netdev.h>
Vlad Lungu0764c162008-01-16 19:27:51 +020015
Simon Glass088454c2017-03-31 08:40:25 -060016DECLARE_GLOBAL_DATA_PTR;
17
Simon Glassf1683aa2017-04-06 12:47:05 -060018int dram_init(void)
Vlad Lungu0764c162008-01-16 19:27:51 +020019{
20 /* Sdram is setup by assembler code */
21 /* If memory could be changed, we should return the true value here */
Simon Glass088454c2017-03-31 08:40:25 -060022 gd->ram_size = MEM_SIZE * 1024 * 1024;
23
24 return 0;
Vlad Lungu0764c162008-01-16 19:27:51 +020025}
26
27int checkboard(void)
28{
29 u32 proc_id;
30 u32 config1;
31
Shinya Kuribayashie2ad8422008-05-30 00:53:38 +090032 proc_id = read_c0_prid();
Vlad Lungu0764c162008-01-16 19:27:51 +020033 printf("Board: Qemu -M mips CPU: ");
34 switch (proc_id) {
35 case 0x00018000:
36 printf("4Kc");
37 break;
38 case 0x00018400:
39 printf("4KEcR1");
40 break;
41 case 0x00019000:
42 printf("4KEc");
43 break;
44 case 0x00019300:
Shinya Kuribayashie2ad8422008-05-30 00:53:38 +090045 config1 = read_c0_config1();
Vlad Lungu0764c162008-01-16 19:27:51 +020046 if (config1 & 1)
47 printf("24Kf");
48 else
49 printf("24Kc");
50 break;
51 case 0x00019500:
52 printf("34Kf");
53 break;
54 case 0x00000400:
55 printf("R4000");
56 break;
57 case 0x00018100:
Shinya Kuribayashie2ad8422008-05-30 00:53:38 +090058 config1 = read_c0_config1();
Vlad Lungu0764c162008-01-16 19:27:51 +020059 if (config1 & 1)
60 printf("5Kf");
61 else
62 printf("5Kc");
63 break;
64 case 0x000182a0:
65 printf("20Kc");
66 break;
67
68 default:
69 printf("unknown");
70 }
71 printf(" proc_id=0x%x\n", proc_id);
72
73 return 0;
74}
75
76int misc_init_r(void)
77{
78 set_io_port_base(0);
79 return 0;
80}
Bernhard Kaindld0201692011-10-20 10:56:59 +000081
Masahiro Yamadab75d8dc2020-06-26 15:13:33 +090082int board_eth_init(struct bd_info *bis)
Bernhard Kaindld0201692011-10-20 10:56:59 +000083{
84 return ne2k_register();
85}