3 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4 * Marius Groeger <mgroeger@sysgo.de>
7 * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
10 * JinHua Luo, GuangDong Linux Center, <luo.jinhua@gd-linux.com>
12 * See file CREDITS for list of people who contributed to this
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation; either version 2 of
18 * the License, or (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
34 #if defined(CONFIG_CMD_NAND)
35 #include <linux/mtd/nand.h>
38 DECLARE_GLOBAL_DATA_PTR
;
42 #if FCLK_SPEED==0 /* Fout = 203MHz, Fin = 12MHz for Audio */
46 #elif FCLK_SPEED==1 /* Fout = 202.8MHz */
64 static inline void delay (unsigned long loops
)
66 __asm__
volatile ("1:\n"
68 "bne 1b":"=r" (loops
):"0" (loops
));
72 * Miscellaneous platform dependent initialisations
77 S3C24X0_CLOCK_POWER
* const clk_power
= S3C24X0_GetBase_CLOCK_POWER();
78 S3C24X0_GPIO
* const gpio
= S3C24X0_GetBase_GPIO();
80 /* to reduce PLL lock time, adjust the LOCKTIME register */
81 clk_power
->LOCKTIME
= 0xFFFFFF;
84 clk_power
->MPLLCON
= ((M_MDIV
<< 12) + (M_PDIV
<< 4) + M_SDIV
);
86 /* some delay between MPLL and UPLL */
90 clk_power
->UPLLCON
= ((U_M_MDIV
<< 12) + (U_M_PDIV
<< 4) + U_M_SDIV
);
92 /* some delay between MPLL and UPLL */
95 /* set up the I/O ports */
96 gpio
->GPACON
= 0x007FFFFF;
97 gpio
->GPBCON
= 0x00044556;
98 gpio
->GPBUP
= 0x000007FF;
99 gpio
->GPCCON
= 0xAAAAAAAA;
100 gpio
->GPCUP
= 0x0000FFFF;
101 gpio
->GPDCON
= 0xAAAAAAAA;
102 gpio
->GPDUP
= 0x0000FFFF;
103 gpio
->GPECON
= 0xAAAAAAAA;
104 gpio
->GPEUP
= 0x0000FFFF;
105 gpio
->GPFCON
= 0x000055AA;
106 gpio
->GPFUP
= 0x000000FF;
107 gpio
->GPGCON
= 0xFF95FF3A;
108 gpio
->GPGUP
= 0x0000FFFF;
109 gpio
->GPHCON
= 0x0016FAAA;
110 gpio
->GPHUP
= 0x000007FF;
112 gpio
->EXTINT0
=0x22222222;
113 gpio
->EXTINT1
=0x22222222;
114 gpio
->EXTINT2
=0x22222222;
116 /* arch number of SMDK2410-Board */
117 gd
->bd
->bi_arch_number
= MACH_TYPE_SMDK2410
;
119 /* adress of boot parameters */
120 gd
->bd
->bi_boot_params
= 0x30000100;
130 gd
->bd
->bi_dram
[0].start
= PHYS_SDRAM_1
;
131 gd
->bd
->bi_dram
[0].size
= PHYS_SDRAM_1_SIZE
;
136 #if defined(CONFIG_CMD_NAND)
137 extern ulong
nand_probe(ulong physadr
);
139 static inline void NF_Reset(void)
144 NF_Cmd(0xFF); /* reset command */
145 for(i
= 0; i
< 10; i
++); /* tWB = 100ns. */
146 NF_WaitRB(); /* wait 200~500us; */
150 static inline void NF_Init(void)
162 NF_Conf((1<<15)|(0<<14)|(0<<13)|(1<<12)|(1<<11)|(TACLS
<<8)|(TWRPH0
<<4)|(TWRPH1
<<0));
163 /*nand->NFCONF = (1<<15)|(1<<14)|(1<<13)|(1<<12)|(1<<11)|(TACLS<<8)|(TWRPH0<<4)|(TWRPH1<<0); */
164 /* 1 1 1 1, 1 xxx, r xxx, r xxx */
165 /* En 512B 4step ECCR nFCE=H tACLS tWRPH0 tWRPH1 */
172 S3C2410_NAND
* const nand
= S3C2410_GetBase_NAND();
176 printf("NAND flash probing at 0x%.8lX\n", (ulong
)nand
);
178 printf ("%4lu MB\n", nand_probe((ulong
)nand
) >> 20);