]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/incaip/incaip.c
3b30970b93984fbf2622aa592de918692da12b09
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 #include <asm/addrspace.h>
28 #include <asm/inca-ip.h>
30 #include <asm/reboot.h>
32 extern uint
incaip_get_cpuclk(void);
34 void _machine_restart(void)
36 *INCA_IP_WDT_RST_REQ
= 0x3f;
39 static ulong
max_sdram_size(void)
41 /* The only supported SDRAM data width is 16bit.
43 #define CONFIG_SYS_DW 2
45 /* The only supported number of SDRAM banks is 4.
47 #define CONFIG_SYS_NB 4
49 ulong cfgpb0
= *INCA_IP_SDRAM_MC_CFGPB0
;
50 int cols
= cfgpb0
& 0xF;
51 int rows
= (cfgpb0
& 0xF0) >> 4;
52 ulong size
= (1 << (rows
+ cols
)) * CONFIG_SYS_DW
* CONFIG_SYS_NB
;
57 phys_size_t
initdram(int board_type
)
59 int rows
, cols
, best_val
= *INCA_IP_SDRAM_MC_CFGPB0
;
60 ulong size
, max_size
= 0;
63 asm volatile ("move %0, $25" : "=r" (our_address
) :);
65 /* Can't probe for RAM size unless we are running from Flash.
67 if (CPHYSADDR(our_address
) < CPHYSADDR(PHYS_FLASH_1
))
69 return max_sdram_size();
72 for (cols
= 0x8; cols
<= 0xC; cols
++)
74 for (rows
= 0xB; rows
<= 0xD; rows
++)
76 *INCA_IP_SDRAM_MC_CFGPB0
= (0x14 << 8) |
78 size
= get_ram_size((long *)CONFIG_SYS_SDRAM_BASE
,
83 best_val
= *INCA_IP_SDRAM_MC_CFGPB0
;
89 *INCA_IP_SDRAM_MC_CFGPB0
= best_val
;
95 unsigned long chipid
= *INCA_IP_WDT_CHIPID
;
98 puts ("Board: INCA-IP ");
99 part_num
= (chipid
>> 12) & 0xffff;
102 printf ("Standard Version, ");
105 printf ("Basic Version, ");
108 printf ("Unknown Part Number 0x%x ", part_num
);
112 printf ("Chip V1.%ld, ", (chipid
>> 28));
114 printf("CPU Speed %d MHz\n", incaip_get_cpuclk()/1000000);
121 #if defined(CONFIG_INCA_IP_SWITCH)
122 int board_eth_init(bd_t
*bis
)
124 return inca_switch_initialize(bis
);