blob: cafc844a22e03ac82abee89ce85b347466c3097f [file] [log] [blame]
wdenkd3341052005-01-09 23:48:14 +00001/*
2 * (C) Copyright 2001
3 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
wdenkd3341052005-01-09 23:48:14 +00005 */
6
7#include <common.h>
8#include <asm/processor.h>
9#include <command.h>
10#include <malloc.h>
11#include <spd_sdram.h>
12
13
14int board_early_init_f (void)
15{
16 /*
17 * IRQ 0-15 405GP internally generated; active high; level sensitive
18 * IRQ 16 405GP internally generated; active low; level sensitive
19 * IRQ 17-24 RESERVED
20 * IRQ 25 (EXT IRQ 0) CAN0; active low; level sensitive
21 * IRQ 26 (EXT IRQ 1) SER0 ; active low; level sensitive
22 * IRQ 27 (EXT IRQ 2) SER1; active low; level sensitive
23 * IRQ 28 (EXT IRQ 3) FPGA 0; active low; level sensitive
24 * IRQ 29 (EXT IRQ 4) FPGA 1; active low; level sensitive
25 * IRQ 30 (EXT IRQ 5) PCI INTA; active low; level sensitive
26 * IRQ 31 (EXT IRQ 6) COMPACT FLASH; active high; level sensitive
27 */
Stefan Roese707fd362009-09-24 09:55:50 +020028 mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */
29 mtdcr(UIC0ER, 0x00000000); /* disable all ints */
30 mtdcr(UIC0CR, 0x00000000); /* set all to be non-critical*/
31 mtdcr(UIC0PR, 0xFFFFFF81); /* set int polarities */
32 mtdcr(UIC0TR, 0x10000000); /* set int trigger levels */
33 mtdcr(UIC0VCR, 0x00000001); /* set vect base=0,INT0 highest priority*/
34 mtdcr(UIC0SR, 0xFFFFFFFF); /* clear all ints */
wdenkd3341052005-01-09 23:48:14 +000035
36 /*
37 * EBC Configuration Register: set ready timeout to 512 ebc-clks -> ca. 15 us
38 */
Stefan Roese918010a2009-09-09 16:25:29 +020039 mtebc (EBC0_CFG, 0xa8400000);
wdenkd3341052005-01-09 23:48:14 +000040
41 return 0;
42}
43
44
45/* ------------------------------------------------------------------------- */
46
47int misc_init_f (void)
48{
49 return 0; /* dummy implementation */
50}
51
52
53int misc_init_r (void)
54{
55 return (0);
56}
57
58
59/*
60 * Check Board Identity:
61 */
62
63int checkboard (void)
64{
Wolfgang Denk7fb52662005-10-13 16:45:02 +020065 char str[64];
Wolfgang Denk76af2782010-07-24 21:55:43 +020066 int i = getenv_f("serial#", str, sizeof(str));
wdenkd3341052005-01-09 23:48:14 +000067
68 puts ("Board: ");
69
70 if (i == -1) {
71 puts ("### No HW ID - assuming sbc405");
72 } else {
73 puts(str);
74 }
75
76 putc ('\n');
77
78 return 0;
79}
80
81/* ------------------------------------------------------------------------- */
82
wdenkd3341052005-01-09 23:48:14 +000083int testdram (void)
84{
85 /* TODO: XXX XXX XXX */
86 printf ("test: 64 MB - ok\n");
87
88 return (0);
89}
90
91/* ------------------------------------------------------------------------- */