wdenk | d334105 | 2005-01-09 23:48:14 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001 |
| 3 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | d334105 | 2005-01-09 23:48:14 +0000 | [diff] [blame] | 5 | */ |
| 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 | |
| 14 | int 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 Roese | 707fd36 | 2009-09-24 09:55:50 +0200 | [diff] [blame] | 28 | 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 */ |
wdenk | d334105 | 2005-01-09 23:48:14 +0000 | [diff] [blame] | 35 | |
| 36 | /* |
| 37 | * EBC Configuration Register: set ready timeout to 512 ebc-clks -> ca. 15 us |
| 38 | */ |
Stefan Roese | 918010a | 2009-09-09 16:25:29 +0200 | [diff] [blame] | 39 | mtebc (EBC0_CFG, 0xa8400000); |
wdenk | d334105 | 2005-01-09 23:48:14 +0000 | [diff] [blame] | 40 | |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | |
| 45 | /* ------------------------------------------------------------------------- */ |
| 46 | |
| 47 | int misc_init_f (void) |
| 48 | { |
| 49 | return 0; /* dummy implementation */ |
| 50 | } |
| 51 | |
| 52 | |
| 53 | int misc_init_r (void) |
| 54 | { |
| 55 | return (0); |
| 56 | } |
| 57 | |
| 58 | |
| 59 | /* |
| 60 | * Check Board Identity: |
| 61 | */ |
| 62 | |
| 63 | int checkboard (void) |
| 64 | { |
Wolfgang Denk | 7fb5266 | 2005-10-13 16:45:02 +0200 | [diff] [blame] | 65 | char str[64]; |
Wolfgang Denk | 76af278 | 2010-07-24 21:55:43 +0200 | [diff] [blame] | 66 | int i = getenv_f("serial#", str, sizeof(str)); |
wdenk | d334105 | 2005-01-09 23:48:14 +0000 | [diff] [blame] | 67 | |
| 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 | |
wdenk | d334105 | 2005-01-09 23:48:14 +0000 | [diff] [blame] | 83 | int testdram (void) |
| 84 | { |
| 85 | /* TODO: XXX XXX XXX */ |
| 86 | printf ("test: 64 MB - ok\n"); |
| 87 | |
| 88 | return (0); |
| 89 | } |
| 90 | |
| 91 | /* ------------------------------------------------------------------------- */ |