1 // SPDX-License-Identifier: GPL-2.0+ 2 /* 3 * (C) Copyright 2007 4 * Vlad Lungu vlad.lungu@windriver.com 5 */ 6 7 #include <common.h> 8 #include <command.h> 9 #include <init.h> 10 #include <net.h> 11 #include <asm/global_data.h> 12 #include <asm/mipsregs.h> 13 #include <asm/io.h> 14 #include <netdev.h> 15 16 DECLARE_GLOBAL_DATA_PTR; 17 dram_init(void)18int dram_init(void) 19 { 20 /* Sdram is setup by assembler code */ 21 /* If memory could be changed, we should return the true value here */ 22 gd->ram_size = MEM_SIZE * 1024 * 1024; 23 24 return 0; 25 } 26 checkboard(void)27int checkboard(void) 28 { 29 u32 proc_id; 30 u32 config1; 31 32 proc_id = read_c0_prid(); 33 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: 45 config1 = read_c0_config1(); 46 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: 58 config1 = read_c0_config1(); 59 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 misc_init_r(void)76int misc_init_r(void) 77 { 78 set_io_port_base(0); 79 return 0; 80 } 81 board_eth_init(struct bd_info * bis)82int board_eth_init(struct bd_info *bis) 83 { 84 return ne2k_register(); 85 } 86