omap3: cm-t3517: add basic board support
[platform/kernel/u-boot.git] / board / compulab / cm_t3517 / cm_t3517.c
1 /*
2  * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
3  *
4  * Authors: Igor Grinberg <grinberg@compulab.co.il>
5  *
6  * SPDX-License-Identifier:     GPL-2.0+
7  */
8
9 #include <common.h>
10 #include <status_led.h>
11 #include <mmc.h>
12 #include <linux/compiler.h>
13
14 #include <asm/io.h>
15 #include <asm/arch/mem.h>
16 #include <asm/arch/am35x_def.h>
17 #include <asm/arch/mmc_host_def.h>
18 #include <asm/arch/sys_proto.h>
19
20 #include "../common/common.h"
21
22 DECLARE_GLOBAL_DATA_PTR;
23
24 const omap3_sysinfo sysinfo = {
25         DDR_DISCRETE,
26         "CM-T3517 board",
27         "NAND 128/512M",
28 };
29
30 int board_init(void)
31 {
32         gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
33
34         /* boot param addr */
35         gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
36
37 #if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
38         status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
39 #endif
40
41         return 0;
42 }
43
44 int misc_init_r(void)
45 {
46         cl_print_pcb_info();
47         dieid_num_r();
48
49         return 0;
50 }
51
52 #if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
53 #define SB_T35_CD_GPIO 144
54 #define SB_T35_WP_GPIO 59
55
56 int board_mmc_init(bd_t *bis)
57 {
58         return omap_mmc_init(0, 0, 0, SB_T35_CD_GPIO, SB_T35_WP_GPIO);
59 }
60 #endif