Skip to contentSkip to conversation

ARM: AM335x: Add support for ICEv2 board

PATCH New Lokesh Vutla 2 participants 21 messages May 16, 2016 – May 30, 2016 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

v2 cover ARM: AM335x: Add support for ICEv2 board

TI's Industrial Communication Engine EVM is a low cost hardware mainly developed for industrial communication type applications using serial or Ethernet based interfaces. This platform features TI's AM3359 with 800MHz single core Cortex-A8 processor, 256MB DDR3, 64MB SPI flash, 8MB NOR Flash, mmc, usb, can, dual Ethernet ports.

For more information, look at HW user guide[1], Data manual[2].

Just add basic support for the moment.

[1] http://processors.wiki.ti.com/index.php/AM335x_Industrial_Communication_Engine_EVM_Rev2_1_HW_User_Guide
[2] http://www.ti.com/lit/ds/symlink/am3359.pdf

Link to v1: https://www.mail-archive.com/u-boot%40lists.denx.de/msg212330.html

Changes since v1:
- Removed am335x_icev2_defconfig and allowed to choose UART dynamically.

Lokesh Vutla (8):
board: AM335x-ICEv2: Add epprom support
board: AM335x-ICEv2: Add pinmux support
board: AM335x-ICEv2: Add DDR data
ARM: AM33xx: Add support for Clock Synthesizer
board: AM335x-ICEv2: Add cpsw support
config: env: Set AM335x-ICEv2 board specific env
ARM: dts: AM335x-ICEv2: Add minimal dts support
board: am335x: Allow to choose serial device dynamically

 arch/arm/cpu/armv7/am33xx/Makefile                 |   2 +
 arch/arm/cpu/armv7/am33xx/clk_synthesizer.c        | 104 +++++
 arch/arm/dts/Makefile                              |   3 +-
 arch/arm/dts/am335x-icev2.dts                      | 430 +++++++++++++++++++++
 arch/arm/include/asm/arch-am33xx/clk_synthesizer.h |  43 +++
 arch/arm/include/asm/arch-am33xx/ddr_defs.h        |  15 +
 board/ti/am335x/board.c                            | 139 ++++++-
 board/ti/am335x/board.h                            |   5 +
 board/ti/am335x/mux.c                              |  31 ++
 configs/am335x_evm_defconfig                       |   2 +-
 include/configs/am335x_evm.h                       |  14 +
 include/serial.h                                   |   4 +
 12 files changed, 783 insertions(+), 9 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/am33xx/clk_synthesizer.c
 create mode 100644 arch/arm/dts/am335x-icev2.dts
 create mode 100644 arch/arm/include/asm/arch-am33xx/clk_synthesizer.h
Signature · 1 line
2.8.2
#1 lore raw

PATCH v2 1/8 board: AM335x-ICEv2: Add epprom support

Similar to other TI's AM335x platforms, AM335x ICEv2 also has an eeprom populated for its unique identification. Adding this info so that AM335x ICEv2 specific initialization can be done.

---
Changes since v1:
- None

 board/ti/am335x/board.h | 5 +++++
 1 file changed, 5 insertions(+)
board/ti/am335x/board.h +5 -0
index 062c345..9776df7 100644
@@ -47,6 +47,11 @@ static inline int board_is_evm_15_or_later(void)
 		strncmp("1.5", board_ti_get_rev(), 3) <= 0);
 }
 
+static inline int board_is_icev2(void)
+{
+	return board_ti_is("A335_ICE") && !strncmp("2", board_ti_get_rev(), 1);
+}
+
 /*
  * We have three pin mux functions that must exist.  We must be able to enable
  * uart0, for initial output and i2c0 to read the main EEPROM.  We then have a
Signature · 1 line
2.8.2
#2 lore raw

PATCH v2 1/8 board: AM335x-ICEv2: Add epprom support

Quoted 6 lines · Lokesh Vutla

Similar to other TI's AM335x platforms, AM335x ICEv2 also has an eeprom populated for its unique identification. Adding this info so that AM335x ICEv2 specific initialization can be done.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160530/f0323579/attachment.sig>
#3 lore raw

PATCH v2 2/8 board: AM335x-ICEv2: Add pinmux support

In reply to Lokesh Vutla

Add necessary pinmux support for AM335x ICEv2 board.

---
Changes since v1:
- None

 board/ti/am335x/mux.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
board/ti/am335x/mux.c +31 -0
index fdf827f..8afa5f9 100644
@@ -135,6 +135,11 @@ static struct module_pin_mux gpio0_7_pin_mux[] = {
 	{-1},
 };
 
+static struct module_pin_mux gpio0_18_pin_mux[] = {
+	{OFFSET(usb0_drvvbus), (MODE(7) | PULLUDEN)},	/* GPIO0_18 */
+	{-1},
+};
+
 static struct module_pin_mux rgmii1_pin_mux[] = {
 	{OFFSET(mii1_txen), MODE(2)},			/* RGMII1_TCTL */
 	{OFFSET(mii1_rxdv), MODE(2) | RXACTIVE},	/* RGMII1_RCTL */
@@ -172,6 +177,20 @@ static struct module_pin_mux mii1_pin_mux[] = {
 	{-1},
 };
 
+static struct module_pin_mux rmii1_pin_mux[] = {
+	{OFFSET(mdio_clk), MODE(0) | PULLUP_EN},	/* MDIO_CLK */
+	{OFFSET(mdio_data), MODE(0) | RXACTIVE | PULLUP_EN}, /* MDIO_DATA */
+	{OFFSET(mii1_crs), MODE(1) | RXACTIVE},		/* MII1_CRS */
+	{OFFSET(mii1_rxerr), MODE(1) | RXACTIVE},	/* MII1_RXERR */
+	{OFFSET(mii1_txen), MODE(1)},			/* MII1_TXEN */
+	{OFFSET(mii1_txd1), MODE(1)},			/* MII1_TXD1 */
+	{OFFSET(mii1_txd0), MODE(1)},			/* MII1_TXD0 */
+	{OFFSET(mii1_rxd1), MODE(1) | RXACTIVE},	/* MII1_RXD1 */
+	{OFFSET(mii1_rxd0), MODE(1) | RXACTIVE},	/* MII1_RXD0 */
+	{OFFSET(rmii1_refclk), MODE(0) | RXACTIVE},	/* RMII1_REFCLK */
+	{-1},
+};
+
 #ifdef CONFIG_NAND
 static struct module_pin_mux nand_pin_mux[] = {
 	{OFFSET(gpmc_ad0),	(MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD0  */
@@ -237,6 +256,12 @@ static struct module_pin_mux bone_norcape_pin_mux[] = {
 };
 #endif
 
+static struct module_pin_mux uart3_icev2_pin_mux[] = {
+	{OFFSET(mii1_rxd3), (MODE(1) | PULLUP_EN | RXACTIVE)},	/* UART3_RXD */
+	{OFFSET(mii1_rxd2), MODE(1) | PULLUDEN},		/* UART3_TXD */
+	{-1},
+};
+
 #if defined(CONFIG_NOR_BOOT)
 void enable_norboot_pin_mux(void)
 {
@@ -365,6 +390,12 @@ void enable_board_pin_mux(void)
 #else
 		configure_module_pin_mux(mmc1_pin_mux);
 #endif
+	} else if (board_is_icev2()) {
+		configure_module_pin_mux(mmc0_pin_mux);
+		configure_module_pin_mux(gpio0_18_pin_mux);
+		configure_module_pin_mux(uart3_icev2_pin_mux);
+		configure_module_pin_mux(rmii1_pin_mux);
+		configure_module_pin_mux(spi0_pin_mux);
 	} else {
 		puts("Unknown board, cannot configure pinmux.");
 		hang();
Signature · 1 line
2.8.2
#4 lore raw

PATCH v2 2/8 board: AM335x-ICEv2: Add pinmux support

Quoted 4 lines · Lokesh Vutla

Add necessary pinmux support for AM335x ICEv2 board.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160530/be224865/attachment.sig>
#5 lore raw

PATCH v2 3/8 board: AM335x-ICEv2: Add DDR data

In reply to Lokesh Vutla

AM335x ICEv2 contains a 2Gbit(128Mx16) of DDR3 SDRAM(MT41J128M16JT-125), capable of running at 400MHz. Adding this specific DDR configuration details running at 400MHz.

---
Changes since v1:
- None

 arch/arm/include/asm/arch-am33xx/ddr_defs.h | 15 +++++++++++
 board/ti/am335x/board.c                     | 41 ++++++++++++++++++++++++++++-
 2 files changed, 55 insertions(+), 1 deletion(-)
arch/arm/include/asm/arch-am33xx/ddr_defs.h +15 -0
index 97bbfe2..43e122e 100644
@@ -54,6 +54,21 @@
 #define MT41J128MJT125_PHY_FIFO_WE		0x100
 #define MT41J128MJT125_IOCTRL_VALUE		0x18B
 
+/* Micron MT41J128M16JT-125 at 400MHz*/
+#define MT41J128MJT125_EMIF_READ_LATENCY_400MHz	0x100007
+#define MT41J128MJT125_EMIF_TIM1_400MHz		0x0AAAD4DB
+#define MT41J128MJT125_EMIF_TIM2_400MHz		0x26437FDA
+#define MT41J128MJT125_EMIF_TIM3_400MHz		0x501F83FF
+#define MT41J128MJT125_EMIF_SDCFG_400MHz	0x61C052B2
+#define MT41J128MJT125_EMIF_SDREF_400MHz	0x00000C30
+#define MT41J128MJT125_ZQ_CFG_400MHz		0x50074BE4
+#define MT41J128MJT125_RATIO_400MHz		0x80
+#define MT41J128MJT125_INVERT_CLKOUT_400MHz	0x0
+#define MT41J128MJT125_RD_DQS_400MHz		0x3A
+#define MT41J128MJT125_WR_DQS_400MHz		0x3B
+#define MT41J128MJT125_PHY_WR_DATA_400MHz	0x76
+#define MT41J128MJT125_PHY_FIFO_WE_400MHz	0x96
+
 /* Micron MT41K128M16JT-187E */
 #define MT41K128MJT187E_EMIF_READ_LATENCY	0x06
 #define MT41K128MJT187E_EMIF_TIM1		0x0888B3DB
board/ti/am335x/board.c +40 -1

83 lines not on this page · raw message

Signature · 1 line
2.8.2
#6 lore raw

PATCH v2 3/8 board: AM335x-ICEv2: Add DDR data

Quoted 6 lines · Lokesh Vutla

AM335x ICEv2 contains a 2Gbit(128Mx16) of DDR3 SDRAM(MT41J128M16JT-125), capable of running at 400MHz. Adding this specific DDR configuration details running at 400MHz.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160530/b8e1da2d/attachment.sig>
#7 lore raw

PATCH v2 4/8 ARM: AM33xx: Add support for Clock Synthesizer

In reply to Lokesh Vutla

The CDCE913 and CDCEL913 devices are modular PLL-based, low cost, high performance , programmable clock synthesizers. They generate upto 3 output clocks from a single input frequency. Each output can be programmed for any clock-frequency.

Adding support for the same.

---
Changes since v1:
- None

 arch/arm/cpu/armv7/am33xx/Makefile                 |   2 +
 arch/arm/cpu/armv7/am33xx/clk_synthesizer.c        | 104 +++++++++++++++++++++
 arch/arm/include/asm/arch-am33xx/clk_synthesizer.h |  43 +++++++++
 3 files changed, 149 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/am33xx/clk_synthesizer.c
 create mode 100644 arch/arm/include/asm/arch-am33xx/clk_synthesizer.h
arch/arm/cpu/armv7/am33xx/Makefile +2 -0
index aae3f09..6fda482 100644
@@ -18,3 +18,5 @@ obj-y	+= ddr.o
 obj-y	+= emif4.o
 obj-y	+= board.o
 obj-y	+= mux.o
+
+obj-$(CONFIG_CLOCK_SYNTHESIZER)	+= clk_synthesizer.o
arch/arm/cpu/armv7/am33xx/clk_synthesizer.c new file +104 -0

104 lines not on this page · raw message

arch/arm/include/asm/arch-am33xx/clk_synthesizer.h new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
2.8.2
#8 lore raw

PATCH v2 4/8 ARM: AM33xx: Add support for Clock Synthesizer

Quoted 9 lines · Lokesh Vutla

The CDCE913 and CDCEL913 devices are modular PLL-based, low cost, high performance , programmable clock synthesizers. They generate upto 3 output clocks from a single input frequency. Each output can be programmed for any clock-frequency.

Adding support for the same.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160530/cf776073/attachment.sig>
#9 lore raw

PATCH v2 5/8 board: AM335x-ICEv2: Add cpsw support

In reply to Lokesh Vutla

In order to enable cpsw on AM335x ICEv2 board, the following needs to be done:

1)There are few on board jumper settings which gives a choice between cpsw and PRUSS, that needs to be properly selected[1]. Even after selecting this, there are few GPIOs which control these muxes that needs to be held high.

2) The clock to PHY is provided by a PLL-based clock synthesizer[2] connected via I2C. This needs to properly programmed and locked for PHY operation. And PHY needs to be reset before before being used, which is also held by a GPIO.

3) RMII mode needs to be selected.

[1] http://www.ti.com/lit/zip/tidr336
[2] http://www.ti.com/lit/ds/symlink/cdce913.pdf

---
Changes since v1:
- None

 board/ti/am335x/board.c      | 87 ++++++++++++++++++++++++++++++++++++++++----
 include/configs/am335x_evm.h |  5 +++
 2 files changed, 85 insertions(+), 7 deletions(-)
board/ti/am335x/board.c +80 -7
index 51c4358..8f47692 100644
@@ -16,6 +16,7 @@
 #include <asm/arch/omap.h>
 #include <asm/arch/ddr_defs.h>
 #include <asm/arch/clock.h>
+#include <asm/arch/clk_synthesizer.h>
 #include <asm/arch/gpio.h>
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/sys_proto.h>
@@ -37,8 +38,13 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 /* GPIO that controls power to DDR on EVM-SK */
-#define GPIO_DDR_VTT_EN		7
-#define ICE_GPIO_DDR_VTT_EN	18
+#define GPIO_TO_PIN(bank, gpio)		(32 * (bank) + (gpio))
+#define GPIO_DDR_VTT_EN		GPIO_TO_PIN(0, 7)
+#define ICE_GPIO_DDR_VTT_EN	GPIO_TO_PIN(0, 18)
+#define GPIO_PR1_MII_CTRL	GPIO_TO_PIN(3, 4)
+#define GPIO_MUX_MII_CTRL	GPIO_TO_PIN(3, 10)
+#define GPIO_FET_SWITCH_CTRL	GPIO_TO_PIN(0, 7)
+#define GPIO_PHY_RESET		GPIO_TO_PIN(2, 5)
 
 #if defined(CONFIG_SPL_BUILD) || \
 	(defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_DM_ETH))
@@ -474,6 +480,49 @@ void sdram_init(void)
 }
 #endif
 
+#if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \
+	(defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
+static void request_and_set_gpio(int gpio, char *name)
+{
+	int ret;
+
+	ret = gpio_request(gpio, name);
+	if (ret < 0) {
+		printf("%s: Unable to request %s\n", __func__, name);
+		return;
+	}
+
+	ret = gpio_direction_output(gpio, 0);
+	if (ret < 0) {
+		printf("%s: Unable to set %s  as output\n", __func__, name);
+		goto err_free_gpio;
+	}
+
+	gpio_set_value(gpio, 1);
+
+	return;
+
+err_free_gpio:
+	gpio_free(gpio);
+}
+
+#define REQUEST_AND_SET_GPIO(N)	request_and_set_gpio(N, #N);
+
+/**
+ * RMII mode on ICEv2 board needs 50MHz clock. Given the clock
+ * synthesizer With a capacitor of 18pF, and 25MHz input clock cycle
+ * PLL1 gives an output of 100MHz. So, configuring the div2/3 as 2 to
+ * give 50MHz output for Eth0 and 1.
+ */
+static struct clk_synth cdce913_data = {
+	.id = 0x81,
+	.capacitor = 0x90,
+	.mux = 0x6d,
+	.pdiv2 = 0x2,
+	.pdiv3 = 0x2,
+};
+#endif
+
 /*
  * Basic board specific setup.  Pinmux has been handled already.
  */
@@ -487,6 +536,23 @@ int board_init(void)
 #if defined(CONFIG_NOR) || defined(CONFIG_NAND)
 	gpmc_init();
 #endif
+#if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD))
+	int rv;
+
+	if (board_is_icev2()) {
+		REQUEST_AND_SET_GPIO(GPIO_PR1_MII_CTRL);
+		REQUEST_AND_SET_GPIO(GPIO_MUX_MII_CTRL);
+		REQUEST_AND_SET_GPIO(GPIO_FET_SWITCH_CTRL);
+		REQUEST_AND_SET_GPIO(GPIO_PHY_RESET);
+
+		rv = setup_clock_synthesizer(&cdce913_data);
+		if (rv) {
+			printf("Clock synthesizer setup failed %d\n", rv);
+			return rv;
+		}
+	}
+#endif
+
 	return 0;
 }
 
@@ -554,6 +620,12 @@ static struct cpsw_platform_data cpsw_data = {
 };
 #endif
 
+#if ((defined(CONFIG_SPL_ETH_SUPPORT) || defined(CONFIG_SPL_USBETH_SUPPORT)) &&\
+	defined(CONFIG_SPL_BUILD)) || \
+	((defined(CONFIG_DRIVER_TI_CPSW) || \
+	  defined(CONFIG_USB_ETHER) && defined(CONFIG_MUSB_GADGET)) && \
+	 !defined(CONFIG_SPL_BUILD))
+
 /*
  * This function will:
  * Read the eFuse for MAC addresses, and set ethaddr/eth1addr/usbnet_devaddr
@@ -565,11 +637,6 @@ static struct cpsw_platform_data cpsw_data = {
  * Build in only these cases to avoid warnings about unused variables
  * when we build an SPL that has neither option but full U-Boot will.
  */
-#if ((defined(CONFIG_SPL_ETH_SUPPORT) || defined(CONFIG_SPL_USBETH_SUPPORT)) \
-		&& defined(CONFIG_SPL_BUILD)) || \
-	((defined(CONFIG_DRIVER_TI_CPSW) || \
-	  defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET)) && \
-	 !defined(CONFIG_SPL_BUILD))
 int board_eth_init(bd_t *bis)
 {
 	int rv, n = 0;
@@ -620,6 +687,12 @@ int board_eth_init(bd_t *bis)
 		writel(MII_MODE_ENABLE, &cdev->miisel);
 		cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
 				PHY_INTERFACE_MODE_MII;
+	} else if (board_is_icev2()) {
+		writel(RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE, &cdev->miisel);
+		cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RMII;
+		cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_RMII;
+		cpsw_slaves[0].phy_addr = 1;
+		cpsw_slaves[1].phy_addr = 3;
 	} else {
 		writel((RGMII_MODE_ENABLE | RGMII_INT_DELAY), &cdev->miisel);
 		cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
include/configs/am335x_evm.h +5 -0
index dfd00de..7c7f197 100644
@@ -475,4 +475,9 @@
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
 #endif  /* NOR support */
 
+#ifdef CONFIG_DRIVER_TI_CPSW
+#define CONFIG_CLOCK_SYNTHESIZER
+#define CLK_SYNTHESIZER_I2C_ADDR 0x65
+#endif
+
 #endif	/* ! __CONFIG_AM335X_EVM_H */
Signature · 1 line
2.8.2
#10 lore raw

PATCH v2 5/8 board: AM335x-ICEv2: Add cpsw support

Quoted 11 lines · Lokesh Vutla

In order to enable cpsw on AM335x ICEv2 board, the following needs to be done:

1)There are few on board jumper settings which gives a choice between cpsw and PRUSS, that needs to be properly selected[1]. Even after selecting this, there are few GPIOs which control these muxes that needs to be held high.

2) The clock to PHY is provided by a PLL-based clock synthesizer[2] connected via I2C. This needs to properly programmed and locked for PHY operation. And PHY needs to be reset before before being used, which is also held by a GPIO.

Quoted 8 lines

3) RMII mode needs to be selected.

[1] http://www.ti.com/lit/zip/tidr336
[2] http://www.ti.com/lit/ds/symlink/cdce913.pdf

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160530/dd8ecdee/attachment.sig>
#11 lore raw

PATCH v2 6/8 config: env: Set AM335x-ICEv2 board specific env

In reply to Lokesh Vutla

Populate the right dtb file and console for AM335x-ICEv2 board.

---
Changes since v1:
- None

 include/configs/am335x_evm.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/configs/am335x_evm.h +9 -0
index 7c7f197..ba4c215 100644
@@ -91,6 +91,7 @@
 
 #define CONFIG_BOOTCOMMAND \
 	"run findfdt; " \
+	"run init_console; " \
 	"run envboot; " \
 	"run distro_bootcmd"
 
@@ -169,8 +170,16 @@
 			"setenv fdtfile am335x-evm.dtb; fi; " \
 		"if test $board_name = A335X_SK; then " \
 			"setenv fdtfile am335x-evmsk.dtb; fi; " \
+		"if test $board_name = A335_ICE; then " \
+			"setenv fdtfile am335x-icev2.dtb; fi; " \
 		"if test $fdtfile = undefined; then " \
 			"echo WARNING: Could not determine device tree to use; fi; \0" \
+	"init_console=" \
+		"if test $board_name = A335_ICE; then "\
+			"setenv console ttyO3,115200n8;" \
+		"else " \
+			"setenv console ttyO0,115200n8;" \
+		"fi;\0" \
 	NANDARGS \
 	NETARGS \
 	DFUARGS \
Signature · 1 line
2.8.2
#12 lore raw

PATCH v2 6/8 config: env: Set AM335x-ICEv2 board specific env

Quoted 4 lines · Lokesh Vutla

Populate the right dtb file and console for AM335x-ICEv2 board.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160530/2c1dfe7b/attachment.sig>
#13 lore raw

PATCH v2 7/8 ARM: dts: AM335x-ICEv2: Add minimal dts support

In reply to Lokesh Vutla

Add minimal dts support for AM335x-ICEv2 board

---
Changes since v1:
- None

 arch/arm/dts/Makefile         |   3 +-
 arch/arm/dts/am335x-icev2.dts | 430 ++++++++++++++++++++++++++++++++++++++++++
 board/ti/am335x/board.c       |   2 +
 configs/am335x_evm_defconfig  |   2 +-
 4 files changed, 435 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/am335x-icev2.dts
arch/arm/dts/Makefile +2 -1
index 800750b..5efe9fe 100644
@@ -91,7 +91,8 @@ dtb-$(CONFIG_ARCH_ZYNQMP) += \
 	zynqmp-zc1751-xm019-dc5.dtb
 dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-bone.dtb am335x-evm.dtb \
 	am335x-evmsk.dtb \
-	am335x-bonegreen.dtb
+	am335x-bonegreen.dtb \
+	am335x-icev2.dtb
 dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb	\
 	am43x-epos-evm.dtb \
 	am437x-idk-evm.dtb
arch/arm/dts/am335x-icev2.dts new file +430 -0

430 lines not on this page · raw message

board/ti/am335x/board.c +2 -0
index 8f47692..ff52314 100644
@@ -758,6 +758,8 @@ int board_fit_config_name_match(const char *name)
 		return 0;
 	else if (board_is_bbg1() && !strcmp(name, "am335x-bonegreen"))
 		return 0;
+	else if (board_is_icev2() && !strcmp(name, "am335x-icev2"))
+		return 0;
 	else
 		return -1;
 }
configs/am335x_evm_defconfig +1 -1
index 5f917d6..12198c0 100644
@@ -46,4 +46,4 @@ CONFIG_RSA=y
 CONFIG_FIT=y
 CONFIG_SPL_OF_LIBFDT=y
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen"
+CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2"
Signature · 1 line
2.8.2
#14 lore raw

PATCH v2 7/8 ARM: dts: AM335x-ICEv2: Add minimal dts support

Quoted 5 lines · Lokesh Vutla

Add minimal dts support for AM335x-ICEv2 board

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160530/7d0e7e2d/attachment.sig>
#15 lore raw

PATCH v2 8/8 board: am335x: Allow to choose serial device dynamically

In reply to Lokesh Vutla

Different AM335x based platforms have different serial consoles. As serial console is Kconfig option a separate defconfig has to be created for each platform. So pass the serial device dynamically.

---
Changes since v1:
- New patch.

 board/ti/am335x/board.c | 11 +++++++++++
 include/serial.h        |  4 ++++
 2 files changed, 15 insertions(+)
board/ti/am335x/board.c +11 -0
index ff52314..56f4984 100644
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <errno.h>
 #include <spl.h>
+#include <serial.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/omap.h>
@@ -59,6 +60,16 @@ static inline int __maybe_unused read_eeprom(void)
 	return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR);
 }
 
+#ifndef CONFIG_DM_SERIAL
+struct serial_device *default_serial_console(void)
+{
+	if (board_is_icev2())
+		return &eserial4_device;
+	else
+		return &eserial1_device;
+}
+#endif
+
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 static const struct ddr_data ddr2_data = {
 	.datardsratio0 = MT47H128M16RT25E_RD_DQS,
include/serial.h +4 -0
index e490f9a..47332c5 100644
@@ -40,6 +40,10 @@ extern struct serial_device serial1_device;
 
 extern struct serial_device eserial1_device;
 extern struct serial_device eserial2_device;
+extern struct serial_device eserial3_device;
+extern struct serial_device eserial4_device;
+extern struct serial_device eserial5_device;
+extern struct serial_device eserial6_device;
 
 extern void serial_register(struct serial_device *);
 extern void serial_initialize(void);
Signature · 1 line
2.8.2
#16 lore raw

PATCH v2 8/8 board: am335x: Allow to choose serial device dynamically

Quoted 31 lines · Lokesh Vutla

Different AM335x based platforms have different serial consoles. As serial console is Kconfig option a separate defconfig has to be created for each platform. So pass the serial device dynamically.

---
Changes since v1:
- New patch.

 board/ti/am335x/board.c | 11 +++++++++++
 include/serial.h        |  4 ++++
 2 files changed, 15 insertions(+)
board/ti/am335x/board.c +4 -0
index ff52314..56f4984 100644
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <errno.h>
 #include <spl.h>
+#include <serial.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/omap.h>
@@ -59,6 +60,16 @@ static inline int __maybe_unused read_eeprom(void)
 	return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR);
 }
 
+#ifndef CONFIG_DM_SERIAL
+struct serial_device *default_serial_console(void)
+{

board/ti/am335x/board.c static inline int __maybe_unused read_eeprom(void) · line 75

Quoted 10 lines
board/ti/am335x/board.c +7 -0
+	if (board_is_icev2())
+		return &eserial4_device;
+	else
+		return &eserial1_device;
+}
+#endif
+
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 static const struct ddr_data ddr2_data = {
 	.datardsratio0 = MT47H128M16RT25E_RD_DQS,

... so in the DM case we're already handling this correctly? Can't we just say that ICEv2 is only supported with DM enabled so that we don't need to add compat code that we'll remove rather soon (I hope..) ? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160516/35e591b5/attachment-0001.sig>
#17 lore raw

PATCH v2 8/8 board: am335x: Allow to choose serial device dynamically

Quoted 30 lines · Tom Rini
Quoted 28 lines · Lokesh Vutla

Different AM335x based platforms have different serial consoles. As serial console is Kconfig option a separate defconfig has to be created for each platform. So pass the serial device dynamically.

---
Changes since v1:
- New patch.

  board/ti/am335x/board.c | 11 +++++++++++
  include/serial.h        |  4 ++++
  2 files changed, 15 insertions(+)
board/ti/am335x/board.c +1 -0
index ff52314..56f4984 100644
@@ -11,6 +11,7 @@
  #include <common.h>
  #include <errno.h>
  #include <spl.h>
+#include <serial.h>
  #include <asm/arch/cpu.h>
  #include <asm/arch/hardware.h>
  #include <asm/arch/omap.h>
@@ -59,6 +60,16 @@ static inline int __maybe_unused read_eeprom(void)
  	return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR);
  }
 
Quoted 15 lines

board/ti/am335x/board.c static inline int __maybe_unused read_eeprom(void) · line 75

Quoted 13 lines
board/ti/am335x/board.c +10 -0
+#ifndef CONFIG_DM_SERIAL
+struct serial_device *default_serial_console(void)
+{
+	if (board_is_icev2())
+		return &eserial4_device;
+	else
+		return &eserial1_device;
+}
+#endif
+
  #ifndef CONFIG_SKIP_LOWLEVEL_INIT
  static const struct ddr_data ddr2_data = {
  	.datardsratio0 = MT47H128M16RT25E_RD_DQS,

... so in the DM case we're already handling this correctly? Can't we

With DM+DT we are handling it correctly which is only in U-Boot. This part of code is meant for only SPL(DM_* is not yet enabled in SPL).

Thanks and regards,
Lokesh

Quoted 4 lines

just say that ICEv2 is only supported with DM enabled so that we don't need to add compat code that we'll remove rather soon (I hope..) ? Thanks!

#18 lore raw

PATCH v2 8/8 board: am335x: Allow to choose serial device dynamically

Quoted 49 lines · Lokesh Vutla
Quoted 30 lines · Tom Rini
Quoted 28 lines · Lokesh Vutla

Different AM335x based platforms have different serial consoles. As serial console is Kconfig option a separate defconfig has to be created for each platform. So pass the serial device dynamically.

---
Changes since v1:
- New patch.

 board/ti/am335x/board.c | 11 +++++++++++
 include/serial.h        |  4 ++++
 2 files changed, 15 insertions(+)
board/ti/am335x/board.c +1 -0
index ff52314..56f4984 100644
@@ -11,6 +11,7 @@
 #include <common.h>
 #include <errno.h>
 #include <spl.h>
+#include <serial.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/omap.h>
@@ -59,6 +60,16 @@ static inline int __maybe_unused read_eeprom(void)
 	return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR);
 }
 
Quoted 15 lines

board/ti/am335x/board.c static inline int __maybe_unused read_eeprom(void) · line 75

Quoted 13 lines
board/ti/am335x/board.c +10 -0
+#ifndef CONFIG_DM_SERIAL
+struct serial_device *default_serial_console(void)
+{
+	if (board_is_icev2())
+		return &eserial4_device;
+	else
+		return &eserial1_device;
+}
+#endif
+
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 static const struct ddr_data ddr2_data = {
 	.datardsratio0 = MT47H128M16RT25E_RD_DQS,

... so in the DM case we're already handling this correctly? Can't we

Quoted 3 lines

With DM+DT we are handling it correctly which is only in U-Boot. This part of code is meant for only SPL(DM_* is not yet enabled in SPL).

... aren't we in the middle of doing this conversion 'tho?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160517/8f8a67f5/attachment.sig>
#19 lore raw

PATCH v2 8/8 board: am335x: Allow to choose serial device dynamically

Quoted 50 lines · Tom Rini
Quoted 49 lines · Lokesh Vutla
Quoted 45 lines · Tom Rini
Quoted 31 lines · Lokesh Vutla

Different AM335x based platforms have different serial consoles. As serial console is Kconfig option a separate defconfig has to be created for each platform. So pass the serial device dynamically.

---
Changes since v1:
- New patch.

  board/ti/am335x/board.c | 11 +++++++++++
  include/serial.h        |  4 ++++
  2 files changed, 15 insertions(+)
board/ti/am335x/board.c +4 -0
index ff52314..56f4984 100644
@@ -11,6 +11,7 @@
  #include <common.h>
  #include <errno.h>
  #include <spl.h>
+#include <serial.h>
  #include <asm/arch/cpu.h>
  #include <asm/arch/hardware.h>
  #include <asm/arch/omap.h>
@@ -59,6 +60,16 @@ static inline int __maybe_unused read_eeprom(void)
  	return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR);
  }
 
+#ifndef CONFIG_DM_SERIAL
+struct serial_device *default_serial_console(void)
+{

board/ti/am335x/board.c static inline int __maybe_unused read_eeprom(void) · line 75

Quoted 10 lines
board/ti/am335x/board.c +7 -0
+	if (board_is_icev2())
+		return &eserial4_device;
+	else
+		return &eserial1_device;
+}
+#endif
+
  #ifndef CONFIG_SKIP_LOWLEVEL_INIT
  static const struct ddr_data ddr2_data = {
  	.datardsratio0 = MT47H128M16RT25E_RD_DQS,

... so in the DM case we're already handling this correctly? Can't we

Quoted 5 lines
Quoted 3 lines

With DM+DT we are handling it correctly which is only in U-Boot. This part of code is meant for only SPL(DM_* is not yet enabled in SPL).

... aren't we in the middle of doing this conversion 'tho?

hmm... I don't think this conversion for SPL has been done.

Thanks and regards,
Lokesh

Quoted 1 line
#20 lore raw

PATCH v2 8/8 board: am335x: Allow to choose serial device dynamically

In reply to Lokesh Vutla
Quoted 5 lines · Lokesh Vutla

Different AM335x based platforms have different serial consoles. As serial console is Kconfig option a separate defconfig has to be created for each platform. So pass the serial device dynamically.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160530/5b2258d1/attachment.sig>