blob: b81596135bf67d012479761b835339caf1574442 [file] [log] [blame]
wdenk16f21702002-08-26 21:58:50 +00001/*
2 * (C) Copyright 2001
3 * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenk16f21702002-08-26 21:58:50 +00006 */
7
8#include <common.h>
9#include "ocrtc.h"
10#include <asm/processor.h>
11#include <i2c.h>
12#include <command.h>
wdenk16f21702002-08-26 21:58:50 +000013
stroese25215ee2004-12-16 18:37:41 +000014
15extern void lxt971_no_sleep(void);
16
wdenk16f21702002-08-26 21:58:50 +000017
wdenkc837dcb2004-01-20 23:12:12 +000018int board_early_init_f (void)
wdenk16f21702002-08-26 21:58:50 +000019{
20 /*
21 * IRQ 0-15 405GP internally generated; active high; level sensitive
22 * IRQ 16 405GP internally generated; active low; level sensitive
23 * IRQ 17-24 RESERVED
24 * IRQ 25 (EXT IRQ 0) CAN0; active low; level sensitive
25 * IRQ 26 (EXT IRQ 1) CAN1; active low; level sensitive
26 * IRQ 27 (EXT IRQ 2) PCI SLOT 0; active low; level sensitive
27 * IRQ 28 (EXT IRQ 3) PCI SLOT 1; active low; level sensitive
28 * IRQ 29 (EXT IRQ 4) PCI SLOT 2; active low; level sensitive
29 * IRQ 30 (EXT IRQ 5) PCI SLOT 3; active low; level sensitive
30 * IRQ 31 (EXT IRQ 6) COMPACT FLASH; active high; level sensitive
31 */
Stefan Roese952e7762009-09-24 09:55:50 +020032 mtdcr (UIC0SR, 0xFFFFFFFF); /* clear all ints */
33 mtdcr (UIC0ER, 0x00000000); /* disable all ints */
34 mtdcr (UIC0CR, 0x00000000); /* set all to be non-critical */
35 mtdcr (UIC0PR, 0xFFFFFF81); /* set int polarities */
36 mtdcr (UIC0TR, 0x10000000); /* set int trigger levels */
37 mtdcr (UIC0VCR, 0x00000001); /* set vect base=0,INT0 highest priority */
38 mtdcr (UIC0SR, 0xFFFFFFFF); /* clear all ints */
wdenk16f21702002-08-26 21:58:50 +000039
40 /*
41 * EBC Configuration Register: clear EBTC -> high-Z ebc signals between
42 * transfers, set device-paced timeout to 256 cycles
43 */
Stefan Roesed1c3b272009-09-09 16:25:29 +020044 mtebc (EBC0_CFG, 0x20400000);
wdenk16f21702002-08-26 21:58:50 +000045
46 return 0;
47}
48
wdenk16f21702002-08-26 21:58:50 +000049/*
50 * Check Board Identity:
51 */
wdenk16f21702002-08-26 21:58:50 +000052int checkboard (void)
53{
Wolfgang Denk77ddac92005-10-13 16:45:02 +020054 char str[64];
Wolfgang Denkcdb74972010-07-24 21:55:43 +020055 int i = getenv_f("serial#", str, sizeof (str));
wdenk16f21702002-08-26 21:58:50 +000056
57 puts ("Board: ");
58
59 if (i == -1) {
60#ifdef CONFIG_OCRTC
61 puts ("### No HW ID - assuming OCRTC");
62#endif
63#ifdef CONFIG_ORSG
64 puts ("### No HW ID - assuming ORSG");
65#endif
66 } else {
67 puts (str);
68 }
69
70 putc ('\n');
71
stroese25215ee2004-12-16 18:37:41 +000072 /*
73 * Disable sleep mode in LXT971
74 */
75 lxt971_no_sleep();
76
wdenk16f21702002-08-26 21:58:50 +000077 return (0);
78}