diff options
Diffstat (limited to 'roms/u-boot/board/ti/sdp4430')
-rw-r--r-- | roms/u-boot/board/ti/sdp4430/Kconfig | 15 | ||||
-rw-r--r-- | roms/u-boot/board/ti/sdp4430/MAINTAINERS | 6 | ||||
-rw-r--r-- | roms/u-boot/board/ti/sdp4430/Makefile | 10 | ||||
-rw-r--r-- | roms/u-boot/board/ti/sdp4430/cmd_bat.c | 41 | ||||
-rw-r--r-- | roms/u-boot/board/ti/sdp4430/sdp.c | 113 | ||||
-rw-r--r-- | roms/u-boot/board/ti/sdp4430/sdp4430_mux_data.h | 67 |
6 files changed, 252 insertions, 0 deletions
diff --git a/roms/u-boot/board/ti/sdp4430/Kconfig b/roms/u-boot/board/ti/sdp4430/Kconfig new file mode 100644 index 000000000..36f185282 --- /dev/null +++ b/roms/u-boot/board/ti/sdp4430/Kconfig @@ -0,0 +1,15 @@ +if TARGET_OMAP4_SDP4430 + +config SYS_BOARD + default "sdp4430" + +config SYS_VENDOR + default "ti" + +config SYS_CONFIG_NAME + default "omap4_sdp4430" + +config CMD_BAT + bool "Enable board-specific battery command" + +endif diff --git a/roms/u-boot/board/ti/sdp4430/MAINTAINERS b/roms/u-boot/board/ti/sdp4430/MAINTAINERS new file mode 100644 index 000000000..ac4d0ccc1 --- /dev/null +++ b/roms/u-boot/board/ti/sdp4430/MAINTAINERS @@ -0,0 +1,6 @@ +SDP4430 BOARD +M: Lokesh Vutla <lokeshvutla@ti.com> +S: Maintained +F: board/ti/sdp4430/ +F: include/configs/omap4_sdp4430.h +F: configs/omap4_sdp4430_defconfig diff --git a/roms/u-boot/board/ti/sdp4430/Makefile b/roms/u-boot/board/ti/sdp4430/Makefile new file mode 100644 index 000000000..ae0694561 --- /dev/null +++ b/roms/u-boot/board/ti/sdp4430/Makefile @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2000, 2001, 2002 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. + +obj-y := sdp.o + +ifndef CONFIG_SPL_BUILD +obj-y += cmd_bat.o +endif diff --git a/roms/u-boot/board/ti/sdp4430/cmd_bat.c b/roms/u-boot/board/ti/sdp4430/cmd_bat.c new file mode 100644 index 000000000..6c1e6ca39 --- /dev/null +++ b/roms/u-boot/board/ti/sdp4430/cmd_bat.c @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2010 Texas Instruments + */ + +#include <common.h> +#include <command.h> + +#ifdef CONFIG_CMD_BAT +#include <twl6030.h> + +int do_vbat(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) +{ + if (argc == 2) { + if (strncmp(argv[1], "startcharge", 12) == 0) + twl6030_start_usb_charging(); + else if (strncmp(argv[1], "stopcharge", 11) == 0) + twl6030_stop_usb_charging(); + else if (strncmp(argv[1], "status", 7) == 0) { + twl6030_get_battery_voltage(); + twl6030_get_battery_current(); + } else { + goto bat_cmd_usage; + } + } else { + goto bat_cmd_usage; + } + return 0; + +bat_cmd_usage: + return cmd_usage(cmdtp); +} + +U_BOOT_CMD( + bat, 2, 1, do_vbat, + "battery charging, voltage/current measurements", + "status - display battery voltage and current\n" + "bat startcharge - start charging via USB\n" + "bat stopcharge - stop charging\n" +); +#endif /* CONFIG_CMD_BAT */ diff --git a/roms/u-boot/board/ti/sdp4430/sdp.c b/roms/u-boot/board/ti/sdp4430/sdp.c new file mode 100644 index 000000000..4895bfafd --- /dev/null +++ b/roms/u-boot/board/ti/sdp4430/sdp.c @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2010 + * Texas Instruments Incorporated, <www.ti.com> + * Aneesh V <aneesh@ti.com> + * Steve Sakoman <steve@sakoman.com> + */ +#include <common.h> +#include <init.h> +#include <net.h> +#include <twl6030.h> +#include <serial.h> +#include <asm/arch/sys_proto.h> +#include <asm/arch/mmc_host_def.h> +#include <asm/global_data.h> + +#include "sdp4430_mux_data.h" + +DECLARE_GLOBAL_DATA_PTR; + +const struct omap_sysinfo sysinfo = { + "Board: OMAP4430 SDP\n" +}; + +/** + * @brief board_init + * + * @return 0 + */ +int board_init(void) +{ + gpmc_init(); + + gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */ + + return 0; +} + +int board_eth_init(struct bd_info *bis) +{ + return 0; +} + +/** + * @brief misc_init_r - Configure SDP board specific configurations + * such as power configurations, ethernet initialization as phase2 of + * boot sequence + * + * @return 0 + */ +int misc_init_r(void) +{ +#ifdef CONFIG_TWL6030_POWER + twl6030_init_battery_charging(); +#endif + return 0; +} + +void set_muxconf_regs(void) +{ + do_set_mux((*ctrl)->control_padconf_core_base, + core_padconf_array_essential, + sizeof(core_padconf_array_essential) / + sizeof(struct pad_conf_entry)); + + do_set_mux((*ctrl)->control_padconf_wkup_base, + wkup_padconf_array_essential, + sizeof(wkup_padconf_array_essential) / + sizeof(struct pad_conf_entry)); + + if ((omap_revision() >= OMAP4460_ES1_0) && + (omap_revision() < OMAP4470_ES1_0)) + do_set_mux((*ctrl)->control_padconf_wkup_base, + wkup_padconf_array_essential_4460, + sizeof(wkup_padconf_array_essential_4460) / + sizeof(struct pad_conf_entry)); +} + +#if defined(CONFIG_MMC) +int board_mmc_init(struct bd_info *bis) +{ + omap_mmc_init(0, 0, 0, -1, -1); + omap_mmc_init(1, 0, 0, -1, -1); + return 0; +} + +#if !defined(CONFIG_SPL_BUILD) +void board_mmc_power_init(void) +{ + twl6030_power_mmc_init(0); + twl6030_power_mmc_init(1); +} +#endif +#endif + +#if defined(CONFIG_SPL_OS_BOOT) +int spl_start_uboot(void) +{ + /* break into full u-boot on 'c' */ + if (serial_tstc() && serial_getc() == 'c') + return 1; + + return 0; +} +#endif /* CONFIG_SPL_OS_BOOT */ + +/* + * get_board_rev() - get board revision + */ +u32 get_board_rev(void) +{ + return 0x20; +} diff --git a/roms/u-boot/board/ti/sdp4430/sdp4430_mux_data.h b/roms/u-boot/board/ti/sdp4430/sdp4430_mux_data.h new file mode 100644 index 000000000..934419f40 --- /dev/null +++ b/roms/u-boot/board/ti/sdp4430/sdp4430_mux_data.h @@ -0,0 +1,67 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * (C) Copyright 2010 + * Texas Instruments Incorporated, <www.ti.com> + * + * Balaji Krishnamoorthy <balajitk@ti.com> + * Aneesh V <aneesh@ti.com> + */ +#ifndef _SDP4430_MUX_DATA_H +#define _SDP4430_MUX_DATA_H + +#include <asm/arch/mux_omap4.h> + +const struct pad_conf_entry core_padconf_array_essential[] = { + +{GPMC_AD0, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat0 */ +{GPMC_AD1, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat1 */ +{GPMC_AD2, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat2 */ +{GPMC_AD3, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat3 */ +{GPMC_AD4, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat4 */ +{GPMC_AD5, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat5 */ +{GPMC_AD6, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat6 */ +{GPMC_AD7, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_dat7 */ +{GPMC_NOE, (PTU | IEN | OFF_EN | OFF_OUT_PTD | M1)}, /* sdmmc2_clk */ +{GPMC_NWE, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M1)}, /* sdmmc2_cmd */ +{SDMMC1_CLK, (PTU | OFF_EN | OFF_OUT_PTD | M0)}, /* sdmmc1_clk */ +{SDMMC1_CMD, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_cmd */ +{SDMMC1_DAT0, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat0 */ +{SDMMC1_DAT1, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat1 */ +{SDMMC1_DAT2, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat2 */ +{SDMMC1_DAT3, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat3 */ +{SDMMC1_DAT4, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat4 */ +{SDMMC1_DAT5, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat5 */ +{SDMMC1_DAT6, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat6 */ +{SDMMC1_DAT7, (PTU | IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* sdmmc1_dat7 */ +{UART3_CTS_RCTX, (PTU | IEN | M0)}, /* uart3_tx */ +{UART3_RTS_SD, (M0)}, /* uart3_rts_sd */ +{UART3_RX_IRRX, (IEN | M0)}, /* uart3_rx */ +{UART3_TX_IRTX, (M0)}, /* uart3_tx */ +{USBB1_ULPITLL_DAT4, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat4 */ +{USBB1_ULPITLL_DAT5, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat5 */ +{USBB1_ULPITLL_DAT6, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat6 */ +{USBB1_ULPITLL_DAT7, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* usbb1_ulpiphy_dat7 */ +{USBB1_HSIC_DATA, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* usbb1_hsic_data */ +{USBB1_HSIC_STROBE, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* usbb1_hsic_strobe */ +{USBC1_ICUSB_DP, (IEN | M0)}, /* usbc1_icusb_dp */ +{USBC1_ICUSB_DM, (IEN | M0)}, /* usbc1_icusb_dm */ +{USBA0_OTG_CE, (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M0)}, /* usba0_otg_ce */ +{USBA0_OTG_DP, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* usba0_otg_dp */ +{USBA0_OTG_DM, (IEN | OFF_EN | OFF_PD | OFF_IN | M0)}, /* usba0_otg_dm */ +}; + +const struct pad_conf_entry wkup_padconf_array_essential[] = { + +{PAD1_SR_SCL, (PTU | IEN | M0)}, /* sr_scl */ +{PAD0_SR_SDA, (PTU | IEN | M0)}, /* sr_sda */ +{PAD1_SYS_32K, (IEN | M0)} /* sys_32k */ + +}; + +const struct pad_conf_entry wkup_padconf_array_essential_4460[] = { + +{PAD1_FREF_CLK4_REQ, (M3)}, /* gpio_wk7 for TPS: Mode 3 */ + +}; + +#endif /* _SDP4430_MUX_DATA_H */ |