Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Vlad Lungu | 635e76c | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2007 |
Vlad Lungu | 3987beb | 2008-05-05 14:20:03 +0300 | [diff] [blame] | 4 | * Vlad Lungu vlad.lungu@windriver.com |
Vlad Lungu | 635e76c | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <command.h> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 9 | #include <init.h> |
Simon Glass | 274e0b0 | 2020-05-10 11:39:56 -0600 | [diff] [blame] | 10 | #include <net.h> |
Vlad Lungu | 635e76c | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 11 | #include <asm/mipsregs.h> |
| 12 | #include <asm/io.h> |
Bernhard Kaindl | adb18ea | 2011-10-20 10:56:59 +0000 | [diff] [blame] | 13 | #include <netdev.h> |
Vlad Lungu | 635e76c | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 14 | |
Simon Glass | 39f90ba | 2017-03-31 08:40:25 -0600 | [diff] [blame] | 15 | DECLARE_GLOBAL_DATA_PTR; |
| 16 | |
Simon Glass | d35f338 | 2017-04-06 12:47:05 -0600 | [diff] [blame] | 17 | int dram_init(void) |
Vlad Lungu | 635e76c | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 18 | { |
| 19 | /* Sdram is setup by assembler code */ |
| 20 | /* If memory could be changed, we should return the true value here */ |
Simon Glass | 39f90ba | 2017-03-31 08:40:25 -0600 | [diff] [blame] | 21 | gd->ram_size = MEM_SIZE * 1024 * 1024; |
| 22 | |
| 23 | return 0; |
Vlad Lungu | 635e76c | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | int checkboard(void) |
| 27 | { |
| 28 | u32 proc_id; |
| 29 | u32 config1; |
| 30 | |
Shinya Kuribayashi | 0fdd27e | 2008-05-30 00:53:38 +0900 | [diff] [blame] | 31 | proc_id = read_c0_prid(); |
Vlad Lungu | 635e76c | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 32 | 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 Kuribayashi | 0fdd27e | 2008-05-30 00:53:38 +0900 | [diff] [blame] | 44 | config1 = read_c0_config1(); |
Vlad Lungu | 635e76c | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 45 | 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 Kuribayashi | 0fdd27e | 2008-05-30 00:53:38 +0900 | [diff] [blame] | 57 | config1 = read_c0_config1(); |
Vlad Lungu | 635e76c | 2008-01-16 19:27:51 +0200 | [diff] [blame] | 58 | 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 | |
| 75 | int misc_init_r(void) |
| 76 | { |
| 77 | set_io_port_base(0); |
| 78 | return 0; |
| 79 | } |
Bernhard Kaindl | adb18ea | 2011-10-20 10:56:59 +0000 | [diff] [blame] | 80 | |
Masahiro Yamada | f7ed78b | 2020-06-26 15:13:33 +0900 | [diff] [blame] | 81 | int board_eth_init(struct bd_info *bis) |
Bernhard Kaindl | adb18ea | 2011-10-20 10:56:59 +0000 | [diff] [blame] | 82 | { |
| 83 | return ne2k_register(); |
| 84 | } |