Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2007 |
Vlad Lungu | 045b4d2 | 2008-05-05 14:20:03 +0300 | [diff] [blame] | 3 | * Vlad Lungu vlad.lungu@windriver.com |
Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include <command.h> |
| 10 | #include <asm/mipsregs.h> |
| 11 | #include <asm/io.h> |
Bernhard Kaindl | d020169 | 2011-10-20 10:56:59 +0000 | [diff] [blame] | 12 | #include <netdev.h> |
Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 13 | |
Becky Bruce | 9973e3c | 2008-06-09 16:03:40 -0500 | [diff] [blame] | 14 | phys_size_t initdram(int board_type) |
Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 15 | { |
| 16 | /* Sdram is setup by assembler code */ |
| 17 | /* If memory could be changed, we should return the true value here */ |
| 18 | return MEM_SIZE*1024*1024; |
| 19 | } |
| 20 | |
| 21 | int checkboard(void) |
| 22 | { |
| 23 | u32 proc_id; |
| 24 | u32 config1; |
| 25 | |
Shinya Kuribayashi | e2ad842 | 2008-05-30 00:53:38 +0900 | [diff] [blame] | 26 | proc_id = read_c0_prid(); |
Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 27 | printf("Board: Qemu -M mips CPU: "); |
| 28 | switch (proc_id) { |
| 29 | case 0x00018000: |
| 30 | printf("4Kc"); |
| 31 | break; |
| 32 | case 0x00018400: |
| 33 | printf("4KEcR1"); |
| 34 | break; |
| 35 | case 0x00019000: |
| 36 | printf("4KEc"); |
| 37 | break; |
| 38 | case 0x00019300: |
Shinya Kuribayashi | e2ad842 | 2008-05-30 00:53:38 +0900 | [diff] [blame] | 39 | config1 = read_c0_config1(); |
Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 40 | if (config1 & 1) |
| 41 | printf("24Kf"); |
| 42 | else |
| 43 | printf("24Kc"); |
| 44 | break; |
| 45 | case 0x00019500: |
| 46 | printf("34Kf"); |
| 47 | break; |
| 48 | case 0x00000400: |
| 49 | printf("R4000"); |
| 50 | break; |
| 51 | case 0x00018100: |
Shinya Kuribayashi | e2ad842 | 2008-05-30 00:53:38 +0900 | [diff] [blame] | 52 | config1 = read_c0_config1(); |
Vlad Lungu | 0764c16 | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 53 | if (config1 & 1) |
| 54 | printf("5Kf"); |
| 55 | else |
| 56 | printf("5Kc"); |
| 57 | break; |
| 58 | case 0x000182a0: |
| 59 | printf("20Kc"); |
| 60 | break; |
| 61 | |
| 62 | default: |
| 63 | printf("unknown"); |
| 64 | } |
| 65 | printf(" proc_id=0x%x\n", proc_id); |
| 66 | |
| 67 | return 0; |
| 68 | } |
| 69 | |
| 70 | int misc_init_r(void) |
| 71 | { |
| 72 | set_io_port_base(0); |
| 73 | return 0; |
| 74 | } |
Bernhard Kaindl | d020169 | 2011-10-20 10:56:59 +0000 | [diff] [blame] | 75 | |
| 76 | int board_eth_init(bd_t *bis) |
| 77 | { |
| 78 | return ne2k_register(); |
| 79 | } |