[U-Boot] [PATCH 2/4] imx: cx9020: migrate cx9020 to CONFIG_DM_USB

2019-10-22 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

Note: gpio7_8 was never used for usb power regulator so we remove it here

Acked-by: Patrick Bruenn 
Signed-off-by: Steffen Dirkwinkel 
---

 arch/arm/dts/imx53-cx9020.dts  | 11 ++-
 board/beckhoff/mx53cx9020/mx53cx9020.c | 10 --
 configs/mx53cx9020_defconfig   |  6 ++
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/arch/arm/dts/imx53-cx9020.dts b/arch/arm/dts/imx53-cx9020.dts
index 2b7f7288088..e08850999b1 100644
--- a/arch/arm/dts/imx53-cx9020.dts
+++ b/arch/arm/dts/imx53-cx9020.dts
@@ -36,7 +36,6 @@
MX53_PAD_GPIO_1__GPIO1_1  0x8000
MX53_PAD_GPIO_4__GPIO1_4  0x8000
MX53_PAD_PATA_DA_0__GPIO7_6   0x8000
-   MX53_PAD_PATA_DA_2__GPIO7_8   0x8000
MX53_PAD_GPIO_16__GPIO7_110x8000
 
MX53_PAD_EIM_OE__EMI_WEIM_OE
0x8000
@@ -220,3 +219,13 @@
full-duplex;
};
 };
+
+ {
+   phy_type = "utmi";
+   status = "okay";
+};
+
+ {
+   dr_mode = "host";
+   status = "okay";
+};
diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index 9450d925f6f..caffd5c9ee8 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -127,16 +127,6 @@ static void setup_gpio_leds(void)
gpio_direction_output(GPIO_LED_PWR_G, 0);
 }
 
-#ifdef CONFIG_USB_EHCI_MX5
-int board_ehci_hcd_init(int port)
-{
-   /* request VBUS power enable pin, GPIO7_8 */
-   gpio_direction_output(IMX_GPIO_NR(7, 8), 1);
-   return 0;
-}
-#endif
-
-
 static int power_init(void)
 {
/* nothing to do on CX9020 */
diff --git a/configs/mx53cx9020_defconfig b/configs/mx53cx9020_defconfig
index 17c44bd070a..6087ed81ec9 100644
--- a/configs/mx53cx9020_defconfig
+++ b/configs/mx53cx9020_defconfig
@@ -19,7 +19,13 @@ CONFIG_CMD_PXE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
+CONFIG_CMD_USB=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_MX5=y
+CONFIG_USB_STORAGE=y
+CONFIG_DM_REGULATOR=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx53-cx9020"
 CONFIG_ENV_IS_IN_MMC=y
-- 
2.23.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 3/4] imx: cx9020: enable vidconsole by default

2019-10-22 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

Acked-by: Patrick Bruenn 
Signed-off-by: Steffen Dirkwinkel 
---

 configs/mx53cx9020_defconfig | 1 +
 include/configs/mx53cx9020.h | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/configs/mx53cx9020_defconfig b/configs/mx53cx9020_defconfig
index 6087ed81ec9..d9c0637110e 100644
--- a/configs/mx53cx9020_defconfig
+++ b/configs/mx53cx9020_defconfig
@@ -43,3 +43,4 @@ CONFIG_PINCTRL_IMX5=y
 CONFIG_MXC_UART=y
 CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_IPUV3=y
+CONFIG_SYS_WHITE_ON_BLACK=y
diff --git a/include/configs/mx53cx9020.h b/include/configs/mx53cx9020.h
index f1007915118..5f35be5ab00 100644
--- a/include/configs/mx53cx9020.h
+++ b/include/configs/mx53cx9020.h
@@ -53,6 +53,9 @@
"pxefile_addr_r=0x7300\0" \
"ramdisk_addr_r=0x7200\0" \
"console=ttymxc1,115200\0" \
+   "stdin=serial\0" \
+   "stdout=serial,vidconsole\0" \
+   "stderr=serial,vidconsole\0" \
"uenv=/boot/uEnv.txt\0" \
"optargs=\0" \
"cmdline=\0" \
-- 
2.23.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 1/4] imx: cx9020: migrate cx9020 to CONFIG_DM_ETH

2019-10-22 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

Acked-by: Patrick Bruenn 
Signed-off-by: Steffen Dirkwinkel 
---

 arch/arm/dts/imx53-cx9020.dts | 31 ---
 configs/mx53cx9020_defconfig  |  2 ++
 include/configs/mx53cx9020.h  |  4 
 3 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/arch/arm/dts/imx53-cx9020.dts b/arch/arm/dts/imx53-cx9020.dts
index 36ceae36aa9..2b7f7288088 100644
--- a/arch/arm/dts/imx53-cx9020.dts
+++ b/arch/arm/dts/imx53-cx9020.dts
@@ -99,17 +99,6 @@
MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS 
0x8000
MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD  
0x8000
 
-   MX53_PAD_FEC_MDC__FEC_MDC   0x4
-   MX53_PAD_FEC_MDIO__FEC_MDIO 0x1fc
-   MX53_PAD_FEC_REF_CLK__FEC_TX_CLK0x180
-   MX53_PAD_FEC_RX_ER__FEC_RX_ER   0x180
-   MX53_PAD_FEC_CRS_DV__FEC_RX_DV  0x180
-   MX53_PAD_FEC_RXD1__FEC_RDATA_1  0x180
-   MX53_PAD_FEC_RXD0__FEC_RDATA_0  0x180
-   MX53_PAD_FEC_TX_EN__FEC_TX_EN   0x4
-   MX53_PAD_FEC_TXD1__FEC_TDATA_1  0x4
-   MX53_PAD_FEC_TXD0__FEC_TDATA_0  0x4
-
MX53_PAD_CSI0_DAT8__I2C1_SDA
0x41ec
MX53_PAD_CSI0_DAT9__I2C1_SCL
0x41ec
 
@@ -148,6 +137,21 @@
>;
};
 
+   pinctrl_fec0: fec0grp {
+   fsl,pins = <
+   MX53_PAD_FEC_MDC__FEC_MDC   0x4
+   MX53_PAD_FEC_MDIO__FEC_MDIO 0x1fc
+   MX53_PAD_FEC_REF_CLK__FEC_TX_CLK0x180
+   MX53_PAD_FEC_RX_ER__FEC_RX_ER   0x180
+   MX53_PAD_FEC_CRS_DV__FEC_RX_DV  0x180
+   MX53_PAD_FEC_RXD1__FEC_RDATA_1  0x180
+   MX53_PAD_FEC_RXD0__FEC_RDATA_0  0x180
+   MX53_PAD_FEC_TX_EN__FEC_TX_EN   0x4
+   MX53_PAD_FEC_TXD1__FEC_TDATA_1  0x4
+   MX53_PAD_FEC_TXD0__FEC_TDATA_0  0x4
+   >;
+   };
+
pinctrl_esdhc1: esdhc1grp {
fsl,pins = <
MX53_PAD_SD1_DATA0__ESDHC1_DAT0 0x1d5
@@ -209,5 +213,10 @@
pinctrl-names = "default";
phy-mode = "rmii";
phy-reset-gpios = < 6 0>;
+   pinctrl-0 = <_fec0>;
status = "okay";
+   fixed-link { /* RMII fixed link to KZ8863 */
+   speed = <100>;
+   full-duplex;
+   };
 };
diff --git a/configs/mx53cx9020_defconfig b/configs/mx53cx9020_defconfig
index 4ed38250f31..17c44bd070a 100644
--- a/configs/mx53cx9020_defconfig
+++ b/configs/mx53cx9020_defconfig
@@ -28,7 +28,9 @@ CONFIG_FPGA_CYCLON2=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_FSL_ESDHC_IMX=y
+CONFIG_DM_ETH=y
 CONFIG_FEC_MXC=y
+CONFIG_PHYLIB=y
 CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX5=y
diff --git a/include/configs/mx53cx9020.h b/include/configs/mx53cx9020.h
index bbe05740330..f1007915118 100644
--- a/include/configs/mx53cx9020.h
+++ b/include/configs/mx53cx9020.h
@@ -35,10 +35,6 @@
 
 /* bootz: zImage/initrd.img support */
 
-/* Eth Configs */
-#define IMX_FEC_BASE   FEC_BASE_ADDR
-#define CONFIG_ETHPRIME"FEC0"
-#define CONFIG_FEC_MXC_PHYADDR 0x1F
 
 /* USB Configs */
 #define CONFIG_MXC_USB_PORT1
-- 
2.23.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 0/4] Migrate cx9020 to DM_ETH, DM_USB and distro boot

2019-10-22 Thread linux-kernel-dev
From: Steffen Dirkwinkel 


This series migrates the cx9020 to DM_ETH and DM_USB.
It also switches bootcmds from custom uEnv.txt based booting to
distroboot.

DM_USB works but enabling usb keyboards just makes them disappear from
the usb device list.

The cx9020 board needs to load a bitstream into an fpga. It's currently
easiest to use boot.scr boot scripts to load the bitstream with u-boot.
In the future this might be implemented in the kernel driver for the
fpga to support full boot with extlinux.conf.


Steffen Dirkwinkel (4):
  imx: cx9020: migrate cx9020 to CONFIG_DM_ETH
  imx: cx9020: migrate cx9020 to CONFIG_DM_USB
  imx: cx9020: enable vidconsole by default
  imx: cx9020: use distro boot

 arch/arm/dts/imx53-cx9020.dts  | 42 
 board/beckhoff/mx53cx9020/mx53cx9020.c | 10 ---
 configs/mx53cx9020_defconfig   | 10 +++
 include/configs/mx53cx9020.h   | 95 ++
 4 files changed, 59 insertions(+), 98 deletions(-)

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


[U-Boot] [PATCH 4/4] imx: cx9020: use distro boot

2019-10-22 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

We switch from custom boot commands relying on uEnv.txt to distro boot.
This removes the automatic fpga bitstream loading in favor of loading
bitstreams via custom bootscripts (boot.scr) or after booting the
kernel.

Acked-by: Patrick Bruenn 
Signed-off-by: Steffen Dirkwinkel 
---
Checkpatch complains with:
>  include/configs/mx53cx9020.h:51: check: Macro argument reuse 'func' - 
> possible side-effects?
Is this expected? I can't see what's wrong though i may have missed
something obvious.

 configs/mx53cx9020_defconfig |  1 +
 include/configs/mx53cx9020.h | 88 +++-
 2 files changed, 17 insertions(+), 72 deletions(-)

diff --git a/configs/mx53cx9020_defconfig b/configs/mx53cx9020_defconfig
index d9c0637110e..ef5cb9775a2 100644
--- a/configs/mx53cx9020_defconfig
+++ b/configs/mx53cx9020_defconfig
@@ -7,6 +7,7 @@ CONFIG_NR_DRAM_BANKS=2
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/beckhoff/mx53cx9020/imximage.cfg"
 CONFIG_BOOTDELAY=1
 CONFIG_USE_PREBOOT=y
+CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SUPPORT_RAW_INITRD=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
diff --git a/include/configs/mx53cx9020.h b/include/configs/mx53cx9020.h
index 5f35be5ab00..db40fe71b36 100644
--- a/include/configs/mx53cx9020.h
+++ b/include/configs/mx53cx9020.h
@@ -21,7 +21,7 @@
 #define CONFIG_SYS_FSL_CLK
 
 /* Size of malloc() pool */
-#define CONFIG_SYS_MALLOC_LEN  (10 * 1024 * 1024)
+#define CONFIG_SYS_MALLOC_LEN  (32 * 1024 * 1024)
 
 #define CONFIG_REVISION_TAG
 
@@ -48,83 +48,27 @@
 
 #define CONFIG_LOADADDR0x7001  /* loadaddr env var */
 
+#define BOOT_TARGET_DEVICES(func) \
+   func(MMC, mmc, 0) \
+   func(MMC, mmc, 1) \
+   func(USB, usb, 0) \
+   func(PXE, pxe, na)
+
+#include 
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   "fdt_addr_r=0x71ff\0" \
+   "fdt_addr_r=0x7500\0" \
"pxefile_addr_r=0x7300\0" \
-   "ramdisk_addr_r=0x7200\0" \
+   "scriptaddr=0x7400\0" \
+   "ramdisk_addr_r=0x8000\0" \
+   "kernel_addr_r=0x7200\0"  \
+   "fdt_high=0x\0" \
"console=ttymxc1,115200\0" \
"stdin=serial\0" \
"stdout=serial,vidconsole\0" \
"stderr=serial,vidconsole\0" \
-   "uenv=/boot/uEnv.txt\0" \
-   "optargs=\0" \
-   "cmdline=\0" \
-   "mmcdev=0\0" \
-   "mmcpart=1\0" \
-   "mmcrootfstype=ext4 rootwait fixrtc\0" \
-   "mmcargs=setenv bootargs console=${console} " \
-   "${optargs} " \
-   "root=/dev/mmcblk${mmcdev}p${mmcpart} ro " \
-   "rootfstype=${mmcrootfstype} " \
-   "${cmdline}\0" \
-   "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
-   "loadpxe=dhcp;setenv kernel_addr_r ${loadaddr};pxe get;pxe boot;\0" \
-   "loadrd=load mmc ${bootpart} ${ramdisk_addr_r} ${bootdir}/${rdfile};" \
-   "setenv rdsize ${filesize}\0" \
-   "loadfdt=echo loading ${fdt_path} ...;" \
-   "load mmc ${bootpart} ${fdt_addr_r} ${fdt_path}\0" \
-   "mmcboot=mmc dev ${mmcdev}; " \
-   "if mmc rescan; then " \
-   "echo SD/MMC found on device ${mmcdev};" \
-   "echo Checking for: ${uenv} ...;" \
-   "setenv bootpart ${mmcdev}:${mmcpart};" \
-   "if test -e mmc ${bootpart} ${uenv}; then " \
-   "load mmc ${bootpart} ${loadaddr} ${uenv};" \
-   "env import -t ${loadaddr} ${filesize};" \
-   "echo Loaded environment from ${uenv};" \
-   "if test -n ${dtb}; then " \
-   "setenv fdt_file ${dtb};" \
-   "echo Using: dtb=${fdt_file} ...;" \
-   "fi;" \
-   "echo Checking for uname_r in ${uenv}...;" \
-   "if test -n ${uname_r}; then " \
-   "echo Running uname_boot ...;" \
-   "run uname_boot;" \
-   "fi;" \
-   "fi;" \
-   "fi;\0" \
-   "uname_boot="\
-   "setenv bootdir /boot; " \
-   "setenv bootfile vmlinuz-${uname_r}; " \
-   "setenv ccatfile /boot/ccat.rbf; " \
-   "echo loading CCAT firmware from ${ccatfile}; " \
-   "load mmc ${bootpart} ${loadaddr} ${ccatfile}; " \
-   "fpga load 0 ${loadaddr} ${filesize}; " \
-   "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \
-   "echo loading ${bootdir}/${bootfile} ...; " \
-   "run loadimage;" \
-   "setenv fdt_path /boot/dtbs/${uname_r}/${fdt_file}; " \
-   "if test -e mmc ${bootpart} ${fdt_path}; then " \
-   

Re: [U-Boot] [v3, 0/5] Split fsl_esdhc driver for i.MX

2019-05-23 Thread linux-kernel-dev
Hi

On Tue, 2019-05-21 at 08:51 +, Y.b. Lu wrote:
> The fsl_esdhc driver was for Freescale eSDHC on MPC83XX/MPC85XX
> initially. The later QoriQ series PowerPC processors (which were
> evolutions of MPC83XX/MPC85XX), QorIQ series ARM processors, and
> i.MX series processors were using this driver for their eSDHCs too.
> 
> For the two series processors, the eSDHCs are becoming more and
> more different. We should have split it into two drivers, like them
> (sdhci-of-esdhc.c/sdhci-esdhc-imx.c) in linux kernel.
> 
> It's ideal to keep common part for reusing. However, it's hard to
> find out a little which could be reused. The truth is there will
> be more and more different registers, bits and operatiing processes.
> Even some code is common now, it may have to be split in the future.
> So let's just split is as two drivers.
> 
> Patch #2 just created a fsl_esdhc_imx driver which was a copy
> of fsl_esdhc driver for i.MX processors.
> Patch #3 converted i.MX platforms to use fsl_esdhc_imx.
> Patch #4 and #5 just dropped useless code for the two driver.
> There are still many cleaning up works needed to be done in the
> future,
> because the eSDHC driver is mess for a long time.
> Since I'm only owner for QorIQ eSDHC driver, I dropped only a little
> things which I'm sure for fsl_esdhc_imx. Let i.MX eSDHC owner do
> futhur
> cleaning up.

Tested-by: Steffen Dirkwinkel s.dirkwin...@beckhoff.com

I've tested this on the beckhoff/mx53cx9020 board. It still boots from
sd after the changes. When rebasing to master this board only needs the
defconfig change as we've recently removed the unused mmc code
in "mx53cx9020.c".

Regards,
Steffen Dirkwinkel

> 
> Yangbo Lu (5):
>   Move CONFIG_FSL_ESDHC to defconfig
>   mmc: split fsl_esdhc driver for i.MX
>   Convert to use fsl_esdhc_imx for i.MX platforms
>   mmc: fsl_esdhc: drop i.MX code
>   mmc: fsl_esdhc_imx: drop useless code
> 
>  arch/arm/cpu/arm1136/mx35/generic.c   |  10 +-
>  arch/arm/cpu/arm926ejs/mx25/generic.c |   8 +-
>  arch/arm/cpu/armv7/vf610/generic.c|  10 +-
>  arch/arm/cpu/armv8/s32v234/generic.c  |   2 +-
>  arch/arm/include/asm/global_data.h|   2 +-
>  arch/arm/mach-imx/cpu.c   |   6 +-
>  arch/arm/mach-imx/mx6/litesom.c   |   4 +-
>  arch/arm/mach-imx/mx7/clock.c |   4 +-
>  arch/arm/mach-imx/mx7ulp/clock.c  |   2 +-
>  arch/arm/mach-imx/speed.c |   4 +-
>  board/advantech/dms-ba16/dms-ba16.c   |   4 +-
>  board/aristainetos/aristainetos-v1.c  |   2 +-
>  board/aristainetos/aristainetos-v2.c  |   2 +-
>  board/aristainetos/aristainetos.c |   4 +-
>  board/bachmann/ot1200/ot1200.c|   2 +-
>  board/barco/platinum/platinum.c   |   2 +-
>  board/barco/titanium/titanium.c   |   4 +-
>  board/beckhoff/mx53cx9020/mx53cx9020.c|   4 +-
>  board/boundary/nitrogen6x/nitrogen6x.c|   4 +-
>  board/ccv/xpress/xpress.c |   2 +-
>  board/compulab/cl-som-imx7/cl-som-imx7.c  |   6 +-
>  board/compulab/cl-som-imx7/common.c   |   6 +-
>  board/compulab/cl-som-imx7/common.h   |   8 +-
>  board/compulab/cl-som-imx7/mux.c  |   8 +-
>  board/compulab/cl-som-imx7/spl.c  |   6 +-
>  board/compulab/cm_fx6/cm_fx6.c|   4 +-
>  board/compulab/cm_fx6/common.c|   4 +-
>  board/compulab/cm_fx6/spl.c   |   2 +-
>  board/congatec/cgtqmx6eval/cgtqmx6eval.c  |   4 +-
>  board/dhelectronics/dh_imx6/dh_imx6.c |   4 +-
>  board/dhelectronics/dh_imx6/dh_imx6_spl.c |   2 +-
>  board/el/el6x/el6x.c  |   4 +-
>  board/embest/mx6boards/mx6boards.c|   4 +-
>  board/freescale/imx8mq_evk/imx8mq_evk.c   |   2 +-
>  board/freescale/imx8mq_evk/spl.c  |   2 +-
>  board/freescale/imx8qxp_mek/imx8qxp_mek.c |   2 +-
>  board/freescale/mx25pdk/mx25pdk.c |   6 +-
>  board/freescale/mx35pdk/mx35pdk.c |   4 +-
>  board/freescale/mx51evk/mx51evk.c |   6 +-
>  board/freescale/mx53ard/mx53ard.c |   4 +-
>  board/freescale/mx53evk/mx53evk.c |   4 +-
>  board/freescale/mx53loco/mx53loco.c   |   4 +-
>  board/freescale/mx53smd/mx53smd.c |   4 +-
>  board/freescale/mx6qarm2/mx6qarm2.c   |   4 +-
>  board/freescale/mx6sabreauto/mx6sabreauto.c   |   4 +-
>  board/freescale/mx6sabresd/mx6sabresd.c   |   4 +-
>  board/freescale/mx6slevk/mx6slevk.c   |   2 +-
>  .../freescale/mx6sxsabreauto/mx6sxsabreauto.c |   2 +-
>  board/freescale/mx6sxsabresd/mx6sxsabresd.c   |   2 +-
>  .../mx6ul_14x14_evk/mx6ul_14x14_evk.c |   4 +-
>  board/freescale/mx6ullevk/mx6ullevk.c |   2 +-
>  board/freescale/mx7dsabresd/mx7dsabresd.c |   2 +-
>  board/freescale/s32v234evb/s32v234evb.c   |   4 +-
>  

[U-Boot] [PATCH v1 5/6] dm: arm: imx: cx9020: remove unused mmc functions

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

These mmc functions were not used anymore since DM_MMC was introduced.

Acked-by: Patrick Bruenn 
Signed-off-by: Steffen Dirkwinkel 
---

 board/beckhoff/mx53cx9020/mx53cx9020.c | 55 --
 1 file changed, 55 deletions(-)

diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index fdef4477d9a..de1d85f1518 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -9,7 +9,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -20,11 +19,8 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
-#include 
 #include 
 
 enum LED_GPIOS {
@@ -148,57 +144,6 @@ int board_ehci_hcd_init(int port)
 }
 #endif
 
-#ifdef CONFIG_FSL_ESDHC
-struct fsl_esdhc_cfg esdhc_cfg[2] = {
-   {MMC_SDHC1_BASE_ADDR},
-   {MMC_SDHC2_BASE_ADDR},
-};
-
-int board_mmc_getcd(struct mmc *mmc)
-{
-   struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
-   int ret;
-
-   gpio_request(GPIO_SD1_CD, "GPIO_SD1_CD");
-   gpio_request(GPIO_SD2_CD, "GPIO_SD2_CD");
-   gpio_direction_input(GPIO_SD1_CD);
-   gpio_direction_input(GPIO_SD2_CD);
-
-   if (cfg->esdhc_base == MMC_SDHC1_BASE_ADDR)
-   ret = !gpio_get_value(GPIO_SD1_CD);
-   else
-   ret = !gpio_get_value(GPIO_SD2_CD);
-
-   return ret;
-}
-
-int board_mmc_init(bd_t *bis)
-{
-   u32 index;
-   int ret;
-
-   esdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
-   esdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
-
-   for (index = 0; index < CONFIG_SYS_FSL_ESDHC_NUM; index++) {
-   switch (index) {
-   case 0:
-   break;
-   case 1:
-   break;
-   default:
-   printf("Warning: you configured more ESDHC 
controller(%d) as supported by the board(2)\n",
-  CONFIG_SYS_FSL_ESDHC_NUM);
-   return -EINVAL;
-   }
-   ret = fsl_esdhc_initialize(bis, _cfg[index]);
-   if (ret)
-   return ret;
-   }
-
-   return 0;
-}
-#endif
 
 static int power_init(void)
 {
-- 
2.21.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 6/6] arm: imx: cx9020: remove unnecessary includes

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

There are several includes in mx53cx9020.c which are not required
anymore.

Acked-by: Patrick Bruenn 
Signed-off-by: Steffen Dirkwinkel 
---

 board/beckhoff/mx53cx9020/mx53cx9020.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index de1d85f1518..9450d925f6f 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -8,20 +8,12 @@
  */
 
 #include 
-#include 
-#include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
 
 enum LED_GPIOS {
GPIO_SD1_CD = IMX_GPIO_NR(1, 1),
-- 
2.21.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 4/6] dm: arm: imx: cx9020: migrate to dm_video

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

Enable DM_VIDEO in config and don't overwrite console so it can be set
from environment

Acked-by: Patrick Bruenn 
Signed-off-by: Steffen Dirkwinkel 
---

 board/beckhoff/mx53cx9020/Makefile   |  2 +-
 board/beckhoff/mx53cx9020/mx53cx9020.c   | 11 -
 board/beckhoff/mx53cx9020/mx53cx9020_video.c | 51 +---
 configs/mx53cx9020_defconfig |  5 +-
 include/configs/mx53cx9020.h |  6 +--
 5 files changed, 28 insertions(+), 47 deletions(-)

diff --git a/board/beckhoff/mx53cx9020/Makefile 
b/board/beckhoff/mx53cx9020/Makefile
index 423a5532ca6..7f15fc5746d 100644
--- a/board/beckhoff/mx53cx9020/Makefile
+++ b/board/beckhoff/mx53cx9020/Makefile
@@ -4,4 +4,4 @@
 # Patrick Bruenn 
 
 obj-y   += mx53cx9020.o
-obj-$(CONFIG_VIDEO) += mx53cx9020_video.o
+obj-$(CONFIG_DM_VIDEO) += mx53cx9020_video.o
diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index 79ea4560283..fdef4477d9a 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -23,8 +23,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -232,15 +230,6 @@ int board_early_init_f(void)
return 0;
 }
 
-/*
- * Do not overwrite the console
- * Use always serial for U-Boot console
- */
-int overwrite_console(void)
-{
-   return 1;
-}
-
 int board_init(void)
 {
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
diff --git a/board/beckhoff/mx53cx9020/mx53cx9020_video.c 
b/board/beckhoff/mx53cx9020/mx53cx9020_video.c
index 85f1cdae8af..bf472902562 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020_video.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020_video.c
@@ -8,29 +8,34 @@
  */
 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
+#include 
+#include 
 
 #define CX9020_DVI_PWD IMX_GPIO_NR(6, 1)
 
-static struct fb_videomode const vga_640x480 = {
-   .name = "VESA_VGA_640x480",
-   .refresh = 60,
-   .xres = 640,
-   .yres = 480,
-   .pixclock = 39721,  /* picosecond (25.175 MHz) */
-   .left_margin = 40,
-   .right_margin = 60,
-   .upper_margin = 10,
-   .lower_margin = 10,
-   .hsync_len = 20,
-   .vsync_len = 10,
-   .sync = 0,
-   .vmode = FB_VMODE_NONINTERLACED
-};
+struct display_info_t const displays[] = {{
+   .bus= -1,
+   .addr   = 0,
+   .pixfmt = IPU_PIX_FMT_RGB24,
+   .detect = NULL,
+   .enable = NULL,
+   .mode   = {
+   .name   = "DVI",
+   .refresh = 60,
+   .xres = 640,
+   .yres = 480,
+   .pixclock = 39721,  /* picosecond (25.175 MHz) */
+   .left_margin = 40,
+   .right_margin = 60,
+   .upper_margin = 10,
+   .lower_margin = 10,
+   .hsync_len = 20,
+   .vsync_len = 10,
+   .sync = 0,
+   .vmode = FB_VMODE_NONINTERLACED
+} } };
+size_t display_count = ARRAY_SIZE(displays);
 
 void setup_iomux_lcd(void)
 {
@@ -39,11 +44,3 @@ void setup_iomux_lcd(void)
gpio_request(CX9020_DVI_PWD, "CX9020_DVI_PWD");
gpio_direction_output(CX9020_DVI_PWD, 1);
 }
-
-int board_video_skip(void)
-{
-   const int ret = ipuv3_fb_init(_640x480, 0, IPU_PIX_FMT_RGB24);
-   if (ret)
-   printf("VESA VG 640x480 cannot be configured: %d\n", ret);
-   return ret;
-}
diff --git a/configs/mx53cx9020_defconfig b/configs/mx53cx9020_defconfig
index 93c113aba73..11b414f790e 100644
--- a/configs/mx53cx9020_defconfig
+++ b/configs/mx53cx9020_defconfig
@@ -33,6 +33,5 @@ CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX5=y
 CONFIG_MXC_UART=y
-CONFIG_VIDEO=y
-CONFIG_VIDEO_IPUV3=y
-# CONFIG_VIDEO_SW_CURSOR is not set
+CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_IPUV3=y
\ No newline at end of file
diff --git a/include/configs/mx53cx9020.h b/include/configs/mx53cx9020.h
index 1e3ea88b77a..66a0f319c45 100644
--- a/include/configs/mx53cx9020.h
+++ b/include/configs/mx53cx9020.h
@@ -160,11 +160,7 @@
 #define CONFIG_SYS_MMC_ENV_DEV 0
 
 /* Framebuffer and LCD */
+#define CONFIG_IMX_VIDEO_SKIP
 #define CONFIG_PREBOOT
-#define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
-#define CONFIG_VIDEO_BMP_RLE8
-#define CONFIG_SPLASH_SCREEN
-#define CONFIG_BMP_16BPP
-#define CONFIG_VIDEO_LOGO
 
 #endif /* __CONFIG_H */
-- 
2.21.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 3/6] arm: imx: add ipu to imx53.dts and set dm-pre-reloc

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

The ipu node in imx53 is needed for DM_VIDEO. We also need to set
u-boot,dm-pre-reloc to initialize before relocation.

Signed-off-by: Steffen Dirkwinkel 
---

 arch/arm/dts/imx53.dtsi | 137 
 1 file changed, 137 insertions(+)

diff --git a/arch/arm/dts/imx53.dtsi b/arch/arm/dts/imx53.dtsi
index 0fd4acc6f53..7a47602b53d 100644
--- a/arch/arm/dts/imx53.dtsi
+++ b/arch/arm/dts/imx53.dtsi
@@ -31,6 +31,7 @@
i2c0 = 
i2c1 = 
i2c2 = 
+   ipu0 = 
mmc0 = 
mmc1 = 
mmc2 = 
@@ -50,6 +51,7 @@
compatible = "simple-bus";
interrupt-parent = <>;
ranges;
+   u-boot,dm-pre-reloc;
 
aips@5000 { /* AIPS1 */
compatible = "fsl,aips-bus", "simple-bus";
@@ -273,5 +275,140 @@
status = "disabled";
};
};
+
+   ipu: ipu@1800 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "fsl,imx53-ipu";
+   reg = <0x1800 0x0800>;
+   interrupts = <11 10>;
+   clocks = < IMX5_CLK_IPU_GATE>,
+< IMX5_CLK_IPU_DI0_GATE>,
+< IMX5_CLK_IPU_DI1_GATE>;
+   clock-names = "bus", "di0", "di1";
+   resets = < 2>;
+   u-boot,dm-pre-reloc;
+
+   ipu_csi0: port@0 {
+   reg = <0>;
+   };
+
+   ipu_csi1: port@1 {
+   reg = <1>;
+   };
+
+   ipu_di0: port@2 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <2>;
+
+   ipu_di0_disp0: endpoint@0 {
+   reg = <0>;
+   };
+
+   ipu_di0_lvds0: endpoint@1 {
+   reg = <1>;
+   remote-endpoint = <_in>;
+   };
+   };
+
+   ipu_di1: port@3 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   reg = <3>;
+
+   ipu_di1_disp1: endpoint@0 {
+   reg = <0>;
+   };
+
+   ipu_di1_lvds1: endpoint@1 {
+   reg = <1>;
+   remote-endpoint = <_in>;
+   };
+
+   ipu_di1_tve: endpoint@2 {
+   reg = <2>;
+   remote-endpoint = <_in>;
+   };
+   };
+   };
+
+   tve: tve@63ff {
+   compatible = "fsl,imx53-tve";
+   reg = <0x63ff 0x1000>;
+   interrupts = <92>;
+   clocks = < IMX5_CLK_TVE_GATE>,
+< IMX5_CLK_IPU_DI1_SEL>;
+   clock-names = "tve", "di_sel";
+   status = "disabled";
+
+   port {
+   tve_in: endpoint {
+   remote-endpoint = 
<_di1_tve>;
+   };
+   };
+   };
+
+   src: src@53fd {
+   compatible = "fsl,imx53-src", "fsl,imx51-src";
+   reg = <0x53fd 0x4000>;
+   #reset-cells = <1>;
+   };
+
+   ldb: ldb@53fa8008 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "fsl,imx53-ldb";
+   reg = <0x53fa8008 0x4>;
+   gpr = <>;
+   clocks = < IMX5_CLK_LDB_DI0_SEL>,
+< IMX5_CLK_LDB_DI1_SEL>,
+< IMX5_CLK_IPU_DI0_SEL>,
+< IMX5_CLK_IPU_DI1_SEL>,
+< IMX5_CLK_LDB_DI0_GATE>,
+< IMX5_CLK_LDB_DI1_GATE>;
+   clock-names = "di0_pll", 

[U-Boot] [PATCH v1 2/6] dm: arm: imx: video: add compatible for imx53-ipu

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

This code also works with imx53 ipus so we can enable it for them.

Signed-off-by: Steffen Dirkwinkel 
---

 drivers/video/imx/mxc_ipuv3_fb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/imx/mxc_ipuv3_fb.c b/drivers/video/imx/mxc_ipuv3_fb.c
index 3e38d4bdcc3..1aca9eba228 100644
--- a/drivers/video/imx/mxc_ipuv3_fb.c
+++ b/drivers/video/imx/mxc_ipuv3_fb.c
@@ -685,6 +685,7 @@ static int ipuv3_video_bind(struct udevice *dev)
 
 static const struct udevice_id ipuv3_video_ids[] = {
{ .compatible = "fsl,imx6q-ipu" },
+   { .compatible = "fsl,imx53-ipu" },
{ }
 };
 
-- 
2.21.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 1/6] dm: arm: imx: cx9020: enable DM_GPIO

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 

Switch to DM_GPIO and add gpio_request where necessary.
This is needed for DM_VIDEO and fixes an issue with sd card detection
which was introduced by the combination of these commits:

commit 7a0425dd969c ("mmc: fsl_esdhc: make get_cd work well in dm_mmc_ops")
commit 7e04b4c751a1 ("dm: arm: imx: migrate cx9020 to CONFIG_DM_MMC")

Acked-by: Patrick Bruenn 
Signed-off-by: Steffen Dirkwinkel 
---

 board/beckhoff/mx53cx9020/mx53cx9020.c   | 25 
 board/beckhoff/mx53cx9020/mx53cx9020_video.c |  1 +
 configs/mx53cx9020_defconfig |  2 ++
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index 79d8a62cf1b..79ea4560283 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -91,6 +91,9 @@ void weim_cs0_settings(u32 mode)
 
 static void setup_gpio_eim(void)
 {
+   gpio_request(GPIO_C3_STATUS, "GPIO_C3_STATUS");
+   gpio_request(GPIO_C3_DONE, "GPIO_C3_DONE");
+   gpio_request(GPIO_C3_CONFIG, "GPIO_C3_CONFIG");
gpio_direction_input(GPIO_C3_STATUS);
gpio_direction_input(GPIO_C3_DONE);
gpio_direction_output(GPIO_C3_CONFIG, 1);
@@ -100,6 +103,7 @@ static void setup_gpio_eim(void)
 
 static void setup_gpio_sups(void)
 {
+   gpio_request(GPIO_SUPS_INT, "GPIO_SUPS_INT");
gpio_direction_input(GPIO_SUPS_INT);
 
static const int BLINK_INTERVALL = 5;
@@ -116,6 +120,16 @@ static void setup_gpio_sups(void)
 
 static void setup_gpio_leds(void)
 {
+   gpio_request(GPIO_LED_SD2_R, "GPIO_LED_SD2_R");
+   gpio_request(GPIO_LED_SD2_B, "GPIO_LED_SD2_B");
+   gpio_request(GPIO_LED_SD2_G, "GPIO_LED_SD2_G");
+   gpio_request(GPIO_LED_SD1_R, "GPIO_LED_SD1_R");
+   gpio_request(GPIO_LED_SD1_B, "GPIO_LED_SD1_B");
+   gpio_request(GPIO_LED_SD1_G, "GPIO_LED_SD1_G");
+   gpio_request(GPIO_LED_PWR_R, "GPIO_LED_PWR_R");
+   gpio_request(GPIO_LED_PWR_B, "GPIO_LED_PWR_B");
+   gpio_request(GPIO_LED_PWR_G, "GPIO_LED_PWR_G");
+
gpio_direction_output(GPIO_LED_SD2_R, 0);
gpio_direction_output(GPIO_LED_SD2_B, 0);
gpio_direction_output(GPIO_LED_SD2_G, 0);
@@ -147,6 +161,8 @@ int board_mmc_getcd(struct mmc *mmc)
struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
int ret;
 
+   gpio_request(GPIO_SD1_CD, "GPIO_SD1_CD");
+   gpio_request(GPIO_SD2_CD, "GPIO_SD2_CD");
gpio_direction_input(GPIO_SD1_CD);
gpio_direction_input(GPIO_SD2_CD);
 
@@ -212,10 +228,6 @@ static void clock_1GHz(void)
 
 int board_early_init_f(void)
 {
-   setup_gpio_leds();
-   setup_gpio_sups();
-   setup_gpio_eim();
-   setup_iomux_lcd();
 
return 0;
 }
@@ -235,6 +247,11 @@ int board_init(void)
 
mxc_set_sata_internal_clock();
 
+   setup_gpio_leds();
+   setup_gpio_sups();
+   setup_gpio_eim();
+   setup_iomux_lcd();
+
return 0;
 }
 
diff --git a/board/beckhoff/mx53cx9020/mx53cx9020_video.c 
b/board/beckhoff/mx53cx9020/mx53cx9020_video.c
index 4055bccc2b7..85f1cdae8af 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020_video.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020_video.c
@@ -36,6 +36,7 @@ void setup_iomux_lcd(void)
 {
/* Turn on DVI_PWD */
imx_iomux_v3_setup_pad(MX53_PAD_CSI0_DAT15__GPIO6_1);
+   gpio_request(CX9020_DVI_PWD, "CX9020_DVI_PWD");
gpio_direction_output(CX9020_DVI_PWD, 1);
 }
 
diff --git a/configs/mx53cx9020_defconfig b/configs/mx53cx9020_defconfig
index 831d50925f3..93c113aba73 100644
--- a/configs/mx53cx9020_defconfig
+++ b/configs/mx53cx9020_defconfig
@@ -24,7 +24,9 @@ CONFIG_DEFAULT_DEVICE_TREE="imx53-cx9020"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_FPGA_ALTERA=y
 CONFIG_FPGA_CYCLON2=y
+CONFIG_DM=y
 CONFIG_DM_MMC=y
+CONFIG_DM_GPIO=y
 CONFIG_FSL_ESDHC=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
-- 
2.21.0
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 0/6] arm: imx: cx9020: Migrate to DM_VIDEO and DM_GPIO

2019-04-17 Thread linux-kernel-dev
From: Steffen Dirkwinkel 


This series migrates mx53cx9020 to DM_VIDEO and DM_GPIO.
The first patch allows the board to boot again by enabling DM_GPIO.
This was broken due to card detect not working with a combination
of previous commits.
Patches 2-4 add ipu device tree nodes for mx53, enable them in the video
driver and migrate the board to using DM_VIDEO.
The last patches remove functions which were used before DM_MMC and
uneccessary includes.


Steffen Dirkwinkel (6):
  dm: arm: imx: cx9020: enable DM_GPIO
  dm: arm: imx: video: add compatible for imx53-ipu
  arm: imx: add ipu to imx53.dts and set dm-pre-reloc
  dm: arm: imx: cx9020: migrate to dm_video
  dm: arm: imx: cx9020: remove unused mmc functions
  arm: imx: cx9020: remove unnecessary includes

 arch/arm/dts/imx53.dtsi  | 137 +++
 board/beckhoff/mx53cx9020/Makefile   |   2 +-
 board/beckhoff/mx53cx9020/mx53cx9020.c   |  95 +++--
 board/beckhoff/mx53cx9020/mx53cx9020_video.c |  52 ---
 configs/mx53cx9020_defconfig |   7 +-
 drivers/video/imx/mxc_ipuv3_fb.c |   1 +
 include/configs/mx53cx9020.h |   6 +-
 7 files changed, 188 insertions(+), 112 deletions(-)

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


[U-Boot] [PATCH 3/3] dm: arm: imx: migrate cx9020 to CONFIG_DM_MMC

2019-01-02 Thread linux-kernel-dev
From: Patrick Bruenn 

Enable esdhc1/2 device nodes for cx9020 and build with CONFIG_DM_MMC=y

Signed-off-by: Patrick Bruenn 

---

 arch/arm/dts/imx53-cx9020.dts | 52 +++
 configs/mx53cx9020_defconfig  |  1 +
 2 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/arch/arm/dts/imx53-cx9020.dts b/arch/arm/dts/imx53-cx9020.dts
index c2e7d86c1b8..36ceae36aa9 100644
--- a/arch/arm/dts/imx53-cx9020.dts
+++ b/arch/arm/dts/imx53-cx9020.dts
@@ -99,20 +99,6 @@
MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS 
0x8000
MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD  
0x8000
 
-   MX53_PAD_SD1_DATA0__ESDHC1_DAT0 0x1d5
-   MX53_PAD_SD1_DATA1__ESDHC1_DAT1 0x1d5
-   MX53_PAD_SD1_DATA2__ESDHC1_DAT2 0x1d5
-   MX53_PAD_SD1_DATA3__ESDHC1_DAT3 0x1d5
-   MX53_PAD_SD1_CMD__ESDHC1_CMD0x1d5
-   MX53_PAD_SD1_CLK__ESDHC1_CLK0x1d5
-
-   MX53_PAD_SD2_DATA0__ESDHC2_DAT0 0x1d5
-   MX53_PAD_SD2_DATA1__ESDHC2_DAT1 0x1d5
-   MX53_PAD_SD2_DATA2__ESDHC2_DAT2 0x1d5
-   MX53_PAD_SD2_DATA3__ESDHC2_DAT3 0x1d5
-   MX53_PAD_SD2_CMD__ESDHC2_CMD0x1d5
-   MX53_PAD_SD2_CLK__ESDHC2_CLK0x1d5
-
MX53_PAD_FEC_MDC__FEC_MDC   0x4
MX53_PAD_FEC_MDIO__FEC_MDIO 0x1fc
MX53_PAD_FEC_REF_CLK__FEC_TX_CLK0x180
@@ -162,6 +148,28 @@
>;
};
 
+   pinctrl_esdhc1: esdhc1grp {
+   fsl,pins = <
+   MX53_PAD_SD1_DATA0__ESDHC1_DAT0 0x1d5
+   MX53_PAD_SD1_DATA1__ESDHC1_DAT1 0x1d5
+   MX53_PAD_SD1_DATA2__ESDHC1_DAT2 0x1d5
+   MX53_PAD_SD1_DATA3__ESDHC1_DAT3 0x1d5
+   MX53_PAD_SD1_CMD__ESDHC1_CMD0x1d5
+   MX53_PAD_SD1_CLK__ESDHC1_CLK0x1d5
+   >;
+   };
+
+   pinctrl_esdhc2: esdhc2grp {
+   fsl,pins = <
+   MX53_PAD_SD2_DATA0__ESDHC2_DAT0 0x1d5
+   MX53_PAD_SD2_DATA1__ESDHC2_DAT1 0x1d5
+   MX53_PAD_SD2_DATA2__ESDHC2_DAT2 0x1d5
+   MX53_PAD_SD2_DATA3__ESDHC2_DAT3 0x1d5
+   MX53_PAD_SD2_CMD__ESDHC2_CMD0x1d5
+   MX53_PAD_SD2_CLK__ESDHC2_CLK0x1d5
+   >;
+   };
+
pinctrl_uart2: uart2grp {
fsl,pins = <
MX53_PAD_EIM_D26__UART2_RXD_MUX 0x1e4
@@ -181,6 +189,22 @@
status = "okay";
 };
 
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_esdhc1>;
+   cd-gpios = < 1 GPIO_ACTIVE_LOW>;
+   bus-width = <4>;
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_esdhc2>;
+   cd-gpios = < 4 GPIO_ACTIVE_LOW>;
+   bus-width = <4>;
+   status = "okay";
+};
+
  {
pinctrl-names = "default";
phy-mode = "rmii";
diff --git a/configs/mx53cx9020_defconfig b/configs/mx53cx9020_defconfig
index 3cff52031a0..ddd65e8ee15 100644
--- a/configs/mx53cx9020_defconfig
+++ b/configs/mx53cx9020_defconfig
@@ -19,6 +19,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_DM_MMC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="imx53-cx9020"
 CONFIG_ENV_IS_IN_MMC=y
-- 
2.11.0


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


[U-Boot] [PATCH 1/3] mmc: fsl_esdhc: add compatible for fsl, imx53-esdhc

2019-01-02 Thread linux-kernel-dev
From: Patrick Bruenn 

Add compatible "fsl,imx53-esdhc" to keep mmc working on i.MX53 platforms
with CONFIG_DM_MMC=y

Signed-off-by: Patrick Bruenn 
---

 drivers/mmc/fsl_esdhc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 3cdfa7f5a68..ff912645f05 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -1579,6 +1579,7 @@ static struct esdhc_soc_data usdhc_imx7d_data = {
 };
 
 static const struct udevice_id fsl_esdhc_ids[] = {
+   { .compatible = "fsl,imx53-esdhc", },
{ .compatible = "fsl,imx6ul-usdhc", },
{ .compatible = "fsl,imx6sx-usdhc", },
{ .compatible = "fsl,imx6sl-usdhc", },
-- 
2.11.0


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


[U-Boot] [PATCH 2/3] arm: imx: Add esdhc1/2 nodes to imx53.dtsi

2019-01-02 Thread linux-kernel-dev
From: Patrick Bruenn 

These nodes are required by CX9020 when build with CONFIG_DM_MMC=y
They are copied from Linux 4.20

Signed-off-by: Patrick Bruenn 
---

 arch/arm/dts/imx53.dtsi | 34 ++
 1 file changed, 34 insertions(+)

diff --git a/arch/arm/dts/imx53.dtsi b/arch/arm/dts/imx53.dtsi
index 64591f9d476..e13009c8708 100644
--- a/arch/arm/dts/imx53.dtsi
+++ b/arch/arm/dts/imx53.dtsi
@@ -31,6 +31,8 @@
i2c0 = 
i2c1 = 
i2c2 = 
+   mmc0 = 
+   mmc1 = 
};
 
tzic: tz-interrupt-controller@fffc000 {
@@ -54,6 +56,38 @@
reg = <0x5000 0x1000>;
ranges;
 
+   spba@5000 {
+   compatible = "fsl,spba-bus", "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   reg = <0x5000 0x4>;
+   ranges;
+
+   esdhc1: esdhc@50004000 {
+   compatible = "fsl,imx53-esdhc";
+   reg = <0x50004000 0x4000>;
+   interrupts = <1>;
+   clocks = < 
IMX5_CLK_ESDHC1_IPG_GATE>,
+< IMX5_CLK_DUMMY>,
+< 
IMX5_CLK_ESDHC1_PER_GATE>;
+   clock-names = "ipg", "ahb", "per";
+   bus-width = <4>;
+   status = "disabled";
+   };
+
+   esdhc2: esdhc@50008000 {
+   compatible = "fsl,imx53-esdhc";
+   reg = <0x50008000 0x4000>;
+   interrupts = <2>;
+   clocks = < 
IMX5_CLK_ESDHC2_IPG_GATE>,
+< IMX5_CLK_DUMMY>,
+< 
IMX5_CLK_ESDHC2_PER_GATE>;
+   clock-names = "ipg", "ahb", "per";
+   bus-width = <4>;
+   status = "disabled";
+   };
+   };
+
iomuxc: iomuxc@53fa8000 {
compatible = "fsl,imx53-iomuxc";
reg = <0x53fa8000 0x4000>;
-- 
2.11.0


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


[U-Boot] [PATCH 0/3] Migrate i.MX53 based cx9020 to CONFIG_DM_MMC=y

2019-01-02 Thread linux-kernel-dev
From: Patrick Bruenn 


This series is based on v2019.01-rc2. It enables compatible
"fsl,imx53-esdhc" for fsl_esdhc driver and copies esdhc1 and esdhc2
device tree nodes from Linux 4.20 into imx53.dtsi. The last patch
enables these nodes for imx53-cx9020.dts and adds CONFIG_DM_MMC=y
for mx53cx9020_defconfig.

I have no other imx53 platform available for testing, but I could add
esdhc3/4 and convert more imx53 boards, if wanted.


Patrick Bruenn (3):
  mmc: fsl_esdhc: add compatible for fsl,imx53-esdhc
  arm: imx: Add esdhc1/2 nodes to imx53.dtsi
  dm: arm: imx: migrate cx9020 to CONFIG_DM_MMC

 arch/arm/dts/imx53-cx9020.dts | 52 +++
 arch/arm/dts/imx53.dtsi   | 34 
 configs/mx53cx9020_defconfig  |  1 +
 drivers/mmc/fsl_esdhc.c   |  1 +
 4 files changed, 74 insertions(+), 14 deletions(-)

-- 
2.11.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


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

2018-04-04 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 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 v3 2/3] dm: led: auto probe() LEDs with "default-state"

2018-04-04 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 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 v3 3/3] dm: led: add testcase for "default-state" property

2018-04-04 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.

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 v3: None
Changes in v2: None

 arch/sandbox/dts/test.dts | 12 
 test/dm/led.c | 16 
 2 files changed, 28 insertions(+)

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 06d0e8ce85..07f9bad258 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 3 0>;
+   label = "sandbox:default_on";
+   default-state = "on";
+   };
+
+   default_off {
+   gpios = <_a 4 0>;
+   label = "sandbox:default_off";
+   default-state = "off";
+   };
};
 
mbox: mbox {
diff --git a/test/dm/led.c b/test/dm/led.c
index fde700be38..c560abc4fb 100644
--- a/test/dm/led.c
+++ b/test/dm/led.c
@@ -28,6 +28,22 @@ static int dm_test_led_base(struct unit_test_state *uts)
 }
 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 v3 0/3] This series adds support for gpio-leds "default-state" property. The

2018-04-04 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 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 | 16 
 3 files changed, 52 insertions(+), 1 deletion(-)

-- 
2.11.0


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


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

2018-04-03 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 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..d2fe3d5ad5 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_string(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 v2 3/3] dm: led: add testcase for "default-state" property

2018-04-03 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.

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 v2: None

 arch/sandbox/dts/test.dts | 12 
 test/dm/led.c | 16 
 2 files changed, 28 insertions(+)

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 06d0e8ce85..07f9bad258 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 3 0>;
+   label = "sandbox:default_on";
+   default-state = "on";
+   };
+
+   default_off {
+   gpios = <_a 4 0>;
+   label = "sandbox:default_off";
+   default-state = "off";
+   };
};
 
mbox: mbox {
diff --git a/test/dm/led.c b/test/dm/led.c
index fde700be38..c560abc4fb 100644
--- a/test/dm/led.c
+++ b/test/dm/led.c
@@ -28,6 +28,22 @@ static int dm_test_led_base(struct unit_test_state *uts)
 }
 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 v2 1/3] dm: led: Support "default-state" property

2018-04-03 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 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 v2 0/3] This series adds support for gpio-leds "default-state" property. The

2018-04-03 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 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 | 16 
 3 files changed, 52 insertions(+), 1 deletion(-)

-- 
2.11.0


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


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

2018-03-07 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 
---

 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..d2fe3d5ad5 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_string(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 1/2] dm: led: Support "default-state" property

2018-03-07 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 

---

 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 0/2] This series adds support for gpio-leds "default-state" property. The

2018-03-07 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.


Patrick Bruenn (2):
  dm: led: Support "default-state" property
  dm: led: auto probe() LEDs with "default-state"

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

-- 
2.11.0


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


[U-Boot] [PATCH] dm: mmc: socfpga: call dwmci_probe()

2018-03-06 Thread linux-kernel-dev
From: Patrick Bruenn 

On a socfpga_cyclone5 based board the SD card, was never powered up. For
other dw_mmc based SoCs dwmci_probe() is called in the platform specific
probe(). It seems this call is missing for socfpga_dw_mmc.

With this change DWMCI_PWREN is set by dmwci_init().

Signed-off-by: Patrick Bruenn 
---

 drivers/mmc/socfpga_dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/socfpga_dw_mmc.c b/drivers/mmc/socfpga_dw_mmc.c
index 759686ccd6..c5fce8f09d 100644
--- a/drivers/mmc/socfpga_dw_mmc.c
+++ b/drivers/mmc/socfpga_dw_mmc.c
@@ -124,7 +124,7 @@ static int socfpga_dwmmc_probe(struct udevice *dev)
upriv->mmc = host->mmc;
host->mmc->dev = dev;
 
-   return 0;
+   return dwmci_probe(dev);
 }
 
 static int socfpga_dwmmc_bind(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 v3 1/4] arm: imx: cx9020: remove usage of mx53_dram_size

2018-01-15 Thread linux-kernel-dev
From: Patrick Bruenn 

Static variables are not available during board_init_f().
'static uint32_t mx53_dram_size[2];' was used in board specific
dram_init(), dram_init_banksize() and get_effective_memsize() to avoid
multiple calls to get_ram_size().

However multiple calls are better than undefined behavior...
This fixes:
https://lists.denx.de/pipermail/u-boot/2017-November/313214.html
https://lists.denx.de/pipermail/u-boot/2017-December/314480.html

Signed-off-by: Patrick Bruenn 

---

Changes in v3:
- rebase to v2018.01
- fix the cover-letter to make it more clear that the first patch is
  required to make the cx9020 boot again. All other patches are
  optional.

Changes in v2:
- move dram initialization into common location
- reuse fixed dram initialization for m53evk and mx53loco

 board/beckhoff/mx53cx9020/mx53cx9020.c | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index 021bd967c4..d8bdfc27bb 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -59,8 +59,6 @@ static const u32 CCAT_MODE_RUN = 0x0033DC8F;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static uint32_t mx53_dram_size[2];
-
 phys_size_t get_effective_memsize(void)
 {
/*
@@ -74,15 +72,13 @@ phys_size_t get_effective_memsize(void)
 * U-Boot into invalid memory area close to the end of the first
 * DRAM bank.
 */
-   return mx53_dram_size[0];
+   return get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
 }
 
 int dram_init(void)
 {
-   mx53_dram_size[0] = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-   mx53_dram_size[1] = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
-
-   gd->ram_size = mx53_dram_size[0] + mx53_dram_size[1];
+   gd->ram_size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
+   gd->ram_size += get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
 
return 0;
 }
@@ -90,10 +86,10 @@ int dram_init(void)
 int dram_init_banksize(void)
 {
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-   gd->bd->bi_dram[0].size = mx53_dram_size[0];
+   gd->bd->bi_dram[0].size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
 
gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
-   gd->bd->bi_dram[1].size = mx53_dram_size[1];
+   gd->bd->bi_dram[1].size = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
 
return 0;
 }
-- 
2.11.0


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


[U-Boot] [PATCH v3 3/4] arm: imx: m53evk: remove usage of mx53_dram_size

2018-01-15 Thread linux-kernel-dev
From: Patrick Bruenn 

Static variables are not available during board_init_f().
'static uint32_t mx53_dram_size[2];' was used in board specific
dram_init(), dram_init_banksize() and get_effective_memsize() to avoid
multiple calls to get_ram_size().

Reused dram initialization functions from arch/arm/mach-imx/mx5/mx53_dram.c

Signed-off-by: Patrick Bruenn 

---

Changes in v3: None
Changes in v2: None


Only compile tested with make m53evk_defconfig

---
 arch/arm/mach-imx/mx5/Makefile |  1 +
 board/aries/m53evk/m53evk.c| 39 ---
 2 files changed, 1 insertion(+), 39 deletions(-)

diff --git a/arch/arm/mach-imx/mx5/Makefile b/arch/arm/mach-imx/mx5/Makefile
index 368cfde98b..2cc2cbc07a 100644
--- a/arch/arm/mach-imx/mx5/Makefile
+++ b/arch/arm/mach-imx/mx5/Makefile
@@ -11,4 +11,5 @@ obj-y := soc.o clock.o
 obj-y += lowlevel_init.o
 
 # common files for mx53 dram initialization
+obj-$(CONFIG_TARGET_M53EVK) += mx53_dram.o
 obj-$(CONFIG_TARGET_MX53CX9020) += mx53_dram.o
diff --git a/board/aries/m53evk/m53evk.c b/board/aries/m53evk/m53evk.c
index ece8957aaf..a798d83376 100644
--- a/board/aries/m53evk/m53evk.c
+++ b/board/aries/m53evk/m53evk.c
@@ -31,45 +31,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static uint32_t mx53_dram_size[2];
-
-phys_size_t get_effective_memsize(void)
-{
-   /*
-* WARNING: We must override get_effective_memsize() function here
-* to report only the size of the first DRAM bank. This is to make
-* U-Boot relocator place U-Boot into valid memory, that is, at the
-* end of the first DRAM bank. If we did not override this function
-* like so, U-Boot would be placed at the address of the first DRAM
-* bank + total DRAM size - sizeof(uboot), which in the setup where
-* each DRAM bank contains 512MiB of DRAM would result in placing
-* U-Boot into invalid memory area close to the end of the first
-* DRAM bank.
-*/
-   return mx53_dram_size[0];
-}
-
-int dram_init(void)
-{
-   mx53_dram_size[0] = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-   mx53_dram_size[1] = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
-
-   gd->ram_size = mx53_dram_size[0] + mx53_dram_size[1];
-
-   return 0;
-}
-
-int dram_init_banksize(void)
-{
-   gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-   gd->bd->bi_dram[0].size = mx53_dram_size[0];
-
-   gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
-   gd->bd->bi_dram[1].size = mx53_dram_size[1];
-
-   return 0;
-}
-
 static void setup_iomux_uart(void)
 {
static const iomux_v3_cfg_t uart_pads[] = {
-- 
2.11.0


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


[U-Boot] [PATCH v3 2/4] arm: imx: cx9020: move dram init into common place

2018-01-15 Thread linux-kernel-dev
From: Patrick Bruenn 

Move dram_init(), dram_init_banksize() and get_effective_memsize() to
arch/arm/mach-imx/mx5/mx53_dram.c, where it can be reused by m53evk and
mx53loco.

Signed-off-by: Patrick Bruenn 

---

Changes in v3: None
Changes in v2: None

Patch-Cc:  Fabio Estevam 
Patch-Cc:  Christian Gmeiner 
Patch-Cc:  Jason Liu 
Patch-Cc:  Patrick Bruenn 
Patch-Cc:  Stefano Babic 
Patch-Cc:  u-boot@lists.denx.de
Patch-Cc:  Marek Vasut 
Patch-Cc:  Albert Aribaud 

---
 arch/arm/mach-imx/mx5/Makefile |  3 +++
 arch/arm/mach-imx/mx5/mx53_dram.c  | 45 ++
 board/beckhoff/mx53cx9020/mx53cx9020.c | 35 --
 3 files changed, 48 insertions(+), 35 deletions(-)
 create mode 100644 arch/arm/mach-imx/mx5/mx53_dram.c

diff --git a/arch/arm/mach-imx/mx5/Makefile b/arch/arm/mach-imx/mx5/Makefile
index d021842f68..368cfde98b 100644
--- a/arch/arm/mach-imx/mx5/Makefile
+++ b/arch/arm/mach-imx/mx5/Makefile
@@ -9,3 +9,6 @@
 
 obj-y := soc.o clock.o
 obj-y += lowlevel_init.o
+
+# common files for mx53 dram initialization
+obj-$(CONFIG_TARGET_MX53CX9020) += mx53_dram.o
diff --git a/arch/arm/mach-imx/mx5/mx53_dram.c 
b/arch/arm/mach-imx/mx5/mx53_dram.c
new file mode 100644
index 00..7e5fc42d1f
--- /dev/null
+++ b/arch/arm/mach-imx/mx5/mx53_dram.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2017  Beckhoff Automation GmbH & Co. KG
+ * Patrick Bruenn 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+phys_size_t get_effective_memsize(void)
+{
+   /*
+* WARNING: We must override get_effective_memsize() function here
+* to report only the size of the first DRAM bank. This is to make
+* U-Boot relocator place U-Boot into valid memory, that is, at the
+* end of the first DRAM bank. If we did not override this function
+* like so, U-Boot would be placed at the address of the first DRAM
+* bank + total DRAM size - sizeof(uboot), which in the setup where
+* each DRAM bank contains 512MiB of DRAM would result in placing
+* U-Boot into invalid memory area close to the end of the first
+* DRAM bank.
+*/
+   return get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
+}
+
+int dram_init(void)
+{
+   gd->ram_size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
+   gd->ram_size += get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
+
+   return 0;
+}
+
+int dram_init_banksize(void)
+{
+   gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+   gd->bd->bi_dram[0].size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
+
+   gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
+   gd->bd->bi_dram[1].size = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
+
+   return 0;
+}
diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index d8bdfc27bb..f9df3604cd 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -59,41 +59,6 @@ static const u32 CCAT_MODE_RUN = 0x0033DC8F;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-phys_size_t get_effective_memsize(void)
-{
-   /*
-* WARNING: We must override get_effective_memsize() function here
-* to report only the size of the first DRAM bank. This is to make
-* U-Boot relocator place U-Boot into valid memory, that is, at the
-* end of the first DRAM bank. If we did not override this function
-* like so, U-Boot would be placed at the address of the first DRAM
-* bank + total DRAM size - sizeof(uboot), which in the setup where
-* each DRAM bank contains 512MiB of DRAM would result in placing
-* U-Boot into invalid memory area close to the end of the first
-* DRAM bank.
-*/
-   return get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-}
-
-int dram_init(void)
-{
-   gd->ram_size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-   gd->ram_size += get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
-
-   return 0;
-}
-
-int dram_init_banksize(void)
-{
-   gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-   gd->bd->bi_dram[0].size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-
-   gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
-   gd->bd->bi_dram[1].size = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
-
-   return 0;
-}
-
 u32 get_board_rev(void)
 {
struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
-- 
2.11.0


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


[U-Boot] [PATCH v3 4/4] arm: imx: mx53loco: remove usage of mx53_dram_size

2018-01-15 Thread linux-kernel-dev
From: Patrick Bruenn 

Static variables are not available during board_init_f().
'static uint32_t mx53_dram_size[2];' was used in board specific
dram_init(), dram_init_banksize() and get_effective_memsize() to avoid
multiple calls to get_ram_size().

Reused dram initialization functions from arch/arm/mach-imx/mx5/mx53_dram.c

Signed-off-by: Patrick Bruenn 

---

Changes in v3: None
Changes in v2: None


Only compile tested with make mx53loco_defconfig

---
 arch/arm/mach-imx/mx5/Makefile  |  1 +
 board/freescale/mx53loco/mx53loco.c | 39 -
 2 files changed, 1 insertion(+), 39 deletions(-)

diff --git a/arch/arm/mach-imx/mx5/Makefile b/arch/arm/mach-imx/mx5/Makefile
index 2cc2cbc07a..4e305e92cf 100644
--- a/arch/arm/mach-imx/mx5/Makefile
+++ b/arch/arm/mach-imx/mx5/Makefile
@@ -13,3 +13,4 @@ obj-y += lowlevel_init.o
 # common files for mx53 dram initialization
 obj-$(CONFIG_TARGET_M53EVK) += mx53_dram.o
 obj-$(CONFIG_TARGET_MX53CX9020) += mx53_dram.o
+obj-$(CONFIG_TARGET_MX53LOCO)   += mx53_dram.o
diff --git a/board/freescale/mx53loco/mx53loco.c 
b/board/freescale/mx53loco/mx53loco.c
index db0e2fbdd6..0beecf3459 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -31,45 +31,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static uint32_t mx53_dram_size[2];
-
-phys_size_t get_effective_memsize(void)
-{
-   /*
-* WARNING: We must override get_effective_memsize() function here
-* to report only the size of the first DRAM bank. This is to make
-* U-Boot relocator place U-Boot into valid memory, that is, at the
-* end of the first DRAM bank. If we did not override this function
-* like so, U-Boot would be placed at the address of the first DRAM
-* bank + total DRAM size - sizeof(uboot), which in the setup where
-* each DRAM bank contains 512MiB of DRAM would result in placing
-* U-Boot into invalid memory area close to the end of the first
-* DRAM bank.
-*/
-   return mx53_dram_size[0];
-}
-
-int dram_init(void)
-{
-   mx53_dram_size[0] = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-   mx53_dram_size[1] = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
-
-   gd->ram_size = mx53_dram_size[0] + mx53_dram_size[1];
-
-   return 0;
-}
-
-int dram_init_banksize(void)
-{
-   gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-   gd->bd->bi_dram[0].size = mx53_dram_size[0];
-
-   gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
-   gd->bd->bi_dram[1].size = mx53_dram_size[1];
-
-   return 0;
-}
-
 u32 get_board_rev(void)
 {
struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
-- 
2.11.0


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


[U-Boot] [PATCH v3 0/4] arm: imx53: remove usage of mx53_dram_size

2018-01-15 Thread linux-kernel-dev
From: Patrick Bruenn 

Global variables are not available during board_init_f().
The i.MX53 boards m53evk, mx53cx9020 and mx53loco are using the exact
same dram initialization code, which uses
'static uint32_t mx53_dram_size[2];' in dram_init(),
dram_init_banksize() and get_effective_memsize() to avoid multiple
calls to get_ram_size().

This series replaces the static variable with multiple calls to
get_ram_size() and moves the shared code into arch/arm/mach-imx/mx5/.

The first patch is required to let cx9020 boot again. Please include at
least this one. Without that patch u-boot on cx9020 is broken.

The second patch moves that code to a common place to be reused by
m53evk and mx53loco. Pick it only if you think this change is useful for
one of these boards and you are willing to include the third and/or last
patch.
Pick the third patch if you want to use the changed code for m53evk.
Pick the last patch if you want to use the changed code for mx53loco.


Changes in v3:
- rebase to v2018.01
- fix the cover-letter to make it more clear that the first patch is
  required to make the cx9020 boot again. All other patches are
  optional.

Changes in v2:
- move dram initialization into common location
- reuse fixed dram initialization for m53evk and mx53loco

Patrick Bruenn (4):
  arm: imx: cx9020: remove usage of mx53_dram_size
  arm: imx: cx9020: move dram init into common place
  arm: imx: m53evk: remove usage of mx53_dram_size
  arm: imx: mx53loco: remove usage of mx53_dram_size

 arch/arm/mach-imx/mx5/Makefile |  5 
 arch/arm/mach-imx/mx5/mx53_dram.c  | 45 ++
 board/aries/m53evk/m53evk.c| 39 -
 board/beckhoff/mx53cx9020/mx53cx9020.c | 39 -
 board/freescale/mx53loco/mx53loco.c| 39 -
 5 files changed, 50 insertions(+), 117 deletions(-)
 create mode 100644 arch/arm/mach-imx/mx5/mx53_dram.c

-- 
2.11.0


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


[U-Boot] [PATCH v2 0/4] arm: imx53: remove usage of mx53_dram_size

2017-12-18 Thread linux-kernel-dev
From: Patrick Bruenn 

Global variables are not available during board_init_f().
The i.MX53 boards m53evk, mx53cx9020 and mx53loco are using the exact
same dram initialization code, which uses
'static uint32_t mx53_dram_size[2];' in dram_init(),
dram_init_banksize() and get_effective_memsize() to avoid multiple
calls to get_ram_size().

This series replaces the static variable with multiple calls to
get_ram_size() and moves the shared code into arch/arm/mach-imx/mx5/.

The first patch fixes cx9020. The next patch moves that code to a common
place to be reused by m53evk and mx53loco with the next patches.

Changes in v2:
- move dram initialization into common location
- reuse fixed dram initialization for m53evk and mx53loco

Patrick Bruenn (4):
  arm: imx: cx9020: remove usage of mx53_dram_size
  arm: imx: cx9020: move dram init into common place
  arm: imx: m53evk: remove usage of mx53_dram_size
  arm: imx: mx53loco: remove usage of mx53_dram_size

 arch/arm/mach-imx/mx5/Makefile |  5 
 arch/arm/mach-imx/mx5/mx53_dram.c  | 45 ++
 board/aries/m53evk/m53evk.c| 39 -
 board/beckhoff/mx53cx9020/mx53cx9020.c | 39 -
 board/freescale/mx53loco/mx53loco.c| 39 -
 5 files changed, 50 insertions(+), 117 deletions(-)
 create mode 100644 arch/arm/mach-imx/mx5/mx53_dram.c

-- 
2.11.0


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


[U-Boot] [PATCH v2 2/4] arm: imx: cx9020: move dram init into common place

2017-12-18 Thread linux-kernel-dev
From: Patrick Bruenn 

Move dram_init(), dram_init_banksize() and get_effective_memsize() to
arch/arm/mach-imx/mx5/mx53_dram.c, where it can be reused by m53evk and
mx53loco.

Signed-off-by: Patrick Bruenn 

---

Changes in v2: None

Patch-Cc:  Fabio Estevam 
Patch-Cc:  Christian Gmeiner 
Patch-Cc:  Jason Liu 
Patch-Cc:  Patrick Bruenn 
Patch-Cc:  Stefano Babic 
Patch-Cc:  u-boot@lists.denx.de
Patch-Cc:  Marek Vasut 
Patch-Cc:  Albert Aribaud 

---
 arch/arm/mach-imx/mx5/Makefile |  3 +++
 arch/arm/mach-imx/mx5/mx53_dram.c  | 45 ++
 board/beckhoff/mx53cx9020/mx53cx9020.c | 35 --
 3 files changed, 48 insertions(+), 35 deletions(-)
 create mode 100644 arch/arm/mach-imx/mx5/mx53_dram.c

diff --git a/arch/arm/mach-imx/mx5/Makefile b/arch/arm/mach-imx/mx5/Makefile
index d021842f68..368cfde98b 100644
--- a/arch/arm/mach-imx/mx5/Makefile
+++ b/arch/arm/mach-imx/mx5/Makefile
@@ -9,3 +9,6 @@
 
 obj-y := soc.o clock.o
 obj-y += lowlevel_init.o
+
+# common files for mx53 dram initialization
+obj-$(CONFIG_TARGET_MX53CX9020) += mx53_dram.o
diff --git a/arch/arm/mach-imx/mx5/mx53_dram.c 
b/arch/arm/mach-imx/mx5/mx53_dram.c
new file mode 100644
index 00..7e5fc42d1f
--- /dev/null
+++ b/arch/arm/mach-imx/mx5/mx53_dram.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2017  Beckhoff Automation GmbH & Co. KG
+ * Patrick Bruenn 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+phys_size_t get_effective_memsize(void)
+{
+   /*
+* WARNING: We must override get_effective_memsize() function here
+* to report only the size of the first DRAM bank. This is to make
+* U-Boot relocator place U-Boot into valid memory, that is, at the
+* end of the first DRAM bank. If we did not override this function
+* like so, U-Boot would be placed at the address of the first DRAM
+* bank + total DRAM size - sizeof(uboot), which in the setup where
+* each DRAM bank contains 512MiB of DRAM would result in placing
+* U-Boot into invalid memory area close to the end of the first
+* DRAM bank.
+*/
+   return get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
+}
+
+int dram_init(void)
+{
+   gd->ram_size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
+   gd->ram_size += get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
+
+   return 0;
+}
+
+int dram_init_banksize(void)
+{
+   gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
+   gd->bd->bi_dram[0].size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
+
+   gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
+   gd->bd->bi_dram[1].size = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
+
+   return 0;
+}
diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index d8bdfc27bb..f9df3604cd 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -59,41 +59,6 @@ static const u32 CCAT_MODE_RUN = 0x0033DC8F;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-phys_size_t get_effective_memsize(void)
-{
-   /*
-* WARNING: We must override get_effective_memsize() function here
-* to report only the size of the first DRAM bank. This is to make
-* U-Boot relocator place U-Boot into valid memory, that is, at the
-* end of the first DRAM bank. If we did not override this function
-* like so, U-Boot would be placed at the address of the first DRAM
-* bank + total DRAM size - sizeof(uboot), which in the setup where
-* each DRAM bank contains 512MiB of DRAM would result in placing
-* U-Boot into invalid memory area close to the end of the first
-* DRAM bank.
-*/
-   return get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-}
-
-int dram_init(void)
-{
-   gd->ram_size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-   gd->ram_size += get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
-
-   return 0;
-}
-
-int dram_init_banksize(void)
-{
-   gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-   gd->bd->bi_dram[0].size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-
-   gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
-   gd->bd->bi_dram[1].size = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
-
-   return 0;
-}
-
 u32 get_board_rev(void)
 {
struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
-- 
2.11.0


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


[U-Boot] [PATCH v2 4/4] arm: imx: mx53loco: remove usage of mx53_dram_size

2017-12-18 Thread linux-kernel-dev
From: Patrick Bruenn 

Static variables are not available during board_init_f().
'static uint32_t mx53_dram_size[2];' was used in board specific
dram_init(), dram_init_banksize() and get_effective_memsize() to avoid
multiple calls to get_ram_size().

Reused dram initialization functions from arch/arm/mach-imx/mx5/mx53_dram.c

Signed-off-by: Patrick Bruenn 

---

Changes in v2: None


Only compile tested with make mx53loco_defconfig

---
 arch/arm/mach-imx/mx5/Makefile  |  1 +
 board/freescale/mx53loco/mx53loco.c | 39 -
 2 files changed, 1 insertion(+), 39 deletions(-)

diff --git a/arch/arm/mach-imx/mx5/Makefile b/arch/arm/mach-imx/mx5/Makefile
index 2cc2cbc07a..4e305e92cf 100644
--- a/arch/arm/mach-imx/mx5/Makefile
+++ b/arch/arm/mach-imx/mx5/Makefile
@@ -13,3 +13,4 @@ obj-y += lowlevel_init.o
 # common files for mx53 dram initialization
 obj-$(CONFIG_TARGET_M53EVK) += mx53_dram.o
 obj-$(CONFIG_TARGET_MX53CX9020) += mx53_dram.o
+obj-$(CONFIG_TARGET_MX53LOCO)   += mx53_dram.o
diff --git a/board/freescale/mx53loco/mx53loco.c 
b/board/freescale/mx53loco/mx53loco.c
index db0e2fbdd6..0beecf3459 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -31,45 +31,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static uint32_t mx53_dram_size[2];
-
-phys_size_t get_effective_memsize(void)
-{
-   /*
-* WARNING: We must override get_effective_memsize() function here
-* to report only the size of the first DRAM bank. This is to make
-* U-Boot relocator place U-Boot into valid memory, that is, at the
-* end of the first DRAM bank. If we did not override this function
-* like so, U-Boot would be placed at the address of the first DRAM
-* bank + total DRAM size - sizeof(uboot), which in the setup where
-* each DRAM bank contains 512MiB of DRAM would result in placing
-* U-Boot into invalid memory area close to the end of the first
-* DRAM bank.
-*/
-   return mx53_dram_size[0];
-}
-
-int dram_init(void)
-{
-   mx53_dram_size[0] = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-   mx53_dram_size[1] = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
-
-   gd->ram_size = mx53_dram_size[0] + mx53_dram_size[1];
-
-   return 0;
-}
-
-int dram_init_banksize(void)
-{
-   gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-   gd->bd->bi_dram[0].size = mx53_dram_size[0];
-
-   gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
-   gd->bd->bi_dram[1].size = mx53_dram_size[1];
-
-   return 0;
-}
-
 u32 get_board_rev(void)
 {
struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
-- 
2.11.0


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


[U-Boot] [PATCH v2 3/4] arm: imx: m53evk: remove usage of mx53_dram_size

2017-12-18 Thread linux-kernel-dev
From: Patrick Bruenn 

Static variables are not available during board_init_f().
'static uint32_t mx53_dram_size[2];' was used in board specific
dram_init(), dram_init_banksize() and get_effective_memsize() to avoid
multiple calls to get_ram_size().

Reused dram initialization functions from arch/arm/mach-imx/mx5/mx53_dram.c

Signed-off-by: Patrick Bruenn 

---

Changes in v2: None


Only compile tested with make m53evk_defconfig

---
 arch/arm/mach-imx/mx5/Makefile |  1 +
 board/aries/m53evk/m53evk.c| 39 ---
 2 files changed, 1 insertion(+), 39 deletions(-)

diff --git a/arch/arm/mach-imx/mx5/Makefile b/arch/arm/mach-imx/mx5/Makefile
index 368cfde98b..2cc2cbc07a 100644
--- a/arch/arm/mach-imx/mx5/Makefile
+++ b/arch/arm/mach-imx/mx5/Makefile
@@ -11,4 +11,5 @@ obj-y := soc.o clock.o
 obj-y += lowlevel_init.o
 
 # common files for mx53 dram initialization
+obj-$(CONFIG_TARGET_M53EVK) += mx53_dram.o
 obj-$(CONFIG_TARGET_MX53CX9020) += mx53_dram.o
diff --git a/board/aries/m53evk/m53evk.c b/board/aries/m53evk/m53evk.c
index ece8957aaf..a798d83376 100644
--- a/board/aries/m53evk/m53evk.c
+++ b/board/aries/m53evk/m53evk.c
@@ -31,45 +31,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static uint32_t mx53_dram_size[2];
-
-phys_size_t get_effective_memsize(void)
-{
-   /*
-* WARNING: We must override get_effective_memsize() function here
-* to report only the size of the first DRAM bank. This is to make
-* U-Boot relocator place U-Boot into valid memory, that is, at the
-* end of the first DRAM bank. If we did not override this function
-* like so, U-Boot would be placed at the address of the first DRAM
-* bank + total DRAM size - sizeof(uboot), which in the setup where
-* each DRAM bank contains 512MiB of DRAM would result in placing
-* U-Boot into invalid memory area close to the end of the first
-* DRAM bank.
-*/
-   return mx53_dram_size[0];
-}
-
-int dram_init(void)
-{
-   mx53_dram_size[0] = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-   mx53_dram_size[1] = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
-
-   gd->ram_size = mx53_dram_size[0] + mx53_dram_size[1];
-
-   return 0;
-}
-
-int dram_init_banksize(void)
-{
-   gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-   gd->bd->bi_dram[0].size = mx53_dram_size[0];
-
-   gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
-   gd->bd->bi_dram[1].size = mx53_dram_size[1];
-
-   return 0;
-}
-
 static void setup_iomux_uart(void)
 {
static const iomux_v3_cfg_t uart_pads[] = {
-- 
2.11.0


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


[U-Boot] [PATCH v2 1/4] arm: imx: cx9020: remove usage of mx53_dram_size

2017-12-18 Thread linux-kernel-dev
From: Patrick Bruenn 

Static variables are not available during board_init_f().
'static uint32_t mx53_dram_size[2];' was used in board specific
dram_init(), dram_init_banksize() and get_effective_memsize() to avoid
multiple calls to get_ram_size().

However multiple calls are better than undefined behavior...
This fixes:
https://lists.denx.de/pipermail/u-boot/2017-November/313214.html
https://lists.denx.de/pipermail/u-boot/2017-December/314480.html

Signed-off-by: Patrick Bruenn 

---

Changes in v2:
- move dram initialization into common location
- reuse fixed dram initialization for m53evk and mx53loco

 board/beckhoff/mx53cx9020/mx53cx9020.c | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index 021bd967c4..d8bdfc27bb 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -59,8 +59,6 @@ static const u32 CCAT_MODE_RUN = 0x0033DC8F;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static uint32_t mx53_dram_size[2];
-
 phys_size_t get_effective_memsize(void)
 {
/*
@@ -74,15 +72,13 @@ phys_size_t get_effective_memsize(void)
 * U-Boot into invalid memory area close to the end of the first
 * DRAM bank.
 */
-   return mx53_dram_size[0];
+   return get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
 }
 
 int dram_init(void)
 {
-   mx53_dram_size[0] = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-   mx53_dram_size[1] = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
-
-   gd->ram_size = mx53_dram_size[0] + mx53_dram_size[1];
+   gd->ram_size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
+   gd->ram_size += get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
 
return 0;
 }
@@ -90,10 +86,10 @@ int dram_init(void)
 int dram_init_banksize(void)
 {
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-   gd->bd->bi_dram[0].size = mx53_dram_size[0];
+   gd->bd->bi_dram[0].size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
 
gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
-   gd->bd->bi_dram[1].size = mx53_dram_size[1];
+   gd->bd->bi_dram[1].size = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
 
return 0;
 }
-- 
2.11.0


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


[U-Boot] [PATCH] arm: imx: cx9020: remove usage of mx53_dram_size

2017-12-15 Thread linux-kernel-dev
From: Patrick Bruenn 

Global variables are not available during board_init_f().
'static uint32_t mx53_dram_size[2];' was used in board specific
dram_init(), dram_init_banksize() and get_effective_memsize() to avoid
multiple calls to get_ram_size().

However multiple calls are better than undefined behavior...
This fixes:
https://lists.denx.de/pipermail/u-boot/2017-November/313214.html
https://lists.denx.de/pipermail/u-boot/2017-December/314480.html

Signed-off-by: Patrick Bruenn 

---

mx53cx9020 was based on mx53loco, which still uses this global variable.
If you agree, this is a bug, I can prepare a similar fix for the QSB.
Maybe it makes sense to move the dram_init functions for both boards
into something like boards/freescale/common/mx53_dram.c
But be aware I have no QSB at hand and could only compile test that
patch for mx53loco.

---
 board/beckhoff/mx53cx9020/mx53cx9020.c | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
b/board/beckhoff/mx53cx9020/mx53cx9020.c
index 021bd967c4..d8bdfc27bb 100644
--- a/board/beckhoff/mx53cx9020/mx53cx9020.c
+++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
@@ -59,8 +59,6 @@ static const u32 CCAT_MODE_RUN = 0x0033DC8F;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static uint32_t mx53_dram_size[2];
-
 phys_size_t get_effective_memsize(void)
 {
/*
@@ -74,15 +72,13 @@ phys_size_t get_effective_memsize(void)
 * U-Boot into invalid memory area close to the end of the first
 * DRAM bank.
 */
-   return mx53_dram_size[0];
+   return get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
 }
 
 int dram_init(void)
 {
-   mx53_dram_size[0] = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
-   mx53_dram_size[1] = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
-
-   gd->ram_size = mx53_dram_size[0] + mx53_dram_size[1];
+   gd->ram_size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
+   gd->ram_size += get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
 
return 0;
 }
@@ -90,10 +86,10 @@ int dram_init(void)
 int dram_init_banksize(void)
 {
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
-   gd->bd->bi_dram[0].size = mx53_dram_size[0];
+   gd->bd->bi_dram[0].size = get_ram_size((void *)PHYS_SDRAM_1, 1 << 30);
 
gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
-   gd->bd->bi_dram[1].size = mx53_dram_size[1];
+   gd->bd->bi_dram[1].size = get_ram_size((void *)PHYS_SDRAM_2, 1 << 30);
 
return 0;
 }
-- 
2.11.0


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


[U-Boot] [PATCH] arm: imx: add tzic interrupt controller for imx53

2017-12-11 Thread linux-kernel-dev
From: Patrick Bruenn 

Since commit 999a78d5cf00 ("scripts/dtc: Update to upstream version 
v1.4.5-3-gb1a60033c110")
dtc warns about:
arch/arm/dts/imx53-cx9020.dtb: Warning (interrupts_property): Missing 
interrupt-parent for /soc/aips@5000/serial@53fc
arch/arm/dts/imx53-cx9020.dtb: Warning (interrupts_property): Missing 
interrupt-parent for /soc/aips@5000/ccm@53fd4000
arch/arm/dts/imx53-cx9020.dtb: Warning (interrupts_property): Missing 
interrupt-parent for /soc/aips@5000/gpio@53fe4000
arch/arm/dts/imx53-cx9020.dtb: Warning (interrupts_property): Missing 
interrupt-parent for /soc/aips@6000/sdma@63fb
arch/arm/dts/imx53-cx9020.dtb: Warning (interrupts_property): Missing 
interrupt-parent for /soc/aips@6000/ethernet@63fec000

Fix this by adding a node for the tzic interrupt controller.
Copied from "/arch/arm/boot/dts/imx53.dts"

Signed-off-by: Patrick Bruenn 
---

 arch/arm/dts/imx53.dtsi | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/dts/imx53.dtsi b/arch/arm/dts/imx53.dtsi
index 1bdf0668a5..f68e88585e 100644
--- a/arch/arm/dts/imx53.dtsi
+++ b/arch/arm/dts/imx53.dtsi
@@ -23,10 +23,18 @@
serial1 = 
};
 
+   tzic: tz-interrupt-controller@fffc000 {
+   compatible = "fsl,imx53-tzic", "fsl,tzic";
+   interrupt-controller;
+   #interrupt-cells = <1>;
+   reg = <0x0fffc000 0x4000>;
+   };
+
soc {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
+   interrupt-parent = <>;
ranges;
 
aips@5000 { /* AIPS1 */
-- 
2.11.0


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


[U-Boot] [PATCH 1/2] imx: cx9020: use fdt_addr_r and ramdisk_addr_r

2017-07-11 Thread linux-kernel-dev
From: Patrick Bruenn 

Replace fdtaddr and rdaddr variable names with u-boot standard names
fdt_addr_r and ramdisk_addr_r.
This will make the use of pxe boot more easy.

Signed-off-by: Patrick Bruenn 
---

 include/configs/mx53cx9020.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/configs/mx53cx9020.h b/include/configs/mx53cx9020.h
index 151c4b3faf..b056298d9a 100644
--- a/include/configs/mx53cx9020.h
+++ b/include/configs/mx53cx9020.h
@@ -66,8 +66,8 @@
 #define CONFIG_SYS_TEXT_BASE0x7780
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   "fdt_addr=0x71ff\0" \
-   "rdaddr=0x7200\0" \
+   "fdt_addr_r=0x71ff\0" \
+   "ramdisk_addr_r=0x7200\0" \
"console=ttymxc1,115200\0" \
"uenv=/boot/uEnv.txt\0" \
"optargs=\0" \
@@ -81,10 +81,10 @@
"rootfstype=${mmcrootfstype} " \
"${cmdline}\0" \
"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
-   "loadrd=load mmc ${bootpart} ${rdaddr} ${bootdir}/${rdfile};" \
+   "loadrd=load mmc ${bootpart} ${ramdisk_addr_r} ${bootdir}/${rdfile};" \
"setenv rdsize ${filesize}\0" \
"loadfdt=echo loading ${fdt_path} ...;" \
-   "load mmc ${bootpart} ${fdt_addr} ${fdt_path}\0" \
+   "load mmc ${bootpart} ${fdt_addr_r} ${fdt_path}\0" \
"mmcboot=mmc dev ${mmcdev}; " \
"if mmc rescan; then " \
"echo SD/MMC found on device ${mmcdev};" \
@@ -128,8 +128,8 @@
"fi;" \
"run mmcargs;" \
"echo debug: [${bootargs}] ... ;" \
-   "echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \
-   "bootz ${loadaddr} - ${fdt_addr}; " \
+   "echo debug: [bootz ${loadaddr} - ${fdt_addr_r}];" \
+   "bootz ${loadaddr} - ${fdt_addr_r}; " \
"fi;\0"
 
 #define CONFIG_BOOTCOMMAND \
-- 
2.11.0


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


[U-Boot] [PATCH 2/2] imx: cx9020: try pxe boot, if no vmlinuz on mmc

2017-07-11 Thread linux-kernel-dev
From: Patrick Bruenn 

If no vmlinuz is found on mmc, try to boot from pxe.

Signed-off-by: Patrick Bruenn 

---

 configs/mx53cx9020_defconfig | 1 +
 include/configs/mx53cx9020.h | 5 +
 2 files changed, 6 insertions(+)

diff --git a/configs/mx53cx9020_defconfig b/configs/mx53cx9020_defconfig
index e0c597cbe2..9609647f0b 100644
--- a/configs/mx53cx9020_defconfig
+++ b/configs/mx53cx9020_defconfig
@@ -18,6 +18,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_PXE=y
 CONFIG_OF_CONTROL=y
 CONFIG_FPGA_ALTERA=y
 CONFIG_FPGA_CYCLON2=y
diff --git a/include/configs/mx53cx9020.h b/include/configs/mx53cx9020.h
index b056298d9a..cff1462d00 100644
--- a/include/configs/mx53cx9020.h
+++ b/include/configs/mx53cx9020.h
@@ -67,6 +67,7 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
"fdt_addr_r=0x71ff\0" \
+   "pxefile_addr_r=0x7300\0" \
"ramdisk_addr_r=0x7200\0" \
"console=ttymxc1,115200\0" \
"uenv=/boot/uEnv.txt\0" \
@@ -81,6 +82,7 @@
"rootfstype=${mmcrootfstype} " \
"${cmdline}\0" \
"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+   "loadpxe=dhcp;setenv kernel_addr_r ${loadaddr};pxe get;pxe boot;\0" \
"loadrd=load mmc ${bootpart} ${ramdisk_addr_r} ${bootdir}/${rdfile};" \
"setenv rdsize ${filesize}\0" \
"loadfdt=echo loading ${fdt_path} ...;" \
@@ -130,6 +132,9 @@
"echo debug: [${bootargs}] ... ;" \
"echo debug: [bootz ${loadaddr} - ${fdt_addr_r}];" \
"bootz ${loadaddr} - ${fdt_addr_r}; " \
+   "else " \
+   "echo loading from dhcp ...; " \
+   "run loadpxe; " \
"fi;\0"
 
 #define CONFIG_BOOTCOMMAND \
-- 
2.11.0


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


[U-Boot] [PATCH 0/2] Enable pxe boot for mx53cx9020

2017-07-11 Thread linux-kernel-dev
From: Patrick Bruenn 

To make kernel development more easy on CX9020, this scripts enables pxe
boot in the default bootscript. pxe boot is then used as a fallback in
case there is no vmlinuz found on mmc.


Patrick Bruenn (2):
  imx: cx9020: use fdt_addr_r and ramdisk_addr_r
  imx: cx9020: try pxe boot, if no vmlinuz on mmc

 configs/mx53cx9020_defconfig |  1 +
 include/configs/mx53cx9020.h | 17 +++--
 2 files changed, 12 insertions(+), 6 deletions(-)

-- 
2.11.0


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


Re: [U-Boot] [PATCH] arm: dts: imx53-cx9020: fix packetloss on fec_mxc

2017-01-23 Thread linux-kernel-dev
>From: Tom Rini [mailto:tr...@konsulko.com]
>Sent: Montag, 23. Januar 2017 16:31
>
>On Mon, Jan 23, 2017 at 03:11:27PM +0100, linux-kernel-...@beckhoff.com
>wrote:
>
>> From: Patrick Bruenn 
>>
>> The pinmuxing for i.MX53 FEC ethernet copied from
>> /arch/arm/boot/dts/imx53-qsb-common.dtsi (at least until v4.9)
>> was bad. It is different from the manual pinmuxing in
>> /board/freescale/mx53loco/mx53loco.c which was used in
>> cx9020 implementation previously before mainlining into u-boot.
>> It seems the bug in imx53-qsb kernel device tree is hidden for so long,
>> because it was never used, by the kernel driver.
>>
>> Signed-off-by: Patrick Bruenn 
>
>So in other words, the dts file is correct in current mainline kernel?
>Or still pending?  Thanks!
Sorry, no it is still pending. I just reported it to the kernel maintainers:
https://mail-archive.com/linux-kernel@vger.kernel.org/msg1316717.html

Patrick

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


[U-Boot] [PATCH] arm: dts: imx53-cx9020: fix packetloss on fec_mxc

2017-01-23 Thread linux-kernel-dev
From: Patrick Bruenn 

The pinmuxing for i.MX53 FEC ethernet copied from
/arch/arm/boot/dts/imx53-qsb-common.dtsi (at least until v4.9)
was bad. It is different from the manual pinmuxing in
/board/freescale/mx53loco/mx53loco.c which was used in
cx9020 implementation previously before mainlining into u-boot.
It seems the bug in imx53-qsb kernel device tree is hidden for so long,
because it was never used, by the kernel driver.

Signed-off-by: Patrick Bruenn 
---

 arch/arm/dts/imx53-cx9020.dts | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/dts/imx53-cx9020.dts b/arch/arm/dts/imx53-cx9020.dts
index 9610301..c928e72 100644
--- a/arch/arm/dts/imx53-cx9020.dts
+++ b/arch/arm/dts/imx53-cx9020.dts
@@ -114,16 +114,16 @@
MX53_PAD_SD2_CMD__ESDHC2_CMD0x1d5
MX53_PAD_SD2_CLK__ESDHC2_CLK0x1d5
 
-   MX53_PAD_FEC_MDC__FEC_MDC   
0x8000
-   MX53_PAD_FEC_MDIO__FEC_MDIO 
0x8000
-   MX53_PAD_FEC_REF_CLK__FEC_TX_CLK
0x8000
-   MX53_PAD_FEC_RX_ER__FEC_RX_ER   
0x8000
-   MX53_PAD_FEC_CRS_DV__FEC_RX_DV  
0x8000
-   MX53_PAD_FEC_RXD1__FEC_RDATA_1  
0x8000
-   MX53_PAD_FEC_RXD0__FEC_RDATA_0  
0x8000
-   MX53_PAD_FEC_TX_EN__FEC_TX_EN   
0x8000
-   MX53_PAD_FEC_TXD1__FEC_TDATA_1  
0x8000
-   MX53_PAD_FEC_TXD0__FEC_TDATA_0  
0x8000
+   MX53_PAD_FEC_MDC__FEC_MDC   0x4
+   MX53_PAD_FEC_MDIO__FEC_MDIO 0x1fc
+   MX53_PAD_FEC_REF_CLK__FEC_TX_CLK0x180
+   MX53_PAD_FEC_RX_ER__FEC_RX_ER   0x180
+   MX53_PAD_FEC_CRS_DV__FEC_RX_DV  0x180
+   MX53_PAD_FEC_RXD1__FEC_RDATA_1  0x180
+   MX53_PAD_FEC_RXD0__FEC_RDATA_0  0x180
+   MX53_PAD_FEC_TX_EN__FEC_TX_EN   0x4
+   MX53_PAD_FEC_TXD1__FEC_TDATA_1  0x4
+   MX53_PAD_FEC_TXD0__FEC_TDATA_0  0x4
 
MX53_PAD_CSI0_DAT8__I2C1_SDA
0x41ec
MX53_PAD_CSI0_DAT9__I2C1_SCL
0x41ec
-- 
2.7.4


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


[U-Boot] [PATCH v4] arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

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

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn 

---
Version 4 should address most of the issues Stefan, Jagan and Simon pointed out.
Missing:
- moving CONFIG_FSL_ESDHC from mx53cx9020.h to defconfig, which would require 
DM_GPIO.
  But as soon as I enable that my imx53 device does not boot up and shows 
nothing on
  uart anymore.
- and because of that DM_GPIO issue I am unable to use DM_LED_GPIO
- I couldn't get DM_VIDEO working, too.
If you have any hint or reference on how to get that running on imx53, please 
let
me know and I will improve that.

Changes in v4:
- move TARGET_MX53CX9020 from arch/arm/Kconfig to arch/arm/cpu/armv7/mx5/Kconfig
- move CONFIG_MX53 to arch/arm/cpu/armv7/mx5/Kconfig
- move CONFIG_MXC_UART to mx53cx9020_defconfig
- move CONFIG_FEC_MXC to mx53cx9020_defconfig
- remove redundant SYS_SOC from board/beckhoff/mx53cx9020/Kconfig
- enable MXC_UART for MX5 devices
- enable FEC_MXC for MX5 devices
- group ethernet related configs in mx53cx9020.h
- make clear mx53cx9020 was derived from the u-boot version of mx53loco not 
from kernel code
- replace 'loadccat' with 'fpga load'
- add pinctrl-imx5 driver and use device tree for pinmux configuration on cx9020

Changes in v3:
- replace CONFIG_TARGET_MX53CX9020 with CONFIG_MX53 in dts/Makefile
- remove redundant CONFIG_DISPLAY_BOARDINFO from mx53cx9020.h

Changes in v2:
- remove #include  from mx53cx9020.c
- remove obsolete CONFIG_CMD_CCAT from mx53cx9020.h

 arch/arm/cpu/armv7/mx5/Kconfig   |8 +
 arch/arm/dts/Makefile|2 +
 arch/arm/dts/imx53-cx9020.dts|  190 
 arch/arm/dts/imx53-pinfunc.h | 1189 ++
 arch/arm/dts/imx53.dtsi  |  110 +++
 board/beckhoff/mx53cx9020/Kconfig|   12 +
 board/beckhoff/mx53cx9020/MAINTAINERS|6 +
 board/beckhoff/mx53cx9020/Makefile   |9 +
 board/beckhoff/mx53cx9020/imximage.cfg   |   82 ++
 board/beckhoff/mx53cx9020/mx53cx9020.c   |  367 
 board/beckhoff/mx53cx9020/mx53cx9020_video.c |   49 ++
 configs/mx53cx9020_defconfig |   29 +
 drivers/fpga/Kconfig |   20 +
 drivers/net/Kconfig  |2 +-
 drivers/pinctrl/nxp/Kconfig  |   14 +
 drivers/pinctrl/nxp/Makefile |1 +
 drivers/pinctrl/nxp/pinctrl-imx5.c   |   44 +
 drivers/serial/Kconfig   |2 +-
 include/configs/mx53cx9020.h |  202 +
 include/dt-bindings/clock/imx5-clock.h   |  219 +
 20 files changed, 2555 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/imx53-cx9020.dts
 create mode 100644 arch/arm/dts/imx53-pinfunc.h
 create mode 100644 arch/arm/dts/imx53.dtsi
 create mode 100644 board/beckhoff/mx53cx9020/Kconfig
 create mode 100644 board/beckhoff/mx53cx9020/MAINTAINERS
 create mode 100644 board/beckhoff/mx53cx9020/Makefile
 create mode 100644 board/beckhoff/mx53cx9020/imximage.cfg
 create mode 100644 board/beckhoff/mx53cx9020/mx53cx9020.c
 create mode 100644 board/beckhoff/mx53cx9020/mx53cx9020_video.c
 create mode 100644 configs/mx53cx9020_defconfig
 create mode 100644 drivers/pinctrl/nxp/pinctrl-imx5.c
 create mode 100644 include/configs/mx53cx9020.h
 create mode 100644 include/dt-bindings/clock/imx5-clock.h

diff --git a/arch/arm/cpu/armv7/mx5/Kconfig b/arch/arm/cpu/armv7/mx5/Kconfig
index 9f250c6..5fb5513 100644
--- a/arch/arm/cpu/armv7/mx5/Kconfig
+++ b/arch/arm/cpu/armv7/mx5/Kconfig
@@ -18,11 +18,19 @@ config TARGET_USBARMORY
bool "Support USB armory"
select CPU_V7
 
+config TARGET_MX53CX9020
+   bool "Support CX9020"
+   select CPU_V7
+   select MX53
+   select DM
+   select DM_SERIAL
+
 endchoice
 
 config SYS_SOC
default "mx5"
 
+source "board/beckhoff/mx53cx9020/Kconfig"
 source "board/inversepath/usbarmory/Kconfig"
 
 endif
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 61eb852..cd00d53 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -282,6 +282,8 @@ dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
pcm052.dtb \
bk4r1.dtb
 
+dtb-$(CONFIG_MX53) += imx53-cx9020.dtb
+
 dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb \
imx6dl-icore.dtb \
imx6q-icore.dtb
diff --git a/arch/arm/dts/imx53-cx9020.dts b/arch/arm/dts/imx53-cx9020.dts
new file mode 100644
index 000..9610301
--- /dev/null
+++ b/arch/arm/dts/imx53-cx9020.dts
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2016 Beckhoff Automation
+ * Copyright 2011 

Re: [U-Boot] [PATCH v3] arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

2016-10-31 Thread linux-kernel-dev
Hi Jagan,
>From: Jagan Teki [mailto:ja...@openedev.com]
>Sent: Donnerstag, 20. Oktober 2016 12:52
>Subject: Re: [U-Boot] [PATCH v3] arm: imx: add i.MX53 Beckhoff CX9020
>Embedded PC
>
>On Mon, Oct 17, 2016 at 5:57 PM,   wrote:
>> From: Patrick Bruenn 
>>...
>> diff --git a/board/beckhoff/mx53cx9020/imximage.cfg
>b/board/beckhoff/mx53cx9020/imximage.cfg
>> new file mode 100644
>> index 000..c6bdc72
>> --- /dev/null
>> +++ b/board/beckhoff/mx53cx9020/imximage.cfg
>> @@ -0,0 +1,82 @@
>> +/*
>> + * Copyright (C) 2015  Beckhoff Automation GmbH
>> + * Patrick Bruenn 
>> + *
>> + * Based on Freescale's Linux i.MX mx53loco/imximage.cfg file:
>
>Is this Linux refenace file? I saw similar one at ./board/freescale/mx53loco.
It's from /board/freescale/mx53loco, I will make that more clear in the 
comment
>>...
>> diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c
>b/board/beckhoff/mx53cx9020/mx53cx9020.c
>> new file mode 100644
>> index 000..c92ec15
>> --- /dev/null
>> +++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
>> @@ -0,0 +1,563 @@
>> +/*
>> + * Copyright (C) 2015  Beckhoff Automation GmbH & Co. KG
>> + * Patrick Bruenn 
>> + *
>> + * Based on Freescale's Linux i.MX mx53loco.c file:
>
>Same as above
>
yes, same here.
>>...
>> +static void clock_1GHz(void)
>> +{
>> +   int ret;
>> +   u32 ref_clk = MXC_HCLK;
>> +   /*
>> +* After increasing voltage to 1.25V, we can switch
>> +* CPU clock to 1GHz and DDR to 400MHz safely
>> +*/
>> +   ret = mxc_set_clock(ref_clk, 1000, MXC_ARM_CLK);
>> +   if (ret)
>> +   printf("CPU:   Switch CPU clock to 1GHZ failed\n");
>> +
>> +   ret = mxc_set_clock(ref_clk, 400, MXC_PERIPH_CLK);
>> +   ret |= mxc_set_clock(ref_clk, 400, MXC_DDR_CLK);
>
>Why we need to | the previous ret?
>
To keep it the same as in mx53loco.c. Besides it sounds reasonable to me the 
check both functions for success.
>>...
>> +U_BOOT_CMD(loadccat, 5, 1, do_load_ccat,
>> +  "loads ccat firmware",
>> +  "   \n"
>> +  "- write FPGA firmware from 'dev' on 'interface' in 
>> 'filename' to
>CCAT using 'addr' as a buffer");
>
>Can't we achieve this through cmd/fpga* ?
>
Maybe, but I didn't find a working solution. From your experience should the 
cyclone2 driver work for cyclon3 as well?
>> ...
>> diff --git a/include/configs/mx53cx9020.h b/include/configs/mx53cx9020.h
>> new file mode 100644
>> index 000..b90e076
>> --- /dev/null
>> +++ b/include/configs/mx53cx9020.h
>> @@ -0,0 +1,206 @@
>> +/*
>> + * Copyright (C) 2015  Beckhoff Automation GmbH & Co. KG
>> + * Patrick Bruenn 
>> + *
>> + * Configuration settings for Beckhoff CX9020.
>> + *
>> + * Based on Freescale's Linux i.MX mx53loco.h file:
>> + * Copyright (C) 2010-2011 Freescale Semiconductor.
>> + *
>> + * SPDX-License-Identifier:GPL-2.0+
>> + */
>> +
>> +#ifndef __CONFIG_H
>> +#define __CONFIG_H
>> +
>> +#define CONFIG_MX53
>
>Move to defconfig
>
If I move that, mx53cx9020 would be different from all other mx53 boards.
Despite from that I tried to, but compiling will fail, because CPU_TYPE, 
required by imx-regs.h, is not set.
>> +
>> +#define CONFIG_MACH_TYPE   MACH_TYPE_MX53_LOCO
>
>What is the need for this?
>
I will remove it.
>> +
>> +#include 
>> +
>> +#define CONFIG_CMDLINE_TAG
>> +#define CONFIG_SETUP_MEMORY_TAGS
>> +#define CONFIG_INITRD_TAG
>> +
>> +#define CONFIG_SYS_FSL_CLK
>> +
>> +/* Size of malloc() pool */
>> +#define CONFIG_SYS_MALLOC_LEN  (10 * 1024 * 1024)
>> +
>> +#define CONFIG_BOARD_EARLY_INIT_F
>> +#define CONFIG_BOARD_LATE_INIT
>> +#define CONFIG_MXC_GPIO
>> +#define CONFIG_REVISION_TAG
>> +
>> +#define CONFIG_MXC_UART
>
>Move to defconfig
>
Again, mx53cx9020 would be different form all remaining mx53 boards. But at 
least this one seems to work.
>> +
>> +/* MMC Configs */
>> +#define CONFIG_FSL_ESDHC
>
>Move to defconfig
>
Again, mx53cx9020 would be different form all remaining mx53 boards. This one 
seems to work, too.
>> +#define CONFIG_SYS_FSL_ESDHC_ADDR  0
>> +#define CONFIG_SYS_FSL_ESDHC_NUM   2
>> +
>> +#define CONFIG_MMC
>> +#define CONFIG_GENERIC_MMC
>> +
>> +/* bootz: zImage/initrd.img support */
>> +#define CONFIG_DOS_PARTITION
>> +
>> +/* Eth Configs */
>> +#define CONFIG_MII
>> +
>> +#define CONFIG_FEC_MXC
>
>Move to defconfig
>
Again, mx53cx9020 would be different form all remaining mx53 boards. This one 
seems to work, too.
>> +#define IMX_FEC_BASE   FEC_BASE_ADDR
>> +#define CONFIG_FEC_MXC_PHYADDR 0x1F
>> +
>> +/* USB Configs */
>> +#define CONFIG_USB_EHCI
>> +#define CONFIG_USB_EHCI_MX5
>> +#define CONFIG_USB_STORAGE
>> +#define CONFIG_USB_HOST_ETHER
>> +#define CONFIG_USB_ETHER_ASIX
>> +#define CONFIG_USB_ETHER_MCS7830
>> +#define CONFIG_USB_ETHER_SMSC95XX
>> +#define CONFIG_MXC_USB_PORT1
>> +#define CONFIG_MXC_USB_PORTSC  (PORT_PTS_UTMI |
>PORT_PTS_PTW)

Re: [U-Boot] [PATCH v2] arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

2016-10-17 Thread linux-kernel-dev
>From: Jagan Teki [mailto:ja...@amarulasolutions.com]
>Sent: Montag, 17. Oktober 2016 14:49
>On Mon, Oct 17, 2016 at 6:14 PM, linux-kernel-dev
><linux-kernel-...@beckhoff.com> wrote:
>>>From: Jagan Teki [mailto:ja...@amarulasolutions.com]
>>>Sent: Montag, 17. Oktober 2016 13:53
>>>>>>
>>>>>> Since, it's have dts support please use pinctrl driver for pads and
>>>>>> mux atleast for supporting ones.
>>>>>
>>>>>..but for MX53 this is still missing, right ?
>>>> Yes, as stated here:
>>>> http://lists.denx.de/pipermail/u-boot/2016-September/268517.html
>>>> I would like to add that in a second patch on top of this.
>>>
>>>I think pinctrl is not taking much time as most of the generic code
>>>already in at drivers/pinctrl/nxp/pinctrl-imx.c and once you did that
>>>board code mostly reduced, I see a point in this sense.
>>>
>> Please excuse my bad understanding, but I don't get what you mean by "I
>see a point in this sense."
>> Is it you agree to make the port in a second step. Or do you disagree and
>want the pinctrl patch first?
>
>Since board file as many of pad definition, I am saying better to add
>pinctrl for mx5 which doesn't take much time as most of the generic
>pinctrl is already there in drivers/pinctrl/nxp/pinctrl-imx.c
>
Thanks for making that clear.
I can try to send a patch for this within the next days.
Should the cx9020 changes be bundled with it? As without it, there would be 
code without use and I have no other imx53 board which I could port and test 
against.
Regards,
Patrick
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

2016-10-17 Thread linux-kernel-dev
>From: Jagan Teki [mailto:ja...@amarulasolutions.com]
>Sent: Montag, 17. Oktober 2016 13:53

 Since, it's have dts support please use pinctrl driver for pads and
 mux atleast for supporting ones.
>>>
>>>..but for MX53 this is still missing, right ?
>> Yes, as stated here:
>> http://lists.denx.de/pipermail/u-boot/2016-September/268517.html
>> I would like to add that in a second patch on top of this.
>
>I think pinctrl is not taking much time as most of the generic code
>already in at drivers/pinctrl/nxp/pinctrl-imx.c and once you did that
>board code mostly reduced, I see a point in this sense.
>
Please excuse my bad understanding, but I don't get what you mean by "I see a 
point in this sense."
Is it you agree to make the port in a second step. Or do you disagree and want 
the pinctrl patch first?

Regards,
Patrick
--

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


[U-Boot] [PATCH v3] arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

2016-10-17 Thread linux-kernel-dev
From: Patrick Bruenn 

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn 

---

Changes in v3:
- replace CONFIG_TARGET_MX53CX9020 with CONFIG_MX53 in dts/Makefile
- remove redundant CONFIG_DISPLAY_BOARDINFO from mx53cx9020.h

Changes in v2:
- remove #include  from mx53cx9020.c
- remove obsolete CONFIG_CMD_CCAT from mx53cx9020.h

 arch/arm/Kconfig |   7 +
 arch/arm/dts/Makefile|   2 +
 arch/arm/dts/imx53-cx9020.dts|  26 ++
 arch/arm/dts/imx53.dtsi  |  41 ++
 board/beckhoff/mx53cx9020/Kconfig|  15 +
 board/beckhoff/mx53cx9020/MAINTAINERS|   6 +
 board/beckhoff/mx53cx9020/Makefile   |   9 +
 board/beckhoff/mx53cx9020/imximage.cfg   |  82 
 board/beckhoff/mx53cx9020/mx53cx9020.c   | 563 +++
 board/beckhoff/mx53cx9020/mx53cx9020_video.c |  83 
 configs/mx53cx9020_defconfig |  19 +
 include/configs/mx53cx9020.h | 206 ++
 12 files changed, 1059 insertions(+)
 create mode 100644 arch/arm/dts/imx53-cx9020.dts
 create mode 100644 arch/arm/dts/imx53.dtsi
 create mode 100644 board/beckhoff/mx53cx9020/Kconfig
 create mode 100644 board/beckhoff/mx53cx9020/MAINTAINERS
 create mode 100644 board/beckhoff/mx53cx9020/Makefile
 create mode 100644 board/beckhoff/mx53cx9020/imximage.cfg
 create mode 100644 board/beckhoff/mx53cx9020/mx53cx9020.c
 create mode 100644 board/beckhoff/mx53cx9020/mx53cx9020_video.c
 create mode 100644 configs/mx53cx9020_defconfig
 create mode 100644 include/configs/mx53cx9020.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f55d5b2..ece610a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -480,6 +480,12 @@ config TARGET_MX53LOCO
bool "Support mx53loco"
select CPU_V7
 
+config TARGET_MX53CX9020
+   bool "Support mx53cx9020"
+   select CPU_V7
+   select DM
+   select DM_SERIAL
+
 config TARGET_MX53SMD
bool "Support mx53smd"
select CPU_V7
@@ -965,6 +971,7 @@ source "board/freescale/mx51evk/Kconfig"
 source "board/freescale/mx53ard/Kconfig"
 source "board/freescale/mx53evk/Kconfig"
 source "board/freescale/mx53loco/Kconfig"
+source "board/beckhoff/mx53cx9020/Kconfig"
 source "board/freescale/mx53smd/Kconfig"
 source "board/freescale/s32v234evb/Kconfig"
 source "board/freescale/vf610twr/Kconfig"
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 04d47e7..85ceb90 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -286,6 +286,8 @@ dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb \
imx6dl-icore.dtb \
imx6q-icore.dtb
 
+dtb-$(CONFIG_MX53) += imx53-cx9020.dtb
+
 dtb-$(CONFIG_SOC_KEYSTONE) += k2hk-evm.dtb \
k2l-evm.dtb \
k2e-evm.dtb \
diff --git a/arch/arm/dts/imx53-cx9020.dts b/arch/arm/dts/imx53-cx9020.dts
new file mode 100644
index 000..4fc6214
--- /dev/null
+++ b/arch/arm/dts/imx53-cx9020.dts
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2016 Beckhoff Automation
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * SPDX-License-Identifier: GPL-2.0+ or X11
+ */
+
+/dts-v1/;
+#include "imx53.dtsi"
+
+/ {
+   model = "Beckhoff CX9020-0100 i.MX53";
+   compatible = "fsl,imx53-qsb", "fsl,imx53";
+
+   chosen {
+   stdout-path = 
+   };
+};
+
+ {
+   pinctrl-names = "default";
+   uart-has-rtscts;
+   fsl,dte-mode;
+   status = "okay";
+};
diff --git a/arch/arm/dts/imx53.dtsi b/arch/arm/dts/imx53.dtsi
new file mode 100644
index 000..3da0765
--- /dev/null
+++ b/arch/arm/dts/imx53.dtsi
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016 Beckhoff Automation
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include "skeleton.dtsi"
+
+/ {
+   aliases {
+   serial1 = 
+   };
+
+   soc {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "simple-bus";
+   ranges;
+
+   aips@5000 { /* AIPS1 */
+   compatible = "fsl,aips-bus", "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   reg = <0x5000 0x1000>;
+   

[U-Boot] [PATCH v2] arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

2016-10-08 Thread linux-kernel-dev
From: Patrick Bruenn 

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn 

---

Changes in v2:
- remove #include  from mx53cx9020.c
- remove obsolete CONFIG_CMD_CCAT from mx53cx9020.h

 arch/arm/Kconfig |   7 +
 arch/arm/dts/Makefile|   2 +
 arch/arm/dts/imx53-cx9020.dts|  26 ++
 arch/arm/dts/imx53.dtsi  |  41 ++
 board/beckhoff/mx53cx9020/Kconfig|  15 +
 board/beckhoff/mx53cx9020/MAINTAINERS|   6 +
 board/beckhoff/mx53cx9020/Makefile   |   9 +
 board/beckhoff/mx53cx9020/imximage.cfg   |  82 
 board/beckhoff/mx53cx9020/mx53cx9020.c   | 563 +++
 board/beckhoff/mx53cx9020/mx53cx9020_video.c |  83 
 configs/mx53cx9020_defconfig |  19 +
 include/configs/mx53cx9020.h | 208 ++
 12 files changed, 1061 insertions(+)
 create mode 100644 arch/arm/dts/imx53-cx9020.dts
 create mode 100644 arch/arm/dts/imx53.dtsi
 create mode 100644 board/beckhoff/mx53cx9020/Kconfig
 create mode 100644 board/beckhoff/mx53cx9020/MAINTAINERS
 create mode 100644 board/beckhoff/mx53cx9020/Makefile
 create mode 100644 board/beckhoff/mx53cx9020/imximage.cfg
 create mode 100644 board/beckhoff/mx53cx9020/mx53cx9020.c
 create mode 100644 board/beckhoff/mx53cx9020/mx53cx9020_video.c
 create mode 100644 configs/mx53cx9020_defconfig
 create mode 100644 include/configs/mx53cx9020.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f55d5b2..ece610a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -480,6 +480,12 @@ config TARGET_MX53LOCO
bool "Support mx53loco"
select CPU_V7
 
+config TARGET_MX53CX9020
+   bool "Support mx53cx9020"
+   select CPU_V7
+   select DM
+   select DM_SERIAL
+
 config TARGET_MX53SMD
bool "Support mx53smd"
select CPU_V7
@@ -965,6 +971,7 @@ source "board/freescale/mx51evk/Kconfig"
 source "board/freescale/mx53ard/Kconfig"
 source "board/freescale/mx53evk/Kconfig"
 source "board/freescale/mx53loco/Kconfig"
+source "board/beckhoff/mx53cx9020/Kconfig"
 source "board/freescale/mx53smd/Kconfig"
 source "board/freescale/s32v234evb/Kconfig"
 source "board/freescale/vf610twr/Kconfig"
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 04d47e7..3f753ba 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -286,6 +286,8 @@ dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb \
imx6dl-icore.dtb \
imx6q-icore.dtb
 
+dtb-$(CONFIG_TARGET_MX53CX9020) += imx53-cx9020.dtb
+
 dtb-$(CONFIG_SOC_KEYSTONE) += k2hk-evm.dtb \
k2l-evm.dtb \
k2e-evm.dtb \
diff --git a/arch/arm/dts/imx53-cx9020.dts b/arch/arm/dts/imx53-cx9020.dts
new file mode 100644
index 000..4fc6214
--- /dev/null
+++ b/arch/arm/dts/imx53-cx9020.dts
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2016 Beckhoff Automation
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * SPDX-License-Identifier: GPL-2.0+ or X11
+ */
+
+/dts-v1/;
+#include "imx53.dtsi"
+
+/ {
+   model = "Beckhoff CX9020-0100 i.MX53";
+   compatible = "fsl,imx53-qsb", "fsl,imx53";
+
+   chosen {
+   stdout-path = 
+   };
+};
+
+ {
+   pinctrl-names = "default";
+   uart-has-rtscts;
+   fsl,dte-mode;
+   status = "okay";
+};
diff --git a/arch/arm/dts/imx53.dtsi b/arch/arm/dts/imx53.dtsi
new file mode 100644
index 000..3da0765
--- /dev/null
+++ b/arch/arm/dts/imx53.dtsi
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016 Beckhoff Automation
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include "skeleton.dtsi"
+
+/ {
+   aliases {
+   serial1 = 
+   };
+
+   soc {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "simple-bus";
+   ranges;
+
+   aips@5000 { /* AIPS1 */
+   compatible = "fsl,aips-bus", "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   reg = <0x5000 0x1000>;
+   ranges;
+
+   uart2: serial@53fc {
+   compatible = "fsl,imx7d-uart", 

[U-Boot] [PATCH] arm: imx: add i.MX53 Beckhoff CX9020 Embedded PC

2016-09-28 Thread linux-kernel-dev
From: Patrick Bruenn 

Add CX9020 board based on mx53loco.
Add simplified imx53 base device tree from kernel v4.8-rc8, to reuse
serial_mxc with DTE and prepare for device tree migration of other
functions and imx53 devices.

The CX9020 differs from i.MX53 Quick Start Board by:
- use uart2 instead of uart1
- DVI-D connector instead of VGA
- no audio
- CCAT FPGA connected to emi
- enable rtc

Signed-off-by: Patrick Bruenn 

---

 arch/arm/Kconfig |   7 +
 arch/arm/dts/Makefile|   2 +
 arch/arm/dts/imx53-cx9020.dts|  26 ++
 arch/arm/dts/imx53.dtsi  |  41 ++
 board/beckhoff/mx53cx9020/Kconfig|  15 +
 board/beckhoff/mx53cx9020/MAINTAINERS|   6 +
 board/beckhoff/mx53cx9020/Makefile   |   9 +
 board/beckhoff/mx53cx9020/imximage.cfg   |  82 
 board/beckhoff/mx53cx9020/mx53cx9020.c   | 564 +++
 board/beckhoff/mx53cx9020/mx53cx9020_video.c |  83 
 configs/mx53cx9020_defconfig |  19 +
 include/configs/mx53cx9020.h | 211 ++
 12 files changed, 1065 insertions(+)
 create mode 100644 arch/arm/dts/imx53-cx9020.dts
 create mode 100644 arch/arm/dts/imx53.dtsi
 create mode 100644 board/beckhoff/mx53cx9020/Kconfig
 create mode 100644 board/beckhoff/mx53cx9020/MAINTAINERS
 create mode 100644 board/beckhoff/mx53cx9020/Makefile
 create mode 100644 board/beckhoff/mx53cx9020/imximage.cfg
 create mode 100644 board/beckhoff/mx53cx9020/mx53cx9020.c
 create mode 100644 board/beckhoff/mx53cx9020/mx53cx9020_video.c
 create mode 100644 configs/mx53cx9020_defconfig
 create mode 100644 include/configs/mx53cx9020.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c871eaf..82afd55 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -573,6 +573,12 @@ config TARGET_MX53LOCO
bool "Support mx53loco"
select CPU_V7
 
+config TARGET_MX53CX9020
+   bool "Support mx53cx9020"
+   select CPU_V7
+   select DM
+   select DM_SERIAL
+
 config TARGET_MX53SMD
bool "Support mx53smd"
select CPU_V7
@@ -994,6 +1000,7 @@ source "board/freescale/mx51evk/Kconfig"
 source "board/freescale/mx53ard/Kconfig"
 source "board/freescale/mx53evk/Kconfig"
 source "board/freescale/mx53loco/Kconfig"
+source "board/beckhoff/mx53cx9020/Kconfig"
 source "board/freescale/mx53smd/Kconfig"
 source "board/freescale/s32v234evb/Kconfig"
 source "board/freescale/vf610twr/Kconfig"
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 74d6ed2..5a926cb 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -275,6 +275,8 @@ dtb-$(CONFIG_MX7) += imx7-colibri.dtb
 
 dtb-$(CONFIG_MX6) += imx6ull-14x14-evk.dtb
 
+dtb-$(CONFIG_TARGET_MX53CX9020) += imx53-cx9020.dtb
+
 dtb-$(CONFIG_SOC_KEYSTONE) += k2hk-evm.dtb \
k2l-evm.dtb \
k2e-evm.dtb \
diff --git a/arch/arm/dts/imx53-cx9020.dts b/arch/arm/dts/imx53-cx9020.dts
new file mode 100644
index 000..4fc6214
--- /dev/null
+++ b/arch/arm/dts/imx53-cx9020.dts
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2016 Beckhoff Automation
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * SPDX-License-Identifier: GPL-2.0+ or X11
+ */
+
+/dts-v1/;
+#include "imx53.dtsi"
+
+/ {
+   model = "Beckhoff CX9020-0100 i.MX53";
+   compatible = "fsl,imx53-qsb", "fsl,imx53";
+
+   chosen {
+   stdout-path = 
+   };
+};
+
+ {
+   pinctrl-names = "default";
+   uart-has-rtscts;
+   fsl,dte-mode;
+   status = "okay";
+};
diff --git a/arch/arm/dts/imx53.dtsi b/arch/arm/dts/imx53.dtsi
new file mode 100644
index 000..3da0765
--- /dev/null
+++ b/arch/arm/dts/imx53.dtsi
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016 Beckhoff Automation
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#include "skeleton.dtsi"
+
+/ {
+   aliases {
+   serial1 = 
+   };
+
+   soc {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "simple-bus";
+   ranges;
+
+   aips@5000 { /* AIPS1 */
+   compatible = "fsl,aips-bus", "simple-bus";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   reg = <0x5000 0x1000>;
+   ranges;
+
+   uart2: serial@53fc {
+   compatible = "fsl,imx7d-uart", 
"fsl,imx53-uart", "fsl,imx21-uart";
+   reg = <0x53fc 0x4000>;
+