Wolfgang Denk | 7b9bc3a | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2005 2N TELEKOMUNIKACE, Ladislav Michl |
| 3 | * |
| 4 | * See file CREDITS for list of people who contributed to this |
| 5 | * project. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License as |
| 9 | * published by the Free Software Foundation; either version 2 of |
| 10 | * the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 20 | * MA 02111-1307 USA |
| 21 | */ |
| 22 | |
| 23 | #include <common.h> |
Ladislav Michl | d0dcaf1 | 2009-03-25 23:43:58 +0100 | [diff] [blame^] | 24 | #include <i2c.h> |
Ladislav Michl | 6d93dd9 | 2009-03-25 23:43:50 +0100 | [diff] [blame] | 25 | #include <flash.h> |
Wolfgang Denk | 7b9bc3a | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 26 | |
Wolfgang Denk | 6405a15 | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 27 | DECLARE_GLOBAL_DATA_PTR; |
| 28 | |
Wolfgang Denk | 7b9bc3a | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 29 | int board_init(void) |
| 30 | { |
Wolfgang Denk | 7b9bc3a | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 31 | /* arch number of NetStar board */ |
Stefan Roese | 9052786 | 2006-10-28 17:12:58 +0200 | [diff] [blame] | 32 | gd->bd->bi_arch_number = MACH_TYPE_NETSTAR; |
Wolfgang Denk | 7b9bc3a | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 33 | |
| 34 | /* adress of boot parameters */ |
| 35 | gd->bd->bi_boot_params = 0x10000100; |
| 36 | |
| 37 | return 0; |
| 38 | } |
| 39 | |
| 40 | int dram_init(void) |
| 41 | { |
Wolfgang Denk | 7b9bc3a | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 42 | gd->bd->bi_dram[0].start = PHYS_SDRAM_1; |
| 43 | gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; |
| 44 | |
| 45 | /* Take the Ethernet controller out of reset and wait |
| 46 | * for the EEPROM load to complete. */ |
| 47 | *((volatile unsigned short *) GPIO_DATA_OUTPUT_REG) |= 0x80; |
| 48 | udelay(10); /* doesn't work before interrupt_init call */ |
| 49 | *((volatile unsigned short *) GPIO_DATA_OUTPUT_REG) &= ~0x80; |
| 50 | udelay(500); |
| 51 | |
| 52 | return 0; |
| 53 | } |
| 54 | |
Wolfgang Denk | 7b9bc3a | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 55 | int misc_init_r(void) |
| 56 | { |
Ladislav Michl | d0dcaf1 | 2009-03-25 23:43:58 +0100 | [diff] [blame^] | 57 | #if defined(CONFIG_RTC_DS1307) |
| 58 | /* enable trickle charge */ |
| 59 | i2c_reg_write(CONFIG_SYS_I2C_RTC_ADDR, 0x10, 0xaa); |
| 60 | #endif |
Wolfgang Denk | 7b9bc3a | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 61 | return 0; |
| 62 | } |
| 63 | |
Wolfgang Denk | 7b9bc3a | 2005-09-14 23:53:32 +0200 | [diff] [blame] | 64 | int board_late_init(void) |
| 65 | { |
| 66 | return 0; |
| 67 | } |
Ladislav Michl | 6d93dd9 | 2009-03-25 23:43:50 +0100 | [diff] [blame] | 68 | |
| 69 | #if defined(CONFIG_CMD_FLASH) |
| 70 | ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t * info) |
| 71 | { |
| 72 | if (banknum == 0) { /* AM29LV800 boot flash */ |
| 73 | info->portwidth = FLASH_CFI_16BIT; |
| 74 | info->chipwidth = FLASH_CFI_BY16; |
| 75 | info->interface = FLASH_CFI_X16; |
| 76 | return 1; |
| 77 | } |
| 78 | |
| 79 | return 0; |
| 80 | } |
| 81 | #endif |