blob: d7dc8a42e4f200d331165a3cbec48c04b53d9c69 [file] [log] [blame]
Dmitry Lifshitz10a59d02016-12-28 18:28:33 +02001/*
2 * Board functions for CompuLab cl_som_am57x board
3 *
4 * (C) Copyright 2016 CompuLab, Ltd. http://compulab.co.il/
5 *
6 * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
7 *
8 * SPDX-License-Identifier: GPL-2.0+
9 */
10
11#include <common.h>
12#include <palmas.h>
13#include <usb.h>
14#include <asm/gpio.h>
15#include <asm/arch/mmc_host_def.h>
16#include <asm/arch/sys_proto.h>
Dmitry Lifshitz39f9cf02016-12-28 18:28:34 +020017#include "../common/common.h"
18#include "../common/eeprom.h"
Faiz Abbas29836a92018-02-15 17:12:11 +053019#include <asm/omap_common.h>
Dmitry Lifshitz10a59d02016-12-28 18:28:33 +020020
21DECLARE_GLOBAL_DATA_PTR;
22
23const struct omap_sysinfo sysinfo = {
24 "Board: CL-SOM-AM57x\n"
25};
26
27int board_init(void)
28{
29 /* Disable PMIC Powerhold feature, DEV_CTRL.DEV_ON = 1 */
30 palmas_i2c_write_u8(TPS65903X_CHIP_P1, 0xA0, 0x1);
31
32 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
33
34 return 0;
35}
36
Masahiro Yamada0a780172017-05-09 20:31:39 +090037#ifdef CONFIG_MMC
Dmitry Lifshitz10a59d02016-12-28 18:28:33 +020038#define SB_SOM_CD_GPIO 187
39#define SB_SOM_WP_GPIO 188
40
41int board_mmc_init(bd_t *bis)
42{
43 int ret0, ret1;
44
45 ret0 = omap_mmc_init(0, 0, 0, SB_SOM_CD_GPIO, SB_SOM_WP_GPIO);
46 if (ret0)
47 printf("cl-som-am57x: failed to initialize mmc0\n");
48
49 ret1 = omap_mmc_init(1, 0, 0, -1, -1);
50 if (ret1)
51 printf("cl-som-am57x: failed to initialize mmc1\n");
52
53 return ret0 && ret1;
54}
Masahiro Yamada0a780172017-05-09 20:31:39 +090055#endif /* CONFIG_MMC */
Dmitry Lifshitz10a59d02016-12-28 18:28:33 +020056
Dmitry Lifshitz39f9cf02016-12-28 18:28:34 +020057int misc_init_r(void)
58{
59 cl_print_pcb_info();
60
61 return 0;
62}
63
64u32 get_board_rev(void)
65{
66 return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
67}
Faiz Abbas29836a92018-02-15 17:12:11 +053068
69int board_usb_init(int index, enum usb_init_type init)
70{
71 enable_usb_clocks(index);
72 return 0;
73}
74
75int board_usb_cleanup(int index, enum usb_init_type init)
76{
77 disable_usb_clocks(index);
78 return 0;
79}