* [U-Boot] [PATCH 0/4] ARM: OMAP5: add cm-t54 board support
@ 2014-04-27 10:17 Dmitry Lifshitz
2014-04-27 10:17 ` [U-Boot] [PATCH 1/4] ARM: OMAP5: add UART4 support Dmitry Lifshitz
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Dmitry Lifshitz @ 2014-04-27 10:17 UTC (permalink / raw)
To: u-boot
Add support for CompuLab cm-t54 CoM, based on OMAP5432 CPU.
http://compulab.co.il/products/computer-on-modules/cm-t54/
Basic support includes:
* Boot from MMC/SD and eMMC
* USB
* LAN
Dmitry Lifshitz (4):
ARM: OMAP5: add UART4 support
ARM: OMAP5: Power: add LDO2 support for Palmas driver
ARM: OMAP5: add CKO buffer control mask
cm-t54: add cm-t54 board support
arch/arm/include/asm/arch-omap5/clock.h | 3 +
arch/arm/include/asm/arch-omap5/omap.h | 1 +
board/compulab/cm_t54/Makefile | 10 ++
board/compulab/cm_t54/cm_t54.c | 177 +++++++++++++++++++++++++++++++
board/compulab/cm_t54/mux.c | 94 ++++++++++++++++
board/compulab/cm_t54/spl.c | 66 ++++++++++++
boards.cfg | 1 +
include/configs/cm_t54.h | 144 +++++++++++++++++++++++++
include/palmas.h | 4 +
9 files changed, 500 insertions(+), 0 deletions(-)
create mode 100644 board/compulab/cm_t54/Makefile
create mode 100644 board/compulab/cm_t54/cm_t54.c
create mode 100644 board/compulab/cm_t54/mux.c
create mode 100644 board/compulab/cm_t54/spl.c
create mode 100644 include/configs/cm_t54.h
--
1.7.5.4
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 1/4] ARM: OMAP5: add UART4 support
2014-04-27 10:17 [U-Boot] [PATCH 0/4] ARM: OMAP5: add cm-t54 board support Dmitry Lifshitz
@ 2014-04-27 10:17 ` Dmitry Lifshitz
2014-05-14 1:35 ` [U-Boot] [U-Boot,1/4] " Tom Rini
2014-04-27 10:17 ` [U-Boot] [PATCH 2/4] ARM: OMAP5: Power: add LDO2 support for Palmas driver Dmitry Lifshitz
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Dmitry Lifshitz @ 2014-04-27 10:17 UTC (permalink / raw)
To: u-boot
Add UART4 base address.
Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
---
arch/arm/include/asm/arch-omap5/omap.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/arch-omap5/omap.h b/arch/arm/include/asm/arch-omap5/omap.h
index 19fdece..e35a81a 100644
--- a/arch/arm/include/asm/arch-omap5/omap.h
+++ b/arch/arm/include/asm/arch-omap5/omap.h
@@ -50,6 +50,7 @@
#define UART1_BASE (OMAP54XX_L4_PER_BASE + 0x6a000)
#define UART2_BASE (OMAP54XX_L4_PER_BASE + 0x6c000)
#define UART3_BASE (OMAP54XX_L4_PER_BASE + 0x20000)
+#define UART4_BASE (OMAP54XX_L4_PER_BASE + 0x6e000)
/* General Purpose Timers */
#define GPT1_BASE (OMAP54XX_L4_WKUP_BASE + 0x18000)
--
1.7.5.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 2/4] ARM: OMAP5: Power: add LDO2 support for Palmas driver
2014-04-27 10:17 [U-Boot] [PATCH 0/4] ARM: OMAP5: add cm-t54 board support Dmitry Lifshitz
2014-04-27 10:17 ` [U-Boot] [PATCH 1/4] ARM: OMAP5: add UART4 support Dmitry Lifshitz
@ 2014-04-27 10:17 ` Dmitry Lifshitz
2014-05-14 1:36 ` [U-Boot] [U-Boot, " Tom Rini
2014-04-27 10:17 ` [U-Boot] [PATCH 3/4] ARM: OMAP5: add CKO buffer control mask Dmitry Lifshitz
2014-04-27 10:17 ` [U-Boot] [PATCH 4/4] cm-t54: add cm-t54 board support Dmitry Lifshitz
3 siblings, 1 reply; 12+ messages in thread
From: Dmitry Lifshitz @ 2014-04-27 10:17 UTC (permalink / raw)
To: u-boot
Add defines required to turn on LDO2 regulator.
Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
---
include/palmas.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/palmas.h b/include/palmas.h
index eaf3670..cca3f9a 100644
--- a/include/palmas.h
+++ b/include/palmas.h
@@ -24,6 +24,10 @@
#define LDO1_CTRL 0x50
#define LDO1_VOLTAGE 0x51
+/* LDO2 control/voltage */
+#define LDO2_CTRL 0x52
+#define LDO2_VOLTAGE 0x53
+
/* LDO9 control/voltage */
#define LDO9_CTRL 0x60
#define LDO9_VOLTAGE 0x61
--
1.7.5.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 3/4] ARM: OMAP5: add CKO buffer control mask
2014-04-27 10:17 [U-Boot] [PATCH 0/4] ARM: OMAP5: add cm-t54 board support Dmitry Lifshitz
2014-04-27 10:17 ` [U-Boot] [PATCH 1/4] ARM: OMAP5: add UART4 support Dmitry Lifshitz
2014-04-27 10:17 ` [U-Boot] [PATCH 2/4] ARM: OMAP5: Power: add LDO2 support for Palmas driver Dmitry Lifshitz
@ 2014-04-27 10:17 ` Dmitry Lifshitz
2014-05-14 1:36 ` [U-Boot] [U-Boot,3/4] " Tom Rini
2014-04-27 10:17 ` [U-Boot] [PATCH 4/4] cm-t54: add cm-t54 board support Dmitry Lifshitz
3 siblings, 1 reply; 12+ messages in thread
From: Dmitry Lifshitz @ 2014-04-27 10:17 UTC (permalink / raw)
To: u-boot
Add CKOBUFFER_CLK_EN bit mask enabling FREF_XTAL_CLK clock.
Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
---
arch/arm/include/asm/arch-omap5/clock.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/arch-omap5/clock.h b/arch/arm/include/asm/arch-omap5/clock.h
index 2dfe4ef..30d9de2 100644
--- a/arch/arm/include/asm/arch-omap5/clock.h
+++ b/arch/arm/include/asm/arch-omap5/clock.h
@@ -322,6 +322,9 @@
#define V_SCLK V_OSCK
+/* CKO buffer control */
+#define CKOBUFFER_CLK_ENABLE_MASK (1 << 28)
+
/* AUXCLKx reg fields */
#define AUXCLK_ENABLE_MASK (1 << 8)
#define AUXCLK_SRCSELECT_SHIFT 1
--
1.7.5.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 4/4] cm-t54: add cm-t54 board support
2014-04-27 10:17 [U-Boot] [PATCH 0/4] ARM: OMAP5: add cm-t54 board support Dmitry Lifshitz
` (2 preceding siblings ...)
2014-04-27 10:17 ` [U-Boot] [PATCH 3/4] ARM: OMAP5: add CKO buffer control mask Dmitry Lifshitz
@ 2014-04-27 10:17 ` Dmitry Lifshitz
2014-05-06 17:45 ` Tom Rini
3 siblings, 1 reply; 12+ messages in thread
From: Dmitry Lifshitz @ 2014-04-27 10:17 UTC (permalink / raw)
To: u-boot
Add cm-t54 board directory, config file. Enable build.
Basic support includes:
Serial console
SD/MMC
eMMC
USB
Ethernet
Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
---
board/compulab/cm_t54/Makefile | 10 ++
board/compulab/cm_t54/cm_t54.c | 177 ++++++++++++++++++++++++++++++++++++++++
board/compulab/cm_t54/mux.c | 94 +++++++++++++++++++++
board/compulab/cm_t54/spl.c | 66 +++++++++++++++
boards.cfg | 1 +
include/configs/cm_t54.h | 144 ++++++++++++++++++++++++++++++++
6 files changed, 492 insertions(+), 0 deletions(-)
create mode 100644 board/compulab/cm_t54/Makefile
create mode 100644 board/compulab/cm_t54/cm_t54.c
create mode 100644 board/compulab/cm_t54/mux.c
create mode 100644 board/compulab/cm_t54/spl.c
create mode 100644 include/configs/cm_t54.h
diff --git a/board/compulab/cm_t54/Makefile b/board/compulab/cm_t54/Makefile
new file mode 100644
index 0000000..bd8bc51
--- /dev/null
+++ b/board/compulab/cm_t54/Makefile
@@ -0,0 +1,10 @@
+#
+# Copyright (C) 2014 Compulab Ltd - http://compulab.co.il/
+#
+# Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y += $(BOARD).o
+obj-$(CONFIG_SPL_BUILD) += mux.o spl.o
diff --git a/board/compulab/cm_t54/cm_t54.c b/board/compulab/cm_t54/cm_t54.c
new file mode 100644
index 0000000..1a4be72
--- /dev/null
+++ b/board/compulab/cm_t54/cm_t54.c
@@ -0,0 +1,177 @@
+/*
+ * Board functions for Compulab CM-T54 board
+ *
+ * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+ *
+ * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <usb.h>
+#include <mmc.h>
+#include <palmas.h>
+
+#include <asm/gpio.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/mmc_host_def.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/ehci.h>
+#include <asm/ehci-omap.h>
+
+#define DIE_ID_REG_BASE (OMAP54XX_L4_CORE_BASE + 0x2000)
+#define DIE_ID_REG_OFFSET 0x200
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#if !defined(CONFIG_SPL_BUILD)
+inline void set_muxconf_regs_essential(void){};
+#endif
+
+const struct omap_sysinfo sysinfo = {
+ "Board: CM-T54\n"
+};
+
+/*
+ * Routine: board_init
+ * Description: hardware init.
+ */
+int board_init(void)
+{
+ gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
+
+ return 0;
+}
+
+/*
+ * Routine: cm_t54_palmas_regulator_set
+ * Description: select voltage and turn on/off Palmas PMIC regulator.
+ */
+static int cm_t54_palmas_regulator_set(u8 vreg, u8 vval, u8 creg, u8 cval)
+{
+ int err;
+
+ /* Setup voltage */
+ err = palmas_i2c_write_u8(TWL603X_CHIP_P1, vreg, vval);
+ if (err) {
+ printf("cm_t54: could not set regulator 0x%02x voltage : %d\n",
+ vreg, err);
+ return err;
+ }
+
+ /* Turn on/off regulator */
+ err = palmas_i2c_write_u8(TWL603X_CHIP_P1, creg, cval);
+ if (err) {
+ printf("cm_t54: could not turn on/off regulator 0x%02x : %d\n",
+ creg, err);
+ return err;
+ }
+
+ return 0;
+}
+
+#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#define SB_T54_CD_GPIO 228
+#define SB_T54_WP_GPIO 229
+
+int board_mmc_getcd(struct mmc *mmc)
+{
+ return !gpio_get_value(SB_T54_CD_GPIO);
+}
+
+int board_mmc_init(bd_t *bis)
+{
+ int ret0, ret1;
+
+ ret0 = omap_mmc_init(0, 0, 0, -1, SB_T54_WP_GPIO);
+ if (ret0)
+ printf("cm_t54: failed to initialize mmc0\n");
+
+ ret1 = omap_mmc_init(1, 0, 0, -1, -1);
+ if (ret1)
+ printf("cm_t54: failed to initialize mmc1\n");
+
+ if (ret0 && ret1)
+ return -1;
+
+ return 0;
+}
+#endif
+
+#ifdef CONFIG_USB_EHCI
+static struct omap_usbhs_board_data usbhs_bdata = {
+ .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
+ .port_mode[1] = OMAP_EHCI_PORT_MODE_HSIC,
+ .port_mode[2] = OMAP_EHCI_PORT_MODE_HSIC,
+};
+
+static void setup_host_clocks(bool enable)
+{
+ int usbhost_clk = OPTFCLKEN_HSIC60M_P3_CLK |
+ OPTFCLKEN_HSIC480M_P3_CLK |
+ OPTFCLKEN_HSIC60M_P2_CLK |
+ OPTFCLKEN_HSIC480M_P2_CLK |
+ OPTFCLKEN_UTMI_P3_CLK |
+ OPTFCLKEN_UTMI_P2_CLK;
+
+ int usbtll_clk = OPTFCLKEN_USB_CH1_CLK_ENABLE |
+ OPTFCLKEN_USB_CH2_CLK_ENABLE;
+
+ int usbhub_clk = CKOBUFFER_CLK_ENABLE_MASK;
+
+ if (enable) {
+ /* Enable port 2 and 3 clocks*/
+ setbits_le32((*prcm)->cm_l3init_hsusbhost_clkctrl, usbhost_clk);
+ /* Enable port 2 and 3 usb host ports tll clocks*/
+ setbits_le32((*prcm)->cm_l3init_hsusbtll_clkctrl, usbtll_clk);
+ /* Request FREF_XTAL_CLK clock for HSIC USB Hub */
+ setbits_le32((*ctrl)->control_ckobuffer, usbhub_clk);
+ } else {
+ clrbits_le32((*ctrl)->control_ckobuffer, usbhub_clk);
+ clrbits_le32((*prcm)->cm_l3init_hsusbtll_clkctrl, usbtll_clk);
+ clrbits_le32((*prcm)->cm_l3init_hsusbhost_clkctrl, usbhost_clk);
+ }
+}
+
+int ehci_hcd_init(int index, enum usb_init_type init,
+ struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+{
+ int ret;
+
+ /* VCC_3V3_ETH */
+ cm_t54_palmas_regulator_set(SMPS9_VOLTAGE, SMPS_VOLT_3V3, SMPS9_CTRL,
+ SMPS_MODE_SLP_AUTO | SMPS_MODE_ACT_AUTO);
+
+ setup_host_clocks(true);
+
+ ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
+ if (ret < 0)
+ printf("cm_t54: Failed to initialize ehci : %d\n", ret);
+
+ return ret;
+}
+
+int ehci_hcd_stop(void)
+{
+ int ret = omap_ehci_hcd_stop();
+
+ setup_host_clocks(false);
+
+ cm_t54_palmas_regulator_set(SMPS9_VOLTAGE, SMPS_VOLT_OFF,
+ SMPS9_CTRL, SMPS_MODE_SLP_AUTO);
+
+ return ret;
+}
+
+void usb_hub_reset_devices(int port)
+{
+ /* The LAN9730 needs to be reset after the port power has been set. */
+ if (port == 3) {
+ gpio_direction_output(CONFIG_OMAP_EHCI_PHY3_RESET_GPIO, 0);
+ udelay(10);
+ gpio_direction_output(CONFIG_OMAP_EHCI_PHY3_RESET_GPIO, 1);
+ }
+}
+#endif
+
diff --git a/board/compulab/cm_t54/mux.c b/board/compulab/cm_t54/mux.c
new file mode 100644
index 0000000..da35383
--- /dev/null
+++ b/board/compulab/cm_t54/mux.c
@@ -0,0 +1,94 @@
+/*
+ * Pinmux configuration for Compulab CM-T54 board
+ *
+ * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+ *
+ * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef _CM_T54_MUX_DATA_H
+#define _CM_T54_MUX_DATA_H
+
+#include <asm/arch/mux_omap5.h>
+#include <asm/arch/sys_proto.h>
+
+const struct pad_conf_entry core_padconf_array_essential[] = {
+ /* MMC1 - SD CARD */
+ {SDCARD_CLK, (PTU | IEN | M0)}, /* SDCARD_CLK */
+ {SDCARD_CMD, (PTU | IEN | M0)}, /* SDCARD_CMD */
+ {SDCARD_DATA0, (PTU | IEN | M0)}, /* SDCARD_DATA0 */
+ {SDCARD_DATA1, (PTU | IEN | M0)}, /* SDCARD_DATA1 */
+ {SDCARD_DATA2, (PTU | IEN | M0)}, /* SDCARD_DATA2 */
+ {SDCARD_DATA3, (PTU | IEN | M0)}, /* SDCARD_DATA3 */
+
+ /* SD CARD CD and WP GPIOs*/
+ {TIMER5_PWM_EVT, (PTU | IEN | M6)}, /* GPIO8_228 */
+ {TIMER6_PWM_EVT, (PTU | IEN | M6)}, /* GPIO8_229 */
+
+ /* MMC2 - eMMC */
+ {EMMC_CLK, (PTU | IEN | M0)}, /* EMMC_CLK */
+ {EMMC_CMD, (PTU | IEN | M0)}, /* EMMC_CMD */
+ {EMMC_DATA0, (PTU | IEN | M0)}, /* EMMC_DATA0 */
+ {EMMC_DATA1, (PTU | IEN | M0)}, /* EMMC_DATA1 */
+ {EMMC_DATA2, (PTU | IEN | M0)}, /* EMMC_DATA2 */
+ {EMMC_DATA3, (PTU | IEN | M0)}, /* EMMC_DATA3 */
+ {EMMC_DATA4, (PTU | IEN | M0)}, /* EMMC_DATA4 */
+ {EMMC_DATA5, (PTU | IEN | M0)}, /* EMMC_DATA5 */
+ {EMMC_DATA6, (PTU | IEN | M0)}, /* EMMC_DATA6 */
+ {EMMC_DATA7, (PTU | IEN | M0)}, /* EMMC_DATA7 */
+
+ /* UART4 */
+ {I2C5_SCL, (PTU | IEN | M2)}, /* UART4_RX */
+ {I2C5_SDA, (M2)}, /* UART4_TX */
+
+ /* Led */
+ {HSI2_CAFLAG, (PTU | M6)}, /* GPIO3_80 */
+
+ /* I2C1 */
+ {I2C1_PMIC_SCL, (PTU | IEN | M0)}, /* I2C1_PMIC_SCL */
+ {I2C1_PMIC_SDA, (PTU | IEN | M0)}, /* I2C1_PMIC_SDA */
+
+ /* USBB2, USBB3 */
+ {USBB2_HSIC_STROBE, (PTU | IEN | M0)}, /* USBB2_HSIC_STROBE */
+ {USBB2_HSIC_DATA, (PTU | IEN | M0)}, /* USBB2_HSIC_DATA */
+ {USBB3_HSIC_STROBE, (PTU | IEN | M0)}, /* USBB3_HSIC_STROBE */
+ {USBB3_HSIC_DATA, (PTU | IEN | M0)}, /* USBB3_HSIC_DATA */
+
+ /* USB Hub and USB Eth reset GPIOs */
+ {HSI2_CAREADY, (PTD | M6)}, /* GPIO3_76 */
+ {HSI2_ACDATA, (PTD | M6)}, /* GPIO3_83 */
+
+ /* I2C4 */
+ {I2C4_SCL, (PTU | IEN | M0)}, /* I2C4_SCL */
+ {I2C4_SDA, (PTU | IEN | M0)}, /* I2C4_SDA */
+};
+
+const struct pad_conf_entry wkup_padconf_array_essential[] = {
+ {SR_PMIC_SCL, (PTU | IEN | M0)}, /* SR_PMIC_SCL */
+ {SR_PMIC_SDA, (PTU | IEN | M0)}, /* SR_PMIC_SDA */
+ {SYS_32K, (IEN | M0)}, /* SYS_32K */
+
+ /* USB Hub clock */
+ {FREF_CLK1_OUT, (PTD | IEN | M0)}, /* FREF_CLK1_OUT */
+};
+
+/*
+ * Routine: set_muxconf_regs_essential
+ * Description: setup board pinmux configuration.
+ */
+void set_muxconf_regs_essential(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));
+}
+
+#endif /* _CM_T54_MUX_DATA_H */
diff --git a/board/compulab/cm_t54/spl.c b/board/compulab/cm_t54/spl.c
new file mode 100644
index 0000000..5c7b2c8
--- /dev/null
+++ b/board/compulab/cm_t54/spl.c
@@ -0,0 +1,66 @@
+/*
+ * SPL specific code for Compulab CM-T54 board
+ *
+ * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+ *
+ * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <asm/emif.h>
+
+const struct emif_regs emif_regs_ddr3_532_mhz_cm_t54 = {
+#if defined(CONFIG_DRAM_1G) || defined(CONFIG_DRAM_512M)
+ .sdram_config_init = 0x618522B2,
+ .sdram_config = 0x618522B2,
+#elif defined(CONFIG_DRAM_2G)
+ .sdram_config_init = 0x618522BA,
+ .sdram_config = 0x618522BA,
+#endif
+ .sdram_config2 = 0x0,
+ .ref_ctrl = 0x00001040,
+ .sdram_tim1 = 0xEEEF36F3,
+ .sdram_tim2 = 0x348F7FDA,
+ .sdram_tim3 = 0x027F88A8,
+ .read_idle_ctrl = 0x00050000,
+ .zq_config = 0x1007190B,
+ .temp_alert_config = 0x00000000,
+
+ .emif_ddr_phy_ctlr_1_init = 0x0030400B,
+ .emif_ddr_phy_ctlr_1 = 0x0034400B,
+ .emif_ddr_ext_phy_ctrl_1 = 0x04040100,
+ .emif_ddr_ext_phy_ctrl_2 = 0x00000000,
+ .emif_ddr_ext_phy_ctrl_3 = 0x00000000,
+ .emif_ddr_ext_phy_ctrl_4 = 0x00000000,
+ .emif_ddr_ext_phy_ctrl_5 = 0x4350D435,
+ .emif_rd_wr_lvl_rmp_win = 0x00000000,
+ .emif_rd_wr_lvl_rmp_ctl = 0x80000000,
+ .emif_rd_wr_lvl_ctl = 0x00000000,
+ .emif_rd_wr_exec_thresh = 0x40000305,
+};
+
+const struct dmm_lisa_map_regs lisa_map_cm_t54 = {
+ .dmm_lisa_map_0 = 0x0,
+ .dmm_lisa_map_1 = 0x0,
+
+#ifdef CONFIG_DRAM_2G
+ .dmm_lisa_map_2 = 0x80740300,
+#elif defined(CONFIG_DRAM_1G)
+ .dmm_lisa_map_2 = 0x80640300,
+#elif defined(CONFIG_DRAM_512M)
+ .dmm_lisa_map_2 = 0x80500100,
+#endif
+ .dmm_lisa_map_3 = 0x00000000,
+ .is_ma_present = 0x1,
+};
+
+void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs)
+{
+ *regs = &emif_regs_ddr3_532_mhz_cm_t54;
+}
+
+void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs)
+{
+ *dmm_lisa_regs = &lisa_map_cm_t54;
+}
diff --git a/boards.cfg b/boards.cfg
index b4203f1..0f3a0bd 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -359,6 +359,7 @@ Active arm armv7 omap3 ti sdp3430
Active arm armv7 omap3 timll devkit8000 devkit8000 - Thomas Weber <weber@corscience.de>
Active arm armv7 omap4 ti panda omap4_panda - Sricharan R <r.sricharan@ti.com>
Active arm armv7 omap4 ti sdp4430 omap4_sdp4430 - Sricharan R <r.sricharan@ti.com>
+Active arm armv7 omap5 compulab cm_t54 cm_t54 - Dmitry Lifshitz <lifshitz@compulab.co.il>
Active arm armv7 omap5 ti dra7xx dra7xx_evm dra7xx_evm:CONS_INDEX=1 Lokesh Vutla <lokeshvutla@ti.com>
Active arm armv7 omap5 ti dra7xx dra7xx_evm_uart3 dra7xx_evm:CONS_INDEX=3,SPL_YMODEM_SUPPORT Lokesh Vutla <lokeshvutla@ti.com>
Active arm armv7 omap5 ti omap5_uevm omap5_uevm - -
diff --git a/include/configs/cm_t54.h b/include/configs/cm_t54.h
new file mode 100644
index 0000000..3ca229b
--- /dev/null
+++ b/include/configs/cm_t54.h
@@ -0,0 +1,144 @@
+/*
+ * Config file for Compulab CM-T54 board
+ *
+ * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+ *
+ * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __CONFIG_CM_T54_H
+#define __CONFIG_CM_T54_H
+
+#define CONFIG_CM_T54
+#define CONFIG_DRAM_2G
+
+#include <configs/ti_omap5_common.h>
+
+#undef CONFIG_MISC_INIT_R
+#undef CONFIG_SPL_OS_BOOT
+
+/* Enable SD/MMC CD and WP GPIOs */
+#define OMAP_HSMMC_USE_GPIO
+
+/* UART setup */
+#define CONFIG_CONS_INDEX 4
+#define CONFIG_SYS_NS16550_COM4 UART4_BASE
+#define CONFIG_BAUDRATE 115200
+
+/* SD/MMC RAW boot */
+#undef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
+#undef CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS
+
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200 /* 0x40000 - 256 KB */
+#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x300 /* 384 KB */
+
+/* MMC ENV related defines */
+#undef CONFIG_ENV_OFFSET
+#undef CONFIG_ENV_SIZE
+
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV 1 /* SLOT2: eMMC(1) */
+#define CONFIG_ENV_OFFSET 0xc0000 /* (in bytes) 768 KB */
+#define CONFIG_ENV_SIZE (16 << 10) /* 16 KB */
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+#define CONFIG_CMD_SAVEENV
+
+/* Enhance our eMMC support / experience. */
+#define CONFIG_HSMMC2_8BIT
+#define CONFIG_SUPPORT_EMMC_BOOT
+
+/* USB UHH support options */
+#define CONFIG_CMD_USB
+#define CONFIG_USB_HOST
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_OMAP
+#define CONFIG_USB_STORAGE
+#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
+
+#define CONFIG_OMAP_EHCI_PHY2_RESET_GPIO 76 /* HSIC2 HUB #RESET */
+#define CONFIG_OMAP_EHCI_PHY3_RESET_GPIO 83 /* HSIC3 ETH #RESET */
+
+/* Enabled commands */
+#define CONFIG_CMD_DHCP /* DHCP Support */
+#define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
+#define CONFIG_CMD_PING
+
+/* USB Networking options */
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_SMSC95XX
+#define CONFIG_USB_ETHER_RNDIS
+#define CONFIG_USB_ETHER_ASIX
+#define CONFIG_USB_ETHER_MCS7830
+
+/* Max time to hold reset on this board, see doc/README.omap-reset-time */
+#define CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC 16296
+
+/*
+ * Miscellaneous configurable options
+ */
+#undef CONFIG_SYS_AUTOLOAD
+#undef CONFIG_SYS_PROMPT
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#undef CONFIG_BOOTCOMMAND
+
+#define CONFIG_SYS_AUTOLOAD "no"
+#define CONFIG_SYS_PROMPT "CM-T54 # "
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "loadaddr=0x82000000\0" \
+ "fdtaddr=0x80F80000\0" \
+ "fdt_high=0xffffffff\0" \
+ "rdaddr=0x81000000\0" \
+ "console=ttyO3,115200n8\0" \
+ "fdtfile=omap5-sbc-t54.dtb\0" \
+ "bootenv=uEnv.txt\0" \
+ "bootpart=0:1\0" \
+ "bootfile=zImage-cm-t54\0" \
+ "vram=16M\0" \
+ "optargs=fixrtc\0" \
+ "mmcdev=1\0" \
+ "mmcroot=/dev/mmcblk1p2 rw rootwait\0" \
+ "mmcrootfstype=ext4\0" \
+ "mmcargs=setenv bootargs console=${console} " \
+ "${optargs} " \
+ "vram=${vram} " \
+ "root=${mmcroot} " \
+ "rootfstype=${mmcrootfstype}\0" \
+ "loadbootenv=load mmc ${bootpart} ${loadaddr} ${bootenv}\0" \
+ "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
+ "env import -t ${loadaddr} ${filesize}\0" \
+ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootfile}\0" \
+ "mmcboot=mmc dev ${mmcdev}; " \
+ "if mmc rescan; then " \
+ "echo SD/MMC found on device ${mmcdev};" \
+ "if run loadbootenv; then " \
+ "echo Loaded environment from ${bootenv};" \
+ "run importbootenv;" \
+ "fi;" \
+ "if test -n $uenvcmd; then " \
+ "echo Running uenvcmd ...;" \
+ "run uenvcmd;" \
+ "fi;" \
+ "if run loadimage; then " \
+ "run loadfdt; " \
+ "echo Booting from mmc${mmcdev} ...; " \
+ "run mmcargs; " \
+ "bootz ${loadaddr} - ${fdtaddr}; " \
+ "fi;" \
+ "fi;\0" \
+ "loadfdt=load mmc ${bootpart} ${fdtaddr} ${fdtfile};\0"
+
+#define CONFIG_BOOTCOMMAND \
+ "echo Trying SD/MMC boot ...;" \
+ "run mmcboot;" \
+ "echo Trying eMMC boot ...;" \
+ "setenv mmcdev 1; " \
+ "setenv bootpart 1:1; " \
+ "setenv mmcroot /dev/mmcblk0p2 rw rootwait; " \
+ "run mmcboot;"
+
+#endif /* __CONFIG_CM_T54_H */
--
1.7.5.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 4/4] cm-t54: add cm-t54 board support
2014-04-27 10:17 ` [U-Boot] [PATCH 4/4] cm-t54: add cm-t54 board support Dmitry Lifshitz
@ 2014-05-06 17:45 ` Tom Rini
2014-05-14 6:19 ` Igor Grinberg
2014-05-19 9:50 ` [U-Boot] [PATCH v2 " Dmitry Lifshitz
0 siblings, 2 replies; 12+ messages in thread
From: Tom Rini @ 2014-05-06 17:45 UTC (permalink / raw)
To: u-boot
On Sun, Apr 27, 2014 at 01:17:28PM +0300, Dmitry Lifshitz wrote:
> Add cm-t54 board directory, config file. Enable build.
[snip]
> diff --git a/board/compulab/cm_t54/Makefile b/board/compulab/cm_t54/Makefile
> new file mode 100644
> index 0000000..bd8bc51
> --- /dev/null
> +++ b/board/compulab/cm_t54/Makefile
> @@ -0,0 +1,10 @@
> +#
> +# Copyright (C) 2014 Compulab Ltd - http://compulab.co.il/
> +#
> +# Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
> +#
> +# SPDX-License-Identifier: GPL-2.0+
> +#
> +
> +obj-y += $(BOARD).o
Please don't use $(BOARD) here, just went and changed the other users of
this convention.
> +/*
> + * Routine: board_init
> + * Description: hardware init.
> + */
> +int board_init(void)
> +{
> + gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
> +
> + return 0;
> +}
CONFIG_SYS_SDRAM_BASE + 0x100
> +#define CONFIG_EXTRA_ENV_SETTINGS \
> + "loadaddr=0x82000000\0" \
> + "fdtaddr=0x80F80000\0" \
> + "fdt_high=0xffffffff\0" \
> + "rdaddr=0x81000000\0" \
Can you use DEFAULT_LINUX_BOOT_ENV here (see u-boot-ti) ? I really
don't like disabling fdt relocation with it being below 128MB (I'd
prefer what we do with DEFAULT_LINUX_BOOT_ENV and bootm_size, please see
the various ML threads about that).
Thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140506/06f19a06/attachment.pgp>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [U-Boot,1/4] ARM: OMAP5: add UART4 support
2014-04-27 10:17 ` [U-Boot] [PATCH 1/4] ARM: OMAP5: add UART4 support Dmitry Lifshitz
@ 2014-05-14 1:35 ` Tom Rini
0 siblings, 0 replies; 12+ messages in thread
From: Tom Rini @ 2014-05-14 1:35 UTC (permalink / raw)
To: u-boot
On Sun, Apr 27, 2014 at 01:17:25PM +0300, Dmitry Lifshitz wrote:
> Add UART4 base address.
>
> Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
Applied to u-boot-ti/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140513/cafcab1a/attachment.pgp>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [U-Boot, 2/4] ARM: OMAP5: Power: add LDO2 support for Palmas driver
2014-04-27 10:17 ` [U-Boot] [PATCH 2/4] ARM: OMAP5: Power: add LDO2 support for Palmas driver Dmitry Lifshitz
@ 2014-05-14 1:36 ` Tom Rini
0 siblings, 0 replies; 12+ messages in thread
From: Tom Rini @ 2014-05-14 1:36 UTC (permalink / raw)
To: u-boot
On Sun, Apr 27, 2014 at 01:17:26PM +0300, Dmitry Lifshitz wrote:
> Add defines required to turn on LDO2 regulator.
>
> Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
Applied to u-boot-ti/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140513/a570cb96/attachment.pgp>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [U-Boot,3/4] ARM: OMAP5: add CKO buffer control mask
2014-04-27 10:17 ` [U-Boot] [PATCH 3/4] ARM: OMAP5: add CKO buffer control mask Dmitry Lifshitz
@ 2014-05-14 1:36 ` Tom Rini
0 siblings, 0 replies; 12+ messages in thread
From: Tom Rini @ 2014-05-14 1:36 UTC (permalink / raw)
To: u-boot
On Sun, Apr 27, 2014 at 01:17:27PM +0300, Dmitry Lifshitz wrote:
> Add CKOBUFFER_CLK_EN bit mask enabling FREF_XTAL_CLK clock.
>
> Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
Applied to u-boot-ti/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140513/fa1319a1/attachment.pgp>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 4/4] cm-t54: add cm-t54 board support
2014-05-06 17:45 ` Tom Rini
@ 2014-05-14 6:19 ` Igor Grinberg
2014-05-19 9:50 ` [U-Boot] [PATCH v2 " Dmitry Lifshitz
1 sibling, 0 replies; 12+ messages in thread
From: Igor Grinberg @ 2014-05-14 6:19 UTC (permalink / raw)
To: u-boot
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Tom,
On 05/06/14 20:45, Tom Rini wrote:
> On Sun, Apr 27, 2014 at 01:17:28PM +0300, Dmitry Lifshitz wrote:
>
>> Add cm-t54 board directory, config file. Enable build.
> [snip]
>> diff --git a/board/compulab/cm_t54/Makefile b/board/compulab/cm_t54/Makefile
>> new file mode 100644
>> index 0000000..bd8bc51
>> --- /dev/null
>> +++ b/board/compulab/cm_t54/Makefile
>> @@ -0,0 +1,10 @@
>> +#
>> +# Copyright (C) 2014 Compulab Ltd - http://compulab.co.il/
>> +#
>> +# Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
>> +#
>> +# SPDX-License-Identifier: GPL-2.0+
>> +#
>> +
>> +obj-y += $(BOARD).o
>
> Please don't use $(BOARD) here, just went and changed the other users of
> this convention.
>
>> +/*
>> + * Routine: board_init
>> + * Description: hardware init.
>> + */
>> +int board_init(void)
>> +{
>> + gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
>> +
>> + return 0;
>> +}
>
> CONFIG_SYS_SDRAM_BASE + 0x100
>
>> +#define CONFIG_EXTRA_ENV_SETTINGS \
>> + "loadaddr=0x82000000\0" \
>> + "fdtaddr=0x80F80000\0" \
>> + "fdt_high=0xffffffff\0" \
>> + "rdaddr=0x81000000\0" \
>
> Can you use DEFAULT_LINUX_BOOT_ENV here (see u-boot-ti) ? I really
> don't like disabling fdt relocation with it being below 128MB (I'd
> prefer what we do with DEFAULT_LINUX_BOOT_ENV and bootm_size, please see
> the various ML threads about that).
Thanks Tom,
We will fix the comments and repost v2 in a couple of days.
- --
Regards,
Igor.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAEBAgAGBQJTcwroAAoJEBDE8YO64EfaxQoP/2GKp8kJErMdiMZs8TdIhkGp
De1T6qw+qoTsA/91nFQUq4AMv5lfApghTgjmU/zx5oI4Uo8IPE8uMtZw9VSwTucu
Zfy1BrhGj8kbVe9u6oOf2uZiqvzyaEqdi9a/EwmB69cYu8QcQFP+nbPPMqmxgA2i
B9aUP/+54PluWcBDN0Z5btPfeRBgodyHLJlOtNWCwy4SmzgoARYbS+wrrKqiZApJ
NPYdH1wtgVcrsqiBFGILCktgVkUl4ncC7oa0MTzQfzAPKaKvbhbuwT98lhgUNcsZ
xf7QS3KSGD6/H8xZS0VTAmC5frf7/IAHzSFJsb25OMfi8gwrL8a1Nf9XA+UaAB0I
cpv53xxEoTvdAP/gmBz0sKdC0YKLvYin/OqY0PeFl1itPrKJ1CiKBXL60l0u7wkT
J4HtxsUUfl/nbZc/KbB9cnYCf57V1nnDw3KesRR2nwWaBf0dTWFiPIKCHpZjyUKg
OUinqCjRIbL6KTLEkcipPYXHuFGVNqcE3a+uRDn7jLW0+XcU2zKi04Djpn7F84TM
LXUhnJX8UC59AZuseMqi3yK26OOmTFcIOMcRDi45Zri3qsaYIi7TrD9offwlxb6/
+JEP3YROi0fm8jrC//0GUjx8idmjeZYlx0U4EDjLxKBqnABVlTjrBoiheB+rr+f0
t2HoJHgnV89Dtu26mZi5
=C1e2
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 12+ messages in thread
* [U-Boot] [PATCH v2 4/4] cm-t54: add cm-t54 board support
2014-05-06 17:45 ` Tom Rini
2014-05-14 6:19 ` Igor Grinberg
@ 2014-05-19 9:50 ` Dmitry Lifshitz
2014-05-23 23:50 ` [U-Boot] [U-Boot,v2,4/4] " Tom Rini
1 sibling, 1 reply; 12+ messages in thread
From: Dmitry Lifshitz @ 2014-05-19 9:50 UTC (permalink / raw)
To: u-boot
Add cm-t54 board directory, config file. Enable build.
Basic support includes:
Serial console
SD/MMC
eMMC
USB
Ethernet
Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
---
v2: * Fixed Makefile to use board file name explicitely instead of $(BOARD).o
* Use CONFIG_SYS_SDRAM_BASE
* Use DEFAULT_LINUX_BOOT_ENV in default environment
* Misc changes in default environment and bootcmd
board/compulab/cm_t54/Makefile | 10 ++
board/compulab/cm_t54/cm_t54.c | 177 ++++++++++++++++++++++++++++++++++++++++
board/compulab/cm_t54/mux.c | 94 +++++++++++++++++++++
board/compulab/cm_t54/spl.c | 66 +++++++++++++++
boards.cfg | 1 +
include/configs/cm_t54.h | 139 +++++++++++++++++++++++++++++++
6 files changed, 487 insertions(+), 0 deletions(-)
create mode 100644 board/compulab/cm_t54/Makefile
create mode 100644 board/compulab/cm_t54/cm_t54.c
create mode 100644 board/compulab/cm_t54/mux.c
create mode 100644 board/compulab/cm_t54/spl.c
create mode 100644 include/configs/cm_t54.h
diff --git a/board/compulab/cm_t54/Makefile b/board/compulab/cm_t54/Makefile
new file mode 100644
index 0000000..298ddd2
--- /dev/null
+++ b/board/compulab/cm_t54/Makefile
@@ -0,0 +1,10 @@
+#
+# Copyright (C) 2014 Compulab Ltd - http://compulab.co.il/
+#
+# Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y += cm_t54.o
+obj-$(CONFIG_SPL_BUILD) += mux.o spl.o
diff --git a/board/compulab/cm_t54/cm_t54.c b/board/compulab/cm_t54/cm_t54.c
new file mode 100644
index 0000000..e0df47e
--- /dev/null
+++ b/board/compulab/cm_t54/cm_t54.c
@@ -0,0 +1,177 @@
+/*
+ * Board functions for Compulab CM-T54 board
+ *
+ * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+ *
+ * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <usb.h>
+#include <mmc.h>
+#include <palmas.h>
+
+#include <asm/gpio.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/mmc_host_def.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/ehci.h>
+#include <asm/ehci-omap.h>
+
+#define DIE_ID_REG_BASE (OMAP54XX_L4_CORE_BASE + 0x2000)
+#define DIE_ID_REG_OFFSET 0x200
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#if !defined(CONFIG_SPL_BUILD)
+inline void set_muxconf_regs_essential(void){};
+#endif
+
+const struct omap_sysinfo sysinfo = {
+ "Board: CM-T54\n"
+};
+
+/*
+ * Routine: board_init
+ * Description: hardware init.
+ */
+int board_init(void)
+{
+ gd->bd->bi_boot_params = (CONFIG_SYS_SDRAM_BASE + 0x100); /* boot param addr */
+
+ return 0;
+}
+
+/*
+ * Routine: cm_t54_palmas_regulator_set
+ * Description: select voltage and turn on/off Palmas PMIC regulator.
+ */
+static int cm_t54_palmas_regulator_set(u8 vreg, u8 vval, u8 creg, u8 cval)
+{
+ int err;
+
+ /* Setup voltage */
+ err = palmas_i2c_write_u8(TWL603X_CHIP_P1, vreg, vval);
+ if (err) {
+ printf("cm_t54: could not set regulator 0x%02x voltage : %d\n",
+ vreg, err);
+ return err;
+ }
+
+ /* Turn on/off regulator */
+ err = palmas_i2c_write_u8(TWL603X_CHIP_P1, creg, cval);
+ if (err) {
+ printf("cm_t54: could not turn on/off regulator 0x%02x : %d\n",
+ creg, err);
+ return err;
+ }
+
+ return 0;
+}
+
+#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#define SB_T54_CD_GPIO 228
+#define SB_T54_WP_GPIO 229
+
+int board_mmc_getcd(struct mmc *mmc)
+{
+ return !gpio_get_value(SB_T54_CD_GPIO);
+}
+
+int board_mmc_init(bd_t *bis)
+{
+ int ret0, ret1;
+
+ ret0 = omap_mmc_init(0, 0, 0, -1, SB_T54_WP_GPIO);
+ if (ret0)
+ printf("cm_t54: failed to initialize mmc0\n");
+
+ ret1 = omap_mmc_init(1, 0, 0, -1, -1);
+ if (ret1)
+ printf("cm_t54: failed to initialize mmc1\n");
+
+ if (ret0 && ret1)
+ return -1;
+
+ return 0;
+}
+#endif
+
+#ifdef CONFIG_USB_EHCI
+static struct omap_usbhs_board_data usbhs_bdata = {
+ .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
+ .port_mode[1] = OMAP_EHCI_PORT_MODE_HSIC,
+ .port_mode[2] = OMAP_EHCI_PORT_MODE_HSIC,
+};
+
+static void setup_host_clocks(bool enable)
+{
+ int usbhost_clk = OPTFCLKEN_HSIC60M_P3_CLK |
+ OPTFCLKEN_HSIC480M_P3_CLK |
+ OPTFCLKEN_HSIC60M_P2_CLK |
+ OPTFCLKEN_HSIC480M_P2_CLK |
+ OPTFCLKEN_UTMI_P3_CLK |
+ OPTFCLKEN_UTMI_P2_CLK;
+
+ int usbtll_clk = OPTFCLKEN_USB_CH1_CLK_ENABLE |
+ OPTFCLKEN_USB_CH2_CLK_ENABLE;
+
+ int usbhub_clk = CKOBUFFER_CLK_ENABLE_MASK;
+
+ if (enable) {
+ /* Enable port 2 and 3 clocks*/
+ setbits_le32((*prcm)->cm_l3init_hsusbhost_clkctrl, usbhost_clk);
+ /* Enable port 2 and 3 usb host ports tll clocks*/
+ setbits_le32((*prcm)->cm_l3init_hsusbtll_clkctrl, usbtll_clk);
+ /* Request FREF_XTAL_CLK clock for HSIC USB Hub */
+ setbits_le32((*ctrl)->control_ckobuffer, usbhub_clk);
+ } else {
+ clrbits_le32((*ctrl)->control_ckobuffer, usbhub_clk);
+ clrbits_le32((*prcm)->cm_l3init_hsusbtll_clkctrl, usbtll_clk);
+ clrbits_le32((*prcm)->cm_l3init_hsusbhost_clkctrl, usbhost_clk);
+ }
+}
+
+int ehci_hcd_init(int index, enum usb_init_type init,
+ struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+{
+ int ret;
+
+ /* VCC_3V3_ETH */
+ cm_t54_palmas_regulator_set(SMPS9_VOLTAGE, SMPS_VOLT_3V3, SMPS9_CTRL,
+ SMPS_MODE_SLP_AUTO | SMPS_MODE_ACT_AUTO);
+
+ setup_host_clocks(true);
+
+ ret = omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
+ if (ret < 0)
+ printf("cm_t54: Failed to initialize ehci : %d\n", ret);
+
+ return ret;
+}
+
+int ehci_hcd_stop(void)
+{
+ int ret = omap_ehci_hcd_stop();
+
+ setup_host_clocks(false);
+
+ cm_t54_palmas_regulator_set(SMPS9_VOLTAGE, SMPS_VOLT_OFF,
+ SMPS9_CTRL, SMPS_MODE_SLP_AUTO);
+
+ return ret;
+}
+
+void usb_hub_reset_devices(int port)
+{
+ /* The LAN9730 needs to be reset after the port power has been set. */
+ if (port == 3) {
+ gpio_direction_output(CONFIG_OMAP_EHCI_PHY3_RESET_GPIO, 0);
+ udelay(10);
+ gpio_direction_output(CONFIG_OMAP_EHCI_PHY3_RESET_GPIO, 1);
+ }
+}
+#endif
+
diff --git a/board/compulab/cm_t54/mux.c b/board/compulab/cm_t54/mux.c
new file mode 100644
index 0000000..da35383
--- /dev/null
+++ b/board/compulab/cm_t54/mux.c
@@ -0,0 +1,94 @@
+/*
+ * Pinmux configuration for Compulab CM-T54 board
+ *
+ * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+ *
+ * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef _CM_T54_MUX_DATA_H
+#define _CM_T54_MUX_DATA_H
+
+#include <asm/arch/mux_omap5.h>
+#include <asm/arch/sys_proto.h>
+
+const struct pad_conf_entry core_padconf_array_essential[] = {
+ /* MMC1 - SD CARD */
+ {SDCARD_CLK, (PTU | IEN | M0)}, /* SDCARD_CLK */
+ {SDCARD_CMD, (PTU | IEN | M0)}, /* SDCARD_CMD */
+ {SDCARD_DATA0, (PTU | IEN | M0)}, /* SDCARD_DATA0 */
+ {SDCARD_DATA1, (PTU | IEN | M0)}, /* SDCARD_DATA1 */
+ {SDCARD_DATA2, (PTU | IEN | M0)}, /* SDCARD_DATA2 */
+ {SDCARD_DATA3, (PTU | IEN | M0)}, /* SDCARD_DATA3 */
+
+ /* SD CARD CD and WP GPIOs*/
+ {TIMER5_PWM_EVT, (PTU | IEN | M6)}, /* GPIO8_228 */
+ {TIMER6_PWM_EVT, (PTU | IEN | M6)}, /* GPIO8_229 */
+
+ /* MMC2 - eMMC */
+ {EMMC_CLK, (PTU | IEN | M0)}, /* EMMC_CLK */
+ {EMMC_CMD, (PTU | IEN | M0)}, /* EMMC_CMD */
+ {EMMC_DATA0, (PTU | IEN | M0)}, /* EMMC_DATA0 */
+ {EMMC_DATA1, (PTU | IEN | M0)}, /* EMMC_DATA1 */
+ {EMMC_DATA2, (PTU | IEN | M0)}, /* EMMC_DATA2 */
+ {EMMC_DATA3, (PTU | IEN | M0)}, /* EMMC_DATA3 */
+ {EMMC_DATA4, (PTU | IEN | M0)}, /* EMMC_DATA4 */
+ {EMMC_DATA5, (PTU | IEN | M0)}, /* EMMC_DATA5 */
+ {EMMC_DATA6, (PTU | IEN | M0)}, /* EMMC_DATA6 */
+ {EMMC_DATA7, (PTU | IEN | M0)}, /* EMMC_DATA7 */
+
+ /* UART4 */
+ {I2C5_SCL, (PTU | IEN | M2)}, /* UART4_RX */
+ {I2C5_SDA, (M2)}, /* UART4_TX */
+
+ /* Led */
+ {HSI2_CAFLAG, (PTU | M6)}, /* GPIO3_80 */
+
+ /* I2C1 */
+ {I2C1_PMIC_SCL, (PTU | IEN | M0)}, /* I2C1_PMIC_SCL */
+ {I2C1_PMIC_SDA, (PTU | IEN | M0)}, /* I2C1_PMIC_SDA */
+
+ /* USBB2, USBB3 */
+ {USBB2_HSIC_STROBE, (PTU | IEN | M0)}, /* USBB2_HSIC_STROBE */
+ {USBB2_HSIC_DATA, (PTU | IEN | M0)}, /* USBB2_HSIC_DATA */
+ {USBB3_HSIC_STROBE, (PTU | IEN | M0)}, /* USBB3_HSIC_STROBE */
+ {USBB3_HSIC_DATA, (PTU | IEN | M0)}, /* USBB3_HSIC_DATA */
+
+ /* USB Hub and USB Eth reset GPIOs */
+ {HSI2_CAREADY, (PTD | M6)}, /* GPIO3_76 */
+ {HSI2_ACDATA, (PTD | M6)}, /* GPIO3_83 */
+
+ /* I2C4 */
+ {I2C4_SCL, (PTU | IEN | M0)}, /* I2C4_SCL */
+ {I2C4_SDA, (PTU | IEN | M0)}, /* I2C4_SDA */
+};
+
+const struct pad_conf_entry wkup_padconf_array_essential[] = {
+ {SR_PMIC_SCL, (PTU | IEN | M0)}, /* SR_PMIC_SCL */
+ {SR_PMIC_SDA, (PTU | IEN | M0)}, /* SR_PMIC_SDA */
+ {SYS_32K, (IEN | M0)}, /* SYS_32K */
+
+ /* USB Hub clock */
+ {FREF_CLK1_OUT, (PTD | IEN | M0)}, /* FREF_CLK1_OUT */
+};
+
+/*
+ * Routine: set_muxconf_regs_essential
+ * Description: setup board pinmux configuration.
+ */
+void set_muxconf_regs_essential(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));
+}
+
+#endif /* _CM_T54_MUX_DATA_H */
diff --git a/board/compulab/cm_t54/spl.c b/board/compulab/cm_t54/spl.c
new file mode 100644
index 0000000..5c7b2c8
--- /dev/null
+++ b/board/compulab/cm_t54/spl.c
@@ -0,0 +1,66 @@
+/*
+ * SPL specific code for Compulab CM-T54 board
+ *
+ * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+ *
+ * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <asm/emif.h>
+
+const struct emif_regs emif_regs_ddr3_532_mhz_cm_t54 = {
+#if defined(CONFIG_DRAM_1G) || defined(CONFIG_DRAM_512M)
+ .sdram_config_init = 0x618522B2,
+ .sdram_config = 0x618522B2,
+#elif defined(CONFIG_DRAM_2G)
+ .sdram_config_init = 0x618522BA,
+ .sdram_config = 0x618522BA,
+#endif
+ .sdram_config2 = 0x0,
+ .ref_ctrl = 0x00001040,
+ .sdram_tim1 = 0xEEEF36F3,
+ .sdram_tim2 = 0x348F7FDA,
+ .sdram_tim3 = 0x027F88A8,
+ .read_idle_ctrl = 0x00050000,
+ .zq_config = 0x1007190B,
+ .temp_alert_config = 0x00000000,
+
+ .emif_ddr_phy_ctlr_1_init = 0x0030400B,
+ .emif_ddr_phy_ctlr_1 = 0x0034400B,
+ .emif_ddr_ext_phy_ctrl_1 = 0x04040100,
+ .emif_ddr_ext_phy_ctrl_2 = 0x00000000,
+ .emif_ddr_ext_phy_ctrl_3 = 0x00000000,
+ .emif_ddr_ext_phy_ctrl_4 = 0x00000000,
+ .emif_ddr_ext_phy_ctrl_5 = 0x4350D435,
+ .emif_rd_wr_lvl_rmp_win = 0x00000000,
+ .emif_rd_wr_lvl_rmp_ctl = 0x80000000,
+ .emif_rd_wr_lvl_ctl = 0x00000000,
+ .emif_rd_wr_exec_thresh = 0x40000305,
+};
+
+const struct dmm_lisa_map_regs lisa_map_cm_t54 = {
+ .dmm_lisa_map_0 = 0x0,
+ .dmm_lisa_map_1 = 0x0,
+
+#ifdef CONFIG_DRAM_2G
+ .dmm_lisa_map_2 = 0x80740300,
+#elif defined(CONFIG_DRAM_1G)
+ .dmm_lisa_map_2 = 0x80640300,
+#elif defined(CONFIG_DRAM_512M)
+ .dmm_lisa_map_2 = 0x80500100,
+#endif
+ .dmm_lisa_map_3 = 0x00000000,
+ .is_ma_present = 0x1,
+};
+
+void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs)
+{
+ *regs = &emif_regs_ddr3_532_mhz_cm_t54;
+}
+
+void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs)
+{
+ *dmm_lisa_regs = &lisa_map_cm_t54;
+}
diff --git a/boards.cfg b/boards.cfg
index 8aaf749..7344c93 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -362,6 +362,7 @@ Active arm armv7 omap3 ti sdp3430
Active arm armv7 omap3 timll devkit8000 devkit8000 - Thomas Weber <weber@corscience.de>
Active arm armv7 omap4 ti panda omap4_panda - Sricharan R <r.sricharan@ti.com>
Active arm armv7 omap4 ti sdp4430 omap4_sdp4430 - Sricharan R <r.sricharan@ti.com>
+Active arm armv7 omap5 compulab cm_t54 cm_t54 - Dmitry Lifshitz <lifshitz@compulab.co.il>
Active arm armv7 omap5 ti dra7xx dra7xx_evm dra7xx_evm:CONS_INDEX=1 Lokesh Vutla <lokeshvutla@ti.com>
Active arm armv7 omap5 ti dra7xx dra7xx_evm_uart3 dra7xx_evm:CONS_INDEX=3,SPL_YMODEM_SUPPORT Lokesh Vutla <lokeshvutla@ti.com>
Active arm armv7 omap5 ti dra7xx dra7xx_evm_qspiboot dra7xx_evm:CONS_INDEX=1,QSPI_BOOT Lokesh Vutla <lokeshvutla@ti.com>
diff --git a/include/configs/cm_t54.h b/include/configs/cm_t54.h
new file mode 100644
index 0000000..4dcac40
--- /dev/null
+++ b/include/configs/cm_t54.h
@@ -0,0 +1,139 @@
+/*
+ * Config file for Compulab CM-T54 board
+ *
+ * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+ *
+ * Author: Dmitry Lifshitz <lifshitz@compulab.co.il>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __CONFIG_CM_T54_H
+#define __CONFIG_CM_T54_H
+
+#define CONFIG_CM_T54
+#define CONFIG_DRAM_2G
+
+#include <configs/ti_omap5_common.h>
+
+#undef CONFIG_MISC_INIT_R
+#undef CONFIG_SPL_OS_BOOT
+
+/* Enable SD/MMC CD and WP GPIOs */
+#define OMAP_HSMMC_USE_GPIO
+
+/* UART setup */
+#define CONFIG_CONS_INDEX 4
+#define CONFIG_SYS_NS16550_COM4 UART4_BASE
+#define CONFIG_BAUDRATE 115200
+
+/* SD/MMC RAW boot */
+#undef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
+#undef CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS
+
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200 /* 0x40000 - 256 KB */
+#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x300 /* 384 KB */
+
+/* MMC ENV related defines */
+#undef CONFIG_ENV_OFFSET
+#undef CONFIG_ENV_SIZE
+
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV 1 /* SLOT2: eMMC(1) */
+#define CONFIG_ENV_OFFSET 0xc0000 /* (in bytes) 768 KB */
+#define CONFIG_ENV_SIZE (16 << 10) /* 16 KB */
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+#define CONFIG_CMD_SAVEENV
+
+/* Enhance our eMMC support / experience. */
+#define CONFIG_HSMMC2_8BIT
+#define CONFIG_SUPPORT_EMMC_BOOT
+
+/* USB UHH support options */
+#define CONFIG_CMD_USB
+#define CONFIG_USB_HOST
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_OMAP
+#define CONFIG_USB_STORAGE
+#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
+
+#define CONFIG_OMAP_EHCI_PHY2_RESET_GPIO 76 /* HSIC2 HUB #RESET */
+#define CONFIG_OMAP_EHCI_PHY3_RESET_GPIO 83 /* HSIC3 ETH #RESET */
+
+/* Enabled commands */
+#define CONFIG_CMD_DHCP /* DHCP Support */
+#define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
+#define CONFIG_CMD_PING
+
+/* USB Networking options */
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_SMSC95XX
+#define CONFIG_USB_ETHER_RNDIS
+#define CONFIG_USB_ETHER_ASIX
+#define CONFIG_USB_ETHER_MCS7830
+
+/* Max time to hold reset on this board, see doc/README.omap-reset-time */
+#define CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC 16296
+
+/*
+ * Miscellaneous configurable options
+ */
+#undef CONFIG_SYS_AUTOLOAD
+#undef CONFIG_SYS_PROMPT
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#undef CONFIG_BOOTCOMMAND
+#undef CONFIG_BOOTDELAY
+
+#define CONFIG_BOOTDELAY 3
+#define CONFIG_SYS_AUTOLOAD "no"
+#define CONFIG_SYS_PROMPT "CM-T54 # "
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ DEFAULT_LINUX_BOOT_ENV \
+ "baudrate=115200\0" \
+ "bootdelay=3\0" \
+ "autoload=no\0" \
+ "bootscr=bootscr.img\0" \
+ "fdtfile=omap5-sbc-t54.dtb\0" \
+ "kernel=zImage-cm-t54\0" \
+ "ramdisk=ramdisk-cm-t54.img\0" \
+ "console=ttyO3\0" \
+ "ramdisksize=16384\0" \
+ "mmcdev=0\0" \
+ "mmcroot=/dev/mmcblk1p2\0" \
+ "mmcargs=setenv bootargs console=${console} " \
+ "root=${mmcroot} rw rootwait\0" \
+ "ramroot=/dev/ram0\0" \
+ "ramargs=setenv bootargs console=${console} " \
+ "root=${ramroot} ramdisk_size=${ramdisksize} rw\0" \
+ "mmcloadkernel=load mmc ${mmcdev} ${loadaddr} ${kernel}\0" \
+ "mmcloadfdt=load mmc ${mmcdev} ${fdtaddr} ${fdtfile}\0" \
+ "mmcloadramdisk=load mmc ${mmcdev} ${rdaddr} ${ramdisk}\0" \
+ "mmcloadbootscript=load mmc ${mmcdev} ${loadaddr} ${bootsrc}\0" \
+ "mmcbootscript=echo Running bootscript from mmc${mmcdev}...; " \
+ "source ${loadaddr}\0" \
+ "mmcbootlinux=echo Booting from mmc${mmcdev} ...; " \
+ "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
+ "mmcboot=if mmc dev ${mmcdev} && mmc rescan; then " \
+ "if run mmcloadbootscript; " \
+ "then run mmcbootscript; " \
+ "fi; " \
+ "if run mmcloadkernel; then " \
+ "if run mmcloadfdt; then " \
+ "if run mmcloadramdisk; then " \
+ "run ramargs; " \
+ "run mmcbootlinux; " \
+ "fi; " \
+ "run mmcargs; " \
+ "setenv rdaddr - ; " \
+ "run mmcbootlinux; " \
+ "fi; " \
+ "fi; " \
+ "fi;\0"
+
+#define CONFIG_BOOTCOMMAND \
+ "bootcmd=run mmcboot || setenv mmcdev 1; setenv mmcroot /dev/mmcblk0p2; run mmcboot;"
+
+#endif /* __CONFIG_CM_T54_H */
--
1.7.5.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [U-Boot] [U-Boot,v2,4/4] cm-t54: add cm-t54 board support
2014-05-19 9:50 ` [U-Boot] [PATCH v2 " Dmitry Lifshitz
@ 2014-05-23 23:50 ` Tom Rini
0 siblings, 0 replies; 12+ messages in thread
From: Tom Rini @ 2014-05-23 23:50 UTC (permalink / raw)
To: u-boot
On Mon, May 19, 2014 at 12:50:54PM +0300, Dmitry Lifshitz wrote:
> Add cm-t54 board directory, config file. Enable build.
>
> Basic support includes:
>
> Serial console
> SD/MMC
> eMMC
> USB
> Ethernet
>
> Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Applied to u-boot-ti/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140523/c24ef945/attachment.pgp>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2014-05-23 23:50 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-27 10:17 [U-Boot] [PATCH 0/4] ARM: OMAP5: add cm-t54 board support Dmitry Lifshitz
2014-04-27 10:17 ` [U-Boot] [PATCH 1/4] ARM: OMAP5: add UART4 support Dmitry Lifshitz
2014-05-14 1:35 ` [U-Boot] [U-Boot,1/4] " Tom Rini
2014-04-27 10:17 ` [U-Boot] [PATCH 2/4] ARM: OMAP5: Power: add LDO2 support for Palmas driver Dmitry Lifshitz
2014-05-14 1:36 ` [U-Boot] [U-Boot, " Tom Rini
2014-04-27 10:17 ` [U-Boot] [PATCH 3/4] ARM: OMAP5: add CKO buffer control mask Dmitry Lifshitz
2014-05-14 1:36 ` [U-Boot] [U-Boot,3/4] " Tom Rini
2014-04-27 10:17 ` [U-Boot] [PATCH 4/4] cm-t54: add cm-t54 board support Dmitry Lifshitz
2014-05-06 17:45 ` Tom Rini
2014-05-14 6:19 ` Igor Grinberg
2014-05-19 9:50 ` [U-Boot] [PATCH v2 " Dmitry Lifshitz
2014-05-23 23:50 ` [U-Boot] [U-Boot,v2,4/4] " Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.