2 * Copyright (C) 2009 Juergen Beisert, Pengutronix
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * @brief a9m2410 Specific Board Initialization routines
30 #include <asm/armlinux.h>
31 #include <asm/mach-types.h>
32 #include <partition.h>
35 #include <mach/s3c24x0-iomap.h>
36 #include <mach/s3c24x0-nand.h>
38 static struct memory_platform_data ram_pdata
= {
43 static struct device_d sdram_dev
= {
46 .platform_data
= &ram_pdata
,
49 // {"NAND 1MiB 3,3V 8-bit", 0xec, 256, 1, 0x1000, 0},
50 static struct s3c24x0_nand_platform_data nand_info
= {
51 .nand_timing
= CALC_NFCONF_TIMING(A9M2410_TACLS
, A9M2410_TWRPH0
, A9M2410_TWRPH1
)
54 static struct device_d nand_dev
= {
55 .name
= "s3c24x0_nand",
56 .map_base
= S3C24X0_NAND_BASE
,
57 .platform_data
= &nand_info
,
61 * SMSC 91C111 network controller on the baseboard
62 * connected to CS line 1 and interrupt line
63 * GPIO3, data width is 32 bit
65 static struct device_d network_dev
= {
67 .map_base
= CS1_BASE
+ 0x300,
71 static int a9m2410_devices_init(void)
76 * detect the current memory size
77 * Note: On this card the second SDRAM page is not used
79 reg
= readl(BANKSIZE
);
83 sdram_dev
.size
= 32 * 1024 * 1024;
86 sdram_dev
.size
= 64 * 1024 * 1024;
89 sdram_dev
.size
= 128 * 1024 * 1024;
92 sdram_dev
.size
= 2 * 1024 * 1024;
95 sdram_dev
.size
= 4 * 1024 * 1024;
98 sdram_dev
.size
= 8 * 1024 * 1024;
101 sdram_dev
.size
= 16 * 1024 * 1024;
105 /* ---------- configure the GPIOs ------------- */
106 writel(0x007FFFFF, GPACON
);
107 writel(0x00000000, GPCCON
);
108 writel(0x00000000, GPCUP
);
109 writel(0x00000000, GPDCON
);
110 writel(0x00000000, GPDUP
);
111 writel(0xAAAAAAAA, GPECON
);
112 writel(0x0000E03F, GPEUP
);
113 writel(0x00000000, GPBCON
); /* all inputs */
114 writel(0x00000007, GPBUP
); /* pullup disabled for GPB0..3 */
115 writel(0x00009000, GPFCON
); /* GPF7 CLK_INT#, GPF6 Debug-LED */
116 writel(0x000000FF, GPFUP
);
117 writel(readl(GPGDAT
) | 0x0010, GPGDAT
); /* switch off LCD backlight */
118 writel(0xFF00A938, GPGCON
); /* switch off USB device */
119 writel(0x0000F000, GPGUP
);
120 writel(readl(GPHDAT
) | 0x100, GPHDAT
); /* switch BOOTINT/GPIO_ON# to high */
121 writel(0x000007FF, GPHUP
);
122 writel(0x0029FAAA, GPHCON
);
124 * USB port1 normal, USB port0 normal, USB1 pads for device
125 * PCLK output on CLKOUT0, UPLL CLK output on CLKOUT1,
126 * 2nd SDRAM bank off (only bank 1 is used)
128 writel(0x40140, MISCCR
);
130 /* ----------- configure the access to the outer space ---------- */
133 /* CS#1 to access the network controller */
136 writel(0x1350, BANKCON1
);
138 /* CS#2 to the dual 16550 UART */
141 writel(0x0d50, BANKCON2
);
145 /* release the reset signal to the network and UART device */
150 /* ----------- the devices the boot loader should work with -------- */
151 register_device(&nand_dev
);
152 register_device(&sdram_dev
);
153 register_device(&network_dev
);
156 /* ----------- add some vital partitions -------- */
157 devfs_add_partition("nand0", 0x00000, 0x40000, PARTITION_FIXED
, "self_raw");
158 dev_add_bb_dev("self_raw", "self0");
160 devfs_add_partition("nand0", 0x40000, 0x20000, PARTITION_FIXED
, "env_raw");
161 dev_add_bb_dev("env_raw", "env0");
164 armlinux_add_dram(&sdram_dev
);
165 armlinux_set_bootparams((void *)sdram_dev
.map_base
+ 0x100);
166 armlinux_set_architecture(MACH_TYPE_A9M2410
);
171 device_initcall(a9m2410_devices_init
);
173 #ifdef CONFIG_S3C24XX_NAND_BOOT
174 void __bare_init
nand_boot(void)
176 s3c24x0_nand_load_image((void *)TEXT_BASE
, 256 * 1024, 0, 512);
180 static struct device_d a9m2410_serial_device
= {
181 .name
= "s3c24x0_serial",
182 .map_base
= UART1_BASE
,
186 static int a9m2410_console_init(void)
188 register_device(&a9m2410_serial_device
);
192 console_initcall(a9m2410_console_init
);
194 /** @page a9m2410 DIGI's a9m2410
196 This CPU card is based on a Samsung S3C2410 CPU. The card is shipped with:
198 - S3C2410\@200 MHz (ARM920T/ARMv4T)
199 - 12MHz crystal reference
201 - Samsung K4M563233E-EE1H
202 - 2M x 32Bit x 4 Banks Mobile SDRAM
204 - CL3\@133MHz, CL2\@100MHz (CAS/RAS delay 19ns)
207 - row address size is 11
208 - Row cycle time: 69ns
209 - collumn address size is 9 bits
210 - Extended temperature range (-25°C...85°C)
211 - 64ms refresh period (4k)
215 - ID: 0xEC, 0x75, 0x??, 0xBD
217 - I2C interface, 100KHz and 400KHz
226 - Touch Screen interface
229 - AC97 Audio-CODEC interface
231 - 3 serial RS232 interfaces
232 - Host and device USB interface, USB1.1 compliant
234 - 10Mbps, Cirrus Logic, CS8900A (on the CPU card) or
235 - 10/100Mbps, SMSC 91C111 (on the baseboard)
239 How to get the binary image:
241 Using the default configuration:
244 make ARCH=arm a9m2410_defconfig
247 Build the binary image:
250 make ARCH=arm CROSS_COMPILE=armv4compiler
253 @note replace the armv4compiler with your ARM v4 cross compiler.