wdenk | 16f2170 | 2002-08-26 21:58:50 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001 |
| 3 | * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | 16f2170 | 2002-08-26 21:58:50 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
| 9 | #include "ocrtc.h" |
| 10 | #include <asm/processor.h> |
| 11 | #include <i2c.h> |
| 12 | #include <command.h> |
wdenk | 16f2170 | 2002-08-26 21:58:50 +0000 | [diff] [blame] | 13 | |
stroese | 25215ee | 2004-12-16 18:37:41 +0000 | [diff] [blame] | 14 | |
| 15 | extern void lxt971_no_sleep(void); |
| 16 | |
wdenk | 16f2170 | 2002-08-26 21:58:50 +0000 | [diff] [blame] | 17 | |
wdenk | c837dcb | 2004-01-20 23:12:12 +0000 | [diff] [blame] | 18 | int board_early_init_f (void) |
wdenk | 16f2170 | 2002-08-26 21:58:50 +0000 | [diff] [blame] | 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 | */ |
Stefan Roese | 952e776 | 2009-09-24 09:55:50 +0200 | [diff] [blame] | 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 */ |
wdenk | 16f2170 | 2002-08-26 21:58:50 +0000 | [diff] [blame] | 39 | |
| 40 | /* |
| 41 | * EBC Configuration Register: clear EBTC -> high-Z ebc signals between |
| 42 | * transfers, set device-paced timeout to 256 cycles |
| 43 | */ |
Stefan Roese | d1c3b27 | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 44 | mtebc (EBC0_CFG, 0x20400000); |
wdenk | 16f2170 | 2002-08-26 21:58:50 +0000 | [diff] [blame] | 45 | |
| 46 | return 0; |
| 47 | } |
| 48 | |
wdenk | 16f2170 | 2002-08-26 21:58:50 +0000 | [diff] [blame] | 49 | /* |
| 50 | * Check Board Identity: |
| 51 | */ |
wdenk | 16f2170 | 2002-08-26 21:58:50 +0000 | [diff] [blame] | 52 | int checkboard (void) |
| 53 | { |
Wolfgang Denk | 77ddac9 | 2005-10-13 16:45:02 +0200 | [diff] [blame] | 54 | char str[64]; |
Wolfgang Denk | cdb7497 | 2010-07-24 21:55:43 +0200 | [diff] [blame] | 55 | int i = getenv_f("serial#", str, sizeof (str)); |
wdenk | 16f2170 | 2002-08-26 21:58:50 +0000 | [diff] [blame] | 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 | |
stroese | 25215ee | 2004-12-16 18:37:41 +0000 | [diff] [blame] | 72 | /* |
| 73 | * Disable sleep mode in LXT971 |
| 74 | */ |
| 75 | lxt971_no_sleep(); |
| 76 | |
wdenk | 16f2170 | 2002-08-26 21:58:50 +0000 | [diff] [blame] | 77 | return (0); |
| 78 | } |