2 * (C) Copyright 2005 2N TELEKOMUNIKACE, Ladislav Michl
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 DECLARE_GLOBAL_DATA_PTR;
28 *((volatile unsigned char *) VOICEBLUE_LED_REG) = 0xaa;
30 /* arch number of VoiceBlue board */
31 /* TODO: use define from asm/mach-types.h */
32 gd->bd->bi_arch_number = 218;
34 /* adress of boot parameters */
35 gd->bd->bi_boot_params = 0x10000100;
42 DECLARE_GLOBAL_DATA_PTR;
44 *((volatile unsigned short *) VOICEBLUE_LED_REG) = 0xff;
46 /* Take the Ethernet controller out of reset and wait
47 * for the EEPROM load to complete. */
48 *((volatile unsigned short *) GPIO_DATA_OUTPUT_REG) |= 0x80;
49 udelay(10); /* doesn't work before interrupt_init call */
50 *((volatile unsigned short *) GPIO_DATA_OUTPUT_REG) &= ~0x80;
53 gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
54 gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
59 #ifndef VOICEBLUE_SMALL_FLASH
61 #include <jffs2/jffs2.h>
63 extern flash_info_t flash_info[];
64 static struct part_info partinfo;
65 static int current_part = -1;
67 /* Partition table (Linux MTD see it this way)
81 static void partition_flash(flash_info_t *info)
84 int i, n, size, psize;
85 const ulong plen[3] = { CFG_MONITOR_LEN, CFG_ENV_SIZE, CFG_ENV_SIZE };
88 for (i = 0; i < 4; i++) {
89 part[i].offset = info->start[n];
90 psize = i < 3 ? plen[i] : (info->size - size) / 2;
91 while (part[i].size < psize) {
92 if (++n > info->sector_count) {
93 printf("Partitioning error. System halted.\n");
96 part[i].size += info->start[n] - info->start[n - 1];
100 part[4].offset = info->start[n];
101 part[4].size = info->start[info->sector_count - 1] - info->start[n];
103 sprintf(mtdparts, "omapflash.0:"
104 "%dk(U-Boot)ro,%dk(env),%dk(r_env),%dk(data1),-(data2)",
105 part[0].size >> 10, part[1].size >> 10,
106 part[2].size >> 10, part[3].size >> 10);
107 setenv ("mtdparts", mtdparts);
110 struct part_info* jffs2_part_info(int part_num)
112 void *jffs2_priv_saved = partinfo.jffs2_priv;
114 if (part_num != 3 && part_num != 4)
117 if (current_part != part_num) {
118 memset(&partinfo, 0, sizeof(partinfo));
119 current_part = part_num;
120 partinfo.offset = (char*) part[part_num].offset;
121 partinfo.size = part[part_num].size;
122 partinfo.usr_priv = ¤t_part;
123 partinfo.jffs2_priv = jffs2_priv_saved;
131 int misc_init_r(void)
133 *((volatile unsigned short *) VOICEBLUE_LED_REG) = 0x55;
135 #ifndef VOICEBLUE_SMALL_FLASH
136 if (flash_info[0].flash_id == FLASH_UNKNOWN) {
137 printf("Unknown flash. System halted.\n");
140 partition_flash(&flash_info[0]);
146 int board_late_init(void)
148 *((volatile unsigned char *) VOICEBLUE_LED_REG) = 0x00;