wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2003 ETC s.r.o. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License as |
| 6 | * published by the Free Software Foundation; either version 2 of |
| 7 | * the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 17 | * MA 02111-1307 USA |
| 18 | * |
| 19 | * Written by Peter Figuli <peposh@etc.sk>, 2003. |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | #include <common.h> |
| 24 | #include <asm/arch/pxa-regs.h> |
| 25 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 26 | DECLARE_GLOBAL_DATA_PTR; |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 27 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 28 | int board_init (void) |
| 29 | { |
| 30 | gd->bd->bi_arch_number = MACH_TYPE_WEP_EP250; |
| 31 | gd->bd->bi_boot_params = 0xa0000000; |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 32 | /* |
| 33 | * Setup GPIO stuff to get serial working |
| 34 | */ |
| 35 | #if defined( CONFIG_FFUART ) |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 36 | GPDR1 = 0x80; |
| 37 | GAFR1_L = 0x8010; |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 38 | #elif defined( CONFIG_BTUART ) |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 39 | GPDR1 = 0x800; |
| 40 | GAFR1_L = 0x900000; |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 41 | #endif |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 42 | PSSR = 0x20; |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 43 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 44 | return 0; |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 45 | } |
| 46 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 47 | int dram_init (void) |
| 48 | { |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 49 | #if ( CONFIG_NR_DRAM_BANKS > 0 ) |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 50 | gd->bd->bi_dram[0].start = WEP_SDRAM_1; |
| 51 | gd->bd->bi_dram[0].size = WEP_SDRAM_1_SIZE; |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 52 | #endif |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 53 | #if ( CONFIG_NR_DRAM_BANKS > 1 ) |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 54 | gd->bd->bi_dram[1].start = WEP_SDRAM_2; |
| 55 | gd->bd->bi_dram[1].size = WEP_SDRAM_2_SIZE; |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 56 | #endif |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 57 | #if ( CONFIG_NR_DRAM_BANKS > 2 ) |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 58 | gd->bd->bi_dram[2].start = WEP_SDRAM_3; |
| 59 | gd->bd->bi_dram[2].size = WEP_SDRAM_3_SIZE; |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 60 | #endif |
| 61 | #if ( CONFIG_NR_DRAM_BANKS > 3 ) |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 62 | gd->bd->bi_dram[3].start = WEP_SDRAM_4; |
| 63 | gd->bd->bi_dram[3].size = WEP_SDRAM_4_SIZE; |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 64 | #endif |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 65 | |
Wolfgang Denk | d87080b | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 66 | return 0; |
wdenk | 3e38691 | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 67 | } |