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