2 * (C) 2006 by OpenMoko, Inc.
3 * Author: Harald Welte <laforge@openmoko.org>
5 * based on existing S3C2410 startup code in u-boot:
8 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
9 * Marius Groeger <mgroeger@sysgo.de>
12 * David Mueller, ELSOFT AG, <d.mueller@elsoft.ch>
14 * See file CREDITS for list of people who contributed to this
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License as
19 * published by the Free Software Foundation; either version 2 of
20 * the License, or (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
38 DECLARE_GLOBAL_DATA_PTR
;
41 //#define M_MDIV 0xA1 /* Fout = 202.8MHz */
44 #define M_MDIV 0x90 /* Fout = 202.8MHz */
48 #define M_MDIV 0x5c /* Fout = 150.0MHz */
63 static inline void delay (unsigned long loops
)
65 __asm__
volatile ("1:\n"
67 "bne 1b":"=r" (loops
):"0" (loops
));
71 * Miscellaneous platform dependent initialisations
76 S3C24X0_CLOCK_POWER
* const clk_power
= S3C24X0_GetBase_CLOCK_POWER();
77 S3C24X0_GPIO
* const gpio
= S3C24X0_GetBase_GPIO();
79 /* to reduce PLL lock time, adjust the LOCKTIME register */
80 clk_power
->LOCKTIME
= 0xFFFFFF;
83 clk_power
->MPLLCON
= ((M_MDIV
<< 12) + (M_PDIV
<< 4) + M_SDIV
);
85 /* some delay between MPLL and UPLL */
89 clk_power
->UPLLCON
= ((U_M_MDIV
<< 12) + (U_M_PDIV
<< 4) + U_M_SDIV
);
91 /* some delay between MPLL and UPLL */
94 /* set up the I/O ports */
95 gpio
->GPACON
= 0x007FFFFF;
96 gpio
->GPBCON
= 0x00044555;
97 gpio
->GPBUP
= 0x000007FF;
98 gpio
->GPCCON
= 0xAAAAAAAA;
99 gpio
->GPCUP
= 0x0000FFFF;
100 gpio
->GPDCON
= 0xAAAAAAAA;
101 gpio
->GPDUP
= 0x0000FFFF;
102 gpio
->GPECON
= 0xAAAAAAAA;
103 gpio
->GPEUP
= 0x0000FFFF;
104 gpio
->GPFCON
= 0x000055AA;
105 gpio
->GPFUP
= 0x000000FF;
106 gpio
->GPGCON
= 0xFF95FFBA;
107 //gpio->GPGUP = 0x0000FFFF;
108 gpio
->GPGUP
= 0x0000AFEF;
109 gpio
->GPHCON
= 0x0028FAAA;
110 gpio
->GPHUP
= 0x000007FF;
112 /* arch number of SMDK2410-Board */
113 gd
->bd
->bi_arch_number
= MACH_TYPE_QT2410
;
115 /* adress of boot parameters */
116 gd
->bd
->bi_boot_params
= 0x30000100;
124 #if defined(CONFIG_USB_DEVICE)
125 void udc_ctrl(enum usbd_event event
, int param
)
130 void board_video_init(GraphicDevice
*pGD
)
132 S3C24X0_LCD
* const lcd
= S3C24X0_GetBase_LCD();
134 /* FIXME: select LCM type by env variable */
136 /* Configuration for GTA01 LCM on QT2410 */
137 lcd
->LCDCON1
= 0x00000178; /* CLKVAL=1, BPPMODE=16bpp, TFT, ENVID=0 */
139 lcd
->LCDCON2
= 0x019fc3c1;
140 lcd
->LCDCON3
= 0x0039df67;
141 lcd
->LCDCON4
= 0x00000007;
142 lcd
->LCDCON5
= 0x0001cf09;
143 lcd
->LPCSEL
= 0x00000000;
148 gd
->bd
->bi_dram
[0].start
= PHYS_SDRAM_1
;
149 gd
->bd
->bi_dram
[0].size
= PHYS_SDRAM_1_SIZE
;
154 unsigned int dynpart_size
[] = {
155 CFG_UBOOT_SIZE
, 0x4000, 0x200000, 0xa0000, 0x3d5c000-CFG_UBOOT_SIZE
, 0 };
156 char *dynpart_names
[] = {
157 "u-boot", "u-boot_env", "kernel", "splash", "rootfs", NULL
};