Re: [U-Boot] [PATCH V2] ARM: imx6: Add DHCOM i.MX6 PDK board support

2017-10-12 Thread Stefano Babic
On 09/10/2017 21:51, Marek Vasut wrote:
> Add support for the DHCOM i.MX6 PDK board. This board has:
> - FEC ethernet
> - EHCI USB host
> - 3x SDMMC
> 
> Signed-off-by: Marek Vasut 
> Cc: Stefano Babic 
> ---
> V2: Use get_cpu_type() and imx_get_mac_from_fuse()
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH V2] ARM: imx6: Add DHCOM i.MX6 PDK board support

2017-10-10 Thread Stefano Babic
Hi Jagan, Marek,

On 10/10/2017 16:08, Marek Vasut wrote:
> On 10/10/2017 04:04 PM, Jagan Teki wrote:
>> On Tue, Oct 10, 2017 at 7:10 PM, Marek Vasut  wrote:
>>> On 10/10/2017 03:32 PM, Jagan Teki wrote:
 On Tue, Oct 10, 2017 at 1:21 AM, Marek Vasut  wrote:
> Add support for the DHCOM i.MX6 PDK board. This board has:
> - FEC ethernet
> - EHCI USB host
> - 3x SDMMC
>
> Signed-off-by: Marek Vasut 
> Cc: Stefano Babic 
> ---
> V2: Use get_cpu_type() and imx_get_mac_from_fuse()
> ---
>  arch/arm/mach-imx/mx6/Kconfig |  10 +
>  board/dhelectronics/dh_imx6/Kconfig   |  12 +
>  board/dhelectronics/dh_imx6/MAINTAINERS   |   7 +
>  board/dhelectronics/dh_imx6/Makefile  |  11 +
>  board/dhelectronics/dh_imx6/dh_imx6.c | 437 
> ++
>  board/dhelectronics/dh_imx6/dh_imx6_spl.c | 399 
> +++
>  configs/dh_imx6_defconfig |  51 
>  include/configs/dh_imx6.h | 191 +
>  8 files changed, 1118 insertions(+)
>  create mode 100644 board/dhelectronics/dh_imx6/Kconfig
>  create mode 100644 board/dhelectronics/dh_imx6/MAINTAINERS
>  create mode 100644 board/dhelectronics/dh_imx6/Makefile
>  create mode 100644 board/dhelectronics/dh_imx6/dh_imx6.c
>  create mode 100644 board/dhelectronics/dh_imx6/dh_imx6_spl.c
>  create mode 100644 configs/dh_imx6_defconfig
>  create mode 100644 include/configs/dh_imx6.h
>
> diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
> index 540f2b29b1..b82db3af22 100644
> --- a/arch/arm/mach-imx/mx6/Kconfig
> +++ b/arch/arm/mach-imx/mx6/Kconfig
> @@ -129,6 +129,15 @@ config TARGET_COLIBRI_IMX6
> select DM_SERIAL
> select DM_THERMAL
>
> +config TARGET_DHCOMIMX6
> +   bool "dh_imx6"
> +   select BOARD_LATE_INIT
> +   select BOARD_EARLY_INIT_F
> +   select SUPPORT_SPL
> +   select DM
> +   select DM_THERMAL
> +   imply CMD_SPL

 I would suggest to add new boards with DTS along with enabling
 dm-driven drivers, this would eventually improve i.MX tree toward
 using new feature set.
>>>
>>> Enabling unused stuff and adding bloat ? Nope :)
>>
>> OK, but we still have useful stuff:
>>
>> DM_ETH
>> DM_GPIO
>> DM_I2C
>> DM_MMC
>> DM_SPI
>> DM_SPI_FLASH
> 
> This discussion is moot, it is NOT useful here and it just adds bloat.

More or less I have already explained my point of view here:

https://lists.denx.de/pipermail/u-boot/2017-May/292424.html

Again, moving to DTS should be done if this does not preclude other
features. That means for example boot time (==> small footprint), having
a single binary for multiple SOC variants, and so on. As I have already
said: I won't constraint any contributor to follow one or the other way.
See case with pico imx.7. I understand that some projects will be better
supported in one way, some other ones with the other way. I have also
merged boards in last time *without* DTS support, because the board
maintainer is in charge to better know which is the best for his own
project - the choice has low impact on the common port for i.MX. For
this patch, Marek has chosen the way to support the board, because he
won't to increase footprint and he does not want to have unused code
inside. All good arguments.

IMHO patch is fine.

Best regards,
Stefano

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH V2] ARM: imx6: Add DHCOM i.MX6 PDK board support

2017-10-10 Thread Marek Vasut
On 10/10/2017 04:04 PM, Jagan Teki wrote:
> On Tue, Oct 10, 2017 at 7:10 PM, Marek Vasut  wrote:
>> On 10/10/2017 03:32 PM, Jagan Teki wrote:
>>> On Tue, Oct 10, 2017 at 1:21 AM, Marek Vasut  wrote:
 Add support for the DHCOM i.MX6 PDK board. This board has:
 - FEC ethernet
 - EHCI USB host
 - 3x SDMMC

 Signed-off-by: Marek Vasut 
 Cc: Stefano Babic 
 ---
 V2: Use get_cpu_type() and imx_get_mac_from_fuse()
 ---
  arch/arm/mach-imx/mx6/Kconfig |  10 +
  board/dhelectronics/dh_imx6/Kconfig   |  12 +
  board/dhelectronics/dh_imx6/MAINTAINERS   |   7 +
  board/dhelectronics/dh_imx6/Makefile  |  11 +
  board/dhelectronics/dh_imx6/dh_imx6.c | 437 
 ++
  board/dhelectronics/dh_imx6/dh_imx6_spl.c | 399 
 +++
  configs/dh_imx6_defconfig |  51 
  include/configs/dh_imx6.h | 191 +
  8 files changed, 1118 insertions(+)
  create mode 100644 board/dhelectronics/dh_imx6/Kconfig
  create mode 100644 board/dhelectronics/dh_imx6/MAINTAINERS
  create mode 100644 board/dhelectronics/dh_imx6/Makefile
  create mode 100644 board/dhelectronics/dh_imx6/dh_imx6.c
  create mode 100644 board/dhelectronics/dh_imx6/dh_imx6_spl.c
  create mode 100644 configs/dh_imx6_defconfig
  create mode 100644 include/configs/dh_imx6.h

 diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
 index 540f2b29b1..b82db3af22 100644
 --- a/arch/arm/mach-imx/mx6/Kconfig
 +++ b/arch/arm/mach-imx/mx6/Kconfig
 @@ -129,6 +129,15 @@ config TARGET_COLIBRI_IMX6
 select DM_SERIAL
 select DM_THERMAL

 +config TARGET_DHCOMIMX6
 +   bool "dh_imx6"
 +   select BOARD_LATE_INIT
 +   select BOARD_EARLY_INIT_F
 +   select SUPPORT_SPL
 +   select DM
 +   select DM_THERMAL
 +   imply CMD_SPL
>>>
>>> I would suggest to add new boards with DTS along with enabling
>>> dm-driven drivers, this would eventually improve i.MX tree toward
>>> using new feature set.
>>
>> Enabling unused stuff and adding bloat ? Nope :)
> 
> OK, but we still have useful stuff:
> 
> DM_ETH
> DM_GPIO
> DM_I2C
> DM_MMC
> DM_SPI
> DM_SPI_FLASH

This discussion is moot, it is NOT useful here and it just adds bloat.

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH V2] ARM: imx6: Add DHCOM i.MX6 PDK board support

2017-10-10 Thread Jagan Teki
On Tue, Oct 10, 2017 at 7:10 PM, Marek Vasut  wrote:
> On 10/10/2017 03:32 PM, Jagan Teki wrote:
>> On Tue, Oct 10, 2017 at 1:21 AM, Marek Vasut  wrote:
>>> Add support for the DHCOM i.MX6 PDK board. This board has:
>>> - FEC ethernet
>>> - EHCI USB host
>>> - 3x SDMMC
>>>
>>> Signed-off-by: Marek Vasut 
>>> Cc: Stefano Babic 
>>> ---
>>> V2: Use get_cpu_type() and imx_get_mac_from_fuse()
>>> ---
>>>  arch/arm/mach-imx/mx6/Kconfig |  10 +
>>>  board/dhelectronics/dh_imx6/Kconfig   |  12 +
>>>  board/dhelectronics/dh_imx6/MAINTAINERS   |   7 +
>>>  board/dhelectronics/dh_imx6/Makefile  |  11 +
>>>  board/dhelectronics/dh_imx6/dh_imx6.c | 437 
>>> ++
>>>  board/dhelectronics/dh_imx6/dh_imx6_spl.c | 399 +++
>>>  configs/dh_imx6_defconfig |  51 
>>>  include/configs/dh_imx6.h | 191 +
>>>  8 files changed, 1118 insertions(+)
>>>  create mode 100644 board/dhelectronics/dh_imx6/Kconfig
>>>  create mode 100644 board/dhelectronics/dh_imx6/MAINTAINERS
>>>  create mode 100644 board/dhelectronics/dh_imx6/Makefile
>>>  create mode 100644 board/dhelectronics/dh_imx6/dh_imx6.c
>>>  create mode 100644 board/dhelectronics/dh_imx6/dh_imx6_spl.c
>>>  create mode 100644 configs/dh_imx6_defconfig
>>>  create mode 100644 include/configs/dh_imx6.h
>>>
>>> diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
>>> index 540f2b29b1..b82db3af22 100644
>>> --- a/arch/arm/mach-imx/mx6/Kconfig
>>> +++ b/arch/arm/mach-imx/mx6/Kconfig
>>> @@ -129,6 +129,15 @@ config TARGET_COLIBRI_IMX6
>>> select DM_SERIAL
>>> select DM_THERMAL
>>>
>>> +config TARGET_DHCOMIMX6
>>> +   bool "dh_imx6"
>>> +   select BOARD_LATE_INIT
>>> +   select BOARD_EARLY_INIT_F
>>> +   select SUPPORT_SPL
>>> +   select DM
>>> +   select DM_THERMAL
>>> +   imply CMD_SPL
>>
>> I would suggest to add new boards with DTS along with enabling
>> dm-driven drivers, this would eventually improve i.MX tree toward
>> using new feature set.
>
> Enabling unused stuff and adding bloat ? Nope :)

OK, but we still have useful stuff:

DM_ETH
DM_GPIO
DM_I2C
DM_MMC
DM_SPI
DM_SPI_FLASH

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH V2] ARM: imx6: Add DHCOM i.MX6 PDK board support

2017-10-10 Thread Marek Vasut
On 10/10/2017 03:32 PM, Jagan Teki wrote:
> On Tue, Oct 10, 2017 at 1:21 AM, Marek Vasut  wrote:
>> Add support for the DHCOM i.MX6 PDK board. This board has:
>> - FEC ethernet
>> - EHCI USB host
>> - 3x SDMMC
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Stefano Babic 
>> ---
>> V2: Use get_cpu_type() and imx_get_mac_from_fuse()
>> ---
>>  arch/arm/mach-imx/mx6/Kconfig |  10 +
>>  board/dhelectronics/dh_imx6/Kconfig   |  12 +
>>  board/dhelectronics/dh_imx6/MAINTAINERS   |   7 +
>>  board/dhelectronics/dh_imx6/Makefile  |  11 +
>>  board/dhelectronics/dh_imx6/dh_imx6.c | 437 
>> ++
>>  board/dhelectronics/dh_imx6/dh_imx6_spl.c | 399 +++
>>  configs/dh_imx6_defconfig |  51 
>>  include/configs/dh_imx6.h | 191 +
>>  8 files changed, 1118 insertions(+)
>>  create mode 100644 board/dhelectronics/dh_imx6/Kconfig
>>  create mode 100644 board/dhelectronics/dh_imx6/MAINTAINERS
>>  create mode 100644 board/dhelectronics/dh_imx6/Makefile
>>  create mode 100644 board/dhelectronics/dh_imx6/dh_imx6.c
>>  create mode 100644 board/dhelectronics/dh_imx6/dh_imx6_spl.c
>>  create mode 100644 configs/dh_imx6_defconfig
>>  create mode 100644 include/configs/dh_imx6.h
>>
>> diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
>> index 540f2b29b1..b82db3af22 100644
>> --- a/arch/arm/mach-imx/mx6/Kconfig
>> +++ b/arch/arm/mach-imx/mx6/Kconfig
>> @@ -129,6 +129,15 @@ config TARGET_COLIBRI_IMX6
>> select DM_SERIAL
>> select DM_THERMAL
>>
>> +config TARGET_DHCOMIMX6
>> +   bool "dh_imx6"
>> +   select BOARD_LATE_INIT
>> +   select BOARD_EARLY_INIT_F
>> +   select SUPPORT_SPL
>> +   select DM
>> +   select DM_THERMAL
>> +   imply CMD_SPL
> 
> I would suggest to add new boards with DTS along with enabling
> dm-driven drivers, this would eventually improve i.MX tree toward
> using new feature set.

Enabling unused stuff and adding bloat ? Nope :)

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH V2] ARM: imx6: Add DHCOM i.MX6 PDK board support

2017-10-10 Thread Jagan Teki
On Tue, Oct 10, 2017 at 1:21 AM, Marek Vasut  wrote:
> Add support for the DHCOM i.MX6 PDK board. This board has:
> - FEC ethernet
> - EHCI USB host
> - 3x SDMMC
>
> Signed-off-by: Marek Vasut 
> Cc: Stefano Babic 
> ---
> V2: Use get_cpu_type() and imx_get_mac_from_fuse()
> ---
>  arch/arm/mach-imx/mx6/Kconfig |  10 +
>  board/dhelectronics/dh_imx6/Kconfig   |  12 +
>  board/dhelectronics/dh_imx6/MAINTAINERS   |   7 +
>  board/dhelectronics/dh_imx6/Makefile  |  11 +
>  board/dhelectronics/dh_imx6/dh_imx6.c | 437 
> ++
>  board/dhelectronics/dh_imx6/dh_imx6_spl.c | 399 +++
>  configs/dh_imx6_defconfig |  51 
>  include/configs/dh_imx6.h | 191 +
>  8 files changed, 1118 insertions(+)
>  create mode 100644 board/dhelectronics/dh_imx6/Kconfig
>  create mode 100644 board/dhelectronics/dh_imx6/MAINTAINERS
>  create mode 100644 board/dhelectronics/dh_imx6/Makefile
>  create mode 100644 board/dhelectronics/dh_imx6/dh_imx6.c
>  create mode 100644 board/dhelectronics/dh_imx6/dh_imx6_spl.c
>  create mode 100644 configs/dh_imx6_defconfig
>  create mode 100644 include/configs/dh_imx6.h
>
> diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
> index 540f2b29b1..b82db3af22 100644
> --- a/arch/arm/mach-imx/mx6/Kconfig
> +++ b/arch/arm/mach-imx/mx6/Kconfig
> @@ -129,6 +129,15 @@ config TARGET_COLIBRI_IMX6
> select DM_SERIAL
> select DM_THERMAL
>
> +config TARGET_DHCOMIMX6
> +   bool "dh_imx6"
> +   select BOARD_LATE_INIT
> +   select BOARD_EARLY_INIT_F
> +   select SUPPORT_SPL
> +   select DM
> +   select DM_THERMAL
> +   imply CMD_SPL

I would suggest to add new boards with DTS along with enabling
dm-driven drivers, this would eventually improve i.MX tree toward
using new feature set.

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH V2] ARM: imx6: Add DHCOM i.MX6 PDK board support

2017-10-09 Thread Marek Vasut
Add support for the DHCOM i.MX6 PDK board. This board has:
- FEC ethernet
- EHCI USB host
- 3x SDMMC

Signed-off-by: Marek Vasut 
Cc: Stefano Babic 
---
V2: Use get_cpu_type() and imx_get_mac_from_fuse()
---
 arch/arm/mach-imx/mx6/Kconfig |  10 +
 board/dhelectronics/dh_imx6/Kconfig   |  12 +
 board/dhelectronics/dh_imx6/MAINTAINERS   |   7 +
 board/dhelectronics/dh_imx6/Makefile  |  11 +
 board/dhelectronics/dh_imx6/dh_imx6.c | 437 ++
 board/dhelectronics/dh_imx6/dh_imx6_spl.c | 399 +++
 configs/dh_imx6_defconfig |  51 
 include/configs/dh_imx6.h | 191 +
 8 files changed, 1118 insertions(+)
 create mode 100644 board/dhelectronics/dh_imx6/Kconfig
 create mode 100644 board/dhelectronics/dh_imx6/MAINTAINERS
 create mode 100644 board/dhelectronics/dh_imx6/Makefile
 create mode 100644 board/dhelectronics/dh_imx6/dh_imx6.c
 create mode 100644 board/dhelectronics/dh_imx6/dh_imx6_spl.c
 create mode 100644 configs/dh_imx6_defconfig
 create mode 100644 include/configs/dh_imx6.h

diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index 540f2b29b1..b82db3af22 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -129,6 +129,15 @@ config TARGET_COLIBRI_IMX6
select DM_SERIAL
select DM_THERMAL
 
+config TARGET_DHCOMIMX6
+   bool "dh_imx6"
+   select BOARD_LATE_INIT
+   select BOARD_EARLY_INIT_F
+   select SUPPORT_SPL
+   select DM
+   select DM_THERMAL
+   imply CMD_SPL
+
 config TARGET_EMBESTMX6BOARDS
bool "embestmx6boards"
select BOARD_LATE_INIT
@@ -428,6 +437,7 @@ source "board/boundary/nitrogen6x/Kconfig"
 source "board/ccv/xpress/Kconfig"
 source "board/compulab/cm_fx6/Kconfig"
 source "board/congatec/cgtqmx6eval/Kconfig"
+source "board/dhelectronics/dh_imx6/Kconfig"
 source "board/el/el6x/Kconfig"
 source "board/embest/mx6boards/Kconfig"
 source "board/engicam/geam6ul/Kconfig"
diff --git a/board/dhelectronics/dh_imx6/Kconfig 
b/board/dhelectronics/dh_imx6/Kconfig
new file mode 100644
index 00..0cfef9b097
--- /dev/null
+++ b/board/dhelectronics/dh_imx6/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_DHCOMIMX6
+
+config SYS_BOARD
+   default "dh_imx6"
+
+config SYS_VENDOR
+   default "dhelectronics"
+
+config SYS_CONFIG_NAME
+   default "dh_imx6"
+
+endif
diff --git a/board/dhelectronics/dh_imx6/MAINTAINERS 
b/board/dhelectronics/dh_imx6/MAINTAINERS
new file mode 100644
index 00..e54bd60adb
--- /dev/null
+++ b/board/dhelectronics/dh_imx6/MAINTAINERS
@@ -0,0 +1,7 @@
+DH_IMX6 BOARD
+M: Andreas Geisreiter , Ludwig Zenz 

+S: Maintained
+F: board/dhelectronics/dh_imx6/
+F: include/configs/dh_imx6.h
+F: configs/dh_mx6q_defconfig
+F: configs/dh_mx6dl_defconfig
diff --git a/board/dhelectronics/dh_imx6/Makefile 
b/board/dhelectronics/dh_imx6/Makefile
new file mode 100644
index 00..bddc8d8568
--- /dev/null
+++ b/board/dhelectronics/dh_imx6/Makefile
@@ -0,0 +1,11 @@
+#
+# Copyright (C) 2017 Marek Vasut 
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+ifdef CONFIG_SPL_BUILD
+obj-y  := dh_imx6_spl.o
+else
+obj-y  := dh_imx6.o
+endif
diff --git a/board/dhelectronics/dh_imx6/dh_imx6.c 
b/board/dhelectronics/dh_imx6/dh_imx6.c
new file mode 100644
index 00..c76da4d2af
--- /dev/null
+++ b/board/dhelectronics/dh_imx6/dh_imx6.c
@@ -0,0 +1,437 @@
+/*
+ * DHCOM DH-iMX6 PDK board support
+ *
+ * Copyright (C) 2017 Marek Vasut 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define I2C_PAD_CTRL   \
+   (PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm |  \
+   PAD_CTL_HYS | PAD_CTL_ODE | PAD_CTL_SRE_FAST)
+
+#define EEPROM_I2C_ADDRESS 0x50
+
+#define PC MUX_PAD_CTRL(I2C_PAD_CTRL)
+
+static struct i2c_pads_info dh6sdl_i2c_pad_info0 = {
+   .scl = {
+   .i2c_mode  = MX6DL_PAD_EIM_D21__I2C1_SCL | PC,
+   .gpio_mode = MX6DL_PAD_EIM_D21__GPIO3_IO21 | PC,
+   .gp = IMX_GPIO_NR(3, 21)
+   },
+   .sda = {
+.i2c_mode = MX6DL_PAD_EIM_D28__I2C1_SDA | PC,
+.gpio_mode = MX6DL_PAD_EIM_D28__GPIO3_IO28 | PC,
+.gp = IMX_GPIO_NR(3, 28)
+}
+};
+
+static struct i2c_pads_info dh6sdl_i2c_pad_info1 = {
+   .scl = {
+   .i2c_mode  = MX6DL_PAD_KEY_COL3__I2C2_SCL | PC,
+   .gpio_mode = MX6DL_PAD_KEY_COL3__GPIO4_IO12 | PC,
+   .gp = IMX_GPIO_NR(4,