common: Drop net.h from common header
[oweals/u-boot.git] / arch / m68k / cpu / mcf5445x / cpu.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  *
4  * (C) Copyright 2000-2003
5  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6  *
7  * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
8  * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
9  */
10
11 #include <common.h>
12 #include <net.h>
13 #include <vsprintf.h>
14 #include <watchdog.h>
15 #include <command.h>
16 #include <netdev.h>
17
18 #include <asm/immap.h>
19 #include <asm/io.h>
20
21 DECLARE_GLOBAL_DATA_PTR;
22
23 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
24 {
25         rcm_t *rcm = (rcm_t *) (MMAP_RCM);
26         udelay(1000);
27         out_8(&rcm->rcr, RCM_RCR_FRCRSTOUT);
28         udelay(10000);
29         setbits_8(&rcm->rcr, RCM_RCR_SOFTRST);
30
31         /* we don't return! */
32         return 0;
33 };
34
35 #if defined(CONFIG_DISPLAY_CPUINFO)
36 int print_cpuinfo(void)
37 {
38         ccm_t *ccm = (ccm_t *) MMAP_CCM;
39         u16 msk;
40         u16 id = 0;
41         u8 ver;
42
43         puts("CPU:   ");
44         msk = (in_be16(&ccm->cir) >> 6);
45         ver = (in_be16(&ccm->cir) & 0x003f);
46         switch (msk) {
47         case 0x48:
48                 id = 54455;
49                 break;
50         case 0x49:
51                 id = 54454;
52                 break;
53         case 0x4a:
54                 id = 54453;
55                 break;
56         case 0x4b:
57                 id = 54452;
58                 break;
59         case 0x4d:
60                 id = 54451;
61                 break;
62         case 0x4f:
63                 id = 54450;
64                 break;
65         case 0x9F:
66                 id = 54410;
67                 break;
68         case 0xA0:
69                 id = 54415;
70                 break;
71         case 0xA1:
72                 id = 54416;
73                 break;
74         case 0xA2:
75                 id = 54417;
76                 break;
77         case 0xA3:
78                 id = 54418;
79                 break;
80         }
81
82         if (id) {
83                 char buf1[32], buf2[32], buf3[32];
84
85                 printf("Freescale MCF%d (Mask:%01x Version:%x)\n", id, msk,
86                        ver);
87                 printf("       CPU CLK %s MHz BUS CLK %s MHz FLB CLK %s MHz\n",
88                        strmhz(buf1, gd->cpu_clk),
89                        strmhz(buf2, gd->bus_clk),
90                        strmhz(buf3, gd->arch.flb_clk));
91 #ifdef CONFIG_PCI
92                 printf("       PCI CLK %s MHz INP CLK %s MHz VCO CLK %s MHz\n",
93                        strmhz(buf1, gd->pci_clk),
94                        strmhz(buf2, gd->arch.inp_clk),
95                        strmhz(buf3, gd->arch.vco_clk));
96 #else
97                 printf("       INP CLK %s MHz VCO CLK %s MHz\n",
98                        strmhz(buf1, gd->arch.inp_clk),
99                        strmhz(buf2, gd->arch.vco_clk));
100 #endif
101         }
102
103         return 0;
104 }
105 #endif /* CONFIG_DISPLAY_CPUINFO */
106
107 #if defined(CONFIG_MCFFEC)
108 /* Default initializations for MCFFEC controllers.  To override,
109  * create a board-specific function called:
110  *      int board_eth_init(bd_t *bis)
111  */
112
113 int cpu_eth_init(bd_t *bis)
114 {
115         return mcffec_initialize(bis);
116 }
117 #endif