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