blob: bb14ca705679a7a4b5e227ffc28d6dbf4169c792 [file] [log] [blame]
Gary Jennejohn73ccb342008-04-28 14:04:32 +02001/*
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 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02008 * SPDX-License-Identifier: GPL-2.0+
Gary Jennejohn73ccb342008-04-28 14:04:32 +02009 */
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>
Stefan Roese09887762010-09-16 14:30:37 +020020#include <asm/ppc4xx-gpio.h>
Gary Jennejohn73ccb342008-04-28 14:04:32 +020021
22DECLARE_GLOBAL_DATA_PTR;
23
24int board_early_init_f(void)
25{
26 /* taken from PPCBoot */
Stefan Roese952e7762009-09-24 09:55:50 +020027 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 */
Gary Jennejohn73ccb342008-04-28 14:04:32 +020034
35 mtdcr(CPC0_SRR, 0x00040000); /* Hold PCI bridge in reset */
36
37 return 0;
38}
39
40/*
41 * Check Board Identity:
42 */
43int checkboard(void)
44{
Wolfgang Denkf0c0b3a2011-05-04 10:32:28 +000045 char buf[64];
46 int i = getenv_f("serial#", buf, sizeof(buf));
Gary Jennejohn73ccb342008-04-28 14:04:32 +020047#ifdef DISPLAY_BOARD_INFO
48 sys_info_t sysinfo;
49#endif
50
51 puts("Board: Quad100hd");
52
Wolfgang Denkf0c0b3a2011-05-04 10:32:28 +000053 if (i > 0) {
Gary Jennejohn73ccb342008-04-28 14:04:32 +020054 puts(", serial# ");
Wolfgang Denkf0c0b3a2011-05-04 10:32:28 +000055 puts(buf);
Gary Jennejohn73ccb342008-04-28 14:04:32 +020056 }
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}