Re: [U-Boot] [PATCH] Kconfig: BOOTCOMMAND: Define default set of boot commands in Kconfig

2017-10-02 Thread Łukasz Majewski

On 10/01/2017 02:41 AM, Tom Rini wrote:

On Sat, Sep 30, 2017 at 10:20:47PM +0200, Łukasz Majewski wrote:

On 09/14/2017 04:55 PM, Tom Rini wrote:

On Mon, Sep 11, 2017 at 10:53:51PM +0200, Łukasz Majewski wrote:

On 09/11/2017 07:31 PM, Tom Rini wrote:

On Sun, Sep 10, 2017 at 08:25:02PM +0200, Lukasz Majewski wrote:


This patch gives an opportunity to override the defined CONFIG_BOOTCOMMAND
(at  files) with set of commands defined in
board _defconfig file.

Rationale: This change allows having two different u-boot builds - one for
production and one (far more larger) for factory setup.

Signed-off-by: Lukasz Majewski 


I don't get it, sorry.  We need to move CONFIG_BOOTCOMMAND into Kconfig
with some other logic so that distro_bootcmd stuff works.



The state of the art:
-

Many boards use CONFIG_BOOTCOMMAND as a set of commands to be
executed at boot time:

bootcmd=CONFIG_BOOTCOMMAND

One notable user of it is config_distro_bootcmd.h


Right.


Rationale:
--

With this patch I can:

1. Setup one set of commands to be executed by default - e.g.:

bootcmd="run boot_mmc"

and

2. Have other defconfig - e.g. _factory_defconfig, which
enables some extra stuff (like USB, gadget, gpt write, etc) and is
used solely for factory flashing.

By having the opportunity to override CONFIG_BOOTCOMMAND in Kconfig,
I can use the same code base and just adjust Kconfig for board.


What do you mean by "some other logic"?


Well, CONFIG_BOOTCOMMAND needs to be moved to Kconfig itself.  Figuring
out some of the "how" will take a little work.  And a little
re-organization.  But that needs doing.



Cannot we start with the approach proposed by this commit?

How would you see the rework done?


I'd like to see something that tries to move CONFIG_BOOTCOMMAND around.
Move the distro boot things into include/environment/ and use the
post-processed command as value in configs/*_defconfig as fits, or put
things into something else in include/environment/ for other repeated
but not distro boot commands.



The proposed above changes are orthogonal to this patch.

This patch _only_ gives the opportunity to override current BOOTCOMMAND 
settings.
This functionality allows the same code base for two distinct u-boot 
builds - namely factory (for flashing) and production one.


Such approach is very convenient with OE builds.

--
Best regards,

Lukasz Majewski

--

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


Re: [U-Boot] [PATCH v6 08/10] fdtdec: sort include files

2017-10-02 Thread Jean-Jacques Hiblot

Hi Simon,


On 25/09/2017 04:12, Simon Glass wrote:

Hi Jean-Jacques,

On 15 September 2017 at 04:57, Jean-Jacques Hiblot  wrote:

Sort include files in accordance to U-Boot coding style.

Signed-off-by: Jean-Jacques Hiblot 
---
  lib/fdtdec.c | 10 +-
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 630e040..f26d2eb 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -4,16 +4,16 @@
   */

  #ifndef USE_HOSTCC
-#include 
  #include 
+#include 
  #include 
+#include 

Actually that should go at the end where it is now.

See:

https://www.denx.de/wiki/U-Boot/CodingStyle
Well I wasn't sure if dm/* should go at the end. I thought that maybe 
asm/*, arch/* and linux/* were 'special' cases. This impression was 
reinforced because in the example asm/* goes before arch/*, which does 
not follow the alphabetical order.
So before I make the change in the patch, what would be the right place 
for dm/of_extra.h ? just before #include  ?


Thanks,
Jean-Jacques




  #include 
-#include 
-#include 
-#include 
  #include 
+#include 
+#include 
+#include 
  #include 
-#include 
  #include 

  DECLARE_GLOBAL_DATA_PTR;
--
1.9.1



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


Re: [U-Boot] [PATCH v2 07/26] mmc: Add a function to dump the mmc capabilities

2017-10-02 Thread Jean-Jacques Hiblot

Hi Jaehoon,


On 22/09/2017 15:54, Jaehoon Chung wrote:

Hi,

On 09/21/2017 11:29 PM, Jean-Jacques Hiblot wrote:

This adds a simple helper function to display information (bus width and
mode) based on a capability mask. Useful for debug.

I agreed this is useful.. but there is no usage in your patch.
How did you use this? and Where does call this function..

I think it can be used the one of mmc command. how about?
At first I added it to "mmc info" but it's more for the developer than 
the user, so I removed it from there.
At the moment it is not referenced anywhere the code, but I left it in 
place because it's indeed useful when debugging the initialization.
Thinking of it I could add something right after the card capabilities 
are discovered if debug is enabled. What do you think?


Jean-Jacques



Best Regards,
Jaehoon Chung


Signed-off-by: Jean-Jacques Hiblot 
---
  drivers/mmc/mmc.c | 24 
  include/mmc.h |  1 +
  2 files changed, 25 insertions(+)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 94b3a02..0b74e78 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1136,6 +1136,30 @@ static void mmc_set_bus_width(struct mmc *mmc, uint 
width)
mmc_set_ios(mmc);
  }
  
+#if CONFIG_IS_ENABLED(MMC_VERBOSE) || defined(DEBUG)

+/*
+ * helper function to display the capabilities in a human
+ * friendly manner. The capabilities include bus width and
+ * supported modes.
+ */
+void mmc_dump_capabilities(const char *text, uint caps)
+{
+   enum bus_mode mode;
+
+   printf("%s: widths [", text);
+   if (caps & MMC_MODE_8BIT)
+   printf("8, ");
+   if (caps & MMC_MODE_4BIT)
+   printf("4, ");
+   printf("1] modes [");
+
+   for (mode = MMC_LEGACY; mode < MMC_MODES_END; mode++)
+   if (MMC_CAP(mode) & caps)
+   printf("%s, ", mmc_mode_name(mode));
+   printf("\b\b]\n");
+}
+#endif
+
  static int sd_select_bus_freq_width(struct mmc *mmc)
  {
int err;
diff --git a/include/mmc.h b/include/mmc.h
index 76bd57a..dd83f14 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -426,6 +426,7 @@ enum bus_mode {
  };
  
  const char *mmc_mode_name(enum bus_mode mode);

+void mmc_dump_capabilities(const char *text, uint caps);
  
  /*

   * With CONFIG_DM_MMC enabled, struct mmc can be accessed from the MMC device





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


Re: [U-Boot] [PATCH v2 13/26] mmc: Enable signal voltage to be selected from mmc core

2017-10-02 Thread Jean-Jacques Hiblot



On 22/09/2017 15:54, Jaehoon Chung wrote:

On 09/21/2017 11:30 PM, Jean-Jacques Hiblot wrote:

From: Kishon Vijay Abraham I 

Add a new function *mmc_set_signal_voltage* in mmc core
which can be used during mmc initialization to select the
signal voltage. Platform driver should use the set_ios
callback function to select the signal voltage.

Signed-off-by: Kishon Vijay Abraham I 
Signed-off-by: Jean-Jacques Hiblot 
---
  drivers/mmc/mmc.c | 16 
  include/mmc.h |  8 
  2 files changed, 24 insertions(+)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 536cd7f..46ec5e1 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -30,6 +30,8 @@ static const unsigned int sd_au_size[] = {
SZ_16M / 512,   (SZ_16M + SZ_8M) / 512, SZ_32M / 512,   SZ_64M / 512,
  };
  
+static int mmc_set_signal_voltage(struct mmc *mmc, uint signal_voltage);

+
  #if CONFIG_IS_ENABLED(MMC_TINY)
  static struct mmc mmc_static;
  struct mmc *find_mmc_device(int dev_num)
@@ -1257,6 +1259,12 @@ struct mode_width_tuning {
uint widths;
  };
  
+static int mmc_set_signal_voltage(struct mmc *mmc, uint signal_voltage)

+{
+   mmc->signal_voltage = signal_voltage;
+   return mmc_set_ios(mmc);
+}
+
  static const struct mode_width_tuning sd_modes_by_pref[] = {
{
.mode = SD_HS,
@@ -1964,6 +1972,14 @@ int mmc_start_init(struct mmc *mmc)
return err;
  #endif
mmc->ddr_mode = 0;
+
+   /* First try to set 3.3V. If it fails set to 1.8V */
+   err = mmc_set_signal_voltage(mmc, MMC_SIGNAL_VOLTAGE_330);
+   if (err != 0)
+   err = mmc_set_signal_voltage(mmc, MMC_SIGNAL_VOLTAGE_180);
+   if (err != 0)
+   printf("failed to set signal voltage\n");
+

Well, it's confused. if 3.3v and 1.8v are failed, there is no problem?
last signal value should be set to 1.8v. Is it correct?
If both 3.3v and 1.8v fail, then it may be because the underlying layer 
doesn't handle this properly (maybe it's using a fixed voltage, and 
refuses any switch).
If there is a real issue when turning on the signal voltage, it'll be 
handled later in the initialization process because the dialog with the 
sd/mmc will not work.




Why didn't try to set the 1.2 voltage?

I didn't think of it. Is this allowed by the MMC spec ?

Jean-Jacques



mmc_set_bus_width(mmc, 1);
mmc_set_clock(mmc, 1);
  
diff --git a/include/mmc.h b/include/mmc.h

index 3e57887..e524963 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -272,6 +272,13 @@
  #define ENHNCD_SUPPORT(0x2)
  #define PART_ENH_ATTRIB   (0x1f)
  
+enum mmc_voltage {

+   MMC_SIGNAL_VOLTAGE_000 = 0,
+   MMC_SIGNAL_VOLTAGE_120,
+   MMC_SIGNAL_VOLTAGE_180,
+   MMC_SIGNAL_VOLTAGE_330
+};
+
  /* Maximum block size for MMC */
  #define MMC_MAX_BLOCK_LEN 512
  
@@ -457,6 +464,7 @@ struct mmc {

int high_capacity;
uint bus_width;
uint clock;
+   enum mmc_voltage signal_voltage;
uint card_caps;
uint ocr;
uint dsr;





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


Re: [U-Boot] [PATCH v2 23/26] mmc: Retry some MMC cmds on failure

2017-10-02 Thread Jean-Jacques Hiblot



On 22/09/2017 15:54, Jaehoon Chung wrote:

On 09/21/2017 11:30 PM, Jean-Jacques Hiblot wrote:

From: Kishon Vijay Abraham I 

With certain SD cards like Kingston 8GB/16GB UHS card, it is seen that
MMC_CMD_ALL_SEND_CID cmd fails on first attempt, but succeeds
subsequently. Therefore, retry MMC_CMD_ALL_SEND_CID cmd a few time
as done in Linux kernel.
Similarly, it is seen that MMC_CMD_SET_BLOCKLEN may fail on first
attempt, therefore retry this cmd a few times as done in kernel.

To make it clear that those are optionnal workarounds, a new Kconfig
option 'MMC_QUIRKS' is added (enabled by default).

Signed-off-by: Vignesh R 
Signed-off-by: Kishon Vijay Abraham I 
Signed-off-by: Jean-Jacques Hiblot 
---
  drivers/mmc/Kconfig |  9 +
  drivers/mmc/mmc.c   | 41 +++--
  include/mmc.h   |  4 
  3 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index 3d577e0..78e58d4 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -33,6 +33,15 @@ config SPL_DM_MMC
  
  if MMC
  
+config MMC_QUIRKS

+   bool "Enable quirks"
+   default y
+   help
+ Some cards and hosts may sometimes behave unexpectedly (quirks).
+ This option enable workarounds to handle those quirks. Some of them
+ are enabled by default, other may require additionnal flags or are
+ enabled by the host driver.
+
  config MMC_VERBOSE
bool "Output more information about the MMC"
default y
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index c5eaeaf..6d1bf94 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -279,6 +279,7 @@ int mmc_send_status(struct mmc *mmc, int timeout)
  int mmc_set_blocklen(struct mmc *mmc, int len)
  {
struct mmc_cmd cmd;
+   int err;
  
  	if (mmc->ddr_mode)

return 0;
@@ -287,7 +288,24 @@ int mmc_set_blocklen(struct mmc *mmc, int len)
cmd.resp_type = MMC_RSP_R1;
cmd.cmdarg = len;
  
-	return mmc_send_cmd(mmc, &cmd, NULL);

+   err = mmc_send_cmd(mmc, &cmd, NULL);
+
+#ifdef CONFIG_MMC_QUIRKS
+   if (err && (mmc->quirks & MMC_QUIRK_RETRY_SET_BLOCKLEN)) {
+   int retries = 4;
+   /*
+* It has been seen that SET_BLOCKLEN may fail on the first
+* attempt, let's try a few more time
+*/
+   do {
+   err = mmc_send_cmd(mmc, &cmd, NULL);
+   if (!err)
+   break;
+   } while (retries--);
+   }
+#endif
+
+   return err;
  }
  
  static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,

@@ -1881,7 +1899,6 @@ static int mmc_startup(struct mmc *mmc)
cmd.resp_type = MMC_RSP_R1;
cmd.cmdarg = 1;
err = mmc_send_cmd(mmc, &cmd, NULL);
-
if (err)
return err;
}
@@ -1895,6 +1912,21 @@ static int mmc_startup(struct mmc *mmc)
  
  	err = mmc_send_cmd(mmc, &cmd, NULL);
  
+#ifdef CONFIG_MMC_QUIRKS

+   if (err && (mmc->quirks & MMC_QUIRK_RETRY_SEND_CID)) {
+   int retries = 4;
+   /*
+* It has been seen that SEND_CID may fail on the first
+* attempt, let's try a few more time
+*/
+   do {
+   err = mmc_send_cmd(mmc, &cmd, NULL);
+   if (!err)
+   break;
+   } while (retries--);
+   }
+#endif
+
if (err)
return err;
  
@@ -2239,6 +2271,11 @@ int mmc_start_init(struct mmc *mmc)

if (err)
return err;
  
+#ifdef CONFIG_MMC_QUIRKS

+   mmc->quirks = MMC_QUIRK_RETRY_SET_BLOCKLEN |
+ MMC_QUIRK_RETRY_SEND_CID;
+#endif
+
err = mmc_power_cycle(mmc);
if (err) {
/*
diff --git a/include/mmc.h b/include/mmc.h
index a8901bf..a9ebc88 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -306,6 +306,9 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx)
  #define ENHNCD_SUPPORT(0x2)
  #define PART_ENH_ATTRIB   (0x1f)
  
+#define MMC_QUIRK_RETRY_SEND_CID	BIT(0)

+#define MMC_QUIRK_RETRY_SET_BLOCKLEN   BIT(1)
+
  enum mmc_voltage {
MMC_SIGNAL_VOLTAGE_000 = 0,
MMC_SIGNAL_VOLTAGE_120,
@@ -591,6 +594,7 @@ struct mmc {
  * operating mode due to limitations when
  * accessing the boot partitions
  */
+   u32 quirks;

Use the #ifdef MMC_QUIRK for quirks?

OK. I'll fix it in the next round
Thanks,
Jean-Jacques



  };
  
  struct mmc_hwpart_conf {






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


Re: [U-Boot] [PATCH v2 26/26] dm: mmc: Add a library function to parse generic dt binding

2017-10-02 Thread Jean-Jacques Hiblot



On 22/09/2017 15:54, Jaehoon Chung wrote:

On 09/21/2017 11:30 PM, Jean-Jacques Hiblot wrote:

From: Kishon Vijay Abraham I 

Add a new function to parse host controller dt node and
set mmc_config. This function can be used by mmc controller
drivers to set the generic mmc_config.
This function can be extended to set other UHS mode caps
once UHS mode support is added.

Signed-off-by: Kishon Vijay Abraham I 
Signed-off-by: Jean-Jacques Hiblot 
---
  drivers/mmc/mmc-uclass.c | 46 ++
  include/mmc.h|  1 +
  2 files changed, 47 insertions(+)

diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 7856e0a..e30cde7 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -120,6 +120,52 @@ int mmc_execute_tuning(struct mmc *mmc, uint opcode)
return dm_mmc_execute_tuning(mmc->dev, opcode);
  }
  
+int mmc_of_parse(const void *fdt, int node, struct mmc_config *cfg)

+{
+   int val;
+
+   val = fdtdec_get_int(fdt, node, "bus-width", 1);
+
+   switch (val) {
+   case 0x8:
+   cfg->host_caps |= MMC_MODE_8BIT;
+   /* fall through */
+   case 0x4:
+   cfg->host_caps |= MMC_MODE_4BIT;
+   /* fall through */
+   case 0x1:
+   cfg->host_caps |= MMC_MODE_1BIT;
+   break;
+   default:
+   printf("error: %s invalid bus-width property %d\n",
+  fdt_get_name(fdt, node, NULL), val);

I guess it can be set to 1-bit by default and just display message about 
invalid bus-width property.

OK.



+   return -ENOENT;
+   }
+
+   cfg->f_max = fdtdec_get_int(fdt, node, "max-frequency", 5200);
+
+   if (fdtdec_get_bool(fdt, node, "cap-sd-highspeed"))
+   cfg->host_caps |= MMC_CAP(SD_HS);
+   if (fdtdec_get_bool(fdt, node, "cap-mmc-highspeed"))
+   cfg->host_caps |= MMC_CAP(MMC_HS);
+   if (fdtdec_get_bool(fdt, node, "sd-uhs-sdr12"))
+   cfg->host_caps |= MMC_CAP(UHS_SDR12);
+   if (fdtdec_get_bool(fdt, node, "sd-uhs-sdr25"))
+   cfg->host_caps |= MMC_CAP(UHS_SDR25);
+   if (fdtdec_get_bool(fdt, node, "sd-uhs-sdr50"))
+   cfg->host_caps |= MMC_CAP(UHS_SDR50);
+   if (fdtdec_get_bool(fdt, node, "sd-uhs-sdr104"))
+   cfg->host_caps |= MMC_CAP(UHS_SDR104);
+   if (fdtdec_get_bool(fdt, node, "sd-uhs-ddr50"))
+   cfg->host_caps |= MMC_CAP(UHS_DDR50);
+   if (fdtdec_get_bool(fdt, node, "mmc-ddr-1_8v"))
+   cfg->host_caps |= MMC_CAP(MMC_DDR_52);
+   if (fdtdec_get_bool(fdt, node, "mmc-hs200-1_8v"))
+   cfg->host_caps |= MMC_CAP(MMC_HS_200);

Don't need to check about 1.2v?

I'll add it. I won't be able to test though by lack of hardware.




+
+   return 0;
+}
+
  struct mmc *mmc_get_mmc_dev(struct udevice *dev)
  {
struct mmc_uclass_priv *upriv;
diff --git a/include/mmc.h b/include/mmc.h
index 79be6b4..6230a32 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -651,6 +651,7 @@ int mmc_unbind(struct udevice *dev);
  int mmc_initialize(bd_t *bis);
  int mmc_init(struct mmc *mmc);
  int mmc_send_tuning(struct mmc *mmc, u32 opcode, int *cmd_error);
+int mmc_of_parse(const void *fdt, int node, struct mmc_config *cfg);
  int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size);
  
  /**






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


Re: [U-Boot] [PATCH v2 00/26] mmc: Add support for HS200 and UHS modes

2017-10-02 Thread Jean-Jacques Hiblot



On 22/09/2017 16:42, Jaehoon Chung wrote:

Dear JJ,

On 09/21/2017 11:29 PM, Jean-Jacques Hiblot wrote:

This series brings support for HS200 and UHS modes to the mmc core.
It has been tested with the hsmmc driver on several platforms (DRA7,
AM57x, AM437x, beaglebone black, Atmel SAMA5D3 xplained). Some modifications
are required in the host driver to take advantage of this (voltage switching,
tuning). The changes to the host driver will be posted a another series as this
one is already long enough.

The series starts with a small refactoring of th sd/mmc startup. The first 5 
commits
are mostly moving code around with little or no functionnal change.

Then the notion of "mode" is introduced. Until now, this information wasn't
kept in struct mmc. Only the clock and a flag for ddr was kept. Later the mode
information will be used to select the clock frequency, the ddr flag and the
tuning procedure. It will be also be check against the host capabilities.

Then comes the big refactoring job in:
"mmc: refactor MMC startup to make it easier to support new modes" and
"mmc: refactor SD startup to make it easier to support new modes"
Since the number of modes is increasing, it makes sense to try them in a more
organized way. those commits use a list of supported modes and iterate through
them to find the best working one. It also allows to switch more easilly from
one mode to another (switching from HS200 to DDR52 to access boot partitions 
for example)

Then there are a couple of new callback added to:
- send the initialization stream (74 clock cycles)
- wait while the card is busy (used during UHS voltage switching). checking is
   done on dat0.
- select the IO voltage

Then Power cycle is added. Without power cycle, if a UHS card fails to 
enumerate in
UHS mode, it can't fall back to high speed mode and card enumeration will fail.
Also in case of a reset (as opposed to a power on), it ensures that the SDCard
is in clean state before re-doing the initialization.

And finally the last commits add the support for HS200 and UHS.

With this in place and the required changes in the HSMMC host driver (including
DMA), we observe significant improvements in the performances on a DRA72 evm:
eMMC HS200: 124 MB/s
eMMC DDR52: 78 MB/s
sd   SDR104: 71 MB/s
sd   SDR50: 44 MB/s

I have one question.

Did you test about accessing Boot partition of eMMC?



As i know, boot partition doesn't support the HS200 mode.

When i checked your patches, there is no the function of mode changing for 
accessing boot partition.
If i missed it, let me know, plz.

Yes I did test the boot partitions. HS200 is not used in this case.
The key function is mmc_boot_part_access_chk(). It checks if the current 
mode is supported by the partition. If not, it'll reselect a new mode.


Jean-Jacques




Best Regards,
Jaehoon Chung


cheers,

Jean-Jacques

changes since v1:
Changes take in account all the comment made during the first round of review.
But it also include a rework of the handling of the voltage supplies and 2 new
helper functions that can be used by the host driver during tuning and dts
parsing.

Here is a detailed list:
  * rebase on u-boot/master.
  * add the description for the new functions/members
  * fix the typos found in the reviews
  * limit the new features to DM_MMC only
  * fix the new checkpatch warnings/errors (is it now more strict ?)
  * get the voltage regulators from dts (main and IO-lines)
  * remove the set_vdd callback and do the job in the mmc core
  * add a send_init_stream callback to perform the 74 clock cycle
sequence after power up
  * do a full power cycle (if possible) before the initialization. This ensures
that the sd/MMC is in valid knwon state. Also it allows to check if the 
power
cycling works as expected.
  * disable the UHS modes is power cycling is not available/working. This 
ensures
that we won't be stuck if the UHS initialization fails.
  * select the appropriate signal voltage when selecting a mode (MMC only)
  * add a helper function to parse the generic dt bindings
  * add a helper function to send the tuning command
  
Jean-Jacques Hiblot (17):

   mmc: dm: get the IO-line and main voltage regulators from the dts
   mmc: split mmc_startup()
   mmc: move the MMC startup for version above v4.0 in a separate
 function
   mmc: make ext_csd part of struct mmc
   mmc: add a function to read and test the ext csd (mmc >= 4)
   mmc: introduce mmc modes
   mmc: Add a function to dump the mmc capabilities
   mmc: use mmc modes to select the correct bus speed
   cmd: mmc: display the mode name and current bus speed in the mmc info
   mmc: refactor SD startup to make it easier to support new modes
   mmc: refactor MMC startup to make it easier to support new modes
   mmc: Add a new callback function to perform the 74 clocks cycle
 sequence
   mmc: Add support for UHS modes
   mmc: disable UHS modes if Vcc cannot be switched on and off
   mmc: Change mode when switching to a boot part

Re: [U-Boot] [PATCH v2 11/19] arm: socfpga: Add DRAM bank size initialization function

2017-10-02 Thread Chee, Tien Fong
On Sel, 2017-09-26 at 12:33 +0200, Marek Vasut wrote:
> On 09/26/2017 10:20 AM, Chee, Tien Fong wrote:
> > 
> > On Isn, 2017-09-25 at 11:15 +0200, Marek Vasut wrote:
> > > 
> > > On 09/25/2017 10:40 AM, tien.fong.c...@intel.com wrote:
> > > > 
> > > > 
> > > > From: Tien Fong Chee 
> > > > 
> > > > Add function for both multiple DRAM bank and single DRAM bank
> > > > size
> > > > initialization. This common functionality could be used by
> > > > every
> > > > single
> > > > SOCFPGA board.
> > > > 
> > > > Signed-off-by: Tien Fong Chee 
> > > I'd like TB on Gen5.
> > > 
> > What is TB?
> Tested-by
> Tested-by: Tien Fong Chee 

You want me resend the patch with Tested-by?
> > 
> > > 
> > > > 
> > > > 
> > > > ---
> > > >  arch/arm/mach-socfpga/board.c| 7 +++
> > > >  include/configs/socfpga_common.h | 1 +
> > > >  2 files changed, 8 insertions(+)
> > > > 
> > > > diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-
> > > > socfpga/board.c
> > > > index a41d089..965f9dc 100644
> > > > --- a/arch/arm/mach-socfpga/board.c
> > > > +++ b/arch/arm/mach-socfpga/board.c
> > > > @@ -29,6 +29,13 @@ int board_init(void)
> > > >     return 0;
> > > >  }
> > > >  
> > > > +int dram_init_banksize(void)
> > > > +{
> > > > +   fdtdec_setup_memory_banksize();
> > > > +
> > > > +   return 0;
> > > > +}
> > > > +
> > > >  #ifdef CONFIG_USB_GADGET
> > > >  struct dwc2_plat_otg_data socfpga_otg_data = {
> > > >     .usb_gusbcfg= 0x1417,
> > > > diff --git a/include/configs/socfpga_common.h
> > > > b/include/configs/socfpga_common.h
> > > > index eadce2d..7549ee8 100644
> > > > --- a/include/configs/socfpga_common.h
> > > > +++ b/include/configs/socfpga_common.h
> > > > @@ -47,6 +47,7 @@
> > > >     (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
> > > >  
> > > >  #define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM_1
> > > > +#define CONFIG_SYS_SDRAM_SIZE  PHYS_SDRAM_1_SIZE
> > > >  #ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
> > > >  #define CONFIG_SYS_TEXT_BASE   0x0840
> > > >  #else
> > > > 
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 11/19] arm: socfpga: Add DRAM bank size initialization function

2017-10-02 Thread Marek Vasut
On 10/02/2017 12:01 PM, Chee, Tien Fong wrote:
> On Sel, 2017-09-26 at 12:33 +0200, Marek Vasut wrote:
>> On 09/26/2017 10:20 AM, Chee, Tien Fong wrote:
>>>
>>> On Isn, 2017-09-25 at 11:15 +0200, Marek Vasut wrote:

 On 09/25/2017 10:40 AM, tien.fong.c...@intel.com wrote:
>
>
> From: Tien Fong Chee 
>
> Add function for both multiple DRAM bank and single DRAM bank
> size
> initialization. This common functionality could be used by
> every
> single
> SOCFPGA board.
>
> Signed-off-by: Tien Fong Chee 
 I'd like TB on Gen5.

>>> What is TB?
>> Tested-by
>> Tested-by: Tien Fong Chee 
> 
> You want me resend the patch with Tested-by?

Uh no, that's not how TB works. You should get TB on your patches from
someone else , not yourself .

>>>

>
>
> ---
>  arch/arm/mach-socfpga/board.c| 7 +++
>  include/configs/socfpga_common.h | 1 +
>  2 files changed, 8 insertions(+)
>
> diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-
> socfpga/board.c
> index a41d089..965f9dc 100644
> --- a/arch/arm/mach-socfpga/board.c
> +++ b/arch/arm/mach-socfpga/board.c
> @@ -29,6 +29,13 @@ int board_init(void)
>   return 0;
>  }
>  
> +int dram_init_banksize(void)
> +{
> + fdtdec_setup_memory_banksize();
> +
> + return 0;
> +}
> +
>  #ifdef CONFIG_USB_GADGET
>  struct dwc2_plat_otg_data socfpga_otg_data = {
>   .usb_gusbcfg= 0x1417,
> diff --git a/include/configs/socfpga_common.h
> b/include/configs/socfpga_common.h
> index eadce2d..7549ee8 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -47,6 +47,7 @@
>   (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
>  
>  #define CONFIG_SYS_SDRAM_BASEPHYS_SDRAM_1
> +#define CONFIG_SYS_SDRAM_SIZEPHYS_SDRAM_1_SIZE
>  #ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
>  #define CONFIG_SYS_TEXT_BASE 0x0840
>  #else
>


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


Re: [U-Boot] [PATCH v2 17/19] arm: socfpga: Adding clock frequency info for U-boot

2017-10-02 Thread Chee, Tien Fong
On Isn, 2017-09-25 at 11:23 +0200, Marek Vasut wrote:
> On 09/25/2017 10:40 AM, tien.fong.c...@intel.com wrote:
> > 
> > From: Tien Fong Chee 
> > 
> > Clock frequency info is required in U-boot.
> > 
> > Signed-off-by: Tien Fong Chee 
> I want a TB on Gen 5
> 
This patch break the gen5, because cm_basic_init is exclusive for Arria
10. #ifdef is required.
> > 
> > ---
> >  arch/arm/mach-socfpga/board.c | 6 ++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-
> > socfpga/board.c
> > index 965f9dc..a00f63b 100644
> > --- a/arch/arm/mach-socfpga/board.c
> > +++ b/arch/arm/mach-socfpga/board.c
> > @@ -8,7 +8,10 @@
> >  
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> > +#include 
> > +#include 
> >  #include 
> >  
> >  #include 
> > @@ -26,6 +29,9 @@ int board_init(void)
> >     /* Address of boot parameters for ATAG (if ATAG is used)
> > */
> >     gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
> >  
> > +   /* configuring the clock based on handoff */
> > +   cm_basic_init(gd->fdt_blob);
> > +
> >     return 0;
> >  }
> >  
> > 
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 11/19] arm: socfpga: Add DRAM bank size initialization function

2017-10-02 Thread Chee, Tien Fong
On Isn, 2017-10-02 at 12:04 +0200, Marek Vasut wrote:
> On 10/02/2017 12:01 PM, Chee, Tien Fong wrote:
> > 
> > On Sel, 2017-09-26 at 12:33 +0200, Marek Vasut wrote:
> > > 
> > > On 09/26/2017 10:20 AM, Chee, Tien Fong wrote:
> > > > 
> > > > 
> > > > On Isn, 2017-09-25 at 11:15 +0200, Marek Vasut wrote:
> > > > > 
> > > > > 
> > > > > On 09/25/2017 10:40 AM, tien.fong.c...@intel.com wrote:
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > From: Tien Fong Chee 
> > > > > > 
> > > > > > Add function for both multiple DRAM bank and single DRAM
> > > > > > bank
> > > > > > size
> > > > > > initialization. This common functionality could be used by
> > > > > > every
> > > > > > single
> > > > > > SOCFPGA board.
> > > > > > 
> > > > > > Signed-off-by: Tien Fong Chee 
> > > > > I'd like TB on Gen5.
> > > > > 
> > > > What is TB?
> > > Tested-by
> > > Tested-by: Tien Fong Chee 
> > You want me resend the patch with Tested-by?
> Uh no, that's not how TB works. You should get TB on your patches
> from
> someone else , not yourself .
> 
oo...okay, i will ask ley foon help to verify.
> > 
> > > 
> > > > 
> > > > 
> > > > > 
> > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > ---
> > > > > >  arch/arm/mach-socfpga/board.c| 7 +++
> > > > > >  include/configs/socfpga_common.h | 1 +
> > > > > >  2 files changed, 8 insertions(+)
> > > > > > 
> > > > > > diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-
> > > > > > socfpga/board.c
> > > > > > index a41d089..965f9dc 100644
> > > > > > --- a/arch/arm/mach-socfpga/board.c
> > > > > > +++ b/arch/arm/mach-socfpga/board.c
> > > > > > @@ -29,6 +29,13 @@ int board_init(void)
> > > > > >     return 0;
> > > > > >  }
> > > > > >  
> > > > > > +int dram_init_banksize(void)
> > > > > > +{
> > > > > > +   fdtdec_setup_memory_banksize();
> > > > > > +
> > > > > > +   return 0;
> > > > > > +}
> > > > > > +
> > > > > >  #ifdef CONFIG_USB_GADGET
> > > > > >  struct dwc2_plat_otg_data socfpga_otg_data = {
> > > > > >     .usb_gusbcfg= 0x1417,
> > > > > > diff --git a/include/configs/socfpga_common.h
> > > > > > b/include/configs/socfpga_common.h
> > > > > > index eadce2d..7549ee8 100644
> > > > > > --- a/include/configs/socfpga_common.h
> > > > > > +++ b/include/configs/socfpga_common.h
> > > > > > @@ -47,6 +47,7 @@
> > > > > >     (CONFIG_SYS_INIT_RAM_ADDR +
> > > > > > CONFIG_SYS_INIT_SP_OFFSET)
> > > > > >  
> > > > > >  #define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM_1
> > > > > > +#define CONFIG_SYS_SDRAM_SIZE  PHYS_SDRAM_1_
> > > > > > SIZE
> > > > > >  #ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
> > > > > >  #define CONFIG_SYS_TEXT_BASE   0x0840
> > > > > >  #else
> > > > > > 
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 17/19] arm: socfpga: Adding clock frequency info for U-boot

2017-10-02 Thread Marek Vasut
On 10/02/2017 12:04 PM, Chee, Tien Fong wrote:
> On Isn, 2017-09-25 at 11:23 +0200, Marek Vasut wrote:
>> On 09/25/2017 10:40 AM, tien.fong.c...@intel.com wrote:
>>>
>>> From: Tien Fong Chee 
>>>
>>> Clock frequency info is required in U-boot.
>>>
>>> Signed-off-by: Tien Fong Chee 
>> I want a TB on Gen 5
>>
> This patch break the gen5, because cm_basic_init is exclusive for Arria
> 10. #ifdef is required.

Can you at least build-test your patches before submitting ?
Heck, you can also set up the travisci [1] to do all that stuff for you.

[1] https://travis-ci.org/marex/u-boot-socfpga/branches

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


Re: [U-Boot] fsl_esdhc driver is broken with DM

2017-10-02 Thread Jagan Teki
On Sun, Oct 1, 2017 at 9:20 PM, Fabio Estevam  wrote:
> Hi Tom,
>
> On Sun, Oct 1, 2017 at 11:49 AM, Tom Rini  wrote:
>
>>> Same regression is observed with mx7dsabresd board as well.
>>
>> It's likely to be all i.MX :(
>
> Only the i.MX configs with CONFIG_DM_MMC=y.
>
>> Have all of the changes gone in such that an i.MX platform with SPL can
>> be non-interactively booted via imx_usb?  Not having my iMX platforms in
>> automated testing means that I always end up not testing them nearly
>> often enough.
>
> Yes, Stefan's patches have been been applied and are in mainline now.
>
> doc/README.sdp contains all the details to get imx_usb to load SPL + 
> u-boot.img.
>
> However, the two platforms I saw the issue does not use SPL.
>
> Jagan,
>
> I noticed that some of your i.MX boards do select CONFIG_DM_MMC=y.
>
> Is MMC functional in U-Boot mainline on these targets?

Yes, currently I'm using DM_MMC for U-Boot proper and recently I've
moved SPL as well [1].  But I've seen an issue with i.MX6UL while
moving to OF_SPL

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

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


Re: [U-Boot] [PATCH v2 17/19] arm: socfpga: Adding clock frequency info for U-boot

2017-10-02 Thread Chee, Tien Fong
On Isn, 2017-10-02 at 12:10 +0200, Marek Vasut wrote:
> On 10/02/2017 12:04 PM, Chee, Tien Fong wrote:
> > 
> > On Isn, 2017-09-25 at 11:23 +0200, Marek Vasut wrote:
> > > 
> > > On 09/25/2017 10:40 AM, tien.fong.c...@intel.com wrote:
> > > > 
> > > > 
> > > > From: Tien Fong Chee 
> > > > 
> > > > Clock frequency info is required in U-boot.
> > > > 
> > > > Signed-off-by: Tien Fong Chee 
> > > I want a TB on Gen 5
> > > 
> > This patch break the gen5, because cm_basic_init is exclusive for
> > Arria
> > 10. #ifdef is required.
> Can you at least build-test your patches before submitting ?
> Heck, you can also set up the travisci [1] to do all that stuff for
> you.
> 
> [1] https://travis-ci.org/marex/u-boot-socfpga/branches
> 
Okay.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [U-Boot,V9,1/4] usb: rockchip: add the rockusb gadget

2017-10-02 Thread Dr. Philipp Tomsich
Lukasz & Marek,

> On 12 Sep 2017, at 10:43, Łukasz Majewski  wrote:
> 
> Hi Dr. Philipp,
> 
>> Hi Lukasz,
>>> On 12 Sep 2017, at 10:14, Łukasz Majewski  wrote:
>>> 
>>> Hi Philipp,
>>> 
>>> This patch series is waiting for opening new merge window. It is already 
>>> applied to usb-next tree.
>> Didn’t the new merge window just open yesterday?
> 
> I'm sure Marek will send PR shortly.

I don’t see this series on u-boot-usb/master … what is the status on this?
I have multiple dependent series pending in my queue that are waiting on this 
one...

>> Regards,
>> Philipp.
>>> 
> this patch implement rockusb protocol on the device side. this is based 
> on USB
> download gadget infrastructure. the rockusb function implements the rd, 
> wl, rid
> commands. it can work with rkdeveloptool
> 
> Signed-off-by: Eddie Cai 
> Reviewed-by: Simon Glass 
> 
> Changes in v9:
> -fix compile error
> 
> Changes in v8:
> -none
> 
> Changes in v7:
> -none
> 
> Changes in v6:
> -move some data to f_rockusb structure
> 
> Changes in v5:
> -fix build error when build non-rockchip board
> -fix checkpatch error
> 
> Changes in v4:
> -use enum instead of macro define
> -move some structure define and macro to f_rockusb.h
> -add some function comment as Simon required
> -address other comment from Simon
> -fix build error as Lukasz point out
> ---
>  arch/arm/include/asm/arch-rockchip/f_rockusb.h | 132 +
>  drivers/usb/gadget/Kconfig |   8 +
>  drivers/usb/gadget/Makefile|   1 +
>  drivers/usb/gadget/f_rockusb.c | 691 
> +
>  4 files changed, 832 insertions(+)
>  create mode 100644 arch/arm/include/asm/arch-rockchip/f_rockusb.h
>  create mode 100644 drivers/usb/gadget/f_rockusb.c
> 
 Acked-by: Philipp Tomsich 
>>> 
>>> 
>>> -- 
>>> Best regards,
>>> 
>>> Lukasz Majewski
>>> 
>>> --
>>> 
>>> DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
>>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>>> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de 
>>> 
> 
> 
> -- 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de

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


Re: [U-Boot] [U-Boot,V9,1/4] usb: rockchip: add the rockusb gadget

2017-10-02 Thread Marek Vasut
On 10/02/2017 12:40 PM, Dr. Philipp Tomsich wrote:
> Lukasz & Marek,
> 
>> On 12 Sep 2017, at 10:43, Łukasz Majewski  wrote:
>>
>> Hi Dr. Philipp,
>>
>>> Hi Lukasz,
 On 12 Sep 2017, at 10:14, Łukasz Majewski  wrote:

 Hi Philipp,

 This patch series is waiting for opening new merge window. It is already 
 applied to usb-next tree.
>>> Didn’t the new merge window just open yesterday?
>>
>> I'm sure Marek will send PR shortly.
> 
> I don’t see this series on u-boot-usb/master … what is the status on this?
> I have multiple dependent series pending in my queue that are waiting on this 
> one...

It didn't pass travisci tests, I'm waiting for one which does.
Can you retest and resubmit , so Lukasz can pick it again ?

Sorry it takes one more cycle.

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


Re: [U-Boot] [U-Boot,V9,1/4] usb: rockchip: add the rockusb gadget

2017-10-02 Thread Dr. Philipp Tomsich
+Kever, +Eddie

Kever & Eddie,

> On 2 Oct 2017, at 12:41, Marek Vasut  wrote:
> 
> On 10/02/2017 12:40 PM, Dr. Philipp Tomsich wrote:
>> Lukasz & Marek,
>> 
>>> On 12 Sep 2017, at 10:43, Łukasz Majewski  wrote:
>>> 
>>> Hi Dr. Philipp,
>>> 
 Hi Lukasz,
> On 12 Sep 2017, at 10:14, Łukasz Majewski  wrote:
> 
> Hi Philipp,
> 
> This patch series is waiting for opening new merge window. It is already 
> applied to usb-next tree.
 Didn’t the new merge window just open yesterday?
>>> 
>>> I'm sure Marek will send PR shortly.
>> 
>> I don’t see this series on u-boot-usb/master … what is the status on this?
>> I have multiple dependent series pending in my queue that are waiting on 
>> this one...
> 
> It didn't pass travisci tests, I'm waiting for one which does.
> Can you retest and resubmit , so Lukasz can pick it again ?
> 
> Sorry it takes one more cycle.

Could you take follow up on Marek’s request to retest and resubmit?

Thanks,
Philipp.

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


Re: [U-Boot] fsl_esdhc driver is broken with DM

2017-10-02 Thread Fabio Estevam
Hi Jagan,

On Mon, Oct 2, 2017 at 7:23 AM, Jagan Teki  wrote:

> Yes, currently I'm using DM_MMC for U-Boot proper and recently I've
> moved SPL as well [1].  But I've seen an issue with i.MX6UL while
> moving to OF_SPL

What exactly is the MX6UL issue you see?

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


Re: [U-Boot] [PATCH v1 1/2] x86: tangier: Enable ACPI support for Intel Tangier

2017-10-02 Thread Andy Shevchenko
On Sun, 2017-09-03 at 17:46 +0800, Bin Meng wrote:
> Hi Andy,
> 
> On Wed, Aug 30, 2017 at 11:04 PM, Andy Shevchenko
>  wrote:
> > Intel Tangier SoC is a part of Intel Merrifield platform which
> > doesn't
> > utilize ACPI by default. Here is an attempt to unleash ACPI
> > flexibility
> > power on Intel Merrifield based platforms.
> > 
> > The change brings minimum support of the devices that found on
> > Intel Merrifield based end user device.
> > 

> Generally it looks good. Some comments below.

Thanks for review, my answers below.

> > +u32 acpi_fill_mcfg(u32 current)
> > +{
> > +   current += acpi_create_mcfg_mmconfig
> > +   ((struct acpi_mcfg_mmconfig *)current,
> > +   0x3f50, 0x0, 0x0, 0x0);
> 
> What is 0x3f50?

Nice question (I have in my local branch an additional commit with FIXME
near to this line)!

The root cause is a hardware design here. There are two (okay, on those
platforms up to four) *real* PCI devices. The rest have PCI
*programming* interface but being not PCI at the same time. This is a
magic address of so called PCI Shim for those (non-PCI) devices which
filed by firmware.

>  Can we define something in asm/arch/iomap.h (like
> Baytrail) and use it here?

It comes from SFI, so, the best approach is to parse SFI for that.

I would not do this right now (will take a lot of time for not much
benefit), though can put as TODO.

>  And I see the end_bus_number is set to zero
> here, why?

See above.

>  Is this table a faked one?

It's based on SFI.

>  How about completely drop this
> table? Does Linux boot without this table?

It might start booting (as initial part), but it will lose an ability to
enumerate almost all devices in SoC. Basically user will not get even
console.

> > +
> > +   return current;
> > +}
> > 

> > +OperationRegion(GNVS, SystemMemory, ACPI_GNVS_ADDR, ACPI_GNVS_SIZE)
> > +Field(GNVS, ByteAcc, NoLock, Preserve)
> > +{
> > +Offset (0x00),
> > +PCNT, 2,/* processor count */
> 
> 2 is weird here. Why only two bits? I believe it should be 8 per your
> global_nvs.h defines.

Ah, I misread what that number means. Will fix.

> > +Method (_PS0, 0, NotSerialized)
> > +{
> > +If (PSTS == Zero)
> > +{
> 
> nits: can we do something similar to U-Boot coding style with these
> If/Else?

I would rather follow iasl style for ASL.

Though if it's obliged to use U-Boot style over all files, I can switch.

> 
> > +If (^^GPIO.AVBL == One)
> > +{
> > +^^GPIO.WFD3 = One
> > +PSTS = One
> > +}
> > +}
> > +}
> > +
> > +/* BCM43340 */
> > +Device (BRC1)
> > +{
> > +Name (_ADR, One)
> 
> nits: since it represents an address, I would use 0x01 instead of One

I have no strong opinion here, ACPI spec says

"The use of this operator can reduce AML code size, since it is
represented by a one-byte AML opcode."

Same for Zero.

Though to be consistent with the rest, I will change it.

> +Device (BRC2)
> > +{
> > +Name (_ADR, 0x02)
> > 

> > +Name (RBUF, ResourceTemplate()
> > +{
> > +GpioIo(Exclusive, PullUp, 0, 0,
> > IoRestrictionOutputOnly,
> > +"\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 91 }
> 
> nits: can we use relative path here, like "GPIO"?

While spec says:

"ResourceSource can be a fully-qualified name, a relative name or a name
segment that utilizes the namespace search rules."

I would rather follow common practice, i.e. to use fully-qualified name
for GPIO and Pin control resources.

> 
> > +GpioIo(Exclusive, PullUp, 0, 0,
> > IoRestrictionOutputOnly,
> > +"\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 92 }
> > +GpioIo(Exclusive, PullUp, 0, 0,
> > IoRestrictionOutputOnly,
> > +"\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 93 }
> > +GpioIo(Exclusive, PullUp, 0, 0,
> > IoRestrictionOutputOnly,
> > +"\\_SB.PCI0.GPIO", 0, ResourceConsumer, , ) { 94 }
> > 

> > +Device (GPIO)
> > +{
> > +Name (_ADR, 0x000c)
> > +Name (_DEP, Package (0x01)
> > +{
> > +\_SB.FLIS
> > +})
> 
> Looks _DEP method is supported only for Operation Regions as I read
> from ACPI spec? Does it work here?

No, it doesn't (yet?). I would move it out to my debugging stuff.

> > +
> > +Method (_STA)
> > +{
> > +Return (STA_VISIBLE)
> > +}
> > +
> > +Name (AVBL, Zero)
> > +Method (_REG, 2, NotSerialized)
> > +{
> > +If (Arg0 == 0x08)
> 
> I assume 0x08 here means GeneralPurposeIO which is one of Operation
> Region Address Space Identifiers Values? If yes, could we add
> something in arch/x86/include/asm/acpi/ and use macro here?

This part I got based on disassemble from iasl. Moreover, there are two
scop

[U-Boot] [PATCH] mx6slevk: Use PARTUUID to specify the rootfs location

2017-10-02 Thread Fabio Estevam
From: Fabio Estevam 

mx6slevk can run different kernel versions, such as NXP 4.1 or mainline.

Currently the rootfs location is passed via mmcblk number and the
problem with this approach is that the mmcblk number for the SD
card changes depending on the kernel version.

In order to avoid such issue, use the UUID method to specify the
rootfs location.

Signed-off-by: Fabio Estevam 
---
 configs/mx6slevk_defconfig | 1 +
 configs/mx6slevk_spl_defconfig | 1 +
 include/configs/mx6slevk.h | 5 +++--
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/configs/mx6slevk_defconfig b/configs/mx6slevk_defconfig
index 1c28942..641fa85 100644
--- a/configs/mx6slevk_defconfig
+++ b/configs/mx6slevk_defconfig
@@ -13,6 +13,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
diff --git a/configs/mx6slevk_spl_defconfig b/configs/mx6slevk_spl_defconfig
index 4d4f273..8fadbcc 100644
--- a/configs/mx6slevk_spl_defconfig
+++ b/configs/mx6slevk_spl_defconfig
@@ -21,6 +21,7 @@ CONFIG_CMD_BOOTZ=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_PART=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_DHCP=y
diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
index 25c83e8..9ddb143 100644
--- a/include/configs/mx6slevk.h
+++ b/include/configs/mx6slevk.h
@@ -53,9 +53,9 @@
"ip_dyn=yes\0" \
"mmcdev=1\0" \
"mmcpart=1\0" \
-   "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
+   "finduuid=part uuid mmc 1:2 uuid\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
-   "root=${mmcroot}\0" \
+   "root=PARTUUID=${uuid} rootwait rw\0" \
"loadbootscript=" \
"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
"bootscript=echo Running bootscript from mmc ...; " \
@@ -63,6 +63,7 @@
"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
"mmcboot=echo Booting from mmc ...; " \
+   "run finduuid; " \
"run mmcargs; " \
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
"if run loadfdt; then " \
-- 
2.7.4

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


Re: [U-Boot] [PATCH V4 11/12] imx: mx6sabresd: enable dm drivers

2017-10-02 Thread Stefano Babic
On 28/09/2017 07:34, Peng Fan wrote:
> Hi Stefano,
> 
>> -Original Message-
>> From: Peng Fan
>> Sent: Tuesday, September 26, 2017 10:04 AM
>> To: 'Stefano Babic' 
>> Cc: van.free...@gmail.com; u-boot@lists.denx.de; Fabio Estevam
>> 
>> Subject: RE: [PATCH V4 11/12] imx: mx6sabresd: enable dm drivers
>>
>> Hi Stefano,
>>
>>
>>> -Original Message-
>>> From: Stefano Babic [mailto:sba...@denx.de]
>>> Sent: Monday, September 25, 2017 10:12 PM
>>> To: Peng Fan ; sba...@denx.de
>>> Cc: van.free...@gmail.com; u-boot@lists.denx.de; Fabio Estevam
>>> 
>>> Subject: Re: [PATCH V4 11/12] imx: mx6sabresd: enable dm drivers
>>>
>>> Hi Peng,
>>>
>>> On 30/08/2017 08:14, Peng Fan wrote:
 Enable DM MMC/I2C/PMIC/GPIO/REGULATOR.

 Signed-off-by: Peng Fan 
 Cc: Fabio Estevam 
 Cc: Stefano Babic 
 ---

 V2->V4: none

>> [..]
>>

>>>
>>> Enabling DM drivers seems to break sabresd:
>>>
>>>   arm:  +   mx6sabresd
>>> +common/usb_storage.c: In function 'usb_stor_probe_device':
>>> +common/usb_storage.c:218:30: error: 'struct usb_device' has no member
>>> named 'dev'
>>> +  data = dev_get_platdata(udev->dev);
>>> +  ^
>>> +common/usb_storage.c:228:32: error: 'struct usb_device' has no member
>>> named 'dev'
>>> +   ret = blk_create_devicef(udev->dev, "usb_storage_blk", str,
>>> +^
>>>
>>>
>>> Can you take a look ?
>>
>> I build mx6sabresd_defconfig, I met the following warning based on imx
>> master branch, but did not met the build error.
>>   CC  spl/common/spl/spl_fit.o
>> common/spl/spl_fit.c: In function 'spl_load_fit_image':
>> common/spl/spl_fit.c:201:7: warning: passing argument 4 of 'gunzip' from
>> incompatible pointer type [enabled by default]
>>src, &length)) {
>>^
>> In file included from common/spl/spl_fit.c:8:0:
>> include/common.h:627:5: note: expected 'long unsigned int *' but argument is
>> of type 'size_t *'
>>  int gunzip(void *, int, unsigned char *, unsigned long *);
> 
> Missed to say that this is not introduced by my patch. 

Yes, it is not - it is due to concurrent mergfe of several patches.

> Did not meet that error when build mx6sabresd_defconfig? I did not meet that 
> error based on
> master or imx master branch.

I got some further errors because I have already merged Fabio's (and
someone patch). Fixes look trivial, but I do not want to do this as I
cannot test.

Could you please take a look and rebase your set on top of current
u-boot.imx ? Thanks !

Stefano

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


Re: [U-Boot] [PATCH V2] imx: mx7: Add support for USB and normal boot modes

2017-10-02 Thread Stefano Babic
On 31/08/2017 00:13, Eric Nelson wrote:
> This adds support for two additional boot modes on the i.MX7D SoC, which
> is most useful when doing U-Boot development on this chip.
> 
> 1. "bmode usb" can be used to force the ROM boot loader's serial
> 2. "bmode normal" can be used to revert to the normal boot mode
>as specified by fuses and BOOT_MODE pins
> 
> Signed-off-by: Eric Nelson 
> ---
> V2 adds "normal" mode as suggested by Troy Kisky
>  arch/arm/mach-imx/mx7/soc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c
> index 87bf105..15be42a 100644
> --- a/arch/arm/mach-imx/mx7/soc.c
> +++ b/arch/arm/mach-imx/mx7/soc.c
> @@ -372,6 +372,9 @@ void set_wdog_reset(struct wdog_regs *wdog)
>   * to SBMR1, which will determine the boot device.
>   */
>  const struct boot_mode soc_boot_modes[] = {
> + {"normal",  MAKE_CFGVAL(0x00, 0x00, 0x00, 0x00)},
> + {"usb", MAKE_CFGVAL(0x01, 0x00, 0x00, 0x00)},
> +
>   {"ecspi1:0",MAKE_CFGVAL(0x00, 0x60, 0x00, 0x00)},
>   {"ecspi1:1",MAKE_CFGVAL(0x40, 0x62, 0x00, 0x00)},
>   {"ecspi1:2",MAKE_CFGVAL(0x80, 0x64, 0x00, 0x00)},
> 

Sorry, it was for a long time in the queue - discussion in thread is
spreading away from the original review (I had errouneosly set it to
Changes requested).

Applied to u-boot-imx, -master, thanks !

Best regards,
Stefano

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


[U-Boot] Beagleboard xM boot broken due to FIT enable

2017-10-02 Thread Guillaume Gardet

Hi,

commit 46f9ef18461609064a1ffbc3f61dc027ec76b3ff
Author: Andrew F. Davis 
Date:   Fri Apr 21 10:01:28 2017 -0500

    Kconfig: Enable FIT support by default for TI platforms

    Almost all TI defconfigs enable this already, add this as a default
    and remove the explicit assignment.

    Signed-off-by: Andrew F. Davis 
    Reviewed-by: Tom Rini 

broke boot on Beagleboard xM. I mean the board hangs after:
    OMAP3630/3730-GP ES1.1, CPU-OPP2, L3-200MHz, Max CPU Clock 800 MHz
    OMAP3 Beagle board + LPDDR/NAND
    I2C:   ready
    DRAM:  512 MiB


To get back the board booting, I need to manually disable FIT (CONFIG_FIT) 
_and_ disable SHA256 hash support (CONFIG_SHA256).

If I enable FIT without sha256 : it breaks boot.
If I enable sha256 without FIT : it breaks boot.

Any idea what could cause this?

As a workaround we could disable it in the omap3_beagle_defconfig but I guess 
it would be better to fix it instead of workaround it, since other boards may 
also be affected.


Guillaume


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


[U-Boot] [PATCH] sandbox: Expand list of IO accessors

2017-10-02 Thread Maxime Ripard
The setbits/clrbits/clrsetbits macros are used widely across the tree,
let's provide implementation for them in the sandbox.

Signed-off-by: Maxime Ripard 
---
 arch/sandbox/include/asm/io.h | 47 +++
 1 file changed, 47 insertions(+)

diff --git a/arch/sandbox/include/asm/io.h b/arch/sandbox/include/asm/io.h
index a6856356df19..3ece70d09dd1 100644
--- a/arch/sandbox/include/asm/io.h
+++ b/arch/sandbox/include/asm/io.h
@@ -56,6 +56,53 @@ void outl(unsigned int value, unsigned int addr);
 void outw(unsigned int value, unsigned int addr);
 void outb(unsigned int value, unsigned int addr);
 
+#define out_arch(type,endian,a,v)  write##type(cpu_to_##endian(v),a)
+#define in_arch(type,endian,a) endian##_to_cpu(read##type(a))
+
+#define out_le32(a,v)  out_arch(l,le32,a,v)
+#define out_le16(a,v)  out_arch(w,le16,a,v)
+
+#define in_le32(a) in_arch(l,le32,a)
+#define in_le16(a) in_arch(w,le16,a)
+
+#define out_be32(a,v)  out_arch(l,be32,a,v)
+#define out_be16(a,v)  out_arch(w,be16,a,v)
+
+#define in_be32(a) in_arch(l,be32,a)
+#define in_be16(a) in_arch(w,be16,a)
+
+#define out_8(a,v) writeb(v,a)
+#define in_8(a)readb(a)
+
+#define clrbits(type, addr, clear) \
+   out_##type((addr), in_##type(addr) & ~(clear))
+
+#define setbits(type, addr, set) \
+   out_##type((addr), in_##type(addr) | (set))
+
+#define clrsetbits(type, addr, clear, set) \
+   out_##type((addr), (in_##type(addr) & ~(clear)) | (set))
+
+#define clrbits_be32(addr, clear) clrbits(be32, addr, clear)
+#define setbits_be32(addr, set) setbits(be32, addr, set)
+#define clrsetbits_be32(addr, clear, set) clrsetbits(be32, addr, clear, set)
+
+#define clrbits_le32(addr, clear) clrbits(le32, addr, clear)
+#define setbits_le32(addr, set) setbits(le32, addr, set)
+#define clrsetbits_le32(addr, clear, set) clrsetbits(le32, addr, clear, set)
+
+#define clrbits_be16(addr, clear) clrbits(be16, addr, clear)
+#define setbits_be16(addr, set) setbits(be16, addr, set)
+#define clrsetbits_be16(addr, clear, set) clrsetbits(be16, addr, clear, set)
+
+#define clrbits_le16(addr, clear) clrbits(le16, addr, clear)
+#define setbits_le16(addr, set) setbits(le16, addr, set)
+#define clrsetbits_le16(addr, clear, set) clrsetbits(le16, addr, clear, set)
+
+#define clrbits_8(addr, clear) clrbits(8, addr, clear)
+#define setbits_8(addr, set) setbits(8, addr, set)
+#define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set)
+
 static inline void _insw(volatile u16 *port, void *buf, int ns)
 {
 }
-- 
2.13.5

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


Re: [U-Boot] [PATCH 0/6] i.MX6Q: Add SPL_OF_CONTROL support

2017-10-02 Thread Stefano Babic
Hi Jagan,

On 19/09/2017 20:37, Jagan Teki wrote:
> From: Jagan Teki 
> 
> This series add OF_CONTROL support for SPL on Engicam i.MX6QDL
> boards, along with proper code optimzation changes.
> 
> 
> Jagan Teki (6):
>   i.MX6: engicam: Fix MAINTAINERS/README
>   imx6ul: geam6ul/isiot: Fix to MMC devices
>   i.MX6: engicam: Move set_fdt_file to common
>   i.MX6Q: icorem6: Move spl load fit to common/spl
>   i.MX6Q: icore: Add SPL_OF_CONTROL support
>   i.MX6Q: icore: Add imx6q board for icore/icore_rqs
> 
>  arch/arm/dts/imx6qdl-icore-rqs.dtsi|   2 +
>  arch/arm/dts/imx6qdl-icore.dtsi|   2 +
>  arch/arm/dts/imx6qdl.dtsi  |   5 +
>  arch/arm/mach-imx/mx6/Kconfig  |  24 +--
>  board/engicam/common/board.c   |  24 +++
>  board/engicam/common/board.h   |   1 -
>  board/engicam/common/spl.c |  16 ++
>  board/engicam/geam6ul/MAINTAINERS  |   2 +-
>  board/engicam/geam6ul/geam6ul.c|   6 -
>  board/engicam/icorem6/README   |  33 
>  board/engicam/icorem6_rqs/Kconfig  |  12 --
>  board/engicam/icorem6_rqs/MAINTAINERS  |   9 --
>  board/engicam/icorem6_rqs/Makefile |   6 -
>  board/engicam/icorem6_rqs/icorem6_rqs.c| 171 
> -
>  board/engicam/{icorem6 => imx6q}/Kconfig   |   2 +-
>  board/engicam/{icorem6 => imx6q}/MAINTAINERS   |  10 +-
>  board/engicam/{icorem6 => imx6q}/Makefile  |   2 +-
>  board/engicam/{icorem6_rqs => imx6q}/README|  12 +-
>  board/engicam/{icorem6/icorem6.c => imx6q/imx6q.c} | 108 +++--
>  board/engicam/isiotmx6ul/MAINTAINERS   |   2 +-
>  board/engicam/isiotmx6ul/isiotmx6ul.c  |  11 --
>  configs/imx6qdl_icore_mmc_defconfig|   1 +
>  configs/imx6qdl_icore_rqs_defconfig|   3 +-
>  configs/imx6ul_geam_mmc_defconfig  |   1 -
>  configs/imx6ul_isiot_emmc_defconfig|   1 -
>  configs/imx6ul_isiot_mmc_defconfig |   1 -
>  include/configs/imx6-engicam.h |  22 +--
>  27 files changed, 112 insertions(+), 377 deletions(-)
>  delete mode 100644 board/engicam/icorem6/README
>  delete mode 100644 board/engicam/icorem6_rqs/Kconfig
>  delete mode 100644 board/engicam/icorem6_rqs/MAINTAINERS
>  delete mode 100644 board/engicam/icorem6_rqs/Makefile
>  delete mode 100644 board/engicam/icorem6_rqs/icorem6_rqs.c
>  rename board/engicam/{icorem6 => imx6q}/Kconfig (87%)
>  rename board/engicam/{icorem6 => imx6q}/MAINTAINERS (51%)
>  rename board/engicam/{icorem6 => imx6q}/Makefile (80%)
>  rename board/engicam/{icorem6_rqs => imx6q}/README (68%)
>  rename board/engicam/{icorem6/icorem6.c => imx6q/imx6q.c} (73%)
> 

I cannot build your boards when I apply the patchset
(CONFIG_SYS_FSL_ESDHC_ADDR is away now):


Building current source for 8 boards (8 threads, 1 job per thread)
   arm:  +   imx6ul_isiot_emmc
+drivers/mmc/fsl_esdhc.c: In function 'fsl_esdhc_mmc_init':
+drivers/mmc/fsl_esdhc.c:934:20: error: 'CONFIG_SYS_FSL_ESDHC_ADDR'
undeclared (first use in this function)
+  cfg->esdhc_base = CONFIG_SYS_FSL_ESDHC_ADDR;
+^
+drivers/mmc/fsl_esdhc.c:934:20: note: each undeclared identifier is
reported only once for each function it appears in
+make[4]: *** [spl/drivers/mmc/fsl_esdhc.o] Error 1
+make[3]: *** [spl/drivers/mmc] Error 2
+make[2]: *** [spl/drivers] Error 2
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
   arm:  +   imx6ul_geam_mmc
+drivers/mmc/fsl_esdhc.c: In function 'fsl_esdhc_mmc_init':
+drivers/mmc/fsl_esdhc.c:934:20: error: 'CONFIG_SYS_FSL_ESDHC_ADDR'
undeclared (first use in this function)
+  cfg->esdhc_base = CONFIG_SYS_FSL_ESDHC_ADDR;
+^
+drivers/mmc/fsl_esdhc.c:934:20: note: each undeclared identifier is
reported only once for each function it appears in
+make[4]: *** [spl/drivers/mmc/fsl_esdhc.o] Error 1
+make[3]: *** [spl/drivers/mmc] Error 2
+make[2]: *** [spl/drivers] Error 2
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2
   arm:  +   imx6ul_isiot_mmc
+drivers/mmc/fsl_esdhc.c: In function 'fsl_esdhc_mmc_init':
+drivers/mmc/fsl_esdhc.c:934:20: error: 'CONFIG_SYS_FSL_ESDHC_ADDR'
undeclared (first use in this function)
+  cfg->esdhc_base = CONFIG_SYS_FSL_ESDHC_ADDR;

Could you take a look, please ?

Thanks,
Stefano

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

Re: [U-Boot] [PATCH v3 1/2] wandboard: Add support for the latest revd1 revision

2017-10-02 Thread Stefano Babic
Hi Fabio,

On 27/09/2017 19:27, Fabio Estevam wrote:
> Latest wandboard hardware revision is revd1, which brings the following
> new features:
> 
> - PFUZE100 PMIC
> - AR8035 Ethernet PHY
> - Upgrade Wifi/BT chip to BCM4339/BCM43430.
> 

This patch cannot be applied anymore - as you will be preparing 2/2,
could you also rebase this on current u-boot-imx ? Thanks !

Best regards,
Stefano

> The detection mechanism is to probe the PMIC and when it is
> found, then the revision of the board is revd1.
> 
> As the detection is done via PMIC, we need to print the board version
> at a later stage via CONFIG_DISPLAY_BOARDINFO_LATE and also need
> to disable CONFIG_DISPLAY_BOARDINFO, which is done much earlier.
> 
> Make the necessary adjustments for the AR8035 PHY to work on revd1.
> 
> Based on Richard Hu's work from Technexion's U-Boot tree.
> 
> Signed-off-by: Fabio Estevam 
> ---
> Changes since v2:
> - Also turn on ldb_di0 clock. Able to boot the kernel now.
> 
>  board/wandboard/wandboard.c | 110 
> +---
>  configs/wandboard_defconfig |   1 +
>  include/configs/wandboard.h |  11 +
>  3 files changed, 115 insertions(+), 7 deletions(-)
> 
> diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
> index adfcf48..14dd378 100644
> --- a/board/wandboard/wandboard.c
> +++ b/board/wandboard/wandboard.c
> @@ -30,6 +30,8 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -51,8 +53,11 @@ DECLARE_GLOBAL_DATA_PTR;
>  #define USDHC1_CD_GPIO   IMX_GPIO_NR(1, 2)
>  #define USDHC3_CD_GPIO   IMX_GPIO_NR(3, 9)
>  #define ETH_PHY_RESETIMX_GPIO_NR(3, 29)
> +#define ETH_PHY_AR8035_POWER IMX_GPIO_NR(7, 13)
>  #define REV_DETECTIONIMX_GPIO_NR(2, 28)
>  
> +static bool with_pmic;
> +
>  int dram_init(void)
>  {
>   gd->ram_size = imx_ddr_size();
> @@ -107,6 +112,11 @@ static iomux_v3_cfg_t const enet_pads[] = {
>   IOMUX_PADS(PAD_EIM_D29__GPIO3_IO29| MUX_PAD_CTRL(NO_PAD_CTRL)),
>  };
>  
> +static iomux_v3_cfg_t const enet_ar8035_power_pads[] = {
> + /* AR8035 POWER */
> + IOMUX_PADS(PAD_GPIO_18__GPIO7_IO13| MUX_PAD_CTRL(NO_PAD_CTRL)),
> +};
> +
>  static iomux_v3_cfg_t const rev_detection_pad[] = {
>   IOMUX_PADS(PAD_EIM_EB0__GPIO2_IO28  | MUX_PAD_CTRL(NO_PAD_CTRL)),
>  };
> @@ -120,6 +130,14 @@ static void setup_iomux_enet(void)
>  {
>   SETUP_IOMUX_PADS(enet_pads);
>  
> + if (with_pmic) {
> + SETUP_IOMUX_PADS(enet_ar8035_power_pads);
> + /* enable AR8035 POWER */
> + gpio_direction_output(ETH_PHY_AR8035_POWER, 0);
> + }
> + /* wait until 3.3V of PHY and clock become stable */
> + mdelay(10);
> +
>   /* Reset AR8031 PHY */
>   gpio_direction_output(ETH_PHY_RESET, 0);
>   mdelay(10);
> @@ -192,6 +210,7 @@ int board_mmc_init(bd_t *bis)
>  static int ar8031_phy_fixup(struct phy_device *phydev)
>  {
>   unsigned short val;
> + int mask;
>  
>   /* To enable AR8031 ouput a 125MHz clk from CLK_25M */
>   phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x7);
> @@ -199,7 +218,12 @@ static int ar8031_phy_fixup(struct phy_device *phydev)
>   phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007);
>  
>   val = phy_read(phydev, MDIO_DEVAD_NONE, 0xe);
> - val &= 0xffe3;
> + if (with_pmic)
> + mask = 0xffe7;  /* AR8035 */
> + else
> + mask = 0xffe3;  /* AR8031 */
> +
> + val &= mask;
>   val |= 0x18;
>   phy_write(phydev, MDIO_DEVAD_NONE, 0xe, val);
>  
> @@ -257,6 +281,40 @@ struct i2c_pads_info mx6dl_i2c2_pad_info = {
>   }
>  };
>  
> +struct i2c_pads_info mx6q_i2c3_pad_info = {
> + .scl = {
> + .i2c_mode = MX6Q_PAD_GPIO_5__I2C3_SCL
> + | MUX_PAD_CTRL(I2C_PAD_CTRL),
> + .gpio_mode = MX6Q_PAD_GPIO_5__GPIO1_IO05
> + | MUX_PAD_CTRL(I2C_PAD_CTRL),
> + .gp = IMX_GPIO_NR(1, 5)
> + },
> + .sda = {
> + .i2c_mode = MX6Q_PAD_GPIO_16__I2C3_SDA
> + | MUX_PAD_CTRL(I2C_PAD_CTRL),
> + .gpio_mode = MX6Q_PAD_GPIO_16__GPIO7_IO11
> + | MUX_PAD_CTRL(I2C_PAD_CTRL),
> + .gp = IMX_GPIO_NR(7, 11)
> + }
> +};
> +
> +struct i2c_pads_info mx6dl_i2c3_pad_info = {
> + .scl = {
> + .i2c_mode = MX6DL_PAD_GPIO_5__I2C3_SCL
> + | MUX_PAD_CTRL(I2C_PAD_CTRL),
> + .gpio_mode = MX6DL_PAD_GPIO_5__GPIO1_IO05
> + | MUX_PAD_CTRL(I2C_PAD_CTRL),
> + .gp = IMX_GPIO_NR(1, 5)
> + },
> + .sda = {
> + .i2c_mode = MX6DL_PAD_GPIO_16__I2C3_SDA
> + | MUX_PAD_CTRL(I2C_PAD_CTRL),
> + .gpio_mode = MX6DL_PAD_GPIO_16__GPIO7_IO11
> + | MUX_PAD_CTRL(I2C_PAD_CTRL),
> + .gp = IMX_GPIO_NR(7, 11)
> + }
> +};
> +
>  static iomux_v3_cfg_t const fwada

Re: [U-Boot] [PATCH 1/2] mx25pdk: Use generic filesystem commands

2017-10-02 Thread Stefano Babic
On 30/09/2017 03:54, Otavio Salvador wrote:
> This rework the board to use the generic filesystem commands instead
> of forcing the use of FAT for the boot files.
> 
> Signed-off-by: Otavio Salvador 
> ---
> 
>  configs/mx25pdk_defconfig | 5 +++--
>  include/configs/mx25pdk.h | 9 ++---
>  2 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/configs/mx25pdk_defconfig b/configs/mx25pdk_defconfig
> index e75a82c199..8ed394569a 100644
> --- a/configs/mx25pdk_defconfig
> +++ b/configs/mx25pdk_defconfig
> @@ -15,7 +15,8 @@ CONFIG_CMD_MII=y
>  CONFIG_CMD_PING=y
>  CONFIG_CMD_CACHE=y
>  CONFIG_CMD_DATE=y
> -CONFIG_CMD_EXT2=y
> -CONFIG_CMD_FAT=y
> +CONFIG_CMD_FS_GENERIC=y
> +CONFIG_DOS_PARTITION=y
>  CONFIG_ENV_IS_IN_MMC=y
> +CONFIG_FS_FAT=y
>  CONFIG_OF_LIBFDT=y
> diff --git a/include/configs/mx25pdk.h b/include/configs/mx25pdk.h
> index bc41a3362d..57e2a6db36 100644
> --- a/include/configs/mx25pdk.h
> +++ b/include/configs/mx25pdk.h
> @@ -70,6 +70,9 @@
>  
>  /* U-Boot commands */
>  
> +/* Filesystem support */
> +#define CONFIG_FS_EXT4
> +
>  /* Ethernet */
>  #define CONFIG_FEC_MXC
>  #define CONFIG_FEC_MXC_PHYADDR   0x1f
> @@ -138,11 +141,11 @@
>   "mmcargs=setenv bootargs console=${console},${baudrate} " \
>   "root=${mmcroot}\0" \
>   "loadbootscript=" \
> - "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
> + "load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
>   "bootscript=echo Running bootscript from mmc ...; " \
>   "source\0" \
> - "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
> - "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
> + "loadimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
> + "loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
>   "mmcboot=echo Booting from mmc ...; " \
>   "run mmcargs; " \
>   "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
> 

Applied to u-boot-imx, -master, thanks !

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


Re: [U-Boot] [PATCH 2/2] mx25pdk: Remove duplicated define

2017-10-02 Thread Stefano Babic
On 30/09/2017 03:55, Otavio Salvador wrote:
> The CONFIG_SYS_MMC_ENV_DEV is duplicated, drop it.
> 
> Signed-off-by: Otavio Salvador 
> ---
> 
>  include/configs/mx25pdk.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/include/configs/mx25pdk.h b/include/configs/mx25pdk.h
> index 57e2a6db36..bb100c40df 100644
> --- a/include/configs/mx25pdk.h
> +++ b/include/configs/mx25pdk.h
> @@ -58,8 +58,6 @@
>  #define CONFIG_ENV_SIZE(8 * 1024)
>  #define CONFIG_SYS_MMC_ENV_DEV   0
>  
> -#define CONFIG_SYS_MMC_ENV_DEV 0
> -
>  /* U-Boot general configuration */
>  #define CONFIG_AUTO_COMPLETE
>  #define CONFIG_SYS_CBSIZE1024/* Console I/O Buffer Size  */
> 

Applied to u-boot-imx, -master, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH] mx6: toradex: Remove custom CONFIG_SPL_PAD_TO definition

2017-10-02 Thread Stefano Babic
On 25/09/2017 20:20, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> CONFIG_SPL_PAD_TO is already defined inside "imx6_spl.h", so there
> is no need to redefine it in the board config files.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  include/configs/apalis_imx6.h  | 1 -
>  include/configs/colibri_imx6.h | 1 -
>  2 files changed, 2 deletions(-)
> 
> diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
> index a15f19d..51bf61c 100644
> --- a/include/configs/apalis_imx6.h
> +++ b/include/configs/apalis_imx6.h
> @@ -23,7 +23,6 @@
>  
>  #ifdef CONFIG_SPL
>  #include "imx6_spl.h"
> -#define CONFIG_SPL_PAD_TO0x11000 /* 4k IVT/DCD, 64k SPL */
>  #endif
>  
>  #define CONFIG_CMDLINE_TAG
> diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h
> index db71369..ac9a23d 100644
> --- a/include/configs/colibri_imx6.h
> +++ b/include/configs/colibri_imx6.h
> @@ -21,7 +21,6 @@
>  
>  #ifdef CONFIG_SPL
>  #include "imx6_spl.h"
> -#define CONFIG_SPL_PAD_TO0x11000 /* 4k IVT/DCD, 64k SPL */
>  #endif
>  
>  #define CONFIG_CMDLINE_TAG
> 
Applied to u-boot-imx, -master, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] Beagleboard xM boot broken due to FIT enable

2017-10-02 Thread Tom Rini
On Mon, Oct 02, 2017 at 03:24:01PM +0200, Guillaume Gardet wrote:
> Hi,
> 
> commit 46f9ef18461609064a1ffbc3f61dc027ec76b3ff
> Author: Andrew F. Davis 
> Date:   Fri Apr 21 10:01:28 2017 -0500
> 
>     Kconfig: Enable FIT support by default for TI platforms
> 
>     Almost all TI defconfigs enable this already, add this as a default
>     and remove the explicit assignment.
> 
>     Signed-off-by: Andrew F. Davis 
>     Reviewed-by: Tom Rini 
> 
> broke boot on Beagleboard xM. I mean the board hangs after:
>     OMAP3630/3730-GP ES1.1, CPU-OPP2, L3-200MHz, Max CPU Clock 800 MHz
>     OMAP3 Beagle board + LPDDR/NAND
>     I2C:   ready
>     DRAM:  512 MiB
> 
> 
> To get back the board booting, I need to manually disable FIT (CONFIG_FIT) 
> _and_ disable SHA256 hash support (CONFIG_SHA256).
> 
> If I enable FIT without sha256 : it breaks boot.
> If I enable sha256 without FIT : it breaks boot.
> 
> Any idea what could cause this?
> 
> As a workaround we could disable it in the omap3_beagle_defconfig but I guess 
> it would be better to fix it instead of workaround it, since other boards may 
> also be affected.

Which Beagleboard xM rev do you have?  And how are you booting (FAT or
raw) ?  Mine, FAT booting, is working currently and is part of my
automated test farm, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] imx: Include header file

2017-10-02 Thread Stefano Babic
On 22/09/2017 17:12, Diego Dorta wrote:
> When building with W=1 errors like the one below is seen:
> 
> board/freescale/mx6sabresd/mx6sabresd.c:546:5: warning:
> no previous prototype for ‘overwrite_console’
> [-Wmissing-prototypes] int overwrite_console(void)
> 
> Fix the build warnings by including .
> 
> Signed-off-by: Diego Dorta 
> ---
>  board/advantech/dms-ba16/dms-ba16.c | 1 +
>  board/aristainetos/aristainetos.c   | 1 +
>  board/beckhoff/mx53cx9020/mx53cx9020.c  | 1 +
>  board/congatec/cgtqmx6eval/cgtqmx6eval.c| 1 +
>  board/el/el6x/el6x.c| 1 +
>  board/embest/mx6boards/mx6boards.c  | 1 +
>  board/freescale/mx51evk/mx51evk.c   | 1 +
>  board/freescale/mx53loco/mx53loco.c | 1 +
>  board/freescale/mx6sabreauto/mx6sabreauto.c | 1 +
>  board/freescale/mx6sabresd/mx6sabresd.c | 1 +
>  board/ge/bx50v3/bx50v3.c| 1 +
>  board/logicpd/imx6/imx6logic.c  | 1 +
>  board/technologic/ts4800/ts4800.c   | 1 +
>  board/toradex/apalis_imx6/apalis_imx6.c | 1 +
>  board/toradex/colibri_imx6/colibri_imx6.c   | 1 +
>  15 files changed, 15 insertions(+)
> 
> diff --git a/board/advantech/dms-ba16/dms-ba16.c 
> b/board/advantech/dms-ba16/dms-ba16.c
> index c728943..6fe7471 100644
> --- a/board/advantech/dms-ba16/dms-ba16.c
> +++ b/board/advantech/dms-ba16/dms-ba16.c
> @@ -25,6 +25,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  DECLARE_GLOBAL_DATA_PTR;
>  
> diff --git a/board/aristainetos/aristainetos.c 
> b/board/aristainetos/aristainetos.c
> index 872fedd..a60cbfc 100644
> --- a/board/aristainetos/aristainetos.c
> +++ b/board/aristainetos/aristainetos.c
> @@ -28,6 +28,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/board/beckhoff/mx53cx9020/mx53cx9020.c 
> b/board/beckhoff/mx53cx9020/mx53cx9020.c
> index a18a4e8..021bd96 100644
> --- a/board/beckhoff/mx53cx9020/mx53cx9020.c
> +++ b/board/beckhoff/mx53cx9020/mx53cx9020.c
> @@ -26,6 +26,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  
> diff --git a/board/congatec/cgtqmx6eval/cgtqmx6eval.c 
> b/board/congatec/cgtqmx6eval/cgtqmx6eval.c
> index 2ed66d3..575aff7 100644
> --- a/board/congatec/cgtqmx6eval/cgtqmx6eval.c
> +++ b/board/congatec/cgtqmx6eval/cgtqmx6eval.c
> @@ -24,6 +24,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/board/el/el6x/el6x.c b/board/el/el6x/el6x.c
> index fb128f5..b2fe7fd 100644
> --- a/board/el/el6x/el6x.c
> +++ b/board/el/el6x/el6x.c
> @@ -25,6 +25,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/board/embest/mx6boards/mx6boards.c 
> b/board/embest/mx6boards/mx6boards.c
> index 8674599..ae04f68 100644
> --- a/board/embest/mx6boards/mx6boards.c
> +++ b/board/embest/mx6boards/mx6boards.c
> @@ -26,6 +26,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/board/freescale/mx51evk/mx51evk.c 
> b/board/freescale/mx51evk/mx51evk.c
> index a88ff8f..9e8a02e 100644
> --- a/board/freescale/mx51evk/mx51evk.c
> +++ b/board/freescale/mx51evk/mx51evk.c
> @@ -15,6 +15,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/board/freescale/mx53loco/mx53loco.c 
> b/board/freescale/mx53loco/mx53loco.c
> index ea36603..db0e2fb 100644
> --- a/board/freescale/mx53loco/mx53loco.c
> +++ b/board/freescale/mx53loco/mx53loco.c
> @@ -17,6 +17,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c 
> b/board/freescale/mx6sabreauto/mx6sabreauto.c
> index 15ca029..bdeb5f7 100644
> --- a/board/freescale/mx6sabreauto/mx6sabreauto.c
> +++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
> @@ -24,6 +24,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
> b/board/freescale/mx6sabresd/mx6sabresd.c
> index 5b50bc8..0d31235 100644
> --- a/board/freescale/mx6sabresd/mx6sabresd.c
> +++ b/board/freescale/mx6sabresd/mx6sabresd.c
> @@ -25,6 +25,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include "../common/pfuze.h"
> diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c
> index c7df4ce..2e8f394 100644
> --- a/board/ge/bx50v3/bx50v3.c
> +++ b/board/ge/bx50v3/bx50v3.c
> @@ -25,6 +25,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include "vpd_reader.h"
> diff --git a/board/logicpd/imx6/imx6logic.c b/board/logicpd/imx6/imx6logic.c
> index 78fc546..1f3e378 100644
> --- a/board/logicpd/imx6/imx6logic.c
> +++ b/board/logicpd/imx6/imx6logic.c
> @@ -11,6 +11,7 @@
>  
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #incl

Re: [U-Boot] [PATCH v2] imx: sys_proto: Add a prototype for board_mmc_get_env_dev()

2017-10-02 Thread Stefano Babic
On 21/09/2017 20:10, Diego Dorta wrote:
> When compiling with W=1 the following warning is observed:
> 
> board/freescale/mx6sabresd/mx6sabresd.c:266:5: warning:
> no previous prototype for ‘board_mmc_get_env_dev’
> [-Wmissing-prototypes] int board_mmc_get_env_dev(int devno)
> 
> Remove this warning by adding the function prototype into sys_proto.h file.
> 
> Signed-off-by: Diego Dorta 
> ---
> Changes since v1:
> - Add 'mmc' prefix
> - Change function prototype to sys_proto.h
> - Update commit log accordingly
> 
>  arch/arm/include/asm/mach-imx/sys_proto.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h 
> b/arch/arm/include/asm/mach-imx/sys_proto.h
> index 970c4ca..7036343 100644
> --- a/arch/arm/include/asm/mach-imx/sys_proto.h
> +++ b/arch/arm/include/asm/mach-imx/sys_proto.h
> @@ -107,6 +107,8 @@ void init_aips(void);
>  void init_src(void);
>  void imx_set_wdog_powerdown(bool enable);
>  
> +int board_mmc_get_env_dev(int devno);
> +
>  /*
>   * Initializes on-chip ethernet controllers.
>   * to override, implement board_eth_init()
> 
Applied to u-boot-imx, -master, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH 04/14] arm: socfpga: stratix10: Add Reset Manager driver for Stratix10 SoC

2017-10-02 Thread Dinh Nguyen
On Fri, Sep 29, 2017 at 7:53 AM, See, Chin Liang
 wrote:
> On Tue, 2017-09-26 at 17:08 -0500, Dinh Nguyen wrote:
>> On Tue, Sep 19, 2017 at 4:22 AM,   wrote:
>> >
>> > From: Chin Liang See 
>> >
>> > Add Reset Manager driver support for Stratix SoC
>> >
>> > Signed-off-by: Chin Liang See 
>> > ---
>> >  arch/arm/mach-socfpga/Makefile |   1 +
>> >  arch/arm/mach-socfpga/include/mach/reset_manager.h |   2 +
>> >  .../mach-socfpga/include/mach/reset_manager_s10.h  | 116
>> > +
>> >  arch/arm/mach-socfpga/reset_manager.c  |   5 +
>> >  arch/arm/mach-socfpga/reset_manager_s10.c  | 140
>> > +
>> I don't see why you need to add a new file for S10? The functionality
>> between
>> Gen 5 and Stratix10 is identical for the reset manager.
>
> Not really, they have same functions name but sequences are difference
> due to diff interconnect technology. Hence, try to avoid too much #if
> #else
>

How so? I'm able to re-use the same driver for Linux on the Stratix10.

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


Re: [U-Boot] [PATCH 4/4] mx6sabresd: Include header file

2017-10-02 Thread Stefano Babic
On 27/09/2017 18:12, Diego Dorta wrote:
> When compiling with W=1 the following warning is observed:
> 
> board/freescale/mx6sabresd/mx6sabresd.c:586:5: warning: no previous prototype 
> for ‘board_ehci_hcd_init’ [-Wmissing-prototypes] int board_ehci_hcd_init(int 
> port)
> 
> Remove this warning by including .
> 
> Signed-off-by: Diego Dorta 
> ---
>  board/freescale/mx6sabresd/mx6sabresd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
> b/board/freescale/mx6sabresd/mx6sabresd.c
> index 0d31235..6c9524d 100644
> --- a/board/freescale/mx6sabresd/mx6sabresd.c
> +++ b/board/freescale/mx6sabresd/mx6sabresd.c
> @@ -30,6 +30,7 @@
>  #include 
>  #include "../common/pfuze.h"
>  #include 
> +#include 
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> 
Applied to u-boot-imx, -master, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH 2/4] mx6sabresd: Include header file

2017-10-02 Thread Stefano Babic
On 27/09/2017 18:12, Diego Dorta wrote:
> When compiling with W=1 the following warning is observed:
> 
> board/freescale/mx6sabresd/mx6sabresd.c:680:5: warning: no previous prototype 
> for ‘board_spi_cs_gpio’ [-Wmissing-prototypes] int board_spi_cs_gpio(unsigned 
> bus, unsigned cs)
> 
> Remove this warning by including .
> 
> Signed-off-by: Diego Dorta 
> ---
>  board/freescale/mx6sabresd/mx6sabresd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/board/freescale/mx6sabresd/mx6sabresd.c 
> b/board/freescale/mx6sabresd/mx6sabresd.c
> index 6c9524d..c494500 100644
> --- a/board/freescale/mx6sabresd/mx6sabresd.c
> +++ b/board/freescale/mx6sabresd/mx6sabresd.c
> @@ -10,6 +10,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> 

Applied to u-boot-imx, -master, thanks !

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


Re: [U-Boot] [PATCH 3/4] usb: ehci-ci: Add a prototype for board_ehci_power()

2017-10-02 Thread Stefano Babic
On 27/09/2017 18:12, Diego Dorta wrote:
> When compiling with W=1 the following warning is observed:
> 
> board/freescale/mx6sabresd/mx6sabresd.c:601:5: warning: no previous prototype 
> for ‘board_ehci_power’ [-Wmissing-prototypes] int board_ehci_power(int port, 
> int on)
> 
> Remove this warning by adding the function prototype into usb/ehci-ci.h file.
> 
> Signed-off-by: Diego Dorta 
> ---
>  include/usb/ehci-ci.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/usb/ehci-ci.h b/include/usb/ehci-ci.h
> index cd3eb47..8c9f3cd 100644
> --- a/include/usb/ehci-ci.h
> +++ b/include/usb/ehci-ci.h
> @@ -280,6 +280,7 @@ struct usb_ehci {
>  int usb_phy_mode(int port);
>  /* Board-specific initialization */
>  int board_ehci_hcd_init(int port);
> +int board_ehci_power(int port, int on);
>  int board_usb_phy_mode(int port);
>  
>  #endif /* _EHCI_CI_H */
> 
Applied to u-boot-imx, -master, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH] mx7ulp_evk: Move CONFIG_CMD_BOOTZ to Kconfig

2017-10-02 Thread Stefano Babic
On 27/09/2017 20:00, Fabio Estevam wrote:
> CONFIG_CMD_BOOTZ symbol does not work in board config file
> anymore, so fix this by moving it to Kconfig.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  configs/mx7ulp_evk_defconfig | 1 +
>  include/configs/mx7ulp_evk.h | 1 -
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configs/mx7ulp_evk_defconfig b/configs/mx7ulp_evk_defconfig
> index d630113..0470fbd 100644
> --- a/configs/mx7ulp_evk_defconfig
> +++ b/configs/mx7ulp_evk_defconfig
> @@ -4,6 +4,7 @@ CONFIG_TARGET_MX7ULP_EVK=y
>  CONFIG_DEFAULT_DEVICE_TREE="imx7ulp-evk"
>  CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx7ulp_evk/imximage.cfg"
>  CONFIG_HUSH_PARSER=y
> +CONFIG_CMD_BOOTZ=y
>  CONFIG_CMD_GPIO=y
>  CONFIG_CMD_I2C=y
>  CONFIG_CMD_MMC=y
> diff --git a/include/configs/mx7ulp_evk.h b/include/configs/mx7ulp_evk.h
> index a7992ea..56d74e9 100644
> --- a/include/configs/mx7ulp_evk.h
> +++ b/include/configs/mx7ulp_evk.h
> @@ -90,7 +90,6 @@
>  #define PHYS_SDRAM_SIZE  SZ_1G
>  #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM
>  #define CONFIG_SYS_SDRAM_BASEPHYS_SDRAM
> -#define CONFIG_CMD_BOOTZ
>  
>  #define CONFIG_LOADADDR 0x6080
>  
> 
Applied to u-boot-imx, -master, thanks !

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH 1/4] mx6: soc: Include header file

2017-10-02 Thread Stefano Babic
On 27/09/2017 18:12, Diego Dorta wrote:
> When compiling with W=1 the following warning is observed:
> 
> arch/arm/mach-imx/mx6/soc.c:213:12: warning: no previous prototype for 
> ‘get_board_rev’ [-Wmissing-prototypes] u32 __weak get_board_rev(void)
> 
> Fix the build warning by including .
> 
> Signed-off-by: Diego Dorta 
> ---
>  arch/arm/mach-imx/mx6/soc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
> index b724668..ad72c12 100644
> --- a/arch/arm/mach-imx/mx6/soc.c
> +++ b/arch/arm/mach-imx/mx6/soc.c
> @@ -13,6 +13,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> 

Applied to u-boot-imx, -master, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH V2] imx: mx7: Add support for USB and normal boot modes

2017-10-02 Thread Eric Nelson

Hi Stefano,

On 10/02/2017 06:21 AM, Stefano Babic wrote:

On 31/08/2017 00:13, Eric Nelson wrote:

This adds support for two additional boot modes on the i.MX7D SoC, which
is most useful when doing U-Boot development on this chip.

1. "bmode usb" can be used to force the ROM boot loader's serial
2. "bmode normal" can be used to revert to the normal boot mode
as specified by fuses and BOOT_MODE pins

Signed-off-by: Eric Nelson 
---
V2 adds "normal" mode as suggested by Troy Kisky
  arch/arm/mach-imx/mx7/soc.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c
index 87bf105..15be42a 100644
--- a/arch/arm/mach-imx/mx7/soc.c
+++ b/arch/arm/mach-imx/mx7/soc.c
@@ -372,6 +372,9 @@ void set_wdog_reset(struct wdog_regs *wdog)
   * to SBMR1, which will determine the boot device.
   */
  const struct boot_mode soc_boot_modes[] = {
+   {"normal",MAKE_CFGVAL(0x00, 0x00, 0x00, 0x00)},
+   {"usb",   MAKE_CFGVAL(0x01, 0x00, 0x00, 0x00)},
+
{"ecspi1:0",  MAKE_CFGVAL(0x00, 0x60, 0x00, 0x00)},
{"ecspi1:1",  MAKE_CFGVAL(0x40, 0x62, 0x00, 0x00)},
{"ecspi1:2",  MAKE_CFGVAL(0x80, 0x64, 0x00, 0x00)},



Sorry, it was for a long time in the queue - discussion in thread is
spreading away from the original review (I had errouneosly set it to
Changes requested).

Applied to u-boot-imx, -master, thanks !



Sorry, but we rejected this patch (because it doesn't work).

https://patchwork.ozlabs.org/patch/807934/

Regards,


Eric

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


Re: [U-Boot] [PATCH 3/4] imx: mx7: SPL support for i.MX7

2017-10-02 Thread Stefano Babic
Hi Uri,

On 24/09/2017 15:32, Fabio Estevam wrote:
> Hi Uri,
> 
> On Sun, Sep 24, 2017 at 3:00 AM, Uri Mashiach
>  wrote:
>> Add configuration file and spl_boot_device function for the i.MX7 SPL.
>>
>> Signed-off-by: Uri Mashiach 
> 
> Thanks for working on this!
> 
> I will test your series and will try to convert imx7d-sabresd to SPL.
> 

It looks like that at least a define is missing - by applying the patch
and testing, I get the error:

+board/compulab/cl-som-imx7/cl-som-imx7.c: In function
'cl_som_imx7_setup_fec':
+board/compulab/cl-som-imx7/cl-som-imx7.c:231:15: error: 'ENET_125MHz'
undeclared (first use in this function)


In fact, ENET_125MHz is not definded anywhere in U-Boot. Could you
please check and fix this ?

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH 3/4] imx: mx7: SPL support for i.MX7

2017-10-02 Thread Otavio Salvador
On Mon, Oct 2, 2017 at 11:22 AM, Stefano Babic  wrote:
> Hi Uri,
>
> On 24/09/2017 15:32, Fabio Estevam wrote:
>> Hi Uri,
>>
>> On Sun, Sep 24, 2017 at 3:00 AM, Uri Mashiach
>>  wrote:
>>> Add configuration file and spl_boot_device function for the i.MX7 SPL.
>>>
>>> Signed-off-by: Uri Mashiach 
>>
>> Thanks for working on this!
>>
>> I will test your series and will try to convert imx7d-sabresd to SPL.
>>
>
> It looks like that at least a define is missing - by applying the patch
> and testing, I get the error:
>
> +board/compulab/cl-som-imx7/cl-som-imx7.c: In function
> 'cl_som_imx7_setup_fec':
> +board/compulab/cl-som-imx7/cl-som-imx7.c:231:15: error: 'ENET_125MHz'
> undeclared (first use in this function)
>
>
> In fact, ENET_125MHz is not definded anywhere in U-Boot. Could you
> please check and fix this ?

It is defined but now it is all upper case. Eric did rename it.

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 3/4] imx: mx7: SPL support for i.MX7

2017-10-02 Thread Fabio Estevam
Hi Stefano,

On Mon, Oct 2, 2017 at 11:22 AM, Stefano Babic  wrote:

> It looks like that at least a define is missing - by applying the patch
> and testing, I get the error:
>
> +board/compulab/cl-som-imx7/cl-som-imx7.c: In function
> 'cl_som_imx7_setup_fec':
> +board/compulab/cl-som-imx7/cl-som-imx7.c:231:15: error: 'ENET_125MHz'
> undeclared (first use in this function)
>
>
> In fact, ENET_125MHz is not definded anywhere in U-Boot. Could you
> please check and fix this ?

This define has changed since: https://patchwork.ozlabs.org/patch/807947/

It is ENET_125MHZ now.

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


Re: [U-Boot] [PATCH V2] imx: mx7: Add support for USB and normal boot modes

2017-10-02 Thread Stefano Babic
On 02/10/2017 16:19, Eric Nelson wrote:
> Hi Stefano,
> 
> On 10/02/2017 06:21 AM, Stefano Babic wrote:
>> On 31/08/2017 00:13, Eric Nelson wrote:
>>> This adds support for two additional boot modes on the i.MX7D SoC, which
>>> is most useful when doing U-Boot development on this chip.
>>>
>>> 1. "bmode usb" can be used to force the ROM boot loader's serial
>>> 2. "bmode normal" can be used to revert to the normal boot mode
>>>     as specified by fuses and BOOT_MODE pins
>>>
>>> Signed-off-by: Eric Nelson 
>>> ---
>>> V2 adds "normal" mode as suggested by Troy Kisky
>>>   arch/arm/mach-imx/mx7/soc.c | 3 +++
>>>   1 file changed, 3 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c
>>> index 87bf105..15be42a 100644
>>> --- a/arch/arm/mach-imx/mx7/soc.c
>>> +++ b/arch/arm/mach-imx/mx7/soc.c
>>> @@ -372,6 +372,9 @@ void set_wdog_reset(struct wdog_regs *wdog)
>>>    * to SBMR1, which will determine the boot device.
>>>    */
>>>   const struct boot_mode soc_boot_modes[] = {
>>> +    {"normal",    MAKE_CFGVAL(0x00, 0x00, 0x00, 0x00)},
>>> +    {"usb",    MAKE_CFGVAL(0x01, 0x00, 0x00, 0x00)},
>>> +
>>>   {"ecspi1:0",    MAKE_CFGVAL(0x00, 0x60, 0x00, 0x00)},
>>>   {"ecspi1:1",    MAKE_CFGVAL(0x40, 0x62, 0x00, 0x00)},
>>>   {"ecspi1:2",    MAKE_CFGVAL(0x80, 0x64, 0x00, 0x00)},
>>>
>>
>> Sorry, it was for a long time in the queue - discussion in thread is
>> spreading away from the original review (I had errouneosly set it to
>> Changes requested).
>>
>> Applied to u-boot-imx, -master, thanks !
>>
> 
> Sorry, but we rejected this patch (because it doesn't work).
> 
> https://patchwork.ozlabs.org/patch/807934/

Thanks, I have not seen it - I drop it.

Best regards,
Stefano



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


Re: [U-Boot] [PATCH 3/4] imx: mx7: SPL support for i.MX7

2017-10-02 Thread Uri Mashiach

Hi Stefano,

On 10/02/2017 05:22 PM, Stefano Babic wrote:

Hi Uri,

On 24/09/2017 15:32, Fabio Estevam wrote:

Hi Uri,

On Sun, Sep 24, 2017 at 3:00 AM, Uri Mashiach
 wrote:

Add configuration file and spl_boot_device function for the i.MX7 SPL.

Signed-off-by: Uri Mashiach 


Thanks for working on this!

I will test your series and will try to convert imx7d-sabresd to SPL.



It looks like that at least a define is missing - by applying the patch
and testing, I get the error:

+board/compulab/cl-som-imx7/cl-som-imx7.c: In function
'cl_som_imx7_setup_fec':
+board/compulab/cl-som-imx7/cl-som-imx7.c:231:15: error: 'ENET_125MHz'
undeclared (first use in this function)


In fact, ENET_125MHz is not definded anywhere in U-Boot. Could you
please check and fix this ?

Best regards,
Stefano Babic




The patch is compiling in u-boot-imx/master.
Should it be based on mainline u-boot?

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


Re: [U-Boot] [PATCH 3/4] imx: mx7: SPL support for i.MX7

2017-10-02 Thread Stefano Babic
Hi Otavio, Fabio,

On 02/10/2017 16:25, Otavio Salvador wrote:
> On Mon, Oct 2, 2017 at 11:22 AM, Stefano Babic  wrote:
>> Hi Uri,
>>
>> On 24/09/2017 15:32, Fabio Estevam wrote:
>>> Hi Uri,
>>>
>>> On Sun, Sep 24, 2017 at 3:00 AM, Uri Mashiach
>>>  wrote:
 Add configuration file and spl_boot_device function for the i.MX7 SPL.

 Signed-off-by: Uri Mashiach 
>>>
>>> Thanks for working on this!
>>>
>>> I will test your series and will try to convert imx7d-sabresd to SPL.
>>>
>>
>> It looks like that at least a define is missing - by applying the patch
>> and testing, I get the error:
>>
>> +board/compulab/cl-som-imx7/cl-som-imx7.c: In function
>> 'cl_som_imx7_setup_fec':
>> +board/compulab/cl-som-imx7/cl-som-imx7.c:231:15: error: 'ENET_125MHz'
>> undeclared (first use in this function)
>>
>>
>> In fact, ENET_125MHz is not definded anywhere in U-Boot. Could you
>> please check and fix this ?
> 
> It is defined but now it is all upper case. Eric did rename it.


Yes, thanks both ! It was the "Camelcase" patch, I have forgotten it.

Best regards,
Stefano

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


Re: [U-Boot] [PATCH 3/4] imx: mx7: SPL support for i.MX7

2017-10-02 Thread Stefano Babic
Hi Uri,

On 02/10/2017 16:59, Uri Mashiach wrote:
> Hi Stefano,
> 
> On 10/02/2017 05:22 PM, Stefano Babic wrote:
>> Hi Uri,
>>
>> On 24/09/2017 15:32, Fabio Estevam wrote:
>>> Hi Uri,
>>>
>>> On Sun, Sep 24, 2017 at 3:00 AM, Uri Mashiach
>>>  wrote:
 Add configuration file and spl_boot_device function for the i.MX7 SPL.

 Signed-off-by: Uri Mashiach 
>>>
>>> Thanks for working on this!
>>>
>>> I will test your series and will try to convert imx7d-sabresd to SPL.
>>>
>>
>> It looks like that at least a define is missing - by applying the patch
>> and testing, I get the error:
>>
>> +board/compulab/cl-som-imx7/cl-som-imx7.c: In function
>> 'cl_som_imx7_setup_fec':
>> +board/compulab/cl-som-imx7/cl-som-imx7.c:231:15: error: 'ENET_125MHz'
>> undeclared (first use in this function)
>>
>>
>> In fact, ENET_125MHz is not definded anywhere in U-Boot. Could you
>> please check and fix this ?
>>
>> Best regards,
>> Stefano Babic
>>
>>
> 
> The patch is compiling in u-boot-imx/master.
> Should it be based on mainline u-boot?

No, it is ok - see above, I fix the Camelcase. There is still a small
conflict in arch/arm/mach-imx/spl.c (due to other patches I am merging),
I fix this as well. If all is fine, I psuh it to the server. This
simplifies Fabio's work and someone else can help with tests.
Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH 0/4] cl-som-imx7: initial support

2017-10-02 Thread Stefano Babic
On 24/09/2017 08:00, Uri Mashiach wrote:
> This patch series adds support for CompuLab CL-SOM-iMX7, SBC-iMX7, 
> SBC-IOT-iMX7
> and IOT-GATE-iMX7.
> 
> CL-SOM-iMX7 is a miniature System-on-Module (SoM) based on
> NXP i.MX7 processor family.
> 
> SBC-iMX7 is a single board computer, implemented with the CL-SOM-iMX7 module
> and the SB-SOM-iMX7 carrier board.
> The CL-SOM-iMX7 providing most of the functions and the SB-SOM-iMX7 providing
> additional peripheral functions and connectors.
> 
> SBC-IOT-iMX7 is a internet of things single board computer, implemented with
> the CL-SOM-iMX7 module and the SB-IOT-iMX7 carrier board.
> The CL-SOM-iMX7 providing most of the functions and the SB-IOT-iMX7 providing
> additional peripheral functions and connectors.
> 
> The CL-SOM-iMX7 has the following features:
> 
> CPU:NXP (Freescale) i.MX 7Dual ARM Cortex-A7, 1GHz processor 
> (dual-core) or
> NXP (Freescale) i.MX 7Solo ARM Cortex-A7, 800MHz processor 
> (single-core)
> 
> RAM:256MB – 2GB, DDR3L-1066
> 
> Storage:SLC NAND flash, 128MB - 1GB or
> eMMC flash, 4GB - 32GB
> 
> Ethernet:   Up to 2x 10/100/1000Mbps Ethernet ports (MAC+PHY)
> 
> WiFi: 802.11b/g/n WiFi interface (TI WiLink 8 WL1801 chipset) or
> Dual-band 2x2 802.11a/b/g/n WiFi interface (TI WiLink 8 
> WL1837 chipset)
> 
> Bluetooth:  Bluetooth 4.1 BLE
> 
> Analog Audio:   Audio codec with stereo output, stereo input and microphone 
> support
> 
> Digital Audio:  I2S compliant digital audio interface, MQS audio interface
> 
> Display:Parallel 24-bit display interface, up to 1920 x 1080 @60Hz,
> LVDS, up to 1400 x 1050 @60Hz
> MIPI-DSI, 2 data lanes, up to 1400 x 1050 @60Hz
> 
> More details can be found here:
> 
> http://www.compulab.com/products/computer-on-modules/cl-som-imx7-freescale-i-mx-7-system-on-module/
> 
> http://www.compulab.com/products/sbcs/sbc-imx7-freescale-i-mx-7-single-board-computer/
> 
> http://www.compulab.com/products/sbcs/sbc-iot-imx7-nxp-i-mx-7-internet-of-things-single-board-computer/
> 
> http://www.compulab.com/products/iot-gateways/iot-gate-imx7-nxp-i-mx-7-internet-of-things-gateway/
> 
> Ilya Ledvich (1):
>   arm: imx7d: add support for Compulab cl-som-imx7
> 
> Uri Mashiach (3):
>   imx: mx7: fix the CCM_ macros
>   imx: mx7: DDR controller configuration for the i.MX7 architecture
>   imx: mx7: SPL support for i.MX7
> 
>  arch/arm/include/asm/arch-mx7/crm_regs.h  |  51 ++---
>  arch/arm/include/asm/arch-mx7/imx-regs.h  |   2 +
>  arch/arm/include/asm/arch-mx7/mx7-ddr.h   | 155 ++
>  arch/arm/include/asm/arch-mx7/sys_proto.h |   1 +
>  arch/arm/mach-imx/mx7/Kconfig |   8 +
>  arch/arm/mach-imx/mx7/Makefile|   2 +-
>  arch/arm/mach-imx/mx7/ddr.c   | 201 ++
>  arch/arm/mach-imx/spl.c   |  23 ++-
>  board/compulab/cl-som-imx7/Kconfig|  28 +++
>  board/compulab/cl-som-imx7/MAINTAINERS|   6 +
>  board/compulab/cl-som-imx7/Makefile   |  17 ++
>  board/compulab/cl-som-imx7/cl-som-imx7.c  | 331 
> ++
>  board/compulab/cl-som-imx7/common.c   |  46 +
>  board/compulab/cl-som-imx7/common.h   |  32 +++
>  board/compulab/cl-som-imx7/mux.c  | 142 +
>  board/compulab/cl-som-imx7/spl.c  | 211 +++
>  configs/cl-som-imx7_defconfig |  54 +
>  include/configs/cl-som-imx7.h | 192 +
>  include/configs/imx7_spl.h|  67 ++
>  19 files changed, 1544 insertions(+), 25 deletions(-)
>  create mode 100644 arch/arm/include/asm/arch-mx7/mx7-ddr.h
>  create mode 100644 arch/arm/mach-imx/mx7/ddr.c
>  create mode 100644 board/compulab/cl-som-imx7/Kconfig
>  create mode 100644 board/compulab/cl-som-imx7/MAINTAINERS
>  create mode 100644 board/compulab/cl-som-imx7/Makefile
>  create mode 100644 board/compulab/cl-som-imx7/cl-som-imx7.c
>  create mode 100644 board/compulab/cl-som-imx7/common.c
>  create mode 100644 board/compulab/cl-som-imx7/common.h
>  create mode 100644 board/compulab/cl-som-imx7/mux.c
>  create mode 100644 board/compulab/cl-som-imx7/spl.c
>  create mode 100644 configs/cl-som-imx7_defconfig
>  create mode 100644 include/configs/cl-som-imx7.h
>  create mode 100644 include/configs/imx7_spl.h
> 

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

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


Re: [U-Boot] Beagleboard xM boot broken due to FIT enable

2017-10-02 Thread Guillaume Gardet



Le 02/10/2017 à 15:53, Tom Rini a écrit :

On Mon, Oct 02, 2017 at 03:24:01PM +0200, Guillaume Gardet wrote:

Hi,

commit 46f9ef18461609064a1ffbc3f61dc027ec76b3ff
Author: Andrew F. Davis 
Date:   Fri Apr 21 10:01:28 2017 -0500

     Kconfig: Enable FIT support by default for TI platforms

     Almost all TI defconfigs enable this already, add this as a default
     and remove the explicit assignment.

     Signed-off-by: Andrew F. Davis 
     Reviewed-by: Tom Rini 

broke boot on Beagleboard xM. I mean the board hangs after:
     OMAP3630/3730-GP ES1.1, CPU-OPP2, L3-200MHz, Max CPU Clock 800 MHz
     OMAP3 Beagle board + LPDDR/NAND
     I2C:   ready
     DRAM:  512 MiB


To get back the board booting, I need to manually disable FIT (CONFIG_FIT) 
_and_ disable SHA256 hash support (CONFIG_SHA256).

If I enable FIT without sha256 : it breaks boot.
If I enable sha256 without FIT : it breaks boot.

Any idea what could cause this?

As a workaround we could disable it in the omap3_beagle_defconfig but I guess 
it would be better to fix it instead of workaround it, since other boards may 
also be affected.

Which Beagleboard xM rev do you have?  And how are you booting (FAT or
raw) ?  Mine, FAT booting, is working currently and is part of my
automated test farm, thanks!


This is a Beagleboard xM rev. B.
We use raw booting (instead of default FAT booting).

Guillaume

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


Re: [U-Boot] Beagleboard xM boot broken due to FIT enable

2017-10-02 Thread Tom Rini
On Mon, Oct 02, 2017 at 05:55:27PM +0200, Guillaume Gardet wrote:
> 
> 
> Le 02/10/2017 à 15:53, Tom Rini a écrit :
> >On Mon, Oct 02, 2017 at 03:24:01PM +0200, Guillaume Gardet wrote:
> >>Hi,
> >>
> >>commit 46f9ef18461609064a1ffbc3f61dc027ec76b3ff
> >>Author: Andrew F. Davis 
> >>Date:   Fri Apr 21 10:01:28 2017 -0500
> >>
> >>     Kconfig: Enable FIT support by default for TI platforms
> >>
> >>     Almost all TI defconfigs enable this already, add this as a default
> >>     and remove the explicit assignment.
> >>
> >>     Signed-off-by: Andrew F. Davis 
> >>     Reviewed-by: Tom Rini 
> >>
> >>broke boot on Beagleboard xM. I mean the board hangs after:
> >>     OMAP3630/3730-GP ES1.1, CPU-OPP2, L3-200MHz, Max CPU Clock 800 MHz
> >>     OMAP3 Beagle board + LPDDR/NAND
> >>     I2C:   ready
> >>     DRAM:  512 MiB
> >>
> >>
> >>To get back the board booting, I need to manually disable FIT (CONFIG_FIT) 
> >>_and_ disable SHA256 hash support (CONFIG_SHA256).
> >>
> >>If I enable FIT without sha256 : it breaks boot.
> >>If I enable sha256 without FIT : it breaks boot.
> >>
> >>Any idea what could cause this?
> >>
> >>As a workaround we could disable it in the omap3_beagle_defconfig but I 
> >>guess it would be better to fix it instead of workaround it, since other 
> >>boards may also be affected.
> >Which Beagleboard xM rev do you have?  And how are you booting (FAT or
> >raw) ?  Mine, FAT booting, is working currently and is part of my
> >automated test farm, thanks!
> 
> This is a Beagleboard xM rev. B.
> We use raw booting (instead of default FAT booting).

OK.  Can you test FAT booting?  Both should work, but I have an idea at
least on RAW, but I'd like to rule out anything else other than size
changes.   Thanks!

-- 
Tom


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


Re: [U-Boot] Beagleboard xM boot broken due to FIT enable

2017-10-02 Thread Guillaume Gardet



Le 02/10/2017 à 17:58, Tom Rini a écrit :

On Mon, Oct 02, 2017 at 05:55:27PM +0200, Guillaume Gardet wrote:


Le 02/10/2017 à 15:53, Tom Rini a écrit :

On Mon, Oct 02, 2017 at 03:24:01PM +0200, Guillaume Gardet wrote:

Hi,

commit 46f9ef18461609064a1ffbc3f61dc027ec76b3ff
Author: Andrew F. Davis 
Date:   Fri Apr 21 10:01:28 2017 -0500

     Kconfig: Enable FIT support by default for TI platforms

     Almost all TI defconfigs enable this already, add this as a default
     and remove the explicit assignment.

     Signed-off-by: Andrew F. Davis 
     Reviewed-by: Tom Rini 

broke boot on Beagleboard xM. I mean the board hangs after:
     OMAP3630/3730-GP ES1.1, CPU-OPP2, L3-200MHz, Max CPU Clock 800 MHz
     OMAP3 Beagle board + LPDDR/NAND
     I2C:   ready
     DRAM:  512 MiB


To get back the board booting, I need to manually disable FIT (CONFIG_FIT) 
_and_ disable SHA256 hash support (CONFIG_SHA256).

If I enable FIT without sha256 : it breaks boot.
If I enable sha256 without FIT : it breaks boot.

Any idea what could cause this?

As a workaround we could disable it in the omap3_beagle_defconfig but I guess 
it would be better to fix it instead of workaround it, since other boards may 
also be affected.

Which Beagleboard xM rev do you have?  And how are you booting (FAT or
raw) ?  Mine, FAT booting, is working currently and is part of my
automated test farm, thanks!

This is a Beagleboard xM rev. B.
We use raw booting (instead of default FAT booting).

OK.  Can you test FAT booting?  Both should work, but I have an idea at
least on RAW, but I'd like to rule out anything else other than size
changes.   Thanks!


Indeed, if u-boot.img is on FAT partition, it boots properly!

Guillaume

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


[U-Boot] Boot failure - Latest master and Raspberry Pi

2017-10-02 Thread Duncan Hare
Previous I've added these two definitions to use u-boot witht he 
raspberry pi, into include/configs/rpi.h



#define CONFIG_SYS_MAXARGS  32  /* dch doubled from 16    */
#define CONFIG_SYS_BARGSIZE 1540    /* dch added, default 512 */

However on the most recent master, the raspberry pi fails to boot with 
or without these definitions.


Two questions:

1. How to I determine where the pi's use of u-boot is failing? I don't 
even get the 2 second countdown before u-boot runs bootcmd.


2. Are these constants still effective in the current master? If not are 
there replacements?


Thanks

Duncan



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


Re: [U-Boot] [PULL] u-boot-usb/master

2017-10-02 Thread Tom Rini
On Sun, Oct 01, 2017 at 08:41:36PM +0200, Marek Vasut wrote:

> The following changes since commit 6e9b109aa9bcdd094e77da9fb03de8b44da8eb9d:
> 
>   Merge git://git.denx.de/u-boot-usb (2017-09-27 09:39:48 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-usb.git master
> 
> for you to fetch changes up to dc04b35ef2c8c04cb362758ec46348ef3f15:
> 
>   usb: dwc3: add UniPhier specific glue layer (2017-10-01 16:32:55 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v3] sun50i: h5: Add NanoPi Neo Plus2 DT initial support

2017-10-02 Thread Maxime Ripard
On Sun, Oct 01, 2017 at 05:34:55PM +, Antony Antony wrote:
> On Mon, Sep 25, 2017 at 01:12:23PM +0200, Maxime Ripard wrote:
> > On Sat, Sep 23, 2017 at 05:59:15PM +, Antony Antony wrote:
> > > Add initial DT for NanoPi NEO Plus2 by FriendlyARM
> > > - Allwinner quad core H5 Cortex A53 with an ARM Mali-450MP GPU
> > > - 1 GB DDR3 RAM
> > > - 8GB eMMC flash (Samsung KLM8G1WEPD-B031)
> > > - micro SD card slot
> > > - Gigabit Ethernet (external RTL8211E-VB-CG chip)
> > > - 802.11 b/g/n WiFi, Bluetooth 4.0 (Ampak AP6212A module)
> > > - 2x USB 2.0 host ports
> > > 
> > > Signed-off-by: Antony Antony 
> > > ---
> > > Changes v1->v2
> > >  removed memory {}, compatible ="allwinner,sun5i-a13-mmc"
> > >  remove CONFIG_SPL_SPI_FLASH_SUPPORT=y and CONFIG_SPL_SPI_SUNXI=y (no SPI)
> > >  remove CONFIG_SD_BOOT=y
> > > Changes v2->v3
> > >  removed compatible ="allwinner,sun50i-a64-mmc"
> > > ---
> > >  arch/arm/dts/Makefile   |   1 +
> > >  arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts | 107 
> > > 
> > >  configs/nanopi_neo_plus2_defconfig  |  18 +
> > >  3 files changed, 126 insertions(+)
> > >  create mode 100644 arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
> > >  create mode 100644 configs/nanopi_neo_plus2_defconfig
> > > 
> > > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> > > index fee4680..295a675 100644
> > > --- a/arch/arm/dts/Makefile
> > > +++ b/arch/arm/dts/Makefile
> > > @@ -333,6 +333,7 @@ dtb-$(CONFIG_MACH_SUN8I_V3S) += \
> > >   sun8i-v3s-licheepi-zero.dtb
> > >  dtb-$(CONFIG_MACH_SUN50I_H5) += \
> > >   sun50i-h5-nanopi-neo2.dtb \
> > > + sun50i-h5-nanopi-neo-plus2.dtb \
> > >   sun50i-h5-orangepi-pc2.dtb \
> > >   sun50i-h5-orangepi-prime.dtb \
> > >   sun50i-h5-orangepi-zero-plus2.dtb
> > > diff --git a/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts 
> > > b/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
> > > new file mode 100644
> > > index 000..8ac098e
> > > --- /dev/null
> > > +++ b/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
> > > @@ -0,0 +1,107 @@
> > > +/*
> > > + * Copyright (C) 2017 Antony Antony 
> > > + * Copyright (c) 2016 ARM Ltd.
> > > + *
> > > + * This file is dual-licensed: you can use it either under the terms
> > > + * of the GPL or the X11 license, at your option. Note that this dual
> > > + * licensing only applies to this file, and not this project as a
> > > + * whole.
> > > + *
> > > + *  a) This library is free software; you can redistribute it and/or
> > > + * modify it under the terms of the GNU General Public License as
> > > + * published by the Free Software Foundation; either version 2 of the
> > > + * License, or (at your option) any later version.
> > > + *
> > > + * This library is distributed in the hope that it will be useful,
> > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > > + * GNU General Public License for more details.
> > > + *
> > > + * Or, alternatively,
> > > + *
> > > + *  b) Permission is hereby granted, free of charge, to any person
> > > + * obtaining a copy of this software and associated documentation
> > > + * files (the "Software"), to deal in the Software without
> > > + * restriction, including without limitation the rights to use,
> > > + * copy, modify, merge, publish, distribute, sublicense, and/or
> > > + * sell copies of the Software, and to permit persons to whom the
> > > + * Software is furnished to do so, subject to the following
> > > + * conditions:
> > > + *
> > > + * The above copyright notice and this permission notice shall be
> > > + * included in all copies or substantial portions of the Software.
> > > + *
> > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> > > + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> > > + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> > > + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> > > + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> > > + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> > > + * OTHER DEALINGS IN THE SOFTWARE.
> > > + */
> > > +
> > > +/dts-v1/;
> > > +
> > > +#include "sun50i-h5.dtsi"
> > > +
> > > +#include 
> > > +
> > > +/ {
> > > + model = "FriendlyARM NanoPi NEO Plus 2";
> > > + compatible = "friendlyarm,nanopi-neo-plus2", "allwinner,sun50i-h5";
> > > +
> > > + aliases {
> > > + serial0 = &uart0;
> > > + };
> > > +
> > > + chosen {
> > > + stdout-path = "serial0:115200n8";
> > > + };
> > > +
> > > + reg_vcc3v3: vcc3v3 {
> > > + compatible = "regulator-fixed";
> > > + regulator-name = "vcc3v3";
> > > + regulator-min-microvolt = <330>;
> > > + regulator-max-microvolt = <330

Re: [U-Boot] [PATCH v3 02/21] part: extract MBR signature from partitions

2017-10-02 Thread Fabio Estevam
On Wed, Sep 13, 2017 at 7:05 PM, Rob Clark  wrote:
> From: Peter Jones 
>
> EFI client programs need the signature information from the partition
> table to determine the disk a partition is on, so we need to fill that
> in here.
>
> Signed-off-by: Peter Jones 
> [separated from efi_loader part, and fixed build-errors for non-
>  CONFIG_EFI_PARTITION case]
> Signed-off-by: Rob Clark 

This is commit ff98cb90514d9b78 in mainline now and breaks all mx6 SPL boots:

U-Boot SPL 2017.09-00221-g0d6ab32 (Oct 02 2017 - 15:13:19)
Trying to boot from MMC1
(hangs here)

Does anyone know how to fix this problem?
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 1/2] wandboard: Add support for the latest revd1 revision

2017-10-02 Thread Fabio Estevam
From: Fabio Estevam 

Latest wandboard hardware revision is revd1, which brings the following
new features:

- PFUZE100 PMIC
- AR8035 Ethernet PHY
- Upgrade Wifi/BT chip to BCM4339/BCM43430.

The detection mechanism is to probe the PMIC and when it is
found, then the revision of the board is revd1.

As the detection is done via PMIC, we need to print the board version
at a later stage via CONFIG_DISPLAY_BOARDINFO_LATE and also need
to disable CONFIG_DISPLAY_BOARDINFO, which is done much earlier.

Make the necessary adjustments for the AR8035 PHY to work on revd1.

Based on Richard Hu's work from Technexion's U-Boot tree.

Signed-off-by: Fabio Estevam 
---
Changes since v3:
- Rebased against latest u-boot-imx

 board/wandboard/wandboard.c | 108 ++--
 configs/wandboard_defconfig |   1 +
 include/configs/wandboard.h |  11 +
 3 files changed, 115 insertions(+), 5 deletions(-)

diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
index dde4988..6d2609c 100644
--- a/board/wandboard/wandboard.c
+++ b/board/wandboard/wandboard.c
@@ -30,6 +30,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -51,8 +53,11 @@ DECLARE_GLOBAL_DATA_PTR;
 #define USDHC1_CD_GPIO IMX_GPIO_NR(1, 2)
 #define USDHC3_CD_GPIO IMX_GPIO_NR(3, 9)
 #define ETH_PHY_RESET  IMX_GPIO_NR(3, 29)
+#define ETH_PHY_AR8035_POWER   IMX_GPIO_NR(7, 13)
 #define REV_DETECTION  IMX_GPIO_NR(2, 28)
 
+static bool with_pmic;
+
 int dram_init(void)
 {
gd->ram_size = imx_ddr_size();
@@ -107,6 +112,11 @@ static iomux_v3_cfg_t const enet_pads[] = {
IOMUX_PADS(PAD_EIM_D29__GPIO3_IO29| MUX_PAD_CTRL(NO_PAD_CTRL)),
 };
 
+static iomux_v3_cfg_t const enet_ar8035_power_pads[] = {
+   /* AR8035 POWER */
+   IOMUX_PADS(PAD_GPIO_18__GPIO7_IO13| MUX_PAD_CTRL(NO_PAD_CTRL)),
+};
+
 static iomux_v3_cfg_t const rev_detection_pad[] = {
IOMUX_PADS(PAD_EIM_EB0__GPIO2_IO28  | MUX_PAD_CTRL(NO_PAD_CTRL)),
 };
@@ -120,6 +130,14 @@ static void setup_iomux_enet(void)
 {
SETUP_IOMUX_PADS(enet_pads);
 
+   if (with_pmic) {
+   SETUP_IOMUX_PADS(enet_ar8035_power_pads);
+   /* enable AR8035 POWER */
+   gpio_direction_output(ETH_PHY_AR8035_POWER, 0);
+   }
+   /* wait until 3.3V of PHY and clock become stable */
+   mdelay(10);
+
/* Reset AR8031 PHY */
gpio_direction_output(ETH_PHY_RESET, 0);
mdelay(10);
@@ -192,6 +210,7 @@ int board_mmc_init(bd_t *bis)
 static int ar8031_phy_fixup(struct phy_device *phydev)
 {
unsigned short val;
+   int mask;
 
/* To enable AR8031 ouput a 125MHz clk from CLK_25M */
phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x7);
@@ -199,7 +218,12 @@ static int ar8031_phy_fixup(struct phy_device *phydev)
phy_write(phydev, MDIO_DEVAD_NONE, 0xd, 0x4007);
 
val = phy_read(phydev, MDIO_DEVAD_NONE, 0xe);
-   val &= 0xffe3;
+   if (with_pmic)
+   mask = 0xffe7;  /* AR8035 */
+   else
+   mask = 0xffe3;  /* AR8031 */
+
+   val &= mask;
val |= 0x18;
phy_write(phydev, MDIO_DEVAD_NONE, 0xe, val);
 
@@ -257,6 +281,40 @@ struct i2c_pads_info mx6dl_i2c2_pad_info = {
}
 };
 
+struct i2c_pads_info mx6q_i2c3_pad_info = {
+   .scl = {
+   .i2c_mode = MX6Q_PAD_GPIO_5__I2C3_SCL
+   | MUX_PAD_CTRL(I2C_PAD_CTRL),
+   .gpio_mode = MX6Q_PAD_GPIO_5__GPIO1_IO05
+   | MUX_PAD_CTRL(I2C_PAD_CTRL),
+   .gp = IMX_GPIO_NR(1, 5)
+   },
+   .sda = {
+   .i2c_mode = MX6Q_PAD_GPIO_16__I2C3_SDA
+   | MUX_PAD_CTRL(I2C_PAD_CTRL),
+   .gpio_mode = MX6Q_PAD_GPIO_16__GPIO7_IO11
+   | MUX_PAD_CTRL(I2C_PAD_CTRL),
+   .gp = IMX_GPIO_NR(7, 11)
+   }
+};
+
+struct i2c_pads_info mx6dl_i2c3_pad_info = {
+   .scl = {
+   .i2c_mode = MX6DL_PAD_GPIO_5__I2C3_SCL
+   | MUX_PAD_CTRL(I2C_PAD_CTRL),
+   .gpio_mode = MX6DL_PAD_GPIO_5__GPIO1_IO05
+   | MUX_PAD_CTRL(I2C_PAD_CTRL),
+   .gp = IMX_GPIO_NR(1, 5)
+   },
+   .sda = {
+   .i2c_mode = MX6DL_PAD_GPIO_16__I2C3_SDA
+   | MUX_PAD_CTRL(I2C_PAD_CTRL),
+   .gpio_mode = MX6DL_PAD_GPIO_16__GPIO7_IO11
+   | MUX_PAD_CTRL(I2C_PAD_CTRL),
+   .gp = IMX_GPIO_NR(7, 11)
+   }
+};
+
 static iomux_v3_cfg_t const fwadapt_7wvga_pads[] = {
IOMUX_PADS(PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK),
IOMUX_PADS(PAD_DI0_PIN2__IPU1_DI0_PIN02), /* HSync */
@@ -385,6 +443,31 @@ int board_early_init_f(void)
return 0;
 }
 
+#define PMIC_I2C_BUS   2
+
+int power_init_board(void)
+{
+   struct pmic *p;
+   u32 reg;
+
+   /* configure PFUZE100 PMIC */
+   power_pfuze100_init(PMIC_I2C_

[U-Boot] [PATCH v4 2/2] wandboard: Add support for the MX6QP variant

2017-10-02 Thread Fabio Estevam
From: Fabio Estevam 

Add support for the latest MX6QP wandboard variant.

Based on Richard Hu's work from Technexion's U-Boot tree.

Signed-off-by: Fabio Estevam 
---
Changes since v3:
- Rebased against latest u-boot-imx

 arch/arm/include/asm/arch-mx6/imx-regs.h |   3 +
 board/wandboard/spl.c| 135 ++-
 board/wandboard/wandboard.c  |   6 +-
 include/configs/wandboard.h  |   2 +
 4 files changed, 142 insertions(+), 4 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h 
b/arch/arm/include/asm/arch-mx6/imx-regs.h
index 86e2670..624ccec 100644
--- a/arch/arm/include/asm/arch-mx6/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
@@ -346,6 +346,9 @@
 #define IOMUXC_SNVS_BASE_ADDR   (AIPS3_ARB_BASE_ADDR + 0x9)
 #define SNVS_GPR_BASE_ADDR  (AIPS3_ARB_BASE_ADDR + 0x94000)
 #endif
+
+#define NOC_DDR_BASE_ADDR   (GPV0_BASE_ADDR + 0xB)
+
 /* Only for i.MX6SX */
 #define LCDIF2_BASE_ADDR(AIPS3_ARB_BASE_ADDR + 0x24000)
 #define MX6SX_LCDIF1_BASE_ADDR  (AIPS3_ARB_BASE_ADDR + 0x2)
diff --git a/board/wandboard/spl.c b/board/wandboard/spl.c
index 00c75d0..2446699 100644
--- a/board/wandboard/spl.c
+++ b/board/wandboard/spl.c
@@ -32,6 +32,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define IMX6DQ_DRIVE_STRENGTH  0x30
 #define IMX6SDL_DRIVE_STRENGTH 0x28
+#define IMX6QP_DRIVE_STRENGTH  0x28
 
 /* configure MX6Q/DUAL mmdc DDR io registers */
 static struct mx6dq_iomux_ddr_regs mx6dq_ddr_ioregs = {
@@ -260,15 +261,145 @@ static void ccgr_init(void)
writel(0x00C03F3F, &ccm->CCGR0);
writel(0x0030FC03, &ccm->CCGR1);
writel(0x0FFFC000, &ccm->CCGR2);
-   writel(0x3FF0, &ccm->CCGR3);
+   writel(0x3FF03000, &ccm->CCGR3);
writel(0x00FFF300, &ccm->CCGR4);
writel(0x0FC3, &ccm->CCGR5);
writel(0x03FF, &ccm->CCGR6);
 }
 
+static void spl_dram_init_imx6qp_lpddr3(void)
+{
+   /* DDR IO TYPE */
+   writel(0x000C, IOMUXC_BASE_ADDR + 0x798);
+   writel(0x, IOMUXC_BASE_ADDR + 0x758);
+   /* Clock */
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x588);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x594);
+   /* Address */
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x56c);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x578);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x74c);
+   /* Control */
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x57c);
+   writel(0x, IOMUXC_BASE_ADDR + 0x58c);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x59c);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x5a0);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x78c);
+   /* Data Strobe */
+   writel(0x0002, IOMUXC_BASE_ADDR + 0x750);
+
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x5a8);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x5b0);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x524);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x51c);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x518);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x50c);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x5b8);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x5c0);
+   /* Data */
+   writel(0x0002, IOMUXC_BASE_ADDR + 0x774);
+
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x784);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x788);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x794);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x79c);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x7a0);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x7a4);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x7a8);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x748);
+
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x5ac);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x5b4);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x528);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x520);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x514);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x510);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x5bc);
+   writel(IMX6QP_DRIVE_STRENGTH, IOMUXC_BASE_ADDR + 0x5c4);
+
+   /* MMDC0_MDSCR set the Configuration request bit during MMDC set up */
+   writel(0x8000, MMDC_P0_BASE_ADDR + 0x01c);
+
+   /* Calibrations - ZQ */
+   writel(0xa1390003, MMDC_P0_BASE_ADDR + 0x800);
+   /* write leveling */
+   writel(0x00060004, MMDC_P0_BASE_ADDR + 0x80c);
+   writel(0x000B0004, MMDC_P0_BASE_ADDR + 0x810);
+   writel(0x0004, MMDC_P1_BASE_ADDR + 0x80c);
+   writel(0x, MMDC_

Re: [U-Boot] [PATCH v3 02/21] part: extract MBR signature from partitions

2017-10-02 Thread Peter Robinson
On Mon, Oct 2, 2017 at 7:17 PM, Fabio Estevam  wrote:
> On Wed, Sep 13, 2017 at 7:05 PM, Rob Clark  wrote:
>> From: Peter Jones 
>>
>> EFI client programs need the signature information from the partition
>> table to determine the disk a partition is on, so we need to fill that
>> in here.
>>
>> Signed-off-by: Peter Jones 
>> [separated from efi_loader part, and fixed build-errors for non-
>>  CONFIG_EFI_PARTITION case]
>> Signed-off-by: Rob Clark 
>
> This is commit ff98cb90514d9b78 in mainline now and breaks all mx6 SPL boots:
>
> U-Boot SPL 2017.09-00221-g0d6ab32 (Oct 02 2017 - 15:13:19)
> Trying to boot from MMC1
> (hangs here)
>
> Does anyone know how to fix this problem?

That would explain what I'm seeing as we pull this patch set in to
2017.09 for EFI boot support on aarch64 platforms.

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


Re: [U-Boot] [PATCH v3 02/21] part: extract MBR signature from partitions

2017-10-02 Thread Fabio Estevam
On Mon, Oct 2, 2017 at 3:49 PM, Peter Robinson  wrote:

> That would explain what I'm seeing as we pull this patch set in to
> 2017.09 for EFI boot support on aarch64 platforms.

Locally I am applying the following hack, so that I can continue to
work on mx6 with SPL:
https://pastebin.com/MX8tK76X
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 02/21] part: extract MBR signature from partitions

2017-10-02 Thread Tom Rini
On Mon, Oct 02, 2017 at 04:02:37PM -0300, Fabio Estevam wrote:
> On Mon, Oct 2, 2017 at 3:49 PM, Peter Robinson  wrote:
> 
> > That would explain what I'm seeing as we pull this patch set in to
> > 2017.09 for EFI boot support on aarch64 platforms.
> 
> Locally I am applying the following hack, so that I can continue to
> work on mx6 with SPL:
> https://pastebin.com/MX8tK76X

FWIW, on cubox the current status is looping, and your kludge I just get
no output :(  But there may be some other problems here too as I'm
seeing some oddities as I try out SDP on it.

-- 
Tom


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


[U-Boot] [PATCH] i.mx6ul: xpress: update UART init for current board revision

2017-10-02 Thread Anatolij Gustschin
UART pinmux has been changed on the last board revision. Change
board pinmux accordingly. Console is on UART7 now, add pinmux,
base address and update console string in environment.

Signed-off-by: Anatolij Gustschin 
---
 board/ccv/xpress/xpress.c | 14 ++
 include/configs/xpress.h  |  4 ++--
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/board/ccv/xpress/xpress.c b/board/ccv/xpress/xpress.c
index b65646588a..8de2c4e6c2 100644
--- a/board/ccv/xpress/xpress.c
+++ b/board/ccv/xpress/xpress.c
@@ -108,6 +108,8 @@ int dram_init(void)
 static iomux_v3_cfg_t const uart1_pads[] = {
MX6_PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
MX6_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
+   MX6_PAD_UART1_CTS_B__UART1_DCE_CTS | MUX_PAD_CTRL(UART_PAD_CTRL),
+   MX6_PAD_UART1_RTS_B__UART1_DCE_RTS | MUX_PAD_CTRL(UART_PAD_CTRL),
 };
 
 static iomux_v3_cfg_t const uart4_pads[] = {
@@ -122,11 +124,14 @@ static iomux_v3_cfg_t const uart5_pads[] = {
MX6_PAD_GPIO1_IO08__UART5_DCE_RTS | MUX_PAD_CTRL(UART_PAD_CTRL),
 };
 
+static iomux_v3_cfg_t const uart7_pads[] = {
+   MX6_PAD_ENET2_RX_EN__UART7_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
+   MX6_PAD_ENET2_TX_DATA0__UART7_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
+};
+
 static iomux_v3_cfg_t const uart8_pads[] = {
-   MX6_PAD_ENET2_TX_DATA1__UART8_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-   MX6_PAD_ENET2_TX_EN__UART8_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-   MX6_PAD_ENET2_TX_CLK__UART8_DCE_CTS | MUX_PAD_CTRL(UART_PAD_CTRL),
-   MX6_PAD_ENET2_RX_ER__UART8_DCE_RTS | MUX_PAD_CTRL(UART_PAD_CTRL),
+   MX6_PAD_LCD_DATA20__UART8_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
+   MX6_PAD_LCD_DATA21__UART8_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
 };
 
 static void setup_iomux_uart(void)
@@ -134,6 +139,7 @@ static void setup_iomux_uart(void)
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
imx_iomux_v3_setup_multiple_pads(uart4_pads, ARRAY_SIZE(uart4_pads));
imx_iomux_v3_setup_multiple_pads(uart5_pads, ARRAY_SIZE(uart5_pads));
+   imx_iomux_v3_setup_multiple_pads(uart7_pads, ARRAY_SIZE(uart7_pads));
imx_iomux_v3_setup_multiple_pads(uart8_pads, ARRAY_SIZE(uart8_pads));
 }
 
diff --git a/include/configs/xpress.h b/include/configs/xpress.h
index fdb504d9d9..c2575f01d9 100644
--- a/include/configs/xpress.h
+++ b/include/configs/xpress.h
@@ -18,7 +18,7 @@
 #define CONFIG_SYS_MALLOC_LEN  (16 << 20)
 
 #define CONFIG_MXC_UART
-#define CONFIG_MXC_UART_BASE   UART1_BASE
+#define CONFIG_MXC_UART_BASE   MX6UL_UART7_BASE_ADDR
 
 /* MMC Configs */
 #define CONFIG_SYS_FSL_ESDHC_ADDR  USDHC2_BASE_ADDR
@@ -87,7 +87,7 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
"script=boot.scr\0" \
"image=zImage\0" \
-   "console=ttymxc0\0" \
+   "console=ttymxc6\0" \
"fdt_high=0x\0" \
"initrd_high=0x\0" \
"fdt_file=undefined\0" \
-- 
2.11.0

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


Re: [U-Boot] [PATCH v3 02/21] part: extract MBR signature from partitions

2017-10-02 Thread Rob Clark
On Mon, Oct 2, 2017 at 2:17 PM, Fabio Estevam  wrote:
> On Wed, Sep 13, 2017 at 7:05 PM, Rob Clark  wrote:
>> From: Peter Jones 
>>
>> EFI client programs need the signature information from the partition
>> table to determine the disk a partition is on, so we need to fill that
>> in here.
>>
>> Signed-off-by: Peter Jones 
>> [separated from efi_loader part, and fixed build-errors for non-
>>  CONFIG_EFI_PARTITION case]
>> Signed-off-by: Rob Clark 
>
> This is commit ff98cb90514d9b78 in mainline now and breaks all mx6 SPL boots:
>
> U-Boot SPL 2017.09-00221-g0d6ab32 (Oct 02 2017 - 15:13:19)
> Trying to boot from MMC1
> (hangs here)
>
> Does anyone know how to fix this problem?

not sure to what extent debug()/printf() works from SPL, but if it
does maybe adding this patch with and without that commit and
comparing logs would give some hint:

--
diff --git a/disk/part.c b/disk/part.c
index aa9183d696..8e0bf54b3e 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -5,6 +5,8 @@
  * SPDX-License-Identifier:GPL-2.0+
  */

+#define DEBUG
+
 #include 
 #include 
 #include 
@@ -13,7 +15,7 @@
 #include 
 #include 

-#undefPART_DEBUG
+#definePART_DEBUG

 #ifdefPART_DEBUG
 #definePRINTF(fmt,args...)printf (fmt ,##args)
--

I don't really see why this commit would cause problems, but I guess
either something unexpected going on w/ partitions or block device
driver on this platform..

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


Re: [U-Boot] [GIT PULL v2] u-boot-sunxi/master

2017-10-02 Thread Maxime Ripard
Hi Tom,

On Fri, Sep 29, 2017 at 12:52:47PM +, Tom Rini wrote:
> On Fri, Sep 29, 2017 at 02:37:55PM +0200, Maxime Ripard wrote:
> > Hi,
> > 
> > On Thu, Sep 28, 2017 at 01:02:58PM +, Tom Rini wrote:
> > > On Thu, Sep 28, 2017 at 11:12:55AM +0200, Maxime Ripard wrote:
> > > 
> > > > Hi Tom,
> > > > 
> > > > Here is the second version of the pull request sent yesterday. It
> > > > shouldn't show the config warnings anymore.
> > > > 
> > > > Thanks!
> > > > Maxime
> > > > 
> > > > The following changes since commit 
> > > > 6e9b109aa9bcdd094e77da9fb03de8b44da8eb9d:
> > > > 
> > > >   Merge git://git.denx.de/u-boot-usb (2017-09-27 09:39:48 -0400)
> > > > 
> > > > are available in the git repository at:
> > > > 
> > > >   git://git.denx.de/u-boot-sunxi master
> > > > 
> > > > for you to fetch changes up to 6a191c5ef1294de8c09a3c4539b76a3d9fa60036:
> > > > 
> > > >   sunxi: usb_phy: invert the USB phy_ctl condition (2017-09-28 10:44:12 
> > > > +0200)
> > > > 
> > > 
> > > OK, there's still some problems.  As a rule, you should at least run
> > > 'make tests' before posting and that shows:
> > > +make O=/home/trini/work/u-boot/u-boot/build-sandbox -s -j8
> > > ../drivers/core/read.c: In function ‘dev_read_addr_ptr’:
> > > ../drivers/core/read.c:64:44: warning: cast to pointer from integer of 
> > > different size [-Wint-to-pointer-cast]
> > >   return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
> > 
> > This one is in the current master.
> > 
> > > ../lib/uuid.c: In function ‘gen_rand_uuid’:
> > > ../lib/uuid.c:246:2: warning: implicit declaration of function 
> > > ‘clrsetbits_be16’ [-Wimplicit-function-declaration]
> > >   clrsetbits_be16(&uuid.time_hi_and_version,
> > >   ^
> > > ../lib/uuid.c:250:2: warning: implicit declaration of function 
> > > ‘clrsetbits_8’ [-Wimplicit-function-declaration]
> > >   clrsetbits_8(&uuid.clock_seq_hi_and_reserved,
> > >   ^
> > > lib/built-in.o: In function `gen_rand_uuid':
> > > /home/trini/work/u-boot/u-boot/build-sandbox/../lib/uuid.c:246: undefined 
> > > reference to `clrsetbits_be16'
> > > /home/trini/work/u-boot/u-boot/build-sandbox/../lib/uuid.c:250: undefined 
> > > reference to `clrsetbits_8'
> > > collect2: error: ld returned 1 exit status
> > > make[2]: *** [u-boot] Error 1
> > > make[1]: *** [sub-make] Error 2
> > 
> > And these two are only seen on the sandbox, since arch/sandbox doesn't
> > define the clrsetbits. How am I supposed to fix that?
> 
> We can't bring in patches that break other architectures.  In this case,
> it doesn't look too bad to grab the macros from ARM and slightly adapt,
> so I'll post a patch in a moment you can grab.

So I've set up travis-ci, and just built that branch with a couple of
fixes and the patch for the sandbox io accessors I sent a bit earlier.

It has passed, so I guess we're good to go.

Do you want me to pick up the sandbox patch and send you the PR, or do
you want to apply it yourself?

Sorry for the mess...
Maxime


-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


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


Re: [U-Boot] [GIT PULL v2] u-boot-sunxi/master

2017-10-02 Thread Tom Rini
On Mon, Oct 02, 2017 at 10:44:31PM +0200, Maxime Ripard wrote:
> Hi Tom,
> 
> On Fri, Sep 29, 2017 at 12:52:47PM +, Tom Rini wrote:
> > On Fri, Sep 29, 2017 at 02:37:55PM +0200, Maxime Ripard wrote:
> > > Hi,
> > > 
> > > On Thu, Sep 28, 2017 at 01:02:58PM +, Tom Rini wrote:
> > > > On Thu, Sep 28, 2017 at 11:12:55AM +0200, Maxime Ripard wrote:
> > > > 
> > > > > Hi Tom,
> > > > > 
> > > > > Here is the second version of the pull request sent yesterday. It
> > > > > shouldn't show the config warnings anymore.
> > > > > 
> > > > > Thanks!
> > > > > Maxime
> > > > > 
> > > > > The following changes since commit 
> > > > > 6e9b109aa9bcdd094e77da9fb03de8b44da8eb9d:
> > > > > 
> > > > >   Merge git://git.denx.de/u-boot-usb (2017-09-27 09:39:48 -0400)
> > > > > 
> > > > > are available in the git repository at:
> > > > > 
> > > > >   git://git.denx.de/u-boot-sunxi master
> > > > > 
> > > > > for you to fetch changes up to 
> > > > > 6a191c5ef1294de8c09a3c4539b76a3d9fa60036:
> > > > > 
> > > > >   sunxi: usb_phy: invert the USB phy_ctl condition (2017-09-28 
> > > > > 10:44:12 +0200)
> > > > > 
> > > > 
> > > > OK, there's still some problems.  As a rule, you should at least run
> > > > 'make tests' before posting and that shows:
> > > > +make O=/home/trini/work/u-boot/u-boot/build-sandbox -s -j8
> > > > ../drivers/core/read.c: In function ‘dev_read_addr_ptr’:
> > > > ../drivers/core/read.c:64:44: warning: cast to pointer from integer of 
> > > > different size [-Wint-to-pointer-cast]
> > > >   return (addr == FDT_ADDR_T_NONE) ? NULL : (void *)addr;
> > > 
> > > This one is in the current master.
> > > 
> > > > ../lib/uuid.c: In function ‘gen_rand_uuid’:
> > > > ../lib/uuid.c:246:2: warning: implicit declaration of function 
> > > > ‘clrsetbits_be16’ [-Wimplicit-function-declaration]
> > > >   clrsetbits_be16(&uuid.time_hi_and_version,
> > > >   ^
> > > > ../lib/uuid.c:250:2: warning: implicit declaration of function 
> > > > ‘clrsetbits_8’ [-Wimplicit-function-declaration]
> > > >   clrsetbits_8(&uuid.clock_seq_hi_and_reserved,
> > > >   ^
> > > > lib/built-in.o: In function `gen_rand_uuid':
> > > > /home/trini/work/u-boot/u-boot/build-sandbox/../lib/uuid.c:246: 
> > > > undefined reference to `clrsetbits_be16'
> > > > /home/trini/work/u-boot/u-boot/build-sandbox/../lib/uuid.c:250: 
> > > > undefined reference to `clrsetbits_8'
> > > > collect2: error: ld returned 1 exit status
> > > > make[2]: *** [u-boot] Error 1
> > > > make[1]: *** [sub-make] Error 2
> > > 
> > > And these two are only seen on the sandbox, since arch/sandbox doesn't
> > > define the clrsetbits. How am I supposed to fix that?
> > 
> > We can't bring in patches that break other architectures.  In this case,
> > it doesn't look too bad to grab the macros from ARM and slightly adapt,
> > so I'll post a patch in a moment you can grab.
> 
> So I've set up travis-ci, and just built that branch with a couple of
> fixes and the patch for the sandbox io accessors I sent a bit earlier.
> 
> It has passed, so I guess we're good to go.
> 
> Do you want me to pick up the sandbox patch and send you the PR, or do
> you want to apply it yourself?
> 
> Sorry for the mess...

No worries.  Go ahead and grab the patch and send the new PR, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 1/1] kconfiglib: update with 'imply' support

2017-10-02 Thread Ulf Magnusson
On Fri, Sep 29, 2017 at 10:25 PM, Tom Rini  wrote:
> On Tue, Sep 19, 2017 at 12:52:55PM +0200, Ulf Magnusson wrote:
>
>> Corresponds to 375506d (File writing nit) from upstream
>> (https://github.com/ulfalizer/Kconfiglib).
>>
>> Adds proper 'imply' support and fixes a few minor issues, one of which
>> previously triggered the following weird warning:
>>
>>   configs/taurus_defconfig: /tmp/tmpisI45S:6: warning: assignment to 
>> SPL_LDSCRIPT changes mode of containing choice from 
>> "arch/$(ARCH)/cpu/u-boot-spl.lds" to "y"
>>
>> The change in 8639f69 (genconfig.py: Print defconfig next to warnings)
>> was reapplied.
>>
>> tools/moveconfig.py previously depended on a hack that merged 'select's
>> with 'imply's. It was modified to look at the union of
>> Symbol.get_selected_symbols() and Symbol.get_implied_symbols(), which
>> should give the same behavior.
>>
>> tools/genboardscfg.py was verified to produce identical board.cfg's
>> before and after the change.
>>
>> Signed-off-by: Ulf Magnusson 
>
> Applied to u-boot/master, thanks!
>
> --
> Tom

For future reference, Kconfiglib is now available on PyPI and can be
installed via e.g. 'pip' (see the updated README at
https://github.com/ulfalizer/Kconfiglib).

Maybe the custom patch in 8639f69a (genconfig.py: Print defconfig next
to warnings) could be removed if stderr is temporarily redirected to a
string 
(https://stackoverflow.com/questions/1218933/can-i-redirect-the-stdout-in-python-into-some-sort-of-string-buffer).
I was thinking of adding an optional list argument to some functions
that would receive the warning strings if provided, but I'm not sure
if it's worth it. Would want them printed directly by default at
least, because otherwise people will miss them.

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


Re: [U-Boot] [PATCH] scripts: dtc: Add .gitignore

2017-10-02 Thread Tom Rini
On Sat, Sep 30, 2017 at 10:56:22PM -0700, Bin Meng wrote:

> Ignore these generated files during the build of dtc.
> 
> Signed-off-by: Bin Meng 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [ANN] U-Boot v2017.11-rc1 released

2017-10-02 Thread Tom Rini
Hey all,

So it's release day and I've put up v2017.11-rc1.  The merge window is
now closed and I've updated git and the tarballs are also up now.

I think my patch queue is in OK shape currently, but I need to
pick up a number of series that were posted in the middle of September
and look to be good to go, but I hadn't had a chance to grab just yet.
Once that stuff is in however, I'm going to start being more strict
about what comes in overall.  I'm kind of thinking about a weeks time
after -rc1 is "it".

Thanks all!

-- 
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] [PATCH v3 02/21] part: extract MBR signature from partitions

2017-10-02 Thread Fabio Estevam
Hi Tom,

On Mon, Oct 2, 2017 at 4:32 PM, Tom Rini  wrote:

> FWIW, on cubox the current status is looping, and your kludge I just get
> no output :(  But there may be some other problems here too as I'm

Just tried it on 2017.11-rc1 plus the attached hack and it boots fine:

U-Boot SPL 2017.11-rc1-dirty (Oct 02 2017 - 21:27:10)
Trying to boot from MMC1


U-Boot 2017.11-rc1-dirty (Oct 02 2017 - 21:27:10 -0300)

CPU:   Freescale i.MX6Q rev1.5 996 MHz (running at 792 MHz)
CPU:   Extended Commercial temperature grade (-20C to 105C) at 26C
Reset cause: POR
Board: MX6 Cubox-i
DRAM:  2 GiB
MMC:   FSL_SDHC: 0
No panel detected: default to HDMI
Display: HDMI (1024x768)
In:serial
Out:   serial
Err:   serial
Net:   FEC
Hit any key to stop autoboot:  0
=>
From b334aa07bcf959fed9c68bfc8e801f9aabe9b93c Mon Sep 17 00:00:00 2001
From: Fabio Estevam 
Date: Mon, 2 Oct 2017 21:28:14 -0300
Subject: [PATCH] part_dos: hack

Signed-off-by: Fabio Estevam 
---
 disk/part_dos.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/disk/part_dos.c b/disk/part_dos.c
index 1a36be0..a1cf553 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -89,20 +89,6 @@ static int test_block_type(unsigned char *buffer)
 
 static int part_test_dos(struct blk_desc *dev_desc)
 {
-	ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr, dev_desc->blksz);
-
-	if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1)
-		return -1;
-
-	if (test_block_type((unsigned char *)mbr) != DOS_MBR)
-		return -1;
-
-	if (dev_desc->sig_type == SIG_TYPE_NONE &&
-	mbr->unique_mbr_signature != 0) {
-		dev_desc->sig_type = SIG_TYPE_MBR;
-		dev_desc->mbr_sig = mbr->unique_mbr_signature;
-	}
-
 	return 0;
 }
 
-- 
2.7.4

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


[U-Boot] [RFC] disk: part_dos: Fix part_test_dos() regression

2017-10-02 Thread Fabio Estevam
From: Fabio Estevam 

Since commit ff98cb90514d ("part: extract MBR signature from partitions")
SPL boot on i.MX6 starts to fail:

U-Boot SPL 2017.09-00221-g0d6ab32 (Oct 02 2017 - 15:13:19)
Trying to boot from MMC1
(hangs here)

Revert the part_test_dos() changes from this commit, so that
SPL boot can be functional again.

Tested on a imx6q-cuboxi board.

Signed-off-by: Fabio Estevam 
---
 disk/part_dos.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/disk/part_dos.c b/disk/part_dos.c
index 1a36be0..213a8d8 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -89,20 +89,14 @@ static int test_block_type(unsigned char *buffer)
 
 static int part_test_dos(struct blk_desc *dev_desc)
 {
-   ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr, dev_desc->blksz);
+   ALLOC_CACHE_ALIGN_BUFFER(unsigned char, mbr, dev_desc->blksz);
 
if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1)
return -1;
 
-   if (test_block_type((unsigned char *)mbr) != DOS_MBR)
+   if (test_block_type(mbr) != DOS_MBR)
return -1;
 
-   if (dev_desc->sig_type == SIG_TYPE_NONE &&
-   mbr->unique_mbr_signature != 0) {
-   dev_desc->sig_type = SIG_TYPE_MBR;
-   dev_desc->mbr_sig = mbr->unique_mbr_signature;
-   }
-
return 0;
 }
 
-- 
2.7.4

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


Re: [U-Boot] [PATCH v3 02/21] part: extract MBR signature from partitions

2017-10-02 Thread Fabio Estevam
Hi Rob,

On Mon, Oct 2, 2017 at 4:35 PM, Rob Clark  wrote:

> not sure to what extent debug()/printf() works from SPL, but if it
> does maybe adding this patch with and without that commit and
> comparing logs would give some hint:

Unfortunately I don't get any logs with this debug patch.

> I don't really see why this commit would cause problems, but I guess
> either something unexpected going on w/ partitions or block device
> driver on this platform..

I have just sent a RFC patch that fixes the boot here.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3] sun50i: h5: Add NanoPi Neo Plus2 DT initial support

2017-10-02 Thread Chen-Yu Tsai
On Mon, Oct 2, 2017 at 1:34 AM, Antony Antony  wrote:
> Hi Maxime,
>
> sorry for the delayed response.
>
> On Mon, Sep 25, 2017 at 01:12:23PM +0200, Maxime Ripard wrote:
>> On Sat, Sep 23, 2017 at 05:59:15PM +, Antony Antony wrote:
>> > Add initial DT for NanoPi NEO Plus2 by FriendlyARM
>> > - Allwinner quad core H5 Cortex A53 with an ARM Mali-450MP GPU
>> > - 1 GB DDR3 RAM
>> > - 8GB eMMC flash (Samsung KLM8G1WEPD-B031)
>> > - micro SD card slot
>> > - Gigabit Ethernet (external RTL8211E-VB-CG chip)
>> > - 802.11 b/g/n WiFi, Bluetooth 4.0 (Ampak AP6212A module)
>> > - 2x USB 2.0 host ports
>> >
>> > Signed-off-by: Antony Antony 
>> > ---
>> > Changes v1->v2
>> >  removed memory {}, compatible ="allwinner,sun5i-a13-mmc"
>> >  remove CONFIG_SPL_SPI_FLASH_SUPPORT=y and CONFIG_SPL_SPI_SUNXI=y (no SPI)
>> >  remove CONFIG_SD_BOOT=y
>> > Changes v2->v3
>> >  removed compatible ="allwinner,sun50i-a64-mmc"
>> > ---
>> >  arch/arm/dts/Makefile   |   1 +
>> >  arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts | 107 
>> > 
>> >  configs/nanopi_neo_plus2_defconfig  |  18 +
>> >  3 files changed, 126 insertions(+)
>> >  create mode 100644 arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
>> >  create mode 100644 configs/nanopi_neo_plus2_defconfig
>> >
>> > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
>> > index fee4680..295a675 100644
>> > --- a/arch/arm/dts/Makefile
>> > +++ b/arch/arm/dts/Makefile
>> > @@ -333,6 +333,7 @@ dtb-$(CONFIG_MACH_SUN8I_V3S) += \
>> > sun8i-v3s-licheepi-zero.dtb
>> >  dtb-$(CONFIG_MACH_SUN50I_H5) += \
>> > sun50i-h5-nanopi-neo2.dtb \
>> > +   sun50i-h5-nanopi-neo-plus2.dtb \
>> > sun50i-h5-orangepi-pc2.dtb \
>> > sun50i-h5-orangepi-prime.dtb \
>> > sun50i-h5-orangepi-zero-plus2.dtb
>> > diff --git a/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts 
>> > b/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
>> > new file mode 100644
>> > index 000..8ac098e
>> > --- /dev/null
>> > +++ b/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
>> > @@ -0,0 +1,107 @@
>> > +/*
>> > + * Copyright (C) 2017 Antony Antony 
>> > + * Copyright (c) 2016 ARM Ltd.
>> > + *
>> > + * This file is dual-licensed: you can use it either under the terms
>> > + * of the GPL or the X11 license, at your option. Note that this dual
>> > + * licensing only applies to this file, and not this project as a
>> > + * whole.
>> > + *
>> > + *  a) This library is free software; you can redistribute it and/or
>> > + * modify it under the terms of the GNU General Public License as
>> > + * published by the Free Software Foundation; either version 2 of the
>> > + * License, or (at your option) any later version.
>> > + *
>> > + * This library is distributed in the hope that it will be useful,
>> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> > + * GNU General Public License for more details.
>> > + *
>> > + * Or, alternatively,
>> > + *
>> > + *  b) Permission is hereby granted, free of charge, to any person
>> > + * obtaining a copy of this software and associated documentation
>> > + * files (the "Software"), to deal in the Software without
>> > + * restriction, including without limitation the rights to use,
>> > + * copy, modify, merge, publish, distribute, sublicense, and/or
>> > + * sell copies of the Software, and to permit persons to whom the
>> > + * Software is furnished to do so, subject to the following
>> > + * conditions:
>> > + *
>> > + * The above copyright notice and this permission notice shall be
>> > + * included in all copies or substantial portions of the Software.
>> > + *
>> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>> > + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
>> > + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>> > + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
>> > + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
>> > + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
>> > + * OTHER DEALINGS IN THE SOFTWARE.
>> > + */
>> > +
>> > +/dts-v1/;
>> > +
>> > +#include "sun50i-h5.dtsi"
>> > +
>> > +#include 
>> > +
>> > +/ {
>> > +   model = "FriendlyARM NanoPi NEO Plus 2";
>> > +   compatible = "friendlyarm,nanopi-neo-plus2", "allwinner,sun50i-h5";
>> > +
>> > +   aliases {
>> > +   serial0 = &uart0;
>> > +   };
>> > +
>> > +   chosen {
>> > +   stdout-path = "serial0:115200n8";
>> > +   };
>> > +
>> > +   reg_vcc3v3: vcc3v3 {
>> > +   compatible = "regulator-fixed";
>> > +   regulator-name = "vcc3v3";
>> > +   regulator-min-microvolt = <330>;
>> > +   regulator-max-microvolt = <330>;
>> > +   };
>> > +};
>> > +
>> 

[U-Boot] [PATCH 1/1] efi_loader: replace efi_div10 by div64_u64

2017-10-02 Thread Heinrich Schuchardt
We should use the existing 64bit division instead of
reinventing the wheel.

Signed-off-by: Heinrich Schuchardt 
---
The patch is based on v2017.11-rc1 with no other patches applied.

Applying it will require rebasing
[PATCH 1/1] efi_loader: provide function comments for boot services
https://patchwork.ozlabs.org/patch/817010/

But we have an open issue with the second patch anyway.
---
 lib/efi_loader/efi_boottime.c | 36 ++--
 1 file changed, 2 insertions(+), 34 deletions(-)

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 9e741c3cf3..d63c66dd45 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -128,39 +129,6 @@ const char *__efi_nesting_dec(void)
return indent_string(--nesting_level);
 }
 
-/* Low 32 bit */
-#define EFI_LOW32(a) (a & 0xULL)
-/* High 32 bit */
-#define EFI_HIGH32(a) (a >> 32)
-
-/*
- * 64bit division by 10 implemented as multiplication by 1 / 10
- *
- * Decimals of one tenth: 0x1 / 0xA = 0x0.1...
- */
-#define EFI_TENTH 0x199A
-static u64 efi_div10(u64 a)
-{
-   u64 prod;
-   u64 rem;
-   u64 ret;
-
-   ret  = EFI_HIGH32(a) * EFI_HIGH32(EFI_TENTH);
-   prod = EFI_HIGH32(a) * EFI_LOW32(EFI_TENTH);
-   rem  = EFI_LOW32(prod);
-   ret += EFI_HIGH32(prod);
-   prod = EFI_LOW32(a) * EFI_HIGH32(EFI_TENTH);
-   rem += EFI_LOW32(prod);
-   ret += EFI_HIGH32(prod);
-   prod = EFI_LOW32(a) * EFI_LOW32(EFI_TENTH);
-   rem += EFI_HIGH32(prod);
-   ret += EFI_HIGH32(rem);
-   /* Round to nearest integer */
-   if (rem >= (1 << 31))
-   ++ret;
-   return ret;
-}
-
 void efi_signal_event(struct efi_event *event)
 {
if (event->notify_function) {
@@ -364,7 +332,7 @@ efi_status_t efi_set_timer(struct efi_event *event, enum 
efi_timer_delay type,
 * The parameter defines a multiple of 100ns.
 * We use multiples of 1000ns. So divide by 10.
 */
-   trigger_time = efi_div10(trigger_time);
+   trigger_time = div64_u64(trigger_time, 10);
 
for (i = 0; i < ARRAY_SIZE(efi_events); ++i) {
if (event != &efi_events[i])
-- 
2.14.1

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


Re: [U-Boot] [PATCH v2 11/19] arm: socfpga: Add DRAM bank size initialization function

2017-10-02 Thread Ley Foon Tan
On Mon, Oct 2, 2017 at 6:06 PM, Chee, Tien Fong
 wrote:
> On Isn, 2017-10-02 at 12:04 +0200, Marek Vasut wrote:
>> On 10/02/2017 12:01 PM, Chee, Tien Fong wrote:
>> >
>> > On Sel, 2017-09-26 at 12:33 +0200, Marek Vasut wrote:
>> > >
>> > > On 09/26/2017 10:20 AM, Chee, Tien Fong wrote:
>> > > >
>> > > >
>> > > > On Isn, 2017-09-25 at 11:15 +0200, Marek Vasut wrote:
>> > > > >
>> > > > >
>> > > > > On 09/25/2017 10:40 AM, tien.fong.c...@intel.com wrote:
>> > > > > >
>> > > > > >
>> > > > > >
>> > > > > > From: Tien Fong Chee 
>> > > > > >
>> > > > > > Add function for both multiple DRAM bank and single DRAM
>> > > > > > bank
>> > > > > > size
>> > > > > > initialization. This common functionality could be used by
>> > > > > > every
>> > > > > > single
>> > > > > > SOCFPGA board.
>> > > > > >
>> > > > > > Signed-off-by: Tien Fong Chee 
>> > > > > I'd like TB on Gen5.
>> > > > >
>> > > > What is TB?
>> > > Tested-by
>> > > Tested-by: Tien Fong Chee 
>> > You want me resend the patch with Tested-by?
>> Uh no, that's not how TB works. You should get TB on your patches
>> from
>> someone else , not yourself .
>>
> oo...okay, i will ask ley foon help to verify.
>> >
Tested-by: Ley Foon Tan 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] ARM: stm32f7: fix prescaler calculation of timer

2017-10-02 Thread Bo Shen
As the timer 2 is on APB1 bus, the maximum of clock frequency of APB1 timer
clock is half of SYSCLK. Then to calculate the timer prescaler for timer 2
which need to be divided by 2.

Signed-off-by: Bo Shen 
---
 arch/arm/mach-stm32/stm32f7/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-stm32/stm32f7/timer.c 
b/arch/arm/mach-stm32/stm32f7/timer.c
index c15f8bb..b04c101 100644
--- a/arch/arm/mach-stm32/stm32f7/timer.c
+++ b/arch/arm/mach-stm32/stm32f7/timer.c
@@ -26,7 +26,7 @@ int timer_init(void)
/* Stop the timer */
writel(readl(&gpt1_regs_ptr->cr1) & ~GPT_CR1_CEN, &gpt1_regs_ptr->cr1);
 
-   writel((CONFIG_SYS_CLK_FREQ/CONFIG_SYS_HZ_CLOCK) - 1,
+   writel((CONFIG_SYS_CLK_FREQ / 2 / CONFIG_SYS_HZ_CLOCK) - 1,
&gpt1_regs_ptr->psc);
 
/* Configure timer for auto-reload */
-- 
2.7.4

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