]> git.ipfire.org Git - thirdparty/u-boot.git/blob - board/esd/ocrtc/ocrtc.c
Add GPL-2.0+ SPDX-License-Identifier to source files
[thirdparty/u-boot.git] / board / esd / ocrtc / ocrtc.c
1 /*
2 * (C) Copyright 2001
3 * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8 #include <common.h>
9 #include "ocrtc.h"
10 #include <asm/processor.h>
11 #include <i2c.h>
12 #include <command.h>
13
14
15 extern void lxt971_no_sleep(void);
16
17
18 int board_early_init_f (void)
19 {
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 */
32 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 */
39
40 /*
41 * EBC Configuration Register: clear EBTC -> high-Z ebc signals between
42 * transfers, set device-paced timeout to 256 cycles
43 */
44 mtebc (EBC0_CFG, 0x20400000);
45
46 return 0;
47 }
48
49 /*
50 * Check Board Identity:
51 */
52 int checkboard (void)
53 {
54 char str[64];
55 int i = getenv_f("serial#", str, sizeof (str));
56
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
72 /*
73 * Disable sleep mode in LXT971
74 */
75 lxt971_no_sleep();
76
77 return (0);
78 }