All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM
@ 2014-11-03  9:32 Igor Grinberg
  2014-11-03  9:32 ` [U-Boot] [PATCH 01/11] am335x: make get_board_rev() function weak Igor Grinberg
                   ` (10 more replies)
  0 siblings, 11 replies; 39+ messages in thread
From: Igor Grinberg @ 2014-11-03  9:32 UTC (permalink / raw)
  To: u-boot

* Move reusable code to a CompuLab common location
* Switch omap_hsmmc cd gpio to active low
* Add CompuLab cm-t3517 support

Igor Grinberg (11):
  am335x: make get_board_rev() function weak
  compulab: refactor board revision handling
  omap3: cm-t35: move the USB hub reset code
  omap3: cm-t35: extract the splash code from board
  omap3: cm-t35: move the SMC911x code
  omap3: cm-t35: move get_board_serial() fallback
  omap: hsmmc: assume cd gpio is active low
  omap3: cm-t3517: add basic board support
  omap3: cm-t3517: add USB support
  omap3: cm-t3517: add Ethernet support
  omap3: cm-t3517: add LCD/DVI and splash support

 arch/arm/cpu/armv7/am33xx/sys_info.c  |   3 +-
 arch/arm/cpu/armv7/omap3/Kconfig      |   4 +
 board/compulab/cm_t35/cm_t35.c        | 157 ++--------------
 board/compulab/cm_t3517/Kconfig       |  12 ++
 board/compulab/cm_t3517/MAINTAINERS   |   6 +
 board/compulab/cm_t3517/Makefile      |   9 +
 board/compulab/cm_t3517/cm_t3517.c    | 231 ++++++++++++++++++++++++
 board/compulab/cm_t3517/mux.c         | 236 ++++++++++++++++++++++++
 board/compulab/cm_t54/cm_t54.c        |   7 +-
 board/compulab/common/Makefile        |   7 +-
 board/compulab/common/common.c        |  59 ++++++
 board/compulab/common/common.h        |  47 +++++
 board/compulab/common/eeprom.c        |  14 +-
 board/compulab/common/omap3_smc911x.c |  93 ++++++++++
 board/compulab/common/splash.c        |  72 ++++++++
 configs/cm_t3517_defconfig            |   4 +
 drivers/mmc/omap_hsmmc.c              |   4 +-
 include/configs/cm_t3517.h            | 325 ++++++++++++++++++++++++++++++++++
 18 files changed, 1134 insertions(+), 156 deletions(-)
 create mode 100644 board/compulab/cm_t3517/Kconfig
 create mode 100644 board/compulab/cm_t3517/MAINTAINERS
 create mode 100644 board/compulab/cm_t3517/Makefile
 create mode 100644 board/compulab/cm_t3517/cm_t3517.c
 create mode 100644 board/compulab/cm_t3517/mux.c
 create mode 100644 board/compulab/common/common.c
 create mode 100644 board/compulab/common/common.h
 create mode 100644 board/compulab/common/omap3_smc911x.c
 create mode 100644 board/compulab/common/splash.c
 create mode 100644 configs/cm_t3517_defconfig
 create mode 100644 include/configs/cm_t3517.h

-- 
2.0.4

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 01/11] am335x: make get_board_rev() function weak
  2014-11-03  9:32 [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM Igor Grinberg
@ 2014-11-03  9:32 ` Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
  2014-11-03  9:32 ` [U-Boot] [PATCH 02/11] compulab: refactor board revision handling Igor Grinberg
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 39+ messages in thread
From: Igor Grinberg @ 2014-11-03  9:32 UTC (permalink / raw)
  To: u-boot

Current get_board_rev() function returns a hard coded value which is
obviously incorrect for the majority of boards.
Allow boards to provide a correct implementation by making this
function weak.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 arch/arm/cpu/armv7/am33xx/sys_info.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/am33xx/sys_info.c b/arch/arm/cpu/armv7/am33xx/sys_info.c
index 2ce682f..c297fd8 100644
--- a/arch/arm/cpu/armv7/am33xx/sys_info.c
+++ b/arch/arm/cpu/armv7/am33xx/sys_info.c
@@ -18,6 +18,7 @@
 #include <asm/arch/cpu.h>
 #include <asm/arch/clock.h>
 #include <power/tps65910.h>
+#include <linux/compiler.h>
 
 struct ctrl_stat *cstat = (struct ctrl_stat *)CTRL_BASE;
 
@@ -53,7 +54,7 @@ u32 get_cpu_type(void)
  * get_board_rev() - setup to pass kernel board revision information
  * returns:(bit[0-3] sub version, higher bit[7-4] is higher version)
  */
-u32 get_board_rev(void)
+u32 __weak get_board_rev(void)
 {
 	return BOARD_REV_ID;
 }
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 02/11] compulab: refactor board revision handling
  2014-11-03  9:32 [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM Igor Grinberg
  2014-11-03  9:32 ` [U-Boot] [PATCH 01/11] am335x: make get_board_rev() function weak Igor Grinberg
@ 2014-11-03  9:32 ` Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:30   ` [U-Boot] [U-Boot, " Tom Rini
  2014-11-03  9:32 ` [U-Boot] [PATCH 03/11] omap3: cm-t35: move the USB hub reset code Igor Grinberg
                   ` (8 subsequent siblings)
  10 siblings, 2 replies; 39+ messages in thread
From: Igor Grinberg @ 2014-11-03  9:32 UTC (permalink / raw)
  To: u-boot

Move board revision handling code to a common location
for further reuse.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 board/compulab/cm_t35/cm_t35.c | 21 +++------------------
 board/compulab/common/Makefile |  5 +++--
 board/compulab/common/common.c | 25 +++++++++++++++++++++++++
 board/compulab/common/common.h | 14 ++++++++++++++
 board/compulab/common/eeprom.c | 14 +++++++++-----
 5 files changed, 54 insertions(+), 25 deletions(-)
 create mode 100644 board/compulab/common/common.c
 create mode 100644 board/compulab/common/common.h

diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c
index d0b0930..5453942 100644
--- a/board/compulab/cm_t35/cm_t35.c
+++ b/board/compulab/cm_t35/cm_t35.c
@@ -33,6 +33,7 @@
 #include <asm/ehci-omap.h>
 #include <asm/gpio.h>
 
+#include "../common/common.h"
 #include "../common/eeprom.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -154,34 +155,18 @@ int board_init(void)
 	return 0;
 }
 
-static u32 cm_t3x_rev;
-
 /*
  * Routine: get_board_rev
  * Description: read system revision
  */
 u32 get_board_rev(void)
 {
-	if (!cm_t3x_rev)
-		cm_t3x_rev = cl_eeprom_get_board_rev();
-
-	return cm_t3x_rev;
+	return cl_eeprom_get_board_rev();
 };
 
-/*
- * Routine: misc_init_r
- * Description: display die ID
- */
 int misc_init_r(void)
 {
-	u32 board_rev = get_board_rev();
-	u32 rev_major = board_rev / 100;
-	u32 rev_minor = board_rev - (rev_major * 100);
-
-	if ((rev_minor / 10) * 10 == rev_minor)
-		rev_minor = rev_minor / 10;
-
-	printf("PCB:   %u.%u\n", rev_major, rev_minor);
+	cl_print_pcb_info();
 	dieid_num_r();
 
 	return 0;
diff --git a/board/compulab/common/Makefile b/board/compulab/common/Makefile
index 4044ac9..e343bf0 100644
--- a/board/compulab/common/Makefile
+++ b/board/compulab/common/Makefile
@@ -6,5 +6,6 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-$(CONFIG_SYS_I2C) += eeprom.o
-obj-$(CONFIG_LCD) += omap3_display.o
+obj-y				+= common.o
+obj-$(CONFIG_SYS_I2C)		+= eeprom.o
+obj-$(CONFIG_LCD)		+= omap3_display.o
diff --git a/board/compulab/common/common.c b/board/compulab/common/common.c
new file mode 100644
index 0000000..6d2d7b0
--- /dev/null
+++ b/board/compulab/common/common.c
@@ -0,0 +1,25 @@
+/*
+ * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
+ *
+ * Authors: Igor Grinberg <grinberg@compulab.co.il>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/bootm.h>
+
+#include "common.h"
+#include "eeprom.h"
+
+void cl_print_pcb_info(void)
+{
+	u32 board_rev = get_board_rev();
+	u32 rev_major = board_rev / 100;
+	u32 rev_minor = board_rev - (rev_major * 100);
+
+	if ((rev_minor / 10) * 10 == rev_minor)
+		rev_minor = rev_minor / 10;
+
+	printf("PCB:   %u.%u\n", rev_major, rev_minor);
+}
diff --git a/board/compulab/common/common.h b/board/compulab/common/common.h
new file mode 100644
index 0000000..316ee4c
--- /dev/null
+++ b/board/compulab/common/common.h
@@ -0,0 +1,14 @@
+/*
+ * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
+ *
+ * Authors: Igor Grinberg <grinberg@compulab.co.il>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _CL_COMMON_
+#define _CL_COMMON_
+
+void cl_print_pcb_info(void);
+
+#endif /* _CL_COMMON_ */
diff --git a/board/compulab/common/eeprom.c b/board/compulab/common/eeprom.c
index 2df3ada..a45e7be 100644
--- a/board/compulab/common/eeprom.c
+++ b/board/compulab/common/eeprom.c
@@ -109,23 +109,27 @@ int cl_eeprom_read_mac_addr(uchar *buf)
 	return cl_eeprom_read(offset, buf, 6);
 }
 
+static u32 board_rev;
+
 /*
  * Routine: cl_eeprom_get_board_rev
  * Description: read system revision from eeprom
  */
 u32 cl_eeprom_get_board_rev(void)
 {
-	u32 rev = 0;
 	char str[5]; /* Legacy representation can contain at most 4 digits */
 	uint offset = BOARD_REV_OFFSET_LEGACY;
 
+	if (board_rev)
+		return board_rev;
+
 	if (cl_eeprom_setup_layout())
 		return 0;
 
 	if (cl_eeprom_layout != LAYOUT_LEGACY)
 		offset = BOARD_REV_OFFSET;
 
-	if (cl_eeprom_read(offset, (uchar *)&rev, BOARD_REV_SIZE))
+	if (cl_eeprom_read(offset, (uchar *)&board_rev, BOARD_REV_SIZE))
 		return 0;
 
 	/*
@@ -133,9 +137,9 @@ u32 cl_eeprom_get_board_rev(void)
 	 * representation. i.e. for rev 1.00: 0x100 --> 0x64
 	 */
 	if (cl_eeprom_layout == LAYOUT_LEGACY) {
-		sprintf(str, "%x", rev);
-		rev = simple_strtoul(str, NULL, 10);
+		sprintf(str, "%x", board_rev);
+		board_rev = simple_strtoul(str, NULL, 10);
 	}
 
-	return rev;
+	return board_rev;
 };
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 03/11] omap3: cm-t35: move the USB hub reset code
  2014-11-03  9:32 [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM Igor Grinberg
  2014-11-03  9:32 ` [U-Boot] [PATCH 01/11] am335x: make get_board_rev() function weak Igor Grinberg
  2014-11-03  9:32 ` [U-Boot] [PATCH 02/11] compulab: refactor board revision handling Igor Grinberg
@ 2014-11-03  9:32 ` Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:30   ` [U-Boot] [U-Boot, " Tom Rini
  2014-11-03  9:32 ` [U-Boot] [PATCH 04/11] omap3: cm-t35: extract the splash code from board Igor Grinberg
                   ` (7 subsequent siblings)
  10 siblings, 2 replies; 39+ messages in thread
From: Igor Grinberg @ 2014-11-03  9:32 UTC (permalink / raw)
  To: u-boot

Extract the USB hub reset code to a common location where it can be
reused by other compulab boards.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 board/compulab/cm_t35/cm_t35.c | 14 +++-----------
 board/compulab/common/common.c | 22 ++++++++++++++++++++++
 board/compulab/common/common.h | 13 +++++++++++++
 3 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c
index 5453942..aca41c8 100644
--- a/board/compulab/cm_t35/cm_t35.c
+++ b/board/compulab/cm_t35/cm_t35.c
@@ -568,21 +568,12 @@ struct omap_usbhs_board_data usbhs_bdata = {
 
 #define SB_T35_USB_HUB_RESET_GPIO	167
 int ehci_hcd_init(int index, enum usb_init_type init,
-		struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+		  struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
 	u8 val;
 	int offset;
 
-	if (gpio_request(SB_T35_USB_HUB_RESET_GPIO, "SB-T35 usb hub reset")) {
-		printf("Error: can't obtain GPIO %d for SB-T35 usb hub reset",
-				SB_T35_USB_HUB_RESET_GPIO);
-		return -1;
-	}
-
-	gpio_direction_output(SB_T35_USB_HUB_RESET_GPIO, 0);
-	udelay(10);
-	gpio_set_value(SB_T35_USB_HUB_RESET_GPIO, 1);
-	udelay(1000);
+	cl_usb_hub_init(SB_T35_USB_HUB_RESET_GPIO, "sb-t35 hub rst");
 
 	offset = TWL4030_BASEADD_GPIO + TWL4030_GPIO_GPIODATADIR1;
 	twl4030_i2c_read_u8(TWL4030_CHIP_GPIO, offset, &val);
@@ -599,6 +590,7 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 
 int ehci_hcd_stop(void)
 {
+	cl_usb_hub_deinit(SB_T35_USB_HUB_RESET_GPIO);
 	return omap_ehci_hcd_stop();
 }
 #endif /* CONFIG_USB_EHCI_OMAP */
diff --git a/board/compulab/common/common.c b/board/compulab/common/common.c
index 6d2d7b0..f2ce522 100644
--- a/board/compulab/common/common.c
+++ b/board/compulab/common/common.c
@@ -8,6 +8,7 @@
 
 #include <common.h>
 #include <asm/bootm.h>
+#include <asm/gpio.h>
 
 #include "common.h"
 #include "eeprom.h"
@@ -23,3 +24,24 @@ void cl_print_pcb_info(void)
 
 	printf("PCB:   %u.%u\n", rev_major, rev_minor);
 }
+
+#ifdef CONFIG_CMD_USB
+int cl_usb_hub_init(int gpio, const char *label)
+{
+	if (gpio_request(gpio, label)) {
+		printf("Error: can't obtain GPIO%d for %s", gpio, label);
+		return -1;
+	}
+
+	gpio_direction_output(gpio, 0);
+	udelay(10);
+	gpio_set_value(gpio, 1);
+	udelay(1000);
+	return 0;
+}
+
+void cl_usb_hub_deinit(int gpio)
+{
+	gpio_free(gpio);
+}
+#endif
diff --git a/board/compulab/common/common.h b/board/compulab/common/common.h
index 316ee4c..ffe1ef8 100644
--- a/board/compulab/common/common.h
+++ b/board/compulab/common/common.h
@@ -9,6 +9,19 @@
 #ifndef _CL_COMMON_
 #define _CL_COMMON_
 
+#include <asm/errno.h>
+
 void cl_print_pcb_info(void);
 
+#ifdef CONFIG_CMD_USB
+int cl_usb_hub_init(int gpio, const char *label);
+void cl_usb_hub_deinit(int gpio);
+#else /* !CONFIG_CMD_USB */
+static inline int cl_usb_hub_init(int gpio, const char *label)
+{
+	return -ENOSYS;
+}
+static inline void cl_usb_hub_deinit(int gpio) {}
+#endif /* CONFIG_CMD_USB */
+
 #endif /* _CL_COMMON_ */
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 04/11] omap3: cm-t35: extract the splash code from board
  2014-11-03  9:32 [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM Igor Grinberg
                   ` (2 preceding siblings ...)
  2014-11-03  9:32 ` [U-Boot] [PATCH 03/11] omap3: cm-t35: move the USB hub reset code Igor Grinberg
@ 2014-11-03  9:32 ` Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:30   ` [U-Boot] [U-Boot, " Tom Rini
  2014-11-03  9:32 ` [U-Boot] [PATCH 05/11] omap3: cm-t35: move the SMC911x code Igor Grinberg
                   ` (6 subsequent siblings)
  10 siblings, 2 replies; 39+ messages in thread
From: Igor Grinberg @ 2014-11-03  9:32 UTC (permalink / raw)
  To: u-boot

The splash screen loading code can be reused by other compulab boards.
For now extract it to a common location for further reuse.

This also switches the splash code dependency from CONFIG_LCD to
CONFIG_SPLASH_SCREEN as it should normally be.

In addition this patch fixes the accidental dependency of the
get_board_mem_timings() function on CONFIG_LCD, by just moving the
splash code and leaving the above function intact.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 board/compulab/cm_t35/cm_t35.c | 62 ++----------------------------------
 board/compulab/common/Makefile |  1 +
 board/compulab/common/common.h |  9 ++++++
 board/compulab/common/splash.c | 72 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 85 insertions(+), 59 deletions(-)
 create mode 100644 board/compulab/common/splash.c

diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c
index aca41c8..a3b38ae 100644
--- a/board/compulab/cm_t35/cm_t35.c
+++ b/board/compulab/cm_t35/cm_t35.c
@@ -19,9 +19,7 @@
 #include <i2c.h>
 #include <usb.h>
 #include <mmc.h>
-#include <nand.h>
 #include <twl4030.h>
-#include <bmp_layout.h>
 #include <linux/compiler.h>
 
 #include <asm/io.h>
@@ -54,48 +52,6 @@ static u32 gpmc_net_config[GPMC_MAX_REG] = {
 	0
 };
 
-#ifdef CONFIG_LCD
-#ifdef CONFIG_CMD_NAND
-static int splash_load_from_nand(u32 bmp_load_addr)
-{
-	struct bmp_header *bmp_hdr;
-	int res, splash_screen_nand_offset = 0x100000;
-	size_t bmp_size, bmp_header_size = sizeof(struct bmp_header);
-
-	if (bmp_load_addr + bmp_header_size >= gd->start_addr_sp)
-		goto splash_address_too_high;
-
-	res = nand_read_skip_bad(&nand_info[nand_curr_device],
-			splash_screen_nand_offset, &bmp_header_size,
-			NULL, nand_info[nand_curr_device].size,
-			(u_char *)bmp_load_addr);
-	if (res < 0)
-		return res;
-
-	bmp_hdr = (struct bmp_header *)bmp_load_addr;
-	bmp_size = le32_to_cpu(bmp_hdr->file_size);
-
-	if (bmp_load_addr + bmp_size >= gd->start_addr_sp)
-		goto splash_address_too_high;
-
-	return nand_read_skip_bad(&nand_info[nand_curr_device],
-			splash_screen_nand_offset, &bmp_size,
-			NULL, nand_info[nand_curr_device].size,
-			(u_char *)bmp_load_addr);
-
-splash_address_too_high:
-	printf("Error: splashimage address too high. Data overwrites U-Boot "
-		"and/or placed beyond DRAM boundaries.\n");
-
-	return -1;
-}
-#else
-static inline int splash_load_from_nand(void)
-{
-	return -1;
-}
-#endif /* CONFIG_CMD_NAND */
-
 #ifdef CONFIG_SPL_BUILD
 /*
  * Routine: get_board_mem_timings
@@ -112,24 +68,12 @@ void get_board_mem_timings(struct board_sdrc_timings *timings)
 }
 #endif
 
+#define CM_T35_SPLASH_NAND_OFFSET 0x100000
+
 int splash_screen_prepare(void)
 {
-	char *env_splashimage_value;
-	u32 bmp_load_addr;
-
-	env_splashimage_value = getenv("splashimage");
-	if (env_splashimage_value == NULL)
-		return -1;
-
-	bmp_load_addr = simple_strtoul(env_splashimage_value, 0, 16);
-	if (bmp_load_addr == 0) {
-		printf("Error: bad splashimage address specified\n");
-		return -1;
-	}
-
-	return splash_load_from_nand(bmp_load_addr);
+	return cl_splash_screen_prepare(CM_T35_SPLASH_NAND_OFFSET);
 }
-#endif /* CONFIG_LCD */
 
 /*
  * Routine: board_init
diff --git a/board/compulab/common/Makefile b/board/compulab/common/Makefile
index e343bf0..78237d1 100644
--- a/board/compulab/common/Makefile
+++ b/board/compulab/common/Makefile
@@ -9,3 +9,4 @@
 obj-y				+= common.o
 obj-$(CONFIG_SYS_I2C)		+= eeprom.o
 obj-$(CONFIG_LCD)		+= omap3_display.o
+obj-$(CONFIG_SPLASH_SCREEN)	+= splash.o
diff --git a/board/compulab/common/common.h b/board/compulab/common/common.h
index ffe1ef8..7a106d6 100644
--- a/board/compulab/common/common.h
+++ b/board/compulab/common/common.h
@@ -24,4 +24,13 @@ static inline int cl_usb_hub_init(int gpio, const char *label)
 static inline void cl_usb_hub_deinit(int gpio) {}
 #endif /* CONFIG_CMD_USB */
 
+#ifdef CONFIG_SPLASH_SCREEN
+int cl_splash_screen_prepare(int nand_offset);
+#else /* !CONFIG_SPLASH_SCREEN */
+static inline int cl_splash_screen_prepare(int nand_offset)
+{
+	return -ENOSYS;
+}
+#endif /* CONFIG_SPLASH_SCREEN */
+
 #endif /* _CL_COMMON_ */
diff --git a/board/compulab/common/splash.c b/board/compulab/common/splash.c
new file mode 100644
index 0000000..49ed49b
--- /dev/null
+++ b/board/compulab/common/splash.c
@@ -0,0 +1,72 @@
+/*
+ * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
+ *
+ * Authors: Igor Grinberg <grinberg@compulab.co.il>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <nand.h>
+#include <bmp_layout.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifdef CONFIG_CMD_NAND
+static int splash_load_from_nand(u32 bmp_load_addr, int nand_offset)
+{
+	struct bmp_header *bmp_hdr;
+	int res;
+	size_t bmp_size, bmp_header_size = sizeof(struct bmp_header);
+
+	if (bmp_load_addr + bmp_header_size >= gd->start_addr_sp)
+		goto splash_address_too_high;
+
+	res = nand_read_skip_bad(&nand_info[nand_curr_device],
+			nand_offset, &bmp_header_size,
+			NULL, nand_info[nand_curr_device].size,
+			(u_char *)bmp_load_addr);
+	if (res < 0)
+		return res;
+
+	bmp_hdr = (struct bmp_header *)bmp_load_addr;
+	bmp_size = le32_to_cpu(bmp_hdr->file_size);
+
+	if (bmp_load_addr + bmp_size >= gd->start_addr_sp)
+		goto splash_address_too_high;
+
+	return nand_read_skip_bad(&nand_info[nand_curr_device],
+			nand_offset, &bmp_size,
+			NULL, nand_info[nand_curr_device].size,
+			(u_char *)bmp_load_addr);
+
+splash_address_too_high:
+	printf("Error: splashimage address too high. Data overwrites U-Boot "
+		"and/or placed beyond DRAM boundaries.\n");
+
+	return -1;
+}
+#else
+static inline int splash_load_from_nand(u32 bmp_load_addr, int nand_offset)
+{
+	return -1;
+}
+#endif /* CONFIG_CMD_NAND */
+
+int cl_splash_screen_prepare(int nand_offset)
+{
+	char *env_splashimage_value;
+	u32 bmp_load_addr;
+
+	env_splashimage_value = getenv("splashimage");
+	if (env_splashimage_value == NULL)
+		return -1;
+
+	bmp_load_addr = simple_strtoul(env_splashimage_value, 0, 16);
+	if (bmp_load_addr == 0) {
+		printf("Error: bad splashimage address specified\n");
+		return -1;
+	}
+
+	return splash_load_from_nand(bmp_load_addr, nand_offset);
+}
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 05/11] omap3: cm-t35: move the SMC911x code
  2014-11-03  9:32 [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM Igor Grinberg
                   ` (3 preceding siblings ...)
  2014-11-03  9:32 ` [U-Boot] [PATCH 04/11] omap3: cm-t35: extract the splash code from board Igor Grinberg
@ 2014-11-03  9:32 ` Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:30   ` [U-Boot] [U-Boot,05/11] " Tom Rini
  2014-11-03  9:32 ` [U-Boot] [PATCH 06/11] omap3: cm-t35: move get_board_serial() fallback Igor Grinberg
                   ` (5 subsequent siblings)
  10 siblings, 2 replies; 39+ messages in thread
From: Igor Grinberg @ 2014-11-03  9:32 UTC (permalink / raw)
  To: u-boot

Extract the SMC911x initialization code to a common location where it
can be reused by other compulab omap3 based boards.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 board/compulab/cm_t35/cm_t35.c        | 50 +++----------------
 board/compulab/common/Makefile        |  1 +
 board/compulab/common/common.h        | 11 +++++
 board/compulab/common/omap3_smc911x.c | 93 +++++++++++++++++++++++++++++++++++
 4 files changed, 112 insertions(+), 43 deletions(-)
 create mode 100644 board/compulab/common/omap3_smc911x.c

diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c
index a3b38ae..3b96318 100644
--- a/board/compulab/cm_t35/cm_t35.c
+++ b/board/compulab/cm_t35/cm_t35.c
@@ -23,6 +23,7 @@
 #include <linux/compiler.h>
 
 #include <asm/io.h>
+#include <asm/errno.h>
 #include <asm/arch/mem.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/mmc_host_def.h>
@@ -42,16 +43,6 @@ const omap3_sysinfo sysinfo = {
 	"NAND",
 };
 
-static u32 gpmc_net_config[GPMC_MAX_REG] = {
-	NET_GPMC_CONFIG1,
-	NET_GPMC_CONFIG2,
-	NET_GPMC_CONFIG3,
-	NET_GPMC_CONFIG4,
-	NET_GPMC_CONFIG5,
-	NET_GPMC_CONFIG6,
-	0
-};
-
 #ifdef CONFIG_SPL_BUILD
 /*
  * Routine: get_board_mem_timings
@@ -391,37 +382,12 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
-/*
- * Routine: setup_net_chip_gmpc
- * Description: Setting up the configuration GPMC registers specific to the
- *		Ethernet hardware.
- */
-static void setup_net_chip_gmpc(void)
-{
-	struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
-
-	enable_gpmc_cs_config(gpmc_net_config, &gpmc_cfg->cs[5],
-			      CM_T3X_SMC911X_BASE, GPMC_SIZE_16M);
-	enable_gpmc_cs_config(gpmc_net_config, &gpmc_cfg->cs[4],
-			      SB_T35_SMC911X_BASE, GPMC_SIZE_16M);
-
-	/* Enable off mode for NWE in PADCONF_GPMC_NWE register */
-	writew(readw(&ctrl_base->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
-
-	/* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
-	writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
-
-	/* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
-	writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
-		&ctrl_base->gpmc_nadv_ale);
-}
-
 #ifdef CONFIG_SYS_I2C_OMAP34XX
 /*
  * Routine: reset_net_chip
  * Description: reset the Ethernet controller via TPS65930 GPIO
  */
-static void reset_net_chip(void)
+static int cm_t3x_reset_net_chip(int gpio)
 {
 	/* Set GPIO1 of TPS65930 as output */
 	twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, TWL4030_BASEADD_GPIO + 0x03,
@@ -436,9 +402,10 @@ static void reset_net_chip(void)
 	twl4030_i2c_write_u8(TWL4030_CHIP_GPIO, TWL4030_BASEADD_GPIO + 0x0C,
 			     0x02);
 	mdelay(1);
+	return 0;
 }
 #else
-static inline void reset_net_chip(void) {}
+static inline int cm_t3x_reset_net_chip(int gpio) { return 0; }
 #endif
 
 #ifdef CONFIG_SMC911X
@@ -465,7 +432,6 @@ static int handle_mac_address(void)
 	return eth_setenv_enetaddr("ethaddr", enetaddr);
 }
 
-
 /*
  * Routine: board_eth_init
  * Description: initialize module and base-board Ethernet chips
@@ -474,18 +440,16 @@ int board_eth_init(bd_t *bis)
 {
 	int rc = 0, rc1 = 0;
 
-	setup_net_chip_gmpc();
-	reset_net_chip();
-
 	rc1 = handle_mac_address();
 	if (rc1)
 		printf("No MAC address found! ");
 
-	rc1 = smc911x_initialize(0, CM_T3X_SMC911X_BASE);
+	rc1 = cl_omap3_smc911x_init(0, 5, CM_T3X_SMC911X_BASE,
+				    cm_t3x_reset_net_chip, -EINVAL);
 	if (rc1 > 0)
 		rc++;
 
-	rc1 = smc911x_initialize(1, SB_T35_SMC911X_BASE);
+	rc1 = cl_omap3_smc911x_init(1, 4, SB_T35_SMC911X_BASE, NULL, -EINVAL);
 	if (rc1 > 0)
 		rc++;
 
diff --git a/board/compulab/common/Makefile b/board/compulab/common/Makefile
index 78237d1..dbf0009 100644
--- a/board/compulab/common/Makefile
+++ b/board/compulab/common/Makefile
@@ -10,3 +10,4 @@ obj-y				+= common.o
 obj-$(CONFIG_SYS_I2C)		+= eeprom.o
 obj-$(CONFIG_LCD)		+= omap3_display.o
 obj-$(CONFIG_SPLASH_SCREEN)	+= splash.o
+obj-$(CONFIG_SMC911X)		+= omap3_smc911x.o
diff --git a/board/compulab/common/common.h b/board/compulab/common/common.h
index 7a106d6..68ffb11 100644
--- a/board/compulab/common/common.h
+++ b/board/compulab/common/common.h
@@ -33,4 +33,15 @@ static inline int cl_splash_screen_prepare(int nand_offset)
 }
 #endif /* CONFIG_SPLASH_SCREEN */
 
+#ifdef CONFIG_SMC911X
+int cl_omap3_smc911x_init(int id, int cs, u32 base_addr,
+			  int (*reset)(int), int rst_gpio);
+#else /* !CONFIG_SMC911X */
+static inline int cl_omap3_smc911x_init(int id, int cs, u32 base_addr,
+					int (*reset)(int), int rst_gpio)
+{
+	return -ENOSYS;
+}
+#endif /* CONFIG_SMC911X */
+
 #endif /* _CL_COMMON_ */
diff --git a/board/compulab/common/omap3_smc911x.c b/board/compulab/common/omap3_smc911x.c
new file mode 100644
index 0000000..4561661
--- /dev/null
+++ b/board/compulab/common/omap3_smc911x.c
@@ -0,0 +1,93 @@
+/*
+ * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
+ *
+ * Authors: Igor Grinberg <grinberg@compulab.co.il>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <netdev.h>
+
+#include <asm/io.h>
+#include <asm/errno.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/mem.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/gpio.h>
+
+#include "common.h"
+
+static u32 cl_omap3_smc911x_gpmc_net_config[GPMC_MAX_REG] = {
+	NET_GPMC_CONFIG1,
+	NET_GPMC_CONFIG2,
+	NET_GPMC_CONFIG3,
+	NET_GPMC_CONFIG4,
+	NET_GPMC_CONFIG5,
+	NET_GPMC_CONFIG6,
+	0
+};
+
+static void cl_omap3_smc911x_setup_net_chip_gmpc(int cs, u32 base_addr)
+{
+	struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+	enable_gpmc_cs_config(cl_omap3_smc911x_gpmc_net_config,
+			      &gpmc_cfg->cs[cs], base_addr, GPMC_SIZE_16M);
+
+	/* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+	writew(readw(&ctrl_base->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+
+	/* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+
+	/* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+	       &ctrl_base->gpmc_nadv_ale);
+}
+
+#ifdef CONFIG_OMAP_GPIO
+static int cl_omap3_smc911x_reset_net_chip(int gpio)
+{
+	int err;
+
+	if (!gpio_is_valid(gpio))
+		return -EINVAL;
+
+	err = gpio_request(gpio, "eth rst");
+	if (err)
+		return err;
+
+	/* Set gpio as output and send a pulse */
+	gpio_direction_output(gpio, 1);
+	udelay(1);
+	gpio_set_value(gpio, 0);
+	mdelay(40);
+	gpio_set_value(gpio, 1);
+	mdelay(1);
+
+	return 0;
+}
+#else /* !CONFIG_OMAP_GPIO */
+static inline int cl_omap3_smc911x_reset_net_chip(int gpio) { return 0; }
+#endif /* CONFIG_OMAP_GPIO */
+
+int cl_omap3_smc911x_init(int id, int cs, u32 base_addr,
+			  int (*reset)(int), int rst_gpio)
+{
+	int ret;
+
+	cl_omap3_smc911x_setup_net_chip_gmpc(cs, base_addr);
+
+	if (reset)
+		reset(rst_gpio);
+	else
+		cl_omap3_smc911x_reset_net_chip(rst_gpio);
+
+	ret = smc911x_initialize(id, base_addr);
+	if (ret > 0)
+		return ret;
+
+	printf("Failed initializing SMC911x! ");
+	return 0;
+}
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 06/11] omap3: cm-t35: move get_board_serial() fallback
  2014-11-03  9:32 [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM Igor Grinberg
                   ` (4 preceding siblings ...)
  2014-11-03  9:32 ` [U-Boot] [PATCH 05/11] omap3: cm-t35: move the SMC911x code Igor Grinberg
@ 2014-11-03  9:32 ` Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:30   ` [U-Boot] [U-Boot, " Tom Rini
  2014-11-03  9:32 ` [U-Boot] [PATCH 07/11] omap: hsmmc: assume cd gpio is active low Igor Grinberg
                   ` (4 subsequent siblings)
  10 siblings, 2 replies; 39+ messages in thread
From: Igor Grinberg @ 2014-11-03  9:32 UTC (permalink / raw)
  To: u-boot

The fallback is used for cases when CONFIG_SERIAL_TAG defined, but the
eeprom is not used.
The fallback is useful for more than one CompuLab board, so move it to a
common location.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 board/compulab/cm_t35/cm_t35.c | 10 ----------
 board/compulab/common/common.c | 12 ++++++++++++
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c
index 3b96318..886c723 100644
--- a/board/compulab/cm_t35/cm_t35.c
+++ b/board/compulab/cm_t35/cm_t35.c
@@ -457,16 +457,6 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
-void __weak get_board_serial(struct tag_serialnr *serialnr)
-{
-	/*
-	 * This corresponds to what happens when we can communicate with the
-	 * eeprom but don't get a valid board serial value.
-	 */
-	serialnr->low = 0;
-	serialnr->high = 0;
-};
-
 #ifdef CONFIG_USB_EHCI_OMAP
 struct omap_usbhs_board_data usbhs_bdata = {
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
diff --git a/board/compulab/common/common.c b/board/compulab/common/common.c
index f2ce522..b25d9a2 100644
--- a/board/compulab/common/common.c
+++ b/board/compulab/common/common.c
@@ -25,6 +25,18 @@ void cl_print_pcb_info(void)
 	printf("PCB:   %u.%u\n", rev_major, rev_minor);
 }
 
+#ifdef CONFIG_SERIAL_TAG
+void __weak get_board_serial(struct tag_serialnr *serialnr)
+{
+	/*
+	 * This corresponds to what happens when we can communicate with the
+	 * eeprom but don't get a valid board serial value.
+	 */
+	serialnr->low = 0;
+	serialnr->high = 0;
+};
+#endif
+
 #ifdef CONFIG_CMD_USB
 int cl_usb_hub_init(int gpio, const char *label)
 {
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 07/11] omap: hsmmc: assume cd gpio is active low
  2014-11-03  9:32 [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM Igor Grinberg
                   ` (5 preceding siblings ...)
  2014-11-03  9:32 ` [U-Boot] [PATCH 06/11] omap3: cm-t35: move get_board_serial() fallback Igor Grinberg
@ 2014-11-03  9:32 ` Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:31   ` [U-Boot] [U-Boot, " Tom Rini
  2014-11-03  9:32 ` [U-Boot] [PATCH 08/11] omap3: cm-t3517: add basic board support Igor Grinberg
                   ` (3 subsequent siblings)
  10 siblings, 2 replies; 39+ messages in thread
From: Igor Grinberg @ 2014-11-03  9:32 UTC (permalink / raw)
  To: u-boot

Switch the default CD GPIO polarity to active low.

The current hsmmc driver assumption that the CD GPIO is active high, but
in the real hardware, usually the opposite holds.
The usual SD card socket has a mechanical switch which is grounded as
soon as a card is inserted.
Of course there might be some board logic which inverts the signal, but
as far as current users are concerned, there is no such logic.

Current U-Boot users either not using the CD functionality, or have a
different way (e.g. external to SoC GPIO controller) for checking the
card presence.

This patch also brings the polarity assumption in line with the Linux
kernel and adds appropriate comments.

This patch also might spare issues once the TWL GPIO driver will be
converted to the DM.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
Cc: Dmitry Lifshitz <lifshitz@compulab.co.il>
---
 board/compulab/cm_t54/cm_t54.c | 7 +------
 drivers/mmc/omap_hsmmc.c       | 4 +++-
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/board/compulab/cm_t54/cm_t54.c b/board/compulab/cm_t54/cm_t54.c
index 944b723..b1a067d 100644
--- a/board/compulab/cm_t54/cm_t54.c
+++ b/board/compulab/cm_t54/cm_t54.c
@@ -100,16 +100,11 @@ uint mmc_get_env_part(struct mmc *mmc)
 #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);
+	ret0 = omap_mmc_init(0, 0, 0, SB_T54_CD_GPIO, SB_T54_WP_GPIO);
 	if (ret0)
 		printf("cm_t54: failed to initialize mmc0\n");
 
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index ef2cbf9..ffb5284 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -611,7 +611,8 @@ static int omap_hsmmc_getcd(struct mmc *mmc)
 	if (cd_gpio < 0)
 		return 1;
 
-	return gpio_get_value(cd_gpio);
+	/* NOTE: assumes card detect signal is active-low */
+	return !gpio_get_value(cd_gpio);
 }
 
 static int omap_hsmmc_getwp(struct mmc *mmc)
@@ -624,6 +625,7 @@ static int omap_hsmmc_getwp(struct mmc *mmc)
 	if (wp_gpio < 0)
 		return 0;
 
+	/* NOTE: assumes write protect signal is active-high */
 	return gpio_get_value(wp_gpio);
 }
 #endif
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 08/11] omap3: cm-t3517: add basic board support
  2014-11-03  9:32 [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM Igor Grinberg
                   ` (6 preceding siblings ...)
  2014-11-03  9:32 ` [U-Boot] [PATCH 07/11] omap: hsmmc: assume cd gpio is active low Igor Grinberg
@ 2014-11-03  9:32 ` Igor Grinberg
  2014-11-04 16:46   ` Tom Rini
  2014-11-03  9:32 ` [U-Boot] [PATCH 09/11] omap3: cm-t3517: add USB support Igor Grinberg
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 39+ messages in thread
From: Igor Grinberg @ 2014-11-03  9:32 UTC (permalink / raw)
  To: u-boot

CompuLab cm-t3517 is Computer on Module (CoM) based on AM3517 SoC.
Features: up to 256MB DDR2, up to 512MB NAND, USB hub, mUSB, WiFi, BT,
Analog audio codec, touch screen controller, LED.

Add basic support including:
LED, Serial console, NAND, MMC, GPIO, I2C, 256MB DRAM.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 arch/arm/cpu/armv7/omap3/Kconfig    |   4 +
 board/compulab/cm_t3517/Kconfig     |  12 ++
 board/compulab/cm_t3517/MAINTAINERS |   6 +
 board/compulab/cm_t3517/Makefile    |   9 ++
 board/compulab/cm_t3517/cm_t3517.c  |  60 ++++++++
 board/compulab/cm_t3517/mux.c       | 135 +++++++++++++++++
 configs/cm_t3517_defconfig          |   4 +
 include/configs/cm_t3517.h          | 282 ++++++++++++++++++++++++++++++++++++
 8 files changed, 512 insertions(+)
 create mode 100644 board/compulab/cm_t3517/Kconfig
 create mode 100644 board/compulab/cm_t3517/MAINTAINERS
 create mode 100644 board/compulab/cm_t3517/Makefile
 create mode 100644 board/compulab/cm_t3517/cm_t3517.c
 create mode 100644 board/compulab/cm_t3517/mux.c
 create mode 100644 configs/cm_t3517_defconfig
 create mode 100644 include/configs/cm_t3517.h

diff --git a/arch/arm/cpu/armv7/omap3/Kconfig b/arch/arm/cpu/armv7/omap3/Kconfig
index c215404..a029379 100644
--- a/arch/arm/cpu/armv7/omap3/Kconfig
+++ b/arch/arm/cpu/armv7/omap3/Kconfig
@@ -22,6 +22,9 @@ config TARGET_CM_T35
 	bool "CompuLab CM-T3530 and CM-T3730 boards"
 	select SUPPORT_SPL
 
+config TARGET_CM_T3517
+	bool "CompuLab CM-T3517 boards"
+
 config TARGET_DEVKIT8000
 	bool "TimLL OMAP3 Devkit8000"
 	select SUPPORT_SPL
@@ -98,6 +101,7 @@ source "board/teejet/mt_ventoux/Kconfig"
 source "board/ti/sdp3430/Kconfig"
 source "board/ti/beagle/Kconfig"
 source "board/compulab/cm_t35/Kconfig"
+source "board/compulab/cm_t3517/Kconfig"
 source "board/timll/devkit8000/Kconfig"
 source "board/ti/evm/Kconfig"
 source "board/isee/igep00x0/Kconfig"
diff --git a/board/compulab/cm_t3517/Kconfig b/board/compulab/cm_t3517/Kconfig
new file mode 100644
index 0000000..2f5473d
--- /dev/null
+++ b/board/compulab/cm_t3517/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_CM_T3517
+
+config SYS_BOARD
+	default "cm_t3517"
+
+config SYS_VENDOR
+	default "compulab"
+
+config SYS_CONFIG_NAME
+	default "cm_t3517"
+
+endif
diff --git a/board/compulab/cm_t3517/MAINTAINERS b/board/compulab/cm_t3517/MAINTAINERS
new file mode 100644
index 0000000..fbb6882
--- /dev/null
+++ b/board/compulab/cm_t3517/MAINTAINERS
@@ -0,0 +1,6 @@
+CM_T3517 BOARD
+M:	Igor Grinberg <grinberg@compulab.co.il>
+S:	Maintained
+F:	board/compulab/cm_t3517/
+F:	include/configs/cm_t3517.h
+F:	configs/cm_t3517_defconfig
diff --git a/board/compulab/cm_t3517/Makefile b/board/compulab/cm_t3517/Makefile
new file mode 100644
index 0000000..4f0db01
--- /dev/null
+++ b/board/compulab/cm_t3517/Makefile
@@ -0,0 +1,9 @@
+#
+# (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
+#
+# Authors: Igor Grinberg <grinberg@compulab.co.il>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	+= cm_t3517.o mux.o
diff --git a/board/compulab/cm_t3517/cm_t3517.c b/board/compulab/cm_t3517/cm_t3517.c
new file mode 100644
index 0000000..056fc15
--- /dev/null
+++ b/board/compulab/cm_t3517/cm_t3517.c
@@ -0,0 +1,60 @@
+/*
+ * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
+ *
+ * Authors: Igor Grinberg <grinberg@compulab.co.il>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <status_led.h>
+#include <mmc.h>
+#include <linux/compiler.h>
+
+#include <asm/io.h>
+#include <asm/arch/mem.h>
+#include <asm/arch/am35x_def.h>
+#include <asm/arch/mmc_host_def.h>
+#include <asm/arch/sys_proto.h>
+
+#include "../common/common.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+const omap3_sysinfo sysinfo = {
+	DDR_DISCRETE,
+	"CM-T3517 board",
+	"NAND 128/512M",
+};
+
+int board_init(void)
+{
+	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
+
+	/* boot param addr */
+	gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
+
+#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
+	status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
+#endif
+
+	return 0;
+}
+
+int misc_init_r(void)
+{
+	cl_print_pcb_info();
+	dieid_num_r();
+
+	return 0;
+}
+
+#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#define SB_T35_CD_GPIO 144
+#define SB_T35_WP_GPIO 59
+
+int board_mmc_init(bd_t *bis)
+{
+	return omap_mmc_init(0, 0, 0, SB_T35_CD_GPIO, SB_T35_WP_GPIO);
+}
+#endif
diff --git a/board/compulab/cm_t3517/mux.c b/board/compulab/cm_t3517/mux.c
new file mode 100644
index 0000000..f799d21
--- /dev/null
+++ b/board/compulab/cm_t3517/mux.c
@@ -0,0 +1,135 @@
+/*
+ * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
+ *
+ * Authors: Igor Grinberg <grinberg@compulab.co.il>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/mux.h>
+#include <asm/io.h>
+
+void set_muxconf_regs(void)
+{
+	/* SDRC */
+	MUX_VAL(CP(SDRC_D0),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D1),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D2),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D3),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D4),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D5),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D6),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D7),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D8),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D9),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D10),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D11),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D12),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D13),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D14),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D15),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D16),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D17),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D18),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D19),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D20),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D21),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D22),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D23),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D24),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D25),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D26),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D27),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D28),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D29),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D30),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D31),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_CLK),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_DQS0),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_DQS1),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_DQS2),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_DQS3),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_CKE0),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(SDRC_CKE1),		(IDIS | PTD | DIS | M7));
+
+	/* GPMC */
+	MUX_VAL(CP(GPMC_A1),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A2),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A3),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A4),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A5),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A6),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A7),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A8),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A9),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A10),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D0),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D1),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D2),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D3),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D4),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D5),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D6),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D7),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D8),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D9),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D10),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D11),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D12),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D13),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D14),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D15),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_NCS0),		(IDIS | PTU | EN  | M0));
+
+	/* SB-T35 SD/MMC WP GPIO59 */
+	MUX_VAL(CP(GPMC_CLK),		(IEN  | PTU | EN  | M4)); /*GPIO_59*/
+	MUX_VAL(CP(GPMC_NWE),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_NOE),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_NADV_ALE),	(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_NBE0_CLE),	(IDIS | PTU | EN  | M0));
+	/* SB-T35 Audio Enable GPIO61 */
+	MUX_VAL(CP(GPMC_NBE1),		(IDIS | PTU | EN  | M4)); /*GPIO_61*/
+	MUX_VAL(CP(GPMC_NWP),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_WAIT0),		(IEN  | PTU | EN  | M0));
+
+	/* UART3 Console */
+	MUX_VAL(CP(UART3_RX_IRRX),	(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(UART3_TX_IRTX),	(IDIS | PTD | DIS | M0));
+	/* RTC V3020 nCS GPIO163 */
+	MUX_VAL(CP(UART3_CTS_RCTX),	(IEN  | PTU | EN  | M4)); /*GPIO_163*/
+
+	/* SB-T35 SD/MMC CD GPIO144 */
+	MUX_VAL(CP(UART2_CTS),		(IEN  | PTU | EN  | M4)); /*GPIO_144*/
+	/* WIFI nRESET GPIO145 */
+	MUX_VAL(CP(UART2_RTS),		(IEN  | PTD | EN  | M4)); /*GPIO_145*/
+
+	/* MMC1 */
+	MUX_VAL(CP(MMC1_CLK),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_CMD),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT0),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT1),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT2),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT3),		(IEN  | PTU | EN  | M0));
+
+	/* I2C */
+	MUX_VAL(CP(I2C1_SCL),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(I2C1_SDA),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(I2C3_SCL),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(I2C3_SDA),		(IEN  | PTU | EN  | M0));
+
+	/* Green LED GPIO186 */
+	MUX_VAL(CP(SYS_CLKOUT2),	(IDIS | PTU | DIS | M4)); /*GPIO_186*/
+
+	/* RTC V3020 CS Enable GPIO160 */
+	MUX_VAL(CP(MCBSP_CLKS),		(IEN  | PTD | EN  | M4)); /*GPIO_160*/
+
+	/* SYS_BOOT */
+	MUX_VAL(CP(SYS_BOOT0),		(IEN  | PTU | DIS | M4)); /*GPIO_2*/
+	MUX_VAL(CP(SYS_BOOT1),		(IEN  | PTU | DIS | M4)); /*GPIO_3*/
+	MUX_VAL(CP(SYS_BOOT2),		(IEN  | PTU | DIS | M4)); /*GPIO_4*/
+	MUX_VAL(CP(SYS_BOOT3),		(IEN  | PTU | DIS | M4)); /*GPIO_5*/
+	MUX_VAL(CP(SYS_BOOT4),		(IEN  | PTU | DIS | M4)); /*GPIO_6*/
+	MUX_VAL(CP(SYS_BOOT5),		(IEN  | PTU | DIS | M4)); /*GPIO_7*/
+}
diff --git a/configs/cm_t3517_defconfig b/configs/cm_t3517_defconfig
new file mode 100644
index 0000000..4000d2c
--- /dev/null
+++ b/configs/cm_t3517_defconfig
@@ -0,0 +1,4 @@
+CONFIG_SPL=n
++S:CONFIG_ARM=y
++S:CONFIG_OMAP34XX=y
++S:CONFIG_TARGET_CM_T3517=y
diff --git a/include/configs/cm_t3517.h b/include/configs/cm_t3517.h
new file mode 100644
index 0000000..02ec932
--- /dev/null
+++ b/include/configs/cm_t3517.h
@@ -0,0 +1,282 @@
+/*
+ * (C) Copyright 2013 CompuLab, Ltd.
+ * Author: Igor Grinberg <grinberg@compulab.co.il>
+ *
+ * Configuration settings for the CompuLab CM-T3517 board
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_OMAP	/* in a TI OMAP core */
+#define CONFIG_CM_T3517	/* working with CM-T3517 */
+#define CONFIG_OMAP_COMMON
+#define CONFIG_SYS_GENERIC_BOARD
+
+#define CONFIG_SYS_TEXT_BASE	0x80008000
+
+/*
+ * This is needed for the DMA stuff.
+ * Although the default iss 64, we still define it
+ * to be on the safe side once the default is changed.
+ */
+#define CONFIG_SYS_CACHELINE_SIZE	64
+
+#define CONFIG_EMIF4	/* The chip has EMIF4 controller */
+
+#include <asm/arch/cpu.h>		/* get chip and board defs */
+#include <asm/arch/omap3.h>
+
+/*
+ * Display CPU and Board information
+ */
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/* Clock Defines */
+#define V_OSCK			26000000	/* Clock output from T2 */
+#define V_SCLK			(V_OSCK >> 1)
+
+#define CONFIG_MISC_INIT_R
+
+#define CONFIG_OF_LIBFDT
+/*
+ * The early kernel mapping on ARM currently only maps from the base of DRAM
+ * to the end of the kernel image.  The kernel is loaded at DRAM base + 0x8000.
+ * The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000,
+ * so that leaves DRAM base to DRAM base + 0x4000 available.
+ */
+#define CONFIG_SYS_BOOTMAPSZ	        0x4000
+
+#define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
+#define CONFIG_SERIAL_TAG
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_ENV_SIZE		(16 << 10)	/* 16 KiB */
+#define CONFIG_SYS_MALLOC_LEN	(CONFIG_ENV_SIZE + (128 << 10))
+
+/*
+ * Hardware drivers
+ */
+
+/*
+ * NS16550 Configuration
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE	(-4)
+#define CONFIG_SYS_NS16550_CLK		48000000	/* 48MHz (APLL96/2) */
+
+/*
+ * select serial console configuration
+ */
+#define CONFIG_CONS_INDEX		3
+#define CONFIG_SYS_NS16550_COM3		OMAP34XX_UART3
+#define CONFIG_SERIAL3			3	/* UART3 */
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_BAUDRATE			115200
+#define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
+					115200}
+
+#define CONFIG_OMAP_GPIO
+
+#define CONFIG_GENERIC_MMC
+#define CONFIG_MMC
+#define CONFIG_OMAP_HSMMC
+#define CONFIG_DOS_PARTITION
+
+/* commands to include */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_EXT2		/* EXT2 Support			*/
+#define CONFIG_CMD_FAT		/* FAT support			*/
+#define CONFIG_CMD_MTDPARTS	/* Enable MTD parts commands */
+#define CONFIG_MTD_DEVICE	/* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
+#define MTDIDS_DEFAULT		"nand0=nand"
+#define MTDPARTS_DEFAULT	"mtdparts=nand:512k(x-loader),"\
+				"1920k(u-boot),256k(u-boot-env),"\
+				"4m(kernel),-(fs)"
+
+#define CONFIG_CMD_I2C		/* I2C serial bus support	*/
+#define CONFIG_CMD_MMC		/* MMC support			*/
+#define CONFIG_CMD_NAND		/* NAND support			*/
+#define CONFIG_CMD_GPIO
+
+#undef CONFIG_CMD_FLASH		/* flinfo, erase, protect	*/
+#undef CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
+#undef CONFIG_CMD_IMLS		/* List all found images	*/
+
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_OMAP24_I2C_SPEED	400000
+#define CONFIG_SYS_OMAP24_I2C_SLAVE	1
+#define CONFIG_SYS_I2C_OMAP34XX
+#define CONFIG_SYS_I2C_EEPROM_ADDR	0x50
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1
+#define CONFIG_SYS_I2C_EEPROM_BUS	0
+#define CONFIG_I2C_MULTI_BUS
+
+/*
+ * Board NAND Info.
+ */
+#define CONFIG_SYS_NAND_QUIET_TEST
+#define CONFIG_NAND_OMAP_GPMC
+#define CONFIG_SYS_NAND_ADDR		NAND_BASE	/* physical address */
+							/* to access nand */
+#define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
+							/* to access nand at */
+							/* CS0 */
+#define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
+							/* devices */
+
+/* Environment information */
+#define CONFIG_BOOTDELAY		3
+#define CONFIG_ZERO_BOOTDELAY_CHECK
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"loadaddr=0x82000000\0" \
+	"baudrate=115200\0" \
+	"console=ttyO2,115200n8\0" \
+	"mpurate=auto\0" \
+	"vram=12M\0" \
+	"dvimode=1024x768MR-16 at 60\0" \
+	"defaultdisplay=dvi\0" \
+	"mmcdev=0\0" \
+	"mmcroot=/dev/mmcblk0p2 rw rootwait\0" \
+	"mmcrootfstype=ext4\0" \
+	"nandroot=/dev/mtdblock4 rw\0" \
+	"nandrootfstype=ubifs\0" \
+	"mmcargs=setenv bootargs console=${console} " \
+		"mpurate=${mpurate} " \
+		"vram=${vram} " \
+		"omapfb.mode=dvi:${dvimode} " \
+		"omapdss.def_disp=${defaultdisplay} " \
+		"root=${mmcroot} " \
+		"rootfstype=${mmcrootfstype}\0" \
+	"nandargs=setenv bootargs console=${console} " \
+		"mpurate=${mpurate} " \
+		"vram=${vram} " \
+		"omapfb.mode=dvi:${dvimode} " \
+		"omapdss.def_disp=${defaultdisplay} " \
+		"root=${nandroot} " \
+		"rootfstype=${nandrootfstype}\0" \
+	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+	"bootscript=echo Running bootscript from mmc ...; " \
+		"source ${loadaddr}\0" \
+	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+	"mmcboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"bootm ${loadaddr}\0" \
+	"nandboot=echo Booting from nand ...; " \
+		"run nandargs; " \
+		"nand read ${loadaddr} 2a0000 400000; " \
+		"bootm ${loadaddr}\0" \
+
+#define CONFIG_CMD_BOOTZ
+#define CONFIG_BOOTCOMMAND \
+	"mmc dev ${mmcdev}; if mmc rescan; then " \
+		"if run loadbootscript; then " \
+			"run bootscript; " \
+		"else " \
+			"if run loaduimage; then " \
+				"run mmcboot; " \
+			"else run nandboot; " \
+			"fi; " \
+		"fi; " \
+	"else run nandboot; fi"
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_TIMESTAMP
+#define CONFIG_SYS_AUTOLOAD		"no"
+#define CONFIG_SYS_LONGHELP		/* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER		/* use "hush" command parser */
+#define CONFIG_SYS_PROMPT		"CM-T3517 # "
+#define CONFIG_SYS_CBSIZE		512	/* Console I/O Buffer Size */
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
+					sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS		32	/* max number of command args */
+/* Boot Argument Buffer Size */
+#define CONFIG_SYS_BARGSIZE		(CONFIG_SYS_CBSIZE)
+
+#define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0)	/* memtest */
+								/* works on */
+#define CONFIG_SYS_MEMTEST_END		(OMAP34XX_SDRC_CS0 + \
+					0x01F00000) /* 31MB */
+
+#define CONFIG_SYS_LOAD_ADDR		(OMAP34XX_SDRC_CS0 + 0x02000000)
+
+/*
+ * AM3517 has 12 GP timers, they can be driven by the system clock
+ * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
+ * This rate is divided by a local divisor.
+ */
+#define CONFIG_SYS_TIMERBASE		(OMAP34XX_GPT2)
+#define CONFIG_SYS_PTV			2       /* Divisor: 2^(PTV+1) => 8 */
+#define CONFIG_SYS_HZ			1000
+
+/*-----------------------------------------------------------------------
+ * Physical Memory Map
+ */
+#define CONFIG_NR_DRAM_BANKS	1	/* CM-T3517 DRAM is only on CS0 */
+#define PHYS_SDRAM_1		OMAP34XX_SDRC_CS0
+#define CONFIG_SYS_CS0_SIZE		(256 << 20)
+
+/*-----------------------------------------------------------------------
+ * FLASH and environment organization
+ */
+
+/* **** PISMO SUPPORT *** */
+/* Monitor@start of flash */
+#define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 2 sectors */
+
+#define CONFIG_ENV_IS_IN_NAND
+#define SMNAND_ENV_OFFSET		0x260000 /* environment starts here */
+#define CONFIG_ENV_OFFSET		SMNAND_ENV_OFFSET
+#define CONFIG_ENV_ADDR			SMNAND_ENV_OFFSET
+
+/* additions for new relocation code, must be added to all boards */
+#define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_RAM_ADDR	0x4020f800
+#define CONFIG_SYS_INIT_RAM_SIZE	0x800
+#define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_INIT_RAM_ADDR +	\
+					 CONFIG_SYS_INIT_RAM_SIZE -	\
+					 GENERATED_GBL_DATA_SIZE)
+
+/* Status LED */
+#define CONFIG_STATUS_LED		/* Status LED enabled */
+#define CONFIG_BOARD_SPECIFIC_LED
+#define CONFIG_GPIO_LED
+#define GREEN_LED_GPIO			186 /* CM-T3517 Green LED is GPIO186 */
+#define GREEN_LED_DEV			0
+#define STATUS_LED_BIT			GREEN_LED_GPIO
+#define STATUS_LED_STATE		STATUS_LED_ON
+#define STATUS_LED_PERIOD		(CONFIG_SYS_HZ / 2)
+#define STATUS_LED_BOOT			GREEN_LED_DEV
+
+/* GPIO banks */
+#ifdef CONFIG_STATUS_LED
+#define CONFIG_OMAP3_GPIO_6	/* GPIO186 is in GPIO bank 6  */
+#endif
+
+#endif /* __CONFIG_H */
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 09/11] omap3: cm-t3517: add USB support
  2014-11-03  9:32 [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM Igor Grinberg
                   ` (7 preceding siblings ...)
  2014-11-03  9:32 ` [U-Boot] [PATCH 08/11] omap3: cm-t3517: add basic board support Igor Grinberg
@ 2014-11-03  9:32 ` Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:31   ` [U-Boot] [U-Boot,09/11] " Tom Rini
  2014-11-03  9:32 ` [U-Boot] [PATCH 10/11] omap3: cm-t3517: add Ethernet support Igor Grinberg
  2014-11-03  9:32 ` [U-Boot] [PATCH 11/11] omap3: cm-t3517: add LCD/DVI and splash support Igor Grinberg
  10 siblings, 2 replies; 39+ messages in thread
From: Igor Grinberg @ 2014-11-03  9:32 UTC (permalink / raw)
  To: u-boot

Add both host and mUSB support.
Currently, the selection between host USB and mUSB is done through the
config file.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 board/compulab/cm_t3517/cm_t3517.c | 82 ++++++++++++++++++++++++++++++++++++++
 board/compulab/cm_t3517/mux.c      | 38 ++++++++++++++++++
 include/configs/cm_t3517.h         | 17 ++++++++
 3 files changed, 137 insertions(+)

diff --git a/board/compulab/cm_t3517/cm_t3517.c b/board/compulab/cm_t3517/cm_t3517.c
index 056fc15..6abecc2 100644
--- a/board/compulab/cm_t3517/cm_t3517.c
+++ b/board/compulab/cm_t3517/cm_t3517.c
@@ -8,14 +8,19 @@
 
 #include <common.h>
 #include <status_led.h>
+#include <usb.h>
 #include <mmc.h>
 #include <linux/compiler.h>
+#include <linux/usb/musb.h>
 
 #include <asm/io.h>
 #include <asm/arch/mem.h>
 #include <asm/arch/am35x_def.h>
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/sys_proto.h>
+#include <asm/arch/musb.h>
+#include <asm/omap_musb.h>
+#include <asm/ehci-omap.h>
 
 #include "../common/common.h"
 
@@ -27,6 +32,53 @@ const omap3_sysinfo sysinfo = {
 	"NAND 128/512M",
 };
 
+#ifdef CONFIG_USB_MUSB_AM35X
+static struct musb_hdrc_config cm_t3517_musb_config = {
+	.multipoint     = 1,
+	.dyn_fifo       = 1,
+	.num_eps        = 16,
+	.ram_bits       = 12,
+};
+
+static struct omap_musb_board_data cm_t3517_musb_board_data = {
+	.set_phy_power		= am35x_musb_phy_power,
+	.clear_irq		= am35x_musb_clear_irq,
+	.reset			= am35x_musb_reset,
+};
+
+static struct musb_hdrc_platform_data cm_t3517_musb_pdata = {
+#if defined(CONFIG_MUSB_HOST)
+	.mode           = MUSB_HOST,
+#elif defined(CONFIG_MUSB_GADGET)
+	.mode		= MUSB_PERIPHERAL,
+#else
+#error "Please define either CONFIG_MUSB_HOST or CONFIG_MUSB_GADGET"
+#endif
+	.config         = &cm_t3517_musb_config,
+	.power          = 250,
+	.platform_ops	= &am35x_ops,
+	.board_data	= &cm_t3517_musb_board_data,
+};
+
+static void cm_t3517_musb_init(void)
+{
+	/*
+	 * Set up USB clock/mode in the DEVCONF2 register.
+	 * USB2.0 PHY reference clock is 13 MHz
+	 */
+	clrsetbits_le32(&am35x_scm_general_regs->devconf2,
+			CONF2_REFFREQ | CONF2_OTGMODE | CONF2_PHY_GPIOMODE,
+			CONF2_REFFREQ_13MHZ | CONF2_SESENDEN |
+			CONF2_VBDTCTEN | CONF2_DATPOL);
+
+	if (musb_register(&cm_t3517_musb_pdata, &cm_t3517_musb_board_data,
+			  (void *)AM35XX_IPSS_USBOTGSS_BASE))
+		printf("Failed initializing AM35x MUSB!\n");
+}
+#else
+static inline void am3517_evm_musb_init(void) {}
+#endif
+
 int board_init(void)
 {
 	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
@@ -38,6 +90,8 @@ int board_init(void)
 	status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
 #endif
 
+	cm_t3517_musb_init();
+
 	return 0;
 }
 
@@ -58,3 +112,31 @@ int board_mmc_init(bd_t *bis)
 	return omap_mmc_init(0, 0, 0, SB_T35_CD_GPIO, SB_T35_WP_GPIO);
 }
 #endif
+
+#ifdef CONFIG_USB_EHCI_OMAP
+static struct omap_usbhs_board_data cm_t3517_usbhs_bdata = {
+	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
+	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
+	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
+};
+
+#define CM_T3517_USB_HUB_RESET_GPIO	152
+#define SB_T35_USB_HUB_RESET_GPIO	98
+
+int ehci_hcd_init(int index, enum usb_init_type init,
+			struct ehci_hccr **hccr, struct ehci_hcor **hcor)
+{
+	cl_usb_hub_init(CM_T3517_USB_HUB_RESET_GPIO, "cm-t3517 hub rst");
+	cl_usb_hub_init(SB_T35_USB_HUB_RESET_GPIO, "sb-t35 hub rst");
+
+	return omap_ehci_hcd_init(index, &cm_t3517_usbhs_bdata, hccr, hcor);
+}
+
+int ehci_hcd_stop(void)
+{
+	cl_usb_hub_deinit(CM_T3517_USB_HUB_RESET_GPIO);
+	cl_usb_hub_deinit(SB_T35_USB_HUB_RESET_GPIO);
+
+	return omap_ehci_hcd_stop();
+}
+#endif /* CONFIG_USB_EHCI_OMAP */
diff --git a/board/compulab/cm_t3517/mux.c b/board/compulab/cm_t3517/mux.c
index f799d21..e1575a6 100644
--- a/board/compulab/cm_t3517/mux.c
+++ b/board/compulab/cm_t3517/mux.c
@@ -104,6 +104,10 @@ void set_muxconf_regs(void)
 	MUX_VAL(CP(UART2_CTS),		(IEN  | PTU | EN  | M4)); /*GPIO_144*/
 	/* WIFI nRESET GPIO145 */
 	MUX_VAL(CP(UART2_RTS),		(IEN  | PTD | EN  | M4)); /*GPIO_145*/
+	/* USB1 PHY Reset GPIO 146 */
+	MUX_VAL(CP(UART2_TX),		(IEN  | PTD | EN  | M4)); /*GPIO_146*/
+	/* USB2 PHY Reset GPIO 147 */
+	MUX_VAL(CP(UART2_RX),		(IEN  | PTD | EN  | M4)); /*GPIO_147*/
 
 	/* MMC1 */
 	MUX_VAL(CP(MMC1_CLK),		(IDIS | PTU | EN  | M0));
@@ -119,12 +123,46 @@ void set_muxconf_regs(void)
 	MUX_VAL(CP(I2C3_SCL),		(IEN  | PTU | EN  | M0));
 	MUX_VAL(CP(I2C3_SDA),		(IEN  | PTU | EN  | M0));
 
+	/* SB-T35 USB HUB Reset GPIO98 */
+	MUX_VAL(CP(CCDC_WEN),		(IDIS | PTU | EN  | M4)); /*GPIO_98*/
+	/* CM-T3517 USB HUB Reset GPIO152 */
+	MUX_VAL(CP(MCBSP4_CLKX),	(IDIS | PTD | DIS | M4)); /*GPIO_152*/
+
 	/* Green LED GPIO186 */
 	MUX_VAL(CP(SYS_CLKOUT2),	(IDIS | PTU | DIS | M4)); /*GPIO_186*/
 
 	/* RTC V3020 CS Enable GPIO160 */
 	MUX_VAL(CP(MCBSP_CLKS),		(IEN  | PTD | EN  | M4)); /*GPIO_160*/
 
+	/* USB0 - mUSB */
+	MUX_VAL(CP(USB0_DRVBUS),	(IEN  | PTD | EN  | M0));
+	/* USB1 EHCI */
+	MUX_VAL(CP(ETK_D0_ES2),		(IEN  | PTD | EN  | M3)); /*HSUSB1_DT0*/
+	MUX_VAL(CP(ETK_D1_ES2),		(IEN  | PTD | EN  | M3)); /*HSUSB1_DT1*/
+	MUX_VAL(CP(ETK_D2_ES2),		(IEN  | PTD | EN  | M3)); /*HSUSB1_DT2*/
+	MUX_VAL(CP(ETK_D7_ES2),		(IEN  | PTD | EN  | M3)); /*HSUSB1_DT3*/
+	MUX_VAL(CP(ETK_D4_ES2),		(IEN  | PTD | EN  | M3)); /*HSUSB1_DT4*/
+	MUX_VAL(CP(ETK_D5_ES2),		(IEN  | PTD | EN  | M3)); /*HSUSB1_DT5*/
+	MUX_VAL(CP(ETK_D6_ES2),		(IEN  | PTD | EN  | M3)); /*HSUSB1_DT6*/
+	MUX_VAL(CP(ETK_D3_ES2),		(IEN  | PTD | EN  | M3)); /*HSUSB1_DT7*/
+	MUX_VAL(CP(ETK_D8_ES2),		(IEN  | PTD | EN  | M3)); /*HSUSB1_DIR*/
+	MUX_VAL(CP(ETK_D9_ES2),		(IEN  | PTD | EN  | M3)); /*HSUSB1_NXT*/
+	MUX_VAL(CP(ETK_CTL_ES2),	(IDIS | PTD | DIS | M3)); /*HSUSB1_CLK*/
+	MUX_VAL(CP(ETK_CLK_ES2),	(IDIS | PTU | DIS | M3)); /*HSUSB1_STP*/
+	/* USB2 EHCI */
+	MUX_VAL(CP(ETK_D14_ES2),	(IEN  | PTD | EN  | M3)); /*HSUSB2_DT0*/
+	MUX_VAL(CP(ETK_D15_ES2),	(IEN  | PTD | EN  | M3)); /*HSUSB2_DT1*/
+	MUX_VAL(CP(MCSPI1_CS3),		(IEN  | PTD | EN  | M3)); /*HSUSB2_DT2*/
+	MUX_VAL(CP(MCSPI2_CS1),		(IEN  | PTD | EN  | M3)); /*HSUSB2_DT3*/
+	MUX_VAL(CP(MCSPI2_SIMO),	(IEN  | PTD | EN  | M3)); /*HSUSB2_DT4*/
+	MUX_VAL(CP(MCSPI2_SOMI),	(IEN  | PTD | EN  | M3)); /*HSUSB2_DT5*/
+	MUX_VAL(CP(MCSPI2_CS0),		(IEN  | PTD | EN  | M3)); /*HSUSB2_DT6*/
+	MUX_VAL(CP(MCSPI2_CLK),		(IEN  | PTD | EN  | M3)); /*HSUSB2_DT7*/
+	MUX_VAL(CP(ETK_D12_ES2),	(IEN  | PTD | EN  | M3)); /*HSUSB2_DIR*/
+	MUX_VAL(CP(ETK_D13_ES2),	(IEN  | PTD | EN  | M3)); /*HSUSB2_NXT*/
+	MUX_VAL(CP(ETK_D10_ES2),	(IDIS | PTD | DIS | M3)); /*HSUSB2_CLK*/
+	MUX_VAL(CP(ETK_D11_ES2),	(IDIS | PTU | DIS | M3)); /*HSUSB2_STP*/
+
 	/* SYS_BOOT */
 	MUX_VAL(CP(SYS_BOOT0),		(IEN  | PTU | DIS | M4)); /*GPIO_2*/
 	MUX_VAL(CP(SYS_BOOT1),		(IEN  | PTU | DIS | M4)); /*GPIO_3*/
diff --git a/include/configs/cm_t3517.h b/include/configs/cm_t3517.h
index 02ec932..1c2d1f4 100644
--- a/include/configs/cm_t3517.h
+++ b/include/configs/cm_t3517.h
@@ -98,6 +98,23 @@
 #define CONFIG_OMAP_HSMMC
 #define CONFIG_DOS_PARTITION
 
+/* USB */
+#define CONFIG_USB_MUSB_AM35X
+
+#ifndef CONFIG_USB_MUSB_AM35X
+#define CONFIG_USB_OMAP3
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_OMAP
+#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 146
+#define CONFIG_OMAP_EHCI_PHY2_RESET_GPIO 147
+#else /* !CONFIG_USB_MUSB_AM35X */
+#define CONFIG_MUSB_HOST
+#define CONFIG_MUSB_PIO_ONLY
+#endif /* CONFIG_USB_MUSB_AM35X */
+
+#define CONFIG_USB_STORAGE
+#define CONFIG_CMD_USB
+
 /* commands to include */
 #include <config_cmd_default.h>
 
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 10/11] omap3: cm-t3517: add Ethernet support
  2014-11-03  9:32 [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM Igor Grinberg
                   ` (8 preceding siblings ...)
  2014-11-03  9:32 ` [U-Boot] [PATCH 09/11] omap3: cm-t3517: add USB support Igor Grinberg
@ 2014-11-03  9:32 ` Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:31   ` [U-Boot] [U-Boot,10/11] " Tom Rini
  2014-11-03  9:32 ` [U-Boot] [PATCH 11/11] omap3: cm-t3517: add LCD/DVI and splash support Igor Grinberg
  10 siblings, 2 replies; 39+ messages in thread
From: Igor Grinberg @ 2014-11-03  9:32 UTC (permalink / raw)
  To: u-boot

Add both EMAC and SMC911x support.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 board/compulab/cm_t3517/cm_t3517.c | 89 ++++++++++++++++++++++++++++++++++++++
 board/compulab/cm_t3517/mux.c      | 19 ++++++++
 include/configs/cm_t3517.h         | 11 +++++
 3 files changed, 119 insertions(+)

diff --git a/board/compulab/cm_t3517/cm_t3517.c b/board/compulab/cm_t3517/cm_t3517.c
index 6abecc2..cac1ad9 100644
--- a/board/compulab/cm_t3517/cm_t3517.c
+++ b/board/compulab/cm_t3517/cm_t3517.c
@@ -8,6 +8,8 @@
 
 #include <common.h>
 #include <status_led.h>
+#include <net.h>
+#include <netdev.h>
 #include <usb.h>
 #include <mmc.h>
 #include <linux/compiler.h>
@@ -23,6 +25,7 @@
 #include <asm/ehci-omap.h>
 
 #include "../common/common.h"
+#include "../common/eeprom.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -113,6 +116,92 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_DRIVER_TI_EMAC
+#define CONTROL_EFUSE_EMAC_LSB  0x48002380
+#define CONTROL_EFUSE_EMAC_MSB  0x48002384
+
+static int am3517_get_efuse_enetaddr(u8 *enetaddr)
+{
+	u32 lsb = __raw_readl(CONTROL_EFUSE_EMAC_LSB);
+	u32 msb = __raw_readl(CONTROL_EFUSE_EMAC_MSB);
+
+	enetaddr[0] = (u8)((msb >> 16) & 0xff);
+	enetaddr[1] = (u8)((msb >> 8)  & 0xff);
+	enetaddr[2] = (u8)(msb & 0xff);
+	enetaddr[3] = (u8)((lsb >> 16) & 0xff);
+	enetaddr[4] = (u8)((lsb >> 8)  & 0xff);
+	enetaddr[5] = (u8)(lsb & 0xff);
+
+	return is_valid_ether_addr(enetaddr);
+}
+
+static inline int cm_t3517_init_emac(bd_t *bis)
+{
+	int ret = cpu_eth_init(bis);
+
+	if (ret > 0)
+		return ret;
+
+	printf("Failed initializing EMAC! ");
+	return 0;
+}
+#else /* !CONFIG_DRIVER_TI_EMAC */
+static inline int am3517_get_efuse_enetaddr(u8 *enetaddr) { return 1; }
+static inline int cm_t3517_init_emac(bd_t *bis) { return 0; }
+#endif /* CONFIG_DRIVER_TI_EMAC */
+
+/*
+ * Routine: handle_mac_address
+ * Description: prepare MAC address for on-board Ethernet.
+ */
+static int cm_t3517_handle_mac_address(void)
+{
+	unsigned char enetaddr[6];
+	int ret;
+
+	ret = eth_getenv_enetaddr("ethaddr", enetaddr);
+	if (ret)
+		return 0;
+
+	ret = cl_eeprom_read_mac_addr(enetaddr);
+	if (ret) {
+		ret = am3517_get_efuse_enetaddr(enetaddr);
+		if (ret)
+			return ret;
+	}
+
+	if (!is_valid_ether_addr(enetaddr))
+		return -1;
+
+	return eth_setenv_enetaddr("ethaddr", enetaddr);
+}
+
+#define SB_T35_ETH_RST_GPIO 164
+
+/*
+ * Routine: board_eth_init
+ * Description: initialize module and base-board Ethernet chips
+ */
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0, rc1 = 0;
+
+	rc1 = cm_t3517_handle_mac_address();
+	if (rc1)
+		printf("No MAC address found! ");
+
+	rc1 = cm_t3517_init_emac(bis);
+	if (rc1 > 0)
+		rc++;
+
+	rc1 = cl_omap3_smc911x_init(0, 4, CONFIG_SMC911X_BASE,
+				    NULL, SB_T35_ETH_RST_GPIO);
+	if (rc1 > 0)
+		rc++;
+
+	return rc;
+}
+
 #ifdef CONFIG_USB_EHCI_OMAP
 static struct omap_usbhs_board_data cm_t3517_usbhs_bdata = {
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
diff --git a/board/compulab/cm_t3517/mux.c b/board/compulab/cm_t3517/mux.c
index e1575a6..cb54c2c 100644
--- a/board/compulab/cm_t3517/mux.c
+++ b/board/compulab/cm_t3517/mux.c
@@ -83,6 +83,9 @@ void set_muxconf_regs(void)
 	MUX_VAL(CP(GPMC_D15),		(IEN  | PTU | EN  | M0));
 	MUX_VAL(CP(GPMC_NCS0),		(IDIS | PTU | EN  | M0));
 
+	/* SB-T35 Ethernet */
+	MUX_VAL(CP(GPMC_NCS4),		(IEN  | PTU | EN  | M0));
+
 	/* SB-T35 SD/MMC WP GPIO59 */
 	MUX_VAL(CP(GPMC_CLK),		(IEN  | PTU | EN  | M4)); /*GPIO_59*/
 	MUX_VAL(CP(GPMC_NWE),		(IDIS | PTD | DIS | M0));
@@ -93,12 +96,16 @@ void set_muxconf_regs(void)
 	MUX_VAL(CP(GPMC_NBE1),		(IDIS | PTU | EN  | M4)); /*GPIO_61*/
 	MUX_VAL(CP(GPMC_NWP),		(IEN  | PTD | DIS | M0));
 	MUX_VAL(CP(GPMC_WAIT0),		(IEN  | PTU | EN  | M0));
+	/* SB-T35 Ethernet IRQ GPIO65 */
+	MUX_VAL(CP(GPMC_WAIT3),		(IEN  | PTU | EN  | M4)); /*GPIO_65*/
 
 	/* UART3 Console */
 	MUX_VAL(CP(UART3_RX_IRRX),	(IEN  | PTD | DIS | M0));
 	MUX_VAL(CP(UART3_TX_IRTX),	(IDIS | PTD | DIS | M0));
 	/* RTC V3020 nCS GPIO163 */
 	MUX_VAL(CP(UART3_CTS_RCTX),	(IEN  | PTU | EN  | M4)); /*GPIO_163*/
+	/* SB-T35 Ethernet nRESET GPIO164 */
+	MUX_VAL(CP(UART3_RTS_SD),	(IDIS | PTU | EN  | M4)); /*GPIO_164*/
 
 	/* SB-T35 SD/MMC CD GPIO144 */
 	MUX_VAL(CP(UART2_CTS),		(IEN  | PTU | EN  | M4)); /*GPIO_144*/
@@ -128,6 +135,18 @@ void set_muxconf_regs(void)
 	/* CM-T3517 USB HUB Reset GPIO152 */
 	MUX_VAL(CP(MCBSP4_CLKX),	(IDIS | PTD | DIS | M4)); /*GPIO_152*/
 
+	/* RMII */
+	MUX_VAL(CP(RMII_MDIO_DATA),	(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(RMII_MDIO_CLK),	(M0));
+	MUX_VAL(CP(RMII_RXD0),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(RMII_RXD1),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(RMII_CRS_DV),	(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(RMII_RXER),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(RMII_TXD0),		(IDIS | M0));
+	MUX_VAL(CP(RMII_TXD1),		(IDIS | M0));
+	MUX_VAL(CP(RMII_TXEN),		(IDIS | M0));
+	MUX_VAL(CP(RMII_50MHZ_CLK),	(IEN  | PTU | DIS | M0));
+
 	/* Green LED GPIO186 */
 	MUX_VAL(CP(SYS_CLKOUT2),	(IDIS | PTU | DIS | M4)); /*GPIO_186*/
 
diff --git a/include/configs/cm_t3517.h b/include/configs/cm_t3517.h
index 1c2d1f4..1d35df9 100644
--- a/include/configs/cm_t3517.h
+++ b/include/configs/cm_t3517.h
@@ -132,6 +132,8 @@
 #define CONFIG_CMD_I2C		/* I2C serial bus support	*/
 #define CONFIG_CMD_MMC		/* MMC support			*/
 #define CONFIG_CMD_NAND		/* NAND support			*/
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_PING
 #define CONFIG_CMD_GPIO
 
 #undef CONFIG_CMD_FLASH		/* flinfo, erase, protect	*/
@@ -272,6 +274,15 @@
 #define CONFIG_ENV_OFFSET		SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR			SMNAND_ENV_OFFSET
 
+#if defined(CONFIG_CMD_NET)
+#define CONFIG_DRIVER_TI_EMAC
+#define CONFIG_DRIVER_TI_EMAC_USE_RMII
+#define CONFIG_MII
+#define CONFIG_SMC911X
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE	(0x2C000000 + (16 << 20))
+#endif /* CONFIG_CMD_NET */
+
 /* additions for new relocation code, must be added to all boards */
 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
 #define CONFIG_SYS_INIT_RAM_ADDR	0x4020f800
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 11/11] omap3: cm-t3517: add LCD/DVI and splash support
  2014-11-03  9:32 [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM Igor Grinberg
                   ` (9 preceding siblings ...)
  2014-11-03  9:32 ` [U-Boot] [PATCH 10/11] omap3: cm-t3517: add Ethernet support Igor Grinberg
@ 2014-11-03  9:32 ` Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:31   ` [U-Boot] [U-Boot, " Tom Rini
  10 siblings, 2 replies; 39+ messages in thread
From: Igor Grinberg @ 2014-11-03  9:32 UTC (permalink / raw)
  To: u-boot

Add support for splash screen on both DVI and SCF0403 LCD.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 board/compulab/cm_t3517/mux.c | 44 +++++++++++++++++++++++++++++++++++++++++++
 include/configs/cm_t3517.h    | 15 +++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/board/compulab/cm_t3517/mux.c b/board/compulab/cm_t3517/mux.c
index cb54c2c..88ce2cc 100644
--- a/board/compulab/cm_t3517/mux.c
+++ b/board/compulab/cm_t3517/mux.c
@@ -85,6 +85,10 @@ void set_muxconf_regs(void)
 
 	/* SB-T35 Ethernet */
 	MUX_VAL(CP(GPMC_NCS4),		(IEN  | PTU | EN  | M0));
+	/* DVI enable */
+	MUX_VAL(CP(GPMC_NCS3),		(IDIS | PTU | DIS  | M4));/*GPIO_54*/
+	/* DataImage backlight */
+	MUX_VAL(CP(GPMC_NCS7),		(IDIS | PTU | DIS  | M4));/*GPIO_58*/
 
 	/* SB-T35 SD/MMC WP GPIO59 */
 	MUX_VAL(CP(GPMC_CLK),		(IEN  | PTU | EN  | M4)); /*GPIO_59*/
@@ -124,6 +128,36 @@ void set_muxconf_regs(void)
 	MUX_VAL(CP(MMC1_DAT2),		(IEN  | PTU | EN  | M0));
 	MUX_VAL(CP(MMC1_DAT3),		(IEN  | PTU | EN  | M0));
 
+	/* DSS */
+	MUX_VAL(CP(DSS_PCLK),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_HSYNC),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_VSYNC),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_ACBIAS),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA0),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA1),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA2),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA3),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA4),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA5),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA6),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA7),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA8),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA9),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA10),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA11),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA12),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA13),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA14),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA15),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA16),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA17),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA18),         (IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA19),         (IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA20),         (IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA21),         (IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA22),         (IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(DSS_DATA23),         (IDIS | PTD | DIS | M0));
+
 	/* I2C */
 	MUX_VAL(CP(I2C1_SCL),		(IEN  | PTU | EN  | M0));
 	MUX_VAL(CP(I2C1_SDA),		(IEN  | PTU | EN  | M0));
@@ -150,8 +184,18 @@ void set_muxconf_regs(void)
 	/* Green LED GPIO186 */
 	MUX_VAL(CP(SYS_CLKOUT2),	(IDIS | PTU | DIS | M4)); /*GPIO_186*/
 
+	/* SPI */
+	MUX_VAL(CP(MCBSP1_CLKR),	(IEN | PTD | DIS | M1)); /*MCSPI4_CLK*/
+	MUX_VAL(CP(MCBSP1_DX),		(IEN | PTD | DIS | M1)); /*MCSPI4_SIMO*/
+	MUX_VAL(CP(MCBSP1_DR),		(IEN | PTD | DIS | M1)); /*MCSPI4_SOMI*/
+	MUX_VAL(CP(MCBSP1_FSX),		(IEN | PTU | EN  | M1)); /*MCSPI4_CS0*/
+	/* LCD reset GPIO157 */
+	MUX_VAL(CP(MCBSP1_FSR),		(IDIS | PTU | DIS | M4)); /*GPIO_157*/
+
 	/* RTC V3020 CS Enable GPIO160 */
 	MUX_VAL(CP(MCBSP_CLKS),		(IEN  | PTD | EN  | M4)); /*GPIO_160*/
+	/* SB-T35 LVDS Transmitter SHDN GPIO162 */
+	MUX_VAL(CP(MCBSP1_CLKX),	(IEN  | PTU | DIS | M4)); /*GPIO_162*/
 
 	/* USB0 - mUSB */
 	MUX_VAL(CP(USB0_DRVBUS),	(IEN  | PTD | EN  | M0));
diff --git a/include/configs/cm_t3517.h b/include/configs/cm_t3517.h
index 1d35df9..d202779 100644
--- a/include/configs/cm_t3517.h
+++ b/include/configs/cm_t3517.h
@@ -307,4 +307,19 @@
 #define CONFIG_OMAP3_GPIO_6	/* GPIO186 is in GPIO bank 6  */
 #endif
 
+/* Display Configuration */
+#define CONFIG_OMAP3_GPIO_2
+#define CONFIG_OMAP3_GPIO_5
+#define CONFIG_VIDEO_OMAP3
+#define LCD_BPP		LCD_COLOR16
+
+#define CONFIG_LCD
+#define CONFIG_SPLASH_SCREEN
+#define CONFIG_SPLASHIMAGE_GUARD
+#define CONFIG_CMD_BMP
+#define CONFIG_BMP_16BPP
+#define CONFIG_SCF0403_LCD
+
+#define CONFIG_OMAP3_SPI
+
 #endif /* __CONFIG_H */
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 01/11] am335x: make get_board_rev() function weak
  2014-11-03  9:32 ` [U-Boot] [PATCH 01/11] am335x: make get_board_rev() function weak Igor Grinberg
@ 2014-11-04 16:45   ` Tom Rini
  2014-11-05 11:29     ` [U-Boot] [PATCH v2] " Igor Grinberg
  0 siblings, 1 reply; 39+ messages in thread
From: Tom Rini @ 2014-11-04 16:45 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:17AM +0200, Igor Grinberg wrote:

> Current get_board_rev() function returns a hard coded value which is
> obviously incorrect for the majority of boards.
> Allow boards to provide a correct implementation by making this
> function weak.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> ---
>  arch/arm/cpu/armv7/am33xx/sys_info.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/cpu/armv7/am33xx/sys_info.c b/arch/arm/cpu/armv7/am33xx/sys_info.c
> index 2ce682f..c297fd8 100644
> --- a/arch/arm/cpu/armv7/am33xx/sys_info.c
> +++ b/arch/arm/cpu/armv7/am33xx/sys_info.c
> @@ -18,6 +18,7 @@
>  #include <asm/arch/cpu.h>
>  #include <asm/arch/clock.h>
>  #include <power/tps65910.h>
> +#include <linux/compiler.h>
>  
>  struct ctrl_stat *cstat = (struct ctrl_stat *)CTRL_BASE;
>  
> @@ -53,7 +54,7 @@ u32 get_cpu_type(void)
>   * get_board_rev() - setup to pass kernel board revision information
>   * returns:(bit[0-3] sub version, higher bit[7-4] is higher version)
>   */
> -u32 get_board_rev(void)
> +u32 __weak get_board_rev(void)
>  {
>  	return BOARD_REV_ID;
>  }

Which is a hard-coded 0 anyhow.  Can you please update the comment to
say something along the lines of "Return 0 for the ATAG REVISION tag
value" along with making it weak and nuke BOARD_REV_ID from the header
as well?  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/da70b493/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 02/11] compulab: refactor board revision handling
  2014-11-03  9:32 ` [U-Boot] [PATCH 02/11] compulab: refactor board revision handling Igor Grinberg
@ 2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:30   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-04 16:45 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:18AM +0200, Igor Grinberg wrote:
> Move board revision handling code to a common location
> for further reuse.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>

Reviewed-by: Tom Rini <trini@ti.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/bcd0a5d6/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 03/11] omap3: cm-t35: move the USB hub reset code
  2014-11-03  9:32 ` [U-Boot] [PATCH 03/11] omap3: cm-t35: move the USB hub reset code Igor Grinberg
@ 2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:30   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-04 16:45 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:19AM +0200, Igor Grinberg wrote:

> Extract the USB hub reset code to a common location where it can be
> reused by other compulab boards.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>

Reviewed-by: Tom Rini <trini@ti.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/6805a5ea/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 04/11] omap3: cm-t35: extract the splash code from board
  2014-11-03  9:32 ` [U-Boot] [PATCH 04/11] omap3: cm-t35: extract the splash code from board Igor Grinberg
@ 2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:30   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-04 16:45 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:20AM +0200, Igor Grinberg wrote:

> The splash screen loading code can be reused by other compulab boards.
> For now extract it to a common location for further reuse.
> 
> This also switches the splash code dependency from CONFIG_LCD to
> CONFIG_SPLASH_SCREEN as it should normally be.
> 
> In addition this patch fixes the accidental dependency of the
> get_board_mem_timings() function on CONFIG_LCD, by just moving the
> splash code and leaving the above function intact.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>

Reviewed-by: Tom Rini <trini@ti.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/df676b03/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 05/11] omap3: cm-t35: move the SMC911x code
  2014-11-03  9:32 ` [U-Boot] [PATCH 05/11] omap3: cm-t35: move the SMC911x code Igor Grinberg
@ 2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:30   ` [U-Boot] [U-Boot,05/11] " Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-04 16:45 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:21AM +0200, Igor Grinberg wrote:

> Extract the SMC911x initialization code to a common location where it
> can be reused by other compulab omap3 based boards.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>

Reviewed-by: Tom Rini <trini@ti.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/a66d2599/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 06/11] omap3: cm-t35: move get_board_serial() fallback
  2014-11-03  9:32 ` [U-Boot] [PATCH 06/11] omap3: cm-t35: move get_board_serial() fallback Igor Grinberg
@ 2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:30   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-04 16:45 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:22AM +0200, Igor Grinberg wrote:

> The fallback is used for cases when CONFIG_SERIAL_TAG defined, but the
> eeprom is not used.
> The fallback is useful for more than one CompuLab board, so move it to a
> common location.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>

Reviewed-by: Tom Rini <trini@ti.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/f3301bd8/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 07/11] omap: hsmmc: assume cd gpio is active low
  2014-11-03  9:32 ` [U-Boot] [PATCH 07/11] omap: hsmmc: assume cd gpio is active low Igor Grinberg
@ 2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:31   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-04 16:45 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:23AM +0200, Igor Grinberg wrote:

> Switch the default CD GPIO polarity to active low.
> 
> The current hsmmc driver assumption that the CD GPIO is active high, but
> in the real hardware, usually the opposite holds.
> The usual SD card socket has a mechanical switch which is grounded as
> soon as a card is inserted.
> Of course there might be some board logic which inverts the signal, but
> as far as current users are concerned, there is no such logic.
> 
> Current U-Boot users either not using the CD functionality, or have a
> different way (e.g. external to SoC GPIO controller) for checking the
> card presence.
> 
> This patch also brings the polarity assumption in line with the Linux
> kernel and adds appropriate comments.
> 
> This patch also might spare issues once the TWL GPIO driver will be
> converted to the DM.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
> Cc: Dmitry Lifshitz <lifshitz@compulab.co.il>

Reviewed-by: Tom Rini <trini@ti.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/ab2e90f9/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 09/11] omap3: cm-t3517: add USB support
  2014-11-03  9:32 ` [U-Boot] [PATCH 09/11] omap3: cm-t3517: add USB support Igor Grinberg
@ 2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:31   ` [U-Boot] [U-Boot,09/11] " Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-04 16:45 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:25AM +0200, Igor Grinberg wrote:

> Add both host and mUSB support.
> Currently, the selection between host USB and mUSB is done through the
> config file.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>

Reviewed-by: Tom Rini <trini@ti.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/1688ce2c/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 10/11] omap3: cm-t3517: add Ethernet support
  2014-11-03  9:32 ` [U-Boot] [PATCH 10/11] omap3: cm-t3517: add Ethernet support Igor Grinberg
@ 2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:31   ` [U-Boot] [U-Boot,10/11] " Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-04 16:45 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:26AM +0200, Igor Grinberg wrote:

> Add both EMAC and SMC911x support.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>

Reviewed-by: Tom Rini <trini@ti.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/7cf2dbdb/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 11/11] omap3: cm-t3517: add LCD/DVI and splash support
  2014-11-03  9:32 ` [U-Boot] [PATCH 11/11] omap3: cm-t3517: add LCD/DVI and splash support Igor Grinberg
@ 2014-11-04 16:45   ` Tom Rini
  2014-11-05 21:31   ` [U-Boot] [U-Boot, " Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-04 16:45 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:27AM +0200, Igor Grinberg wrote:

> Add support for splash screen on both DVI and SCF0403 LCD.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>

Reviewed-by: Tom Rini <trini@ti.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/48ab961b/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 08/11] omap3: cm-t3517: add basic board support
  2014-11-03  9:32 ` [U-Boot] [PATCH 08/11] omap3: cm-t3517: add basic board support Igor Grinberg
@ 2014-11-04 16:46   ` Tom Rini
  2014-11-05 12:16     ` Igor Grinberg
  2014-11-05 12:25     ` [U-Boot] [PATCH v2 8/11] " Igor Grinberg
  0 siblings, 2 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-04 16:46 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:24AM +0200, Igor Grinberg wrote:

> CompuLab cm-t3517 is Computer on Module (CoM) based on AM3517 SoC.
> Features: up to 256MB DDR2, up to 512MB NAND, USB hub, mUSB, WiFi, BT,
> Analog audio codec, touch screen controller, LED.
> 
> Add basic support including:
> LED, Serial console, NAND, MMC, GPIO, I2C, 256MB DRAM.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
[snip]
> +/*
> + * The early kernel mapping on ARM currently only maps from the base of DRAM
> + * to the end of the kernel image.  The kernel is loaded at DRAM base + 0x8000.
> + * The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000,
> + * so that leaves DRAM base to DRAM base + 0x4000 available.
> + */
> +#define CONFIG_SYS_BOOTMAPSZ	        0x4000

The big comment about layout at the top of
include/configs/ti_armv7_common.h applies to omap3 too, are you sure you
want to go in the direction instead?  In fact, are you sure you can't /
don't want to leverage that file?

> +#define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
> +					115200}

Use the default table?

> +#define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0)	/* memtest */
> +								/* works on */
> +#define CONFIG_SYS_MEMTEST_END		(OMAP34XX_SDRC_CS0 + \
> +					0x01F00000) /* 31MB */

Really want this on?  See doc/README.memory-test

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141104/9a5ba3cd/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH v2] am335x: make get_board_rev() function weak
  2014-11-04 16:45   ` Tom Rini
@ 2014-11-05 11:29     ` Igor Grinberg
  2014-11-05 21:33       ` [U-Boot] [U-Boot, " Tom Rini
  0 siblings, 1 reply; 39+ messages in thread
From: Igor Grinberg @ 2014-11-05 11:29 UTC (permalink / raw)
  To: u-boot

Current get_board_rev() function returns a hard coded value which is
obviously incorrect for the majority of boards.
Allow boards to provide a correct implementation by making this
function weak.
In addition open code the trivial and useless BOARD_REV_ID define and
adjust the comment.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Cc: Tom Rini <trini@ti.com>
---
v2: Remove the BOARD_REV_ID define, adjust the comment and
    commit message.

 arch/arm/cpu/armv7/am33xx/sys_info.c         | 7 ++++---
 arch/arm/include/asm/arch-am33xx/sys_proto.h | 2 --
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/sys_info.c b/arch/arm/cpu/armv7/am33xx/sys_info.c
index 2ce682f..781d83f 100644
--- a/arch/arm/cpu/armv7/am33xx/sys_info.c
+++ b/arch/arm/cpu/armv7/am33xx/sys_info.c
@@ -18,6 +18,7 @@
 #include <asm/arch/cpu.h>
 #include <asm/arch/clock.h>
 #include <power/tps65910.h>
+#include <linux/compiler.h>
 
 struct ctrl_stat *cstat = (struct ctrl_stat *)CTRL_BASE;
 
@@ -51,11 +52,11 @@ u32 get_cpu_type(void)
 
 /**
  * get_board_rev() - setup to pass kernel board revision information
- * returns:(bit[0-3] sub version, higher bit[7-4] is higher version)
+ * returns: 0 for the ATAG REVISION tag value.
  */
-u32 get_board_rev(void)
+u32 __weak get_board_rev(void)
 {
-	return BOARD_REV_ID;
+	return 0;
 }
 
 /**
diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h b/arch/arm/include/asm/arch-am33xx/sys_proto.h
index 33a82fc..7eacf27 100644
--- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
+++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
@@ -14,8 +14,6 @@
 #include <asm/ti-common/sys_proto.h>
 #include <asm/arch/cpu.h>
 
-#define BOARD_REV_ID	0x0
-
 u32 get_cpu_rev(void);
 u32 get_sysboot_value(void);
 
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 08/11] omap3: cm-t3517: add basic board support
  2014-11-04 16:46   ` Tom Rini
@ 2014-11-05 12:16     ` Igor Grinberg
  2014-11-05 12:23       ` Tom Rini
  2014-11-05 12:25     ` [U-Boot] [PATCH v2 8/11] " Igor Grinberg
  1 sibling, 1 reply; 39+ messages in thread
From: Igor Grinberg @ 2014-11-05 12:16 UTC (permalink / raw)
  To: u-boot

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Tom,

On 11/04/14 18:46, Tom Rini wrote:
> On Mon, Nov 03, 2014 at 11:32:24AM +0200, Igor Grinberg wrote:
> 
>> CompuLab cm-t3517 is Computer on Module (CoM) based on AM3517 SoC.
>> Features: up to 256MB DDR2, up to 512MB NAND, USB hub, mUSB, WiFi, BT,
>> Analog audio codec, touch screen controller, LED.
>>
>> Add basic support including:
>> LED, Serial console, NAND, MMC, GPIO, I2C, 256MB DRAM.
>>
>> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> [snip]
>> +/*
>> + * The early kernel mapping on ARM currently only maps from the base of DRAM
>> + * to the end of the kernel image.  The kernel is loaded at DRAM base + 0x8000.
>> + * The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000,
>> + * so that leaves DRAM base to DRAM base + 0x4000 available.
>> + */
>> +#define CONFIG_SYS_BOOTMAPSZ	        0x4000
> 
> The big comment about layout at the top of
> include/configs/ti_armv7_common.h applies to omap3 too, are you sure you
> want to go in the direction instead?  In fact, are you sure you can't /
> don't want to leverage that file?

Well, the only concern about the using common configurations in general
is the breakage it can introduce as changes to those files are never tested
on all the boards that include them. Hopefully, this will be (at least
partially) solved by defconfigs.
As same stands also for fixes, I think we can take the chances.
Switching to use the common config file will require some additional checks
like undef unneeded stuff and also check the binary size impact.
I might be unable to do those soon enough for this patchset to be included
in the release.

> 
>> +#define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
>> +					115200}
> 
> Use the default table?

Do you mean the one in ti_omap3_common.h?
Well, that is the same question as above (and also the same answer).

The question is can we proceed with only the below fixed and I will update
the above and common config file inclusion later (also for cm-t35)?

> 
>> +#define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0)	/* memtest */
>> +								/* works on */
>> +#define CONFIG_SYS_MEMTEST_END		(OMAP34XX_SDRC_CS0 + \
>> +					0x01F00000) /* 31MB */
> 
> Really want this on?  See doc/README.memory-test

No, not really... Thanks for pointing to this.
I usually try to keep myself up to date, but recently, I have
way to much stuff going on, so those small things are slipping through.
 

- -- 
Regards,
Igor.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJUWhUjAAoJEBDE8YO64EfahvsP/iVwljxV3L9R3MXYnv9UrD0V
iId1gURxQXATU9lSLIXM6RTfAGLCGFkemASxTWNNMy1LpvxXxBfvrRmIGpK1Z26f
ydpOmp1yCiSoYLSXnFUqOHmiqdi/IA/URDPAWlzoXD6qfRIah1b/P2Ajdc+3rQS6
dmESDdyYj37aKIeeMtLbqhup9qG8Tm3YgF7S95K3dDAiVG9/HQtj7ccCVhh+ML2u
u0TQ+YVfp8oPHQULw2IzXNwLQ7cZq7pTU5QmVx7YgDNNdi+ULH1Zjwv5zQtUx29c
R9cdOpzTKrp94BzZIAkyzKuqKUmr4psaI3gfyFzCh8ow25knh7xXdRYmYpkzjWgS
Sf04CGccv5iOC/kJWjuidj1QtmmBt7BhlD4/EfETzeQT/cnzHJL6suR2XL2mKcC2
YfPYnz2pLqAgDi14km34ZwWWtXn+rqAEf5Z49BqyngIeOytFcAGNptsFOMLOgRYr
/MahOwEE/1aaEa/v5b5onStvakrXLkVoOhEvqtIdyCmRUG/ENKwFmNI8ECJTdoN3
mhzvaSQAlEiY7uWjyq57uu/2ltcbUYsvHZA03WS2RaQGhAYydfNbagg+wjuh3774
lfT+RAk0d+jN+zB9IUysQVPUaXckMOtylxxLs4m9sq75qVzM9B5dS041c13qvlqE
D2t0+Z5Ipi4v04+2b588
=T9e1
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 08/11] omap3: cm-t3517: add basic board support
  2014-11-05 12:16     ` Igor Grinberg
@ 2014-11-05 12:23       ` Tom Rini
  2014-11-05 12:53         ` Igor Grinberg
  0 siblings, 1 reply; 39+ messages in thread
From: Tom Rini @ 2014-11-05 12:23 UTC (permalink / raw)
  To: u-boot

On Wed, Nov 05, 2014 at 02:16:35PM +0200, Igor Grinberg wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi Tom,
> 
> On 11/04/14 18:46, Tom Rini wrote:
> > On Mon, Nov 03, 2014 at 11:32:24AM +0200, Igor Grinberg wrote:
> > 
> >> CompuLab cm-t3517 is Computer on Module (CoM) based on AM3517 SoC.
> >> Features: up to 256MB DDR2, up to 512MB NAND, USB hub, mUSB, WiFi, BT,
> >> Analog audio codec, touch screen controller, LED.
> >>
> >> Add basic support including:
> >> LED, Serial console, NAND, MMC, GPIO, I2C, 256MB DRAM.
> >>
> >> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> > [snip]
> >> +/*
> >> + * The early kernel mapping on ARM currently only maps from the base of DRAM
> >> + * to the end of the kernel image.  The kernel is loaded at DRAM base + 0x8000.
> >> + * The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000,
> >> + * so that leaves DRAM base to DRAM base + 0x4000 available.
> >> + */
> >> +#define CONFIG_SYS_BOOTMAPSZ	        0x4000
> > 
> > The big comment about layout at the top of
> > include/configs/ti_armv7_common.h applies to omap3 too, are you sure you
> > want to go in the direction instead?  In fact, are you sure you can't /
> > don't want to leverage that file?
> 
> Well, the only concern about the using common configurations in general
> is the breakage it can introduce as changes to those files are never tested
> on all the boards that include them. Hopefully, this will be (at least
> partially) solved by defconfigs.
> As same stands also for fixes, I think we can take the chances.
> Switching to use the common config file will require some additional checks
> like undef unneeded stuff and also check the binary size impact.
> I might be unable to do those soon enough for this patchset to be included
> in the release.

OK.

> >> +#define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
> >> +					115200}
> > 
> > Use the default table?
> 
> Do you mean the one in ti_omap3_common.h?
> Well, that is the same question as above (and also the same answer).

Aaand now I have egg on my face, I was referring to
include/config_fallbacks.h

> The question is can we proceed with only the below fixed and I will update
> the above and common config file inclusion later (also for cm-t35)?

... maybe.  I need to think about it I suppose.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/35b89647/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH v2 8/11] omap3: cm-t3517: add basic board support
  2014-11-04 16:46   ` Tom Rini
  2014-11-05 12:16     ` Igor Grinberg
@ 2014-11-05 12:25     ` Igor Grinberg
  2014-11-05 21:33       ` [U-Boot] [U-Boot, v2, " Tom Rini
  1 sibling, 1 reply; 39+ messages in thread
From: Igor Grinberg @ 2014-11-05 12:25 UTC (permalink / raw)
  To: u-boot

CompuLab cm-t3517 is Computer on Module (CoM) based on AM3517 SoC.
Features: up to 256MB DDR2, up to 512MB NAND, USB hub, mUSB, WiFi, BT,
Analog audio codec, touch screen controller, LED.

Add basic support including:
LED, Serial console, NAND, MMC, GPIO, I2C, 256MB DRAM.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
v2:	Remove unneeded CONFIG_SYS_MEMTEST_* defines

 arch/arm/cpu/armv7/omap3/Kconfig    |   4 +
 board/compulab/cm_t3517/Kconfig     |  12 ++
 board/compulab/cm_t3517/MAINTAINERS |   6 +
 board/compulab/cm_t3517/Makefile    |   9 ++
 board/compulab/cm_t3517/cm_t3517.c  |  60 ++++++++
 board/compulab/cm_t3517/mux.c       | 135 ++++++++++++++++++
 configs/cm_t3517_defconfig          |   4 +
 include/configs/cm_t3517.h          | 277 ++++++++++++++++++++++++++++++++++++
 8 files changed, 507 insertions(+)
 create mode 100644 board/compulab/cm_t3517/Kconfig
 create mode 100644 board/compulab/cm_t3517/MAINTAINERS
 create mode 100644 board/compulab/cm_t3517/Makefile
 create mode 100644 board/compulab/cm_t3517/cm_t3517.c
 create mode 100644 board/compulab/cm_t3517/mux.c
 create mode 100644 configs/cm_t3517_defconfig
 create mode 100644 include/configs/cm_t3517.h

diff --git a/arch/arm/cpu/armv7/omap3/Kconfig b/arch/arm/cpu/armv7/omap3/Kconfig
index c215404..a029379 100644
--- a/arch/arm/cpu/armv7/omap3/Kconfig
+++ b/arch/arm/cpu/armv7/omap3/Kconfig
@@ -22,6 +22,9 @@ config TARGET_CM_T35
 	bool "CompuLab CM-T3530 and CM-T3730 boards"
 	select SUPPORT_SPL
 
+config TARGET_CM_T3517
+	bool "CompuLab CM-T3517 boards"
+
 config TARGET_DEVKIT8000
 	bool "TimLL OMAP3 Devkit8000"
 	select SUPPORT_SPL
@@ -98,6 +101,7 @@ source "board/teejet/mt_ventoux/Kconfig"
 source "board/ti/sdp3430/Kconfig"
 source "board/ti/beagle/Kconfig"
 source "board/compulab/cm_t35/Kconfig"
+source "board/compulab/cm_t3517/Kconfig"
 source "board/timll/devkit8000/Kconfig"
 source "board/ti/evm/Kconfig"
 source "board/isee/igep00x0/Kconfig"
diff --git a/board/compulab/cm_t3517/Kconfig b/board/compulab/cm_t3517/Kconfig
new file mode 100644
index 0000000..2f5473d
--- /dev/null
+++ b/board/compulab/cm_t3517/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_CM_T3517
+
+config SYS_BOARD
+	default "cm_t3517"
+
+config SYS_VENDOR
+	default "compulab"
+
+config SYS_CONFIG_NAME
+	default "cm_t3517"
+
+endif
diff --git a/board/compulab/cm_t3517/MAINTAINERS b/board/compulab/cm_t3517/MAINTAINERS
new file mode 100644
index 0000000..fbb6882
--- /dev/null
+++ b/board/compulab/cm_t3517/MAINTAINERS
@@ -0,0 +1,6 @@
+CM_T3517 BOARD
+M:	Igor Grinberg <grinberg@compulab.co.il>
+S:	Maintained
+F:	board/compulab/cm_t3517/
+F:	include/configs/cm_t3517.h
+F:	configs/cm_t3517_defconfig
diff --git a/board/compulab/cm_t3517/Makefile b/board/compulab/cm_t3517/Makefile
new file mode 100644
index 0000000..4f0db01
--- /dev/null
+++ b/board/compulab/cm_t3517/Makefile
@@ -0,0 +1,9 @@
+#
+# (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
+#
+# Authors: Igor Grinberg <grinberg@compulab.co.il>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	+= cm_t3517.o mux.o
diff --git a/board/compulab/cm_t3517/cm_t3517.c b/board/compulab/cm_t3517/cm_t3517.c
new file mode 100644
index 0000000..056fc15
--- /dev/null
+++ b/board/compulab/cm_t3517/cm_t3517.c
@@ -0,0 +1,60 @@
+/*
+ * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
+ *
+ * Authors: Igor Grinberg <grinberg@compulab.co.il>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <status_led.h>
+#include <mmc.h>
+#include <linux/compiler.h>
+
+#include <asm/io.h>
+#include <asm/arch/mem.h>
+#include <asm/arch/am35x_def.h>
+#include <asm/arch/mmc_host_def.h>
+#include <asm/arch/sys_proto.h>
+
+#include "../common/common.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+const omap3_sysinfo sysinfo = {
+	DDR_DISCRETE,
+	"CM-T3517 board",
+	"NAND 128/512M",
+};
+
+int board_init(void)
+{
+	gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
+
+	/* boot param addr */
+	gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
+
+#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
+	status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
+#endif
+
+	return 0;
+}
+
+int misc_init_r(void)
+{
+	cl_print_pcb_info();
+	dieid_num_r();
+
+	return 0;
+}
+
+#if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
+#define SB_T35_CD_GPIO 144
+#define SB_T35_WP_GPIO 59
+
+int board_mmc_init(bd_t *bis)
+{
+	return omap_mmc_init(0, 0, 0, SB_T35_CD_GPIO, SB_T35_WP_GPIO);
+}
+#endif
diff --git a/board/compulab/cm_t3517/mux.c b/board/compulab/cm_t3517/mux.c
new file mode 100644
index 0000000..f799d21
--- /dev/null
+++ b/board/compulab/cm_t3517/mux.c
@@ -0,0 +1,135 @@
+/*
+ * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
+ *
+ * Authors: Igor Grinberg <grinberg@compulab.co.il>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/arch/mux.h>
+#include <asm/io.h>
+
+void set_muxconf_regs(void)
+{
+	/* SDRC */
+	MUX_VAL(CP(SDRC_D0),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D1),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D2),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D3),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D4),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D5),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D6),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D7),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D8),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D9),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D10),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D11),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D12),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D13),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D14),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D15),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D16),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D17),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D18),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D19),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D20),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D21),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D22),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D23),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D24),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D25),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D26),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D27),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D28),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D29),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D30),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_D31),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_CLK),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_DQS0),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_DQS1),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_DQS2),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_DQS3),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(SDRC_CKE0),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(SDRC_CKE1),		(IDIS | PTD | DIS | M7));
+
+	/* GPMC */
+	MUX_VAL(CP(GPMC_A1),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A2),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A3),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A4),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A5),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A6),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A7),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A8),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A9),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_A10),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D0),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D1),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D2),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D3),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D4),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D5),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D6),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D7),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D8),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D9),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D10),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D11),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D12),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D13),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D14),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_D15),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(GPMC_NCS0),		(IDIS | PTU | EN  | M0));
+
+	/* SB-T35 SD/MMC WP GPIO59 */
+	MUX_VAL(CP(GPMC_CLK),		(IEN  | PTU | EN  | M4)); /*GPIO_59*/
+	MUX_VAL(CP(GPMC_NWE),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_NOE),		(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_NADV_ALE),	(IDIS | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_NBE0_CLE),	(IDIS | PTU | EN  | M0));
+	/* SB-T35 Audio Enable GPIO61 */
+	MUX_VAL(CP(GPMC_NBE1),		(IDIS | PTU | EN  | M4)); /*GPIO_61*/
+	MUX_VAL(CP(GPMC_NWP),		(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(GPMC_WAIT0),		(IEN  | PTU | EN  | M0));
+
+	/* UART3 Console */
+	MUX_VAL(CP(UART3_RX_IRRX),	(IEN  | PTD | DIS | M0));
+	MUX_VAL(CP(UART3_TX_IRTX),	(IDIS | PTD | DIS | M0));
+	/* RTC V3020 nCS GPIO163 */
+	MUX_VAL(CP(UART3_CTS_RCTX),	(IEN  | PTU | EN  | M4)); /*GPIO_163*/
+
+	/* SB-T35 SD/MMC CD GPIO144 */
+	MUX_VAL(CP(UART2_CTS),		(IEN  | PTU | EN  | M4)); /*GPIO_144*/
+	/* WIFI nRESET GPIO145 */
+	MUX_VAL(CP(UART2_RTS),		(IEN  | PTD | EN  | M4)); /*GPIO_145*/
+
+	/* MMC1 */
+	MUX_VAL(CP(MMC1_CLK),		(IDIS | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_CMD),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT0),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT1),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT2),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(MMC1_DAT3),		(IEN  | PTU | EN  | M0));
+
+	/* I2C */
+	MUX_VAL(CP(I2C1_SCL),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(I2C1_SDA),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(I2C3_SCL),		(IEN  | PTU | EN  | M0));
+	MUX_VAL(CP(I2C3_SDA),		(IEN  | PTU | EN  | M0));
+
+	/* Green LED GPIO186 */
+	MUX_VAL(CP(SYS_CLKOUT2),	(IDIS | PTU | DIS | M4)); /*GPIO_186*/
+
+	/* RTC V3020 CS Enable GPIO160 */
+	MUX_VAL(CP(MCBSP_CLKS),		(IEN  | PTD | EN  | M4)); /*GPIO_160*/
+
+	/* SYS_BOOT */
+	MUX_VAL(CP(SYS_BOOT0),		(IEN  | PTU | DIS | M4)); /*GPIO_2*/
+	MUX_VAL(CP(SYS_BOOT1),		(IEN  | PTU | DIS | M4)); /*GPIO_3*/
+	MUX_VAL(CP(SYS_BOOT2),		(IEN  | PTU | DIS | M4)); /*GPIO_4*/
+	MUX_VAL(CP(SYS_BOOT3),		(IEN  | PTU | DIS | M4)); /*GPIO_5*/
+	MUX_VAL(CP(SYS_BOOT4),		(IEN  | PTU | DIS | M4)); /*GPIO_6*/
+	MUX_VAL(CP(SYS_BOOT5),		(IEN  | PTU | DIS | M4)); /*GPIO_7*/
+}
diff --git a/configs/cm_t3517_defconfig b/configs/cm_t3517_defconfig
new file mode 100644
index 0000000..4000d2c
--- /dev/null
+++ b/configs/cm_t3517_defconfig
@@ -0,0 +1,4 @@
+CONFIG_SPL=n
++S:CONFIG_ARM=y
++S:CONFIG_OMAP34XX=y
++S:CONFIG_TARGET_CM_T3517=y
diff --git a/include/configs/cm_t3517.h b/include/configs/cm_t3517.h
new file mode 100644
index 0000000..d691b9f
--- /dev/null
+++ b/include/configs/cm_t3517.h
@@ -0,0 +1,277 @@
+/*
+ * (C) Copyright 2013 CompuLab, Ltd.
+ * Author: Igor Grinberg <grinberg@compulab.co.il>
+ *
+ * Configuration settings for the CompuLab CM-T3517 board
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_OMAP	/* in a TI OMAP core */
+#define CONFIG_CM_T3517	/* working with CM-T3517 */
+#define CONFIG_OMAP_COMMON
+#define CONFIG_SYS_GENERIC_BOARD
+
+#define CONFIG_SYS_TEXT_BASE	0x80008000
+
+/*
+ * This is needed for the DMA stuff.
+ * Although the default iss 64, we still define it
+ * to be on the safe side once the default is changed.
+ */
+#define CONFIG_SYS_CACHELINE_SIZE	64
+
+#define CONFIG_EMIF4	/* The chip has EMIF4 controller */
+
+#include <asm/arch/cpu.h>		/* get chip and board defs */
+#include <asm/arch/omap3.h>
+
+/*
+ * Display CPU and Board information
+ */
+#define CONFIG_DISPLAY_CPUINFO
+#define CONFIG_DISPLAY_BOARDINFO
+
+/* Clock Defines */
+#define V_OSCK			26000000	/* Clock output from T2 */
+#define V_SCLK			(V_OSCK >> 1)
+
+#define CONFIG_MISC_INIT_R
+
+#define CONFIG_OF_LIBFDT
+/*
+ * The early kernel mapping on ARM currently only maps from the base of DRAM
+ * to the end of the kernel image.  The kernel is loaded at DRAM base + 0x8000.
+ * The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000,
+ * so that leaves DRAM base to DRAM base + 0x4000 available.
+ */
+#define CONFIG_SYS_BOOTMAPSZ	        0x4000
+
+#define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
+#define CONFIG_SERIAL_TAG
+
+/*
+ * Size of malloc() pool
+ */
+#define CONFIG_ENV_SIZE		(16 << 10)	/* 16 KiB */
+#define CONFIG_SYS_MALLOC_LEN	(CONFIG_ENV_SIZE + (128 << 10))
+
+/*
+ * Hardware drivers
+ */
+
+/*
+ * NS16550 Configuration
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE	(-4)
+#define CONFIG_SYS_NS16550_CLK		48000000	/* 48MHz (APLL96/2) */
+
+/*
+ * select serial console configuration
+ */
+#define CONFIG_CONS_INDEX		3
+#define CONFIG_SYS_NS16550_COM3		OMAP34XX_UART3
+#define CONFIG_SERIAL3			3	/* UART3 */
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+
+/* allow to overwrite serial and ethaddr */
+#define CONFIG_ENV_OVERWRITE
+#define CONFIG_BAUDRATE			115200
+#define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
+					115200}
+
+#define CONFIG_OMAP_GPIO
+
+#define CONFIG_GENERIC_MMC
+#define CONFIG_MMC
+#define CONFIG_OMAP_HSMMC
+#define CONFIG_DOS_PARTITION
+
+/* commands to include */
+#include <config_cmd_default.h>
+
+#define CONFIG_CMD_CACHE
+#define CONFIG_CMD_EXT2		/* EXT2 Support			*/
+#define CONFIG_CMD_FAT		/* FAT support			*/
+#define CONFIG_CMD_MTDPARTS	/* Enable MTD parts commands */
+#define CONFIG_MTD_DEVICE	/* needed for mtdparts commands */
+#define CONFIG_MTD_PARTITIONS
+#define MTDIDS_DEFAULT		"nand0=nand"
+#define MTDPARTS_DEFAULT	"mtdparts=nand:512k(x-loader),"\
+				"1920k(u-boot),256k(u-boot-env),"\
+				"4m(kernel),-(fs)"
+
+#define CONFIG_CMD_I2C		/* I2C serial bus support	*/
+#define CONFIG_CMD_MMC		/* MMC support			*/
+#define CONFIG_CMD_NAND		/* NAND support			*/
+#define CONFIG_CMD_GPIO
+
+#undef CONFIG_CMD_FLASH		/* flinfo, erase, protect	*/
+#undef CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
+#undef CONFIG_CMD_IMLS		/* List all found images	*/
+
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_SYS_I2C
+#define CONFIG_SYS_OMAP24_I2C_SPEED	400000
+#define CONFIG_SYS_OMAP24_I2C_SLAVE	1
+#define CONFIG_SYS_I2C_OMAP34XX
+#define CONFIG_SYS_I2C_EEPROM_ADDR	0x50
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	1
+#define CONFIG_SYS_I2C_EEPROM_BUS	0
+#define CONFIG_I2C_MULTI_BUS
+
+/*
+ * Board NAND Info.
+ */
+#define CONFIG_SYS_NAND_QUIET_TEST
+#define CONFIG_NAND_OMAP_GPMC
+#define CONFIG_SYS_NAND_ADDR		NAND_BASE	/* physical address */
+							/* to access nand */
+#define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
+							/* to access nand at */
+							/* CS0 */
+#define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
+							/* devices */
+
+/* Environment information */
+#define CONFIG_BOOTDELAY		3
+#define CONFIG_ZERO_BOOTDELAY_CHECK
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"loadaddr=0x82000000\0" \
+	"baudrate=115200\0" \
+	"console=ttyO2,115200n8\0" \
+	"mpurate=auto\0" \
+	"vram=12M\0" \
+	"dvimode=1024x768MR-16 at 60\0" \
+	"defaultdisplay=dvi\0" \
+	"mmcdev=0\0" \
+	"mmcroot=/dev/mmcblk0p2 rw rootwait\0" \
+	"mmcrootfstype=ext4\0" \
+	"nandroot=/dev/mtdblock4 rw\0" \
+	"nandrootfstype=ubifs\0" \
+	"mmcargs=setenv bootargs console=${console} " \
+		"mpurate=${mpurate} " \
+		"vram=${vram} " \
+		"omapfb.mode=dvi:${dvimode} " \
+		"omapdss.def_disp=${defaultdisplay} " \
+		"root=${mmcroot} " \
+		"rootfstype=${mmcrootfstype}\0" \
+	"nandargs=setenv bootargs console=${console} " \
+		"mpurate=${mpurate} " \
+		"vram=${vram} " \
+		"omapfb.mode=dvi:${dvimode} " \
+		"omapdss.def_disp=${defaultdisplay} " \
+		"root=${nandroot} " \
+		"rootfstype=${nandrootfstype}\0" \
+	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+	"bootscript=echo Running bootscript from mmc ...; " \
+		"source ${loadaddr}\0" \
+	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+	"mmcboot=echo Booting from mmc ...; " \
+		"run mmcargs; " \
+		"bootm ${loadaddr}\0" \
+	"nandboot=echo Booting from nand ...; " \
+		"run nandargs; " \
+		"nand read ${loadaddr} 2a0000 400000; " \
+		"bootm ${loadaddr}\0" \
+
+#define CONFIG_CMD_BOOTZ
+#define CONFIG_BOOTCOMMAND \
+	"mmc dev ${mmcdev}; if mmc rescan; then " \
+		"if run loadbootscript; then " \
+			"run bootscript; " \
+		"else " \
+			"if run loaduimage; then " \
+				"run mmcboot; " \
+			"else run nandboot; " \
+			"fi; " \
+		"fi; " \
+	"else run nandboot; fi"
+
+/*
+ * Miscellaneous configurable options
+ */
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_CMDLINE_EDITING
+#define CONFIG_TIMESTAMP
+#define CONFIG_SYS_AUTOLOAD		"no"
+#define CONFIG_SYS_LONGHELP		/* undef to save memory */
+#define CONFIG_SYS_HUSH_PARSER		/* use "hush" command parser */
+#define CONFIG_SYS_PROMPT		"CM-T3517 # "
+#define CONFIG_SYS_CBSIZE		512	/* Console I/O Buffer Size */
+/* Print Buffer Size */
+#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
+					sizeof(CONFIG_SYS_PROMPT) + 16)
+#define CONFIG_SYS_MAXARGS		32	/* max number of command args */
+/* Boot Argument Buffer Size */
+#define CONFIG_SYS_BARGSIZE		(CONFIG_SYS_CBSIZE)
+
+#define CONFIG_SYS_LOAD_ADDR		(OMAP34XX_SDRC_CS0 + 0x02000000)
+
+/*
+ * AM3517 has 12 GP timers, they can be driven by the system clock
+ * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
+ * This rate is divided by a local divisor.
+ */
+#define CONFIG_SYS_TIMERBASE		(OMAP34XX_GPT2)
+#define CONFIG_SYS_PTV			2       /* Divisor: 2^(PTV+1) => 8 */
+#define CONFIG_SYS_HZ			1000
+
+/*-----------------------------------------------------------------------
+ * Physical Memory Map
+ */
+#define CONFIG_NR_DRAM_BANKS	1	/* CM-T3517 DRAM is only on CS0 */
+#define PHYS_SDRAM_1		OMAP34XX_SDRC_CS0
+#define CONFIG_SYS_CS0_SIZE		(256 << 20)
+
+/*-----------------------------------------------------------------------
+ * FLASH and environment organization
+ */
+
+/* **** PISMO SUPPORT *** */
+/* Monitor@start of flash */
+#define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_MONITOR_LEN		(256 << 10)	/* Reserve 2 sectors */
+
+#define CONFIG_ENV_IS_IN_NAND
+#define SMNAND_ENV_OFFSET		0x260000 /* environment starts here */
+#define CONFIG_ENV_OFFSET		SMNAND_ENV_OFFSET
+#define CONFIG_ENV_ADDR			SMNAND_ENV_OFFSET
+
+/* additions for new relocation code, must be added to all boards */
+#define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
+#define CONFIG_SYS_INIT_RAM_ADDR	0x4020f800
+#define CONFIG_SYS_INIT_RAM_SIZE	0x800
+#define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_INIT_RAM_ADDR +	\
+					 CONFIG_SYS_INIT_RAM_SIZE -	\
+					 GENERATED_GBL_DATA_SIZE)
+
+/* Status LED */
+#define CONFIG_STATUS_LED		/* Status LED enabled */
+#define CONFIG_BOARD_SPECIFIC_LED
+#define CONFIG_GPIO_LED
+#define GREEN_LED_GPIO			186 /* CM-T3517 Green LED is GPIO186 */
+#define GREEN_LED_DEV			0
+#define STATUS_LED_BIT			GREEN_LED_GPIO
+#define STATUS_LED_STATE		STATUS_LED_ON
+#define STATUS_LED_PERIOD		(CONFIG_SYS_HZ / 2)
+#define STATUS_LED_BOOT			GREEN_LED_DEV
+
+/* GPIO banks */
+#ifdef CONFIG_STATUS_LED
+#define CONFIG_OMAP3_GPIO_6	/* GPIO186 is in GPIO bank 6  */
+#endif
+
+#endif /* __CONFIG_H */
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 39+ messages in thread

* [U-Boot] [PATCH 08/11] omap3: cm-t3517: add basic board support
  2014-11-05 12:23       ` Tom Rini
@ 2014-11-05 12:53         ` Igor Grinberg
  0 siblings, 0 replies; 39+ messages in thread
From: Igor Grinberg @ 2014-11-05 12:53 UTC (permalink / raw)
  To: u-boot

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/05/14 14:23, Tom Rini wrote:
> On Wed, Nov 05, 2014 at 02:16:35PM +0200, Igor Grinberg wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hi Tom,
>>
>> On 11/04/14 18:46, Tom Rini wrote:
>>> On Mon, Nov 03, 2014 at 11:32:24AM +0200, Igor Grinberg wrote:
>>>
>>>> CompuLab cm-t3517 is Computer on Module (CoM) based on AM3517 SoC.
>>>> Features: up to 256MB DDR2, up to 512MB NAND, USB hub, mUSB, WiFi, BT,
>>>> Analog audio codec, touch screen controller, LED.
>>>>
>>>> Add basic support including:
>>>> LED, Serial console, NAND, MMC, GPIO, I2C, 256MB DRAM.
>>>>
>>>> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
>>> [snip]
>>>> +/*
>>>> + * The early kernel mapping on ARM currently only maps from the base of DRAM
>>>> + * to the end of the kernel image.  The kernel is loaded at DRAM base + 0x8000.
>>>> + * The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000,
>>>> + * so that leaves DRAM base to DRAM base + 0x4000 available.
>>>> + */
>>>> +#define CONFIG_SYS_BOOTMAPSZ	        0x4000
>>>
>>> The big comment about layout at the top of
>>> include/configs/ti_armv7_common.h applies to omap3 too, are you sure you
>>> want to go in the direction instead?  In fact, are you sure you can't /
>>> don't want to leverage that file?
>>
>> Well, the only concern about the using common configurations in general
>> is the breakage it can introduce as changes to those files are never tested
>> on all the boards that include them. Hopefully, this will be (at least
>> partially) solved by defconfigs.
>> As same stands also for fixes, I think we can take the chances.
>> Switching to use the common config file will require some additional checks
>> like undef unneeded stuff and also check the binary size impact.
>> I might be unable to do those soon enough for this patchset to be included
>> in the release.
> 
> OK.
> 
>>>> +#define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
>>>> +					115200}
>>>
>>> Use the default table?
>>
>> Do you mean the one in ti_omap3_common.h?
>> Well, that is the same question as above (and also the same answer).
> 
> Aaand now I have egg on my face, I was referring to
> include/config_fallbacks.h

;-) evil me...

> 
>> The question is can we proceed with only the below fixed and I will update
>> the above and common config file inclusion later (also for cm-t35)?
> 
> ... maybe.  I need to think about it I suppose.

Well, I would be very glad if you decide to take this (of course if no other
problems are spotted) and let me get back to this later, as now I need to
prepare things for my o-o-o next week.

Thanks!

- -- 
Regards,
Igor.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJUWh2vAAoJEBDE8YO64Efaw/MP/iW4Py226ZI6mF8hK/V9ih3z
5hi7c+PnGTY3hAXj5+9oiNT1UgWCXwzg0GPFupAB6tHjGDLs09Z6jZZUNKsTReXo
M/ZLLatxS0YSh9Tvcz3I48wZluT6Iueeo4+uYPPshRJkHJXTM1/2hcOkCcc9Upnm
5wVgcv8TvhT0i9R9Dg9H98MNqqOLjgqMpm7mvYk7mJTzQIBJ5O9UXV7VFKmcohOz
1WFjZozfOssfHv2OAyuMD7qKJcvLpjOrcVXJPmvUUtox6lfKzUxWC5ihKlzhSweH
Gtu82QsxfIFfCbcoGkrbcFE0eRJDUSLrkpZTeSBqRrzE5B3+5Z8hc9g145QJ+yin
YLqXPR25nd1n5NudN7ZFhIgyRmOl9cDTZNPBElc/uO/kUC+L0/rccL/vYQpWuWNA
07VMdNNqNdCCtKcE6rXQ+6Rlk2+ztGwtyCp+gr8jpFC6JRcO9rzvtHm9y8Yd+yXE
xoid+a0xkQeLDrbB3GzHtQ6G0VcJAEEUulyb9a0Mf8x2y195lI1S7QLVoVhRP/tr
bSC7ku3TUvgumH2GBMll8tS1s4THyAhLf0XWR70iXGmqnet1hLlLBdkUPgZXH+Le
aCvzDTc4vhokwpr+iLdEV1I8XQiXnPL/jBYqp0+trgMIugPVnwew3n36l7jb4UMK
1/Ou+E+Hc/Tfg0Z7W65y
=Ezqv
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [U-Boot, 02/11] compulab: refactor board revision handling
  2014-11-03  9:32 ` [U-Boot] [PATCH 02/11] compulab: refactor board revision handling Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
@ 2014-11-05 21:30   ` Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-05 21:30 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:18AM +0200, Igor Grinberg wrote:

> Move board revision handling code to a common location
> for further reuse.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Reviewed-by: Tom Rini <trini@ti.com>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/54b526f2/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [U-Boot, 03/11] omap3: cm-t35: move the USB hub reset code
  2014-11-03  9:32 ` [U-Boot] [PATCH 03/11] omap3: cm-t35: move the USB hub reset code Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
@ 2014-11-05 21:30   ` Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-05 21:30 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:19AM +0200, Igor Grinberg wrote:

> Extract the USB hub reset code to a common location where it can be
> reused by other compulab boards.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Reviewed-by: Tom Rini <trini@ti.com>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/d1238b9a/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [U-Boot, 04/11] omap3: cm-t35: extract the splash code from board
  2014-11-03  9:32 ` [U-Boot] [PATCH 04/11] omap3: cm-t35: extract the splash code from board Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
@ 2014-11-05 21:30   ` Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-05 21:30 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:20AM +0200, Igor Grinberg wrote:

> The splash screen loading code can be reused by other compulab boards.
> For now extract it to a common location for further reuse.
> 
> This also switches the splash code dependency from CONFIG_LCD to
> CONFIG_SPLASH_SCREEN as it should normally be.
> 
> In addition this patch fixes the accidental dependency of the
> get_board_mem_timings() function on CONFIG_LCD, by just moving the
> splash code and leaving the above function intact.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Reviewed-by: Tom Rini <trini@ti.com>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/e6ae65f3/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [U-Boot,05/11] omap3: cm-t35: move the SMC911x code
  2014-11-03  9:32 ` [U-Boot] [PATCH 05/11] omap3: cm-t35: move the SMC911x code Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
@ 2014-11-05 21:30   ` Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-05 21:30 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:21AM +0200, Igor Grinberg wrote:

> Extract the SMC911x initialization code to a common location where it
> can be reused by other compulab omap3 based boards.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Reviewed-by: Tom Rini <trini@ti.com>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/8b3cc86e/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [U-Boot, 06/11] omap3: cm-t35: move get_board_serial() fallback
  2014-11-03  9:32 ` [U-Boot] [PATCH 06/11] omap3: cm-t35: move get_board_serial() fallback Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
@ 2014-11-05 21:30   ` Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-05 21:30 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:22AM +0200, Igor Grinberg wrote:

> The fallback is used for cases when CONFIG_SERIAL_TAG defined, but the
> eeprom is not used.
> The fallback is useful for more than one CompuLab board, so move it to a
> common location.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Reviewed-by: Tom Rini <trini@ti.com>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/37e465a9/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [U-Boot, 07/11] omap: hsmmc: assume cd gpio is active low
  2014-11-03  9:32 ` [U-Boot] [PATCH 07/11] omap: hsmmc: assume cd gpio is active low Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
@ 2014-11-05 21:31   ` Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-05 21:31 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:23AM +0200, Igor Grinberg wrote:

> Switch the default CD GPIO polarity to active low.
> 
> The current hsmmc driver assumption that the CD GPIO is active high, but
> in the real hardware, usually the opposite holds.
> The usual SD card socket has a mechanical switch which is grounded as
> soon as a card is inserted.
> Of course there might be some board logic which inverts the signal, but
> as far as current users are concerned, there is no such logic.
> 
> Current U-Boot users either not using the CD functionality, or have a
> different way (e.g. external to SoC GPIO controller) for checking the
> card presence.
> 
> This patch also brings the polarity assumption in line with the Linux
> kernel and adds appropriate comments.
> 
> This patch also might spare issues once the TWL GPIO driver will be
> converted to the DM.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
> Cc: Dmitry Lifshitz <lifshitz@compulab.co.il>
> Reviewed-by: Tom Rini <trini@ti.com>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/eb3c0d24/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [U-Boot,09/11] omap3: cm-t3517: add USB support
  2014-11-03  9:32 ` [U-Boot] [PATCH 09/11] omap3: cm-t3517: add USB support Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
@ 2014-11-05 21:31   ` Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-05 21:31 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:25AM +0200, Igor Grinberg wrote:

> Add both host and mUSB support.
> Currently, the selection between host USB and mUSB is done through the
> config file.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Reviewed-by: Tom Rini <trini@ti.com>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/0aff411d/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [U-Boot,10/11] omap3: cm-t3517: add Ethernet support
  2014-11-03  9:32 ` [U-Boot] [PATCH 10/11] omap3: cm-t3517: add Ethernet support Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
@ 2014-11-05 21:31   ` Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-05 21:31 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:26AM +0200, Igor Grinberg wrote:

> Add both EMAC and SMC911x support.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Reviewed-by: Tom Rini <trini@ti.com>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/dd5d2713/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [U-Boot, 11/11] omap3: cm-t3517: add LCD/DVI and splash support
  2014-11-03  9:32 ` [U-Boot] [PATCH 11/11] omap3: cm-t3517: add LCD/DVI and splash support Igor Grinberg
  2014-11-04 16:45   ` Tom Rini
@ 2014-11-05 21:31   ` Tom Rini
  1 sibling, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-05 21:31 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 03, 2014 at 11:32:27AM +0200, Igor Grinberg wrote:

> Add support for splash screen on both DVI and SCF0403 LCD.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Reviewed-by: Tom Rini <trini@ti.com>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/ce5c2f23/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [U-Boot, v2] am335x: make get_board_rev() function weak
  2014-11-05 11:29     ` [U-Boot] [PATCH v2] " Igor Grinberg
@ 2014-11-05 21:33       ` Tom Rini
  0 siblings, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-05 21:33 UTC (permalink / raw)
  To: u-boot

On Wed, Nov 05, 2014 at 01:29:54PM +0200, Igor Grinberg wrote:

> Current get_board_rev() function returns a hard coded value which is
> obviously incorrect for the majority of boards.
> Allow boards to provide a correct implementation by making this
> function weak.
> In addition open code the trivial and useless BOARD_REV_ID define and
> adjust the comment.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> Cc: Tom Rini <trini@ti.com>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/17ea5f96/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

* [U-Boot] [U-Boot, v2, 8/11] omap3: cm-t3517: add basic board support
  2014-11-05 12:25     ` [U-Boot] [PATCH v2 8/11] " Igor Grinberg
@ 2014-11-05 21:33       ` Tom Rini
  0 siblings, 0 replies; 39+ messages in thread
From: Tom Rini @ 2014-11-05 21:33 UTC (permalink / raw)
  To: u-boot

On Wed, Nov 05, 2014 at 02:25:35PM +0200, Igor Grinberg wrote:

> CompuLab cm-t3517 is Computer on Module (CoM) based on AM3517 SoC.
> Features: up to 256MB DDR2, up to 512MB NAND, USB hub, mUSB, WiFi, BT,
> Analog audio codec, touch screen controller, LED.
> 
> Add basic support including:
> LED, Serial console, NAND, MMC, GPIO, I2C, 256MB DRAM.
> 
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>

Applied to u-boot-ti/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141105/fd7d762a/attachment.pgp>

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2014-11-05 21:33 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-03  9:32 [U-Boot] [PATCH 00/11] Add support for CompuLab cm-t3517 SoM Igor Grinberg
2014-11-03  9:32 ` [U-Boot] [PATCH 01/11] am335x: make get_board_rev() function weak Igor Grinberg
2014-11-04 16:45   ` Tom Rini
2014-11-05 11:29     ` [U-Boot] [PATCH v2] " Igor Grinberg
2014-11-05 21:33       ` [U-Boot] [U-Boot, " Tom Rini
2014-11-03  9:32 ` [U-Boot] [PATCH 02/11] compulab: refactor board revision handling Igor Grinberg
2014-11-04 16:45   ` Tom Rini
2014-11-05 21:30   ` [U-Boot] [U-Boot, " Tom Rini
2014-11-03  9:32 ` [U-Boot] [PATCH 03/11] omap3: cm-t35: move the USB hub reset code Igor Grinberg
2014-11-04 16:45   ` Tom Rini
2014-11-05 21:30   ` [U-Boot] [U-Boot, " Tom Rini
2014-11-03  9:32 ` [U-Boot] [PATCH 04/11] omap3: cm-t35: extract the splash code from board Igor Grinberg
2014-11-04 16:45   ` Tom Rini
2014-11-05 21:30   ` [U-Boot] [U-Boot, " Tom Rini
2014-11-03  9:32 ` [U-Boot] [PATCH 05/11] omap3: cm-t35: move the SMC911x code Igor Grinberg
2014-11-04 16:45   ` Tom Rini
2014-11-05 21:30   ` [U-Boot] [U-Boot,05/11] " Tom Rini
2014-11-03  9:32 ` [U-Boot] [PATCH 06/11] omap3: cm-t35: move get_board_serial() fallback Igor Grinberg
2014-11-04 16:45   ` Tom Rini
2014-11-05 21:30   ` [U-Boot] [U-Boot, " Tom Rini
2014-11-03  9:32 ` [U-Boot] [PATCH 07/11] omap: hsmmc: assume cd gpio is active low Igor Grinberg
2014-11-04 16:45   ` Tom Rini
2014-11-05 21:31   ` [U-Boot] [U-Boot, " Tom Rini
2014-11-03  9:32 ` [U-Boot] [PATCH 08/11] omap3: cm-t3517: add basic board support Igor Grinberg
2014-11-04 16:46   ` Tom Rini
2014-11-05 12:16     ` Igor Grinberg
2014-11-05 12:23       ` Tom Rini
2014-11-05 12:53         ` Igor Grinberg
2014-11-05 12:25     ` [U-Boot] [PATCH v2 8/11] " Igor Grinberg
2014-11-05 21:33       ` [U-Boot] [U-Boot, v2, " Tom Rini
2014-11-03  9:32 ` [U-Boot] [PATCH 09/11] omap3: cm-t3517: add USB support Igor Grinberg
2014-11-04 16:45   ` Tom Rini
2014-11-05 21:31   ` [U-Boot] [U-Boot,09/11] " Tom Rini
2014-11-03  9:32 ` [U-Boot] [PATCH 10/11] omap3: cm-t3517: add Ethernet support Igor Grinberg
2014-11-04 16:45   ` Tom Rini
2014-11-05 21:31   ` [U-Boot] [U-Boot,10/11] " Tom Rini
2014-11-03  9:32 ` [U-Boot] [PATCH 11/11] omap3: cm-t3517: add LCD/DVI and splash support Igor Grinberg
2014-11-04 16:45   ` Tom Rini
2014-11-05 21:31   ` [U-Boot] [U-Boot, " 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.