Re: [U-Boot] [PATCH v3 0/9] sf: Update flash params for supported read commands and sector size

2014-12-17 Thread Jagan Teki
On 15 December 2014 at 19:21, Bin Meng bmeng...@gmail.com wrote:
 Hi Jagan,

 On Thu, Dec 11, 2014 at 3:40 PM, Bin Meng bmeng...@gmail.com wrote:
 Hi Jagan,

 On Thu, Dec 11, 2014 at 3:26 PM, Jagan Teki jagannadh.t...@gmail.com wrote:
 Hi Bin,

 On 11 December 2014 at 08:34, Bin Meng bmeng...@gmail.com wrote:
 Hi Jagan,

 On Thu, Dec 11, 2014 at 2:41 AM, Jagan Teki jagannadh.t...@gmail.com 
 wrote:
 Hi Bin,

 On 10 December 2014 at 18:21, Bin Meng bmeng...@gmail.com wrote:
 This series update SPI flash supported read commands per datasheet
 in the flash params table, and change flash sector size to 4KiB as
 long as flash supports sector erase (20h) command, to ensure
 'sf erase offset +len' work on 4KiB boundary instead of 64KiB when
 given SECT_4K.

 Changes in v3:
 - Rebase with Jagan's patch series @ 
 http://patchwork.ozlabs.org/patch/419154/


 Bin Meng (9):
   sf: Update SST flash params
   sf: Update Atmel flash params
   sf: Update EON flash params
   sf: Update GigaDevice flash params
   sf: Update Macronix flash params
   sf: Update Spansion flash params
   sf: Update Micron flash params
   sf: Update Winbond flash params
   sf: Give proper spacing between flash table params

 Thanks for the updates - have you verified these changes?

 I verified some, but not all of these flash parts. The update is based
 on flash datasheet, so if something is broken, eg before this series
 the flash advertises only READ_NORM and after my series it is changed
 to READ_FULL, and let's say QUAD_IO_FAST is not working, it is very
 likely that the SPI controller driver has some bugs when supporting
 QUAD_IO_FAST.

 Since these updates were tested before, I will skip these for this PR.
 Will test all the rest (except these) and send the PR soon.

 Let me know your inputs?

 I am fine, as long as this PR will not contains other commits which
 modify the same sf_params.c to introduce more flash support. We can
 test these updates and if everything looks fine, apply these first and
 ask other commits to rebase on this series to introduce more flash
 support.


 Do you have any additional comments about this patch series besides
 the S25FL128S_64K and S25FL256S_64K sector size? If not, I can send
 the v4.

I'm thinking about the other flashes too,  since these params were taken from
previous working and Linux mtd.

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


Re: [U-Boot] [PATCH v3 0/9] sf: Update flash params for supported read commands and sector size

2014-12-17 Thread Bin Meng
Hi Jagan,

On Wed, Dec 17, 2014 at 3:59 PM, Jagan Teki jagannadh.t...@gmail.com wrote:
 On 15 December 2014 at 19:21, Bin Meng bmeng...@gmail.com wrote:
 Hi Jagan,

 On Thu, Dec 11, 2014 at 3:40 PM, Bin Meng bmeng...@gmail.com wrote:
 Hi Jagan,

 On Thu, Dec 11, 2014 at 3:26 PM, Jagan Teki jagannadh.t...@gmail.com 
 wrote:
 Hi Bin,

 On 11 December 2014 at 08:34, Bin Meng bmeng...@gmail.com wrote:
 Hi Jagan,

 On Thu, Dec 11, 2014 at 2:41 AM, Jagan Teki jagannadh.t...@gmail.com 
 wrote:
 Hi Bin,

 On 10 December 2014 at 18:21, Bin Meng bmeng...@gmail.com wrote:
 This series update SPI flash supported read commands per datasheet
 in the flash params table, and change flash sector size to 4KiB as
 long as flash supports sector erase (20h) command, to ensure
 'sf erase offset +len' work on 4KiB boundary instead of 64KiB when
 given SECT_4K.

 Changes in v3:
 - Rebase with Jagan's patch series @ 
 http://patchwork.ozlabs.org/patch/419154/


 Bin Meng (9):
   sf: Update SST flash params
   sf: Update Atmel flash params
   sf: Update EON flash params
   sf: Update GigaDevice flash params
   sf: Update Macronix flash params
   sf: Update Spansion flash params
   sf: Update Micron flash params
   sf: Update Winbond flash params
   sf: Give proper spacing between flash table params

 Thanks for the updates - have you verified these changes?

 I verified some, but not all of these flash parts. The update is based
 on flash datasheet, so if something is broken, eg before this series
 the flash advertises only READ_NORM and after my series it is changed
 to READ_FULL, and let's say QUAD_IO_FAST is not working, it is very
 likely that the SPI controller driver has some bugs when supporting
 QUAD_IO_FAST.

 Since these updates were tested before, I will skip these for this PR.
 Will test all the rest (except these) and send the PR soon.

 Let me know your inputs?

 I am fine, as long as this PR will not contains other commits which
 modify the same sf_params.c to introduce more flash support. We can
 test these updates and if everything looks fine, apply these first and
 ask other commits to rebase on this series to introduce more flash
 support.


 Do you have any additional comments about this patch series besides
 the S25FL128S_64K and S25FL256S_64K sector size? If not, I can send
 the v4.

 I'm thinking about the other flashes too,  since these params were taken from
 previous working and Linux mtd.


You mean 'thinking about' or 'testing'? I should say previously they
might not be 100% working as per datasheet some flash params currently
are apparently wrong.

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


Re: [U-Boot] [PATCH v4 03/15] x86: Convert microcode format to device-tree-only

2014-12-17 Thread Bin Meng
Hi,

On Wed, Dec 17, 2014 at 3:50 PM, Bin Meng bmeng...@gmail.com wrote:
 From: Simon Glass s...@chromium.org

 To avoid having two microcode formats, adjust the build system to support
 obtaining the microcode from the device tree, even in the case where it
 must be made available before the device tree can be accessed.

 Signed-off-by: Simon Glass s...@chromium.org

 ---

 Changes in v4:
 - Squash the microcode.dtsi to patch#1 in the v4 series

 Changes in v3: None
 Changes in v2: None

  Makefile |  4 +++-
  arch/x86/cpu/queensbay/tnc_car.S | 11 ---
  arch/x86/dts/crownbay.dts|  7 +++
  3 files changed, 14 insertions(+), 8 deletions(-)

 diff --git a/Makefile b/Makefile
 index fd24cde..d4e60e8 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -947,7 +947,9 @@ ifneq ($(CONFIG_X86_RESET_VECTOR),)
  rom: u-boot.rom FORCE

  IFDTOOL=$(objtree)/tools/ifdtool
 -IFDTOOL_FLAGS  = -w $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-dtb.bin
 +IFDTOOL_FLAGS  = -f 0:$(objtree)/u-boot.dtb
 +IFDTOOL_FLAGS += -m 0x$(shell $(NM) u-boot |grep _dt_ucode_base_size |cut 
 -d' ' -f1)
 +IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot.bin
  IFDTOOL_FLAGS += -w $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin

  ifneq ($(CONFIG_HAVE_INTEL_ME),)
 diff --git a/arch/x86/cpu/queensbay/tnc_car.S 
 b/arch/x86/cpu/queensbay/tnc_car.S
 index 6834a64..2e9139e 100644
 --- a/arch/x86/cpu/queensbay/tnc_car.S
 +++ b/arch/x86/cpu/queensbay/tnc_car.S
 @@ -116,12 +116,9 @@ temp_ram_init_romstack:
 .long   temp_ram_init_ret
 .long   temp_ram_init_params
  temp_ram_init_params:
 -   .long   ucode_start /* microcode base */
 -   .long   ucode_size  /* microcode size */
 +_dt_ucode_base_size:
 +   /* These next two fields are filled in by ifdtool */
 +   .long   0   /* microcode base */
 +   .long   0   /* microcode size */
 .long   CONFIG_SYS_MONITOR_BASE /* code region base */
 .long   CONFIG_SYS_MONITOR_LEN  /* code region size */
 -
 -   .balign 4
 -ucode_start:
 -   .include arch/x86/cpu/queensbay/M0220661105.inc
 -ucode_size = ( . - ucode_start)
 diff --git a/arch/x86/dts/crownbay.dts b/arch/x86/dts/crownbay.dts
 index 399dafb..3f43f3c 100644
 --- a/arch/x86/dts/crownbay.dts
 +++ b/arch/x86/dts/crownbay.dts
 @@ -50,4 +50,11 @@
 memory-map = 0xffe0 0x0020;
 };
 };
 +
 +   microcode {
 +   update@0 {
 +#include microcode/m0220661105_cv.dtsi
 +   };
 +   };
 +
  };
 --

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


Re: [U-Boot] [PATCH v2 6/6] x86: Convert microcode format to device-tree-only

2014-12-17 Thread Bin Meng
Hi Simon,

On Wed, Dec 17, 2014 at 10:49 AM, Simon Glass s...@chromium.org wrote:
 Hi Bin,

 On 16 December 2014 at 03:01, Bin Meng bmeng...@gmail.com wrote:
 On Tue, Dec 16, 2014 at 1:02 PM, Simon Glass s...@chromium.org wrote:
 To avoid having two microcode formats, adjust the build system to support
 obtaining the microcode from the device tree, even in the case where it
 must be made available before the device tree can be accessed.

 Also move the microcode for queensbay (unfortunately the wrong version).

 Signed-off-by: Simon Glass s...@chromium.org
 ---

 Changes in v2:
 - Update microcode file to version 5_cv
 - Drop patches that have already been applied

  Makefile   |4 +-
  arch/x86/cpu/queensbay/M0220661105.inc | 1288 
 
  arch/x86/cpu/queensbay/tnc_car.S   |   11 +-
  arch/x86/dts/crownbay.dts  |7 +
  arch/x86/dts/microcode/m0220661105_cv.dtsi |  366 
  5 files changed, 380 insertions(+), 1296 deletions(-)
  delete mode 100644 arch/x86/cpu/queensbay/M0220661105.inc
  create mode 100644 arch/x86/dts/microcode/m0220661105_cv.dtsi

 [snip]
 --

 Reviewed-by: Bin Meng bmeng...@gmail.com

 Tested on Intel Crown Bay

 Tested-by: Bin Meng bmeng...@gmail.com

 This patch is for you, I cannot apply it as it depends on one of your
 patches. If I apply your patch then it breaks the build.

 So it would be best if you squashed this patch into one of yours. I'll
 push everything to x86/master (except the microcode patch which needs
 another rev) ready for you to rebase your patches.

 Regards,
 Simon

This patch is integrated into my series @
http://patchwork.ozlabs.org/patch/422192/. Thanks!

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


Re: [U-Boot] [PATCH 25/25] x86: Add a README.x86 for U-Boot on x86 support

2014-12-17 Thread Bin Meng
Hi Pavel,

On Tue, Dec 16, 2014 at 6:34 AM, Pavel Machek pa...@denx.de wrote:
 Hi!

 +Status
 +--
 +U-Boot supports running as a coreboot [1] payload on x86. So far only link
 +(Chromebook pixel) has been tested, but it should work with minimal
 adjustments

 Link is codeword for Chromebook Pixel? I'd write Chromebook Pixel
 (Link) if so.

 +on other x86 boards since coreboot deals with most of the low-level details.
 +
 +U-Boot also supports booting directly from x86 reset vector without 
 coreboot,
 +aka raw support or bare support. Currently Google Chromebook link and Intel

 Should this me Chromebook Pixel?


 +Building rom version U-Boot (hereafter referred to as u-boot.rom) is a 
 little

 ROM version of ?

 +bit tricky, as generally it requires several binary blobs which are not 
 shipped
 +in the U-Boot source tree. Due to this reason, the u-boot.rom build is not
 +turned on by default in the U-Boot source tree. Firstly, you need turn it on
 +by uncommenting the following line in the main U-Boot Makefile:
 +
 +# ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
 +
 +Google Chromebook link specific instructions:

 link - Pixel?

 +Firstly, you need the following binary blobs:

 Firstly-First

 +You can get these binary blobs by:
 +
 +$ git clone http://review.coreboot.org/p/blobs.git
 +$ cd blobs
 +
 +Find the following files:
 +
 +* ./mainboard/google/link/descriptor.bin
 +* ./mainboard/google/link/me.bin
 +* ./northbridge/intel/sandybridge/systemagent-ivybridge.bin
 +
 +The 3rd one should be renamed to mrc.bin.

 Should there be instruction where to put those files? Perhaps a script
 doing this and getting ROM would be nice?

 +As for the video ROM, you can get it here [2].
 +
 +Now you can build U-Boot and obtain u-boot.rom:

 +$ make chromebook_link_defconfig
 +$ make all
 +
 +Intel Crown Bay specific instructions:
 +
 +U-Boot support of Intel Crown Bay board [3] relies on a binary blob called
 +Firmware Support Package [4] to perform all the necessary initialization 
 steps
 +as documented in the BIOS Writer Guide including initialization of
 the CPU,

 Guide, 


 +Downalod the Intel FSP for Atom E6xx series and Platform Controller

 - Download.


Most issues fixed in the v4 patch @
http://patchwork.ozlabs.org/patch/422203/, except the Chromebook Pixel
(link) issue which will need Simon to comment.

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


Re: [U-Boot] [PATCH 15/25] x86: Add a simple command to show FSP HOB information

2014-12-17 Thread Bin Meng
Hi Pavel,

On Tue, Dec 16, 2014 at 6:34 AM, Pavel Machek pa...@denx.de wrote:
 Hi!


 +static char *hob_type[] = {
 + reserved,
 + Hand-off,
 + Memory Allocation,
 + Resource Descriptor,
 + GUID Extension,
 + Firmware Volumn,

 volume? ?

 +int do_hob(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 +{
 + EFI_PEI_HOB_POINTERS hob;
 + UINT16 type;
 + char *desc;
 + int i = 0;
 +
 + hob.Raw = (UINT8 *)gd-arch.hob_list;

 + printf(HOB list address: 0x%08x\n\n, (unsigned int)hob.Raw);
 +
 + printf( No. | Address  | Type | Length in Bytes \n);
 + printf(-|--|--|-\n);
 + while (!END_OF_HOB_LIST(hob)) {
 + printf( %-3d | %08x |, i, (unsigned int)hob.Raw);
 + type = hob.Header-HobType;

 Can we get rid of camelCase easily?

 + if (type == EFI_HOB_TYPE_UNUSED)
 + desc = *Unused*;
 + else if (type == EFI_HOB_TYPE_END_OF_HOB_LIST)
 + desc = **END OF HOB**;
 + else if (type = HOB_TYPE_MIN  type = HOB_TYPE_MAX)
 + desc = hob_type[type];
 + else
 + desc = !!!Invalid Type!!!;

 I'd put there less stars and !s...

 +U_BOOT_CMD(
 + hob,1,  1,  do_hob,
 + print FSP Hand-Off Block information,

 You might what to spell out FSP... it is help text after all.


All issues are fixed in the v4 patch @ http://patchwork.ozlabs.org/patch/422204/

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


[U-Boot] [PATCH v2] powerpc/t1024: add serdes protocol 0x40 and 0x5f

2014-12-17 Thread Shengzhou Liu
Add serdes protocol 0x40 and 0x5f.

Signed-off-by: Shengzhou Liu shengzhou@freescale.com
---
v2: fix a typo.

 arch/powerpc/cpu/mpc85xx/t1024_serdes.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/cpu/mpc85xx/t1024_serdes.c 
b/arch/powerpc/cpu/mpc85xx/t1024_serdes.c
index 7dc8385..2ba314a 100644
--- a/arch/powerpc/cpu/mpc85xx/t1024_serdes.c
+++ b/arch/powerpc/cpu/mpc85xx/t1024_serdes.c
@@ -11,6 +11,7 @@
 
 
 static u8 serdes_cfg_tbl[][4] = {
+   [0x40] = {PCIE1, PCIE1, PCIE1, PCIE1},
[0xD5] = {QSGMII_FM1_A, PCIE3, PCIE2, PCIE1},
[0xD6] = {QSGMII_FM1_A, PCIE3, PCIE2, SATA1},
[0x95] = {XFI_FM1_MAC1, PCIE3, PCIE2, PCIE1},
@@ -20,6 +21,7 @@ static u8 serdes_cfg_tbl[][4] = {
[0x56] = {PCIE1, PCIE3, PCIE2, SATA1},
[0x5A] = {PCIE1, PCIE3, SGMII_FM1_DTSEC2, SATA1},
[0x5B] = {PCIE1, PCIE3, SGMII_FM1_DTSEC2, SGMII_FM1_DTSEC1},
+   [0x5F] = {PCIE1, PCIE3, SGMII_2500_FM1_DTSEC2, SGMII_2500_FM1_DTSEC1},
[0x6A] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC2, SATA1},
[0x6B] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_FM1_DTSEC2, SGMII_FM1_DTSEC1},
[0x6F] = {PCIE1, SGMII_FM1_DTSEC3, SGMII_2500_FM1_DTSEC2,
-- 
1.8.0

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


[U-Boot] [PATCH] t1024qds: add missing T1024QDS_defconfig

2014-12-17 Thread Shengzhou Liu
Add missing T1024QDS_defconfig for NOR boot on T1024QDS.

Signed-off-by: Shengzhou Liu shengzhou@freescale.com
---
 configs/T1024QDS_defconfig | 4 
 1 file changed, 4 insertions(+)
 create mode 100644 configs/T1024QDS_defconfig

diff --git a/configs/T1024QDS_defconfig b/configs/T1024QDS_defconfig
new file mode 100644
index 000..94a76ba
--- /dev/null
+++ b/configs/T1024QDS_defconfig
@@ -0,0 +1,4 @@
+CONFIG_SYS_EXTRA_OPTIONS=PPC_T1024
+CONFIG_PPC=y
+CONFIG_MPC85xx=y
+CONFIG_TARGET_T102XQDS=y
-- 
1.8.0

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


Re: [U-Boot] [PATCH v3 0/9] sf: Update flash params for supported read commands and sector size

2014-12-17 Thread Jagan Teki
On 17 December 2014 at 13:32, Bin Meng bmeng...@gmail.com wrote:
 Hi Jagan,

 On Wed, Dec 17, 2014 at 3:59 PM, Jagan Teki jagannadh.t...@gmail.com wrote:
 On 15 December 2014 at 19:21, Bin Meng bmeng...@gmail.com wrote:
 Hi Jagan,

 On Thu, Dec 11, 2014 at 3:40 PM, Bin Meng bmeng...@gmail.com wrote:
 Hi Jagan,

 On Thu, Dec 11, 2014 at 3:26 PM, Jagan Teki jagannadh.t...@gmail.com 
 wrote:
 Hi Bin,

 On 11 December 2014 at 08:34, Bin Meng bmeng...@gmail.com wrote:
 Hi Jagan,

 On Thu, Dec 11, 2014 at 2:41 AM, Jagan Teki jagannadh.t...@gmail.com 
 wrote:
 Hi Bin,

 On 10 December 2014 at 18:21, Bin Meng bmeng...@gmail.com wrote:
 This series update SPI flash supported read commands per datasheet
 in the flash params table, and change flash sector size to 4KiB as
 long as flash supports sector erase (20h) command, to ensure
 'sf erase offset +len' work on 4KiB boundary instead of 64KiB when
 given SECT_4K.

 Changes in v3:
 - Rebase with Jagan's patch series @ 
 http://patchwork.ozlabs.org/patch/419154/


 Bin Meng (9):
   sf: Update SST flash params
   sf: Update Atmel flash params
   sf: Update EON flash params
   sf: Update GigaDevice flash params
   sf: Update Macronix flash params
   sf: Update Spansion flash params
   sf: Update Micron flash params
   sf: Update Winbond flash params
   sf: Give proper spacing between flash table params

 Thanks for the updates - have you verified these changes?

 I verified some, but not all of these flash parts. The update is based
 on flash datasheet, so if something is broken, eg before this series
 the flash advertises only READ_NORM and after my series it is changed
 to READ_FULL, and let's say QUAD_IO_FAST is not working, it is very
 likely that the SPI controller driver has some bugs when supporting
 QUAD_IO_FAST.

 Since these updates were tested before, I will skip these for this PR.
 Will test all the rest (except these) and send the PR soon.

 Let me know your inputs?

 I am fine, as long as this PR will not contains other commits which
 modify the same sf_params.c to introduce more flash support. We can
 test these updates and if everything looks fine, apply these first and
 ask other commits to rebase on this series to introduce more flash
 support.


 Do you have any additional comments about this patch series besides
 the S25FL128S_64K and S25FL256S_64K sector size? If not, I can send
 the v4.

 I'm thinking about the other flashes too,  since these params were taken from
 previous working and Linux mtd.


 You mean 'thinking about' or 'testing'? I should say previously they
 might not be 100% working as per datasheet some flash params currently
 are apparently wrong.

Yes - about testing.

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


Re: [U-Boot] [PATCH] fat: scripts for prepare and test read fat files

2014-12-17 Thread Przemyslaw Marczak

Hello Simon,

On 12/16/2014 09:41 PM, Simon Glass wrote:

Hi Przemyslaw,

On 12 December 2014 at 08:54, Przemyslaw Marczak p.marc...@samsung.com wrote:


Hello,


On 12/12/2014 04:52 PM, Przemyslaw Marczak wrote:


-
mktest_files: script for generating random size long name files
-
Usage:
./1_mktest_files.sh count

count - number of files to be generated

The output directory is: ./test_files

-
copy_files: copy the test_files/* into test partition mount point
-
Usage:
./2_copy_files.sh mount_point

---
fat_test.sh: test fat read by write commands to the device console
--
This script send commands to U-Boot console.
First specify few script variables, e.g:
- TTY=/dev/ttyS0
- MMCDEV=0
- PARTITION=2
- LOAD_ADDR=0x4000

usage:
1. Target:
 run: ums 0 mmc 0
2. Run script 1 and 2 to make and copy the test files
 onto the test partition by UMS
3. This script:
 - set test device $PARTITION and other variables in the script,
   which is required for sending proper commands
 - set $TTY in the script
 run: ./3_fat_test.sh
4. Compare the crc results on the target and device consoles
 (sorry for the mess on the console)

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
---
   1_mktest_files.sh | 82 
+++
   2_copy_files.sh   | 20 ++
   3_fat_test.sh | 38 ++
   3 files changed, 140 insertions(+)
   create mode 100755 1_mktest_files.sh
   create mode 100755 2_copy_files.sh
   create mode 100755 3_fat_test.sh



This is just for some quick test.
I will add something more pretty to the sandbox.


Perhaps this should be written in Python? We now have quite a few
tests and it's getting to the point where we might want to have a way
to run them all, check results, etc. That would be easier if we could
import them through some standard interface. For now, perhaps we
should avoid shell scripts except for really trivial things.

You can bring in the patman libraries (we could break these out into
another dir but it doesn't seem important):

import os
import sys

# Bring in the patman libraries
our_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(our_path, 'tools/patman'))

import command

The, for example:
print command.Output('ls', '-l')

Regards,
Simon



The patch fixes the issue with the hidden files, so for looking the 
issue on some other cases I made some simple script. I understand that 
this is not good for a U-Boot tests, and I agree that better is to write 
something automated in the Python for the sandbox.

I think that the fix should be merged.
I can write the test for the sandbox in a free time, but it will take a 
moment, because now I would like to focus on the pmic framework.

The pmic was on hold for too long.

Best regards,
--
Przemyslaw Marczak
Samsung RD Institute Poland
Samsung Electronics
p.marc...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] fs: fat: read: fix fat16 ls/read issue

2014-12-17 Thread Przemyslaw Marczak

Hello,

On 12/16/2014 11:26 PM, Simon Glass wrote:

Hi Przemyslaw,

On 12 December 2014 at 08:30, Przemyslaw Marczak p.marc...@samsung.com wrote:

Hello,


On 12/12/2014 01:32 AM, Simon Glass wrote:


Hi Przemyslaw,

On 11 December 2014 at 05:01, Przemyslaw Marczak p.marc...@samsung.com
wrote:



The present fat implementation ignores FAT16 long name
directory entries which aren't placed in a single sector.

This was becouse of the buffer was always filled by the
two sectors, and the loop was made also for two sectors.

If some file long name entries are stored in two sectors,
the we have two cases:

Case 1:
Both of sectors are in the buffer - all required data
for long file name is in the buffer.
- Read OK!

Case 2:
The current directory entry is placed at the end of the
second buffered sector. And the next entries are placed
in a sector which is not buffered yet. Then two next
sectors are buffered and the mentioned entry is ignored.
- Read fail!

This commit fixes this issue by:
- read two sectors after loop on each single is done
- keep the last used sector as a first in the buffer
before the read of two next

The commit doesn't affects the fat32 imlementation,
which works good as previous.




This is very interesting\! Is this the same failure that I saw on this
thread?


http://u-boot.10912.n7.nabble.com/PATCH-U-Boot-ARM-rpi-b-detect-board-revision-td196720.html

(search for fatload)

I tried this out. It worked OK for me except that it can't find the
device tree file bcm2835-rpi-b-rev2.dtb.

Oddly I can fatload it from /bcm2835-rpi-b-rev2.dtb but when I try
from /syslinux/..//bcm2835-rpi-b-rev2.dtb it fails and cannot find the
file. Reducing the filename length to 8 chars works. I wonder what
year of my life FAT will stop plaguing me? 


Also can you write a test for this in test/fs/fs-test.sh?

Regards,
Simon

[snip]



Probably this is an another case which is caused by the sector buffer bug.
Does this patch fixed your issue?

I have some simple test for manual use with the ums tool.
It just copy the test files to the tested fat16 partition mounted using the
UMS, next it computes CRC32 of those files on the host and next using U-Boot
fatload/crc32 commands - it tests the read feature. But it's not full
automated - I didn't work on getting the log from U-Boot console.

So I could check if the file checksums are proper and if all files were
found on the partiion, by the U-Boot read command. It's not useful for the
test/fs/fs-test.sh because this is not designed for the sandbox.
My test writes some commands directly to U-Boot console, like this: echo
some cmd  /dev/ttyS0.

Unfortunately the sandbox config seems to be broken.

The bug was not so obvious, any read/write on fat partition can change fat
directory entries or add the new ones and then all data can be read right.

I will send the scripts for such simple test.


I'm not sure if it fixes my problem but it seems likely. I will see if
I can make time to test it.

If you want to write input data to U-Boot sandbox we can do that
fairly easily. You can import cros_subprocess and use the function
there to generate output from your test and inspect the input from
U-Boot's command line. Let me know if you'd like an example.

Regards,
Simon



It sounds good. I can do that, as I wrote in my previous message, now 
I'm focused on the pmic, and this will be a side task for a break time.
I will look into the present tests and I think, that I will find an 
example there.


Best regards,
--
Przemyslaw Marczak
Samsung RD Institute Poland
Samsung Electronics
p.marc...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] fs: fat: read: fix fat16 ls/read issue

2014-12-17 Thread Przemyslaw Marczak

Hello,

On 12/16/2014 11:26 PM, Simon Glass wrote:

Hi Przemyslaw,

On 12 December 2014 at 08:30, Przemyslaw Marczak p.marc...@samsung.com wrote:

Hello,


On 12/12/2014 01:32 AM, Simon Glass wrote:


Hi Przemyslaw,

On 11 December 2014 at 05:01, Przemyslaw Marczak p.marc...@samsung.com
wrote:



The present fat implementation ignores FAT16 long name
directory entries which aren't placed in a single sector.

This was becouse of the buffer was always filled by the
two sectors, and the loop was made also for two sectors.

If some file long name entries are stored in two sectors,
the we have two cases:

Case 1:
Both of sectors are in the buffer - all required data
for long file name is in the buffer.
- Read OK!

Case 2:
The current directory entry is placed at the end of the
second buffered sector. And the next entries are placed
in a sector which is not buffered yet. Then two next
sectors are buffered and the mentioned entry is ignored.
- Read fail!

This commit fixes this issue by:
- read two sectors after loop on each single is done
- keep the last used sector as a first in the buffer
before the read of two next

The commit doesn't affects the fat32 imlementation,
which works good as previous.




This is very interesting\! Is this the same failure that I saw on this
thread?


http://u-boot.10912.n7.nabble.com/PATCH-U-Boot-ARM-rpi-b-detect-board-revision-td196720.html

(search for fatload)

I tried this out. It worked OK for me except that it can't find the
device tree file bcm2835-rpi-b-rev2.dtb.

Oddly I can fatload it from /bcm2835-rpi-b-rev2.dtb but when I try
from /syslinux/..//bcm2835-rpi-b-rev2.dtb it fails and cannot find the
file. Reducing the filename length to 8 chars works. I wonder what
year of my life FAT will stop plaguing me? 


Also can you write a test for this in test/fs/fs-test.sh?

Regards,
Simon

[snip]



Probably this is an another case which is caused by the sector buffer bug.
Does this patch fixed your issue?

I have some simple test for manual use with the ums tool.
It just copy the test files to the tested fat16 partition mounted using the
UMS, next it computes CRC32 of those files on the host and next using U-Boot
fatload/crc32 commands - it tests the read feature. But it's not full
automated - I didn't work on getting the log from U-Boot console.

So I could check if the file checksums are proper and if all files were
found on the partiion, by the U-Boot read command. It's not useful for the
test/fs/fs-test.sh because this is not designed for the sandbox.
My test writes some commands directly to U-Boot console, like this: echo
some cmd  /dev/ttyS0.

Unfortunately the sandbox config seems to be broken.

The bug was not so obvious, any read/write on fat partition can change fat
directory entries or add the new ones and then all data can be read right.

I will send the scripts for such simple test.


I'm not sure if it fixes my problem but it seems likely. I will see if
I can make time to test it.

If you want to write input data to U-Boot sandbox we can do that
fairly easily. You can import cros_subprocess and use the function
there to generate output from your test and inspect the input from
U-Boot's command line. Let me know if you'd like an example.

Regards,
Simon



Before, I wrote, that sandbox seems to be broken, sorry for this - it 
was just my dirty repo - sandbox compiles and works well.


Best regards,
--
Przemyslaw Marczak
Samsung RD Institute Poland
Samsung Electronics
p.marc...@samsung.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] powerpc/t1024rdb: Add support for T1024RDB-PB

2014-12-17 Thread Shengzhou Liu
T1024RDB-PB board adds 2.5G SGMII support with AQR105 PHY.
rcw_0x095 is used for 10G XFI + 3x PCIex1
rcw_0x135 is used for 2.5G SGMII + 2x PCIex1

Signed-off-by: Shengzhou Liu shengzhou@freescale.com
---
based on u-boot-fsl-qoriq.git, master branch

 board/freescale/t102xrdb/cpld.h |  4 
 board/freescale/t102xrdb/eth_t102xrdb.c | 30 +++---
 board/freescale/t102xrdb/t102xrdb.c | 31 ++-
 include/configs/T102xRDB.h  |  2 ++
 4 files changed, 63 insertions(+), 4 deletions(-)

diff --git a/board/freescale/t102xrdb/cpld.h b/board/freescale/t102xrdb/cpld.h
index 5a3100f..db50f81 100644
--- a/board/freescale/t102xrdb/cpld.h
+++ b/board/freescale/t102xrdb/cpld.h
@@ -43,3 +43,7 @@ void cpld_write(unsigned int reg, u8 value);
 #define CPLD_LBMAP_RESET   0xFF
 #define CPLD_LBMAP_SHIFT   0x03
 #define CPLD_BOOT_SEL 0x80
+
+#define CPLD_PCIE_SGMII_MUX0x80
+#define CPLD_OVERRIDE_BOOT_EN  0x01
+#define CPLD_OVERRIDE_MUX_EN   0x02 /* PCIE/2.5G-SGMII mux override enable */
diff --git a/board/freescale/t102xrdb/eth_t102xrdb.c 
b/board/freescale/t102xrdb/eth_t102xrdb.c
index 2e400c4..f611ff0 100644
--- a/board/freescale/t102xrdb/eth_t102xrdb.c
+++ b/board/freescale/t102xrdb/eth_t102xrdb.c
@@ -21,6 +21,7 @@
 #include phy.h
 #include asm/fsl_dtsec.h
 #include asm/fsl_serdes.h
+#include ../common/fman.h
 
 int board_eth_init(bd_t *bis)
 {
@@ -51,15 +52,22 @@ int board_eth_init(bd_t *bis)
/* Register the 10G MDIO bus */
fm_memac_mdio_init(bis, tgec_mdio_info);
 
-   /* Set the two on-board RGMII PHY address */
-   fm_info_set_phy_address(FM1_DTSEC3, RGMII_PHY2_ADDR);
+   /* Set the on-board RGMII PHY address */
fm_info_set_phy_address(FM1_DTSEC4, RGMII_PHY1_ADDR);
 
switch (srds_s1) {
case 0x95:
-   /* 10G XFI with Aquantia PHY */
+   /* set the on-board RGMII2  PHY */
+   fm_info_set_phy_address(FM1_DTSEC3, RGMII_PHY2_ADDR);
+
+   /* set 10G XFI with Aquantia AQR105 PHY */
fm_info_set_phy_address(FM1_10GEC1, FM1_10GEC1_PHY_ADDR);
break;
+   case 0x77:
+   case 0x135:
+   /* set the on-board 2.5G SGMII AQR105 PHY */
+   fm_info_set_phy_address(FM1_DTSEC3, SGMII_PHY1_ADDR);
+   break;
default:
printf(SerDes protocol 0x%x is not supported on T102xRDB\n,
   srds_s1);
@@ -73,6 +81,10 @@ int board_eth_init(bd_t *bis)
dev = miiphy_get_dev_by_name(DEFAULT_FM_MDIO_NAME);
fm_info_set_mdio(i, dev);
break;
+   case PHY_INTERFACE_MODE_SGMII_2500:
+   dev = miiphy_get_dev_by_name(DEFAULT_FM_TGEC_MDIO_NAME);
+   fm_info_set_mdio(i, dev);
+   break;
default:
break;
}
@@ -95,6 +107,18 @@ int board_eth_init(bd_t *bis)
return pci_eth_init(bis);
 }
 
+void board_ft_fman_fixup_port(void *fdt, char *compat, phys_addr_t addr,
+ enum fm_port port, int offset)
+{
+   if ((fm_info_get_enet_if(port) == PHY_INTERFACE_MODE_SGMII_2500) 
+   (port == FM1_DTSEC3)) {
+   fdt_set_phy_handle(fdt, compat, addr, sg_2500_aqr105_phy4);
+   fdt_setprop(fdt, offset, phy-connection-type,
+   sgmii-2500, 10);
+   fdt_status_disabled_by_alias(fdt, xg_aqr105_phy3);
+   }
+}
+
 void fdt_fixup_board_enet(void *fdt)
 {
 }
diff --git a/board/freescale/t102xrdb/t102xrdb.c 
b/board/freescale/t102xrdb/t102xrdb.c
index f5c438d..9676577 100644
--- a/board/freescale/t102xrdb/t102xrdb.c
+++ b/board/freescale/t102xrdb/t102xrdb.c
@@ -27,6 +27,11 @@ int checkboard(void)
 {
struct cpu_type *cpu = gd-arch.cpu;
static const char *freq[3] = {100.00MHZ, 125.00MHz, 156.25MHZ};
+   ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+   u32 srds_s1;
+
+   srds_s1 = in_be32(gur-rcwsr[4])  FSL_CORENET2_RCWSR4_SRDS1_PRTCL;
+   srds_s1 = FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT;
 
printf(Board: %sRDB, , cpu-name);
printf(Board rev: 0x%02x CPLD ver: 0x%02x, boot from ,
@@ -50,11 +55,34 @@ int checkboard(void)
 #endif
 
puts(SERDES Reference Clocks:\n);
-   printf(SD1_CLK1=%s, SD1_CLK2=%s\n, freq[2], freq[0]);
+   if (srds_s1 == 0x95)
+   printf(SD1_CLK1=%s, SD1_CLK2=%s\n, freq[2], freq[0]);
+   else
+   printf(SD1_CLK1=%s, SD1_CLK2=%s\n, freq[0], freq[0]);
 
return 0;
 }
 
+static void board_mux_lane(void)
+{
+   ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
+   u32 srds_prtcl_s1;
+   u8 reg = CPLD_READ(misc_ctl_status);
+
+   srds_prtcl_s1 = in_be32(gur-rcwsr[4]) 
+   FSL_CORENET2_RCWSR4_SRDS1_PRTCL;
+

[U-Boot] [PATCH 1/4] [RFC] rsa: Split the rsa-verify

2014-12-17 Thread Ruchika Gupta
Public exponentiation which is required in rsa verify
functionality is currently tightly integrated with
verification code in rsa_verify.c. Currently this
implementation is software based. Some platforms
having support of the exponentiation in hardware.
To enable the rsa verify functionality to use the
Modular exponentiation if present in hardware, the
patch-set splits the file into two files:

1. rsa-verify.c
- The file parses device tree keys node to fill a keyprop
structure. The keyprop structure can then be converted
to implementation specific formal (struct rsa_pub_key
for sw implementation).
- The parsed device tree node is then passed to a generic
rsa_mod_exp function.

2. rsa-mod-exp.c
Move the software specific functions related to exponentiation
from rsa-verify.c to this file. The file is compiled if
CONFIG_RSA_MOD_EXP_SW is defined. In general if both
CONFIG_FIT_SIGNATURE and CONFIG_RSA are defined,
CONFIG_RSA_MOD_EXP_SW gets automatically defined.

Platforms having hardware implementation for rsa_mod_exp can
add a define CONFIG_RSA_MOD_EXP_HW to their config files.
Adding this defined, undefs the CONFIG_RSA_MOD_EXP_SW and
hardware implementation of mod_exp gets compiled.

Signed-off-by: Ruchika Gupta ruchika.gu...@freescale.com
CC: Simon Glass s...@chromium.org
---
 include/config_fallbacks.h   |   5 +
 include/u-boot/rsa-mod-exp.h |  25 
 lib/rsa/Makefile |   1 +
 lib/rsa/rsa-mod-exp.c| 308 +++
 lib/rsa/rsa-verify.c | 307 +-
 tools/Makefile   |   2 +-
 6 files changed, 370 insertions(+), 278 deletions(-)
 create mode 100644 include/u-boot/rsa-mod-exp.h
 create mode 100644 lib/rsa/rsa-mod-exp.c

diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h
index ddfe045..d4676b4 100644
--- a/include/config_fallbacks.h
+++ b/include/config_fallbacks.h
@@ -83,6 +83,11 @@
 #define CONFIG_SYS_PBSIZE  (CONFIG_SYS_CBSIZE + 128)
 #endif
 
+#if defined(CONFIG_FIT_SIGNATURE)  defined(CONFIG_RSA)  \
+   !defined(CONFIG_RSA_MOD_EXP_HW)
+#define CONFIG_RSA_MOD_EXP_SW
+#endif
+
 #ifndef CONFIG_FIT_SIGNATURE
 #define CONFIG_IMAGE_FORMAT_LEGACY
 #endif
diff --git a/include/u-boot/rsa-mod-exp.h b/include/u-boot/rsa-mod-exp.h
new file mode 100644
index 000..577f673
--- /dev/null
+++ b/include/u-boot/rsa-mod-exp.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2014, Ruchika Gupta.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+*/
+
+#ifndef _RSA_MOD_EXP_H
+#define _RSA_MOD_EXP_H
+
+#include errno.h
+#include image.h
+
+struct key_prop {
+   const void *rr;
+   const void *modulus;
+   const void *public_exponent;
+   uint32_t n0inv;
+   int num_bits;
+   uint32_t exp_len;
+};
+
+int rsa_mod_exp(const uint8_t *sig, uint32_t sig_len,
+   struct key_prop *node, uint8_t *out);
+
+#endif
diff --git a/lib/rsa/Makefile b/lib/rsa/Makefile
index a5a96cb6..ccc6060 100644
--- a/lib/rsa/Makefile
+++ b/lib/rsa/Makefile
@@ -8,3 +8,4 @@
 #
 
 obj-$(CONFIG_FIT_SIGNATURE) += rsa-verify.o rsa-checksum.o
+obj-$(CONFIG_RSA_MOD_EXP_SW) += rsa-mod-exp.o
diff --git a/lib/rsa/rsa-mod-exp.c b/lib/rsa/rsa-mod-exp.c
new file mode 100644
index 000..f69ae1b
--- /dev/null
+++ b/lib/rsa/rsa-mod-exp.c
@@ -0,0 +1,308 @@
+/*
+ * Copyright (c) 2013, Google Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef USE_HOSTCC
+#include common.h
+#include fdtdec.h
+#include asm/types.h
+#include asm/byteorder.h
+#include asm/errno.h
+#include asm/types.h
+#include asm/unaligned.h
+#else
+#include fdt_host.h
+#include mkimage.h
+#include fdt_support.h
+#endif
+#include u-boot/rsa.h
+#include u-boot/rsa-mod-exp.h
+
+#define UINT64_MULT32(v, multby)  (((uint64_t)(v)) * ((uint32_t)(multby)))
+
+#define get_unaligned_be32(a) fdt32_to_cpu(*(uint32_t *)a)
+#define put_unaligned_be32(a, b) (*(uint32_t *)(b) = cpu_to_fdt32(a))
+
+/* Default public exponent for backward compatibility */
+#define RSA_DEFAULT_PUBEXP 65537
+
+/**
+ * subtract_modulus() - subtract modulus from the given value
+ *
+ * @key:   Key containing modulus to subtract
+ * @num:   Number to subtract modulus from, as little endian word array
+ */
+static void subtract_modulus(const struct rsa_public_key *key, uint32_t num[])
+{
+   int64_t acc = 0;
+   uint i;
+
+   for (i = 0; i  key-len; i++) {
+   acc += (uint64_t)num[i] - key-modulus[i];
+   num[i] = (uint32_t)acc;
+   acc = 32;
+   }
+}
+
+/**
+ * greater_equal_modulus() - check if a value is = modulus
+ *
+ * @key:   Key containing modulus to check
+ * @num:   Number to check against modulus, as little endian word array
+ * @return 0 if num  modulus, 1 if num = modulus
+ */
+static int greater_equal_modulus(const struct rsa_public_key *key,
+uint32_t num[])
+{
+   int i;
+
+   for (i = (int)key-len - 1; i = 0; i--) {
+   if 

[U-Boot] [PATCH 4/4] [RFC] rsa: Use checksum algorithms from struct hash_algo

2014-12-17 Thread Ruchika Gupta
Currently the hash functions used in RSA are called
directly from the sha1 and sha256 libraries.
Change the RSA checksum library to use the progressive
hash API's registered with struct hash_algo. This will
allow the checksum library to use the support of hardware
accelerated progressive hash API's once available.

Signed-off-by: Ruchika Gupta ruchika.gu...@freescale.com
CC: Simon Glass s...@chromium.org
---
 include/image.h   |  2 +-
 include/u-boot/rsa-checksum.h |  4 +--
 lib/rsa/rsa-checksum.c| 61 ---
 3 files changed, 60 insertions(+), 7 deletions(-)

diff --git a/include/image.h b/include/image.h
index af30d60..0067c75 100644
--- a/include/image.h
+++ b/include/image.h
@@ -926,7 +926,7 @@ struct checksum_algo {
 #if IMAGE_ENABLE_SIGN
const EVP_MD *(*calculate_sign)(void);
 #endif
-   void (*calculate)(const struct image_region region[],
+   int (*calculate)(const struct image_region region[],
  int region_count, uint8_t *checksum);
const uint8_t *rsa_padding;
 };
diff --git a/include/u-boot/rsa-checksum.h b/include/u-boot/rsa-checksum.h
index c996fb3..db55046 100644
--- a/include/u-boot/rsa-checksum.h
+++ b/include/u-boot/rsa-checksum.h
@@ -16,9 +16,9 @@ extern const uint8_t padding_sha256_rsa4096[];
 extern const uint8_t padding_sha256_rsa2048[];
 extern const uint8_t padding_sha1_rsa2048[];
 
-void sha256_calculate(const struct image_region region[], int region_count,
+int sha256_calculate(const struct image_region region[], int region_count,
  uint8_t *checksum);
-void sha1_calculate(const struct image_region region[], int region_count,
+int sha1_calculate(const struct image_region region[], int region_count,
uint8_t *checksum);
 
 #endif
diff --git a/lib/rsa/rsa-checksum.c b/lib/rsa/rsa-checksum.c
index 8d8b59f..af27c97 100644
--- a/lib/rsa/rsa-checksum.c
+++ b/lib/rsa/rsa-checksum.c
@@ -10,12 +10,13 @@
 #include asm/byteorder.h
 #include asm/errno.h
 #include asm/unaligned.h
+#include hash.h
 #else
 #include fdt_host.h
-#endif
-#include u-boot/rsa.h
 #include u-boot/sha1.h
 #include u-boot/sha256.h
+#endif
+#include u-boot/rsa.h
 
 /* PKCS 1.5 paddings as described in the RSA PKCS#1 v2.1 standard. */
 
@@ -136,7 +137,54 @@ const uint8_t padding_sha256_rsa4096[RSA4096_BYTES - 
SHA256_SUM_LEN] = {
0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20
 };
 
-void sha1_calculate(const struct image_region region[], int region_count,
+#ifndef USE_HOSTCC
+void hash_calculate(struct hash_algo *algo, const struct image_region region[],
+  int region_count, uint8_t *checksum)
+{
+   void *ctx;
+   uint32_t i;
+   i = 0;
+
+   algo-hash_init(algo, ctx);
+   for (i = 0; i  region_count - 1; i++)
+   algo-hash_update(algo, ctx, region[i].data, region[i].size, 0);
+
+   algo-hash_update(algo, ctx, region[i].data, region[i].size, 1);
+   algo-hash_finish(algo, ctx, checksum, algo-digest_size);
+}
+
+int sha1_calculate(const struct image_region region[], int region_count,
+   uint8_t *checksum)
+{
+   struct hash_algo *algo;
+   int ret = 0;
+
+   ret = hash_progressive_lookup_algo(sha1, algo);
+   if (ret)
+   return ret;
+
+   hash_calculate(algo, region, region_count, checksum);
+
+   return 0;
+}
+
+int sha256_calculate(const struct image_region region[], int region_count,
+   uint8_t *checksum)
+{
+   struct hash_algo *algo;
+   int ret;
+
+   ret = hash_progressive_lookup_algo(sha256, algo);
+   if (ret)
+   return ret;
+
+   hash_calculate(algo, region, region_count, checksum);
+
+   return 0;
+}
+
+#else
+int sha1_calculate(const struct image_region region[], int region_count,
uint8_t *checksum)
 {
sha1_context ctx;
@@ -147,9 +195,11 @@ void sha1_calculate(const struct image_region region[], 
int region_count,
for (i = 0; i  region_count; i++)
sha1_update(ctx, region[i].data, region[i].size);
sha1_finish(ctx, checksum);
+
+   return 0;
 }
 
-void sha256_calculate(const struct image_region region[], int region_count,
+int sha256_calculate(const struct image_region region[], int region_count,
  uint8_t *checksum)
 {
sha256_context ctx;
@@ -160,4 +210,7 @@ void sha256_calculate(const struct image_region region[], 
int region_count,
for (i = 0; i  region_count; i++)
sha256_update(ctx, region[i].data, region[i].size);
sha256_finish(ctx, checksum);
+
+   return 0;
 }
+#endif
-- 
1.8.1.4

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


Re: [U-Boot] [PATCH v3 0/6] ARM: kirkwood: mvebu_mmc: Speed up access time

2014-12-17 Thread Pantelis Antoniou
Hi Gerald,

Last pull-req for mmc was last Friday, I intend to issue another this Friday 
too.

Regards

— Pantelis

 On Dec 17, 2014, at 11:22 , drEagle drea...@doukki.net wrote:
 
 Hi,
 
 Any chance to be included in the next release of u-boot ?
 
 Regards,
 Gérald
 
 Le 15/12/2014 12:14, Mario Schuknecht a écrit :
 
 2014-12-13 21:35 GMT+01:00 Gérald Kerma drea...@doukki.net 
 mailto:drea...@doukki.net:
 
 
This serie of patches speed up access time of MVEBUMMC driver
 
This is allowed by a fix in MVEBUMMC init status check inspired from 
 linux MVSDIO driver.
 * Hardware weirdness.  The FIFO_EMPTY bit of the HW_STATE
 * register is sometimes not set before a while when some
 * unusual data block sizes are used (such as with the SWITCH
 * command), even despite the fact that the XFER_DONE interrupt
 * was raised.  And if another data transfer starts before
 * this bit comes to good sense (which eventually happens by
 * itself) then the new transfer simply fails with a timeout.
 
It allows about 10x to 40x faster access time transfer on SHEEVAPLUG MMC
It may also fixes some SD types incompatibilities
 
### before patch
 
Marvell ext2load mmc 0:1 0x80 uImage
1613392 bytes read in 977 ms (1.6 MiB/s)
 
### with fix
 
Marvell ext2load mmc 0:1 0x80 uImage
1613392 bytes read in 83 ms (18.5 MiB/s)
 
 
 
 Looks good to me.
 ACK to this series of patches:
 
 
Gérald Kerma (6):
  MVEBUMMC : Change copyright date
  MVEBUMMC : Speed up access time
  MVEBUMMC : FIX debug strings
  MVEBUMMC : REMOVE unnecessary delays
  MVEBUMMC : CLEAN code
  MVEBUMMC : REMOVE unnecessary delay from init
 
 
 drivers/mmc/mvebu_mmc.c | 103 
 
 include/mvebu_mmc.h |   1 +
 2 files changed, 61 insertions(+), 43 deletions(-)
 
--
2.1.3
___
U-Boot mailing list
U-Boot@lists.denx.de mailto:U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
 
 

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


[U-Boot] [PATCH 0/4] [RFC] rsa: Modify rsa lib to use hw acceleration

2014-12-17 Thread Ruchika Gupta
The rsa-verify functionality is a two step operation involving:
1. Checksum (hash) Calculation over image regions
2. Public Key Modular exponentiation over signature to generate hash
 
The following patch set modifies the rsa library to use hw 
acceleration if available in platform.

The first two patches in the series, split the rsa-verify lib
into two files:
1. rsa-verify.c
- The file parses device tree keys node to fill a keyprop
structure. The key prop structure can then be converted
to implementation specific formal (struct rsa_pub_key 
for sw implementation).
- The parsed device tree node is then passed to a generic
rsa_mod_exp function.

2. rsa-mod-exp.c
Move the software specific functions related to exponentiation
from rsa-verify.c to this file. The file is compiled if
CONFIG_RSA_MOD_EXP_SW is defined. In general if both
CONFIG_FIT_SIGNATURE and CONFIG_RSA are defined, 
CONFIG_RSA_MOD_EXP_SW gets automatically defined.

Platforms having hardware implementation for rsa_mod_exp can 
add a define CONFIG_RSA_MOD_EXP_HW to their config files.
Adding this defined, undefs the CONFIG_RSA_MOD_EXP_SW and 
hardware implementation of mod_exp gets compiled.

Another option is to add a node in struct image_sig_algos
in image-sig.c as done in common/sha.c. 

#ifdef CONFIG_RSA_HW
 {
sha1,rsa2048,
#ifdef HOST_CC
rsa_sign,
rsa_add_verify_data,
#else
NULL,
NULL,
#endif
rsa_verify_hw,
checksum_algos[0],
},
#endif.

However the code related with parsing of devicetree for key properties,
calculation of hash and comparison of passed hash with signature derived
hash would need to be duplicated in the rsa_verify_hw function. 

The next set of two patches are related with hash lib support 
in RSA.
 
For hash, the infrastructure already exists in common/hash.c.
rsa_checksum is modified to use the API's registered with the
hash_algo structure. Once HW accelerated support for progressive
hash is available, RSA library can easily pick it up.

Ruchika Gupta (4):
  rsa: Split the rsa-verify
  crypto/fsl: Add support for RSA Modular Exponentiation
  hash: Add function to find hash_algo struct with progressive hash
  rsa: Use checksum algorithms from struct hash_algo

Signed-off-by: Ruchika Gupta ruchika.gu...@freescale.com
CC: Simon Glass s...@chromium.org

 common/hash.c |  35 +++--
 drivers/crypto/fsl/Makefile   |   1 +
 drivers/crypto/fsl/fsl_rsa.c  |  44 ++
 drivers/crypto/fsl/jobdesc.c  |  28 
 drivers/crypto/fsl/jobdesc.h  |   5 +
 drivers/crypto/fsl/rsa_caam.h |  27 
 include/config_fallbacks.h|   5 +
 include/hash.h|  15 ++
 include/image.h   |   2 +-
 include/u-boot/rsa-checksum.h |   4 +-
 include/u-boot/rsa-mod-exp.h  |  25 
 lib/rsa/Makefile  |   1 +
 lib/rsa/rsa-checksum.c|  61 -
 lib/rsa/rsa-mod-exp.c | 308 ++
 lib/rsa/rsa-verify.c  | 307 -
 tools/Makefile|   2 +-
 16 files changed, 576 insertions(+), 294 deletions(-)
 create mode 100644 drivers/crypto/fsl/fsl_rsa.c
 create mode 100644 drivers/crypto/fsl/rsa_caam.h
 create mode 100644 include/u-boot/rsa-mod-exp.h
 create mode 100644 lib/rsa/rsa-mod-exp.c

-- 
1.8.1.4

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


[U-Boot] [PATCH 2/4] [RFC] crypto/fsl: Add support for RSA Modular Exponentiation

2014-12-17 Thread Ruchika Gupta
Support added for offloading Modular Exponentiation required
in RSA Verify functionality to hardware which depends on
CONFIG_RSA_MOD_EXP_HW.

Signed-off-by: Ruchika Gupta ruchika.gu...@freescale.com
CC: Simon Glass s...@chromium.org
---
 drivers/crypto/fsl/Makefile   |  1 +
 drivers/crypto/fsl/fsl_rsa.c  | 44 +++
 drivers/crypto/fsl/jobdesc.c  | 28 +++
 drivers/crypto/fsl/jobdesc.h  |  5 +
 drivers/crypto/fsl/rsa_caam.h | 27 ++
 5 files changed, 105 insertions(+)
 create mode 100644 drivers/crypto/fsl/fsl_rsa.c
 create mode 100644 drivers/crypto/fsl/rsa_caam.h

diff --git a/drivers/crypto/fsl/Makefile b/drivers/crypto/fsl/Makefile
index 067d0a9..ef36f67 100644
--- a/drivers/crypto/fsl/Makefile
+++ b/drivers/crypto/fsl/Makefile
@@ -8,4 +8,5 @@
 
 obj-y += sec.o
 obj-$(CONFIG_FSL_CAAM) += jr.o fsl_hash.o jobdesc.o error.o
+obj-$(CONFIG_RSA_MOD_EXP_HW) += fsl_rsa.o
 obj-$(CONFIG_CMD_BLOB) += fsl_blob.o
diff --git a/drivers/crypto/fsl/fsl_rsa.c b/drivers/crypto/fsl/fsl_rsa.c
new file mode 100644
index 000..1100316
--- /dev/null
+++ b/drivers/crypto/fsl/fsl_rsa.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2013, Google Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include asm/types.h
+#include malloc.h
+#include jobdesc.h
+#include desc.h
+#include jr.h
+#include rsa_caam.h
+#include u-boot/rsa-mod-exp.h
+
+int rsa_mod_exp(const uint8_t *sig, uint32_t sig_len,
+   struct key_prop *prop, uint8_t *out)
+{
+   uint32_t keylen;
+   struct pk_in_params pkin;
+   uint32_t desc[MAX_CAAM_DESCSIZE];
+   int ret;
+
+   /* Length in bytes */
+   keylen = prop-num_bits / 8;
+
+   pkin.a = sig;
+   pkin.a_siz = sig_len;
+   pkin.n = prop-modulus;
+   pkin.n_siz = keylen;
+   pkin.e = prop-public_exponent;
+   pkin.e_siz = prop-exp_len;
+
+   inline_cnstr_jobdesc_pkha_rsaexp(desc, pkin, out, sig_len);
+
+   ret = run_descriptor_jr(desc);
+
+   if (ret) {
+   debug(%s: RSA failed to verify: %d\n, __func__, ret);
+   return ret;
+   }
+
+   return 0;
+}
diff --git a/drivers/crypto/fsl/jobdesc.c b/drivers/crypto/fsl/jobdesc.c
index 1386bae..cc0dced 100644
--- a/drivers/crypto/fsl/jobdesc.c
+++ b/drivers/crypto/fsl/jobdesc.c
@@ -11,6 +11,7 @@
 #include common.h
 #include desc_constr.h
 #include jobdesc.h
+#include rsa_caam.h
 
 #define KEY_BLOB_SIZE  32
 #define MAC_SIZE   16
@@ -123,3 +124,30 @@ void inline_cnstr_jobdesc_rng_instantiation(uint32_t *desc)
append_operation(desc, OP_TYPE_CLASS1_ALG | OP_ALG_ALGSEL_RNG |
 OP_ALG_RNG4_SK);
 }
+
+/* Change key size to bytes form bits in calling function*/
+void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc,
+ struct pk_in_params *pkin, uint8_t *out,
+ uint32_t out_siz)
+{
+   dma_addr_t dma_addr_e, dma_addr_a, dma_addr_n, dma_addr_out;
+
+   dma_addr_e = virt_to_phys((void *)pkin-e);
+   dma_addr_a = virt_to_phys((void *)pkin-a);
+   dma_addr_n = virt_to_phys((void *)pkin-n);
+   dma_addr_out = virt_to_phys((void *)out);
+
+   init_job_desc(desc, 0);
+   append_key(desc, dma_addr_e, pkin-e_siz, KEY_DEST_PKHA_E | CLASS_1);
+
+   append_fifo_load(desc, dma_addr_a,
+pkin-a_siz, LDST_CLASS_1_CCB | FIFOLD_TYPE_PK_A);
+
+   append_fifo_load(desc, dma_addr_n,
+pkin-n_siz, LDST_CLASS_1_CCB | FIFOLD_TYPE_PK_N);
+
+   append_operation(desc, OP_TYPE_PK | OP_ALG_PK | OP_ALG_PKMODE_MOD_EXPO);
+
+   append_fifo_store(desc, dma_addr_out, out_siz,
+ LDST_CLASS_1_CCB | FIFOST_TYPE_PKHA_B);
+}
diff --git a/drivers/crypto/fsl/jobdesc.h b/drivers/crypto/fsl/jobdesc.h
index 3cf7226..84b3edd 100644
--- a/drivers/crypto/fsl/jobdesc.h
+++ b/drivers/crypto/fsl/jobdesc.h
@@ -10,6 +10,7 @@
 
 #include common.h
 #include asm/io.h
+#include rsa_caam.h
 
 #define KEY_IDNFR_SZ_BYTES 16
 
@@ -26,4 +27,8 @@ void inline_cnstr_jobdesc_blob_decap(uint32_t *desc, uint8_t 
*key_idnfr,
 uint32_t out_sz);
 
 void inline_cnstr_jobdesc_rng_instantiation(uint32_t *desc);
+
+void inline_cnstr_jobdesc_pkha_rsaexp(uint32_t *desc,
+ struct pk_in_params *pkin, uint8_t *out,
+ uint32_t out_siz);
 #endif
diff --git a/drivers/crypto/fsl/rsa_caam.h b/drivers/crypto/fsl/rsa_caam.h
new file mode 100644
index 000..d1dc7eb
--- /dev/null
+++ b/drivers/crypto/fsl/rsa_caam.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __RSA_SEC_H
+#define __RSA_SEC_H
+
+#include common.h
+
+/**
+ * struct pk_in_params - holder for input to PKHA block in CAAM
+ *
+ */
+struct 

[U-Boot] [PATCH 3/4] [RFC] hash: Add function to find hash_algo struct with progressive hash

2014-12-17 Thread Ruchika Gupta
Signed-off-by: Ruchika Gupta ruchika.gu...@freescale.com
CC: Simon Glass s...@chromium.org
---
 common/hash.c  | 35 ++-
 include/hash.h | 15 +++
 2 files changed, 41 insertions(+), 9 deletions(-)

diff --git a/common/hash.c b/common/hash.c
index 12d6759..87263df 100644
--- a/common/hash.c
+++ b/common/hash.c
@@ -20,7 +20,7 @@
 #include asm/io.h
 #include asm/errno.h
 
-#ifdef CONFIG_CMD_SHA1SUM
+#ifdef CONFIG_SHA256
 static int hash_init_sha1(struct hash_algo *algo, void **ctxp)
 {
sha1_context *ctx = malloc(sizeof(sha1_context));
@@ -125,12 +125,8 @@ static struct hash_algo hash_algo[] = {
CHUNKSZ_SHA256,
},
 #endif
-   /*
-* This is CONFIG_CMD_SHA1SUM instead of CONFIG_SHA1 since otherwise
-* it bloats the code for boards which use SHA1 but not the 'hash'
-* or 'sha1sum' commands.
-*/
-#ifdef CONFIG_CMD_SHA1SUM
+
+#ifdef CONFIG_SHA1
{
sha1,
SHA1_SUM_LEN,
@@ -140,7 +136,6 @@ static struct hash_algo hash_algo[] = {
hash_update_sha1,
hash_finish_sha1,
},
-#define MULTI_HASH
 #endif
 #ifdef CONFIG_SHA256
{
@@ -152,7 +147,6 @@ static struct hash_algo hash_algo[] = {
hash_update_sha256,
hash_finish_sha256,
},
-#define MULTI_HASH
 #endif
{
crc32,
@@ -165,6 +159,10 @@ static struct hash_algo hash_algo[] = {
},
 };
 
+#if defined(CONFIG_SHA256) || defined(CONFIG_CMD_SHA1SUM)
+#define MULTI_HASH
+#endif
+
 #if defined(CONFIG_HASH_VERIFY) || defined(CONFIG_CMD_HASH)
 #define MULTI_HASH
 #endif
@@ -311,6 +309,25 @@ int hash_lookup_algo(const char *algo_name, struct 
hash_algo **algop)
return -EPROTONOSUPPORT;
 }
 
+int hash_progressive_lookup_algo(const char *algo_name,
+struct hash_algo **algop)
+{
+   int i;
+
+   for (i = 0; i  ARRAY_SIZE(hash_algo); i++) {
+   if (!strcmp(algo_name, hash_algo[i].name)) {
+   if (hash_algo[i].hash_init) {
+   *algop = hash_algo[i];
+   return 0;
+   }
+   }
+   }
+
+   debug(Unknown hash algorithm '%s'\n, algo_name);
+   return -EPROTONOSUPPORT;
+}
+
+
 void hash_show(struct hash_algo *algo, ulong addr, ulong len, uint8_t *output)
 {
int i;
diff --git a/include/hash.h b/include/hash.h
index d8ec4f0..059f84e 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -128,6 +128,21 @@ int hash_block(const char *algo_name, const void *data, 
unsigned int len,
 int hash_lookup_algo(const char *algo_name, struct hash_algo **algop);
 
 /**
+ * hash_progressive_lookup_algo() - Look up the hash_algo struct with 
progressive
+ * hash support for an algorithm
+ *
+ * The function returns the pointer to the struct or -EPROTONOSUPPORT if the
+ * algorithm is not available with progressive hash support.
+ *
+ * @algo_name: Hash algorithm to look up
+ * @algop: Pointer to the hash_algo struct if found
+ *
+ * @return 0 if ok, -EPROTONOSUPPORT for an unknown algorithm.
+ */
+int hash_progressive_lookup_algo(const char *algo_name,
+struct hash_algo **algop);
+
+/**
  * hash_show() - Print out a hash algorithm and value
  *
  * You will get a message like this (without a newline at the end):
-- 
1.8.1.4

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


Re: [U-Boot] [PATCH V4 2/3] usb: eth: add ASIX AX88179 DRIVER

2014-12-17 Thread René Griessl




Is there a reason you can't implement write_hwaddr() so that it will 
behave like other NICs (u-boot is the highest priority source of the 
MAC address).




The AX88179 uses an external flash to store the MAC address. So for my 
application I do not want the user to be able to change it, since it is 
a unique ID inside the server cluster.
I could add it as compiler option. Maybe it is even better to implement 
my behavior as option, since it differs from standard.
I think it will be finished mid of january, so if it is OK for you in a 
separate patch.



Looks good to me otherwise.

Thanks,
-Joe



Thanks,
 Rene

 


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


Re: [U-Boot] [PATCH 02/14] sunxi: Add support for the rsb (Reduced Serial Bus)

2014-12-17 Thread Hans de Goede

Hi,

On 17-12-14 03:22, Chen-Yu Tsai wrote:

Hi,

On Wed, Dec 17, 2014 at 4:31 AM, Hans de Goede hdego...@redhat.com wrote:

sun8i (A23) introduces a new bus for communicating with the pmic, the rsb,
the rsb is also used to communicate with the pmic on the A80, and is
documented in the A80 user manual.

This commit adds support for this based on the rsb driver from the allwinner
u-boot sources.

Note: Not yet ready for upstream, code needs some significant cleanups.


Confusing note.


Ugh, I forgot to remove that note after doing the cleanups, I'll remove it
from the version of the patch my personal tree :)





Signed-off-by: Hans de Goede hdego...@redhat.com
---
  arch/arm/cpu/armv7/sunxi/Makefile  |   1 +
  arch/arm/cpu/armv7/sunxi/rsb.c | 158 +
  arch/arm/include/asm/arch-sunxi/cpu.h  |   3 +-
  arch/arm/include/asm/arch-sunxi/gpio.h |   2 +
  arch/arm/include/asm/arch-sunxi/prcm.h |   3 +-
  arch/arm/include/asm/arch-sunxi/rsb.h  |  55 
  6 files changed, 220 insertions(+), 2 deletions(-)
  create mode 100644 arch/arm/cpu/armv7/sunxi/rsb.c
  create mode 100644 arch/arm/include/asm/arch-sunxi/rsb.h

diff --git a/arch/arm/cpu/armv7/sunxi/Makefile 
b/arch/arm/cpu/armv7/sunxi/Makefile
index 1337b60..3e8975a 100644
--- a/arch/arm/cpu/armv7/sunxi/Makefile
+++ b/arch/arm/cpu/armv7/sunxi/Makefile
@@ -15,6 +15,7 @@ obj-y += pinmux.o
  obj-$(CONFIG_MACH_SUN6I)   += prcm.o
  obj-$(CONFIG_MACH_SUN8I)   += prcm.o
  obj-$(CONFIG_MACH_SUN6I)   += p2wi.o
+obj-$(CONFIG_MACH_SUN8I)   += rsb.o
  obj-$(CONFIG_MACH_SUN4I)   += clock_sun4i.o
  obj-$(CONFIG_MACH_SUN5I)   += clock_sun4i.o
  obj-$(CONFIG_MACH_SUN6I)   += clock_sun6i.o
diff --git a/arch/arm/cpu/armv7/sunxi/rsb.c b/arch/arm/cpu/armv7/sunxi/rsb.c
new file mode 100644
index 000..b72bb9d
--- /dev/null
+++ b/arch/arm/cpu/armv7/sunxi/rsb.c
@@ -0,0 +1,158 @@
+/*
+ * (C) Copyright 2014 Hans de Goede hdego...@redhat.com
+ *
+ * Based on allwinner u-boot sources rsb code which is:
+ * (C) Copyright 2007-2013
+ * Allwinner Technology Co., Ltd. www.allwinnertech.com
+ * lixiang lixi...@allwinnertech.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include errno.h
+#include asm/arch/cpu.h
+#include asm/arch/gpio.h
+#include asm/arch/prcm.h
+#include asm/arch/rsb.h
+
+static void rsb_cfg_io(void)
+{
+   sunxi_gpio_set_cfgpin(SUNXI_GPL(0), SUN8I_GPL0_R_RSB_SCK);
+   sunxi_gpio_set_cfgpin(SUNXI_GPL(1), SUN8I_GPL1_R_RSB_SDA);
+   sunxi_gpio_set_pull(SUNXI_GPL(0), 1);
+   sunxi_gpio_set_pull(SUNXI_GPL(1), 1);
+   sunxi_gpio_set_drv(SUNXI_GPL(0), 2);
+   sunxi_gpio_set_drv(SUNXI_GPL(1), 2);
+}
+
+static void rsb_set_clk(void)
+{
+   struct sunxi_rsb_reg * const rsb =
+   (struct sunxi_rsb_reg *)SUNXI_RSB_BASE;
+   u32 div = 0;
+   u32 cd_odly = 0;
+
+   /* Source is Hosc24M, set RSB clk to 3Mhz */
+   div = 2400 / 300 / 2 - 1;
+   cd_odly = div  1;
+   if (!cd_odly)
+   cd_odly = 1;
+
+   writel((cd_odly  8) | div, rsb-ccr);
+}
+
+void rsb_init(void)
+{
+   struct sunxi_rsb_reg * const rsb =
+   (struct sunxi_rsb_reg *)SUNXI_RSB_BASE;
+
+   rsb_cfg_io();
+
+   /* Enable RSB and PIO clk, and de-assert their resets */
+   prcm_apb0_enable(PRCM_APB0_GATE_PIO | PRCM_APB0_GATE_RSB);
+
+   writel(RSB_CTRL_SOFT_RST, rsb-ctrl);


Do we need a small delay here for the device to finish reset?


Maybe, this (no delay) is what the allwinner code was doing, and it
seems to work fine ...




+   rsb_set_clk();
+}
+
+static int rsb_await_trans(void)
+{
+   struct sunxi_rsb_reg * const rsb =
+   (struct sunxi_rsb_reg *)SUNXI_RSB_BASE;
+   unsigned long tmo = timer_get_us() + 100;
+   u32 stat;
+   int ret;
+
+   while (1) {
+   stat = readl(rsb-stat);
+   if (stat  RSB_STAT_LBSY_INT) {
+   ret = -EBUSY;
+   break;
+   }
+   if (stat  RSB_STAT_TERR_INT) {
+   ret = -EIO;
+   break;
+   }
+   if (stat  RSB_STAT_TOVER_INT) {
+   ret = 0;
+   break;
+   }
+   if (timer_get_us()  tmo) {
+   ret = -ETIME;
+   break;
+   }
+   }
+   writel(stat, rsb-stat); /* Clear status bits */
+
+   return ret;
+}
+
+int rsb_set_device_mode(u32 device_mode_data)
+{
+   struct sunxi_rsb_reg * const rsb =
+   (struct sunxi_rsb_reg *)SUNXI_RSB_BASE;
+   unsigned long tmo = timer_get_us() + 100;
+
+   writel(RSB_DMCR_DEVICE_MODE_START | device_mode_data, rsb-dmcr);
+
+   while (readl(rsb-dmcr)  RSB_DMCR_DEVICE_MODE_START) {
+   if (timer_get_us()  tmo)
+   return -ETIME;
+   }
+
+   return 

Re: [U-Boot] [PATCH v3 0/6] SHEEVAPLUG : REFRESH 201412

2014-12-17 Thread Prafulla Wadaskar


 -Original Message-
 From: Gérald Kerma [mailto:drea...@doukki.net]
 Sent: 17 December 2014 19:33
 To: u-boot@lists.denx.de; Prafulla Wadaskar
 Cc: albert.u.b...@aribaud.net; l...@openwrt.org; Gérald
 Kerma
 Subject: [PATCH v3 0/6] SHEEVAPLUG : REFRESH 201412
 
 Prepare ENV settings for sheevaplugs to be OpenWRT
 ready.
 
   +--+
   | UBOOT|  896 Kb (7x128)  = uboot
   +--+
   | ENV  |  128 Kb  = uboot_env
   +--+
   | ROOT(FS) |  511 Mb @ 1 Mb   = root - rootfs
 (ubifs)
   +--+
 
 With (CC) TRUNK OpenWRT build (QUICK HOWTO) :
 
   INTERRUPT
   Marvell nand erase.part root
   Marvell ubi part root
   Marvell ubi remove rootfs
   Marvell ubi create rootfs
   Marvell usb reset
   Marvell fatload usb 0:1 0x80
 sheevaplug/openwrt/openwrt-kirkwood-sheevaplug-
 rootfs.ubifs
   Marvell ubi write 0x80 rootfs ${filesize}
   Marvell reset
 
 Gérald Kerma (6):
   SHEEVAPLUG : FIX typo
   SHEEVAPLUG : FIX multiple defines
   SHEEVAPLUG : ADD generic board define
   SHEEVAPLUG : ADD CONFIG_CMD_FAT
   SHEEVAPLUG : ADD FDT support
   SHEEVAPLUG : REDEFINE MTDPARTS
 
  include/configs/sheevaplug.h | 49
 +---
  1 file changed, 32 insertions(+), 17 deletions(-)

Is this final one to be pulled, or you are planning more changes? :-)

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


Re: [U-Boot] [PATCH 25/25] x86: Add a README.x86 for U-Boot on x86 support

2014-12-17 Thread Simon Glass
Hi Pavel,

On 15 December 2014 at 15:34, Pavel Machek pa...@denx.de wrote:

 Hi!

  +Status
  +--
  +U-Boot supports running as a coreboot [1] payload on x86. So far only link
  +(Chromebook pixel) has been tested, but it should work with minimal
  adjustments

 Link is codeword for Chromebook Pixel? I'd write Chromebook Pixel
 (Link) if so.

  +on other x86 boards since coreboot deals with most of the low-level 
  details.
  +
  +U-Boot also supports booting directly from x86 reset vector without 
  coreboot,
  +aka raw support or bare support. Currently Google Chromebook link and Intel

 Should this me Chromebook Pixel?

Yes we should either say 'Chromebook Pixel' or link. I will tidy this
up when applying.



  +Building rom version U-Boot (hereafter referred to as u-boot.rom) is a 
  little

 ROM version of ?

  +bit tricky, as generally it requires several binary blobs which are not 
  shipped
  +in the U-Boot source tree. Due to this reason, the u-boot.rom build is not
  +turned on by default in the U-Boot source tree. Firstly, you need turn it 
  on
  +by uncommenting the following line in the main U-Boot Makefile:
  +
  +# ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
  +
  +Google Chromebook link specific instructions:

 link - Pixel?

  +Firstly, you need the following binary blobs:

 Firstly-First

  +You can get these binary blobs by:
  +
  +$ git clone http://review.coreboot.org/p/blobs.git
  +$ cd blobs
  +
  +Find the following files:
  +
  +* ./mainboard/google/link/descriptor.bin
  +* ./mainboard/google/link/me.bin
  +* ./northbridge/intel/sandybridge/systemagent-ivybridge.bin
  +
  +The 3rd one should be renamed to mrc.bin.

 Should there be instruction where to put those files? Perhaps a script
 doing this and getting ROM would be nice?

  +As for the video ROM, you can get it here [2].
  +
  +Now you can build U-Boot and obtain u-boot.rom:

  +$ make chromebook_link_defconfig
  +$ make all
  +
  +Intel Crown Bay specific instructions:
  +
  +U-Boot support of Intel Crown Bay board [3] relies on a binary blob called
  +Firmware Support Package [4] to perform all the necessary initialization 
  steps
  +as documented in the BIOS Writer Guide including initialization of
  the CPU,

 Guide, 


  +Downalod the Intel FSP for Atom E6xx series and Platform Controller

 - Download.

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


Re: [U-Boot] [PATCH v4 01/15] x86: Integrate Tunnel Creek processor microcode

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 Integrate the processor microcode version 1.05 for Tunnel Creek,
 CPUID device 20661h.

 Signed-off-by: Bin Meng bmeng...@gmail.com

 ---

 Changes in v4:
 - Switch to use dtsi format microcode

 Changes in v3: None
 Changes in v2: None

  arch/x86/dts/microcode/m0220661105_cv.dtsi | 368 
 +
  1 file changed, 368 insertions(+)
  create mode 100644 arch/x86/dts/microcode/m0220661105_cv.dtsi

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


Re: [U-Boot] [PATCH v4 15/15] x86: Clean up the FSP support codes

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 This is the follow-on patch to clean up the FSP support codes:

 - Remove the _t suffix on the structures defines
 - Use __packed for structure defines
 - Use U-Boot's assert()
 - Use standard bool true/false
 - Remove read_unaligned64()
 - Use memcmp() in the compare_guid()
 - Remove the cast in the memset() call
 - Replace some magic numbers with macros
 - Use panic() when no valid FSP image header is found
 - Change some FSP utility routines to use an fsp_ prefix
 - Add comment blocks for asm_continuation and fsp_init_done
 - Remove some casts in find_fsp_header()
 - Change HOB access macros to static inline routines
 - Add comments to mention find_fsp_header() may be called in a
   stackless environment
 - Add comments to mention init(params) in fsp_init() cannot
   be removed

 Signed-off-by: Bin Meng bmeng...@gmail.com

 ---

 Changes in v4:
 - Use __packed for structure defines
 - Fix some typos and print FSP full name in cmd_hob.c

 Changes in v3: None
 Changes in v2:
 - Remove some casts in find_fsp_header()
 - Change HOB access macros to static inline routines

  arch/x86/cpu/queensbay/fsp_configs.c   |   2 +-
  arch/x86/cpu/queensbay/fsp_support.c   | 253 
 ++---
  arch/x86/cpu/queensbay/tnc_dram.c  |  18 +-
  arch/x86/include/asm/arch-queensbay/fsp/fsp_api.h  |  18 +-
  arch/x86/include/asm/arch-queensbay/fsp/fsp_ffs.h  |  28 +--
  arch/x86/include/asm/arch-queensbay/fsp/fsp_fv.h   |  14 +-
  arch/x86/include/asm/arch-queensbay/fsp/fsp_hob.h  | 112 +
  .../asm/arch-queensbay/fsp/fsp_infoheader.h|   6 +-
  .../include/asm/arch-queensbay/fsp/fsp_platform.h  |   8 +-
  .../include/asm/arch-queensbay/fsp/fsp_support.h   |  63 ++---
  .../x86/include/asm/arch-queensbay/fsp/fsp_types.h |  17 +-
  arch/x86/include/asm/arch-queensbay/fsp/fsp_vpd.h  |   8 +-
  arch/x86/lib/cmd_hob.c |  22 +-
  13 files changed, 279 insertions(+), 290 deletions(-)


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


Re: [U-Boot] [PATCH v4 02/15] x86: Add basic support to queensbay platform and crownbay board

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 Implement minimum required functions for the basic support to
 queensbay platform and crownbay board.

 Currently the implementation is to call fsp_init() in the car_init().
 We may move that call to cpu_init_f() in the future.

 Signed-off-by: Bin Meng bmeng...@gmail.com

 ---

 Changes in v4: None
 Changes in v3:
 - Update to use u-boot coding convention for fsp codes
 - Use jnz to jump to the car_init error code at the end of tnc_car.S
   file instead of being in the normal path flow
 - Add a TODO comment block to document the fsp_init() call
 - Change label xxx_stack to xxx_romstack
 - Add a comment block to explain the ROM stack

 Changes in v2:
 - Replace 0xcf9 with macro PORT_RESET from processor.h
 - Move FspInit call from start.S to car_init
 - Add UART0_BASE and UART1_BASE to ibmpc.h

  arch/x86/cpu/queensbay/Makefile   |   9 +++
  arch/x86/cpu/queensbay/tnc.c  |  48 ++
  arch/x86/cpu/queensbay/tnc_car.S  | 127 
 ++
  arch/x86/cpu/queensbay/tnc_dram.c |  78 +++
  arch/x86/cpu/queensbay/tnc_pci.c  |  61 ++
  arch/x86/include/asm/ibmpc.h  |   3 +
  board/intel/crownbay/MAINTAINERS  |   6 ++
  board/intel/crownbay/Makefile |   7 +++
  board/intel/crownbay/crownbay.c   |  21 +++
  board/intel/crownbay/start.S  |   9 +++
  10 files changed, 369 insertions(+)
  create mode 100644 arch/x86/cpu/queensbay/Makefile
  create mode 100644 arch/x86/cpu/queensbay/tnc.c
  create mode 100644 arch/x86/cpu/queensbay/tnc_car.S
  create mode 100644 arch/x86/cpu/queensbay/tnc_dram.c
  create mode 100644 arch/x86/cpu/queensbay/tnc_pci.c
  create mode 100644 board/intel/crownbay/MAINTAINERS
  create mode 100644 board/intel/crownbay/Makefile
  create mode 100644 board/intel/crownbay/crownbay.c
  create mode 100644 board/intel/crownbay/start.S

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


Re: [U-Boot] [PATCH v4 01/15] x86: Integrate Tunnel Creek processor microcode

2014-12-17 Thread Simon Glass
On 17 December 2014 at 07:40, Simon Glass s...@chromium.org wrote:
 On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 Integrate the processor microcode version 1.05 for Tunnel Creek,
 CPUID device 20661h.

 Signed-off-by: Bin Meng bmeng...@gmail.com

 ---

 Changes in v4:
 - Switch to use dtsi format microcode

 Changes in v3: None
 Changes in v2: None

  arch/x86/dts/microcode/m0220661105_cv.dtsi | 368 
 +
  1 file changed, 368 insertions(+)
  create mode 100644 arch/x86/dts/microcode/m0220661105_cv.dtsi

 Acked-by: Simon Glass s...@chromium.org

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 v4 02/15] x86: Add basic support to queensbay platform and crownbay board

2014-12-17 Thread Simon Glass
On 17 December 2014 at 07:41, Simon Glass s...@chromium.org wrote:
 On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 Implement minimum required functions for the basic support to
 queensbay platform and crownbay board.

 Currently the implementation is to call fsp_init() in the car_init().
 We may move that call to cpu_init_f() in the future.

 Signed-off-by: Bin Meng bmeng...@gmail.com

 ---

 Changes in v4: None
 Changes in v3:
 - Update to use u-boot coding convention for fsp codes
 - Use jnz to jump to the car_init error code at the end of tnc_car.S
   file instead of being in the normal path flow
 - Add a TODO comment block to document the fsp_init() call
 - Change label xxx_stack to xxx_romstack
 - Add a comment block to explain the ROM stack

 Changes in v2:
 - Replace 0xcf9 with macro PORT_RESET from processor.h
 - Move FspInit call from start.S to car_init
 - Add UART0_BASE and UART1_BASE to ibmpc.h

  arch/x86/cpu/queensbay/Makefile   |   9 +++
  arch/x86/cpu/queensbay/tnc.c  |  48 ++
  arch/x86/cpu/queensbay/tnc_car.S  | 127 
 ++
  arch/x86/cpu/queensbay/tnc_dram.c |  78 +++
  arch/x86/cpu/queensbay/tnc_pci.c  |  61 ++
  arch/x86/include/asm/ibmpc.h  |   3 +
  board/intel/crownbay/MAINTAINERS  |   6 ++
  board/intel/crownbay/Makefile |   7 +++
  board/intel/crownbay/crownbay.c   |  21 +++
  board/intel/crownbay/start.S  |   9 +++
  10 files changed, 369 insertions(+)
  create mode 100644 arch/x86/cpu/queensbay/Makefile
  create mode 100644 arch/x86/cpu/queensbay/tnc.c
  create mode 100644 arch/x86/cpu/queensbay/tnc_car.S
  create mode 100644 arch/x86/cpu/queensbay/tnc_dram.c
  create mode 100644 arch/x86/cpu/queensbay/tnc_pci.c
  create mode 100644 board/intel/crownbay/MAINTAINERS
  create mode 100644 board/intel/crownbay/Makefile
  create mode 100644 board/intel/crownbay/crownbay.c
  create mode 100644 board/intel/crownbay/start.S

 Acked-by: Simon Glass s...@chromium.org

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 v4 03/15] x86: Convert microcode format to device-tree-only

2014-12-17 Thread Simon Glass
On 17 December 2014 at 01:05, Bin Meng bmeng...@gmail.com wrote:
 Hi,

 On Wed, Dec 17, 2014 at 3:50 PM, Bin Meng bmeng...@gmail.com wrote:
 From: Simon Glass s...@chromium.org

 To avoid having two microcode formats, adjust the build system to support
 obtaining the microcode from the device tree, even in the case where it
 must be made available before the device tree can be accessed.

 Signed-off-by: Simon Glass s...@chromium.org

 ---

 Changes in v4:
 - Squash the microcode.dtsi to patch#1 in the v4 series

 Changes in v3: None
 Changes in v2: None

  Makefile |  4 +++-
  arch/x86/cpu/queensbay/tnc_car.S | 11 ---
  arch/x86/dts/crownbay.dts|  7 +++
  3 files changed, 14 insertions(+), 8 deletions(-)

 diff --git a/Makefile b/Makefile
 index fd24cde..d4e60e8 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -947,7 +947,9 @@ ifneq ($(CONFIG_X86_RESET_VECTOR),)
  rom: u-boot.rom FORCE

  IFDTOOL=$(objtree)/tools/ifdtool
 -IFDTOOL_FLAGS  = -w $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-dtb.bin
 +IFDTOOL_FLAGS  = -f 0:$(objtree)/u-boot.dtb
 +IFDTOOL_FLAGS += -m 0x$(shell $(NM) u-boot |grep _dt_ucode_base_size |cut 
 -d' ' -f1)
 +IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot.bin
  IFDTOOL_FLAGS += -w 
 $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin

  ifneq ($(CONFIG_HAVE_INTEL_ME),)
 diff --git a/arch/x86/cpu/queensbay/tnc_car.S 
 b/arch/x86/cpu/queensbay/tnc_car.S
 index 6834a64..2e9139e 100644
 --- a/arch/x86/cpu/queensbay/tnc_car.S
 +++ b/arch/x86/cpu/queensbay/tnc_car.S
 @@ -116,12 +116,9 @@ temp_ram_init_romstack:
 .long   temp_ram_init_ret
 .long   temp_ram_init_params
  temp_ram_init_params:
 -   .long   ucode_start /* microcode base */
 -   .long   ucode_size  /* microcode size */
 +_dt_ucode_base_size:
 +   /* These next two fields are filled in by ifdtool */
 +   .long   0   /* microcode base */
 +   .long   0   /* microcode size */
 .long   CONFIG_SYS_MONITOR_BASE /* code region base */
 .long   CONFIG_SYS_MONITOR_LEN  /* code region size */
 -
 -   .balign 4
 -ucode_start:
 -   .include arch/x86/cpu/queensbay/M0220661105.inc
 -ucode_size = ( . - ucode_start)
 diff --git a/arch/x86/dts/crownbay.dts b/arch/x86/dts/crownbay.dts
 index 399dafb..3f43f3c 100644
 --- a/arch/x86/dts/crownbay.dts
 +++ b/arch/x86/dts/crownbay.dts
 @@ -50,4 +50,11 @@
 memory-map = 0xffe0 0x0020;
 };
 };
 +
 +   microcode {
 +   update@0 {
 +#include microcode/m0220661105_cv.dtsi
 +   };
 +   };
 +
  };
 --

 Reviewed-by: Bin Meng bmeng...@gmail.com
 Tested-by: Bin Meng bmeng...@gmail.com

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 v4 04/15] x86: ich6-gpio: Add Intel Tunnel Creek GPIO support

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 Intel Tunnel Creek GPIO register block is compatible with current
 ich6-gpio driver, except the offset and content of GPIO block base
 address register in the LPC PCI configuration space are different.

 Use u16 instead of u32 to store the 16-bit I/O address of the GPIO
 registers so that it could support both Ivybridge and Tunnel Creek.

 Signed-off-by: Bin Meng bmeng...@gmail.com
 Acked-by: Simon Glass s...@chromium.org

 ---

 Changes in v4: None
 Changes in v3: None
 Changes in v2:
 - Add a comment to explain we don't need check bit0 in GPIO base
   address register
 - Add setup_pch_gpios() in crownbay.c

  arch/x86/include/asm/arch-queensbay/gpio.h | 13 +
  arch/x86/include/asm/gpio.h|  4 ++--
  board/coreboot/coreboot/coreboot.c |  2 +-
  board/google/chromebook_link/link.c|  2 +-
  board/intel/crownbay/crownbay.c|  5 +
  drivers/gpio/intel_ich6_gpio.c | 20 
  6 files changed, 34 insertions(+), 12 deletions(-)
  create mode 100644 arch/x86/include/asm/arch-queensbay/gpio.h

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 v4 06/15] x86: Add queensbay and crownbay Kconfig files

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 Signed-off-by: Bin Meng bmeng...@gmail.com
 Acked-by: Simon Glass s...@chromium.org

 ---

 Changes in v4: None
 Changes in v3: None
 Changes in v2:
 - Fix several typos in queensbay/Kconfig
 - Change FSP_FILE and CMC_FILE description to indicate the file is
   in the board directory
 - Add help for FSP_TEMP_RAM_ADDR
 - Add more help for CMC_FILE

  arch/x86/Kconfig   | 13 +++
  arch/x86/cpu/queensbay/Kconfig | 79 
 ++
  board/intel/crownbay/Kconfig   | 20 +++
  3 files changed, 112 insertions(+)
  create mode 100644 arch/x86/cpu/queensbay/Kconfig
  create mode 100644 board/intel/crownbay/Kconfig

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 v4 07/15] x86: Add crownbay defconfig and config.h

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 Signed-off-by: Bin Meng bmeng...@gmail.com
 Acked-by: Simon Glass s...@chromium.org
 ---

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

  configs/crownbay_defconfig |  6 ++
  include/configs/crownbay.h | 52 
 ++
  2 files changed, 58 insertions(+)
  create mode 100644 configs/crownbay_defconfig
  create mode 100644 include/configs/crownbay.h

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 v4 05/15] x86: Enable the queensbay cpu directory build

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 Signed-off-by: Bin Meng bmeng...@gmail.com
 Acked-by: Simon Glass s...@chromium.org
 ---

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

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

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 v4 09/15] x86: Include FSP and CMC binary in the u-boot.rom build rules

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 Signed-off-by: Bin Meng bmeng...@gmail.com
 Acked-by: Simon Glass s...@chromium.org

 ---

 Changes in v4: None
 Changes in v3: None
 Changes in v2:
 - Update ifdtool flags to indicate FSP and CMC files are in
   the board directory
 - Use consistent XXX_FILE name for binary blob file

  Makefile  | 10 +-
  include/configs/chromebook_link.h |  2 +-
  2 files changed, 10 insertions(+), 2 deletions(-)

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 v4 08/15] x86: Use consistent name XXX_ADDR for binary blob flash address

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 Signed-off-by: Bin Meng bmeng...@gmail.com
 Acked-by: Simon Glass s...@chromium.org

 ---

 Changes in v4: None
 Changes in v3: None
 Changes in v2:
 - New patch to use consistent name XXX_ADDR for binary blobs

  Makefile | 2 +-
  arch/x86/cpu/ivybridge/sdram.c   | 2 +-
  arch/x86/cpu/queensbay/Kconfig   | 4 ++--
  arch/x86/cpu/queensbay/fsp_support.c | 2 +-
  arch/x86/cpu/queensbay/tnc_car.S | 2 +-
  include/configs/chromebook_link.h| 2 +-
  6 files changed, 7 insertions(+), 7 deletions(-)

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 v4 10/15] x86: crownbay: Add SPI flash support

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 The Crown Bay board has an SST25VF016B flash connected to the Tunnel
 Creek processor SPI controller used as the BIOS media where U-Boot
 is stored. Enable this flash support.

 Signed-off-by: Bin Meng bmeng...@gmail.com
 Acked-by: Simon Glass s...@chromium.org

 ---

 Changes in v4: None
 Changes in v3:
 - Add a commit message for the SPI support

 Changes in v2:
 - Move PCH_LPC_DEV to arch/x86/include/asm/arch-queensbay/tnc.h
 - Check return value of x86_cpu_init_f()

  arch/x86/cpu/queensbay/tnc.c  | 26 +-
  arch/x86/include/asm/arch-queensbay/tnc.h | 15 +++
  include/configs/crownbay.h|  2 ++
  3 files changed, 42 insertions(+), 1 deletion(-)
  create mode 100644 arch/x86/include/asm/arch-queensbay/tnc.h

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 v4 15/15] x86: Clean up the FSP support codes

2014-12-17 Thread Simon Glass
On 17 December 2014 at 07:41, Simon Glass s...@chromium.org wrote:
 On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 This is the follow-on patch to clean up the FSP support codes:

 - Remove the _t suffix on the structures defines
 - Use __packed for structure defines
 - Use U-Boot's assert()
 - Use standard bool true/false
 - Remove read_unaligned64()
 - Use memcmp() in the compare_guid()
 - Remove the cast in the memset() call
 - Replace some magic numbers with macros
 - Use panic() when no valid FSP image header is found
 - Change some FSP utility routines to use an fsp_ prefix
 - Add comment blocks for asm_continuation and fsp_init_done
 - Remove some casts in find_fsp_header()
 - Change HOB access macros to static inline routines
 - Add comments to mention find_fsp_header() may be called in a
   stackless environment
 - Add comments to mention init(params) in fsp_init() cannot
   be removed

 Signed-off-by: Bin Meng bmeng...@gmail.com

 ---

 Changes in v4:
 - Use __packed for structure defines
 - Fix some typos and print FSP full name in cmd_hob.c

 Changes in v3: None
 Changes in v2:
 - Remove some casts in find_fsp_header()
 - Change HOB access macros to static inline routines

  arch/x86/cpu/queensbay/fsp_configs.c   |   2 +-
  arch/x86/cpu/queensbay/fsp_support.c   | 253 
 ++---
  arch/x86/cpu/queensbay/tnc_dram.c  |  18 +-
  arch/x86/include/asm/arch-queensbay/fsp/fsp_api.h  |  18 +-
  arch/x86/include/asm/arch-queensbay/fsp/fsp_ffs.h  |  28 +--
  arch/x86/include/asm/arch-queensbay/fsp/fsp_fv.h   |  14 +-
  arch/x86/include/asm/arch-queensbay/fsp/fsp_hob.h  | 112 +
  .../asm/arch-queensbay/fsp/fsp_infoheader.h|   6 +-
  .../include/asm/arch-queensbay/fsp/fsp_platform.h  |   8 +-
  .../include/asm/arch-queensbay/fsp/fsp_support.h   |  63 ++---
  .../x86/include/asm/arch-queensbay/fsp/fsp_types.h |  17 +-
  arch/x86/include/asm/arch-queensbay/fsp/fsp_vpd.h  |   8 +-
  arch/x86/lib/cmd_hob.c |  22 +-
  13 files changed, 279 insertions(+), 290 deletions(-)


 Acked-by: Simon Glass s...@chromium.org

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 v4 12/15] x86: crownbay: Add SDHCI support

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 There are two standard SD card slots on the Crown Bay board, which
 are connected to the Topcliff PCH SDIO controllers. Enable the SDHC
 support so that we can use them.

 Signed-off-by: Bin Meng bmeng...@gmail.com
 Acked-by: Simon Glass s...@chromium.org

 ---

 Changes in v4: None
 Changes in v3: None
 Changes in v2:
 - Use ARRAY_SIZE(mmc_supported) instead of 2
 - Check return value of add_sdhci()

  arch/x86/cpu/queensbay/Makefile   |  2 +-
  arch/x86/cpu/queensbay/topcliff.c | 47 
 +++
  include/configs/crownbay.h|  6 +
  3 files changed, 54 insertions(+), 1 deletion(-)
  create mode 100644 arch/x86/cpu/queensbay/topcliff.c

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 v4 11/15] x86: crownbay: Enable Intel E1000 NIC support

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 We don't have driver for the Intel Topcliff PCH Gigabit Ethernet
 controller for now, so enable the Intle E1000 NIC support, which
 can be plugged into any PCIe slot on the Crown Bay board.

 Signed-off-by: Bin Meng bmeng...@gmail.com
 Acked-by: Simon Glass s...@chromium.org
 ---

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

  board/intel/crownbay/crownbay.c | 6 ++
  include/configs/crownbay.h  | 1 +
  2 files changed, 7 insertions(+)

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 v4 13/15] x86: Rename coreboot-serial to x86-serial

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 Signed-off-by: Bin Meng bmeng...@gmail.com
 Acked-by: Simon Glass s...@chromium.org

 ---

 Changes in v4: None
 Changes in v3: None
 Changes in v2:
 - New patch to rename coreboot-serial to x86-serial

  arch/x86/dts/coreboot.dtsi |  2 +-
  drivers/serial/Makefile|  2 +-
  drivers/serial/{serial_coreboot.c = serial_x86.c} | 12 ++--
  include/configs/chromebook_link.h  |  2 +-
  include/configs/coreboot.h |  2 +-
  include/configs/crownbay.h |  2 +-
  6 files changed, 11 insertions(+), 11 deletions(-)
  rename drivers/serial/{serial_coreboot.c = serial_x86.c} (67%)

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 v4 14/15] x86: Add a README.x86 for U-Boot on x86 support

2014-12-17 Thread Simon Glass
On 17 December 2014 at 00:50, Bin Meng bmeng...@gmail.com wrote:
 Signed-off-by: Bin Meng bmeng...@gmail.com
 Acked-by: Simon Glass s...@chromium.org

 ---

 Changes in v4:
 - Minor update per review comments from Pavel Machek

 Changes in v3: None
 Changes in v2:
 - Remove the 'make menuconfig' in the crownbay build instructions
 - Indicate all the binary blobs should be put in the board directory

  doc/README.x86 | 126 
 +
  1 file changed, 126 insertions(+)
  create mode 100644 doc/README.x86

I also fixed up the 'Link' reference.

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 1/2] kbuild: Fix a false error of generic board support

2014-12-17 Thread Tom Rini
On Wed, Dec 17, 2014 at 02:04:32AM +0100, Marek Vasut wrote:
 On Wednesday, December 17, 2014 at 12:56:46 AM, Tom Rini wrote:
  On Tue, Dec 16, 2014 at 02:56:44PM -0600, mgerlach wrote:
   Hello Masahiro Yamada,
   
   Even the with this patch, we encountered a false error of generic board
   support.  The problem was very interrmittent for us, but we were able
   to debug the problem to performing builds on EXT3 file systems which
   have a time stamp resolution of one second.  To reproduce the problem,
   touch ./include/config/auto.conf and .config on a configured uboot tree
   on an EXT3 file system.
   
   The patch below fixes the problem for us.
  
  This makes an odd race condition problem I run into when doing massively
  paralell builds worse :(  With MAKEALL no ARM boards build (ARCH wasn't
  set in time so it tried arch//Makefile for something) and buildman was
  also broken in a bunch of places.
 
 Let me just chime in, I recall I did report something possibly similar some 
 time 
 ago [1]. I did not manage to put a finger on this issue though and I can no 
 longer trigger it.
 
 [1] http://lists.denx.de/pipermail/u-boot/2013-June/157481.html

No, my problem was introduced with the switch to Kbuild itself.

-- 
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] Falcon mode boot support

2014-12-17 Thread Andy Pont
Hi Tom,

Following the experiment that yielded the following results:

 U-Boot time sf read ${loadaddr} 0x20 ${loadsize}
 
 I get the following back:
 
 SF: 2541352 bytes @ 0x20 Read: OK
 time: 2.447 seconds

I have done some reading and poking around and have added the
OMAP3_MCSPI_CHCONF_TURBO flag to the SPI channel enablement in the
omap3_spi_read() function within omap3_spi.c and now the same command takes
1.279 seconds to execute.

I have also added a couple of printf() statements around the call to read
the flash device that loads the kernel image in spi_load_image_os() and the
timestamps on the output to the serial console consistently show that it is
taking around 3.5 seconds to load the same kernel image.

I haven't fully looked into what is going on as I haven't yet found the full
call path from spi_flash_read() in spi_flash.h to when it eventually results
in the call to omap3_spi_read() and so it may be doing more and I'm not
actually comparing apples with apples.

Could you (or maybe Jagannadha as SPI custodian) point me in the right
direction?

Thanks,

Andy.

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


Re: [U-Boot] [PATCH v3] dm: sh: serial: Add support driver model

2014-12-17 Thread Simon Glass
On 16 December 2014 at 17:03, Nobuhiro Iwamatsu
nobuhiro.iwamatsu...@renesas.com wrote:
 This adds driver model support with this driver. This was tested by Koelsch
 board and Gose board.

 Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
 ---
  V3: Add function of checking -EAGAIN without DM.
  V2: Fix loop for tx fifo and tx fifo.
  Fix write return code writing with DM.

  drivers/serial/serial_sh.c   | 321 
 ---
  drivers/serial/serial_sh.h   |  10 +-
  include/dm/platform_data/serial_sh.h |  37 
  3 files changed, 260 insertions(+), 108 deletions(-)
  create mode 100644 include/dm/platform_data/serial_sh.h

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


Re: [U-Boot] [PATCH V4 2/3] usb: eth: add ASIX AX88179 DRIVER

2014-12-17 Thread Joe Hershberger
On Wed, Dec 17, 2014 at 6:33 AM, René Griessl 
rgrie...@cit-ec.uni-bielefeld.de wrote:
 Is there a reason you can't implement write_hwaddr() so that it will
behave like other NICs (u-boot is the highest priority source of the MAC
address).

 The AX88179 uses an external flash to store the MAC address. So for my
application I do not want the user to be able to change it, since it is a
unique ID inside the server cluster.
 I could add it as compiler option. Maybe it is even better to implement
my behavior as option, since it differs from standard.

The feature is not supposed to cause any change to the flash stored MAC
address, but rather override it at run-time.  It is only overridden if the
user specifies a MAC in u-boot env.  This should not be a build option, but
just the way it always works.

 I think it will be finished mid of january, so if it is OK for you in a
separate patch.

That's fine.

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


Re: [U-Boot] [PATCH V4 2/3] usb: eth: add ASIX AX88179 DRIVER

2014-12-17 Thread Joe Hershberger
On Fri, Nov 7, 2014 at 9:53 AM, Rene Griessl 
rgrie...@cit-ec.uni-bielefeld.de wrote:

 This patch adds driver support for the ASIX AX88179 USB3.0 to GbE network
 adapter.

 Driver has been tested on the RECS5250 COM module (similar to ARDALE5250).
 Testcase was DHCP and PXE boot.

 Signed-off-by: Rene Griessl rgrie...@cit-ec.uni-bielefeld.de
 ---
 changes for v4:
 -added dynamic RX bulk configuration
 changes for v3:
 -added all compatible devices from linux driver
  from commit cf8bf7cd13804fcb87b5f9ad026d5b823873e8cc
 -fixed issues from review
 changes for v2:
 -added usb_ether.h to change list
 -added 2nd patch to enable driver for arndale board

  drivers/usb/eth/Makefile|   1 +
  drivers/usb/eth/asix88179.c | 700

  drivers/usb/eth/usb_ether.c |   7 +
  include/usb_ether.h |   6 +
  4 files changed, 714 insertions(+)

Acked-by: Joe Hershberger joe.hershber...@ni.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] ubi: enable error reporting in initialization

2014-12-17 Thread Hector Palacios
Hi Andrew,

On 11/05/2014 08:31 PM, Andrew Ruder wrote:
 The UBI layer will disable much of its error reporting when it is
 compiled into the linux kernel to avoid stopping boot.  We want this
 error reporting in U-Boot since we don't initialize the UBI layer until
 it is used and want the error reporting.
 
 We force this by telling the UBI layer we are building as a module.
 
 Signed-off-by: Andrew Ruder andrew.ru...@elecsyscorp.com
 Cc: Wolfgang Denk w...@denx.de
 Cc: Heiko Schocher h...@denx.de
 Cc: Kyungmin Park kmp...@infradead.org
 ---
  include/ubi_uboot.h | 8 
  1 file changed, 8 insertions(+)
 
 diff --git a/include/ubi_uboot.h b/include/ubi_uboot.h
 index 1fd15f4..324fe72 100644
 --- a/include/ubi_uboot.h
 +++ b/include/ubi_uboot.h
 @@ -51,6 +51,14 @@
  
  #undef CONFIG_MTD_UBI_BLOCK
  
 +/* ubi_init() disables returning error codes when built into the Linux
 + * kernel so that it doesn't hang the Linux kernel boot process.  Since
 + * the U-Boot driver code depends on getting valid error codes from this
 + * function we just tell the UBI layer that we are building as a module
 + * (which only enables the additional error reporting).
 + */
 +#define CONFIG_MTD_UBI_MODULE
 +
  #if !defined(CONFIG_MTD_UBI_BEB_LIMIT)
  #define CONFIG_MTD_UBI_BEB_LIMIT 20
  #endif
 

I applied this patch but apparently I'm suffering a memory leak in a certain
condition. I wonder if you can reproduce it:

1. Assume you have an empty partition called MyPart.
2. Write it with some dummy data:
= mw.l $loadaddr deadbeed 1000
= nand write $loadaddr MyPart 1000
3. Set it as the UBI part:
= ubi part MyPart
This (which returned 0 before, despite failing during the attach procedure now 
should
return an error).
4. Run the command again several times:
= ubi part MyPart
= ubi part MyPart

In my case, after calling this three times, the target hangs. I think the exit 
path in
ubi_init() does not properly free every allocated memory. I was not able to 
find the
root cause, though.

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


Re: [U-Boot] Falcon mode boot support

2014-12-17 Thread Tom Rini
On Wed, Dec 17, 2014 at 04:27:37PM -, Andy Pont wrote:
 Hi Tom,
 
 Following the experiment that yielded the following results:
 
  U-Boot time sf read ${loadaddr} 0x20 ${loadsize}
  
  I get the following back:
  
  SF: 2541352 bytes @ 0x20 Read: OK
  time: 2.447 seconds
 
 I have done some reading and poking around and have added the
 OMAP3_MCSPI_CHCONF_TURBO flag to the SPI channel enablement in the
 omap3_spi_read() function within omap3_spi.c and now the same command takes
 1.279 seconds to execute.
 
 I have also added a couple of printf() statements around the call to read
 the flash device that loads the kernel image in spi_load_image_os() and the
 timestamps on the output to the serial console consistently show that it is
 taking around 3.5 seconds to load the same kernel image.
 
 I haven't fully looked into what is going on as I haven't yet found the full
 call path from spi_flash_read() in spi_flash.h to when it eventually results
 in the call to omap3_spi_read() and so it may be doing more and I'm not
 actually comparing apples with apples.
 
 Could you (or maybe Jagannadha as SPI custodian) point me in the right
 direction?

I suspect that this might be related to the general problem on these
part families where SPL isn't as fast as we expect it to be, perhaps
cache related.

-- 
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 1/4] [RFC] rsa: Split the rsa-verify

2014-12-17 Thread Simon Glass
Hi Ruchika,

On 17 December 2014 at 03:05, Ruchika Gupta ruchika.gu...@freescale.com wrote:
 Public exponentiation which is required in rsa verify
 functionality is currently tightly integrated with
 verification code in rsa_verify.c. Currently this
 implementation is software based. Some platforms
 having support of the exponentiation in hardware.
 To enable the rsa verify functionality to use the
 Modular exponentiation if present in hardware, the
 patch-set splits the file into two files:

 1. rsa-verify.c
 - The file parses device tree keys node to fill a keyprop
 structure. The keyprop structure can then be converted
 to implementation specific formal (struct rsa_pub_key
 for sw implementation).
 - The parsed device tree node is then passed to a generic
 rsa_mod_exp function.

 2. rsa-mod-exp.c
 Move the software specific functions related to exponentiation
 from rsa-verify.c to this file. The file is compiled if
 CONFIG_RSA_MOD_EXP_SW is defined. In general if both
 CONFIG_FIT_SIGNATURE and CONFIG_RSA are defined,
 CONFIG_RSA_MOD_EXP_SW gets automatically defined.

 Platforms having hardware implementation for rsa_mod_exp can
 add a define CONFIG_RSA_MOD_EXP_HW to their config files.
 Adding this defined, undefs the CONFIG_RSA_MOD_EXP_SW and
 hardware implementation of mod_exp gets compiled.

 Signed-off-by: Ruchika Gupta ruchika.gu...@freescale.com
 CC: Simon Glass s...@chromium.org

I'm going to mostly limit my comments to high level things for this
RFC. It's a good idea.

Can you add a patch to move existing RSA CONFIGs to Kconfig, and then
use Kconfig for your new options. Then I think your ...EXP_HW and
...EXP_SW become an choice:

1. Software RSA
2. Freescale xxx chip hardware RSA
3. Some other RSA implementation

With my driver model hat on, there really should be a uclass for an
exponentiation implementation and an interface that these drivers
implement. Since you already have an interface, that should be easy.

I'm not sure about the structures you mention above, but potentially
you can have a the driver-specific structure and a uclass structure.
The device tree would parse to the latter perhaps.

 ---
  include/config_fallbacks.h   |   5 +
  include/u-boot/rsa-mod-exp.h |  25 
  lib/rsa/Makefile |   1 +
  lib/rsa/rsa-mod-exp.c| 308 
 +++
  lib/rsa/rsa-verify.c | 307 +-
  tools/Makefile   |   2 +-
  6 files changed, 370 insertions(+), 278 deletions(-)
  create mode 100644 include/u-boot/rsa-mod-exp.h
  create mode 100644 lib/rsa/rsa-mod-exp.c

 diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h
 index ddfe045..d4676b4 100644
 --- a/include/config_fallbacks.h
 +++ b/include/config_fallbacks.h
 @@ -83,6 +83,11 @@
  #define CONFIG_SYS_PBSIZE  (CONFIG_SYS_CBSIZE + 128)
  #endif

 +#if defined(CONFIG_FIT_SIGNATURE)  defined(CONFIG_RSA)  \
 +   !defined(CONFIG_RSA_MOD_EXP_HW)
 +#define CONFIG_RSA_MOD_EXP_SW
 +#endif

As above you shouldn't need this

 +
  #ifndef CONFIG_FIT_SIGNATURE
  #define CONFIG_IMAGE_FORMAT_LEGACY
  #endif
 diff --git a/include/u-boot/rsa-mod-exp.h b/include/u-boot/rsa-mod-exp.h
 new file mode 100644
 index 000..577f673
 --- /dev/null
 +++ b/include/u-boot/rsa-mod-exp.h
 @@ -0,0 +1,25 @@
 +/*
 + * Copyright (c) 2014, Ruchika Gupta.
 + *
 + * SPDX-License-Identifier:GPL-2.0+
 +*/
 +
 +#ifndef _RSA_MOD_EXP_H
 +#define _RSA_MOD_EXP_H
 +
 +#include errno.h
 +#include image.h

Comments here

 +
 +struct key_prop {
 +   const void *rr;
 +   const void *modulus;
 +   const void *public_exponent;
 +   uint32_t n0inv;
 +   int num_bits;
 +   uint32_t exp_len;
 +};
 +
 +int rsa_mod_exp(const uint8_t *sig, uint32_t sig_len,
 +   struct key_prop *node, uint8_t *out);
 +
 +#endif
 diff --git a/lib/rsa/Makefile b/lib/rsa/Makefile
 index a5a96cb6..ccc6060 100644
 --- a/lib/rsa/Makefile
 +++ b/lib/rsa/Makefile
 @@ -8,3 +8,4 @@
  #

  obj-$(CONFIG_FIT_SIGNATURE) += rsa-verify.o rsa-checksum.o
 +obj-$(CONFIG_RSA_MOD_EXP_SW) += rsa-mod-exp.o
 diff --git a/lib/rsa/rsa-mod-exp.c b/lib/rsa/rsa-mod-exp.c
 new file mode 100644
 index 000..f69ae1b
 --- /dev/null
 +++ b/lib/rsa/rsa-mod-exp.c
 @@ -0,0 +1,308 @@
 +/*
 + * Copyright (c) 2013, Google Inc.
 + *
 + * SPDX-License-Identifier:GPL-2.0+
 + */
 +
 +#ifndef USE_HOSTCC
 +#include common.h
 +#include fdtdec.h
 +#include asm/types.h
 +#include asm/byteorder.h
 +#include asm/errno.h
 +#include asm/types.h
 +#include asm/unaligned.h
 +#else
 +#include fdt_host.h
 +#include mkimage.h
 +#include fdt_support.h
 +#endif
 +#include u-boot/rsa.h
 +#include u-boot/rsa-mod-exp.h
 +
 +#define UINT64_MULT32(v, multby)  (((uint64_t)(v)) * ((uint32_t)(multby)))
 +
 +#define get_unaligned_be32(a) fdt32_to_cpu(*(uint32_t *)a)
 +#define put_unaligned_be32(a, b) (*(uint32_t *)(b) = cpu_to_fdt32(a))
 +
 +/* Default public exponent for backward compatibility */

Re: [U-Boot] [PATCH 2/4] [RFC] crypto/fsl: Add support for RSA Modular Exponentiation

2014-12-17 Thread Simon Glass
Hi Ruchika,

On 17 December 2014 at 03:05, Ruchika Gupta ruchika.gu...@freescale.com wrote:
 Support added for offloading Modular Exponentiation required
 in RSA Verify functionality to hardware which depends on
 CONFIG_RSA_MOD_EXP_HW.

 Signed-off-by: Ruchika Gupta ruchika.gu...@freescale.com
 CC: Simon Glass s...@chromium.org
 ---
  drivers/crypto/fsl/Makefile   |  1 +
  drivers/crypto/fsl/fsl_rsa.c  | 44 
 +++
  drivers/crypto/fsl/jobdesc.c  | 28 +++
  drivers/crypto/fsl/jobdesc.h  |  5 +
  drivers/crypto/fsl/rsa_caam.h | 27 ++
  5 files changed, 105 insertions(+)
  create mode 100644 drivers/crypto/fsl/fsl_rsa.c
  create mode 100644 drivers/crypto/fsl/rsa_caam.h

I have no new comments on this patch apart from what I said on patch 1.

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


Re: [U-Boot] [PATCH 4/4] [RFC] rsa: Use checksum algorithms from struct hash_algo

2014-12-17 Thread Simon Glass
Hi,

On 17 December 2014 at 03:05, Ruchika Gupta ruchika.gu...@freescale.com wrote:
 Currently the hash functions used in RSA are called
 directly from the sha1 and sha256 libraries.
 Change the RSA checksum library to use the progressive
 hash API's registered with struct hash_algo. This will
 allow the checksum library to use the support of hardware
 accelerated progressive hash API's once available.

 Signed-off-by: Ruchika Gupta ruchika.gu...@freescale.com
 CC: Simon Glass s...@chromium.org
 ---
  include/image.h   |  2 +-
  include/u-boot/rsa-checksum.h |  4 +--
  lib/rsa/rsa-checksum.c| 61 
 ---
  3 files changed, 60 insertions(+), 7 deletions(-)

 diff --git a/include/image.h b/include/image.h
 index af30d60..0067c75 100644
 --- a/include/image.h
 +++ b/include/image.h
 @@ -926,7 +926,7 @@ struct checksum_algo {
  #if IMAGE_ENABLE_SIGN
 const EVP_MD *(*calculate_sign)(void);
  #endif
 -   void (*calculate)(const struct image_region region[],
 +   int (*calculate)(const struct image_region region[],
   int region_count, uint8_t *checksum);
 const uint8_t *rsa_padding;
  };
 diff --git a/include/u-boot/rsa-checksum.h b/include/u-boot/rsa-checksum.h
 index c996fb3..db55046 100644
 --- a/include/u-boot/rsa-checksum.h
 +++ b/include/u-boot/rsa-checksum.h
 @@ -16,9 +16,9 @@ extern const uint8_t padding_sha256_rsa4096[];
  extern const uint8_t padding_sha256_rsa2048[];
  extern const uint8_t padding_sha1_rsa2048[];

 -void sha256_calculate(const struct image_region region[], int region_count,
 +int sha256_calculate(const struct image_region region[], int region_count,
   uint8_t *checksum);
 -void sha1_calculate(const struct image_region region[], int region_count,
 +int sha1_calculate(const struct image_region region[], int region_count,
 uint8_t *checksum);

I wonder if the algorithm can become a parameter rather than
duplicating the code...


  #endif
 diff --git a/lib/rsa/rsa-checksum.c b/lib/rsa/rsa-checksum.c
 index 8d8b59f..af27c97 100644
 --- a/lib/rsa/rsa-checksum.c
 +++ b/lib/rsa/rsa-checksum.c
 @@ -10,12 +10,13 @@
  #include asm/byteorder.h
  #include asm/errno.h
  #include asm/unaligned.h
 +#include hash.h
  #else
  #include fdt_host.h
 -#endif
 -#include u-boot/rsa.h
  #include u-boot/sha1.h
  #include u-boot/sha256.h
 +#endif
 +#include u-boot/rsa.h

  /* PKCS 1.5 paddings as described in the RSA PKCS#1 v2.1 standard. */

 @@ -136,7 +137,54 @@ const uint8_t padding_sha256_rsa4096[RSA4096_BYTES - 
 SHA256_SUM_LEN] = {
 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20
  };

 -void sha1_calculate(const struct image_region region[], int region_count,
 +#ifndef USE_HOSTCC
 +void hash_calculate(struct hash_algo *algo, const struct image_region 
 region[],
 +  int region_count, uint8_t *checksum)
 +{
 +   void *ctx;
 +   uint32_t i;
 +   i = 0;
 +
 +   algo-hash_init(algo, ctx);
 +   for (i = 0; i  region_count - 1; i++)
 +   algo-hash_update(algo, ctx, region[i].data, region[i].size, 
 0);
 +
 +   algo-hash_update(algo, ctx, region[i].data, region[i].size, 1);
 +   algo-hash_finish(algo, ctx, checksum, algo-digest_size);
 +}
 +
 +int sha1_calculate(const struct image_region region[], int region_count,
 +   uint8_t *checksum)
 +{
 +   struct hash_algo *algo;
 +   int ret = 0;
 +
 +   ret = hash_progressive_lookup_algo(sha1, algo);
 +   if (ret)
 +   return ret;
 +
 +   hash_calculate(algo, region, region_count, checksum);
 +
 +   return 0;
 +}
 +
 +int sha256_calculate(const struct image_region region[], int region_count,
 +   uint8_t *checksum)
 +{
 +   struct hash_algo *algo;
 +   int ret;
 +
 +   ret = hash_progressive_lookup_algo(sha256, algo);
 +   if (ret)
 +   return ret;
 +
 +   hash_calculate(algo, region, region_count, checksum);
 +
 +   return 0;
 +}

Here is the duplication - these functions are the same but for sha1 and sha256.

 +
 +#else
 +int sha1_calculate(const struct image_region region[], int region_count,
 uint8_t *checksum)
  {
 sha1_context ctx;
 @@ -147,9 +195,11 @@ void sha1_calculate(const struct image_region region[], 
 int region_count,
 for (i = 0; i  region_count; i++)
 sha1_update(ctx, region[i].data, region[i].size);
 sha1_finish(ctx, checksum);
 +
 +   return 0;
  }

 -void sha256_calculate(const struct image_region region[], int region_count,
 +int sha256_calculate(const struct image_region region[], int region_count,
   uint8_t *checksum)
  {
 sha256_context ctx;
 @@ -160,4 +210,7 @@ void sha256_calculate(const struct image_region region[], 
 int region_count,
 for (i = 0; i  region_count; i++)
 sha256_update(ctx, region[i].data, 

Re: [U-Boot] [PATCH 3/4] [RFC] hash: Add function to find hash_algo struct with progressive hash

2014-12-17 Thread Simon Glass
Hi,

On 17 December 2014 at 03:05, Ruchika Gupta ruchika.gu...@freescale.com wrote:
 Signed-off-by: Ruchika Gupta ruchika.gu...@freescale.com
 CC: Simon Glass s...@chromium.org
 ---
  common/hash.c  | 35 ++-
  include/hash.h | 15 +++
  2 files changed, 41 insertions(+), 9 deletions(-)


Can you please add a commit message? I think I can see what this is
doing, but I'm not sure...


 diff --git a/common/hash.c b/common/hash.c
 index 12d6759..87263df 100644
 --- a/common/hash.c
 +++ b/common/hash.c
 @@ -20,7 +20,7 @@
  #include asm/io.h
  #include asm/errno.h

 -#ifdef CONFIG_CMD_SHA1SUM
 +#ifdef CONFIG_SHA256
  static int hash_init_sha1(struct hash_algo *algo, void **ctxp)
  {
 sha1_context *ctx = malloc(sizeof(sha1_context));
 @@ -125,12 +125,8 @@ static struct hash_algo hash_algo[] = {
 CHUNKSZ_SHA256,
 },
  #endif
 -   /*
 -* This is CONFIG_CMD_SHA1SUM instead of CONFIG_SHA1 since otherwise
 -* it bloats the code for boards which use SHA1 but not the 'hash'
 -* or 'sha1sum' commands.
 -*/
 -#ifdef CONFIG_CMD_SHA1SUM
 +
 +#ifdef CONFIG_SHA1
 {
 sha1,
 SHA1_SUM_LEN,
 @@ -140,7 +136,6 @@ static struct hash_algo hash_algo[] = {
 hash_update_sha1,
 hash_finish_sha1,
 },
 -#define MULTI_HASH
  #endif
  #ifdef CONFIG_SHA256
 {
 @@ -152,7 +147,6 @@ static struct hash_algo hash_algo[] = {
 hash_update_sha256,
 hash_finish_sha256,
 },
 -#define MULTI_HASH
  #endif
 {
 crc32,
 @@ -165,6 +159,10 @@ static struct hash_algo hash_algo[] = {
 },
  };

 +#if defined(CONFIG_SHA256) || defined(CONFIG_CMD_SHA1SUM)
 +#define MULTI_HASH
 +#endif
 +
  #if defined(CONFIG_HASH_VERIFY) || defined(CONFIG_CMD_HASH)
  #define MULTI_HASH
  #endif
 @@ -311,6 +309,25 @@ int hash_lookup_algo(const char *algo_name, struct 
 hash_algo **algop)
 return -EPROTONOSUPPORT;
  }

 +int hash_progressive_lookup_algo(const char *algo_name,
 +struct hash_algo **algop)
 +{
 +   int i;
 +
 +   for (i = 0; i  ARRAY_SIZE(hash_algo); i++) {
 +   if (!strcmp(algo_name, hash_algo[i].name)) {
 +   if (hash_algo[i].hash_init) {
 +   *algop = hash_algo[i];
 +   return 0;
 +   }
 +   }
 +   }
 +
 +   debug(Unknown hash algorithm '%s'\n, algo_name);
 +   return -EPROTONOSUPPORT;
 +}
 +
 +
  void hash_show(struct hash_algo *algo, ulong addr, ulong len, uint8_t 
 *output)
  {
 int i;
 diff --git a/include/hash.h b/include/hash.h
 index d8ec4f0..059f84e 100644
 --- a/include/hash.h
 +++ b/include/hash.h
 @@ -128,6 +128,21 @@ int hash_block(const char *algo_name, const void *data, 
 unsigned int len,
  int hash_lookup_algo(const char *algo_name, struct hash_algo **algop);

  /**
 + * hash_progressive_lookup_algo() - Look up the hash_algo struct with 
 progressive
 + * hash support for an algorithm
 + *
 + * The function returns the pointer to the struct or -EPROTONOSUPPORT if the
 + * algorithm is not available with progressive hash support.
 + *
 + * @algo_name: Hash algorithm to look up
 + * @algop: Pointer to the hash_algo struct if found
 + *
 + * @return 0 if ok, -EPROTONOSUPPORT for an unknown algorithm.
 + */
 +int hash_progressive_lookup_algo(const char *algo_name,
 +struct hash_algo **algop);
 +
 +/**
   * hash_show() - Print out a hash algorithm and value
   *
   * You will get a message like this (without a newline at the end):
 --
 1.8.1.4


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


Re: [U-Boot] [PATCH V4 2/3] usb: eth: add ASIX AX88179 DRIVER

2014-12-17 Thread Marek Vasut
On Wednesday, December 17, 2014 at 01:33:57 PM, René Griessl wrote:
  Is there a reason you can't implement write_hwaddr() so that it will
  behave like other NICs (u-boot is the highest priority source of the
  MAC address).
 
 The AX88179 uses an external flash to store the MAC address. So for my
 application I do not want the user to be able to change it, since it is
 a unique ID inside the server cluster.
 I could add it as compiler option. Maybe it is even better to implement
 my behavior as option, since it differs from standard.
 I think it will be finished mid of january, so if it is OK for you in a
 separate patch.

Joe, can you just pick the patch as is and wait for subsequent patch to improve 
the driver? My understanding is that the driver is operating correctly and 
pulling the MAC from an integrated EEPROM, which is fine. If you want to allow
overriding this MAC using the $ethaddr, this is only an improvement and can be
added later. This would improve our hardware support and avoid blocking the 
driver further.

What do you think 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] ls1:config: Add XHCI support for ls1021aqds

2014-12-17 Thread York Sun
On 10/21/2014 04:36 AM, Ramneek Mehresh wrote:
 Add USB XHCI support for ls1021aqds platform and
 making this as default mode
 
 Signed-off-by: Ramneek Mehresh ramneek.mehr...@freescale.com
 ---
  include/configs/ls1021aqds.h | 21 -
  1 file changed, 16 insertions(+), 5 deletions(-)
 

Please verify this patch on the latest u-boot. I saw compiling errors.

York


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


Re: [U-Boot] [PATCH] ls1:config: Add USB support for ls1021atwr

2014-12-17 Thread York Sun
On 10/21/2014 04:36 AM, Ramneek Mehresh wrote:
 Add USB EHCI/XHCI support for ls1021atwr platform and
 making xHCI as default mode
 
 Signed-off-by: Ramneek Mehresh ramneek.mehr...@freescale.com
 ---
  include/configs/ls1021atwr.h | 28 
  1 file changed, 28 insertions(+)
 

Please verify this patch on the latest u-boot. I saw compiling errors.

York


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


[U-Boot] [PATCH] mpc85xx/t102xqds: convert deep sleep to generic board interface

2014-12-17 Thread Tang Yuantian
A new deep sleep interface is introduced to support generic
board structure. Converts it to use new interface.

Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
---
 board/freescale/t102xqds/ddr.c  | 19 +++
 board/freescale/t102xqds/t102xqds.c | 23 +++
 include/configs/T102xQDS.h  |  3 +++
 3 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/board/freescale/t102xqds/ddr.c b/board/freescale/t102xqds/ddr.c
index 46fc64e..2d4d10f 100644
--- a/board/freescale/t102xqds/ddr.c
+++ b/board/freescale/t102xqds/ddr.c
@@ -11,6 +11,7 @@
 #include fsl_ddr_sdram.h
 #include fsl_ddr_dimm_params.h
 #include asm/fsl_law.h
+#include asm/mpc85xx_gpio.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -152,6 +153,19 @@ found:
 #endif
 }
 
+#if defined(CONFIG_DEEP_SLEEP)
+void board_mem_sleep_setup(void)
+{
+   void __iomem *qixis_base = (void *)QIXIS_BASE;
+
+   /* does not provide HW signals for power management */
+   clrbits_8(qixis_base + 0x21, 0x2);
+   /* Disable MCKE isolation */
+   gpio_set_value(2, 0);
+   udelay(1);
+}
+#endif
+
 phys_size_t initdram(int board_type)
 {
phys_size_t dram_size;
@@ -166,5 +180,10 @@ phys_size_t initdram(int board_type)
/* DDR has been initialised by first stage boot loader */
dram_size =  fsl_ddr_sdram_size();
 #endif
+
+#if defined(CONFIG_DEEP_SLEEP)  !defined(CONFIG_SPL_BUILD)
+   fsl_dp_resume();
+#endif
+
return dram_size;
 }
diff --git a/board/freescale/t102xqds/t102xqds.c 
b/board/freescale/t102xqds/t102xqds.c
index f3141b5..708afca 100644
--- a/board/freescale/t102xqds/t102xqds.c
+++ b/board/freescale/t102xqds/t102xqds.c
@@ -19,10 +19,10 @@
 #include asm/fsl_liodn.h
 #include fm_eth.h
 #include hwconfig.h
-#include asm/mpc85xx_gpio.h
 #include ../common/qixis.h
 #include t102xqds.h
 #include t102xqds_qixis.h
+#include ../common/sleep.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -242,6 +242,16 @@ void board_retimer_ds125df111_init(void)
i2c_write(I2C_RETIMER_ADDR, 0x64, 1, reg, 1);
 }
 
+int board_early_init_f(void)
+{
+#if defined(CONFIG_DEEP_SLEEP)
+   if (is_warm_boot())
+   fsl_dp_disable_console();
+#endif
+
+   return 0;
+}
+
 int board_early_init_r(void)
 {
 #ifdef CONFIG_SYS_FLASH_BASE
@@ -395,14 +405,3 @@ void qixis_dump_switch(void)
printf(SW%d = (0x%02x)\n, i, QIXIS_READ(cms[1]));
}
 }
-
-#ifdef CONFIG_DEEP_SLEEP
-void board_mem_sleep_setup(void)
-{
-   /* does not provide HW signals for power management */
-   QIXIS_WRITE(pwr_ctl[1], (QIXIS_READ(pwr_ctl[1])  ~0x2));
-   /* Disable MCKE isolation */
-   gpio_set_value(2, 0);
-   udelay(1);
-}
-#endif
diff --git a/include/configs/T102xQDS.h b/include/configs/T102xQDS.h
index c2bdbb9..3f02ced 100644
--- a/include/configs/T102xQDS.h
+++ b/include/configs/T102xQDS.h
@@ -35,7 +35,10 @@
 #define CONFIG_ENV_OVERWRITE
 
 #define CONFIG_DEEP_SLEEP
+#if defined(CONFIG_DEEP_SLEEP)
 #define CONFIG_SILENT_CONSOLE
+#define CONFIG_BOARD_EARLY_INIT_F
+#endif
 
 #ifdef CONFIG_RAMBOOT_PBL
 #define CONFIG_SYS_FSL_PBL_PBI board/freescale/t102xqds/t1024_pbi.cfg
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCH] mpc85xx/t1040qds: convert deep sleep to generic board interface

2014-12-17 Thread Tang Yuantian
A new deep sleep interface is introduced to support generic
board structure. Converts it to use new interface.

Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
---
 board/freescale/t1040qds/ddr.c  | 19 +++
 board/freescale/t1040qds/t1040qds.c | 23 +++
 include/configs/T1040QDS.h  |  3 +++
 3 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/board/freescale/t1040qds/ddr.c b/board/freescale/t1040qds/ddr.c
index 43f952f..8240240 100644
--- a/board/freescale/t1040qds/ddr.c
+++ b/board/freescale/t1040qds/ddr.c
@@ -11,6 +11,7 @@
 #include fsl_ddr_sdram.h
 #include fsl_ddr_dimm_params.h
 #include asm/fsl_law.h
+#include asm/mpc85xx_gpio.h
 #include ddr.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -100,6 +101,19 @@ found:
 #endif
 }
 
+#if defined(CONFIG_DEEP_SLEEP)
+void board_mem_sleep_setup(void)
+{
+   void __iomem *qixis_base = (void *)QIXIS_BASE;
+
+   /* does not provide HW signals for power management */
+   clrbits_8(qixis_base + 0x21, 0x2);
+   /* Disable MCKE isolation */
+   gpio_set_value(2, 0);
+   udelay(1);
+}
+#endif
+
 phys_size_t initdram(int board_type)
 {
phys_size_t dram_size;
@@ -112,5 +126,10 @@ phys_size_t initdram(int board_type)
dram_size *= 0x10;
 
puts(DDR: );
+
+#if defined(CONFIG_DEEP_SLEEP)  !defined(CONFIG_SPL_BUILD)
+   fsl_dp_resume();
+#endif
+
return dram_size;
 }
diff --git a/board/freescale/t1040qds/t1040qds.c 
b/board/freescale/t1040qds/t1040qds.c
index 13285be..eaca57f 100644
--- a/board/freescale/t1040qds/t1040qds.c
+++ b/board/freescale/t1040qds/t1040qds.c
@@ -19,8 +19,8 @@
 #include asm/fsl_liodn.h
 #include fm_eth.h
 #include hwconfig.h
-#include asm/mpc85xx_gpio.h
 
+#include ../common/sleep.h
 #include ../common/qixis.h
 #include t1040qds.h
 #include t1040qds_qixis.h
@@ -115,6 +115,16 @@ static void qe_board_setup(void)
}
 }
 
+int board_early_init_f(void)
+{
+#if defined(CONFIG_DEEP_SLEEP)
+   if (is_warm_boot())
+   fsl_dp_disable_console();
+#endif
+
+   return 0;
+}
+
 int board_early_init_r(void)
 {
 #ifdef CONFIG_SYS_FLASH_BASE
@@ -281,14 +291,3 @@ int board_need_mem_reset(void)
 {
return 1;
 }
-
-#ifdef CONFIG_DEEP_SLEEP
-void board_mem_sleep_setup(void)
-{
-   /* does not provide HW signals for power management */
-   QIXIS_WRITE(pwr_ctl[1], (QIXIS_READ(pwr_ctl[1])  ~0x2));
-   /* Disable MCKE isolation */
-   gpio_set_value(2, 0);
-   udelay(1);
-}
-#endif
diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h
index b70bdfe..5ebc870 100644
--- a/include/configs/T1040QDS.h
+++ b/include/configs/T1040QDS.h
@@ -47,7 +47,10 @@
 
 /* support deep sleep */
 #define CONFIG_DEEP_SLEEP
+#if defined(CONFIG_DEEP_SLEEP)
 #define CONFIG_SILENT_CONSOLE
+#define CONFIG_BOARD_EARLY_INIT_F
+#endif
 
 #ifndef CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_TEXT_BASE   0xeff4
-- 
2.1.0.27.g96db324

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


[U-Boot] [PATCH] mpc85xx: clean up the old deep sleep framework

2014-12-17 Thread Tang Yuantian
All the boards that support deep sleep feature are converted
to deep sleep generic board interface. The old interface which
support non-generic board is not used anymore. So clean it up.

Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
---
 arch/powerpc/cpu/mpc85xx/cpu_init.c | 10 +-
 arch/powerpc/lib/board.c| 21 -
 2 files changed, 1 insertion(+), 30 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index 85d32fc..4cf8853 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -424,7 +424,6 @@ void fsl_erratum_a007212_workaround(void)
 
 ulong cpu_init_f(void)
 {
-   ulong flag = 0;
extern void m8560_cpm_reset (void);
 #if defined(CONFIG_SYS_DCSRBAR_PHYS) || \
(defined(CONFIG_SECURE_BOOT)  defined(CONFIG_FSL_CORENET))
@@ -499,18 +498,11 @@ ulong cpu_init_f(void)
in_be32(gur-dcsrcr);
 #endif
 
-#ifdef CONFIG_SYS_DCSRBAR_PHYS
-#ifdef CONFIG_DEEP_SLEEP
-   /* disable the console if boot from deep sleep */
-   if (in_be32(gur-scrtsr[0])  (1  3))
-   flag = GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE;
-#endif
-#endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_A007212
fsl_erratum_a007212_workaround();
 #endif
 
-   return flag;
+   return 0;
 }
 
 /* Implement a dummy function for those platforms w/o SERDES */
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index e6d5355..91645d3 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -346,13 +346,6 @@ void board_init_f(ulong bootflag)
 #ifdef CONFIG_PRAM
ulong reg;
 #endif
-#ifdef CONFIG_DEEP_SLEEP
-   const ccsr_gur_t *gur = (void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-   struct ccsr_scfg *scfg = (void *)CONFIG_SYS_MPC85xx_SCFG;
-   u32 start_addr;
-   typedef void (*func_t)(void);
-   func_t kernel_resume;
-#endif
 
/* Pointer is writable since we allocated a register for it */
gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
@@ -372,20 +365,6 @@ void board_init_f(ulong bootflag)
if ((*init_fnc_ptr) () != 0)
hang();
 
-#ifdef CONFIG_DEEP_SLEEP
-   /* Jump to kernel in deep sleep case */
-   if (in_be32(gur-scrtsr[0])  (1  3)) {
-   l2cache_init();
-#if defined(CONFIG_RAMBOOT_PBL)
-   disable_cpc_sram();
-#endif
-   enable_cpc();
-   start_addr = in_be32(scfg-sparecr[1]);
-   kernel_resume = (func_t)start_addr;
-   kernel_resume();
-   }
-#endif
-
 #ifdef CONFIG_POST
post_bootmode_init();
post_run(NULL, POST_ROM | post_bootmode_get(NULL));
-- 
2.1.0.27.g96db324

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


Re: [U-Boot] [PATCH] mpc85xx: clean up the old deep sleep framework

2014-12-17 Thread York Sun
On 12/17/2014 06:26 PM, Tang Yuantian wrote:
 All the boards that support deep sleep feature are converted
 to deep sleep generic board interface. The old interface which
 support non-generic board is not used anymore. So clean it up.
 
 Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
 ---

I know for sure we have some patches pending. It would be helpful if you list
all the dependency so I won't apply this one first. It will be a good habit for
all future patches.

York


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


Re: [U-Boot] [PATCH] mpc85xx: clean up the old deep sleep framework

2014-12-17 Thread Yuantian Tang
Hello York,

The following 3 patches, which are independent to each other, should be applied 
first before this one get applied.
You can apply these 4 patches in the order I sent them.

1. mpc85xx/t102xrdb: convert deep sleep to generic board interface
http://patchwork.ozlabs.org/patch/422189/ 
2. mpc85xx/t1040qds: convert deep sleep to generic board interface
http://patchwork.ozlabs.org/patch/422451/
3. mpc85xx/t102xqds: convert deep sleep to generic board interface
http://patchwork.ozlabs.org/patch/422447/

Thanks,
Yuantian

 -Original Message-
 From: York Sun [mailto:york...@freescale.com]
 Sent: Thursday, December 18, 2014 10:31 AM
 To: Tang Yuantian-B29983
 Cc: u-boot@lists.denx.de
 Subject: Re: [PATCH] mpc85xx: clean up the old deep sleep framework
 
 On 12/17/2014 06:26 PM, Tang Yuantian wrote:
  All the boards that support deep sleep feature are converted to deep
  sleep generic board interface. The old interface which support
  non-generic board is not used anymore. So clean it up.
 
  Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
  ---
 
 I know for sure we have some patches pending. It would be helpful if you list 
 all
 the dependency so I won't apply this one first. It will be a good habit for 
 all future
 patches.
 
 York
 

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


Re: [U-Boot] [PATCH v2 2/2] fsl/ls1021qds: Add deep sleep support

2014-12-17 Thread Yuantian Tang
Hello York,

This patch's dependent patch is merged into mainline. So there is no dependency 
for this patch anymore.

Thanks,
Yuantian

 -Original Message-
 From: Tang Yuantian [mailto:yuantian.t...@freescale.com]
 Sent: Wednesday, December 17, 2014 12:58 PM
 To: albert.u.b...@aribaud.net; Sun York-R58495
 Cc: u-boot@lists.denx.de; Tang Yuantian-B29983
 Subject: [PATCH v2 2/2] fsl/ls1021qds: Add deep sleep support
 
 Add deep sleep support on Freescale LS1021QDS platform.
 
 Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
 ---
 based on: u-boot-fsl-qoriq master.
 depends on patch: http://patchwork.ozlabs.org/patch/420999/
 which is applied to u-boot-mpc85xx master, awaiting upstream.
 v2:
   - added sd boot deep sleep support
 
  arch/arm/cpu/armv7/ls102xa/fdt.c| 19 +++
  board/freescale/ls1021aqds/ddr.c| 17 +
  board/freescale/ls1021aqds/ls1021aqds.c | 26 ++
  include/configs/ls1021aqds.h|  8 +++-
  4 files changed, 69 insertions(+), 1 deletion(-)
 
 diff --git a/arch/arm/cpu/armv7/ls102xa/fdt.c
 b/arch/arm/cpu/armv7/ls102xa/fdt.c
 index 989780d..4f226e9 100644
 --- a/arch/arm/cpu/armv7/ls102xa/fdt.c
 +++ b/arch/arm/cpu/armv7/ls102xa/fdt.c
 @@ -133,4 +133,23 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 
   do_fixup_by_compat_u32(blob, fsl, ls1021a-flexcan,
  clock-frequency, busclk / 2, 1);
 +
 +#if defined(CONFIG_DEEP_SLEEP)  defined(CONFIG_SD_BOOT)
 +#define UBOOT_HEAD_LEN   0x1000
 + /*
 +  * Reserved memory in SD boot deep sleep case.
 +  * Second stage uboot binary and malloc space should be reserved.
 +  * If the memory they occupied has not been reserved, then this
 +  * space would be used by kernel and overwritten in uboot when
 +  * deep sleep resume, which cause deep sleep failed.
 +  * Since second uboot binary has a head, that space need to be
 +  * reserved either(assuming its size is less than 0x1000).
 +  */
 + off = fdt_add_mem_rsv(blob, CONFIG_SYS_TEXT_BASE -
 UBOOT_HEAD_LEN,
 + CONFIG_SYS_MONITOR_LEN + CONFIG_SYS_SPL_MALLOC_SIZE +
 + UBOOT_HEAD_LEN);
 + if (off  0)
 + printf(Failed to reserve memory for SD boot deep sleep: %s\n,
 +fdt_strerror(off));
 +#endif
  }
 diff --git a/board/freescale/ls1021aqds/ddr.c 
 b/board/freescale/ls1021aqds/ddr.c
 index a539ff9..6435bf9 100644
 --- a/board/freescale/ls1021aqds/ddr.c
 +++ b/board/freescale/ls1021aqds/ddr.c
 @@ -7,6 +7,7 @@
  #include common.h
  #include fsl_ddr_sdram.h
  #include fsl_ddr_dimm_params.h
 +#include asm/io.h
  #include ddr.h
 
  DECLARE_GLOBAL_DATA_PTR;
 @@ -149,6 +150,17 @@ int fsl_ddr_get_dimm_params(dimm_params_t
 *pdimm,  }  #endif
 
 +#if defined(CONFIG_DEEP_SLEEP)
 +void board_mem_sleep_setup(void)
 +{
 + void __iomem *qixis_base = (void *)QIXIS_BASE;
 +
 + /* does not provide HW signals for power management */
 + clrbits_8(qixis_base + 0x21, 0x2);
 + udelay(1);
 +}
 +#endif
 +
  phys_size_t initdram(int board_type)
  {
   phys_size_t dram_size;
 @@ -159,6 +171,11 @@ phys_size_t initdram(int board_type)  #else
   dram_size =  fsl_ddr_sdram_size();
  #endif
 +
 +#if defined(CONFIG_DEEP_SLEEP)  !defined(CONFIG_SPL_BUILD)
 + fsl_dp_resume();
 +#endif
 +
   return dram_size;
  }
 
 diff --git a/board/freescale/ls1021aqds/ls1021aqds.c
 b/board/freescale/ls1021aqds/ls1021aqds.c
 index f08e54f..97da47d 100644
 --- a/board/freescale/ls1021aqds/ls1021aqds.c
 +++ b/board/freescale/ls1021aqds/ls1021aqds.c
 @@ -20,6 +20,7 @@
  #include fsl_sec.h
  #include spl.h
 
 +#include ../common/sleep.h
  #include ../common/qixis.h
  #include ls1021aqds_qixis.h
  #ifdef CONFIG_U_QE
 @@ -195,6 +196,11 @@ int board_early_init_f(void)
* allow barrier transaction to DDR again */
   out_le32(cci-ctrl_ord, CCI400_CTRLORD_TERM_BARRIER);
 
 +#if defined(CONFIG_DEEP_SLEEP)
 + if (is_warm_boot())
 + fsl_dp_disable_console();
 +#endif
 +
   return 0;
  }
 
 @@ -231,6 +237,11 @@ void board_init_f(ulong dummy)
 
   get_clocks();
 
 +#if defined(CONFIG_DEEP_SLEEP)
 + if (is_warm_boot())
 + fsl_dp_disable_console();
 +#endif
 +
   preloader_console_init();
 
  #ifdef CONFIG_SPL_I2C_SUPPORT
 @@ -503,6 +514,21 @@ int board_init(void)
   return 0;
  }
 
 +#if defined(CONFIG_DEEP_SLEEP)
 +void board_sleep_prepare(void)
 +{
 + struct ccsr_cci400 __iomem *cci = (void *)CONFIG_SYS_CCI400_ADDR;
 +
 + /* Set CCI-400 control override register to
 +  * enable barrier transaction */
 + out_le32(cci-ctrl_ord, CCI400_CTRLORD_EN_BARRIER);
 +
 +#ifdef CONFIG_LS102XA_NS_ACCESS
 + enable_devices_ns_access(ns_dev, ARRAY_SIZE(ns_dev)); #endif } #endif
 +
  int ft_board_setup(void *blob, bd_t *bd)  {
   ft_cpu_setup(blob, bd);
 diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h index
 

Re: [U-Boot] [PATCH] mpc85xx: clean up the old deep sleep framework

2014-12-17 Thread York Sun
On 12/17/2014 06:43 PM, Tang Yuantian-B29983 wrote:
 Hello York,
 
 The following 3 patches, which are independent to each other, should be 
 applied first before this one get applied.
 You can apply these 4 patches in the order I sent them.
 
 1. mpc85xx/t102xrdb: convert deep sleep to generic board interface
 http://patchwork.ozlabs.org/patch/422189/ 
 2. mpc85xx/t1040qds: convert deep sleep to generic board interface
 http://patchwork.ozlabs.org/patch/422451/
 3. mpc85xx/t102xqds: convert deep sleep to generic board interface
 http://patchwork.ozlabs.org/patch/422447/
 

Thanks. This is what I need.

York

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


Re: [U-Boot] [PATCH] fs: fat: read: fix fat16 ls/read issue

2014-12-17 Thread Simon Glass
Hi Przemyslaw,

On 17 December 2014 at 02:03, Przemyslaw Marczak p.marc...@samsung.com wrote:
 Hello,


 On 12/16/2014 11:26 PM, Simon Glass wrote:

 Hi Przemyslaw,

 On 12 December 2014 at 08:30, Przemyslaw Marczak p.marc...@samsung.com
 wrote:

 Hello,


 On 12/12/2014 01:32 AM, Simon Glass wrote:


 Hi Przemyslaw,

 On 11 December 2014 at 05:01, Przemyslaw Marczak p.marc...@samsung.com
 wrote:



 The present fat implementation ignores FAT16 long name
 directory entries which aren't placed in a single sector.

 This was becouse of the buffer was always filled by the
 two sectors, and the loop was made also for two sectors.

 If some file long name entries are stored in two sectors,
 the we have two cases:

 Case 1:
 Both of sectors are in the buffer - all required data
 for long file name is in the buffer.
 - Read OK!

 Case 2:
 The current directory entry is placed at the end of the
 second buffered sector. And the next entries are placed
 in a sector which is not buffered yet. Then two next
 sectors are buffered and the mentioned entry is ignored.
 - Read fail!

 This commit fixes this issue by:
 - read two sectors after loop on each single is done
 - keep the last used sector as a first in the buffer
 before the read of two next

 The commit doesn't affects the fat32 imlementation,
 which works good as previous.




 This is very interesting\! Is this the same failure that I saw on this
 thread?



 http://u-boot.10912.n7.nabble.com/PATCH-U-Boot-ARM-rpi-b-detect-board-revision-td196720.html

 (search for fatload)

 I tried this out. It worked OK for me except that it can't find the
 device tree file bcm2835-rpi-b-rev2.dtb.

 Oddly I can fatload it from /bcm2835-rpi-b-rev2.dtb but when I try
 from /syslinux/..//bcm2835-rpi-b-rev2.dtb it fails and cannot find the
 file. Reducing the filename length to 8 chars works. I wonder what
 year of my life FAT will stop plaguing me? 


 Also can you write a test for this in test/fs/fs-test.sh?

 Regards,
 Simon

 [snip]


 Probably this is an another case which is caused by the sector buffer
 bug.
 Does this patch fixed your issue?

 I have some simple test for manual use with the ums tool.
 It just copy the test files to the tested fat16 partition mounted using
 the
 UMS, next it computes CRC32 of those files on the host and next using
 U-Boot
 fatload/crc32 commands - it tests the read feature. But it's not full
 automated - I didn't work on getting the log from U-Boot console.

 So I could check if the file checksums are proper and if all files were
 found on the partiion, by the U-Boot read command. It's not useful for
 the
 test/fs/fs-test.sh because this is not designed for the sandbox.
 My test writes some commands directly to U-Boot console, like this: echo
 some cmd  /dev/ttyS0.

 Unfortunately the sandbox config seems to be broken.

 The bug was not so obvious, any read/write on fat partition can change
 fat
 directory entries or add the new ones and then all data can be read
 right.

 I will send the scripts for such simple test.


 I'm not sure if it fixes my problem but it seems likely. I will see if
 I can make time to test it.

 If you want to write input data to U-Boot sandbox we can do that
 fairly easily. You can import cros_subprocess and use the function
 there to generate output from your test and inspect the input from
 U-Boot's command line. Let me know if you'd like an example.

 Regards,
 Simon


 Before, I wrote, that sandbox seems to be broken, sorry for this - it was
 just my dirty repo - sandbox compiles and works well.

Somewhat bewildering, but it does not in fact fix my problem.

Here is a compressed version of the fat filesystem if you want to take a look:

https://drive.google.com/file/d/0B7WYZbZ9zd-3NGRMNkFQQTdtV2M/view?usp=sharing

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


Re: [U-Boot] [PATCH] cros-ec-keyboard: Synchronize DT binding from linux

2014-12-17 Thread Simon Glass
Hi,

On 16 December 2014 at 01:03, Sjoerd Simons
sjoerd.sim...@collabora.co.uk wrote:
 On Mon, 2014-12-15 at 23:34 +0100, Pavel Machek wrote:
 On Thu 2014-11-27 16:34:08, Sjoerd Simons wrote:
  The ChromeOS EC keyboard is used by various different chromebooks. Peach
  pi being the third board in the u-boot tree to use it (snow and peach
  pit the other two). Rather then embedding the same big DT node in the
  peach-pi DT again, copy the dtsi snippit  bindings documentation from
  linux and include it in all 3 boards.
 
  This slightly changes the dt bindings in u-boot:
 ...
* google,repeat-delay-ms and google,repeat-rate-ms are no longer used
  and replaced by hardcoded values (similar to tegra kbc)

 If more than one board needs this (and it clearly does) it would be
 good to make the binding official...? I guess that means talking to
 linux Documentation/devicetree maintainers...

 Device tree is for describing hardware, while repeat rate  delay are
 user preferences, not something inherent to the hardware. As such, those
 properties do not belong in device-tree in the first place.

 Fwiw, Linux by default uses a delay of 250ms and a period of 33ms unless
 the driver handles auto-repeat (e.g. for PS2 which does repeat in
 hardware). If your goal is to fix the hardcoding of these values in
 various drivers, it's probably better to make u-boot input core have
 sane defaults for repeat rather then pushing it out into device-tree.

This patch could be adjusted to drop the common keyboard file, which
is now in mainline. But on the other hand, it will probably apply
cleaning for Minkyu.

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


Re: [U-Boot] [PATCH V4 2/3] usb: eth: add ASIX AX88179 DRIVER

2014-12-17 Thread Joe Hershberger
Hi Marek,

On Wed, Dec 17, 2014 at 10:00 AM, Marek Vasut ma...@denx.de wrote:

 On Wednesday, December 17, 2014 at 01:33:57 PM, René Griessl wrote:
   Is there a reason you can't implement write_hwaddr() so that it will
   behave like other NICs (u-boot is the highest priority source of the
   MAC address).
 
  The AX88179 uses an external flash to store the MAC address. So for my
  application I do not want the user to be able to change it, since it is
  a unique ID inside the server cluster.
  I could add it as compiler option. Maybe it is even better to implement
  my behavior as option, since it differs from standard.
  I think it will be finished mid of january, so if it is OK for you in a
  separate patch.

 Joe, can you just pick the patch as is and wait for subsequent patch to
improve
 the driver? My understanding is that the driver is operating correctly and
 pulling the MAC from an integrated EEPROM, which is fine. If you want to
allow
 overriding this MAC using the $ethaddr, this is only an improvement and
can be
 added later. This would improve our hardware support and avoid blocking
the
 driver further.

 What do you think please ?

I agree... You may have noticed I already Acked it and agreed that the
improvement may come later.

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


Re: [U-Boot] [PATCH] da850evm: Use generic board and libfdt, fix size for SPI flash

2014-12-17 Thread Jagan Teki
On 17 December 2014 at 06:44, Peter Howard p...@northern-ridge.com.au wrote:
 Add defines to use CONFIG_SYS_GENERIC_BOARD and CONFIG_OF_LIBFDT.
 Semi-separate to this: the size of the image for the da850evm has
 increased to the point that the size in da850evm.h and the offset for
 the environment in SPI flash no longer work.  They are modified to
 account for the larger image size.

 Signed-off-by: Peter Howard phow...@gme.net.au
 ---
  include/configs/da850evm.h | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

 diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
 index e5f8afe..e5a612c 100644
 --- a/include/configs/da850evm.h
 +++ b/include/configs/da850evm.h
 @@ -157,7 +157,7 @@
  #define CONFIG_SPL_SPI_FLASH_SUPPORT
  #define CONFIG_SPL_SPI_LOAD
  #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000
 -#define CONFIG_SYS_SPI_U_BOOT_SIZE 0x3
 +#define CONFIG_SYS_SPI_U_BOOT_SIZE 0x4
  #endif

  /*
 @@ -251,7 +251,7 @@
  #undef CONFIG_ENV_IS_IN_NAND
  #define CONFIG_ENV_IS_IN_SPI_FLASH
  #define CONFIG_ENV_SIZE(64  10)
 -#define CONFIG_ENV_OFFSET  (256  10)
 +#define CONFIG_ENV_OFFSET  (512  10)

Please make sure the proper testing of this new flash env size.

Reviewed-by: Jagannadha Sutradharudu Teki jagannadh.t...@gmail.com

  #define CONFIG_ENV_SECT_SIZE   (64  10)
  #define CONFIG_SYS_NO_FLASH
  #endif
 @@ -259,6 +259,7 @@
  /*
   * U-Boot general configuration
   */
 +#define CONFIG_SYS_GENERIC_BOARD
  #define CONFIG_MISC_INIT_R
  #define CONFIG_BOARD_EARLY_INIT_F
  #define CONFIG_BOOTFILEuImage /* Boot file name */
 @@ -275,6 +276,7 @@
  #define CONFIG_SYS_LONGHELP
  #define CONFIG_CRC32_VERIFY
  #define CONFIG_MX_CYCLIC
 +#define CONFIG_OF_LIBFDT

  /*
   * Linux Information
 --
 1.9.3


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


Re: [U-Boot] [PATCH v3 23/27] x86: crownbay: Add SPI flash support

2014-12-17 Thread Jagan Teki
On 12 December 2014 at 18:35, Bin Meng bmeng...@gmail.com wrote:
 The Crown Bay board has an SST25VF016B flash connected to the Tunnel
 Creek processor SPI controller used as the BIOS media where U-Boot
 is stored. Enable this flash support.

Is this necessary to enable flash at BIOS media?

How about other flash media's, is this specific to x86 cpu to store
u-boot always in
spi flash.


 Signed-off-by: Bin Meng bmeng...@gmail.com
 Acked-by: Simon Glass s...@chromium.org

 ---

 Changes in v3:
 - Add a commit message for the SPI support

 Changes in v2:
 - Move PCH_LPC_DEV to arch/x86/include/asm/arch-queensbay/tnc.h
 - Check return value of x86_cpu_init_f()

  arch/x86/cpu/queensbay/tnc.c  | 26 +-
  arch/x86/include/asm/arch-queensbay/tnc.h | 15 +++
  include/configs/crownbay.h|  2 ++
  3 files changed, 42 insertions(+), 1 deletion(-)
  create mode 100644 arch/x86/include/asm/arch-queensbay/tnc.h

 diff --git a/arch/x86/cpu/queensbay/tnc.c b/arch/x86/cpu/queensbay/tnc.c
 index 8b9815f..8637cdc 100644
 --- a/arch/x86/cpu/queensbay/tnc.c
 +++ b/arch/x86/cpu/queensbay/tnc.c
 @@ -6,18 +6,42 @@

  #include common.h
  #include asm/io.h
 +#include asm/pci.h
  #include asm/post.h
 +#include asm/arch/tnc.h
  #include asm/arch/fsp/fsp_support.h
  #include asm/processor.h

 +static void unprotect_spi_flash(void)
 +{
 +   u32 bc;
 +
 +   bc = pci_read_config32(PCH_LPC_DEV, 0xd8);
 +   bc |= 0x1;  /* unprotect the flash */
 +   pci_write_config32(PCH_LPC_DEV, 0xd8, bc);
 +}
 +
  int arch_cpu_init(void)
  {
 +   struct pci_controller *hose;
 +   int ret;
 +
 post_code(POST_CPU_INIT);
  #ifdef CONFIG_SYS_X86_TSC_TIMER
 timer_set_base(rdtsc());
  #endif

 -   return x86_cpu_init_f();
 +   ret = x86_cpu_init_f();
 +   if (ret)
 +   return ret;
 +
 +   ret = pci_early_init_hose(hose);
 +   if (ret)
 +   return ret;
 +
 +   unprotect_spi_flash();
 +
 +   return 0;
  }

  int print_cpuinfo(void)
 diff --git a/arch/x86/include/asm/arch-queensbay/tnc.h 
 b/arch/x86/include/asm/arch-queensbay/tnc.h
 new file mode 100644
 index 000..67c5e05
 --- /dev/null
 +++ b/arch/x86/include/asm/arch-queensbay/tnc.h
 @@ -0,0 +1,15 @@
 +/*
 + * Copyright (C) 2014, Bin Meng bmeng...@gmail.com
 + *
 + * SPDX-License-Identifier:GPL-2.0+
 + */
 +
 +#ifndef _X86_ARCH_TNC_H_
 +#define _X86_ARCH_TNC_H_
 +
 +#include pci.h
 +
 +/* PCI Configuration Space (D31:F0): LPC */
 +#define PCH_LPC_DEVPCI_BDF(0, 0x1f, 0)
 +
 +#endif /* _X86_ARCH_TNC_H_ */
 diff --git a/include/configs/crownbay.h b/include/configs/crownbay.h
 index 2314e62..a051b11 100644
 --- a/include/configs/crownbay.h
 +++ b/include/configs/crownbay.h
 @@ -45,6 +45,8 @@
  #define CONFIG_SCSI_DEV_LIST\
 {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TCF_SATA}

 +#define CONFIG_SPI_FLASH_SST
 +
  /* Video is not supported */
  #undef CONFIG_VIDEO
  #undef CONFIG_CFB_CONSOLE
 --
 1.8.2.1

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


Re: [U-Boot] [PATCH] spl: spl_nor: surround Linux-load code with #ifdef CONFIG_SPL_OS_BOOT

2014-12-17 Thread Masahiro Yamada
Hi Tom,

On Wed, 10 Dec 2014 20:34:03 -0500
Tom Rini tr...@ti.com wrote:

 On Thu, Dec 11, 2014 at 10:01:38AM +0900, Masahiro Yamada wrote:
 
  If CONFIG_SPL_NOR_SUPPORT is defined, spl_nor_load_image() requires
  spl_start_uboot(), CONFIG_SYS_OS_BASE, CONFIG_SYS_SPL_ARGS_ADDR,
  CONFIG_SYS_FDT_BASE to be defined even if users just want to run
  U-Boot, not Linux.  This is inconvenient.
  
  Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 
 Good idea, but the function to check on U-Boot or Linux should be called
 spl_start_uboot to match the other load methods :)
 

I think I am following this way.



 +#if defined(CONFIG_SPL_OS_BOOT)
 +int load_linux(void)
 +{
 + if (spl_start_uboot())
 + return -1;


Here.
Any problem?



Best Regards
Masahiro Yamada


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


Re: [U-Boot] [PATCH v3 23/27] x86: crownbay: Add SPI flash support

2014-12-17 Thread Bin Meng
Hi Jagan,

On Thu, Dec 18, 2014 at 3:06 PM, Jagan Teki jagannadh.t...@gmail.com wrote:
 On 12 December 2014 at 18:35, Bin Meng bmeng...@gmail.com wrote:
 The Crown Bay board has an SST25VF016B flash connected to the Tunnel
 Creek processor SPI controller used as the BIOS media where U-Boot
 is stored. Enable this flash support.

 Is this necessary to enable flash at BIOS media?

Yes, so that we can use 'sf probe/erase/read/write' command from U-Boot shell.

 How about other flash media's, is this specific to x86 cpu to store
 u-boot always in
 spi flash.

Do you mean NOR/NAND? Modern x86 boards always have the SPI flash as
its BIOS media. Normally there is no NOR/NAND flash on x86 boards.

[snip]

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


Re: [U-Boot] [PATCH v3 23/27] x86: crownbay: Add SPI flash support

2014-12-17 Thread Jagan Teki
On 18 December 2014 at 12:48, Bin Meng bmeng...@gmail.com wrote:
 Hi Jagan,

 On Thu, Dec 18, 2014 at 3:06 PM, Jagan Teki jagannadh.t...@gmail.com wrote:
 On 12 December 2014 at 18:35, Bin Meng bmeng...@gmail.com wrote:
 The Crown Bay board has an SST25VF016B flash connected to the Tunnel
 Creek processor SPI controller used as the BIOS media where U-Boot
 is stored. Enable this flash support.

 Is this necessary to enable flash at BIOS media?

 Yes, so that we can use 'sf probe/erase/read/write' command from U-Boot shell.

 How about other flash media's, is this specific to x86 cpu to store
 u-boot always in
 spi flash.

 Do you mean NOR/NAND? Modern x86 boards always have the SPI flash as
 its BIOS media. Normally there is no NOR/NAND flash on x86 boards.

Ok.

Reviewed-by: Jagannadha Sutradharudu Teki jagannadh.t...@gmail.com

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


Re: [U-Boot] [PATCH v3 0/6] ARM: kirkwood: mvebu_mmc: Speed up access time

2014-12-17 Thread drEagle
Hi,

Any chance to be included in the next release of u-boot ?

Regards,
Gérald

Le 15/12/2014 12:14, Mario Schuknecht a écrit :
 
 2014-12-13 21:35 GMT+01:00 Gérald Kerma drea...@doukki.net 
 mailto:drea...@doukki.net:
 
 
 This serie of patches speed up access time of MVEBUMMC driver
 
 This is allowed by a fix in MVEBUMMC init status check inspired from 
 linux MVSDIO driver.
  * Hardware weirdness.  The FIFO_EMPTY bit of the HW_STATE
  * register is sometimes not set before a while when some
  * unusual data block sizes are used (such as with the SWITCH
  * command), even despite the fact that the XFER_DONE interrupt
  * was raised.  And if another data transfer starts before
  * this bit comes to good sense (which eventually happens by
  * itself) then the new transfer simply fails with a timeout.
 
 It allows about 10x to 40x faster access time transfer on SHEEVAPLUG MMC
 It may also fixes some SD types incompatibilities
 
 ### before patch
 
 Marvell ext2load mmc 0:1 0x80 uImage
 1613392 bytes read in 977 ms (1.6 MiB/s)
 
 ### with fix
 
 Marvell ext2load mmc 0:1 0x80 uImage
 1613392 bytes read in 83 ms (18.5 MiB/s)
 
 
 
 Looks good to me.
 ACK to this series of patches:
  
 
 Gérald Kerma (6):
   MVEBUMMC : Change copyright date
   MVEBUMMC : Speed up access time
   MVEBUMMC : FIX debug strings
   MVEBUMMC : REMOVE unnecessary delays
   MVEBUMMC : CLEAN code
   MVEBUMMC : REMOVE unnecessary delay from init
 
 
  drivers/mmc/mvebu_mmc.c | 103 
 
  include/mvebu_mmc.h |   1 +
  2 files changed, 61 insertions(+), 43 deletions(-)
 
 --
 2.1.3
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de mailto:U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 3/6] SHEEVAPLUG : ADD generic board define

2014-12-17 Thread Gérald Kerma
Signed-off-by: Gérald Kerma drea...@doukki.net
---
 include/configs/sheevaplug.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 393fdd4..589655a 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -10,6 +10,8 @@
 #ifndef _CONFIG_SHEEVAPLUG_H
 #define _CONFIG_SHEEVAPLUG_H
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*
  * Version number information
  */
-- 
2.1.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 4/6] SHEEVAPLUG : ADD CONFIG_CMD_FAT

2014-12-17 Thread Gérald Kerma
Signed-off-by: Gérald Kerma drea...@doukki.net
---
 include/configs/sheevaplug.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 589655a..77e8d17 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -51,6 +51,7 @@
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_USB
+#define CONFIG_CMD_FAT
 
 /*
  * mv-common.h should be defined after CMD configs since it used them
-- 
2.1.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 6/6] SHEEVAPLUG : REDEFINE MTDPARTS

2014-12-17 Thread Gérald Kerma
Prepare ENV settings for sheevaplugs to be OpenWRT ready.

+--+
| UBOOT|  896 Kb (7x128)  = uboot
+--+
| ENV  |  128 Kb  = uboot_env
+--+
| ROOT(FS) |  511 Mb @ 1 Mb   = root - rootfs (ubifs)
+--+

With (CC) TRUNK OpenWRT build (QUICK HOWTO) :

INTERRUPT
Marvell nand erase.part root
Marvell ubi part root
Marvell ubi remove rootfs
Marvell ubi create rootfs
Marvell usb reset
Marvell fatload usb 0:1 0x80 
sheevaplug/openwrt/openwrt-kirkwood-sheevaplug-rootfs.ubifs
Marvell ubi write 0x80 rootfs ${filesize}
Marvell reset

Changes in v3
- Supress image partition (unused)

Change in v2
- Define new NAND partition mapping

Signed-off-by: Gérald Kerma drea...@doukki.net
---
 include/configs/sheevaplug.h | 39 +++
 1 file changed, 23 insertions(+), 16 deletions(-)

diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 0f523c5..a1ce821 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -78,26 +78,33 @@
  * it has to be rounded to sector size
  */
 #define CONFIG_ENV_SIZE0x2 /* 128k */
-#define CONFIG_ENV_ADDR0x8
-#define CONFIG_ENV_OFFSET  0x8 /* env starts here */
+#define CONFIG_ENV_OFFSET  0xE /* env starts here */
 
 /*
  * Default environment variables
  */
-#define CONFIG_BOOTCOMMAND ${x_bootcmd_kernel};  \
-   setenv bootargs ${x_bootargs} ${x_bootargs_root}; \
-   ${x_bootcmd_usb}; bootm 0x640;
-
-#define CONFIG_MTDPARTS\
-   mtdparts=orion_nand:512K(uboot),  \
-   512K(env),1M(script),6M(kernel),  \
-   12M(ramdisk),4M(spare),-(rootfs)
-
-#define CONFIG_EXTRA_ENV_SETTINGS  x_bootargs=console\
-   =ttyS0,115200 mtdparts=CONFIG_MTDPARTS\
-   x_bootcmd_kernel=nand read 0x640 0x10 0x30\0 \
-   x_bootcmd_usb=usb start\0 \
-   x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0
+#define CONFIG_BOOTCOMMAND \
+   setenv bootargs ${console} ${mtdparts} ${bootargs_root};  \
+   ubi part root;\
+   ubifsmount ubi:rootfs;\
+   ubifsload 0x80 ${kernel}; \
+   ubifsload 0x70 ${fdt};\
+   ubifsumount;  \
+   fdt addr 0x70; fdt resize; fdt chosen;\
+   bootz 0x80 - 0x70
+
+#define CONFIG_MTDPARTS\
+   mtdparts=orion_nand:  \
+   896K(uboot),128K(uboot_env),  \
+   -@1M(root)\0
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+   console=console=ttyS0,115200\0\
+   mtdids=nand0=orion_nand\0 \
+   mtdparts=CONFIG_MTDPARTS  \
+   kernel=/boot/zImage\0 \
+   fdt=/boot/sheevaplug.dtb\0\
+   bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw\0
 
 #define MTDIDS_DEFAULT nand0=orion_nand
 
-- 
2.1.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 5/6] SHEEVAPLUG : ADD FDT support

2014-12-17 Thread Gérald Kerma
LIBFDT feature is required to support new kernel

Signed-off-by: Gérald Kerma drea...@doukki.net
---
 include/configs/sheevaplug.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 77e8d17..0f523c5 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -33,6 +33,11 @@
 #define CONFIG_LZO
 
 /*
+ * Enable device tree support
+ */
+#define CONFIG_OF_LIBFDT
+
+/*
  * Miscellaneous configurable options
  */
 #define CONFIG_SYS_HUSH_PARSER /* use hush command parser */
-- 
2.1.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 0/6] SHEEVAPLUG : REFRESH 201412

2014-12-17 Thread Gérald Kerma
Prepare ENV settings for sheevaplugs to be OpenWRT ready.

+--+
| UBOOT|  896 Kb (7x128)  = uboot
+--+
| ENV  |  128 Kb  = uboot_env
+--+
| ROOT(FS) |  511 Mb @ 1 Mb   = root - rootfs (ubifs)
+--+

With (CC) TRUNK OpenWRT build (QUICK HOWTO) :

INTERRUPT
Marvell nand erase.part root
Marvell ubi part root
Marvell ubi remove rootfs
Marvell ubi create rootfs
Marvell usb reset
Marvell fatload usb 0:1 0x80 
sheevaplug/openwrt/openwrt-kirkwood-sheevaplug-rootfs.ubifs
Marvell ubi write 0x80 rootfs ${filesize}
Marvell reset

Gérald Kerma (6):
  SHEEVAPLUG : FIX typo
  SHEEVAPLUG : FIX multiple defines
  SHEEVAPLUG : ADD generic board define
  SHEEVAPLUG : ADD CONFIG_CMD_FAT
  SHEEVAPLUG : ADD FDT support
  SHEEVAPLUG : REDEFINE MTDPARTS

 include/configs/sheevaplug.h | 49 +---
 1 file changed, 32 insertions(+), 17 deletions(-)

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


[U-Boot] [PATCH v3 2/6] SHEEVAPLUG : FIX multiple defines

2014-12-17 Thread Gérald Kerma
Signed-off-by: Gérald Kerma drea...@doukki.net
---
 include/configs/sheevaplug.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 829c57a..393fdd4 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -140,6 +140,5 @@
 #define CONFIG_MTD_DEVICE   /* needed for mtdparts commands */
 #define CONFIG_MTD_PARTITIONS
 #define CONFIG_CMD_MTDPARTS
-#define CONFIG_LZO
 
 #endif /* _CONFIG_SHEEVAPLUG_H */
-- 
2.1.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 1/6] SHEEVAPLUG : FIX typo

2014-12-17 Thread Gérald Kerma
Signed-off-by: Gérald Kerma drea...@doukki.net
---
 include/configs/sheevaplug.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
index 71be823..829c57a 100644
--- a/include/configs/sheevaplug.h
+++ b/include/configs/sheevaplug.h
@@ -49,6 +49,7 @@
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_USB
+
 /*
  * mv-common.h should be defined after CMD configs since it used them
  * to enable certain macros
-- 
2.1.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 0/6] SHEEVAPLUG : REFRESH 201412

2014-12-17 Thread drEagle
Le 17/12/2014 15:24, Prafulla Wadaskar a écrit :
 
 
 -Original Message-
 From: Gérald Kerma [mailto:drea...@doukki.net]
 Sent: 17 December 2014 19:33
 To: u-boot@lists.denx.de; Prafulla Wadaskar
 Cc: albert.u.b...@aribaud.net; l...@openwrt.org; Gérald
 Kerma
 Subject: [PATCH v3 0/6] SHEEVAPLUG : REFRESH 201412

 Is this final one to be pulled, or you are planning more changes? :-)

Hi Prafulla, I think this one is good.

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