Re: [U-Boot] [PATCH 1/5] arm: am57xx: cl-som-am57x: add initial board support

2016-12-04 Thread Tom Rini
On Sun, Dec 04, 2016 at 09:58:42AM +0200, Uri Mashiach wrote:
> Hello Tom,
> 
> On 12/01/2016 05:36 PM, Tom Rini wrote:
> > On Thu, Dec 01, 2016 at 10:28:12AM +0200, Uri Mashiach wrote:
> >
> >> From: Dmitry Lifshitz 
> >>
> >> Features supported :
> >>
> >> * Serial console
> >> * SPI Flash
> >> * MMC/SD Card
> >> * eMMC storage
> >> * SATA
> >> * PCA9555 - GPIO expander over I2C5 bus
> >> * USB
> >>
> >> Signed-off-by: Dmitry Lifshitz 
> >> [uri.mashi...@compulab.co.il: Adjust to v2016.11]
> >> Signed-off-by: Uri Mashiach 
> >> Acked-by: Igor Grinberg 
> >
> > In general:
> >
> > Reviewed-by: Tom Rini 
> >
> > [snip]
> >> +/* Status LED */
> >> +#define CONFIG_STATUS_LED /* Status LED enabled */
> >> +#define CONFIG_GPIO_LED
> >> +#define CONFIG_BOARD_SPECIFIC_LED
> >> +#define GREEN_LED_DEV 0
> >> +  /* cl_som_am57x Green LED is GPIO2_5 */
> >> +#define GREEN_LED_GPIO37
> >> +#define STATUS_LED_BITGREEN_LED_GPIO
> >> +#define STATUS_LED_STATE  STATUS_LED_ON
> >> +#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
> >
> > Do you have time to look at moving CONFIG_STATUS_LED and related defines
> > to Kconfig (or where makes more sense, include/status_led.h) ?  I see
> > this is used on a few CompuLab boards so you'd be able to test the
> > changes as well, thanks!
> 
> I prefer that the CL-COM-AM57x module will be included the next release.
> The Kconfig migration of the status LED will be sent as a separate
> patch set.
> Please let me know which of the following options is preferred:
> 1. Remove the current patch from the set and add a separate patch
> after the Kconfig migration of the status LED.
> 2. Leave the current patch in the patch set and send a
> separated update patch after the Kconfig migration of the status LED.

I'm OK with 2 since you're committing to do the work, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/5] arm: am57xx: cl-som-am57x: add initial board support

2016-12-03 Thread Uri Mashiach

Hello Tom,

On 12/01/2016 05:36 PM, Tom Rini wrote:
> On Thu, Dec 01, 2016 at 10:28:12AM +0200, Uri Mashiach wrote:
>
>> From: Dmitry Lifshitz 
>>
>> Features supported :
>>
>> * Serial console
>> * SPI Flash
>> * MMC/SD Card
>> * eMMC storage
>> * SATA
>> * PCA9555 - GPIO expander over I2C5 bus
>> * USB
>>
>> Signed-off-by: Dmitry Lifshitz 
>> [uri.mashi...@compulab.co.il: Adjust to v2016.11]
>> Signed-off-by: Uri Mashiach 
>> Acked-by: Igor Grinberg 
>
> In general:
>
> Reviewed-by: Tom Rini 
>
> [snip]
>> +/* Status LED */
>> +#define CONFIG_STATUS_LED /* Status LED enabled */
>> +#define CONFIG_GPIO_LED
>> +#define CONFIG_BOARD_SPECIFIC_LED
>> +#define GREEN_LED_DEV 0
>> +  /* cl_som_am57x Green LED is GPIO2_5 
*/
>> +#define GREEN_LED_GPIO37
>> +#define STATUS_LED_BITGREEN_LED_GPIO
>> +#define STATUS_LED_STATE  STATUS_LED_ON
>> +#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
>
> Do you have time to look at moving CONFIG_STATUS_LED and related defines
> to Kconfig (or where makes more sense, include/status_led.h) ?  I see
> this is used on a few CompuLab boards so you'd be able to test the
> changes as well, thanks!
>

I prefer that the CL-COM-AM57x module will be included the next release.
The Kconfig migration of the status LED will be sent as a separate patch 
set.

Please let me know which of the following options is preferred:
1. Remove the current patch from the set and add a separate patch after 
the Kconfig migration of the status LED.

2. Leave the current patch in the patch set and send a
separated update patch after the Kconfig migration of the status LED.

--
Thabks,
Uri
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/5] arm: am57xx: cl-som-am57x: add initial board support

2016-12-01 Thread Tom Rini
On Thu, Dec 01, 2016 at 10:28:12AM +0200, Uri Mashiach wrote:

> From: Dmitry Lifshitz 
> 
> Features supported :
> 
> * Serial console
> * SPI Flash
> * MMC/SD Card
> * eMMC storage
> * SATA
> * PCA9555 - GPIO expander over I2C5 bus
> * USB
> 
> Signed-off-by: Dmitry Lifshitz 
> [uri.mashi...@compulab.co.il: Adjust to v2016.11]
> Signed-off-by: Uri Mashiach 
> Acked-by: Igor Grinberg 

In general:

Reviewed-by: Tom Rini 

[snip]
> +/* Status LED */
> +#define CONFIG_STATUS_LED/* Status LED enabled */
> +#define CONFIG_GPIO_LED
> +#define CONFIG_BOARD_SPECIFIC_LED
> +#define GREEN_LED_DEV0
> + /* cl_som_am57x Green LED is GPIO2_5 */
> +#define GREEN_LED_GPIO   37
> +#define STATUS_LED_BIT   GREEN_LED_GPIO
> +#define STATUS_LED_STATE STATUS_LED_ON
> +#define STATUS_LED_PERIOD(CONFIG_SYS_HZ / 2)

Do you have time to look at moving CONFIG_STATUS_LED and related defines
to Kconfig (or where makes more sense, include/status_led.h) ?  I see
this is used on a few CompuLab boards so you'd be able to test the
changes as well, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/5] arm: am57xx: cl-som-am57x: add initial board support

2016-12-01 Thread Uri Mashiach
From: Dmitry Lifshitz 

Features supported :

* Serial console
* SPI Flash
* MMC/SD Card
* eMMC storage
* SATA
* PCA9555 - GPIO expander over I2C5 bus
* USB

Signed-off-by: Dmitry Lifshitz 
[uri.mashi...@compulab.co.il: Adjust to v2016.11]
Signed-off-by: Uri Mashiach 
Acked-by: Igor Grinberg 
---
 arch/arm/cpu/armv7/omap5/Kconfig   |   4 +
 board/compulab/cl-som-am57x/Kconfig|  12 ++
 board/compulab/cl-som-am57x/MAINTAINERS|   6 +
 board/compulab/cl-som-am57x/Makefile   |  15 ++
 board/compulab/cl-som-am57x/cl-som-am57x.c |  62 
 board/compulab/cl-som-am57x/mux.c  | 100 +
 board/compulab/cl-som-am57x/spl.c  | 222 +
 configs/cl-som-am57x_defconfig |  41 ++
 include/configs/cl-som-am57x.h | 102 +
 9 files changed, 564 insertions(+)
 create mode 100644 board/compulab/cl-som-am57x/Kconfig
 create mode 100644 board/compulab/cl-som-am57x/MAINTAINERS
 create mode 100644 board/compulab/cl-som-am57x/Makefile
 create mode 100644 board/compulab/cl-som-am57x/cl-som-am57x.c
 create mode 100644 board/compulab/cl-som-am57x/mux.c
 create mode 100644 board/compulab/cl-som-am57x/spl.c
 create mode 100644 configs/cl-som-am57x_defconfig
 create mode 100644 include/configs/cl-som-am57x.h

diff --git a/arch/arm/cpu/armv7/omap5/Kconfig b/arch/arm/cpu/armv7/omap5/Kconfig
index 22259dc..0ee5ac1 100644
--- a/arch/arm/cpu/armv7/omap5/Kconfig
+++ b/arch/arm/cpu/armv7/omap5/Kconfig
@@ -40,6 +40,9 @@ choice
prompt "OMAP5 board select"
optional
 
+config TARGET_CL_SOM_AM57X
+   bool "CompuLab CL-SOM-AM57x"
+
 config TARGET_CM_T54
bool "CompuLab CM-T54"
 
@@ -86,6 +89,7 @@ config TI_SECURE_EMIF_PROTECTED_REGION_SIZE
  using hardware memory firewalls. This value must be smaller than the
  TI_SECURE_EMIF_TOTAL_REGION_SIZE value.
 
+source "board/compulab/cl-som-am57x/Kconfig"
 source "board/compulab/cm_t54/Kconfig"
 source "board/ti/omap5_uevm/Kconfig"
 source "board/ti/dra7xx/Kconfig"
diff --git a/board/compulab/cl-som-am57x/Kconfig 
b/board/compulab/cl-som-am57x/Kconfig
new file mode 100644
index 000..85fc9a1
--- /dev/null
+++ b/board/compulab/cl-som-am57x/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_CL_SOM_AM57X
+
+config SYS_BOARD
+   default "cl-som-am57x"
+
+config SYS_VENDOR
+   default "compulab"
+
+config SYS_CONFIG_NAME
+   default "cl-som-am57x"
+
+endif
diff --git a/board/compulab/cl-som-am57x/MAINTAINERS 
b/board/compulab/cl-som-am57x/MAINTAINERS
new file mode 100644
index 000..e0195f4
--- /dev/null
+++ b/board/compulab/cl-som-am57x/MAINTAINERS
@@ -0,0 +1,6 @@
+CL-SOM-AM57x BOARD
+M: Uri Mashiach 
+S: Maintained
+F: board/compulab/cl-som-am57x/
+F: include/configs/cl-som-am57x.h
+F: configs/cl-som-am57x_defconfig
diff --git a/board/compulab/cl-som-am57x/Makefile 
b/board/compulab/cl-som-am57x/Makefile
new file mode 100644
index 000..0c59781
--- /dev/null
+++ b/board/compulab/cl-som-am57x/Makefile
@@ -0,0 +1,15 @@
+#
+# Makefile
+#
+# (C) Copyright 2016 CompuLab, Ltd. 
+#
+# Author: Dmitry Lifshitz 
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+ifdef CONFIG_SPL_BUILD
+obj-y  += spl.o mux.o
+else
+obj-y  += cl-som-am57x.o mux.o
+endif
diff --git a/board/compulab/cl-som-am57x/cl-som-am57x.c 
b/board/compulab/cl-som-am57x/cl-som-am57x.c
new file mode 100644
index 000..4bad644
--- /dev/null
+++ b/board/compulab/cl-som-am57x/cl-som-am57x.c
@@ -0,0 +1,62 @@
+/*
+ * Board functions for CompuLab cl_som_am57x board
+ *
+ * (C) Copyright 2016 CompuLab, Ltd. http://compulab.co.il/
+ *
+ * Author: Dmitry Lifshitz 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+const struct omap_sysinfo sysinfo = {
+   "Board: CL-SOM-AM57x\n"
+};
+
+int board_init(void)
+{
+   /* Disable PMIC Powerhold feature, DEV_CTRL.DEV_ON = 1 */
+   palmas_i2c_write_u8(TPS65903X_CHIP_P1, 0xA0, 0x1);
+
+   gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+
+   return 0;
+}
+
+#ifdef CONFIG_GENERIC_MMC
+#define SB_SOM_CD_GPIO 187
+#define SB_SOM_WP_GPIO 188
+
+int board_mmc_init(bd_t *bis)
+{
+   int ret0, ret1;
+
+   ret0 = omap_mmc_init(0, 0, 0, SB_SOM_CD_GPIO, SB_SOM_WP_GPIO);
+   if (ret0)
+   printf("cl-som-am57x: failed to initialize mmc0\n");
+
+   ret1 = omap_mmc_init(1, 0, 0, -1, -1);
+   if (ret1)
+   printf("cl-som-am57x: failed to initialize mmc1\n");
+
+   return ret0 && ret1;
+}
+#endif /* CONFIG_GENERIC_MMC */
+
+#ifdef CONFIG_USB_XHCI_OMAP
+int board_usb_init(int index, enum usb_init_type init)
+{
+   setbits_le32((*prcm)->cm_l3init_usb_otg_ss1_clkctrl,
+