Re: [U-Boot] [PATCH] arm: exynos: Use the generic lowlevel_init instead of the specific one

2016-09-19 Thread Thomas Abraham
Hi Alison,


On Mon, Sep 19, 2016 at 7:38 PM, Alexander Graf  wrote:
>
>
> On 09.09.16 10:48, Alison Wang wrote:
>> This patch is to use the the generic lowlevel_init instead of the
>> specific one.
>>
>> Signed-off-by: Alison Wang 
>
> If I had to guess, I'd think they only had their own version because the
> old one required a GIC.

I apologize for the delay.

The reason for using a custom version was to avoid enabling
ARMV8_MULTIENTRY config option since the Exynos7 code was ready for
it.

>
> Either way, since Samsung doesn't reply, I'm fine potentially breaking
> their boards if that means that we can make progress for actively
> maintained ones:
>
>   Reviewed-by: Alexander Graf 

This patch without the ARMV8_MULTIENTRY and ARMV8_SWITCH_TO_EL1 config
options does not switch the boot CPU from EL3 to EL1. So it would be
preferable to not merge this patch until ARMV8_MULTIENTRY  is enabled
for Exynos7.

Thomas.

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


Re: [U-Boot] [PATCH 1/9] ddr: altera: Configuring SDRAM extra cycles timing parameters

2016-09-19 Thread Chin Liang See
On Mon, 2016-09-19 at 20:54 +0200, Marek Vasut wrote:
> On 09/19/2016 12:11 PM, Chin Liang See wrote:
> > On Mon, 2016-09-19 at 16:22 +0200, Marek Vasut wrote:
> > > On 09/15/2016 09:26 AM, Chin Liang See wrote:
> > > > To enable configuration of sdr.ctrlcfg.extratime1 register
> > > > which
> > > > enable
> > > > extra clocks for read to write command timing. This is critical
> > > > to
> > > > ensure successful LPDDR2 interface
> > > > 
> > > > Signed-off-by: Chin Liang See 
> > > > ---
> > > >  arch/arm/mach-socfpga/include/mach/sdram.h | 8 +++-
> > > >  arch/arm/mach-socfpga/qts-filter.sh| 2 +-
> > > >  arch/arm/mach-socfpga/wrap_sdram_config.c  | 9 +
> > > >  drivers/ddr/altera/sdram.c | 3 +++
> > > >  4 files changed, 20 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/arch/arm/mach-socfpga/include/mach/sdram.h
> > > > b/arch/arm/mach-socfpga/include/mach/sdram.h
> > > > index f12bb84..b11228f 100644
> > > > --- a/arch/arm/mach-socfpga/include/mach/sdram.h
> > > > +++ b/arch/arm/mach-socfpga/include/mach/sdram.h
> > > > @@ -30,7 +30,8 @@ struct socfpga_sdr_ctrl {
> > > > u32 dram_timing4;   /* 0x10 */
> > > > u32 lowpwr_timing;
> > > > u32 dram_odt;
> > > > -   u32 __padding0[4];
> > > > +   u32 extratime1;
> > > > +   u32 __padding0[3];
> > > > u32 dram_addrw; /* 0x2c */
> > > > u32 dram_if_width;  /* 0x30 */
> > > > u32 dram_dev_width;
> > > > @@ -88,6 +89,7 @@ struct socfpga_sdram_config {
> > > > u32 dram_timing4;
> > > > u32 lowpwr_timing;
> > > > u32 dram_odt;
> > > > +   u32 extratime1;
> > > > u32 dram_addrw;
> > > > u32 dram_if_width;
> > > > u32 dram_dev_width;
> > > 
> > > This seems to be changing the DRAM register layout, is this
> > > really
> > > correct and was this really tested on AV SoCDK ?
> > 
> > Previously its treated unused register as default value is good
> > enough.
> > But this not true anymore for LPDDR2 and we are exposing extratime1
> > register.
> 
> I mean the later one , which adds an entry and moves the other
> registers
> by 4 bytes.

Oh you referring to socfpga_sdram_config. That structure is used to
store the handoff value. The address of register is actually pointed by
structure socfpga_sdr_ctrl.

> 
> > While for testing, I tested both CV and AV SoCDK few times as I
> > also
> > worried even they are using DDR3 instead LPDDR2.
> 
> Yes, they do, it's in the documentation ;-)

Oh actually I meant that this patch should not impact existing boards
which are using DDR3.

Thanks
Chin Liang

> 
> > > 
> > > [...]
> > > 
> > > > diff --git a/arch/arm/mach-socfpga/wrap_sdram_config.c
> > > > b/arch/arm/mach-socfpga/wrap_sdram_config.c
> > > > index 31cc7de..d72f5e1 100644
> > > > --- a/arch/arm/mach-socfpga/wrap_sdram_config.c
> > > > +++ b/arch/arm/mach-socfpga/wrap_sdram_config.c
> > > > @@ -81,6 +81,15 @@ static const struct socfpga_sdram_config
> > > > sdram_config = {
> > > > SDR_CTRLGRP_DRAMODT_READ_LSB)   
> > > > |
> > > > (CONFIG_HPS_SDR_CTRLCFG_DRAMODT_WRITE <<
> > > > SDR_CTRLGRP_DRAMODT_WRITE_LSB),
> > > > +#ifdef
> > > > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR
> > > 
> > > How come this is not always defined for all boards ?
> > 
> > This is to ensure it still works if users are using older SOCEDS
> > instead of SOCEDS 16.1. Besides that, this is only applicable for
> > LPDDR2. With that, patches #2 to #9 are not needed.
> > 
> > Thanks
> > Chin Liang
> > 
> > > 
> > > > +   .extratime1 =
> > > > +   (CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_R
> > > > D_TO
> > > > _WR <<
> > > > +   SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_LSB)
> > > > |
> > > > +   (CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_R
> > > > D_TO
> > > > _WR_BC <<
> > > > +   SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_BC_LSB
> > > > )   
> > > > |
> > > > +(CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_
> > > > DIFF
> > > > _CHIP <<
> > > > +   SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_DIFF_L
> > > > SB),
> > > > +#endif
> > > > .dram_addrw =
> > > > (CONFIG_HPS_SDR_CTRLCFG_DRAMADDRW_COLBITS <<
> > > > SDR_CTRLGRP_DRAMADDRW_COLBITS_LSB)  
> > > > 
> > > > > 
> > > > diff --git a/drivers/ddr/altera/sdram.c
> > > > b/drivers/ddr/altera/sdram.c
> > > > index 7e4606d..e74c5b0 100644
> > > > --- a/drivers/ddr/altera/sdram.c
> > > > +++ b/drivers/ddr/altera/sdram.c
> > > > @@ -418,6 +418,9 @@ static void sdr_load_regs(const struct
> > > > socfpga_sdram_config *cfg)
> > > >  
> > > > debug("Configuring DRAMODT\n");
> > > > writel(cfg->dram_odt, _ctrl->dram_odt);
> > > > +
> > > > +   

Re: [U-Boot] [PATCH 2/9] arm: socfpga: Adding handoff for SDRAM ctrlcfg.extratime1

2016-09-19 Thread Chin Liang See
On Mon, 2016-09-19 at 20:52 +0200, Marek Vasut wrote:
> On 09/19/2016 12:12 PM, Chin Liang See wrote:
> > On Mon, 2016-09-19 at 16:24 +0200, Marek Vasut wrote:
> > > On 09/15/2016 09:27 AM, Chin Liang See wrote:
> > > > Adding new handoff for SDRAM ctrcfg.extratime1 which is
> > > > required for stabil LPDDR2 operation
> > > 
> > > ... stable ...
> > > 
> > > Isn't SoCDK using DDR3 DRAM ?
> > 
> > Yah, you are right where we won't need this patch and others except
> > #1
> > one. Should I send v2 which only have first patch?
> 
> Then should this register be set to zero on SoCDK ?

Not required as the default value is zero.

Thanks
Chin Liang

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


[U-Boot] [PATCH v2] ARM: uniphier: move CONFIG_SPL_* to defconfig or select

2016-09-19 Thread Masahiro Yamada
As I repeated in the ML, I am unhappy with config entries with bare
defaults.  Kick them out of arch/arm/mach-uniphier/Kconfig.

Currently, CONFIG_SPL_SERIAL_SUPPORT is not user-configurable
(build fails without it), but it should be fixed later anyway,
so I am moving CONFIG_SPL_SERIAL_SUPPORT to defconfigs.

Signed-off-by: Masahiro Yamada 
Reviewed-by: Tom Rini 
---

Changes in v2:
  - Rebase onto commit 9b1b6d422

 arch/arm/Kconfig |  2 ++
 arch/arm/mach-uniphier/Kconfig   | 15 ---
 configs/uniphier_ld11_defconfig  |  1 +
 configs/uniphier_ld20_defconfig  |  1 +
 configs/uniphier_ld4_sld8_defconfig  |  3 +++
 configs/uniphier_pro4_defconfig  |  3 +++
 configs/uniphier_pxs2_ld6b_defconfig |  3 +++
 configs/uniphier_sld3_defconfig  |  3 +++
 8 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a311215..5de3bfc 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -868,6 +868,8 @@ config ARCH_UNIPHIER
select PINCTRL
select SPL
select SPL_DM
+   select SPL_LIBCOMMON_SUPPORT
+   select SPL_LIBGENERIC_SUPPORT
select SPL_OF_CONTROL
select SPL_PINCTRL
select SUPPORT_SPL
diff --git a/arch/arm/mach-uniphier/Kconfig b/arch/arm/mach-uniphier/Kconfig
index 2e824bb..7bee6c7 100644
--- a/arch/arm/mach-uniphier/Kconfig
+++ b/arch/arm/mach-uniphier/Kconfig
@@ -1,20 +1,5 @@
 if ARCH_UNIPHIER
 
-config SPL_LIBCOMMON_SUPPORT
-   default y
-
-config SPL_LIBGENERIC_SUPPORT
-   default y
-
-config SPL_MMC_SUPPORT
-   default y if !ARCH_UNIPHIER_64BIT
-
-config SPL_NAND_SUPPORT
-   default y if !ARM64
-
-config SPL_SERIAL_SUPPORT
-   default y
-
 config SYS_CONFIG_NAME
default "uniphier"
 
diff --git a/configs/uniphier_ld11_defconfig b/configs/uniphier_ld11_defconfig
index 3fed739..c098069 100644
--- a/configs/uniphier_ld11_defconfig
+++ b/configs/uniphier_ld11_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_UNIPHIER=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_ARCH_UNIPHIER_LD11=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x8400
diff --git a/configs/uniphier_ld20_defconfig b/configs/uniphier_ld20_defconfig
index b85f528..3fe3758 100644
--- a/configs/uniphier_ld20_defconfig
+++ b/configs/uniphier_ld20_defconfig
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_UNIPHIER=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_ARCH_UNIPHIER_LD20=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x8400
diff --git a/configs/uniphier_ld4_sld8_defconfig 
b/configs/uniphier_ld4_sld8_defconfig
index e996355..c18f042 100644
--- a/configs/uniphier_ld4_sld8_defconfig
+++ b/configs/uniphier_ld4_sld8_defconfig
@@ -1,6 +1,9 @@
 CONFIG_ARM=y
 CONFIG_ARCH_UNIPHIER=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_SPL_NAND_SUPPORT=y
+CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_ARCH_UNIPHIER_LD4_SLD8=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x8400
diff --git a/configs/uniphier_pro4_defconfig b/configs/uniphier_pro4_defconfig
index f0f47ee..9441b05 100644
--- a/configs/uniphier_pro4_defconfig
+++ b/configs/uniphier_pro4_defconfig
@@ -1,6 +1,9 @@
 CONFIG_ARM=y
 CONFIG_ARCH_UNIPHIER=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_SPL_NAND_SUPPORT=y
+CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x8400
 CONFIG_DEFAULT_DEVICE_TREE="uniphier-ph1-pro4-ref"
diff --git a/configs/uniphier_pxs2_ld6b_defconfig 
b/configs/uniphier_pxs2_ld6b_defconfig
index 64684de..0bf39f4 100644
--- a/configs/uniphier_pxs2_ld6b_defconfig
+++ b/configs/uniphier_pxs2_ld6b_defconfig
@@ -1,6 +1,9 @@
 CONFIG_ARM=y
 CONFIG_ARCH_UNIPHIER=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_SPL_NAND_SUPPORT=y
+CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_ARCH_UNIPHIER_PRO5_PXS2_LD6B=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x8400
diff --git a/configs/uniphier_sld3_defconfig b/configs/uniphier_sld3_defconfig
index f4ed2ee..bd9c327 100644
--- a/configs/uniphier_sld3_defconfig
+++ b/configs/uniphier_sld3_defconfig
@@ -1,6 +1,9 @@
 CONFIG_ARM=y
 CONFIG_ARCH_UNIPHIER=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_SPL_NAND_SUPPORT=y
+CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_ARCH_UNIPHIER_SLD3=y
 CONFIG_MICRO_SUPPORT_CARD=y
 CONFIG_SYS_TEXT_BASE=0x8400
-- 
1.9.1

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


Re: [U-Boot] [PATCH v3 1/6] dm: i2c: Add u8 read/write i2c functions

2016-09-19 Thread Heiko Schocher

Hello,

Am 19.09.2016 um 08:17 schrieb Keerthy:

Add u8 i2c read/write hooks.

Signed-off-by: Keerthy 
---
  drivers/i2c/i2c-uclass.c | 10 ++
  include/i2c.h| 24 
  2 files changed, 34 insertions(+)


Reviewed-by: Heiko Schocher 

bye,
Heiko


diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c
index dbd3789..6ce5d9a 100644
--- a/drivers/i2c/i2c-uclass.c
+++ b/drivers/i2c/i2c-uclass.c
@@ -231,6 +231,16 @@ int dm_i2c_reg_write(struct udevice *dev, uint offset, 
uint value)
return dm_i2c_write(dev, offset, , 1);
  }

+int dm_i2c_u8_read(struct udevice *dev, uint offset, u8 *val)
+{
+   return dm_i2c_read(dev, offset, val, 1);
+}
+
+int dm_i2c_u8_write(struct udevice *dev, uint offset, u8 *val)
+{
+   return dm_i2c_write(dev, offset, val, 1);
+}
+
  /**
   * i2c_probe_chip() - probe for a chip on a bus
   *
diff --git a/include/i2c.h b/include/i2c.h
index d500445..c3059ad 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -191,6 +191,30 @@ int dm_i2c_reg_read(struct udevice *dev, uint offset);
  int dm_i2c_reg_write(struct udevice *dev, uint offset, unsigned int val);

  /**
+ * dm_i2c_u8_read() - Read a byte value from an I2C register
+ *
+ * This reads a single value from the given address in an I2C chip
+ *
+ * @dev:Device to use for transfer
+ * @addr:   Address to read from
+ * @val:   Value read is stored in val
+ * @return 0 for success, -ve on error
+ */
+int dm_i2c_u8_read(struct udevice *dev, uint offset, u8 *val);
+
+/**
+ * dm_i2c_u8_write() - Write a byte value to an I2C register
+ *
+ * This writes a single value to the given address in an I2C chip
+ *
+ * @dev:Device to use for transfer
+ * @addr:   Address to write to
+ * @val:Value to write
+ * @return 0 on success, -ve on error
+ */
+int dm_i2c_u8_write(struct udevice *dev, uint offset, u8 *val);
+
+/**
   * dm_i2c_xfer() - Transfer messages over I2C
   *
   * This transfers a raw message. It is best to use dm_i2c_reg_read/write()



--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ARMv7: LS102xA: Move two macros from header files to Kconfig

2016-09-19 Thread macro . wave . z
From: Hongbo Zhang 

ARMV7_PSCI depends on ARMV7_NONSEC && ARCH_SUPPORT_PSCI, and ARMV7_NONSEC
depends on CPU_V7_HAS_NONSEC, LS102XA didn't enable CPU_V7_HAS_NONSEC, but
defined ARMV7_NONSEC in a internal header file, this cannot be recognized by
Kconfig, so ARMV7_PSCI isn't defined at last.
This patch selects CPU_V7_HAS_NONSEC in Kconfig, and remove ARMV7_NONSEC in
header file, and meanwhile selects CPU_V7_HAS_VIRT in Kconfig and remove
CONFIG_ARMV7_VIRT in header file too.

Signed-off-by: Hongbo Zhang 
---
 arch/arm/Kconfig | 4 
 include/configs/ls1021aqds.h | 2 --
 include/configs/ls1021atwr.h | 2 --
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1560bcc..7fcb1cb 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -818,12 +818,16 @@ config TARGET_LS1021AQDS
select CPU_V7
select SUPPORT_SPL
select ARCH_SUPPORT_PSCI
+   select CPU_V7_HAS_NONSEC
+   select CPU_V7_HAS_VIRT
 
 config TARGET_LS1021ATWR
bool "Support ls1021atwr"
select CPU_V7
select SUPPORT_SPL
select ARCH_SUPPORT_PSCI
+   select CPU_V7_HAS_NONSEC
+   select CPU_V7_HAS_VIRT
 
 config TARGET_LS1043AQDS
bool "Support ls1043aqds"
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index 5aaecc7..7b608c1 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -563,8 +563,6 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_CMDLINE_EDITING
 
-#define CONFIG_ARMV7_NONSEC
-#define CONFIG_ARMV7_VIRT
 #define CONFIG_PEN_ADDR_BIG_ENDIAN
 #define CONFIG_LAYERSCAPE_NS_ACCESS
 #define CONFIG_SMP_PEN_ADDR0x01ee0200
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index ef238a4..d946224 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -425,8 +425,6 @@
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_CMDLINE_EDITING
 
-#define CONFIG_ARMV7_NONSEC
-#define CONFIG_ARMV7_VIRT
 #define CONFIG_PEN_ADDR_BIG_ENDIAN
 #define CONFIG_LAYERSCAPE_NS_ACCESS
 #define CONFIG_SMP_PEN_ADDR0x01ee0200
-- 
2.1.4

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


[U-Boot] Fw: FDT pointer value, passed by the PI firmware, is not set in u-boot

2016-09-19 Thread dh

I modified the current u-boot code to store r2 in rpi.c board_init, but only 
get a zero value from the register.

It could be one of three issues:
1. My use of the c asm statement  to store r2 is wrong (I've never done this 
before), assembler yes, c assembler no.
2. The compiler has consumed the value of r2 before getting to board_init
3. The pi firmware does not put the fdt value in r2.

asm statement to store r2 is asm("mov %%r2, %0" : "=r" (gd->bd->bpi_boot_parms) 
); 

In order to use up Marco's ATAG and FDT code.

What the earliest place where I can store the input r2 value?
Hopefully, I'm putting the r2 value into gd->bd->bpi_boot_parms in board_init, 
but it appear it is zero at that point.

Should I restrict the compiler's use of r2? (I'm reluctant to limit the 
compiler in that manner)?

Suggestion would be welcome.

Thanks Duncan Hare

714 931 7952

   

   

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


Re: [U-Boot] [PATCH 0/2] Add sdram capacity auto detect for rk3288

2016-09-19 Thread Kever Yang

Hi Sandy,

On 09/19/2016 09:33 PM, Sandy Patterson wrote:

Hi Kever and Vagrant,

I tested this patch on my rock2 board against 2016.09. (I didn't have 
my board with me over the weekend)


Thanks for your test and for your log, my source code do have one bug 
and I have fix and upload the V2 patch set.




1) It seems the BACK_TO_BROM feature is broken. It doesn't boot using 
the 2016.09. I'm afraid I don't have the time to track it down.
It works fine on my evb, do you flash the image correctly? it's 
different with the way you don't use BACK_TO_BROM.


Regards,
- Kever
2) It seems the SPL is still small enough to test this feature. 
(vagrant you can forget about the back to brom feature unless you need 
more SPL space).


3) I get the same behavior as Vagrant on the rock2 board. I'm 
including DEBUG output in case that helps Kever. I tried to trace it, 
but it seems a larger undertaking than I can manage right now. 
(vagrant, you can add DEBUG #define's into the 
file include/configs/firefly-rk3288.h to get the output below.. my 
guess is it's similar.)


This trace is almost exactly the same between enabling the SDRAM 
detection and not. I marked the point where it halts. The fdt is a 
slightly different size, but that is expected.


Sandy


initcall: 0010af55
U-Boot code: 0010 -> 0014F8C0  BSS: -> 0018D1B8
initcall: 0010add1
initcall: 0010b359
Model: Radxa Rock 2 Square
initcall: 0010af95
DRAM:  initcall: 00100d19
malloc_simple: size=3c, ptr=7d8, limit=2000: fe79c
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
   - -1 -1
   - not found
fdtdec_get_int_array: interrupts
get_prop_check_min_len: interrupts
malloc_simple: size=4, ptr=7dc, limit=2000: fe7d8
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
   - -1 1
   - -1 -1
   - -1 0
   - found
uclass_find_device_by_seq: 0 1
   - -1 1
   - found
uclass_find_device_by_seq: 0 2
   - -1 1
   - -1 -1
   - -1 0
   - -1 -1
   - not found
fdtdec_get_int_array: interrupts
get_prop_check_min_len: interrupts
malloc_simple: size=14, ptr=7f0, limit=2000: fe7dc
malloc_simple: size=4, ptr=7f4, limit=2000: fe7f0
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
   - -1 1
   - -1 -1
   - -1 0
   - found
uclass_find_device_by_seq: 0 1
   - -1 1
   - found
uclass_find_device_by_seq: 0 2
   - -1 1
   - -1 -1
   - -1 0
   - -1 2
   - found
uclass_find_device_by_seq: 0 3
   - -1 1
   - -1 -1
   - -1 0
   - -1 2
   - not found
fdtdec_get_int_array: interrupts
get_prop_check_min_len: interrupts
malloc_simple: size=14, ptr=808, limit=2000: fe7f4
malloc_simple: size=c, ptr=814, limit=2000: fe808
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
   - -1 -1
   - not found
fdtdec_get_int_array: interrupts
get_prop_check_min_len: interrupts
OF: ** translation for device clock-controller@ff76 **
OF: bus is default (na=1, ns=1) on
OF: translating address: 76ff
OF: reached root node
clk_request(dev=000fe474, clk=000fe7bc)
SDRAM base=0, size=8000
initcall: 0010b129
Monitor len: 0008D1B8
Ram size: 8000
Ram top: 8000
initcall: 0010adf1
initcall: 0010af0d
TLB table from 7fff to 7fff4000
initcall: 0010af75
video_reserve: Reserving 4f bytes at 7fb0 for video device 
'vop@ff94'

Video frame buffers from 7fb0 to 7fff
initcall: 0010ae05
initcall: 0010aecd
Reserving 564k for U-Boot at: 7fa72000
initcall: 0010aea5
Reserving 32776k for malloc() at: 7da7
initcall: 0010b059
Reserving 80 Bytes for Board Info at: 7da6ffb0
initcall: 0010ae09
initcall: 0010ae7d
Reserving 200 Bytes for Global Data at: 7da6fee8
initcall: 0010ae2d
Reserving 38464 Bytes for FDT at: 7da668a8
initcall: 0010ae11
initcall: 0010b18d
initcall: 0010b113
initcall: 0010b099

RAM Configuration:
== SDRAM DETECTION FEATURE HALTS HERE 
Bank #0: 0 2 GiB

DRAM:  2 GiB
initcall: 0010ae19
New Stack Pointer is: 7da66880
initcall: 0010b02d
initcall: 0010afd5
Relocation Offset is: 7f972000
Relocating to 7fa72000, new gd at 7da6fee8, sp at 7da66880
initcall: 7fa7d1cd
initcall: 7fa7d1d1
initcall: 0010b32d (relocated to 7fa7d32d)
dram_bank_mmu_setup: bank: 0
initcall: 0010b305 (relocated to 7fa7d305)
efi_runtime_relocate: Relocating to offset=7fa72000




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


[U-Boot] [PATCH v2 3/3] dts: rk3288: remove node in dmc which not need anymore

2016-09-19 Thread Kever Yang
Since we implement the dram capacity auto detect, we don't
need to set the channel number and sdram-channel in dts.

Signed-off-by: Kever Yang 
---

Changes in v2: None

 arch/arm/dts/rk3288-evb.dts  | 3 ---
 arch/arm/dts/rk3288-fennec.dts   | 3 ---
 arch/arm/dts/rk3288-firefly.dts  | 2 --
 arch/arm/dts/rk3288-miniarm.dts  | 3 ---
 arch/arm/dts/rk3288-popmetal.dts | 3 ---
 arch/arm/dts/rk3288-rock2-square.dts | 2 --
 arch/arm/dts/rk3288-veyron.dtsi  | 2 --
 7 files changed, 18 deletions(-)

diff --git a/arch/arm/dts/rk3288-evb.dts b/arch/arm/dts/rk3288-evb.dts
index 3e1ee58..3f03e13 100644
--- a/arch/arm/dts/rk3288-evb.dts
+++ b/arch/arm/dts/rk3288-evb.dts
@@ -17,7 +17,6 @@
 };
 
  {
-   rockchip,num-channels = <2>;
rockchip,pctl-timing = <0x215 0xc8 0x0 0x35 0x26 0x2 0x70 0x2000d
0x6 0x0 0x8 0x4 0x17 0x24 0xd 0x6
0x4 0x8 0x4 0x76 0x4 0x0 0x30 0x0
@@ -25,8 +24,6 @@
0x8 0x1f4>;
rockchip,phy-timing = <0x48d7dd93 0x187008d8 0x121076
0x0 0xc3 0x6 0x2>;
-   /* Add a dummy value to cause of-platdata think this is bytes */
-   rockchip,sdram-channel = /bits/ 8 <0x2 0xa 0x3 0x2 0x2 0x0 0xe 0xe 
0xff>;
rockchip,sdram-params = <0x20d266a4 0x5b6 2 53300 6 9 0>;
 };
 
diff --git a/arch/arm/dts/rk3288-fennec.dts b/arch/arm/dts/rk3288-fennec.dts
index 36e9f3d..66ddf8d 100644
--- a/arch/arm/dts/rk3288-fennec.dts
+++ b/arch/arm/dts/rk3288-fennec.dts
@@ -17,7 +17,6 @@
 };
 
  {
-   rockchip,num-channels = <2>;
rockchip,pctl-timing = <0x215 0xc8 0x0 0x35 0x26 0x2 0x70 0x2000d
0x6 0x0 0x8 0x4 0x17 0x24 0xd 0x6
0x4 0x8 0x4 0x76 0x4 0x0 0x30 0x0
@@ -25,8 +24,6 @@
0x8 0x1f4>;
rockchip,phy-timing = <0x48d7dd93 0x187008d8 0x121076
0x0 0xc3 0x6 0x2>;
-   /* Add a dummy value to cause of-platdata think this is bytes */
-   rockchip,sdram-channel = /bits/ 8 <0x2 0xa 0x3 0x2 0x2 0x0 0xe 0xe 
0xff>;
rockchip,sdram-params = <0x20d266a4 0x5b6 2 53300 6 9 0>;
 };
 
diff --git a/arch/arm/dts/rk3288-firefly.dts b/arch/arm/dts/rk3288-firefly.dts
index 3176d50..97568a3 100644
--- a/arch/arm/dts/rk3288-firefly.dts
+++ b/arch/arm/dts/rk3288-firefly.dts
@@ -22,7 +22,6 @@
 };
 
  {
-   rockchip,num-channels = <2>;
rockchip,pctl-timing = <0x29a 0xc8 0x1f8 0x42 0x4e 0x4 0xea 0xa
0x5 0x0 0xa 0x7 0x19 0x24 0xa 0x7
0x5 0xa 0x5 0x200 0x5 0x10 0x40 0x0
@@ -31,7 +30,6 @@
rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
0xa60 0x40 0x10 0x0>;
/* Add a dummy value to cause of-platdata think this is bytes */
-   rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf 
0xff>;
rockchip,sdram-params = <0x30B25564 0x627 3 66600 3 9 1>;
 };
 
diff --git a/arch/arm/dts/rk3288-miniarm.dts b/arch/arm/dts/rk3288-miniarm.dts
index c741082..9083028 100644
--- a/arch/arm/dts/rk3288-miniarm.dts
+++ b/arch/arm/dts/rk3288-miniarm.dts
@@ -17,7 +17,6 @@
 };
 
  {
-   rockchip,num-channels = <2>;
rockchip,pctl-timing = <0x29a 0xc8 0x1f8 0x42 0x4e 0x4 0xea 0xa
0x5 0x0 0xa 0x7 0x19 0x24 0xa 0x7
0x5 0xa 0x5 0x200 0x5 0x10 0x40 0x0
@@ -25,8 +24,6 @@
0x5 0x0>;
rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
0xa60 0x40 0x10 0x0>;
-   /* Add a dummy value to cause of-platdata think this is bytes */
-   rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf 
0xff>;
rockchip,sdram-params = <0x30B25564 0x627 3 66600 3 9 1>;
 };
 
diff --git a/arch/arm/dts/rk3288-popmetal.dts b/arch/arm/dts/rk3288-popmetal.dts
index 3f61a61..284d5ed 100644
--- a/arch/arm/dts/rk3288-popmetal.dts
+++ b/arch/arm/dts/rk3288-popmetal.dts
@@ -17,7 +17,6 @@
 };
 
  {
-   rockchip,num-channels = <2>;
rockchip,pctl-timing = <0x29a 0xc8 0x1f8 0x42 0x4e 0x4 0xea 0xa
0x5 0x0 0xa 0x7 0x19 0x24 0xa 0x7
0x5 0xa 0x5 0x200 0x5 0x10 0x40 0x0
@@ -25,8 +24,6 @@
0x5 0x0>;
rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
0xa60 0x40 0x10 0x0>;
-   /* Add a dummy value to cause of-platdata think this is bytes */
-   rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf 
0xff>;
rockchip,sdram-params = <0x30B25564 0x627 3 66600 3 9 1>;
 };
 
diff --git a/arch/arm/dts/rk3288-rock2-square.dts 
b/arch/arm/dts/rk3288-rock2-square.dts
index 2c30355..11c580a 100644
--- a/arch/arm/dts/rk3288-rock2-square.dts
+++ b/arch/arm/dts/rk3288-rock2-square.dts
@@ -184,7 +184,6 @@
 };
 
  {
-   rockchip,num-channels = <2>;
rockchip,pctl-timing = <0x29a 0xc8 0x1f8 0x42 0x4e 0x4 0xea 0xa
0x5 0x0 0xa 0x7 0x19 0x24 0xa 0x7
0x5 0xa 0x5 0x200 0x5 0x10 0x40 0x0
@@ -192,7 +191,6 @@
0x5 

[U-Boot] [PATCH v2 2/3] rk3288: sdram: auto-detect the capacity

2016-09-19 Thread Kever Yang
Add support for rk3288 dram capacity auto detect, support DDR3 and
LPDDR3, DDR2 is not supported.
The program will automatically detect:
- channel number
- rank number
- column address number
- row address number

The dts file do not need to describe those info after apply this patch.

Signed-off-by: Kever Yang 
---

Changes in v2:
- update code for OF_PLATDATA enabled
- bug fix for ddrconfig

 arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 244 ++-
 1 file changed, 202 insertions(+), 42 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c 
b/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
index cf9ef2e..b3dc251 100644
--- a/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288/sdram_rk3288.c
@@ -57,6 +57,10 @@ struct rk3288_sdram_params {
struct regmap *map;
 };
 
+#define TEST_PATTEN0x5aa5f00f
+#define DQS_GATE_TRAINING_ERROR_RANK0  (1 << 4)
+#define DQS_GATE_TRAINING_ERROR_RANK1  (2 << 4)
+
 #ifdef CONFIG_SPL_BUILD
 static void copy_to_reg(u32 *dest, const u32 *src, u32 n)
 {
@@ -214,7 +218,7 @@ static void ddr_set_en_bst_odt(struct rk3288_grf *grf, uint 
channel,
 }
 
 static void pctl_cfg(u32 channel, struct rk3288_ddr_pctl *pctl,
-const struct rk3288_sdram_params *sdram_params,
+struct rk3288_sdram_params *sdram_params,
 struct rk3288_grf *grf)
 {
unsigned int burstlen;
@@ -264,7 +268,7 @@ static void pctl_cfg(u32 channel, struct rk3288_ddr_pctl 
*pctl,
 }
 
 static void phy_cfg(const struct chan_info *chan, u32 channel,
-   const struct rk3288_sdram_params *sdram_params)
+   struct rk3288_sdram_params *sdram_params)
 {
struct rk3288_ddr_publ *publ = chan->publ;
struct rk3288_msch *msch = chan->msch;
@@ -446,7 +450,7 @@ static void set_bandwidth_ratio(const struct chan_info 
*chan, u32 channel,
 }
 
 static int data_training(const struct chan_info *chan, u32 channel,
-const struct rk3288_sdram_params *sdram_params)
+struct rk3288_sdram_params *sdram_params)
 {
unsigned int j;
int ret = 0;
@@ -549,7 +553,7 @@ static void move_to_access_state(const struct chan_info 
*chan)
 }
 
 static void dram_cfg_rbc(const struct chan_info *chan, u32 chnum,
-const struct rk3288_sdram_params *sdram_params)
+struct rk3288_sdram_params *sdram_params)
 {
struct rk3288_ddr_publ *publ = chan->publ;
 
@@ -563,7 +567,7 @@ static void dram_cfg_rbc(const struct chan_info *chan, u32 
chnum,
 }
 
 static void dram_all_config(const struct dram_info *dram,
-   const struct rk3288_sdram_params *sdram_params)
+   struct rk3288_sdram_params *sdram_params)
 {
unsigned int chan;
u32 sys_reg = 0;
@@ -589,9 +593,173 @@ static void dram_all_config(const struct dram_info *dram,
writel(sys_reg, >pmu->sys_reg[2]);
rk_clrsetreg(>sgrf->soc_con2, 0x1f, sdram_params->base.stride);
 }
+const int ddrconf_table[] = {
+   /* row  col,bw */
+   0,
+   ((1 << 4) | 1),
+   ((2 << 4) | 1),
+   ((3 << 4) | 1),
+   ((4 << 4) | 1),
+   ((1 << 4) | 2),
+   ((2 << 4) | 2),
+   ((3 << 4) | 2),
+   ((1 << 4) | 0),
+   ((2 << 4) | 0),
+   ((3 << 4) | 0),
+   0,
+   0,
+   0,
+   0,
+   ((4 << 4) | 2),
+};
+
+static int sdram_rank_bw_detect(struct dram_info *dram, int channel,
+   struct rk3288_sdram_params *sdram_params)
+{
+   int reg;
+   int need_trainig = 0;
+   const struct chan_info *chan = >chan[channel];
+   struct rk3288_ddr_publ *publ = chan->publ;
+
+   if (-1 == data_training(chan, channel, sdram_params)) {
+   reg = readl(>datx8[0].dxgsr[0]);
+   /* Check the result for rank 0 */
+   if ((channel == 0) && (reg & DQS_GATE_TRAINING_ERROR_RANK0)) {
+   debug("data training fail!\n");
+   return -EIO;
+   } else if ((channel == 1) &&
+  (reg & DQS_GATE_TRAINING_ERROR_RANK0)) {
+   sdram_params->num_channels = 1;
+   }
+
+   /* Check the result for rank 1 */
+   if (reg & DQS_GATE_TRAINING_ERROR_RANK1) {
+   sdram_params->ch[channel].rank = 1;
+   clrsetbits_le32(>pgcr, 0xF << 18,
+   sdram_params->ch[channel].rank << 18);
+   need_trainig = 1;
+   }
+   reg = readl(>datx8[2].dxgsr[0]);
+   if (reg & (1 << 4)) {
+   sdram_params->ch[channel].bw = 1;
+   set_bandwidth_ratio(chan, channel,
+   sdram_params->ch[channel].bw,
+   

[U-Boot] [PATCH v2 0/3] Add sdram capacity auto detect for rk3288

2016-09-19 Thread Kever Yang

The rk3288 spl size is very close to 32KB while the rk3288 bootrom
has the limitation of maximum size of SPL is 32KB. After apply this
patch, the SPL size will exceed 32KB if we do not enable macro
CONFIG_ROCKCHIP_SPL_BACK_TO_BROM.

I think this patch is usful and should be go upstream other than the
size issue.

This patch has test with 2GB DDR3 and 2GB/4GB LPDDR3.

V2 add patch to clean some source code size for some rk3288 board to
make the SPL size in the 32KB limitation.


Changes in v2:
- update code for OF_PLATDATA enabled
- bug fix for ddrconfig

Kever Yang (3):
  rk3288: config change for enable dram capacity auto-detect.
  rk3288: sdram: auto-detect the capacity
  dts: rk3288: remove node in dmc which not need anymore

 arch/arm/dts/rk3288-evb.dts  |   3 -
 arch/arm/dts/rk3288-fennec.dts   |   3 -
 arch/arm/dts/rk3288-firefly.dts  |   2 -
 arch/arm/dts/rk3288-miniarm.dts  |   3 -
 arch/arm/dts/rk3288-popmetal.dts |   3 -
 arch/arm/dts/rk3288-rock2-square.dts |   2 -
 arch/arm/dts/rk3288-veyron.dtsi  |   2 -
 arch/arm/mach-rockchip/rk3288/sdram_rk3288.c | 244 ++-
 include/configs/evb_rk3288.h |   3 +-
 include/configs/fennec_rk3288.h  |   3 +-
 include/configs/miniarm_rk3288.h |   3 +-
 include/configs/popmetal_rk3288.h|   3 +-
 12 files changed, 206 insertions(+), 68 deletions(-)

-- 
1.9.1

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


[U-Boot] [PATCH v2 1/3] rk3288: config change for enable dram capacity auto-detect.

2016-09-19 Thread Kever Yang
Enable ROCKCHIP_SPL_BACK_TO_BROM and disable CONFIG_SPL_MMC_SUPPORT
to save memory in order to enable add source code for dram capacity
auto-detect.

Signed-off-by: Kever Yang 
---

Changes in v2: None

 include/configs/evb_rk3288.h  | 3 +--
 include/configs/fennec_rk3288.h   | 3 +--
 include/configs/miniarm_rk3288.h  | 3 +--
 include/configs/popmetal_rk3288.h | 3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/include/configs/evb_rk3288.h b/include/configs/evb_rk3288.h
index 342557f..9f32184 100644
--- a/include/configs/evb_rk3288.h
+++ b/include/configs/evb_rk3288.h
@@ -7,11 +7,10 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
 #define ROCKCHIP_DEVICE_SETTINGS
 #include 
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
diff --git a/include/configs/fennec_rk3288.h b/include/configs/fennec_rk3288.h
index 342557f..9f32184 100644
--- a/include/configs/fennec_rk3288.h
+++ b/include/configs/fennec_rk3288.h
@@ -7,11 +7,10 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
 #define ROCKCHIP_DEVICE_SETTINGS
 #include 
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
diff --git a/include/configs/miniarm_rk3288.h b/include/configs/miniarm_rk3288.h
index 342557f..9f32184 100644
--- a/include/configs/miniarm_rk3288.h
+++ b/include/configs/miniarm_rk3288.h
@@ -7,11 +7,10 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
 #define ROCKCHIP_DEVICE_SETTINGS
 #include 
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
diff --git a/include/configs/popmetal_rk3288.h 
b/include/configs/popmetal_rk3288.h
index 342557f..9f32184 100644
--- a/include/configs/popmetal_rk3288.h
+++ b/include/configs/popmetal_rk3288.h
@@ -7,11 +7,10 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#define CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
 #define ROCKCHIP_DEVICE_SETTINGS
 #include 
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
-- 
1.9.1

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


[U-Boot] [PATCH v2] dm/mmc: gen_atmel_mci: Add driver model support for mci

2016-09-19 Thread Wenyou Yang
Add the driver model support for Atmel mci while retaining the
existing legacy code. This allows the driver to support boards
that have converted to driver model as well as those that have not.

Signed-off-by: Wenyou Yang 
---

Changes in v2:
 - Change the return type of atmel_mci_setup_cfg() from int to void.
 - Add comments on the features depends on the IP version.
 - Add the error handle path of clock.
 - Fix the missing use priv->bus_clk_rate.
 - Return from mmc_bind() directly, instead of checking its return.

 drivers/mmc/Kconfig |   9 +++
 drivers/mmc/gen_atmel_mci.c | 164 +++-
 2 files changed, 172 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
index a71afa5..e56eb94 100644
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
@@ -44,6 +44,15 @@ config ATMEL_SDHCI
  It is compliant with the SD Host Controller Standard V3.0
  specification.
 
+config GENERIC_ATMEL_MCI
+   bool "Atmel Multimedia Card Interface support"
+   depends on DM_MMC && BLK && DM_MMC_OPS && ARCH_AT91
+   help
+ This enables support for Atmel High Speed Multimedia Card Interface
+ (HSMCI), which supports the MultiMedia Card (MMC) Specification V4.3,
+ the SD Memory Card Specification V2.0, the SDIO V2.0 specification
+ and CE-ATA V1.1.
+
 config ROCKCHIP_DWMMC
bool "Rockchip SD/MMC controller support"
depends on DM_MMC && OF_CONTROL
diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c
index 69770df..b2d6d86 100644
--- a/drivers/mmc/gen_atmel_mci.c
+++ b/drivers/mmc/gen_atmel_mci.c
@@ -10,6 +10,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -18,8 +19,11 @@
 #include 
 #include 
 #include 
+#include 
 #include "atmel_mci.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifndef CONFIG_SYS_MMC_CLK_OD
 # define CONFIG_SYS_MMC_CLK_OD 15
 #endif
@@ -37,6 +41,10 @@ struct atmel_mci_priv {
struct atmel_mci*mci;
unsigned intinitialized:1;
unsigned intcurr_clk;
+#ifdef CONFIG_DM_MMC
+   struct mmc  mmc;
+   ulong   bus_clk_rate;
+#endif
 };
 
 /* Read Atmel MCI IP version */
@@ -57,12 +65,20 @@ static void dump_cmd(u32 cmdr, u32 arg, u32 status, const 
char* msg)
  cmdr, cmdr & 0x3F, arg, status, msg);
 }
 
+#ifndef CONFIG_DM_MMC
 /* Setup for MCI Clock and Block Size */
 static void mci_set_mode(struct mmc *mmc, u32 hz, u32 blklen)
 {
struct atmel_mci_priv *priv = mmc->priv;
-   atmel_mci_t *mci = priv->mci;
u32 bus_hz = get_mci_clk_rate();
+#else
+static void mci_set_mode(struct atmel_mci_priv *priv, u32 hz, u32 blklen)
+{
+   struct mmc *mmc = >mmc;
+   u32 bus_hz = priv->bus_clk_rate;
+#endif
+
+   atmel_mci_t *mci = priv->mci;
u32 clkdiv = 255;
unsigned int version = atmel_mci_get_version(mci);
u32 clkodd = 0;
@@ -202,10 +218,18 @@ io_fail:
  * Sends a command out on the bus and deals with the block data.
  * Takes the mmc pointer, a command pointer, and an optional data pointer.
  */
+#ifndef CONFIG_DM_MMC
 static int
 mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 {
struct atmel_mci_priv *priv = mmc->priv;
+#else
+static int atmel_mci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
+ struct mmc_data *data)
+{
+   struct atmel_mci_priv *priv = dev_get_priv(dev);
+   struct mmc *mmc = mmc_get_mmc_dev(dev);
+#endif
atmel_mci_t *mci = priv->mci;
u32 cmdr;
u32 error_flags = 0;
@@ -335,17 +359,29 @@ mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct 
mmc_data *data)
return 0;
 }
 
+#ifndef CONFIG_DM_MMC
 /* Entered into mmc structure during driver init */
 static void mci_set_ios(struct mmc *mmc)
 {
struct atmel_mci_priv *priv = mmc->priv;
+#else
+static int atmel_mci_set_ios(struct udevice *dev)
+{
+   struct atmel_mci_priv *priv = dev_get_priv(dev);
+   struct mmc *mmc = mmc_get_mmc_dev(dev);
+#endif
+
atmel_mci_t *mci = priv->mci;
int bus_width = mmc->bus_width;
unsigned int version = atmel_mci_get_version(mci);
int busw;
 
/* Set the clock speed */
+#ifndef CONFIG_DM_MMC
mci_set_mode(mmc, mmc->clock, MMC_DEFAULT_BLKLEN);
+#else
+   mci_set_mode(priv, mmc->clock, MMC_DEFAULT_BLKLEN);
+#endif
 
/*
 * set the bus width and select slot for this interface
@@ -370,12 +406,22 @@ static void mci_set_ios(struct mmc *mmc)
 
writel(busw << 7 | MMCI_BF(SCDSEL, MCI_BUS), >sdcr);
}
+
+#ifdef CONFIG_DM_MMC
+   return 0;
+#endif
 }
 
+
+#ifndef CONFIG_DM_MMC
 /* Entered into mmc structure during driver init */
 static int mci_init(struct mmc *mmc)
 {
struct atmel_mci_priv *priv = mmc->priv;
+#else
+static int atmel_mci_hw_init(struct atmel_mci_priv *priv)
+{
+#endif
  

[U-Boot] [PATCH 27/28] Convert CONFIG_SYS_CONSOLE_INFO_QUIET to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_INFO_QUIET

Signed-off-by: Simon Glass 
---

 README  | 3 ---
 common/Kconfig  | 8 
 configs/10m50_defconfig | 1 +
 configs/3c120_defconfig | 1 +
 configs/CPCI2DP_defconfig   | 1 +
 configs/CPCI4052_defconfig  | 1 +
 configs/M5249EVB_defconfig  | 1 +
 configs/MIP405T_defconfig   | 1 +
 configs/MIP405_defconfig| 1 +
 configs/PIP405_defconfig| 1 +
 configs/PLU405_defconfig| 1 +
 configs/PMC405DE_defconfig  | 1 +
 configs/VOM405_defconfig| 1 +
 configs/a3m071_defconfig| 1 +
 configs/a4m2k_defconfig | 1 +
 configs/acadia_defconfig| 1 +
 configs/am335x_baltos_defconfig | 1 +
 configs/am335x_boneblack_defconfig  | 3 ++-
 configs/am335x_boneblack_vboot_defconfig| 3 ++-
 configs/am335x_evm_defconfig| 1 +
 configs/am335x_evm_nor_defconfig| 1 +
 configs/am335x_evm_norboot_defconfig| 1 +
 configs/am335x_evm_spiboot_defconfig| 3 ++-
 configs/am335x_evm_usbspl_defconfig | 1 +
 configs/am335x_igep0033_defconfig   | 1 +
 configs/am335x_shc_defconfig| 1 +
 configs/am335x_shc_ict_defconfig| 1 +
 configs/am335x_shc_netboot_defconfig| 1 +
 configs/am335x_shc_prompt_defconfig | 1 +
 configs/am335x_shc_sdboot_defconfig | 1 +
 configs/am335x_shc_sdboot_prompt_defconfig  | 1 +
 configs/am335x_sl50_defconfig   | 1 +
 configs/am43xx_evm_defconfig| 1 +
 configs/am43xx_evm_ethboot_defconfig| 1 +
 configs/am43xx_evm_qspiboot_defconfig   | 1 +
 configs/am43xx_evm_usbhost_boot_defconfig   | 1 +
 configs/am43xx_hs_evm_defconfig | 1 +
 configs/am57xx_evm_defconfig| 3 ++-
 configs/am57xx_evm_nodt_defconfig   | 3 ++-
 configs/am57xx_hs_evm_defconfig | 3 ++-
 configs/amcore_defconfig| 1 +
 configs/arches_defconfig| 1 +
 configs/bamboo_defconfig| 1 +
 configs/bayleybay_defconfig | 1 +
 configs/birdland_bav335a_defconfig  | 1 +
 configs/birdland_bav335b_defconfig  | 1 +
 configs/brppt1_mmc_defconfig| 1 +
 configs/brppt1_nand_defconfig   | 1 +
 configs/brppt1_spi_defconfig| 1 +
 configs/brxre1_defconfig| 1 +
 configs/bubinga_defconfig   | 1 +
 configs/cairo_defconfig | 1 +
 configs/canyonlands_defconfig   | 1 +
 configs/chromebook_link_defconfig   | 1 +
 configs/chromebook_samus_defconfig  | 1 +
 configs/chromebox_panther_defconfig | 1 +
 configs/clearfog_defconfig  | 1 +
 configs/cm_t335_defconfig   | 1 +
 configs/cm_t43_defconfig| 1 +
 configs/cm_t54_defconfig| 4 ++--
 configs/conga-qeval20-qa3-e3845-internal-uart_defconfig | 1 +
 configs/conga-qeval20-qa3-e3845_defconfig   | 1 +
 configs/coreboot-x86_defconfig  | 1 +
 configs/cougarcanyon2_defconfig | 1 +
 configs/crownbay_defconfig  | 1 +
 configs/db-88f6720_defconfig| 1 +
 configs/db-88f6820-gp_defconfig | 1 +
 configs/db-mv784mp-gp_defconfig | 1 +
 configs/devconcenter_defconfig  | 1 +
 configs/devkit8000_defconfig| 3 ++-
 configs/dfi-bt700-q7x-151_defconfig | 1 +
 configs/dlvision-10g_defconfig  | 1 +
 configs/dlvision_defconfig  | 1 +
 configs/dra7xx_evm_defconfig| 3 ++-
 configs/dra7xx_hs_evm_defconfig | 3 ++-
 configs/draco_defconfig | 1 +
 configs/duovero_defconfig 

Re: [U-Boot] [PATCH] mmc: cat u8 to u64 to avoid unexpected error

2016-09-19 Thread Tom Rini
On Tue, Sep 20, 2016 at 11:04:40AM +0900, Jaehoon Chung wrote:
> On 09/19/2016 08:30 PM, Tom Rini wrote:
> > On Mon, Sep 19, 2016 at 03:31:54PM +0900, Jaehoon Chung wrote:
> >> On 09/19/2016 02:53 AM, Tom Rini wrote:
> >>> On Tue, Sep 13, 2016 at 04:27:57PM +0800, Haibo Chen wrote:
> >>>
>  Suspicious implicit sign extension exist. ext_csd[] is defined
>  as "u8", capacity is defined as u64, so u8 is promoted to signed
>  int first int the "|" expersion, then the sign extended to u64.
>  if the tmp sign value is largeer than 0x7fff, after the sign
>  extension, the upper bits of the result will all be 1.
>  Thanks to coverity 
> 
>  e.g.
>   u8  data_8;
>   u64 data_64;
> 
>   data_8 = 0x80;
>   data_64 = data_8 << 24; //0x8000
>   data_64 = ((u64)data_8) << 24;  //0x8000
> 
>  Signed-off-by: Haibo Chen 
> >>>
> >>> Please add a 'Reported-by: Coverity' and you can include the CID if you
> >>> like.
> >>
> >> I think cid doesn't need to change type.
> > 
> > I mean the coverity CID :)  In the public coverity project it's 149300
> 
> Ah! I misunderstood CID as cid register. :)
> 
> > 
> >>
> >>>
>  ---
>   drivers/mmc/mmc.c | 8 
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
>  diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
>  index 43ea0bb..c1d1dc6 100644
>  --- a/drivers/mmc/mmc.c
>  +++ b/drivers/mmc/mmc.c
>  @@ -1176,10 +1176,10 @@ static int mmc_startup(struct mmc *mmc)
>    * ext_csd's capacity is valid if the value is 
>  more
>    * than 2GB
>    */
>  -capacity = ext_csd[EXT_CSD_SEC_CNT] << 0
>  -| ext_csd[EXT_CSD_SEC_CNT + 1] 
>  << 8
>  -| ext_csd[EXT_CSD_SEC_CNT + 2] 
>  << 16
>  -| ext_csd[EXT_CSD_SEC_CNT + 3] 
>  << 24;
>  +capacity = ((u64)ext_csd[EXT_CSD_SEC_CNT]) << 0
>  +| ((u64)ext_csd[EXT_CSD_SEC_CNT 
>  + 1]) << 8
>  +| ((u64)ext_csd[EXT_CSD_SEC_CNT 
>  + 2]) << 16
>  +| ((u64)ext_csd[EXT_CSD_SEC_CNT 
>  + 3]) << 24;
>   capacity *= MMC_MAX_BLOCK_LEN;
>   if ((capacity >> 20) > 2 * 1024)
>   mmc->capacity_user = capacity;
> >>>
> >>> Can't we just move capacity down to a u8 instead?  Thanks!
> >>
> >> Maybe not to move down to a u8..because it's displayed the real capacity 
> >> for storage.
> > 
> > We could update those lines too?  It's just that one case right there,
> > yes?
> 
> If it's possible to calculate the correct capacity?

... I think?  I hadn't had my coffee yet when I did a quick compile test
this morning but it looks like all of the uses of capacity would fit
into a u8.  Someone should check and make a formal patch :)

-- 
Tom


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


[U-Boot] [PATCH 08/28] Convert CONFIG_CFB_CONSOLE to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_CFB_CONSOLE

Signed-off-by: Simon Glass 
---

 README | 39 -
 configs/A10-OLinuXino-Lime_defconfig   |  1 +
 configs/A10s-OLinuXino-M_defconfig |  1 +
 configs/A13-OLinuXinoM_defconfig   |  1 +
 configs/A13-OLinuXino_defconfig|  1 +
 configs/A20-OLinuXino-Lime2_defconfig  |  1 +
 configs/A20-OLinuXino-Lime_defconfig   |  1 +
 configs/A20-OLinuXino_MICRO_defconfig  |  1 +
 configs/A20-Olimex-SOM-EVB_defconfig   |  1 +
 configs/A33-OLinuXino_defconfig|  1 +
 configs/Ainol_AW1_defconfig|  1 +
 configs/Ampe_A76_defconfig |  1 +
 configs/Auxtek-T003_defconfig  |  1 +
 configs/Auxtek-T004_defconfig  |  1 +
 configs/Bananapi_defconfig |  1 +
 configs/Bananapro_defconfig|  1 +
 configs/CHIP_defconfig |  1 +
 configs/CSQ_CS908_defconfig|  1 +
 configs/Chuwi_V7_CW0825_defconfig  |  1 +
 configs/Colombus_defconfig |  1 +
 configs/Cubieboard2_defconfig  |  1 +
 configs/Cubieboard_defconfig   |  1 +
 configs/Cubietruck_defconfig   |  1 +
 configs/Empire_electronix_d709_defconfig   |  1 +
 configs/Empire_electronix_m712_defconfig   |  1 +
 configs/Hummingbird_A31_defconfig  |  1 +
 configs/Hyundai_A7HD_defconfig |  1 +
 configs/Itead_Ibox_A20_defconfig   |  1 +
 configs/Lamobo_R1_defconfig|  1 +
 configs/Linksprite_pcDuino3_Nano_defconfig |  1 +
 configs/Linksprite_pcDuino3_defconfig  |  1 +
 configs/Linksprite_pcDuino_defconfig   |  1 +
 configs/MIP405T_defconfig  |  1 +
 configs/MIP405_defconfig   |  1 +
 configs/MK808C_defconfig   |  1 +
 configs/MPC8536DS_36BIT_defconfig  |  1 +
 configs/MPC8536DS_SDCARD_defconfig |  1 +
 configs/MPC8536DS_SPIFLASH_defconfig   |  1 +
 configs/MPC8536DS_defconfig|  1 +
 configs/MPC8544DS_defconfig|  1 +
 configs/MPC8572DS_36BIT_defconfig  |  1 +
 configs/MPC8572DS_defconfig|  1 +
 configs/MPC8610HPCD_defconfig  |  1 +
 configs/MPC8641HPCN_36BIT_defconfig|  1 +
 configs/MPC8641HPCN_defconfig  |  1 +
 configs/MSI_Primo73_defconfig  |  1 +
 configs/MSI_Primo81_defconfig  |  1 +
 configs/Marsboard_A10_defconfig|  1 +
 configs/Mele_A1000G_quad_defconfig |  1 +
 configs/Mele_A1000_defconfig   |  1 +
 configs/Mele_I7_defconfig  |  1 +
 configs/Mele_M3_defconfig  |  1 +
 configs/Mele_M5_defconfig  |  1 +
 configs/Mele_M9_defconfig  |  1 +
 configs/Mini-X_defconfig   |  1 +
 configs/MiniFAP_defconfig  |  1 +
 configs/Orangepi_defconfig |  1 +
 configs/Orangepi_mini_defconfig|  1 +
 configs/PIP405_defconfig   |  1 +
 configs/Sinlinx_SinA31s_defconfig  |  1 +
 configs/Sinlinx_SinA33_defconfig   |  1 +
 configs/Sinovoip_BPI_M2_defconfig  |  1 +
 configs/T1024QDS_DDR4_SECURE_BOOT_defconfig|  1 +
 configs/T1024QDS_DDR4_defconfig|  1 +
 configs/T1024QDS_NAND_defconfig|  3 +-
 configs/T1024QDS_SDCARD_defconfig  |  3 +-
 configs/T1024QDS_SECURE_BOOT_defconfig |  1 +
 configs/T1024QDS_SPIFLASH_defconfig|  1 +
 configs/T1024QDS_defconfig |  1 +
 configs/T1040QDS_DDR4_defconfig|  1 +
 configs/T1040QDS_SECURE_BOOT_defconfig |  1 +
 configs/T1040QDS_defconfig |  1 +
 configs/T1042D4RDB_NAND_defconfig  |  3 +-
 configs/T1042D4RDB_SDCARD_defconfig|  3 +-
 configs/T1042D4RDB_SECURE_BOOT_defconfig   |  1 +
 configs/T1042D4RDB_SPIFLASH_defconfig  |  1 +
 configs/T1042D4RDB_defconfig   |  1 +
 configs/T1042RDB_PI_NAND_SECURE_BOOT_defconfig |  3 +-
 configs/T1042RDB_PI_NAND_defconfig |  3 +-
 configs/T1042RDB_PI_SDCARD_defconfig   |  3 +-
 configs/T1042RDB_PI_SPIFLASH_defconfig |  1 +
 configs/T1042RDB_PI_defconfig  |  1 +
 

[U-Boot] [PATCH 16/28] Convert CONFIG_VGA_AS_SINGLE_DEVICE to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_VGA_AS_SINGLE_DEVICE

Once we migrate to driver model for video, we should be able to drop this
option.

Signed-off-by: Simon Glass 
---

 configs/A10-OLinuXino-Lime_defconfig| 1 +
 configs/A10s-OLinuXino-M_defconfig  | 1 +
 configs/A13-OLinuXinoM_defconfig| 1 +
 configs/A13-OLinuXino_defconfig | 1 +
 configs/A20-OLinuXino-Lime2_defconfig   | 1 +
 configs/A20-OLinuXino-Lime_defconfig| 1 +
 configs/A20-OLinuXino_MICRO_defconfig   | 1 +
 configs/A20-Olimex-SOM-EVB_defconfig| 1 +
 configs/A33-OLinuXino_defconfig | 1 +
 configs/Ainol_AW1_defconfig | 1 +
 configs/Ampe_A76_defconfig  | 1 +
 configs/Auxtek-T003_defconfig   | 1 +
 configs/Auxtek-T004_defconfig   | 1 +
 configs/Bananapi_defconfig  | 1 +
 configs/Bananapro_defconfig | 1 +
 configs/CHIP_defconfig  | 1 +
 configs/CSQ_CS908_defconfig | 1 +
 configs/Chuwi_V7_CW0825_defconfig   | 3 ++-
 configs/Colombus_defconfig  | 1 +
 configs/Cubieboard2_defconfig   | 1 +
 configs/Cubieboard_defconfig| 1 +
 configs/Cubietruck_defconfig| 1 +
 configs/Empire_electronix_d709_defconfig| 1 +
 configs/Empire_electronix_m712_defconfig| 1 +
 configs/Hummingbird_A31_defconfig   | 1 +
 configs/Hyundai_A7HD_defconfig  | 1 +
 configs/Itead_Ibox_A20_defconfig| 1 +
 configs/Lamobo_R1_defconfig | 1 +
 configs/Linksprite_pcDuino3_Nano_defconfig  | 1 +
 configs/Linksprite_pcDuino3_defconfig   | 1 +
 configs/Linksprite_pcDuino_defconfig| 1 +
 configs/MIP405T_defconfig   | 1 +
 configs/MIP405_defconfig| 1 +
 configs/MK808C_defconfig| 1 +
 configs/MPC8536DS_36BIT_defconfig   | 1 +
 configs/MPC8536DS_SDCARD_defconfig  | 1 +
 configs/MPC8536DS_SPIFLASH_defconfig| 1 +
 configs/MPC8536DS_defconfig | 1 +
 configs/MPC8544DS_defconfig | 1 +
 configs/MPC8572DS_36BIT_defconfig   | 1 +
 configs/MPC8572DS_defconfig | 1 +
 configs/MPC8610HPCD_defconfig   | 1 +
 configs/MPC8641HPCN_36BIT_defconfig | 1 +
 configs/MPC8641HPCN_defconfig   | 1 +
 configs/MSI_Primo73_defconfig   | 1 +
 configs/MSI_Primo81_defconfig   | 3 ++-
 configs/Marsboard_A10_defconfig | 1 +
 configs/Mele_A1000G_quad_defconfig  | 1 +
 configs/Mele_A1000_defconfig| 1 +
 configs/Mele_I7_defconfig   | 1 +
 configs/Mele_M3_defconfig   | 1 +
 configs/Mele_M5_defconfig   | 1 +
 configs/Mele_M9_defconfig   | 1 +
 configs/Mini-X_defconfig| 1 +
 configs/MiniFAP_defconfig   | 1 +
 configs/Orangepi_defconfig  | 1 +
 configs/Orangepi_mini_defconfig | 1 +
 configs/PIP405_defconfig| 1 +
 configs/Sinlinx_SinA31s_defconfig   | 1 +
 configs/Sinlinx_SinA33_defconfig| 1 +
 configs/Sinovoip_BPI_M2_defconfig   | 1 +
 configs/T1024QDS_DDR4_SECURE_BOOT_defconfig | 1 +
 configs/T1024QDS_DDR4_defconfig | 1 +
 configs/T1024QDS_NAND_defconfig | 3 ++-
 configs/T1024QDS_SDCARD_defconfig   | 3 ++-
 configs/T1024QDS_SECURE_BOOT_defconfig  | 1 +
 configs/T1024QDS_SPIFLASH_defconfig | 1 +
 configs/T1024QDS_defconfig  | 1 +
 configs/T1040QDS_DDR4_defconfig | 1 +
 configs/T1040QDS_SECURE_BOOT_defconfig  | 1 +
 configs/T1040QDS_defconfig  | 1 +
 configs/T1042D4RDB_NAND_defconfig   | 3 ++-
 configs/T1042D4RDB_SDCARD_defconfig | 3 ++-
 configs/T1042D4RDB_SECURE_BOOT_defconfig| 1 +
 configs/T1042D4RDB_SPIFLASH_defconfig   | 1 +
 configs/T1042D4RDB_defconfig  

Re: [U-Boot] [PATCH v3 4/6] power: regulator: palmas: Add regulator support

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 11:47:36AM +0530, Keerthy wrote:

> The driver provides regulator set/get voltage
> enable/disable functions for palmas family of PMICs.
> 
> Signed-off-by: Keerthy 
> Reviewed-by: Simon Glass 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH v3 6/6] configs: dra7xx_evm_defconfig: Enable PALMAS options

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 11:47:38AM +0530, Keerthy wrote:

> Enable palmas PMIC config options.
> 
> Signed-off-by: Keerthy 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH v3 5/6] configs: am57xx_evm_defconfig: Enable PALMAS options

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 11:47:37AM +0530, Keerthy wrote:

> Enable palmas PMIC config options.
> 
> Signed-off-by: Keerthy 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH v3 3/6] power: pmic: Palmas: Add the base pmic support

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 11:47:35AM +0530, Keerthy wrote:

> Add support to bind the regulators/child nodes with the pmic.
> 
> Signed-off-by: Keerthy 
> Reviewed-by: Simon Glass 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH v3 2/6] power: regulator: Add ctrl_reg and volt_reg fields for pmic

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 11:47:34AM +0530, Keerthy wrote:

> The ctrl reg contains bit fields to enable and disable regulators,
> and volt_reg has the bit fields to configure the voltage values.
> The registers are frequently accessed hence make them part
> of dm_regulator_uclass_platdata structure.
> 
> Signed-off-by: Keerthy 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH v3 1/6] dm: i2c: Add u8 read/write i2c functions

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 11:47:33AM +0530, Keerthy wrote:

> Add u8 i2c read/write hooks.
> 
> Signed-off-by: Keerthy 

Reviewed-by: Tom Rini 

-- 
Tom


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


[U-Boot] [PATCH 2/2] PowerPC: Update last users of CONFIG_ISO_STRING to Kconfig

2016-09-19 Thread Tom Rini
There are a few boards that use CONFIG_ISO_STRING as part of a sanity
check during firmware update at run time.  Move this string to Kconfig.

Signed-off-by: Tom Rini 
---
 board/mpl/pati/Kconfig   | 3 +++
 board/mpl/pati/pati.h| 1 -
 board/mpl/pip405/Kconfig | 3 +++
 include/configs/PATI.h   | 3 ---
 include/configs/PIP405.h | 6 --
 scripts/config_whitelist.txt | 1 -
 6 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/board/mpl/pati/Kconfig b/board/mpl/pati/Kconfig
index b141da3..0eeaf70 100644
--- a/board/mpl/pati/Kconfig
+++ b/board/mpl/pati/Kconfig
@@ -9,4 +9,7 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
default "PATI"
 
+config ISO_STRING
+   string
+   default "MEV-10084-001"
 endif
diff --git a/board/mpl/pati/pati.h b/board/mpl/pati/pati.h
index 66760d7..4fd345b 100644
--- a/board/mpl/pati/pati.h
+++ b/board/mpl/pati/pati.h
@@ -203,7 +203,6 @@
 
 #if defined(CONFIG_TARGET_MIP405)
 #define PATI_FIRMWARE_START_OFFSET 0x0030
-#define PATI_ISO_STRING  "MEV-10084-001"
 #endif
 
 #define PATI_ENDIAN_MODE   0x3E
diff --git a/board/mpl/pip405/Kconfig b/board/mpl/pip405/Kconfig
index f485367..e7ae6af 100644
--- a/board/mpl/pip405/Kconfig
+++ b/board/mpl/pip405/Kconfig
@@ -9,4 +9,7 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
default "PIP405"
 
+config ISO_STRING
+   string
+   default "MEV-10066-001"
 endif
diff --git a/include/configs/PATI.h b/include/configs/PATI.h
index 880246e..ebabdff 100644
--- a/include/configs/PATI.h
+++ b/include/configs/PATI.h
@@ -252,7 +252,4 @@
  */
 #define CONFIG_SYS_DER 0x
 
-#define VERSION_TAG "released"
-#define CONFIG_ISO_STRING "MEV-10084-001"
-
 #endif /* __CONFIG_H */
diff --git a/include/configs/PIP405.h b/include/configs/PIP405.h
index 9ace443..7d08f0c 100644
--- a/include/configs/PIP405.h
+++ b/include/configs/PIP405.h
@@ -333,10 +333,4 @@
  /
 #define CONFIG_BZIP2   1
 
-/
- * Ident
- /
-#define VERSION_TAG "released"
-#define CONFIG_ISO_STRING "MEV-10066-001"
-
 #endif /* __CONFIG_H */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 090c0a2..cb4516f 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1728,7 +1728,6 @@ CONFIG_IRAM_STACK
 CONFIG_IRAM_TOP
 CONFIG_IRDA_BASE
 CONFIG_ISO_PARTITION
-CONFIG_ISO_STRING
 CONFIG_ISP1362_USB
 CONFIG_IS_
 CONFIG_IS_BUILTIN
-- 
2.1.4

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


[U-Boot] [PATCH 1/2] PowerPC: Update MIP405/MIP405T to use Kconfig better

2016-09-19 Thread Tom Rini
Convert CONFIG_MIP405T from SYS_EXTRA_OPTIONS to a real config

There are two boards, MIP405 and MIP405T that have a few differences.
Start by checking for CONFIG_TARGET_MIP405.  Then introduce
CONFIG_TARGET_MIP405T and use that not CONFIG_MIP405T.  Next, convert
also convert the usage of CONFIG_ISO_STRING to be based on Kconfig.

Signed-off-by: Tom Rini 
---
 arch/powerpc/cpu/ppc4xx/4xx_pci.c  |  4 ++--
 arch/powerpc/cpu/ppc4xx/Kconfig|  3 +++
 arch/powerpc/cpu/ppc4xx/resetvec.S |  2 +-
 board/mpl/common/common_util.c | 12 ++--
 board/mpl/common/common_util.h |  2 +-
 board/mpl/common/pci_parts.h   |  4 ++--
 board/mpl/mip405/Kconfig   |  7 ++-
 board/mpl/mip405/mip405.c  | 14 +++---
 board/mpl/pati/pati.h  |  2 +-
 configs/MIP405T_defconfig  |  3 +--
 include/configs/MIP405.h   | 18 +++---
 scripts/config_whitelist.txt   |  2 --
 12 files changed, 33 insertions(+), 40 deletions(-)

diff --git a/arch/powerpc/cpu/ppc4xx/4xx_pci.c 
b/arch/powerpc/cpu/ppc4xx/4xx_pci.c
index 30e6c65..314cfdc 100644
--- a/arch/powerpc/cpu/ppc4xx/4xx_pci.c
+++ b/arch/powerpc/cpu/ppc4xx/4xx_pci.c
@@ -118,7 +118,7 @@ void pci_405gp_init(struct pci_controller *hose)
 #endif
unsigned long ptmla[2]= {CONFIG_SYS_PCI_PTM1LA, 
CONFIG_SYS_PCI_PTM2LA};
unsigned long ptmms[2]= {CONFIG_SYS_PCI_PTM1MS, 
CONFIG_SYS_PCI_PTM2MS};
-#if defined(CONFIG_PIP405) || defined (CONFIG_MIP405)
+#if defined(CONFIG_PIP405) || defined (CONFIG_TARGET_MIP405)
unsigned long pmmla[3]= {0x8000, 0xA000, 0};
unsigned long pmmma[3]= {0xE001, 0xE001, 0};
unsigned long pmmpcila[3] = {0x8000, 0x, 0};
@@ -408,7 +408,7 @@ void pci_405gp_setup_vga(struct pci_controller *hose, 
pci_dev_t dev,
pci_hose_write_config_dword(hose, dev, PCI_COMMAND, cmdstat);
 }
 
-#if !(defined(CONFIG_PIP405) || defined (CONFIG_MIP405))
+#if !(defined(CONFIG_PIP405) || defined (CONFIG_TARGET_MIP405))
 
 /*
  *As is these functs get called out of flash Not a horrible
diff --git a/arch/powerpc/cpu/ppc4xx/Kconfig b/arch/powerpc/cpu/ppc4xx/Kconfig
index 92a330d..a6066ef 100644
--- a/arch/powerpc/cpu/ppc4xx/Kconfig
+++ b/arch/powerpc/cpu/ppc4xx/Kconfig
@@ -104,6 +104,9 @@ config TARGET_ICON
 config TARGET_MIP405
bool "Support MIP405"
 
+config TARGET_MIP405T
+   bool "Support MIP405T"
+
 config TARGET_PIP405
bool "Support PIP405"
 
diff --git a/arch/powerpc/cpu/ppc4xx/resetvec.S 
b/arch/powerpc/cpu/ppc4xx/resetvec.S
index b3308bd..4144837 100644
--- a/arch/powerpc/cpu/ppc4xx/resetvec.S
+++ b/arch/powerpc/cpu/ppc4xx/resetvec.S
@@ -4,7 +4,7 @@
 #if defined(CONFIG_440)
b _start_440
 #else
-#if defined(CONFIG_BOOT_PCI) && defined(CONFIG_MIP405)
+#if defined(CONFIG_BOOT_PCI) && defined(CONFIG_TARGET_MIP405)
b _start_pci
 #else
b _start
diff --git a/board/mpl/common/common_util.c b/board/mpl/common/common_util.c
index 2262175..c1a4b62 100644
--- a/board/mpl/common/common_util.c
+++ b/board/mpl/common/common_util.c
@@ -20,7 +20,7 @@
 #include "../pip405/pip405.h"
 #include 
 #endif
-#ifdef CONFIG_MIP405
+#ifdef CONFIG_TARGET_MIP405
 #include "../mip405/mip405.h"
 #include 
 #endif
@@ -36,7 +36,7 @@ extern int mem_test(ulong start, ulong ramsize, int quiet);
 #define I2C_BACKUP_ADDR 0x7C00 /* 0x200 bytes for backup */
 #define IMAGE_SIZE CONFIG_SYS_MONITOR_LEN  /* ugly, but it works for now */
 
-#if defined(CONFIG_PIP405) || defined(CONFIG_MIP405)
+#if defined(CONFIG_PIP405) || defined(CONFIG_TARGET_MIP405)
 /*---
  * On PIP/MIP405 we have 3 (4) possible boot mode
  *
@@ -116,7 +116,7 @@ void setup_cs_reloc(void)
mtdcr(EBC0_CFGDATA, FLASH_CR_B);
}
 }
-#endif /* #if defined(CONFIG_PIP405) || defined(CONFIG_MIP405) */
+#endif /* #if defined(CONFIG_PIP405) || defined(CONFIG_TARGET_MIP405) */
 
 #ifdef CONFIG_SYS_UPDATE_FLASH_SIZE
 /* adjust flash start and protection info */
@@ -190,12 +190,12 @@ mpl_prg(uchar *src, ulong size)
 #if defined(CONFIG_PATI)
int start_sect;
 #endif
-#if defined(CONFIG_PIP405) || defined(CONFIG_MIP405) || defined(CONFIG_PATI)
+#if defined(CONFIG_PIP405) || defined(CONFIG_TARGET_MIP405) || 
defined(CONFIG_PATI)
char *copystr = (char *)src;
ulong *magic = (ulong *)src;
 #endif
 
-#if defined(CONFIG_PIP405) || defined(CONFIG_MIP405) || defined(CONFIG_PATI)
+#if defined(CONFIG_PIP405) || defined(CONFIG_TARGET_MIP405) || 
defined(CONFIG_PATI)
if (uimage_to_cpu (magic[0]) != IH_MAGIC) {
puts("Bad Magic number\n");
return -1;
@@ -701,7 +701,7 @@ void video_get_info_str (int line_number, char *info)
strcpy(buf,"### No HW ID - assuming PIP405");
}
 #endif
-#ifdef CONFIG_MIP405
+#ifdef CONFIG_TARGET_MIP405
if (!s || 

Re: [U-Boot] [PATCH] mmc: cat u8 to u64 to avoid unexpected error

2016-09-19 Thread Jaehoon Chung
On 09/19/2016 08:30 PM, Tom Rini wrote:
> On Mon, Sep 19, 2016 at 03:31:54PM +0900, Jaehoon Chung wrote:
>> On 09/19/2016 02:53 AM, Tom Rini wrote:
>>> On Tue, Sep 13, 2016 at 04:27:57PM +0800, Haibo Chen wrote:
>>>
 Suspicious implicit sign extension exist. ext_csd[] is defined
 as "u8", capacity is defined as u64, so u8 is promoted to signed
 int first int the "|" expersion, then the sign extended to u64.
 if the tmp sign value is largeer than 0x7fff, after the sign
 extension, the upper bits of the result will all be 1.
 Thanks to coverity 

 e.g.
u8  data_8;
u64 data_64;

data_8 = 0x80;
data_64 = data_8 << 24; //0x8000
data_64 = ((u64)data_8) << 24;  //0x8000

 Signed-off-by: Haibo Chen 
>>>
>>> Please add a 'Reported-by: Coverity' and you can include the CID if you
>>> like.
>>
>> I think cid doesn't need to change type.
> 
> I mean the coverity CID :)  In the public coverity project it's 149300

Ah! I misunderstood CID as cid register. :)

> 
>>
>>>
 ---
  drivers/mmc/mmc.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

 diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
 index 43ea0bb..c1d1dc6 100644
 --- a/drivers/mmc/mmc.c
 +++ b/drivers/mmc/mmc.c
 @@ -1176,10 +1176,10 @@ static int mmc_startup(struct mmc *mmc)
 * ext_csd's capacity is valid if the value is more
 * than 2GB
 */
 -  capacity = ext_csd[EXT_CSD_SEC_CNT] << 0
 -  | ext_csd[EXT_CSD_SEC_CNT + 1] << 8
 -  | ext_csd[EXT_CSD_SEC_CNT + 2] << 16
 -  | ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
 +  capacity = ((u64)ext_csd[EXT_CSD_SEC_CNT]) << 0
 +  | ((u64)ext_csd[EXT_CSD_SEC_CNT + 1]) 
 << 8
 +  | ((u64)ext_csd[EXT_CSD_SEC_CNT + 2]) 
 << 16
 +  | ((u64)ext_csd[EXT_CSD_SEC_CNT + 3]) 
 << 24;
capacity *= MMC_MAX_BLOCK_LEN;
if ((capacity >> 20) > 2 * 1024)
mmc->capacity_user = capacity;
>>>
>>> Can't we just move capacity down to a u8 instead?  Thanks!
>>
>> Maybe not to move down to a u8..because it's displayed the real capacity for 
>> storage.
> 
> We could update those lines too?  It's just that one case right there,
> yes?

If it's possible to calculate the correct capacity?

Best Regards,
Jaehoon Chung

> 
>> And i wonder that coverity didn't report about the line 1294?
> 
> It does, along with 1256.
> 
> Thanks!
> 

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


Re: [U-Boot] [PATCH v1] dm/mmc: gen_atmel_mci: Add driver model support for mci

2016-09-19 Thread Jaehoon Chung
On 09/19/2016 07:02 PM, Wenyou Yang wrote:
> Add the driver model support for Atmel mci while retaining the
> existing legacy code. This allows the driver to support boards
> that have converted to driver model as well as those that have not.
> 
> Signed-off-by: Wenyou Yang 
> ---
> 
>  drivers/mmc/Kconfig |   9 +++
>  drivers/mmc/gen_atmel_mci.c | 160 
> 
>  2 files changed, 169 insertions(+)
> 
> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
> index a71afa5..e56eb94 100644
> --- a/drivers/mmc/Kconfig
> +++ b/drivers/mmc/Kconfig
> @@ -44,6 +44,15 @@ config ATMEL_SDHCI
> It is compliant with the SD Host Controller Standard V3.0
> specification.
>  
> +config GENERIC_ATMEL_MCI
> + bool "Atmel Multimedia Card Interface support"
> + depends on DM_MMC && BLK && DM_MMC_OPS && ARCH_AT91
> + help
> +   This enables support for Atmel High Speed Multimedia Card Interface
> +   (HSMCI), which supports the MultiMedia Card (MMC) Specification V4.3,
> +   the SD Memory Card Specification V2.0, the SDIO V2.0 specification
> +   and CE-ATA V1.1.
> +
>  config ROCKCHIP_DWMMC
>   bool "Rockchip SD/MMC controller support"
>   depends on DM_MMC && OF_CONTROL
> diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c
> index 69770df..3ebc998 100644
> --- a/drivers/mmc/gen_atmel_mci.c
> +++ b/drivers/mmc/gen_atmel_mci.c
> @@ -10,6 +10,7 @@
>   */
>  
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -18,8 +19,11 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include "atmel_mci.h"
>  
> +DECLARE_GLOBAL_DATA_PTR;
> +
>  #ifndef CONFIG_SYS_MMC_CLK_OD
>  # define CONFIG_SYS_MMC_CLK_OD   15
>  #endif
> @@ -37,6 +41,10 @@ struct atmel_mci_priv {
>   struct atmel_mci*mci;
>   unsigned intinitialized:1;
>   unsigned intcurr_clk;
> +#ifdef CONFIG_DM_MMC
> + struct mmc  mmc;
> + ulong   bus_clk_rate;
> +#endif
>  };
>  
>  /* Read Atmel MCI IP version */
> @@ -57,10 +65,18 @@ static void dump_cmd(u32 cmdr, u32 arg, u32 status, const 
> char* msg)
> cmdr, cmdr & 0x3F, arg, status, msg);
>  }
>  
> +#ifndef CONFIG_DM_MMC
>  /* Setup for MCI Clock and Block Size */
>  static void mci_set_mode(struct mmc *mmc, u32 hz, u32 blklen)
>  {
>   struct atmel_mci_priv *priv = mmc->priv;
> +#else
> +static void mci_set_mode(struct atmel_mci_priv *priv, u32 hz, u32 blklen)
> +{
> + struct mmc *mmc = >mmc;
> +
> +#endif
> +
>   atmel_mci_t *mci = priv->mci;
>   u32 bus_hz = get_mci_clk_rate();
>   u32 clkdiv = 255;
> @@ -202,10 +218,18 @@ io_fail:
>   * Sends a command out on the bus and deals with the block data.
>   * Takes the mmc pointer, a command pointer, and an optional data pointer.
>   */
> +#ifndef CONFIG_DM_MMC
>  static int
>  mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
>  {
>   struct atmel_mci_priv *priv = mmc->priv;
> +#else
> +static int atmel_mci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
> +   struct mmc_data *data)
> +{
> + struct atmel_mci_priv *priv = dev_get_priv(dev);
> + struct mmc *mmc = mmc_get_mmc_dev(dev);
> +#endif
>   atmel_mci_t *mci = priv->mci;
>   u32 cmdr;
>   u32 error_flags = 0;
> @@ -335,17 +359,29 @@ mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, 
> struct mmc_data *data)
>   return 0;
>  }
>  
> +#ifndef CONFIG_DM_MMC
>  /* Entered into mmc structure during driver init */
>  static void mci_set_ios(struct mmc *mmc)
>  {
>   struct atmel_mci_priv *priv = mmc->priv;
> +#else
> +static int atmel_mci_set_ios(struct udevice *dev)
> +{
> + struct atmel_mci_priv *priv = dev_get_priv(dev);
> + struct mmc *mmc = mmc_get_mmc_dev(dev);
> +#endif
> +
>   atmel_mci_t *mci = priv->mci;
>   int bus_width = mmc->bus_width;
>   unsigned int version = atmel_mci_get_version(mci);
>   int busw;
>  
>   /* Set the clock speed */
> +#ifndef CONFIG_DM_MMC
>   mci_set_mode(mmc, mmc->clock, MMC_DEFAULT_BLKLEN);
> +#else
> + mci_set_mode(priv, mmc->clock, MMC_DEFAULT_BLKLEN);
> +#endif
>  
>   /*
>* set the bus width and select slot for this interface
> @@ -370,12 +406,22 @@ static void mci_set_ios(struct mmc *mmc)
>  
>   writel(busw << 7 | MMCI_BF(SCDSEL, MCI_BUS), >sdcr);
>   }
> +
> +#ifdef CONFIG_DM_MMC
> + return 0;
> +#endif
>  }
>  
> +
> +#ifndef CONFIG_DM_MMC
>  /* Entered into mmc structure during driver init */
>  static int mci_init(struct mmc *mmc)
>  {
>   struct atmel_mci_priv *priv = mmc->priv;
> +#else
> +static int atmel_mci_hw_init(struct atmel_mci_priv *priv)
> +{
> +#endif
>   atmel_mci_t *mci = priv->mci;
>  
>   /* Initialize controller */
> @@ -390,11 +436,16 @@ static int mci_init(struct mmc *mmc)
>   writel(~0UL, >idr);
>  
>   /* Set default 

Re: [U-Boot] [PATCH] A20-OLinuXino-Lime2: Enable USB gadget support

2016-09-19 Thread Chen-Yu Tsai
On Mon, Sep 19, 2016 at 11:44 PM, Hans de Goede  wrote:
> Hi,
>
>
> On 19-09-16 17:00, Tom Rini wrote:
>>
>> On Mon, Sep 19, 2016 at 04:53:04PM +0200, Hans de Goede wrote:
>>>
>>> Hi,
>>>
>>> On 19-09-16 16:03, Tom Rini wrote:

 Based on A13-OLinuXino, enable DFU and UMS support.

 Signed-off-by: Tom Rini 
 ---
 With this change I've added DFU to my tests on this board, and assuming
 a
 follow up test with the SD image that kicks the board into FEL works,
 I'll
 then enable the UMS tests on this board (and add DFU to SD, not just DFU
 to
 RAM).

 configs/A20-OLinuXino-Lime2_defconfig | 8 
 1 file changed, 8 insertions(+)

 diff --git a/configs/A20-OLinuXino-Lime2_defconfig
 b/configs/A20-OLinuXino-Lime2_defconfig
 index 23db07380624..54343de7f351 100644
 --- a/configs/A20-OLinuXino-Lime2_defconfig
 +++ b/configs/A20-OLinuXino-Lime2_defconfig
 @@ -12,9 +12,17 @@
 CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 +CONFIG_CMD_DFU=y
 +CONFIG_CMD_USB_MASS_STORAGE=y
>>>
>>>
>>> Do you need CMD_USB_MASS_STORAGE for your tests ? Enabling
>>> CMD_USB_MASS_STORAGE really seems orthogonal to enabling GADGET
>>> mode to me, esp. since it is only useful in host mode AFAICT.
>>
>>
>> Ah, no, things have bad names perhaps.  CMD_USB_MASS_STORAGE enables
>> "ums" as a command which is what in turn will export MMC (or something
>> else) as a USB mass storage gadget over to the host.
>
>
> Ah, I thought this enabled the (destructive) low level usb mass storage
> block read/write test commands, but I guess I'm wrong.
>
> I wonder why Chen-Yu put it in the usb host enabling patch for
> an A33 board then...
>

It was copy pasted from some other defconfig. Like you, I thought it was
for host mode supporting USB sticks...

ChenYu

>>> Chen-Yu did something similar in a patch enabling host mode for a
>>> different sunxi board and here is what I replied:
>>>
>>> "
>>> If we want to enable CONFIG_CMD_USB_MASS_STORAGE on sunxi, we really
>>> should do so on all boards (feel free to submit a patch for this).
>>>
>>> e.g. add something like this to board/sunxi/Kconfig:
>>>
>>> config CMD_USB_MASS_STORAGE
>>> default y
>
>
> Given the above, that should probably be:
>
> config CMD_USB_MASS_STORAGE
>default y if USB_GADGET
>
>
> Hmm, I guess we may want to have a bunch of those, so that
> simply adding:
>
> CONFIG_USB_MUSB_GADGET=y
>
> To a defconfig enables the relevant related options...
>
> Regards,
>
> Hans
>
>
>
>>>
>>> So that we can still disable it in case there are space constraints,
>>> but normally we enable it on all sunxi boards offering a
>>> consistent set of available commands.
>>> "
>>
>>
>> I think it's a useful command that should be more widely exposed, yes.
>> IIRC, it's how the Tegra platforms support flashing their dev boards
>> with official images, and can be a handy "rescue" type option too.
>>
>>>
>>> The same goes for this patch, otherwise this patch is:
>>>
>>> Reviewed-by: Hans de Goede 
>>>
>>> Ig you want to feel free to apply this directly
>>> (given that I've send out a sunxi pull-req recently).
>>
>>
>> OK, thanks.  I just might since I really want to move on to grabbing
>> some fs patches and before I do that I really want to have as much
>> testing of them as possible.
>>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 6/7] ext4: Respect group descriptor size when adjusting free counts

2016-09-19 Thread Stefan Brüns
Also adjust high 16/32 bits when free inode/block counts are modified.

Signed-off-by: Stefan Brüns 
---
v2: rebase on last version of ext4 endian fixes

 fs/ext4/ext4_common.c | 53 +++
 fs/ext4/ext4_write.c  | 40 ++
 2 files changed, 69 insertions(+), 24 deletions(-)

diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 90e7602..1336068 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -60,22 +60,51 @@ static inline void ext4fs_sb_free_inodes_dec(struct 
ext2_sblock *sb)
 
 static inline void ext4fs_sb_free_blocks_dec(struct ext2_sblock *sb)
 {
-   sb->free_blocks = cpu_to_le32(le32_to_cpu(sb->free_blocks) - 1);
+   uint64_t free_blocks = le32_to_cpu(sb->free_blocks);
+   free_blocks += (uint64_t)le32_to_cpu(sb->free_blocks_high) << 32;
+   free_blocks--;
+
+   sb->free_blocks = cpu_to_le32(free_blocks & 0x);
+   sb->free_blocks_high = cpu_to_le16(free_blocks >> 32);
 }
 
-static inline void ext4fs_bg_free_inodes_dec(struct ext2_block_group *bg)
+static inline void ext4fs_bg_free_inodes_dec
+   (struct ext2_block_group *bg, const struct ext_filesystem *fs)
 {
-   bg->free_inodes = cpu_to_le16(le16_to_cpu(bg->free_inodes) - 1);
+   uint32_t free_inodes = le16_to_cpu(bg->free_inodes);
+   if (fs->gdsize == 64)
+   free_inodes += le16_to_cpu(bg->free_inodes_high) << 16;
+   free_inodes--;
+
+   bg->free_inodes = cpu_to_le16(free_inodes & 0x);
+   if (fs->gdsize == 64)
+   bg->free_inodes_high = cpu_to_le16(free_inodes >> 16);
 }
 
-static inline void ext4fs_bg_free_blocks_dec(struct ext2_block_group *bg)
+static inline void ext4fs_bg_free_blocks_dec
+   (struct ext2_block_group *bg, const struct ext_filesystem *fs)
 {
-   bg->free_blocks = cpu_to_le16(le16_to_cpu(bg->free_blocks) - 1);
+   uint32_t free_blocks = le16_to_cpu(bg->free_blocks);
+   if (fs->gdsize == 64)
+   free_blocks += le16_to_cpu(bg->free_blocks_high) << 16;
+   free_blocks--;
+
+   bg->free_blocks = cpu_to_le16(free_blocks & 0x);
+   if (fs->gdsize == 64)
+   bg->free_blocks_high = cpu_to_le16(free_blocks >> 16);
 }
 
-static inline void ext4fs_bg_itable_unused_dec(struct ext2_block_group *bg)
+static inline void ext4fs_bg_itable_unused_dec
+   (struct ext2_block_group *bg, const struct ext_filesystem *fs)
 {
-   bg->bg_itable_unused = cpu_to_le16(le16_to_cpu(bg->bg_itable_unused) - 
1);
+   uint32_t free_inodes = le16_to_cpu(bg->bg_itable_unused);
+   if (fs->gdsize == 64)
+   free_inodes += le16_to_cpu(bg->bg_itable_unused_high) << 16;
+   free_inodes--;
+
+   bg->bg_itable_unused = cpu_to_le16(free_inodes & 0x);
+   if (fs->gdsize == 64)
+   bg->bg_itable_unused_high = cpu_to_le16(free_inodes >> 16);
 }
 
 uint64_t ext4fs_sb_get_free_blocks(const struct ext2_sblock *sb)
@@ -958,7 +987,7 @@ uint32_t ext4fs_get_new_blk_no(void)
fs->curr_blkno = fs->curr_blkno +
(i * fs->blksz * 8);
fs->first_pass_bbmap++;
-   ext4fs_bg_free_blocks_dec(bgd);
+   ext4fs_bg_free_blocks_dec(bgd, fs);
ext4fs_sb_free_blocks_dec(fs->sb);
status = ext4fs_devread(b_bitmap_blk *
fs->sect_perblk,
@@ -1033,7 +1062,7 @@ restart:
 
prev_bg_bitmap_index = bg_idx;
}
-   ext4fs_bg_free_blocks_dec(bgd);
+   ext4fs_bg_free_blocks_dec(bgd, fs);
ext4fs_sb_free_blocks_dec(fs->sb);
goto success;
}
@@ -1092,9 +1121,9 @@ int ext4fs_get_new_inode_no(void)
fs->curr_inode_no = fs->curr_inode_no +
(i * inodes_per_grp);
fs->first_pass_ibmap++;
-   ext4fs_bg_free_inodes_dec(bgd);
+   ext4fs_bg_free_inodes_dec(bgd, fs);
if (has_gdt_chksum)
-   ext4fs_bg_itable_unused_dec(bgd);
+   ext4fs_bg_itable_unused_dec(bgd, fs);
ext4fs_sb_free_inodes_dec(fs->sb);
status = ext4fs_devread(i_bitmap_blk *
fs->sect_perblk,
@@ -1148,7 +1177,7 @@ restart:
goto fail;
prev_inode_bitmap_index = ibmap_idx;
}
-   ext4fs_bg_free_inodes_dec(bgd);
+   ext4fs_bg_free_inodes_dec(bgd, fs);
if 

[U-Boot] [PATCH v2 3/7] ext4: Add helper functions for block group descriptor field access

2016-09-19 Thread Stefan Brüns
The helper functions encapsulate access of the block group descriptors,
independent of group descriptor size. The helpers also deal with the
endianess of the fields, and with split fields like free_blocks/
free_blocks_high.

Signed-off-by: Stefan Brüns 
---
v2: include ext4fs_bg_get_inode_table_id(...) even if CONFIG_EXT4_WRITE
is not defined

 fs/ext4/ext4_common.c | 82 +++
 fs/ext4/ext4_common.h | 12 
 2 files changed, 94 insertions(+)

diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 2df4f8b..81740f8 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -47,6 +47,12 @@ struct ext2_inode *g_parent_inode;
 static int symlinknest;
 
 #if defined(CONFIG_EXT4_WRITE)
+struct ext2_block_group *ext4fs_get_group_descriptor
+   (const struct ext_filesystem *fs, uint32_t bg_idx)
+{
+   return (struct ext2_block_group *)(fs->gdtable + (bg_idx * fs->gdsize));
+}
+
 static inline void ext4fs_sb_free_inodes_dec(struct ext2_sblock *sb)
 {
sb->free_inodes = cpu_to_le32(le32_to_cpu(sb->free_inodes) - 1);
@@ -72,6 +78,82 @@ static inline void ext4fs_bg_itable_unused_dec(struct 
ext2_block_group *bg)
bg->bg_itable_unused = cpu_to_le16(le16_to_cpu(bg->bg_itable_unused) - 
1);
 }
 
+uint64_t ext4fs_sb_get_free_blocks(const struct ext2_sblock *sb)
+{
+   uint64_t free_blocks = le32_to_cpu(sb->free_blocks);
+   free_blocks += (uint64_t)le32_to_cpu(sb->free_blocks_high) << 32;
+   return free_blocks;
+}
+
+void ext4fs_sb_set_free_blocks(struct ext2_sblock *sb, uint64_t free_blocks)
+{
+   sb->free_blocks = cpu_to_le32(free_blocks & 0x);
+   sb->free_blocks_high = cpu_to_le16(free_blocks >> 32);
+}
+
+uint32_t ext4fs_bg_get_free_blocks(const struct ext2_block_group *bg,
+  const struct ext_filesystem *fs)
+{
+   uint32_t free_blocks = le16_to_cpu(bg->free_blocks);
+   if (fs->gdsize == 64)
+   free_blocks += le16_to_cpu(bg->free_blocks_high) << 16;
+   return free_blocks;
+}
+
+static inline
+uint32_t ext4fs_bg_get_free_inodes(const struct ext2_block_group *bg,
+  const struct ext_filesystem *fs)
+{
+   uint32_t free_inodes = le16_to_cpu(bg->free_inodes);
+   if (fs->gdsize == 64)
+   free_inodes += le16_to_cpu(bg->free_inodes_high) << 16;
+   return free_inodes;
+}
+
+static inline uint16_t ext4fs_bg_get_flags(const struct ext2_block_group *bg)
+{
+   return le16_to_cpu(bg->bg_flags);
+}
+
+static inline void ext4fs_bg_set_flags(struct ext2_block_group *bg,
+  uint16_t flags)
+{
+   bg->bg_flags = cpu_to_le16(flags);
+}
+
+/* Block number of the block bitmap */
+uint64_t ext4fs_bg_get_block_id(const struct ext2_block_group *bg,
+   const struct ext_filesystem *fs)
+{
+   uint64_t block_nr = le32_to_cpu(bg->block_id);
+   if (fs->gdsize == 64)
+   block_nr += (uint64_t)le32_to_cpu(bg->block_id_high) << 32;
+   return block_nr;
+}
+
+/* Block number of the inode bitmap */
+uint64_t ext4fs_bg_get_inode_id(const struct ext2_block_group *bg,
+   const struct ext_filesystem *fs)
+{
+   uint64_t block_nr = le32_to_cpu(bg->inode_id);
+   if (fs->gdsize == 64)
+   block_nr += (uint64_t)le32_to_cpu(bg->inode_id_high) << 32;
+   return block_nr;
+}
+#endif
+
+/* Block number of the inode table */
+uint64_t ext4fs_bg_get_inode_table_id(const struct ext2_block_group *bg,
+ const struct ext_filesystem *fs)
+{
+   uint64_t block_nr = le32_to_cpu(bg->inode_table_id);
+   if (fs->gdsize == 64)
+   block_nr +=
+   (uint64_t)le32_to_cpu(bg->inode_table_id_high) << 32;
+   return block_nr;
+}
+
+#if defined(CONFIG_EXT4_WRITE)
 uint32_t ext4fs_div_roundup(uint32_t size, uint32_t n)
 {
uint32_t res = size / n;
diff --git a/fs/ext4/ext4_common.h b/fs/ext4/ext4_common.h
index cc9d0c5..99d49e6 100644
--- a/fs/ext4/ext4_common.h
+++ b/fs/ext4/ext4_common.h
@@ -74,5 +74,17 @@ void ext4fs_allocate_blocks(struct ext2_inode *file_inode,
unsigned int total_remaining_blocks,
unsigned int *total_no_of_block);
 void put_ext4(uint64_t off, void *buf, uint32_t size);
+struct ext2_block_group *ext4fs_get_group_descriptor
+   (const struct ext_filesystem *fs, uint32_t bg_idx);
+uint64_t ext4fs_bg_get_block_id(const struct ext2_block_group *bg,
+   const struct ext_filesystem *fs);
+uint64_t ext4fs_bg_get_inode_id(const struct ext2_block_group *bg,
+   const struct ext_filesystem *fs);
+uint64_t ext4fs_bg_get_inode_table_id(const struct ext2_block_group *bg,
+   const struct ext_filesystem *fs);
+uint64_t ext4fs_sb_get_free_blocks(const struct ext2_sblock *sb);
+void 

Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-09-19 Thread Jaehoon Chung
Hi,

On 09/19/2016 10:17 PM, Maxime Ripard wrote:
> On Wed, Sep 14, 2016 at 12:05:19PM +0200, Hans de Goede wrote:
>> Hi,
>>
>> On 13-09-16 13:50, Maxime Ripard wrote:
>>> Hi,
>>>
>>> On Mon, Sep 12, 2016 at 04:47:49PM +0200, Hans de Goede wrote:
 On 12-09-16 15:56, Maxime Ripard wrote:
> Hi,
>
> On Mon, Sep 12, 2016 at 01:53:24PM +0200, Ciprian Manea wrote:
>> I'm using a SinA33 dev board (Allwinner a33 SoC) and at the moment
>> I'm trying to boot from the eMMC.
>>
>> But it fails in the following way:
>>
>>
>> *Got the following error at boot time:*
>> *U-Boot SPL 2016.09-rc2-00125-g6e8b42f (Sep 08 2016 - 11:00:46) DRAM: 
>> 1024
>> MiB Trying to boot from MMC2 MMC Device 1 not found spl: could not find 
>> mmc
>> device. error: -19 SPL: failed to boot from all boot devices ### ERROR 
>> ###
>> Please RESET the board ###*
>
> So I've been on the same issue for the last couple of days.
>
> Since that board is already supported, adding support for the eMMC
> basically came down to that patch on top of 2016.09-rc2.
>
> http://code.bulix.org/kcgxri-106037?raw
>
> (Quite hackish, the 8-Bits part being a separate issue that would need
> to be addressed somehow).
>
> However, it doesn't work, neither when flashing u-boot on the eMMC
> itself (where there's a timeout error in the SPL) nor when trying to
> access the eMMC from a U-Boot loaded from the (external) SD.
>
> In the latter case, even mmc dev 1 fails silently.
>
> I traced that down to the mmc_switch here:
> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530
>
> Which fails with ETIMEDOUT, and more specifically, it's the call to
> mmc_rint_wait here
> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/sunxi_mmc.c#l383
> that times out.
>
> Increasing the timeout value (to 1) doesn't really change
> anything. I guess this is also the reason why we had a timeout error
> in the SPL.

timeout_msecs is expired or hit SUNXI_MMC_RINT_INTERRUPT_ERROR_BIT?
If hit ERROR_BIT, did you check which bit is set?

If error is occurred when mmc_change_freq() is running, cid/ext_csd register 
have already read.
It means the controller read the something from eMMC card.

>
> This eMMC works fine in Linux, with the same muxing (and I guess the
> earlier commands wouldn't be successful if the muxing or power was not
> set up appropriately). So I'm kind of running out of ideas on what
> could be the root cause of this.
>
> Hans, any ideas?

 Maybe the emmc needs external pull-ups ? I don't remember if u-boot
 always enables those or not ...
>>>
>>> So I pushed this a bit more, and it seems like commenting the call to
>>> mmc_change_freq makes everything just work.
>>>
>>> Reading the JEDEC spec, it looks like when you switch to high speed,
>>> you also need to change the controller clock rate, that u-boot doesn't
>>> seem to do at the moment, which obviously will fail, since the
>>> controller will be stuck at the former rate, while the eMMC would be
>>> switched.
>>>
>>> If I comment mmc_change_freq, everything works.
>>
>> Hmm, I'm pretty sure the u-boot sunxi mmc code
>> does properly change the clock, see mmc_set_mod_clk() in
>> drivers/mmc/sunxi_mmc.c
>>
>> This will switch to the right PLL, etc. So there likely is
>> something else going on making things not work at higher
>> speeds.
> 
> Yep, I noticed that. However, what confuses me more is that the
> command seems to be sent here:
> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530

If then..i guess that it's possible to set the initial clock as higher clock 
than 400KHz.
Did you check this?

Best Regards,
Jaehoon Chung

> 
> And set_ios is being called after we check that everything
> works. Linux for example calls set_ios right after switching
> http://lxr.free-electrons.com/source/drivers/mmc/core/mmc.c#L965
> 
>> Maybe we need a higher driver strenghts at the mmc io pins, or maybe
>> we've a completely unrelated issue ?
> 
> I've tested that already. It doesn't change the outcome.
> 
>> I'm pretty sure that the eMMC's on A20 devices work fine in 50MHZ
>> (SDR) mode.
> 
> What emmc was that? Did it support HS? Was it considered an SD (and
> went through sd_change_freq), or an MMC?
> 
> Thanks,
> Maxime
> 

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


[U-Boot] [PATCH 17/28] video: Drop CONFIG_VIDEO_HW_CURSOR

2016-09-19 Thread Simon Glass
This is not used in U-Boot.

Signed-off-by: Simon Glass 
---

 drivers/video/cfb_console.c  | 33 +-
 drivers/video/ct69000.c  | 79 
 include/video_fb.h   |  4 ---
 scripts/config_whitelist.txt |  1 -
 4 files changed, 1 insertion(+), 116 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 3a8e20b..a99fc00 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -63,14 +63,6 @@
  * character. No blinking is provided.
  * Uses the macros CURSOR_SET and
  * CURSOR_OFF.
- *
- * CONFIG_VIDEO_HW_CURSOR:- Uses the hardware cursor capability
- * of the graphic chip. Uses the macro
- * CURSOR_SET. ATTENTION: If booting an
- * OS, the display driver must disable
- * the hardware register of the graphic
- * chip. Otherwise a blinking field is
- * displayed.
  */
 
 #include 
@@ -154,13 +146,8 @@
  * CONFIG_VIDEO_SW_CURSOR: Draws a cursor after the last character. No
  *blinking is provided. Uses the macros CURSOR_SET
  *and CURSOR_OFF.
- * CONFIG_VIDEO_HW_CURSOR: Uses the hardware cursor capability of the
- *graphic chip. Uses the macro CURSOR_SET.
- *ATTENTION: If booting an OS, the display driver
- *must disable the hardware register of the graphic
- *chip. Otherwise a blinking field is displayed
  */
-#if !defined(CONFIG_VIDEO_SW_CURSOR) && !defined(CONFIG_VIDEO_HW_CURSOR)
+#if !defined(CONFIG_VIDEO_SW_CURSOR)
 /* no Cursor defined */
 #define CURSOR_ON
 #define CURSOR_OFF
@@ -168,10 +155,6 @@
 #endif
 
 #if defined(CONFIG_VIDEO_SW_CURSOR)
-#if defined(CONFIG_VIDEO_HW_CURSOR)
-#error only one of CONFIG_VIDEO_SW_CURSOR or CONFIG_VIDEO_HW_CURSOR can be \
-   defined
-#endif
 void console_cursor(int state);
 
 #define CURSOR_ON  console_cursor(1)
@@ -179,17 +162,6 @@ void console_cursor(int state);
 #define CURSOR_SET video_set_cursor()
 #endif /* CONFIG_VIDEO_SW_CURSOR */
 
-#ifdef CONFIG_VIDEO_HW_CURSOR
-#ifdef CURSOR_ON
-#error only one of CONFIG_VIDEO_SW_CURSOR or CONFIG_VIDEO_HW_CURSOR can be \
-   defined
-#endif
-#define CURSOR_ON
-#define CURSOR_OFF
-#define CURSOR_SET video_set_hw_cursor(console_col * VIDEO_FONT_WIDTH, \
- (console_row * VIDEO_FONT_HEIGHT) + video_logo_height)
-#endif /* CONFIG_VIDEO_HW_CURSOR */
-
 #ifdef CONFIG_VIDEO_LOGO
 #ifdef CONFIG_VIDEO_BMP_LOGO
 #include 
@@ -2056,9 +2028,6 @@ static int video_init(void)
return -1;
 
video_fb_address = (void *) VIDEO_FB_ADRS;
-#ifdef CONFIG_VIDEO_HW_CURSOR
-   video_init_hw_cursor(VIDEO_FONT_WIDTH, VIDEO_FONT_HEIGHT);
-#endif
 
cfb_do_flush_cache = cfb_fb_is_in_dram() && dcache_status();
 
diff --git a/drivers/video/ct69000.c b/drivers/video/ct69000.c
index 349da5e..a74e4e6 100644
--- a/drivers/video/ct69000.c
+++ b/drivers/video/ct69000.c
@@ -804,85 +804,6 @@ video_dump_reg (void)
 
 #endif
 
-#ifdef CONFIG_VIDEO_HW_CURSOR
-/***
- * Set Hardware Cursor in Pixel
- */
-void
-video_set_hw_cursor (int x, int y)
-{
-   int sig_x = 0, sig_y = 0;
-   if (x < 0) {
-   x *= -1;
-   sig_x = 1;
-   }
-   if (y < 0) {
-   y *= -1;
-   sig_y = 1;
-   }
-   ctWrite_i (CT_XR_O, 0xa4, x & 0xff);
-   ctWrite_i (CT_XR_O, 0xa5, (x >> 8) & 0x7);
-   ctWrite_i (CT_XR_O, 0xa6, y & 0xff);
-   ctWrite_i (CT_XR_O, 0xa7, (y >> 8) & 0x7);
-}
-
-/***
- * Init Hardware Cursor. To know the size of the Cursor,
- * we have to know the Font size.
- */
-void
-video_init_hw_cursor (int font_width, int font_height)
-{
-   unsigned char xr_80;
-   unsigned long *curs, pattern;
-   int i;
-   int cursor_start;
-   GraphicDevice *pGD = (GraphicDevice *) & ctfb;
-
-   cursor_start = pGD->dprBase;
-   xr_80 = ctRead_i (CT_XR_O, 0x80);
-   /* set start address */
-   ctWrite_i (CT_XR_O, 0xa2, (cursor_start >> 8) & 0xf0);
-   ctWrite_i (CT_XR_O, 0xa3, (cursor_start >> 16) & 0x3f);
-   /* set cursor shape */
-   curs = (unsigned long *) cursor_start;
-   i = 0;
-   while (i < 0x400) {
-   curs[i++] = 0x; /* AND mask */
-   curs[i++] = 0x; /* AND mask */
-   curs[i++] = 0;  /* XOR mask */
-   curs[i++] = 0;  /* XOR mask */
-   /* Transparent */
-   }
-   pattern = 0x >> font_width;
-   i = 0;
-   while (i < (font_height * 2)) {
-   

[U-Boot] [PATCH 07/28] Convert CONFIG_VIDEO to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_VIDEO

Signed-off-by: Simon Glass 
---

 README  | 5 -
 configs/MIP405T_defconfig   | 1 +
 configs/MIP405_defconfig| 1 +
 configs/MPC8536DS_36BIT_defconfig   | 1 +
 configs/MPC8536DS_SDCARD_defconfig  | 1 +
 configs/MPC8536DS_SPIFLASH_defconfig| 1 +
 configs/MPC8536DS_defconfig | 1 +
 configs/MPC8544DS_defconfig | 1 +
 configs/MPC8572DS_36BIT_defconfig   | 1 +
 configs/MPC8572DS_defconfig | 1 +
 configs/MPC8610HPCD_defconfig   | 1 +
 configs/MPC8641HPCN_36BIT_defconfig | 1 +
 configs/MPC8641HPCN_defconfig   | 1 +
 configs/MiniFAP_defconfig   | 1 +
 configs/PIP405_defconfig| 1 +
 configs/T1024QDS_DDR4_SECURE_BOOT_defconfig | 1 +
 configs/T1024QDS_DDR4_defconfig | 1 +
 configs/T1024QDS_NAND_defconfig | 1 +
 configs/T1024QDS_SDCARD_defconfig   | 1 +
 configs/T1024QDS_SECURE_BOOT_defconfig  | 1 +
 configs/T1024QDS_SPIFLASH_defconfig | 1 +
 configs/T1024QDS_defconfig  | 1 +
 configs/T1040QDS_DDR4_defconfig | 1 +
 configs/T1040QDS_SECURE_BOOT_defconfig  | 1 +
 configs/T1040QDS_defconfig  | 1 +
 configs/T1042D4RDB_NAND_defconfig   | 1 +
 configs/T1042D4RDB_SDCARD_defconfig | 1 +
 configs/T1042D4RDB_SECURE_BOOT_defconfig| 1 +
 configs/T1042D4RDB_SPIFLASH_defconfig   | 1 +
 configs/T1042D4RDB_defconfig| 1 +
 configs/T1042RDB_PI_NAND_SECURE_BOOT_defconfig  | 1 +
 configs/T1042RDB_PI_NAND_defconfig  | 1 +
 configs/T1042RDB_PI_SDCARD_defconfig| 1 +
 configs/T1042RDB_PI_SPIFLASH_defconfig  | 1 +
 configs/T1042RDB_PI_defconfig   | 1 +
 configs/TQM5200_B_HIGHBOOT_defconfig| 1 +
 configs/TQM5200_B_defconfig | 1 +
 configs/TQM5200_STK100_defconfig| 1 +
 configs/TQM5200_defconfig   | 1 +
 configs/aristainetos2_defconfig | 1 +
 configs/aristainetos2b_defconfig| 1 +
 configs/aristainetos_defconfig  | 1 +
 configs/bayleybay_defconfig | 1 +
 configs/cgtqmx6eval_defconfig   | 1 +
 configs/charon_defconfig| 1 +
 configs/chromebook_link_defconfig   | 1 +
 configs/chromebox_panther_defconfig | 1 +
 configs/cm-bf548_defconfig  | 1 +
 configs/cm_fx6_defconfig| 1 +
 configs/colibri_imx7_defconfig  | 1 +
 configs/conga-qeval20-qa3-e3845-internal-uart_defconfig | 1 +
 configs/conga-qeval20-qa3-e3845_defconfig   | 1 +
 configs/controlcenterd_36BIT_SDCARD_DEVELOP_defconfig   | 1 +
 configs/controlcenterd_36BIT_SDCARD_defconfig   | 1 +
 configs/coreboot-x86_defconfig  | 1 +
 configs/crownbay_defconfig  | 1 +
 configs/dfi-bt700-q7x-151_defconfig | 1 +
 configs/digsy_mtc_RAMBOOT_defconfig | 1 +
 configs/digsy_mtc_defconfig | 1 +
 configs/digsy_mtc_rev5_RAMBOOT_defconfig| 1 +
 configs/digsy_mtc_rev5_defconfig| 1 +
 configs/dms-ba16-1g_defconfig   | 1 +
 configs/dms-ba16_defconfig  | 1 +
 configs/ea20_defconfig  | 1 +
 configs/eb_cpu5282_defconfig| 1 +
 configs/eb_cpu5282_internal_defconfig   | 1 +
 configs/fo300_defconfig | 1 +
 configs/gwventana_defconfig | 1 +
 configs/icon_defconfig  | 1 +
 configs/imx31_phycore_eet_defconfig | 1 +
 configs/ipek01_defconfig| 1 +
 configs/ls1021aqds_ddr4_nor_defconfig   | 1 +
 configs/ls1021aqds_ddr4_nor_lpuart_defconfig| 1 +
 configs/ls1021aqds_nand_defconfig   | 1 +
 configs/ls1021aqds_nor_SECURE_BOOT_defconfig| 1 +
 configs/ls1021aqds_nor_defconfig| 1 +
 configs/ls1021aqds_nor_lpuart_defconfig | 1 +
 configs/ls1021aqds_qspi_defconfig 

[U-Boot] [PATCH 02/28] Convert SILENT_CONSOLE options to Kconfig

2016-09-19 Thread Simon Glass
Move these option to Kconfig and tidy up existing uses.

The Power PC boards don't have a suitable common element: the common header
files don't appear to line up with the Kconfig files as far as I can tell.
This results in a lot of defconfig changes.

Signed-off-by: Simon Glass 
---

 README |  5 ---
 arch/arm/mach-exynos/Kconfig   |  3 ++
 arch/arm/mach-rockchip/rk3288/Kconfig  |  3 ++
 arch/blackfin/Kconfig  |  3 ++
 arch/sandbox/Kconfig   |  3 ++
 common/Kconfig | 45 ++
 configs/T1024QDS_DDR4_SECURE_BOOT_defconfig|  1 +
 configs/T1024QDS_DDR4_defconfig|  1 +
 configs/T1024QDS_NAND_defconfig|  1 +
 configs/T1024QDS_SDCARD_defconfig  |  1 +
 configs/T1024QDS_SECURE_BOOT_defconfig |  1 +
 configs/T1024QDS_SPIFLASH_defconfig|  1 +
 configs/T1024QDS_defconfig |  1 +
 configs/T1024RDB_NAND_defconfig|  1 +
 configs/T1024RDB_SDCARD_defconfig  |  1 +
 configs/T1024RDB_SECURE_BOOT_defconfig |  1 +
 configs/T1024RDB_SPIFLASH_defconfig|  1 +
 configs/T1024RDB_defconfig |  1 +
 configs/T1040D4RDB_NAND_defconfig  |  1 +
 configs/T1040D4RDB_SDCARD_defconfig|  1 +
 configs/T1040D4RDB_SECURE_BOOT_defconfig   |  1 +
 configs/T1040D4RDB_SPIFLASH_defconfig  |  1 +
 configs/T1040D4RDB_defconfig   |  1 +
 configs/T1040QDS_DDR4_defconfig|  1 +
 configs/T1040QDS_SECURE_BOOT_defconfig |  1 +
 configs/T1040QDS_defconfig |  1 +
 configs/T1040RDB_NAND_defconfig|  1 +
 configs/T1040RDB_SDCARD_defconfig  |  1 +
 configs/T1040RDB_SECURE_BOOT_defconfig |  1 +
 configs/T1040RDB_SPIFLASH_defconfig|  1 +
 configs/T1040RDB_defconfig |  1 +
 configs/T1042D4RDB_NAND_defconfig  |  1 +
 configs/T1042D4RDB_SDCARD_defconfig|  1 +
 configs/T1042D4RDB_SECURE_BOOT_defconfig   |  1 +
 configs/T1042D4RDB_SPIFLASH_defconfig  |  1 +
 configs/T1042D4RDB_defconfig   |  1 +
 configs/T1042RDB_PI_NAND_SECURE_BOOT_defconfig |  1 +
 configs/T1042RDB_PI_NAND_defconfig |  1 +
 configs/T1042RDB_PI_SDCARD_defconfig   |  1 +
 configs/T1042RDB_PI_SPIFLASH_defconfig |  1 +
 configs/T1042RDB_PI_defconfig  |  1 +
 configs/T1042RDB_SECURE_BOOT_defconfig |  1 +
 configs/T1042RDB_defconfig |  1 +
 configs/a4m072_defconfig   |  1 +
 configs/cm5200_defconfig   |  1 +
 configs/espresso7420_defconfig |  1 +
 configs/fo300_defconfig|  1 +
 configs/ls1021aqds_ddr4_nor_defconfig  |  1 +
 configs/ls1021aqds_ddr4_nor_lpuart_defconfig   |  1 +
 configs/ls1021aqds_nand_defconfig  |  1 +
 configs/ls1021aqds_nor_SECURE_BOOT_defconfig   |  1 +
 configs/ls1021aqds_nor_defconfig   |  1 +
 configs/ls1021aqds_nor_lpuart_defconfig|  1 +
 configs/ls1021aqds_qspi_defconfig  |  1 +
 configs/ls1021aqds_sdcard_ifc_defconfig|  1 +
 configs/ls1021aqds_sdcard_qspi_defconfig   |  1 +
 configs/ls1021atwr_nor_SECURE_BOOT_defconfig   |  1 +
 configs/ls1021atwr_nor_defconfig   |  1 +
 configs/ls1021atwr_nor_lpuart_defconfig|  1 +
 configs/ls1021atwr_qspi_defconfig  |  1 +
 .../ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig|  1 +
 configs/ls1021atwr_sdcard_ifc_defconfig|  1 +
 configs/ls1021atwr_sdcard_qspi_defconfig   |  1 +
 configs/pdm360ng_defconfig |  1 +
 configs/tricorder_defconfig|  1 +
 configs/tricorder_flash_defconfig  |  1 +
 include/configs/T102xQDS.h |  1 -
 include/configs/T102xRDB.h |  1 -
 include/configs/T1040QDS.h |  1 -
 include/configs/T104xRDB.h |  1 -
 include/configs/TQM5200.h  |  1 -
 include/configs/UCP1020.h  |  4 --
 include/configs/a4m072.h   |  1 -
 include/configs/bfin_adi_common.h  |  1 -
 include/configs/cm5200.h   |  1 -
 include/configs/exynos5-common.h   |  1 -
 include/configs/exynos7420-common.h|  1 -
 include/configs/ls1021aqds.h   |  3 --
 include/configs/ls1021atwr.h   |  3 --
 

[U-Boot] [PATCH 24/28] Convert CONFIG_CONSOLE_SCROLL_LINES to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_CONSOLE_SCROLL_LINES

Signed-off-by: Simon Glass 
---

 README  |  6 --
 configs/bayleybay_defconfig |  1 +
 configs/chromebook_jerry_defconfig  |  1 +
 configs/chromebook_link_defconfig   |  1 +
 configs/chromebook_samus_defconfig  |  1 +
 configs/chromebox_panther_defconfig |  1 +
 configs/colibri_t20_defconfig   |  1 +
 configs/conga-qeval20-qa3-e3845-internal-uart_defconfig |  1 +
 configs/conga-qeval20-qa3-e3845_defconfig   |  1 +
 configs/coreboot-x86_defconfig  |  1 +
 configs/crownbay_defconfig  |  1 +
 configs/dfi-bt700-q7x-151_defconfig |  1 +
 configs/firefly-rk3288_defconfig|  1 +
 configs/harmony_defconfig   |  1 +
 configs/minnowmax_defconfig |  1 +
 configs/paz00_defconfig |  1 +
 configs/qemu-x86_defconfig  |  1 +
 configs/qemu-x86_efi_payload32_defconfig|  1 +
 configs/qemu-x86_efi_payload64_defconfig|  1 +
 configs/rock2_defconfig |  1 +
 configs/seaboard_defconfig  |  1 +
 configs/som-db5800-som-6867_defconfig   |  1 +
 configs/theadorable-x86-dfi-bt700_defconfig |  1 +
 configs/ventana_defconfig   |  1 +
 drivers/video/Kconfig   | 10 ++
 include/configs/chromebook_jerry.h  |  1 -
 include/configs/colibri_pxa270.h|  1 -
 include/configs/colibri_t20.h   |  1 -
 include/configs/evb_rk3288.h|  1 -
 include/configs/evb_rk3399.h|  1 -
 include/configs/fennec_rk3288.h |  1 -
 include/configs/firefly-rk3288.h|  1 -
 include/configs/harmony.h   |  1 -
 include/configs/miniarm_rk3288.h|  1 -
 include/configs/paz00.h |  1 -
 include/configs/popmetal_rk3288.h   |  1 -
 include/configs/rock2.h |  1 -
 include/configs/rpi.h   |  1 -
 include/configs/seaboard.h  |  1 -
 include/configs/ventana.h   |  1 -
 include/configs/x86-common.h|  1 -
 include/lcd_console.h   |  3 ---
 scripts/config_whitelist.txt|  1 -
 43 files changed, 33 insertions(+), 26 deletions(-)

diff --git a/README b/README
index cf83fc3..8b9c04e 100644
--- a/README
+++ b/README
@@ -1743,12 +1743,6 @@ CBFS (Coreboot Filesystem) support
here, since it is cheaper to change data cache settings on
a per-section basis.
 
-   CONFIG_CONSOLE_SCROLL_LINES
-
-   When the console need to be scrolled, this is the number of
-   lines to scroll by. It defaults to 1. Increasing this makes
-   the console jump but can help speed up operation when scrolling
-   is slow.
 
CONFIG_LCD_ROTATION
 
diff --git a/configs/bayleybay_defconfig b/configs/bayleybay_defconfig
index cf6317a..7dbb931 100644
--- a/configs/bayleybay_defconfig
+++ b/configs/bayleybay_defconfig
@@ -61,4 +61,5 @@ CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_SCROLL_LINES=5
 CONFIG_USE_PRIVATE_LIBGCC=y
diff --git a/configs/chromebook_jerry_defconfig 
b/configs/chromebook_jerry_defconfig
index 4979513..3c41707 100644
--- a/configs/chromebook_jerry_defconfig
+++ b/configs/chromebook_jerry_defconfig
@@ -79,6 +79,7 @@ CONFIG_SYSRESET=y
 CONFIG_DM_VIDEO=y
 CONFIG_DISPLAY=y
 CONFIG_VIDEO_ROCKCHIP=y
+CONFIG_CONSOLE_SCROLL_LINES=10
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
diff --git a/configs/chromebook_link_defconfig 
b/configs/chromebook_link_defconfig
index 90c701d..b3af268 100644
--- a/configs/chromebook_link_defconfig
+++ b/configs/chromebook_link_defconfig
@@ -65,5 +65,6 @@ CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_SCROLL_LINES=5
 CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_TPM=y
diff --git a/configs/chromebook_samus_defconfig 
b/configs/chromebook_samus_defconfig
index df6b0a6..3a0299f 100644
--- a/configs/chromebook_samus_defconfig
+++ b/configs/chromebook_samus_defconfig
@@ -62,5 +62,6 @@ CONFIG_DM_VIDEO=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 

[U-Boot] [PATCH 11/28] Convert CONFIG_SYS_CONSOLE_BG_COL et al to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_BG_COL
   CONFIG_SYS_CONSOLE_FG_COL

Signed-off-by: Simon Glass 
---

 README   |  5 ---
 configs/pxm2_defconfig   |  2 +
 configs/rut_defconfig|  2 +
 drivers/video/Kconfig| 22 ++
 drivers/video/cfb_console.c  | 98 ++--
 drivers/video/ct69000.c  |  3 +-
 include/configs/pxm2.h   |  2 -
 include/configs/rut.h|  2 -
 include/video_fb.h   |  8 
 scripts/config_whitelist.txt |  2 -
 10 files changed, 78 insertions(+), 68 deletions(-)

diff --git a/README b/README
index 5df8b6b..e1d4dfc 100644
--- a/README
+++ b/README
@@ -810,11 +810,6 @@ The following options need to be configured:
port routines must be defined elsewhere
(i.e. serial_init(), serial_getc(), ...)
 
-   CONFIG_SYS_CONSOLE_BG_COL: define the backgroundcolor, default
-   is 0x00.
-   CONFIG_SYS_CONSOLE_FG_COL: define the foregroundcolor, default
-   is 0xa0.
-
 - Console Baudrate:
CONFIG_BAUDRATE - in bps
Select one of the baudrates listed in
diff --git a/configs/pxm2_defconfig b/configs/pxm2_defconfig
index bc7245c..bfac212 100644
--- a/configs/pxm2_defconfig
+++ b/configs/pxm2_defconfig
@@ -56,3 +56,5 @@ CONFIG_G_DNL_MANUFACTURER="Siemens AG"
 CONFIG_G_DNL_VENDOR_NUM=0x0908
 CONFIG_G_DNL_PRODUCT_NUM=0x02d2
 CONFIG_CFB_CONSOLE=y
+CONFIG_SYS_CONSOLE_BG_COL=0xff
+CONFIG_SYS_CONSOLE_FG_COL=0x00
diff --git a/configs/rut_defconfig b/configs/rut_defconfig
index 870f928..eda5d7b 100644
--- a/configs/rut_defconfig
+++ b/configs/rut_defconfig
@@ -56,3 +56,5 @@ CONFIG_G_DNL_MANUFACTURER="Siemens AG"
 CONFIG_G_DNL_VENDOR_NUM=0x0908
 CONFIG_G_DNL_PRODUCT_NUM=0x02d2
 CONFIG_CFB_CONSOLE=y
+CONFIG_SYS_CONSOLE_BG_COL=0xff
+CONFIG_SYS_CONSOLE_FG_COL=0x00
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 20ae11e..de6f419 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -498,4 +498,26 @@ config VIDEO_CT69000
- "videomode=bootargs" all the video parameters are parsed
from the bootargs. (See drivers/video/videomodes.c)
 
+config SYS_CONSOLE_BG_COL
+   hex "Background colour"
+   depends on CFB_CONSOLE || VIDEO_CT69000
+   default 0x00
+   help
+ Defines the background colour for the console. The value is from
+ 0x00 to 0xff and the meaning depends on the graphics card.
+ Typically, 0x00 means black and 0xff means white. Do not set
+ the background and foreground to the same colour or you will see
+ nothing.
+
+config SYS_CONSOLE_FG_COL
+   hex "Foreground colour"
+   depends on CFB_CONSOLE || VIDEO_CT69000
+   default 0xa0
+   help
+ Defines the foreground colour for the console. The value is from
+ 0x00 to 0xff and the meaning depends on the graphics card.
+ Typically, 0x00 means black and 0xff means white. Do not set
+ the background and foreground to the same colour or you will see
+ nothing.
+
 endmenu
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 30b53db..949187c 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -2093,70 +2093,72 @@ static int video_init(void)
/* Init drawing pats */
switch (VIDEO_DATA_FORMAT) {
case GDF__8BIT_INDEX:
-   video_set_lut(0x01, CONSOLE_FG_COL, CONSOLE_FG_COL,
- CONSOLE_FG_COL);
-   video_set_lut(0x00, CONSOLE_BG_COL, CONSOLE_BG_COL,
- CONSOLE_BG_COL);
+   video_set_lut(0x01, CONFIG_SYS_CONSOLE_FG_COL,
+ CONFIG_SYS_CONSOLE_FG_COL,
+ CONFIG_SYS_CONSOLE_FG_COL);
+   video_set_lut(0x00, CONFIG_SYS_CONSOLE_BG_COL,
+ CONFIG_SYS_CONSOLE_BG_COL,
+ CONFIG_SYS_CONSOLE_BG_COL);
fgx = 0x01010101;
bgx = 0x;
break;
case GDF__8BIT_332RGB:
-   color8 = ((CONSOLE_FG_COL & 0xe0) |
- ((CONSOLE_FG_COL >> 3) & 0x1c) |
- CONSOLE_FG_COL >> 6);
+   color8 = ((CONFIG_SYS_CONSOLE_FG_COL & 0xe0) |
+ ((CONFIG_SYS_CONSOLE_FG_COL >> 3) & 0x1c) |
+ CONFIG_SYS_CONSOLE_FG_COL >> 6);
fgx = (color8 << 24) | (color8 << 16) | (color8 << 8) |
color8;
-   color8 = ((CONSOLE_BG_COL & 0xe0) |
- ((CONSOLE_BG_COL >> 3) & 0x1c) |
- CONSOLE_BG_COL >> 6);
+   color8 = ((CONFIG_SYS_CONSOLE_BG_COL & 0xe0) |
+ ((CONFIG_SYS_CONSOLE_BG_COL >> 3) & 0x1c) |
+ 

[U-Boot] [PATCH 15/28] video: Drop the sed13806 driver

2016-09-19 Thread Simon Glass
This is not used in U-Boot.

Signed-off-by: Simon Glass 
---

 README   |   5 -
 drivers/video/Makefile   |   1 -
 drivers/video/cfb_console.c  |   9 --
 drivers/video/sed13806.c | 286 ---
 include/sed13806.h   |  81 
 scripts/config_whitelist.txt |   1 -
 6 files changed, 383 deletions(-)
 delete mode 100644 drivers/video/sed13806.c
 delete mode 100644 include/sed13806.h

diff --git a/README b/README
index 74ecb79..2dfdc52 100644
--- a/README
+++ b/README
@@ -1665,11 +1665,6 @@ CBFS (Coreboot Filesystem) support
instead.
 
 - Video support:
-   CONFIG_VIDEO_SED13806
-   Enable Epson SED13806 driver. This driver supports 8bpp
-   and 16bpp modes defined by CONFIG_VIDEO_SED13806_8BPP
-   or CONFIG_VIDEO_SED13806_16BPP
-
CONFIG_FSL_DIU_FB
Enable the Freescale DIU video driver.  Reference boards for
SOCs that have a DIU should define this macro to enable DIU
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 412c948..ff3617b 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -49,7 +49,6 @@ obj-$(CONFIG_VIDEO_MVEBU) += mvebu_lcd.o
 obj-$(CONFIG_VIDEO_MXS) += mxsfb.o videomodes.o
 obj-$(CONFIG_VIDEO_OMAP3) += omap3_dss.o
 obj-$(CONFIG_VIDEO_SANDBOX_SDL) += sandbox_sdl.o
-obj-$(CONFIG_VIDEO_SED13806) += sed13806.o
 obj-$(CONFIG_VIDEO_SM501) += sm501.o
 obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o videomodes.o
 obj-$(CONFIG_VIDEO_TEGRA20) += tegra.o
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index aca..ac7c402 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -95,15 +95,6 @@
 #define VIDEO_HW_BITBLT
 #endif
 
-/*
- * Defines for the SED13806 driver
- */
-#ifdef CONFIG_VIDEO_SED13806
-#define VIDEO_FB_LITTLE_ENDIAN
-#define VIDEO_HW_RECTFILL
-#define VIDEO_HW_BITBLT
-#endif
-
 #if defined(CONFIG_VIDEO_MXS)
 #define VIDEO_FB_16BPP_WORD_SWAP
 #endif
diff --git a/drivers/video/sed13806.c b/drivers/video/sed13806.c
deleted file mode 100644
index cd7fac6..000
--- a/drivers/video/sed13806.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * (C) Copyright 2002
- * Stäubli Faverges - 
- * Pierre AUBERT  p.aub...@staubli.com
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-/* Video support for Epson SED13806 chipset  */
-
-#include 
-
-#include 
-#include 
-
-#define readByte(ptrReg)\
-*(volatile unsigned char *)(sed13806.isaBase + ptrReg)
-
-#define writeByte(ptrReg,value) \
-*(volatile unsigned char *)(sed13806.isaBase + ptrReg) = value
-
-#define writeWord(ptrReg,value) \
-(*(volatile unsigned short *)(sed13806.isaBase + ptrReg) = ((value >> 8 ) 
& 0xff) | ((value << 8) & 0xff00))
-
-GraphicDevice sed13806;
-
-/*-
- * EpsonSetRegs --
- *-
- */
-static void EpsonSetRegs (void)
-{
-/* the content of the chipset register depends on the board (clocks, ...)*/
-const S1D_REGS *preg = board_get_regs ();
-while (preg -> Index) {
-   writeByte (preg -> Index, preg -> Value);
-   preg ++;
-}
-}
-
-/*-
- * video_hw_init --
- *-
- */
-void *video_hw_init (void)
-{
-unsigned int *vm, i;
-
-memset (, 0, sizeof (GraphicDevice));
-
-/* Initialization of the access to the graphic chipset
-   Retreive base address of the chipset
-   (see board/RPXClassic/eccx.c) */
-if ((sed13806.isaBase = board_video_init ()) == 0) {
-   return (NULL);
-}
-
-sed13806.frameAdrs = sed13806.isaBase + FRAME_BUFFER_OFFSET;
-sed13806.winSizeX = board_get_width ();
-sed13806.winSizeY = board_get_height ();
-
-#if defined(CONFIG_VIDEO_SED13806_8BPP)
-sed13806.gdfIndex = GDF__8BIT_INDEX;
-sed13806.gdfBytesPP = 1;
-
-#elif defined(CONFIG_VIDEO_SED13806_16BPP)
-sed13806.gdfIndex = GDF_16BIT_565RGB;
-sed13806.gdfBytesPP = 2;
-
-#else
-#error Unsupported SED13806 BPP
-#endif
-
-sed13806.memSize = sed13806.winSizeX * sed13806.winSizeY * 
sed13806.gdfBytesPP;
-
-/* Load SED registers*/
-EpsonSetRegs ();
-
-/* (see board/RPXClassic/RPXClassic.c)   */
-board_validate_screen (sed13806.isaBase);
-
-/* Clear video memory */
-i = sed13806.memSize/4;
-vm = (unsigned int *)sed13806.frameAdrs;
-while(i--)
-   *vm++ = 0;
-
-
-return ();
-}
-/*-
- * Epson_wait_idle -- Wait for hardware to become 

[U-Boot] [PATCH 26/28] Convert CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE

Signed-off-by: Simon Glass 
---

 README | 3 ---
 common/Kconfig | 9 +
 configs/MIP405T_defconfig  | 1 +
 configs/MIP405_defconfig   | 1 +
 configs/PIP405_defconfig   | 1 +
 configs/aristainetos2_defconfig| 1 +
 configs/aristainetos2b_defconfig   | 1 +
 configs/aristainetos_defconfig | 1 +
 configs/brppt1_mmc_defconfig   | 1 +
 configs/brppt1_nand_defconfig  | 1 +
 configs/brppt1_spi_defconfig   | 1 +
 configs/brxre1_defconfig   | 1 +
 configs/cgtqmx6eval_defconfig  | 1 +
 configs/dms-ba16-1g_defconfig  | 1 +
 configs/dms-ba16_defconfig | 1 +
 configs/ea20_defconfig | 1 +
 configs/ge_b450v3_defconfig| 1 +
 configs/ge_b650v3_defconfig| 1 +
 configs/ge_b850v3_defconfig| 1 +
 configs/marsboard_defconfig| 1 +
 configs/mx51evk_defconfig  | 1 +
 configs/mx53loco_defconfig | 1 +
 configs/mx6dlsabreauto_defconfig   | 1 +
 configs/mx6dlsabresd_defconfig | 1 +
 configs/mx6qpsabreauto_defconfig   | 1 +
 configs/mx6qsabreauto_defconfig| 1 +
 configs/mx6qsabrelite_defconfig| 1 +
 configs/mx6qsabresd_defconfig  | 1 +
 configs/mx6sabresd_spl_defconfig   | 1 +
 configs/nitrogen6dl2g_defconfig| 1 +
 configs/nitrogen6dl_defconfig  | 1 +
 configs/nitrogen6q2g_defconfig | 1 +
 configs/nitrogen6q_defconfig   | 1 +
 configs/nitrogen6s1g_defconfig | 1 +
 configs/nitrogen6s_defconfig   | 1 +
 configs/riotboard_defconfig| 1 +
 configs/socfpga_arria5_defconfig   | 1 +
 configs/socfpga_cyclone5_defconfig | 1 +
 configs/socfpga_de0_nano_soc_defconfig | 1 +
 configs/socfpga_is1_defconfig  | 1 +
 configs/socfpga_mcvevk_defconfig   | 1 +
 configs/socfpga_sockit_defconfig   | 1 +
 configs/socfpga_socrates_defconfig | 1 +
 configs/socfpga_sr1500_defconfig   | 1 +
 configs/socfpga_vining_fpga_defconfig  | 1 +
 configs/wandboard_defconfig| 1 +
 include/configs/MIP405.h   | 1 -
 include/configs/MigoR.h| 1 -
 include/configs/PIP405.h   | 1 -
 include/configs/advantech_dms-ba16.h   | 1 -
 include/configs/ap325rxa.h | 1 -
 include/configs/ap_sh4a_4a.h   | 1 -
 include/configs/aristainetos-common.h  | 1 -
 include/configs/armadillo-800eva.h | 1 -
 include/configs/bur_cfg_common.h   | 1 -
 include/configs/cgtqmx6eval.h  | 1 -
 include/configs/ea20.h | 1 -
 include/configs/ecovec.h   | 1 -
 include/configs/embestmx6boards.h  | 1 -
 include/configs/ge_bx50v3.h| 2 --
 include/configs/kzm9g.h| 1 -
 include/configs/ms7722se.h | 1 -
 include/configs/mx51evk.h  | 1 -
 include/configs/mx53loco.h | 1 -
 include/configs/mx6sabre_common.h  | 1 -
 include/configs/nitrogen6x.h   | 1 -
 include/configs/r0p7734.h  | 1 -
 include/configs/rcar-gen2-common.h | 1 -
 include/configs/rcar-gen3-common.h | 1 -
 include/configs/sh7752evb.h| 1 -
 include/configs/sh7753evb.h| 1 -
 include/configs/sh7757lcr.h| 1 -
 include/configs/sh7785lcr.h| 1 -
 include/configs/socfpga_common.h   | 1 -
 include/configs/wandboard.h| 1 -
 scripts/config_whitelist.txt   | 1 -
 76 files changed, 53 insertions(+), 34 deletions(-)

diff --git a/README b/README
index f2e0809..752c8cb 100644
--- a/README
+++ b/README
@@ -3585,9 +3585,6 @@ Configuration Settings:
 - CONFIG_SYS_CONSOLE_INFO_QUIET
Suppress display of console information at boot.
 
-- CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
-   Enable the call to overwrite_console().
-
 - CONFIG_SYS_MEMTEST_START, CONFIG_SYS_MEMTEST_END:
Begin and End addresses of the area used by the
simple memory test.
diff --git a/common/Kconfig b/common/Kconfig
index 416f7b2..bf1e277 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -300,6 +300,15 @@ config SYS_CONSOLE_IS_IN_ENV
  environment variables can be updated after boot to change the
  input/output devices.
 
+config SYS_CONSOLE_OVERWRITE_ROUTINE
+   bool "Allow board control over console overwriting"
+   help
+ If this is enabled, and the board-specific function
+ overwrite_console() returns 1, the stdin, stderr and stdout are
+ switched to the serial port, else the settings in the environment
+ are used. If this is not enabled, the console will not be switched
+ to serial.
+
 config SYS_CONSOLE_ENV_OVERWRITE
bool "Update environment variables during console init"
help
diff --git 

[U-Boot] [PATCH 05/28] config: Drop CONFIG_CONSOLE

2016-09-19 Thread Simon Glass
This is not really a config. Rename it to avoid confusion.

Signed-off-by: Simon Glass 
---

 include/configs/MPC8349ITX.h | 6 +++---
 scripts/config_whitelist.txt | 1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/include/configs/MPC8349ITX.h b/include/configs/MPC8349ITX.h
index 177718e..0fbc1fd 100644
--- a/include/configs/MPC8349ITX.h
+++ b/include/configs/MPC8349ITX.h
@@ -358,7 +358,7 @@ boards, we say we have two, but don't display a message if 
we find only one. */
 #define CONFIG_SYS_BAUDRATE_TABLE  \
{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
 
-#define CONFIG_CONSOLE ttyS0
+#define CONSOLEttyS0
 #define CONFIG_BAUDRATE115200
 
 #define CONFIG_SYS_NS16550_COM1(CONFIG_SYS_IMMR + 0x4500)
@@ -740,10 +740,10 @@ boards, we say we have two, but don't display a message 
if we find only one. */
__stringify(CONFIG_GATEWAYIP) ":"   \
__stringify(CONFIG_NETMASK) ":" \
CONFIG_HOSTNAME ":" CONFIG_NETDEV ":off"\
-   " console=" __stringify(CONFIG_CONSOLE) "," __stringify(CONFIG_BAUDRATE)
+   " console=" __stringify(CONSOLE) "," __stringify(CONFIG_BAUDRATE)
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   "console=" __stringify(CONFIG_CONSOLE) "\0" \
+   "console=" __stringify(CONSOLE) "\0"\
"netdev=" CONFIG_NETDEV "\0"\
"uboot=" CONFIG_UBOOTPATH "\0"  \
"tftpflash=tftpboot $loadaddr $uboot; " \
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 8d07e82..80a7377 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -675,7 +675,6 @@ CONFIG_COMMON_ENV_SETTINGS
 CONFIG_COMMON_ENV_UBI
 CONFIG_COMPACT_FLASH
 CONFIG_COMPAT
-CONFIG_CONSOLE
 CONFIG_CONSOLE_DEV
 CONFIG_CONSOLE_EXTRA_INFO
 CONFIG_CONSOLE_INFO_QUIET
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 10/28] Convert CONFIG_VIDEO_CT69000 to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_VIDEO_CT69000

Signed-off-by: Simon Glass 
---

 README   | 23 ---
 configs/MIP405T_defconfig|  1 +
 configs/MIP405_defconfig |  1 +
 configs/PIP405_defconfig |  1 +
 drivers/video/Kconfig| 27 +++
 include/configs/MIP405.h |  1 -
 include/configs/PIP405.h |  1 -
 scripts/config_whitelist.txt |  1 -
 8 files changed, 30 insertions(+), 26 deletions(-)

diff --git a/README b/README
index d3b0a1b..5df8b6b 100644
--- a/README
+++ b/README
@@ -1670,35 +1670,12 @@ CBFS (Coreboot Filesystem) support
instead.
 
 - Video support:
-   CONFIG_VIDEO_CT69000
-
-   Enable Chips & Technologies 69000 Video chip
-
CONFIG_VIDEO_SMI_LYNXEM
Enable Silicon Motion SMI 712/710/810 Video chip. The
video output is selected via environment 'videoout'
(1 = LCD and 2 = CRT). If videoout is undefined, CRT is
assumed.
 
-   For the CT69000 and SMI_LYNXEM drivers, videomode is
-   selected via environment 'videomode'. Two different ways
-   are possible:
-   - "videomode=num"   'num' is a standard LiLo mode numbers.
-   Following standard modes are supported  (* is default):
-
- Colors640x480 800x600 1024x768 1152x864 1280x1024
-   -+-
- 8 bits |  0x301*  0x3030x3050x161 0x307
-15 bits |  0x310   0x3130x3160x162 0x319
-16 bits |  0x311   0x3140x3170x163 0x31A
-24 bits |  0x312   0x3150x318  ?   0x31B
-   -+-
-   (i.e. setenv videomode 317; saveenv; reset;)
-
-   - "videomode=bootargs" all the video parameters are parsed
-   from the bootargs. (See drivers/video/videomodes.c)
-
-
CONFIG_VIDEO_SED13806
Enable Epson SED13806 driver. This driver supports 8bpp
and 16bpp modes defined by CONFIG_VIDEO_SED13806_8BPP
diff --git a/configs/MIP405T_defconfig b/configs/MIP405T_defconfig
index 7445f4b..028a112 100644
--- a/configs/MIP405T_defconfig
+++ b/configs/MIP405T_defconfig
@@ -15,3 +15,4 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_FAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_CFB_CONSOLE=y
+CONFIG_VIDEO_CT69000=y
diff --git a/configs/MIP405_defconfig b/configs/MIP405_defconfig
index 66f3eb8..ec76163 100644
--- a/configs/MIP405_defconfig
+++ b/configs/MIP405_defconfig
@@ -17,3 +17,4 @@ CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
+CONFIG_VIDEO_CT69000=y
diff --git a/configs/PIP405_defconfig b/configs/PIP405_defconfig
index 5350d54..1f49c3b 100644
--- a/configs/PIP405_defconfig
+++ b/configs/PIP405_defconfig
@@ -17,3 +17,4 @@ CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
+CONFIG_VIDEO_CT69000=y
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index b73d1a3..20ae11e 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -471,4 +471,31 @@ config CFB_CONSOLE_ANSI
  erase functions and limited graphics rendition control). Normal
  output from U-Boot will pass through this filter.
 
+config VIDEO_CT69000
+   bool "Enable Chips & Technologies 69000 video driver"
+   depends on VIDEO
+   help
+ This enables a frame buffer driver for the Chips & Technologies
+ ct69000, a fairly old graphics device (circa 2000) which is used
+ on some hardware. It operates over the ISA bus, and supports
+ some acceleration features.
+
+ For the CT69000 and SMI_LYNXEM drivers, videomode is
+   selected via environment 'videomode'. Two different ways
+   are possible:
+   - "videomode=num"   'num' is a standard LiLo mode numbers.
+   Following standard modes are supported  (* is default):
+
+ Colors640x480 800x600 1024x768 1152x864 1280x1024
+   -+-
+ 8 bits |  0x301*  0x3030x3050x161 0x307
+15 bits |  0x310   0x3130x3160x162 0x319
+16 bits |  0x311   0x3140x3170x163 0x31A
+24 bits |  0x312   0x3150x318  ?   0x31B
+   -+-
+   (i.e. setenv videomode 317; saveenv; reset;)
+
+   - "videomode=bootargs" all the video parameters are parsed
+   from the bootargs. (See drivers/video/videomodes.c)
+
 endmenu
diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h
index 

[U-Boot] [PATCH 20/28] Convert CONFIG_CONSOLE_EXTRA_INFO to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_CONSOLE_EXTRA_INFO

Signed-off-by: Simon Glass 
---

 configs/MIP405T_defconfig|  1 +
 configs/MIP405_defconfig |  1 +
 configs/MiniFAP_defconfig|  1 +
 configs/PIP405_defconfig |  1 +
 configs/TQM5200_B_HIGHBOOT_defconfig |  1 +
 configs/TQM5200_B_defconfig  |  1 +
 configs/TQM5200_STK100_defconfig |  1 +
 configs/TQM5200_defconfig|  1 +
 configs/charon_defconfig |  1 +
 configs/icon_defconfig   |  1 +
 configs/ipek01_defconfig |  1 +
 configs/lwmon5_defconfig |  1 +
 configs/socrates_defconfig   |  1 +
 drivers/video/Kconfig| 10 ++
 include/configs/MIP405.h |  1 -
 include/configs/PIP405.h |  1 -
 include/configs/TQM5200.h|  1 -
 include/configs/icon.h   |  1 -
 include/configs/ipek01.h |  1 -
 include/configs/lwmon5.h |  1 -
 include/configs/socrates.h   |  1 -
 scripts/config_whitelist.txt |  1 -
 22 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/configs/MIP405T_defconfig b/configs/MIP405T_defconfig
index 387d60d..6e3a721 100644
--- a/configs/MIP405T_defconfig
+++ b/configs/MIP405T_defconfig
@@ -16,4 +16,5 @@ CONFIG_CMD_FAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_VIDEO_CT69000=y
diff --git a/configs/MIP405_defconfig b/configs/MIP405_defconfig
index 1acec56..8e26ce6 100644
--- a/configs/MIP405_defconfig
+++ b/configs/MIP405_defconfig
@@ -18,4 +18,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_VIDEO_CT69000=y
diff --git a/configs/MiniFAP_defconfig b/configs/MiniFAP_defconfig
index 6df03b1..208f894 100644
--- a/configs/MiniFAP_defconfig
+++ b/configs/MiniFAP_defconfig
@@ -22,4 +22,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/PIP405_defconfig b/configs/PIP405_defconfig
index b86d28b..891cd43 100644
--- a/configs/PIP405_defconfig
+++ b/configs/PIP405_defconfig
@@ -18,4 +18,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_VIDEO_CT69000=y
diff --git a/configs/TQM5200_B_HIGHBOOT_defconfig 
b/configs/TQM5200_B_HIGHBOOT_defconfig
index 49a53bf..ec75792 100644
--- a/configs/TQM5200_B_HIGHBOOT_defconfig
+++ b/configs/TQM5200_B_HIGHBOOT_defconfig
@@ -22,4 +22,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/TQM5200_B_defconfig b/configs/TQM5200_B_defconfig
index 8acc5d2..2d7ca16 100644
--- a/configs/TQM5200_B_defconfig
+++ b/configs/TQM5200_B_defconfig
@@ -22,4 +22,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/TQM5200_STK100_defconfig b/configs/TQM5200_STK100_defconfig
index 0e11a00..c258821 100644
--- a/configs/TQM5200_STK100_defconfig
+++ b/configs/TQM5200_STK100_defconfig
@@ -22,4 +22,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/TQM5200_defconfig b/configs/TQM5200_defconfig
index 6ef0df7..3e189bd 100644
--- a/configs/TQM5200_defconfig
+++ b/configs/TQM5200_defconfig
@@ -21,4 +21,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/charon_defconfig b/configs/charon_defconfig
index 3de627b..188dc88 100644
--- a/configs/charon_defconfig
+++ b/configs/charon_defconfig
@@ -21,4 +21,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/icon_defconfig b/configs/icon_defconfig
index 15ed170..232f67d 100644
--- a/configs/icon_defconfig
+++ b/configs/icon_defconfig
@@ -20,4 +20,5 @@ CONFIG_CMD_FAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/ipek01_defconfig b/configs/ipek01_defconfig
index bb6801f..4e90df1 100644
--- a/configs/ipek01_defconfig
+++ b/configs/ipek01_defconfig
@@ -16,4 +16,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/lwmon5_defconfig b/configs/lwmon5_defconfig
index e31f4eb..0ef4c63 100644
--- a/configs/lwmon5_defconfig
+++ b/configs/lwmon5_defconfig
@@ -22,4 +22,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
 CONFIG_VGA_AS_SINGLE_DEVICE=y

[U-Boot] [PATCH 09/28] Convert CONFIG_CFB_CONSOLE_ANSI to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_CFB_CONSOLE_ANSI

Signed-off-by: Simon Glass 
---

 README | 4 
 configs/T1042D4RDB_NAND_defconfig  | 1 +
 configs/T1042D4RDB_SDCARD_defconfig| 1 +
 configs/T1042D4RDB_SECURE_BOOT_defconfig   | 1 +
 configs/T1042D4RDB_SPIFLASH_defconfig  | 1 +
 configs/T1042D4RDB_defconfig   | 1 +
 configs/T1042RDB_PI_NAND_SECURE_BOOT_defconfig | 1 +
 configs/T1042RDB_PI_NAND_defconfig | 1 +
 configs/T1042RDB_PI_SDCARD_defconfig   | 1 +
 configs/T1042RDB_PI_SPIFLASH_defconfig | 1 +
 configs/T1042RDB_PI_defconfig  | 1 +
 configs/nokia_rx51_defconfig   | 1 +
 configs/tbs2910_defconfig  | 1 +
 drivers/video/Kconfig  | 9 +
 include/configs/T104xRDB.h | 1 -
 include/configs/nokia_rx51.h   | 1 -
 include/configs/tbs2910.h  | 1 -
 scripts/config_whitelist.txt   | 1 -
 18 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/README b/README
index ce6ea7a..d3b0a1b 100644
--- a/README
+++ b/README
@@ -810,10 +810,6 @@ The following options need to be configured:
port routines must be defined elsewhere
(i.e. serial_init(), serial_getc(), ...)
 
-   When CONFIG_CFB_CONSOLE_ANSI is defined, console will support
-   a limited number of ANSI escape sequences (cursor control,
-   erase functions and limited graphics rendition control).
-
CONFIG_SYS_CONSOLE_BG_COL: define the backgroundcolor, default
is 0x00.
CONFIG_SYS_CONSOLE_FG_COL: define the foregroundcolor, default
diff --git a/configs/T1042D4RDB_NAND_defconfig 
b/configs/T1042D4RDB_NAND_defconfig
index dbf5af2..a7c60f4 100644
--- a/configs/T1042D4RDB_NAND_defconfig
+++ b/configs/T1042D4RDB_NAND_defconfig
@@ -39,4 +39,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 CONFIG_CFB_CONSOLE=y
+CONFIG_CFB_CONSOLE_ANSI=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/T1042D4RDB_SDCARD_defconfig 
b/configs/T1042D4RDB_SDCARD_defconfig
index 3c80d66..5d9299a 100644
--- a/configs/T1042D4RDB_SDCARD_defconfig
+++ b/configs/T1042D4RDB_SDCARD_defconfig
@@ -39,4 +39,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 CONFIG_CFB_CONSOLE=y
+CONFIG_CFB_CONSOLE_ANSI=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/T1042D4RDB_SECURE_BOOT_defconfig 
b/configs/T1042D4RDB_SECURE_BOOT_defconfig
index fd2b5ba..61d51bc 100644
--- a/configs/T1042D4RDB_SECURE_BOOT_defconfig
+++ b/configs/T1042D4RDB_SECURE_BOOT_defconfig
@@ -32,6 +32,7 @@ CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
+CONFIG_CFB_CONSOLE_ANSI=y
 CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/T1042D4RDB_SPIFLASH_defconfig 
b/configs/T1042D4RDB_SPIFLASH_defconfig
index c4cb658..a591263 100644
--- a/configs/T1042D4RDB_SPIFLASH_defconfig
+++ b/configs/T1042D4RDB_SPIFLASH_defconfig
@@ -40,4 +40,5 @@ CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
+CONFIG_CFB_CONSOLE_ANSI=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/T1042D4RDB_defconfig b/configs/T1042D4RDB_defconfig
index 077d39d..4be096d 100644
--- a/configs/T1042D4RDB_defconfig
+++ b/configs/T1042D4RDB_defconfig
@@ -30,4 +30,5 @@ CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y
+CONFIG_CFB_CONSOLE_ANSI=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/T1042RDB_PI_NAND_SECURE_BOOT_defconfig 
b/configs/T1042RDB_PI_NAND_SECURE_BOOT_defconfig
index e2cf38f..478706a 100644
--- a/configs/T1042RDB_PI_NAND_SECURE_BOOT_defconfig
+++ b/configs/T1042RDB_PI_NAND_SECURE_BOOT_defconfig
@@ -43,6 +43,7 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 CONFIG_CFB_CONSOLE=y
+CONFIG_CFB_CONSOLE_ANSI=y
 CONFIG_RSA=y
 CONFIG_SPL_RSA=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/T1042RDB_PI_NAND_defconfig 
b/configs/T1042RDB_PI_NAND_defconfig
index 418f7e9..4afcf1b 100644
--- a/configs/T1042RDB_PI_NAND_defconfig
+++ b/configs/T1042RDB_PI_NAND_defconfig
@@ -39,4 +39,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 CONFIG_CFB_CONSOLE=y
+CONFIG_CFB_CONSOLE_ANSI=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/T1042RDB_PI_SDCARD_defconfig 
b/configs/T1042RDB_PI_SDCARD_defconfig
index 5246eb3..a89b4f2 100644
--- a/configs/T1042RDB_PI_SDCARD_defconfig
+++ b/configs/T1042RDB_PI_SDCARD_defconfig
@@ -39,4 +39,5 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_VIDEO=y
 CONFIG_CFB_CONSOLE=y
+CONFIG_CFB_CONSOLE_ANSI=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/T1042RDB_PI_SPIFLASH_defconfig 
b/configs/T1042RDB_PI_SPIFLASH_defconfig
index 71aa6e1..55a24f4 100644
--- a/configs/T1042RDB_PI_SPIFLASH_defconfig
+++ b/configs/T1042RDB_PI_SPIFLASH_defconfig
@@ -40,4 +40,5 @@ CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_CFB_CONSOLE=y

[U-Boot] [PATCH 21/28] video: Move video_get_info_str() prototype to a header file

2016-09-19 Thread Simon Glass
This should be defined in a header file so that arguments are checked.
Move it to video.h.

Signed-off-by: Simon Glass 
---

 board/liebherr/lwmon5/lwmon5.c |  1 +
 board/mosaixtech/icon/icon.c   |  1 +
 board/mpl/common/common_util.c |  1 +
 board/tqc/tqm5200/tqm5200.c|  1 +
 drivers/video/cfb_console.c| 25 -
 include/video.h| 11 +++
 6 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/board/liebherr/lwmon5/lwmon5.c b/board/liebherr/lwmon5/lwmon5.c
index 8ad6712..bb99a3b 100644
--- a/board/liebherr/lwmon5/lwmon5.c
+++ b/board/liebherr/lwmon5/lwmon5.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/mosaixtech/icon/icon.c b/board/mosaixtech/icon/icon.c
index e3fb1e6..1245f92 100644
--- a/board/mosaixtech/icon/icon.c
+++ b/board/mosaixtech/icon/icon.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/mpl/common/common_util.c b/board/mpl/common/common_util.c
index 2262175..4b85a59 100644
--- a/board/mpl/common/common_util.c
+++ b/board/mpl/common/common_util.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef CONFIG_PIP405
 #include "../pip405/pip405.h"
diff --git a/board/tqc/tqm5200/tqm5200.c b/board/tqc/tqm5200/tqm5200.c
index 8b82c34..fef9d2b 100644
--- a/board/tqc/tqm5200/tqm5200.c
+++ b/board/tqc/tqm5200/tqm5200.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef CONFIG_VIDEO_SM501
 #include 
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index c788651..b02a153 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -64,6 +64,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 /*
@@ -215,16 +216,6 @@
 #endif
 #endif
 
-#ifdef CONFIG_CONSOLE_EXTRA_INFO
-/*
- * setup a board string: type, speed, etc.
- *
- * line_number:location to place info string beside logo
- * info:   buffer for info string
- */
-extern void video_get_info_str(int line_number,char *info);
-#endif
-
 DECLARE_GLOBAL_DATA_PTR;
 
 /* Locals */
@@ -801,7 +792,7 @@ static void parse_putc(const char c)
video_set_cursor();
 }
 
-static void video_putc(struct stdio_dev *dev, const char c)
+static void cfb_video_putc(struct stdio_dev *dev, const char c)
 {
 #ifdef CONFIG_CFB_CONSOLE_ANSI
int i;
@@ -1015,7 +1006,7 @@ static void video_putc(struct stdio_dev *dev, const char 
c)
flush_cache(VIDEO_FB_ADRS, VIDEO_SIZE);
 }
 
-static void video_puts(struct stdio_dev *dev, const char *s)
+static void cfb_video_puts(struct stdio_dev *dev, const char *s)
 {
int flush = cfb_do_flush_cache;
int count = strlen(s);
@@ -1024,7 +1015,7 @@ static void video_puts(struct stdio_dev *dev, const char 
*s)
cfb_do_flush_cache = 0;
 
while (count--)
-   video_putc(dev, *s++);
+   cfb_video_putc(dev, *s++);
 
if (flush) {
cfb_do_flush_cache = flush;
@@ -1991,7 +1982,7 @@ void video_clear(void)
 #endif
 }
 
-static int video_init(void)
+static int cfg_video_init(void)
 {
unsigned char color8;
 
@@ -2117,7 +2108,7 @@ int drv_video_init(void)
return 0;
 
/* Init video chip - returns with framebuffer cleared */
-   if (video_init() == -1)
+   if (cfg_video_init() == -1)
return 0;
 
if (board_cfb_skip())
@@ -2142,8 +2133,8 @@ int drv_video_init(void)
memset(_dev, 0, sizeof(console_dev));
strcpy(console_dev.name, "vga");
console_dev.flags = DEV_FLAGS_OUTPUT;
-   console_dev.putc = video_putc;  /* 'putc' function */
-   console_dev.puts = video_puts;  /* 'puts' function */
+   console_dev.putc = cfb_video_putc;  /* 'putc' function */
+   console_dev.puts = cfb_video_puts;  /* 'puts' function */
 
 #if !defined(CONFIG_VGA_AS_SINGLE_DEVICE)
if (have_keyboard && keyboard_ok) {
diff --git a/include/video.h b/include/video.h
index 0d5bd21..5b4e78b 100644
--- a/include/video.h
+++ b/include/video.h
@@ -245,6 +245,17 @@ int lg4573_spi_startup(unsigned int bus, unsigned int cs,
unsigned int max_hz, unsigned int spi_mode);
 #endif
 
+/*
+ * video_get_info_str() - obtain a board string: type, speed, etc.
+ *
+ * This is called if CONFIG_CONSOLE_EXTRA_INFO is enabled.
+ *
+ * line_number:location to place info string beside logo
+ * info:   buffer for info string (empty if nothing to display on this
+ * line)
+ */
+void video_get_info_str(int line_number, char *info);
+
 #endif /* CONFIG_DM_VIDEO */
 
 #endif
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 18/28] Convert CONFIG_VIDEO_SW_CURSOR to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_VIDEO_SW_CURSOR

Signed-off-by: Simon Glass 
---

 drivers/video/Kconfig | 10 ++
 drivers/video/cfb_console.c   |  6 --
 include/configs/MIP405.h  |  1 -
 include/configs/MPC8536DS.h   |  1 -
 include/configs/MPC8544DS.h   |  1 -
 include/configs/MPC8572DS.h   |  1 -
 include/configs/MPC8610HPCD.h |  1 -
 include/configs/MPC8641HPCN.h |  1 -
 include/configs/P1022DS.h |  2 --
 include/configs/PIP405.h  |  1 -
 include/configs/T102xQDS.h|  1 -
 include/configs/T102xRDB.h|  1 -
 include/configs/T1040QDS.h|  1 -
 include/configs/T104xRDB.h|  1 -
 include/configs/TQM5200.h |  1 -
 include/configs/cm_fx6.h  |  1 -
 include/configs/colibri_imx7.h|  1 -
 include/configs/digsy_mtc.h   |  1 -
 include/configs/icon.h|  1 -
 include/configs/imx31_phycore.h   |  1 -
 include/configs/ipek01.h  |  1 -
 include/configs/lwmon5.h  |  1 -
 include/configs/mpc5121ads.h  |  1 -
 include/configs/mx6sxsabresd.h|  1 -
 include/configs/mx6ul_14x14_evk.h |  1 -
 include/configs/mx7dsabresd.h |  1 -
 include/configs/mxs.h |  1 -
 include/configs/nokia_rx51.h  |  1 -
 include/configs/sequoia.h |  1 -
 include/configs/socrates.h|  1 -
 include/configs/sunxi-common.h|  1 -
 include/configs/tbs2910.h |  1 -
 include/configs/x86-common.h  |  1 -
 scripts/config_whitelist.txt  |  1 -
 34 files changed, 10 insertions(+), 39 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 278600c..78bf2c9 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -480,6 +480,16 @@ config VGA_AS_SINGLE_DEVICE
  may be used if you have no keyboard device, or more than one
  (USB Keyboard, AT Keyboard).
 
+config VIDEO_SW_CURSOR
+   bool "Enable a software cursor"
+   depends on CFB_CONSOLE
+   default y if CFB_CONSOLE
+   help
+ This draws a cursor after the last character. No blinking is
+ provided. This makes it possible to see the current cursor
+ position when entering text on the console. It is recommended to
+ enable this.
+
 config VIDEO_CT69000
bool "Enable Chips & Technologies 69000 video driver"
depends on VIDEO
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index a99fc00..56d3c15 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -141,12 +141,6 @@
 #include 
 #endif
 
-/*
- * Cursor definition:
- * CONFIG_VIDEO_SW_CURSOR: Draws a cursor after the last character. No
- *blinking is provided. Uses the macros CURSOR_SET
- *and CURSOR_OFF.
- */
 #if !defined(CONFIG_VIDEO_SW_CURSOR)
 /* no Cursor defined */
 #define CURSOR_ON
diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h
index b7ee708..7c7acb1 100644
--- a/include/configs/MIP405.h
+++ b/include/configs/MIP405.h
@@ -348,7 +348,6 @@
  /
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_CONSOLE_EXTRA_INFO
-#define CONFIG_VIDEO_SW_CURSOR
 #undef CONFIG_VIDEO_ONBOARD
 /
  * USB support EXPERIMENTAL
diff --git a/include/configs/MPC8536DS.h b/include/configs/MPC8536DS.h
index 0900540..cba393a 100644
--- a/include/configs/MPC8536DS.h
+++ b/include/configs/MPC8536DS.h
@@ -507,7 +507,6 @@
 
 #if defined(CONFIG_VIDEO)
 #define CONFIG_BIOSEMU
-#define CONFIG_VIDEO_SW_CURSOR
 #define CONFIG_ATI_RADEON_FB
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_SYS_ISA_IO_BASE_ADDRESS CONFIG_SYS_PCIE3_IO_VIRT
diff --git a/include/configs/MPC8544DS.h b/include/configs/MPC8544DS.h
index 76eb674..c3d69cb 100644
--- a/include/configs/MPC8544DS.h
+++ b/include/configs/MPC8544DS.h
@@ -280,7 +280,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 
 #if defined(CONFIG_VIDEO)
 #define CONFIG_BIOSEMU
-#define CONFIG_VIDEO_SW_CURSOR
 #define CONFIG_ATI_RADEON_FB
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_SYS_ISA_IO_BASE_ADDRESS VIDEO_IO_OFFSET
diff --git a/include/configs/MPC8572DS.h b/include/configs/MPC8572DS.h
index 3f43d75..509728c 100644
--- a/include/configs/MPC8572DS.h
+++ b/include/configs/MPC8572DS.h
@@ -467,7 +467,6 @@
 
 #if defined(CONFIG_VIDEO)
 #define CONFIG_BIOSEMU
-#define CONFIG_VIDEO_SW_CURSOR
 #define CONFIG_ATI_RADEON_FB
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_SYS_ISA_IO_BASE_ADDRESS VIDEO_IO_OFFSET
diff --git a/include/configs/MPC8610HPCD.h b/include/configs/MPC8610HPCD.h
index c5295f9..7882b35 100644
--- a/include/configs/MPC8610HPCD.h
+++ b/include/configs/MPC8610HPCD.h
@@ -26,7 +26,6 @@
 #ifdef CONFIG_FSL_DIU_FB
 #define CONFIG_SYS_DIU_ADDR(CONFIG_SYS_CCSRBAR + 0x2c000)
 #define CONFIG_CMD_BMP
-#define CONFIG_VIDEO_SW_CURSOR
 #define CONFIG_VIDEO_LOGO
 #define 

[U-Boot] [PATCH 28/28] Convert CONFIG_SYS_STDIO_DEREGISTER to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_SYS_STDIO_DEREGISTER

This option should never be enabled in SPL, so use
CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER) when checking the option.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-tegra/Kconfig | 3 +++
 arch/x86/Kconfig| 3 +++
 board/sunxi/Kconfig | 3 +++
 common/Kconfig  | 8 
 common/stdio.c  | 6 +++---
 common/usb_kbd.c| 2 +-
 configs/Cyrus_P5020_defconfig   | 1 +
 configs/Cyrus_P5040_defconfig   | 1 +
 configs/MIP405_defconfig| 1 +
 configs/MPC8610HPCD_defconfig   | 1 +
 configs/MPC8641HPCN_36BIT_defconfig | 1 +
 configs/MPC8641HPCN_defconfig   | 1 +
 configs/PIP405_defconfig| 1 +
 configs/VCMA9_defconfig | 1 +
 configs/cm_fx6_defconfig| 1 +
 configs/novena_defconfig| 1 +
 configs/rpi_2_defconfig | 1 +
 configs/rpi_3_32b_defconfig | 1 +
 configs/rpi_3_defconfig | 1 +
 configs/rpi_defconfig   | 1 +
 configs/sandbox_defconfig   | 1 +
 configs/sandbox_noblk_defconfig | 1 +
 configs/sandbox_spl_defconfig   | 1 +
 configs/tbs2910_defconfig   | 1 +
 drivers/serial/serial-uclass.c  | 2 +-
 include/configs/MIP405.h| 1 -
 include/configs/MPC8610HPCD.h   | 1 -
 include/configs/MPC8641HPCN.h   | 1 -
 include/configs/PIP405.h| 1 -
 include/configs/VCMA9.h | 1 -
 include/configs/cm_fx6.h| 1 -
 include/configs/cyrus.h | 1 -
 include/configs/gr_ep2s60.h | 1 -
 include/configs/novena.h| 1 -
 include/configs/rpi.h   | 1 -
 include/configs/sandbox.h   | 2 --
 include/configs/sunxi-common.h  | 1 -
 include/configs/tbs2910.h   | 1 -
 include/configs/tegra-common.h  | 4 
 include/configs/x86-common.h| 2 --
 include/stdio_dev.h | 2 +-
 scripts/config_whitelist.txt| 1 -
 42 files changed, 41 insertions(+), 27 deletions(-)

diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 76909ee..3800225 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -12,6 +12,9 @@ config SPL_LIBGENERIC_SUPPORT
 config SPL_SERIAL_SUPPORT
default y
 
+config SYS_STDIO_DEREGISTER
+   default y
+
 config TEGRA_IVC
bool "Tegra IVC protocol"
help
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5193ee7..b15935d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -34,6 +34,9 @@ config VENDOR_INTEL
 
 endchoice
 
+config SYS_STDIO_DEREGISTER
+   default y if X86
+
 # board-specific options below
 source "board/advantech/Kconfig"
 source "board/congatec/Kconfig"
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 9954f0a..23413f1 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -27,6 +27,9 @@ config SPL_POWER_SUPPORT
 config SPL_SERIAL_SUPPORT
default y
 
+config SYS_STDIO_DEREGISTER
+   default y
+
 config PRE_CONSOLE_BUFFER
 # Note only one of these may be selected at a time! But hidden choices are
 # not supported by Kconfig
diff --git a/common/Kconfig b/common/Kconfig
index 815e11d..149d002 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -326,6 +326,14 @@ config SYS_CONSOLE_INFO_QUIET
  Enable this option to supress this output. It can be obtained by
  calling stdio_print_current_devices() from board code.
 
+config SYS_STDIO_DEREGISTER
+   bool "Allow deregistering stdio devices"
+   help
+ Generally there is no need to deregister stdio devices since they
+ are never deactivated. But if a stdio device is used which can be
+ removed (for example a USB keyboard) then this option can be
+ enabled to ensure this is handled correctly.
+
 endmenu
 
 config SYS_NO_FLASH
diff --git a/common/stdio.c b/common/stdio.c
index f99cfe7..c849a9a 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -37,7 +37,7 @@ char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" 
};
 #defineCONFIG_SYS_DEVICE_NULLDEV   1
 #endif
 
-#ifdef CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
 #defineCONFIG_SYS_DEVICE_NULLDEV   1
 #endif
 
@@ -177,7 +177,7 @@ int stdio_register(struct stdio_dev *dev)
 /* deregister the device "devname".
  * returns 0 if success, -1 if device is assigned and 1 if devname not found
  */
-#ifdef CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
 int stdio_deregister_dev(struct stdio_dev *dev, int force)
 {
int l;
@@ -224,7 +224,7 @@ int stdio_deregister(const char *devname, int force)
 
return stdio_deregister_dev(dev, force);
 }
-#endif /* CONFIG_SYS_STDIO_DEREGISTER */
+#endif /* CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER) */
 
 int stdio_init_tables(void)
 {
diff --git a/common/usb_kbd.c 

[U-Boot] [PATCH 25/28] Convert CONFIG_SYS_CONSOLE_ENV_OVERWRITE to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_ENV_OVERWRITE

Signed-off-by: Simon Glass 
---

 README | 3 ---
 common/Kconfig | 9 +
 configs/socfpga_arria5_defconfig   | 1 +
 configs/socfpga_cyclone5_defconfig | 1 +
 configs/socfpga_de0_nano_soc_defconfig | 1 +
 configs/socfpga_is1_defconfig  | 1 +
 configs/socfpga_mcvevk_defconfig   | 1 +
 configs/socfpga_sockit_defconfig   | 1 +
 configs/socfpga_socrates_defconfig | 1 +
 configs/socfpga_sr1500_defconfig   | 1 +
 configs/socfpga_vining_fpga_defconfig  | 1 +
 include/configs/MIP405.h   | 1 -
 include/configs/MigoR.h| 1 -
 include/configs/PIP405.h   | 1 -
 include/configs/ap325rxa.h | 1 -
 include/configs/ap_sh4a_4a.h   | 1 -
 include/configs/armadillo-800eva.h | 1 -
 include/configs/ecovec.h   | 1 -
 include/configs/kzm9g.h| 1 -
 include/configs/ms7722se.h | 1 -
 include/configs/r0p7734.h  | 1 -
 include/configs/rcar-gen2-common.h | 1 -
 include/configs/rcar-gen3-common.h | 1 -
 include/configs/sh7752evb.h| 1 -
 include/configs/sh7753evb.h| 1 -
 include/configs/sh7757lcr.h| 1 -
 include/configs/sh7785lcr.h| 1 -
 include/configs/socfpga_common.h   | 1 -
 scripts/config_whitelist.txt   | 1 -
 29 files changed, 18 insertions(+), 21 deletions(-)

diff --git a/README b/README
index 8b9c04e..f2e0809 100644
--- a/README
+++ b/README
@@ -3588,9 +3588,6 @@ Configuration Settings:
 - CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
Enable the call to overwrite_console().
 
-- CONFIG_SYS_CONSOLE_ENV_OVERWRITE
-   Enable overwrite of previous console environment settings.
-
 - CONFIG_SYS_MEMTEST_START, CONFIG_SYS_MEMTEST_END:
Begin and End addresses of the area used by the
simple memory test.
diff --git a/common/Kconfig b/common/Kconfig
index bfde65d..416f7b2 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -300,6 +300,15 @@ config SYS_CONSOLE_IS_IN_ENV
  environment variables can be updated after boot to change the
  input/output devices.
 
+config SYS_CONSOLE_ENV_OVERWRITE
+   bool "Update environment variables during console init"
+   help
+ The console environment variables (stdout, stdin, stderr) can be
+ used to determine the correct console devices on start-up. This
+ option writes the console devices to these variables on console
+ start-up (after relocation). This causes the environment to be
+ updated to match the console devices actually chosen.
+
 endmenu
 
 config SYS_NO_FLASH
diff --git a/configs/socfpga_arria5_defconfig b/configs/socfpga_arria5_defconfig
index 48d5e0d..4b79f02 100644
--- a/configs/socfpga_arria5_defconfig
+++ b/configs/socfpga_arria5_defconfig
@@ -5,6 +5,7 @@ CONFIG_SPL_STACK_R_ADDR=0x0080
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_arria5_socdk"
 CONFIG_FIT=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
diff --git a/configs/socfpga_cyclone5_defconfig 
b/configs/socfpga_cyclone5_defconfig
index fcbcd7f..abdc450 100644
--- a/configs/socfpga_cyclone5_defconfig
+++ b/configs/socfpga_cyclone5_defconfig
@@ -5,6 +5,7 @@ CONFIG_SPL_STACK_R_ADDR=0x0080
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_socdk"
 CONFIG_FIT=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
diff --git a/configs/socfpga_de0_nano_soc_defconfig 
b/configs/socfpga_de0_nano_soc_defconfig
index 8b5c6a5..e4258ec 100644
--- a/configs/socfpga_de0_nano_soc_defconfig
+++ b/configs/socfpga_de0_nano_soc_defconfig
@@ -5,6 +5,7 @@ CONFIG_SPL_STACK_R_ADDR=0x0080
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_de0_nano_soc"
 CONFIG_FIT=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
diff --git a/configs/socfpga_is1_defconfig b/configs/socfpga_is1_defconfig
index 6f8eb55..a8432a9 100644
--- a/configs/socfpga_is1_defconfig
+++ b/configs/socfpga_is1_defconfig
@@ -5,6 +5,7 @@ CONFIG_SPL_STACK_R_ADDR=0x0080
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_is1"
 CONFIG_FIT=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/socfpga_mcvevk_defconfig b/configs/socfpga_mcvevk_defconfig
index 0065abb..2b0d379 100644
--- a/configs/socfpga_mcvevk_defconfig
+++ b/configs/socfpga_mcvevk_defconfig
@@ -5,6 +5,7 @@ CONFIG_SPL_STACK_R_ADDR=0x0080
 CONFIG_DEFAULT_DEVICE_TREE="socfpga_cyclone5_mcvevk"
 CONFIG_FIT=y
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y
 

[U-Boot] [PATCH 22/28] video: Drop CONFIG_CONSOLE_INFO_QUIET

2016-09-19 Thread Simon Glass
This is not used in U-Boot. Drop it.

Signed-off-by: Simon Glass 
---

 include/configs/edminiv2.h   | 1 -
 include/configs/km/km_arm.h  | 1 -
 include/configs/mv-common.h  | 1 -
 scripts/config_whitelist.txt | 1 -
 4 files changed, 4 deletions(-)

diff --git a/include/configs/edminiv2.h b/include/configs/edminiv2.h
index 1e2807d..33612d6 100644
--- a/include/configs/edminiv2.h
+++ b/include/configs/edminiv2.h
@@ -214,7 +214,6 @@
 /*
  * Other required minimal configurations
  */
-#define CONFIG_CONSOLE_INFO_QUIET  /* some code reduction */
 #define CONFIG_ARCH_CPU_INIT   /* call arch_cpu_init() */
 #define CONFIG_ARCH_MISC_INIT  /* call arch_misc_init() */
 #define CONFIG_DISPLAY_CPUINFO /* Display cpu info */
diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
index 25db704..e2fade0 100644
--- a/include/configs/km/km_arm.h
+++ b/include/configs/km/km_arm.h
@@ -146,7 +146,6 @@
 /*
  * Other required minimal configurations
  */
-#define CONFIG_CONSOLE_INFO_QUIET  /* some code reduction */
 #define CONFIG_ARCH_CPU_INIT   /* call arch_cpu_init() */
 #define CONFIG_ARCH_MISC_INIT  /* call arch_misc_init() */
 #define CONFIG_DISPLAY_CPUINFO /* Display cpu info */
diff --git a/include/configs/mv-common.h b/include/configs/mv-common.h
index dd223be..1af8913 100644
--- a/include/configs/mv-common.h
+++ b/include/configs/mv-common.h
@@ -83,7 +83,6 @@
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_CMDLINE_EDITING
-#define CONFIG_CONSOLE_INFO_QUIET  /* some code reduction */
 #define CONFIG_ARCH_CPU_INIT   /* call arch_cpu_init() */
 #define CONFIG_ARCH_MISC_INIT  /* call arch_misc_init() */
 #define CONFIG_BOARD_EARLY_INIT_F /* call board_init_f for early inits */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 204830b..fe50cc3 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -673,7 +673,6 @@ CONFIG_COMMON_ENV_SETTINGS
 CONFIG_COMMON_ENV_UBI
 CONFIG_COMPACT_FLASH
 CONFIG_COMPAT
-CONFIG_CONSOLE_INFO_QUIET
 CONFIG_CONSOLE_SCROLL_LINES
 CONFIG_CONS_EXTC_PINSEL
 CONFIG_CONS_EXTC_RATE
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 19/28] video: Drop CONFIG_VIDEO_SW_CURSOR

2016-09-19 Thread Simon Glass
Since all boards enable this, we may as well drop the option.

This is a separate patch from the previous one, so it can be skipped if
someone identifies a need.

Signed-off-by: Simon Glass 
---

 README  |  1 -
 drivers/video/Kconfig   | 10 --
 drivers/video/cfb_console.c | 46 -
 3 files changed, 12 insertions(+), 45 deletions(-)

diff --git a/README b/README
index 2dfdc52..cf83fc3 100644
--- a/README
+++ b/README
@@ -1674,7 +1674,6 @@ CBFS (Coreboot Filesystem) support
CONFIG_VIDEO
CONFIG_CMD_BMP
CONFIG_CFB_CONSOLE
-   CONFIG_VIDEO_SW_CURSOR
CONFIG_VGA_AS_SINGLE_DEVICE
CONFIG_VIDEO_LOGO
CONFIG_VIDEO_BMP_LOGO
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 78bf2c9..278600c 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -480,16 +480,6 @@ config VGA_AS_SINGLE_DEVICE
  may be used if you have no keyboard device, or more than one
  (USB Keyboard, AT Keyboard).
 
-config VIDEO_SW_CURSOR
-   bool "Enable a software cursor"
-   depends on CFB_CONSOLE
-   default y if CFB_CONSOLE
-   help
- This draws a cursor after the last character. No blinking is
- provided. This makes it possible to see the current cursor
- position when entering text on the console. It is recommended to
- enable this.
-
 config VIDEO_CT69000
bool "Enable Chips & Technologies 69000 video driver"
depends on VIDEO
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 56d3c15..c788651 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -58,11 +58,6 @@
  * info);
  * that fills a info buffer at i=row.
  * s.a: board/eltec/bab7xx.
- *
- * CONFIG_VIDEO_SW_CURSOR:- Draws a cursor after the last
- * character. No blinking is provided.
- * Uses the macros CURSOR_SET and
- * CURSOR_OFF.
  */
 
 #include 
@@ -141,21 +136,6 @@
 #include 
 #endif
 
-#if !defined(CONFIG_VIDEO_SW_CURSOR)
-/* no Cursor defined */
-#define CURSOR_ON
-#define CURSOR_OFF
-#define CURSOR_SET
-#endif
-
-#if defined(CONFIG_VIDEO_SW_CURSOR)
-void console_cursor(int state);
-
-#define CURSOR_ON  console_cursor(1)
-#define CURSOR_OFF console_cursor(0)
-#define CURSOR_SET video_set_cursor()
-#endif /* CONFIG_VIDEO_SW_CURSOR */
-
 #ifdef CONFIG_VIDEO_LOGO
 #ifdef CONFIG_VIDEO_BMP_LOGO
 #include 
@@ -529,14 +509,6 @@ static void video_putchar(int xx, int yy, unsigned char c)
video_drawchars(xx, yy + video_logo_height, , 1);
 }
 
-#if defined(CONFIG_VIDEO_SW_CURSOR)
-static void video_set_cursor(void)
-{
-   if (cursor_state)
-   console_cursor(0);
-   console_cursor(1);
-}
-
 static void video_invertchar(int xx, int yy)
 {
int firstx = xx * VIDEO_PIXEL_SIZE;
@@ -552,7 +524,7 @@ static void video_invertchar(int xx, int yy)
}
 }
 
-void console_cursor(int state)
+static void console_cursor(int state)
 {
if (cursor_state != state) {
if (cursor_state) {
@@ -573,7 +545,13 @@ void console_cursor(int state)
if (cfb_do_flush_cache)
flush_cache(VIDEO_FB_ADRS, VIDEO_SIZE);
 }
-#endif
+
+static void video_set_cursor(void)
+{
+   if (cursor_state)
+   console_cursor(0);
+   console_cursor(1);
+}
 
 #ifndef VIDEO_HW_RECTFILL
 static void memsetl(int *p, int c, int v)
@@ -779,7 +757,7 @@ static void parse_putc(const char c)
static int nl = 1;
 
if (console_cursor_is_visible())
-   CURSOR_OFF;
+   console_cursor(0);
 
switch (c) {
case 13:/* back to first column */
@@ -820,7 +798,7 @@ static void parse_putc(const char c)
}
 
if (console_cursor_is_visible())
-   CURSOR_SET;
+   video_set_cursor();
 }
 
 static void video_putc(struct stdio_dev *dev, const char c)
@@ -951,7 +929,7 @@ static void video_putc(struct stdio_dev *dev, const char c)
 
if (flush) {
if (!ansi_cursor_hidden)
-   CURSOR_OFF;
+   console_cursor(0);
ansi_buf_size = 0;
switch (cchar) {
case 'A':
@@ -1025,7 +1003,7 @@ static void video_putc(struct stdio_dev *dev, const char 
c)
break;
}
if (!ansi_cursor_hidden)
-   CURSOR_SET;
+   video_set_cursor();
}
} else {
parse_putc(c);
-- 

[U-Boot] [PATCH 23/28] Convert CONFIG_LCD to Kconfig

2016-09-19 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_LCD

Signed-off-by: Simon Glass 
---

 configs/TQM823L_LCD_defconfig | 3 ++-
 configs/TTTech_defconfig  | 3 ++-
 configs/at91sam9261ek_dataflash_cs0_defconfig | 1 +
 configs/at91sam9261ek_dataflash_cs3_defconfig | 1 +
 configs/at91sam9261ek_nandflash_defconfig | 1 +
 configs/at91sam9263ek_dataflash_cs0_defconfig | 1 +
 configs/at91sam9263ek_dataflash_defconfig | 1 +
 configs/at91sam9263ek_nandflash_defconfig | 1 +
 configs/at91sam9263ek_norflash_boot_defconfig | 1 +
 configs/at91sam9263ek_norflash_defconfig  | 1 +
 configs/at91sam9g10ek_dataflash_cs0_defconfig | 1 +
 configs/at91sam9g10ek_dataflash_cs3_defconfig | 1 +
 configs/at91sam9g10ek_nandflash_defconfig | 1 +
 configs/at91sam9m10g45ek_mmc_defconfig| 1 +
 configs/at91sam9m10g45ek_nandflash_defconfig  | 1 +
 configs/at91sam9n12ek_mmc_defconfig   | 1 +
 configs/at91sam9n12ek_nandflash_defconfig | 1 +
 configs/at91sam9n12ek_spiflash_defconfig  | 1 +
 configs/at91sam9rlek_dataflash_defconfig  | 1 +
 configs/at91sam9rlek_mmc_defconfig| 1 +
 configs/at91sam9rlek_nandflash_defconfig  | 1 +
 configs/at91sam9x5ek_dataflash_defconfig  | 1 +
 configs/at91sam9x5ek_mmc_defconfig| 1 +
 configs/at91sam9x5ek_nandflash_defconfig  | 1 +
 configs/at91sam9x5ek_spiflash_defconfig   | 1 +
 configs/brppt1_mmc_defconfig  | 1 +
 configs/brppt1_nand_defconfig | 1 +
 configs/brppt1_spi_defconfig  | 1 +
 configs/brxre1_defconfig  | 1 +
 configs/cm_t3517_defconfig| 1 +
 configs/cm_t35_defconfig  | 1 +
 configs/peach-pi_defconfig| 1 +
 configs/peach-pit_defconfig   | 1 +
 configs/picosam9g45_defconfig | 1 +
 configs/pm9261_defconfig  | 1 +
 configs/pm9263_defconfig  | 1 +
 configs/rpi_2_defconfig   | 1 +
 configs/rpi_3_32b_defconfig   | 1 +
 configs/rpi_3_defconfig   | 1 +
 configs/rpi_defconfig | 1 +
 configs/sama5d3xek_mmc_defconfig  | 1 +
 configs/sama5d3xek_nandflash_defconfig| 1 +
 configs/sama5d3xek_spiflash_defconfig | 1 +
 configs/sama5d4ek_mmc_defconfig   | 1 +
 configs/sama5d4ek_nandflash_defconfig | 1 +
 configs/sama5d4ek_spiflash_defconfig  | 1 +
 configs/snow_defconfig| 1 +
 configs/spring_defconfig  | 1 +
 configs/wtk_defconfig | 3 ++-
 configs/zipitz2_defconfig | 1 +
 drivers/video/Kconfig | 8 
 include/configs/M52277EVB.h   | 1 -
 include/configs/at91sam9261ek.h   | 1 -
 include/configs/at91sam9263ek.h   | 1 -
 include/configs/at91sam9m10g45ek.h| 1 -
 include/configs/at91sam9n12ek.h   | 1 -
 include/configs/at91sam9rlek.h| 1 -
 include/configs/at91sam9x5ek.h| 1 -
 include/configs/brppt1.h  | 1 -
 include/configs/brxre1.h  | 1 -
 include/configs/cm_t35.h  | 1 -
 include/configs/cm_t3517.h| 1 -
 include/configs/exynos5-dt-common.h   | 1 -
 include/configs/ma5d4evk.h| 1 -
 include/configs/peach-pi.h| 1 -
 include/configs/picosam9g45.h | 1 -
 include/configs/pm9261.h  | 1 -
 include/configs/pm9263.h  | 1 -
 include/configs/rpi.h | 1 -
 include/configs/sama5d2_xplained.h| 1 -
 include/configs/sama5d3xek.h  | 1 -
 include/configs/sama5d4_xplained.h| 1 -
 include/configs/sama5d4ek.h   | 1 -
 include/configs/smdk5250.h| 1 -
 include/configs/smdk5420.h| 1 -
 include/configs/zipitz2.h | 1 -
 scripts/config_whitelist.txt  | 1 -
 77 files changed, 61 insertions(+), 29 deletions(-)

diff --git a/configs/TQM823L_LCD_defconfig b/configs/TQM823L_LCD_defconfig
index 38f5119..9bc8c73 100644
--- a/configs/TQM823L_LCD_defconfig
+++ b/configs/TQM823L_LCD_defconfig
@@ -2,7 +2,7 @@ CONFIG_PPC=y
 CONFIG_8xx=y
 CONFIG_TARGET_TQM823L=y
 CONFIG_OF_BOARD_SETUP=y
-CONFIG_SYS_EXTRA_OPTIONS="LCD,NEC_NL6448BC20"
+CONFIG_SYS_EXTRA_OPTIONS="NEC_NL6448BC20"
 CONFIG_BOOTDELAY=5
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_ASKENV=y
@@ -10,4 +10,5 @@ CONFIG_CMD_ASKENV=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_SNTP=y
 CONFIG_CMD_EXT2=y
+CONFIG_LCD=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/TTTech_defconfig b/configs/TTTech_defconfig
index e545848..9649012 100644
--- a/configs/TTTech_defconfig
+++ b/configs/TTTech_defconfig
@@ -2,7 +2,7 @@ CONFIG_PPC=y
 

[U-Boot] [PATCH 13/28] video: Drop the imx25lcdc driver

2016-09-19 Thread Simon Glass
This is not used anywhere in U-Boot.

Signed-off-by: Simon Glass 
---

 drivers/video/Makefile|   1 -
 drivers/video/imx25lcdc.c | 121 --
 2 files changed, 122 deletions(-)
 delete mode 100644 drivers/video/imx25lcdc.c

diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 2df2015..6bb9e28 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -39,7 +39,6 @@ obj-$(CONFIG_VIDEO_BCM2835) += bcm2835.o
 obj-$(CONFIG_VIDEO_COREBOOT) += coreboot_fb.o
 obj-$(CONFIG_VIDEO_CT69000) += ct69000.o videomodes.o
 obj-$(CONFIG_VIDEO_DA8XX) += da8xx-fb.o videomodes.o
-obj-$(CONFIG_VIDEO_IMX25LCDC) += imx25lcdc.o videomodes.o
 obj-$(CONFIG_VIDEO_LCD_ANX9804) += anx9804.o
 obj-$(CONFIG_VIDEO_LCD_HITACHI_TX18D42VM) += hitachi_tx18d42vm_lcd.o
 obj-$(CONFIG_VIDEO_LCD_SSD2828) += ssd2828.o
diff --git a/drivers/video/imx25lcdc.c b/drivers/video/imx25lcdc.c
deleted file mode 100644
index ef5767b..000
--- a/drivers/video/imx25lcdc.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * (C) Copyright 2011
- * Matthias Weisser 
- *
- * SPDX-License-Identifier:GPL-2.0+
- *
- * imx25lcdc.c - Graphic interface for i.MX25 lcd controller
- */
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include "videomodes.h"
-
-/*
- * 4MB (at the end of system RAM)
- */
-#define VIDEO_MEM_SIZE 0x40
-
-#define FB_SYNC_CLK_INV(1<<16) /* pixel clock inverted */
-
-/*
- * Graphic Device
- */
-static GraphicDevice imx25fb;
-
-void *video_hw_init(void)
-{
-   struct lcdc_regs *lcdc = (struct lcdc_regs *)IMX_LCDC_BASE;
-   struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
-   GraphicDevice *pGD = 
-   char *s;
-   u32 *videomem;
-
-   memset(pGD, 0, sizeof(GraphicDevice));
-
-   pGD->gdfIndex = GDF_16BIT_565RGB;
-   pGD->gdfBytesPP = 2;
-   pGD->memSize = VIDEO_MEM_SIZE;
-   pGD->frameAdrs = PHYS_SDRAM + PHYS_SDRAM_SIZE - VIDEO_MEM_SIZE;
-
-   videomem = (u32 *)pGD->frameAdrs;
-
-   s = getenv("videomode");
-   if (s != NULL) {
-   struct ctfb_res_modes var_mode;
-   u32 lsr, lpcr, lhcr, lvcr;
-   unsigned long div;
-   int bpp;
-
-   /* Disable all clocks of the LCDC */
-   writel(readl(>cgr0) & ~((1<<7) | (1<<24)), >cgr0);
-   writel(readl(>cgr1) & ~(1<<29), >cgr1);
-
-   bpp = video_get_params(_mode, s);
-
-   if (bpp == 0) {
-   var_mode.xres = 320;
-   var_mode.yres = 240;
-   var_mode.pixclock = 154000;
-   var_mode.left_margin = 68;
-   var_mode.right_margin = 20;
-   var_mode.upper_margin = 4;
-   var_mode.lower_margin = 18;
-   var_mode.hsync_len = 40;
-   var_mode.vsync_len = 6;
-   var_mode.sync = 0;
-   var_mode.vmode = 0;
-   }
-
-   /* Fill memory with white */
-   memset(videomem, 0xFF, var_mode.xres * var_mode.yres * 2);
-
-   imx25fb.winSizeX = var_mode.xres;
-   imx25fb.winSizeY = var_mode.yres;
-
-   /* LCD base clock is 66.6MHZ. We do calculations in kHz */
-   div = 66000 / (10L / var_mode.pixclock);
-   if (div > 63)
-   div = 63;
-   if (0 == div)
-   div = 1;
-
-   lsr = ((var_mode.xres / 16) << 20) |
-   var_mode.yres;
-   lpcr =  (1 << 31) |
-   (1 << 30) |
-   (5 << 25) |
-   (1 << 23) |
-   (1 << 22) |
-   (1 << 19) |
-   (1 <<  7) |
-   div;
-   lhcr =  (var_mode.right_margin << 0) |
-   (var_mode.left_margin << 8) |
-   (var_mode.hsync_len << 26);
-
-   lvcr =  (var_mode.lower_margin << 0) |
-   (var_mode.upper_margin << 8) |
-   (var_mode.vsync_len << 26);
-
-   writel((uint32_t)videomem, >lssar);
-   writel(lsr, >lsr);
-   writel(var_mode.xres * 2 / 4, >lvpwr);
-   writel(lpcr, >lpcr);
-   writel(lhcr, >lhcr);
-   writel(lvcr, >lvcr);
-   writel(0x00040060, >ldcr);
-
-   writel(0xA90300, >lpccr);
-
-   /* Ensable all clocks of the LCDC */
-   writel(readl(>cgr0) | ((1<<7) | (1<<24)), >cgr0);
-   writel(readl(>cgr1) | (1<<29), >cgr1);
-   }
-
-   return pGD;
-}
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 12/28] video: Drop the smiLynxEM driver

2016-09-19 Thread Simon Glass
This is not used in U-Boot anymore.

Signed-off-by: Simon Glass 
---

 README   |   6 -
 drivers/video/Makefile   |   1 -
 drivers/video/cfb_console.c  |  13 -
 drivers/video/smiLynxEM.c| 835 ---
 scripts/config_whitelist.txt |   1 -
 5 files changed, 856 deletions(-)
 delete mode 100644 drivers/video/smiLynxEM.c

diff --git a/README b/README
index e1d4dfc..74ecb79 100644
--- a/README
+++ b/README
@@ -1665,12 +1665,6 @@ CBFS (Coreboot Filesystem) support
instead.
 
 - Video support:
-   CONFIG_VIDEO_SMI_LYNXEM
-   Enable Silicon Motion SMI 712/710/810 Video chip. The
-   video output is selected via environment 'videoout'
-   (1 = LCD and 2 = CRT). If videoout is undefined, CRT is
-   assumed.
-
CONFIG_VIDEO_SED13806
Enable Epson SED13806 driver. This driver supports 8bpp
and 16bpp modes defined by CONFIG_VIDEO_SED13806_8BPP
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 3f045fe..2df2015 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -53,7 +53,6 @@ obj-$(CONFIG_VIDEO_S3C) += s3c-fb.o videomodes.o
 obj-$(CONFIG_VIDEO_SANDBOX_SDL) += sandbox_sdl.o
 obj-$(CONFIG_VIDEO_SED13806) += sed13806.o
 obj-$(CONFIG_VIDEO_SM501) += sm501.o
-obj-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o
 obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o videomodes.o
 obj-$(CONFIG_VIDEO_TEGRA20) += tegra.o
 obj-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 949187c..a087d2e 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -27,7 +27,6 @@
  *
  * (for SMI LynxE graphic chip)
  *
- * CONFIG_VIDEO_SMI_LYNXEM- use graphic driver for SMI 710,712,810
  * VIDEO_FB_LITTLE_ENDIAN - framebuffer organisation default: big endian
  * VIDEO_HW_RECTFILL - graphic driver supports hardware rectangle fill
  * VIDEO_HW_BITBLT   - graphic driver supports hardware bit blt
@@ -87,18 +86,6 @@
 #include 
 
 /*
- * Console device defines with SMI graphic
- * Any other graphic must change this section
- */
-
-#ifdef CONFIG_VIDEO_SMI_LYNXEM
-
-#define VIDEO_FB_LITTLE_ENDIAN
-#define VIDEO_HW_RECTFILL
-#define VIDEO_HW_BITBLT
-#endif
-
-/*
  * Defines for the CT69000 driver
  */
 #ifdef CONFIG_VIDEO_CT69000
diff --git a/drivers/video/smiLynxEM.c b/drivers/video/smiLynxEM.c
deleted file mode 100644
index 1880ccc..000
--- a/drivers/video/smiLynxEM.c
+++ /dev/null
@@ -1,835 +0,0 @@
-/*
- * (C) Copyright 1997-2002 ELTEC Elektronik AG
- * Frank Gottschling 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-/*
- * smiLynxEM.c
- *
- * Silicon Motion graphic interface for sm810/sm710/sm712 accelerator
- *
- * modification history
- * 
- * 04-18-2002 Rewritten for U-Boot .
- *
- * 18-03-2004 - Unify videomodes handling with the ct69000
- *- The video output can be set via the variable "videoout"
- *  in the environment.
- *  videoout=1 output on LCD
- *  videoout=2 output on CRT (default value)
- * 
- */
-
-#include 
-
-#include 
-#include 
-#include "videomodes.h"
-/*
- * Export Graphic Device
- */
-GraphicDevice smi;
-
-/*
- * SMI 710/712 have 4MB internal RAM; SMI 810 2MB internal + 2MB external
- */
-#define VIDEO_MEM_SIZE 0x40
-
-
-/*
- * ISA mapped regs
- */
-#define SMI_INDX_C4(pGD->isaBase + 0x03c4)/* index reg */
-#define SMI_DATA_C5(pGD->isaBase + 0x03c5)/* data reg */
-#define SMI_INDX_D4(pGD->isaBase + 0x03d4)/* index reg */
-#define SMI_DATA_D5(pGD->isaBase + 0x03d5)/* data reg */
-#define SMI_ISR1   (pGD->isaBase + 0x03ca)
-#define SMI_INDX_CE(pGD->isaBase + 0x03ce)/* index reg */
-#define SMI_DATA_CF(pGD->isaBase + 0x03cf)/* data reg */
-#define SMI_LOCK_REG   (pGD->isaBase + 0x03c3)/* unlock/lock ext 
crt reg */
-#define SMI_MISC_REG   (pGD->isaBase + 0x03c2)/* misc reg */
-#define SMI_LUT_MASK   (pGD->isaBase + 0x03c6)/* lut mask reg */
-#define SMI_LUT_START  (pGD->isaBase + 0x03c8)/* lut start index */
-#define SMI_LUT_RGB(pGD->isaBase + 0x03c9)/* lut colors auto 
incr.*/
-#define SMI_INDX_ATTR  (pGD->isaBase + 0x03c0)/* attributes index 
reg */
-
-/*
- * Video processor control
- */
-typedef struct {
-   unsigned int   control;
-   unsigned int   colorKey;
-   unsigned int   colorKeyMask;
-   unsigned int   start;
-   unsigned short offset;
-   unsigned short width;
-   unsigned int   fifoPrio;
-   unsigned int   fifoERL;
-   unsigned int   YUVtoRGB;
-} SmiVideoProc;
-
-/*
- * Video window control
- */

[U-Boot] [PATCH 14/28] video: Drop the s3c-fb driver

2016-09-19 Thread Simon Glass
This is not used in U-Boot.

Signed-off-by: Simon Glass 
---

 drivers/video/Makefile  |   1 -
 drivers/video/cfb_console.c |   2 +-
 drivers/video/s3c-fb.c  | 172 
 3 files changed, 1 insertion(+), 174 deletions(-)
 delete mode 100644 drivers/video/s3c-fb.c

diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 6bb9e28..412c948 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -48,7 +48,6 @@ obj-$(CONFIG_VIDEO_IPUV3) += mxc_ipuv3_fb.o ipu_common.o 
ipu_disp.o
 obj-$(CONFIG_VIDEO_MVEBU) += mvebu_lcd.o
 obj-$(CONFIG_VIDEO_MXS) += mxsfb.o videomodes.o
 obj-$(CONFIG_VIDEO_OMAP3) += omap3_dss.o
-obj-$(CONFIG_VIDEO_S3C) += s3c-fb.o videomodes.o
 obj-$(CONFIG_VIDEO_SANDBOX_SDL) += sandbox_sdl.o
 obj-$(CONFIG_VIDEO_SED13806) += sed13806.o
 obj-$(CONFIG_VIDEO_SM501) += sm501.o
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index a087d2e..aca 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -104,7 +104,7 @@
 #define VIDEO_HW_BITBLT
 #endif
 
-#if defined(CONFIG_VIDEO_MXS) || defined(CONFIG_VIDEO_S3C)
+#if defined(CONFIG_VIDEO_MXS)
 #define VIDEO_FB_16BPP_WORD_SWAP
 #endif
 
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
deleted file mode 100644
index 521eb75..000
--- a/drivers/video/s3c-fb.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * S3C24x0 LCD driver
- *
- * NOTE: Only 16/24 bpp operation with TFT LCD is supported.
- *
- * Copyright (C) 2014 Marek Vasut 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-
-#include "videomodes.h"
-
-static GraphicDevice panel;
-
-/* S3C requires the FB to be 4MiB aligned. */
-#define S3CFB_ALIGN(4 << 20)
-
-#define S3CFB_LCDCON1_CLKVAL(x)((x) << 8)
-#define S3CFB_LCDCON1_PNRMODE_TFT  (0x3 << 5)
-#define S3CFB_LCDCON1_BPPMODE_TFT_16BPP(0xc << 1)
-#define S3CFB_LCDCON1_BPPMODE_TFT_24BPP(0xd << 1)
-
-#define S3CFB_LCDCON2_VBPD(x)  ((x) << 24)
-#define S3CFB_LCDCON2_LINEVAL(x)   ((x) << 14)
-#define S3CFB_LCDCON2_VFPD(x)  ((x) << 6)
-#define S3CFB_LCDCON2_VSPW(x)  ((x) << 0)
-
-#define S3CFB_LCDCON3_HBPD(x)  ((x) << 19)
-#define S3CFB_LCDCON3_HOZVAL(x)((x) << 8)
-#define S3CFB_LCDCON3_HFPD(x)  ((x) << 0)
-
-#define S3CFB_LCDCON4_HSPW(x)  ((x) << 0)
-
-#define S3CFB_LCDCON5_BPP24BL  (1 << 12)
-#define S3CFB_LCDCON5_FRM565   (1 << 11)
-#define S3CFB_LCDCON5_HWSWP(1 << 0)
-
-#definePS2KHZ(ps)  (10UL / (ps))
-
-/*
- * Example:
- * setenv videomode video=ctfb:x:800,y:480,depth:16,mode:0,\
- *pclk:30066,le:41,ri:89,up:45,lo:12,
- *hs:1,vs:1,sync:100663296,vmode:0
- */
-static void s3c_lcd_init(GraphicDevice *panel,
-   struct ctfb_res_modes *mode, int bpp)
-{
-   uint32_t clk_divider;
-   struct s3c24x0_lcd *regs = s3c24x0_get_base_lcd();
-
-   /* Stop the controller. */
-   clrbits_le32(>lcdcon1, 1);
-
-   /* Calculate clock divider. */
-   clk_divider = (get_HCLK() / PS2KHZ(mode->pixclock)) / 1000;
-   clk_divider = DIV_ROUND_UP(clk_divider, 2);
-   if (clk_divider)
-   clk_divider -= 1;
-
-   /* Program LCD configuration. */
-   switch (bpp) {
-   case 16:
-   writel(S3CFB_LCDCON1_BPPMODE_TFT_16BPP |
-  S3CFB_LCDCON1_PNRMODE_TFT |
-  S3CFB_LCDCON1_CLKVAL(clk_divider),
-  >lcdcon1);
-   writel(S3CFB_LCDCON5_HWSWP | S3CFB_LCDCON5_FRM565,
-  >lcdcon5);
-   break;
-   case 24:
-   writel(S3CFB_LCDCON1_BPPMODE_TFT_24BPP |
-  S3CFB_LCDCON1_PNRMODE_TFT |
-  S3CFB_LCDCON1_CLKVAL(clk_divider),
-  >lcdcon1);
-   writel(S3CFB_LCDCON5_BPP24BL, >lcdcon5);
-   break;
-   }
-
-   writel(S3CFB_LCDCON2_LINEVAL(mode->yres - 1) |
-  S3CFB_LCDCON2_VBPD(mode->upper_margin - 1) |
-  S3CFB_LCDCON2_VFPD(mode->lower_margin - 1) |
-  S3CFB_LCDCON2_VSPW(mode->vsync_len - 1),
-  >lcdcon2);
-
-   writel(S3CFB_LCDCON3_HBPD(mode->right_margin - 1) |
-  S3CFB_LCDCON3_HFPD(mode->left_margin - 1) |
-  S3CFB_LCDCON3_HOZVAL(mode->xres - 1),
-  >lcdcon3);
-
-   writel(S3CFB_LCDCON4_HSPW(mode->hsync_len - 1),
-  >lcdcon4);
-
-   /* Write FB address. */
-   writel(panel->frameAdrs >> 1, >lcdsaddr1);
-   writel((panel->frameAdrs +
-  (mode->xres * mode->yres * panel->gdfBytesPP)) >> 1,
-  >lcdsaddr2);
-   writel(mode->xres * bpp / 16, >lcdsaddr3);
-
-   /* Start the controller. */
-   setbits_le32(>lcdcon1, 1);
-}
-
-void 

[U-Boot] [PATCH 01/28] Remove some merge markers

2016-09-19 Thread Simon Glass
These two files have patch merge markers in them, within comments or
strings. Remove then, so that a search for merge markers does not show up
matches in these files.

Signed-off-by: Simon Glass 
---

 drivers/net/ax88180.c  | 6 +-
 drivers/usb/host/isp116x-hcd.c | 6 +++---
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ax88180.c b/drivers/net/ax88180.c
index 43a67a5..261fde0 100644
--- a/drivers/net/ax88180.c
+++ b/drivers/net/ax88180.c
@@ -698,11 +698,7 @@ static void ax88180_read_mac_addr (struct eth_device *dev)
}
 }
 
-/*
-===
-<< Exported SubProgram Bodies  >>
-===
-*/
+/* Exported SubProgram Bodies */
 int ax88180_initialize (bd_t * bis)
 {
struct eth_device *dev;
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index 0556f32..32874d7 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -428,10 +428,10 @@ static int isp116x_interrupt(struct isp116x *isp116x)
isp116x_write_reg16(isp116x, HCuPINTENB, 0);
irqstat = isp116x_read_reg16(isp116x, HCuPINT);
isp116x_write_reg16(isp116x, HCuPINT, irqstat);
-   DBG(">> irqstat %x <<", irqstat);
+   DBG("-- irqstat %x --", irqstat);
 
if (irqstat & HCuPINT_ATL) {
-   DBG(">> HCuPINT_ATL <<");
+   DBG("-- HCuPINT_ATL --");
udelay(500);
ret = 1;
}
@@ -439,7 +439,7 @@ static int isp116x_interrupt(struct isp116x *isp116x)
if (irqstat & HCuPINT_OPR) {
intstat = isp116x_read_reg32(isp116x, HCINTSTAT);
isp116x_write_reg32(isp116x, HCINTSTAT, intstat);
-   DBG(">> HCuPINT_OPR %x <<", intstat);
+   DBG("-- HCuPINT_OPR %x --", intstat);
 
if (intstat & HCINT_UE) {
ERR("unrecoverable error, controller disabled");
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 06/28] config: Drop CONFIG_CONSOLE_DEV

2016-09-19 Thread Simon Glass
This is not really a config. Rename it to avoid confusion.

Signed-off-by: Simon Glass 
---

 include/configs/advantech_dms-ba16.h  | 4 ++--
 include/configs/aristainetos-common.h | 2 +-
 include/configs/aristainetos.h| 2 +-
 include/configs/aristainetos2.h   | 2 +-
 include/configs/aristainetos2b.h  | 2 +-
 include/configs/cgtqmx6eval.h | 4 ++--
 include/configs/el6x_common.h | 2 +-
 include/configs/embestmx6boards.h | 2 +-
 include/configs/ge_bx50v3.h   | 4 ++--
 include/configs/mx6cuboxi.h   | 4 ++--
 include/configs/mx6qsabreauto.h   | 2 +-
 include/configs/mx6sabre_common.h | 2 +-
 include/configs/mx6sabresd.h  | 2 +-
 include/configs/o2dnt-common.h| 6 +++---
 include/configs/pcm058.h  | 2 +-
 include/configs/tqma6.h   | 2 +-
 include/configs/tqma6_mba6.h  | 2 +-
 include/configs/tqma6_wru4.h  | 2 +-
 include/configs/zc5202.h  | 2 +-
 include/configs/zc5601.h  | 2 +-
 scripts/config_whitelist.txt  | 1 -
 21 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/include/configs/advantech_dms-ba16.h 
b/include/configs/advantech_dms-ba16.h
index 22410ce..4f07f23 100644
--- a/include/configs/advantech_dms-ba16.h
+++ b/include/configs/advantech_dms-ba16.h
@@ -16,7 +16,7 @@
 #define CONFIG_DEFAULT_FDT_FILE"imx6q-dms-ba16.dtb"
 
 #define CONFIG_MXC_UART_BASE   UART4_BASE
-#define CONFIG_CONSOLE_DEV "ttymxc3"
+#define CONSOLE_DEV"ttymxc3"
 #define CONFIG_EXTRA_BOOTARGS  "panic=10"
 
 #define CONFIG_BOOT_DIR""
@@ -117,7 +117,7 @@
"fdt_addr=0x1800\0" \
"boot_fdt=yes\0" \
"ip_dyn=yes\0" \
-   "console=" CONFIG_CONSOLE_DEV "\0" \
+   "console=" CONSOLE_DEV "\0" \
"fdt_high=0x\0"   \
"initrd_high=0x\0" \
"sddev=0\0" \
diff --git a/include/configs/aristainetos-common.h 
b/include/configs/aristainetos-common.h
index 7d6a7bf..c31d9ad 100644
--- a/include/configs/aristainetos-common.h
+++ b/include/configs/aristainetos-common.h
@@ -57,7 +57,7 @@
"rescue_sys_length=f1\0" \
"panel=lb07wv8\0" \
"splashpos=m,m\0" \
-   "console=" CONFIG_CONSOLE_DEV "\0" \
+   "console=" CONSOLE_DEV "\0" \
"fdt_high=0x\0"   \
"initrd_high=0x\0" \
"addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
diff --git a/include/configs/aristainetos.h b/include/configs/aristainetos.h
index be93deb..1799cc1 100644
--- a/include/configs/aristainetos.h
+++ b/include/configs/aristainetos.h
@@ -18,7 +18,7 @@
 #define CONFIG_BOARDNAME   "aristainetos"
 
 #define CONFIG_MXC_UART_BASE   UART5_BASE
-#define CONFIG_CONSOLE_DEV "ttymxc4"
+#define CONSOLE_DEV"ttymxc4"
 
 #define CONFIG_FEC_XCV_TYPERMII
 
diff --git a/include/configs/aristainetos2.h b/include/configs/aristainetos2.h
index 152f5e9..8fa3eb5 100644
--- a/include/configs/aristainetos2.h
+++ b/include/configs/aristainetos2.h
@@ -19,7 +19,7 @@
 #define CONFIG_BOARD_LATE_INIT
 
 #define CONFIG_MXC_UART_BASE   UART2_BASE
-#define CONFIG_CONSOLE_DEV "ttymxc1"
+#define CONSOLE_DEV"ttymxc1"
 
 #define CONFIG_FEC_XCV_TYPERGMII
 #define CONFIG_PHY_MICREL_KSZ9031
diff --git a/include/configs/aristainetos2b.h b/include/configs/aristainetos2b.h
index 78791db..df9b5c9 100644
--- a/include/configs/aristainetos2b.h
+++ b/include/configs/aristainetos2b.h
@@ -19,7 +19,7 @@
 #define CONFIG_BOARD_LATE_INIT
 
 #define CONFIG_MXC_UART_BASE   UART2_BASE
-#define CONFIG_CONSOLE_DEV "ttymxc1"
+#define CONSOLE_DEV"ttymxc1"
 
 #define CONFIG_FEC_XCV_TYPERGMII
 #define CONFIG_PHY_MICREL_KSZ9031
diff --git a/include/configs/cgtqmx6eval.h b/include/configs/cgtqmx6eval.h
index 637bed2..6a25f2b 100644
--- a/include/configs/cgtqmx6eval.h
+++ b/include/configs/cgtqmx6eval.h
@@ -133,7 +133,7 @@
 /* Command definition */
 
 #define CONFIG_MXC_UART_BASE   UART2_BASE
-#define CONFIG_CONSOLE_DEV "ttymxc1"
+#define CONSOLE_DEV"ttymxc1"
 #define CONFIG_MMCROOT "/dev/mmcblk0p2"
 #define CONFIG_SYS_MMC_ENV_DEV 0
 
@@ -145,7 +145,7 @@
"fdt_addr_r=0x1800\0" \
"boot_fdt=try\0" \
"ip_dyn=yes\0" \
-   "console=" CONFIG_CONSOLE_DEV "\0" \
+   "console=" CONSOLE_DEV "\0" \
"dfuspi=dfu 0 sf 0:0:1000:0\0" \
"dfu_alt_info_spl=spl raw 0x400\0" \
"dfu_alt_info_img=u-boot raw 0x1\0" \
diff --git a/include/configs/el6x_common.h b/include/configs/el6x_common.h
index 81b79b2..7e9bcb1 100644
--- a/include/configs/el6x_common.h
+++ b/include/configs/el6x_common.h
@@ -73,7 +73,7 @@
"board="__stringify(CONFIG_BOARD_NAME)"\0"  
\
"cma_size="__stringify(EL6Q_CMA_SIZE)"\0"   
\
"chp_size="__stringify(EL6Q_COHERENT_POOL_SIZE)"\0" 
\
-   "console=" 

[U-Boot] [PATCH 03/28] Convert CONSOLE_PRE_CONSOLE_BUFFER options to Kconfig

2016-09-19 Thread Simon Glass
Move these option to Kconfig and tidy up existing uses.

Signed-off-by: Simon Glass 
---

 README| 17 -
 board/sunxi/Kconfig   | 11 +++
 common/Kconfig| 40 +++
 common/console.c  |  6 +++---
 configs/tbs2910_defconfig |  3 +++
 include/asm-generic/global_data.h |  2 +-
 include/configs/sunxi-common.h|  6 --
 include/configs/tbs2910.h |  4 
 scripts/config_whitelist.txt  |  3 ---
 9 files changed, 58 insertions(+), 34 deletions(-)

diff --git a/README b/README
index 1b6f8ec..26a53e2 100644
--- a/README
+++ b/README
@@ -872,23 +872,6 @@ The following options need to be configured:
must be defined, to setup the maximum idle timeout for
the SMC.
 
-- Pre-Console Buffer:
-   Prior to the console being initialised (i.e. serial UART
-   initialised etc) all console output is silently discarded.
-   Defining CONFIG_PRE_CONSOLE_BUFFER will cause U-Boot to
-   buffer any console messages prior to the console being
-   initialised to a buffer of size CONFIG_PRE_CON_BUF_SZ
-   bytes located at CONFIG_PRE_CON_BUF_ADDR. The buffer is
-   a circular buffer, so if more than CONFIG_PRE_CON_BUF_SZ
-   bytes are output before the console is initialised, the
-   earlier bytes are discarded.
-
-   Note that when printing the buffer a copy is made on the
-   stack so CONFIG_PRE_CON_BUF_SZ must fit on the stack.
-
-   'Sane' compilers will generate smaller code if
-   CONFIG_PRE_CON_BUF_SZ is a power of 2
-
 - Autoboot Command:
CONFIG_BOOTCOMMAND
Only needed when CONFIG_BOOTDELAY is enabled;
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 79f644a..9954f0a 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -1,5 +1,11 @@
 if ARCH_SUNXI
 
+config PRE_CONSOLE_BUFFER
+   default y
+
+config PRE_CON_BUF_SZ
+   default 4096
+
 config SPL_GPIO_SUPPORT
default y
 
@@ -21,6 +27,7 @@ config SPL_POWER_SUPPORT
 config SPL_SERIAL_SUPPORT
default y
 
+config PRE_CONSOLE_BUFFER
 # Note only one of these may be selected at a time! But hidden choices are
 # not supported by Kconfig
 config SUNXI_GEN_SUN4I
@@ -121,6 +128,10 @@ config MACH_SUN50I
 
 endchoice
 
+config PRE_CON_BUF_ADDR
+   default 0x2f00 if MACH_SUN9I
+   default 0x4f00 if !MACH_SUN9I
+
 # The sun8i SoCs share a lot, this helps to avoid a lot of "if A23 || A33"
 config MACH_SUN8I
bool
diff --git a/common/Kconfig b/common/Kconfig
index 20f34bb..3ecb589 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -241,6 +241,46 @@ config SILENT_CONSOLE_UPDATE_ON_RELOC
  (e.g. NAND). This option makes the value of the 'silent'
  environment variable take effect at relocation.
 
+config PRE_CONSOLE_BUFFER
+   bool "Buffer characters before the console is available"
+   help
+ Prior to the console being initialised (i.e. serial UART
+ initialised etc) all console output is silently discarded.
+ Defining CONFIG_PRE_CONSOLE_BUFFER will cause U-Boot to
+ buffer any console messages prior to the console being
+ initialised to a buffer. The buffer is a circular buffer, so
+ if it overflows, earlier output is discarded.
+
+ Note that this is not currently supported in SPL. It would be
+ useful to be able to share the pre-console buffer with SPL.
+
+config PRE_CON_BUF_SZ
+   hex "Sets the size of the pre-console buffer"
+   depends on PRE_CONSOLE_BUFFER
+   default 1024 if PRE_CONSOLE_BUFFER
+   help
+ The size of the pre-console buffer affects how much console output
+ can be held before it overflows and starts discarding earlier
+ output. Normally there is very little output at this early stage,
+ unless debugging is enabled, so allow enough for ~10 lines of
+ text.
+
+ This is a useful feature if you are using a video console and
+ want to see the full boot output on the console. Without this
+ option only the post-relocation output will be displayed.
+
+config PRE_CON_BUF_ADDR
+   hex "Address of the pre-console buffer"
+   depends on PRE_CONSOLE_BUFFER
+   help
+ This sets the start address of the pre-console buffer. This must
+ be in available memory and is accessed before relocation and
+ possibly before DRAM is set up. Therefore choose an address
+ carefully.
+
+ We should consider removing this option and allocating the memory
+ in board_init_f_init_reserve() instead.
+
 endmenu
 
 config SYS_NO_FLASH
diff --git a/common/console.c b/common/console.c
index 12293f3..31a9b3e 100644
--- 

[U-Boot] [PATCH 00/28] Kconfig: Move console options to Kconfig

2016-09-19 Thread Simon Glass
This series moves a number of console-related CONFIG options to Kconfig.
Those that are not currently used are removed.

A few unused video drivers are also removed and there are a few minor
adjustments to improve the code. But mostly this follows the output of
the moveconfig tool.

It is tested with buildman -K to make sure no CONFIGs change overall, and
also for building.

Here's the full config delta. Most of the changes involve options being
added to SPL which were previous not. With Kconfig we use
CONFIG_IS_ENABLED() with separate options for SPL, instead of #undef in
header files.

$ buildman -b video --step 0 -sK
boards.cfg is up to date. Nothing to do.
Summary of 2 commits for 1197 boards (32 threads, 1 job per thread)
01: buildman: Drop the 'alive' flag in BuilderThread
  blackfin:  +   cm-bf527 bf609-ezkit bf537-stamp
 sparc:  +   grsim grsim_leon2 gr_cpci_ax2000 gr_xc3s_1500 gr_ep2s60
 nios2:  +   10m50 3c120
microblaze:  +   microblaze-generic
  openrisc:  +   openrisc-generic
29: Convert CONFIG_SYS_STDIO_DEREGISTER to Kconfig
powerpc:
   + u-boot.cfg: CONFIG_CONSOLE_SCROLL_LINES=1 
CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1 CONFIG_SYS_CONSOLE_BG_COL=0x00 
CONFIG_SYS_CONSOLE_FG_COL=0xa0
   - u-boot.cfg: CONFIG_CONSOLE=ttyS0 CONFIG_CONSOLE_DEV="ttyPSC1" 
CONFIG_VIDEO_SW_CURSOR=1
   + u-boot-spl.cfg: CONFIG_CONSOLE_SCROLL_LINES=1 
CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1 CONFIG_SYS_CONSOLE_BG_COL=0x00 
CONFIG_SYS_CONSOLE_FG_COL=0xa0 CONFIG_SYS_CONSOLE_IS_IN_ENV=1
   - u-boot-spl.cfg: CONFIG_VIDEO_SW_CURSOR=1
   + all: CONFIG_CONSOLE_SCROLL_LINES=1 CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1 
CONFIG_SYS_CONSOLE_BG_COL=0x00 CONFIG_SYS_CONSOLE_FG_COL=0xa0 
CONFIG_SYS_CONSOLE_IS_IN_ENV=1
   - all: CONFIG_CONSOLE=ttyS0 CONFIG_CONSOLE_DEV="ttyPSC1" 
CONFIG_VIDEO_SW_CURSOR=1
arm:
   + u-boot.cfg: CONFIG_CONSOLE_SCROLL_LINES=1 
CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1 CONFIG_SYS_CONSOLE_BG_COL=0x00 
CONFIG_SYS_CONSOLE_FG_COL=0xa0
   - u-boot.cfg: CONFIG_CONSOLE_DEV="ttymxc1" CONFIG_CONSOLE_INFO_QUIET=1 
CONFIG_CONSOLE_SCROLL_LINES=10 CONFIG_SYS_WHITE_ON_BLACK=1 
CONFIG_VIDEO_SW_CURSOR=1
   + u-boot-spl.cfg: CONFIG_CFB_CONSOLE=1 CONFIG_CONSOLE_MUX=1 
CONFIG_CONSOLE_SCROLL_LINES=1 CONFIG_PRE_CONSOLE_BUFFER=1 
CONFIG_PRE_CON_BUF_SZ=0x4096 CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1 
CONFIG_SYS_CONSOLE_BG_COL=0x00 CONFIG_SYS_CONSOLE_FG_COL=0xa0 
CONFIG_SYS_CONSOLE_IS_IN_ENV=1 CONFIG_SYS_STDIO_DEREGISTER=1 
CONFIG_VGA_AS_SINGLE_DEVICE=1 CONFIG_VIDEO=1
   - u-boot-spl.cfg: CONFIG_CONSOLE_DEV="ttymxc0" CONFIG_CONSOLE_INFO_QUIET=1 
CONFIG_CONSOLE_SCROLL_LINES=10 CONFIG_SYS_WHITE_ON_BLACK=1 
CONFIG_VIDEO_SW_CURSOR=1
   + all: CONFIG_CFB_CONSOLE=1 CONFIG_CONSOLE_MUX=1 
CONFIG_CONSOLE_SCROLL_LINES=1 CONFIG_PRE_CONSOLE_BUFFER=1 
CONFIG_PRE_CON_BUF_SZ=0x4096 CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1 
CONFIG_SYS_CONSOLE_BG_COL=0x00 CONFIG_SYS_CONSOLE_FG_COL=0xa0 
CONFIG_SYS_CONSOLE_IS_IN_ENV=1 CONFIG_SYS_STDIO_DEREGISTER=1 
CONFIG_VGA_AS_SINGLE_DEVICE=1 CONFIG_VIDEO=1
   - all: CONFIG_CONSOLE_DEV="ttymxc0" CONFIG_CONSOLE_INFO_QUIET=1 
CONFIG_CONSOLE_SCROLL_LINES=10 CONFIG_SYS_WHITE_ON_BLACK=1 
CONFIG_VIDEO_SW_CURSOR=1
blackfin:
   + u-boot.cfg: CONFIG_SILENT_CONSOLE=1 CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1
   + all: CONFIG_SILENT_CONSOLE=1 CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1
aarch64:
   + u-boot.cfg: CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1
   - u-boot.cfg: CONFIG_CONSOLE_SCROLL_LINES=10
   + all: CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1
   - all: CONFIG_CONSOLE_SCROLL_LINES=10
x86:
   + u-boot.cfg: CONFIG_SYS_CONSOLE_BG_COL=0x00 CONFIG_SYS_CONSOLE_FG_COL=0xa0
   - u-boot.cfg: CONFIG_CONSOLE_SCROLL_LINES=5 CONFIG_VGA_AS_SINGLE_DEVICE=1 
CONFIG_VIDEO=1 CONFIG_VIDEO_SW_CURSOR=1
   + all: CONFIG_SYS_CONSOLE_BG_COL=0x00 CONFIG_SYS_CONSOLE_FG_COL=0xa0
   - all: CONFIG_CONSOLE_SCROLL_LINES=5 CONFIG_VGA_AS_SINGLE_DEVICE=1 
CONFIG_VIDEO=1 CONFIG_VIDEO_SW_CURSOR=1
sandbox:
   + u-boot.cfg: CONFIG_CONSOLE_SCROLL_LINES=1 
CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1
   + u-boot-spl.cfg: CONFIG_CONSOLE_SCROLL_LINES=1 
CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1
   + all: CONFIG_CONSOLE_SCROLL_LINES=1 CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=1
B4420QDS_NAND B4860QDS_NAND :
   + u-boot-spl.cfg: CONFIG_SYS_CONSOLE_IS_IN_ENV=1
   + all: CONFIG_SYS_CONSOLE_IS_IN_ENV=1
at91sam9m10g45ek_mmc at91sam9m10g45ek_nandflash at91sam9n12ek_nandflash 
at91sam9n12ek_spiflash at91sam9x5ek_nandflash at91sam9x5ek_spiflash brppt1_mmc 
brppt1_nand brppt1_spi brxre1 cm_t35 picosam9g45 pxm2 rut sama5d3xek_mmc 
sama5d3xek_nandflash sama5d3xek_spiflash sama5d4ek_mmc sama5d4ek_nandflash 
sama5d4ek_spiflash :
   + u-boot.cfg: CONFIG_CONSOLE_SCROLL_LINES=1
   + u-boot-spl.cfg: CONFIG_CONSOLE_SCROLL_LINES=1
   + all: CONFIG_CONSOLE_SCROLL_LINES=1
T1024RDB T1024RDB_SECURE_BOOT T1040D4RDB T1040D4RDB_SECURE_BOOT T1040RDB 
T1040RDB_SECURE_BOOT T1042RDB T1042RDB_SECURE_BOOT a4m072 bct-brettl2 
bf518f-ezbrd bf526-ezbrd bf527-ad7160-eval bf527-ezkit bf527-ezkit-v2 bf527-sdp 
bf533-ezkit bf533-stamp 

Re: [U-Boot] [PATCH] test/py/tests/test_vboot.py: Add check that we boot the image

2016-09-19 Thread Stephen Warren

On 09/18/2016 07:46 AM, Tom Rini wrote:

Make sure that when we're telling bootm to boot an image, and we expect
the image to boot we get the output from sandbox that we attempted to
run Linux and that U-Boot completed its job.


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


Re: [U-Boot] [PATCH 00/27] spl: Use linker list and parameters for SPL image loading

2016-09-19 Thread Tom Rini
On Sun, Sep 18, 2016 at 06:57:01PM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On 18 September 2016 at 16:14, Tom Rini  wrote:
> > On Sun, Sep 18, 2016 at 01:44:49PM -0600, Simon Glass wrote:
> >
> >> At present the SPL code uses a global spl_image variable which is shared
> >> amongst lots of files, some in common/spl and some elsewhere. There is no
> >> need for this to be global, and in fact a parameter makes it easier to
> >> understand what information the functions act on. It also reduces the BSS
> >> use in the SPL (at the expense of stack) which is useful on boards which
> >> don't have BSS available early on.
> >
> > Thanks for taking a stab at cleaning this up.
> 
> I ran into it with the 64-bit x86 stuff and decided to take a detour :-)
> 
> >
> > [snip]
> >> There is a priorty value attached to each loader which should allow the
> >> existing ordering to be maintained.
> >
> > I worry here about some of the corner cases, but it's probably no more
> > or less fragile than currently at least.  I'm actually not sure how
> > that's working in this version of the series, everyone gets priority 0
> > filled in so it seems like we're on linker order.  But I'm also not
> > convinced that it's a problem here.  As far as I can recall, the use
> > cases are that a given binary will support say NAND and MMC, and at run
> > time knows that it came from NAND or MMC, and thus we need to look at
> > the same device for U-Boot itself.  So order doesn't matter there.  So
> > we can just drop that part I think.
> 
> I see in the code that if Ubifs is enabled, it uses that instead of
> NAND and ONENAND. There is another case too - SPI might have a
> board-specific loader which takes precedence (although I suspect in
> the sunxi case the generic loader is not present).
> 
> If these are not needed then we can drop it.
> 
> At present priority is handled by adding the priority value into the
> linker list element name. Since they are sorted in order within the
> image, this gives the required result.

Looking over the code, UBI is setup as mutually exclusive.  It also
looks like that SPL_SPI_BOOT, SPL_SPI_SUNXI and SPL_SPI_LOAD are all
exclusive as well.  So we should clean that up so that we select the
right back end if SPL_SPI is set, and we can drop the order part.

> >> Code size is about 20 bytes larger on average which I think is acceptable.
> >> The BSS size drops by about 64 bytes, but really this just transfers to
> >> the stack.
> >
> > How about the worst case growths in what we have today?
> 
> Ah well that's something buildman cannot tell me! There is a small
> overhead for the lookup code (about 20-30 bytes) and 8-12 bytes for
> each loader method. Here's the buildman summary.
> 
> $ buildman -b spl -s --step 0 -S
> boards.cfg is up to date. Nothing to do.
> Summary of 2 commits for 1196 boards (32 threads, 1 job per thread)
> 01: Makefile: Give a build error if ad-hoc CONFIG options are added
>   blackfin:  +   cm-bf527 bf609-ezkit bf537-stamp
>  sparc:  +   grsim grsim_leon2 gr_cpci_ax2000 gr_xc3s_1500 gr_ep2s60
>  nios2:  +   10m50 3c120
> microblaze:  +   microblaze-generic
>   openrisc:  +   openrisc-generic
> 28: spl: Make spl_boot_list a local variable
>aarch64: (for 51/51 boards)  spl/u-boot-spl:all +36.8
> spl/u-boot-spl:bss -6.3  spl/u-boot-spl:data +5.6
> spl/u-boot-spl:rodata +7.5  spl/u-boot-spl:text +29.9
>powerpc: (for 415/415 boards)  spl/u-boot-spl:all -24.7
> spl/u-boot-spl:bss -0.1  spl/u-boot-spl:data -0.1
> spl/u-boot-spl:rodata -15.9  spl/u-boot-spl:text -8.6
>sandbox: (for 3/3 boards)  spl/u-boot-spl:all +37.3
> spl/u-boot-spl:bss -10.7  spl/u-boot-spl:rodata +10.7
> spl/u-boot-spl:text +37.3
>arm: (for 552/552 boards)  all -0.8  bss -0.8  data -0.1
> spl/u-boot-spl:all -66.3  spl/u-boot-spl:bss -22.3
> spl/u-boot-spl:data -5.1  spl/u-boot-spl:rodata +0.5
> spl/u-boot-spl:text -39.3

You should have a bit more output :)  Adding in -d will list every board
and then what I do (since I do -SCdvel and -Ssdel after to log it) is
read over the list and manually look at the deviations.

> >> There is an obvious follow-on from this, to move boot_name_table[] into the
> >> same linker list struct (i.e. add a name field to struct spl_image_loader).
> >> The complication here is that we don't want naming if
> >> CONFIG_SPL_LIBCOMMON_SUPPORT is not enabled, since it bloats the code. In
> >> addition I think that common/spl/spl.c can be tidied up a little.
> >
> > Yeah, I worry about size growth in doing that too.  But maybe we can be
> > a little clever when declaring the ll and just not have the strings if
> > !LIBCOMMON ?
> 
> Yes I think so...perhaps someone else might take a look, or I'll wait
> for a rainy day!

Sounds good enough for now, thanks.

-- 
Tom


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


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-09-19 Thread Hans de Goede

HI,

On 19-09-16 15:17, Maxime Ripard wrote:

On Wed, Sep 14, 2016 at 12:05:19PM +0200, Hans de Goede wrote:

Hi,

On 13-09-16 13:50, Maxime Ripard wrote:

Hi,

On Mon, Sep 12, 2016 at 04:47:49PM +0200, Hans de Goede wrote:

On 12-09-16 15:56, Maxime Ripard wrote:

Hi,

On Mon, Sep 12, 2016 at 01:53:24PM +0200, Ciprian Manea wrote:

I'm using a SinA33 dev board (Allwinner a33 SoC) and at the moment
I'm trying to boot from the eMMC.

But it fails in the following way:


*Got the following error at boot time:*
*U-Boot SPL 2016.09-rc2-00125-g6e8b42f (Sep 08 2016 - 11:00:46) DRAM: 1024
MiB Trying to boot from MMC2 MMC Device 1 not found spl: could not find mmc
device. error: -19 SPL: failed to boot from all boot devices ### ERROR ###
Please RESET the board ###*


So I've been on the same issue for the last couple of days.

Since that board is already supported, adding support for the eMMC
basically came down to that patch on top of 2016.09-rc2.

http://code.bulix.org/kcgxri-106037?raw

(Quite hackish, the 8-Bits part being a separate issue that would need
to be addressed somehow).

However, it doesn't work, neither when flashing u-boot on the eMMC
itself (where there's a timeout error in the SPL) nor when trying to
access the eMMC from a U-Boot loaded from the (external) SD.

In the latter case, even mmc dev 1 fails silently.

I traced that down to the mmc_switch here:
http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530

Which fails with ETIMEDOUT, and more specifically, it's the call to
mmc_rint_wait here
http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/sunxi_mmc.c#l383
that times out.

Increasing the timeout value (to 1) doesn't really change
anything. I guess this is also the reason why we had a timeout error
in the SPL.

This eMMC works fine in Linux, with the same muxing (and I guess the
earlier commands wouldn't be successful if the muxing or power was not
set up appropriately). So I'm kind of running out of ideas on what
could be the root cause of this.

Hans, any ideas?


Maybe the emmc needs external pull-ups ? I don't remember if u-boot
always enables those or not ...


So I pushed this a bit more, and it seems like commenting the call to
mmc_change_freq makes everything just work.

Reading the JEDEC spec, it looks like when you switch to high speed,
you also need to change the controller clock rate, that u-boot doesn't
seem to do at the moment, which obviously will fail, since the
controller will be stuck at the former rate, while the eMMC would be
switched.

If I comment mmc_change_freq, everything works.


Hmm, I'm pretty sure the u-boot sunxi mmc code
does properly change the clock, see mmc_set_mod_clk() in
drivers/mmc/sunxi_mmc.c

This will switch to the right PLL, etc. So there likely is
something else going on making things not work at higher
speeds.


Yep, I noticed that. However, what confuses me more is that the
command seems to be sent here:
http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/mmc.c#l530

And set_ios is being called after we check that everything
works. Linux for example calls set_ios right after switching
http://lxr.free-electrons.com/source/drivers/mmc/core/mmc.c#L965


Maybe we need a higher driver strenghts at the mmc io pins, or maybe
we've a completely unrelated issue ?


I've tested that already. It doesn't change the outcome.


I'm pretty sure that the eMMC's on A20 devices work fine in 50MHZ
(SDR) mode.


What emmc was that? Did it support HS? Was it considered an SD (and
went through sd_change_freq), or an MMC?


Here is what "mmc info" in u-boot says on my UTOO P66 tablet (A13)
with 4G eMMC (manually transcribed, no serial console):

Device: SUNXI SD/MMC
Manufacturer ID: 70
OEM: 100
Name: MMC04
Tran Speed: 5200
Rd Block Len: 512
MMC version 4.4.1
High Capacity: Yes
Bus-width: 4-bit


And here is /sys/kernel/debug/mmc1/ios under linux:

clock:  5200 Hz
vdd:21 (3.3 ~ 3.4 V)
bus mode:   2 (push-pull)
chip select:0 (don't care)
power mode: 2 (on)
bus width:  3 (8 bits)
timing spec:1 (mmc high-speed)
signal voltage: 0 (3.30 V)
driver type:0 (driver type B)

HTH,

Regards,

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


Re: [U-Boot] [PATCH] Repair image-fit: switch ENOLINK to ENOENT

2016-09-19 Thread Marek Vasut
On 09/19/2016 10:29 AM, Paul Burton wrote:
> Hi Marek,

Hi,

> On 18/09/16 14:27, Marek Vasut wrote:
>> This patch broke booting of any fitImage-wrapped kernel images due
>> to replacement of ENOLINK with ENOENT without checking where the
>> ENOLINK return value is being tested for. Adjust the tests as well
>> to repair the breakage.
> 
> It's not obvious from the commit message what "this patch" refers to - I
> think it would be useful to include the hash & subject of the broken
> commit, eg:
> 
>   Commit bac17b78dace ("image-fit: switch ENOLINK to ENOENT") broke...
> 
> The (potential?) problem with the approach you took in this patch is
> that the return value from fit_get_node_from_config no longer
> differentiates between the ramdisk property of a FIT config being
> missing (-ENOLINK prior to bac17b78dace) & the configuration itself
> being missing (-ENOENT). Could that possibly lead to accepting invalid
> FIT images? If not then I imagine it's by some convoluted chance & that
> we'd probably be best to not rely on it.

Crap, that's a very valid point.

> If using ENOLINK isn't an option then my suggestion would be that we
> change the config not found case to return -EINVAL & the property not
> found can keep returning -ENOENT. Semantically that would seem to make
> sense but it would mean checking all the callers, direct or indirect, of
> fit_get_node_from_config to see whether they rely upon -ENOENT for the
> config not found case.

Can you roll a patch for that ?

Thanks!

> Thanks,
> Paul
> 
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Jonathan Gray 
>> Cc: Paul Burton 
>> Cc: Tom Rini 
>> ---
>>  common/image-fdt.c | 2 +-
>>  common/image.c | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/common/image-fdt.c b/common/image-fdt.c
>> index d6ee225..3d23608 100644
>> --- a/common/image-fdt.c
>> +++ b/common/image-fdt.c
>> @@ -285,7 +285,7 @@ int boot_get_fdt(int flag, int argc, char * const 
>> argv[], uint8_t arch,
>>  fdt_noffset = fit_get_node_from_config(images,
>> FIT_FDT_PROP,
>> fdt_addr);
>> -if (fdt_noffset == -ENOLINK)
>> +if (fdt_noffset == -ENOENT)
>>  return 0;
>>  else if (fdt_noffset < 0)
>>  return 1;
>> diff --git a/common/image.c b/common/image.c
>> index 7ad04ca..c8d9bc8 100644
>> --- a/common/image.c
>> +++ b/common/image.c
>> @@ -1078,7 +1078,7 @@ int boot_get_ramdisk(int argc, char * const argv[], 
>> bootm_headers_t *images,
>>  rd_addr = map_to_sysmem(images->fit_hdr_os);
>>  rd_noffset = fit_get_node_from_config(images,
>>  FIT_RAMDISK_PROP, rd_addr);
>> -if (rd_noffset == -ENOLINK)
>> +if (rd_noffset == -ENOENT)
>>  return 0;
>>  else if (rd_noffset < 0)
>>  return 1;
>>


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


Re: [U-Boot] [PATCH 1/9] ddr: altera: Configuring SDRAM extra cycles timing parameters

2016-09-19 Thread Marek Vasut
On 09/19/2016 08:54 PM, Marek Vasut wrote:
> On 09/19/2016 12:11 PM, Chin Liang See wrote:
>> On Mon, 2016-09-19 at 16:22 +0200, Marek Vasut wrote:
>>> On 09/15/2016 09:26 AM, Chin Liang See wrote:
 To enable configuration of sdr.ctrlcfg.extratime1 register which
 enable
 extra clocks for read to write command timing. This is critical to
 ensure successful LPDDR2 interface

 Signed-off-by: Chin Liang See 
 ---
  arch/arm/mach-socfpga/include/mach/sdram.h | 8 +++-
  arch/arm/mach-socfpga/qts-filter.sh| 2 +-
  arch/arm/mach-socfpga/wrap_sdram_config.c  | 9 +
  drivers/ddr/altera/sdram.c | 3 +++
  4 files changed, 20 insertions(+), 2 deletions(-)

 diff --git a/arch/arm/mach-socfpga/include/mach/sdram.h
 b/arch/arm/mach-socfpga/include/mach/sdram.h
 index f12bb84..b11228f 100644
 --- a/arch/arm/mach-socfpga/include/mach/sdram.h
 +++ b/arch/arm/mach-socfpga/include/mach/sdram.h
 @@ -30,7 +30,8 @@ struct socfpga_sdr_ctrl {
u32 dram_timing4;   /* 0x10 */
u32 lowpwr_timing;
u32 dram_odt;
 -  u32 __padding0[4];
 +  u32 extratime1;
 +  u32 __padding0[3];
u32 dram_addrw; /* 0x2c */
u32 dram_if_width;  /* 0x30 */
u32 dram_dev_width;
 @@ -88,6 +89,7 @@ struct socfpga_sdram_config {
u32 dram_timing4;
u32 lowpwr_timing;
u32 dram_odt;
 +  u32 extratime1;
u32 dram_addrw;
u32 dram_if_width;
u32 dram_dev_width;
>>>
>>> This seems to be changing the DRAM register layout, is this really
>>> correct and was this really tested on AV SoCDK ?
>>
>> Previously its treated unused register as default value is good enough.
>> But this not true anymore for LPDDR2 and we are exposing extratime1
>> register.
> 
> I mean the later one , which adds an entry and moves the other registers
> by 4 bytes.
> 
>> While for testing, I tested both CV and AV SoCDK few times as I also
>> worried even they are using DDR3 instead LPDDR2.
> 
> Yes, they do, it's in the documentation ;-)
> 
>>>
>>> [...]
>>>
 diff --git a/arch/arm/mach-socfpga/wrap_sdram_config.c
 b/arch/arm/mach-socfpga/wrap_sdram_config.c
 index 31cc7de..d72f5e1 100644
 --- a/arch/arm/mach-socfpga/wrap_sdram_config.c
 +++ b/arch/arm/mach-socfpga/wrap_sdram_config.c
 @@ -81,6 +81,15 @@ static const struct socfpga_sdram_config
 sdram_config = {
SDR_CTRLGRP_DRAMODT_READ_LSB)   
|
(CONFIG_HPS_SDR_CTRLCFG_DRAMODT_WRITE <<
SDR_CTRLGRP_DRAMODT_WRITE_LSB),
 +#ifdef
 CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR
>>>
>>> How come this is not always defined for all boards ?
>>
>> This is to ensure it still works if users are using older SOCEDS
>> instead of SOCEDS 16.1. Besides that, this is only applicable for
>> LPDDR2. With that, patches #2 to #9 are not needed.

We don't support old crap :)

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


Re: [U-Boot] [PATCH 1/9] ddr: altera: Configuring SDRAM extra cycles timing parameters

2016-09-19 Thread Marek Vasut
On 09/19/2016 12:11 PM, Chin Liang See wrote:
> On Mon, 2016-09-19 at 16:22 +0200, Marek Vasut wrote:
>> On 09/15/2016 09:26 AM, Chin Liang See wrote:
>>> To enable configuration of sdr.ctrlcfg.extratime1 register which
>>> enable
>>> extra clocks for read to write command timing. This is critical to
>>> ensure successful LPDDR2 interface
>>>
>>> Signed-off-by: Chin Liang See 
>>> ---
>>>  arch/arm/mach-socfpga/include/mach/sdram.h | 8 +++-
>>>  arch/arm/mach-socfpga/qts-filter.sh| 2 +-
>>>  arch/arm/mach-socfpga/wrap_sdram_config.c  | 9 +
>>>  drivers/ddr/altera/sdram.c | 3 +++
>>>  4 files changed, 20 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-socfpga/include/mach/sdram.h
>>> b/arch/arm/mach-socfpga/include/mach/sdram.h
>>> index f12bb84..b11228f 100644
>>> --- a/arch/arm/mach-socfpga/include/mach/sdram.h
>>> +++ b/arch/arm/mach-socfpga/include/mach/sdram.h
>>> @@ -30,7 +30,8 @@ struct socfpga_sdr_ctrl {
>>> u32 dram_timing4;   /* 0x10 */
>>> u32 lowpwr_timing;
>>> u32 dram_odt;
>>> -   u32 __padding0[4];
>>> +   u32 extratime1;
>>> +   u32 __padding0[3];
>>> u32 dram_addrw; /* 0x2c */
>>> u32 dram_if_width;  /* 0x30 */
>>> u32 dram_dev_width;
>>> @@ -88,6 +89,7 @@ struct socfpga_sdram_config {
>>> u32 dram_timing4;
>>> u32 lowpwr_timing;
>>> u32 dram_odt;
>>> +   u32 extratime1;
>>> u32 dram_addrw;
>>> u32 dram_if_width;
>>> u32 dram_dev_width;
>>
>> This seems to be changing the DRAM register layout, is this really
>> correct and was this really tested on AV SoCDK ?
> 
> Previously its treated unused register as default value is good enough.
> But this not true anymore for LPDDR2 and we are exposing extratime1
> register.

I mean the later one , which adds an entry and moves the other registers
by 4 bytes.

> While for testing, I tested both CV and AV SoCDK few times as I also
> worried even they are using DDR3 instead LPDDR2.

Yes, they do, it's in the documentation ;-)

>>
>> [...]
>>
>>> diff --git a/arch/arm/mach-socfpga/wrap_sdram_config.c
>>> b/arch/arm/mach-socfpga/wrap_sdram_config.c
>>> index 31cc7de..d72f5e1 100644
>>> --- a/arch/arm/mach-socfpga/wrap_sdram_config.c
>>> +++ b/arch/arm/mach-socfpga/wrap_sdram_config.c
>>> @@ -81,6 +81,15 @@ static const struct socfpga_sdram_config
>>> sdram_config = {
>>> SDR_CTRLGRP_DRAMODT_READ_LSB)   
>>> |
>>> (CONFIG_HPS_SDR_CTRLCFG_DRAMODT_WRITE <<
>>> SDR_CTRLGRP_DRAMODT_WRITE_LSB),
>>> +#ifdef
>>> CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR
>>
>> How come this is not always defined for all boards ?
> 
> This is to ensure it still works if users are using older SOCEDS
> instead of SOCEDS 16.1. Besides that, this is only applicable for
> LPDDR2. With that, patches #2 to #9 are not needed.
> 
> Thanks
> Chin Liang
> 
>>
>>> +   .extratime1 =
>>> +   (CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO
>>> _WR <<
>>> +   SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_LSB)
>>> |
>>> +   (CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO
>>> _WR_BC <<
>>> +   SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_BC_LSB) 
>>> |
>>> +(CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF
>>> _CHIP <<
>>> +   SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_DIFF_LSB),
>>> +#endif
>>> .dram_addrw =
>>> (CONFIG_HPS_SDR_CTRLCFG_DRAMADDRW_COLBITS <<
>>> SDR_CTRLGRP_DRAMADDRW_COLBITS_LSB)  
>>> |
>>> diff --git a/drivers/ddr/altera/sdram.c
>>> b/drivers/ddr/altera/sdram.c
>>> index 7e4606d..e74c5b0 100644
>>> --- a/drivers/ddr/altera/sdram.c
>>> +++ b/drivers/ddr/altera/sdram.c
>>> @@ -418,6 +418,9 @@ static void sdr_load_regs(const struct
>>> socfpga_sdram_config *cfg)
>>>  
>>> debug("Configuring DRAMODT\n");
>>> writel(cfg->dram_odt, _ctrl->dram_odt);
>>> +
>>> +   debug("Configuring EXTRATIME1\n");
>>> +   writel(cfg->extratime1, _ctrl->extratime1);
>>>  }
>>>  
>>>  /**
>>>
>>
>>


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


Re: [U-Boot] [PATCH 2/9] arm: socfpga: Adding handoff for SDRAM ctrlcfg.extratime1

2016-09-19 Thread Marek Vasut
On 09/19/2016 12:12 PM, Chin Liang See wrote:
> On Mon, 2016-09-19 at 16:24 +0200, Marek Vasut wrote:
>> On 09/15/2016 09:27 AM, Chin Liang See wrote:
>>> Adding new handoff for SDRAM ctrcfg.extratime1 which is
>>> required for stabil LPDDR2 operation
>>
>> ... stable ...
>>
>> Isn't SoCDK using DDR3 DRAM ?
> 
> Yah, you are right where we won't need this patch and others except #1
> one. Should I send v2 which only have first patch?

Then should this register be set to zero on SoCDK ?


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


Re: [U-Boot] [PATCH v2] Revert "Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL"

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 09:40:26PM +0900, Masahiro Yamada wrote:

> This reverts commit 90c08d9e08c7a108ab904f3bbdeb558081757892.
> 
> I took a closer look at this after the commit was applied, and found
> CONFIG_SYS_MALLOC_F_LEN=0x2000 was too much.  8KB memory for SPL is
> actually too big for some boards.  Perhaps 0x800 is enough, but the
> situation varies board by board.
> 
> Let's postpone our decision until we come up with a better idea.
> 
> Signed-off-by: Masahiro Yamada 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] ARM: uniphier: move CONFIG_SPL_* to defconfig or select

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 09:26:38PM +0900, Masahiro Yamada wrote:

> As I repeated in the ML, I am unhappy with config entries with bare
> defaults.  Kick them out of arch/arm/mach-uniphier/Kconfig.
> 
> Currently, CONFIG_SPL_SERIAL_SUPPORT is not user-configurable
> (build fails without it), but it should be fixed later anyway,
> so I am moving CONFIG_SPL_SERIAL_SUPPORT to defconfigs.
> 
> Signed-off-by: Masahiro Yamada 

Yes, this is the kind of clean-up that needs to be done after moving
them over, sadly.  Thanks!

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH 10/13] buildman: Allow builds to terminate cleanly

2016-09-19 Thread Tom Rini
On Sun, Sep 18, 2016 at 04:48:35PM -0600, Simon Glass wrote:

> It is annoying that buildman does not respond cleanly to Ctrl-C or SIGINT,
> particularly on machines with lots of CPUS. Unfortunately queue.join()
> blocks the main thread and does not allow it to see the signal. Use a
> separate thread instead,
> 
> Signed-off-by: Simon Glass 

Yay for fixing this, killing off the running make's when I have a bad
test build going is one of the minor pitas in my workflow :)

-- 
Tom


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


Re: [U-Boot] [PATCH 06/13] buildman: Tidy up the 'cloning' message

2016-09-19 Thread Tom Rini
On Sun, Sep 18, 2016 at 04:48:31PM -0600, Simon Glass wrote:

> On a machine with a lot of CPUs this prints a lot of useless lines of the
> form:
> 
>Cloning repo for thread 
> 
> Adjust the output so that these all appear on one line, and disappear when
> the cloning is complete.
> 
> Note: This cloning is actually unnecessary and very wasteful on disk space
> (about 3.5GB each time). It would be better to create symlinks.

When do we actually need to clone?  Or why, even?

-- 
Tom


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


[U-Boot] [PATCH 2/2] Makefile: rm u-boot.cfg dependencies are missing

2016-09-19 Thread Stephen Warren
From: Stephen Warren 

Prior to the previous patch, a freshly created .u-boot.cfg.cmd may not
correctly represent all dependencies for u-boot.cfg. The previous change
only solved this issue for fresh builds; when performing an incremental
build, the deficient .u-boot.cfg.cmd is already present, so u-boot.cfg
is not rebuilt, and hence .u-boot.cfg.cmd is not rebuilt with the correct
content.

Solve this by explicitly detecting when the dependency file .u-boot.cfg.d
has not been integrated into .u-boot.cfg.cmd, and force u-boot.cfg to be
rebuilt in this case by deleting it first. This is possible since
if_changed_dep will always delete .u-boot.cfg.d when it executes
successfully, so its presence means either that the previous build was
made by a source tree that contained a Makefile that didn't include the
previous patch, or that the build failed part way through executing
if_changed_dep for u-boot.cfg. Forcing a rebuild of u-boot.cfg is required
in the former case, and will cause no additional work in the latter case,
since the file would be rebuilt anyway for the same reason it was being
rebuilt by the previous build.

Signed-off-by: Stephen Warren 
---
 Makefile | 11 +++
 scripts/Makefile.spl | 11 +++
 2 files changed, 22 insertions(+)

diff --git a/Makefile b/Makefile
index 949b264b8fee..c30f90af8cff 100644
--- a/Makefile
+++ b/Makefile
@@ -936,6 +936,17 @@ u-boot.sha1:   u-boot.bin
 u-boot.dis:u-boot
$(OBJDUMP) -d $< > $@
 
+# If .u-boot.cfg.d is still present, then either:
+# a) The previous build used a Makefile that used if_changed rather than
+#if_changed_dep when building u-boot.cfg, and hence any later builds will
+#be unaware of the dependencies for u-boot.cfg. In this case, we must
+#delete u-boot.cfg to force it and .u-boot.cfg.cmd to be rebuilt the
+#correct way.
+# b) The previous build failed or was interrupted while building u-boot.cfg,
+#so deleting u-boot.cfg isn't going to cause any additional work.
+ifneq ($(wildcard $(obj)/.u-boot.cfg.d),)
+  unused := $(shell rm -f $(obj)/u-boot.cfg)
+endif
 u-boot.cfg:include/config.h FORCE
$(call if_changed_dep,cpp_cfg)
 
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index d0d73d3b0a4c..5a7f79c25a76 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -216,6 +216,17 @@ quiet_cmd_cpp_cfg = CFG $@
 cmd_cpp_cfg = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
-DDO_DEPS_ONLY -D__ASSEMBLY__ -x assembler-with-cpp -P -dM -E -o $@ $<
 
+# If .u-boot.cfg.d is still present, then either:
+# a) The previous build used a Makefile that used if_changed rather than
+#if_changed_dep when building u-boot.cfg, and hence any later builds will
+#be unaware of the dependencies for u-boot.cfg. In this case, we must
+#delete u-boot.cfg to force it and .u-boot.cfg.cmd to be rebuilt the
+#correct way.
+# b) The previous build failed or was interrupted while building u-boot.cfg,
+#so deleting u-boot.cfg isn't going to cause any additional work.
+ifneq ($(wildcard $(obj)/.$(SPL_BIN).d),)
+  unused := $(shell rm -f $(obj)/$(SPL_BIN).cfg)
+endif
 $(obj)/$(SPL_BIN).cfg: include/config.h FORCE
$(call if_changed_dep,cpp_cfg)
 
-- 
2.9.3

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


[U-Boot] [PATCH 1/2] Makefile: use if_change_dep for u-boot.cfg

2016-09-19 Thread Stephen Warren
From: Stephen Warren 

cmd_cpp_cfg generates a dependency output, but because it's invoked using
if_changed rather than if_changed_dep, that dependency file is ignored.
This results in Kbuild not knowing about which files u-boot.cfg depends
on, so it may not be rebuilt when required.

A practical result of this is that u-boot.cfg may continue to reference
CONFIG_ options that no longer exist in the source tree, and this can
cause the adhoc config options check to fail.

This change modifies Makefile to use if_changed_dep, which in turn causes
all dependencies to be known to the next make invocation.

Signed-off-by: Stephen Warren 
---
 Makefile | 2 +-
 scripts/Makefile.spl | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index fffc188f9ac0..949b264b8fee 100644
--- a/Makefile
+++ b/Makefile
@@ -937,7 +937,7 @@ u-boot.dis: u-boot
$(OBJDUMP) -d $< > $@
 
 u-boot.cfg:include/config.h FORCE
-   $(call if_changed,cpp_cfg)
+   $(call if_changed_dep,cpp_cfg)
 
 # Check that this build does not use CONFIG options that we don't know about
 # unless they are in Kconfig. All the existing CONFIG options are whitelisted,
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 4994fa887ba3..d0d73d3b0a4c 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -217,7 +217,7 @@ cmd_cpp_cfg = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) 
$(LDPPFLAGS) -ansi \
-DDO_DEPS_ONLY -D__ASSEMBLY__ -x assembler-with-cpp -P -dM -E -o $@ $<
 
 $(obj)/$(SPL_BIN).cfg: include/config.h FORCE
-   $(call if_changed,cpp_cfg)
+   $(call if_changed_dep,cpp_cfg)
 
 pythonpath = PYTHONPATH=tools
 
-- 
2.9.3

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


Re: [U-Boot] [PATCH] dfu: Migrate to Kconfig

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 01:31:30PM -0400, Tom Rini wrote:

> Introduce a hidden USB_FUNCTION_DFU Kconfig option and select it for
> CMD_DFU (as we must have the DFU command enabled to do anything DFU).
> Make all of the entries in drivers/dfu/Kconfig depend on CMD_DFU and add
> options for all of the back end choices that DFU can make use of.
[snip]
> +config DFU_MMC
> + bool "MMC back end for DFU"
> + help
> +   This option enables using DFU to read and write to MMC based storage.

Adding:
  If working with an underlying filesystem rather than raw
  storage you will still need to enable the appropriate write
  commands.

As in doing local testing of stuff that drove me to scratch this itch I
noticed that CMD_EXT4_WRITE is not set on sunxi.  But I don't think we
should force fat+ext4 write to be enabled simply because DFU_MMC is set.
I should however follow up with adding default y if DFU_MMC to
CMD_EXT4_WRITE and migrate FAT_WRITE to Kconfig as well.

-- 
Tom


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


Re: [U-Boot] ad-hoc CONFIG build error

2016-09-19 Thread Stephen Warren

On 09/19/2016 09:22 AM, Tom Rini wrote:

On Mon, Sep 19, 2016 at 09:14:30AM -0600, Stephen Warren wrote:


Tom, Simon,

I'm seeing the following error when building sandbox in either
u-boot.git master branch or u-boot-dm.git master branch:

Error: You must add new CONFIG options using Kconfig
The following new ad-hoc CONFIG options were detected:
CONFIG_DISK
CONFIG_HAVE_GENERIC_BOARD
CONFIG_ROCKCHIP_3036_PINCTRL
CONFIG_ROCKCHIP_PINCTRL
CONFIG_SYS_HUSH_PARSER

Please add these via Kconfig instead. Find a suitable Kconfig
file and add a 'config' or 'menuconfig' option.
make[1]: *** [no_new_adhoc_configs_check] Error 1
make[1]: *** Waiting for unfinished jobs

This is from my Jenkins install, which does incremental builds. I
haven't yet checked whether non-incremental builds work any better.


So, non-incremental should be fine.  What's odd is that the above
options are long done from the tree.  So why are they persisting
somewhere?


I've found the issue. Dependencies are missing for u-boot.cfg, so it 
isn't getting rebuilt, and hence keeps references to old CONFIG options. 
I'll send patches after some testing.

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


[U-Boot] [PATCH] dfu: Migrate to Kconfig

2016-09-19 Thread Tom Rini
Introduce a hidden USB_FUNCTION_DFU Kconfig option and select it for
CMD_DFU (as we must have the DFU command enabled to do anything DFU).
Make all of the entries in drivers/dfu/Kconfig depend on CMD_DFU and add
options for all of the back end choices that DFU can make use of.

Cc: Lukasz Majewski 
Signed-off-by: Tom Rini 
---
Once ack'd I'll run moveconfig.py to migrate everyone over and check for
size changes.  This will also depend on the patch I sent to change the
malloc pool size on TI parts as we otherwise will now expose the bug
about DFU_MMC being unset.
---
 cmd/Kconfig |  1 +
 drivers/dfu/Kconfig | 28 
 2 files changed, 29 insertions(+)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index d28da54ed659..26720b6e1f0d 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -404,6 +404,7 @@ config CMD_USB
 
 config CMD_DFU
bool "dfu"
+   select USB_FUNCTION_DFU
help
  Enables the command "dfu" which is used to have U-Boot create a DFU
  class device via USB.
diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig
index 6b92064f0b52..56a98f5273ce 100644
--- a/drivers/dfu/Kconfig
+++ b/drivers/dfu/Kconfig
@@ -1,5 +1,9 @@
 menu "DFU support"
 
+config USB_FUNCTION_DFU
+   bool
+
+if CMD_DFU
 config DFU_TFTP
bool "DFU via TFTP"
help
@@ -7,4 +11,28 @@ config DFU_TFTP
  sent via TFTP boot.
 
  Detailed description of this feature can be found at 
./doc/README.dfutftp
+
+config DFU_MMC
+   bool "MMC back end for DFU"
+   help
+ This option enables using DFU to read and write to MMC based storage.
+
+config DFU_NAND
+   bool "NAND back end for DFU"
+   help
+ This option enables using DFU to read and write to NAND based
+ storage.
+
+config DFU_RAM
+   bool "RAM back end for DFU"
+   help
+ This option enables using DFU to read and write RAM on the target.
+
+config DFU_SF
+   bool "SPI flash back end for DFU"
+   help
+ This option enables using DFU to read and write to SPI flash based
+ storage.
+
+endif
 endmenu
-- 
1.9.1

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


[U-Boot] [PATCH] ti_armv7_common.h: Adjust malloc pool size in all cases.

2016-09-19 Thread Tom Rini
Previously we had been adjusting CONFIG_SYS_MALLOC_LEN based on if
CONFIG_DFU_MMC has been set or not.  However, for quite some time this
has not been the case as we often include 
prior to setting CONFIG_DFU_MMC so we would always use 16MiB and then
not have enough room for to DFU files.  Given the amount of memory we
always have, setting a minimum size of 32MiB for malloc is reasonable.
However, in the SPL case not only do we not need that much we start
running into overlap problems and then will fail to boot.  Since we
don't need 16MiB in the SPL case, bring this down to 8MiB.

Signed-off-by: Tom Rini 
---
 include/configs/ti_armv7_common.h | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/include/configs/ti_armv7_common.h 
b/include/configs/ti_armv7_common.h
index d8a8c4a87558..3ec8a8f44997 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -146,10 +146,7 @@
  * we are on so we do not need to rely on the command prompt.  We set a
  * console baudrate of 115200 and use the default baud rate table.
  */
-#ifdef CONFIG_DFU_MMC
-#define CONFIG_SYS_MALLOC_LEN  ((16 << 20) + CONFIG_SYS_DFU_DATA_BUF_SIZE)
-#else
-#define CONFIG_SYS_MALLOC_LEN  (16 << 20)
+#define CONFIG_SYS_MALLOC_LEN  SZ_32M
 #endif
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 #define CONFIG_BAUDRATE115200
@@ -230,7 +227,7 @@
 #ifndef CONFIG_SYS_SPL_MALLOC_START
 #define CONFIG_SYS_SPL_MALLOC_START(CONFIG_SPL_BSS_START_ADDR + \
 CONFIG_SPL_BSS_MAX_SIZE)
-#define CONFIG_SYS_SPL_MALLOC_SIZE CONFIG_SYS_MALLOC_LEN
+#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_8M
 #endif
 #ifndef CONFIG_SPL_MAX_SIZE
 #define CONFIG_SPL_MAX_SIZE(SRAM_SCRATCH_SPACE_ADDR - \
-- 
1.9.1

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


Re: [U-Boot] [ANN] U-Boot v2016.09.01 is released

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 01:43:11PM -0300, Fabio Estevam wrote:
> On Mon, Sep 19, 2016 at 1:07 PM, Tom Rini  wrote:
> > On Mon, Sep 12, 2016 at 12:21:28PM -0400, Tom Rini wrote:
> >
> >> Hey all,
> >>
> >> I've released v2016.09 and it's now live on git and FTP and ACD (along
> >> with PGP sig file).
> >
> > Mistakes happen, and I'm announcing the release of v2016.09.01.  This
> > consists of two changes:
> 
> Still does not appear at http://git.denx.de/?p=u-boot.git;a=shortlog

I've poked Wolfgang about why these aren't migrating over to the public
git side, but they are available on the github mirror.

-- 
Tom


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


Re: [U-Boot] [PATCH] efi: console: Correctly report modes

2016-09-19 Thread Emmanuel Vadot
On Mon, 19 Sep 2016 15:55:49 +0200
Alexander Graf  wrote:

> 
> 
> On 19.08.16 18:12, Emmanuel Vadot wrote:
> > Hello Alexander,
> > 
> > The UEFI spec say that mode 0 will always be 80x25, mode 1 80x50 and other
> > size will be mode >=2.
> > This patch :
> > - set the default size to 80x25.
> > - returns EFI_UNSUPPORTED if the queried mode isn't available.
> 
> Very well spot, would you mind to tell me where you hit this? :)

 The FreeBSD loader queries mode until it gets EFI_UNSUPPORTED.

> > Signed-off-by: Emmanuel Vadot 
> > ---
> >  lib/efi_loader/efi_console.c | 16 ++--
> >  1 file changed, 14 insertions(+), 2 deletions(-)
> > 
> > diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
> > index 2e0228c..10849f9 100644
> > --- a/lib/efi_loader/efi_console.c
> > +++ b/lib/efi_loader/efi_console.c
> > @@ -9,9 +9,9 @@
> >  #include 
> >  #include 
> >  
> > -/* If we can't determine the console size, default to 80x24 */
> > +/* If we can't determine the console size, default to 80x25 */
> >  static int console_columns = 80;
> > -static int console_rows = 24;
> > +static int console_rows = 25;
> 
> We should probably adapt the comment saying that "mode 0 is always 80x25".
> 
> >  static bool console_size_queried;
> >  
> >  const efi_guid_t efi_guid_console_control = CONSOLE_CONTROL_GUID;
> > @@ -165,6 +165,8 @@ static efi_status_t EFIAPI efi_cout_query_mode(
> > unsigned long mode_number, unsigned long *columns,
> > unsigned long *rows)
> >  {
> > +   unsigned long current_mode;
> > +
> > EFI_ENTRY("%p, %ld, %p, %p", this, mode_number, columns, rows);
> >  
> > if (!console_size_queried) {
> > @@ -196,6 +198,16 @@ static efi_status_t EFIAPI efi_cout_query_mode(
> > }
> >  
> >  out:
> > +   if (console_columns == 80 && console_rows == 25)
> > +   current_mode = 0;
> > +   else if (console_columns == 80 && console_rows == 50)
> > +   current_mode = 1;
> > +   else
> > +   current_mode = 2;
> 
> Unfortunately this introduces modes that we don't declare as supported.
> The struct "efi_con_mode" only sets max_mode to 0. So we really tell the
> payload that we only have 80x25 available.
> 
> I guess we should set max_mode to 2 and have mode 2 be the actually
> determined size while mode 0 stays 80x25? This will need some
> refactoring of the code.

 Ah true, I've missed that, I'll update my patch this week.

> Sorry for the terribly late reply.
> 
> Alex

 No problem,

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


Re: [U-Boot] A20-OLinuXino-Lime2: Enable USB gadget support

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 10:03:32AM -0400, Tom Rini wrote:

> Based on A13-OLinuXino, enable DFU and UMS support.
> 
> Signed-off-by: Tom Rini 
> Reviewed-by: Hans de Goede 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [ANN] U-Boot v2016.09.01 is released

2016-09-19 Thread Fabio Estevam
On Mon, Sep 19, 2016 at 1:07 PM, Tom Rini  wrote:
> On Mon, Sep 12, 2016 at 12:21:28PM -0400, Tom Rini wrote:
>
>> Hey all,
>>
>> I've released v2016.09 and it's now live on git and FTP and ACD (along
>> with PGP sig file).
>
> Mistakes happen, and I'm announcing the release of v2016.09.01.  This
> consists of two changes:

Still does not appear at http://git.denx.de/?p=u-boot.git;a=shortlog
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] cmd: Make CMD_USB_MASS_STORAGE visible only with USB_GADGET and default y

2016-09-19 Thread Tom Rini
In order for CMD_USB_MASS_STORAGE to be useful we must have USB_GADGET
enabled, so only show this option when USB_GADGET is set.  In addition,
expand the help text so it's clearer what this does and given the
overall utility of this command, make it enabled by default.

Signed-off-by: Tom Rini 
---
 cmd/Kconfig | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cmd/Kconfig b/cmd/Kconfig
index d28da54ed659..ddbd5a82d80f 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -408,10 +408,14 @@ config CMD_DFU
  Enables the command "dfu" which is used to have U-Boot create a DFU
  class device via USB.
 
+if USB_GADGET
 config CMD_USB_MASS_STORAGE
bool "UMS usb mass storage"
+   default y
help
- USB mass storage support
+ Enables the command "ums" which is used to have U-Boot expose
+ local storage such as eMMC as a USB Mass Storage Device class device.
+endif
 
 config CMD_FPGA
bool "fpga"
-- 
1.9.1

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


Re: [U-Boot] [PATCH] A20-OLinuXino-Lime2: Enable USB gadget support

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 05:44:09PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 19-09-16 17:00, Tom Rini wrote:
> >On Mon, Sep 19, 2016 at 04:53:04PM +0200, Hans de Goede wrote:
> >>Hi,
> >>
> >>On 19-09-16 16:03, Tom Rini wrote:
> >>>Based on A13-OLinuXino, enable DFU and UMS support.
> >>>
> >>>Signed-off-by: Tom Rini 
> >>>---
> >>>With this change I've added DFU to my tests on this board, and assuming a
> >>>follow up test with the SD image that kicks the board into FEL works, I'll
> >>>then enable the UMS tests on this board (and add DFU to SD, not just DFU to
> >>>RAM).
> >>>
> >>>configs/A20-OLinuXino-Lime2_defconfig | 8 
> >>>1 file changed, 8 insertions(+)
> >>>
> >>>diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
> >>>b/configs/A20-OLinuXino-Lime2_defconfig
> >>>index 23db07380624..54343de7f351 100644
> >>>--- a/configs/A20-OLinuXino-Lime2_defconfig
> >>>+++ b/configs/A20-OLinuXino-Lime2_defconfig
> >>>@@ -12,9 +12,17 @@ 
> >>>CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"
> >>>CONFIG_SPL=y
> >>># CONFIG_CMD_IMLS is not set
> >>># CONFIG_CMD_FLASH is not set
> >>>+CONFIG_CMD_DFU=y
> >>>+CONFIG_CMD_USB_MASS_STORAGE=y
> >>
> >>Do you need CMD_USB_MASS_STORAGE for your tests ? Enabling
> >>CMD_USB_MASS_STORAGE really seems orthogonal to enabling GADGET
> >>mode to me, esp. since it is only useful in host mode AFAICT.
> >
> >Ah, no, things have bad names perhaps.  CMD_USB_MASS_STORAGE enables
> >"ums" as a command which is what in turn will export MMC (or something
> >else) as a USB mass storage gadget over to the host.
> 
> Ah, I thought this enabled the (destructive) low level usb mass storage
> block read/write test commands, but I guess I'm wrong.
> 
> I wonder why Chen-Yu put it in the usb host enabling patch for
> an A33 board then...
> 
> 
> >>Chen-Yu did something similar in a patch enabling host mode for a
> >>different sunxi board and here is what I replied:
> >>
> >>"
> >>If we want to enable CONFIG_CMD_USB_MASS_STORAGE on sunxi, we really
> >>should do so on all boards (feel free to submit a patch for this).
> >>
> >>e.g. add something like this to board/sunxi/Kconfig:
> >>
> >>config CMD_USB_MASS_STORAGE
> >>default y
> 
> Given the above, that should probably be:
> 
> config CMD_USB_MASS_STORAGE
>default y if USB_GADGET
> 
> 
> Hmm, I guess we may want to have a bunch of those, so that
> simply adding:
> 
> CONFIG_USB_MUSB_GADGET=y
> 
> To a defconfig enables the relevant related options...

Yes.  I think that something that should be done, and sooner rather than
later, is changing more options from 'default n' (the default when not
spelled out) to 'default y' as with the change from board.h to Kconfig
there is much less pain in turning off default values.  Things like
'ums' are really handy and unlike DFU/fastboot don't require additional
configuration.  So, I should go and fire off a patch for this one
quickly at least.

-- 
Tom


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


Re: [U-Boot] [RFC PATCH] kconfig: introduce kconfig for UBI

2016-09-19 Thread Andrew F. Davis
BTW, the following addresses that bounce should be removed from wherever
you found them or added to .get_maintainer.ignore if they are part of
old commits:

Bo Shen 
Albert ARIBAUD 
Gerald Kerma 
Karl Beldan 
Vaibhav Hiremath 
Sudhakar Rajashekhara 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [ANN] U-Boot v2016.09.01 is released

2016-09-19 Thread Tom Rini
On Mon, Sep 12, 2016 at 12:21:28PM -0400, Tom Rini wrote:

> Hey all,
> 
> I've released v2016.09 and it's now live on git and FTP and ACD (along
> with PGP sig file).

Mistakes happen, and I'm announcing the release of v2016.09.01.  This
consists of two changes:
- Revert "image-fit: switch ENOLINK to ENOENT"
  As while I want to support OpenBSD hosts, this change broke FIT images
  as in the image checking code we care about ENOLINK and on further
  review we need to think about what to change ENOLINK to so we can be
  sure to handle the different cases here.
- Revert "Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL"
  This increase is too large and causes other problems, and we're still
  discussing things.  I wouldn't have done a release just for this
  change but since I must fix the other problem, I've included this.

As for the first problem, let this be a warning by example of relying
too much on tests without fully reading the logs rather than just
pass/fail.  We have FIT image tests, I ran the FIT image tests but they
weren't checking for success at the end of booting the image.  Now they
will (I posted that the other day).

-- 
Tom


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


Re: [U-Boot] [RFC PATCH] kconfig: introduce kconfig for UBI

2016-09-19 Thread Andrew F. Davis
On 09/14/2016 12:03 AM, Heiko Schocher wrote:
> move the UBI config options into Kconfig.
> 
> Signed-off-by: Heiko Schocher 
> ---
> Tested with tbot:
> http://lists.denx.de/pipermail/u-boot/2016-June/258119.html
> 
> result:
> Boards  : 1196
> compile err : 36
> not checked : 0
> U-Boot good : 1157 bad 3
> SPL good: 427 bad 0
> ('compile err :', [...]
> ('bad :', ['sandbox', 'sandbox_noblk', 'sandbox_spl'])
> 
> I have 36 boards, which do not compile, at least with my
> toolchains used, see:
> https://github.com/hsdenx/tbot/blob/master/config/tbot_uboot_kconfig_check.cfg#L68
> but none of them had UBI support, so this should be OK.
> 
> One change which should be discussed in microblaze-generic:
> (I preceded the patchsnipset with a 'D' so I hope it does
>  not confuse patchwork)
> Ddiff --git a/include/configs/microblaze-generic.h 
> b/include/configs/microblaze-generic.h
> Dindex e5bf700..d8e65f8 100644
> D--- a/include/configs/microblaze-generic.h
> D+++ b/include/configs/microblaze-generic.h
> D@@ -177,7 +177,6 @@
> D
> D #if defined(FLASH)
> D # define CONFIG_CMD_JFFS2
> D-# define CONFIG_CMD_UBI
> D # undef CONFIG_CMD_UBIFS
> D
> D # if !defined(RAMENV)
> D@@ -192,7 +191,6 @@
> D # endif
> D #else
> D # undef CONFIG_CMD_JFFS2
> D-# undef CONFIG_CMD_UBI
> D # undef CONFIG_CMD_UBIFS
> D #endif
> D #endif
> D@@ -202,7 +200,6 @@
> D #endif
> D
> D #if defined(CONFIG_CMD_UBIFS)
> D-# define CONFIG_CMD_UBI
> D # define CONFIG_LZO
> D #endif
> 
> Hmm... how to handle such a move?
> Just ignore it, as my test does not detect different
> binaries?

This kind of thing has shown up for me a bit, some of this logic should
be moved over to Kconfig, others like these maybe not. These could be
replaced by defaulting CMD_UBI when a FLASH or UBI enabled defconfig is
selected.

IMHO all of this can be added later when the Kconfig conversion is
finished, for now if the binary doesn't change I see no harm.

[snip]

> +config CMD_UBI
> + tristate "Enable UBI - Unsorted block images commands"
> + select CRC32
> + select MTD_UBI
> + help
> +   UBI is a software layer above MTD layer which admits of LVM-like

^^ use of?

Otherwise:

Reviewed-by: Andrew F. Davis 

> +   logical volumes on top of MTD devices, hides some complexities of
> +   flash chips like wear and bad blocks and provides some other useful
> +   capabilities. Please, consult the MTD web site for more details
> +   (www.linux-mtd.infradead.org). Activate this option if you want
> +   to use U-Boot UBI commands.
> +
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] watchdog: Fix Watchdog Reset while in U-Boot Prompt

2016-09-19 Thread Andreas Reichel
Hi Tom,

is my patch going to be applied or is the problem resolved
otherwhise?

Kind regards
Andreas

On Mo, Sep 05, 2016 at 07:04:53 -0600, Simon Glass wrote:
> +Tom, in case this should go into the release.
> 
> On 1 August 2016 at 05:49, Andreas J. Reichel
>  wrote:
> > This patch fixes unwanted watchdog resets while the user enters
> > a command at the U-Boot prompt.
> >
> > As found on the CM-FX6 board from Compulab, when having enabled the
> > watchdog, a missing WATCHDOG_RESET call in _serial_tstc() in
> > (/drivers/serial/serial-uclass.c) causes this and alike boards to
> > reset when the watchdog's timeout has elapsed while waiting at the
> > U-Boot prompt.
> >
> > Despite the user could press several keys within the watchdog
> > timeout limit, the while loop in cli_readline.c, line 261, does only
> > call WATCHDOG_RESET if first == 1, which gets set to 0 in the 1st
> > loop iteration. This leads to a watchdog timeout no matter if the
> > user presses keys or not.
> >
> > The problem is solved with a call to WATCHDOG_RESET in _serial_tstc,
> > defined in drivers/serial/serial-uclass.c.
> >
> > Since the macro WATCHDOG_RESET expands to {} if watchdog support
> > isn't configured, there's no need to surround it by #ifdef in this
> > case.
> >
> >  * Symptom:
> >U-Boot resets after watchdog times out when in commandline prompt
> >and watchdog is enabled.
> >
> >  * Reasoning:
> >When U-Boot shows the commandline prompt, the following function
> >call stack is executed while waiting for a keypress:
> >
> >common/main.c:
> > main_loop  => common/cli.c: cli_loop() =>
> >common/cli_hush.c:
> > parse_file_outer   => parse_stream_outer   =>
> > parse_stream   => b_getch(i)   =>
> > i->get(i)  => file_get =>
> > get_user_input => cmdedit_read_input   =>
> > uboot_cli_readline =>
> >common/cli_readline.c:
> > cli_readline   => cli_readline_into_buffer =>
> > cread_line => getcmd_getch (== getc)   =>
> >commonn/console.c:
> > fgetc  => console_tstc
> >
> >- in console_tstc line 181:
> >If dev->tstc(dev) returns 0, the global tstcdev variable doesn't
> >get set. This is the case if no character is in the serial buffer.
> >
> >- in fgetc(int file), line 297:
> >Program flow keeps looping because tstcdev does not get set.
> >Therefore WATCHDOG_RESET is not called, as mx_serial_tstc from
> >drivers/serial/serial_mxc.c does not call it.
> >
> >- Initialization calls drv_system_init in stdio.c, which sets
> >dev.tstc = stdio_serial_tstc. Thus, dev->tstc(dev) calls serial_tstc()
> >which in turn calls _serial_tstc().
> >
> >Hence, _serial_tstc() needs to call WATCHDOG_RESET() to periodically
> >reset the watchdog while cli_readline waits for user input.
> >
> > Signed-off-by: Christian Storm 
> > Signed-off-by: Jan Kiszka 
> > Signed-off-by: Andreas J. Reichel 
> > ---
> >
> > Changes in v2:
> >  - Move WATCHDOG_RESET() call from common/console.c to
> >drivers/serial/serial-uclass.c.
> >
> >  drivers/serial/serial-uclass.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
> > index 0ce5c44..72cf808 100644
> > --- a/drivers/serial/serial-uclass.c
> > +++ b/drivers/serial/serial-uclass.c
> > @@ -155,6 +155,7 @@ static int _serial_tstc(struct udevice *dev)
> >  {
> > struct dm_serial_ops *ops = serial_get_ops(dev);
> >
> > +   WATCHDOG_RESET();
> > if (ops->pending)
> > return ops->pending(dev, true);
> 
> Great explanation, thank you.
> 
> Acked-by: Simon Glass 
> 
> >
> > --
> > 2.8.2
> >

-- 
Andreas Reichel 
Dipl.-Phys. (Univ.) 
Software Consultant

andreas.reic...@tngtech.com 
+49-174-3180074

TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
Geschäftsführer: Henrik Klagges, Christoph Stock, Dr. Robert Dahlke
Sitz: Unterföhring * Amtsgericht München * HRB 135082
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] A20-OLinuXino-Lime2: Enable USB gadget support

2016-09-19 Thread Hans de Goede

Hi,

On 19-09-16 17:00, Tom Rini wrote:

On Mon, Sep 19, 2016 at 04:53:04PM +0200, Hans de Goede wrote:

Hi,

On 19-09-16 16:03, Tom Rini wrote:

Based on A13-OLinuXino, enable DFU and UMS support.

Signed-off-by: Tom Rini 
---
With this change I've added DFU to my tests on this board, and assuming a
follow up test with the SD image that kicks the board into FEL works, I'll
then enable the UMS tests on this board (and add DFU to SD, not just DFU to
RAM).

configs/A20-OLinuXino-Lime2_defconfig | 8 
1 file changed, 8 insertions(+)

diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
b/configs/A20-OLinuXino-Lime2_defconfig
index 23db07380624..54343de7f351 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -12,9 +12,17 @@ 
CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"
CONFIG_SPL=y
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_DFU=y
+CONFIG_CMD_USB_MASS_STORAGE=y


Do you need CMD_USB_MASS_STORAGE for your tests ? Enabling
CMD_USB_MASS_STORAGE really seems orthogonal to enabling GADGET
mode to me, esp. since it is only useful in host mode AFAICT.


Ah, no, things have bad names perhaps.  CMD_USB_MASS_STORAGE enables
"ums" as a command which is what in turn will export MMC (or something
else) as a USB mass storage gadget over to the host.


Ah, I thought this enabled the (destructive) low level usb mass storage
block read/write test commands, but I guess I'm wrong.

I wonder why Chen-Yu put it in the usb host enabling patch for
an A33 board then...



Chen-Yu did something similar in a patch enabling host mode for a
different sunxi board and here is what I replied:

"
If we want to enable CONFIG_CMD_USB_MASS_STORAGE on sunxi, we really
should do so on all boards (feel free to submit a patch for this).

e.g. add something like this to board/sunxi/Kconfig:

config CMD_USB_MASS_STORAGE
default y


Given the above, that should probably be:

config CMD_USB_MASS_STORAGE
   default y if USB_GADGET


Hmm, I guess we may want to have a bunch of those, so that
simply adding:

CONFIG_USB_MUSB_GADGET=y

To a defconfig enables the relevant related options...

Regards,

Hans





So that we can still disable it in case there are space constraints,
but normally we enable it on all sunxi boards offering a
consistent set of available commands.
"


I think it's a useful command that should be more widely exposed, yes.
IIRC, it's how the Tegra platforms support flashing their dev boards
with official images, and can be a handy "rescue" type option too.



The same goes for this patch, otherwise this patch is:

Reviewed-by: Hans de Goede 

Ig you want to feel free to apply this directly
(given that I've send out a sunxi pull-req recently).


OK, thanks.  I just might since I really want to move on to grabbing
some fs patches and before I do that I really want to have as much
testing of them as possible.


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


Re: [U-Boot] ad-hoc CONFIG build error

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 09:14:30AM -0600, Stephen Warren wrote:

> Tom, Simon,
> 
> I'm seeing the following error when building sandbox in either
> u-boot.git master branch or u-boot-dm.git master branch:
> 
> Error: You must add new CONFIG options using Kconfig
> The following new ad-hoc CONFIG options were detected:
> CONFIG_DISK
> CONFIG_HAVE_GENERIC_BOARD
> CONFIG_ROCKCHIP_3036_PINCTRL
> CONFIG_ROCKCHIP_PINCTRL
> CONFIG_SYS_HUSH_PARSER
> 
> Please add these via Kconfig instead. Find a suitable Kconfig
> file and add a 'config' or 'menuconfig' option.
> make[1]: *** [no_new_adhoc_configs_check] Error 1
> make[1]: *** Waiting for unfinished jobs
> 
> This is from my Jenkins install, which does incremental builds. I
> haven't yet checked whether non-incremental builds work any better.

So, non-incremental should be fine.  What's odd is that the above
options are long done from the tree.  So why are they persisting
somewhere?

-- 
Tom


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


[U-Boot] ad-hoc CONFIG build error

2016-09-19 Thread Stephen Warren

Tom, Simon,

I'm seeing the following error when building sandbox in either 
u-boot.git master branch or u-boot-dm.git master branch:


Error: You must add new CONFIG options using Kconfig
The following new ad-hoc CONFIG options were detected:
CONFIG_DISK
CONFIG_HAVE_GENERIC_BOARD
CONFIG_ROCKCHIP_3036_PINCTRL
CONFIG_ROCKCHIP_PINCTRL
CONFIG_SYS_HUSH_PARSER

Please add these via Kconfig instead. Find a suitable Kconfig
file and add a 'config' or 'menuconfig' option.
make[1]: *** [no_new_adhoc_configs_check] Error 1
make[1]: *** Waiting for unfinished jobs

This is from my Jenkins install, which does incremental builds. I 
haven't yet checked whether non-incremental builds work any better.

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


Re: [U-Boot] [PATCH] A20-OLinuXino-Lime2: Enable USB gadget support

2016-09-19 Thread Hans de Goede

Hi,

On 19-09-16 16:03, Tom Rini wrote:

Based on A13-OLinuXino, enable DFU and UMS support.

Signed-off-by: Tom Rini 
---
With this change I've added DFU to my tests on this board, and assuming a
follow up test with the SD image that kicks the board into FEL works, I'll
then enable the UMS tests on this board (and add DFU to SD, not just DFU to
RAM).

 configs/A20-OLinuXino-Lime2_defconfig | 8 
 1 file changed, 8 insertions(+)

diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
b/configs/A20-OLinuXino-Lime2_defconfig
index 23db07380624..54343de7f351 100644
--- a/configs/A20-OLinuXino-Lime2_defconfig
+++ b/configs/A20-OLinuXino-Lime2_defconfig
@@ -12,9 +12,17 @@ 
CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"
 CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_DFU=y
+CONFIG_CMD_USB_MASS_STORAGE=y


Do you need CMD_USB_MASS_STORAGE for your tests ? Enabling
CMD_USB_MASS_STORAGE really seems orthogonal to enabling GADGET
mode to me, esp. since it is only useful in host mode AFAICT.

Chen-Yu did something similar in a patch enabling host mode for a
different sunxi board and here is what I replied:

"
If we want to enable CONFIG_CMD_USB_MASS_STORAGE on sunxi, we really
should do so on all boards (feel free to submit a patch for this).

e.g. add something like this to board/sunxi/Kconfig:

config CMD_USB_MASS_STORAGE
default y

So that we can still disable it in case there are space constraints,
but normally we enable it on all sunxi boards offering a
consistent set of available commands.
"

The same goes for this patch, otherwise this patch is:

Reviewed-by: Hans de Goede 

Ig you want to feel free to apply this directly
(given that I've send out a sunxi pull-req recently).

Regards,

Hans




 # CONFIG_CMD_FPGA is not set
 CONFIG_RTL8211X_PHY_FORCE_MASTER=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_AXP_ALDO3_VOLT=2800
 CONFIG_AXP_ALDO4_VOLT=2800
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
+CONFIG_G_DNL_VENDOR_NUM=0x1f3a
+CONFIG_G_DNL_PRODUCT_NUM=0x1010


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


Re: [U-Boot] [PATCH] A20-OLinuXino-Lime2: Enable USB gadget support

2016-09-19 Thread Tom Rini
On Mon, Sep 19, 2016 at 04:53:04PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 19-09-16 16:03, Tom Rini wrote:
> >Based on A13-OLinuXino, enable DFU and UMS support.
> >
> >Signed-off-by: Tom Rini 
> >---
> >With this change I've added DFU to my tests on this board, and assuming a
> >follow up test with the SD image that kicks the board into FEL works, I'll
> >then enable the UMS tests on this board (and add DFU to SD, not just DFU to
> >RAM).
> >
> > configs/A20-OLinuXino-Lime2_defconfig | 8 
> > 1 file changed, 8 insertions(+)
> >
> >diff --git a/configs/A20-OLinuXino-Lime2_defconfig 
> >b/configs/A20-OLinuXino-Lime2_defconfig
> >index 23db07380624..54343de7f351 100644
> >--- a/configs/A20-OLinuXino-Lime2_defconfig
> >+++ b/configs/A20-OLinuXino-Lime2_defconfig
> >@@ -12,9 +12,17 @@ 
> >CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,AHCI,SATAPWR=SUNXI_GPC(3)"
> > CONFIG_SPL=y
> > # CONFIG_CMD_IMLS is not set
> > # CONFIG_CMD_FLASH is not set
> >+CONFIG_CMD_DFU=y
> >+CONFIG_CMD_USB_MASS_STORAGE=y
> 
> Do you need CMD_USB_MASS_STORAGE for your tests ? Enabling
> CMD_USB_MASS_STORAGE really seems orthogonal to enabling GADGET
> mode to me, esp. since it is only useful in host mode AFAICT.

Ah, no, things have bad names perhaps.  CMD_USB_MASS_STORAGE enables
"ums" as a command which is what in turn will export MMC (or something
else) as a USB mass storage gadget over to the host.

> Chen-Yu did something similar in a patch enabling host mode for a
> different sunxi board and here is what I replied:
> 
> "
> If we want to enable CONFIG_CMD_USB_MASS_STORAGE on sunxi, we really
> should do so on all boards (feel free to submit a patch for this).
> 
> e.g. add something like this to board/sunxi/Kconfig:
> 
> config CMD_USB_MASS_STORAGE
> default y
> 
> So that we can still disable it in case there are space constraints,
> but normally we enable it on all sunxi boards offering a
> consistent set of available commands.
> "

I think it's a useful command that should be more widely exposed, yes.
IIRC, it's how the Tegra platforms support flashing their dev boards
with official images, and can be a handy "rescue" type option too.

> 
> The same goes for this patch, otherwise this patch is:
> 
> Reviewed-by: Hans de Goede 
> 
> Ig you want to feel free to apply this directly
> (given that I've send out a sunxi pull-req recently).

OK, thanks.  I just might since I really want to move on to grabbing
some fs patches and before I do that I really want to have as much
testing of them as possible.

-- 
Tom


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


Re: [U-Boot] [PATCH 4/9] arm: socfpga: socrates: Adding handoff for SDRAM ctrlcfg.extratime1

2016-09-19 Thread Chin Liang See
On Mon, 2016-09-19 at 16:24 +0200, Marek Vasut wrote:
> On 09/15/2016 09:27 AM, Chin Liang See wrote:
> > Adding new handoff for SDRAM ctrcfg.extratime1 which is
> > required for stabil LPDDR2 operation
> 
> Same comment as 2/9 applies to the rest


Yup, we just need 1/9.

Thanks
Chin Liang


> 
> > Signed-off-by: Chin Liang See 
> > ---
> >  board/ebv/socrates/qts/sdram_config.h | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/board/ebv/socrates/qts/sdram_config.h
> > b/board/ebv/socrates/qts/sdram_config.h
> > index cf9d1d3..a0cad51 100644
> > --- a/board/ebv/socrates/qts/sdram_config.h
> > +++ b/board/ebv/socrates/qts/sdram_config.h
> > @@ -49,6 +49,9 @@
> >  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TRTP
> > 4
> >  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_PWRDOWNEXIT 
> > 3
> >  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_SELFRFSHEXIT
> > 512
> > +#define
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR 2
> > +#define
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC 2
> > +#define
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_C
> > HIP 2
> >  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_INCSYNC 
> > 0
> >  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_SYNCMODE
> > 0
> >  #define CONFIG_HPS_SDR_CTRLCFG_FPGAPORTRST 
> > 0x0
> > 
> 
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/9] arm: socfpga: mcvevk: Adding handoff for SDRAM ctrlcfg.extratime1

2016-09-19 Thread Chin Liang See
On Mon, 2016-09-19 at 16:24 +0200, Marek Vasut wrote:
> On 09/15/2016 09:27 AM, Chin Liang See wrote:
> > Adding new handoff for SDRAM ctrcfg.extratime1 which is
> > required for stabil LPDDR2 operation
> 
> Same comment as 2/9

Yup, this patch is not required.

Thanks
Chin Liang

> 
> > Signed-off-by: Chin Liang See 
> > ---
> >  board/denx/mcvevk/qts/sdram_config.h | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/board/denx/mcvevk/qts/sdram_config.h
> > b/board/denx/mcvevk/qts/sdram_config.h
> > index 30c4d7d..0328850 100644
> > --- a/board/denx/mcvevk/qts/sdram_config.h
> > +++ b/board/denx/mcvevk/qts/sdram_config.h
> > @@ -49,6 +49,9 @@
> >  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TRTP
> > 5
> >  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_PWRDOWNEXIT 
> > 3
> >  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_SELFRFSHEXIT
> > 512
> > +#define
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR 2
> > +#define
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC 2
> > +#define
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_C
> > HIP 2
> >  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_INCSYNC 
> > 0
> >  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_SYNCMODE
> > 0
> >  #define CONFIG_HPS_SDR_CTRLCFG_FPGAPORTRST 
> > 0x0
> > 
> 
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/9] arm: socfpga: Adding handoff for SDRAM ctrlcfg.extratime1

2016-09-19 Thread Chin Liang See
On Mon, 2016-09-19 at 16:24 +0200, Marek Vasut wrote:
> On 09/15/2016 09:27 AM, Chin Liang See wrote:
> > Adding new handoff for SDRAM ctrcfg.extratime1 which is
> > required for stabil LPDDR2 operation
> 
> ... stable ...
> 
> Isn't SoCDK using DDR3 DRAM ?

Yah, you are right where we won't need this patch and others except #1
one. Should I send v2 which only have first patch?

Thanks
Chin Liang

> 
> > Signed-off-by: Chin Liang See 
> > ---
> >  board/altera/arria5-socdk/qts/sdram_config.h   | 3 +++
> >  board/altera/cyclone5-socdk/qts/sdram_config.h | 3 +++
> >  2 files changed, 6 insertions(+)
> > 
> > diff --git a/board/altera/arria5-socdk/qts/sdram_config.h
> > b/board/altera/arria5-socdk/qts/sdram_config.h
> > index e9fe60f..8964637 100644
> > --- a/board/altera/arria5-socdk/qts/sdram_config.h
> > +++ b/board/altera/arria5-socdk/qts/sdram_config.h
> > @@ -49,6 +49,9 @@
> >  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TRTP
> > 4
> >  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_PWRDOWNEXIT 
> > 3
> >  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_SELFRFSHEXIT
> > 512
> > +#define
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR 2
> > +#define
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC 2
> > +#define
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_C
> > HIP 2
> >  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_INCSYNC 
> > 0
> >  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_SYNCMODE
> > 0
> >  #define CONFIG_HPS_SDR_CTRLCFG_FPGAPORTRST 
> > 0
> > diff --git a/board/altera/cyclone5-socdk/qts/sdram_config.h
> > b/board/altera/cyclone5-socdk/qts/sdram_config.h
> > index 37c1476..1bc6f6f 100644
> > --- a/board/altera/cyclone5-socdk/qts/sdram_config.h
> > +++ b/board/altera/cyclone5-socdk/qts/sdram_config.h
> > @@ -49,6 +49,9 @@
> >  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TRTP
> > 3
> >  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_PWRDOWNEXIT 
> > 3
> >  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_SELFRFSHEXIT
> > 512
> > +#define
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR 2
> > +#define
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC 2
> > +#define
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_C
> > HIP 2
> >  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_INCSYNC 
> > 0
> >  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_SYNCMODE
> > 0
> >  #define CONFIG_HPS_SDR_CTRLCFG_FPGAPORTRST 
> > 0
> > 
> 
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/9] ddr: altera: Configuring SDRAM extra cycles timing parameters

2016-09-19 Thread Chin Liang See
On Mon, 2016-09-19 at 16:22 +0200, Marek Vasut wrote:
> On 09/15/2016 09:26 AM, Chin Liang See wrote:
> > To enable configuration of sdr.ctrlcfg.extratime1 register which
> > enable
> > extra clocks for read to write command timing. This is critical to
> > ensure successful LPDDR2 interface
> > 
> > Signed-off-by: Chin Liang See 
> > ---
> >  arch/arm/mach-socfpga/include/mach/sdram.h | 8 +++-
> >  arch/arm/mach-socfpga/qts-filter.sh| 2 +-
> >  arch/arm/mach-socfpga/wrap_sdram_config.c  | 9 +
> >  drivers/ddr/altera/sdram.c | 3 +++
> >  4 files changed, 20 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/mach-socfpga/include/mach/sdram.h
> > b/arch/arm/mach-socfpga/include/mach/sdram.h
> > index f12bb84..b11228f 100644
> > --- a/arch/arm/mach-socfpga/include/mach/sdram.h
> > +++ b/arch/arm/mach-socfpga/include/mach/sdram.h
> > @@ -30,7 +30,8 @@ struct socfpga_sdr_ctrl {
> > u32 dram_timing4;   /* 0x10 */
> > u32 lowpwr_timing;
> > u32 dram_odt;
> > -   u32 __padding0[4];
> > +   u32 extratime1;
> > +   u32 __padding0[3];
> > u32 dram_addrw; /* 0x2c */
> > u32 dram_if_width;  /* 0x30 */
> > u32 dram_dev_width;
> > @@ -88,6 +89,7 @@ struct socfpga_sdram_config {
> > u32 dram_timing4;
> > u32 lowpwr_timing;
> > u32 dram_odt;
> > +   u32 extratime1;
> > u32 dram_addrw;
> > u32 dram_if_width;
> > u32 dram_dev_width;
> 
> This seems to be changing the DRAM register layout, is this really
> correct and was this really tested on AV SoCDK ?

Previously its treated unused register as default value is good enough.
But this not true anymore for LPDDR2 and we are exposing extratime1
register.

While for testing, I tested both CV and AV SoCDK few times as I also
worried even they are using DDR3 instead LPDDR2.

> 
> [...]
> 
> > diff --git a/arch/arm/mach-socfpga/wrap_sdram_config.c
> > b/arch/arm/mach-socfpga/wrap_sdram_config.c
> > index 31cc7de..d72f5e1 100644
> > --- a/arch/arm/mach-socfpga/wrap_sdram_config.c
> > +++ b/arch/arm/mach-socfpga/wrap_sdram_config.c
> > @@ -81,6 +81,15 @@ static const struct socfpga_sdram_config
> > sdram_config = {
> > SDR_CTRLGRP_DRAMODT_READ_LSB)   
> > |
> > (CONFIG_HPS_SDR_CTRLCFG_DRAMODT_WRITE <<
> > SDR_CTRLGRP_DRAMODT_WRITE_LSB),
> > +#ifdef
> > CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR
> 
> How come this is not always defined for all boards ?

This is to ensure it still works if users are using older SOCEDS
instead of SOCEDS 16.1. Besides that, this is only applicable for
LPDDR2. With that, patches #2 to #9 are not needed.

Thanks
Chin Liang

> 
> > +   .extratime1 =
> > +   (CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO
> > _WR <<
> > +   SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_LSB)
> > |
> > +   (CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO
> > _WR_BC <<
> > +   SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_BC_LSB) 
> > |
> > +(CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF
> > _CHIP <<
> > +   SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_DIFF_LSB),
> > +#endif
> > .dram_addrw =
> > (CONFIG_HPS_SDR_CTRLCFG_DRAMADDRW_COLBITS <<
> > SDR_CTRLGRP_DRAMADDRW_COLBITS_LSB)  
> > |
> > diff --git a/drivers/ddr/altera/sdram.c
> > b/drivers/ddr/altera/sdram.c
> > index 7e4606d..e74c5b0 100644
> > --- a/drivers/ddr/altera/sdram.c
> > +++ b/drivers/ddr/altera/sdram.c
> > @@ -418,6 +418,9 @@ static void sdr_load_regs(const struct
> > socfpga_sdram_config *cfg)
> >  
> > debug("Configuring DRAMODT\n");
> > writel(cfg->dram_odt, _ctrl->dram_odt);
> > +
> > +   debug("Configuring EXTRATIME1\n");
> > +   writel(cfg->extratime1, _ctrl->extratime1);
> >  }
> >  
> >  /**
> > 
> 
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6] spi: pl022_spi: Add support for ARM PL022 spi controller

2016-09-19 Thread Armando Visconti

Ciao Michael,

Did you test it?
It seems that all the platform related changes (pinmux, board file,
...) are there.

Pls let us know,
Armando

On 09/19/2016 01:59 PM, Michael Brandl wrote:

Ciao Armando,
Hi Jagan,

On Friday I found another driver implementation already on my desktop, by 
grepping for pl022 in the upper level ../, but it is more general and not easy 
to understand. But maybe it helps us to find the information we need.

This is how I started! Now as patchset based on u-boot-spi.git:


diff --git a/arch/arm/cpu/armv8/hisilicon/pinmux.c 
b/arch/arm/cpu/armv8/hisilicon/pinmux.c
index 3e4c9ce..83f02db 100644
--- a/arch/arm/cpu/armv8/hisilicon/pinmux.c
+++ b/arch/arm/cpu/armv8/hisilicon/pinmux.c
@@ -17,6 +17,24 @@ struct hi6220_pinmux0_regs *pmx0 =
 struct hi6220_pinmux1_regs *pmx1 =
(struct hi6220_pinmux1_regs *)HI6220_PINMUX1_BASE;

+static void hi6220_spi_config(int peripheral)
+{
+   switch (peripheral) {
+   case PERIPH_ID_SPI0:
+// at91_set_a_periph(AT91_PIO_PORTC, 0, 0);/* SPI0_MISO */
+// at91_set_a_periph(AT91_PIO_PORTC, 1, 0);/* SPI0_MOSI */
+// at91_set_a_periph(AT91_PIO_PORTC, 2, 0);/* SPI0_SPCK */
+   break;
+
+   case PERIPH_ID_SPI1:
+   break;
+
+   default:
+   debug("%s: invalid peripheral %d", __func__, peripheral);
+   return;
+   }
+}
+
 static void hi6220_uart_config(int peripheral)
 {
switch (peripheral) {
@@ -164,6 +182,9 @@ static int hi6220_mmc_config(int peripheral)
 int hi6220_pinmux_config(int peripheral)
 {
switch (peripheral) {
+   case PERIPH_ID_SPI0:
+   hi6220_spi_config(peripheral);
+   break;
case PERIPH_ID_UART0:
case PERIPH_ID_UART1:
case PERIPH_ID_UART2:
diff --git a/arch/arm/include/asm/arch-hi6220/hi6220.h 
b/arch/arm/include/asm/arch-hi6220/hi6220.h
index 3a12c75..1b73f42 100644
--- a/arch/arm/include/asm/arch-hi6220/hi6220.h
+++ b/arch/arm/include/asm/arch-hi6220/hi6220.h
@@ -19,6 +19,8 @@
 #define HI6220_PMUSSI_BASE 0xF800

 #define HI6220_PERI_BASE   0xF703
+/*Hi6220V100_Multi-Mode_Application_Processor_Function_Description on p.5-45*/
+#define HI6220_SPI_BASE0xF7106000

 struct peri_sc_periph_regs {
u32 ctrl1;  /*0x0*/
diff --git a/arch/arm/include/asm/arch-hi6220/periph.h 
b/arch/arm/include/asm/arch-hi6220/periph.h
index 7155f60..b58a0f7 100644
--- a/arch/arm/include/asm/arch-hi6220/periph.h
+++ b/arch/arm/include/asm/arch-hi6220/periph.h
@@ -25,6 +25,8 @@ enum periph_id {
PERIPH_ID_SDMMC1,

PERIPH_ID_NONE = -1,
+   PERIPH_ID_SPI0,
+   PERIPH_ID_SPI1,
 };

 #endif /* __ASM_ARM_ARCH_PERIPH_H */
diff --git a/board/hisilicon/hikey/hikey.c b/board/hisilicon/hikey/hikey.c
index 72d6334..e90ea74 100644
--- a/board/hisilicon/hikey/hikey.c
+++ b/board/hisilicon/hikey/hikey.c
@@ -21,6 +21,10 @@
 #include 
 #include 

+#ifdef CONFIG_PL022_SPI
+#include 
+#endif
+
 /*TODO drop this table in favour of device tree */
 static const struct hikey_gpio_platdata hi6220_gpio[] = {
{ 0, HI6220_GPIO_BASE(0)},
@@ -335,9 +339,46 @@ int misc_init_r(void)
 {
return 0;
 }
+#ifdef CONFIG_PL022_SPI
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+   return bus == 0 && cs == 0;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+// at91_set_pio_output(AT91_PIO_PORTC, 3, 0);
+   gpio_request(0, "PWR_HOLD_GPIO0_0");
+   gpio_direction_output(0, 1);
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+// at91_set_pio_output(AT91_PIO_PORTC, 3, 1);
+   gpio_request(0, "PWR_HOLD_GPIO0_0");
+   gpio_direction_output(0, 1);
+}
+
+static void hikey_spi0_hw_init(void)
+{
+   hi6220_pinmux_config(PERIPH_ID_SPI0);
+// at91_set_pio_output(AT91_PIO_PORTC, 3, 1);  /* SPI0_CS0 */
+   gpio_request(0, "PWR_HOLD_GPIO0_0");
+   gpio_direction_output(0, 1);
+
+   /* Enable clock */
+// at91_periph_clk_enable(ATMEL_ID_SPI0);
+/* from Kernel { HI6220_SPI_CLK, "spi_clk", "clk_150m", 
CLK_SET_RATE_PARENT|CLK_IGNORE_UNUSED, 0x230, 9,  0, }, */
+// hi6220_clk_enable(PERI_CLK0_SPI0, _sc->clk3_en);
+
+}
+#endif /* CONFIG_PL022_SPI */

 int board_init(void)
 {
+#ifdef CONFIG_PL022_SPI
+   hikey_spi0_hw_init();
+#endif
return 0;
 }

diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index b1d9e20..a509d93 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -6,6 +6,8 @@
 #

 # There are many options which enable SPI, so make this library available
+obj-$(CONFIG_PL022_SPI) += pl022_spi.o
+
 ifdef CONFIG_DM_SPI
 obj-y += spi-uclass.o
 obj-$(CONFIG_SANDBOX) += spi-emul-uclass.o
diff --git a/drivers/spi/pl022_spi.c b/drivers/spi/pl022_spi.c
index e69de29..e80fed3 100644
--- a/drivers/spi/pl022_spi.c
+++ b/drivers/spi/pl022_spi.c
@@ -0,0 +1,321 @@
+/*
+ * (C) 

[U-Boot] [FASTBOOT] increase envstr[] length from 32 to 64

2016-09-19 Thread Nicolas le bayon
Hi,

The following commit has been pushed in order to retrieve envrionment
variables for fastboot:
fastboot: allow retrieving fastboot variables from env
(74322201dde4593dc3194c702e95e5760e6b497a)

The file is drivers/usb/gadget/f_fastboot.c, function is cb_getvar

It uses à 32-char array (char envstr[32]), knowing that it should ends by
'\0', so it has 31 usable characters.

In my case, we use the variable: ‘fastboot.partition-type:userdata’, his
length is 32 characters, so this is a problem.

As information, this variable is used in the Android context, but we can
imagine to face this same issue with any framework.

Would it be possible to increase the length from 32 to 64 ?

Thanks in advance.
Best Regards
Nicolas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/9] ddr: altera: Configuring SDRAM extra cycles timing parameters

2016-09-19 Thread Marek Vasut
On 09/15/2016 09:26 AM, Chin Liang See wrote:
> To enable configuration of sdr.ctrlcfg.extratime1 register which enable
> extra clocks for read to write command timing. This is critical to
> ensure successful LPDDR2 interface
> 
> Signed-off-by: Chin Liang See 
> ---
>  arch/arm/mach-socfpga/include/mach/sdram.h | 8 +++-
>  arch/arm/mach-socfpga/qts-filter.sh| 2 +-
>  arch/arm/mach-socfpga/wrap_sdram_config.c  | 9 +
>  drivers/ddr/altera/sdram.c | 3 +++
>  4 files changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-socfpga/include/mach/sdram.h 
> b/arch/arm/mach-socfpga/include/mach/sdram.h
> index f12bb84..b11228f 100644
> --- a/arch/arm/mach-socfpga/include/mach/sdram.h
> +++ b/arch/arm/mach-socfpga/include/mach/sdram.h
> @@ -30,7 +30,8 @@ struct socfpga_sdr_ctrl {
>   u32 dram_timing4;   /* 0x10 */
>   u32 lowpwr_timing;
>   u32 dram_odt;
> - u32 __padding0[4];
> + u32 extratime1;
> + u32 __padding0[3];
>   u32 dram_addrw; /* 0x2c */
>   u32 dram_if_width;  /* 0x30 */
>   u32 dram_dev_width;
> @@ -88,6 +89,7 @@ struct socfpga_sdram_config {
>   u32 dram_timing4;
>   u32 lowpwr_timing;
>   u32 dram_odt;
> + u32 extratime1;
>   u32 dram_addrw;
>   u32 dram_if_width;
>   u32 dram_dev_width;

This seems to be changing the DRAM register layout, is this really
correct and was this really tested on AV SoCDK ?

[...]

> diff --git a/arch/arm/mach-socfpga/wrap_sdram_config.c 
> b/arch/arm/mach-socfpga/wrap_sdram_config.c
> index 31cc7de..d72f5e1 100644
> --- a/arch/arm/mach-socfpga/wrap_sdram_config.c
> +++ b/arch/arm/mach-socfpga/wrap_sdram_config.c
> @@ -81,6 +81,15 @@ static const struct socfpga_sdram_config sdram_config = {
>   SDR_CTRLGRP_DRAMODT_READ_LSB)   |
>   (CONFIG_HPS_SDR_CTRLCFG_DRAMODT_WRITE <<
>   SDR_CTRLGRP_DRAMODT_WRITE_LSB),
> +#ifdef CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR

How come this is not always defined for all boards ?

> + .extratime1 =
> + (CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR <<
> + SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_LSB)|
> + (CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC <<
> + SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_BC_LSB) |
> +(CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_CHIP <<
> + SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_DIFF_LSB),
> +#endif
>   .dram_addrw =
>   (CONFIG_HPS_SDR_CTRLCFG_DRAMADDRW_COLBITS <<
>   SDR_CTRLGRP_DRAMADDRW_COLBITS_LSB)  |
> diff --git a/drivers/ddr/altera/sdram.c b/drivers/ddr/altera/sdram.c
> index 7e4606d..e74c5b0 100644
> --- a/drivers/ddr/altera/sdram.c
> +++ b/drivers/ddr/altera/sdram.c
> @@ -418,6 +418,9 @@ static void sdr_load_regs(const struct 
> socfpga_sdram_config *cfg)
>  
>   debug("Configuring DRAMODT\n");
>   writel(cfg->dram_odt, _ctrl->dram_odt);
> +
> + debug("Configuring EXTRATIME1\n");
> + writel(cfg->extratime1, _ctrl->extratime1);
>  }
>  
>  /**
> 


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


Re: [U-Boot] [PATCH v6 2/2] armv8: fsl-layerscape: SMP support for loading 32-bit OS

2016-09-19 Thread Alexander Graf


On 09.09.16 10:44, Alison Wang wrote:
> Spin-table method is used for secondary cores to load 32-bit OS. The
> architecture information will be got through checking FIT image and
> saved in the os_arch element of spin-table, then the secondary cores
> will check os_arch and jump to 32-bit OS or 64-bit OS automatically.
> 
> Signed-off-by: Alison Wang 
> Signed-off-by: Chenhui Zhao 

No complains from my side, but this dives heavily into FSL specific
code. Also, I mention PSCI once more here ;).


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


Re: [U-Boot] [PATCH 3/9] arm: socfpga: mcvevk: Adding handoff for SDRAM ctrlcfg.extratime1

2016-09-19 Thread Marek Vasut
On 09/15/2016 09:27 AM, Chin Liang See wrote:
> Adding new handoff for SDRAM ctrcfg.extratime1 which is
> required for stabil LPDDR2 operation

Same comment as 2/9

> Signed-off-by: Chin Liang See 
> ---
>  board/denx/mcvevk/qts/sdram_config.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/board/denx/mcvevk/qts/sdram_config.h 
> b/board/denx/mcvevk/qts/sdram_config.h
> index 30c4d7d..0328850 100644
> --- a/board/denx/mcvevk/qts/sdram_config.h
> +++ b/board/denx/mcvevk/qts/sdram_config.h
> @@ -49,6 +49,9 @@
>  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TRTP  5
>  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_PWRDOWNEXIT   3
>  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_SELFRFSHEXIT  512
> +#define CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR 2
> +#define CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC 2
> +#define 
> CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_CHIP 2
>  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_INCSYNC   0
>  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_SYNCMODE  0
>  #define CONFIG_HPS_SDR_CTRLCFG_FPGAPORTRST   0x0
> 


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


Re: [U-Boot] [PATCH 4/9] arm: socfpga: socrates: Adding handoff for SDRAM ctrlcfg.extratime1

2016-09-19 Thread Marek Vasut
On 09/15/2016 09:27 AM, Chin Liang See wrote:
> Adding new handoff for SDRAM ctrcfg.extratime1 which is
> required for stabil LPDDR2 operation

Same comment as 2/9 applies to the rest

> Signed-off-by: Chin Liang See 
> ---
>  board/ebv/socrates/qts/sdram_config.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/board/ebv/socrates/qts/sdram_config.h 
> b/board/ebv/socrates/qts/sdram_config.h
> index cf9d1d3..a0cad51 100644
> --- a/board/ebv/socrates/qts/sdram_config.h
> +++ b/board/ebv/socrates/qts/sdram_config.h
> @@ -49,6 +49,9 @@
>  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TRTP  4
>  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_PWRDOWNEXIT   3
>  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_SELFRFSHEXIT  512
> +#define CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR 2
> +#define CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC 2
> +#define 
> CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_CHIP 2
>  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_INCSYNC   0
>  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_SYNCMODE  0
>  #define CONFIG_HPS_SDR_CTRLCFG_FPGAPORTRST   0x0
> 


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


Re: [U-Boot] [PATCH v6 1/2] armv8: Support loading 32-bit OS in AArch32 execution state

2016-09-19 Thread Alexander Graf


On 09.09.16 10:44, Alison Wang wrote:
> To support loading a 32-bit OS, the execution state will change from
> AArch64 to AArch32 when jumping to kernel.
> 
> The architecture information will be got through checking FIT image,
> then U-Boot will load 32-bit OS or 64-bit OS automatically.
> 
> Signed-off-by: Ebony Zhu 
> Signed-off-by: Alison Wang 
> Signed-off-by: Chenhui Zhao 

I still have a hard time wrapping my head around how this will look like
with PSCI support, but it's certainly a step into the right direction.

Reviewed-by: Alexander Graf 


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


Re: [U-Boot] [PATCH 2/9] arm: socfpga: Adding handoff for SDRAM ctrlcfg.extratime1

2016-09-19 Thread Marek Vasut
On 09/15/2016 09:27 AM, Chin Liang See wrote:
> Adding new handoff for SDRAM ctrcfg.extratime1 which is
> required for stabil LPDDR2 operation

... stable ...

Isn't SoCDK using DDR3 DRAM ?

> Signed-off-by: Chin Liang See 
> ---
>  board/altera/arria5-socdk/qts/sdram_config.h   | 3 +++
>  board/altera/cyclone5-socdk/qts/sdram_config.h | 3 +++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/board/altera/arria5-socdk/qts/sdram_config.h 
> b/board/altera/arria5-socdk/qts/sdram_config.h
> index e9fe60f..8964637 100644
> --- a/board/altera/arria5-socdk/qts/sdram_config.h
> +++ b/board/altera/arria5-socdk/qts/sdram_config.h
> @@ -49,6 +49,9 @@
>  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TRTP  4
>  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_PWRDOWNEXIT   3
>  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_SELFRFSHEXIT  512
> +#define CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR 2
> +#define CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC 2
> +#define 
> CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_CHIP 2
>  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_INCSYNC   0
>  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_SYNCMODE  0
>  #define CONFIG_HPS_SDR_CTRLCFG_FPGAPORTRST   0
> diff --git a/board/altera/cyclone5-socdk/qts/sdram_config.h 
> b/board/altera/cyclone5-socdk/qts/sdram_config.h
> index 37c1476..1bc6f6f 100644
> --- a/board/altera/cyclone5-socdk/qts/sdram_config.h
> +++ b/board/altera/cyclone5-socdk/qts/sdram_config.h
> @@ -49,6 +49,9 @@
>  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING3_TRTP  3
>  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_PWRDOWNEXIT   3
>  #define CONFIG_HPS_SDR_CTRLCFG_DRAMTIMING4_SELFRFSHEXIT  512
> +#define CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR 2
> +#define CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC 2
> +#define 
> CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_CHIP 2
>  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_INCSYNC   0
>  #define CONFIG_HPS_SDR_CTRLCFG_FIFOCFG_SYNCMODE  0
>  #define CONFIG_HPS_SDR_CTRLCFG_FPGAPORTRST   0
> 


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


  1   2   >