diff options
author | Dmitry Lifshitz <lifshitz@compulab.co.il> | 2016-12-28 18:28:33 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-01-02 11:14:06 -0500 |
commit | 46650d583b8067c8aecf2ddea585e8a97f937d0c (patch) | |
tree | 50b31d30927a7692eb92ee7924e22da80c7ab53f /board/compulab/cl-som-am57x/cl-som-am57x.c | |
parent | 6d799d04a843b85b0842b7c266a16b3c515b8c35 (diff) |
arm: am57xx: cl-som-am57x: add initial board support
Features supported :
* Serial console
* SPI Flash
* MMC/SD Card
* eMMC storage
* SATA
* PCA9555 - GPIO expander over I2C5 bus
* USB
Use spl alternate boot device feature to define fallback to
the main boot device as it is defined by hardware.
Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
[uri.mashiach@compulab.co.il: Adjust to v2016.11]
Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Diffstat (limited to 'board/compulab/cl-som-am57x/cl-som-am57x.c')
-rw-r--r-- | board/compulab/cl-som-am57x/cl-som-am57x.c | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/board/compulab/cl-som-am57x/cl-som-am57x.c b/board/compulab/cl-som-am57x/cl-som-am57x.c new file mode 100644 index 0000000000..4bad6440f3 --- /dev/null +++ b/board/compulab/cl-som-am57x/cl-som-am57x.c @@ -0,0 +1,62 @@ +/* + * Board functions for CompuLab cl_som_am57x board + * + * (C) Copyright 2016 CompuLab, Ltd. http://compulab.co.il/ + * + * Author: Dmitry Lifshitz <lifshitz@compulab.co.il> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <palmas.h> +#include <usb.h> +#include <asm/gpio.h> +#include <asm/arch/mmc_host_def.h> +#include <asm/arch/sys_proto.h> + +DECLARE_GLOBAL_DATA_PTR; + +const struct omap_sysinfo sysinfo = { + "Board: CL-SOM-AM57x\n" +}; + +int board_init(void) +{ + /* Disable PMIC Powerhold feature, DEV_CTRL.DEV_ON = 1 */ + palmas_i2c_write_u8(TPS65903X_CHIP_P1, 0xA0, 0x1); + + gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; + + return 0; +} + +#ifdef CONFIG_GENERIC_MMC +#define SB_SOM_CD_GPIO 187 +#define SB_SOM_WP_GPIO 188 + +int board_mmc_init(bd_t *bis) +{ + int ret0, ret1; + + ret0 = omap_mmc_init(0, 0, 0, SB_SOM_CD_GPIO, SB_SOM_WP_GPIO); + if (ret0) + printf("cl-som-am57x: failed to initialize mmc0\n"); + + ret1 = omap_mmc_init(1, 0, 0, -1, -1); + if (ret1) + printf("cl-som-am57x: failed to initialize mmc1\n"); + + return ret0 && ret1; +} +#endif /* CONFIG_GENERIC_MMC */ + +#ifdef CONFIG_USB_XHCI_OMAP +int board_usb_init(int index, enum usb_init_type init) +{ + setbits_le32((*prcm)->cm_l3init_usb_otg_ss1_clkctrl, + OTG_SS_CLKCTRL_MODULEMODE_HW | OPTFCLKEN_REFCLK960M); + + return 0; +} +#endif /* CONFIG_USB_XHCI_OMAP */ |