wdenk | 2d5b561 | 2003-10-14 19:43:55 +0000 | [diff] [blame] | 1 | /* |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 2 | * (C) Copyright 2006 |
| 3 | * Stefan Roese, DENX Software Engineering, sr@denx.de. |
| 4 | * |
wdenk | 2d5b561 | 2003-10-14 19:43:55 +0000 | [diff] [blame] | 5 | * (C) Copyright 2002 |
| 6 | * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net |
| 7 | * |
| 8 | * (C) Copyright 2002 |
| 9 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 10 | * Marius Groeger <mgroeger@sysgo.de> |
| 11 | * |
| 12 | * See file CREDITS for list of people who contributed to this |
| 13 | * project. |
| 14 | * |
| 15 | * This program is free software; you can redistribute it and/or |
| 16 | * modify it under the terms of the GNU General Public License as |
| 17 | * published by the Free Software Foundation; either version 2 of |
| 18 | * the License, or (at your option) any later version. |
| 19 | * |
| 20 | * This program is distributed in the hope that it will be useful, |
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 | * GNU General Public License for more details. |
| 24 | * |
| 25 | * You should have received a copy of the GNU General Public License |
| 26 | * along with this program; if not, write to the Free Software |
| 27 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 28 | * MA 02111-1307 USA |
| 29 | */ |
| 30 | |
wdenk | 2d5b561 | 2003-10-14 19:43:55 +0000 | [diff] [blame] | 31 | #include <common.h> |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 32 | #include <command.h> |
| 33 | #include <malloc.h> |
Ben Warren | 10efa02 | 2008-08-31 20:37:00 -0700 | [diff] [blame] | 34 | #include <netdev.h> |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 35 | #include <asm/arch/ixp425.h> |
wdenk | 2d5b561 | 2003-10-14 19:43:55 +0000 | [diff] [blame] | 36 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 37 | DECLARE_GLOBAL_DATA_PTR; |
wdenk | 2d5b561 | 2003-10-14 19:43:55 +0000 | [diff] [blame] | 38 | |
| 39 | /* |
| 40 | * Miscelaneous platform dependent initialisations |
| 41 | */ |
wdenk | 289f932 | 2005-01-12 00:15:14 +0000 | [diff] [blame] | 42 | int board_init (void) |
wdenk | 2d5b561 | 2003-10-14 19:43:55 +0000 | [diff] [blame] | 43 | { |
wdenk | 2d5b561 | 2003-10-14 19:43:55 +0000 | [diff] [blame] | 44 | /* arch number of IXDP */ |
wdenk | 731215e | 2004-10-10 18:41:04 +0000 | [diff] [blame] | 45 | gd->bd->bi_arch_number = MACH_TYPE_IXDP425; |
wdenk | 2d5b561 | 2003-10-14 19:43:55 +0000 | [diff] [blame] | 46 | |
| 47 | /* adress of boot parameters */ |
| 48 | gd->bd->bi_boot_params = 0x00000100; |
| 49 | |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 50 | #ifdef CONFIG_IXDPG425 |
| 51 | /* arch number of IXDP */ |
| 52 | gd->bd->bi_arch_number = MACH_TYPE_IXDPG425; |
| 53 | |
| 54 | /* |
| 55 | * Get realtek RTL8305 switch and SLIC out of reset |
| 56 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 57 | GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_SWITCH_RESET_N); |
| 58 | GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_SWITCH_RESET_N); |
| 59 | GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_SLIC_RESET_N); |
| 60 | GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_SLIC_RESET_N); |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 61 | |
| 62 | /* |
| 63 | * Setup GPIO's for PCI INTA & INTB |
| 64 | */ |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 65 | GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_PCI_INTA_N); |
| 66 | GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_PCI_INTA_N); |
| 67 | GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_PCI_INTB_N); |
| 68 | GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_PCI_INTB_N); |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 69 | |
| 70 | /* |
| 71 | * Setup GPIO's for 33MHz clock output |
| 72 | */ |
| 73 | *IXP425_GPIO_GPCLKR = 0x01FF01FF; |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 74 | GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_PCI_CLK); |
| 75 | GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_EXTBUS_CLK); |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 76 | #endif |
| 77 | |
wdenk | 2d5b561 | 2003-10-14 19:43:55 +0000 | [diff] [blame] | 78 | return 0; |
| 79 | } |
| 80 | |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 81 | /* |
| 82 | * Check Board Identity |
| 83 | */ |
| 84 | int checkboard(void) |
| 85 | { |
Wolfgang Denk | f0c0b3a | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 86 | char buf[64]; |
| 87 | int i = getenv_f("serial#", buf, sizeof(buf)); |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 88 | |
| 89 | #ifdef CONFIG_IXDPG425 |
| 90 | puts("Board: IXDPG425 - Intel Network Gateway Reference Platform"); |
| 91 | #else |
| 92 | puts("Board: IXDP425 - Intel Development Platform"); |
| 93 | #endif |
| 94 | |
Wolfgang Denk | f0c0b3a | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 95 | if (i > 0) { |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 96 | puts(", serial# "); |
Wolfgang Denk | f0c0b3a | 2011-05-04 10:32:28 +0000 | [diff] [blame] | 97 | puts(buf); |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 98 | } |
| 99 | putc('\n'); |
| 100 | |
| 101 | return (0); |
| 102 | } |
wdenk | 289f932 | 2005-01-12 00:15:14 +0000 | [diff] [blame] | 103 | |
| 104 | int dram_init (void) |
wdenk | 2d5b561 | 2003-10-14 19:43:55 +0000 | [diff] [blame] | 105 | { |
wdenk | 2d5b561 | 2003-10-14 19:43:55 +0000 | [diff] [blame] | 106 | gd->bd->bi_dram[0].start = PHYS_SDRAM_1; |
| 107 | gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; |
| 108 | |
| 109 | return (0); |
| 110 | } |
wdenk | 289f932 | 2005-01-12 00:15:14 +0000 | [diff] [blame] | 111 | |
Jon Loeliger | c508a4c | 2007-07-09 18:31:28 -0500 | [diff] [blame] | 112 | #if defined(CONFIG_CMD_PCI) || defined(CONFIG_PCI) |
wdenk | a119190 | 2005-01-09 17:12:27 +0000 | [diff] [blame] | 113 | extern struct pci_controller hose; |
Wolfgang Denk | 3706ba1 | 2005-09-25 00:00:45 +0200 | [diff] [blame] | 114 | extern void pci_ixp_init(struct pci_controller * hose); |
wdenk | 289f932 | 2005-01-12 00:15:14 +0000 | [diff] [blame] | 115 | |
wdenk | a119190 | 2005-01-09 17:12:27 +0000 | [diff] [blame] | 116 | void pci_init_board(void) |
| 117 | { |
wdenk | 289f932 | 2005-01-12 00:15:14 +0000 | [diff] [blame] | 118 | extern void pci_ixp_init (struct pci_controller *hose); |
| 119 | |
wdenk | a119190 | 2005-01-09 17:12:27 +0000 | [diff] [blame] | 120 | pci_ixp_init(&hose); |
wdenk | a119190 | 2005-01-09 17:12:27 +0000 | [diff] [blame] | 121 | } |
Wolfgang Denk | ba94a1b | 2006-05-30 15:56:48 +0200 | [diff] [blame] | 122 | #endif |
Ben Warren | 10efa02 | 2008-08-31 20:37:00 -0700 | [diff] [blame] | 123 | |
| 124 | int board_eth_init(bd_t *bis) |
| 125 | { |
| 126 | return pci_eth_init(bis); |
| 127 | } |