summaryrefslogtreecommitdiff
path: root/board/samsung/smdkv310/smdkv310.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2011-06-01 22:04:29 +0200
committerWolfgang Denk <wd@denx.de>2011-06-01 22:04:29 +0200
commit1a0787d3c4f51cd1bcd2a1c71a2a10eccff0c3fd (patch)
tree9e20db24fbb05815e9c09963e7ea55a8c108dcb3 /board/samsung/smdkv310/smdkv310.c
parent54ca033b0f7f7cc627e191049fc6bdef79b8f3b9 (diff)
parent033cd2c42bf335d3b96e9612695f6c30b83dce2b (diff)
Merge branch 'master' of /home/wd/git/u-boot/custodians
* 'master' of /home/wd/git/u-boot/custodians: SMDKV310: Fix incorrect conditional compilation for MIU linear mapping SMDKV310: CPU fequency and mmc_pre_ratio modified armv7: Add support for ST-Ericsson U8500 href platform I2C: Add driver for ST-Ericsson U8500 i2c armv7: Add ST-Ericsson u8500 arch Kirkwood: boards cleanup for deprecated CONFIG_CMD_AUTOSCRIPT ARMV7: Vexpress: Add missing MMC header arm/km: update mgcoge3un board support mvgbe: enable configurability of PORT_SERIAL_CONTROL_VALUE arm/km: rename mgcoge2un to mgcoge3un arm/km: add second serial interface for kirkwood arm/km: disable ls (through jffs2 support) arm/km: introduce bootcount env variable and clean km_arm arm/km: move CONFIG_EXTRA_ENV_SETTINGS from board to km_arm file arm/km: remove CONFIG_SYS_KWD_CONFIG from keymile-common.h ARMV7: MMC SPL Boot support for SMDKV310 board ARMV7: Add support for Samsung SMDKV310 Board S5PC2XX: clock: support pwm clock for evt1 (cpu revision 1) S5P: add set_mmc_clk for external clock control S5PC2XX: Support the cpu revision S5P:SROM config code moved to s5p-common directory Add _end for the end of u-boot image for SMDK6400 MMC S5P: Fix typo S5P: GPIO Macro Values Corrected. SMDK2410: various cleanup/code style fixes SMDK2410: use the CFI driver (and remove the old one) SMDK2410: remove unneeded config.mk SMDK2410: activate ARM relocation feature BeagleBoard: fixed typo in typecast mvsata: issue hard reset on initialization VCMA9: use ARM relocation feature to fix build error MX31: drop warnings due to missing prototype for mxc_watchdog_reset() MX5: drop config.mk from efikamx board MX31: Make get_reset_cause() static and drop unreachable code MX53: Remove CONFIG_SYS_BOOTMAPSZ from mx53 config files. MX53: Handle silicon revision 2.1 case mx5: board: code clean up for checkboard code MX51: vision2: Fix build for vision2 board. MX51: vision: Let video mode struct be independant of watchdog. MX53: Add initial support for MX53SMD board. MX53: support for freescale MX53LOCO board mx5: Fix CONFIG_OF_LIBFDT redefined warning mx5: Remove unnecessary CONFIG_SYS_BOOTMAPSZ definition mx31pdk: Clean up mx31pdk.h file
Diffstat (limited to 'board/samsung/smdkv310/smdkv310.c')
-rw-r--r--board/samsung/smdkv310/smdkv310.c136
1 files changed, 136 insertions, 0 deletions
diff --git a/board/samsung/smdkv310/smdkv310.c b/board/samsung/smdkv310/smdkv310.c
new file mode 100644
index 0000000000..acf9ee7b87
--- /dev/null
+++ b/board/samsung/smdkv310/smdkv310.c
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <netdev.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/mmc.h>
+#include <asm/arch/sromc.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+struct s5pc210_gpio_part1 *gpio1;
+struct s5pc210_gpio_part2 *gpio2;
+
+static void smc9115_pre_init(void)
+{
+ u32 smc_bw_conf, smc_bc_conf;
+
+ /* gpio configuration GPK0CON */
+ gpio_cfg_pin(&gpio2->y0, CONFIG_ENV_SROM_BANK, GPIO_FUNC(2));
+
+ /* Ethernet needs bus width of 16 bits */
+ smc_bw_conf = SROMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK);
+ smc_bc_conf = SROMC_BC_TACS(0x0F) | SROMC_BC_TCOS(0x0F)
+ | SROMC_BC_TACC(0x0F) | SROMC_BC_TCOH(0x0F)
+ | SROMC_BC_TAH(0x0F) | SROMC_BC_TACP(0x0F)
+ | SROMC_BC_PMC(0x0F);
+
+ /* Select and configure the SROMC bank */
+ s5p_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
+}
+
+int board_init(void)
+{
+ gpio1 = (struct s5pc210_gpio_part1 *) S5PC210_GPIO_PART1_BASE;
+ gpio2 = (struct s5pc210_gpio_part2 *) S5PC210_GPIO_PART2_BASE;
+
+ smc9115_pre_init();
+
+ gd->bd->bi_arch_number = MACH_TYPE_SMDKV310;
+ gd->bd->bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
+ return 0;
+}
+
+int dram_init(void)
+{
+ gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE)
+ + get_ram_size((long *)PHYS_SDRAM_2, PHYS_SDRAM_2_SIZE)
+ + get_ram_size((long *)PHYS_SDRAM_3, PHYS_SDRAM_3_SIZE)
+ + get_ram_size((long *)PHYS_SDRAM_4, PHYS_SDRAM_4_SIZE);
+
+ return 0;
+}
+
+void dram_init_banksize(void)
+{
+ gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+ gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
+ gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
+ gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
+ gd->bd->bi_dram[2].start = PHYS_SDRAM_3;
+ gd->bd->bi_dram[2].size = PHYS_SDRAM_3_SIZE;
+ gd->bd->bi_dram[3].start = PHYS_SDRAM_4;
+ gd->bd->bi_dram[3].size = PHYS_SDRAM_4_SIZE;
+}
+
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_SMC911X
+ rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+ return rc;
+}
+
+#ifdef CONFIG_DISPLAY_BOARDINFO
+int checkboard(void)
+{
+ printf("\nBoard: SMDKV310\n");
+ return 0;
+}
+#endif
+
+#ifdef CONFIG_GENERIC_MMC
+int board_mmc_init(bd_t *bis)
+{
+ int i, err;
+
+ /*
+ * MMC2 SD card GPIO:
+ *
+ * GPK2[0] SD_2_CLK(2)
+ * GPK2[1] SD_2_CMD(2)
+ * GPK2[2] SD_2_CDn
+ * GPK2[3:6] SD_2_DATA[0:3](2)
+ */
+ for (i = 0; i < 7; i++) {
+ /* GPK2[0:6] special function 2 */
+ gpio_cfg_pin(&gpio2->k2, i, GPIO_FUNC(0x2));
+
+ /* GPK2[0:6] drv 4x */
+ gpio_set_drv(&gpio2->k2, i, GPIO_DRV_4X);
+
+ /* GPK2[0:1] pull disable */
+ if (i == 0 || i == 1) {
+ gpio_set_pull(&gpio2->k2, i, GPIO_PULL_NONE);
+ continue;
+ }
+
+ /* GPK2[2:6] pull up */
+ gpio_set_pull(&gpio2->k2, i, GPIO_PULL_UP);
+ }
+ err = s5p_mmc_init(2, 4);
+ return err;
+}
+#endif