Re: [U-Boot] [RFC] board/liteboard: Add support for liteSOM and liteBoard

2016-09-14 Thread Marcin Niestroj

On 13.09.2016 20:23, Fabio Estevam wrote:

Hi Marcin,

On Wed, Aug 31, 2016 at 7:54 AM, Marcin Niestroj
 wrote:

liteSOM is a System On Module (http://grinn-global.com/litesom/). It
can't exists on its own, but will be used as part of other boards.

Hardware specification:
 * NXP i.MX6UL processor
 * 256M or 512M DDR3 memory
 * optional eMMC (uSDHC2)

liteBoard is a development board which uses liteSOM as its base.

Hardware specification:
 * liteSOM (i.MX6UL, DRAM, eMMC)
 * Ethernet PHY (id 0)
 * USB host (usb_otg1)
 * MicroSD slot (uSDHC1)

The main question is: how should liteSOM sources be integrated? I didn't
find similar modules, which are part of different boards in u-boot
tree. For now, I've put source into arch/arm/mach-litesom, but I guess
it is not the best place for them.


What about placing it inside board/grinn/ ?


Putting them in board/grinn/ was my first idea (adding them to
board/litesom/). Unfortunately there is no easy way to build those
sources there.

Board sources are built depending on vendor and board name. As litesom
will never be a board name, these sources won't compile.

Additionally there is a possibility to add "common" directory inside
vendor directory (so there would be something like 
board/grinn/common/litesom/). This will work for all grinn boards. But 
the idea is

that some other vendor can make a board that will use litesom. And in
that case sources from board/grinn/ directory won't compile.

So my idea was to treat SOM go rather like SOC which is in arch/, than
BOARD.




+   .p0_mpdgctrl0 = 0x41490145,
+   .p0_mprddlctl = 0x40404546,
+   .p0_mpwrdlctl = 0x4040524D,
+};
+
+struct mx6_ddr_sysinfo ddr_sysinfo = {
+   .dsize = 0,
+   .cs_density = 20,
+   .ncs = 1,
+   .cs1_mirror = 0,
+   .rtt_wr = 2,
+   .rtt_nom = 1,   /* RTT_Nom = RZQ/2 */
+   .walat = 1, /* Write additional latency */
+   .ralat = 5, /* Read additional latency */
+   .mif3_mode = 3, /* Command prediction working mode */
+   .bi_on = 1, /* Bank interleaving enabled */
+   .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */
+   .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */
+   .ddr_type = DDR_TYPE_DDR3,


Please rebase against U-Boot 2016.09. There are new fields now: refsel and refr.



Thanks for noticing.

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


Re: [U-Boot] [RFC] board/liteboard: Add support for liteSOM and liteBoard

2016-09-13 Thread Fabio Estevam
Hi Marcin,

On Wed, Aug 31, 2016 at 7:54 AM, Marcin Niestroj
 wrote:
> liteSOM is a System On Module (http://grinn-global.com/litesom/). It
> can't exists on its own, but will be used as part of other boards.
>
> Hardware specification:
>  * NXP i.MX6UL processor
>  * 256M or 512M DDR3 memory
>  * optional eMMC (uSDHC2)
>
> liteBoard is a development board which uses liteSOM as its base.
>
> Hardware specification:
>  * liteSOM (i.MX6UL, DRAM, eMMC)
>  * Ethernet PHY (id 0)
>  * USB host (usb_otg1)
>  * MicroSD slot (uSDHC1)
>
> The main question is: how should liteSOM sources be integrated? I didn't
> find similar modules, which are part of different boards in u-boot
> tree. For now, I've put source into arch/arm/mach-litesom, but I guess
> it is not the best place for them.

What about placing it inside board/grinn/ ?

> +   .p0_mpdgctrl0 = 0x41490145,
> +   .p0_mprddlctl = 0x40404546,
> +   .p0_mpwrdlctl = 0x4040524D,
> +};
> +
> +struct mx6_ddr_sysinfo ddr_sysinfo = {
> +   .dsize = 0,
> +   .cs_density = 20,
> +   .ncs = 1,
> +   .cs1_mirror = 0,
> +   .rtt_wr = 2,
> +   .rtt_nom = 1,   /* RTT_Nom = RZQ/2 */
> +   .walat = 1, /* Write additional latency */
> +   .ralat = 5, /* Read additional latency */
> +   .mif3_mode = 3, /* Command prediction working mode */
> +   .bi_on = 1, /* Bank interleaving enabled */
> +   .sde_to_rst = 0x10, /* 14 cycles, 200us (JEDEC default) */
> +   .rst_to_cke = 0x23, /* 33 cycles, 500us (JEDEC default) */
> +   .ddr_type = DDR_TYPE_DDR3,

Please rebase against U-Boot 2016.09. There are new fields now: refsel and refr.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC] board/liteboard: Add support for liteSOM and liteBoard

2016-08-31 Thread Marcin Niestroj
liteSOM is a System On Module (http://grinn-global.com/litesom/). It
can't exists on its own, but will be used as part of other boards.

Hardware specification:
 * NXP i.MX6UL processor
 * 256M or 512M DDR3 memory
 * optional eMMC (uSDHC2)

liteBoard is a development board which uses liteSOM as its base.

Hardware specification:
 * liteSOM (i.MX6UL, DRAM, eMMC)
 * Ethernet PHY (id 0)
 * USB host (usb_otg1)
 * MicroSD slot (uSDHC1)

The main question is: how should liteSOM sources be integrated? I didn't
find similar modules, which are part of different boards in u-boot
tree. For now, I've put source into arch/arm/mach-litesom, but I guess
it is not the best place for them.

The patch below compiles and runs successfully on liteBoard. It is based
on 2016-09-rc2.

Signed-off-by: Marcin Niestroj 
---
 arch/arm/Kconfig|   2 +
 arch/arm/Makefile   |   1 +
 arch/arm/cpu/armv7/mx6/Kconfig  |   5 +
 arch/arm/mach-litesom/Kconfig   |   6 +
 arch/arm/mach-litesom/Makefile  |   6 +
 arch/arm/mach-litesom/include/litesom.h |  16 ++
 arch/arm/mach-litesom/litesom.c | 207 
 board/grinn/liteboard/Kconfig   |  12 ++
 board/grinn/liteboard/MAINTAINERS   |   6 +
 board/grinn/liteboard/Makefile  |   6 +
 board/grinn/liteboard/README|  31 
 board/grinn/liteboard/board.c   | 271 
 configs/liteboard_defconfig |  22 +++
 include/configs/liteboard.h | 175 +
 14 files changed, 766 insertions(+)
 create mode 100644 arch/arm/mach-litesom/Kconfig
 create mode 100644 arch/arm/mach-litesom/Makefile
 create mode 100644 arch/arm/mach-litesom/include/litesom.h
 create mode 100644 arch/arm/mach-litesom/litesom.c
 create mode 100644 board/grinn/liteboard/Kconfig
 create mode 100644 board/grinn/liteboard/MAINTAINERS
 create mode 100644 board/grinn/liteboard/Makefile
 create mode 100644 board/grinn/liteboard/README
 create mode 100644 board/grinn/liteboard/board.c
 create mode 100644 configs/liteboard_defconfig
 create mode 100644 include/configs/liteboard.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c871eaf..4216a15 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -913,6 +913,8 @@ source "arch/arm/mach-keystone/Kconfig"
 
 source "arch/arm/mach-kirkwood/Kconfig"
 
+source "arch/arm/mach-litesom/Kconfig"
+
 source "arch/arm/mach-mvebu/Kconfig"
 
 source "arch/arm/cpu/armv7/mx7/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 42093c2..3e804d7 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -58,6 +58,7 @@ machine-$(CONFIG_ARCH_HIGHBANK)   += highbank
 machine-$(CONFIG_ARCH_KEYSTONE)+= keystone
 # TODO: rename CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD
 machine-$(CONFIG_KIRKWOOD) += kirkwood
+machine-$(CONFIG_LITESOM)  += litesom
 machine-$(CONFIG_ARCH_MESON)   += meson
 machine-$(CONFIG_ARCH_MVEBU)   += mvebu
 # TODO: rename CONFIG_TEGRA -> CONFIG_ARCH_TEGRA
diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
index 78383f0..1f72413 100644
--- a/arch/arm/cpu/armv7/mx6/Kconfig
+++ b/arch/arm/cpu/armv7/mx6/Kconfig
@@ -140,6 +140,10 @@ config TARGET_PICO_IMX6UL
bool "PICO-IMX6UL-EMMC"
select MX6UL
 
+config TARGET_LITEBOARD
+   bool "Grinn liteBoard (i.MX6UL)"
+   select LITESOM
+
 config TARGET_PLATINUM_PICON
bool "platinum-picon"
select SUPPORT_SPL
@@ -217,6 +221,7 @@ source "board/freescale/mx6slevk/Kconfig"
 source "board/freescale/mx6sxsabresd/Kconfig"
 source "board/freescale/mx6sxsabreauto/Kconfig"
 source "board/freescale/mx6ul_14x14_evk/Kconfig"
+source "board/grinn/liteboard/Kconfig"
 source "board/phytec/pcm058/Kconfig"
 source "board/gateworks/gw_ventana/Kconfig"
 source "board/kosagi/novena/Kconfig"
diff --git a/arch/arm/mach-litesom/Kconfig b/arch/arm/mach-litesom/Kconfig
new file mode 100644
index 000..9b7f36d
--- /dev/null
+++ b/arch/arm/mach-litesom/Kconfig
@@ -0,0 +1,6 @@
+config LITESOM
+   bool
+   select MX6UL
+   select DM
+   select DM_THERMAL
+   select SUPPORT_SPL
diff --git a/arch/arm/mach-litesom/Makefile b/arch/arm/mach-litesom/Makefile
new file mode 100644
index 000..b15eb64
--- /dev/null
+++ b/arch/arm/mach-litesom/Makefile
@@ -0,0 +1,6 @@
+# (C) Copyright 2016 Grinn
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y  := litesom.o
diff --git a/arch/arm/mach-litesom/include/litesom.h 
b/arch/arm/mach-litesom/include/litesom.h
new file mode 100644
index 000..6833949
--- /dev/null
+++ b/arch/arm/mach-litesom/include/litesom.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2016 Grinn
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __ARCH_ARM_MACH_LITESOM_SOM_H__
+#define __ARCH_ARM_MACH_LITESOM_SOM_H__
+
+int litesom_mmc_init(bd_t *bis);
+
+#ifdef