xref: /OK3568_Linux_fs/u-boot/board/micronas/vct/ebi.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * (C) Copyright 2008 Stefan Roese <sr@denx.de>, DENX Software Engineering
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Copyright (C) 2006 Micronas GmbH
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * SPDX-License-Identifier:	GPL-2.0+
7*4882a593Smuzhiyun  */
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #include <common.h>
10*4882a593Smuzhiyun #include <asm/io.h>
11*4882a593Smuzhiyun #include "vct.h"
12*4882a593Smuzhiyun 
ebi_initialize(void)13*4882a593Smuzhiyun int ebi_initialize(void)
14*4882a593Smuzhiyun {
15*4882a593Smuzhiyun #if defined(CONFIG_VCT_NOR)
16*4882a593Smuzhiyun 	if (ebi_init_nor_flash())
17*4882a593Smuzhiyun 		return -1;
18*4882a593Smuzhiyun #endif
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun #if defined(CONFIG_VCT_ONENAND)
21*4882a593Smuzhiyun 	if (ebi_init_onenand())
22*4882a593Smuzhiyun 		return -1;
23*4882a593Smuzhiyun #endif
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun #if defined(CONFIG_DRIVER_SMC911X)
26*4882a593Smuzhiyun 	if (ebi_init_smc911x())
27*4882a593Smuzhiyun 		return -1;
28*4882a593Smuzhiyun #endif
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun 	reg_write(EBI_CTRL_SIG_ACTLV(EBI_BASE), 0x00004100);
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun 	ebi_wait();
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun 	return 0;
35*4882a593Smuzhiyun }
36