]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - board/quad100hd/quad100hd.c
mx25pdk: Remove CONFIG_SYS_GENERIC_BOARD
[karo-tx-uboot.git] / board / quad100hd / quad100hd.c
1 /*
2  * (C) Copyright 2008
3  * Gary Jennejohn, DENX Software Engineering GmbH, garyj@denx.de.
4  *
5  * Based in part on board/icecube/icecube.c from PPCBoot
6  * (C) Copyright 2003 Intrinsyc Software
7  *
8  * SPDX-License-Identifier:     GPL-2.0+
9  */
10
11 #include <common.h>
12 #include <command.h>
13 #include <malloc.h>
14 #include <environment.h>
15 #include <logbuff.h>
16 #include <post.h>
17
18 #include <asm/processor.h>
19 #include <asm/io.h>
20 #include <asm/ppc4xx-gpio.h>
21
22 DECLARE_GLOBAL_DATA_PTR;
23
24 int board_early_init_f(void)
25 {
26         /* taken from PPCBoot */
27         mtdcr(UIC0SR, 0xFFFFFFFF);      /* clear all ints */
28         mtdcr(UIC0ER, 0x00000000);      /* disable all ints */
29         mtdcr(UIC0CR, 0x00000000);
30         mtdcr(UIC0PR, 0xFFFF7FFE);      /* set int polarities */
31         mtdcr(UIC0TR, 0x00000000);      /* set int trigger levels */
32         mtdcr(UIC0SR, 0xFFFFFFFF);      /* clear all ints */
33         mtdcr(UIC0VCR, 0x00000001);     /* set vect base=0,INT0 highest priority */
34
35         mtdcr(CPC0_SRR, 0x00040000);   /* Hold PCI bridge in reset */
36
37         return 0;
38 }
39
40 /*
41  * Check Board Identity:
42  */
43 int checkboard(void)
44 {
45         char buf[64];
46         int i = getenv_f("serial#", buf, sizeof(buf));
47 #ifdef DISPLAY_BOARD_INFO
48         sys_info_t sysinfo;
49 #endif
50
51         puts("Board: Quad100hd");
52
53         if (i > 0) {
54                 puts(", serial# ");
55                 puts(buf);
56         }
57         putc('\n');
58
59 #ifdef DISPLAY_BOARD_INFO
60         /* taken from ppcboot */
61         get_sys_info(&sysinfo);
62
63         printf("\tVCO: %lu MHz\n", sysinfo.freqVCOMhz);
64         printf("\tCPU: %lu MHz\n", sysinfo.freqProcessor / 1000000);
65         printf("\tPLB: %lu MHz\n", sysinfo.freqPLB / 1000000);
66         printf("\tOPB: %lu MHz\n", sysinfo.freqOPB / 1000000);
67         printf("\tEPB: %lu MHz\n", sysinfo.freqPLB / (sysinfo.pllExtBusDiv *
68                 1000000));
69         printf("\tPCI: %lu MHz\n", sysinfo.freqPCI / 1000000);
70 #endif
71
72         return 0;
73 }