Re: [U-Boot] serial: meson: Update compatible with new Linux bindings

2018-04-11 Thread Tom Rini
On Thu, Mar 29, 2018 at 02:56:02PM +0200, Neil Armstrong wrote:

> The Amlogic Meson SoCs serial bindings were not written when serial
> support was pushed into Linux and U-Boot.
> A clean bindings document has been merged into Linux tree to correctly
> handle the multiple clocks feeding the serial peripheral.
> This update the U-Boot serial_meson driver with the new compatible
> string for Amlogic Meson GX Socs.
> 
> Signed-off-by: Neil Armstrong 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] sysreset: syscon: convert to use live dt

2018-04-11 Thread Tom Rini
On Sat, Mar 17, 2018 at 12:22:24PM +0100, Álvaro Fernández Rojas wrote:

> Signed-off-by: Álvaro Fernández Rojas 
> Reviewed-by: Daniel Schwierzeck 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] Pull request: u-boot-ubi/master

2018-04-11 Thread Heiko Schocher

Hello Tom,

please pull from u-boot-ubi master

The following changes since commit 2600df4f8ef12ece9cec13030005919e0ba2b0d5:

  Merge tag 'xilinx-for-v2018.05-rc2' of git://git.denx.de/u-boot-microblaze (2018-04-09 11:06:21 
-0400)


are available in the Git repository at:

  git://git.denx.de/u-boot-ubi.git master

for you to fetch changes up to 05ea83b67ed7861c1693187dbf3a2613601c1b15:

  ubifs: Change value of mutex_is_locked() (2018-04-11 11:27:07 +0200)


Bradley Bolen (1):
  ubifs: Change value of mutex_is_locked()

 fs/ubifs/ubifs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Travis build:

https://travis-ci.org/hsdenx/u-boot-ubi/builds/365022599

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


Re: [U-Boot] arm: socfpga: unable to boot cyclone5 devkit or SocKit

2018-04-11 Thread Alexander Graf

On 04/11/2018 02:37 PM, Marek Vasut wrote:

On 04/11/2018 02:26 PM, Tom Rini wrote:

On Wed, Apr 11, 2018 at 10:12:42AM +0200, Marek Vasut wrote:

On 04/11/2018 04:52 AM, Dinh Nguyen wrote:
[...]


u-boot$ git reset --hard v2018.01 ; bu socfpga_cyclone5 ; ls -la
spl/u-boot-spl.bin
HEAD is now at f3dd87e0b9 Prepare v2018.01
-rw-r--r-- 1 marex marex 52902 Apr 11 00:34 spl/u-boot-spl.bin

u-boot$ git reset --hard v2018.03 ; bu socfpga_cyclone5 ; ls -la
spl/u-boot-spl.bin
HEAD is now at f95ab1fb6e Prepare v2018.03
-rw-r--r-- 1 marex marex 59706 Apr 11 00:34 spl/u-boot-spl.bin

Try bisecting out the commit which caused this 7 kiB growth between
2018.01 and 2018.03 . Even those 53 kiB are quite borderline, but it was
at 53 kiB for a while (2017.05 is also ~53 kiB)

Do you have a size constraint and are not setting the correct CONFIG
options so that it becomes a build failure?


Doing the bisect points me to this commit:

commit fa2c14676c7c6f3115dd4d9b2a4cc3b35c3ad2a2
Author: Tom Rini 
Date:   Sat Feb 10 16:54:38 2018 -0500

 configs: Re-sync with CONFIG_DISTRO_DEFAULTS

 A number of platforms include config_distro_defaults.h but do not enable
 CONFIG_DISTRO_DEFAULTS.  As they plainly intended to, set that flag and
 re-sync config files.

 Signed-off-by: Tom Rini 

Doing a revert of the above commit shrinks the SPL back down to ~7 kiB.

Dinh


It looks like the enablement of CONFIG_DISTRO_DEFAULTS, enables these
configs:

CONFIG_ISO_PARTITION=y
CONFIG_SPL_ISO_PARTITION=y
# CONFIG_AMIGA_PARTITION is not set
# CONFIG_SPL_AMIGA_PARTITION is not set
CONFIG_EFI_PARTITION=y
CONFIG_EFI_PARTITION_ENTRIES_NUMBERS=128
CONFIG_EFI_PARTITION_ENTRIES_OFF=0
CONFIG_SPL_EFI_PARTITION=y
CONFIG_PARTITION_UUIDS=y
CONFIG_SPL_PARTITION_UUIDS=y
# CONFIG_PARTITION_TYPE_GUID is not set

Which is contributing to the SPL growth.


Turning the following config options off subtracts 7k from the SPL:

+# CONFIG_SPL_ISO_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set

Not sure if these are needed?

IMO not on SoCFPGA. Also CCing Tom.

Yes, all of those options are part of CONFIG_DISTRO_DEFAULTS and are
needed so that booting from various distro media works.

In SPL on boards which usually boot from SDMMC or QSPI NOR ? How is EFI
or ISO partition needed there ?



I don't think ISO partitioning is needed in SPL. However, for GPT I'm 
not 100% sure. People tend to go with GPT more often than not these days 
- and to be able to fetch U-Boot proper from a GPT partition may make sense.


How much reduction do you get when you only disable 
CONFIG_SPL_ISO_PARTITION?



Alex

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ubifs: Change value of mutex_is_locked()

2018-04-11 Thread Heiko Schocher

Hello Bradley,

Am 04.04.2018 um 18:42 schrieb Bradley Bolen:

The mutex lock and unlock functions are stubbed out and mutex_is_locked
was 0.  This caused asserts to fail in ubifs code when checking that the
mutex was locked.  For example,

UBIFS assert failed in ubifs_change_lp at 540
UBIFS assert failed in ubifs_release_lprops at 278

Assume that the "mutex" is locked since that is the normal case when it
is checked in the ubifs code.

Signed-off-by: Bradley Bolen 
---
  fs/ubifs/ubifs.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)


Applied to u-boot-ubi master

Thanks!

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


Re: [U-Boot] arm: socfpga: unable to boot cyclone5 devkit or SocKit

2018-04-11 Thread Marek Vasut
On 04/11/2018 02:26 PM, Tom Rini wrote:
> On Wed, Apr 11, 2018 at 10:12:42AM +0200, Marek Vasut wrote:
>> On 04/11/2018 04:52 AM, Dinh Nguyen wrote:
>> [...]
>>
>> u-boot$ git reset --hard v2018.01 ; bu socfpga_cyclone5 ; ls -la
>> spl/u-boot-spl.bin
>> HEAD is now at f3dd87e0b9 Prepare v2018.01
>> -rw-r--r-- 1 marex marex 52902 Apr 11 00:34 spl/u-boot-spl.bin
>>
>> u-boot$ git reset --hard v2018.03 ; bu socfpga_cyclone5 ; ls -la
>> spl/u-boot-spl.bin
>> HEAD is now at f95ab1fb6e Prepare v2018.03
>> -rw-r--r-- 1 marex marex 59706 Apr 11 00:34 spl/u-boot-spl.bin
>>
>> Try bisecting out the commit which caused this 7 kiB growth between
>> 2018.01 and 2018.03 . Even those 53 kiB are quite borderline, but it was
>> at 53 kiB for a while (2017.05 is also ~53 kiB)
> 
> Do you have a size constraint and are not setting the correct CONFIG
> options so that it becomes a build failure?
> 
> Doing the bisect points me to this commit:
>
> commit fa2c14676c7c6f3115dd4d9b2a4cc3b35c3ad2a2
> Author: Tom Rini 
> Date:   Sat Feb 10 16:54:38 2018 -0500
>
> configs: Re-sync with CONFIG_DISTRO_DEFAULTS
>
> A number of platforms include config_distro_defaults.h but do not 
> enable
> CONFIG_DISTRO_DEFAULTS.  As they plainly intended to, set that flag 
> and
> re-sync config files.
>
> Signed-off-by: Tom Rini 
>
> Doing a revert of the above commit shrinks the SPL back down to ~7 kiB.
>
> Dinh
>

 It looks like the enablement of CONFIG_DISTRO_DEFAULTS, enables these
 configs:

 CONFIG_ISO_PARTITION=y
 CONFIG_SPL_ISO_PARTITION=y
 # CONFIG_AMIGA_PARTITION is not set
 # CONFIG_SPL_AMIGA_PARTITION is not set
 CONFIG_EFI_PARTITION=y
 CONFIG_EFI_PARTITION_ENTRIES_NUMBERS=128
 CONFIG_EFI_PARTITION_ENTRIES_OFF=0
 CONFIG_SPL_EFI_PARTITION=y
 CONFIG_PARTITION_UUIDS=y
 CONFIG_SPL_PARTITION_UUIDS=y
 # CONFIG_PARTITION_TYPE_GUID is not set

 Which is contributing to the SPL growth.

>>>
>>> Turning the following config options off subtracts 7k from the SPL:
>>>
>>> +# CONFIG_SPL_ISO_PARTITION is not set
>>> +# CONFIG_SPL_EFI_PARTITION is not set
>>>
>>> Not sure if these are needed?
>>
>> IMO not on SoCFPGA. Also CCing Tom.
> 
> Yes, all of those options are part of CONFIG_DISTRO_DEFAULTS and are
> needed so that booting from various distro media works.

In SPL on boards which usually boot from SDMMC or QSPI NOR ? How is EFI
or ISO partition needed there ?

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


Re: [U-Boot] [PATCH v3] arm64: Add SMC and HVC commands

2018-04-11 Thread Simon Glass
On 9 April 2018 at 09:17, Michalis Pappas  wrote:
> This patch adds smc and hvc commands, that allow issuing Secure Monitor
> Calls and Hypervisor Calls conforming to the ARM SMC Calling Convention.
>
> Add Kconfig items to allow each command can be individually enabled.
>
> Signed-off-by: Michalis Pappas 
> ---
>
>  cmd/Kconfig  | 14 ++
>  cmd/Makefile |  2 ++
>  cmd/smccc.c  | 72 
>  3 files changed, 88 insertions(+)
>  create mode 100644 cmd/smccc.c
>

Reviewed-by: Simon Glass 

But you need a change list
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 5/7] configs: imx6dl-mamoj: Add DFU support

2018-04-11 Thread Jagan Teki
Add DFU support for BTicino Mamoj board and update
the same steps in README.

Signed-off-by: Jagan Teki 
Signed-off-by: Simone CIANNI 
Signed-off-by: Raffaele RECALCATI 
---
 board/bticino/mamoj/README | 37 +
 configs/imx6dl_mamoj_defconfig |  2 ++
 include/configs/imx6dl-mamoj.h |  4 +++-
 3 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/board/bticino/mamoj/README b/board/bticino/mamoj/README
index eda9e45ed1..8b0e9c3e0c 100644
--- a/board/bticino/mamoj/README
+++ b/board/bticino/mamoj/README
@@ -13,6 +13,8 @@ The following methods can be used for booting Mamoj boards:
 
 1. USB SDP boot
 
+2. eMMC boot (via DFU)
+
 1. USB SDP boot:
 ---
 
@@ -55,6 +57,41 @@ The following methods can be used for booting Mamoj boards:
 
   We can see U-Boot boot from USB SDP on minicom
 
+2. eMMC boot via DFU:
+
+
+  Once booted from USB SDP, program the eMMC as below(make sure to connect USB 
OTG)
+
+  - Change eMMC partition config
+
+ => mmc partconf 2 1 0 0
+
+  - Partition eMMC on host
+
+ => ums 0 mmc 2
+
+Host will able to detect the eMMC disk as UMS, partition the same.
+
+  - Program SPL
+
+ => setenv dfu_alt_info $dfu_alt_info_spl
+ => dfu 0 mmc 2
+
+ At Host
+
+ # dfu-util -D SPL -a spl
+
+  - Program u-boot-dtb.img
+
+ => setenv dfu_alt_info $dfu_alt_info_uboot
+ => dfu 0 mmc 2
+
+ At Host
+
+ # dfu-util -D u-boot-dtb.img -a u-boot
+
+  Poweroff and Poweron the board and see U-Boot booting from eMMC.
+
 --
 Jagan Teki 
 03/12/18
diff --git a/configs/imx6dl_mamoj_defconfig b/configs/imx6dl_mamoj_defconfig
index 08272077d2..e34c2d9be3 100644
--- a/configs/imx6dl_mamoj_defconfig
+++ b/configs/imx6dl_mamoj_defconfig
@@ -15,6 +15,7 @@ CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=2
 CONFIG_SYS_PROMPT="=> "
 CONFIG_CRC32_VERIFY=y
+CONFIG_CMD_DFU=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -44,5 +45,6 @@ CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
+CONFIG_DFU_MMC=y
 CONFIG_IMX_THERMAL=y
 CONFIG_SYS_I2C_MXC=y
diff --git a/include/configs/imx6dl-mamoj.h b/include/configs/imx6dl-mamoj.h
index 929365af79..0ac238b82d 100644
--- a/include/configs/imx6dl-mamoj.h
+++ b/include/configs/imx6dl-mamoj.h
@@ -15,7 +15,7 @@
 #include "mx6_common.h"
 
 /* Size of malloc() pool */
-#define CONFIG_SYS_MALLOC_LEN  (16 * SZ_1M)
+#define CONFIG_SYS_MALLOC_LEN  (35 * SZ_1M)
 
 /* Total Size of Environment Sector */
 #define CONFIG_ENV_SIZESZ_128K
@@ -37,6 +37,8 @@
"fdt_addr_r=0x1300\0"   \
"kernel_addr_r=0x10008000\0"\
"fdt_high=0x\0" \
+   "dfu_alt_info_spl=spl raw 0x2 0x400\0" \
+   "dfu_alt_info_uboot=u-boot raw 0x8a 0x11400\0" \
BOOTENV
 
 #define BOOT_TARGET_DEVICES(func) \
-- 
2.14.3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3] arm64: Add SMC and HVC commands

2018-04-11 Thread Simon Glass
Hi,

On 11 April 2018 at 05:35, Michalis Pappas  wrote:
> Sorry for the duplicate, for some reason I thought that v3 didn't make it
> into the list. Any news on this one btw?

Is there a list of changes for the version? It says v3 but there are
no changes listed.

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 1/7] i.MX6: board: Add BTicino i.MX6DL Mamoj initial support

2018-04-11 Thread Jagan Teki
Add initial support for i.MX6DL BTicino Mamoj board.

Mamoh board added:
- SPL
- SPL_DM
- SPL_OF_CONTROL
- DM for U-Boot proper
- OF_CONTROL for U-Boot proper
- eMMC
- FEC
- Boot from eMMC
- Boot from USB SDP

Signed-off-by: Simone CIANNI 
Signed-off-by: Raffaele RECALCATI 
Signed-off-by: Jagan Teki 
---
 arch/arm/dts/Makefile |   1 +
 arch/arm/dts/imx6dl-mamoj-u-boot.dtsi |  15 
 arch/arm/dts/imx6dl-mamoj.dts |  84 +++
 arch/arm/mach-imx/mx6/Kconfig |  29 +++
 board/bticino/mamoj/Kconfig   |  12 +++
 board/bticino/mamoj/MAINTAINERS   |  10 +++
 board/bticino/mamoj/Makefile  |   8 ++
 board/bticino/mamoj/README|  60 +
 board/bticino/mamoj/mamoj.c   |  27 ++
 board/bticino/mamoj/spl.c | 154 ++
 configs/imx6dl_mamoj_defconfig|  39 +
 include/configs/imx6dl-mamoj.h|  88 +++
 12 files changed, 527 insertions(+)
 create mode 100644 arch/arm/dts/imx6dl-mamoj-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-mamoj.dts
 create mode 100644 board/bticino/mamoj/Kconfig
 create mode 100644 board/bticino/mamoj/MAINTAINERS
 create mode 100644 board/bticino/mamoj/Makefile
 create mode 100644 board/bticino/mamoj/README
 create mode 100644 board/bticino/mamoj/mamoj.c
 create mode 100644 board/bticino/mamoj/spl.c
 create mode 100644 configs/imx6dl_mamoj_defconfig
 create mode 100644 include/configs/imx6dl-mamoj.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index f03e276486..2a75711246 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -398,6 +398,7 @@ dtb-$(CONFIG_MX6QDL) += \
imx6dl-icore.dtb \
imx6dl-icore-mipi.dtb \
imx6dl-icore-rqs.dtb \
+   imx6dl-mamoj.dtb \
imx6q-cm-fx6.dtb \
imx6q-icore.dtb \
imx6q-icore-mipi.dtb \
diff --git a/arch/arm/dts/imx6dl-mamoj-u-boot.dtsi 
b/arch/arm/dts/imx6dl-mamoj-u-boot.dtsi
new file mode 100644
index 00..d4c3c0bdf0
--- /dev/null
+++ b/arch/arm/dts/imx6dl-mamoj-u-boot.dtsi
@@ -0,0 +1,15 @@
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include "imx6qdl-u-boot.dtsi"
+
+ {
+   u-boot,dm-spl;
+};
+
+_usdhc3 {
+   u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/imx6dl-mamoj.dts b/arch/arm/dts/imx6dl-mamoj.dts
new file mode 100644
index 00..068d518de3
--- /dev/null
+++ b/arch/arm/dts/imx6dl-mamoj.dts
@@ -0,0 +1,84 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2018 BTicino
+ * Copyright (C) 2018 Amarula Solutions B.V.
+ */
+
+/dts-v1/;
+
+#include 
+#include "imx6dl.dtsi"
+
+/ {
+   model = "BTicino i.MX6DL Mamoj board";
+   compatible = "bticino,imx6dl-mamoj", "fsl,imx6dl";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_enet>;
+   phy-mode = "mii";
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_uart3>;
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_usdhc3>;
+   bus-width = <8>;
+   non-removable;
+   keep-power-in-suspend;
+   status = "okay";
+};
+
+ {
+   pinctrl_enet: enetgrp {
+   fsl,pins = <
+   MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
+   MX6QDL_PAD_ENET_MDC__ENET_MDC   0x1b0b0
+   MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK0x1b0b1
+   MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0 0x1b0b0
+   MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1 0x1b0b0
+   MX6QDL_PAD_KEY_ROW2__ENET_TX_DATA2  0x1b0b0
+   MX6QDL_PAD_KEY_ROW0__ENET_TX_DATA3  0x1b0b0
+   MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN   0x1b0b0
+   MX6QDL_PAD_GPIO_19__ENET_TX_ER  0x1b0b0
+   MX6QDL_PAD_GPIO_18__ENET_RX_CLK 0x1b0b1
+   MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0 0x1b0b0
+   MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1 0x1b0b0
+   MX6QDL_PAD_KEY_COL2__ENET_RX_DATA2  0x1b0b0
+   MX6QDL_PAD_KEY_COL0__ENET_RX_DATA3  0x1b0b0
+   MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN  0x1b0b0
+   MX6QDL_PAD_ENET_RX_ER__ENET_RX_ER   0x1b0b0
+   MX6QDL_PAD_KEY_COL3__ENET_CRS   0x1b0b0
+   MX6QDL_PAD_KEY_ROW1__ENET_COL   0x1b0b0
+   >;
+   };
+
+   pinctrl_uart3: uart3grp {
+   fsl,pins = <
+   MX6QDL_PAD_EIM_D24__UART3_TX_DATA   0x1b0b1
+   MX6QDL_PAD_EIM_D25__UART3_RX_DATA   0x1b0b1
+   >;
+   };
+
+   pinctrl_usdhc3: 

[U-Boot] [PATCH v2 7/7] configs: imx6dl-mamoj: Enable HAB

2018-04-11 Thread Jagan Teki
Enable Secure boot(HAB) for BTicino Mamoj board.

Signed-off-by: Jagan Teki 
---
 configs/imx6dl_mamoj_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/imx6dl_mamoj_defconfig b/configs/imx6dl_mamoj_defconfig
index d789496dff..0001457f5d 100644
--- a/configs/imx6dl_mamoj_defconfig
+++ b/configs/imx6dl_mamoj_defconfig
@@ -49,3 +49,4 @@ CONFIG_CI_UDC=y
 CONFIG_DFU_MMC=y
 CONFIG_IMX_THERMAL=y
 CONFIG_SYS_I2C_MXC=y
+CONFIG_SECURE_BOOT=y
-- 
2.14.3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 2/7] i.MX6DL: mamoj: Add I2C support

2018-04-11 Thread Jagan Teki
i.MX6DL Mamoj has i2c3 and i2c4 buses, add support
through DM_I2C with dt definition.

i2c log:
===
=> i2c bus
Bus 2:  i2c@021a8000
Bus 3:  i2c@021f8000
=> i2c dev 2
Setting bus to 2
=> i2c speed 40
Setting bus speed to 40 Hz
=> i2c probe
Valid chip addresses: 20 51 53
=> i2c md 53 0xff
00ff: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
=> i2c md 51 0xff
00ff: a8 08 40 50 09 43 46 52 42 18 80 8e ae a9 d0 53..@P.CFRB..S
=> i2c dev 3
Setting bus to 3
=> i2c speed 10
Setting bus speed to 10 Hz
=> i2c probe
Valid chip addresses: 08 40 48 4B
=> i2c md 08 0xff
00ff: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Signed-off-by: Jagan Teki 
Signed-off-by: Simone CIANNI 
Signed-off-by: Raffaele RECALCATI 
---
 arch/arm/dts/imx6dl-mamoj.dts  | 28 
 arch/arm/mach-imx/mx6/Kconfig  |  1 +
 configs/imx6dl_mamoj_defconfig |  2 ++
 3 files changed, 31 insertions(+)

diff --git a/arch/arm/dts/imx6dl-mamoj.dts b/arch/arm/dts/imx6dl-mamoj.dts
index 068d518de3..558043445b 100644
--- a/arch/arm/dts/imx6dl-mamoj.dts
+++ b/arch/arm/dts/imx6dl-mamoj.dts
@@ -21,6 +21,20 @@
status = "okay";
 };
 
+ {
+   clock-frequency = <40>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_i2c3>;
+   status = "okay";
+};
+
+ {
+   clock-frequency = <10>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_i2c4>;
+   status = "okay";
+};
+
  {
pinctrl-names = "default";
pinctrl-0 = <_uart3>;
@@ -60,6 +74,20 @@
>;
};
 
+   pinctrl_i2c3: i2c3grp {
+   fsl,pins = <
+   MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
+   MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
+   >;
+   };
+
+   pinctrl_i2c4: i2c4grp {
+   fsl,pins = <
+   MX6QDL_PAD_GPIO_7__I2C4_SCL 0x4001b8b1
+   MX6QDL_PAD_GPIO_8__I2C4_SDA 0x4001b8b1
+   >;
+   };
+
pinctrl_uart3: uart3grp {
fsl,pins = <
MX6QDL_PAD_EIM_D24__UART3_TX_DATA   0x1b0b1
diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index c6acba7f85..5007fe3941 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -233,6 +233,7 @@ config TARGET_MX6DL_MAMOJ
select DM
select DM_ETH
select DM_GPIO
+   select DM_I2C
select DM_MMC
select DM_THERMAL
select SPL
diff --git a/configs/imx6dl_mamoj_defconfig b/configs/imx6dl_mamoj_defconfig
index e45ca9a05a..e2a18d2c30 100644
--- a/configs/imx6dl_mamoj_defconfig
+++ b/configs/imx6dl_mamoj_defconfig
@@ -12,6 +12,7 @@ CONFIG_SYS_PROMPT="=> "
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -37,3 +38,4 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_IMX_THERMAL=y
+CONFIG_SYS_I2C_MXC=y
-- 
2.14.3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 6/7] configs: imx6dl-mamoj: Add Falcon mode support

2018-04-11 Thread Jagan Teki
Add Falcon mode support to boot Linux directly after SPL.

Signed-off-by: Jagan Teki 
---
 board/bticino/mamoj/README | 27 +++
 board/bticino/mamoj/spl.c  | 11 +++
 configs/imx6dl_mamoj_defconfig |  1 +
 include/configs/imx6dl-mamoj.h | 12 
 4 files changed, 51 insertions(+)

diff --git a/board/bticino/mamoj/README b/board/bticino/mamoj/README
index 8b0e9c3e0c..5333c72537 100644
--- a/board/bticino/mamoj/README
+++ b/board/bticino/mamoj/README
@@ -15,6 +15,8 @@ The following methods can be used for booting Mamoj boards:
 
 2. eMMC boot (via DFU)
 
+3. Falcon mode
+
 1. USB SDP boot:
 ---
 
@@ -92,6 +94,31 @@ The following methods can be used for booting Mamoj boards:
 
   Poweroff and Poweron the board and see U-Boot booting from eMMC.
 
+3. Falcon mode:
+--
+
+  - Skip 10M space and create dual partitions for eMMC, start sector is 20480
+
+Partition Map for MMC device 2  --   Partition Type: DOS
+
+PartStart SectorNum Sectors UUIDType
+  1 20480   131072  c52e78be-01 83
+  2 151552  7581696 c52e78be-02 83
+
+  - Write uImage
+
+=> fatload mmc 2:1 $kernel_addr_r uImage
+=> mmc write $kernel_addr_r 0x1000 0x4000
+
+  - Write dtb and args
+
+=> setenv bootargs console=ttymxc2,115200 root=/dev/mmcblk0p2 
rootfstype=ext4 rootwait rw quiet
+=> fatload mmc 2:1 $fdt_addr_r imx6dl-mamoj.dtb
+=> spl export fdt $kernel_addr_r - $fdt_addr_r
+=> mmc write 0x1300 0x800 0x800
+
+  Poweroff and Poweron the board and see Linux booting directly after SPL.
+
 --
 Jagan Teki 
 03/12/18
diff --git a/board/bticino/mamoj/spl.c b/board/bticino/mamoj/spl.c
index 82568f7af5..531064995f 100644
--- a/board/bticino/mamoj/spl.c
+++ b/board/bticino/mamoj/spl.c
@@ -27,6 +27,17 @@ static iomux_v3_cfg_t const uart3_pads[] = {
IOMUX_PADS(PAD_EIM_D25__UART3_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
 };
 
+#ifdef CONFIG_SPL_OS_BOOT
+int spl_start_uboot(void)
+{
+   /* break into full u-boot on 'c' */
+   if (serial_tstc() && serial_getc() == 'c')
+   return 1;
+
+   return 0;
+}
+#endif
+
 static int mx6dl_dcd_table[] = {
0x020e0774, 0x000C, /* MX6_IOM_GRP_DDR_TYPE */
0x020e0754, 0x, /* MX6_IOM_GRP_DDRPKE */
diff --git a/configs/imx6dl_mamoj_defconfig b/configs/imx6dl_mamoj_defconfig
index e34c2d9be3..d789496dff 100644
--- a/configs/imx6dl_mamoj_defconfig
+++ b/configs/imx6dl_mamoj_defconfig
@@ -3,6 +3,7 @@ CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x1780
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_MX6DL_MAMOJ=y
+CONFIG_SPL_OS_BOOT=y
 # CONFIG_CMD_BMODE is not set
 CONFIG_DEFAULT_DEVICE_TREE="imx6dl-mamoj"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
diff --git a/include/configs/imx6dl-mamoj.h b/include/configs/imx6dl-mamoj.h
index 0ac238b82d..2f5e212b88 100644
--- a/include/configs/imx6dl-mamoj.h
+++ b/include/configs/imx6dl-mamoj.h
@@ -64,6 +64,18 @@
 #define CONFIG_MXC_USB_FLAGS   0
 #define CONFIG_USB_MAX_CONTROLLER_COUNT2
 
+/* Falcon */
+#define CONFIG_SPL_FS_LOAD_ARGS_NAME   "args"
+#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
+#define CONFIG_CMD_SPL
+#define CONFIG_SYS_SPL_ARGS_ADDR   0x1300
+#define CONFIG_CMD_SPL_WRITE_SIZE  (128 * SZ_1K)
+
+/* MMC support: args@1MB kernel@2MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR  0x800   /* 1MB */
+#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 
(CONFIG_CMD_SPL_WRITE_SIZE / 512)
+#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR0x1000  /* 2MB 
*/
+
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_MEMTEST_START   0x8000
 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + 0x800)
-- 
2.14.3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 4/7] configs: imx6dl_mamoj: Enable fastboot and ums

2018-04-11 Thread Jagan Teki
Enable fastboot and ums for host to interact eMMC on
Mamoj board.

Signed-off-by: Jagan Teki 
Signed-off-by: Simone CIANNI 
Signed-off-by: Raffaele RECALCATI 
---
 configs/imx6dl_mamoj_defconfig | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/configs/imx6dl_mamoj_defconfig b/configs/imx6dl_mamoj_defconfig
index 362962fdf3..08272077d2 100644
--- a/configs/imx6dl_mamoj_defconfig
+++ b/configs/imx6dl_mamoj_defconfig
@@ -8,6 +8,11 @@ CONFIG_DEFAULT_DEVICE_TREE="imx6dl-mamoj"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_HUSH_PARSER=y
+CONFIG_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x1200
+CONFIG_FASTBOOT_BUF_SIZE=0x1000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=2
 CONFIG_SYS_PROMPT="=> "
 CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MEMTEST=y
@@ -24,6 +29,7 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_PHYLIB=y
-- 
2.14.3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 3/7] i.MX6DL: mamoj: Add PFUZE100 support

2018-04-11 Thread Jagan Teki
MX6DL Mamoj boards has Freescale PFUZE100 PMIC, add support
for it through DM_PMIC dt definition.

pmic log:

=> pmic list
| Name| Parent name | Parent uclass @ seq
| pfuze100@08 | i2c@021f8000| i2c @ 3
=> pmic dev pfuze100@08
dev: 0 @ pfuze100@08
=> pmic dump
Dump pmic: pfuze100@08 registers

0x00: 10 00 00 21 00 01 3f 01 00 7f 00 00 00 00 00 81
0x10: 00 00 3f 00 00 00 00 00 00 00 00 10 00 00 00 00
0x20: 2b 2b 2b 08 c4 00 00 00 00 00 00 00 00 00 2b 2b
0x30: 2b 08 c4 00 00 72 72 72 08 d4 00 00 2c 2c 2c 08
0x40: e4 00 00 2c 2c 2c 08 e4 00 00 6f 6f 6f 08 f4 00
0x50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x60: 00 00 00 00 00 00 48 00 00 00 10 06 1e 1e 17 10
0x70: 1a 1f 00 00 00 00 00 00 00 00 00 00 00 00 00

Signed-off-by: Jagan Teki 
Signed-off-by: Simone CIANNI 
Signed-off-by: Raffaele RECALCATI 
---
 arch/arm/dts/imx6dl-mamoj.dts  | 113 +
 arch/arm/mach-imx/mx6/Kconfig  |   2 +
 configs/imx6dl_mamoj_defconfig |   1 +
 3 files changed, 116 insertions(+)

diff --git a/arch/arm/dts/imx6dl-mamoj.dts b/arch/arm/dts/imx6dl-mamoj.dts
index 558043445b..3f6d8aa4a2 100644
--- a/arch/arm/dts/imx6dl-mamoj.dts
+++ b/arch/arm/dts/imx6dl-mamoj.dts
@@ -33,6 +33,119 @@
pinctrl-names = "default";
pinctrl-0 = <_i2c4>;
status = "okay";
+
+   pmic: pfuze100@08 {
+   compatible = "fsl,pfuze100";
+   reg = <0x08>;
+
+   regulators {
+   /* CPU vdd_arm core */
+   sw1a_reg: sw1ab {
+   regulator-min-microvolt = <30>;
+   regulator-max-microvolt = <1875000>;
+   regulator-boot-on;
+   regulator-always-on;
+   regulator-ramp-delay = <6250>;
+   };
+
+   /* SOC vdd_soc */
+   sw1c_reg: sw1c {
+   regulator-min-microvolt = <30>;
+   regulator-max-microvolt = <1875000>;
+   regulator-boot-on;
+   regulator-always-on;
+   regulator-ramp-delay = <6250>;
+   };
+
+   /* I/O power GEN_3V3 */
+   sw2_reg: sw2 {
+   regulator-min-microvolt = <80>;
+   regulator-max-microvolt = <330>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   /* DDR memory */
+   sw3a_reg: sw3a {
+   regulator-min-microvolt = <40>;
+   regulator-max-microvolt = <1975000>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   /* DDR memory */
+   sw3b_reg: sw3b {
+   regulator-min-microvolt = <40>;
+   regulator-max-microvolt = <1975000>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   /* not used */
+   sw4_reg: sw4 {
+   regulator-min-microvolt = <80>;
+   regulator-max-microvolt = <330>;
+   };
+
+   /* not used */
+   swbst_reg: swbst {
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <515>;
+   };
+
+   /* PMIC vsnvs. EX boot mode */
+   snvs_reg: vsnvs {
+   regulator-min-microvolt = <100>;
+   regulator-max-microvolt = <300>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   vref_reg: vrefddr {
+   regulator-boot-on;
+   regulator-always-on;
+   };
+
+   /* not used */
+   vgen1_reg: vgen1 {
+   regulator-min-microvolt = <80>;
+   regulator-max-microvolt = <155>;
+   };
+
+   /* not used */
+   vgen2_reg: vgen2 {
+   regulator-min-microvolt = <80>;
+   regulator-max-microvolt = 

[U-Boot] [PATCH v2 0/7] i.MX6DL: Add BTicino Mamoj board support

2018-04-11 Thread Jagan Teki
This series add support for BTicino i.MX6DL Mamoj board.

Changes for v2:
- Update Kconfig changes for CONFIG_FSL_ESDHC
- Add HAB support

Jagan Teki (7):
  i.MX6: board: Add BTicino i.MX6DL Mamoj initial support
  i.MX6DL: mamoj: Add I2C support
  i.MX6DL: mamoj: Add PFUZE100 support
  configs: imx6dl_mamoj: Enable fastboot and ums
  configs: imx6dl-mamoj: Add DFU support
  configs: imx6dl-mamoj: Add Falcon mode support
  configs: imx6dl-mamoj: Enable HAB

 arch/arm/dts/Makefile |   1 +
 arch/arm/dts/imx6dl-mamoj-u-boot.dtsi |  15 +++
 arch/arm/dts/imx6dl-mamoj.dts | 225 ++
 arch/arm/mach-imx/mx6/Kconfig |  32 +
 board/bticino/mamoj/Kconfig   |  12 ++
 board/bticino/mamoj/MAINTAINERS   |  10 ++
 board/bticino/mamoj/Makefile  |   8 ++
 board/bticino/mamoj/README| 124 +++
 board/bticino/mamoj/mamoj.c   |  27 
 board/bticino/mamoj/spl.c | 165 +
 configs/imx6dl_mamoj_defconfig|  52 
 include/configs/imx6dl-mamoj.h| 102 +++
 12 files changed, 773 insertions(+)
 create mode 100644 arch/arm/dts/imx6dl-mamoj-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-mamoj.dts
 create mode 100644 board/bticino/mamoj/Kconfig
 create mode 100644 board/bticino/mamoj/MAINTAINERS
 create mode 100644 board/bticino/mamoj/Makefile
 create mode 100644 board/bticino/mamoj/README
 create mode 100644 board/bticino/mamoj/mamoj.c
 create mode 100644 board/bticino/mamoj/spl.c
 create mode 100644 configs/imx6dl_mamoj_defconfig
 create mode 100644 include/configs/imx6dl-mamoj.h

-- 
2.14.3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 4/4] ARM: i.MX6: dts: Build dtb based on SOC type

2018-04-11 Thread Jagan Teki
Build dtb's based on SOC type instead building arch type.

Signed-off-by: Jagan Teki 
---
 arch/arm/dts/Makefile | 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 62fbf32a62..f03e276486 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -394,9 +394,7 @@ dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
 
 dtb-$(CONFIG_MX53) += imx53-cx9020.dtb
 
-dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb \
-   imx6sl-evk.dtb \
-   imx6sll-evk.dtb \
+dtb-$(CONFIG_MX6QDL) += \
imx6dl-icore.dtb \
imx6dl-icore-mipi.dtb \
imx6dl-icore-rqs.dtb \
@@ -404,14 +402,24 @@ dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb \
imx6q-icore.dtb \
imx6q-icore-mipi.dtb \
imx6q-icore-rqs.dtb \
-   imx6q-logicpd.dtb \
+   imx6q-logicpd.dtb
+
+dtb-$(CONFIG_MX6SL) += imx6sl-evk.dtb
+
+dtb-$(CONFIG_MX6SL) += imx6sll-evk.dtb
+
+dtb-$(CONFIG_MX6SX) += \
imx6sx-sabreauto.dtb \
-   imx6sx-sdb.dtb \
+   imx6sx-sdb.dtb
+
+dtb-$(CONFIG_MX6UL) += \
imx6ul-geam-kit.dtb \
imx6ul-isiot-emmc.dtb \
imx6ul-isiot-nand.dtb \
imx6ul-opos6uldev.dtb
 
+dtb-$(CONFIG_MX6ULL) += imx6ull-14x14-evk.dtb
+
 dtb-$(CONFIG_MX7) += imx7-colibri.dtb \
imx7d-sdb.dtb
 
-- 
2.14.3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 1/4] ARM: dts: i.MX6QDL: U-Boot specific dts for u-boot, dm-spl

2018-04-11 Thread Jagan Teki
u-boot,dm-spl property is specific to U-Boot, so move it into
*u-boot.dtsi files for relevant i.MX6QDL files.

This make syncing Linux dts files straight forward.

Also update the MAINTAINERS file for dts files.

Signed-off-by: Jagan Teki 
---
 arch/arm/dts/imx6dl-icore-mipi-u-boot.dtsi | 11 +++
 arch/arm/dts/imx6dl-icore-mipi.dts |  1 -
 arch/arm/dts/imx6dl-icore-rqs-u-boot.dtsi  |  7 +++
 arch/arm/dts/imx6dl-icore-u-boot.dtsi  |  7 +++
 arch/arm/dts/imx6q-icore-mipi-u-boot.dtsi  | 11 +++
 arch/arm/dts/imx6q-icore-mipi.dts  |  1 -
 arch/arm/dts/imx6q-icore-rqs-u-boot.dtsi   |  7 +++
 arch/arm/dts/imx6q-icore-u-boot.dtsi   |  7 +++
 arch/arm/dts/imx6qdl-icore-rqs-u-boot.dtsi | 23 +++
 arch/arm/dts/imx6qdl-icore-rqs.dtsi|  4 
 arch/arm/dts/imx6qdl-icore-u-boot.dtsi | 19 +++
 arch/arm/dts/imx6qdl-icore.dtsi|  3 ---
 arch/arm/dts/imx6qdl-u-boot.dtsi   | 27 +++
 arch/arm/dts/imx6qdl.dtsi  |  5 -
 board/engicam/imx6q/MAINTAINERS| 11 ++-
 15 files changed, 129 insertions(+), 15 deletions(-)
 create mode 100644 arch/arm/dts/imx6dl-icore-mipi-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-icore-rqs-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-icore-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-icore-mipi-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-icore-rqs-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-icore-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-icore-rqs-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-icore-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-u-boot.dtsi

diff --git a/arch/arm/dts/imx6dl-icore-mipi-u-boot.dtsi 
b/arch/arm/dts/imx6dl-icore-mipi-u-boot.dtsi
new file mode 100644
index 00..86e8da761d
--- /dev/null
+++ b/arch/arm/dts/imx6dl-icore-mipi-u-boot.dtsi
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include "imx6qdl-icore-u-boot.dtsi"
+
+ {
+   u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/imx6dl-icore-mipi.dts 
b/arch/arm/dts/imx6dl-icore-mipi.dts
index 3a444c0d98..39bdf2d55b 100644
--- a/arch/arm/dts/imx6dl-icore-mipi.dts
+++ b/arch/arm/dts/imx6dl-icore-mipi.dts
@@ -16,6 +16,5 @@
 };
 
  {
-   u-boot,dm-spl;
status = "okay";
 };
diff --git a/arch/arm/dts/imx6dl-icore-rqs-u-boot.dtsi 
b/arch/arm/dts/imx6dl-icore-rqs-u-boot.dtsi
new file mode 100644
index 00..210b930264
--- /dev/null
+++ b/arch/arm/dts/imx6dl-icore-rqs-u-boot.dtsi
@@ -0,0 +1,7 @@
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include "imx6qdl-icore-rqs-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6dl-icore-u-boot.dtsi 
b/arch/arm/dts/imx6dl-icore-u-boot.dtsi
new file mode 100644
index 00..5bd3df96f5
--- /dev/null
+++ b/arch/arm/dts/imx6dl-icore-u-boot.dtsi
@@ -0,0 +1,7 @@
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include "imx6qdl-icore-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6q-icore-mipi-u-boot.dtsi 
b/arch/arm/dts/imx6q-icore-mipi-u-boot.dtsi
new file mode 100644
index 00..86e8da761d
--- /dev/null
+++ b/arch/arm/dts/imx6q-icore-mipi-u-boot.dtsi
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include "imx6qdl-icore-u-boot.dtsi"
+
+ {
+   u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/imx6q-icore-mipi.dts 
b/arch/arm/dts/imx6q-icore-mipi.dts
index 527f52c886..e7c5616a63 100644
--- a/arch/arm/dts/imx6q-icore-mipi.dts
+++ b/arch/arm/dts/imx6q-icore-mipi.dts
@@ -16,6 +16,5 @@
 };
 
  {
-   u-boot,dm-spl;
status = "okay";
 };
diff --git a/arch/arm/dts/imx6q-icore-rqs-u-boot.dtsi 
b/arch/arm/dts/imx6q-icore-rqs-u-boot.dtsi
new file mode 100644
index 00..210b930264
--- /dev/null
+++ b/arch/arm/dts/imx6q-icore-rqs-u-boot.dtsi
@@ -0,0 +1,7 @@
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include "imx6qdl-icore-rqs-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6q-icore-u-boot.dtsi 
b/arch/arm/dts/imx6q-icore-u-boot.dtsi
new file mode 100644
index 00..5bd3df96f5
--- /dev/null
+++ b/arch/arm/dts/imx6q-icore-u-boot.dtsi
@@ -0,0 +1,7 @@
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include "imx6qdl-icore-u-boot.dtsi"
diff --git a/arch/arm/dts/imx6qdl-icore-rqs-u-boot.dtsi 
b/arch/arm/dts/imx6qdl-icore-rqs-u-boot.dtsi
new file mode 100644
index 00..458debfbab
--- /dev/null
+++ b/arch/arm/dts/imx6qdl-icore-rqs-u-boot.dtsi
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ *
+ * 

[U-Boot] [PATCH v4 3/4] ARM: dts: i.MX6UL: U-Boot specific dts for u-boot, dm-spl

2018-04-11 Thread Jagan Teki
u-boot,dm-spl property is specific to U-Boot, so move it into
*u-boot.dtsi files for relevant i.MX6UL files.

This make syncing Linux dts files straight forward.

Also update the MAINTAINERS file for dts files.

Signed-off-by: Jagan Teki 
---
 arch/arm/dts/imx6ul-geam-kit-u-boot.dtsi   | 25 
 arch/arm/dts/imx6ul-geam-kit.dts   |  4 
 arch/arm/dts/imx6ul-isiot-emmc-u-boot.dtsi | 11 +++
 arch/arm/dts/imx6ul-isiot-emmc.dts |  1 +
 arch/arm/dts/imx6ul-isiot-nand.dts |  1 +
 arch/arm/dts/imx6ul-isiot-u-boot.dtsi  | 19 ++
 arch/arm/dts/imx6ul-isiot.dtsi |  3 ---
 arch/arm/dts/imx6ul-u-boot.dtsi| 31 ++
 arch/arm/dts/imx6ul.dtsi   |  6 --
 board/engicam/imx6ul/MAINTAINERS   |  5 +
 10 files changed, 93 insertions(+), 13 deletions(-)
 create mode 100644 arch/arm/dts/imx6ul-geam-kit-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6ul-isiot-emmc-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6ul-isiot-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6ul-u-boot.dtsi

diff --git a/arch/arm/dts/imx6ul-geam-kit-u-boot.dtsi 
b/arch/arm/dts/imx6ul-geam-kit-u-boot.dtsi
new file mode 100644
index 00..d1b77ba295
--- /dev/null
+++ b/arch/arm/dts/imx6ul-geam-kit-u-boot.dtsi
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include "imx6ul-u-boot.dtsi"
+
+ {
+   u-boot,dm-spl;
+};
+
+ {
+   pinctrl_usdhc1: usdhc1grp {
+   u-boot,dm-spl;
+   };
+
+   pinctrl_usdhc1_100mhz: usdhc1grp100mhz {
+   u-boot,dm-spl;
+   };
+
+   pinctrl_usdhc1_200mhz: usdhc1grp200mhz {
+   u-boot,dm-spl;
+   };
+};
diff --git a/arch/arm/dts/imx6ul-geam-kit.dts b/arch/arm/dts/imx6ul-geam-kit.dts
index 15e3f94153..07c21cb0a2 100644
--- a/arch/arm/dts/imx6ul-geam-kit.dts
+++ b/arch/arm/dts/imx6ul-geam-kit.dts
@@ -87,7 +87,6 @@
 };
 
  {
-   u-boot,dm-spl;
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <_usdhc1>;
pinctrl-1 = <_usdhc1_100mhz>;
@@ -135,7 +134,6 @@
};
 
pinctrl_usdhc1: usdhc1grp {
-   u-boot,dm-spl;
fsl,pins = <
MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x17059
MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x10059
@@ -147,7 +145,6 @@
};
 
pinctrl_usdhc1_100mhz: usdhc1grp100mhz {
-   u-boot,dm-spl;
fsl,pins = <
MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x170b9
MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x100b9
@@ -159,7 +156,6 @@
};
 
pinctrl_usdhc1_200mhz: usdhc1grp200mhz {
-   u-boot,dm-spl;
fsl,pins = <
MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x170f9
MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x100f9
diff --git a/arch/arm/dts/imx6ul-isiot-emmc-u-boot.dtsi 
b/arch/arm/dts/imx6ul-isiot-emmc-u-boot.dtsi
new file mode 100644
index 00..7d0cc154cf
--- /dev/null
+++ b/arch/arm/dts/imx6ul-isiot-emmc-u-boot.dtsi
@@ -0,0 +1,11 @@
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include "imx6ul-isiot-u-boot.dtsi"
+
+ {
+   u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/imx6ul-isiot-emmc.dts 
b/arch/arm/dts/imx6ul-isiot-emmc.dts
index 588bebac47..50ce2d798e 100644
--- a/arch/arm/dts/imx6ul-isiot-emmc.dts
+++ b/arch/arm/dts/imx6ul-isiot-emmc.dts
@@ -42,6 +42,7 @@
 
 /dts-v1/;
 
+#include "imx6ul.dtsi"
 #include "imx6ul-isiot.dtsi"
 
 / {
diff --git a/arch/arm/dts/imx6ul-isiot-nand.dts 
b/arch/arm/dts/imx6ul-isiot-nand.dts
index 12a3528428..ffdaf34efb 100644
--- a/arch/arm/dts/imx6ul-isiot-nand.dts
+++ b/arch/arm/dts/imx6ul-isiot-nand.dts
@@ -42,6 +42,7 @@
 
 /dts-v1/;
 
+#include "imx6ul.dtsi"
 #include "imx6ul-isiot.dtsi"
 
 / {
diff --git a/arch/arm/dts/imx6ul-isiot-u-boot.dtsi 
b/arch/arm/dts/imx6ul-isiot-u-boot.dtsi
new file mode 100644
index 00..f98c395747
--- /dev/null
+++ b/arch/arm/dts/imx6ul-isiot-u-boot.dtsi
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2018 Jagan Teki 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include "imx6ul-u-boot.dtsi"
+
+ {
+   u-boot,dm-spl;
+};
+
+_usdhc1 {
+   u-boot,dm-spl;
+};
+
+_usdhc2 {
+   u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/imx6ul-isiot.dtsi b/arch/arm/dts/imx6ul-isiot.dtsi
index e645c1265f..4ed7313683 100644
--- a/arch/arm/dts/imx6ul-isiot.dtsi
+++ b/arch/arm/dts/imx6ul-isiot.dtsi
@@ -42,7 +42,6 @@
 
 #include 
 #include 
-#include "imx6ul.dtsi"
 
 / {
memory {
@@ -82,7 +81,6 @@
 };
 
  {
-   u-boot,dm-spl;
pinctrl-names = "default";
pinctrl-0 = <_usdhc1>;
cd-gpios = < 19 GPIO_ACTIVE_LOW>;
@@ -138,7 +136,6 @@
   

[U-Boot] [PATCH v4 2/4] ARM: dts: imx6ul-isiot: Move usdhc2 into dtsi

2018-04-11 Thread Jagan Teki
Move usdhc2 node along with pinctrl to imx6ul-isiot.dts
from imx6ul-isiot-emmc.dts

Signed-off-by: Jagan Teki 
---
 arch/arm/dts/imx6ul-isiot-emmc.dts | 24 
 arch/arm/dts/imx6ul-isiot.dtsi | 26 ++
 2 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/arch/arm/dts/imx6ul-isiot-emmc.dts 
b/arch/arm/dts/imx6ul-isiot-emmc.dts
index a611e3bba5..588bebac47 100644
--- a/arch/arm/dts/imx6ul-isiot-emmc.dts
+++ b/arch/arm/dts/imx6ul-isiot-emmc.dts
@@ -51,29 +51,5 @@
 
  {
u-boot,dm-spl;
-   pinctrl-names = "default";
-   pinctrl-0 = <_usdhc2>;
-   cd-gpios = < 5 GPIO_ACTIVE_LOW>;
-   bus-width = <8>;
-   no-1-8-v;
status = "okay";
 };
-
- {
-   pinctrl_usdhc2: usdhc2grp {
-   u-boot,dm-spl;
-   fsl,pins = <
-   MX6UL_PAD_NAND_RE_B__USDHC2_CLK  0x17070
-   MX6UL_PAD_NAND_WE_B__USDHC2_CMD  0x10070
-   MX6UL_PAD_NAND_DATA00__USDHC2_DATA0  0x17070
-   MX6UL_PAD_NAND_DATA01__USDHC2_DATA1  0x17070
-   MX6UL_PAD_NAND_DATA02__USDHC2_DATA2  0x17070
-   MX6UL_PAD_NAND_DATA03__USDHC2_DATA3  0x17070
-   MX6UL_PAD_NAND_DATA04__USDHC2_DATA4  0x17070
-   MX6UL_PAD_NAND_DATA05__USDHC2_DATA5  0x17070
-   MX6UL_PAD_NAND_DATA06__USDHC2_DATA6  0x17070
-   MX6UL_PAD_NAND_DATA07__USDHC2_DATA7  0x17070
-   MX6UL_PAD_NAND_ALE__USDHC2_RESET_B   0x17070
-   >;
-   };
-};
diff --git a/arch/arm/dts/imx6ul-isiot.dtsi b/arch/arm/dts/imx6ul-isiot.dtsi
index 5007a88f45..e645c1265f 100644
--- a/arch/arm/dts/imx6ul-isiot.dtsi
+++ b/arch/arm/dts/imx6ul-isiot.dtsi
@@ -91,6 +91,15 @@
status = "okay";
 };
 
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_usdhc2>;
+   cd-gpios = < 5 GPIO_ACTIVE_LOW>;
+   bus-width = <8>;
+   no-1-8-v;
+   status = "disabled";
+};
+
  {
pinctrl_enet1: enet1grp {
fsl,pins = <
@@ -139,4 +148,21 @@
MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x17059
>;
};
+
+   pinctrl_usdhc2: usdhc2grp {
+   u-boot,dm-spl;
+   fsl,pins = <
+   MX6UL_PAD_NAND_RE_B__USDHC2_CLK  0x17070
+   MX6UL_PAD_NAND_WE_B__USDHC2_CMD  0x10070
+   MX6UL_PAD_NAND_DATA00__USDHC2_DATA0  0x17070
+   MX6UL_PAD_NAND_DATA01__USDHC2_DATA1  0x17070
+   MX6UL_PAD_NAND_DATA02__USDHC2_DATA2  0x17070
+   MX6UL_PAD_NAND_DATA03__USDHC2_DATA3  0x17070
+   MX6UL_PAD_NAND_DATA04__USDHC2_DATA4  0x17070
+   MX6UL_PAD_NAND_DATA05__USDHC2_DATA5  0x17070
+   MX6UL_PAD_NAND_DATA06__USDHC2_DATA6  0x17070
+   MX6UL_PAD_NAND_DATA07__USDHC2_DATA7  0x17070
+   MX6UL_PAD_NAND_ALE__USDHC2_RESET_B   0x17070
+   >;
+   };
 };
-- 
2.14.3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 0/4] ARM: i.MX6: Add u-boot dtsi files

2018-04-11 Thread Jagan Teki
All CONFIG changes from arch/arm/mach-imx fromprevious version [1]
since most of them won't agree with new naming convention that sync
with Linux.

This series add rest of changes like u-boot dtsi files for U-Boot
definitions and arch/arm/boot/Makefile changes wrt imx.

Changes for v4:
- Drop patches related to CONFIG changes on arch/arm/mach-imx
- Revised and rebased on master

Changes for v3:
- Drop patch "Change SYS_SOC from mx6 to imx6"

Changes for v2:
- Add new patch "ARM: dts: imx6ul-isiot: Move usdhc2 into dtsi"
- Fixed *u-boot.dtsi files
- Fixed board/logicpd/imx6/mx6q_2x_MT41K512M16HA.cfg to use imx6

[1] https://patchwork.ozlabs.org/cover/890931/

Jagan Teki (4):
  ARM: dts: i.MX6QDL: U-Boot specific dts for u-boot,dm-spl
  ARM: dts: imx6ul-isiot: Move usdhc2 into dtsi
  ARM: dts: i.MX6UL: U-Boot specific dts for u-boot,dm-spl
  ARM: i.MX6: dts: Build dtb based on SOC type

 arch/arm/dts/Makefile  | 18 -
 arch/arm/dts/imx6dl-icore-mipi-u-boot.dtsi | 11 +++
 arch/arm/dts/imx6dl-icore-mipi.dts |  1 -
 arch/arm/dts/imx6dl-icore-rqs-u-boot.dtsi  |  7 +++
 arch/arm/dts/imx6dl-icore-u-boot.dtsi  |  7 +++
 arch/arm/dts/imx6q-icore-mipi-u-boot.dtsi  | 11 +++
 arch/arm/dts/imx6q-icore-mipi.dts  |  1 -
 arch/arm/dts/imx6q-icore-rqs-u-boot.dtsi   |  7 +++
 arch/arm/dts/imx6q-icore-u-boot.dtsi   |  7 +++
 arch/arm/dts/imx6qdl-icore-rqs-u-boot.dtsi | 23 ++
 arch/arm/dts/imx6qdl-icore-rqs.dtsi|  4 
 arch/arm/dts/imx6qdl-icore-u-boot.dtsi | 19 ++
 arch/arm/dts/imx6qdl-icore.dtsi|  3 ---
 arch/arm/dts/imx6qdl-u-boot.dtsi   | 27 ++
 arch/arm/dts/imx6qdl.dtsi  |  5 -
 arch/arm/dts/imx6ul-geam-kit-u-boot.dtsi   | 25 
 arch/arm/dts/imx6ul-geam-kit.dts   |  4 
 arch/arm/dts/imx6ul-isiot-emmc-u-boot.dtsi | 11 +++
 arch/arm/dts/imx6ul-isiot-emmc.dts | 25 +---
 arch/arm/dts/imx6ul-isiot-nand.dts |  1 +
 arch/arm/dts/imx6ul-isiot-u-boot.dtsi  | 19 ++
 arch/arm/dts/imx6ul-isiot.dtsi | 29 +---
 arch/arm/dts/imx6ul-u-boot.dtsi| 31 ++
 arch/arm/dts/imx6ul.dtsi   |  6 --
 board/engicam/imx6q/MAINTAINERS| 11 ++-
 board/engicam/imx6ul/MAINTAINERS   |  5 +
 26 files changed, 261 insertions(+), 57 deletions(-)
 create mode 100644 arch/arm/dts/imx6dl-icore-mipi-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-icore-rqs-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6dl-icore-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-icore-mipi-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-icore-rqs-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6q-icore-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-icore-rqs-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-icore-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6qdl-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6ul-geam-kit-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6ul-isiot-emmc-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6ul-isiot-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx6ul-u-boot.dtsi

-- 
2.14.3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] arm: socfpga: unable to boot cyclone5 devkit or SocKit

2018-04-11 Thread Tom Rini
On Wed, Apr 11, 2018 at 10:12:42AM +0200, Marek Vasut wrote:
> On 04/11/2018 04:52 AM, Dinh Nguyen wrote:
> [...]
> 
>  u-boot$ git reset --hard v2018.01 ; bu socfpga_cyclone5 ; ls -la
>  spl/u-boot-spl.bin
>  HEAD is now at f3dd87e0b9 Prepare v2018.01
>  -rw-r--r-- 1 marex marex 52902 Apr 11 00:34 spl/u-boot-spl.bin
> 
>  u-boot$ git reset --hard v2018.03 ; bu socfpga_cyclone5 ; ls -la
>  spl/u-boot-spl.bin
>  HEAD is now at f95ab1fb6e Prepare v2018.03
>  -rw-r--r-- 1 marex marex 59706 Apr 11 00:34 spl/u-boot-spl.bin
> 
>  Try bisecting out the commit which caused this 7 kiB growth between
>  2018.01 and 2018.03 . Even those 53 kiB are quite borderline, but it was
>  at 53 kiB for a while (2017.05 is also ~53 kiB)

Do you have a size constraint and are not setting the correct CONFIG
options so that it becomes a build failure?

> >>> Doing the bisect points me to this commit:
> >>>
> >>> commit fa2c14676c7c6f3115dd4d9b2a4cc3b35c3ad2a2
> >>> Author: Tom Rini 
> >>> Date:   Sat Feb 10 16:54:38 2018 -0500
> >>>
> >>> configs: Re-sync with CONFIG_DISTRO_DEFAULTS
> >>>
> >>> A number of platforms include config_distro_defaults.h but do not 
> >>> enable
> >>> CONFIG_DISTRO_DEFAULTS.  As they plainly intended to, set that flag 
> >>> and
> >>> re-sync config files.
> >>>
> >>> Signed-off-by: Tom Rini 
> >>>
> >>> Doing a revert of the above commit shrinks the SPL back down to ~7 kiB.
> >>>
> >>> Dinh
> >>>
> >>
> >> It looks like the enablement of CONFIG_DISTRO_DEFAULTS, enables these
> >> configs:
> >>
> >> CONFIG_ISO_PARTITION=y
> >> CONFIG_SPL_ISO_PARTITION=y
> >> # CONFIG_AMIGA_PARTITION is not set
> >> # CONFIG_SPL_AMIGA_PARTITION is not set
> >> CONFIG_EFI_PARTITION=y
> >> CONFIG_EFI_PARTITION_ENTRIES_NUMBERS=128
> >> CONFIG_EFI_PARTITION_ENTRIES_OFF=0
> >> CONFIG_SPL_EFI_PARTITION=y
> >> CONFIG_PARTITION_UUIDS=y
> >> CONFIG_SPL_PARTITION_UUIDS=y
> >> # CONFIG_PARTITION_TYPE_GUID is not set
> >>
> >> Which is contributing to the SPL growth.
> >>
> > 
> > Turning the following config options off subtracts 7k from the SPL:
> > 
> > +# CONFIG_SPL_ISO_PARTITION is not set
> > +# CONFIG_SPL_EFI_PARTITION is not set
> > 
> > Not sure if these are needed?
> 
> IMO not on SoCFPGA. Also CCing Tom.

Yes, all of those options are part of CONFIG_DISTRO_DEFAULTS and are
needed so that booting from various distro media works.

-- 
Tom


signature.asc
Description: PGP signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH V3 3/3] imx6: sabrelite: update defconfig to use distro defaults

2018-04-11 Thread Guillaume GARDET
Boot tested with boot.scr script and EFI/Grub2 on mmc0 and mmc1 slots on 
sabrelite board.

Signed-off-by: Guillaume GARDET 
Cc: Troy Kisky 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Gary Bisson 

---
 configs/mx6qsabrelite_defconfig | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig
index 7499704058..fee33cfff1 100644
--- a/configs/mx6qsabrelite_defconfig
+++ b/configs/mx6qsabrelite_defconfig
@@ -3,15 +3,15 @@ CONFIG_ARCH_MX6=y
 CONFIG_SYS_TEXT_BASE=0x1780
 CONFIG_TARGET_NITROGEN6X=y
 CONFIG_CMD_HDMIDETECT=y
+CONFIG_DISTRO_DEFAULTS=y
 
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,SABRELITE"
 CONFIG_BOOTDELAY=3
+# CONFIG_USE_BOOTCOMMAND is not set
 CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y
-CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_ARCH_MISC_INIT=y
 CONFIG_BOARD_EARLY_INIT_F=y
-CONFIG_HUSH_PARSER=y
 CONFIG_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x1200
-CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_MEMTEST=y
 CONFIG_SYS_ALT_MEMTEST=y
 # CONFIG_CMD_FLASH is not set
@@ -22,17 +22,12 @@ CONFIG_CMD_SATA=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MII=y
-CONFIG_CMD_PING=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
-CONFIG_CMD_EXT2=y
-CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
-CONFIG_CMD_FAT=y
-CONFIG_CMD_FS_GENERIC=y
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
 CONFIG_DWC_AHSATA=y
-- 
2.13.6

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH V3 2/3] imx6: Convert sabrelite and nitrogen6x boards to distro boot support

2018-04-11 Thread Guillaume GARDET
Boot tested on sabrelite board.

Signed-off-by: Guillaume GARDET 
Cc: Troy Kisky 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Gary Bisson 

---
 include/configs/nitrogen6x.h | 180 +--
 1 file changed, 54 insertions(+), 126 deletions(-)

diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 7d2cf0bd8c..589c5b1ae8 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -101,140 +101,68 @@
 #define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC CONFIG_DRIVE_USB
 #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
 
+#ifdef CONFIG_CMD_MMC
+#define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
+#else
+#define DISTRO_BOOT_DEV_MMC(func)
+#endif
+
+#ifdef CONFIG_CMD_SATA
+#define DISTRO_BOOT_DEV_SATA(func) func(SATA, sata, 0)
+#else
+#define DISTRO_BOOT_DEV_SATA(func)
+#endif
+
+#ifdef CONFIG_USB_STORAGE
+#define DISTRO_BOOT_DEV_USB(func) func(USB, usb, 0)
+#else
+#define DISTRO_BOOT_DEV_USB(func)
+#endif
+
+#ifdef CONFIG_CMD_PXE
+#define DISTRO_BOOT_DEV_PXE(func) func(PXE, pxe, na)
+#else
+#define DISTRO_BOOT_DEV_PXE(func)
+#endif
+
+#ifdef CONFIG_CMD_DHCP
+#define DISTRO_BOOT_DEV_DHCP(func) func(DHCP, dhcp, na)
+#else
+#define DISTRO_BOOT_DEV_DHCP(func)
+#endif
+
+
 #if defined(CONFIG_SABRELITE)
+#define FDTFILE "fdtfile=imx6q-sabrelite.dtb\0"
+#else 
+/* fdtfile depends on nitrogen6x board used, so leave it to config distro 
fallback */
+#define FDTFILE
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+   DISTRO_BOOT_DEV_MMC(func) \
+   DISTRO_BOOT_DEV_SATA(func) \
+   DISTRO_BOOT_DEV_USB(func) \
+   DISTRO_BOOT_DEV_PXE(func) \
+   DISTRO_BOOT_DEV_DHCP(func)
+
+#include 
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   "script=boot.scr\0" \
-   "uimage=uImage\0" \
"console=ttymxc1\0" \
"fdt_high=0x\0" \
"initrd_high=0x\0" \
-   "fdt_file=imx6q-sabrelite.dtb\0" \
-   "fdt_addr=0x1800\0" \
-   "boot_fdt=try\0" \
+   "fdt_addr_r=0x1800\0" \
+   FDTFILE \
+   "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0"  \
+   "pxefile_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
+   "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
+   "ramdisk_addr_r=0x1300\0" \
+   "ramdiskaddr=0x1300\0" \
"ip_dyn=yes\0" \
"usb_pgood_delay=2000\0" \
-   "mmcdevs=0 1\0" \
-   "mmcpart=1\0" \
-   "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
-   "mmcargs=setenv bootargs console=${console},${baudrate} " \
-   "root=${mmcroot}\0" \
-   "loadbootscript=" \
-   "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
-   "bootscript=echo Running bootscript from mmc ...; " \
-   "source\0" \
-   "loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
-   "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
-   "mmcboot=echo Booting from mmc ...; " \
-   "run mmcargs; " \
-   "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-   "if run loadfdt; then " \
-   "bootm ${loadaddr} - ${fdt_addr}; " \
-   "else " \
-   "if test ${boot_fdt} = try; then " \
-   "bootm; " \
-   "else " \
-   "echo WARN: Cannot load the DT; " \
-   "fi; " \
-   "fi; " \
-   "else " \
-   "bootm; " \
-   "fi;\0" \
-   "netargs=setenv bootargs console=${console},${baudrate} " \
-   "root=/dev/nfs " \
-   "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
-   "netboot=echo Booting from net ...; " \
-   "run netargs; " \
-   "if test ${ip_dyn} = yes; then " \
-   "setenv get_cmd dhcp; " \
-   "else " \
-   "setenv get_cmd tftp; " \
-   "fi; " \
-   "${get_cmd} ${uimage}; " \
-   "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-   "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
-   "bootm ${loadaddr} - ${fdt_addr}; " \
-   "else " \
-   "if test ${boot_fdt} = try; then " \
-   "bootm; " \
-   "else " \
-   "echo WARN: Cannot load the DT; " \
-   "fi; " \
-   "fi; " \
-   "else " \
-   "bootm; " \
-   "fi;\0"
-
-#define CONFIG_BOOTCOMMAND \
-   "for 

[U-Boot] [PATCH V3 1/3] imx6: Define 'soc' env var for imx6 SoC

2018-04-11 Thread Guillaume GARDET
Signed-off-by: Guillaume GARDET 
Cc: Troy Kisky 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Gary Bisson 

---
 arch/arm/mach-imx/mx6/soc.c | 34 ++
 1 file changed, 34 insertions(+)

diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
index 9b3d8f69b2..c4cb752c76 100644
--- a/arch/arm/mach-imx/mx6/soc.c
+++ b/arch/arm/mach-imx/mx6/soc.c
@@ -446,6 +446,40 @@ int arch_cpu_init(void)
return 0;
 }
 
+ #ifdef CONFIG_ARCH_MISC_INIT
+ int arch_misc_init(void)
+ {
+ #ifdef CONFIG_ENV_VARS_UBOOT_CONFIG
+   if (is_cpu_type(MXC_CPU_MX6QP))
+   env_set("soc", "imx6qp");
+   else if (is_cpu_type(MXC_CPU_MX6Q))
+   env_set("soc", "imx6q");
+   else if (is_cpu_type(MXC_CPU_MX6DP))
+   env_set("soc", "imx6dp");
+   else if (is_cpu_type(MXC_CPU_MX6D))
+   env_set("soc", "imx6d");
+   else if (is_mx6dl( ))
+   env_set("soc", "imx6dl");
+   else if (is_mx6sx( ))
+   env_set("soc", "imx6sx");
+   else if (is_mx6sl( ))
+   env_set("soc", "imx6sl");
+   else if (is_mx6solo( ))
+   env_set("soc", "imx6solo");
+   else if (is_mx6ul( ))
+   env_set("soc", "imx6ul");
+   else if (is_mx6ull( ))
+   env_set("soc", "imx6ull");
+   else if (is_mx6sll( ))
+   env_set("soc", "imx6sll");
+   else
+   env_set("soc", "imx6");
+ #endif
+
+   return 0;
+ }
+ #endif
+
 #ifdef CONFIG_ENV_IS_IN_MMC
 __weak int board_mmc_get_env_dev(int devno)
 {
-- 
2.13.6

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH V3 0/3] Update sabrelite and nitrogen6x boards to use distro boot support

2018-04-11 Thread Guillaume GARDET
This patch serie updates sabrelite and nitrogen6x boards to use distro boot 
support.
Sabrelite has been boot tested with boot.scr script and EFI/Grub2 on mmc0 and 
mmc1 slots.
Nitrogen6* boards have been build tested only.

Signed-off-by: Guillaume GARDET 
Cc: Troy Kisky 
Cc: Stefano Babic 
Cc: Fabio Estevam 
Cc: Gary Bisson 

Changes in V3:
  * Add imx6 soc definition
  * Also update nitrogen6x config, not only sabrelite
  * Split mx6qsabrelite_defconfig update to a separate patch
Changes in V2:
  * add mx6qsabrelite_defconfig update

Guillaume GARDET (3):
  imx6: Define 'soc' env var for imx6 SoC
  imx6: Convert sabrelite and nitrogen6x boards to distro boot support
  imx6: sabrelite: update defconfig to use distro defaults

 arch/arm/mach-imx/mx6/soc.c |  34 
 configs/mx6qsabrelite_defconfig |  15 ++--
 include/configs/nitrogen6x.h| 180 
 3 files changed, 93 insertions(+), 136 deletions(-)

-- 
2.13.6

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3] arm64: Add SMC and HVC commands

2018-04-11 Thread Michalis Pappas
Sorry for the duplicate, for some reason I thought that v3 didn't make 
it into the list. Any news on this one btw?



On 04/11/2018 12:30 PM, Michalis Pappas wrote:

This patch adds smc and hvc commands, that allow issuing Secure Monitor
Calls and Hypervisor Calls conforming to the ARM SMC Calling Convention.

Add Kconfig items to allow each command can be individually enabled.

Signed-off-by: Michalis Pappas 
---

  cmd/Kconfig  | 14 ++
  cmd/Makefile |  2 ++
  cmd/smccc.c  | 72 
  3 files changed, 88 insertions(+)
  create mode 100644 cmd/smccc.c

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 136836d146..2176b98ccb 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1348,6 +1348,20 @@ config CMD_HASH
  saved to memory or to an environment variable. It is also possible
  to verify a hash against data in memory.

+config CMD_HVC
+   bool "Support the 'hvc' command"
+   depends on ARM_SMCCC
+   help
+ Allows issuing Hypervisor Calls (HVCs). Mostly useful for
+ development and testing.
+
+config CMD_SMC
+   bool "Support the 'smc' command"
+   depends on ARM_SMCCC
+   help
+ Allows issuing Secure Monitor Calls (SMCs). Mostly useful for
+ development and testing.
+
  config HASH_VERIFY
bool "hash -v"
depends on CMD_HASH
diff --git a/cmd/Makefile b/cmd/Makefile
index 9a358e4801..5656a1a40a 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -61,6 +61,7 @@ obj-$(CONFIG_CMD_FS_GENERIC) += fs.o
  obj-$(CONFIG_CMD_FUSE) += fuse.o
  obj-$(CONFIG_CMD_GETTIME) += gettime.o
  obj-$(CONFIG_CMD_GPIO) += gpio.o
+obj-$(CONFIG_CMD_HVC) += smccc.o
  obj-$(CONFIG_CMD_I2C) += i2c.o
  obj-$(CONFIG_CMD_IOTRACE) += iotrace.o
  obj-$(CONFIG_CMD_HASH) += hash.o
@@ -113,6 +114,7 @@ obj-$(CONFIG_CMD_SHA1SUM) += sha1sum.o
  obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
  obj-$(CONFIG_CMD_SPI) += spi.o
  obj-$(CONFIG_CMD_STRINGS) += strings.o
+obj-$(CONFIG_CMD_SMC) += smccc.o
  obj-$(CONFIG_CMD_TERMINAL) += terminal.o
  obj-$(CONFIG_CMD_TIME) += time.o
  obj-$(CONFIG_CMD_TRACE) += trace.o
diff --git a/cmd/smccc.c b/cmd/smccc.c
new file mode 100644
index 00..2fa7c23999
--- /dev/null
+++ b/cmd/smccc.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2018
+ * Michalis Pappas 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int do_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   struct arm_smccc_res res;
+
+   unsigned long fid;
+
+   unsigned long a1;
+   unsigned long a2;
+   unsigned long a3;
+   unsigned long a4;
+   unsigned long a5;
+   unsigned long a6;
+   unsigned long a7;
+
+   if (argc < 2)
+   return CMD_RET_USAGE;
+
+   fid = simple_strtoul(argv[1], NULL, 16);
+
+   a1 = argc > 2 ? simple_strtoul(argv[2], NULL, 16) : 0;
+   a2 = argc > 3 ? simple_strtoul(argv[3], NULL, 16) : 0;
+   a3 = argc > 4 ? simple_strtoul(argv[4], NULL, 16) : 0;
+   a4 = argc > 5 ? simple_strtoul(argv[5], NULL, 16) : 0;
+   a5 = argc > 6 ? simple_strtoul(argv[6], NULL, 16) : 0;
+   a6 = argc > 7 ? simple_strtoul(argv[7], NULL, 16) : 0;
+   a7 = argc > 8 ? simple_strtoul(argv[8], NULL, 16) : 0;
+
+   if (!strcmp(argv[0], "smc"))
+   arm_smccc_smc(fid, a1, a2, a3, a4, a5, a6, a7, );
+   else
+   arm_smccc_hvc(fid, a1, a2, a3, a4, a5, a6, a7, );
+
+   printf("Res:  %ld %ld %ld %ld\n", res.a0, res.a1, res.a2, res.a3);
+
+   return 0;
+}
+
+#ifdef CONFIG_CMD_SMC
+U_BOOT_CMD(
+   smc,8,  2,  do_call,
+   "Issue a Secure Monitor Call",
+   " [arg1 ... arg6] [id]\n"
+   "  - fid Function ID\n"
+   "  - arg SMC arguments, passed to X1-X6 (default to zero)\n"
+   "  - id  Secure OS ID / Session ID, passed to W7 (defaults to zero)\n"
+);
+#endif
+
+#ifdef CONFIG_CMD_HVC
+U_BOOT_CMD(
+   hvc,8,  2,  do_call,
+   "Issue a Hypervisor Call",
+   " [arg1...arg7] [id]\n"
+   "  - fid Function ID\n"
+   "  - arg HVC arguments, passed to X1-X6 (default to zero)\n"
+   "  - id  Session ID, passed to W7 (defaults to zero)\n"
+);
+#endif
+
--
2.17.0



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3] arm64: Add SMC and HVC commands

2018-04-11 Thread Michalis Pappas
This patch adds smc and hvc commands, that allow issuing Secure Monitor
Calls and Hypervisor Calls conforming to the ARM SMC Calling Convention.

Add Kconfig items to allow each command can be individually enabled.

Signed-off-by: Michalis Pappas 
---

 cmd/Kconfig  | 14 ++
 cmd/Makefile |  2 ++
 cmd/smccc.c  | 72 
 3 files changed, 88 insertions(+)
 create mode 100644 cmd/smccc.c

diff --git a/cmd/Kconfig b/cmd/Kconfig
index 136836d146..2176b98ccb 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1348,6 +1348,20 @@ config CMD_HASH
  saved to memory or to an environment variable. It is also possible
  to verify a hash against data in memory.

+config CMD_HVC
+   bool "Support the 'hvc' command"
+   depends on ARM_SMCCC
+   help
+ Allows issuing Hypervisor Calls (HVCs). Mostly useful for
+ development and testing.
+
+config CMD_SMC
+   bool "Support the 'smc' command"
+   depends on ARM_SMCCC
+   help
+ Allows issuing Secure Monitor Calls (SMCs). Mostly useful for
+ development and testing.
+
 config HASH_VERIFY
bool "hash -v"
depends on CMD_HASH
diff --git a/cmd/Makefile b/cmd/Makefile
index 9a358e4801..5656a1a40a 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -61,6 +61,7 @@ obj-$(CONFIG_CMD_FS_GENERIC) += fs.o
 obj-$(CONFIG_CMD_FUSE) += fuse.o
 obj-$(CONFIG_CMD_GETTIME) += gettime.o
 obj-$(CONFIG_CMD_GPIO) += gpio.o
+obj-$(CONFIG_CMD_HVC) += smccc.o
 obj-$(CONFIG_CMD_I2C) += i2c.o
 obj-$(CONFIG_CMD_IOTRACE) += iotrace.o
 obj-$(CONFIG_CMD_HASH) += hash.o
@@ -113,6 +114,7 @@ obj-$(CONFIG_CMD_SHA1SUM) += sha1sum.o
 obj-$(CONFIG_CMD_SETEXPR) += setexpr.o
 obj-$(CONFIG_CMD_SPI) += spi.o
 obj-$(CONFIG_CMD_STRINGS) += strings.o
+obj-$(CONFIG_CMD_SMC) += smccc.o
 obj-$(CONFIG_CMD_TERMINAL) += terminal.o
 obj-$(CONFIG_CMD_TIME) += time.o
 obj-$(CONFIG_CMD_TRACE) += trace.o
diff --git a/cmd/smccc.c b/cmd/smccc.c
new file mode 100644
index 00..2fa7c23999
--- /dev/null
+++ b/cmd/smccc.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2018
+ * Michalis Pappas 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int do_call(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   struct arm_smccc_res res;
+
+   unsigned long fid;
+
+   unsigned long a1;
+   unsigned long a2;
+   unsigned long a3;
+   unsigned long a4;
+   unsigned long a5;
+   unsigned long a6;
+   unsigned long a7;
+
+   if (argc < 2)
+   return CMD_RET_USAGE;
+
+   fid = simple_strtoul(argv[1], NULL, 16);
+
+   a1 = argc > 2 ? simple_strtoul(argv[2], NULL, 16) : 0;
+   a2 = argc > 3 ? simple_strtoul(argv[3], NULL, 16) : 0;
+   a3 = argc > 4 ? simple_strtoul(argv[4], NULL, 16) : 0;
+   a4 = argc > 5 ? simple_strtoul(argv[5], NULL, 16) : 0;
+   a5 = argc > 6 ? simple_strtoul(argv[6], NULL, 16) : 0;
+   a6 = argc > 7 ? simple_strtoul(argv[7], NULL, 16) : 0;
+   a7 = argc > 8 ? simple_strtoul(argv[8], NULL, 16) : 0;
+
+   if (!strcmp(argv[0], "smc"))
+   arm_smccc_smc(fid, a1, a2, a3, a4, a5, a6, a7, );
+   else
+   arm_smccc_hvc(fid, a1, a2, a3, a4, a5, a6, a7, );
+
+   printf("Res:  %ld %ld %ld %ld\n", res.a0, res.a1, res.a2, res.a3);
+
+   return 0;
+}
+
+#ifdef CONFIG_CMD_SMC
+U_BOOT_CMD(
+   smc,8,  2,  do_call,
+   "Issue a Secure Monitor Call",
+   " [arg1 ... arg6] [id]\n"
+   "  - fid Function ID\n"
+   "  - arg SMC arguments, passed to X1-X6 (default to zero)\n"
+   "  - id  Secure OS ID / Session ID, passed to W7 (defaults to zero)\n"
+);
+#endif
+
+#ifdef CONFIG_CMD_HVC
+U_BOOT_CMD(
+   hvc,8,  2,  do_call,
+   "Issue a Hypervisor Call",
+   " [arg1...arg7] [id]\n"
+   "  - fid Function ID\n"
+   "  - arg HVC arguments, passed to X1-X6 (default to zero)\n"
+   "  - id  Session ID, passed to W7 (defaults to zero)\n"
+);
+#endif
+
--
2.17.0

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 1/3] dm: led: Support "default-state" property

2018-04-11 Thread linux-kernel-dev
From: Patrick Bruenn 

Add support for the device tree property "default-state". This feature
might be useful for LEDs indicating "power on" or similar states.

Note: Even with this commit gpio-leds remain in reset state. That's
because the led_gpio is not probed until DM_FLAG_ACTIVATED is set.

Signed-off-by: Patrick Bruenn 

---

Changes in v4:
- don't break 'make tests'
- rebased on 2600df4f8ef12ece9cec13030005919e0ba2b0d5 (master
  2018-04-09)

Changes in v3:
- use ofnode_read_bool() instead of ofnode_read_string() to determine if
  LED node has the default-state property

Changes in v2:
- rebase to v2018.05-rc1
- add dm_test_led_default_state() to tests/dm/led.c

 drivers/led/led_gpio.c | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c
index 9976635887..e68d8d3864 100644
--- a/drivers/led/led_gpio.c
+++ b/drivers/led/led_gpio.c
@@ -60,11 +60,25 @@ static int led_gpio_probe(struct udevice *dev)
 {
struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
struct led_gpio_priv *priv = dev_get_priv(dev);
+   const char *default_state;
+   int ret;
 
/* Ignore the top-level LED node */
if (!uc_plat->label)
return 0;
-   return gpio_request_by_name(dev, "gpios", 0, >gpio, GPIOD_IS_OUT);
+
+   ret = gpio_request_by_name(dev, "gpios", 0, >gpio, GPIOD_IS_OUT);
+   if (ret)
+   return ret;
+
+   default_state = dev_read_string(dev, "default-state");
+   if (default_state) {
+   if (!strncmp(default_state, "on", 2))
+   gpio_led_set_state(dev, LEDST_ON);
+   else if (!strncmp(default_state, "off", 3))
+   gpio_led_set_state(dev, LEDST_OFF);
+   }
+   return 0;
 }
 
 static int led_gpio_remove(struct udevice *dev)
-- 
2.11.0


___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 3/3] dm: led: add testcase for "default-state" property

2018-04-11 Thread linux-kernel-dev
From: Patrick Bruenn 

Add two more gpio-leds to sandbox test device tree with default-state
property set to "on"/"off".
Add dm_test_led_default_state() to check that these new LED's are set to
LEDST_ON and LEDST_OFF.

dm: led: add testcase for "default-state" property

Add two more gpio-leds to sandbox test device tree with default-state
property set to "on"/"off".
Add dm_test_led_default_state() to check that these new LED's are set to
LEDST_ON and LEDST_OFF.

Signed-off-by: Patrick Bruenn 
---
patman complains about: test/dm/led.c:45: check: Please use a blank line
after function/struct/union/enum declarations.
I compared with other DM_TEST() usage and decided to ignore this check.
Should we fix the macro, patman or keep ignoring this?

Changes in v4:
- gpio_a pin 4 is already use by dm_test_gpio_phandles() -> we switch to
  use pin 5 and 6
- adjust dm_test_led_base() to the fact that we have two more LEDs, now

Changes in v3: None
Changes in v2: None

 arch/sandbox/dts/test.dts | 12 
 test/dm/led.c | 20 +++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 06d0e8ce85..2f104af960 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -254,6 +254,18 @@
gpios = <_a 2 0>;
label = "sandbox:green";
};
+
+   default_on {
+   gpios = <_a 5 0>;
+   label = "sandbox:default_on";
+   default-state = "on";
+   };
+
+   default_off {
+   gpios = <_a 6 0>;
+   label = "sandbox:default_off";
+   default-state = "off";
+   };
};
 
mbox: mbox {
diff --git a/test/dm/led.c b/test/dm/led.c
index fde700be38..af05cd78b6 100644
--- a/test/dm/led.c
+++ b/test/dm/led.c
@@ -22,12 +22,30 @@ static int dm_test_led_base(struct unit_test_state *uts)
ut_assertok(uclass_get_device(UCLASS_LED, 0, ));
ut_assertok(uclass_get_device(UCLASS_LED, 1, ));
ut_assertok(uclass_get_device(UCLASS_LED, 2, ));
-   ut_asserteq(-ENODEV, uclass_get_device(UCLASS_LED, 3, ));
+   ut_assertok(uclass_get_device(UCLASS_LED, 3, ));
+   ut_assertok(uclass_get_device(UCLASS_LED, 4, ));
+   ut_asserteq(-ENODEV, uclass_get_device(UCLASS_LED, 5, ));
 
return 0;
 }
 DM_TEST(dm_test_led_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
 
+/* Test of the LED 'default-state' device tree property */
+static int dm_test_led_default_state(struct unit_test_state *uts)
+{
+   struct udevice *dev;
+
+   /* Check that we handle the default-state property correctly. */
+   ut_assertok(led_get_by_label("sandbox:default_on", ));
+   ut_asserteq(LEDST_ON, led_get_state(dev));
+
+   ut_assertok(led_get_by_label("sandbox:default_off", ));
+   ut_asserteq(LEDST_OFF, led_get_state(dev));
+
+   return 0;
+}
+DM_TEST(dm_test_led_default_state, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
 /* Test of the led uclass using the led_gpio driver */
 static int dm_test_led_gpio(struct unit_test_state *uts)
 {
-- 
2.11.0


___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 2/3] dm: led: auto probe() LEDs with "default-state"

2018-04-11 Thread linux-kernel-dev
From: Patrick Bruenn 

To avoid board specificy LED activation code, automatically
activate gpio-leds with "default-state" property during bind().

Signed-off-by: Patrick Bruenn 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/led/led_gpio.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c
index e68d8d3864..f5b3b63493 100644
--- a/drivers/led/led_gpio.c
+++ b/drivers/led/led_gpio.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -120,6 +121,14 @@ static int led_gpio_bind(struct udevice *parent)
return ret;
uc_plat = dev_get_uclass_platdata(dev);
uc_plat->label = label;
+
+   if (ofnode_read_bool(node, "default-state")) {
+   struct udevice *devp;
+
+   ret = uclass_get_device_tail(dev, 0, );
+   if (ret)
+   return ret;
+   }
}
 
return 0;
-- 
2.11.0


___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 0/3] This series adds support for gpio-leds "default-state" property. The

2018-04-11 Thread linux-kernel-dev
From: Patrick Bruenn 

main usecase in mind are LEDs which indicate a state like "power on".
With this patchset applied, all you have to do is:
Add a gpio-led node with 'default-state = "on";' property to your device
tree. And the LED will automatically light up during U-Boot startup.

Changes in v4:
- don't break 'make tests'
- gpio_a pin 4 is already use by dm_test_gpio_phandles() -> we switch to
  use pin 5 and 6
- adjust dm_test_led_base() to the fact that we have two more LEDs, now
- rebased on 2600df4f8ef12ece9cec13030005919e0ba2b0d5 (master
  2018-04-09)

Changes in v3:
- use ofnode_read_bool() instead of ofnode_read_string() to determine if
  LED node has the default-state property

Changes in v2:
- rebase to v2018.05-rc1
- add dm_test_led_default_state() to tests/dm/led.c

Patrick Bruenn (3):
  dm: led: Support "default-state" property
  dm: led: auto probe() LEDs with "default-state"
  dm: led: add testcase for "default-state" property

 arch/sandbox/dts/test.dts | 12 
 drivers/led/led_gpio.c| 25 -
 test/dm/led.c | 20 +++-
 3 files changed, 55 insertions(+), 2 deletions(-)

-- 
2.11.0


___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] arm: socfpga: unable to boot cyclone5 devkit or SocKit

2018-04-11 Thread Marek Vasut
On 04/11/2018 04:52 AM, Dinh Nguyen wrote:
[...]

 u-boot$ git reset --hard v2018.01 ; bu socfpga_cyclone5 ; ls -la
 spl/u-boot-spl.bin
 HEAD is now at f3dd87e0b9 Prepare v2018.01
 -rw-r--r-- 1 marex marex 52902 Apr 11 00:34 spl/u-boot-spl.bin

 u-boot$ git reset --hard v2018.03 ; bu socfpga_cyclone5 ; ls -la
 spl/u-boot-spl.bin
 HEAD is now at f95ab1fb6e Prepare v2018.03
 -rw-r--r-- 1 marex marex 59706 Apr 11 00:34 spl/u-boot-spl.bin

 Try bisecting out the commit which caused this 7 kiB growth between
 2018.01 and 2018.03 . Even those 53 kiB are quite borderline, but it was
 at 53 kiB for a while (2017.05 is also ~53 kiB)

>>>
>>> Doing the bisect points me to this commit:
>>>
>>> commit fa2c14676c7c6f3115dd4d9b2a4cc3b35c3ad2a2
>>> Author: Tom Rini 
>>> Date:   Sat Feb 10 16:54:38 2018 -0500
>>>
>>> configs: Re-sync with CONFIG_DISTRO_DEFAULTS
>>>
>>> A number of platforms include config_distro_defaults.h but do not enable
>>> CONFIG_DISTRO_DEFAULTS.  As they plainly intended to, set that flag and
>>> re-sync config files.
>>>
>>> Signed-off-by: Tom Rini 
>>>
>>> Doing a revert of the above commit shrinks the SPL back down to ~7 kiB.
>>>
>>> Dinh
>>>
>>
>> It looks like the enablement of CONFIG_DISTRO_DEFAULTS, enables these
>> configs:
>>
>> CONFIG_ISO_PARTITION=y
>> CONFIG_SPL_ISO_PARTITION=y
>> # CONFIG_AMIGA_PARTITION is not set
>> # CONFIG_SPL_AMIGA_PARTITION is not set
>> CONFIG_EFI_PARTITION=y
>> CONFIG_EFI_PARTITION_ENTRIES_NUMBERS=128
>> CONFIG_EFI_PARTITION_ENTRIES_OFF=0
>> CONFIG_SPL_EFI_PARTITION=y
>> CONFIG_PARTITION_UUIDS=y
>> CONFIG_SPL_PARTITION_UUIDS=y
>> # CONFIG_PARTITION_TYPE_GUID is not set
>>
>> Which is contributing to the SPL growth.
>>
> 
> Turning the following config options off subtracts 7k from the SPL:
> 
> +# CONFIG_SPL_ISO_PARTITION is not set
> +# CONFIG_SPL_EFI_PARTITION is not set
> 
> Not sure if these are needed?

IMO not on SoCFPGA. Also CCing Tom.

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


Re: [U-Boot] [PATCH 7/7] video_display: Add Xilinx LogiCore DP TX

2018-04-11 Thread Mario Six
Hi Simon,

On Fri, Mar 30, 2018 at 10:41 AM, Simon Glass  wrote:
> Hi Mario,
>
> On 28 March 2018 at 20:40, Mario Six  wrote:
>> Add a driver for the Xilinx LogiCORE DisplayPort IP core.
>>
>> Signed-off-by: Mario Six 
>> ---
>>  drivers/video/Kconfig|8 +
>>  drivers/video/Makefile   |1 +
>>  drivers/video/logicore_dp_dpcd.h |  342 ++
>>  drivers/video/logicore_dp_tx.c   | 1974 
>> ++
>>  drivers/video/logicore_dp_tx.h   |   40 +
>>  drivers/video/logicore_dp_tx_regif.h |  365 +++
>>  6 files changed, 2730 insertions(+)
>>  create mode 100644 drivers/video/logicore_dp_dpcd.h
>>  create mode 100644 drivers/video/logicore_dp_tx.c
>>  create mode 100644 drivers/video/logicore_dp_tx.h
>>  create mode 100644 drivers/video/logicore_dp_tx_regif.h
>
> Is it possible to have common code with the other DP drivers?
>

While the DP transmitters, of course, all do similar things (e.g. they all
eventually set a lane count), the implementation details differ greatly, and I
think trying to merge them would only make things more confusing, since the
drivers tend to be pretty elaborate (looking at the exynos driver, for
example).

> Regards,
> Simon
>

Best regards,

Mario
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/8] core: Add uclass_{first, next}_device_compat

2018-04-11 Thread Mario Six
Hi Simon,

On Fri, Mar 30, 2018 at 10:41 AM, Simon Glass  wrote:
> Hi Mario,
>
> On 28 March 2018 at 20:38, Mario Six  wrote:
>> A lot of times one wants to cycle through the devices in a uclass, but
>> only certain ones, especially ones identified by their compatibility
>> string, and ignore all others (in the best case this procedure should
>> not even activate the devices one is not interested in).
>>
>> Hence, we add a pair of functions similar to uclass_{first,next}_device,
>> but taking a compatibility string as an additional argument, which cycle
>> through the devices of a uclass that conform to this compatibility
>> string.
>
> Can we not use a phandle to find the device? Using raw compatible
> strings feel bad (and slow to me).
>
> If not, a please add a sandbox test.
>

A phandle would indeed be the cleaner solution, but it won't work if you have
to get device handles in board files, since there is no device for a board you
could query for a phandle. And the MPC83xx board this series leads up to needs
to gather numerous device handles for configuration and querying purposes.

If there was a underlying device for the board functions there would be no
issue with using a phandle, but as it is, it sadly won't work.

>>
>> Signed-off-by: Mario Six 
>> ---
>>  drivers/core/uclass.c | 33 +
>>  include/dm/uclass.h   | 37 +
>>  2 files changed, 70 insertions(+)
>
> Regards,
> Simon
>

Best regards,

Mario
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [GIT PULL] Xilinx patches for v2018.05-rc2

2018-04-11 Thread Michal Simek
On 10.4.2018 16:28, Tom Rini wrote:
> On Tue, Apr 10, 2018 at 04:16:14PM +0200, Michal Simek wrote:
>> On 10.4.2018 16:08, Tom Rini wrote:
>>> On Mon, Apr 09, 2018 at 04:39:29PM +0200, Michal Simek wrote:
>>>
 Hi Tom,

 please pull these changes to your tree.

 Travis looks good.
 https://travis-ci.org/michalsimek/u-boot/builds/364047688

 And buildman output too.

 Thanks,
 Michal


 The following changes since commit 
 5bc0543df3079add8152afa041b887d081d71839:

   treewide: Convert CONFIG_HOSTNAME to a string option (2018-04-08
 18:31:09 -0400)

 are available in the git repository at:

   git://www.denx.de/git/u-boot-microblaze.git tags/xilinx-for-v2018.05-rc2

 for you to fetch changes up to f190eaf002bf1434587d57c726b3dabfabbc8074:

   arm64: zynqmp: Add support for Xilinx zcu111-revA (2018-04-09 12:14:53
 +0200)

>>>
>>> Applied to u-boot/master, thanks!
>>>
>>> But a small request.  A number of Xilinx have commits in the form of:
>>> Author: Their Name 
>>> ...
>>> Signed-off-by: Their Name: 
>>>
>>> Which is fine in that it's clear that the Author also S-o-B'd it.  But
>>> since the email doesn't match is does trigger my script that shows me
>>> the log to manually confirm the author S-o-B'd it.  Can you please ask
>>> the team to check their gitconfig?  Thanks!
>>
>> Xilinx is allowing to have email setup in both forms.
> 
> That's fairly common.  FWIW, it pops up sometimes for TI and
> NXP/Freescale (I don't know if it will follow over to qcom).
> 
>> I see that Siva, Nitin, Vipul and maybe others have that incorrect setting.
>> Do you have that script somewhere to also include it to my flow to make
>> sure that this is aligned when I accept these patches internally too?
> 
> Sure.  This is ugly, but functional:
> #!/bin/bash
> COMMITS=`git log --no-merges origin/master.. --oneline | wc -l`
> SIGNS=`mktemp`
> 
> for HASH in `git log --no-merges origin/master.. --format=%h`;do EMAIL=`git 
> log -n1 --format=%ae $HASH`; git log --grep="Signed-off-by.*$EMAIL" 
> ${HASH}^..${HASH} --format="Commit %h is OK";done > $SIGNS
> 
> if test $COMMITS -ne `cat $SIGNS | wc -l`;then
>   echo Problematic commits exist:
>   for HASH in `git log --no-merges origin/master.. --format=%h`;do 
> EMAIL=`git log -n1 --format=%ae $HASH`; git log 
> --grep="Signed-off-by.*$EMAIL" --invert-grep ${HASH}^..${HASH};done
>   rm -f $SIGNS
>   exit 1
> else
>   rm -f $SIGNS
>   echo "All commits appear OK"
> fi
> 

Ok. I have let all xilinx people know to fix their setup and will start
to checking that. It will be good to integrate this checking in patman.

Thanks,
Michal

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/7] axi: Add AXI sandbox driver and simple emulator

2018-04-11 Thread Mario Six
Hi Simon,

On Fri, Mar 30, 2018 at 10:41 AM, Simon Glass  wrote:
> Hi Mario,
>
> On 28 March 2018 at 20:40, Mario Six  wrote:
>> Add test infrastructure and tests for the AXI uclass.
>>
>> Signed-off-by: Mario Six 
>> ---
>>  drivers/axi/Kconfig   |   6 +++
>>  drivers/axi/Makefile  |   3 ++
>>  drivers/axi/axi-emul-uclass.c |  68 
>>  drivers/axi/axi_sandbox.c |  61 ++
>>  drivers/axi/sandbox_store.c   | 118 
>> ++
>>  include/axi.h |  51 ++
>>  include/dm/uclass-id.h|   1 +
>>  7 files changed, 308 insertions(+)
>>  create mode 100644 drivers/axi/axi-emul-uclass.c
>>  create mode 100644 drivers/axi/axi_sandbox.c
>>  create mode 100644 drivers/axi/sandbox_store.c
>>
>> diff --git a/drivers/axi/Kconfig b/drivers/axi/Kconfig
>> index 19e1b7fd2f..a0333782cf 100644
>> --- a/drivers/axi/Kconfig
>> +++ b/drivers/axi/Kconfig
>> @@ -21,4 +21,10 @@ config IHS_AXI
>>   Support for IHS AXI bus on a gdsys IHS FPGA used to communicate 
>> with
>>   IP cores in the FPGA (e.g. video transmitter cores).
>>
>> +config AXI_SANDBOX
>> +   bool "Enable AXI sandbox driver"
>> +   depends on DM
>> +   help
>> + Support the AXI emulation for the sandbox environment.
>
> Please spell out abbreviations
>
>> +
>>  endif
>> diff --git a/drivers/axi/Makefile b/drivers/axi/Makefile
>> index 18d9380e9b..66b6c5a28f 100644
>> --- a/drivers/axi/Makefile
>> +++ b/drivers/axi/Makefile
>> @@ -7,3 +7,6 @@
>>
>>  obj-$(CONFIG_AXI) += axi-uclass.o
>>  obj-$(CONFIG_IHS_AXI) += ihs_axi.o
>> +obj-$(CONFIG_SANDBOX) += axi-emul-uclass.o
>> +obj-$(CONFIG_SANDBOX) += sandbox_store.o
>> +obj-$(CONFIG_AXI_SANDBOX) += axi_sandbox.o
>> diff --git a/drivers/axi/axi-emul-uclass.c b/drivers/axi/axi-emul-uclass.c
>> new file mode 100644
>> index 00..bf60c40518
>> --- /dev/null
>> +++ b/drivers/axi/axi-emul-uclass.c
>> @@ -0,0 +1,68 @@
>> +/*
>> + * (C) Copyright 2018
>> + * Mario Six, Guntermann & Drunck GmbH, mario@gdsys.cc
>> + *
>> + * SPDX-License-Identifier:GPL-2.0+
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +int axi_sandbox_get_emul(struct udevice *bus, ulong address, enum 
>> axi_size_t size,
>> +struct udevice **emulp)
>> +{
>> +   struct udevice *dev;
>> +   u32 reg[2];
>> +   uint offset;
>> +
>> +   switch (size) {
>> +   case AXI_SIZE_8:
>> +   offset = 1;
>> +   break;
>> +   case AXI_SIZE_16:
>> +   offset = 2;
>> +   break;
>> +   case AXI_SIZE_32:
>> +   offset = 4;
>> +   break;
>> +   default:
>> +   offset = 0;
>> +   }
>> +
>> +   for (device_find_first_child(bus, );
>> +dev;
>> +device_find_next_child()) {
>> +   int ret;
>> +
>> +   ret = dev_read_u32_array(dev, "reg", reg, ARRAY_SIZE(reg));
>> +   if (ret)
>> +   continue;
>> +
>> +   if (address >= reg[0] && address <= reg[0] + reg[1] - 
>> offset) {
>> +   if (device_probe(dev))
>> +   return -ENODEV;
>> +
>> +   *emulp = dev;
>> +   return 0;
>> +   }
>> +   }
>> +
>> +   return -ENODEV;
>> +}
>> +
>> +int axi_get_store(struct udevice *dev, u8 **store)
>> +{
>> +   struct axi_emul_ops *ops = axi_emul_get_ops(dev);
>> +
>> +   if (!ops->get_store)
>> +   return -ENOSYS;
>> +
>> +   return ops->get_store(dev, store);
>> +}
>> +
>> +UCLASS_DRIVER(axi_emul) = {
>> +   .id = UCLASS_AXI_EMUL,
>> +   .name   = "axi_emul",
>> +};
>> diff --git a/drivers/axi/axi_sandbox.c b/drivers/axi/axi_sandbox.c
>> new file mode 100644
>> index 00..b0f24bdd9d
>> --- /dev/null
>> +++ b/drivers/axi/axi_sandbox.c
>> @@ -0,0 +1,61 @@
>> +/*
>> + * (C) Copyright 2018
>> + * Mario Six, Guntermann & Drunck GmbH, mario@gdsys.cc
>> + *
>> + * SPDX-License-Identifier:GPL-2.0+
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +
>> +int axi_sandbox_read(struct udevice *bus, ulong address, void *data,
>> +enum axi_size_t size)
>> +{
>> +   struct axi_emul_ops *ops;
>> +   struct udevice *emul;
>> +   int ret;
>> +
>> +   ret = axi_sandbox_get_emul(bus, address, size, );
>> +   if (ret)
>> +   return ret == -ENODEV ? 0 : ret;
>
> Please add a comment as to why you are doing this.
>
>> +   ops = axi_emul_get_ops(emul);
>> +   if (!ops || !ops->read)
>> +   return -ENOSYS;
>> +
>> +   return ops->read(emul, address, data, size);
>> +}
>> +
>> +int axi_sandbox_write(struct udevice *bus, ulong address, void *data,
>> + enum 

Re: [U-Boot] [PATCH 1/2] misc: uclass: Add enable/disable functions

2018-04-11 Thread Mario Six
Hi Simon,

On Fri, Mar 30, 2018 at 10:41 AM, Simon Glass  wrote:
> Hi Mario,
>
> On 28 March 2018 at 20:38, Mario Six  wrote:
>> Add generic enable/disable functions to the misc uclass.
>>
>> Signed-off-by: Mario Six 
>> ---
>>  drivers/misc/misc-uclass.c | 20 
>>  include/misc.h | 30 ++
>>  2 files changed, 50 insertions(+)
>>
>> diff --git a/drivers/misc/misc-uclass.c b/drivers/misc/misc-uclass.c
>> index d9eea3dac5..942fa8da94 100644
>> --- a/drivers/misc/misc-uclass.c
>> +++ b/drivers/misc/misc-uclass.c
>> @@ -56,6 +56,26 @@ int misc_call(struct udevice *dev, int msgid, void 
>> *tx_msg, int tx_size,
>> return ops->call(dev, msgid, tx_msg, tx_size, rx_msg, rx_size);
>>  }
>>
>> +int misc_enable(struct udevice *dev)
>> +{
>> +   const struct misc_ops *ops = device_get_ops(dev);
>> +
>> +   if (!ops->enable)
>> +   return -ENOSYS;
>> +
>> +   return ops->enable(dev);
>> +}
>> +
>> +int misc_disable(struct udevice *dev)
>> +{
>> +   const struct misc_ops *ops = device_get_ops(dev);
>> +
>> +   if (!ops->enable)
>> +   return -ENOSYS;
>> +
>> +   return ops->disable(dev);
>> +}
>> +
>>  UCLASS_DRIVER(misc) = {
>> .id = UCLASS_MISC,
>> .name   = "misc",
>> diff --git a/include/misc.h b/include/misc.h
>> index 03ef55cdc8..6f86396443 100644
>> --- a/include/misc.h
>> +++ b/include/misc.h
>> @@ -58,6 +58,22 @@ int misc_ioctl(struct udevice *dev, unsigned long 
>> request, void *buf);
>>  int misc_call(struct udevice *dev, int msgid, void *tx_msg, int tx_size,
>>   void *rx_msg, int rx_size);
>>
>> +/*
>> + * Enable a device.
>> + *
>> + * @dev: the device to enable.
>> + * @return: 0 if OK, -ve on error
>> + */
>> +int misc_enable(struct udevice *dev);
>
> How about a single function like:
>
> int misc_set_enable(struct udevice *dev, bool enable);
>
> Also please state in the comment what exactly it means to
> enable/disable a device.
>

OK, v2 will have one function and more comments.

>> +
>> +/*
>> + * Disable a device.
>> + *
>> + * @dev: the device to disable.
>> + * @return: 0 if OK, -ve on error
>> + */
>> +int misc_disable(struct udevice *dev);
>> +
>>  /*
>>   * struct misc_ops - Driver model Misc operations
>>   *
>> @@ -109,6 +125,20 @@ struct misc_ops {
>>  */
>> int (*call)(struct udevice *dev, int msgid, void *tx_msg, int 
>> tx_size,
>> void *rx_msg, int rx_size);
>> +   /*
>> +* Enable a device, optional.
>> +*
>> +* @dev: the device to enable.
>> +* @return: 0 if OK, -ve on error
>> +*/
>> +   int (*enable)(struct udevice *dev);
>> +   /*
>> +* Disable a device, optional.
>> +*
>> +* @dev: the device to disable.
>> +* @return: 0 if OK, -ve on error
>> +*/
>> +   int (*disable)(struct udevice *dev);
>>  };
>>
>>  #endif /* _MISC_H_ */
>> --
>> 2.16.1
>>
>
> Regards,
> Simon
>

Best regards,

Mario
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/7] drivers: Add AXI uclass and ihs_axi driver

2018-04-11 Thread Mario Six
Hi Simon,

On Fri, Mar 30, 2018 at 10:41 AM, Simon Glass  wrote:
> Hi Mario,
>
> On 28 March 2018 at 20:40, Mario Six  wrote:
>> Add a uclass for AXI (Advanced eXtensible Interface) busses, and a
>> driver for the gdsys IHS AXI bus on IHS FPGAs.
>>
>> Signed-off-by: Mario Six 
>> ---
>>  drivers/Kconfig  |   2 +
>>  drivers/Makefile |   1 +
>>  drivers/axi/Kconfig  |  24 ++
>>  drivers/axi/Makefile |   9 +++
>>  drivers/axi/axi-uclass.c |  40 ++
>>  drivers/axi/ihs_axi.c| 199 
>> +++
>>  include/axi.h|  75 ++
>>  include/dm/uclass-id.h   |   1 +
>>  8 files changed, 351 insertions(+)
>>  create mode 100644 drivers/axi/Kconfig
>>  create mode 100644 drivers/axi/Makefile
>>  create mode 100644 drivers/axi/axi-uclass.c
>>  create mode 100644 drivers/axi/ihs_axi.c
>>  create mode 100644 include/axi.h
>
> Would UCLASS_MAILBOX be suitable here?
>
> It's fine if you want a new uclass, just checking.
>

From what I understand about the mailbox uclass, it's more for "one-off"
devices that need to transfer messages, while AXI is a type of bus, much like
I2C or SPI, so I think the mailbox uclass doesn't really encompass all that AXI
is about.

> Please split out your driver into a separate patch. Adding the new
> uclass should be in its own patch.
>

OK, will split them in v2.

>>
>> diff --git a/drivers/Kconfig b/drivers/Kconfig
>> index c2e813f5ad..eeaaa7575c 100644
>> --- a/drivers/Kconfig
>> +++ b/drivers/Kconfig
>> @@ -8,6 +8,8 @@ source "drivers/adc/Kconfig"
>>
>>  source "drivers/ata/Kconfig"
>>
>> +source "drivers/axi/Kconfig"
>> +
>>  source "drivers/block/Kconfig"
>>
>>  source "drivers/bootcount/Kconfig"
>> diff --git a/drivers/Makefile b/drivers/Makefile
>> index 6846d181aa..f54a10f3ad 100644
>> --- a/drivers/Makefile
>> +++ b/drivers/Makefile
>> @@ -100,6 +100,7 @@ obj-y += input/
>>  obj-y += soc/
>>  obj-$(CONFIG_REMOTEPROC) += remoteproc/
>>  obj-y += thermal/
>> +obj-y += axi/
>>
>>  obj-$(CONFIG_MACH_PIC32) += ddr/microchip/
>>  endif
>> diff --git a/drivers/axi/Kconfig b/drivers/axi/Kconfig
>> new file mode 100644
>> index 00..19e1b7fd2f
>> --- /dev/null
>> +++ b/drivers/axi/Kconfig
>> @@ -0,0 +1,24 @@
>> +menuconfig AXI
>> +   bool "AXI bus drivers"
>> +   help
>> + Support AXI (Advanced eXtensible Interface) busses, a on-chip
>> + interconnect specification for managing functional blocks in SoC
>> + designs, which is also often used in designs involving FPGAs (e.g.
>> + communication with IP cores in Xilinx FPGAs).
>> +
>> + These types of busses expose a virtual address space that can be
>> + accessed using different address widths (8, 16, and 32 are 
>> supported
>> + for now).
>> +
>> + Other similar bus architectures may be compatible as well.
>> +
>> +if AXI
>> +
>> +config IHS_AXI
>> +   bool "Enable IHS AXI driver"
>> +   depends on DM
>> +   help
>> + Support for IHS AXI bus on a gdsys IHS FPGA used to communicate 
>> with
>> + IP cores in the FPGA (e.g. video transmitter cores).
>
> Please also spell out the abbreviations in the help
>

Will do in v2.

> [...]
>
> Regards,
> Simon
>

Best regards,

Mario
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 6/8] cpu: Add cpu_print_info function

2018-04-11 Thread Mario Six
Hi Simon,

On Fri, Mar 30, 2018 at 10:41 AM, Simon Glass  wrote:
> Hi,
>
> On 28 March 2018 at 20:38, Mario Six  wrote:
>> Add a cpu_print_info function to the CPU uclass to emulate the behavior
>> of some current non-DM drivers (e.g. MPC83xx) to print CPU information
>> during startup.
>>
>> Signed-off-by: Mario Six 
>> ---
>>  drivers/cpu/cpu-uclass.c | 10 ++
>>  include/cpu.h| 15 +++
>>  2 files changed, 25 insertions(+)
>>
>
> I really don't want drivers printing stuff. Can you use the existing
> get_info() method?
>

I could, but I'm just emulating the behavior of the legacy code here, which
prints some information when the CPU is initialized. I think that's pretty
useful, and I can do that in our board file, but that would mean implementing
the same routine in every MPC83xx board to get the legacy behavior back.

> Regards,
> Simon
>

Best regards,

Mario
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] devinfo: Add gazerbeam info driver

2018-04-11 Thread Mario Six
Hi Simon,

On Fri, Mar 30, 2018 at 10:40 AM, Simon Glass  wrote:
> Hi Mario,
>
> On 28 March 2018 at 20:36, Mario Six  wrote:
>> Add a device information driver for the upcoming gdsys Gazerbeam board.
>>
>> Signed-off-by: Mario Six 
>> ---
>>  drivers/devinfo/gazerbeam.c | 151 
>> 
>>  drivers/devinfo/gazerbeam.h |  17 +
>>  2 files changed, 168 insertions(+)
>>  create mode 100644 drivers/devinfo/gazerbeam.c
>>  create mode 100644 drivers/devinfo/gazerbeam.h
>>
>> diff --git a/drivers/devinfo/gazerbeam.c b/drivers/devinfo/gazerbeam.c
>> new file mode 100644
>> index 00..10226aa254
>> --- /dev/null
>> +++ b/drivers/devinfo/gazerbeam.c
>> @@ -0,0 +1,151 @@
>> +/*
>> + * (C) Copyright 2017
>> + * Mario Six,  Guntermann & Drunck GmbH, mario@gdsys.cc
>> + *
>> + * SPDX-License-Identifier:GPL-2.0+
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include "gazerbeam.h"
>> +
>> +const int VER_GPIOS_COUNT = 4;
>> +
>> +struct devinfo_gazerbeam_priv {
>> +   struct gpio_desc var_gpios[2];
>> +   struct gpio_desc ver_gpios[4];
>> +   int variant;
>> +   int multichannel;
>> +   int hwversion;
>> +};
>> +
>> +static int _read_multichannel_variant(struct udevice *dev)
>> +{
>> +   struct devinfo_gazerbeam_priv *priv = dev_get_priv(dev);
>> +   struct udevice *i2c_bus;
>> +   struct udevice *dummy;
>> +   char *listname;
>> +   bool mc4, mc2, sc, con;
>> +
>> +   uclass_get_device_by_seq(UCLASS_I2C, 1, _bus);
>
> Please pass the error through unless there is a good reason not to.
>
> ret = uclass ...
> if (ret) {
>debug(...)
>return ret
> }
>
>> +
>> +   if (!i2c_bus) {
>> +   puts("Could not get I2C bus\n");
>> +   return -EIO;
>> +   }
>> +
>> +   mc2 = !dm_i2c_probe(i2c_bus, 0x20, 0, );
>> +   mc4 = !dm_i2c_probe(i2c_bus, 0x22, 0, );
>
> Same here
>> +
>> +   if (mc2 && mc4) {
>> +   puts("Board hardware configuration inconsistent.\n");
>> +   return -EINVAL;
>> +   }
>> +
>> +   listname = mc2 ? "var_gpios_mc2" : "var_gpios_mc4";
>
> If these are DT properties they should use hyphen instead of underscore
>
>> +
>> +   if (!gpio_request_list_by_name(dev, listname, priv->var_gpios,
>> +  2, GPIOD_IS_IN)) {
>> +   printf("Requesting gpio list %s failed.\n", listname);
>> +   return -ENODEV;
>
> Return correct error
>
>> +   }
>> +
>> +   sc = dm_gpio_get_value(>var_gpios[0]);
>> +   con = dm_gpio_get_value(>var_gpios[1]);
>
> And here
>> +
>> +   if ((sc && mc2) || (sc && mc4) || (!sc && !mc2 && !mc4)) {
>> +   puts("Board hardware configuration inconsistent.\n");
>> +   return -EINVAL;
>> +   }
>> +
>> +   priv->variant = con ? VAR_CON : VAR_CPU;
>> +
>> +   priv->multichannel = mc4 ? 4 : (mc2 ? 2 : (sc ? 1 : 0));
>> +
>> +   return 0;
>> +}
>> +
>> +static int _read_hwversion(struct udevice *dev)
>> +{
>> +   struct devinfo_gazerbeam_priv *priv = dev_get_priv(dev);
>> +   int value;
>> +
>> +   if (!gpio_request_list_by_name(dev, "ver_gpios", priv->ver_gpios,
>
> ver-gpios ?
>
>> +  VER_GPIOS_COUNT, GPIOD_IS_IN))
>> +   return -ENODEV;
>> +
>> +   value = dm_gpio_get_values_as_int(priv->ver_gpios, VER_GPIOS_COUNT);
>> +
>> +   if (value < 0)
>> +   return value;
>> +
>> +   priv->hwversion = value;
>> +
>> +   gpio_free_list(dev, priv->ver_gpios, VER_GPIOS_COUNT);
>> +
>> +   return 0;
>> +}
>> +
>> +int devinfo_gazerbeam_detect(struct udevice *dev)
>> +{
>> +   int res;
>> +
>> +   res = _read_multichannel_variant(dev);
>> +   if (res)
>> +   return res;
>> +
>> +   res = _read_hwversion(dev);
>> +   if (res)
>> +   return res;
>> +
>> +   return 0;
>> +}
>> +
>> +int devinfo_gazerbeam_get_int(struct udevice *dev, int id, int *val)
>> +{
>> +   struct devinfo_gazerbeam_priv *priv = dev_get_priv(dev);
>> +
>> +   switch (id) {
>> +   case DEVINFO_MULTICHANNEL:
>> +   *val = priv->multichannel;
>> +   break;
>> +   case DEVINFO_VARIANT:
>> +   *val = priv->variant;
>> +   break;
>> +   case DEVINFO_HWVERSION:
>> +   *val = priv->hwversion;
>> +   break;
>> +   default:
>> +   return -EINVAL;
>> +   }
>> +
>> +   return 0;
>> +}
>> +
>> +static const struct udevice_id devinfo_gazerbeam_ids[] = {
>> +   { .compatible = "gdsys,devinfo_gazerbeam" },
>> +   { /* sentinel */ }
>> +};
>> +
>> +static const struct devinfo_ops devinfo_gazerbeam_ops = {
>> +   .detect = devinfo_gazerbeam_detect,
>> +   .get_int = devinfo_gazerbeam_get_int,
>> +};
>> +

Re: [U-Boot] [PATCH 6/7] video_display: Add power_on function

2018-04-11 Thread Mario Six
Hi Simon,

On Fri, Mar 30, 2018 at 10:41 AM, Simon Glass  wrote:
> Hi Mario,
>
> On 28 March 2018 at 20:40, Mario Six  wrote:
>> Add a power_on function to the display uclass to allow devices to be
>> probed and powered-on separately.
>
> Is this different from the 'enable' method?
>

I was thinking that this is more low-level than the enable method, which also
sets display parameters. I could also use the enable method if it's alright to
disregard the panel_bpp and timing parameters.

> Also note that we have a panel uclass that might be useful.
>

The Logicore driver is probably more low-level than that, but I'll take a look.

>>
>> Signed-off-by: Mario Six 
>> ---
>>  drivers/video/display-uclass.c | 10 ++
>>  include/display.h  | 18 ++
>>  2 files changed, 28 insertions(+)
>>
>> diff --git a/drivers/video/display-uclass.c b/drivers/video/display-uclass.c
>> index e752eb07c4..4865057e94 100644
>> --- a/drivers/video/display-uclass.c
>> +++ b/drivers/video/display-uclass.c
>> @@ -57,6 +57,16 @@ int display_read_timing(struct udevice *dev, struct 
>> display_timing *timing)
>> return edid_get_timing(buf, ret, timing, _bits_per_colour);
>>  }
>>
>> +int display_power_on(struct udevice *dev, void *data)
>> +{
>> +   struct dm_display_ops *ops = display_get_ops(dev);
>> +
>> +   if (!ops || !ops->power_on)
>> +   return -ENOSYS;
>> +
>> +   return ops->power_on(dev, data);
>> +}
>> +
>>  bool display_in_use(struct udevice *dev)
>>  {
>> struct display_plat *disp_uc_plat = dev_get_uclass_platdata(dev);
>> diff --git a/include/display.h b/include/display.h
>> index d0a08d4aaa..bb263be246 100644
>> --- a/include/display.h
>> +++ b/include/display.h
>> @@ -51,6 +51,15 @@ int display_enable(struct udevice *dev, int panel_bpp,
>>   */
>>  bool display_in_use(struct udevice *dev);
>>
>> +/**
>> + * display_power_on() - Power on display port device
>> + *
>> + * @dev:   Device to power on
>> + * @data:  Optional data needed to power on the display correctly
>> + * @return 0 if OK, -ve on error
>> + */
>> +int display_power_on(struct udevice *dev, void *data);
>> +
>>  struct dm_display_ops {
>> /**
>>  * read_timing() - Read information directly
>> @@ -81,6 +90,15 @@ struct dm_display_ops {
>>  */
>> int (*enable)(struct udevice *dev, int panel_bpp,
>>   const struct display_timing *timing);
>> +
>> +   /**
>> +* power_on() - Power on display port device
>> +*
>> +* @dev:Device to power on
>> +* @data:   Optional data needed to power on the display 
>> correctly
>> +* @return 0 if OK, -ve on error
>> +*/
>> +   int (*power_on)(struct udevice *dev, void *data);
>>  };
>>
>>  #define display_get_ops(dev)   ((struct dm_display_ops *)(dev)->driver->ops)
>> --
>> 2.16.1
>>
>
> Regards,
> Simon
>

Best regards,

Mario
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] drivers: Add FPGA register map uclass

2018-04-11 Thread Mario Six
Hi Simon,

On Fri, Mar 30, 2018 at 10:40 AM, Simon Glass  wrote:
> Hi Mario,
>
> On 28 March 2018 at 20:37, Mario Six  wrote:
>> The FPGA (as a device) and the register map supplied by a FPGA are two
>> different entities. There are U-Boot drivers for the former, but not for
>> the later.
>>
>> Add a uclass that makes it possible to read from and write to FPGA
>> memory maps. The interface provided emulates the PCI interface, with one
>> function for reading/writing plus a size parameter.
>>
>> Signed-off-by: Mario Six 
>> ---
>>  drivers/Kconfig  |   2 +
>>  drivers/Makefile |   1 +
>>  drivers/fpgamap/Kconfig  |   9 +++
>>  drivers/fpgamap/Makefile |   8 +++
>>  drivers/fpgamap/fpgamap-uclass.c |  53 
>>  include/dm/uclass-id.h   |   1 +
>>  include/fpgamap.h| 131 
>> +++
>>  7 files changed, 205 insertions(+)
>>  create mode 100644 drivers/fpgamap/Kconfig
>>  create mode 100644 drivers/fpgamap/Makefile
>>  create mode 100644 drivers/fpgamap/fpgamap-uclass.c
>>  create mode 100644 include/fpgamap.h
>>
>
> Could we use regmap for this? That uclass really could use being
> enhanced to do the things you do here.
>

OK, that should work, I'll move the functionality over to regmap then.

> Regards,
> Simon
>

Best regards,

Mario
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] drivers: Add devinfo uclass

2018-04-11 Thread Mario Six
Hi Simon,

On Fri, Mar 30, 2018 at 10:40 AM, Simon Glass  wrote:
> Hi Mario,
>
> On 28 March 2018 at 20:36, Mario Six  wrote:
>> Some boards have encoded information, e.g. hard-wired GPIOs on a GPIO
>> expander, read-only memory ICs, etc. that carry information about the
>> hardware.
>>
>> Add a uclass that encapsulates device information of such a kind and
>> makes them accessible in a uniform manner. The devices of this uclass
>> expose methods to read generic data types (integers, strings, booleans)
>> to encode the information provided by the hardware.
>>
>> Signed-off-by: Mario Six 
>> ---
>>  drivers/Kconfig  |  2 ++
>>  drivers/Makefile |  1 +
>>  drivers/devinfo/Kconfig  | 17 
>>  drivers/devinfo/Makefile |  9 +++
>>  drivers/devinfo/devinfo-uclass.c | 55 
>> +++
>>  include/devinfo.h| 56 
>> 
>>  include/dm/uclass-id.h   |  1 +
>>  7 files changed, 141 insertions(+)
>>  create mode 100644 drivers/devinfo/Kconfig
>>  create mode 100644 drivers/devinfo/Makefile
>>  create mode 100644 drivers/devinfo/devinfo-uclass.c
>>  create mode 100644 include/devinfo.h
>
> Please can you add a sandbox driver for this and a test?
>
>>
>> diff --git a/drivers/Kconfig b/drivers/Kconfig
>> index c2e813f5ad..34777d9013 100644
>> --- a/drivers/Kconfig
>> +++ b/drivers/Kconfig
>> @@ -22,6 +22,8 @@ source "drivers/ddr/Kconfig"
>>
>>  source "drivers/demo/Kconfig"
>>
>> +source "drivers/devinfo/Kconfig"
>> +
>>  source "drivers/ddr/fsl/Kconfig"
>>
>>  source "drivers/dfu/Kconfig"
>> diff --git a/drivers/Makefile b/drivers/Makefile
>> index 6846d181aa..208b68081e 100644
>> --- a/drivers/Makefile
>> +++ b/drivers/Makefile
>> @@ -72,6 +72,7 @@ obj-y += block/
>>  obj-$(CONFIG_BOOTCOUNT_LIMIT) += bootcount/
>>  obj-$(CONFIG_CPU) += cpu/
>>  obj-y += crypto/
>> +obj-y += devinfo/
>>  obj-y += firmware/
>>  obj-$(CONFIG_FPGA) += fpga/
>>  obj-y += misc/
>> diff --git a/drivers/devinfo/Kconfig b/drivers/devinfo/Kconfig
>> new file mode 100644
>> index 00..0de70b410e
>> --- /dev/null
>> +++ b/drivers/devinfo/Kconfig
>> @@ -0,0 +1,17 @@
>> +menuconfig DEVINFO
>> +   bool "Device Information"
>> +   help
>> + Support methods to query hardware configurations from internal
>> + mechanisms (e.g. reading GPIO values, determining the presence of
>> + devices on busses, etc.). This enables the usage of U-Boot with
>> + modular board architectures.
>> +
>> +if DEVINFO
>> +
>> +
>> +config DEVINFO_GAZERBEAM
>> +   bool "Enable device information for the Gazerbeam board"
>> +   help
>> + Support querying device information for the gdsys Gazerbeam board.
>> +
>> +endif
>> diff --git a/drivers/devinfo/Makefile b/drivers/devinfo/Makefile
>> new file mode 100644
>> index 00..0a9cad4a15
>> --- /dev/null
>> +++ b/drivers/devinfo/Makefile
>> @@ -0,0 +1,9 @@
>> +#
>> +# (C) Copyright 2017
>> +# Mario Six,  Guntermann & Drunck GmbH, mario@gdsys.cc
>> +#
>> +# SPDX-License-Identifier: GPL-2.0+
>> +#
>> +
>> +obj-$(CONFIG_DEVINFO) += devinfo-uclass.o
>> +obj-$(CONFIG_DEVINFO_GAZERBEAM) += gazerbeam.o
>> diff --git a/drivers/devinfo/devinfo-uclass.c 
>> b/drivers/devinfo/devinfo-uclass.c
>> new file mode 100644
>> index 00..89bbe8f343
>> --- /dev/null
>> +++ b/drivers/devinfo/devinfo-uclass.c
>> @@ -0,0 +1,55 @@
>> +/*
>> + * (C) Copyright 2017
>> + * Mario Six,  Guntermann & Drunck GmbH, mario@gdsys.cc
>> + *
>> + * SPDX-License-Identifier:GPL-2.0+
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +
>> +int devinfo_detect(struct udevice *dev)
>> +{
>> +   struct devinfo_ops *ops = devinfo_get_ops(dev);
>> +
>> +   if (!ops->detect)
>> +   return -ENOSYS;
>> +
>> +   return ops->detect(dev);
>> +}
>> +
>> +int devinfo_get_bool(struct udevice *dev, int id, bool *val)
>> +{
>> +   struct devinfo_ops *ops = devinfo_get_ops(dev);
>> +
>> +   if (!ops->get_bool)
>> +   return -ENOSYS;
>> +
>> +   return ops->get_bool(dev, id, val);
>> +}
>> +
>> +int devinfo_get_int(struct udevice *dev, int id, int *val)
>> +{
>> +   struct devinfo_ops *ops = devinfo_get_ops(dev);
>> +
>> +   if (!ops->get_int)
>> +   return -ENOSYS;
>> +
>> +   return ops->get_int(dev, id, val);
>> +}
>> +
>> +int devinfo_get_str(struct udevice *dev, int id, char *val)
>> +{
>> +   struct devinfo_ops *ops = devinfo_get_ops(dev);
>> +
>> +   if (!ops->get_str)
>> +   return -ENOSYS;
>> +
>> +   return ops->get_str(dev, id, val);
>> +}
>> +
>> +UCLASS_DRIVER(devinfo) = {
>> +   .id = UCLASS_DEVINFO,
>> +   .name   = "devinfo",
>> +};
>> diff --git a/include/devinfo.h b/include/devinfo.h
>> new file mode 100644
>> index 00..90014c27c4
>> 

Re: [U-Boot] [PATCH 2/3] video_osd: Add ihs_video_out driver

2018-04-11 Thread Mario Six
Hi Simon,

On Fri, Mar 30, 2018 at 12:42 AM, Simon Glass  wrote:
> Hi Mario,
>
> On 28 March 2018 at 20:39, Mario Six  wrote:
>> Add a driver for IHS OSDs on IHS FPGAs.
>>
>> Signed-off-by: Mario Six 
>> ---
>>  drivers/misc/Kconfig  |   6 +-
>>  drivers/video/Kconfig |   7 ++
>>  drivers/video/Makefile|   1 +
>>  drivers/video/ihs_video_out.c | 277 
>> ++
>>  4 files changed, 290 insertions(+), 1 deletion(-)
>>  create mode 100644 drivers/video/ihs_video_out.c
>>
>> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
>> index d774569cbc..742fee3b76 100644
>> --- a/drivers/misc/Kconfig
>> +++ b/drivers/misc/Kconfig
>> @@ -263,5 +263,9 @@ config SYS_I2C_EEPROM_ADDR_OVERFLOW
>>
>>  endif
>>
>> -
>> +config IHS_VIDEO_OUT
>> +   bool "Enable IHS video out driver"
>> +   depends on MISC
>> +   help
>> + Support for IHS video out.
>
> What is IHS? Please greatly expand this help.
>
>>  endmenu
>> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
>> index da60bbe692..40a881cf56 100644
>> --- a/drivers/video/Kconfig
>> +++ b/drivers/video/Kconfig
>> @@ -668,4 +668,11 @@ config OSD
>>This supports drivers that provide a OSD (on-screen display), 
>> which
>>is a (usually text-oriented) graphics buffer to show information 
>> on
>>a display.
>> +
>> +config IHS_VIDEO_OUT
>> +   bool "Enable IHS video out driver"
>> +   depends on OSD
>> +   help
>> + Support for IHS video out OSD.
>
> Same here
>
>> +
>>  endmenu
>> diff --git a/drivers/video/Makefile b/drivers/video/Makefile
>> index 209d5e3a75..0d633e03d4 100644
>> --- a/drivers/video/Makefile
>> +++ b/drivers/video/Makefile
>> @@ -59,6 +59,7 @@ obj-${CONFIG_VIDEO_ROCKCHIP} += rockchip/
>>  obj-${CONFIG_VIDEO_STM32} += stm32/
>>
>>  obj-${CONFIG_OSD} += video_osd-uclass.o
>> +obj-$(CONFIG_IHS_VIDEO_OUT) += ihs_video_out.o
>>
>>  obj-y += bridge/
>>  obj-y += sunxi/
>> diff --git a/drivers/video/ihs_video_out.c b/drivers/video/ihs_video_out.c
>> new file mode 100644
>> index 00..3efb343c02
>> --- /dev/null
>> +++ b/drivers/video/ihs_video_out.c
>> @@ -0,0 +1,277 @@
>> +/*
>> + * (C) Copyright 2017
>> + * Mario Six, Guntermann & Drunck GmbH, mario@gdsys.cc
>> + *
>> + * based on the gdsys osd driver, which is
>> + *
>> + * (C) Copyright 2010
>> + * Dirk Eibach, Guntermann & Drunck GmbH, dirk.eib...@gdsys.de
>> + *
>> + * SPDX-License-Identifier:GPL-2.0+
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include "../misc/gdsys_soc.h"
>> +#include "../video/logicore_dp_tx.h"
>> +
>> +#define MAX_X_CHARS 53
>> +#define MAX_Y_CHARS 26
>> +#define MAX_VIDEOMEM_WIDTH (2 * 64)
>> +#define MAX_VIDEOMEM_HEIGHT (2 * 32)
>> +
>> +enum {
>> +   REG_VERSION = 0x00,
>> +   REG_FEATURES = 0x02,
>> +   REG_CONTROL = 0x04,
>> +   REG_XY_SIZE = 0x06,
>> +   REG_XY_SCALE = 0x08,
>> +   REG_X_POS = 0x0A,
>> +   REG_Y_POS = 0x0C,
>> +};
>> +
>> +struct ihs_video_out_priv {
>
> This struct needs a comment describing the members
>
>> +   int addr;
>> +   int osd_base;
>> +   int osd_buffer_base;
>> +   int osd_buffer_size;
>> +   uint base_width;
>> +   uint base_height;
>> +   uint res_x;
>> +   uint res_y;
>> +   int sync_src;
>> +   struct udevice *dp_tx;
>> +   struct udevice *clk_gen;
>> +};
>> +
>> +/**
>> + * struct ihs_video_out_data - information about a IHS OSD instance
>> + *
>> + * @width  Maximum width of the OSD screen in characters.
>> + * @heigth Maximum height of the OSD screen in characters.
>> + */
>> +struct ihs_video_out_data {
>> +   uint width;
>> +   uint height;
>> +};
>> +
>> +static const struct udevice_id ihs_video_out_ids[] = {
>> +   { .compatible = "gdsys,ihs_video_out" },
>> +   { }
>> +};
>> +
>> +static int set_control(struct udevice *dev, u16 value)
>> +{
>> +   struct ihs_video_out_priv *priv = dev_get_priv(dev);
>> +   struct udevice *fpga;
>> +
>> +   gdsys_soc_get_fpga(dev, );
>> +
>> +   if (priv->sync_src)
>> +   value |= ((priv->sync_src & 0x7) << 8);
>> +
>> +   fpgamap_write(fpga, priv->osd_base + REG_CONTROL, ,
>> + FPGAMAP_SIZE_16);
>> +
>> +   return 0;
>> +}
>> +
>> +static void print_info(struct udevice *dev)
>> +{
>
> Instead of printing the info, can you add a way to get the driver
> info? See cpu.h get_desc() for how it does it.
>
>> +   struct ihs_video_out_priv *priv = dev_get_priv(dev);
>> +   struct udevice *fpga;
>> +   u16 version;
>> +   u16 features;
>> +
>> +   gdsys_soc_get_fpga(dev, );
>> +
>> +   fpgamap_read(fpga, priv->osd_base + REG_VERSION, ,
>> +FPGAMAP_SIZE_16);
>> +   fpgamap_read(fpga, priv->osd_base + REG_FEATURES, ,
>> +

<    1   2