Re: [U-Boot] [PATCH] spi: kirkwood_spi: implement mvebu_spi_set_mode()

2016-10-17 Thread Stefan Roese

On 14.10.2016 05:19, Chris Packham wrote:

Set the appropriate bits in the interface config register based
on the SPI_ mode flags.

Signed-off-by: Chris Packham 


Reviewed-by: Stefan Roese 

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


Re: [U-Boot] [PATCH] common: env: add kconfig entry for env storage

2016-10-17 Thread Heiko Schocher

Hello Tom,

Am 18.10.2016 um 00:55 schrieb Tom Rini:

On Mon, Oct 17, 2016 at 04:17:06PM -0600, Simon Glass wrote:

Hi Peng,

On 8 October 2016 at 03:06, Peng Fan  wrote:

Add Kconfig entry for ENV storage

Signed-off-by: Peng Fan 
Cc: Simon Glass 
Cc: Heiko Schocher 
Cc: Tom Rini 
Cc: Masahiro Yamada 
Cc: Stefan Roese 
Cc: Siva Durga Prasad Paladugu 
Cc: Francois Retief 
---
  common/Kconfig | 73 ++
  1 file changed, 73 insertions(+)

diff --git a/common/Kconfig b/common/Kconfig
index c69c141..a630924 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -158,6 +158,79 @@ config SPI_BOOT

  endmenu

+menu "ENV storage media"
+
+config ENV_IS_IN_DATAFLASH
+   bool "env stored in dataflash"
+   help
+ env stored in dataflash


Can you add a little more help detail on this? Also I suspect we
should have CONFIG_ENV as well, to enable the actual environment
(independent of where it is stored).


Yes, please add a bit more to the text.


Also, can you migrate the existing configs with moveconfig? That would
be a big step forward and may inspire me to move it to linker lists.


Actually, I bet this is going to be messy enough that I'm fine running
the moveconfig myself right before I merge it in.


Feel free to give me the patch for running the tbot test [1], that the
patch does not change binaries ...

bye,
Heiko

[1] 
https://github.com/hsdenx/tbot/blob/master/src/tc/uboot/tc_uboot_check_kconfig.py
--
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


Re: [U-Boot] i2c: mxc: refactor i2c driver and support dm

2016-10-17 Thread Peng Fan
Hi Jagan,
On Mon, Oct 17, 2016 at 04:47:11PM +0530, Jagan Teki wrote:
>Hi Peng/all,
>
>Observed an issue while setting the bus on mxc_i2c driver
>addr = dev_get_addr(bus); is getting failed to get invalid address.
>
>Commit details:
>"i2c: mxc: refactor i2c driver and support dm"
>(sha1: 71204e95ce13228a0c742cce137c3238f64581d8)
>
>Log:
>icorem6qdl> i2c bus
>Bus 0:  i2c@021a
>Bus 1:  i2c@021a4000
>icorem6qdl> i2c dev 0
>Setting bus to 0
>cmd_i2c_set_bus_num: Trying bus 0
>mxc_i2c_probe
>0. mxc_i2c_probe
>dev_get_addr_index: OF_TRANSLATE
>dev_get_addr_index: i2c@021a - 0x
>cmd_i2c_set_bus_num: No bus 0
>Failure changing bus number (-19)
>
>Any help? did you tested on any board?

It works well on i.MX6ULL 14x14 EVK board.
"
=> i2c bus
Bus 0:  i2c@021a
Bus 1:  i2c@021a4000
=> i2c dev 0
Setting bus to 0
i2c bus 0 at 35258368, no gpio pinctrl state.
=> i2c probe
Valid chip addresses: 0E 1E
=> i2c dev 1
Setting bus to 1
i2c bus 1 at 35274752, no gpio pinctrl state.
=> i2c probe
Valid chip addresses: 1A
=> i2c bus
Bus 0:  i2c@021a  (active 0)
0e: generic_e, offset len 1, flags 0
1e: generic_1e, offset len 1, flags 0
Bus 1:  i2c@021a4000  (active 1)
1a: generic_1a, offset len 1, flags 0
"

Add alias, and have a try.
 aliases {
 i2c0 =
 i2c1 = 
 };


Regards,
Peng.

>
>thanks!
>-- 
>Jagan Teki
>Free Software Engineer | www.openedev.com
>U-Boot, Linux | Upstream Maintainer
>Hyderabad, India.
>___
>U-Boot mailing list
>U-Boot@lists.denx.de
>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] [ANN] U-Boot v2016.11-rc2 released

2016-10-17 Thread Heiko Schocher

Hello Tom,

Am 18.10.2016 um 02:15 schrieb Tom Rini:

Hey all,

It's release day and v2016.11-rc2 is out.  I've tried to clean up my
queue a bit, but I think there's still a few things I have outstanding.
And I know I need to get some changes from Alexander for EFI stuff that
I've already promised can come in.  But we should also be moving towards
release.

So I will be picking up some Kconfig related changes and making sure we
have no (unexplained) binary size changes.

A perhaps less obvious change between -rc1 and -rc2 is that I've added
test.py running for qemu-ppce500, qemu-x86, vexpress_ca15_tc2,
vexpres_ca9x5 and integratorap_cm926ejs along with qemu-mips*.

I plan on doing -rc3 on the 31st.


Thanks!

rc2 is working on

powerpc TQM5200 board
http://xeidos.ddns.net/tests/test_db_auslesen.php#132

am335x shc:
http://xeidos.ddns.net/tests/test_db_auslesen.php#135

at91 corvus and smartweb board:
(The automated build fails, as I apply local patches, one failed with
 rc2 ... fixed it, as similiar patch is now in mainline, so I had
 to start the builds manually for the 2 boards)
http://xeidos.ddns.net/tests/test_db_auslesen.php#137
http://xeidos.ddns.net/tests/test_db_auslesen.php#138

bye,
Heiko
--
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


Re: [U-Boot] [PATCH v3 04/12] arm: socfpga: clkmgr: Separate the Clock Manager for Stratix 10

2016-10-17 Thread Marek Vasut
On 10/18/2016 05:22 AM, Chin Liang See wrote:
> On Sen, 2016-10-17 at 18:14 +0200, Marek Vasut wrote:
>> On 10/17/2016 05:59 PM, Chin Liang See wrote:
>>>
>>> On Sen, 2016-10-17 at 17:39 +0200, Marek Vasut wrote:

 On 10/17/2016 05:28 PM, Chin Liang See wrote:
>
>
> On Sen, 2016-10-17 at 17:20 +0200, Marek Vasut wrote:
>>
>>
>> On 10/17/2016 05:07 PM, Chin Liang See wrote:
>>>
>>>
>>>
>>> On Sen, 2016-10-17 at 15:42 +0200, Marek Vasut wrote:



 On 10/17/2016 03:32 PM, See, Chin Liang wrote:
>
>
>
>
> On Min, 2016-10-16 at 17:33 +0200, Marek Vasut wrote:
>>
>>
>>
>>
>> On 10/13/2016 10:33 AM, Chin Liang See wrote:
>>>
>>>
>>>
>>>
>>>
>>> Separate the Clock Manager to support both GEN5 SoC
>>> and
>>> Stratix 10 SoC.
>>>
>>> Signed-off-by: Chin Liang See 
>>> Cc: Marek Vasut 
>>> Cc: Dinh Nguyen 
>>> Cc: Ley Foon Tan 
>>> Cc: Tien Fong Chee 
>>> ---
>>>  arch/arm/mach-socfpga/clock_manager.c | 8 
>>>  1 file changed, 8 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-socfpga/clock_manager.c
>>> b/arch/arm/mach-
>>> socfpga/clock_manager.c
>>> index aa71636..0d67b3c 100644
>>> --- a/arch/arm/mach-socfpga/clock_manager.c
>>> +++ b/arch/arm/mach-socfpga/clock_manager.c
>>> @@ -10,6 +10,7 @@
>>>
>>>  DECLARE_GLOBAL_DATA_PTR;
>>>
>>> +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>>>  static const struct socfpga_clock_manager
>>> *clock_manager_base
>>> =
>>>   (struct socfpga_clock_manager
>>> *)SOCFPGA_CLKMGR_ADDRESS;
>>>
>>> @@ -446,9 +447,11 @@ unsigned int
>>> cm_get_l4_sp_clk_hz(void)
>>>
>>>   return clock;
>>>  }
>>> +#endif /* CONFIG_TARGET_SOCFPGA_GEN5 */
>>>
>>>  unsigned int cm_get_mmc_controller_clk_hz(void)
>>>  {
>>> +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>>>   uint32_t reg, clock = 0;
>>>
>>>   /* identify the source of MMC clock */
>>> @@ -475,8 +478,12 @@ unsigned int
>>> cm_get_mmc_controller_clk_hz(void)
>>>   /* further divide by 4 as we have fixed
>>> divider
>>> at
>>> wrapper */
>>>   clock /= 4;
>>>   return clock;
>>> +#elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
>>> + return 2500;
>> Is this always gonna be the case or is this S10VP
>> specific ?
>>
>>>
>>>
>>>
>>>
>>>
>>> +#endif /* CONFIG_TARGET_SOCFPGA_GEN5 */
>>>  }
>>>
>>> +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>>>  unsigned int cm_get_qspi_controller_clk_hz(void)
>>>  {
>>>   uint32_t reg, clock = 0;
>>> @@ -556,3 +563,4 @@ U_BOOT_CMD(
>>>   "display clocks",
>>>   ""
>> Why does the clock display not work on S10 ? Are some
>> functions
>> missing?
> Not for SOCVP. But will be added in later stage when
> testing
> against
> emulation
 How hard would it be to add this missing functionality
 now ?

>>> That will take weeks as that need to be validated as whole
>>> in
>>> emulation
>>> platform.
>> You mean printing a few clock information based on some
>> values
>> from
>> registers would take weeks ? Why ?
>>
> Oh actually I am referring all the managers code such as full
> Clock
> Manager, Reset Manager ... plus testing. Testing is the part
> take
> some
> significant time especially slow when come to emulation.
 Just use empty functions for the clock init code (since it's not
 needed
 on the socvp) and populate the clock reporting functions. That
 should
 be
 simple, right ?
>>> Can be done but the value won't be meaningful as the register is
>>> uninitialzied. Unless we hardcode to a hard value which might not
>>> sound
>>> right.
>> Ha, I see. Is there some sane default for the SoCVP ?
>>
> 
> It will not meaningful as performance is same even with frequency
> change :) But definitely will address this in coming weeks as I am
> already working on the emulation. 

I understand that, but I believe it is still better to provide some
sensible value rather than just ifdef the whole code out.

-- 
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 v3 1/8] x86: Add implementations of setjmp() and longjmp()

2016-10-17 Thread Bin Meng
On Tue, Oct 18, 2016 at 11:02 AM, Bin Meng  wrote:
> On Tue, Oct 18, 2016 at 10:29 AM, Simon Glass  wrote:
>> Bring in these functions from Linux v4.4. They will be needed for EFI loader
>> support.
>>
>> Signed-off-by: Simon Glass 
>> ---
>>
>> Changes in v3:
>> - Add a parameter to longjmp()
>> - Drop unused header files
>>
>> Changes in v2:
>> - Drop irrelevant comment
>> - Add a comment about .size
>> - Drop unnecessary .text directive
>> - Make longjmp() always cause setjmp() to return 1
>>
>>  arch/x86/cpu/Makefile |  2 +-
>>  arch/x86/cpu/setjmp.S | 61 
>> +++
>>  arch/x86/include/asm/setjmp.h | 24 +
>>  3 files changed, 86 insertions(+), 1 deletion(-)
>>  create mode 100644 arch/x86/cpu/setjmp.S
>>  create mode 100644 arch/x86/include/asm/setjmp.h
>>
>
> Reviewed-by: Bin Meng 

Checked patchwork record, looks Alex has applied v2 series patch#2,
#3, #6 into his efi-next tree
(https://github.com/agraf/u-boot/tree/efi-next)

I will only pick up this v3 patch#1 via u-boot-x86 tree, while leaving
other patches in v3 to Alex to handle.

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/8] x86: Add implementations of setjmp() and longjmp()

2016-10-17 Thread Bin Meng
On Tue, Oct 18, 2016 at 10:29 AM, Simon Glass  wrote:
> Bring in these functions from Linux v4.4. They will be needed for EFI loader
> support.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v3:
> - Add a parameter to longjmp()
> - Drop unused header files
>
> Changes in v2:
> - Drop irrelevant comment
> - Add a comment about .size
> - Drop unnecessary .text directive
> - Make longjmp() always cause setjmp() to return 1
>
>  arch/x86/cpu/Makefile |  2 +-
>  arch/x86/cpu/setjmp.S | 61 
> +++
>  arch/x86/include/asm/setjmp.h | 24 +
>  3 files changed, 86 insertions(+), 1 deletion(-)
>  create mode 100644 arch/x86/cpu/setjmp.S
>  create mode 100644 arch/x86/include/asm/setjmp.h
>

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


Re: [U-Boot] [PATCH v3 4/8] x86: Tidy up selection of building the EFI stub

2016-10-17 Thread Bin Meng
On Tue, Oct 18, 2016 at 10:29 AM, Simon Glass  wrote:
> At present we use a CONFIG option in efi.h to determine whether we are
> building the EFI stub or not. This means that the same header cannot be
> used for EFI_LOADER support. The CONFIG option will be enabled for the
> whole build, even when not building the stub.
>
> Use a different define instead, set up just for the files that make up the
> stub.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v3: None
> Changes in v2:
> - Add new patch to tidy up selection of building the EFI stub
>
>  include/efi.h| 7 +--
>  lib/efi/Makefile | 4 ++--
>  2 files changed, 7 insertions(+), 4 deletions(-)
>

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


Re: [U-Boot] [PATCH v3 7/8] x86: efi: Add a hello world test program

2016-10-17 Thread Bin Meng
On Tue, Oct 18, 2016 at 10:29 AM, Simon Glass  wrote:
> It is useful to have a basic sanity check for EFI loader support. Add a
> 'bootefi hello' command which loads HelloWord.efi and runs it under U-Boot.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v3:
> - Include a link to the program instead of adding it to the tree
>
> Changes in v2: None
>
>  arch/x86/lib/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>

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


Re: [U-Boot] [PATCH v6 01/10] x86: Move table csum into separate header

2016-10-17 Thread Bin Meng
On Fri, Aug 19, 2016 at 7:23 AM, Alexander Graf  wrote:
> We need the checksum function without all the other table functionality
> soon, so let's split it out into its own header file.
>
> Signed-off-by: Alexander Graf 
> Reviewed-by: Bin Meng 
> Reviewed-by: Simon Glass 
> ---
>  arch/x86/include/asm/tables.h |  2 ++
>  arch/x86/lib/tables.c | 12 
>  include/tables_csum.h | 22 ++
>  3 files changed, 24 insertions(+), 12 deletions(-)
>  create mode 100644 include/tables_csum.h
>

I see on patchwork, this patch was assigned to me, so I will pick up
this patch via u-boot-x86 tree.

applied to u-boot-x86, thanks!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] qemu-x86 issues

2016-10-17 Thread Bin Meng
Hi Tom,

On Sat, Oct 15, 2016 at 7:32 AM, Tom Rini  wrote:
> Hey guys,
>
> After making Stephen's scripts work with qemu today, I've started
> testing out what platforms I can test out via qemu.  I've found two
> problems with qemu-x86.  First, there's a real problem with the network.
> I run qemu with "-nographic -cpu qemu32 -netdev
> user,id=net0,tftp=/tftpboot -device e1000,netdev=net0" so that I can
> tftpboot things in and I'm getting crc32 mismatches.
>

I just tried QEMU v2.6.1 with u-boot.rom built from the master head,
but did not see such issue.

> Second, the sleep command is not at all accurate.  It's returning the 3
> second test in less than 1 second.

Typical emulation target issue :) Did you see similar issue on other
QEMU platform with U-Boot?

>
> Any ideas, or places I should try poking to solve these issues?  I'm
> going to kludge around this for now by disabling these tests locally.
> Thanks!
>

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


[U-Boot] [PATCH v3 8/8] x86: Enable EFI loader support

2016-10-17 Thread Simon Glass
Enable this so that EFI applications (notably grub) can be run under U-Boot
on x86 platforms.

Signed-off-by: Simon Glass 
Reviewed-by: Bin Meng 
---

Changes in v3: None
Changes in v2:
- Remove EFI support from README.x86 TODO list

 configs/efi-x86_defconfig | 1 +
 doc/README.x86| 1 -
 lib/efi_loader/Kconfig| 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configs/efi-x86_defconfig b/configs/efi-x86_defconfig
index b31c73b..1fe6142 100644
--- a/configs/efi-x86_defconfig
+++ b/configs/efi-x86_defconfig
@@ -34,3 +34,4 @@ CONFIG_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_EFI=y
+# CONFIG_EFI_LOADER is not set
diff --git a/doc/README.x86 b/doc/README.x86
index 6799559..a38cc1b 100644
--- a/doc/README.x86
+++ b/doc/README.x86
@@ -1077,7 +1077,6 @@ TODO List
 -
 - Audio
 - Chrome OS verified boot
-- Support for CONFIG_EFI_LOADER
 - Building U-Boot to run in 64-bit mode
 
 References
diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
index 37a0dd6..8e7e8a5 100644
--- a/lib/efi_loader/Kconfig
+++ b/lib/efi_loader/Kconfig
@@ -1,6 +1,6 @@
 config EFI_LOADER
bool "Support running EFI Applications in U-Boot"
-   depends on (ARM64 || ARM) && OF_LIBFDT
+   depends on (ARM64 || ARM || X86) && OF_LIBFDT
default y
help
  Select this option if you want to run EFI applications (like grub2)
-- 
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 v3 7/8] x86: efi: Add a hello world test program

2016-10-17 Thread Simon Glass
It is useful to have a basic sanity check for EFI loader support. Add a
'bootefi hello' command which loads HelloWord.efi and runs it under U-Boot.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Include a link to the program instead of adding it to the tree

Changes in v2: None

 arch/x86/lib/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index e46e7f1..1d9ebc0 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-y  += cmd_boot.o
 obj-$(CONFIG_SEABIOS) += coreboot_table.o
 obj-$(CONFIG_EFI) += efi/
+obj-$(CONFIG_CMD_BOOTEFI_HELLO) += HelloWorld32.o
 obj-y  += e820.o
 obj-y  += gcc.o
 obj-y  += init_helpers.o
-- 
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 v3 6/8] x86: efi: Add EFI loader support for x86

2016-10-17 Thread Simon Glass
Add the required pieces to support the EFI loader on x86.

Since U-Boot only builds for 32-bit on x86, only a 32-bit EFI application
is supported. If a 64-bit kernel must be booted, U-Boot supports this
directly using FIT (see doc/uImage.FIT/kernel.its). U-Boot can act as a
payload for both 32-bit and 64-bit EFI.

Signed-off-by: Simon Glass 
Reviewed-by: Bin Meng 
---

Changes in v3: None
Changes in v2: None

 arch/x86/cpu/u-boot.lds   | 36 +++-
 arch/x86/lib/Makefile |  1 +
 arch/x86/lib/sections.c   | 12 
 lib/efi_loader/efi_boottime.c |  9 +
 lib/efi_loader/efi_runtime.c  |  4 
 5 files changed, 61 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/lib/sections.c

diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds
index 36f59ea..cca536b 100644
--- a/arch/x86/cpu/u-boot.lds
+++ b/arch/x86/cpu/u-boot.lds
@@ -28,7 +28,10 @@ SECTIONS
}
 
. = ALIGN(4);
-   .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
+   .rodata : {
+   *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
+   KEEP(*(.rodata.efi.init));
+   }
 
. = ALIGN(4);
.data : { *(.data*) }
@@ -40,6 +43,37 @@ SECTIONS
.got : { *(.got*) }
 
. = ALIGN(4);
+
+   .__efi_runtime_start : {
+   *(.__efi_runtime_start)
+   }
+
+   .efi_runtime : {
+   *(efi_runtime_text)
+   *(efi_runtime_data)
+   }
+
+   .__efi_runtime_stop : {
+   *(.__efi_runtime_stop)
+   }
+
+   .efi_runtime_rel_start :
+   {
+   *(.__efi_runtime_rel_start)
+   }
+
+   .efi_runtime_rel : {
+   *(.relefi_runtime_text)
+   *(.relefi_runtime_data)
+   }
+
+   .efi_runtime_rel_stop :
+   {
+   *(.__efi_runtime_rel_stop)
+   }
+
+   . = ALIGN(4);
+
__data_end = .;
__init_end = .;
 
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index e17f0bb..e46e7f1 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -28,6 +28,7 @@ obj-y += pirq_routing.o
 obj-y  += relocate.o
 obj-y += physmem.o
 obj-$(CONFIG_X86_RAMTEST) += ramtest.o
+obj-y  += sections.o
 obj-y += sfi.o
 obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += smbios.o
 obj-y  += string.o
diff --git a/arch/x86/lib/sections.c b/arch/x86/lib/sections.c
new file mode 100644
index 000..6455e0f
--- /dev/null
+++ b/arch/x86/lib/sections.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright 2013 Albert ARIBAUD 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+char __efi_runtime_start[0] __attribute__((section(".__efi_runtime_start")));
+char __efi_runtime_stop[0] __attribute__((section(".__efi_runtime_stop")));
+char __efi_runtime_rel_start[0]
+   __attribute__((section(".__efi_runtime_rel_start")));
+char __efi_runtime_rel_stop[0]
+   __attribute__((section(".__efi_runtime_rel_stop")));
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 01a9b8f..d16fb4e 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -39,6 +39,7 @@ static bool efi_is_direct_boot = true;
  */
 static struct efi_configuration_table EFI_RUNTIME_DATA efi_conf_table[1];
 
+#ifdef CONFIG_ARM
 /*
  * The "gd" pointer lives in a register on ARM and AArch64 that we declare
  * fixed when compiling U-Boot. However, the payload does not know about that
@@ -46,16 +47,20 @@ static struct efi_configuration_table EFI_RUNTIME_DATA 
efi_conf_table[1];
  * EFI callback entry/exit.
  */
 static volatile void *efi_gd, *app_gd;
+#endif
 
 /* Called from do_bootefi_exec() */
 void efi_save_gd(void)
 {
+#ifdef CONFIG_ARM
efi_gd = gd;
+#endif
 }
 
 /* Called on every callback entry */
 void efi_restore_gd(void)
 {
+#ifdef CONFIG_ARM
/* Only restore if we're already in EFI context */
if (!efi_gd)
return;
@@ -63,12 +68,16 @@ void efi_restore_gd(void)
if (gd != efi_gd)
app_gd = gd;
gd = efi_gd;
+#endif
 }
 
 /* Called on every callback exit */
 efi_status_t efi_exit_func(efi_status_t ret)
 {
+#ifdef CONFIG_ARM
gd = app_gd;
+#endif
+
return ret;
 }
 
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index 99b5ef1..3793471 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -34,6 +34,10 @@ static efi_status_t EFI_RUNTIME_TEXT EFIAPI 
efi_invalid_parameter(void);
 #elif defined(CONFIG_ARM)
 #define R_RELATIVE 23
 #define R_MASK 0xffULL
+#elif defined(CONFIG_X86)
+#include 
+#define R_RELATIVE R_386_RELATIVE
+#define R_MASK 0xffULL
 #else
 #error Need to add relocation awareness
 #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 v3 5/8] arm: efi: Add a hello world test program

2016-10-17 Thread Simon Glass
It is useful to have a basic sanity check for EFI loader support. Add a
'bootefi hello' command which loads HelloWord.efi and runs it under U-Boot.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Include a link to the program instead of adding it to the tree
- Fix several typos
- Align backslashes to the same column

Changes in v2: None

 arch/arm/lib/Makefile  |  7 +++
 cmd/Kconfig|  9 +
 cmd/bootefi.c  | 26 --
 doc/README.efi | 22 ++
 include/asm-generic/sections.h |  2 ++
 scripts/Makefile.lib   | 19 +++
 6 files changed, 79 insertions(+), 6 deletions(-)

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index caa62c6..64378e1 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -30,6 +30,13 @@ obj-$(CONFIG_CMD_BOOTI) += bootm.o
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-$(CONFIG_CMD_BOOTZ) += bootm.o zimage.o
 obj-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
+ifdef CONFIG_ARM64
+# This option does not work for arm64, as there is no binary.
+# TODO(s...@chromium.org): Add this once it is possible to build one
+obj-$(CONFIG_CMD_BOOTEFI_HELLO) += HelloWorld64.o
+else
+obj-$(CONFIG_CMD_BOOTEFI_HELLO) += HelloWorld32.o
+endif
 obj-$(CONFIG_USE_ARCH_MEMSET) += memset.o
 obj-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
 else
diff --git a/cmd/Kconfig b/cmd/Kconfig
index e339d86..a5d030b 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -181,6 +181,15 @@ config CMD_BOOTEFI
help
  Boot an EFI image from memory.
 
+config CMD_BOOTEFI_HELLO
+   bool "Allow booting a standard EFI hello world for testing"
+   depends on CMD_BOOTEFI
+   help
+ This adds a standard EFI hello world application to U-Boot so that
+ it can be used with the 'bootefi hello' command. This is useful
+ for testing that EFI is working at a basic level, and for bringing
+ up EFI support on a new architecture.
+
 config CMD_ELF
bool "bootelf, bootvx"
default y
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 7b2e0b5..7c2d9fc 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -230,13 +230,22 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv[])
 
if (argc < 2)
return CMD_RET_USAGE;
-   saddr = argv[1];
+#ifdef CONFIG_CMD_BOOTEFI_HELLO
+   if (!strcmp(argv[1], "hello")) {
+   addr = CONFIG_SYS_LOAD_ADDR;
+   memcpy((char *)addr, __efi_hello_world_begin,
+  __efi_hello_world_end - __efi_hello_world_begin);
+   } else
+#endif
+   {
+   saddr = argv[1];
 
-   addr = simple_strtoul(saddr, NULL, 16);
+   addr = simple_strtoul(saddr, NULL, 16);
 
-   if (argc > 2) {
-   sfdt = argv[2];
-   fdt_addr = simple_strtoul(sfdt, NULL, 16);
+   if (argc > 2) {
+   sfdt = argv[2];
+   fdt_addr = simple_strtoul(sfdt, NULL, 16);
+   }
}
 
printf("## Starting EFI application at 0x%08lx ...\n", addr);
@@ -254,7 +263,12 @@ static char bootefi_help_text[] =
" [fdt address]\n"
"  - boot EFI payload stored at address .\n"
"If specified, the device tree located at  gets\n"
-   "exposed as EFI configuration table.\n";
+   "exposed as EFI configuration table.\n"
+#ifdef CONFIG_CMD_BOOTEFI_HELLO
+   "hello\n"
+   "  - boot a sample Hello World application stored within U-Boot"
+#endif
+   ;
 #endif
 
 U_BOOT_CMD(
diff --git a/doc/README.efi b/doc/README.efi
index 1fd3f00..6e76310 100644
--- a/doc/README.efi
+++ b/doc/README.efi
@@ -310,6 +310,28 @@ Removable media booting (search for 
/efi/boot/boota{a64,arm}.efi) is supported.
 Simple use cases like "Plug this SD card into my ARM device and it just
 boots into grub which boots into Linux", work very well.
 
+
+Running HelloWord.efi
+-
+
+You can run a simple 'hello world' EFI program in U-Boot. This is not
+distributed in the U-Boot source, but you can download this patch:
+
+   https://goo.gl/vihiZS
+
+Then apply it, e.g.:
+
+   $ git am ~/Downloads/0001-efi-Add-test-program-binaries.patch
+
+and enable the option CONFIG_CMD_BOOTEFI_HELLO
+
+Then you can boot into U-Boot and type:
+
+   > bootefi hello
+
+The 'hello world EFI' program will then run, print a message and exit.
+
+
 Future work
 ---
 
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index d69bc60..daf021b 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -22,6 +22,8 @@ extern char __kprobes_text_start[], __kprobes_text_end[];
 extern char __entry_text_start[], __entry_text_end[];
 extern char __initdata_begin[], __initdata_end[];
 extern char __start_rodata[], __end_rodata[];
+extern char __efi_hello_world_begin[];
+extern char 

[U-Boot] [PATCH v3 4/8] x86: Tidy up selection of building the EFI stub

2016-10-17 Thread Simon Glass
At present we use a CONFIG option in efi.h to determine whether we are
building the EFI stub or not. This means that the same header cannot be
used for EFI_LOADER support. The CONFIG option will be enabled for the
whole build, even when not building the stub.

Use a different define instead, set up just for the files that make up the
stub.

Signed-off-by: Simon Glass 
---

Changes in v3: None
Changes in v2:
- Add new patch to tidy up selection of building the EFI stub

 include/efi.h| 7 +--
 lib/efi/Makefile | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/efi.h b/include/efi.h
index d07187c..3d58780 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -30,8 +30,11 @@ struct efi_device_path;
 
 #define EFI_BITS_PER_LONG  BITS_PER_LONG
 
-/* With 64-bit EFI stub, EFI_BITS_PER_LONG has to be 64 */
-#ifdef CONFIG_EFI_STUB_64BIT
+/*
+ * With 64-bit EFI stub, EFI_BITS_PER_LONG has to be 64. EFI_STUB is set
+ * in lib/efi/Makefile, when building the stub.
+ */
+#if defined(CONFIG_EFI_STUB_64BIT) && defined(EFI_STUB)
 #undef EFI_BITS_PER_LONG
 #define EFI_BITS_PER_LONG  64
 #endif
diff --git a/lib/efi/Makefile b/lib/efi/Makefile
index e32dc14..9449600 100644
--- a/lib/efi/Makefile
+++ b/lib/efi/Makefile
@@ -9,9 +9,9 @@ obj-$(CONFIG_EFI_STUB) += efi_info.o
 
 CFLAGS_REMOVE_efi_stub.o := -mregparm=3 \
$(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32)
-CFLAGS_efi_stub.o := -fpic -fshort-wchar
+CFLAGS_efi_stub.o := -fpic -fshort-wchar -DEFI_STUB
 CFLAGS_REMOVE_efi.o := -mregparm=3 \
$(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32)
-CFLAGS_efi.o := -fpic -fshort-wchar
+CFLAGS_efi.o := -fpic -fshort-wchar -DEFI_STUB
 
 extra-$(CONFIG_EFI_STUB) += efi_stub.o efi.o
-- 
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 v3 3/8] efi: Fix missing EFIAPI specifiers

2016-10-17 Thread Simon Glass
These are missing in some functions. Add them to keep things consistent.

Signed-off-by: Simon Glass 
Reviewed-by: Bin Meng 
Reviewed-by: Alexander Graf 
---

Changes in v3: None
Changes in v2: None

 cmd/bootefi.c |  7 +--
 include/efi_loader.h  |  2 +-
 lib/efi_loader/efi_boottime.c |  5 +++--
 lib/efi_loader/efi_disk.c | 13 +++--
 lib/efi_loader/efi_net.c  |  4 ++--
 5 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 21fe42c..7b2e0b5 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -15,6 +15,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -52,7 +54,7 @@ static struct efi_device_path_file_path bootefi_device_path[] 
= {
}
 };
 
-static efi_status_t bootefi_open_dp(void *handle, efi_guid_t *protocol,
+static efi_status_t EFIAPI bootefi_open_dp(void *handle, efi_guid_t *protocol,
void **protocol_interface, void *agent_handle,
void *controller_handle, uint32_t attributes)
 {
@@ -145,7 +147,8 @@ static void *copy_fdt(void *fdt)
  */
 static unsigned long do_bootefi_exec(void *efi, void *fdt)
 {
-   ulong (*entry)(void *image_handle, struct efi_system_table *st);
+   ulong (*entry)(void *image_handle, struct efi_system_table *st)
+   asmlinkage;
ulong fdt_pages, fdt_size, fdt_start, fdt_end;
bootm_headers_t img = { 0 };
 
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 9738835..aa4ae0e 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -93,7 +93,7 @@ void efi_net_set_dhcp_ack(void *pkt, int len);
  * Stub implementation for a protocol opener that just returns the handle as
  * interface
  */
-efi_status_t efi_return_handle(void *handle,
+efi_status_t EFIAPI efi_return_handle(void *handle,
efi_guid_t *protocol, void **protocol_interface,
void *agent_handle, void *controller_handle,
uint32_t attributes);
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 792db39..01a9b8f 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -159,7 +159,7 @@ static struct {
u32 trigger_time;
u64 trigger_next;
unsigned long notify_tpl;
-   void (*notify_function) (void *event, void *context);
+   void (EFIAPI *notify_function) (void *event, void *context);
void *notify_context;
 } efi_event = {
/* Disable timers on bootup */
@@ -168,7 +168,8 @@ static struct {
 
 static efi_status_t EFIAPI efi_create_event(
enum efi_event_type type, ulong notify_tpl,
-   void (*notify_function) (void *event, void *context),
+   void (EFIAPI *notify_function) (void *event,
+   void *context),
void *notify_context, void **event)
 {
EFI_ENTRY("%d, 0x%lx, %p, %p", type, notify_tpl, notify_function,
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index d8ddcc9..1e3dca4 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -35,9 +35,10 @@ struct efi_disk_obj {
const struct blk_desc *desc;
 };
 
-static efi_status_t efi_disk_open_block(void *handle, efi_guid_t *protocol,
-   void **protocol_interface, void *agent_handle,
-   void *controller_handle, uint32_t attributes)
+static efi_status_t EFIAPI efi_disk_open_block(void *handle,
+   efi_guid_t *protocol, void **protocol_interface,
+   void *agent_handle, void *controller_handle,
+   uint32_t attributes)
 {
struct efi_disk_obj *diskobj = handle;
 
@@ -46,7 +47,7 @@ static efi_status_t efi_disk_open_block(void *handle, 
efi_guid_t *protocol,
return EFI_SUCCESS;
 }
 
-static efi_status_t efi_disk_open_dp(void *handle, efi_guid_t *protocol,
+static efi_status_t EFIAPI efi_disk_open_dp(void *handle, efi_guid_t *protocol,
void **protocol_interface, void *agent_handle,
void *controller_handle, uint32_t attributes)
 {
@@ -108,7 +109,7 @@ static efi_status_t EFIAPI efi_disk_rw_blocks(struct 
efi_block_io *this,
return EFI_EXIT(EFI_SUCCESS);
 }
 
-static efi_status_t efi_disk_read_blocks(struct efi_block_io *this,
+static efi_status_t EFIAPI efi_disk_read_blocks(struct efi_block_io *this,
u32 media_id, u64 lba, unsigned long buffer_size,
void *buffer)
 {
@@ -143,7 +144,7 @@ static efi_status_t efi_disk_read_blocks(struct 
efi_block_io *this,
return EFI_EXIT(r);
 }
 
-static efi_status_t efi_disk_write_blocks(struct efi_block_io *this,
+static efi_status_t EFIAPI efi_disk_write_blocks(struct efi_block_io *this,

[U-Boot] [PATCH v3 2/8] efi: Use asmlinkage for EFIAPI

2016-10-17 Thread Simon Glass
This is required for x86 and is also correct for ARM (since it is empty).

Signed-off-by: Simon Glass 
Reviewed-by: Bin Meng 
---

Changes in v3: None
Changes in v2:
- Move efi.h changes to a new patch

 arch/avr32/include/asm/linkage.h  | 0
 arch/m68k/include/asm/linkage.h   | 0
 arch/microblaze/include/asm/linkage.h | 0
 arch/mips/include/asm/linkage.h   | 0
 arch/nios2/include/asm/linkage.h  | 0
 arch/openrisc/include/asm/linkage.h   | 0
 arch/sandbox/include/asm/linkage.h| 0
 arch/sh/include/asm/linkage.h | 0
 arch/sparc/include/asm/linkage.h  | 0
 include/efi.h | 3 ++-
 10 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 arch/avr32/include/asm/linkage.h
 create mode 100644 arch/m68k/include/asm/linkage.h
 create mode 100644 arch/microblaze/include/asm/linkage.h
 create mode 100644 arch/mips/include/asm/linkage.h
 create mode 100644 arch/nios2/include/asm/linkage.h
 create mode 100644 arch/openrisc/include/asm/linkage.h
 create mode 100644 arch/sandbox/include/asm/linkage.h
 create mode 100644 arch/sh/include/asm/linkage.h
 create mode 100644 arch/sparc/include/asm/linkage.h

diff --git a/arch/avr32/include/asm/linkage.h b/arch/avr32/include/asm/linkage.h
new file mode 100644
index 000..e69de29
diff --git a/arch/m68k/include/asm/linkage.h b/arch/m68k/include/asm/linkage.h
new file mode 100644
index 000..e69de29
diff --git a/arch/microblaze/include/asm/linkage.h 
b/arch/microblaze/include/asm/linkage.h
new file mode 100644
index 000..e69de29
diff --git a/arch/mips/include/asm/linkage.h b/arch/mips/include/asm/linkage.h
new file mode 100644
index 000..e69de29
diff --git a/arch/nios2/include/asm/linkage.h b/arch/nios2/include/asm/linkage.h
new file mode 100644
index 000..e69de29
diff --git a/arch/openrisc/include/asm/linkage.h 
b/arch/openrisc/include/asm/linkage.h
new file mode 100644
index 000..e69de29
diff --git a/arch/sandbox/include/asm/linkage.h 
b/arch/sandbox/include/asm/linkage.h
new file mode 100644
index 000..e69de29
diff --git a/arch/sh/include/asm/linkage.h b/arch/sh/include/asm/linkage.h
new file mode 100644
index 000..e69de29
diff --git a/arch/sparc/include/asm/linkage.h b/arch/sparc/include/asm/linkage.h
new file mode 100644
index 000..e69de29
diff --git a/include/efi.h b/include/efi.h
index 5a3b8cf..d07187c 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -15,6 +15,7 @@
 #ifndef _EFI_H
 #define _EFI_H
 
+#include 
 #include 
 #include 
 
@@ -22,7 +23,7 @@
 /* EFI uses the Microsoft ABI which is not the default for GCC */
 #define EFIAPI __attribute__((ms_abi))
 #else
-#define EFIAPI
+#define EFIAPI asmlinkage
 #endif
 
 struct efi_device_path;
-- 
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 v3 1/8] x86: Add implementations of setjmp() and longjmp()

2016-10-17 Thread Simon Glass
Bring in these functions from Linux v4.4. They will be needed for EFI loader
support.

Signed-off-by: Simon Glass 
---

Changes in v3:
- Add a parameter to longjmp()
- Drop unused header files

Changes in v2:
- Drop irrelevant comment
- Add a comment about .size
- Drop unnecessary .text directive
- Make longjmp() always cause setjmp() to return 1

 arch/x86/cpu/Makefile |  2 +-
 arch/x86/cpu/setjmp.S | 61 +++
 arch/x86/include/asm/setjmp.h | 24 +
 3 files changed, 86 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/cpu/setjmp.S
 create mode 100644 arch/x86/include/asm/setjmp.h

diff --git a/arch/x86/cpu/Makefile b/arch/x86/cpu/Makefile
index 2667e0b..f5b8c9e 100644
--- a/arch/x86/cpu/Makefile
+++ b/arch/x86/cpu/Makefile
@@ -10,7 +10,7 @@
 
 extra-y= start.o
 obj-$(CONFIG_X86_RESET_VECTOR) += resetvec.o start16.o
-obj-y  += interrupts.o cpu.o cpu_x86.o call64.o
+obj-y  += interrupts.o cpu.o cpu_x86.o call64.o setjmp.o
 
 AFLAGS_REMOVE_call32.o := -mregparm=3 \
$(if $(CONFIG_EFI_STUB_64BIT),-march=i386 -m32)
diff --git a/arch/x86/cpu/setjmp.S b/arch/x86/cpu/setjmp.S
new file mode 100644
index 000..2ea1c6c
--- /dev/null
+++ b/arch/x86/cpu/setjmp.S
@@ -0,0 +1,61 @@
+/*
+ * Written by H. Peter Anvin 
+ * Brought in from Linux v4.4 and modified for U-Boot
+ * From Linux arch/um/sys-i386/setjmp.S
+ *
+ * SPDX-License-Identifier:GPL-2.0
+ */
+
+#define _REGPARM
+
+/*
+ * The jmp_buf is assumed to contain the following, in order:
+ * %ebx
+ * %esp
+ * %ebp
+ * %esi
+ * %edi
+ * 
+ */
+
+   .text
+   .align 4
+   .globl setjmp
+   .type setjmp, @function
+setjmp:
+#ifdef _REGPARM
+   movl %eax, %edx
+#else
+   movl 4(%esp), %edx
+#endif
+   popl %ecx   /* Return address, and adjust the stack */
+   xorl %eax, %eax /* Return value */
+   movl %ebx, (%edx)
+   movl %esp, 4(%edx)  /* Post-return %esp! */
+   pushl %ecx  /* Make the call/return stack happy */
+   movl %ebp, 8(%edx)
+   movl %esi, 12(%edx)
+   movl %edi, 16(%edx)
+   movl %ecx, 20(%edx) /* Return address */
+   ret
+
+   /* Provide function size if needed */
+   .size setjmp, .-setjmp
+
+   .align 4
+   .globl longjmp
+   .type longjmp, @function
+longjmp:
+#ifdef _REGPARM
+   xchgl %eax, %edx
+#else
+   movl 4(%esp), %edx  /* jmp_ptr address */
+#endif
+   movl (%edx), %ebx
+   movl 4(%edx), %esp
+   movl 8(%edx), %ebp
+   movl 12(%edx), %esi
+   movl 16(%edx), %edi
+   jmp *20(%edx)
+
+   .size longjmp, .-longjmp
diff --git a/arch/x86/include/asm/setjmp.h b/arch/x86/include/asm/setjmp.h
new file mode 100644
index 000..1feaa89
--- /dev/null
+++ b/arch/x86/include/asm/setjmp.h
@@ -0,0 +1,24 @@
+/*
+ * Written by H. Peter Anvin 
+ * Brought in from Linux v4.4 and modified for U-Boot
+ * From Linux arch/um/sys-i386/setjmp.S
+ *
+ * SPDX-License-Identifier:GPL-2.0
+ */
+
+#ifndef __setjmp_h
+#define __setjmp_h
+
+struct jmp_buf_data {
+   unsigned int __ebx;
+   unsigned int __esp;
+   unsigned int __ebp;
+   unsigned int __esi;
+   unsigned int __edi;
+   unsigned int __eip;
+};
+
+int setjmp(struct jmp_buf_data *jmp_buf);
+void longjmp(struct jmp_buf_data *jmp_buf, int val);
+
+#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 v4 29/29] Convert CONFIG_SYS_STDIO_DEREGISTER to Kconfig

2016-10-17 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 
---

Changes in v4:
- Rebase to master

Changes in v3: None
Changes in v2:
- Make CONFIG_SYS_STDIO_DEREGISTER the default if USB_KEYBOARD
- Drop Kconfig changes

 common/Kconfig  | 9 +
 common/stdio.c  | 6 +++---
 common/usb_kbd.c| 2 +-
 configs/MPC8610HPCD_defconfig   | 1 +
 configs/MPC8641HPCN_36BIT_defconfig | 1 +
 configs/MPC8641HPCN_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 -
 24 files changed, 18 insertions(+), 27 deletions(-)

diff --git a/common/Kconfig b/common/Kconfig
index e0bc1bb..0a3e114 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -336,6 +336,15 @@ 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"
+   default y if USB_KEYBOARD
+   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 ab9b05d..8e4a9be 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
 
@@ -245,7 +245,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;
@@ -292,7 +292,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 b/common/usb_kbd.c
index a9872a6..5f9a64a 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -570,7 +570,7 @@ int drv_usb_kbd_init(void)
 /* Deregister the keyboard. */
 int usb_kbd_deregister(int force)
 {
-#ifdef CONFIG_SYS_STDIO_DEREGISTER
+#if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
struct stdio_dev *dev;
struct usb_device *usb_kbd_dev;
struct usb_kbd_pdata *data;
diff --git a/configs/MPC8610HPCD_defconfig b/configs/MPC8610HPCD_defconfig
index 2c03ba2..1ff4fdb 100644
--- a/configs/MPC8610HPCD_defconfig
+++ b/configs/MPC8610HPCD_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_MPC8610HPCD=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
diff --git a/configs/MPC8641HPCN_36BIT_defconfig 
b/configs/MPC8641HPCN_36BIT_defconfig
index 0c3d60b..dafdf58 100644
--- a/configs/MPC8641HPCN_36BIT_defconfig
+++ b/configs/MPC8641HPCN_36BIT_defconfig
@@ -6,6 +6,7 @@ CONFIG_PHYS_64BIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
diff --git a/configs/MPC8641HPCN_defconfig b/configs/MPC8641HPCN_defconfig
index d2250ec..1f7ceb3 100644
--- a/configs/MPC8641HPCN_defconfig
+++ b/configs/MPC8641HPCN_defconfig
@@ -5,6 +5,7 @@ CONFIG_TARGET_MPC8641HPCN=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=10
+CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_USB=y
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 19f38e1..43c028e 100644
--- 

[U-Boot] [PATCH v4 28/29] Convert CONFIG_USB_KEYBOARD to Kconfig

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_USB_KEYBOARD

Signed-off-by: Simon Glass 
---

Changes in v4: None
Changes in v3: None
Changes in v2:
- Add new patch to convert CONFIG_USB_KEYBOARD to Kconfig

 configs/Cyrus_P5020_defconfig   | 1 +
 configs/Cyrus_P5040_defconfig   | 1 +
 configs/MIP405_defconfig| 1 +
 configs/PIP405_defconfig| 1 +
 configs/VCMA9_defconfig | 1 +
 configs/at91rm9200ek_defconfig  | 1 +
 configs/at91rm9200ek_ram_defconfig  | 1 +
 configs/bayleybay_defconfig | 1 +
 configs/cgtqmx6eval_defconfig   | 1 +
 configs/chromebook_link_defconfig   | 1 +
 configs/chromebook_samus_defconfig  | 1 +
 configs/chromebox_panther_defconfig | 1 +
 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/dfi-bt700-q7x-151_defconfig | 1 +
 configs/dms-ba16-1g_defconfig   | 1 +
 configs/dms-ba16_defconfig  | 1 +
 configs/efi-x86_defconfig   | 1 +
 configs/galileo_defconfig   | 1 +
 configs/gwventana_defconfig | 1 +
 configs/minnowmax_defconfig | 1 +
 configs/mx6cuboxi_defconfig | 1 +
 configs/mx6qsabrelite_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/novena_defconfig| 1 +
 configs/qemu-x86_defconfig  | 1 +
 configs/qemu-x86_efi_payload32_defconfig| 1 +
 configs/qemu-x86_efi_payload64_defconfig| 1 +
 configs/rpi_2_defconfig | 1 +
 configs/rpi_3_32b_defconfig | 1 +
 configs/rpi_3_defconfig | 1 +
 configs/rpi_defconfig   | 1 +
 configs/seaboard_defconfig  | 1 +
 configs/smdk2410_defconfig  | 1 +
 configs/som-db5800-som-6867_defconfig   | 1 +
 configs/tbs2910_defconfig   | 1 +
 configs/theadorable-x86-dfi-bt700_defconfig | 1 +
 configs/ventana_defconfig   | 1 +
 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/advantech_dms-ba16.h| 1 -
 include/configs/at91rm9200ek.h  | 1 -
 include/configs/cgtqmx6eval.h   | 1 -
 include/configs/cyrus.h | 1 -
 include/configs/ge_bx50v3.h | 1 -
 include/configs/gw_ventana.h| 1 -
 include/configs/mx6cuboxi.h | 1 -
 include/configs/nitrogen6x.h| 1 -
 include/configs/novena.h| 1 -
 include/configs/rpi.h   | 1 -
 include/configs/seaboard.h  | 1 -
 include/configs/smdk2410.h  | 1 -
 include/configs/tbs2910.h   | 1 -
 include/configs/ventana.h   | 1 -
 include/configs/x86-common.h| 1 -
 66 files changed, 46 insertions(+), 20 deletions(-)

diff --git a/configs/Cyrus_P5020_defconfig b/configs/Cyrus_P5020_defconfig
index 6495440..5eb56602 100644
--- a/configs/Cyrus_P5020_defconfig
+++ b/configs/Cyrus_P5020_defconfig
@@ -26,4 +26,5 @@ CONFIG_SYS_NS16550=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_USB_KEYBOARD=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/Cyrus_P5040_defconfig b/configs/Cyrus_P5040_defconfig
index 4566abb..e33340b 100644
--- a/configs/Cyrus_P5040_defconfig
+++ b/configs/Cyrus_P5040_defconfig
@@ -26,4 +26,5 @@ CONFIG_SYS_NS16550=y
 CONFIG_FSL_ESPI=y
 

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

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_LCD

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 

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

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 ef4015c..7642615 100644
--- a/README
+++ b/README
@@ -3529,9 +3529,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 13a59c5..dd85b2d 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -309,6 +309,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 

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

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_CONSOLE_SCROLL_LINES

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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|  5 -
 include/lcd_console.h   |  3 ---
 scripts/config_whitelist.txt|  1 -
 43 files changed, 33 insertions(+), 30 deletions(-)

diff --git a/README b/README
index 1140ccb..0257c80 100644
--- a/README
+++ b/README
@@ -1692,12 +1692,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 e163250..21b0135 100644
--- a/configs/bayleybay_defconfig
+++ b/configs/bayleybay_defconfig
@@ -60,4 +60,5 @@ CONFIG_VIDEO_VESA=y
 CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_11A=y
 CONFIG_CFB_CONSOLE=y
+CONFIG_CONSOLE_SCROLL_LINES=5
 CONFIG_USE_PRIVATE_LIBGCC=y
diff --git a/configs/chromebook_jerry_defconfig 
b/configs/chromebook_jerry_defconfig
index b3c6970..8b2f53f 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 6f2fe2a..da251a1 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_VIDEO_IVYBRIDGE_IGD=y
 CONFIG_CFB_CONSOLE=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 1822970..7e9857e 100644
--- a/configs/chromebook_samus_defconfig
+++ 

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

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_ENV_OVERWRITE

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 0257c80..ef4015c 100644
--- a/README
+++ b/README
@@ -3532,9 +3532,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 24f..13a59c5 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -309,6 +309,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 5d31112..246ba00 100644
--- a/configs/socfpga_arria5_defconfig
+++ b/configs/socfpga_arria5_defconfig
@@ -6,6 +6,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_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
diff --git a/configs/socfpga_cyclone5_defconfig 
b/configs/socfpga_cyclone5_defconfig
index c930acc..bc550e5 100644
--- a/configs/socfpga_cyclone5_defconfig
+++ b/configs/socfpga_cyclone5_defconfig
@@ -6,6 +6,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_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
diff --git a/configs/socfpga_de0_nano_soc_defconfig 
b/configs/socfpga_de0_nano_soc_defconfig
index 402d9fb..140ac4d 100644
--- a/configs/socfpga_de0_nano_soc_defconfig
+++ b/configs/socfpga_de0_nano_soc_defconfig
@@ -6,6 +6,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_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
diff --git a/configs/socfpga_is1_defconfig b/configs/socfpga_is1_defconfig
index cc0313c..6a50f5b 100644
--- a/configs/socfpga_is1_defconfig
+++ b/configs/socfpga_is1_defconfig
@@ -6,6 +6,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_DISPLAY_BOARDINFO is not set
 CONFIG_SPL=y
diff --git a/configs/socfpga_mcvevk_defconfig b/configs/socfpga_mcvevk_defconfig
index 2462f66..cc0938d 100644
--- a/configs/socfpga_mcvevk_defconfig
+++ b/configs/socfpga_mcvevk_defconfig
@@ -6,6 +6,7 @@ CONFIG_SPL_STACK_R_ADDR=0x0080
 

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

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_INFO_QUIET

Signed-off-by: Simon Glass 
---

Changes in v4: None
Changes in v3: None
Changes in v2:
- Make CONFIG_SYS_CONSOLE_INFO_QUIET the default if !CONFIG_MUX

 README  | 3 ---
 common/Kconfig  | 9 +
 configs/MIP405T_defconfig   | 1 +
 configs/MIP405_defconfig| 1 +
 configs/PIP405_defconfig| 1 +
 configs/bayleybay_defconfig | 1 +
 configs/brppt1_mmc_defconfig| 1 +
 configs/brppt1_nand_defconfig   | 1 +
 configs/brppt1_spi_defconfig| 1 +
 configs/brxre1_defconfig| 1 +
 configs/chromebook_link_defconfig   | 1 +
 configs/chromebook_samus_defconfig  | 1 +
 configs/chromebox_panther_defconfig | 1 +
 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/dfi-bt700-q7x-151_defconfig | 1 +
 configs/ea20_defconfig  | 1 +
 configs/efi-x86_defconfig   | 1 +
 configs/galileo_defconfig   | 1 +
 configs/icon_defconfig  | 1 +
 configs/lwmon5_defconfig| 1 +
 configs/minnowmax_defconfig | 1 +
 configs/pxm2_defconfig  | 1 +
 configs/qemu-x86_defconfig  | 1 +
 configs/qemu-x86_efi_payload32_defconfig| 1 +
 configs/qemu-x86_efi_payload64_defconfig| 1 +
 configs/rut_defconfig   | 1 +
 configs/som-db5800-som-6867_defconfig   | 1 +
 configs/theadorable-x86-dfi-bt700_defconfig | 1 +
 configs/theadorable_debug_defconfig | 1 +
 configs/theadorable_defconfig   | 1 +
 include/configs/10m50_devboard.h| 1 -
 include/configs/3c120_devboard.h| 1 -
 include/configs/CPCI2DP.h   | 2 --
 include/configs/CPCI4052.h  | 2 +-
 include/configs/M5249EVB.h  | 1 -
 include/configs/MIP405.h| 1 -
 include/configs/MigoR.h | 2 --
 include/configs/PIP405.h| 1 -
 include/configs/PLU405.h| 2 --
 include/configs/PMC405DE.h  | 1 -
 include/configs/VOM405.h| 2 --
 include/configs/a3m071.h| 2 --
 include/configs/amcc-common.h   | 1 -
 include/configs/amcore.h| 1 -
 include/configs/ap325rxa.h  | 1 -
 include/configs/ap_sh4a_4a.h| 1 -
 include/configs/armadillo-800eva.h  | 1 -
 include/configs/bur_cfg_common.h| 1 -
 include/configs/clearfog.h  | 1 -
 include/configs/db-88f6720.h| 1 -
 include/configs/db-88f6820-amc.h| 1 -
 include/configs/db-88f6820-gp.h | 1 -
 include/configs/db-mv784mp-gp.h | 1 -
 include/configs/ea20.h  | 1 -
 include/configs/ecovec.h| 1 -
 include/configs/hrcon.h | 2 --
 include/configs/kzm9g.h | 1 -
 include/configs/lsxl.h  | 1 -
 include/configs/lwmon5.h| 2 --
 include/configs/maxbcm.h| 1 -
 include/configs/ms7722se.h  | 1 -
 include/configs/mvebu_db-88f3720.h  | 1 -
 include/configs/mvebu_db-88f7040.h  | 1 -
 include/configs/odroid.h| 1 -
 include/configs/openrisc-generic.h  | 1 -
 include/configs/origen.h| 1 -
 include/configs/r0p7734.h   | 1 -
 include/configs/rcar-gen2-common.h  | 1 -
 include/configs/rcar-gen3-common.h  | 1 -
 include/configs/s5pc210_universal.h | 1 -
 include/configs/sh7752evb.h | 1 -
 

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

2016-10-17 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 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 configs/Chuwi_V7_CW0825_defconfig   |  1 +
 configs/MSI_Primo81_defconfig   |  1 +
 configs/bayleybay_defconfig |  1 +
 configs/chromebook_link_defconfig   |  1 +
 configs/chromebox_panther_defconfig |  1 +
 configs/conga-qeval20-qa3-e3845-internal-uart_defconfig |  1 +
 configs/conga-qeval20-qa3-e3845_defconfig   |  1 +
 configs/crownbay_defconfig  |  1 +
 configs/dfi-bt700-q7x-151_defconfig |  1 +
 configs/minnowmax_defconfig |  1 +
 configs/qemu-x86_defconfig  |  1 +
 configs/qemu-x86_efi_payload32_defconfig|  1 +
 configs/qemu-x86_efi_payload64_defconfig|  1 +
 configs/som-db5800-som-6867_defconfig   |  1 +
 configs/theadorable-x86-dfi-bt700_defconfig |  1 +
 configs/theadorable_debug_defconfig |  1 +
 configs/theadorable_defconfig   |  1 +
 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/ac14xx.h|  4 
 include/configs/advantech_dms-ba16.h|  1 -
 include/configs/aria.h  |  4 
 include/configs/aristainetos-common.h   |  1 -
 include/configs/cgtqmx6eval.h   |  1 -
 include/configs/cm_fx6.h|  1 -
 include/configs/colibri_imx7.h  |  1 -
 include/configs/controlcenterd.h|  1 -
 include/configs/digsy_mtc.h |  1 -
 include/configs/ea20.h  |  1 -
 include/configs/embestmx6boards.h   |  1 -
 include/configs/ge_bx50v3.h |  1 -
 include/configs/gw_ventana.h|  1 -
 include/configs/icon.h  |  1 -
 include/configs/imx31_phycore.h |  1 -
 include/configs/ipek01.h|  1 -
 include/configs/ls1021aqds.h|  1 -
 include/configs/ls1021atwr.h|  1 -
 include/configs/lwmon5.h|  1 -
 include/configs/m53evk.h|  1 -
 include/configs/mcx.h   |  1 -
 include/configs/mpc5121ads.h|  1 -
 include/configs/mt_ventoux.h|  1 -
 include/configs/mx51evk.h   |  1 -
 include/configs/mx53loco.h  |  1 -
 include/configs/mx6cuboxi.h |  1 -
 include/configs/mx6sabre_common.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/nitrogen6x.h|  1 -
 include/configs/novena.h|  1 -
 include/configs/pdm360ng.h  |  1 -
 include/configs/pxm2.h  |  1 -
 include/configs/rut.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/theadorable.h   |  1 -
 include/configs/wandboard.h  

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

2016-10-17 Thread Simon Glass
This is not used in U-Boot. Drop it.

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 include/configs/edminiv2.h | 1 -
 include/configs/km/km_arm.h| 1 -
 include/configs/mv-common.h| 1 -
 include/configs/mvebu_db-88f3720.h | 1 -
 include/configs/mvebu_db-88f7040.h | 1 -
 scripts/config_whitelist.txt   | 1 -
 6 files changed, 6 deletions(-)

diff --git a/include/configs/edminiv2.h b/include/configs/edminiv2.h
index 1671438..af7b470 100644
--- a/include/configs/edminiv2.h
+++ b/include/configs/edminiv2.h
@@ -208,7 +208,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_NR_DRAM_BANKS   1
diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
index c55c5d2..98aec7c 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_NR_DRAM_BANKS   4
diff --git a/include/configs/mv-common.h b/include/configs/mv-common.h
index 73e9a03..b28030c 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/include/configs/mvebu_db-88f3720.h 
b/include/configs/mvebu_db-88f3720.h
index e785f24..7a50c4e 100644
--- a/include/configs/mvebu_db-88f3720.h
+++ b/include/configs/mvebu_db-88f3720.h
@@ -51,7 +51,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_BOARD_EARLY_INIT_F  /* call board_init_f for early inits */
 #define CONFIG_SYS_LOAD_ADDR   0x0080  /* default load adr- 8M */
diff --git a/include/configs/mvebu_db-88f7040.h 
b/include/configs/mvebu_db-88f7040.h
index cfb0191..709098f 100644
--- a/include/configs/mvebu_db-88f7040.h
+++ b/include/configs/mvebu_db-88f7040.h
@@ -54,7 +54,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_BOARD_EARLY_INIT_F  /* call board_init_f for early inits */
 #define CONFIG_SYS_LOAD_ADDR   0x0080  /* default load adr- 8M */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index ce5f34e..fbf1b3c 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -671,7 +671,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 v4 21/29] video: Move video_get_info_str() prototype to a header file

2016-10-17 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 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 1795464..7558234 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 3c110fa..a6edb6d 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 v4 20/29] Convert CONFIG_CONSOLE_EXTRA_INFO to Kconfig

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_CONSOLE_EXTRA_INFO

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 ddc5c36..1d72a74 100644
--- a/configs/MIP405T_defconfig
+++ b/configs/MIP405T_defconfig
@@ -15,4 +15,5 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_FAT=y
 CONFIG_SYS_NS16550=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_VIDEO_CT69000=y
diff --git a/configs/MIP405_defconfig b/configs/MIP405_defconfig
index 2610899..91d5db8 100644
--- a/configs/MIP405_defconfig
+++ b/configs/MIP405_defconfig
@@ -18,4 +18,5 @@ CONFIG_CMD_FAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_VIDEO_CT69000=y
diff --git a/configs/MiniFAP_defconfig b/configs/MiniFAP_defconfig
index 31602ab..e426cd1 100644
--- a/configs/MiniFAP_defconfig
+++ b/configs/MiniFAP_defconfig
@@ -20,4 +20,5 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/PIP405_defconfig b/configs/PIP405_defconfig
index 73ed894..939c58f 100644
--- a/configs/PIP405_defconfig
+++ b/configs/PIP405_defconfig
@@ -18,4 +18,5 @@ CONFIG_CMD_FAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=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 cdba626..085e4f2 100644
--- a/configs/TQM5200_B_HIGHBOOT_defconfig
+++ b/configs/TQM5200_B_HIGHBOOT_defconfig
@@ -20,4 +20,5 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/TQM5200_B_defconfig b/configs/TQM5200_B_defconfig
index ddd356b..54ae558 100644
--- a/configs/TQM5200_B_defconfig
+++ b/configs/TQM5200_B_defconfig
@@ -20,4 +20,5 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/TQM5200_STK100_defconfig b/configs/TQM5200_STK100_defconfig
index 541a37a..5ee99e3 100644
--- a/configs/TQM5200_STK100_defconfig
+++ b/configs/TQM5200_STK100_defconfig
@@ -20,4 +20,5 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/TQM5200_defconfig b/configs/TQM5200_defconfig
index 1d31439..faf5802 100644
--- a/configs/TQM5200_defconfig
+++ b/configs/TQM5200_defconfig
@@ -19,4 +19,5 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/charon_defconfig b/configs/charon_defconfig
index a7e60b7..5c8b949 100644
--- a/configs/charon_defconfig
+++ b/configs/charon_defconfig
@@ -19,4 +19,5 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/icon_defconfig b/configs/icon_defconfig
index 78a9a76..e415ac5 100644
--- a/configs/icon_defconfig
+++ b/configs/icon_defconfig
@@ -19,4 +19,5 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_SYS_NS16550=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/ipek01_defconfig b/configs/ipek01_defconfig
index ee36fab..d81d95c 100644
--- a/configs/ipek01_defconfig
+++ b/configs/ipek01_defconfig
@@ -14,4 +14,5 @@ CONFIG_CMD_MII=y
 CONFIG_CMD_FAT=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/lwmon5_defconfig b/configs/lwmon5_defconfig
index a2259b4..0282d28 100644
--- a/configs/lwmon5_defconfig
+++ b/configs/lwmon5_defconfig
@@ -21,4 +21,5 @@ CONFIG_CMD_FAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_CONSOLE_EXTRA_INFO=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/socrates_defconfig 

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

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_VIDEO_SW_CURSOR

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 -
 scripts/config_whitelist.txt  |  1 -
 33 files changed, 10 insertions(+), 38 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 42db0ad..7cb73a0 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -503,6 +503,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 0fc3131..257fa47 100644
--- a/include/configs/MIP405.h
+++ b/include/configs/MIP405.h
@@ -344,7 +344,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 949b807..13d6aa2 100644
--- a/include/configs/MPC8536DS.h
+++ b/include/configs/MPC8536DS.h
@@ -506,7 +506,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 0e90783..1de22d8 100644
--- a/include/configs/MPC8544DS.h
+++ b/include/configs/MPC8544DS.h
@@ -278,7 +278,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 034940a..102c261 100644
--- a/include/configs/MPC8572DS.h
+++ b/include/configs/MPC8572DS.h
@@ -465,7 +465,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 bd2e57e..5981755 100644
--- a/include/configs/MPC8610HPCD.h
+++ b/include/configs/MPC8610HPCD.h
@@ -24,7 +24,6 @@
 #ifdef CONFIG_FSL_DIU_FB
 #define CONFIG_SYS_DIU_ADDR(CONFIG_SYS_CCSRBAR + 0x2c000)
 #define CONFIG_CMD_BMP
-#define 

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

2016-10-17 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 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 f585705..1140ccb 100644
--- a/README
+++ b/README
@@ -1623,7 +1623,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 7cb73a0..42db0ad 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -503,16 +503,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;
+  

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

2016-10-17 Thread Simon Glass
This is not used anywhere in U-Boot.

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 951d021..d6dd436 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -40,7 +40,6 @@ obj-$(CONFIG_VIDEO_BCM2835) += bcm2835.o
 obj-$(CONFIG_VIDEO_COREBOOT) += coreboot.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] [PATCH v4 15/29] video: Drop the sed13806 driver

2016-10-17 Thread Simon Glass
This is not used in U-Boot.

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 8925837..f585705 100644
--- a/README
+++ b/README
@@ -1614,11 +1614,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 2d5f607..db34904 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -50,7 +50,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 ();
-}

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

2016-10-17 Thread Simon Glass
This is not used in U-Boot.

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 */
-   }
-  

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

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_BG_COL
   CONFIG_SYS_CONSOLE_FG_COL

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 7443b9f..b528abd 100644
--- a/README
+++ b/README
@@ -770,11 +770,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 ffdfcfe..76ea361 100644
--- a/configs/pxm2_defconfig
+++ b/configs/pxm2_defconfig
@@ -61,3 +61,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Siemens AG"
 CONFIG_G_DNL_VENDOR_NUM=0x0908
 CONFIG_G_DNL_PRODUCT_NUM=0x02d2
+CONFIG_SYS_CONSOLE_BG_COL=0xff
+CONFIG_SYS_CONSOLE_FG_COL=0x00
diff --git a/configs/rut_defconfig b/configs/rut_defconfig
index a6a4bb9..8811eb2 100644
--- a/configs/rut_defconfig
+++ b/configs/rut_defconfig
@@ -61,3 +61,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="Siemens AG"
 CONFIG_G_DNL_VENDOR_NUM=0x0908
 CONFIG_G_DNL_PRODUCT_NUM=0x02d2
+CONFIG_SYS_CONSOLE_BG_COL=0xff
+CONFIG_SYS_CONSOLE_FG_COL=0x00
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 47b82f4..3249275 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -520,4 +520,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 = 

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

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_VIDEO

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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

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

2016-10-17 Thread Simon Glass
This is not used in U-Boot.

Signed-off-by: Simon Glass 
Acked-by: Minkyu Kang 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 d6dd436..2d5f607 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -49,7 +49,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 bea3e69..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,
- 

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

2016-10-17 Thread Simon Glass
This is not used in U-Boot anymore.

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 b528abd..8925837 100644
--- a/README
+++ b/README
@@ -1614,12 +1614,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 4a42417..951d021 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -54,7 +54,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 

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

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_CFB_CONSOLE_ANSI

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 b4dc217..5996598 100644
--- a/README
+++ b/README
@@ -770,10 +770,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 e40fe49..a644929 100644
--- a/configs/T1042D4RDB_NAND_defconfig
+++ b/configs/T1042D4RDB_NAND_defconfig
@@ -38,4 +38,5 @@ CONFIG_SYS_NS16550=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_CFB_CONSOLE_ANSI=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/T1042D4RDB_SDCARD_defconfig 
b/configs/T1042D4RDB_SDCARD_defconfig
index 2665b05..ebd0990 100644
--- a/configs/T1042D4RDB_SDCARD_defconfig
+++ b/configs/T1042D4RDB_SDCARD_defconfig
@@ -38,4 +38,5 @@ CONFIG_SYS_NS16550=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=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 1d2548b..54a8b5f 100644
--- a/configs/T1042D4RDB_SECURE_BOOT_defconfig
+++ b/configs/T1042D4RDB_SECURE_BOOT_defconfig
@@ -31,6 +31,7 @@ CONFIG_SYS_NS16550=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=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 611881f..a0920bb 100644
--- a/configs/T1042D4RDB_SPIFLASH_defconfig
+++ b/configs/T1042D4RDB_SPIFLASH_defconfig
@@ -39,4 +39,5 @@ CONFIG_SYS_NS16550=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_CFB_CONSOLE_ANSI=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/T1042D4RDB_defconfig b/configs/T1042D4RDB_defconfig
index 7f172cd..35284df 100644
--- a/configs/T1042D4RDB_defconfig
+++ b/configs/T1042D4RDB_defconfig
@@ -29,4 +29,5 @@ CONFIG_SYS_NS16550=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=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 c80db93..e885816 100644
--- a/configs/T1042RDB_PI_NAND_SECURE_BOOT_defconfig
+++ b/configs/T1042RDB_PI_NAND_SECURE_BOOT_defconfig
@@ -42,6 +42,7 @@ CONFIG_SYS_NS16550=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=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 cebe3c9..67ae007 100644
--- a/configs/T1042RDB_PI_NAND_defconfig
+++ b/configs/T1042RDB_PI_NAND_defconfig
@@ -38,4 +38,5 @@ CONFIG_SYS_NS16550=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=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 433c856..87d2a29 100644
--- a/configs/T1042RDB_PI_SDCARD_defconfig
+++ b/configs/T1042RDB_PI_SDCARD_defconfig
@@ -38,4 +38,5 @@ CONFIG_SYS_NS16550=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=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 6c3ba81..b28b46c 100644
--- a/configs/T1042RDB_PI_SPIFLASH_defconfig
+++ 

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

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_CFB_CONSOLE

Signed-off-by: Simon Glass 
---

Changes in v4: None
Changes in v3:
- Change CONFIG_CFB_CONSOLE to default y if CONFIG_VIDEO

Changes in v2: None

 README| 39 -
 configs/eb_cpu5282_defconfig  |  1 +
 configs/eb_cpu5282_internal_defconfig |  1 +
 drivers/video/Kconfig | 41 +++
 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/ac14xx.h  |  1 -
 include/configs/advantech_dms-ba16.h  |  1 -
 include/configs/aria.h|  1 -
 include/configs/aristainetos-common.h |  1 -
 include/configs/cgtqmx6eval.h |  1 -
 include/configs/chromebook_samus.h|  2 --
 include/configs/cm_fx6.h  |  1 -
 include/configs/colibri_imx7.h|  1 -
 include/configs/controlcenterd.h  |  1 -
 include/configs/digsy_mtc.h   |  1 -
 include/configs/ea20.h|  1 -
 include/configs/embestmx6boards.h |  1 -
 include/configs/ge_bx50v3.h   |  1 -
 include/configs/gw_ventana.h  |  1 -
 include/configs/icon.h|  1 -
 include/configs/imx31_phycore.h   |  1 -
 include/configs/ipek01.h  |  1 -
 include/configs/ls1021aqds.h  |  1 -
 include/configs/ls1021atwr.h  |  1 -
 include/configs/lwmon5.h  |  1 -
 include/configs/m53evk.h  |  1 -
 include/configs/mcx.h |  1 -
 include/configs/mpc5121ads.h  |  1 -
 include/configs/mt_ventoux.h  |  1 -
 include/configs/mx51evk.h |  1 -
 include/configs/mx53loco.h|  1 -
 include/configs/mx6cuboxi.h   |  1 -
 include/configs/mx6sabre_common.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/nitrogen6x.h  |  1 -
 include/configs/nokia_rx51.h  |  1 -
 include/configs/novena.h  |  1 -
 include/configs/pdm360ng.h|  1 -
 include/configs/pxm2.h|  1 -
 include/configs/rut.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/theadorable.h |  1 -
 include/configs/wandboard.h   |  1 -
 scripts/config_whitelist.txt  |  1 -
 62 files changed, 43 insertions(+), 99 deletions(-)

diff --git a/README b/README
index e1ac6e3..b4dc217 100644
--- a/README
+++ b/README
@@ -770,49 +770,10 @@ The following options need to be configured:
port routines must be defined elsewhere
(i.e. serial_init(), serial_getc(), ...)
 
-   CONFIG_CFB_CONSOLE
-   Enables console device for a color framebuffer. Needs following
-   defines (cf. smiLynxEM, i8042)
-   VIDEO_FB_LITTLE_ENDIAN  graphic memory organisation
-   (default big endian)
-   VIDEO_HW_RECTFILL   graphic chip supports
-   rectangle fill
-   (cf. smiLynxEM)
-   VIDEO_HW_BITBLT graphic chip supports
-   bit-blit (cf. smiLynxEM)
-   VIDEO_VISIBLE_COLS  visible pixel columns
-   (cols=pitch)
-   VIDEO_VISIBLE_ROWS  visible pixel rows
-   VIDEO_PIXEL_SIZEbytes per pixel
-   VIDEO_DATA_FORMAT   graphic data format
-   (0-5, cf. cfb_console.c)
-   VIDEO_FB_ADRS   framebuffer address
-   VIDEO_KBD_INIT_FCT  keyboard int fct
-   (i.e. rx51_kp_init())
-   VIDEO_TSTC_FCT  test char fct
-   (i.e. rx51_kp_tstc)
-   VIDEO_GETC_FCT  get char fct
-   (i.e. rx51_kp_getc)
-

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

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

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 31dbba7..d5b7348 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""
@@ -114,7 +114,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 a0e9076..3401f66 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 6c3d98b..8090200 100644
--- a/include/configs/cgtqmx6eval.h
+++ b/include/configs/cgtqmx6eval.h
@@ -128,7 +128,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
 
@@ -140,7 +140,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"   
\

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

2016-10-17 Thread Simon Glass
This converts the following to Kconfig:
   CONFIG_VIDEO_CT69000

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 5996598..7443b9f 100644
--- a/README
+++ b/README
@@ -1619,35 +1619,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 c977887..ddc5c36 100644
--- a/configs/MIP405T_defconfig
+++ b/configs/MIP405T_defconfig
@@ -15,3 +15,4 @@ CONFIG_CMD_PING=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_FAT=y
 CONFIG_SYS_NS16550=y
+CONFIG_VIDEO_CT69000=y
diff --git a/configs/MIP405_defconfig b/configs/MIP405_defconfig
index b5542fe..2610899 100644
--- a/configs/MIP405_defconfig
+++ b/configs/MIP405_defconfig
@@ -18,3 +18,4 @@ CONFIG_CMD_FAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_VIDEO_CT69000=y
diff --git a/configs/PIP405_defconfig b/configs/PIP405_defconfig
index 052f354..73ed894 100644
--- a/configs/PIP405_defconfig
+++ b/configs/PIP405_defconfig
@@ -18,3 +18,4 @@ CONFIG_CMD_FAT=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_STORAGE=y
+CONFIG_VIDEO_CT69000=y
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index d759c5b..47b82f4 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -493,4 +493,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 

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

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

Signed-off-by: Simon Glass 
---

Changes in v4: None
Changes in v3: None
Changes in v2:
- Change CONFIG_PRE_CON_BUF_SZ default to 4096
- Change CONFIG_PRE_CON_BUF_SZ to 'int' type
- Drop the depend clause on the CONFIG_PRE_CON_BUF_SZ default
- Move CONFIG_PRE_CON_BUF_ADDR default to common/Kconfig

 README| 17 
 board/sunxi/Kconfig   |  3 +++
 common/Kconfig| 42 +++
 common/console.c  |  6 +++---
 configs/tbs2910_defconfig |  2 ++
 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, 51 insertions(+), 34 deletions(-)

diff --git a/README b/README
index cc75700..0614a60 100644
--- a/README
+++ b/README
@@ -832,23 +832,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 b139d1c..c0ffeb3 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -3,6 +3,9 @@ if ARCH_SUNXI
 config IDENT_STRING
default " Allwinner Technology"
 
+config PRE_CONSOLE_BUFFER
+   default y
+
 config SPL_GPIO_SUPPORT
default y
 
diff --git a/common/Kconfig b/common/Kconfig
index a8dfd7c..7988de2 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -246,6 +246,48 @@ 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
+   int "Sets the size of the pre-console buffer"
+   depends on PRE_CONSOLE_BUFFER
+   default 4096
+   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
+   default 0x2f00 if ARCH_SUNXI && MACH_SUN9I
+   default 0x4f00 if ARCH_SUNXI && !MACH_SUN9I
+   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 c7f3243..f0f9bab 100644
--- a/common/console.c
+++ b/common/console.c
@@ -201,7 +201,7 @@ static void console_putc(int file, const char c)
}
 }
 
-#ifdef CONFIG_PRE_CONSOLE_BUFFER
+#if 

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

2016-10-17 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 
---

Changes in v4: None
Changes in v3: None
Changes in v2:
- Drop the changes to Kconfig defaults

 README |  5 ---
 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/arndale_defconfig  |  1 +
 configs/bct-brettl2_defconfig  |  1 +
 configs/bf518f-ezbrd_defconfig |  1 +
 configs/bf526-ezbrd_defconfig  |  1 +
 configs/bf527-ad7160-eval_defconfig|  1 +
 configs/bf527-ezkit-v2_defconfig   |  1 +
 configs/bf527-ezkit_defconfig  |  1 +
 configs/bf527-sdp_defconfig|  1 +
 configs/bf533-ezkit_defconfig  |  1 +
 configs/bf533-stamp_defconfig  |  1 +
 configs/bf537-pnav_defconfig   |  1 +
 configs/bf537-stamp_defconfig  |  1 +
 configs/bf538f-ezkit_defconfig |  1 +
 configs/bf548-ezkit_defconfig  |  1 +
 configs/bf561-acvilon_defconfig|  1 +
 configs/bf561-ezkit_defconfig  |  1 +
 configs/br4_defconfig  |  1 +
 configs/chromebook_jerry_defconfig |  1 +
 configs/cm-bf527_defconfig |  1 +
 configs/cm-bf533_defconfig |  1 +
 configs/cm-bf537e_defconfig|  1 +
 configs/cm-bf537u_defconfig|  1 +
 configs/cm-bf548_defconfig |  1 +
 configs/cm-bf561_defconfig |  1 +
 configs/cm5200_defconfig   |  1 +
 configs/espresso7420_defconfig |  1 +
 configs/evb-rk3288_defconfig   |  1 +
 configs/fennec-rk3288_defconfig|  1 +
 configs/firefly-rk3288_defconfig   |  1 +
 configs/fo300_defconfig|  1 +
 configs/ibf-dsp561_defconfig   |  1 +
 configs/ip04_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 +
 

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

2016-10-17 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 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 v4 00/29] Kconfig: Move console options to Kconfig

2016-10-17 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 build-tested to check that everything still works. The series is
available at u-boot-dm/video-working

$ buildman -b video --step 0 -su
boards.cfg is up to date. Nothing to do.
Summary of 2 commits for 1213 boards (32 threads, 1 job per thread)
01: Merge git://www.denx.de/git/u-boot-ppc4xx
  blackfin:  +   cm-bf527 bf609-ezkit bf537-stamp
 sparc:  +   grsim grsim_leon2 gr_cpci_ax2000 gr_xc3s_1500 gr_ep2s60
   sandbox:  +   sandbox_spl
   arc:  ?   nsim_700be nsim_hs38be tb100 axs101 axs103 nsim_700 nsim_hs38
 nios2:  +   10m50 3c120
microblaze:  +   microblaze-generic
  openrisc:  +   openrisc-generic
31: Convert CONFIG_SYS_STDIO_DEREGISTER to Kconfig
   arc:  ?   nsim_700be nsim_hs38be tb100 axs101 axs103 nsim_700 nsim_hs38


Changes in v4:
- Rebase to master

Changes in v3:
- Make SYS_CONSOLE_IS_IN_ENV default to y if CONSOLE_MUX is enabled
- Change CONFIG_CFB_CONSOLE to default y if CONFIG_VIDEO

Changes in v2:
- Drop the changes to Kconfig defaults
- Change CONFIG_PRE_CON_BUF_SZ default to 4096
- Change CONFIG_PRE_CON_BUF_SZ to 'int' type
- Drop the depend clause on the CONFIG_PRE_CON_BUF_SZ default
- Move CONFIG_PRE_CON_BUF_ADDR default to common/Kconfig
- Make CONFIG_SYS_CONSOLE_INFO_QUIET the default if !CONFIG_MUX
- Add new patch to convert CONFIG_USB_KEYBOARD to Kconfig
- Make CONFIG_SYS_STDIO_DEREGISTER the default if USB_KEYBOARD
- Drop Kconfig changes

Simon Glass (29):
  Remove some merge markers
  Convert SILENT_CONSOLE options to Kconfig
  Convert CONSOLE_PRE_CONSOLE_BUFFER options to Kconfig
  Convert CONFIG_SYS_CONSOLE_IS_IN_ENV et al to Kconfig
  config: Drop CONFIG_CONSOLE
  config: Drop CONFIG_CONSOLE_DEV
  Convert CONFIG_VIDEO to Kconfig
  Convert CONFIG_CFB_CONSOLE to Kconfig
  Convert CONFIG_CFB_CONSOLE_ANSI to Kconfig
  Convert CONFIG_VIDEO_CT69000 to Kconfig
  Convert CONFIG_SYS_CONSOLE_BG_COL et al to Kconfig
  video: Drop the smiLynxEM driver
  video: Drop the imx25lcdc driver
  video: Drop the s3c-fb driver
  video: Drop the sed13806 driver
  Convert CONFIG_VGA_AS_SINGLE_DEVICE to Kconfig
  video: Drop CONFIG_VIDEO_HW_CURSOR
  Convert CONFIG_VIDEO_SW_CURSOR to Kconfig
  video: Drop CONFIG_VIDEO_SW_CURSOR
  Convert CONFIG_CONSOLE_EXTRA_INFO to Kconfig
  video: Move video_get_info_str() prototype to a header file
  video: Drop CONFIG_CONSOLE_INFO_QUIET
  Convert CONFIG_LCD to Kconfig
  Convert CONFIG_CONSOLE_SCROLL_LINES to Kconfig
  Convert CONFIG_SYS_CONSOLE_ENV_OVERWRITE to Kconfig
  Convert CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE to Kconfig
  Convert CONFIG_SYS_CONSOLE_INFO_QUIET to Kconfig
  Convert CONFIG_USB_KEYBOARD to Kconfig
  Convert CONFIG_SYS_STDIO_DEREGISTER to Kconfig

 README | 131 
 board/liebherr/lwmon5/lwmon5.c |   1 +
 board/mosaixtech/icon/icon.c   |   1 +
 board/mpl/common/common_util.c |   1 +
 board/sunxi/Kconfig|   3 +
 board/tqc/tqm5200/tqm5200.c|   1 +
 common/Kconfig | 144 
 common/console.c   |   6 +-
 common/stdio.c |   6 +-
 common/usb_kbd.c   |   2 +-
 configs/B4420QDS_NAND_defconfig|   1 +
 configs/B4420QDS_SPIFLASH_defconfig|   1 +
 configs/B4420QDS_defconfig |   1 +
 configs/B4860QDS_NAND_defconfig|   1 +
 configs/B4860QDS_SECURE_BOOT_defconfig |   1 +
 configs/B4860QDS_SPIFLASH_defconfig|   1 +
 configs/B4860QDS_SRIO_PCIE_BOOT_defconfig  |   1 +
 configs/B4860QDS_defconfig |   1 +
 configs/BSC9131RDB_NAND_SYSCLK100_defconfig|   1 +
 configs/BSC9131RDB_NAND_defconfig  |   1 +
 configs/BSC9131RDB_SPIFLASH_SYSCLK100_defconfig|   1 +
 configs/BSC9131RDB_SPIFLASH_defconfig  |   1 +
 configs/BSC9132QDS_NAND_DDRCLK100_SECURE_defconfig |   1 +
 configs/BSC9132QDS_NAND_DDRCLK100_defconfig|   1 +
 configs/BSC9132QDS_NAND_DDRCLK133_SECURE_defconfig |   1 +
 configs/BSC9132QDS_NAND_DDRCLK133_defconfig|   1 +
 configs/BSC9132QDS_NOR_DDRCLK100_SECURE_defconfig  |   1 +
 configs/BSC9132QDS_NOR_DDRCLK100_defconfig |   1 +
 configs/BSC9132QDS_NOR_DDRCLK133_SECURE_defconfig  |   1 +
 configs/BSC9132QDS_NOR_DDRCLK133_defconfig |   1 +
 .../BSC9132QDS_SDCARD_DDRCLK100_SECURE_defconfig   |   1 +
 configs/BSC9132QDS_SDCARD_DDRCLK100_defconfig  |   1 +
 .../BSC9132QDS_SDCARD_DDRCLK133_SECURE_defconfig   |   1 +
 configs/BSC9132QDS_SDCARD_DDRCLK133_defconfig

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

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

Signed-off-by: Simon Glass 
Reviewed-by: Tom Rini 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 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 c2f79a3..9e061bc 100644
--- a/include/configs/MPC8349ITX.h
+++ b/include/configs/MPC8349ITX.h
@@ -356,7 +356,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)
@@ -738,10 +738,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 cb8a067..dd03e21 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
 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


Re: [U-Boot] [U-Boot, RFC] arm: Enable CONFIG_USE_ARCH_MEMSET/MEMCPY globally

2016-10-17 Thread Tom Rini
On Tue, Feb 03, 2015 at 03:21:53PM -0500, Tom Rini wrote:
> - Move the obj- lines for memset.S/memcpy.S to outside of an SPL check
>   so that SPL can use them as well.
> - Make sure memset() / memcpy() end up in a text.fn section for garbage
>   collection in SPL.
> - Update examples/api/Makefile to get memset() again on ARM.
> - Drop Y-MODEM SPL from am335x_evm and USB SPL so that it fits within
>   size constraints again.
> - Always set CONFIG_USE_ARCH_MEMSET/MEMCPY on ARM && !ARM64
> 
> Cc: Albert Aribaud 
> Signed-off-by: Tom Rini 

So, this never made it into master.  I'm going to make a v2 of this that
applies better to how we are today.

-- 
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 3/6] arm: efi: Add a hello world test program

2016-10-17 Thread Simon Glass
Hi Leif,

On 26 September 2016 at 19:53, Leif Lindholm  wrote:
>
> On Mon, Sep 26, 2016 at 08:09:40AM -0600, Simon Glass wrote:
>> >> >> If so, can we just remove this for arm64?
>> >> >
>> >> > Actually I was hoping that Alexander might have a suitable arm64
>> >> > HelloWorld.efi lying around. When I tried building UEFI for arm64, for
>> >> > some reason it did not create it.
>> >>
>> >> Is it part of edk2? If so, Leif (CC'ed) might have one :). I usually
>> >> use grub as my hello world application.
>> >
>> > There is a hello world application in EDK2, but it does not get built
>> > as part of a normal platform build.
>> > Currently it also fails to build for ARM* on its own :|
>> > See
>> > http://patchew.org/EDK2/1471021908-3509-1-git-send-email-leif.lindholm%40linaro.org/
>> > for a hack of how to build one before upstream is resolved.
>> >
>> > If cross compiling, prepend GCC5_AARCH64_PREFIX=aarch64-linux-gnu- to
>> > build command line.
>>
>> Thanks for the pointer. Unfortunately that patch appears to make no
>> differences for me. Are you able to build and send me a 64-bit
>> HelloWorld.efi please?
>
> So, I probably could, but if that isn't working for you, I'd quite
> like to know why.
>
> To make that a little less painful though, I've added support for
> building the helloworld app to my set of scripts:
> https://git.linaro.org/uefi/uefi-tools.git
>
> This still depends on this (updated) patch.
> https://lists.01.org/pipermail/edk2-devel/2016-September/002112.html
>
> But with a current edk2, and a uefi-tools placed in the same directory
> as the edk2 clone, could you try executing:
>
> ../uefi-tools/uefi-build.sh -A AARCH64 hello
>
> If the build fails and creates messy output due to being parallel,
> could you stick a -1 on that command line and send me the output (or
> pastebin)?

OK thanks. Please see:

http://pastebin.com/DmixdA4C

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


Re: [U-Boot] [PATCH] sandboxfs: Fix resource leak

2016-10-17 Thread Simon Glass
On 17 October 2016 at 19:09, Tom Rini  wrote:
> Now that we free resources in sandbox_fs_ls Coverity is letting us know
> that in some cases we might leak.  So in case of error we should still
> let os_dirent_free free anything that was allocated.
>
> Fixes: 86167089b71c ("sandbox/fs: Free memory allocated by os_dirent_ls")
> Reported-by: Coverity (CID: 153450)
> Cc: Stefan Brüns 
> Cc: Simon Glass 
> Signed-off-by: Tom Rini 
> ---
>  fs/sandbox/sandboxfs.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH 00/82] x86: Add initial support for 64-bit U-Boot

2016-10-17 Thread Bin Meng
Hi Simon,

On Tue, Oct 18, 2016 at 6:17 AM, Simon Glass  wrote:
> Hi Bin,
>
> On 10 October 2016 at 23:36, Bin Meng  wrote:
>> Hi Simon,
>>
>> On Mon, Sep 26, 2016 at 11:33 AM, Simon Glass  wrote:
>>> At present U-Boot runs entirely in 32-bit mode on x86, except for the
>>> initial switch from 16-bit mode. On 64-bit machines it is possible to run
>>> in 64-bit mode. This series starts the process of adding this support.
>>>
>>> The main benefit of 64-bit mode for a boot loader is direct access to all
>>> available memory. There are also more registers, but this makes very little
>>> difference.
>>>
>>> This feature is implemented by putting all of the 32-bit code in an SPL
>>> build. SPL then runs through all the init that has to be done in 32-bit
>>> mode, changes to 64-bit mode and then jumps to U-Boot proper.
>>>
>>> Typically the total code size increases slightly. For example, on link in
>>> 32-bit mode, U-Boot has around 480KB of code (admittedly with a large
>>> number of features enabled). In 64-bit mode, U-Boot falls to around 460KB,
>>> but SPL adds another 60KB, for a net increase of 40KB. Partly this is due
>>> to code duplication and partly it is due to the worse code density of
>>> 64-bit code on x86.
>>>
>>> Many major features are not implemented yet, for example:
>>> - SDRAM sizing
>>> - Booting linux
>>> - FSP support
>>> - EFI support
>>> - SCSI device init
>>> - Running video ROMs
>>>
>>> Still, this is a big step forward towards full 64-bit support. To enable it,
>>> select CONFIG_X86_RUN_64BIT.
>>>
>>> This series is available at u-boot-x86/64-working
>>>
>>
>> Looks it requires a 64-bit toolchain to compile 64-bit U-Boot. For
>> example, I used kernel.org i386 toolchain to compile 64-bit U-Boot, I
>> got:
>>
>> include/asm-generic/bitops/__fls.h: In function '__fls':
>> include/asm-generic/bitops/__fls.h:17:2: warning: left shift count >=
>> width of type
>>   if (!(word & (~0ul << 32))) {
>>   ^
>> include/asm-generic/bitops/__fls.h:19:3: warning: left shift count >=
>> width of type
>>word <<= 32;
>>^
>> include/asm-generic/bitops/__fls.h:22:2: warning: left shift count >=
>> width of type
>>   if (!(word & (~0ul << (BITS_PER_LONG-16 {
>>   ^
>> include/asm-generic/bitops/__fls.h:26:2: warning: left shift count >=
>> width of type
>>   if (!(word & (~0ul << (BITS_PER_LONG-8 {
>>   ^
>> include/asm-generic/bitops/__fls.h:30:2: warning: left shift count >=
>> width of type
>>   if (!(word & (~0ul << (BITS_PER_LONG-4 {
>>   ^
>> include/asm-generic/bitops/__fls.h:34:2: warning: left shift count >=
>> width of type
>>   if (!(word & (~0ul << (BITS_PER_LONG-2 {
>>   ^
>> include/asm-generic/bitops/__fls.h:38:2: warning: left shift count >=
>> width of type
>>   if (!(word & (~0ul << (BITS_PER_LONG-1
>>   ^
>> arch/x86/cpu/intel_common/microcode.c: In function 'microcode_read_rev':
>> arch/x86/cpu/intel_common/microcode.c:79:2: error: PIC register
>> clobbered by 'ebx' in 'asm'
>>   asm volatile (
>>   ^
>> make[2]: *** [arch/x86/cpu/intel_common/microcode.o] Error 1
>
> Yes, that is expected.

Can we make the i386 toolchain work? Linux 64-bit kernel build does
not require the toolchain to be 64-bit.

>>
>> After I switched to 64-bit toolchain from kernel.org (x86_64-linux),
>> there was no such warnings/errors, but I still got build failure at
>> last.
>>
>>   ./tools/binman/binman -d u-boot.dtb -O . -I . -I
>> ./board/google/chromebook_link u-boot-x86-16bit.bin
>> Traceback (most recent call last):
>>   File "./tools/binman/binman", line 31, in 
>> import control
>>   File "./tools/binman/control.py", line 17, in 
>> from image import Image
>>   File "./tools/binman/image.py", line 12, in 
>> import entry
>>   File "./tools/binman/etype/entry.py", line 8, in 
>> import importlib
>> ImportError: No module named importlib
>> make: *** [u-boot.rom] Error 1
>
> What version of python do you use?

$ python -V
Python 2.7.12

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


[U-Boot] [PATCH] sandboxfs: Fix resource leak

2016-10-17 Thread Tom Rini
Now that we free resources in sandbox_fs_ls Coverity is letting us know
that in some cases we might leak.  So in case of error we should still
let os_dirent_free free anything that was allocated.

Fixes: 86167089b71c ("sandbox/fs: Free memory allocated by os_dirent_ls")
Reported-by: Coverity (CID: 153450)
Cc: Stefan Brüns 
Cc: Simon Glass 
Signed-off-by: Tom Rini 
---
 fs/sandbox/sandboxfs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/sandbox/sandboxfs.c b/fs/sandbox/sandboxfs.c
index cd10fd6845fb..ca8026133708 100644
--- a/fs/sandbox/sandboxfs.c
+++ b/fs/sandbox/sandboxfs.c
@@ -88,15 +88,16 @@ int sandbox_fs_ls(const char *dirname)
 
ret = os_dirent_ls(dirname, );
if (ret)
-   return ret;
+   goto out;
 
for (node = head; node; node = node->next) {
printf("%s %10lu %s\n", os_dirent_get_typename(node->type),
   node->size, node->name);
}
+out:
os_dirent_free(head);
 
-   return 0;
+   return ret;
 }
 
 int sandbox_fs_exists(const char *filename)
-- 
1.9.1

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


[U-Boot] [ANN] U-Boot v2016.11-rc2 released

2016-10-17 Thread Tom Rini
Hey all,

It's release day and v2016.11-rc2 is out.  I've tried to clean up my
queue a bit, but I think there's still a few things I have outstanding.
And I know I need to get some changes from Alexander for EFI stuff that
I've already promised can come in.  But we should also be moving towards
release.

So I will be picking up some Kconfig related changes and making sure we
have no (unexplained) binary size changes.

A perhaps less obvious change between -rc1 and -rc2 is that I've added
test.py running for qemu-ppce500, qemu-x86, vexpress_ca15_tc2,
vexpres_ca9x5 and integratorap_cm926ejs along with qemu-mips*.

I plan on doing -rc3 on the 31st.

Thanks all!

-- 
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] Please pull u-boot-mpc85xx master

2016-10-17 Thread Tom Rini
On Sat, Oct 15, 2016 at 05:02:03PM +, york sun wrote:

> Tom,
> 
> The following changes since commit 44afdc4a12b9f6f48338e7975e4f08cfe90dba74:
> 
>Merge branch 'master' of git://git.denx.de/u-boot-net (2016-10-13 
> 13:38:49 -0400)
> 
> are available in the git repository at:
> 
>git://git.denx.de/u-boot-mpc85xx.git
> 
> for you to fetch changes up to a9320c495ef938cb96f0862dca79e899e4fa:
> 
>arch: powerpc: Remove unused dts frequency fixup for lbc_clk 
> (2016-10-14 10:23:11 -0700)
> 

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


[U-Boot] [PATCH] test/py: ensure a log section exists for skipped tests

2016-10-17 Thread Stephen Warren
From: Stephen Warren 

In pytest 3, runtestprotocol() may not call pytest_runtest_setup() if
the test is skipped. That call is required to create a section for the
test in the log file. If this is skipped, the call to log.end_section()
at the tail of pytest_runtest_protocol() will throw an exception. This
patch ensures that a log section always exists, both to avoid the
exception and to ensure that a consistently structured log file is
always created.

Cc: Stefan Brüns 
Reported-by: Stefan Brüns 
Signed-off-by: Stephen Warren 
---
 test/py/conftest.py | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/test/py/conftest.py b/test/py/conftest.py
index 5b3a92316bbf..1f15e3e33dcf 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -431,6 +431,9 @@ def setup_buildconfigspec(item):
 if not ubconfig.buildconfig.get('config_' + option.lower(), None):
 pytest.skip('.config feature not enabled')
 
+def start_test_section(item):
+anchors[item.name] = log.start_section(item.name)
+
 def pytest_runtest_setup(item):
 """pytest hook: Configure (set up) a test item.
 
@@ -444,7 +447,7 @@ def pytest_runtest_setup(item):
 Nothing.
 """
 
-anchors[item.name] = log.start_section(item.name)
+start_test_section(item)
 setup_boardspec(item)
 setup_buildconfigspec(item)
 
@@ -464,6 +467,14 @@ def pytest_runtest_protocol(item, nextitem):
 
 reports = runtestprotocol(item, nextitem=nextitem)
 
+# In pytest 3, runtestprotocol() may not call pytest_runtest_setup() if
+# the test is skipped. That call is required to create the test's section
+# in the log file. The call to log.end_section() requires that the log
+# contain a section for this test. Create a section for the test if it
+# doesn't already exist.
+if not item.name in anchors:
+start_test_section(item)
+
 failure_cleanup = False
 test_list = tests_passed
 msg = 'OK'
-- 
2.10.1

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


Re: [U-Boot] [PATCH] test/py: Fix exception, do not parametrize with empty set

2016-10-17 Thread Stephen Warren

On 10/16/2016 12:17 PM, Stefan Brüns wrote:

If the parameter set is empty, the pytest setup fails:
---
call: 
---

This aborts pytest_runtest_makereport and later leads to an exception
during the report generation, as the call to log.start_section(...)
is never executed:
---
Exception: Block nesting mismatch:
"test_dfu[env__usb_dev_port0-env__dfu_config0]" ""
---


This patch causes failures with pytest 2.5 when env__dfu_configs is an 
empty list or not set at all. I've created an alternative patch that 
seems to work with both pytest 2.5 and 3, which I'll send in a minute.

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


Re: [U-Boot] [PATCH] common: env: add kconfig entry for env storage

2016-10-17 Thread Tom Rini
On Mon, Oct 17, 2016 at 04:17:06PM -0600, Simon Glass wrote:
> Hi Peng,
> 
> On 8 October 2016 at 03:06, Peng Fan  wrote:
> > Add Kconfig entry for ENV storage
> >
> > Signed-off-by: Peng Fan 
> > Cc: Simon Glass 
> > Cc: Heiko Schocher 
> > Cc: Tom Rini 
> > Cc: Masahiro Yamada 
> > Cc: Stefan Roese 
> > Cc: Siva Durga Prasad Paladugu 
> > Cc: Francois Retief 
> > ---
> >  common/Kconfig | 73 
> > ++
> >  1 file changed, 73 insertions(+)
> >
> > diff --git a/common/Kconfig b/common/Kconfig
> > index c69c141..a630924 100644
> > --- a/common/Kconfig
> > +++ b/common/Kconfig
> > @@ -158,6 +158,79 @@ config SPI_BOOT
> >
> >  endmenu
> >
> > +menu "ENV storage media"
> > +
> > +config ENV_IS_IN_DATAFLASH
> > +   bool "env stored in dataflash"
> > +   help
> > + env stored in dataflash
> 
> Can you add a little more help detail on this? Also I suspect we
> should have CONFIG_ENV as well, to enable the actual environment
> (independent of where it is stored).

Yes, please add a bit more to the text.

> Also, can you migrate the existing configs with moveconfig? That would
> be a big step forward and may inspire me to move it to linker lists.

Actually, I bet this is going to be messy enough that I'm fine running
the moveconfig myself right before I merge it in.

-- 
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] test/py: Fix exception, do not parametrize with empty set

2016-10-17 Thread Stephen Warren

On 10/17/2016 04:01 PM, Stephen Warren wrote:

On 10/17/2016 01:18 PM, Brüns, Stefan wrote:

On Montag, 17. Oktober 2016 12:11:26 CEST Stephen Warren wrote:

On 10/16/2016 12:17 PM, Stefan Brüns wrote:

If the parameter set is empty, the pytest setup fails:
---

call: 

---

This aborts pytest_runtest_makereport and later leads to an exception
during the report generation, as the call to log.start_section(...)
is never executed:
---

Exception: Block nesting mismatch:
"test_dfu[env__usb_dev_port0-env__dfu_config0]" ""

---


How do you trigger this? I believe my test setup has many cases where
the test you added would trigger, but without the issues you mention,
but I'm not 100% sure since I don't know for sure what is causing this
issue.

Which pytest version do you have? I appear to have 2.5.1 (on Ubuntu
Trusty)


1. You need "dfu_configs" to be empty
2. Maybe its pytest version dependent, IIRC I have 3.0.2

The first error above can be seen when running pytest with "--debug",
it is
written to IIRC pytestdebug.log


Looks like this is a bug in pytest 3, and has been fixed upstream:

https://github.com/pytest-dev/pytest/issues/1849
Pytest 3.0 does not accept empty list in fixture


Actually, I take that back; that's something else. I'll keep looking.

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


Re: [U-Boot] [PATCH] libfdt: Sync overlay with upstream

2016-10-17 Thread Simon Glass
On 17 October 2016 at 14:50, Maxime Ripard
 wrote:
> Now that the overlay code has been merge upstream, update our copy to
> what's been merged, since a significant number of issues have been fixed
> during the merge process.
>
> Signed-off-by: Maxime Ripard 
> ---
>  include/libfdt.h  |  24 --
>  lib/libfdt/fdt_overlay.c  | 199 
> +-
>  lib/libfdt/fdt_strerror.c |   3 +
>  3 files changed, 147 insertions(+), 79 deletions(-)

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


Re: [U-Boot] [PATCH 1/2] libfdt: fix fdt_stringlist_count()

2016-10-17 Thread Simon Glass
On 17 October 2016 at 00:24, Masahiro Yamada
 wrote:
> If fdt_getprop() fails, negative error code should be returned.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  lib/libfdt/fdt_ro.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH] Fix codying style broken by recent libfdt sync

2016-10-17 Thread Simon Glass
On 17 October 2016 at 05:43, Masahiro Yamada
 wrote:
> Commit b02e4044ff8e ("libfdt: Bring in upstream stringlist
> functions") broke codying style in some places especially
> by inserting an extra whitespace before fdt_stringlist_count().
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  arch/arm/mach-tegra/xusb-padctl-common.c | 2 +-
>  drivers/core/device.c| 4 ++--
>  drivers/net/sun8i_emac.c | 2 +-
>  drivers/pinctrl/exynos/pinctrl-exynos.c  | 2 +-
>  drivers/pinctrl/pinctrl-generic.c| 6 +++---
>  drivers/video/sunxi_display.c| 2 +-
>  6 files changed, 9 insertions(+), 9 deletions(-)

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


Re: [U-Boot] [PATCH v2] tpm: tpm_tis_lpc: Add support for AT97SC3204

2016-10-17 Thread Simon Glass
On 17 October 2016 at 08:24, George McCollister
 wrote:
> The Atmel AT97SC3204 is also TIS compliant.
> Modify the tpm_tis_lpc driver to check for the vid/did used by the
> Atmel AT97SC3204 and report an appropriate description.
>
> Signed-off-by: George McCollister 
> ---
>
> Changes in v2:
> - Reorganized didvid check to make it more consistent with the original
>   code
> - Return -ENODEV instead of -ENOENT when didvid doesn't match the
>   expected value for the device
>
>  drivers/tpm/tpm_tis_lpc.c | 37 -
>  1 file changed, 28 insertions(+), 9 deletions(-)

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


Re: [U-Boot] [PATCH 2/2] libfdt: fix fdt_stringlist_search()

2016-10-17 Thread Simon Glass
On 17 October 2016 at 00:24, Masahiro Yamada
 wrote:
> If fdt_getprop() fails, negative error code should be returned.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  lib/libfdt/fdt_ro.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH] cmd/tpm_test: Fix misleading code indentation

2016-10-17 Thread Simon Glass
On 16 October 2016 at 09:13, Stefan Brüns  wrote:
> GCC 6.2 reasonably complains about the current code:
>
> ../cmd/tpm_test.c: In function ‘do_tpmtest’:
> ../cmd/tpm_test.c:540:3: warning: this ‘for’ clause does not guard... 
> [-Wmisleading-indentation]
>for (i = 0; i < argc; i++)
>^~~
> ../cmd/tpm_test.c:542:4: note: ...this statement, but the latter is 
> misleadingly indented as if it is guarded by the ‘for’
> printf("\n--\n");
> ^~
>
> Signed-off-by: Stefan Brüns 
> ---
>  cmd/tpm_test.c | 11 +--
>  1 file changed, 5 insertions(+), 6 deletions(-)

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


Re: [U-Boot] [PATCH 00/82] x86: Add initial support for 64-bit U-Boot

2016-10-17 Thread Simon Glass
Hi Bin,

On 10 October 2016 at 23:36, Bin Meng  wrote:
> Hi Simon,
>
> On Mon, Sep 26, 2016 at 11:33 AM, Simon Glass  wrote:
>> At present U-Boot runs entirely in 32-bit mode on x86, except for the
>> initial switch from 16-bit mode. On 64-bit machines it is possible to run
>> in 64-bit mode. This series starts the process of adding this support.
>>
>> The main benefit of 64-bit mode for a boot loader is direct access to all
>> available memory. There are also more registers, but this makes very little
>> difference.
>>
>> This feature is implemented by putting all of the 32-bit code in an SPL
>> build. SPL then runs through all the init that has to be done in 32-bit
>> mode, changes to 64-bit mode and then jumps to U-Boot proper.
>>
>> Typically the total code size increases slightly. For example, on link in
>> 32-bit mode, U-Boot has around 480KB of code (admittedly with a large
>> number of features enabled). In 64-bit mode, U-Boot falls to around 460KB,
>> but SPL adds another 60KB, for a net increase of 40KB. Partly this is due
>> to code duplication and partly it is due to the worse code density of
>> 64-bit code on x86.
>>
>> Many major features are not implemented yet, for example:
>> - SDRAM sizing
>> - Booting linux
>> - FSP support
>> - EFI support
>> - SCSI device init
>> - Running video ROMs
>>
>> Still, this is a big step forward towards full 64-bit support. To enable it,
>> select CONFIG_X86_RUN_64BIT.
>>
>> This series is available at u-boot-x86/64-working
>>
>
> Looks it requires a 64-bit toolchain to compile 64-bit U-Boot. For
> example, I used kernel.org i386 toolchain to compile 64-bit U-Boot, I
> got:
>
> include/asm-generic/bitops/__fls.h: In function '__fls':
> include/asm-generic/bitops/__fls.h:17:2: warning: left shift count >=
> width of type
>   if (!(word & (~0ul << 32))) {
>   ^
> include/asm-generic/bitops/__fls.h:19:3: warning: left shift count >=
> width of type
>word <<= 32;
>^
> include/asm-generic/bitops/__fls.h:22:2: warning: left shift count >=
> width of type
>   if (!(word & (~0ul << (BITS_PER_LONG-16 {
>   ^
> include/asm-generic/bitops/__fls.h:26:2: warning: left shift count >=
> width of type
>   if (!(word & (~0ul << (BITS_PER_LONG-8 {
>   ^
> include/asm-generic/bitops/__fls.h:30:2: warning: left shift count >=
> width of type
>   if (!(word & (~0ul << (BITS_PER_LONG-4 {
>   ^
> include/asm-generic/bitops/__fls.h:34:2: warning: left shift count >=
> width of type
>   if (!(word & (~0ul << (BITS_PER_LONG-2 {
>   ^
> include/asm-generic/bitops/__fls.h:38:2: warning: left shift count >=
> width of type
>   if (!(word & (~0ul << (BITS_PER_LONG-1
>   ^
> arch/x86/cpu/intel_common/microcode.c: In function 'microcode_read_rev':
> arch/x86/cpu/intel_common/microcode.c:79:2: error: PIC register
> clobbered by 'ebx' in 'asm'
>   asm volatile (
>   ^
> make[2]: *** [arch/x86/cpu/intel_common/microcode.o] Error 1

Yes, that is expected.

>
> After I switched to 64-bit toolchain from kernel.org (x86_64-linux),
> there was no such warnings/errors, but I still got build failure at
> last.
>
>   ./tools/binman/binman -d u-boot.dtb -O . -I . -I
> ./board/google/chromebook_link u-boot-x86-16bit.bin
> Traceback (most recent call last):
>   File "./tools/binman/binman", line 31, in 
> import control
>   File "./tools/binman/control.py", line 17, in 
> from image import Image
>   File "./tools/binman/image.py", line 12, in 
> import entry
>   File "./tools/binman/etype/entry.py", line 8, in 
> import importlib
> ImportError: No module named importlib
> make: *** [u-boot.rom] Error 1

What version of python do you use?

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


Re: [U-Boot] [PATCH] common: env: add kconfig entry for env storage

2016-10-17 Thread Simon Glass
Hi Peng,

On 8 October 2016 at 03:06, Peng Fan  wrote:
> Add Kconfig entry for ENV storage
>
> Signed-off-by: Peng Fan 
> Cc: Simon Glass 
> Cc: Heiko Schocher 
> Cc: Tom Rini 
> Cc: Masahiro Yamada 
> Cc: Stefan Roese 
> Cc: Siva Durga Prasad Paladugu 
> Cc: Francois Retief 
> ---
>  common/Kconfig | 73 
> ++
>  1 file changed, 73 insertions(+)
>
> diff --git a/common/Kconfig b/common/Kconfig
> index c69c141..a630924 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -158,6 +158,79 @@ config SPI_BOOT
>
>  endmenu
>
> +menu "ENV storage media"
> +
> +config ENV_IS_IN_DATAFLASH
> +   bool "env stored in dataflash"
> +   help
> + env stored in dataflash

Can you add a little more help detail on this? Also I suspect we
should have CONFIG_ENV as well, to enable the actual environment
(independent of where it is stored).

Also, can you migrate the existing configs with moveconfig? That would
be a big step forward and may inspire me to move it to linker lists.

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


Re: [U-Boot] [PATCH v5 2/5] net: fec_mxc: Convert into driver model

2016-10-17 Thread Simon Glass
Hi Jagan,

On 12 October 2016 at 10:16, Jagan Teki  wrote:
> Hi Simon,
>
> On Wed, Oct 12, 2016 at 2:28 AM, Simon Glass  wrote:
>> Hi Jagan,
>>
>> On 9 October 2016 at 08:51, Jagan Teki  wrote:
>>>
>>> Hi Simon,
>>>
>>> On Thu, Oct 6, 2016 at 4:25 PM, Jagan Teki  wrote:
>>> > From: Jagan Teki 
>>> >
>>> > This patch add driver model support for fec_mxc driver.
>>> >
>>> > Cc: Simon Glass 
>>> > Cc: Joe Hershberger 
>>> > Cc: Peng Fan 
>>> > Cc: Stefano Babic 
>>> > Cc: Michael Trimarchi 
>>> > Signed-off-by: Jagan Teki 
>>> > ---
>>> >  drivers/net/fec_mxc.c | 314 
>>> > ++
>>> >  drivers/net/fec_mxc.h |   4 +
>>> >  2 files changed, 271 insertions(+), 47 deletions(-)
>>> >
>>>
>>  [...]
>>>
>>> This look OK now, let me know if you have any inputs.
>>
>> Is there a change log please?
>
> Added on cover-letter[1], forgot to add you :)
>
> [1] 
> http://u-boot.10912.n7.nabble.com/PATCH-v5-0-5-net-fec-mxc-Convert-to-DM-td269625.html

It's easier if you add it to the individual patch. Anyway, Joe is
reviewing this so I will leave it to him.

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


Re: [U-Boot] [PATCH] efi_loader: Rename EFI_RUNTIME_{TEXT, DATA} to __efi_runtime{, _data}

2016-10-17 Thread Simon Glass
On 14 October 2016 at 05:45, Alexander Graf  wrote:
> Compiler attributes are more commonly __foo style tags rather than big
> upper case eye sores like EFI_RUNTIME_TEXT.
>
> Simon Glass felt quite strongly about this, so this patch converts our
> existing defines over to more eye friendly ones.
>
> Signed-off-by: Alexander Graf 
> ---
>  arch/arm/cpu/armv8/fwcall.c   | 12 ++--
>  include/efi_loader.h  | 12 ++--
>  lib/efi_loader/efi_boottime.c |  6 +++---
>  lib/efi_loader/efi_runtime.c  | 20 ++--
>  4 files changed, 25 insertions(+), 25 deletions(-)

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


Re: [U-Boot] [PATCH 33/82] x86: dts: Mark serial as needed before relocation

2016-10-17 Thread Simon Glass
Hi Bin,

On 10 October 2016 at 21:16, Bin Meng  wrote:
> Hi Simon,
>
> On Mon, Sep 26, 2016 at 11:33 AM, Simon Glass  wrote:
>> We almost always need the serial port before relocation, so mark it as such.
>> This will ensure that it appears in the device tree for SPL, if used.
>>
>> Signed-off-by: Simon Glass 
>> ---
>>
>>  arch/x86/dts/serial.dtsi | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/x86/dts/serial.dtsi b/arch/x86/dts/serial.dtsi
>> index 54c3faf..22f7b54 100644
>> --- a/arch/x86/dts/serial.dtsi
>> +++ b/arch/x86/dts/serial.dtsi
>> @@ -1,5 +1,6 @@
>>  / {
>> serial: serial {
>> +   u-boot,dm-pre-reloc;
>
> The ns16550 driver already has the pre-relocation flag, why is this
> still needed?

Without this, it will not appear in the SPL device tree (fdtgrep will
drop it). So we need it here.

>
>> compatible = "ns16550";
>> reg = <0x3f8 8>;
>> reg-shift = <0>;
>> --

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


Re: [U-Boot] [PATCH 05/82] console: Don't enable CONFIG-CONSOLE_MUX, etc. in SPL

2016-10-17 Thread Simon Glass
Hi Bin,

On 10 October 2016 at 21:15, Bin Meng  wrote:
> Hi Simon,
>
> Typo of CONFIG-CONSOLE_MUX in the commit title.
>
> On Mon, Sep 26, 2016 at 11:33 AM, Simon Glass  wrote:
>> CONFIG_CONSOLE_MUX and CONFIG_SYS_CONSOLE_IS_IN_ENV are not applicable
>> for SPL. Update the console code to use CONFIG_IS_ENABLED(), so that these
>> options will be inactive in SPL.
>
> I don't understand, what's the difference between CONFIG_IS_ENABLE() and 
> #ifdef?

CONFIG_IS_ENABLED() can have a different value for SPL and U-Boot
proper. It uses CONFIG_xxx or CONFIG_SPL_xxx depending on which is
being built.

>
>>
>> Signed-off-by: Simon Glass 
>> ---
>>
>>  common/console.c | 30 +++---
>>  1 file changed, 15 insertions(+), 15 deletions(-)

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


Re: [U-Boot] [PATCH] test/py: Fix exception, do not parametrize with empty set

2016-10-17 Thread Stephen Warren

On 10/17/2016 01:18 PM, Brüns, Stefan wrote:

On Montag, 17. Oktober 2016 12:11:26 CEST Stephen Warren wrote:

On 10/16/2016 12:17 PM, Stefan Brüns wrote:

If the parameter set is empty, the pytest setup fails:
---

call: 

---

This aborts pytest_runtest_makereport and later leads to an exception
during the report generation, as the call to log.start_section(...)
is never executed:
---

Exception: Block nesting mismatch:
"test_dfu[env__usb_dev_port0-env__dfu_config0]" ""

---


How do you trigger this? I believe my test setup has many cases where
the test you added would trigger, but without the issues you mention,
but I'm not 100% sure since I don't know for sure what is causing this
issue.

Which pytest version do you have? I appear to have 2.5.1 (on Ubuntu Trusty)


1. You need "dfu_configs" to be empty
2. Maybe its pytest version dependent, IIRC I have 3.0.2

The first error above can be seen when running pytest with "--debug", it is
written to IIRC pytestdebug.log


Looks like this is a bug in pytest 3, and has been fixed upstream:

https://github.com/pytest-dev/pytest/issues/1849
Pytest 3.0 does not accept empty list in fixture

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


[U-Boot] [PATCH 1/2] armv8: add hooks for all cache-wide operations

2016-10-17 Thread Stephen Warren
From: Stephen Warren 

SoC-specific logic may be required for all forms of cache-wide
operations; invalidate and flush of both dcache and icache (note that
only 3 of the 4 possible combinations make sense, since the icache never
contains dirty lines). This patch adds an optional hook for all
implemented cache-wide operations, and renames the one existing hook to
better represent exactly which operation it is implementing. A dummy
no-op implementation of each hook is provided. These dummy
implementations are moved into C code, since there's no need to
implement them in assembly.

Signed-off-by: Stephen Warren 
---
 arch/arm/cpu/armv8/cache.S   |  6 --
 arch/arm/cpu/armv8/cache_v8.c| 23 ---
 arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S |  4 ++--
 arch/arm/include/asm/system.h|  5 -
 arch/arm/mach-tegra/tegra186/cache.c |  2 +-
 5 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/arch/arm/cpu/armv8/cache.S b/arch/arm/cpu/armv8/cache.S
index 46f25e63f01d..23fa914dc556 100644
--- a/arch/arm/cpu/armv8/cache.S
+++ b/arch/arm/cpu/armv8/cache.S
@@ -150,12 +150,6 @@ ENTRY(__asm_invalidate_icache_all)
ret
 ENDPROC(__asm_invalidate_icache_all)
 
-ENTRY(__asm_flush_l3_cache)
-   mov x0, #0  /* return status as success */
-   ret
-ENDPROC(__asm_flush_l3_cache)
-   .weak   __asm_flush_l3_cache
-
 /*
  * void __asm_switch_ttbr(ulong new_ttbr)
  *
diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c
index cd3f6c10ae12..d2965e9878a0 100644
--- a/arch/arm/cpu/armv8/cache_v8.c
+++ b/arch/arm/cpu/armv8/cache_v8.c
@@ -415,25 +415,36 @@ __weak void mmu_setup(void)
set_sctlr(get_sctlr() | CR_M);
 }
 
+__weak int invalidate_dcache_all_l3(void)
+{
+   return 0;
+}
+
 /*
  * Performs a invalidation of the entire data cache at all levels
  */
 void invalidate_dcache_all(void)
 {
__asm_invalidate_dcache_all();
+   invalidate_dcache_all_l3();
+}
+
+__weak int flush_dcache_all_l3(void)
+{
+   return 0;
 }
 
 /*
  * Performs a clean & invalidation of the entire data cache at all levels.
  * This function needs to be inline to avoid using stack.
- * __asm_flush_l3_cache return status of timeout
+ * flush_dcache_all_l3 return status of timeout
  */
 inline void flush_dcache_all(void)
 {
int ret;
 
__asm_flush_dcache_all();
-   ret = __asm_flush_l3_cache();
+   ret = flush_dcache_all_l3();
if (ret)
debug("flushing dcache returns 0x%x\n", ret);
else
@@ -623,7 +634,7 @@ void mmu_set_region_dcache_behaviour(phys_addr_t start, 
size_t size,
 
 void icache_enable(void)
 {
-   __asm_invalidate_icache_all();
+   invalidate_icache_all();
set_sctlr(get_sctlr() | CR_I);
 }
 
@@ -637,9 +648,15 @@ int icache_status(void)
return (get_sctlr() & CR_I) != 0;
 }
 
+__weak int invalidate_icache_all_l3(void)
+{
+   return 0;
+}
+
 void invalidate_icache_all(void)
 {
__asm_invalidate_icache_all();
+   invalidate_icache_all_l3();
 }
 
 #else  /* CONFIG_SYS_ICACHE_OFF */
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S 
b/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
index 5d0b7a45c354..4e4ef8b7a6df 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
+++ b/arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S
@@ -245,7 +245,7 @@ hnf_set_pstate:
 
ret
 
-ENTRY(__asm_flush_l3_cache)
+ENTRY(flush_dcache_all_l3)
/*
 * Return status in x0
 *success 0
@@ -275,7 +275,7 @@ ENTRY(__asm_flush_l3_cache)
mov x0, x8
mov lr, x29
ret
-ENDPROC(__asm_flush_l3_cache)
+ENDPROC(flush_dcache_all_l3)
 #endif
 
 #ifdef CONFIG_MP
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index c18e1e3a10ee..095f3742ce60 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -93,9 +93,12 @@ void __asm_invalidate_dcache_all(void);
 void __asm_flush_dcache_range(u64 start, u64 end);
 void __asm_invalidate_tlb_all(void);
 void __asm_invalidate_icache_all(void);
-int __asm_flush_l3_cache(void);
 void __asm_switch_ttbr(u64 new_ttbr);
 
+int invalidate_dcache_all_l3(void);
+int flush_dcache_all_l3(void);
+int invalidate_icache_all_l3(void);
+
 void armv8_switch_to_el2(void);
 void armv8_switch_to_el1(void);
 void gic_init(void);
diff --git a/arch/arm/mach-tegra/tegra186/cache.c 
b/arch/arm/mach-tegra/tegra186/cache.c
index adaed8968eb9..fb0b1142e49b 100644
--- a/arch/arm/mach-tegra/tegra186/cache.c
+++ b/arch/arm/mach-tegra/tegra186/cache.c
@@ -10,7 +10,7 @@
 #define SMC_SIP_INVOKE_MCE 0x8200
 #define MCE_SMC_ROC_FLUSH_CACHE11
 
-int __asm_flush_l3_cache(void)
+int flush_dcache_all_l3(void)
 {
struct pt_regs regs = {0};
 
-- 
2.10.1

___
U-Boot mailing list
U-Boot@lists.denx.de

[U-Boot] [PATCH 2/2] ARM: tegra186: call secure monitor for all cache-wide ops

2016-10-17 Thread Stephen Warren
From: Stephen Warren 

An SMC call is required for all cache-wide operations on Tegra186. This
patch implements the two missing hooks now that U-Boot supports them, and
fixes the mapping of "hook name" to SMC call code.

Signed-off-by: Stephen Warren 
---
 arch/arm/mach-tegra/tegra186/cache.c | 23 ---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-tegra/tegra186/cache.c 
b/arch/arm/mach-tegra/tegra186/cache.c
index fb0b1142e49b..3ab60b3b85b2 100644
--- a/arch/arm/mach-tegra/tegra186/cache.c
+++ b/arch/arm/mach-tegra/tegra186/cache.c
@@ -8,16 +8,33 @@
 #include 
 
 #define SMC_SIP_INVOKE_MCE 0x8200
-#define MCE_SMC_ROC_FLUSH_CACHE11
+#define MCE_SMC_ROC_FLUSH_CACHE11
+#define MCE_SMC_ROC_FLUSH_CACHE_ONLY   14
+#define MCE_SMC_ROC_CLEAN_CACHE_ONLY   15
 
-int flush_dcache_all_l3(void)
+static int smc_sip_invoke_mce(int cmd)
 {
struct pt_regs regs = {0};
 
isb();
 
-   regs.regs[0] = SMC_SIP_INVOKE_MCE | MCE_SMC_ROC_FLUSH_CACHE;
+   regs.regs[0] = SMC_SIP_INVOKE_MCE | cmd;
smc_call();
 
return 0;
 }
+
+int invalidate_dcache_all_l3(void)
+{
+   return smc_sip_invoke_mce(MCE_SMC_ROC_FLUSH_CACHE_ONLY);
+}
+
+int flush_dcache_all_l3(void)
+{
+   return smc_sip_invoke_mce(MCE_SMC_ROC_CLEAN_CACHE_ONLY);
+}
+
+int invalidate_icache_all_l3(void)
+{
+   return smc_sip_invoke_mce(MCE_SMC_ROC_FLUSH_CACHE);
+}
-- 
2.10.1

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


Re: [U-Boot] [PATCH] ARM: zynq: Extend picozed board support

2016-10-17 Thread Moritz Fischer
Hi Oscar,

On Mon, Oct 17, 2016 at 5:33 PM, Oscar Gomez Fuente
 wrote:
> Ok Michal,
>
> Then you're suggesting change the zynq-picozed.dts file to:

If you're planning to include this into others, make it a .dtsi file.

>
> diff --git a/arch/arm/dts/zynq-picozed.dts b/arch/arm/dts/zynq-picozed.dts
> index 3408df8..d8ed298 100644
> --- a/arch/arm/dts/zynq-picozed.dts
> +++ b/arch/arm/dts/zynq-picozed.dts
> @@ -14,6 +14,8 @@
>
> aliases {
> serial0 = 
> +   spi0 = 
> +   ethernet0 = 
> };
>
> memory {
> @@ -26,3 +28,18 @@
> u-boot,dm-pre-reloc;
> status = "okay";
>  };
> +
> + {
> +   u-boot,dm-pre-reloc;
> +   status = "okay";
> +};
> +
> + {
> +   status = "okay";
> +   phy-mode = "rgmii-id";
> +   phy-handle = <_phy>;
> +
> +   ethernet_phy: ethernet-phy@0 {
> +   reg = <0>;
> +   };
> +};
>
> And add a new dts file with the configuration of the PizoZed FMC Carrier V2
> (in this case V2. Avnet has two PicoZed FMC carriers V1 and V2). For
> example: zynq-picozed-fmc-v2.dts
>
> *
>  * Avnet PicoZed FMC carrier V2 DTS
>  *
>  * Copyright (C) 2015 Xilinx, Inc.
>  *
>  * SPDX-License-Identifier: GPL-2.0+
>  */
> /dts-v1/;
> #include "zynq-picozed.dts"

should be a .dtsi file then.
>
> / {
> compatible = "xlnx,zynq-picozed", "xlnx,zynq-7000";
>
> aliases {
> mmc0 = 
> };
> };
>
>  {
> u-boot,dm-pre-reloc;
> status = "okay";
> };
>
> Do you think the is the best way?
>
>
> Best regards.
>
> Oscar Gomez Fuente
>
> On 17 October 2016 at 16:36, Michal Simek  wrote:
>
>> On 17.10.2016 16:03, Oscar Gomez Fuente wrote:
>> > Hi everyone,
>> >
>> > Sorry for the errors, I know is a very simple patch but it's my first
>> time.
>> >
>> > 
>> --
>> >> Add missing DT nodes.
>> >>
>> >> Signed-off-by: Oscar Gomez Fuente 
>> >> ---
>> >>  arch/arm/dts/zynq-picozed.dts | 20 
>> >>  1 file changed, 20 insertions(+)
>> >>
>> >> diff --git a/arch/arm/dts/zynq-picozed.dts
>> b/arch/arm/dts/zynq-picozed.dts
>> >> index 3408df8..5f703a2 100644
>> >> --- a/arch/arm/dts/zynq-picozed.dts
>> >> +++ b/arch/arm/dts/zynq-picozed.dts
>> >> @@ -26,3 +26,23 @@
>> >>   u-boot,dm-pre-reloc;
>> >>   status = "okay";
>> >>  };
>> >> +
>> >
>> > please also extended aliases list.
>> > 
>> --
>> > -> Ok, Understood.
>> >
>> > 
>> --
>> >> + {
>> >> + status = "okay";
>> >> + phy-mode = "rgmii-id";
>> >> + phy-handle = <_phy>;
>> >> +
>> >> + ethernet_phy: ethernet-phy@0 {
>> >> + reg = <0>;
>> >
>> > I expect that this is on board 88e1512
>> > 
>> --
>> > -> Yes, this is on board 88e1512. Do I have to modify anything? I think
>> > that's good, isn't it?
>>
>> nope.
>>
>> >
>> > 
>> --
>> >> + };
>> >> +};
>> >> +
>> >> + {
>> >> + u-boot,dm-pre-reloc;
>> >> + status = "okay";
>> >> + };
>> >
>> > wrong indentation here.
>> > 
>> --
>> > -> Ok, sorry.
>> >
>> > 
>> --
>> >> +
>> >> + {
>> >
>> > is this sd0 or sd1 hard IP? I expect that this is emmc right?
>> > 
>> --
>> > -> sdhci0 is sd0 IP, the Sd Card on the PicoZed FMC Carrier.
>>
>>
>> Then this shouldn't be the part of this file. picozed is SOM and you
>> should describe all stuff which are just on this module.
>> If you want to support Picozed with any carrier board you should
>> describe it separately. The best carrier and include picozed dts.
>>
>>
>> >
>> >> + u-boot,dm-pre-reloc;
>> >> + status = "okay";
>> >> +};
>> >>
>> >
>> > If everything is ok now, I'll send the patch to mainline mailing list
>> > instead of xilinx one.
>>
>> I have changed emails.
>>
>> >
>> >
>> > Another question: Do you know if there is any perl script to check dts
>> > files before sending it? I've run the ./scripts/checkpatch.pl to check
>> the
>> > arch/arm/dts/zynq-picozed.dts file and I didn't get any error.
>>
>> checkpatch is not designed to parse DTS files and I am not sure if there
>> is any parser.
>>
>> Thanks,
>> Michal
>>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

Thanks,

Moritz
___
U-Boot mailing 

Re: [U-Boot] [Resend RFC PATCH 1/2] armv8: Fix dcache disable function

2016-10-17 Thread Stephen Warren

On 10/14/2016 02:17 PM, York Sun wrote:

Current code turns off d-cache first, then flush all levels of cache.
This results data loss. As soon as d-cache is off, the dirty cache
is discarded according to the test on LS2080A. This issue was not
seen as long as external L3 cache was flushed to push the data to
main memory. However, external L3 cache is not guaranteed to have
the data. To fix this, flush the d-cache by way/set first to make
sure cache is clean before turning it off.


This patch,
Tested-by: Stephen Warren 

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


[U-Boot] [PATCH] libfdt: Sync overlay with upstream

2016-10-17 Thread Maxime Ripard
Now that the overlay code has been merge upstream, update our copy to
what's been merged, since a significant number of issues have been fixed
during the merge process.

Signed-off-by: Maxime Ripard 
---
 include/libfdt.h  |  24 --
 lib/libfdt/fdt_overlay.c  | 199 +-
 lib/libfdt/fdt_strerror.c |   3 +
 3 files changed, 147 insertions(+), 79 deletions(-)

diff --git a/include/libfdt.h b/include/libfdt.h
index 8746790a2535..e2bc2e00c184 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -79,8 +79,10 @@
 * (e.g. missing a leading / for a function which requires an
 * absolute path) */
 #define FDT_ERR_BADPHANDLE 6
-   /* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle
-* value.  phandle values of 0 and -1 are not permitted. */
+   /* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle.
+* This can be caused either by an invalid phandle property
+* length, or the phandle value was either 0 or -1, which are
+* not permitted. */
 #define FDT_ERR_BADSTATE   7
/* FDT_ERR_BADSTATE: Function was passed an incomplete device
 * tree created by the sequential-write functions, which is
@@ -126,12 +128,21 @@
 * value. For example: a property expected to contain a string list
 * is not NUL-terminated within the length of its value. */
 
-#define FDT_ERR_TOODEEP16
+#define FDT_ERR_BADOVERLAY 16
+   /* FDT_ERR_BADOVERLAY: The device tree overlay, while
+* correctly structured, cannot be applied due to some
+* unexpected or missing value, property or node. */
+
+#define FDT_ERR_NOPHANDLES 17
+   /* FDT_ERR_NOPHANDLES: The device tree doesn't have any
+* phandle available anymore without causing an overflow */
+
+#define FDT_ERR_TOODEEP18
/* FDT_ERR_TOODEEP: The depth of a node has exceeded the internal
 * libfdt limit. This can happen if you have more than
 * FDT_MAX_DEPTH nested nodes. */
 
-#define FDT_ERR_MAX16
+#define FDT_ERR_MAX18
 
 /**/
 /* Low-level functions (you probably don't need these)*/
@@ -1789,8 +1800,9 @@ int fdt_del_node(void *fdt, int nodeoffset);
  * -FDT_ERR_NOSPACE, there's not enough space in the base device tree
  * -FDT_ERR_NOTFOUND, the overlay points to some inexistant nodes or
  * properties in the base DT
- * -FDT_ERR_BADPHANDLE, the phandles in the overlay do not have the right
- * magic
+ * -FDT_ERR_BADPHANDLE,
+ * -FDT_ERR_BADOVERLAY,
+ * -FDT_ERR_NOPHANDLES,
  * -FDT_ERR_INTERNAL,
  * -FDT_ERR_BADLAYOUT,
  * -FDT_ERR_BADMAGIC,
diff --git a/lib/libfdt/fdt_overlay.c b/lib/libfdt/fdt_overlay.c
index d35ceacbf001..bb4140412971 100644
--- a/lib/libfdt/fdt_overlay.c
+++ b/lib/libfdt/fdt_overlay.c
@@ -28,19 +28,19 @@ static uint32_t overlay_get_target_phandle(const void 
*fdto, int fragment)
if (!val)
return 0;
 
-   if ((*val == (uint32_t)-1) || (len != sizeof(*val)))
+   if ((len != sizeof(*val)) || (*val == (uint32_t)-1))
return (uint32_t)-1;
 
return fdt32_to_cpu(*val);
 }
 
 /**
- * overlay_get_target - retrieves the target phandle of a fragment
+ * overlay_get_target - retrieves the offset of a fragment's target
  * @fdt: Base device tree blob
  * @fdto: Device tree overlay blob
  * @fragment: node offset of the fragment in the overlay
  *
- * overlay_get_target() retrieves the target phandle in the base
+ * overlay_get_target() retrieves the target offset in the base
  * device tree of a fragment, no matter how the actual targetting is
  * done (through a phandle or a path)
  *
@@ -53,6 +53,7 @@ static int overlay_get_target(const void *fdt, const void 
*fdto,
 {
uint32_t phandle;
const char *path;
+   int path_len;
 
/* Try first to do a phandle based lookup */
phandle = overlay_get_target_phandle(fdto, fragment);
@@ -63,9 +64,20 @@ static int overlay_get_target(const void *fdt, const void 
*fdto,
return fdt_node_offset_by_phandle(fdt, phandle);
 
/* And then a path based lookup */
-   path = fdt_getprop(fdto, fragment, "target-path", NULL);
-   if (!path)
-   return -FDT_ERR_NOTFOUND;
+   path = fdt_getprop(fdto, fragment, "target-path", _len);
+   if (!path) {
+   /*
+* If we haven't found either a target or a
+* target-path property in a node that contains a
+* __overlay__ subnode (we wouldn't be called
+* otherwise), consider it a improperly written
+* overlay
+*/
+   if (path_len == -FDT_ERR_NOTFOUND)
+   return -FDT_ERR_BADOVERLAY;
+
+   

Re: [U-Boot] [PATCH v5 1/7] ls2080: Exit dpaa only right before exiting U-Boot

2016-10-17 Thread Prabhakar Kushwaha

> -Original Message-
> From: Alexander Graf [mailto:ag...@suse.de]
> Sent: Monday, October 17, 2016 12:28 PM
> To: Prabhakar Kushwaha ; u-
> b...@lists.denx.de
> Cc: york sun 
> Subject: Re: [PATCH v5 1/7] ls2080: Exit dpaa only right before exiting U-Boot
> 
> Hi Prabhakara,
> 
> On 17.10.16 05:42, Prabhakar Kushwaha wrote:
> > Hi Alex,
> >
> >> -Original Message-
> >> From: Alexander Graf [mailto:ag...@suse.de]
> >> Sent: Saturday, October 15, 2016 3:33 PM
> >> To: u-boot@lists.denx.de
> >> Cc: york sun ; Prabhakar Kushwaha
> >> 
> >> Subject: [PATCH v5 1/7] ls2080: Exit dpaa only right before exiting U-Boot
> >>
> >> On ls2080 we have a separate network fabric component which we need to
> >> shut down before we enter Linux (or any other OS). Along with that also
> >> comes configuration of the fabric using a description file.
> >>
> >> Today we always stop and configure the fabric in the boot script and
> >> (again) exit it on device tree generation. This works ok for the normal
> >> booti case, but with bootefi the payload we're running may still want to
> >> access the network.
> >>
> >> So let's add a new fsl_mc command that defers configuration and stopping
> >> the hardware to when we actually exit U-Boot, so that we can still use
> >> the fabric from an EFI payload.
> >>
> >> For existing boot scripts, nothing should change with this patch.
> >>
> >> Signed-off-by: Alexander Graf 
> >>
> >
> > Can we get one small modification in this patch to include env variable.
> > So if a user **always** want " lazyapply", this info can be stored in env
> variable. This env variable will be used after reset without explicit u-boot
> command.
> 
> I'm not sure I understand your suggestion. We use "lazyapply" because
> EFI payloads need to be able to use the fabric for network I/O which is
> impossible after a normal apply.
> 
> Because we don't know in bootcmd whether we will end up in the old bootm
> path or in the fallback distro path (which again potentially means
> efi_loader), we have to play safe (lazyapply) by default.
> 
If I understand correctly, this patch defines a variable mc_lazy_dpl_addr.  It 
is set via " fsl_mc lazyapply DPL" u-boot command. 
If this variable set
  - Apply DPL file during bootm (no user intervention)
Else
 - Assume user to apply dpl manually by " fsl_mc apply DPL" before running 
bootm.

One modification can be done to store value mc_lazy_dpl_addr in env so that " 
fsl_mc lazyapply DPL " will not be required to run after every reset.

--prabhakar

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


Re: [U-Boot] [PATCH] test/py: Fix exception, do not parametrize with empty set

2016-10-17 Thread Brüns , Stefan
On Montag, 17. Oktober 2016 12:11:26 CEST Stephen Warren wrote:
> On 10/16/2016 12:17 PM, Stefan Brüns wrote:
> > If the parameter set is empty, the pytest setup fails:
> > ---
> > 
> > call:  > ['env__dfu_config'], function test_dfu at [...]test_dfu.py:107>
> > 
> > ---
> > 
> > This aborts pytest_runtest_makereport and later leads to an exception
> > during the report generation, as the call to log.start_section(...)
> > is never executed:
> > ---
> > 
> > Exception: Block nesting mismatch:
> > "test_dfu[env__usb_dev_port0-env__dfu_config0]" ""
> > 
> > ---
> 
> How do you trigger this? I believe my test setup has many cases where
> the test you added would trigger, but without the issues you mention,
> but I'm not 100% sure since I don't know for sure what is causing this
> issue.
> 
> Which pytest version do you have? I appear to have 2.5.1 (on Ubuntu Trusty)

1. You need "dfu_configs" to be empty
2. Maybe its pytest version dependent, IIRC I have 3.0.2

The first error above can be seen when running pytest with "--debug", it is 
written to IIRC pytestdebug.log

Kind regards,

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


Re: [U-Boot] [PATCH 2/2] net: add driver for Synopsys Ethernet QoS device

2016-10-17 Thread Stephen Warren

On 10/13/2016 05:46 PM, Joe Hershberger wrote:

On Fri, Oct 14, 2016 at 1:35 AM, Stephen Warren  wrote:

On 10/11/2016 04:48 PM, Joe Hershberger wrote:


On Tue, Oct 4, 2016 at 12:13 AM, Stephen Warren 
wrote:


On 09/23/2016 03:49 PM, Joe Hershberger wrote:



Hi Stephen,

Thanks for sending this! I have some comments below.

Cheers,
-Joe

On Mon, Sep 12, 2016 at 12:48 PM, Stephen Warren 
wrote:



From: Stephen Warren 

This driver supports the Synopsys Designware Ethernet QoS (Quality of
Service) a/k/a eqos IP block, which is a different design than the HW
supported by the existing designware.c driver. The IP supports many
options for bus type, clocking/reset structure, and feature list. This
driver currently supports the specific configuration used in NVIDIA's
Tegra186 chip, but should be extensible to other combinations quite
easily, as explained in the source.




diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c




+static int eqos_start(struct udevice *dev)




+   /* Update the MAC address */
+   val = (plat->enetaddr[5] << 8) |
+   (plat->enetaddr[4]);
+   writel(val, eqos->regs + EQOS_MAC_ADDRESS0_HIGH);
+   val = (plat->enetaddr[3] << 24) |
+   (plat->enetaddr[2] << 16) |
+   (plat->enetaddr[1] << 8) |
+   (plat->enetaddr[0]);
+   writel(val, eqos->regs + EQOS_MAC_ADDRESS0_LOW);




This should be implemented in write_hwaddr() op.



That op is never called because this driver is only instantiated by
device
tree. Since this code can't be skipped, it can't be moved to that op.



I don't understand what you're saying here. That op is called in
eth_initialize() on every device found in device tree.



Oh, so it is. I must have screwed up my tracing before.

Anyway, I still don't believe using write_hwaddr() is correct for this HW.
It's marked optional in include/net.h; it would be implemented in cases
where the MAC address should be passed to subsequent SW in Ethernet
controller registers. That's not the case here. The master location for the
MAC address is in an unrelated EEPROM that all drivers must read.


That sounds more like a NV storage location for a read_rom_hwaddr() op
to get a default mac addr that can be overridden with the env.


If the EQoS HW module contained the interface to this EEPROM, such that 
all instances of the HW module always accessed the EEPROM in the same 
way and the layout of data in the EEPROM was fixed by the HW module, 
then yes.


However, the EqoS HW module doesn't define any mechanism for 
non-volatile MAC address storage; only the runtime registers. So, we 
can't implement read_rom_hwaddr() inside the EQoS driver unfortunately.



The
write_hwaddr is about what the mac uses to filter for limiting packet
ingress. One reason to support it as an op is so that when the env var
for the mac address is changed, the mac filter in the hw is also
updated.


I believe that every time the Ethernet device is used, the start() op is 
called first, followed by packet transfer, followed by the stop() op. If 
start() always programs the MAC address, the driver will always end up 
using the value requested by the user.



Resetting
the device (as any driver would do to guarantee correct operation no matter
what SW ran before), or never initializing it in the first place (as is the
case now without any driver in U-Boot) means that those registers cannot be
assumed to contain valid data.


That's what the comment I quoted in my last mail is directly
addressing. It does make that data valid.


Resetting the device zeros out the MAC address value in the runtime 
registers. Perhaps we mean different things by "make the data valid", 
but resetting the device certainly doesn't load/activate any useful MAC 
address.



Thus SW after U-Boot won't rely on the MAC
address register values,


And yet it does in most cases, hence the comment I quoted in the last mail.


This certainly isn't true for this HW at least, and I believe aside from 
any platform-specific hacks is true fairly generally across other 
Ethernet devices too. I've checked:


a) The mainline kernel's EQoS driver.

b) The Synopsis-supplied EQoS driver as used in NVIDIA's downstream 
Tegra kernel.


In both cases, the driver retrieves the desired MAC address from sources 
other than the EQoS registers (i.e. device tree, or a system-specific 
user-space application which sets the MAC address before enabling the 
interface), and unconditionally programs that value into the EQoS 
runtime registers.


I also talked to the only user of the mainline Linux EQoS driver, and he 
also is of the opinion that we can't rely on transferring the MAC 
address between U-Boot (or any FW/...) and Linux using the EQoS registers.

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


Re: [U-Boot] [PATCH] power: twl6030: fix code refactoring

2016-10-17 Thread Tom Rini
On Mon, Oct 17, 2016 at 08:03:23PM +0300, Nicolae Rosia wrote:
> Hi,
> 
> On Sat, Oct 15, 2016 at 8:48 PM, Tom Rini  wrote:
> > I'll take this and do you want to do a follow up to make the file
> > checkpatch clean?  Thanks!
> Either way works for me, I can do the follow up to make the file
> checkpatch clean.

Follow up patch it is, 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] test/py: Fix exception, do not parametrize with empty set

2016-10-17 Thread Stephen Warren

On 10/16/2016 12:17 PM, Stefan Brüns wrote:

If the parameter set is empty, the pytest setup fails:
---
call: 
---

This aborts pytest_runtest_makereport and later leads to an exception
during the report generation, as the call to log.start_section(...)
is never executed:
---
Exception: Block nesting mismatch:
"test_dfu[env__usb_dev_port0-env__dfu_config0]" ""
---


How do you trigger this? I believe my test setup has many cases where 
the test you added would trigger, but without the issues you mention, 
but I'm not 100% sure since I don't know for sure what is causing this 
issue.


Which pytest version do you have? I appear to have 2.5.1 (on Ubuntu Trusty)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] power: twl6030: fix code refactoring

2016-10-17 Thread Nicolae Rosia
Hi,

On Sat, Oct 15, 2016 at 8:48 PM, Tom Rini  wrote:
> I'll take this and do you want to do a follow up to make the file
> checkpatch clean?  Thanks!
Either way works for me, I can do the follow up to make the file
checkpatch clean.

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


Re: [U-Boot] [PATCH v3 05/12] arm: socfpga: fpgamgr: Disable FPGA Manager for Stratix 10

2016-10-17 Thread Chin Liang See
On Sen, 2016-10-17 at 15:42 +0200, Marek Vasut wrote:
> On 10/17/2016 03:35 PM, See, Chin Liang wrote:
> > 
> > On Min, 2016-10-16 at 17:34 +0200, Marek Vasut wrote:
> > > 
> > > On 10/13/2016 10:33 AM, Chin Liang See wrote:
> > > > 
> > > > 
> > > > Disable the FPGA Manager for Stratix 10 SoC as we are not
> > > > using this for SOCVP
> > > If it's not used on SoCVP, then shouldn't this be disabled only
> > > for
> > > SoCVP instead of S10 ?
> > > 
> > We will be enhancing this code to support the hardware / emulation
> > in
> > later phase. In another word, will switch the support from SOCVP to
> > hardware once its available.
> > 
> This is confusing, what would happen if someone tries to use old u-
> boot
> on real hardware ?

It won't work until added drivers for Clocks, Reset and DDR. Current
state would be good for SOCVP only where not all hardware is simulated.

Thanks
Chin Liang

> 
> --
> 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] arm: psci: save and restore registers from r4 to r12

2016-10-17 Thread Chen-Yu Tsai
On Fri, Oct 14, 2016 at 8:14 AM, Chenhui Zhao  wrote:
> On Thu, Oct 13, 2016 at 5:52 PM, Chen-Yu Tsai  wrote:
>> On Sat, Oct 8, 2016 at 7:08 PM, Chenhui Zhao  wrote:
>>> Save and restore core registers from r4 to r12 so that PSCI code won't
>>> break their value.
>>>
>>> Signed-off-by: Chenhui Zhao 
>>> Signed-off-by: Alison Wang 
>>> Signed-off-by: Abhimanyu Saini 
>>> ---
>>>  arch/arm/cpu/armv7/psci.S | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/cpu/armv7/psci.S b/arch/arm/cpu/armv7/psci.S
>>> index 6a36208..746297c 100644
>>> --- a/arch/arm/cpu/armv7/psci.S
>>> +++ b/arch/arm/cpu/armv7/psci.S
>>> @@ -152,7 +152,7 @@ _psci_table:
>>> .word   0
>>>
>>>  _smc_psci:
>>> -   push{r4-r7,lr}
>>> +   push{r4-r12,lr}
>>
>> This change is not needed. This function only uses r4-r7.
>> Any subroutines called should save variable registers (r4-r12)
>> themselves, per the ARM calling conventions.
>>
>> ChenYu
>>
>
> I do not think it is a normal calling, instead it is an exception
> handler. In the exception context,
> it is necessary to save/restore all registers.

It should be the same for an exception handler. You only save the
registers that you clobber, at each function level.

ChenYu

>
> Sorry, my mail server has something wrong.
>
> Chenhui
>
>>>
>>> @ Switch to secure
>>> mrc p15, 0, r7, c1, c1, 0
>>> @@ -175,7 +175,7 @@ _smc_psci:
>>> @ Switch back to non-secure
>>>  2: mcr p15, 0, r7, c1, c1, 0
>>>
>>> -   pop {r4-r7, lr}
>>> +   pop {r4-r12, lr}
>>> movspc, lr  @ Return to the kernel
>>>
>>>  @ Requires dense and single-cluster CPU ID space
>>> --
>>> 1.9.1
>>>
>>> ___
>>> 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 v3 04/12] arm: socfpga: clkmgr: Separate the Clock Manager for Stratix 10

2016-10-17 Thread Marek Vasut
On 10/17/2016 05:59 PM, Chin Liang See wrote:
> On Sen, 2016-10-17 at 17:39 +0200, Marek Vasut wrote:
>> On 10/17/2016 05:28 PM, Chin Liang See wrote:
>>>
>>> On Sen, 2016-10-17 at 17:20 +0200, Marek Vasut wrote:

 On 10/17/2016 05:07 PM, Chin Liang See wrote:
>
>
> On Sen, 2016-10-17 at 15:42 +0200, Marek Vasut wrote:
>>
>>
>> On 10/17/2016 03:32 PM, See, Chin Liang wrote:
>>>
>>>
>>>
>>> On Min, 2016-10-16 at 17:33 +0200, Marek Vasut wrote:



 On 10/13/2016 10:33 AM, Chin Liang See wrote:
>
>
>
>
> Separate the Clock Manager to support both GEN5 SoC and
> Stratix 10 SoC.
>
> Signed-off-by: Chin Liang See 
> Cc: Marek Vasut 
> Cc: Dinh Nguyen 
> Cc: Ley Foon Tan 
> Cc: Tien Fong Chee 
> ---
>  arch/arm/mach-socfpga/clock_manager.c | 8 
>  1 file changed, 8 insertions(+)
>
> diff --git a/arch/arm/mach-socfpga/clock_manager.c
> b/arch/arm/mach-
> socfpga/clock_manager.c
> index aa71636..0d67b3c 100644
> --- a/arch/arm/mach-socfpga/clock_manager.c
> +++ b/arch/arm/mach-socfpga/clock_manager.c
> @@ -10,6 +10,7 @@
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>  static const struct socfpga_clock_manager
> *clock_manager_base
> =
>   (struct socfpga_clock_manager
> *)SOCFPGA_CLKMGR_ADDRESS;
>
> @@ -446,9 +447,11 @@ unsigned int
> cm_get_l4_sp_clk_hz(void)
>
>   return clock;
>  }
> +#endif /* CONFIG_TARGET_SOCFPGA_GEN5 */
>
>  unsigned int cm_get_mmc_controller_clk_hz(void)
>  {
> +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>   uint32_t reg, clock = 0;
>
>   /* identify the source of MMC clock */
> @@ -475,8 +478,12 @@ unsigned int
> cm_get_mmc_controller_clk_hz(void)
>   /* further divide by 4 as we have fixed divider
> at
> wrapper */
>   clock /= 4;
>   return clock;
> +#elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
> + return 2500;
 Is this always gonna be the case or is this S10VP
 specific ?

>
>
>
>
> +#endif /* CONFIG_TARGET_SOCFPGA_GEN5 */
>  }
>
> +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>  unsigned int cm_get_qspi_controller_clk_hz(void)
>  {
>   uint32_t reg, clock = 0;
> @@ -556,3 +563,4 @@ U_BOOT_CMD(
>   "display clocks",
>   ""
 Why does the clock display not work on S10 ? Are some
 functions
 missing?
>>> Not for SOCVP. But will be added in later stage when
>>> testing
>>> against
>>> emulation
>> How hard would it be to add this missing functionality now ?
>>
> That will take weeks as that need to be validated as whole in
> emulation
> platform.
 You mean printing a few clock information based on some values
 from
 registers would take weeks ? Why ?

>>> Oh actually I am referring all the managers code such as full Clock
>>> Manager, Reset Manager ... plus testing. Testing is the part take
>>> some
>>> significant time especially slow when come to emulation.
>> Just use empty functions for the clock init code (since it's not
>> needed
>> on the socvp) and populate the clock reporting functions. That should
>> be
>> simple, right ?
> 
> Can be done but the value won't be meaningful as the register is
> uninitialzied. Unless we hardcode to a hard value which might not sound
> right. 

Ha, I see. Is there some sane default for the SoCVP ?

-- 
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 v3 09/12] arm: socfpga: stratix10: Add board directory for Stratix 10 socdk

2016-10-17 Thread Chin Liang See
On Min, 2016-10-16 at 17:39 +0200, Marek Vasut wrote:
> On 10/13/2016 10:33 AM, Chin Liang See wrote:
> > 
> > Add board folder
> directory
> 

Will fix this.

> > 
> > for Stratix 10 SoC development kit
> > 
> > Signed-off-by: Chin Liang See 
> > Cc: Marek Vasut 
> > Cc: Dinh Nguyen 
> > Cc: Ley Foon Tan 
> > Cc: Tien Fong Chee 
> > ---
> >  board/altera/stratix10-socdk/MAINTAINERS | 7 +++
> >  board/altera/stratix10-socdk/Makefile| 7 +++
> >  board/altera/stratix10-socdk/socfpga.c   | 7 +++
> >  3 files changed, 21 insertions(+)
> >  create mode 100644 board/altera/stratix10-socdk/MAINTAINERS
> >  create mode 100644 board/altera/stratix10-socdk/Makefile
> >  create mode 100644 board/altera/stratix10-socdk/socfpga.c
> > 
> > diff --git a/board/altera/stratix10-socdk/MAINTAINERS
> > b/board/altera/stratix10-socdk/MAINTAINERS
> > new file mode 100644
> > index 000..596933c
> > --- /dev/null
> > +++ b/board/altera/stratix10-socdk/MAINTAINERS
> > @@ -0,0 +1,7 @@
> > +SOCFPGA BOARD
> > +M:   Chin-Liang See 
> > +M:   Dinh Nguyen 
> > +S:   Maintained
> > +F:   board/altera/stratix10-socdk/
> > +F:   include/configs/socfpga_stratix10_socdk.h
> > +F:   configs/socfpga_stratix10_defconfig
> > diff --git a/board/altera/stratix10-socdk/Makefile
> > b/board/altera/stratix10-socdk/Makefile
> > new file mode 100644
> > index 000..a0c8024
> > --- /dev/null
> > +++ b/board/altera/stratix10-socdk/Makefile
> > @@ -0,0 +1,7 @@
> > +#
> > +# Copyright (C) 2016, Intel Corporation
> > +#
> > +# SPDX-License-Identifier:   GPL-2.0
> > +#
> > +
> > +obj-y:= socfpga.o
> > diff --git a/board/altera/stratix10-socdk/socfpga.c
> > b/board/altera/stratix10-socdk/socfpga.c
> > new file mode 100644
> > index 000..6778c04
> > --- /dev/null
> > +++ b/board/altera/stratix10-socdk/socfpga.c
> > @@ -0,0 +1,7 @@
> > +/*
> > + * Copyright (C) 2016, Intel Corporation
> > + *
> > + * SPDX-License-Identifier:  GPL-2.0
> > + */
> > +
> > +#include 
> > 
> Is this even needed or do we still need an empty file ?

As a place holder in case customization needed for socdk. Will document
this as avoiding customer change the common code.

Thanks
Chin Liang

> 
> --
> Best regards,
> Marek Vasut
> 
> 
> 
> Confidentiality Notice.
> This message may contain information that is confidential or
> otherwise protected from disclosure. If you are not the intended
> recipient, you are hereby notified that any use, disclosure,
> dissemination, distribution, or copying of this message, or any
> attachments, is strictly prohibited. If you have received this
> message in error, please advise the sender by reply e-mail, and
> delete the message and any attachments. Thank you.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 04/12] arm: socfpga: clkmgr: Separate the Clock Manager for Stratix 10

2016-10-17 Thread Chin Liang See
On Sen, 2016-10-17 at 17:39 +0200, Marek Vasut wrote:
> On 10/17/2016 05:28 PM, Chin Liang See wrote:
> > 
> > On Sen, 2016-10-17 at 17:20 +0200, Marek Vasut wrote:
> > > 
> > > On 10/17/2016 05:07 PM, Chin Liang See wrote:
> > > > 
> > > > 
> > > > On Sen, 2016-10-17 at 15:42 +0200, Marek Vasut wrote:
> > > > > 
> > > > > 
> > > > > On 10/17/2016 03:32 PM, See, Chin Liang wrote:
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > On Min, 2016-10-16 at 17:33 +0200, Marek Vasut wrote:
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > On 10/13/2016 10:33 AM, Chin Liang See wrote:
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > Separate the Clock Manager to support both GEN5 SoC and
> > > > > > > > Stratix 10 SoC.
> > > > > > > > 
> > > > > > > > Signed-off-by: Chin Liang See 
> > > > > > > > Cc: Marek Vasut 
> > > > > > > > Cc: Dinh Nguyen 
> > > > > > > > Cc: Ley Foon Tan 
> > > > > > > > Cc: Tien Fong Chee 
> > > > > > > > ---
> > > > > > > >  arch/arm/mach-socfpga/clock_manager.c | 8 
> > > > > > > >  1 file changed, 8 insertions(+)
> > > > > > > > 
> > > > > > > > diff --git a/arch/arm/mach-socfpga/clock_manager.c
> > > > > > > > b/arch/arm/mach-
> > > > > > > > socfpga/clock_manager.c
> > > > > > > > index aa71636..0d67b3c 100644
> > > > > > > > --- a/arch/arm/mach-socfpga/clock_manager.c
> > > > > > > > +++ b/arch/arm/mach-socfpga/clock_manager.c
> > > > > > > > @@ -10,6 +10,7 @@
> > > > > > > > 
> > > > > > > >  DECLARE_GLOBAL_DATA_PTR;
> > > > > > > > 
> > > > > > > > +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
> > > > > > > >  static const struct socfpga_clock_manager
> > > > > > > > *clock_manager_base
> > > > > > > > =
> > > > > > > >   (struct socfpga_clock_manager
> > > > > > > > *)SOCFPGA_CLKMGR_ADDRESS;
> > > > > > > > 
> > > > > > > > @@ -446,9 +447,11 @@ unsigned int
> > > > > > > > cm_get_l4_sp_clk_hz(void)
> > > > > > > > 
> > > > > > > >   return clock;
> > > > > > > >  }
> > > > > > > > +#endif /* CONFIG_TARGET_SOCFPGA_GEN5 */
> > > > > > > > 
> > > > > > > >  unsigned int cm_get_mmc_controller_clk_hz(void)
> > > > > > > >  {
> > > > > > > > +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
> > > > > > > >   uint32_t reg, clock = 0;
> > > > > > > > 
> > > > > > > >   /* identify the source of MMC clock */
> > > > > > > > @@ -475,8 +478,12 @@ unsigned int
> > > > > > > > cm_get_mmc_controller_clk_hz(void)
> > > > > > > >   /* further divide by 4 as we have fixed divider
> > > > > > > > at
> > > > > > > > wrapper */
> > > > > > > >   clock /= 4;
> > > > > > > >   return clock;
> > > > > > > > +#elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
> > > > > > > > + return 2500;
> > > > > > > Is this always gonna be the case or is this S10VP
> > > > > > > specific ?
> > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > +#endif /* CONFIG_TARGET_SOCFPGA_GEN5 */
> > > > > > > >  }
> > > > > > > > 
> > > > > > > > +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
> > > > > > > >  unsigned int cm_get_qspi_controller_clk_hz(void)
> > > > > > > >  {
> > > > > > > >   uint32_t reg, clock = 0;
> > > > > > > > @@ -556,3 +563,4 @@ U_BOOT_CMD(
> > > > > > > >   "display clocks",
> > > > > > > >   ""
> > > > > > > Why does the clock display not work on S10 ? Are some
> > > > > > > functions
> > > > > > > missing?
> > > > > > Not for SOCVP. But will be added in later stage when
> > > > > > testing
> > > > > > against
> > > > > > emulation
> > > > > How hard would it be to add this missing functionality now ?
> > > > > 
> > > > That will take weeks as that need to be validated as whole in
> > > > emulation
> > > > platform.
> > > You mean printing a few clock information based on some values
> > > from
> > > registers would take weeks ? Why ?
> > > 
> > Oh actually I am referring all the managers code such as full Clock
> > Manager, Reset Manager ... plus testing. Testing is the part take
> > some
> > significant time especially slow when come to emulation.
> Just use empty functions for the clock init code (since it's not
> needed
> on the socvp) and populate the clock reporting functions. That should
> be
> simple, right ?

Can be done but the value won't be meaningful as the register is
uninitialzied. Unless we hardcode to a hard value which might not sound
right. 

Thanks
Chin Liang

> 
> --
> 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 v3 11/12] arm: socfpga: Add SPL support for Stratix 10 SoC

2016-10-17 Thread Chin Liang See
On Min, 2016-10-16 at 17:41 +0200, Marek Vasut wrote:
> On 10/13/2016 10:33 AM, Chin Liang See wrote:
> > 
> > Add SPL support for Stratix 10 SoC development kit
> > 
> > Signed-off-by: Chin Liang See 
> > Cc: Marek Vasut 
> > Cc: Dinh Nguyen 
> > Cc: Ley Foon Tan 
> > Cc: Tien Fong Chee 
> > ---
> >  arch/arm/mach-socfpga/Makefile | 13 -
> >  arch/arm/mach-socfpga/spl.c| 13 -
> >  2 files changed, 20 insertions(+), 6 deletions(-)
> > 
> > diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach-
> > socfpga/Makefile
> > index 5038919..2b00c8c 100644
> > --- a/arch/arm/mach-socfpga/Makefile
> > +++ b/arch/arm/mach-socfpga/Makefile
> > @@ -8,17 +8,20 @@
> >  #
> > 
> >  obj-y+= misc.o timer.o reset_manager.o clock_manager.o
> > board.o
> > -
> > -obj-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o
> > -
> >  obj-$(CONFIG_TARGET_SOCFPGA_STRATIX10) += mmu-arm64.o
> > 
> > +ifdef CONFIG_SPL_BUILD
> > +obj-y += spl.o
> > +obj-$(CONFIG_TARGET_SOCFPGA_GEN5) += freeze_controller.o
> > +endif
> > +
> > +ifdef CONFIG_TARGET_SOCFPGA_GEN5
> >  # QTS-generated config file wrappers
> > -obj-$(CONFIG_TARGET_SOCFPGA_GEN5)+= scan_manager.o
> > wrap_pll_config.o \
> > -fpga_manager.o
> > system_manager.o
> > +obj-y+= scan_manager.o wrap_pll_config.o fpga_manager.o
> > system_manager.o
> >  obj-$(CONFIG_SPL_BUILD) += wrap_iocsr_config.o
> > wrap_pinmux_config.o  \
> >  wrap_sdram_config.o
> >  CFLAGS_wrap_iocsr_config.o   += -I$(srctree)/board/$(BOARDDIR)
> >  CFLAGS_wrap_pinmux_config.o  += -I$(srctree)/board/$(BOARDDIR)
> >  CFLAGS_wrap_pll_config.o += -I$(srctree)/board/$(BOARDDIR)
> >  CFLAGS_wrap_sdram_config.o   += -I$(srctree)/board/$(BOARDDIR)
> > +endif
> > diff --git a/arch/arm/mach-socfpga/spl.c b/arch/arm/mach-
> > socfpga/spl.c
> > index fec4c7a..b514a01 100644
> > --- a/arch/arm/mach-socfpga/spl.c
> > +++ b/arch/arm/mach-socfpga/spl.c
> It seems like the only thing which happens in the spl.c for S10 is it
> calls spl_console_init(). In that case, just split the spl into gen5
> one
> and S10 one instead of polluting it with ifdefs.
> 

Ok can split this out as already seeing different flow for S10
hardware.

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


Re: [U-Boot] [PATCH v3 05/12] arm: socfpga: fpgamgr: Disable FPGA Manager for Stratix 10

2016-10-17 Thread Marek Vasut
On 10/17/2016 05:30 PM, Chin Liang See wrote:
> On Sen, 2016-10-17 at 17:20 +0200, Marek Vasut wrote:
>> On 10/17/2016 05:14 PM, Chin Liang See wrote:
>>>
>>> On Sen, 2016-10-17 at 15:42 +0200, Marek Vasut wrote:

 On 10/17/2016 03:35 PM, See, Chin Liang wrote:
>
>
> On Min, 2016-10-16 at 17:34 +0200, Marek Vasut wrote:
>>
>>
>> On 10/13/2016 10:33 AM, Chin Liang See wrote:
>>>
>>>
>>>
>>> Disable the FPGA Manager for Stratix 10 SoC as we are not
>>> using this for SOCVP
>> If it's not used on SoCVP, then shouldn't this be disabled
>> only
>> for
>> SoCVP instead of S10 ?
>>
> We will be enhancing this code to support the hardware /
> emulation
> in
> later phase. In another word, will switch the support from
> SOCVP to
> hardware once its available.
>
 This is confusing, what would happen if someone tries to use old
 u-
 boot
 on real hardware ?
>>> It won't work until added drivers for Clocks, Reset and DDR.
>>> Current
>>> state would be good for SOCVP only where not all hardware is
>>> simulated.
>> In that case, mark it as SoCVP to prevent confusion please.
>>
> 
> In this case, I can update the config to indicate this is S10 SOCVP.
> 
Yes please.


-- 
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 v3 05/12] arm: socfpga: fpgamgr: Disable FPGA Manager for Stratix 10

2016-10-17 Thread Chin Liang See
On Sen, 2016-10-17 at 17:20 +0200, Marek Vasut wrote:
> On 10/17/2016 05:14 PM, Chin Liang See wrote:
> > 
> > On Sen, 2016-10-17 at 15:42 +0200, Marek Vasut wrote:
> > > 
> > > On 10/17/2016 03:35 PM, See, Chin Liang wrote:
> > > > 
> > > > 
> > > > On Min, 2016-10-16 at 17:34 +0200, Marek Vasut wrote:
> > > > > 
> > > > > 
> > > > > On 10/13/2016 10:33 AM, Chin Liang See wrote:
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > Disable the FPGA Manager for Stratix 10 SoC as we are not
> > > > > > using this for SOCVP
> > > > > If it's not used on SoCVP, then shouldn't this be disabled
> > > > > only
> > > > > for
> > > > > SoCVP instead of S10 ?
> > > > > 
> > > > We will be enhancing this code to support the hardware /
> > > > emulation
> > > > in
> > > > later phase. In another word, will switch the support from
> > > > SOCVP to
> > > > hardware once its available.
> > > > 
> > > This is confusing, what would happen if someone tries to use old
> > > u-
> > > boot
> > > on real hardware ?
> > It won't work until added drivers for Clocks, Reset and DDR.
> > Current
> > state would be good for SOCVP only where not all hardware is
> > simulated.
> In that case, mark it as SoCVP to prevent confusion please.
> 

In this case, I can update the config to indicate this is S10 SOCVP.

Thanks
Chin Liang

> 
> --
> Best regards,
> Marek Vasut
> 
> 
> 
> Confidentiality Notice.
> This message may contain information that is confidential or
> otherwise protected from disclosure. If you are not the intended
> recipient, you are hereby notified that any use, disclosure,
> dissemination, distribution, or copying of this message, or any
> attachments, is strictly prohibited. If you have received this
> message in error, please advise the sender by reply e-mail, and
> delete the message and any attachments. Thank you.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 09/12] arm: socfpga: stratix10: Add board directory for Stratix 10 socdk

2016-10-17 Thread Marek Vasut
On 10/17/2016 05:32 PM, Chin Liang See wrote:
> On Min, 2016-10-16 at 17:39 +0200, Marek Vasut wrote:
>> On 10/13/2016 10:33 AM, Chin Liang See wrote:
>>>
>>> Add board folder
>> directory
>>
> 
> Will fix this.
> 
>>>
>>> for Stratix 10 SoC development kit
>>>
>>> Signed-off-by: Chin Liang See 
>>> Cc: Marek Vasut 
>>> Cc: Dinh Nguyen 
>>> Cc: Ley Foon Tan 
>>> Cc: Tien Fong Chee 
>>> ---
>>>  board/altera/stratix10-socdk/MAINTAINERS | 7 +++
>>>  board/altera/stratix10-socdk/Makefile| 7 +++
>>>  board/altera/stratix10-socdk/socfpga.c   | 7 +++
>>>  3 files changed, 21 insertions(+)
>>>  create mode 100644 board/altera/stratix10-socdk/MAINTAINERS
>>>  create mode 100644 board/altera/stratix10-socdk/Makefile
>>>  create mode 100644 board/altera/stratix10-socdk/socfpga.c
>>>
>>> diff --git a/board/altera/stratix10-socdk/MAINTAINERS
>>> b/board/altera/stratix10-socdk/MAINTAINERS
>>> new file mode 100644
>>> index 000..596933c
>>> --- /dev/null
>>> +++ b/board/altera/stratix10-socdk/MAINTAINERS
>>> @@ -0,0 +1,7 @@
>>> +SOCFPGA BOARD
>>> +M:   Chin-Liang See 
>>> +M:   Dinh Nguyen 
>>> +S:   Maintained
>>> +F:   board/altera/stratix10-socdk/
>>> +F:   include/configs/socfpga_stratix10_socdk.h
>>> +F:   configs/socfpga_stratix10_defconfig
>>> diff --git a/board/altera/stratix10-socdk/Makefile
>>> b/board/altera/stratix10-socdk/Makefile
>>> new file mode 100644
>>> index 000..a0c8024
>>> --- /dev/null
>>> +++ b/board/altera/stratix10-socdk/Makefile
>>> @@ -0,0 +1,7 @@
>>> +#
>>> +# Copyright (C) 2016, Intel Corporation
>>> +#
>>> +# SPDX-License-Identifier:   GPL-2.0
>>> +#
>>> +
>>> +obj-y:= socfpga.o
>>> diff --git a/board/altera/stratix10-socdk/socfpga.c
>>> b/board/altera/stratix10-socdk/socfpga.c
>>> new file mode 100644
>>> index 000..6778c04
>>> --- /dev/null
>>> +++ b/board/altera/stratix10-socdk/socfpga.c
>>> @@ -0,0 +1,7 @@
>>> +/*
>>> + * Copyright (C) 2016, Intel Corporation
>>> + *
>>> + * SPDX-License-Identifier:  GPL-2.0
>>> + */
>>> +
>>> +#include 
>>>
>> Is this even needed or do we still need an empty file ?
> 
> As a place holder in case customization needed for socdk. Will document
> this as avoiding customer change the common code.
> 

Customization should go into DT. On the other hand, I am fine with
having an empty file here, it's what we do for multiple boards. It would
be a bit more core work to clean this up I think.


-- 
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 v3 11/12] arm: socfpga: Add SPL support for Stratix 10 SoC

2016-10-17 Thread Marek Vasut
On 10/17/2016 05:34 PM, Chin Liang See wrote:
> On Min, 2016-10-16 at 17:41 +0200, Marek Vasut wrote:
>> On 10/13/2016 10:33 AM, Chin Liang See wrote:
>>>
>>> Add SPL support for Stratix 10 SoC development kit
>>>
>>> Signed-off-by: Chin Liang See 
>>> Cc: Marek Vasut 
>>> Cc: Dinh Nguyen 
>>> Cc: Ley Foon Tan 
>>> Cc: Tien Fong Chee 
>>> ---
>>>  arch/arm/mach-socfpga/Makefile | 13 -
>>>  arch/arm/mach-socfpga/spl.c| 13 -
>>>  2 files changed, 20 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-socfpga/Makefile b/arch/arm/mach-
>>> socfpga/Makefile
>>> index 5038919..2b00c8c 100644
>>> --- a/arch/arm/mach-socfpga/Makefile
>>> +++ b/arch/arm/mach-socfpga/Makefile
>>> @@ -8,17 +8,20 @@
>>>  #
>>>
>>>  obj-y+= misc.o timer.o reset_manager.o clock_manager.o
>>> board.o
>>> -
>>> -obj-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o
>>> -
>>>  obj-$(CONFIG_TARGET_SOCFPGA_STRATIX10) += mmu-arm64.o
>>>
>>> +ifdef CONFIG_SPL_BUILD
>>> +obj-y += spl.o
>>> +obj-$(CONFIG_TARGET_SOCFPGA_GEN5) += freeze_controller.o
>>> +endif
>>> +
>>> +ifdef CONFIG_TARGET_SOCFPGA_GEN5
>>>  # QTS-generated config file wrappers
>>> -obj-$(CONFIG_TARGET_SOCFPGA_GEN5)+= scan_manager.o
>>> wrap_pll_config.o \
>>> -fpga_manager.o
>>> system_manager.o
>>> +obj-y+= scan_manager.o wrap_pll_config.o fpga_manager.o
>>> system_manager.o
>>>  obj-$(CONFIG_SPL_BUILD) += wrap_iocsr_config.o
>>> wrap_pinmux_config.o  \
>>>  wrap_sdram_config.o
>>>  CFLAGS_wrap_iocsr_config.o   += -I$(srctree)/board/$(BOARDDIR)
>>>  CFLAGS_wrap_pinmux_config.o  += -I$(srctree)/board/$(BOARDDIR)
>>>  CFLAGS_wrap_pll_config.o += -I$(srctree)/board/$(BOARDDIR)
>>>  CFLAGS_wrap_sdram_config.o   += -I$(srctree)/board/$(BOARDDIR)
>>> +endif
>>> diff --git a/arch/arm/mach-socfpga/spl.c b/arch/arm/mach-
>>> socfpga/spl.c
>>> index fec4c7a..b514a01 100644
>>> --- a/arch/arm/mach-socfpga/spl.c
>>> +++ b/arch/arm/mach-socfpga/spl.c
>> It seems like the only thing which happens in the spl.c for S10 is it
>> calls spl_console_init(). In that case, just split the spl into gen5
>> one
>> and S10 one instead of polluting it with ifdefs.
>>
> 
> Ok can split this out as already seeing different flow for S10
> hardware.

Thanks


-- 
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 v3 04/12] arm: socfpga: clkmgr: Separate the Clock Manager for Stratix 10

2016-10-17 Thread Marek Vasut
On 10/17/2016 05:28 PM, Chin Liang See wrote:
> On Sen, 2016-10-17 at 17:20 +0200, Marek Vasut wrote:
>> On 10/17/2016 05:07 PM, Chin Liang See wrote:
>>>
>>> On Sen, 2016-10-17 at 15:42 +0200, Marek Vasut wrote:

 On 10/17/2016 03:32 PM, See, Chin Liang wrote:
>
>
> On Min, 2016-10-16 at 17:33 +0200, Marek Vasut wrote:
>>
>>
>> On 10/13/2016 10:33 AM, Chin Liang See wrote:
>>>
>>>
>>>
>>> Separate the Clock Manager to support both GEN5 SoC and
>>> Stratix 10 SoC.
>>>
>>> Signed-off-by: Chin Liang See 
>>> Cc: Marek Vasut 
>>> Cc: Dinh Nguyen 
>>> Cc: Ley Foon Tan 
>>> Cc: Tien Fong Chee 
>>> ---
>>>  arch/arm/mach-socfpga/clock_manager.c | 8 
>>>  1 file changed, 8 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-socfpga/clock_manager.c
>>> b/arch/arm/mach-
>>> socfpga/clock_manager.c
>>> index aa71636..0d67b3c 100644
>>> --- a/arch/arm/mach-socfpga/clock_manager.c
>>> +++ b/arch/arm/mach-socfpga/clock_manager.c
>>> @@ -10,6 +10,7 @@
>>>
>>>  DECLARE_GLOBAL_DATA_PTR;
>>>
>>> +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>>>  static const struct socfpga_clock_manager
>>> *clock_manager_base
>>> =
>>>   (struct socfpga_clock_manager
>>> *)SOCFPGA_CLKMGR_ADDRESS;
>>>
>>> @@ -446,9 +447,11 @@ unsigned int cm_get_l4_sp_clk_hz(void)
>>>
>>>   return clock;
>>>  }
>>> +#endif /* CONFIG_TARGET_SOCFPGA_GEN5 */
>>>
>>>  unsigned int cm_get_mmc_controller_clk_hz(void)
>>>  {
>>> +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>>>   uint32_t reg, clock = 0;
>>>
>>>   /* identify the source of MMC clock */
>>> @@ -475,8 +478,12 @@ unsigned int
>>> cm_get_mmc_controller_clk_hz(void)
>>>   /* further divide by 4 as we have fixed divider at
>>> wrapper */
>>>   clock /= 4;
>>>   return clock;
>>> +#elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
>>> + return 2500;
>> Is this always gonna be the case or is this S10VP specific ?
>>
>>>
>>>
>>>
>>> +#endif /* CONFIG_TARGET_SOCFPGA_GEN5 */
>>>  }
>>>
>>> +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>>>  unsigned int cm_get_qspi_controller_clk_hz(void)
>>>  {
>>>   uint32_t reg, clock = 0;
>>> @@ -556,3 +563,4 @@ U_BOOT_CMD(
>>>   "display clocks",
>>>   ""
>> Why does the clock display not work on S10 ? Are some
>> functions
>> missing?
> Not for SOCVP. But will be added in later stage when testing
> against
> emulation
 How hard would it be to add this missing functionality now ?

>>> That will take weeks as that need to be validated as whole in
>>> emulation
>>> platform.
>> You mean printing a few clock information based on some values from
>> registers would take weeks ? Why ?
>>
> 
> Oh actually I am referring all the managers code such as full Clock
> Manager, Reset Manager ... plus testing. Testing is the part take some
> significant time especially slow when come to emulation.

Just use empty functions for the clock init code (since it's not needed
on the socvp) and populate the clock reporting functions. That should be
simple, right ?

-- 
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 v3 01/12] arm: socfpga: stratix10: Add SOCFPGA Stratix10 base address

2016-10-17 Thread Chin Liang See
On Sen, 2016-10-17 at 15:40 +0200, Marek Vasut wrote:
> On 10/17/2016 03:26 PM, See, Chin Liang wrote:
> > 
> > On Min, 2016-10-16 at 17:31 +0200, Marek Vasut wrote:
> > > 
> > > On 10/13/2016 10:32 AM, Chin Liang See wrote:
> > > > 
> > > > 
> > > > Add base address header file for Stratix10 SoC
> > > > 
> > > > Signed-off-by: Chin Liang See 
> > > > Cc: Marek Vasut 
> > > > Cc: Dinh Nguyen 
> > > > Cc: Ley Foon Tan 
> > > > Cc: Tien Fong Chee 
> > > > Acked-by: Marek Vasut 
> > > > ---
> > > >  arch/arm/mach-socfpga/include/mach/base_addr_s10.h | 48
> > > > ++
> > > >  1 file changed, 48 insertions(+)
> > > >  create mode 100644 arch/arm/mach-
> > > > socfpga/include/mach/base_addr_s10.h
> > > > 
> > > OK, V3 patch, but where's the changelog ? ;-)
> > > 
> > Oh I just added the changelog if particular patch is modified. For
> > this
> > patch 1/12, no change for v2 to v3 :)
> OK, got it.
> 
> [...]
> 
> > 
> > > 
> > > Confidentiality Notice.
> Oh yeah ?
> 

Strange as I didn't see this when using Intel email send to my gmail.
In this case, better use back my old altera.com while sorting with IT.

Thanks
Chin Liang

> > 
> > > 
> > > This message may contain information that is confidential or
> > > otherwise protected from disclosure. If you are not the intended
> > > recipient, you are hereby notified that any use, disclosure,
> > > dissemination, distribution, or copying of this message, or any
> > > attachments, is strictly prohibited. If you have received this
> > > message in error, please advise the sender by reply e-mail, and
> > > delete the message and any attachments. Thank you.
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: zynq: Extend picozed board support

2016-10-17 Thread Oscar Gomez Fuente
Ok Michal,

Then you're suggesting change the zynq-picozed.dts file to:

diff --git a/arch/arm/dts/zynq-picozed.dts b/arch/arm/dts/zynq-picozed.dts
index 3408df8..d8ed298 100644
--- a/arch/arm/dts/zynq-picozed.dts
+++ b/arch/arm/dts/zynq-picozed.dts
@@ -14,6 +14,8 @@

aliases {
serial0 = 
+   spi0 = 
+   ethernet0 = 
};

memory {
@@ -26,3 +28,18 @@
u-boot,dm-pre-reloc;
status = "okay";
 };
+
+ {
+   u-boot,dm-pre-reloc;
+   status = "okay";
+};
+
+ {
+   status = "okay";
+   phy-mode = "rgmii-id";
+   phy-handle = <_phy>;
+
+   ethernet_phy: ethernet-phy@0 {
+   reg = <0>;
+   };
+};

And add a new dts file with the configuration of the PizoZed FMC Carrier V2
(in this case V2. Avnet has two PicoZed FMC carriers V1 and V2). For
example: zynq-picozed-fmc-v2.dts

*
 * Avnet PicoZed FMC carrier V2 DTS
 *
 * Copyright (C) 2015 Xilinx, Inc.
 *
 * SPDX-License-Identifier: GPL-2.0+
 */
/dts-v1/;
#include "zynq-picozed.dts"

/ {
compatible = "xlnx,zynq-picozed", "xlnx,zynq-7000";

aliases {
mmc0 = 
};
};

 {
u-boot,dm-pre-reloc;
status = "okay";
};

Do you think the is the best way?


Best regards.

Oscar Gomez Fuente

On 17 October 2016 at 16:36, Michal Simek  wrote:

> On 17.10.2016 16:03, Oscar Gomez Fuente wrote:
> > Hi everyone,
> >
> > Sorry for the errors, I know is a very simple patch but it's my first
> time.
> >
> > 
> --
> >> Add missing DT nodes.
> >>
> >> Signed-off-by: Oscar Gomez Fuente 
> >> ---
> >>  arch/arm/dts/zynq-picozed.dts | 20 
> >>  1 file changed, 20 insertions(+)
> >>
> >> diff --git a/arch/arm/dts/zynq-picozed.dts
> b/arch/arm/dts/zynq-picozed.dts
> >> index 3408df8..5f703a2 100644
> >> --- a/arch/arm/dts/zynq-picozed.dts
> >> +++ b/arch/arm/dts/zynq-picozed.dts
> >> @@ -26,3 +26,23 @@
> >>   u-boot,dm-pre-reloc;
> >>   status = "okay";
> >>  };
> >> +
> >
> > please also extended aliases list.
> > 
> --
> > -> Ok, Understood.
> >
> > 
> --
> >> + {
> >> + status = "okay";
> >> + phy-mode = "rgmii-id";
> >> + phy-handle = <_phy>;
> >> +
> >> + ethernet_phy: ethernet-phy@0 {
> >> + reg = <0>;
> >
> > I expect that this is on board 88e1512
> > 
> --
> > -> Yes, this is on board 88e1512. Do I have to modify anything? I think
> > that's good, isn't it?
>
> nope.
>
> >
> > 
> --
> >> + };
> >> +};
> >> +
> >> + {
> >> + u-boot,dm-pre-reloc;
> >> + status = "okay";
> >> + };
> >
> > wrong indentation here.
> > 
> --
> > -> Ok, sorry.
> >
> > 
> --
> >> +
> >> + {
> >
> > is this sd0 or sd1 hard IP? I expect that this is emmc right?
> > 
> --
> > -> sdhci0 is sd0 IP, the Sd Card on the PicoZed FMC Carrier.
>
>
> Then this shouldn't be the part of this file. picozed is SOM and you
> should describe all stuff which are just on this module.
> If you want to support Picozed with any carrier board you should
> describe it separately. The best carrier and include picozed dts.
>
>
> >
> >> + u-boot,dm-pre-reloc;
> >> + status = "okay";
> >> +};
> >>
> >
> > If everything is ok now, I'll send the patch to mainline mailing list
> > instead of xilinx one.
>
> I have changed emails.
>
> >
> >
> > Another question: Do you know if there is any perl script to check dts
> > files before sending it? I've run the ./scripts/checkpatch.pl to check
> the
> > arch/arm/dts/zynq-picozed.dts file and I didn't get any error.
>
> checkpatch is not designed to parse DTS files and I am not sure if there
> is any parser.
>
> Thanks,
> Michal
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 04/12] arm: socfpga: clkmgr: Separate the Clock Manager for Stratix 10

2016-10-17 Thread Chin Liang See
On Sen, 2016-10-17 at 17:20 +0200, Marek Vasut wrote:
> On 10/17/2016 05:07 PM, Chin Liang See wrote:
> > 
> > On Sen, 2016-10-17 at 15:42 +0200, Marek Vasut wrote:
> > > 
> > > On 10/17/2016 03:32 PM, See, Chin Liang wrote:
> > > > 
> > > > 
> > > > On Min, 2016-10-16 at 17:33 +0200, Marek Vasut wrote:
> > > > > 
> > > > > 
> > > > > On 10/13/2016 10:33 AM, Chin Liang See wrote:
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > Separate the Clock Manager to support both GEN5 SoC and
> > > > > > Stratix 10 SoC.
> > > > > > 
> > > > > > Signed-off-by: Chin Liang See 
> > > > > > Cc: Marek Vasut 
> > > > > > Cc: Dinh Nguyen 
> > > > > > Cc: Ley Foon Tan 
> > > > > > Cc: Tien Fong Chee 
> > > > > > ---
> > > > > >  arch/arm/mach-socfpga/clock_manager.c | 8 
> > > > > >  1 file changed, 8 insertions(+)
> > > > > > 
> > > > > > diff --git a/arch/arm/mach-socfpga/clock_manager.c
> > > > > > b/arch/arm/mach-
> > > > > > socfpga/clock_manager.c
> > > > > > index aa71636..0d67b3c 100644
> > > > > > --- a/arch/arm/mach-socfpga/clock_manager.c
> > > > > > +++ b/arch/arm/mach-socfpga/clock_manager.c
> > > > > > @@ -10,6 +10,7 @@
> > > > > > 
> > > > > >  DECLARE_GLOBAL_DATA_PTR;
> > > > > > 
> > > > > > +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
> > > > > >  static const struct socfpga_clock_manager
> > > > > > *clock_manager_base
> > > > > > =
> > > > > >   (struct socfpga_clock_manager
> > > > > > *)SOCFPGA_CLKMGR_ADDRESS;
> > > > > > 
> > > > > > @@ -446,9 +447,11 @@ unsigned int cm_get_l4_sp_clk_hz(void)
> > > > > > 
> > > > > >   return clock;
> > > > > >  }
> > > > > > +#endif /* CONFIG_TARGET_SOCFPGA_GEN5 */
> > > > > > 
> > > > > >  unsigned int cm_get_mmc_controller_clk_hz(void)
> > > > > >  {
> > > > > > +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
> > > > > >   uint32_t reg, clock = 0;
> > > > > > 
> > > > > >   /* identify the source of MMC clock */
> > > > > > @@ -475,8 +478,12 @@ unsigned int
> > > > > > cm_get_mmc_controller_clk_hz(void)
> > > > > >   /* further divide by 4 as we have fixed divider at
> > > > > > wrapper */
> > > > > >   clock /= 4;
> > > > > >   return clock;
> > > > > > +#elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
> > > > > > + return 2500;
> > > > > Is this always gonna be the case or is this S10VP specific ?
> > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > +#endif /* CONFIG_TARGET_SOCFPGA_GEN5 */
> > > > > >  }
> > > > > > 
> > > > > > +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
> > > > > >  unsigned int cm_get_qspi_controller_clk_hz(void)
> > > > > >  {
> > > > > >   uint32_t reg, clock = 0;
> > > > > > @@ -556,3 +563,4 @@ U_BOOT_CMD(
> > > > > >   "display clocks",
> > > > > >   ""
> > > > > Why does the clock display not work on S10 ? Are some
> > > > > functions
> > > > > missing?
> > > > Not for SOCVP. But will be added in later stage when testing
> > > > against
> > > > emulation
> > > How hard would it be to add this missing functionality now ?
> > > 
> > That will take weeks as that need to be validated as whole in
> > emulation
> > platform.
> You mean printing a few clock information based on some values from
> registers would take weeks ? Why ?
> 

Oh actually I am referring all the managers code such as full Clock
Manager, Reset Manager ... plus testing. Testing is the part take some
significant time especially slow when come to emulation.

Thanks
Chin Liang

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


Re: [U-Boot] [PATCH 3/3] mx6: synchronize SPL to u-boot offset

2016-10-17 Thread Max Krummenacher
2016-10-17 14:45 GMT+02:00 Marek Vasut :
> On 10/17/2016 02:28 PM, Max Krummenacher wrote:
>> Hi Marek
>>
>>  #if defined(CONFIG_SPL_MMC_SUPPORT)
>>  #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR138 /*
>> offset 69KB */
>> +#define CONFIG_SPL_PAD_TO  0x11000 /* offset
>> 68KB */
>
> Does this mess up boards which can boot from both SD and other boot
> media (NAND, SPI NOR, PNOR...) ?

 Good point.
 CONFIG_SPL_PAD_TO is used to create the combined SPL/U-Boot binary.
 While I have not found any use of this by any config which includes
 imx6_spl.h it might hinder future boards.
 So it's probably best to define CONFIG_SPL_PAD_TO in the individual
 board configs and skip this patch.
>>>
>>> So how did you come up with this patch ? What was the thought process?
>>>
>> I'm preparing patches for submission of new boards, Colibri iMX6, Apalis 
>> iMX6.
>> They rely on this patchset
>> https://www.mail-archive.com/u-boot@lists.denx.de/msg227944.html, so
>> the board patches are not yet ready for submission.
>
> OT: Can you make those boards load u-boot.img from extfs partition instead ?

I probably could but did not try.

Also it would change the way we use U-Boot across our module family
and I'm worried that we more often need to recover over USB due to a
corrupted filesystem.
On top of that I made some measurements on loading the kernel from an
ext2 instead of an fat fs and have seen differences bigger than 100ms.
So parsing into a filesystem twice would probably add even more
overhead.

Max

>
>> I forward ported from a downstream 2015.04 U-Boot where 'make
>> u-boot-with-spl.imx' used an offset of 68KB between SPL and U-Boot
>> binary matching the SPL code which later loads U-Boot.
>> With the current master it used an offset of 64KB resulting in an SPL
>> not loading U-Boot.
>> Probably the 4KB stem from now counting SPL_PAD_TO from the start of
>> the IVT/DCD region and earlier counting from the start of SPL.
>
> I see, thanks for clarifying.
>
>> Max
>>
>
>
> --
> 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 v3 07/12] arm: socfpga: sysmgr: Disable System Manager for Stratix 10

2016-10-17 Thread Chin Liang See
On Min, 2016-10-16 at 17:38 +0200, Marek Vasut wrote:
> On 10/13/2016 10:33 AM, Chin Liang See wrote:
> > 
> > Disable the System Manager for Stratix 10 SoC as we are not
> > using this for SOCVP
> So I wonder, shouldn't we introduce some bool Kconfig entry,
> something
> like CONFIG_SOCFPGA_HAS_SYSTEMMANAGER and then make each target (AV,
> CV,
> S10, S10SoCVP...) select whether it has it or not ? I think this
> might
> make things a bit cleaner.

This sound a good idea. Let's do this then.

Thanks
Chin Liang

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


Re: [U-Boot] [PATCH v3 04/12] arm: socfpga: clkmgr: Separate the Clock Manager for Stratix 10

2016-10-17 Thread Marek Vasut
On 10/17/2016 05:07 PM, Chin Liang See wrote:
> On Sen, 2016-10-17 at 15:42 +0200, Marek Vasut wrote:
>> On 10/17/2016 03:32 PM, See, Chin Liang wrote:
>>>
>>> On Min, 2016-10-16 at 17:33 +0200, Marek Vasut wrote:

 On 10/13/2016 10:33 AM, Chin Liang See wrote:
>
>
> Separate the Clock Manager to support both GEN5 SoC and
> Stratix 10 SoC.
>
> Signed-off-by: Chin Liang See 
> Cc: Marek Vasut 
> Cc: Dinh Nguyen 
> Cc: Ley Foon Tan 
> Cc: Tien Fong Chee 
> ---
>  arch/arm/mach-socfpga/clock_manager.c | 8 
>  1 file changed, 8 insertions(+)
>
> diff --git a/arch/arm/mach-socfpga/clock_manager.c
> b/arch/arm/mach-
> socfpga/clock_manager.c
> index aa71636..0d67b3c 100644
> --- a/arch/arm/mach-socfpga/clock_manager.c
> +++ b/arch/arm/mach-socfpga/clock_manager.c
> @@ -10,6 +10,7 @@
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>  static const struct socfpga_clock_manager *clock_manager_base
> =
>   (struct socfpga_clock_manager *)SOCFPGA_CLKMGR_ADDRESS;
>
> @@ -446,9 +447,11 @@ unsigned int cm_get_l4_sp_clk_hz(void)
>
>   return clock;
>  }
> +#endif /* CONFIG_TARGET_SOCFPGA_GEN5 */
>
>  unsigned int cm_get_mmc_controller_clk_hz(void)
>  {
> +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>   uint32_t reg, clock = 0;
>
>   /* identify the source of MMC clock */
> @@ -475,8 +478,12 @@ unsigned int
> cm_get_mmc_controller_clk_hz(void)
>   /* further divide by 4 as we have fixed divider at
> wrapper */
>   clock /= 4;
>   return clock;
> +#elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
> + return 2500;
 Is this always gonna be the case or is this S10VP specific ?

>
>
> +#endif /* CONFIG_TARGET_SOCFPGA_GEN5 */
>  }
>
> +#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
>  unsigned int cm_get_qspi_controller_clk_hz(void)
>  {
>   uint32_t reg, clock = 0;
> @@ -556,3 +563,4 @@ U_BOOT_CMD(
>   "display clocks",
>   ""
 Why does the clock display not work on S10 ? Are some functions
 missing?
>>> Not for SOCVP. But will be added in later stage when testing
>>> against
>>> emulation
>> How hard would it be to add this missing functionality now ?
>>
> 
> That will take weeks as that need to be validated as whole in emulation
> platform.

You mean printing a few clock information based on some values from
registers would take weeks ? Why ?

 Maybe we should split the clock manager into common part and then
 gen5
 and gen10 specific parts ?
>>> Ok, we can do that as initially we were worried too many files
>>> created
>>> within mach-socfpga.
>> It's probably better than polluting the clock code with ifdefs.
>>
> 
> Ok, we have an consensus then

OK

> Thanks
> Chin Liang
> 
> 
>> [...]
>>
>>


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


  1   2   >