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