Re: [U-Boot] [PATCH v2 0/15] arm: kconfig: move board select menus and other settings to SoC dir

2014-08-09 Thread Masahiro YAMADA
Hi Tom,


2014-08-06 12:17 GMT+09:00 Masahiro Yamada yamad...@jp.panasonic.com:
 There are lots of boards supported in ARM architecture.
 The board select menu in arch/arm/Kconfig is already too fat.

 This series introduces platform select between arch select and
 board select.

   ARCH select (ARM)
|-- Platform select
|-- Board select

 Many (not all) of boards have been moved to $(SOC)/Kconfig.

 I built all the boards and confirmed the same binaries are
 produced with/without thie series.

 I am including a patch to remove omap5912osk board in this series
 to avoid conflicts.

  Prerequisites
  -
 [1]
 http://patchwork.ozlabs.org/patch/374758/
 to avoid a conflict in drivers/usb/gadget/Makefile

 [2]
 http://patchwork.ozlabs.org/patch/374416/
 to avoid a conflict in doc/README.scrapyard

 [3]
 http://patchwork.ozlabs.org/patch/375467/
 to avoid a conflict in configs/jetson-tk1_defconfig



New boards are coming all the time, for example
http://patchwork.ozlabs.org/patch/376782/

The problem is this series causes big conflicts with such patches.

Because this series was reviewed, acked or tested by some ARM-SoC maintainers,
I think this should go directly into u-boot/master asap along with
some prerequisites.

What do you think? Should we wait for Albert's review?



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 v4 4/5] usb/gadget: fastboot: add sparse image definitions

2014-08-09 Thread Marek Vasut
On Friday, August 08, 2014 at 12:17:38 AM, Wolfgang Denk wrote:
 Dear Marek,
 
 In message 201408072343.58591.ma...@denx.de you wrote:
  OK, so we need a GPLv2-compatible header file. That's the conclusion.
 
 Well, GPLv2 compatible might be acceptable, but GPLv2+ compatible
 woould be best.

I was talking to Hans about this yesterday (and who was dropped from the CC for 
some reason) and it turns out the easy way out here is to just reimplement the 
header. I would like him to take a look and express his opinion properly though.

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] pci: mx6: fix occasional link failures

2014-08-09 Thread Marek Vasut
On Friday, August 08, 2014 at 05:35:23 PM, Fabio Estevam wrote:
 On Fri, Aug 8, 2014 at 10:33 AM, Marek Vasut ma...@denx.de wrote:
  Can you guys test it on FSL hardware ?
 
 Sure, I am running u-boot-imx with Tim's patch applied and this
 additional debug patch that shows the number of reboots and PCI
 linkups:

Well you do realize that this addition changes the timing of the code and also 
generates writes on the AXI bus, right? I would be much fonder of your testing 
if you did it with a pristine code and monitored the number of successful cases 
with plain logging of the serial console and a grep. This should be easy and 
would avoid the problems with modified code.

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


Re: [U-Boot] Python subprocess module missing in multiconfig.py

2014-08-09 Thread Marek Vasut
On Saturday, August 09, 2014 at 12:16:01 AM, Jeroen Hofstee wrote:
 Hello Marek,
 
 On 07-08-14 23:52, Marek Vasut wrote:
  small
  Thanks for CCing me.
  
  I sent a patch to OE-core to ship the python modules. This is a problem
  with the Yocto Qt SDK toolchain in general and you can track the mayhem
  at [1]. There will likely be ELDK 5.5.3 once this is all settled.
  
  btw. you should update to ELDK 5.5.2 in the first place, since the
  compiler in Yocto 1.5.0 did have trouble with code generation [2], [3].
  
  [1] http://lists.openembedded.org/pipermail/openembedded-core/2014-
  August/095470.html
  [2] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854
  [3]http://lists.openembedded.org/pipermail/openembedded-core/2014-
  February/089489.html
  
  A bit of topic, beside the toolchain problems, aren't these
  dependencies of the u-boot recipe? The native sdk will pick
  them up if any machine needs them (at least in my setup).
  
  Why would it do it please?
 
 For the RDEPENDS at least adding it to the recipe itself instead of some
 common image file makes sure it gets deleted if nobody is using it any
 longer. And hopefully makes sure you can't compile/use something on the
 host which isn't on the target, since the header files will be missing.

It does make sense, but the toolchain is then stripped down in such fashion 
that 
it's rather useless. Still, would you mind commenting on the patch sent to the 
OE list and expressing this concern?

 RDEPENDS do get included in the sdk in my setup. For DEPENDS it would
 mean the sdk can build the same targets with the same tools, but I never
 checked if it does that.

Yes, this does make sense. But then, this also means the toolchain becomes 
useless for general use.

  What exactly is your setup, please describe it in detail.
 
 Doesn't really matter, you need to convince the oe people. Not me,
 I am just a user of oe user, if the thing does what I want I am happy
 enough.

Urgh, this was not really helpful answer.

  Besides of that, do we really want so much dependencies
  for u-boot what used to be sed, awk.. and uh find perhaps?
  Is all of this needed to just compile u-boot?
  
  This is a question for Yamada-san, +CC . But from my point of view, I see
  we had dependency on python with some tools for a while -- it's only now
  that the dependency got pulled into the build system. On the other hand,
  I don't know what are the plans with the Kconfig and it might end up
  that this dependency will eventually disappear.
 
 yup, understood, I will leave it up to them.

Uh, OK.

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


Re: [U-Boot] Please pull u-boot-sunxi.git/master

2014-08-09 Thread Albert ARIBAUD
Hi Masahiro,

On my way to applying this.

On Fri, 01 Aug 2014 10:54:28 +0900, Masahiro Yamada
yamad...@jp.panasonic.com wrote:

 Hi Hans,
 
 
 On Thu, 31 Jul 2014 16:30:22 +0200
 Hans de Goede hdego...@redhat.com wrote:
 
  Hi Albert
  
  Note:
  
  1) This superseeds my previous pull-req as that conflicted with the Kconfig 
  changes
  which have landed in u-boot/master, this pull-req replaces all the 
  boards.cfg changes
  from the previous series with defconfig changes / additions;
 
 The conversion to Kconfig looks good.
 Thanks!
 
 
 
 Best Regards
 Masahiro Yamada

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


[U-Boot] mx6: spl: Rename ncs as ranks and move it to mx6_ddr3_cfg

2014-08-09 Thread Nikolay Dimitrov

Hi guys,

I'm working on adding SO-DIMM SPL support on a custom imx6 board, so I'm 
thinking on the idea of which DDR3 settings belong to the controller and 
which belong to the DDR3 memory module/chips.


My proposal is to rename the struct member ncs to ranks (as per 
JEDEC) and to move it as part of the DDR3 module description (be it an 
external so-dimm module or on-board DDR ICs), and not part of the MMDC 
description. This way the ranks value can be loaded from the SO-DIMM 
SPD or hard-coded as in Tim's case for the Ventana board.


The code for my board is out of the official tree, so I'm showing my 
idea on Tim's Ventana SPL code:



diff --git a/arch/arm/cpu/armv7/mx6/ddr.c b/arch/arm/cpu/armv7/mx6/ddr.c
index 0434211..0d3580b 100644
--- a/arch/arm/cpu/armv7/mx6/ddr.c
+++ b/arch/arm/cpu/armv7/mx6/ddr.c
@@ -340,7 +340,7 @@ void mx6_dram_cfg(const struct mx6_ddr_sysinfo *i,
debug(trrd=%d\n, trrd);
debug(txpr=%d\n, txpr);
debug(CS0_END=%d\n, CS0_END);
-   debug(ncs=%d\n, i-ncs);
+   debug(ranks=%d\n, m-ranks);
debug(Rtt_wr=%d\n, i-rtt_wr);
debug(Rtt_nom=%d\n, i-rtt_nom);
debug(SRT=%d\n, m-SRT);
@@ -437,11 +437,11 @@ void mx6_dram_cfg(const struct mx6_ddr_sysinfo *i,
/* Step 7: Enable MMDC with desired chip select */
reg = mmdc0-mdctl |
  (1  31) | /* SDE_0 for CS0 */
- ((i-ncs == 2) ? 1 : 0)  30;   /* SDE_1 for CS1 */
+ ((m-ranks == 2) ? 1 : 0)  30; /* SDE_1 for CS1 */
mmdc0-mdctl = reg;

/* Step 8: Write Mode Registers to Init DDR3 devices */
-   for (cs = 0; cs  i-ncs; cs++) {
+   for (cs = 0; cs  m-ranks; cs++) {
/* MR2 */
reg = (i-rtt_wr  3)  9 | (m-SRT  1)  7 |
  ((tcwl - 3)  3)  3;
diff --git a/arch/arm/include/asm/arch-mx6/mx6-ddr.h 
b/arch/arm/include/asm/arch-mx6/mx6-ddr.h

index 5ebabfa..2b9649c 100644
--- a/arch/arm/include/asm/arch-mx6/mx6-ddr.h
+++ b/arch/arm/include/asm/arch-mx6/mx6-ddr.h
@@ -191,13 +191,13 @@ struct mx6_ddr3_cfg {
u16 trcmin; /* tRC min (ns*100) */
u16 trasmin;/* tRAS min (ns*100) */
u8 SRT; /* self-refresh temperature: 0=normal, 1=extended */
+   u8 ranks;   /* ranks (chip-selects) of the DDR3 memory (1,2) */
 };

 /* System Information: Varies per board design, layout, and term 
choices */

 struct mx6_ddr_sysinfo {
u8 dsize;   /* size of bus (in dwords: 0=16bit,1=32bit,2=64bit) */
u8 cs_density;  /* density per chip select (Gb) */
-   u8 ncs; /* number chip selects used (1|2) */
char cs1_mirror;/* enable address mirror (0|1) */
char bi_on; /* Bank interleaving enable */
u8 rtt_nom; /* Rtt_Nom (DDR3_RTT_*) */
diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c 
b/board/gateworks/gw_ventana/gw_ventana_spl.c

index e943879..93be270 100644
--- a/board/gateworks/gw_ventana/gw_ventana_spl.c
+++ b/board/gateworks/gw_ventana/gw_ventana_spl.c
@@ -199,6 +199,7 @@ static struct mx6_ddr3_cfg mt41k128m16jt_125 = {
.trcd = 1375,
.trcmin = 4875,
.trasmin = 3500,
+   .ranks = 1
 };

 /* GW54xx specific calibration */
@@ -309,8 +310,6 @@ static void spl_dram_init(int width, int size, int 
board_model)

.dsize = width/32,
/* config for full 4GB range so that get_mem_size() works */
.cs_density = 32, /* 32Gb per CS */
-   /* single chip select */
-   .ncs = 1,
.cs1_mirror = 0,
.rtt_wr = 1 /*DDR3_RTT_60_OHM*/,/* RTT_Wr = RZQ/4 */
 #ifdef RTT_NOM_120OHM


Please excuse me if this way to show ideas is not the appropriate one, 
just tell me how to do it better and I'll do my best.


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


Re: [U-Boot] [PATCH 1/3] config: introduce a generic $bootcmd

2014-08-09 Thread Hans de Goede
Hi,

On 08/08/2014 06:00 PM, Stephen Warren wrote:
 On 08/07/2014 06:17 PM, Simon Glass wrote:
 Acked-by: Simon Glass s...@chromium.org
 
 For the list archive's record: Simon also replied to patch 2 with the same 
 ack, but somehow the CC list got dropped to only myself and TomW.

I've a bunch of patches relying on this, is there anything stopping this
from getting merged ?

Reviewed-by: Hans de Goede hdego...@redhat.com

Regards,

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


Re: [U-Boot] [PATCH] pci: mx6: fix occasional link failures

2014-08-09 Thread Fabio Estevam
Hi Marek,

On Sat, Aug 9, 2014 at 8:51 AM, Marek Vasut ma...@denx.de wrote:

 Well you do realize that this addition changes the timing of the code and also
 generates writes on the AXI bus, right? I would be much fonder of your testing
 if you did it with a pristine code and monitored the number of successful 
 cases
 with plain logging of the serial console and a grep. This should be easy and
 would avoid the problems with modified code.

Ok, so with the debug patch applied I let it running overnight and it
ran 39k+ times without PCI linkup failures.

I agree with your comments and now I am doing as you suggested:

Running top of tree u-boot-imx with only Tim's patch applied.

Then I do:

sudo minicom | tee pci.txt  to collect the logs.

After one hour of testing:

/tmp$ cat pci.txt | grep CPU | wc -l
2251

/tmp$ cat pci.txt | grep Bridge | wc -l
2251

Could you help testing the kernel patch?

Regards,

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


[U-Boot] [PATCH] mkimage: fix compilation issues on OpenBSD

2014-08-09 Thread Luka Perkov
Signed-off-by: Luka Perkov l...@openwrt.org
---
 tools/mkimage.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/mkimage.c b/tools/mkimage.c
index 123d0c7..c70408c9 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -458,6 +458,7 @@ NXTARG: ;
 #if defined(_POSIX_SYNCHRONIZED_IO)  \
!defined(__sun__)  \
!defined(__FreeBSD__)  \
+   !defined(__OpenBSD__)  \
!defined(__APPLE__)
(void) fdatasync (ifd);
 #else
@@ -501,6 +502,7 @@ NXTARG: ;
 #if defined(_POSIX_SYNCHRONIZED_IO)  \
!defined(__sun__)  \
!defined(__FreeBSD__)  \
+   !defined(__OpenBSD__)  \
!defined(__APPLE__)
(void) fdatasync (ifd);
 #else
-- 
2.0.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-sunxi.git/master

2014-08-09 Thread Albert ARIBAUD
Hi Hans,

On Thu, 31 Jul 2014 16:30:22 +0200, Hans de Goede hdego...@redhat.com
wrote:

 Hi Albert
 
 Note:
 
 1) This superseeds my previous pull-req as that conflicted with the Kconfig 
 changes
 which have landed in u-boot/master, this pull-req replaces all the boards.cfg 
 changes
 from the previous series with defconfig changes / additions;
 
 2) Since this new pull-req is intended to resolve conflicts with 
 u-boot/master it
 is based on u-boot/master rather then on u-boot-arm/master.
 
 Please pull from u-boot-sunxi.git/master for a set of patches adding
 AHCI, EHCI, PSCI support + support for 14 new boards.
 
 The following changes since commit 25b4adbba018633b943a99322bfb2fb819c0bafb:
 
   include: remove CONFIG_SPL/CONFIG_TPL definition in config headers 
 (2014-07-30 14:42:03 -0400)
 
 are available in the git repository at:
 
   http://git.denx.de/u-boot-sunxi.git master
 
 for you to fetch changes up to 3340eab26d89176dd0bf543e6d2590665c577423:
 
   sun7i: Add bananapi board (2014-07-31 15:37:24 +0200)
 
 
 Hans de Goede (8):
   sun4i: add USB EHCI settings
   sun5i: add USB EHCI settings
   sunxi: Enable EHCI on various sunxi boards
   sunxi: Add CONFIG_MACPWR option
   sun4i: Add support for a number of new sun4i boards
   sun5i: Add support for a number of new sun5i boards
   sun7i: Add support for a number of new sun7i boards
   sun7i: Add bananapi board
 
 Ian Campbell (2):
   ahci: provide sunxi SATA driver using AHCI platform framework
   cubieboard2: Enable AXP209 power controller
 
 Marc Zyngier (2):
   sunxi: HYP/non-sec: add sun7i PSCI backend
   sunxi: HYP/non-sec: configure CNTFRQ on all CPUs
 
 Roman Byshko (5):
   sunxi: add defines to control USB Host clocks/resets
   sunxi: add USB EHCI driver
   sunxi: add general USB settings
   sun7i: add USB EHCI settings
   sun7i: cubietruck: enable USB EHCI
 
  arch/arm/cpu/armv7/sunxi/Makefile |   3 +
  arch/arm/cpu/armv7/sunxi/board.c  |   5 +
  arch/arm/cpu/armv7/sunxi/clock_sun4i.c|   4 +
  arch/arm/cpu/armv7/sunxi/psci.S   | 162 +
  arch/arm/include/asm/arch-sunxi/clock_sun4i.h |  15 +-
  board/sunxi/MAINTAINERS   |  19 ++-
  board/sunxi/Makefile  |  16 ++
  board/sunxi/ahci.c|  84 +++
  board/sunxi/dram_a10_olinuxino_l.c|  31 
  board/sunxi/dram_a10s_olinuxino_m.c   |  31 
  board/sunxi/dram_a13_olinuxino.c  |  31 
  board/sunxi/dram_bananapi.c   |  31 
  board/sunxi/dram_linksprite_pcduino3.c|  31 
  board/sunxi/dram_sun4i_360_1024_iow16.c   |  31 
  board/sunxi/dram_sun4i_360_1024_iow8.c|  31 
  board/sunxi/dram_sun4i_360_512.c  |  31 
  board/sunxi/dram_sun4i_384_1024_iow8.c|  31 
  board/sunxi/dram_sun7i_384_1024_iow16.c   |  31 
  board/sunxi/dram_sun7i_384_512_busw16_iow16.c |  31 
  configs/A10-OLinuXino-Lime_defconfig  |   4 +
  configs/A10s-OLinuXino-M_defconfig|   4 +
  configs/A13-OLinuXinoM_defconfig  |   2 +-
  configs/A13-OLinuXino_defconfig   |   4 +
  configs/A20-OLinuXino_MICRO_defconfig |   4 +
  configs/Auxtek-T004_defconfig |   4 +
  configs/Bananapi_defconfig|   4 +
  configs/Cubieboard2_FEL_defconfig |   2 +-
  configs/Cubieboard2_defconfig |   2 +-
  configs/Cubieboard_defconfig  |   2 +-
  configs/Cubietruck_FEL_defconfig  |   2 +-
  configs/Cubietruck_defconfig  |   2 +-
  configs/Linksprite_pcDuino3_defconfig |   4 +
  configs/Mele_A1000G_defconfig |   4 +
  configs/Mele_A1000_defconfig  |   4 +
  configs/Mini-X-1Gb_defconfig  |   4 +
  configs/Mini-X_defconfig  |   4 +
  configs/ba10_tv_box_defconfig |   4 +
  configs/i12-tvbox_defconfig   |   4 +
  configs/qt840a_defconfig  |   4 +
  configs/r7-tv-dongle_defconfig|   2 +-
  drivers/block/ahci.c  |  16 ++
  drivers/usb/host/Makefile |   1 +
  drivers/usb/host/ehci-sunxi.c | 201 
 ++
  include/ahci.h|   4 +
  include/configs/sun4i.h   |  12 ++
  include/configs/sun5i.h   |   5 +
  include/configs/sun7i.h   |  19 +++
  include/configs/sunxi-common.h|  18 +++
  48 files changed, 982 insertions(+), 13 deletions(-)
  create mode 100644 arch/arm/cpu/armv7/sunxi/psci.S
  create mode 100644 board/sunxi/ahci.c
  create mode 100644 board/sunxi/dram_a10_olinuxino_l.c
  

Re: [U-Boot] [PATCH v4 4/5] usb/gadget: fastboot: add sparse image definitions

2014-08-09 Thread Steve Rae

( Google agreed to submit a patch with BSD3 license  stay tuned!!! )


On 14-08-09 05:48 AM, Marek Vasut wrote:

On Friday, August 08, 2014 at 12:17:38 AM, Wolfgang Denk wrote:

Dear Marek,

In message 201408072343.58591.ma...@denx.de you wrote:

OK, so we need a GPLv2-compatible header file. That's the conclusion.


Well, GPLv2 compatible might be acceptable, but GPLv2+ compatible
woould be best.


I was talking to Hans about this yesterday (and who was dropped from the CC for
some reason) and it turns out the easy way out here is to just reimplement the
header. I would like him to take a look and express his opinion properly though.

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] pci: mx6: fix occasional link failures

2014-08-09 Thread Fabio Estevam
On Sat, Aug 9, 2014 at 12:37 PM, Fabio Estevam feste...@gmail.com wrote:

 Ok, so with the debug patch applied I let it running overnight and it
 ran 39k+ times without PCI linkup failures.

 I agree with your comments and now I am doing as you suggested:

 Running top of tree u-boot-imx with only Tim's patch applied.

 Then I do:

 sudo minicom | tee pci.txt  to collect the logs.

 After one hour of testing:

 /tmp$ cat pci.txt | grep CPU | wc -l
 2251

 /tmp$ cat pci.txt | grep Bridge | wc -l
 2251

The test has been running more than 11k times without a failure.

Will finish the tests now and let my board to rest a little bit :-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 5/9] arm: Support pre-relocation malloc()

2014-08-09 Thread Simon Glass
Applied to u-boot-dm/master.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/9] arm: Set up global data before board_init_f()

2014-08-09 Thread Simon Glass
Applied to u-boot-dm/master.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/25] Introduce driver model support for SPI, SPI flash, cros_ec

2014-08-09 Thread Simon Glass
Hi,

On 14 July 2014 18:56, Simon Glass s...@chromium.org wrote:
 Up until now driver model has not been used for any type of bus. Buses
 have some unique properties and needs, so we cannot claim that driver
 model can cover all the common cases unless we have converted a bus over
 to driver model.

 SPI is a reasonable choice for this next step. It has a fairly simple
 API and not too many dependencies. The main one is SPI flash so we may
 as well convert that also. Since the boards I test with have cros_ec I
 have also included that, for SPI only.

 The technique used is make use of driver model's supported data structures
 to hold information currently kept by each subsystem in a private data
 structure. Since 'struct spi_slave' relates to the slave device on the bus
 it is stored in the 'parent' data with each child device of the bus.
 Since 'struct spi_flash' is a standard interface used for each SPI flash
 driver, it is stored in the SPI FLash uclass's private data for each
 device.

 New defines are created to enable driver model for each subsystem. These
 are:

CONFIG_DM_SPI
CONFIG_DM_SPI_FLASH
CONFIG_DM_CROS_EC

 This allows us to move some boards and drivers to driver model, while
 leaving others behind. A 'big bang' conversion of everything to driver
 model, event at a subsystem level, is never going to work.

 On the other hand, we change the driver at the same time as the CONFIG
 option is enabled. Keeping both version of the driver around involves a
 flock of #ifdefs, the benefit of which is not apparent to me, since the
 old code is removed anyway.

 There is some cost in changing the uclass interface after it is created,
 so if you have limited time, please spend it reviewing the uclass
 interfaces in spi.h and spi_flash.h. These need to be supported by each
 driver, so changing them later may involve changing multiple drivers.

 To help with conversion of SPI drivers to driver model, documentation is
 provided which takes the happy camper through the process with an example.

 As always, driver model patches are available at u-boot-dm.git branch
 'working'.

 Note: This series is not fully ready - e.g. some header files are missing
 comments. But I wanted to get it out for review early since some SPI work
 is ongoing which might depend on it.

Are there any comments on this series please? I'd like to apply these
to dm/master early next week, excluding the exynos ones.

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


[U-Boot] [PATCH v6 0/20] Add some missing buildman features and deprecate MAKEALL

2014-08-09 Thread Simon Glass
Buildman has been around for a little over a year and is used by a fair
number of U-Boot developers. However quite a few people still use MAKEALL.

Buildman was intended to replace MAKEALL, so perhaps now is a good time to
start that process.

The reasons to deprecate MAKEALL are:
- We don't want to maintain two build systems
- Buildman is typically faster
- Buildman has a lot more features

This series adds a few features to buildman to fill some gaps, adds some
information into the README on how to migrate from MAKEALL, and adds a
deprecation message to MAKEALL.

Changes in v6:
- Add new patch to remove patman's -a option
- Add new patch to fix patman unit tests
- Add new patch to fix indentation in teminal.py
- Add new patch to fix the spelling of 'colour'
- Add new patch to avoid using --no-decorate when not available
- Add new patch to move 'git log' command into a function
- Add new patch to implement -c option

Changes in v5:
- Drop patch to search for *cc instead of *gcc for the compiler
- Add new patch to add an 'and' operator for board selection
- Update test for verbose option
- Update test for output options

Changes in v4:
- Add new patch to add a few more toolchain examples to the README
- Add new patch to show a message when there are no errors
- Add new patch to allow the config file to be specified
- Add new patch to remove unused non-incremental build method code
- Fix typo in commit message
- Fix missing import in builder.py

Changes in v3:
- Add new patch to add a verbose option
- Add new patch to refactor output options
- Add new patch to sort command line options
- Add new patch to move BuilderThread code to its own file
- Add new patch to build current source tree

Changes in v2:
- Minor changes to the text
- Add new patch to fix existing typos

Simon Glass (20):
  buildman: Fix a few typos
  buildman: Add some notes about moving from MAKEALL
  buildman: Allow building of current source tree
  buildman: Move BuilderThread code to its own file
  buildman: Sort command line options
  buildman: Refactor output options
  buildman: Add verbose option to display errors as they happen
  buildman: Remove unused non-incremental build method code
  buildman: Add an option to specify the buildman config file
  buildman: Add a message indicating there are no errors
  buildman: Add a few more toolchain examples to the README
  buildman: Introduce an 'and' operator for board selection
  buildman: Allow selection of the number of commits to build
  patman: Move the 'git log' command into a function
  patman: Only use git's --no-decorate when available
  patman: buildman: Correct spelling of 'colour'
  patman: Fix indentation in terminal.py
  patman: Correct unit tests to run correctly
  patman: Remove the -a option
  RFC: Deprecate MAKEALL

 MAKEALL |   4 +
 tools/buildman/README   | 159 ++-
 tools/buildman/board.py | 144 --
 tools/buildman/builder.py   | 587 +++-
 tools/buildman/builderthread.py | 434 +
 tools/buildman/buildman.py  |  16 +-
 tools/buildman/control.py   | 116 +---
 tools/buildman/test.py  |  56 +++-
 tools/patman/checkpatch.py  |  18 +-
 tools/patman/gitutil.py | 142 +++---
 tools/patman/patchstream.py |  18 +-
 tools/patman/patman.py  |  11 +-
 tools/patman/series.py  |  14 +-
 tools/patman/terminal.py| 120 
 tools/patman/test.py|  13 +-
 15 files changed, 1076 insertions(+), 776 deletions(-)
 create mode 100644 tools/buildman/builderthread.py

-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v6 18/20] patman: Correct unit tests to run correctly

2014-08-09 Thread Simon Glass
It seems that doctest behaves differently now, and some of the unit tests
do not run. Adjust the tests to work correctly.

 ./tools/patman/patman --test
unittest.result.TestResult run=10 errors=0 failures=0

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

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3:
- Add new patch to build current source tree

Changes in v2: None

 tools/patman/gitutil.py |  8 
 tools/patman/patchstream.py |  7 +--
 tools/patman/terminal.py|  8 ++--
 tools/patman/test.py| 13 +++--
 4 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 18133f2..77cf73f 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -476,13 +476,13 @@ def LookupEmail(lookup_name, alias=None, 
raise_on_error=True, level=0):
 ...
 OSError: Recursive email alias at 'other'
  LookupEmail('odd', alias, raise_on_error=False)
-\033[1;31mAlias 'odd' not found\033[0m
+Alias 'odd' not found
 []
  # In this case the loop part will effectively be ignored.
  LookupEmail('loop', alias, raise_on_error=False)
-\033[1;31mRecursive email alias at 'other'\033[0m
-\033[1;31mRecursive email alias at 'john'\033[0m
-\033[1;31mRecursive email alias at 'mary'\033[0m
+Recursive email alias at 'other'
+Recursive email alias at 'john'
+Recursive email alias at 'mary'
 ['j.blo...@napier.co.nz', 'm.popp...@cloud.net']
 
 if not alias:
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index 0040468..322374c 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -275,7 +275,7 @@ class PatchStream:
 
 # Suppress duplicate signoffs
 elif signoff_match:
-if (self.is_log or
+if (self.is_log or not self.commit or
 self.commit.CheckDuplicateSignoff(signoff_match.group(1))):
 out = [line]
 
@@ -312,7 +312,10 @@ class PatchStream:
 out = []
 log = self.series.MakeChangeLog(self.commit)
 out += self.FormatTags(self.tags)
-out += [line] + self.commit.notes + [''] + log
+out += [line]
+if self.commit:
+out += self.commit.notes
+out += [''] + log
 elif self.found_test:
 if not re_allowed_after_test.match(line):
 self.lines_after_test += 1
diff --git a/tools/patman/terminal.py b/tools/patman/terminal.py
index be216d3..9510dfd 100644
--- a/tools/patman/terminal.py
+++ b/tools/patman/terminal.py
@@ -30,8 +30,12 @@ class Colour(object):
   enabled: True if colour output should be enabled. If False then this
 class will not add colour codes at all.
 
-self._enabled = (coloured == COLOUR_ALWAYS or
-(coloured == COLOUR_IF_TERMINAL and 
os.isatty(sys.stdout.fileno(
+try:
+self._enabled = (coloured == COLOUR_ALWAYS or
+(coloured == COLOUR_IF_TERMINAL and
+ os.isatty(sys.stdout.fileno(
+except:
+self._enabled = False
 
 def Start(self, colour, bright=True):
 Returns a start colour code.
diff --git a/tools/patman/test.py b/tools/patman/test.py
index 8fcfe53..e8f7472 100644
--- a/tools/patman/test.py
+++ b/tools/patman/test.py
@@ -55,6 +55,7 @@ This adds functions to enable/disable clocks and reset to 
on-chip peripherals.
 
 Signed-off-by: Simon Glass s...@chromium.org
 ---
+
  arch/arm/cpu/armv7/tegra2/Makefile |2 +-
  arch/arm/cpu/armv7/tegra2/ap20.c   |   57 ++
  arch/arm/cpu/armv7/tegra2/clock.c  |  163 +
@@ -200,7 +201,7 @@ index 000..2234c87
 self.assertEqual(result.errors, 0)
 self.assertEqual(result.warnings, 0)
 self.assertEqual(result.checks, 0)
-self.assertEqual(result.lines, 67)
+self.assertEqual(result.lines, 56)
 os.remove(inf)
 
 def testNoSignoff(self):
@@ -211,18 +212,18 @@ index 000..2234c87
 self.assertEqual(result.errors, 1)
 self.assertEqual(result.warnings, 0)
 self.assertEqual(result.checks, 0)
-self.assertEqual(result.lines, 67)
+self.assertEqual(result.lines, 56)
 os.remove(inf)
 
 def testSpaces(self):
 inf = self.SetupData('spaces')
 result = checkpatch.CheckPatch(inf)
 self.assertEqual(result.ok, False)
-self.assertEqual(len(result.problems), 1)
+self.assertEqual(len(result.problems), 2)
 self.assertEqual(result.errors, 0)
-self.assertEqual(result.warnings, 1)
+self.assertEqual(result.warnings, 2)
 self.assertEqual(result.checks, 0)
-self.assertEqual(result.lines, 67)
+self.assertEqual(result.lines, 56)
 os.remove(inf)
 
 def 

[U-Boot] [PATCH v6 05/20] buildman: Sort command line options

2014-08-09 Thread Simon Glass
These options have got slightly out of order. Fix them.

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

Changes in v6:
- Add new patch to fix the spelling of 'colour'

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

 tools/buildman/buildman.py | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py
index 42847ac..da6025a 100755
--- a/tools/buildman/buildman.py
+++ b/tools/buildman/buildman.py
@@ -70,6 +70,9 @@ parser.add_option('-c', '--count', dest='count', type='int',
 parser.add_option('-C', '--force-reconfig', dest='force_reconfig',
action='store_true', default=False,
help='Reconfigure for every commit (disable incremental build)')
+parser.add_option('-d', '--detail', dest='show_detail',
+   action='store_true', default=False,
+   help='Show detailed information for each board in summary')
 parser.add_option('-e', '--show_errors', action='store_true',
default=False, help='Show errors and warnings')
 parser.add_option('-f', '--force-build', dest='force_build',
@@ -78,9 +81,6 @@ parser.add_option('-f', '--force-build', dest='force_build',
 parser.add_option('-F', '--force-build-failures', dest='force_build_failures',
action='store_true', default=False,
help='Force build of previously-failed build')
-parser.add_option('-d', '--detail', dest='show_detail',
-   action='store_true', default=False,
-   help='Show detailed information for each board in summary')
 parser.add_option('-g', '--git', type='string',
help='Git repo containing branch to build', default='.')
 parser.add_option('-H', '--full-help', action='store_true', dest='full_help',
@@ -96,6 +96,9 @@ parser.add_option('--list-tool-chains', action='store_true', 
default=False,
help='List available tool chains')
 parser.add_option('-n', '--dry-run', action='store_true', dest='dry_run',
default=False, help=Do a try run (describe actions, but no nothing))
+parser.add_option('-o', '--output-dir', type='string',
+   dest='output_dir', default='..',
+   help='Directory where all builds happen and buildman has its workspace 
(default is ../)')
 parser.add_option('-Q', '--quick', action='store_true',
default=False, help='Do a rough build, with limited warning resolution')
 parser.add_option('-s', '--summary', action='store_true',
@@ -110,9 +113,6 @@ parser.add_option('-T', '--threads', type='int',
default=None, help='Number of builder threads to use')
 parser.add_option('-u', '--show_unknown', action='store_true',
default=False, help='Show boards with unknown build result')
-parser.add_option('-o', '--output-dir', type='string',
-   dest='output_dir', default='..',
-   help='Directory where all builds happen and buildman has its workspace 
(default is ../)')
 
 parser.usage = buildman -b branch [options]
 
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v6 17/20] patman: Fix indentation in terminal.py

2014-08-09 Thread Simon Glass
This code came from a different project with 2-character indentation. Fix
it for U-Boot.

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

Changes in v6: None
Changes in v5: None
Changes in v4:
- Fix missing import in builder.py

Changes in v3:
- Add new patch to move BuilderThread code to its own file

Changes in v2: None

 tools/patman/terminal.py | 108 ---
 1 file changed, 55 insertions(+), 53 deletions(-)

diff --git a/tools/patman/terminal.py b/tools/patman/terminal.py
index 5862aa1..be216d3 100644
--- a/tools/patman/terminal.py
+++ b/tools/patman/terminal.py
@@ -15,66 +15,68 @@ import sys
 COLOUR_IF_TERMINAL, COLOUR_ALWAYS, COLOUR_NEVER = range(3)
 
 class Colour(object):
-  Conditionally wraps text in ANSI colour escape sequences.
-  BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
-  BOLD = -1
-  BRIGHT_START = '\033[1;%dm'
-  NORMAL_START = '\033[22;%dm'
-  BOLD_START = '\033[1m'
-  RESET = '\033[0m'
+Conditionally wraps text in ANSI colour escape sequences.
+BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
+BOLD = -1
+BRIGHT_START = '\033[1;%dm'
+NORMAL_START = '\033[22;%dm'
+BOLD_START = '\033[1m'
+RESET = '\033[0m'
 
-  def __init__(self, coloured=COLOUR_IF_TERMINAL):
-Create a new Colour object, optionally disabling colour output.
+def __init__(self, coloured=COLOUR_IF_TERMINAL):
+Create a new Colour object, optionally disabling colour output.
 
-Args:
-  enabled: True if colour output should be enabled. If False then this
-class will not add colour codes at all.
-
-self._enabled = (coloured == COLOUR_ALWAYS or
-(coloured == COLOUR_IF_TERMINAL and os.isatty(sys.stdout.fileno(
+Args:
+  enabled: True if colour output should be enabled. If False then this
+class will not add colour codes at all.
+
+self._enabled = (coloured == COLOUR_ALWAYS or
+(coloured == COLOUR_IF_TERMINAL and 
os.isatty(sys.stdout.fileno(
 
-  def Start(self, colour, bright=True):
-Returns a start colour code.
+def Start(self, colour, bright=True):
+Returns a start colour code.
 
-Args:
-  colour: Colour to use, .e.g BLACK, RED, etc.
+Args:
+  colour: Colour to use, .e.g BLACK, RED, etc.
 
-Returns:
-  If colour is enabled, returns an ANSI sequence to start the given colour,
-  otherwise returns empty string
-
-if self._enabled:
-base = self.BRIGHT_START if bright else self.NORMAL_START
-return base % (colour + 30)
-return ''
+Returns:
+  If colour is enabled, returns an ANSI sequence to start the given
+  colour, otherwise returns empty string
+
+if self._enabled:
+base = self.BRIGHT_START if bright else self.NORMAL_START
+return base % (colour + 30)
+return ''
 
-  def Stop(self):
-Retruns a stop colour code.
+def Stop(self):
+Retruns a stop colour code.
 
-Returns:
-  If colour is enabled, returns an ANSI colour reset sequence, otherwise
-  returns empty string
-
-if self._enabled:
-return self.RESET
-return ''
+Returns:
+  If colour is enabled, returns an ANSI colour reset sequence,
+  otherwise returns empty string
+
+if self._enabled:
+return self.RESET
+return ''
 
-  def Colour(self, colour, text, bright=True):
-Returns text with conditionally added colour escape sequences.
+def Colour(self, colour, text, bright=True):
+Returns text with conditionally added colour escape sequences.
 
-Keyword arguments:
-  colour: Text colour -- one of the colour constants defined in this class.
-  text: The text to colour.
+Keyword arguments:
+  colour: Text colour -- one of the colour constants defined in this
+  class.
+  text: The text to colour.
 
-Returns:
-  If self._enabled is False, returns the original text. If it's True,
-  returns text with colour escape sequences based on the value of colour.
-
-if not self._enabled:
-return text
-if colour == self.BOLD:
-start = self.BOLD_START
-else:
-base = self.BRIGHT_START if bright else self.NORMAL_START
-start = base % (colour + 30)
-return start + text + self.RESET
+Returns:
+  If self._enabled is False, returns the original text. If it's True,
+  returns text with colour escape sequences based on the value of
+  colour.
+
+if not self._enabled:
+return text
+if colour == self.BOLD:
+start = self.BOLD_START
+else:
+base = self.BRIGHT_START if bright else self.NORMAL_START
+start = base % (colour + 30)
+return start + text + self.RESET
-- 
2.0.0.526.g5318336


[U-Boot] [PATCH v6 11/20] buildman: Add a few more toolchain examples to the README

2014-08-09 Thread Simon Glass
The current README is a bit sparse in this area, so add a few more
examples.

Suggested-by: Tom Rini tr...@ti.com
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v6: None
Changes in v5: None
Changes in v4:
- Add new patch to show a message when there are no errors

Changes in v3: None
Changes in v2: None

 tools/buildman/README | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/buildman/README b/tools/buildman/README
index 6ba24c0..aaf0a10 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -134,6 +134,8 @@ example:
 root: /
 rest: /toolchains/*
 eldk: /opt/eldk-4.2
+arm: /opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux
+aarch64: /opt/linaro/gcc-linaro-aarch64-none-elf-4.8-2013.10_linux
 
 [toolchain-alias]
 x86: i386
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v6 10/20] buildman: Add a message indicating there are no errors

2014-08-09 Thread Simon Glass
If buildman finds no problems it prints nothing. This can be a bit confusing,
so add a message that all is well.

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

Changes in v6: None
Changes in v5: None
Changes in v4:
- Add new patch to add a few more toolchain examples to the README

Changes in v3: None
Changes in v2: None

 tools/buildman/builder.py | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 22a24b1..d5b8454 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -210,6 +210,7 @@ class Builder:
 self.force_reconfig = False
 self._step = step
 self.in_tree = False
+self._error_lines = 0
 
 self.col = terminal.Color()
 
@@ -891,10 +892,13 @@ class Builder:
 self.col.MAGENTA)
 for arch, target_list in arch_list.iteritems():
 print '%10s: %s' % (arch, target_list)
+self._error_lines += 1
 if better_err:
 print self.col.Color(self.col.GREEN, '\n'.join(better_err))
+self._error_lines += 1
 if worse_err:
 print self.col.Color(self.col.RED, '\n'.join(worse_err))
+self._error_lines += 1
 
 if show_sizes:
 self.PrintSizeSummary(board_selected, board_dict, show_detail,
@@ -937,9 +941,12 @@ class Builder:
 self.commit_count = len(commits) if commits else 1
 self.commits = commits
 self.ResetResultSummary(board_selected)
+self._error_lines = 0
 
 for commit_upto in range(0, self.commit_count, self._step):
 self.ProduceResultSummary(commit_upto, commits, board_selected)
+if not self._error_lines:
+print self.col.Color(self.col.GREEN, '(no errors to report)')
 
 
 def SetupBuild(self, board_selected, commits):
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v6 07/20] buildman: Add verbose option to display errors as they happen

2014-08-09 Thread Simon Glass
Normally buildman operates in two passes - one to do the build and another
to summarise the errors. Add a verbose option (-v) to display build problems
as they happen. With -e also given, this will display errors too.

When building the current source tree (rather than a list of commits in a
branch), both -v and -e are enabled automatically.

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

Changes in v6:
- Add new patch to move 'git log' command into a function

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

 tools/buildman/README  | 46 --
 tools/buildman/builder.py  | 16 +---
 tools/buildman/buildman.py |  2 ++
 tools/buildman/control.py  |  4 +++-
 tools/buildman/test.py |  3 ++-
 5 files changed, 56 insertions(+), 15 deletions(-)

diff --git a/tools/buildman/README b/tools/buildman/README
index 1c919af..6ba24c0 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -41,9 +41,10 @@ Theory of Operation
 
 Buildman is a builder. It is not make, although it runs make. It does not
 produce any useful output on the terminal while building, except for
-progress information. All the output (errors, warnings and binaries if you
-are ask for them) is stored in output directories, which you can look at
-while the build is progressing, or when it is finished.
+progress information (except with -v, see below). All the output (errors,
+warnings and binaries if you are ask for them) is stored in output
+directories, which you can look at while the build is progressing, or when
+it is finished.
 
 Buildman produces a concise summary of which boards succeeded and failed.
 It shows which commit introduced which board failure using a simple
@@ -77,12 +78,17 @@ Buildman automatically selects the correct tool chain for 
each board. You
 must supply suitable tool chains, but buildman takes care of selecting the
 right one.
 
-Buildman always builds a branch, and always builds the upstream commit as
-well, for comparison. It cannot build individual commits at present, unless
-(maybe) you point it at an empty branch. Put all your commits in a branch,
-set the branch's upstream to a valid value, and all will be well. Otherwise
-buildman will perform random actions. Use -n to check what the random
-actions might be.
+Buildman generally builds a branch (with the -b flag), and in this case
+builds the upstream commit as well, for comparison. It cannot build
+individual commits at present, unless (maybe) you point it at an empty
+branch. Put all your commits in a branch, set the branch's upstream to a
+valid value, and all will be well. Otherwise buildman will perform random
+actions. Use -n to check what the random actions might be.
+
+If you just want to build the current source tree, leave off the -b flag.
+This will display results and errors as they happen. You can still look
+at them later using -s. Note that buildman will assume that the source
+has changed, and will build all specified boards in this case.
 
 Buildman is optimised for building many commits at once, for many boards.
 On multi-core machines, Buildman is fast because it uses most of the
@@ -659,6 +665,15 @@ It is expected that any variables added are dealt with in 
U-Boot's
 config.mk file and documented in the README.
 
 
+Quick Sanity Check
+==
+
+If you have made changes and want to do a quick sanity check of the
+currently-checked-out source, run buildman without the -b flag. This will
+build the selected boards and display build status and errors as it runs
+(i.e. -v amd -e are enabled automatically).
+
+
 Other options
 =
 
@@ -685,7 +700,15 @@ First you need to set up your tool chains - see the 
'Setting up' section
 for details. Once you have your required toolchain(s) detected then you are
 ready to go.
 
-Buildman works on entire branches, so the normal use is:
+To build the current source tree, run buildman without a -b flag:
+
+   ./tools/buildman/buildman list of things to build
+
+This will build the current source tree for the given boards and display
+the results and errors.
+
+However buildman usually works on entire branches, and for that you must
+specify a board flag:
 
./tools/buildman/buildman -b branch_name list of things to build
 
@@ -698,6 +721,9 @@ buildman just shows a summary, with red indicating that a 
commit introduced
 an error and green indicating that a commit fixed an error. Use the -e
 flag to see the full errors.
 
+If you really want to see build results as they happen, use -v when doing a
+build (and -e if you want to see errors as well).
+
 You don't need to stick around on that branch while buildman is running. It
 checks out its own copy of the source code, so you can change branches,
 add commits, etc. without affecting the build in progress.
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index a6c43e0..dd7f5a4 100644
--- a/tools/buildman/builder.py
+++ 

[U-Boot] [PATCH v6 04/20] buildman: Move BuilderThread code to its own file

2014-08-09 Thread Simon Glass
The builder.py file is getting too long, so split out some code.

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

Changes in v6:
- Add new patch to fix indentation in teminal.py

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

 tools/buildman/builder.py   | 439 +---
 tools/buildman/builderthread.py | 434 +++
 2 files changed, 442 insertions(+), 431 deletions(-)
 create mode 100644 tools/buildman/builderthread.py

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index d2b72d5..e2da0eb 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -6,7 +6,6 @@
 #
 
 import collections
-import errno
 from datetime import datetime, timedelta
 import glob
 import os
@@ -15,9 +14,9 @@ import Queue
 import shutil
 import string
 import sys
-import threading
 import time
 
+import builderthread
 import command
 import gitutil
 import terminal
@@ -97,428 +96,6 @@ OUTCOME_OK, OUTCOME_WARNING, OUTCOME_ERROR, OUTCOME_UNKNOWN 
= range(4)
 trans_valid_chars = string.maketrans(/: , ---)
 
 
-def Mkdir(dirname):
-Make a directory if it doesn't already exist.
-
-Args:
-dirname: Directory to create
-
-try:
-os.mkdir(dirname)
-except OSError as err:
-if err.errno == errno.EEXIST:
-pass
-else:
-raise
-
-class BuilderJob:
-Holds information about a job to be performed by a thread
-
-Members:
-board: Board object to build
-commits: List of commit options to build.
-
-def __init__(self):
-self.board = None
-self.commits = []
-
-
-class ResultThread(threading.Thread):
-This thread processes results from builder threads.
-
-It simply passes the results on to the builder. There is only one
-result thread, and this helps to serialise the build output.
-
-def __init__(self, builder):
-Set up a new result thread
-
-Args:
-builder: Builder which will be sent each result
-
-threading.Thread.__init__(self)
-self.builder = builder
-
-def run(self):
-Called to start up the result thread.
-
-We collect the next result job and pass it on to the build.
-
-while True:
-result = self.builder.out_queue.get()
-self.builder.ProcessResult(result)
-self.builder.out_queue.task_done()
-
-
-class BuilderThread(threading.Thread):
-This thread builds U-Boot for a particular board.
-
-An input queue provides each new job. We run 'make' to build U-Boot
-and then pass the results on to the output queue.
-
-Members:
-builder: The builder which contains information we might need
-thread_num: Our thread number (0-n-1), used to decide on a
-temporary directory
-
-def __init__(self, builder, thread_num):
-Set up a new builder thread
-threading.Thread.__init__(self)
-self.builder = builder
-self.thread_num = thread_num
-
-def Make(self, commit, brd, stage, cwd, *args, **kwargs):
-Run 'make' on a particular commit and board.
-
-The source code will already be checked out, so the 'commit'
-argument is only for information.
-
-Args:
-commit: Commit object that is being built
-brd: Board object that is being built
-stage: Stage of the build. Valid stages are:
-distclean - can be called to clean source
-config - called to configure for a board
-build - the main make invocation - it does the build
-args: A list of arguments to pass to 'make'
-kwargs: A list of keyword arguments to pass to command.RunPipe()
-
-Returns:
-CommandResult object
-
-return self.builder.do_make(commit, brd, stage, cwd, *args,
-**kwargs)
-
-def RunCommit(self, commit_upto, brd, work_dir, do_config, force_build,
-  force_build_failures):
-Build a particular commit.
-
-If the build is already done, and we are not forcing a build, we skip
-the build and just return the previously-saved results.
-
-Args:
-commit_upto: Commit number to build (0...n-1)
-brd: Board object to build
-work_dir: Directory to which the source will be checked out
-do_config: True to run a make board_defconfig on the source
-force_build: Force a build even if one was previously done
-force_build_failures: Force a bulid if the previous result showed
-failure
-
-Returns:
-tuple containing:
-- CommandResult object containing the results of the build
-- boolean indicating whether 'make config' is still needed
-
-# Create 

[U-Boot] [PATCH v6 03/20] buildman: Allow building of current source tree

2014-08-09 Thread Simon Glass
Originally buildman had some support for building the current source tree.
However this was dropped before it was submitted, as part of the effort to
make it faster when building entire branches.

Reinstate this support. If no -b option is given, buildman will build the
current source tree.

Reported-by: Masahiro Yamada yamad...@jp.panasonic.com
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v6:
- Add new patch to fix patman unit tests

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

 tools/buildman/builder.py | 71 +---
 tools/buildman/control.py | 91 ++-
 2 files changed, 108 insertions(+), 54 deletions(-)

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 48408ff..d2b72d5 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -248,21 +248,34 @@ class BuilderThread(threading.Thread):
 
 if self.toolchain:
 # Checkout the right commit
-if commit_upto is not None:
+if self.builder.commits:
 commit = self.builder.commits[commit_upto]
 if self.builder.checkout:
 git_dir = os.path.join(work_dir, '.git')
 gitutil.Checkout(commit.hash, git_dir, work_dir,
  force=True)
 else:
-commit = self.builder.commit # Ick, fix this for 
BuildCommits()
+commit = 'current'
 
 # Set up the environment and command line
 env = self.toolchain.MakeEnvironment()
 Mkdir(out_dir)
 args = []
+cwd = work_dir
 if not self.builder.in_tree:
-args.append('O=build')
+if commit_upto is None:
+# In this case we are building in the original source
+# directory (i.e. the current directory where buildman
+# is invoked. The output directory is set to this
+# thread's selected work directory.
+#
+# Symlinks can confuse U-Boot's Makefile since
+# we may use '..' in our path, so remove them.
+work_dir = os.path.realpath(work_dir)
+args.append('O=%s/build' % work_dir)
+cwd = None
+else:
+args.append('O=build')
 args.append('-s')
 if self.builder.num_jobs is not None:
 args.extend(['-j', str(self.builder.num_jobs)])
@@ -272,14 +285,14 @@ class BuilderThread(threading.Thread):
 
 # If we need to reconfigure, do that now
 if do_config:
-result = self.Make(commit, brd, 'distclean', work_dir,
+result = self.Make(commit, brd, 'distclean', cwd,
 'distclean', *args, env=env)
-result = self.Make(commit, brd, 'config', work_dir,
+result = self.Make(commit, brd, 'config', cwd,
 *(args + config_args), env=env)
 config_out = result.combined
 do_config = False   # No need to configure next time
 if result.return_code == 0:
-result = self.Make(commit, brd, 'build', work_dir, *args,
+result = self.Make(commit, brd, 'build', cwd, *args,
 env=env)
 result.stdout = config_out + result.stdout
 else:
@@ -478,8 +491,10 @@ class BuilderThread(threading.Thread):
 self.builder.out_queue.put(result)
 else:
 # Just build the currently checked-out build
-result = self.RunCommit(None, True)
-result.commit_upto = self.builder.upto
+result, request_config = self.RunCommit(None, brd, work_dir, True,
+True, self.builder.force_build_failures)
+result.commit_upto = 0
+self._WriteResult(result, job.keep_outputs)
 self.builder.out_queue.put(result)
 
 def run(self):
@@ -491,12 +506,16 @@ class BuilderThread(threading.Thread):
 alive = True
 while True:
 job = self.builder.queue.get()
+if self.builder.active and alive:
+self.RunJob(job)
+'''
 try:
 if self.builder.active and alive:
 self.RunJob(job)
 except Exception as err:
 alive = False
 print err
+'''
 self.builder.queue.task_done()
 
 
@@ -763,10 +782,13 @@ class Builder:
 Args:
 commit_upto: Commit number to use 

[U-Boot] [PATCH v6 19/20] patman: Remove the -a option

2014-08-09 Thread Simon Glass
It seems that this is no longer needed, since checkpatch.pl will catch
whitespace problems in patches. Also the option is not widely used, so
it seems safe to just remove it.

Suggested-by: Masahiro Yamada yamad...@jp.panasonic.com
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
- Minor changes to the text

 tools/patman/gitutil.py | 88 -
 tools/patman/patman.py  |  7 
 2 files changed, 95 deletions(-)

diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 77cf73f..029ad48 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -213,94 +213,6 @@ def CreatePatches(start, count, series):
 else:
return None, files
 
-def ApplyPatch(verbose, fname):
-Apply a patch with git am to test it
-
-TODO: Convert these to use command, with stderr option
-
-Args:
-fname: filename of patch file to apply
-
-col = terminal.Colour()
-cmd = ['git', 'am', fname]
-pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE,
-stderr=subprocess.PIPE)
-stdout, stderr = pipe.communicate()
-re_error = re.compile('^error: patch failed: (.+):(\d+)')
-for line in stderr.splitlines():
-if verbose:
-print line
-match = re_error.match(line)
-if match:
-print checkpatch.GetWarningMsg(col, 'warning', match.group(1),
-   int(match.group(2)), 'Patch failed')
-return pipe.returncode == 0, stdout
-
-def ApplyPatches(verbose, args, start_point):
-Apply the patches with git am to make sure all is well
-
-Args:
-verbose: Print out 'git am' output verbatim
-args: List of patch files to apply
-start_point: Number of commits back from HEAD to start applying.
-Normally this is len(args), but it can be larger if a start
-offset was given.
-
-error_count = 0
-col = terminal.Colour()
-
-# Figure out our current position
-cmd = ['git', 'name-rev', 'HEAD', '--name-only']
-pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE)
-stdout, stderr = pipe.communicate()
-if pipe.returncode:
-str = 'Could not find current commit name'
-print col.Colour(col.RED, str)
-print stdout
-return False
-old_head = stdout.splitlines()[0]
-if old_head == 'undefined':
-str = Invalid HEAD '%s' % stdout.strip()
-print col.Colour(col.RED, str)
-return False
-
-# Checkout the required start point
-cmd = ['git', 'checkout', 'HEAD~%d' % start_point]
-pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE,
-stderr=subprocess.PIPE)
-stdout, stderr = pipe.communicate()
-if pipe.returncode:
-str = 'Could not move to commit before patch series'
-print col.Colour(col.RED, str)
-print stdout, stderr
-return False
-
-# Apply all the patches
-for fname in args:
-ok, stdout = ApplyPatch(verbose, fname)
-if not ok:
-print col.Colour(col.RED, 'git am returned errors for %s: will '
-'skip this patch' % fname)
-if verbose:
-print stdout
-error_count += 1
-cmd = ['git', 'am', '--skip']
-pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE)
-stdout, stderr = pipe.communicate()
-if pipe.returncode != 0:
-print col.Colour(col.RED, 'Unable to skip patch! Aborting...')
-print stdout
-break
-
-# Return to our previous position
-cmd = ['git', 'checkout', old_head]
-pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)
-stdout, stderr = pipe.communicate()
-if pipe.returncode:
-print col.Colour(col.RED, 'Could not move back to head commit')
-print stdout, stderr
-return error_count == 0
-
 def BuildEmailList(in_list, tag=None, alias=None, raise_on_error=True):
 Build a list of email addresses based on an input list.
 
diff --git a/tools/patman/patman.py b/tools/patman/patman.py
index 8fdedda..8b89765 100755
--- a/tools/patman/patman.py
+++ b/tools/patman/patman.py
@@ -25,9 +25,6 @@ import test
 
 
 parser = OptionParser()
-parser.add_option('-a', '--no-apply', action='store_false',
-  dest='apply_patches', default=True,
-  help=Don't test-apply patches with git am)
 parser.add_option('-H', '--full-help', action='store_true', dest='full_help',
default=False, help='Display the README file')
 parser.add_option('-c', '--count', dest='count', type='int',
@@ -144,10 +141,6 @@ else:
 ok = checkpatch.CheckPatches(options.verbose, args)
 else:
 ok = True
-if options.apply_patches:
-if not gitutil.ApplyPatches(options.verbose, args,
-   

[U-Boot] [PATCH v6 15/20] patman: Only use git's --no-decorate when available

2014-08-09 Thread Simon Glass
Older versions of git (e.g. Ubuntu 10.04) do not support this flag. By
default they do not decorate. So only enable this flag when supported.

Suggested-by: Tom Rini tr...@ti.com
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v6: None
Changes in v5:
- Update test for output options

Changes in v4: None
Changes in v3:
- Add new patch to refactor output options

Changes in v2: None

 tools/patman/gitutil.py | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index a8b0a1a..735c8dd 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -14,6 +14,9 @@ import terminal
 import checkpatch
 import settings
 
+# True to use --no-decorate - we check this in Setup()
+use_no_decorate = True
+
 def LogCmd(commit_range, git_dir=None, oneline=False, reverse=False,
count=None):
 Create a command to perform a 'git log'
@@ -33,7 +36,8 @@ def LogCmd(commit_range, git_dir=None, oneline=False, 
reverse=False,
 cmd += ['log', '--no-color']
 if oneline:
 cmd.append('--oneline')
-cmd.append('--no-decorate')
+if use_no_decorate:
+cmd.append('--no-decorate')
 if count is not None:
 cmd.append('-n%d' % count)
 if commit_range:
@@ -566,6 +570,9 @@ def Setup():
 alias_fname = GetAliasFile()
 if alias_fname:
 settings.ReadGitAliases(alias_fname)
+cmd = LogCmd(None, count=0)
+use_no_decorate = (command.RunPipe([cmd], raise_on_error=False)
+   .return_code == 0)
 
 def GetHead():
 Get the hash of the current HEAD
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v6 01/20] buildman: Fix a few typos

2014-08-09 Thread Simon Glass
There are several typos in the README - fix them.

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

Changes in v6: None
Changes in v5:
- Drop patch to search for *cc instead of *gcc for the compiler

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

 tools/buildman/README | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/buildman/README b/tools/buildman/README
index c30c1d4..a5d181c 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -71,8 +71,8 @@ directory. It clones this repository into a copy for each 
thread, and the
 threads do not affect the state of your git repository. Any checkouts done
 by the thread affect only the working directory for that thread.
 
-Buildman automatically selects the correct toolchain for each board. You
-must supply suitable toolchains, but buildman takes care of selecting the
+Buildman automatically selects the correct tool chain for each board. You
+must supply suitable tool chains, but buildman takes care of selecting the
 right one.
 
 Buildman always builds a branch, and always builds the upstream commit as
@@ -287,7 +287,7 @@ If it can't detect the upstream branch, try checking out 
the branch, and
 doing something like 'git branch --set-upstream branch upstream/master'
 or something similar.
 
-As an exmmple:
+As an example:
 
 Dry run, so not doing much. But I would do this:
 
@@ -339,7 +339,7 @@ Building 18 commits for 1059 boards (4 threads, 1 job per 
thread)
   528   36  124 /19062  1:13:30  : SIMPC8313_SP
 
 This means that it is building 19062 board/commit combinations. So far it
-has managed to succesfully build 528. Another 36 have built with warnings,
+has managed to successfully build 528. Another 36 have built with warnings,
 and 124 more didn't build at all. Buildman expects to complete the process
 in an hour and 15 minutes. Use this time to buy a faster computer.
 
@@ -413,7 +413,7 @@ again.
 
 At commit 16, the error moves - you can see that the old error at line 120
 is fixed, but there is a new one at line 126. This is probably only because
-we added some code and moved the broken line futher down the file.
+we added some code and moved the broken line father down the file.
 
 If many boards have the same error, then -e will display the error only
 once. This makes the output as concise as possible.
@@ -491,7 +491,7 @@ You can also use -d to see a detailed size breakdown for 
each board. This
 list is sorted in order from largest growth to largest reduction.
 
 It is possible to go a little further with the -B option (--bloat). This
-shows where U-Boot has bloted, breaking the size change down to the function
+shows where U-Boot has bloated, breaking the size change down to the function
 level. Example output is below:
 
 $ ./tools/buildman/buildman -b us-mem4 -sSdB
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v6 16/20] patman: buildman: Correct spelling of 'colour'

2014-08-09 Thread Simon Glass
This code came from another project. Correct the spelling now that it is
in U-Boot.

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

Changes in v6: None
Changes in v5: None
Changes in v4:
- Fix typo in commit message

Changes in v3:
- Add new patch to sort command line options

Changes in v2: None

 tools/buildman/builder.py  | 46 +-
 tools/buildman/control.py  | 12 +--
 tools/patman/checkpatch.py | 18 -
 tools/patman/gitutil.py| 22 ++--
 tools/patman/patman.py |  4 ++--
 tools/patman/series.py | 14 ++---
 tools/patman/terminal.py   | 50 +++---
 7 files changed, 83 insertions(+), 83 deletions(-)

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index d5b8454..a65d1c3 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -105,7 +105,7 @@ class Builder:
 base_dir: Base directory to use for builder
 checkout: True to check out source, False to skip that step.
 This is used for testing.
-col: terminal.Color() object
+col: terminal.Colour() object
 count: Number of commits to build
 do_make: Method to call to invoke Make
 fail: Number of builds that failed due to error
@@ -212,7 +212,7 @@ class Builder:
 self.in_tree = False
 self._error_lines = 0
 
-self.col = terminal.Color()
+self.col = terminal.Colour()
 
 self.queue = Queue.Queue()
 self.out_queue = Queue.Queue()
@@ -325,7 +325,7 @@ class Builder:
 result: A CommandResult object, which indicates the result for
 a single build
 
-col = terminal.Color()
+col = terminal.Colour()
 if result:
 target = result.brd.target
 
@@ -353,9 +353,9 @@ class Builder:
 
 # Display separate counts for ok, warned and fail
 ok = self.upto - self.warned - self.fail
-line = '\r' + self.col.Color(self.col.GREEN, '%5d' % ok)
-line += self.col.Color(self.col.YELLOW, '%5d' % self.warned)
-line += self.col.Color(self.col.RED, '%5d' % self.fail)
+line = '\r' + self.col.Colour(self.col.GREEN, '%5d' % ok)
+line += self.col.Colour(self.col.YELLOW, '%5d' % self.warned)
+line += self.col.Colour(self.col.RED, '%5d' % self.fail)
 
 name = ' /%-5d  ' % self.count
 
@@ -583,7 +583,7 @@ class Builder:
 err_lines_summary.append(err.rstrip())
 return board_dict, err_lines_summary
 
-def AddOutcome(self, board_dict, arch_list, changes, char, color):
+def AddOutcome(self, board_dict, arch_list, changes, char, colour):
 Add an output to our list of outcomes for each architecture
 
 This simple function adds failing boards (changes) to the
@@ -595,7 +595,7 @@ class Builder:
  arch_list: Dict keyed by arch name. Value is a string containing
 a list of board names which failed for that arch.
  changes: List of boards to add to arch_list
- color: terminal.Colour object
+ colour: terminal.Colour object
 
 done_arch = {}
 for target in changes:
@@ -603,9 +603,9 @@ class Builder:
 arch = board_dict[target].arch
 else:
 arch = 'unknown'
-str = self.col.Color(color, ' ' + target)
+str = self.col.Colour(colour, ' ' + target)
 if not arch in done_arch:
-str = self.col.Color(color, char) + '  ' + str
+str = self.col.Colour(colour, char) + '  ' + str
 done_arch[arch] = True
 if not arch in arch_list:
 arch_list[arch] = str
@@ -614,10 +614,10 @@ class Builder:
 
 
 def ColourNum(self, num):
-color = self.col.RED if num  0 else self.col.GREEN
+colour = self.col.RED if num  0 else self.col.GREEN
 if num == 0:
 return '0'
-return self.col.Color(color, str(num))
+return self.col.Colour(colour, str(num))
 
 def ResetResultSummary(self, board_selected):
 Reset the results summary ready for use.
@@ -674,15 +674,15 @@ class Builder:
 args = [self.ColourNum(x) for x in args]
 indent = ' ' * 15
 print ('%s%s: add: %s/%s, grow: %s/%s bytes: %s/%s (%s)' %
-   tuple([indent, self.col.Color(self.col.YELLOW, fname)] + args))
+   tuple([indent, self.col.Colour(self.col.YELLOW, fname)] + args))
 print '%s  %-38s %7s %7s %+7s' % (indent, 'function', 'old', 'new',
 'delta')
 for diff, name in delta:
 if diff:
-color = self.col.RED if diff  0 else self.col.GREEN
+colour = self.col.RED if diff  0 else self.col.GREEN
 msg = '%s  %-38s %7s %7s %+7d' % (indent, name,
   

[U-Boot] [PATCH v6 20/20] RFC: Deprecate MAKEALL

2014-08-09 Thread Simon Glass
Since buildman now includes most of the features of MAKEALL it is probably
time to talk about deprecating MAKEALL.

Comments welcome.

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

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
- Add new patch to fix existing typos

 MAKEALL | 4 
 1 file changed, 4 insertions(+)

diff --git a/MAKEALL b/MAKEALL
index 929fe88..dbbf74b 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -60,6 +60,10 @@ usage()
exit ${ret}
 }
 
+echo ** Note: MAKEALL is deprecated - please use buildman instead
+echo ** See tools/buildman/README for details
+echo
+
 SHORT_OPTS=ha:c:v:s:b:lmMCnr
 
LONG_OPTS=help,arch:,cpu:,vendor:,soc:,board:,list,maintainers,mails,check,continue,rebuild-errors
 
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v6 08/20] buildman: Remove unused non-incremental build method code

2014-08-09 Thread Simon Glass
The non-incremental build method is no longer used, so remove it.

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

Changes in v6:
- Add new patch to implement -c option

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

 tools/buildman/builder.py | 34 --
 tools/buildman/test.py|  1 -
 2 files changed, 35 deletions(-)

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index dd7f5a4..22a24b1 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -955,40 +955,6 @@ class Builder:
 self.upto = self.warned = self.fail = 0
 self._timestamps = collections.deque()
 
-def BuildBoardsForCommit(self, board_selected, keep_outputs):
-Build all boards for a single commit
-self.SetupBuild(board_selected)
-self.count = len(board_selected)
-for brd in board_selected.itervalues():
-job = BuilderJob()
-job.board = brd
-job.commits = None
-job.keep_outputs = keep_outputs
-self.queue.put(brd)
-
-self.queue.join()
-self.out_queue.join()
-print
-self.ClearLine(0)
-
-def BuildCommits(self, commits, board_selected, show_errors, keep_outputs):
-Build all boards for all commits (non-incremental)
-self.commit_count = len(commits)
-
-self.ResetResultSummary(board_selected)
-for self.commit_upto in range(self.commit_count):
-self.SelectCommit(commits[self.commit_upto])
-self.SelectOutputDir()
-builderthread.Mkdir(self.output_dir)
-
-self.BuildBoardsForCommit(board_selected, keep_outputs)
-board_dict, err_lines = self.GetResultSummary()
-self.PrintResultSummary(board_selected, board_dict,
-err_lines if show_errors else [])
-
-if self.already_done:
-print '%d builds already done' % self.already_done
-
 def GetThreadDir(self, thread_num):
 Get the directory path to the working dir for a thread.
 
diff --git a/tools/buildman/test.py b/tools/buildman/test.py
index a724d83..502c9b4 100644
--- a/tools/buildman/test.py
+++ b/tools/buildman/test.py
@@ -136,7 +136,6 @@ class TestBuild(unittest.TestCase):
 build.do_make = self.Make
 board_selected = self.boards.GetSelectedDict()
 
-#build.BuildCommits(self.commits, board_selected, False)
 build.BuildBoards(self.commits, board_selected, keep_outputs=False,
   verbose=False)
 build.SetDisplayOptions(show_errors=True);
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v6 06/20] buildman: Refactor output options

2014-08-09 Thread Simon Glass
We need the output options to be available in several places. It's a pain
to pass them into each function. Make them properties of the builder and
add a single function to set them up. At the same time, add a function which
produces summary output using these options.

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

Changes in v6:
- Add new patch to avoid using --no-decorate when not available

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

 tools/buildman/builder.py | 46 +++---
 tools/buildman/control.py |  8 
 tools/buildman/test.py|  6 +++---
 3 files changed, 34 insertions(+), 26 deletions(-)

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index e2da0eb..a6c43e0 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -235,6 +235,20 @@ class Builder:
 for t in self.threads:
 del t
 
+def SetDisplayOptions(self, show_errors=False, show_sizes=False,
+  show_detail=False, show_bloat=False):
+Setup display options for the builder.
+
+show_errors: True to show summarised error/warning info
+show_sizes: Show size deltas
+show_detail: Show detail for each board
+show_bloat: Show detail for each function
+
+self._show_errors = show_errors
+self._show_sizes = show_sizes
+self._show_detail = show_detail
+self._show_bloat = show_bloat
+
 def _AddTimestamp(self):
 Add a new timestamp to the list and record the build period.
 
@@ -891,9 +905,18 @@ class Builder:
 print Boards not built (%d): %s % (len(not_built),
 ', '.join(not_built))
 
+def ProduceResultSummary(self, commit_upto, commits, board_selected):
+board_dict, err_lines = self.GetResultSummary(board_selected,
+commit_upto, read_func_sizes=self._show_bloat)
+if commits:
+msg = '%02d: %s' % (commit_upto + 1,
+commits[commit_upto].subject)
+print self.col.Color(self.col.BLUE, msg)
+self.PrintResultSummary(board_selected, board_dict,
+err_lines if self._show_errors else [],
+self._show_sizes, self._show_detail, self._show_bloat)
 
-def ShowSummary(self, commits, board_selected, show_errors, show_sizes,
-show_detail, show_bloat):
+def ShowSummary(self, commits, board_selected):
 Show a build summary for U-Boot for a given board list.
 
 Reset the result summary, then repeatedly call GetResultSummary on
@@ -902,27 +925,13 @@ class Builder:
 Args:
 commit: Commit objects to summarise
 board_selected: Dict containing boards to summarise
-show_errors: Show errors that occured
-show_sizes: Show size deltas
-show_detail: Show detail for each board
-show_bloat: Show detail for each function
 
 self.commit_count = len(commits) if commits else 1
 self.commits = commits
 self.ResetResultSummary(board_selected)
 
 for commit_upto in range(0, self.commit_count, self._step):
-board_dict, err_lines = self.GetResultSummary(board_selected,
-commit_upto, read_func_sizes=show_bloat)
-if commits:
-msg = '%02d: %s' % (commit_upto + 1,
-commits[commit_upto].subject)
-else:
-msg = 'current'
-print self.col.Color(self.col.BLUE, msg)
-self.PrintResultSummary(board_selected, board_dict,
-err_lines if show_errors else [], show_sizes, show_detail,
-show_bloat)
+self.ProduceResultSummary(commit_upto, commits, board_selected)
 
 
 def SetupBuild(self, board_selected, commits):
@@ -1032,14 +1041,13 @@ class Builder:
 if dirname not in dir_list:
 shutil.rmtree(dirname)
 
-def BuildBoards(self, commits, board_selected, show_errors, keep_outputs):
+def BuildBoards(self, commits, board_selected, keep_outputs):
 Build all commits for a list of boards
 
 Args:
 commits: List of commits to be build, each a Commit object
 boards_selected: Dict of selected boards, key is target name,
 value is Board object
-show_errors: True to show summarised error/warning info
 keep_outputs: True to save build output files
 
 self.commit_count = len(commits) if commits else 1
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 12a9699..d8fa74b 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -207,13 +207,13 @@ def DoBuildman(options, args):
 print GetActionSummary(options.summary, commits, board_selected,

[U-Boot] [PATCH v6 09/20] buildman: Add an option to specify the buildman config file

2014-08-09 Thread Simon Glass
Add a new --config-file option (-G) to specify a different configuration
file from the default ~/.buildman.

Reported-by: Tom Rini tr...@ti.com
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v6: None
Changes in v5:
- Add new patch to add an 'and' operator for board selection

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

 tools/buildman/buildman.py | 2 ++
 tools/buildman/control.py  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py
index f32557f..6ca8dc6 100755
--- a/tools/buildman/buildman.py
+++ b/tools/buildman/buildman.py
@@ -83,6 +83,8 @@ parser.add_option('-F', '--force-build-failures', 
dest='force_build_failures',
help='Force build of previously-failed build')
 parser.add_option('-g', '--git', type='string',
help='Git repo containing branch to build', default='.')
+parser.add_option('-G', '--config-file', type='string',
+   help='Path to buildman config file', default='')
 parser.add_option('-H', '--full-help', action='store_true', dest='full_help',
default=False, help='Display the README file')
 parser.add_option('-i', '--in-tree', dest='in_tree',
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index cc8593f..0c9e2cb 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -86,7 +86,7 @@ def DoBuildman(options, args):
 
 gitutil.Setup()
 
-bsettings.Setup()
+bsettings.Setup(options.config_file)
 options.git_dir = os.path.join(options.git, '.git')
 
 toolchains = toolchain.Toolchains()
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v6 14/20] patman: Move the 'git log' command into a function

2014-08-09 Thread Simon Glass
Move the code that builds a 'git log' command into a function so we can more
easily adjust it.

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

Changes in v6: None
Changes in v5:
- Update test for verbose option

Changes in v4: None
Changes in v3:
- Add new patch to add a verbose option

Changes in v2: None

 tools/patman/gitutil.py | 33 -
 tools/patman/patchstream.py | 11 +++
 2 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 65754f5..a8b0a1a 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -14,6 +14,31 @@ import terminal
 import checkpatch
 import settings
 
+def LogCmd(commit_range, git_dir=None, oneline=False, reverse=False,
+   count=None):
+Create a command to perform a 'git log'
+
+Args:
+commit_range: Range expression to use for log, None for none
+git_dir: Path to git repositiory (None to use default)
+oneline: True to use --oneline, else False
+reverse: True to reverse the log (--reverse)
+count: Number of commits to list, or None for no limit
+Return:
+List containing command and arguments to run
+
+cmd = ['git']
+if git_dir:
+cmd += ['--git-dir', git_dir]
+cmd += ['log', '--no-color']
+if oneline:
+cmd.append('--oneline')
+cmd.append('--no-decorate')
+if count is not None:
+cmd.append('-n%d' % count)
+if commit_range:
+cmd.append(commit_range)
+return cmd
 
 def CountCommitsToBranch():
 Returns number of commits between HEAD and the tracking branch.
@@ -24,8 +49,7 @@ def CountCommitsToBranch():
 Return:
 Number of patches that exist on top of the branch
 
-pipe = [['git', 'log', '--no-color', '--oneline', '--no-decorate',
- '@{upstream}..'],
+pipe = [LogCmd('@{upstream}..', oneline=True),
 ['wc', '-l']]
 stdout = command.RunPipe(pipe, capture=True, oneline=True).stdout
 patch_count = int(stdout)
@@ -87,8 +111,7 @@ def CountCommitsInBranch(git_dir, branch, 
include_upstream=False):
 range_expr = GetRangeInBranch(git_dir, branch, include_upstream)
 if not range_expr:
 return None
-pipe = [['git', '--git-dir', git_dir, 'log', '--oneline', '--no-decorate',
- range_expr],
+pipe = [LogCmd(range_expr, git_dir=git_dir, oneline=True),
 ['wc', '-l']]
 result = command.RunPipe(pipe, capture=True, oneline=True)
 patch_count = int(result.stdout)
@@ -102,7 +125,7 @@ def CountCommits(commit_range):
 Return:
 Number of patches that exist on top of the branch
 
-pipe = [['git', 'log', '--oneline', '--no-decorate', commit_range],
+pipe = [LogCmd(commit_range, oneline=True),
 ['wc', '-l']]
 stdout = command.RunPipe(pipe, capture=True, oneline=True).stdout
 patch_count = int(stdout)
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index 3228719..0040468 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -379,14 +379,9 @@ def GetMetaDataForList(commit_range, git_dir=None, 
count=None,
 Returns:
 A Series object containing information about the commits.
 
-params = ['git', 'log', '--no-color', '--reverse', '--no-decorate',
-commit_range]
-if count is not None:
-params[2:2] = ['-n%d' % count]
-if git_dir:
-params[1:1] = ['--git-dir', git_dir]
-pipe = [params]
-stdout = command.RunPipe(pipe, capture=True).stdout
+params = gitutil.LogCmd(commit_range,reverse=True, count=count,
+git_dir=git_dir)
+stdout = command.RunPipe([params], capture=True).stdout
 ps = PatchStream(series, is_log=True)
 for line in stdout.splitlines():
 ps.ProcessLine(line)
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v6 13/20] buildman: Allow selection of the number of commits to build

2014-08-09 Thread Simon Glass
It is useful to be able to build only some of the commits in a branch. Add
support for the -c option to allow this. It was previously parsed by
buildman but not implemented.

Suggested-by: York Sun york...@freescale.com
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v6: None
Changes in v5: None
Changes in v4:
- Add new patch to remove unused non-incremental build method code

Changes in v3: None
Changes in v2: None

 tools/buildman/control.py | 31 +++
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 0c9e2cb..98a07a2 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -144,18 +144,25 @@ def DoBuildman(options, args):
 # a merge commit (it will list all the commits that form part of the
 # merge)
 if options.branch:
-range_expr = gitutil.GetRangeInBranch(options.git_dir, options.branch)
-upstream_commit = gitutil.GetUpstream(options.git_dir, options.branch)
-series = patchstream.GetMetaDataForList(upstream_commit,
-options.git_dir, 1)
-
-# Conflicting tags are not a problem for buildman, since it does not
-# use them. For example, Series-version is not useful for buildman. On
-# the other hand conflicting tags will cause an error. So allow later
-# tags to overwrite earlier ones.
-series.allow_overwrite = True
-series = patchstream.GetMetaDataForList(range_expr, options.git_dir, 
None,
-series)
+if count == -1:
+range_expr = gitutil.GetRangeInBranch(options.git_dir,
+  options.branch)
+upstream_commit = gitutil.GetUpstream(options.git_dir,
+  options.branch)
+series = patchstream.GetMetaDataForList(upstream_commit,
+options.git_dir, 1)
+
+# Conflicting tags are not a problem for buildman, since it does
+# not use them. For example, Series-version is not useful for
+# buildman. On the other hand conflicting tags will cause an
+# error. So allow later tags to overwrite earlier ones.
+series.allow_overwrite = True
+series = patchstream.GetMetaDataForList(range_expr,
+  options.git_dir, None, series)
+else:
+# Honour the count
+series = patchstream.GetMetaDataForList(options.branch,
+options.git_dir, count)
 else:
 series = None
 options.verbose = True
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v6 02/20] buildman: Add some notes about moving from MAKEALL

2014-08-09 Thread Simon Glass
For those used to MAKEALL, buildman seems strange. Add some notes to ease
the transition.

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

Changes in v6:
- Add new patch to remove patman's -a option

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

 tools/buildman/README | 92 +++
 1 file changed, 92 insertions(+)

diff --git a/tools/buildman/README b/tools/buildman/README
index a5d181c..1c919af 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -3,6 +3,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+(Please read 'How to change from MAKEALL' if you are used to that tool)
+
 What is this?
 =
 
@@ -663,6 +665,96 @@ Other options
 Buildman has various other command line options. Try --help to see them.
 
 
+How to change from MAKEALL
+==
+
+Buildman includes most of the features of MAKEALL and is generally faster
+and easier to use. In particular it builds entire branches: if a particular
+commit introduces an error in a particular board, buildman can easily show
+you this, even if a later commit fixes that error.
+
+The reasons to deprecate MAKEALL are:
+- We don't want to maintain two build systems
+- Buildman is typically faster
+- Buildman has a lot more features
+
+But still, many people will be sad to lose MAKEALL. If you are used to
+MAKEALL, here are a few pointers.
+
+First you need to set up your tool chains - see the 'Setting up' section
+for details. Once you have your required toolchain(s) detected then you are
+ready to go.
+
+Buildman works on entire branches, so the normal use is:
+
+   ./tools/buildman/buildman -b branch_name list of things to build
+
+followed by (afterwards, or perhaps concurrently in another terminal):
+
+   ./tools/buildman/buildman -b branch_name -s list of things to build
+
+to see the results of the build. Rather than showing you all the output,
+buildman just shows a summary, with red indicating that a commit introduced
+an error and green indicating that a commit fixed an error. Use the -e
+flag to see the full errors.
+
+You don't need to stick around on that branch while buildman is running. It
+checks out its own copy of the source code, so you can change branches,
+add commits, etc. without affecting the build in progress.
+
+The list of things to build can include board names, architectures or the
+like. There are no flags to disambiguate since ambiguities are rare. Using
+the examples from MAKEALL:
+
+Examples:
+  - build all Power Architecture boards:
+  MAKEALL -a powerpc
+  MAKEALL --arch powerpc
+  MAKEALL powerpc
+  ** buildman -b branch powerpc
+  - build all PowerPC boards manufactured by vendor esd:
+  MAKEALL -a powerpc -v esd
+  ** buildman -b branch esd
+  - build all PowerPC boards manufactured either by keymile or siemens:
+  MAKEALL -a powerpc -v keymile -v siemens
+  ** buildman -b branch keymile siemens
+  - build all Freescale boards with MPC83xx CPUs, plus all 4xx boards:
+  MAKEALL -c mpc83xx -v freescale 4xx
+  ** buildman -b branch mpc83xx freescale 4xx
+
+Buildman automatically tries to use all the CPUs in your machine. If you
+are building a lot of boards it will use one thread for every CPU core
+it detects in your machine. This is like MAKEALL's BUILD_NBUILDS option.
+You can use the -T flag to change the number of threads. If you are only
+building a few boards, buildman will automatically run make with the -j
+flag to increase the number of concurrent make tasks. It isn't normally
+that helpful to fiddle with this option, but if you use the BUILD_NCPUS
+option in MAKEALL then -j is the equivalent in buildman.
+
+Buildman puts its output in ../branch_name by default but you can change
+this with the -o option. Buildman normally does out-of-tree builds: use -i
+to disable that if you really want to. But be careful that once you have
+used -i you pollute buildman's copies of the source tree, and you will need
+to remove the build directory (normally ../branch_name) to run buildman
+in normal mode (without -i).
+
+Buildman doesn't keep the output result normally, but use the -k option to
+do this.
+
+Please read 'Theory of Operation' a few times as it will make a lot of
+things clearer.
+
+Some options you might like are:
+
+   -B shows which functions are growing/shrinking in which commit - great
+for finding code bloat.
+   -S shows image sizes for each commit (just an overall summary)
+   -u shows boards that you haven't built yet
+   --step 0 will build just the upstream commit and the last commit of your
+branch. This is often a quick sanity check that your branch doesn't
+break anything. But note this does not check bisectability!
+
+
 TODO
 
 
-- 
2.0.0.526.g5318336

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


[U-Boot] [PATCH v6 12/20] buildman: Introduce an 'and' operator for board selection

2014-08-09 Thread Simon Glass
Currently buildman allows a list of boards to build to be specified on the
command line. The list can include specific board names, architecture, SOC
and so on.

At present the list of boards is dealt with in an 'OR' fashion, and there
is no way to specify something like 'arm  freescale', meaning boards with
ARM architecture but only those made by Freescale. This would exclude the
PowerPC boards made by Freescale.

Support an '' operator on the command line to permit this. Ensure that
arguments can be specified in a single string to permit easy shell quoting.

Suggested-by: York Sun york...@freescale.com
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v6: None
Changes in v5: None
Changes in v4:
- Add new patch to allow the config file to be specified

Changes in v3: None
Changes in v2: None

 tools/buildman/README   |   9 +++
 tools/buildman/board.py | 144 ++--
 tools/buildman/test.py  |  48 
 3 files changed, 184 insertions(+), 17 deletions(-)

diff --git a/tools/buildman/README b/tools/buildman/README
index aaf0a10..d4e8404 100644
--- a/tools/buildman/README
+++ b/tools/buildman/README
@@ -108,6 +108,15 @@ behaviour is a superset of exact or substring matching. 
Examples are:
 * '^tegra[23]0$' All boards with either Tegra20 or Tegra30 SoC
 * 'powerpc'  All PowerPC boards
 
+While the default is to OR the terms together, you can also make use of
+the '' operator to limit the selection:
+
+* 'freescale  arm sandbox'  All Freescale boards with ARM architecture,
+ plus sandbox
+
+It is convenient to use the -n option to see whaat will be built based on
+the subset given.
+
 Buildman does not store intermediate object files. It optionally copies
 the binary output into a directory when a build is successful. Size
 information is always recorded. It needs a fair bit of disk space to work,
diff --git a/tools/buildman/board.py b/tools/buildman/board.py
index 7bcc932..a333287 100644
--- a/tools/buildman/board.py
+++ b/tools/buildman/board.py
@@ -5,6 +5,72 @@
 
 import re
 
+class Expr:
+A single regular expression for matching boards to build
+
+def __init__(self, expr):
+Set up a new Expr object.
+
+Args:
+expr: String cotaining regular expression to store
+
+self._expr = expr
+self._re = re.compile(expr)
+
+def Matches(self, props):
+Check if any of the properties match the regular expression.
+
+Args:
+   props: List of properties to check
+Returns:
+   True if any of the properties match the regular expression
+
+for prop in props:
+if self._re.match(prop):
+return True
+return False
+
+def __str__(self):
+return self._expr
+
+class Term:
+A list of expressions each of which must match with properties.
+
+This provides a list of 'AND' expressions, meaning that each must
+match the board properties for that board to be built.
+
+def __init__(self):
+self._expr_list = []
+self._board_count = 0
+
+def AddExpr(self, expr):
+Add an Expr object to the list to check.
+
+Args:
+expr: New Expr object to add to the list of those that must
+  match for a board to be built.
+
+self._expr_list.append(Expr(expr))
+
+def __str__(self):
+Return some sort of useful string describing the term
+return ''.join([str(expr) for expr in self._expr_list])
+
+def Matches(self, props):
+Check if any of the properties match this term
+
+Each of the expressions in the term is checked. All must match.
+
+Args:
+   props: List of properties to check
+Returns:
+   True if all of the expressions in the Term match, else False
+
+for expr in self._expr_list:
+if not expr.Matches(props):
+return False
+return True
+
 class Board:
 A particular board that we can build
 def __init__(self, status, arch, cpu, soc, vendor, board_name, target, 
options):
@@ -124,6 +190,55 @@ class Boards:
 
 return [board.target for board in self._boards if board.build_it]
 
+def _BuildTerms(self, args):
+Convert command line arguments to a list of terms.
+
+This deals with parsing of the arguments. It handles the ''
+operator, which joins several expressions into a single Term.
+
+For example:
+['arm  freescale sandbox', 'tegra']
+
+will produce 3 Terms containing expressions as follows:
+arm, freescale
+sandbox
+tegra
+
+The first Term has two expressions, both of which must match for
+a board to be selected.
+
+Args:
+args: List of command line arguments
+Returns:
+A list of Term objects
+
+

Re: [U-Boot] [PATCH 1/3] config: introduce a generic $bootcmd

2014-08-09 Thread Tom Rini
On Sat, Aug 09, 2014 at 05:02:46PM +0200, Hans de Goede wrote:
 Hi,
 
 On 08/08/2014 06:00 PM, Stephen Warren wrote:
  On 08/07/2014 06:17 PM, Simon Glass wrote:
  Acked-by: Simon Glass s...@chromium.org
  
  For the list archive's record: Simon also replied to patch 2 with the same 
  ack, but somehow the CC list got dropped to only myself and TomW.
 
 I've a bunch of patches relying on this, is there anything stopping this
 from getting merged ?
 
 Reviewed-by: Hans de Goede hdego...@redhat.com

Mainly a bug I've just bisected and emailed Masahiro about that's
keeping me from building PowerPC on my bigger boxes so I'm having to do
it locally.  I'll be pushing it all soon.

-- 
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 v6 16/20] patman: buildman: Correct spelling of 'colour'

2014-08-09 Thread Fabio Estevam
Hi Simon,

On Sat, Aug 9, 2014 at 6:33 PM, Simon Glass s...@chromium.org wrote:
 This code came from another project. Correct the spelling now that it is
 in U-Boot.



 -col: terminal.Color() object
 +col: terminal.Colour() object

I thought that both forms were correct and that color is the
American way and colour the British one.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6 16/20] patman: buildman: Correct spelling of 'colour'

2014-08-09 Thread Simon Glass
Hi,

On 9 August 2014 16:01, Fabio Estevam feste...@gmail.com wrote:
 Hi Simon,

 On Sat, Aug 9, 2014 at 6:33 PM, Simon Glass s...@chromium.org wrote:
 This code came from another project. Correct the spelling now that it is
 in U-Boot.

 

 -col: terminal.Color() object
 +col: terminal.Colour() object

 I thought that both forms were correct and that color is the
 American way and colour the British one.

Yes, but U-Boot doesn't use American English as I understand it, so
might as well fix it since i'm making other changes in that file.

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


Re: [U-Boot] [PATCH v6 16/20] patman: buildman: Correct spelling of 'colour'

2014-08-09 Thread Fabio Estevam
On Sat, Aug 9, 2014 at 7:17 PM, Simon Glass s...@chromium.org wrote:
 Hi,

 On 9 August 2014 16:01, Fabio Estevam feste...@gmail.com wrote:
 Hi Simon,

 On Sat, Aug 9, 2014 at 6:33 PM, Simon Glass s...@chromium.org wrote:
 This code came from another project. Correct the spelling now that it is
 in U-Boot.

 

 -col: terminal.Color() object
 +col: terminal.Colour() object

 I thought that both forms were correct and that color is the
 American way and colour the British one.

 Yes, but U-Boot doesn't use American English as I understand it, so

I think it just depends on the code's author preference as both
formats are valid.

Doing a quick grep in U-boot source:

$ git grep color | wc -l
646
$ git grep colour | wc -l
43
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Add CONFIG_API to config_distribution

2014-08-09 Thread Jeroen Hofstee
Since the goal of the common include is to boot
many distros, also include the api to boot distro's
relying on the api, like GRUB / ubldr / vxWorks.

Jeroen Hofstee (2):
  api: fix build without CMD_NET support
  config_distro_defaults.h: add CONFIG_API

 api/api_net.c| 30 ++
 include/config_distro_defaults.h |  4 
 2 files changed, 34 insertions(+)

-- 
1.9.1

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


[U-Boot] [PATCH 1/2] api: fix build without CMD_NET support

2014-08-09 Thread Jeroen Hofstee
Provide stubs in case that no NET interface is supported.

Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
---
 api/api_net.c | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/api/api_net.c b/api/api_net.c
index 3f52d71..7b3805e 100644
--- a/api/api_net.c
+++ b/api/api_net.c
@@ -25,6 +25,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define errf(fmt, args...) do { printf(ERROR @ %s(): , __func__); 
printf(fmt, ##args); } while (0)
 
+#ifdef CONFIG_CMD_NET
 
 static int dev_valid_net(void *cookie)
 {
@@ -85,3 +86,32 @@ int dev_read_net(void *cookie, void *buf, int len)
 
return eth_receive(buf, len);
 }
+
+#else
+
+int dev_open_net(void *cookie)
+{
+   return API_ENODEV;
+}
+
+int dev_close_net(void *cookie)
+{
+   return API_ENODEV;
+}
+
+int dev_enum_net(struct device_info *di)
+{
+   return 0;
+}
+
+int dev_write_net(void *cookie, void *buf, int len)
+{
+   return API_ENODEV;
+}
+
+int dev_read_net(void *cookie, void *buf, int len)
+{
+   return API_ENODEV;
+}
+
+#endif
-- 
1.9.1

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


[U-Boot] [PATCH 2/2] config_distro_defaults.h: add CONFIG_API

2014-08-09 Thread Jeroen Hofstee
Grub, FreeBSD ubldr, vxworks etc depend on the API

Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl
---
 include/config_distro_defaults.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/include/config_distro_defaults.h b/include/config_distro_defaults.h
index 5d18a4b..b4f6f3c 100644
--- a/include/config_distro_defaults.h
+++ b/include/config_distro_defaults.h
@@ -53,4 +53,8 @@
 #define CONFIG_SUPPORT_RAW_INITRD
 #define CONFIG_SYS_HUSH_PARSER
 
+/* Grub, FreeBSD ubldr, vxworks etc depend on the API */
+#define CONFIG_API
+#define CONFIG_SYS_MMC_MAX_DEVICE  4
+
 #endif /* _CONFIG_CMD_DISTRO_DEFAULTS_H */
-- 
1.9.1

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


Re: [U-Boot] [PATCH v6 16/20] patman: buildman: Correct spelling of 'colour'

2014-08-09 Thread Simon Glass
Hi Fabio,

On 9 August 2014 16:29, Fabio Estevam feste...@gmail.com wrote:
 On Sat, Aug 9, 2014 at 7:17 PM, Simon Glass s...@chromium.org wrote:
 Hi,

 On 9 August 2014 16:01, Fabio Estevam feste...@gmail.com wrote:
 Hi Simon,

 On Sat, Aug 9, 2014 at 6:33 PM, Simon Glass s...@chromium.org wrote:
 This code came from another project. Correct the spelling now that it is
 in U-Boot.

 

 -col: terminal.Color() object
 +col: terminal.Colour() object

 I thought that both forms were correct and that color is the
 American way and colour the British one.

 Yes, but U-Boot doesn't use American English as I understand it, so

 I think it just depends on the code's author preference as both
 formats are valid.

 Doing a quick grep in U-boot source:

 $ git grep color | wc -l
 646
 $ git grep colour | wc -l
 43

Yes that may well be true :-)

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


Re: [U-Boot] [PATCH 1/3] config: introduce a generic $bootcmd

2014-08-09 Thread Jeroen Hofstee

Hi Hans,

On 09-08-14 17:02, Hans de Goede wrote:

Hi,

On 08/08/2014 06:00 PM, Stephen Warren wrote:

On 08/07/2014 06:17 PM, Simon Glass wrote:

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

For the list archive's record: Simon also replied to patch 2 with the same ack, 
but somehow the CC list got dropped to only myself and TomW.

I've a bunch of patches relying on this, is there anything stopping this
from getting merged ?

Reviewed-by: Hans de Goede hdego...@redhat.com



Is it not possible to have a uboot.src or something
checking for extlinux. This seems to scale badly if
we start to check for Grub, Ubldr, VxWorks etc.

Regards,
Jeroen

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


Re: [U-Boot] [PATCH 1/3] config: introduce a generic $bootcmd

2014-08-09 Thread Stephen Warren
On 08/09/2014 04:43 PM, Jeroen Hofstee wrote:
 On 09-08-14 17:02, Hans de Goede wrote:
 On 08/08/2014 06:00 PM, Stephen Warren wrote:
 On 08/07/2014 06:17 PM, Simon Glass wrote:
...
 Acked-by: Simon Glass s...@chromium.org

 For the list archive's record: Simon also replied to patch 2 with the
 same ack, but somehow the CC list got dropped to only myself and TomW.

 I've a bunch of patches relying on this, is there anything stopping this
 from getting merged ?

 Reviewed-by: Hans de Goede hdego...@redhat.com
 
 Is it not possible to have a uboot.src or something
 checking for extlinux. This seems to scale badly if
 we start to check for Grub, Ubldr, VxWorks etc.

The entire point of this series is to prevent distros from having to
install bootloader-specific boot configuration files. As such, relying
exclusively on boot.scr wouldn't be useful.

If we need to support other OSs, I think it'd be best to extend
extlinux.conf to allow it to support booting OSs besides Linux.

FWIW, if extlinux.conf isn't found on the media, this patch does fall
back to searching for boot.scr (a uImage of a U-Boot script) so it's
certainly possible to make custom things happen if you want.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6 16/20] patman: buildman: Correct spelling of 'colour'

2014-08-09 Thread York Sun

On 8/9/14 3:34 PM, Simon Glass s...@chromium.org wrote:

Hi Fabio,

On 9 August 2014 16:29, Fabio Estevam feste...@gmail.com wrote:
 On Sat, Aug 9, 2014 at 7:17 PM, Simon Glass s...@chromium.org wrote:
 Hi,

 On 9 August 2014 16:01, Fabio Estevam feste...@gmail.com wrote:
 Hi Simon,

 On Sat, Aug 9, 2014 at 6:33 PM, Simon Glass s...@chromium.org wrote:
 This code came from another project. Correct the spelling now that
it is
 in U-Boot.

 

 -col: terminal.Color() object
 +col: terminal.Colour() object

 I thought that both forms were correct and that color is the
 American way and colour the British one.

 Yes, but U-Boot doesn't use American English as I understand it, so

 I think it just depends on the code's author preference as both
 formats are valid.

 Doing a quick grep in U-boot source:

 $ git grep color | wc -l
 646
 $ git grep colour | wc -l
 43

Yes that may well be true :-)

I am not bothered by either spelling. But I hate my computer automatically
corrects it.

York

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