[U-Boot] Ordering PCI device probes

2018-08-18 Thread Aaron Williams
Hi all,

I am trying to port our OcteonTX Linux NAND driver to U-Boot and am running 
into an issue with ordering. We have a bch engine which consists of a pf and a 
vf and uses SRIOV to activate the vf.

The problem is that the nand device is probed before the BCH engine is probed 
and the NAND driver depends on the BCH driver.

In Linux, this is handled by having the NAND driver probe function return 
EPROBE_DEFER which causes the probe function to be called later after all of 
the other probe functions have been called. U-Boot does not use EPROBE_DEFER 
so is there some other way I can do this or otherwise change the ordering of 
the probes?

-Aaron


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


[U-Boot] [PATCH] ARM: display5: config: Replace hardcoded size of kernel (0x2000) with variable (fitImg_fw_sz)

2018-08-18 Thread Lukasz Majewski
This cosmetic change allow easy adjustment of the to-load kernel size if
needed.

Signed-off-by: Lukasz Majewski 

---

 include/configs/display5.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/configs/display5.h b/include/configs/display5.h
index fc8261373a..514638f684 100644
--- a/include/configs/display5.h
+++ b/include/configs/display5.h
@@ -166,7 +166,7 @@
  "rootwait rootfstype=ext4 rw; " \
"run set_kernel_part;" \
"part start mmc ${mmcdev} ${kernel_part} lba_start; " \
-   "mmc read ${loadaddr} ${lba_start} 0x2000; " \
+   "mmc read ${loadaddr} ${lba_start} ${fitImg_fw_sz}; " \
"setenv fdt_conf imx6q-${board}-${display}.dtb; "
 
 /* All the numbers are in LBAs */
@@ -273,6 +273,7 @@
"fdt_high=0x\0" \
"initrd_high=0x\0" \
"kernel_file=fitImage\0" \
+   "fitImg_fw_sz=0x2200\0" \
"up=run tftp_sf_SPL; run tftp_sf_uboot\0" \
"download_kernel=" \
"tftpboot ${loadaddr} ${kernel_file};\0" \
-- 
2.11.0

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


Re: [U-Boot] sunxi: USB gadget does not work on H2+ after 92a30692b2b18f45aae6fdaae38d67ed03dd2d11

2018-08-18 Thread Jagan Teki
On Sat, Aug 18, 2018 at 11:35 PM, Nuno Gonçalves  wrote:
> With the basic defconfig + CMD_USB_MASS_STORAGE, I don't get the driver to 
> load:
>
> Controller uninitialized
> g_dnl_register: failed!, error: -6
> g_dnl_register failed

Are you using mainline? is your defconfig has MUSB? try to see
existing H3 defconfigs for reference.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] sunxi: USB gadget does not work on H2+ after 92a30692b2b18f45aae6fdaae38d67ed03dd2d11

2018-08-18 Thread Jagan Teki
On Sat, Aug 18, 2018 at 10:05 PM, Nuno Gonçalves  wrote:
> On Sat, Aug 18, 2018 at 6:29 PM Jagan Teki 
> wrote:
>>
>> See the board I've mentioned, it's Sinovoip_BPI_M2_Plus_defconfig
>
>
> That is the reason I asked, since that defconfig does not have
> CONFIG_CMD_USB_MASS_STORAGE. Your test is done with something else.

We, sunxi treated this CONFIG as user defined, not giving room to add
it on defconfig. I enabled via menuconfig.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v5] arm: socfpga: fix U-Boot running from fpga OnChip RAM

2018-08-18 Thread Marek Vasut
On 08/18/2018 10:55 AM, Simon Goldschmidt wrote:
> On Fri, Aug 17, 2018 at 12:20 PM Marek Vasut  wrote:
>>
>> On 08/17/2018 08:56 AM, Simon Goldschmidt wrote:
>>> On Fri, Aug 17, 2018 at 1:57 AM Marek Vasut  wrote:

 On 08/16/2018 09:44 PM, Simon Goldschmidt wrote:
> On Thu, Aug 16, 2018 at 4:04 PM Marek Vasut  wrote:
>>
>> On 08/16/2018 03:50 PM, Simon Goldschmidt wrote:
>>> On Thu, Aug 16, 2018 at 3:15 PM Marek Vasut  wrote:

 On 08/16/2018 03:12 PM, Simon Goldschmidt wrote:
>
>
> Marek Vasut mailto:ma...@denx.de>> schrieb am Do., 16.
> Aug. 2018, 15:06:
>
> On 08/16/2018 03:00 PM, Simon Goldschmidt wrote:
> > On Thu, Aug 16, 2018 at 1:18 PM Marek Vasut  > wrote:
> >>
> >> On 08/16/2018 09:38 AM, Simon Goldschmidt wrote:
> >>> gd->env_addr points to pre-relocation address even after
> >>> relocation. This leads to an abort in env_callback_init
> >>> when loading the environment.
> >>>
> >>> Fix this by enabling CONFIG_SYS_EXTRA_ENV_RELOC.
> >>>
> >>> Signed-off-by: Simon Goldschmidt
>  >
> >>
> >> I have one last question -- does this somehow influence SPL ?
> >
> > No, it doesn't. The code that gets enabled by this define is in
> > common/board_r.c, which is not linked for SPL.
>
> Ah, thanks for checking.
>
> btw do you think it'd make sense to just enable this by default 
> on all
> systems and zap the EXTRA_ENV_RELOC macro altogether ?
>
>
> Yes, that's what I have thought about already. Just like the for the
> embedded device tree relocation, we could then probably use
> gd->reloc_off instead of CONFIG_SYS_MONITOR_BASE. I'm just not sure 
> this
> really works for all boards, but it would be worth a try to push after
> this release is out.

 I think so too. I cannot think of a reason why this shouldn't be 
 enabled
 in fact.
>>>
>>> Exactly. Too me it seems like a leftover, especially given the use of
>>> CONFIG_SYS_MONITOR_BASE, which seems a little outdated, too.
>>> I've set up a reminder for a patch to remove it after the release.
>>
>> Feel free to send it now.
>
> OK, I have tried, but it seems it's not that easy: some boards
> override the initial gd->env_addr by setting CONFIG_ENV_ADDR. So if
> this is outside of U-Boot's pre-relocation range, it clearly should
> not be relocated. One might find an improved way to relocate
> gd->env_addr if it is internal (e.g. checking the range to be in
> pre-relocation?). But simply removing the EXTRA_ENV_RELOC  does not
> seem to work.

 Shouldn't most of those boards be easily fixable ?
>>>
>>> Well, if we unconditionally alter gd->env_addr by gd->reloc_off,
>>> boards that have their initial gd->env_addr outside of the initial
>>> binary can be fixed only by changing their behaviour. I don't know how
>>> widely used this feature is, but since it's a config option
>>> (CONFIG_ENV_ADDR), how would we know?
>>
>> git grep ? But aren't you mixing CONFIG_ENV_ADDR and CONFIG_ENV_RELOC ?
> 
> Have a look at env_sf_init() in env/sf.c (called from env_init(),
> which in turn is called from board_init_f()). There gd->env_addr is
> initialized by a config setting. If this user-supplied address is
> outside of the binary, relocating it is wrong, isn't it?

I think you want to relocate the env close to where U-Boot is relocated
in all cases, no ?

> Anyway, I'm off for 2 weeks now (holiday time here) with some email
> access at most, so I'll continue on this when I get back.

Have a nice vacation.

> Simon
> 
>>
>>> So to me that means we still have to make this overridable and could
>>> change the "default" state of such an option only. Meaning that the
>>> default is "relocate gd->env_addr" with an option to leave it. But is
>>> this really worth breaking existing boards?
>>
>> I think you do want to relocate the env alongside U-Boot, always, no ?
>>
>> --
>> Best regards,
>> Marek Vasut


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


[U-Boot] [PATCH 2/3] ARM: dts: socfpga: Flag timer clock as pre-reloc

2018-08-18 Thread Marek Vasut
Flag timer clock as DM pre-reloc, so that a timer driver can be used and
it can extract information about it's clock rate using the clock framework.
This patch also moves some of the pre-reloc flags into the core dtsi file,
this is because the timer is not board specific, but rather is used on all
boards.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
Cc: Ley Foon Tan 
---
 arch/arm/dts/socfpga_arria10.dtsi   | 10 ++
 arch/arm/dts/socfpga_arria10_socdk.dtsi | 12 
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/arch/arm/dts/socfpga_arria10.dtsi 
b/arch/arm/dts/socfpga_arria10.dtsi
index ce000512ef..573974be04 100644
--- a/arch/arm/dts/socfpga_arria10.dtsi
+++ b/arch/arm/dts/socfpga_arria10.dtsi
@@ -21,6 +21,11 @@
#address-cells = <1>;
#size-cells = <1>;
 
+   chosen {
+   tick-timer = 
+   u-boot,dm-pre-reloc;
+   };
+
cpus {
#address-cells = <1>;
#size-cells = <0>;
@@ -147,6 +152,7 @@
compatible = 
"altr,socfpga-a10-perip-clk";
clocks = <_pll>;
div-reg = <0x144 0 11>;
+   u-boot,dm-pre-reloc;
};
 
main_emaca_clk: 
main_emaca_clk@68 {
@@ -236,6 +242,7 @@
compatible = 
"altr,socfpga-a10-perip-clk";
clocks = <_pll>;
div-reg = <0x144 16 11>;
+   u-boot,dm-pre-reloc;
};
 
peri_emaca_clk: 
peri_emaca_clk@e8 {
@@ -311,6 +318,7 @@
 <>, 
<_intosc_hs_div2_clk>,
 <_free_clk>;
reg = <0x64>;
+   u-boot,dm-pre-reloc;
};
 
s2f_user1_free_clk: 
s2f_user1_free_clk@104 {
@@ -337,6 +345,7 @@
compatible = 
"altr,socfpga-a10-perip-clk";
clocks = <_free_clk>;
fixed-divider = <4>;
+   u-boot,dm-pre-reloc;
};
 
l4_main_clk: l4_main_clk {
@@ -800,6 +809,7 @@
reg = <0xffd0 0x100>;
clocks = <_sys_free_clk>;
clock-names = "timer";
+   u-boot,dm-pre-reloc;
};
 
timer3: timer3@ffd00100 {
diff --git a/arch/arm/dts/socfpga_arria10_socdk.dtsi 
b/arch/arm/dts/socfpga_arria10_socdk.dtsi
index 9160c20bd0..17e0b75a8f 100644
--- a/arch/arm/dts/socfpga_arria10_socdk.dtsi
+++ b/arch/arm/dts/socfpga_arria10_socdk.dtsi
@@ -169,22 +169,10 @@
 };
 
 /* Clock available early */
-_noc_base_clk {
-   u-boot,dm-pre-reloc;
-};
-
 _periph_ref_clk {
u-boot,dm-pre-reloc;
 };
 
-_noc_base_clk {
-   u-boot,dm-pre-reloc;
-};
-
-_free_clk {
-   u-boot,dm-pre-reloc;
-};
-
 _mp_clk {
u-boot,dm-pre-reloc;
 };
-- 
2.16.2

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


[U-Boot] [PATCH 3/3] ARM: socfpga: Convert Arria10 to timer framework

2018-08-18 Thread Marek Vasut
Switch the Arria10 from ad-hoc hardcoded timer to timer framework
and the DW APB timer driver. This allows the A10 to extract timer
information, like timer rate, from clock framework and thus DT
instead of having it hardcoded in U-Boot configuration files.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
Cc: Ley Foon Tan 
---
 arch/arm/mach-socfpga/Makefile| 1 -
 configs/socfpga_arria10_defconfig | 3 +++
 include/configs/socfpga_common.h  | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach-socfpga/Makefile
index 654999cdf6..e66720447f 100644
--- a/arch/arm/mach-socfpga/Makefile
+++ b/arch/arm/mach-socfpga/Makefile
@@ -26,7 +26,6 @@ obj-y += clock_manager_arria10.o
 obj-y  += misc_arria10.o
 obj-y  += pinmux_arria10.o
 obj-y  += reset_manager_arria10.o
-obj-y  += timer.o
 endif
 
 ifdef CONFIG_TARGET_SOCFPGA_STRATIX10
diff --git a/configs/socfpga_arria10_defconfig 
b/configs/socfpga_arria10_defconfig
index 4b0d47489a..a504035547 100644
--- a/configs/socfpga_arria10_defconfig
+++ b/configs/socfpga_arria10_defconfig
@@ -39,4 +39,7 @@ CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_MII=y
 CONFIG_SPI=y
+CONFIG_TIMER=y
+CONFIG_SPL_TIMER=y
+CONFIG_DESIGNWARE_APB_TIMER=y
 CONFIG_USE_TINY_PRINTF=y
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 440a918fc7..2330143cf1 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -86,11 +86,13 @@
 /*
  * L4 OSC1 Timer 0
  */
+#ifndef CONFIG_TIMER
 /* This timer uses eosc1, whose clock frequency is fixed at any condition. */
 #define CONFIG_SYS_TIMERBASE   SOCFPGA_OSC1TIMER0_ADDRESS
 #define CONFIG_SYS_TIMER_COUNTS_DOWN
 #define CONFIG_SYS_TIMER_COUNTER   (CONFIG_SYS_TIMERBASE + 0x4)
 #define CONFIG_SYS_TIMER_RATE  2500
+#endif
 
 /*
  * L4 Watchdog
-- 
2.16.2

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


[U-Boot] [PATCH 1/3] timer: dw-apb: Add Designware APB timer driver

2018-08-18 Thread Marek Vasut
Add timer driver for the Designware APB Timer IP. This is present
for example on the Altera SoCFPGA chips.

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
Cc: Ley Foon Tan 
---
 drivers/timer/Kconfig|  7 
 drivers/timer/Makefile   |  1 +
 drivers/timer/dw-apb-timer.c | 90 
 3 files changed, 98 insertions(+)
 create mode 100644 drivers/timer/dw-apb-timer.c

diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig
index 8a31397553..5ab6749193 100644
--- a/drivers/timer/Kconfig
+++ b/drivers/timer/Kconfig
@@ -59,6 +59,13 @@ config CADENCE_TTC_TIMER
  Enables support for the cadence ttc driver. This driver is present
  on Xilinx Zynq and ZynqMP SoCs.
 
+config DESIGNWARE_APB_TIMER
+   bool "Designware APB Timer"
+   depends on TIMER
+   help
+ Enables support for the Designware APB Timer driver. This timer is
+ present on Altera SoCFPGA SoCs.
+
 config SANDBOX_TIMER
bool "Sandbox timer support"
depends on SANDBOX && TIMER
diff --git a/drivers/timer/Makefile b/drivers/timer/Makefile
index ee2fcb1fa7..0c8a62767a 100644
--- a/drivers/timer/Makefile
+++ b/drivers/timer/Makefile
@@ -5,6 +5,7 @@
 obj-y += timer-uclass.o
 obj-$(CONFIG_ALTERA_TIMER) += altera_timer.o
 obj-$(CONFIG_CADENCE_TTC_TIMER)+= cadence-ttc.o
+obj-$(CONFIG_DESIGNWARE_APB_TIMER) += dw-apb-timer.o
 obj-$(CONFIG_SANDBOX_TIMER)+= sandbox_timer.o
 obj-$(CONFIG_X86_TSC_TIMER)+= tsc_timer.o
 obj-$(CONFIG_OMAP_TIMER)   += omap-timer.o
diff --git a/drivers/timer/dw-apb-timer.c b/drivers/timer/dw-apb-timer.c
new file mode 100644
index 00..031f429acb
--- /dev/null
+++ b/drivers/timer/dw-apb-timer.c
@@ -0,0 +1,90 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Designware APB Timer driver
+ *
+ * Copyright (C) 2018 Marek Vasut 
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#define DW_APB_LOAD_VAL0x0
+#define DW_APB_CURR_VAL0x4
+#define DW_APB_CTRL0x8
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct dw_apb_timer_priv {
+   fdt_addr_t  regs;
+};
+
+static int dw_apb_timer_get_count(struct udevice *dev, u64 *count)
+{
+   struct dw_apb_timer_priv *priv = dev_get_priv(dev);
+
+   /*
+* The DW APB counter counts down, but this function
+* requires the count to be incrementing. Invert the
+* result.
+*/
+   *count = ~readl(priv->regs + DW_APB_CURR_VAL);
+
+   return 0;
+}
+
+static int dw_apb_timer_probe(struct udevice *dev)
+{
+   struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev);
+   struct dw_apb_timer_priv *priv = dev_get_priv(dev);
+   struct clk clk;
+   int ret;
+
+   ret = clk_get_by_index(dev, 0, );
+   if (ret)
+   return ret;
+
+   uc_priv->clock_rate = clk_get_rate();
+
+   clk_free();
+
+   /* init timer */
+   writel(0x, priv->regs + DW_APB_LOAD_VAL);
+   writel(0x, priv->regs + DW_APB_CURR_VAL);
+   setbits_le32(priv->regs + DW_APB_CTRL, 0x3);
+
+   return 0;
+}
+
+static int dw_apb_timer_ofdata_to_platdata(struct udevice *dev)
+{
+   struct dw_apb_timer_priv *priv = dev_get_priv(dev);
+
+   priv->regs = dev_read_addr(dev);
+
+   return 0;
+}
+
+static const struct timer_ops dw_apb_timer_ops = {
+   .get_count  = dw_apb_timer_get_count,
+};
+
+static const struct udevice_id dw_apb_timer_ids[] = {
+   { .compatible = "snps,dw-apb-timer" },
+   {}
+};
+
+U_BOOT_DRIVER(dw_apb_timer) = {
+   .name   = "dw_apb_timer",
+   .id = UCLASS_TIMER,
+   .ops= _apb_timer_ops,
+   .probe  = dw_apb_timer_probe,
+   .flags  = DM_FLAG_PRE_RELOC,
+   .of_match   = dw_apb_timer_ids,
+   .ofdata_to_platdata = dw_apb_timer_ofdata_to_platdata,
+   .priv_auto_alloc_size = sizeof(struct dw_apb_timer_priv),
+};
-- 
2.16.2

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


[U-Boot] [PATCH] ARM: socfpga: Reorder Arria10 SPL

2018-08-18 Thread Marek Vasut
The Arria10 SPL is a complete mess of calls to functions which are
called in the wrong context and it is surprise it works at all. This
patch tries to clean that mess up by shuffling the function calls
around and moving the calls into the correct context. Due to the
delicate nature of the reordering, this is done in one huge patch.

The following changes happen in this patch:
- Security policy init and NIC301 happens first in board_init_f()
- The clock init happens very early in board_init_f() in SPL only
- arch_early_init_r() only registers the FPGA, just like on Gen5
- arch_early_init_r() is never called from any _f() function
- Dedicated FPGA pins are inited in board_init_f() as on Gen5

Signed-off-by: Marek Vasut 
Cc: Chin Liang See 
Cc: Dinh Nguyen 
Cc: Ley Foon Tan 
---
 arch/arm/mach-socfpga/board.c  |  8 ---
 arch/arm/mach-socfpga/clock_manager_arria10.c  | 11 ++---
 .../include/mach/clock_manager_arria10.h   |  3 ++-
 arch/arm/mach-socfpga/include/mach/misc.h  |  5 
 arch/arm/mach-socfpga/misc_arria10.c   | 25 +++
 arch/arm/mach-socfpga/spl_a10.c| 28 ++
 6 files changed, 36 insertions(+), 44 deletions(-)

diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
index e8c7503fba..7c8c05cc31 100644
--- a/arch/arm/mach-socfpga/board.c
+++ b/arch/arm/mach-socfpga/board.c
@@ -43,14 +43,6 @@ int board_init(void)
/* Address of boot parameters for ATAG (if ATAG is used) */
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
-#if defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
-   /* configuring the clock based on handoff */
-   cm_basic_init(gd->fdt_blob);
-
-   /* Add device descriptor to FPGA device table */
-   socfpga_fpga_add();
-#endif
-
return 0;
 }
 
diff --git a/arch/arm/mach-socfpga/clock_manager_arria10.c 
b/arch/arm/mach-socfpga/clock_manager_arria10.c
index 1b4052cd37..334a79fd9c 100644
--- a/arch/arm/mach-socfpga/clock_manager_arria10.c
+++ b/arch/arm/mach-socfpga/clock_manager_arria10.c
@@ -11,8 +11,7 @@
 #include 
 #include 
 
-static const struct socfpga_clock_manager *clock_manager_base =
-   (struct socfpga_clock_manager *)SOCFPGA_CLKMGR_ADDRESS;
+#ifdef CONFIG_SPL_BUILD
 
 static u32 eosc1_hz;
 static u32 cb_intosc_hz;
@@ -232,6 +231,9 @@ static int of_get_clk_cfg(const void *blob, struct 
mainpll_cfg *main_cfg,
return 0;
 }
 
+static const struct socfpga_clock_manager *clock_manager_base =
+   (struct socfpga_clock_manager *)SOCFPGA_CLKMGR_ADDRESS;
+
 /* calculate the intended main VCO frequency based on handoff */
 static unsigned int cm_calc_handoff_main_vco_clk_hz
(struct mainpll_cfg *main_cfg)
@@ -897,7 +899,7 @@ static int cm_full_cfg(struct mainpll_cfg *main_cfg, struct 
perpll_cfg *per_cfg)
return 0;
 }
 
-void cm_use_intosc(void)
+static void cm_use_intosc(void)
 {
setbits_le32(_manager_base->ctrl,
 CLKMGR_CLKMGR_CTL_BOOTCLK_INTOSC_SET_MSK);
@@ -917,8 +919,11 @@ int cm_basic_init(const void *blob)
if (rval)
return rval;
 
+   cm_use_intosc();
+
return cm_full_cfg(_cfg, _cfg);
 }
+#endif
 
 static u32 cm_get_rate_dm(char *name)
 {
diff --git a/arch/arm/mach-socfpga/include/mach/clock_manager_arria10.h 
b/arch/arm/mach-socfpga/include/mach/clock_manager_arria10.h
index b3c8853aa3..de8c22540f 100644
--- a/arch/arm/mach-socfpga/include/mach/clock_manager_arria10.h
+++ b/arch/arm/mach-socfpga/include/mach/clock_manager_arria10.h
@@ -89,8 +89,9 @@ struct socfpga_clock_manager {
struct socfpga_clock_manager_altera altera;
 };
 
-void cm_use_intosc(void);
+#ifdef CONFIG_SPL_BUILD
 int cm_basic_init(const void *blob);
+#endif
 
 unsigned int cm_get_l4_sp_clk_hz(void);
 unsigned long cm_get_mpu_clk_hz(void);
diff --git a/arch/arm/mach-socfpga/include/mach/misc.h 
b/arch/arm/mach-socfpga/include/mach/misc.h
index e7e08b72d2..4fc9570a04 100644
--- a/arch/arm/mach-socfpga/include/mach/misc.h
+++ b/arch/arm/mach-socfpga/include/mach/misc.h
@@ -25,6 +25,11 @@ static inline void socfpga_fpga_add(void) {}
 void socfpga_sdram_remap_zero(void);
 #endif
 
+#ifdef CONFIG_TARGET_SOCFPGA_ARRIA10
+void socfpga_init_security_policies(void);
+void socfpga_sdram_remap_zero(void);
+#endif
+
 void do_bridge_reset(int enable);
 
 #endif /* _MISC_H_ */
diff --git a/arch/arm/mach-socfpga/misc_arria10.c 
b/arch/arm/mach-socfpga/misc_arria10.c
index 284e076ad6..f347ae857e 100644
--- a/arch/arm/mach-socfpga/misc_arria10.c
+++ b/arch/arm/mach-socfpga/misc_arria10.c
@@ -28,17 +28,14 @@
 #define PINMUX_UART1_TX_SHARED_IO_OFFSET_Q3_7  0x78
 #define PINMUX_UART1_TX_SHARED_IO_OFFSET_Q4_3  0x98
 
+static struct socfpga_system_manager *sysmgr_regs =
+   (struct socfpga_system_manager *)SOCFPGA_SYSMGR_ADDRESS;
 #if defined(CONFIG_SPL_BUILD)
 static struct pl310_regs *const pl310 =
(struct pl310_regs 

[U-Boot] [PATCH v2] Convert CONFIG_BOARD_LATE_INIT to Kconfig

2018-08-18 Thread Ramon Fried
This converts the remaining board defined
CONFIG_BOARD_LATE_INIT to Kconfig.

Signed-off-by: Ramon Fried 
---
Changes in v2:
* Removed config from Kconfig as it already exists on
  common/Kconfig.
* Changed the commit message.

 configs/am335x_pdu001_defconfig  | 1 +
 configs/bcm7445_defconfig| 1 +
 configs/cl-som-imx7_defconfig| 1 +
 configs/controlcenterdc_defconfig| 1 +
 configs/hsdk_defconfig   | 1 +
 configs/mccmon6_nor_defconfig| 1 +
 configs/mccmon6_sd_defconfig | 1 +
 configs/mx53ppd_defconfig| 1 +
 configs/stm32f746-disco_defconfig| 1 +
 configs/stm32h743-disco_defconfig| 1 +
 configs/stm32h743-eval_defconfig | 1 +
 include/configs/bcmstb.h | 1 -
 include/configs/cl-som-imx7.h| 2 --
 include/configs/controlcenterdc.h| 1 -
 include/configs/hsdk.h   | 1 -
 include/configs/mccmon6.h| 1 -
 include/configs/mx53ppd.h| 1 -
 include/configs/pdu001.h | 1 -
 include/configs/stm32f746-disco.h| 1 -
 include/configs/stm32h743-disco.h| 1 -
 include/configs/stm32h743-eval.h | 1 -
 include/configs/xilinx_zynqmp_mini.h | 1 -
 include/configs/zynq_cse.h   | 1 -
 23 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/configs/am335x_pdu001_defconfig b/configs/am335x_pdu001_defconfig
index 625ee6603d..3a69bbf460 100644
--- a/configs/am335x_pdu001_defconfig
+++ b/configs/am335x_pdu001_defconfig
@@ -11,6 +11,7 @@ CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-pdu001"
 CONFIG_LOCALVERSION="-EETS-1.0.0"
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=1
 # CONFIG_USE_BOOTCOMMAND is not set
diff --git a/configs/bcm7445_defconfig b/configs/bcm7445_defconfig
index 8b4247882f..c1e8194fcc 100644
--- a/configs/bcm7445_defconfig
+++ b/configs/bcm7445_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_BCMSTB=y
 CONFIG_SYS_TEXT_BASE=0x8010
 CONFIG_TARGET_BCM7445=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_BOOTDELAY=1
diff --git a/configs/cl-som-imx7_defconfig b/configs/cl-som-imx7_defconfig
index d47dd66197..3321d02e14 100644
--- a/configs/cl-som-imx7_defconfig
+++ b/configs/cl-som-imx7_defconfig
@@ -13,6 +13,7 @@ CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
 CONFIG_IMX_RDC=y
 CONFIG_IMX_BOOTAUX=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_SPI_BOOT=y
 CONFIG_BOOTDELAY=3
diff --git a/configs/controlcenterdc_defconfig 
b/configs/controlcenterdc_defconfig
index a66a281ede..e492a09255 100644
--- a/configs/controlcenterdc_defconfig
+++ b/configs/controlcenterdc_defconfig
@@ -12,6 +12,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_DEFAULT_DEVICE_TREE="armada-38x-controlcenterdc"
 CONFIG_DEBUG_UART=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
diff --git a/configs/hsdk_defconfig b/configs/hsdk_defconfig
index eec19478c6..332cc6a2b7 100644
--- a/configs/hsdk_defconfig
+++ b/configs/hsdk_defconfig
@@ -7,6 +7,7 @@ CONFIG_DEBUG_UART_CLOCK=
 CONFIG_SYS_CLK_FREQ=5
 CONFIG_DEFAULT_DEVICE_TREE="hsdk"
 CONFIG_DEBUG_UART=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200n8"
 CONFIG_BOARD_EARLY_INIT_F=y
diff --git a/configs/mccmon6_nor_defconfig b/configs/mccmon6_nor_defconfig
index 93cf3eef27..b5e3152443 100644
--- a/configs/mccmon6_nor_defconfig
+++ b/configs/mccmon6_nor_defconfig
@@ -7,6 +7,7 @@ CONFIG_TARGET_MCCMON6=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 # CONFIG_CMD_BMODE is not set
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_DISTRO_DEFAULTS=y
 
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/liebherr/mccmon6/mon6_imximage_nor.cfg"
 # CONFIG_USE_BOOTCOMMAND is not set
diff --git a/configs/mccmon6_sd_defconfig b/configs/mccmon6_sd_defconfig
index 2abaa82a35..23bcb37d06 100644
--- a/configs/mccmon6_sd_defconfig
+++ b/configs/mccmon6_sd_defconfig
@@ -8,6 +8,7 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 # CONFIG_CMD_BMODE is not set
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_DISTRO_DEFAULTS=y
 
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/liebherr/mccmon6/mon6_imximage_sd.cfg"
 # CONFIG_USE_BOOTCOMMAND is not set
diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
index 8a0cc5d481..9bd20cb4b6 100644
--- a/configs/mx53ppd_defconfig
+++ b/configs/mx53ppd_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_MX5=y
 CONFIG_SYS_TEXT_BASE=0x7780
 CONFIG_TARGET_MX53PPD=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_FIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/ge/mx53ppd/imximage.cfg"
 CONFIG_BOOTDELAY=1
diff --git a/configs/stm32f746-disco_defconfig 
b/configs/stm32f746-disco_defconfig
index b376e8b1c3..e9b2318b42 100644
--- a/configs/stm32f746-disco_defconfig
+++ b/configs/stm32f746-disco_defconfig
@@ -5,6 +5,7 @@ CONFIG_SYS_MALLOC_F_LEN=0xC00
 CONFIG_STM32F7=y
 

Re: [U-Boot] fdt_support: Use CONFIG_NR_DRAM_BANKS if necessary

2018-08-18 Thread Anand Moon
Hi Tom / Ramon,
On Sat, 18 Aug 2018 at 17:58, Tom Rini  wrote:
>
> On Sat, Aug 18, 2018 at 11:39:25AM +0300, Ramon Fried wrote:
> > On August 18, 2018 9:07:50 AM GMT+03:00, Anand Moon  
> > wrote:
> > >Hi Tom
> > >
> > >On Fri, 17 Aug 2018 at 07:36, Tom Rini  wrote:
> > >>
> > >> On Tue, Aug 14, 2018 at 12:35:42AM +0300, Ramon Fried wrote:
> > >>
> > >> > If CONFIG_NR_DRAM_BANKS is bigger than the default
> > >> > value (4) define MEMORY_BANKS_MAX as CONFIG_NR_DRAM_BANKS.
> > >> >
> > >> > Fixes: 2a1f4f1758b5 ("Revert "fdt_support: Use CONFIG_NR_DRAM_BANKS
> > >if defined"")
> > >> > Signed-off-by: Ramon Fried 
> > >>
> > >> Applied to u-boot/master, thanks!
> > >>
> > >> --
> > >> Tom
> > >
> > >I could not find this patch applied to u-boot/master.
> > >I check out the latest u-boot
> > >
> > ># git clone git://git.denx.de/u-boot.git u-boot-main
> > >
> > He merged to his tree. Not available in mainline yet.
> > https://github.com/trini/u-boot?files=1
>
> The tree at git.denx.de can sometimes take a little bit to get fully
> synced.  As of now it is up to date.
>
> --
> Tom

Thanks fro your inputs.

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


Re: [U-Boot] sunxi: USB gadget does not work on H2+ after 92a30692b2b18f45aae6fdaae38d67ed03dd2d11

2018-08-18 Thread Jagan Teki
On Sat, Aug 18, 2018 at 6:01 PM, Nuno Gonçalves  wrote:
>
>
> On Sat, Aug 18, 2018 at 1:41 PM Jagan Teki 
> wrote:
>>
>> Here is the steps with UMS on BPI-M2+ which is H3 board (USB is similar to
>> H2+)

See the board I've mentioned, it's Sinovoip_BPI_M2_Plus_defconfig
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: bcm7445: Move config defines to bcm7445.h

2018-08-18 Thread Florian Fainelli


On 07/26/2018 08:02 PM, Thomas Fitzsimmons wrote:
> Move some configuration #defines that do not apply to other bcmstb
> boards from bcmstb.h to bcm7445.h.
> 
> Signed-off-by: Thomas Fitzsimmons 

Acked-by: Florian Fainelli 

Thanks for addressing this.
-- 
Florian
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] board: arm: Add support for Broadcom BCM7260

2018-08-18 Thread Florian Fainelli


On 08/16/2018 06:44 PM, Thomas Fitzsimmons wrote:
> Add support for loading U-Boot on the Broadcom 7260 SoC.  This port
> assumes Broadcom's BOLT bootloader is acting as the second stage
> bootloader, and U-Boot is acting as the third stage bootloader, loaded
> as an ELF program by BOLT.
> 
> Signed-off-by: Thomas Fitzsimmons 

Reviewed-by: Florian Fainelli 

Looks good to me given the structured you added earlier for 7445
support, just one nit below:

[snip]

> +
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +#define CONFIG_SYS_NS16550_COM3  0xf040c000

This is the physical address of UARTA, there are typically 3 UARTs on
those SoCs, is there a reason to name this COM3 and not COM1? If this is
an established u-boot convention, pardon my ignore here.
-- 
Florian
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] doc: FIT image: fix typo

2018-08-18 Thread Pierre-Jean Texier
Fix typo in beaglebone verified boot documentation.

Signed-off-by: Pierre-Jean Texier 
---
 doc/uImage.FIT/beaglebone_vboot.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/uImage.FIT/beaglebone_vboot.txt 
b/doc/uImage.FIT/beaglebone_vboot.txt
index f1862c2..685ec1f 100644
--- a/doc/uImage.FIT/beaglebone_vboot.txt
+++ b/doc/uImage.FIT/beaglebone_vboot.txt
@@ -462,7 +462,7 @@ you sign.
cd $UBOOT
make O=b/am335x_boneblack_vboot EXT_DTB=${WORK}/am335x-boneblack-pubkey.dtb
 
-Here we are overrriding the normal device tree file with our one, which
+Here we are overriding the normal device tree file with our one, which
 contains the public key.
 
 Now you have a special U-Boot image with the public key. It can verify can
-- 
2.7.4

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


Re: [U-Boot] [PATCH] Convert CONFIG_BOARD_LATE_INIT to Kconfig

2018-08-18 Thread Tom Rini
On Sat, Aug 18, 2018 at 12:11:48PM +0300, Ramon Fried wrote:

> This converts the following to Kconfig:
> CONFIG_BOARD_LATE_INIT
> 
> Signed-off-by: Ramon Fried 
> ---
>  Kconfig  | 5 +

We have BOARD_LATE_INIT already set in common/Kconfig so I think we just
have a few boards that are out of sync.

-- 
Tom


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


Re: [U-Boot] fdt_support: Use CONFIG_NR_DRAM_BANKS if necessary

2018-08-18 Thread Tom Rini
On Sat, Aug 18, 2018 at 11:39:25AM +0300, Ramon Fried wrote:
> On August 18, 2018 9:07:50 AM GMT+03:00, Anand Moon  
> wrote:
> >Hi Tom
> >
> >On Fri, 17 Aug 2018 at 07:36, Tom Rini  wrote:
> >>
> >> On Tue, Aug 14, 2018 at 12:35:42AM +0300, Ramon Fried wrote:
> >>
> >> > If CONFIG_NR_DRAM_BANKS is bigger than the default
> >> > value (4) define MEMORY_BANKS_MAX as CONFIG_NR_DRAM_BANKS.
> >> >
> >> > Fixes: 2a1f4f1758b5 ("Revert "fdt_support: Use CONFIG_NR_DRAM_BANKS
> >if defined"")
> >> > Signed-off-by: Ramon Fried 
> >>
> >> Applied to u-boot/master, thanks!
> >>
> >> --
> >> Tom
> >
> >I could not find this patch applied to u-boot/master.
> >I check out the latest u-boot
> >
> ># git clone git://git.denx.de/u-boot.git u-boot-main
> >
> He merged to his tree. Not available in mainline yet. 
> https://github.com/trini/u-boot?files=1

The tree at git.denx.de can sometimes take a little bit to get fully
synced.  As of now it is up to date.

-- 
Tom


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


Re: [U-Boot] sunxi: USB gadget does not work on H2+ after 92a30692b2b18f45aae6fdaae38d67ed03dd2d11

2018-08-18 Thread Jagan Teki
On Fri, Aug 17, 2018 at 5:49 PM, Nuno Gonçalves  wrote:
> This can be because UMS is not DM aware?
>
> On Fri, Aug 17, 2018 at 2:02 PM Nuno Gonçalves  wrote:
>>
>> This test is on 2018.09-rc2 with UMS enabled.
>>
>> With your patch, I get this dmesg on the host:
>>
>> [20121.718226] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad?
>> [20122.578151] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad?
>> [20122.578320] usb 1-4-port4: attempt power cycle
>> [20123.750104] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad?
>> [20124.602034] usb 1-4-port4: Cannot enable. Maybe the USB cable is bad?
>> [20124.602190] usb 1-4-port4: unable to enumerate USB device
>>
>> u-boot console is the same, including loading the gadget:
>>
>> Allwinner mUSB OTG (Peripheral)
>>
>> If you tell me how you tested USB Gadget to work, I will reproduce your
>> test locally to confirm the issue.

Here is the steps with UMS on BPI-M2+ which is H3 board (USB is similar to H2+)

on target:
=> mmc list
SUNXI SD/MMC: 0
SUNXI SD/MMC: 1 (eMMC)
=> mmc dev 1
switch to partitions #0, OK
mmc1(part 0) is current device
=> ums 0 mmc 1
UMS: LUN 0, dev 1, hwpart 0, sector 0x0, count 0xe9
\musb-hdrc: peripheral reset irq lost!

on host:
$ sudo dmesg
[25593.969620] usb 1-1: new high-speed USB device number 7 using xhci_hcd
[25594.118084] usb 1-1: New USB device found, idVendor=1f3a, idProduct=1010
[25594.118092] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[25594.118097] usb 1-1: Product: USB download gadget
[25594.118102] usb 1-1: Manufacturer: Allwinner Technology
[25594.118107] usb 1-1: SerialNumber: 02c0008196cc4467
[25594.159273] usb-storage 1-1:1.0: USB Mass Storage device detected

fastboot also look fine.

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


Re: [U-Boot] [PATCH] Convert CONFIG_BOARD_LATE_INIT to Kconfig

2018-08-18 Thread Marek Vasut
On 08/18/2018 11:11 AM, Ramon Fried wrote:
> This converts the following to Kconfig:
> CONFIG_BOARD_LATE_INIT

Wouldn't it make more sense to convert board_late_init() to __weak
function and then nuke this macro altogether ?

> Signed-off-by: Ramon Fried 
[...]
-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] Convert CONFIG_BOARD_LATE_INIT to Kconfig

2018-08-18 Thread Ramon Fried
This converts the following to Kconfig:
CONFIG_BOARD_LATE_INIT

Signed-off-by: Ramon Fried 
---
 Kconfig  | 5 +
 configs/am335x_pdu001_defconfig  | 1 +
 configs/bcm7445_defconfig| 1 +
 configs/cl-som-imx7_defconfig| 1 +
 configs/controlcenterdc_defconfig| 1 +
 configs/hsdk_defconfig   | 1 +
 configs/mccmon6_nor_defconfig| 1 +
 configs/mccmon6_sd_defconfig | 1 +
 configs/mx53ppd_defconfig| 1 +
 configs/stm32f746-disco_defconfig| 1 +
 configs/stm32h743-disco_defconfig| 1 +
 configs/stm32h743-eval_defconfig | 1 +
 include/configs/bcmstb.h | 1 -
 include/configs/cl-som-imx7.h| 2 --
 include/configs/controlcenterdc.h| 1 -
 include/configs/hsdk.h   | 1 -
 include/configs/mccmon6.h| 1 -
 include/configs/mx53ppd.h| 1 -
 include/configs/pdu001.h | 1 -
 include/configs/stm32f746-disco.h| 1 -
 include/configs/stm32h743-disco.h| 1 -
 include/configs/stm32h743-eval.h | 1 -
 include/configs/xilinx_zynqmp_mini.h | 1 -
 include/configs/zynq_cse.h   | 1 -
 24 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/Kconfig b/Kconfig
index db0f545e45..55407e378d 100644
--- a/Kconfig
+++ b/Kconfig
@@ -50,6 +50,11 @@ config LOCALVERSION_AUTO
 
  which is done within the script "scripts/setlocalversion".)
 
+config BOARD_LATE_INIT
+   bool "Execute Board late init"
+   help
+ Enabling this option calls 'board_late_init' function
+
 config CC_OPTIMIZE_FOR_SIZE
bool "Optimize for size"
default y
diff --git a/configs/am335x_pdu001_defconfig b/configs/am335x_pdu001_defconfig
index 625ee6603d..3a69bbf460 100644
--- a/configs/am335x_pdu001_defconfig
+++ b/configs/am335x_pdu001_defconfig
@@ -11,6 +11,7 @@ CONFIG_SPL_FAT_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-pdu001"
 CONFIG_LOCALVERSION="-EETS-1.0.0"
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTDELAY=1
 # CONFIG_USE_BOOTCOMMAND is not set
diff --git a/configs/bcm7445_defconfig b/configs/bcm7445_defconfig
index 8b4247882f..c1e8194fcc 100644
--- a/configs/bcm7445_defconfig
+++ b/configs/bcm7445_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_BCMSTB=y
 CONFIG_SYS_TEXT_BASE=0x8010
 CONFIG_TARGET_BCM7445=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_BOOTDELAY=1
diff --git a/configs/cl-som-imx7_defconfig b/configs/cl-som-imx7_defconfig
index d47dd66197..3321d02e14 100644
--- a/configs/cl-som-imx7_defconfig
+++ b/configs/cl-som-imx7_defconfig
@@ -13,6 +13,7 @@ CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_ARMV7_BOOT_SEC_DEFAULT=y
 CONFIG_IMX_RDC=y
 CONFIG_IMX_BOOTAUX=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg"
 CONFIG_SPI_BOOT=y
 CONFIG_BOOTDELAY=3
diff --git a/configs/controlcenterdc_defconfig 
b/configs/controlcenterdc_defconfig
index a66a281ede..e492a09255 100644
--- a/configs/controlcenterdc_defconfig
+++ b/configs/controlcenterdc_defconfig
@@ -12,6 +12,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_DEFAULT_DEVICE_TREE="armada-38x-controlcenterdc"
 CONFIG_DEBUG_UART=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
diff --git a/configs/hsdk_defconfig b/configs/hsdk_defconfig
index eec19478c6..332cc6a2b7 100644
--- a/configs/hsdk_defconfig
+++ b/configs/hsdk_defconfig
@@ -7,6 +7,7 @@ CONFIG_DEBUG_UART_CLOCK=
 CONFIG_SYS_CLK_FREQ=5
 CONFIG_DEFAULT_DEVICE_TREE="hsdk"
 CONFIG_DEBUG_UART=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200n8"
 CONFIG_BOARD_EARLY_INIT_F=y
diff --git a/configs/mccmon6_nor_defconfig b/configs/mccmon6_nor_defconfig
index 93cf3eef27..b5e3152443 100644
--- a/configs/mccmon6_nor_defconfig
+++ b/configs/mccmon6_nor_defconfig
@@ -7,6 +7,7 @@ CONFIG_TARGET_MCCMON6=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 # CONFIG_CMD_BMODE is not set
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_DISTRO_DEFAULTS=y
 
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/liebherr/mccmon6/mon6_imximage_nor.cfg"
 # CONFIG_USE_BOOTCOMMAND is not set
diff --git a/configs/mccmon6_sd_defconfig b/configs/mccmon6_sd_defconfig
index 2abaa82a35..23bcb37d06 100644
--- a/configs/mccmon6_sd_defconfig
+++ b/configs/mccmon6_sd_defconfig
@@ -8,6 +8,7 @@ CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 # CONFIG_CMD_BMODE is not set
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_DISTRO_DEFAULTS=y
 
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/liebherr/mccmon6/mon6_imximage_sd.cfg"
 # CONFIG_USE_BOOTCOMMAND is not set
diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig
index 8a0cc5d481..9bd20cb4b6 100644
--- a/configs/mx53ppd_defconfig
+++ b/configs/mx53ppd_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_MX5=y
 CONFIG_SYS_TEXT_BASE=0x7780
 CONFIG_TARGET_MX53PPD=y
+CONFIG_BOARD_LATE_INIT=y
 CONFIG_FIT=y
 

Re: [U-Boot] [U-Boot, 2/2] FIT image: use compression = "none" for ramdisks

2018-08-18 Thread Simon Goldschmidt
On Sat, Aug 18, 2018 at 1:14 AM Tom Rini  wrote:
>
> On Mon, Jul 30, 2018 at 12:53:19PM +0200, Simon Goldschmidt wrote:
>
> > To prepare supporting compression for all image types, change
> > compression to "none" for ramdisks in all examples.
> >
> > Signed-off-by: Simon Goldschmidt 
> > ---
> >
> >  arch/arm/cpu/armv8/fsl-layerscape/doc/README.falcon | 2 +-
> >  doc/README.bcm7xxx  | 2 +-
> >  doc/uImage.FIT/multi.its| 4 ++--
> >  3 files changed, 4 insertions(+), 4 deletions(-)
>
> Sorry for the delay.  I think this patch as-is, is wrong.  Please split
> it into a patch per file that CCs the appropriate custodian(s) for them
> to ack/nak and pick up.  It's also appropriate to do a patch now that
> corrects the behavior of uncompressing ramdisks that can be uncompressed
> automatically (and no need for a CONFIG option).  Thanks!

OK, I'll rework it. But I won't have time for that until in two weeks
or even later, so I won't be able to provide something for 2018.09.

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


Re: [U-Boot] [PATCH v5] arm: socfpga: fix U-Boot running from fpga OnChip RAM

2018-08-18 Thread Simon Goldschmidt
On Fri, Aug 17, 2018 at 12:20 PM Marek Vasut  wrote:
>
> On 08/17/2018 08:56 AM, Simon Goldschmidt wrote:
> > On Fri, Aug 17, 2018 at 1:57 AM Marek Vasut  wrote:
> >>
> >> On 08/16/2018 09:44 PM, Simon Goldschmidt wrote:
> >>> On Thu, Aug 16, 2018 at 4:04 PM Marek Vasut  wrote:
> 
>  On 08/16/2018 03:50 PM, Simon Goldschmidt wrote:
> > On Thu, Aug 16, 2018 at 3:15 PM Marek Vasut  wrote:
> >>
> >> On 08/16/2018 03:12 PM, Simon Goldschmidt wrote:
> >>>
> >>>
> >>> Marek Vasut mailto:ma...@denx.de>> schrieb am Do., 16.
> >>> Aug. 2018, 15:06:
> >>>
> >>> On 08/16/2018 03:00 PM, Simon Goldschmidt wrote:
> >>> > On Thu, Aug 16, 2018 at 1:18 PM Marek Vasut  >>> > wrote:
> >>> >>
> >>> >> On 08/16/2018 09:38 AM, Simon Goldschmidt wrote:
> >>> >>> gd->env_addr points to pre-relocation address even after
> >>> >>> relocation. This leads to an abort in env_callback_init
> >>> >>> when loading the environment.
> >>> >>>
> >>> >>> Fix this by enabling CONFIG_SYS_EXTRA_ENV_RELOC.
> >>> >>>
> >>> >>> Signed-off-by: Simon Goldschmidt
> >>>  >>> >
> >>> >>
> >>> >> I have one last question -- does this somehow influence SPL ?
> >>> >
> >>> > No, it doesn't. The code that gets enabled by this define is in
> >>> > common/board_r.c, which is not linked for SPL.
> >>>
> >>> Ah, thanks for checking.
> >>>
> >>> btw do you think it'd make sense to just enable this by default 
> >>> on all
> >>> systems and zap the EXTRA_ENV_RELOC macro altogether ?
> >>>
> >>>
> >>> Yes, that's what I have thought about already. Just like the for the
> >>> embedded device tree relocation, we could then probably use
> >>> gd->reloc_off instead of CONFIG_SYS_MONITOR_BASE. I'm just not sure 
> >>> this
> >>> really works for all boards, but it would be worth a try to push after
> >>> this release is out.
> >>
> >> I think so too. I cannot think of a reason why this shouldn't be 
> >> enabled
> >> in fact.
> >
> > Exactly. Too me it seems like a leftover, especially given the use of
> > CONFIG_SYS_MONITOR_BASE, which seems a little outdated, too.
> > I've set up a reminder for a patch to remove it after the release.
> 
>  Feel free to send it now.
> >>>
> >>> OK, I have tried, but it seems it's not that easy: some boards
> >>> override the initial gd->env_addr by setting CONFIG_ENV_ADDR. So if
> >>> this is outside of U-Boot's pre-relocation range, it clearly should
> >>> not be relocated. One might find an improved way to relocate
> >>> gd->env_addr if it is internal (e.g. checking the range to be in
> >>> pre-relocation?). But simply removing the EXTRA_ENV_RELOC  does not
> >>> seem to work.
> >>
> >> Shouldn't most of those boards be easily fixable ?
> >
> > Well, if we unconditionally alter gd->env_addr by gd->reloc_off,
> > boards that have their initial gd->env_addr outside of the initial
> > binary can be fixed only by changing their behaviour. I don't know how
> > widely used this feature is, but since it's a config option
> > (CONFIG_ENV_ADDR), how would we know?
>
> git grep ? But aren't you mixing CONFIG_ENV_ADDR and CONFIG_ENV_RELOC ?

Have a look at env_sf_init() in env/sf.c (called from env_init(),
which in turn is called from board_init_f()). There gd->env_addr is
initialized by a config setting. If this user-supplied address is
outside of the binary, relocating it is wrong, isn't it?

Anyway, I'm off for 2 weeks now (holiday time here) with some email
access at most, so I'll continue on this when I get back.

Simon

>
> > So to me that means we still have to make this overridable and could
> > change the "default" state of such an option only. Meaning that the
> > default is "relocate gd->env_addr" with an option to leave it. But is
> > this really worth breaking existing boards?
>
> I think you do want to relocate the env alongside U-Boot, always, no ?
>
> --
> Best regards,
> Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] fdt_support: Use CONFIG_NR_DRAM_BANKS if necessary

2018-08-18 Thread Ramon Fried
On August 18, 2018 9:07:50 AM GMT+03:00, Anand Moon  
wrote:
>Hi Tom
>
>On Fri, 17 Aug 2018 at 07:36, Tom Rini  wrote:
>>
>> On Tue, Aug 14, 2018 at 12:35:42AM +0300, Ramon Fried wrote:
>>
>> > If CONFIG_NR_DRAM_BANKS is bigger than the default
>> > value (4) define MEMORY_BANKS_MAX as CONFIG_NR_DRAM_BANKS.
>> >
>> > Fixes: 2a1f4f1758b5 ("Revert "fdt_support: Use CONFIG_NR_DRAM_BANKS
>if defined"")
>> > Signed-off-by: Ramon Fried 
>>
>> Applied to u-boot/master, thanks!
>>
>> --
>> Tom
>
>I could not find this patch applied to u-boot/master.
>I check out the latest u-boot
>
># git clone git://git.denx.de/u-boot.git u-boot-main
>
He merged to his tree. Not available in mainline yet. 
https://github.com/trini/u-boot?files=1

>Best Regards
>-Anand


-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] fdt_support: Use CONFIG_NR_DRAM_BANKS if necessary

2018-08-18 Thread Anand Moon
Hi Tom

On Fri, 17 Aug 2018 at 07:36, Tom Rini  wrote:
>
> On Tue, Aug 14, 2018 at 12:35:42AM +0300, Ramon Fried wrote:
>
> > If CONFIG_NR_DRAM_BANKS is bigger than the default
> > value (4) define MEMORY_BANKS_MAX as CONFIG_NR_DRAM_BANKS.
> >
> > Fixes: 2a1f4f1758b5 ("Revert "fdt_support: Use CONFIG_NR_DRAM_BANKS if 
> > defined"")
> > Signed-off-by: Ramon Fried 
>
> Applied to u-boot/master, thanks!
>
> --
> Tom

I could not find this patch applied to u-boot/master.
I check out the latest u-boot

# git clone git://git.denx.de/u-boot.git u-boot-main

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