Re: [U-Boot] [PATCH] ns16550: allow UART address to be set dynamically

2012-12-15 Thread Graeme Russ
Hi Wolfgang,

On Dec 15, 2012 6:30 PM, Wolfgang Denk w...@denx.de wrote:

 Dear Graeme Russ,

 In message 50cbd313.60...@gmail.com you wrote:
 
  I can give you an example - Remote Telemetry Units (RTUs). They usually
  have a number of serial ports. The number of ports may vary based on the
  sub-model. Some ports may be RS-232, some may be RS-485 or RS-422.
  Depending on what additional devices you want to communicate with, you
may
  need to use the 'console/diag' port to connect to a real device. So what
  you want to do is route console to another port (if available) or even
  netconsole.

 Netconsole is always an option, and I think we also support switching
 to other serial ports here and there (after relocation, that is).

 But if you need console output before relocation (i. e. during
 debugging), then I do not see why we cannot demand that the console
 port is statically configured, and that you need corectly configured
 images to have an early working console.

I have seen situations where console output by the bootloader messes up
attached serial devices hence effectively dropping the serial port count by
one. Pre-console buffer helps a lot (no console output until we know where
to send it to). But that kills early debug.


  I do get your point of view. But I think a combination of storing the
  dynamic console info in a DT format, the pre-console buffer and getting
DT
  available as early as possible can yield a 'non-cludgy' solution. For
board
  or SoC vendors who, for whatever reason, have implemented non-DT
storage of
  hardware enumeration data they will be stuck with the penalty of having
to
  translate that data into DT format before it can be parsed by U-Boot.
Maybe
  this could be done in SPL. Yes, it's a hack, but if it can't be worked
  around, push it as low as possible and as far away from the U-Boot core
as
  possible

 I mostly agree here.  But I still fail to see why we havet os upport
 this combination of early and dynamic - and only this is what causes
 some issues.

The situations I have seen can be resolved by pre-console buffer and
console configured in env. If the hardware is playing up,  a factory reset
to default console (without using pre-console buffer) suffices (the device
is on the bench with nothing attached). But then we are back to the board
specific/pre-DT problem.

Regards,

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


Re: [U-Boot] please pull u-boot-samsung/resolve

2012-12-15 Thread Albert ARIBAUD
Hi Minkyu,

On Fri, 14 Dec 2012 09:14:11 +0900, Minkyu Kang mk7.k...@samsung.com
wrote:
 On 14/12/12 04:56, Albert ARIBAUD wrote:
  Hi Minkyu,
  
  On Tue, 11 Dec 2012 20:10:06 +0900, Minkyu Kang mk7.k...@samsung.com
  wrote:
  Dear Albert,
 
  The following changes since commit 
  fd4d564b3c80b111f18c93adb14233a6a7ddb0e9:
 
Merge branch 'master' of git://git.denx.de/u-boot-x86 (2012-12-07 
  08:47:59 -0700)
 
  are available in the git repository at:
 
 
git://git.denx.de/u-boot-samsung resolve
 
  for you to fetch changes up to fbef8e6e7f1233ed20f8c5045e12c9cf31b43540:
 
universal_c210: check the NULL pointer when get the PMIC (2012-12-11 
  17:37:28 +0900)
 
  
  Albert ARIBAUD (1):
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
 
  Allen Martin (1):
tegra: add CONSOLE_MUX support to tegra-kbc
 
  Ashok Kumar Reddy (1):
ARM: arm1176: Define arch_cpu_init() for s3c64xx
 
  Benoît Thébaudeau (17):
arm1136: Fix enable_caches()
mx31: Move EHCI definitions to ehci-fsl.h
ehci-mxc: Clean up
ehci-mx5: Clean up
ehci-mx5: Fix OC_DIS usage
ehci-mx5: Fix OPM usage
ehci-mx5: Fix *PM usage for i.MX53
ehci-mx5: Add missing OC_DIS for i.MX53
ehci-mxc: Make EHCI power/oc polarities configurable
ehci-mxc: Make i.MX25 EHCI configurable
ehci-mxc: Define host offsets
ehci-mxc: Add support for i.MX35
mx35pdk: Add support for OTG
ehci-mx5/6: Make board_ehci_hcd_init() optional
ehci-mxc: Fix host power mask bit for i.MX35
ehci-mxc: Fix host power mask bit for i.MX25
mx5: Mark lowlevel_init board-specific code
 
  Chander Kashyap (1):
Exynos5250: Enable PXE Support
 
  Fabio Estevam (24):
mx25pdk: Include CONFIG_MX25
mx25pdk: Add esdhc support
pmic_fsl: Introduce FSL_PMIC_I2C_LENGTH
mx25: Place common functions into sys_proto.h
pmic: Add support for mc34704
mx25pdk: Add Ethernet support
mx53loco: Allow booting a zImage kernel
mx25pdk: Allow booting a zImage kernel
mx51evk: Allow booting a zImage kernel
mx35pdk: Allow booting a zImage kernel
mx6qsabre_common: Allow booting a zImage kernel
mx5: Align SPI CS naming with i.MX53 reference manual
mx5: Print CSPI clock in 'clock' command
spi: mxc_spi: Fix handling of chip select
spi: mxc_spi: Fix spi clock glitch durant reset
mx6: clock: Only show CSPI clock if CSPI is enabled
mx28evk: Configure CONFIG_BOOTDELAY to one second
mx53loco: Configure CONFIG_BOOTDELAY to one second
mx6qsabrelite: Configure CONFIG_BOOTDELAY to one second
mx6qsabre_common: Configure CONFIG_BOOTDELAY to one second
mx51evk: Configure CONFIG_BOOTDELAY to one second
mx25pdk: Configure CONFIG_BOOTDELAY to one second
mx31pdk: Configure CONFIG_BOOTDELAY to one second
mx35pdk: Configure CONFIG_BOOTDELAY to one second
 
  Hatim RV (3):
EXYNOS: Add clock for SPI
EXYNOS5: Add base address for SPI
EXYNOS5: Enable SPI
 
  Marek Vasut (3):
dm: wdt: Move s5p watchdog timer to drivers/watchdog/
mx28: Fix typo in POWER_MINPWR_VBG_OFF
mx28: Fix typo in POWER_DCLIMITS_NEGLIMIT_OFFSET
 
  Mayuresh Kulkarni (1):
tegra: Enable display/lcd support on Seaboard
 
  Minkyu Kang (6):
ARCH: EXYNOS: add support to match product id
EXYNOS: Clock: Add common function for pll rate calculation
s3c64xx: fix the compiler error and warning
Merge branch 'master' of git://git.denx.de/u-boot into resolve
universal_c210: fix compiler error and compiler warning
universal_c210: check the NULL pointer when get the PMIC
 
  Piotr Wilczek (12):
arm:exynos4:trats: Correct SDRAM configuration for trats
arm:exynos4:trats: Fix SDRAM size
arm:exynos4:pinmux: Modify the gpio function for mmc
arm:exynos4:trats: Use pinmux for mmc configuration
arm:exynos4:universal: Use pinmux for mmc configuration
arm:exynos4:universal: Eliminated low level init
arm: trats: Power down core 1
exynos4: universal_C210: use software SPI
misc:max8998 Add LDO macros
drivers: video: Add ld9040 video driver
drivers: video: fix image position
exynos4: universal_C210: add display support
 
  Rajeshwari Shinde (16):
PMIC: MAX77686: Add support for MAX77686
SMDK5250: Config: Enable MAX77686 pmic chip
SOUND: SAMSUNG: Add I2S driver
SOUND: Add WM8994 codec
Sound: Add command for audio playback
EXYNOS: Add I2S registers
EXYNOS: Add parameters required by I2S
EXYNOS: Add pinmux for I2S
EXYNOS: Add I2S base address
EXYNOS: Add clock for I2S
SMDK5250: Enable Sound

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

2012-12-15 Thread Marek Vasut
This set contains mostly fixes, but also the DFU (which was submitted before 
RC). That's why I'd like it in master if possible. If not, apply to next.

The following changes since commit ebbf0d20aa85f623c49b7ed3349ebfea450c152d:

  Prepare v2013.01-rc2 (2012-12-14 14:43:22 -0700)

are available in the git repository at:

  git://git.denx.de/u-boot-usb.git master

for you to fetch changes up to 1b9bf5c3c99d990d6c88b39c5df82179b7c6028f:

  usb: Fix bug when both DFU  ETHER are defined (2012-12-15 17:34:43 +0100)


Lukasz Dalek (2):
  pxa25x_udc: Remove usbdescriptors.h
  h2200: Add USB CDC ethernet support

Milind Choudhary (1):
  usb: Clean up newly allocated device nodes in case of configuration 
failure

Nikita Kiryanov (3):
  twl4030: add gpio register offsets
  cm-t35: add USB host support
  cm_t35: use new low level interface for usb ehci

Pantelis Antoniou (9):
  g_dnl: Issue connect/disconnect as appropriate
  g_dnl: Properly terminate string list.
  dfu: Only perform DFU board_usb_init() for TRATS
  dfu: Fix crash when wrong number of arguments given
  dfu: Send correct DFU response from composite_setup
  dfu: Properly zero out timeout value
  dfu: Add a partition type target
  dfu: Support larger than memory transfers.
  usb: Fix bug when both DFU  ETHER are defined

Richard Genoud (1):
  usb documentation: fix typo

Vincent Palatin (2):
  usb: ehci: Add 64-bit controller support
  usb: properly detect empty mass storage media reader

Vipin Kumar (1):
  usbh/ehci: Increase timeout for enumeration

 board/cm_t35/cm_t35.c   |   77 
 board/h2200/h2200.c |   11 
 common/cmd_dfu.c|5 +-
 common/usb.c|   12 +
 common/usb_hub.c|   35 +++--
 common/usb_storage.c|   10 
 doc/README.usb  |2 +-
 drivers/dfu/dfu.c   |  244 
+---
 drivers/dfu/dfu_mmc.c   |  109 ++-
 drivers/usb/gadget/Makefile |   10 +++-
 drivers/usb/gadget/composite.c  |   27 ++
 drivers/usb/gadget/ep0.c|1 +
 drivers/usb/gadget/f_dfu.c  |9 +++-
 drivers/usb/gadget/g_dnl.c  |   12 -
 drivers/usb/gadget/pxa25x_udc.c |1 -
 drivers/usb/host/ehci-hcd.c |3 ++
 include/configs/cm_t35.h|8 ++-
 include/configs/h2200.h |   25 +
 include/dfu.h   |   21 ++--
 include/twl4030.h   |   44 
 include/usb.h   |1 +
 21 files changed, 572 insertions(+), 95 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Conflicting commits for seaboard USB keyboard handling

2012-12-15 Thread Albert ARIBAUD
Hi Allen,

On Tue, 11 Dec 2012 11:02:09 -0800, Allen Martin amar...@nvidia.com
wrote:
 On Mon, Dec 10, 2012 at 01:51:40PM -0800, Tom Warren wrote:
  Albert,
  
   On Sat, Dec 8, 2012 at 11:03 PM, Albert ARIBAUD
   albert.u.b...@aribaud.net wrote:
   Hello,
  
   It seems like two commits 5ddcc38b (in u-boot, committed by Marek)
   29f3e3f2 (in u-boot-arm, committed by Tom from u-boot-tegra) are
   conflicting on the seaboard configuration header file for USB (and
   possibly other areas).
  
  One possible problem is that I've got new commits ready in
  u-boot-tegra/next that were almost ready for a pull request, so I
  copied them over to my tegra/master branch and pushed to
  u-boot-tegra/master on denx.  I assumed that once I got the 'applied
  to u-boot-arm/master' response from you, that I could stage the next
  pull request.  But if you (or Allen) are pulling from
  u-boot-tegra/master )or /next), you're gonna get commits that haven't
  been merged into u-boot-arm/master.
  
  I can push the older tegra/master branch back to denx.de (the one that
  I requested a pull from on Nov 19th) if that'll help.  But I'm not
  sure how it would help, since all those commits should have been
  present in u-boot-arm/master (from my pull request) when you went to
  merge w/u-boot/master.
  
  So I'm still not seeing how the conflict arose, or what the path is to
  fixing it.
  
 
 The conflict came from my config file changes for tegra USB keyboard
 which went up to u-boot/master through Marek's tree becasue they
 depend on my USB DMA alignment fix which was not a tegra change.
 There are subsequent changes in both the tegra and arm trees that were
 not based on that change, so they now conflict when attempting to
 merge back into u-boot/master.
 
 It's trivial for me to resolve the conflict since I have context on
 the changes.  I see that there are other merge conflicts between
 u-boot/master and u-boot-arm/master though, so I'm not sure how to
 proceed.  Albert do you just want me to post merged versions of the
 two files that conflict, so you know how to resolve the conflict
 during your merge?

I would like you to post a pull request that would fix the two file
conflicts; I have asked other people to fix other merge conflicts. I
will merge all fix branches in one go (so that u-boot-arm keeps
building clean) once all fix branches are available.

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


Re: [U-Boot] [STATUS] v2013.01-rc2 released

2012-12-15 Thread Simon Glass
Hi Tom,

On Fri, Dec 14, 2012 at 1:52 PM, Tom Rini tr...@ti.com wrote:
 Hey all,

 I've tagged and pushed v2013.01-rc2 now.  The next branch has been open
 for a little bit, and is still open now, and in sync.  Here's where
 we're at:
 - I expect a USB pull request from Marek soon.
 - I've locally build-tested Simon's gd-arch series and will run-time
   test it on a few platforms I have soon now.
 - I know Albert is around and working on a u-boot-arm pull request.

 In my TODO list in patchwork, nothing strikes me as new feature posted
 before the merge window closed.  I see a few bug fixes I might pull in,
 or might sit on to make sure they don't cause surprises.  It's of course
 possible I missed something, or something is assigned to someone else so
 if this strikes anyone as wrong, please speak up now.  Also, if you have
 any bugfixes you expect me to pull, please get them out sooner rather
 than later.  The release is still planned for Jan 15, a month away, but
 there's holidays in there which mean both some folks are not working and
 other folks have some free time for hobby projects.

Thanks Tom.

There are a few SPI patches sitting there:

http://patchwork.ozlabs.org/patch/190164/
http://patchwork.ozlabs.org/patch/187915/

I see a couple of others in mmc and net - will ping the thread.

Regards,
Simon


 Thanks all!

 --
 Tom

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

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


Re: [U-Boot] [PATCH v2] mmc: Split device init to decouple OCR-polling delay

2012-12-15 Thread Simon Glass
Hi,

On Fri, Nov 30, 2012 at 3:13 PM, Simon Glass s...@chromium.org wrote:
 Hi Jaehoon,

 On Fri, Nov 30, 2012 at 12:25 AM, Jaehoon Chung jh80.ch...@samsung.com 
 wrote:
 Hi,

 This concept is very good.
 But I have one question. I think need to call mmc_init() one more, right?
 how did you save the boot time(200ms)?

 On 11/29/2012 10:21 AM, Simon Glass wrote:
 From: Che-Liang Chiou clch...@chromium.org

 Most of time that MMC driver spends on initializing a device is polling
 OCR (operation conditions register).  To decouple this polling loop,
 device init is split into two parts: The first part fires the OCR query
 command, and the second part polls the result.  So the caller is now no
 longer bound to the OCR-polling delay; he may fire the query, go
 somewhere and then come back later for the result.

 To use this, call mmc_set_preinit() on any device which needs this.

 This can save significant amounts of time on boot (e.g. 200ms) by
 hiding the MMC init time behind other init.
 snip..
 +int mmc_init(struct mmc *mmc)
 +{
 + int err = IN_PROGRESS;
 + unsigned start = get_timer(0);
 +
 + if (mmc-has_init)
 + return 0;
 + if (!mmc-init_in_progress)
 + err = mmc_start_init(mmc);
 It need not to return? if err is IN_PROGRESS, next condition is immediately 
 run.
 Then i think we didn't save the time before adjust this patch.

 It's a little confusing, but the way it works is that mmc_preinit()
 calls mmc_start_init() early in boot. Then when mmc_init() finally
 gets called (later) it finishes off the init. We still need mmc_init()
 to actually fully complete the init. If it were to return before
 completing the init then we would be unable to use the MMC.

 +
 + if (!err || err == IN_PROGRESS)
 + err = mmc_complete_init(mmc);
 + debug(%s: %d, time %lu\n, __func__, err, get_timer(start));
   return err;
  }


Does this patch look good now? I am wondering if it will be including
in release, or in next?

Regards,
Simon

 [snip]

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


Re: [U-Boot] [PATCH 2/3] fw_env: fix incorrect usage of open(O_CREAT)

2012-12-15 Thread Joe Hershberger
Hi Mike,

On Sat, Nov 10, 2012 at 11:47 PM, Mike Frysinger vap...@gentoo.org wrote:
 When using open(), the O_CREAT flag must be given a mode, otherwise it
 uses random garbage from the stack.  Also, it can fail to build:

 In file included from /usr/include/fcntl.h:290:0,
  from fw_env_main.c:42:
 In function 'open',
 inlined from 'main' at fw_env_main.c:97:9:
 /usr/include/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' 
 declared
 with attribute error: open with O_CREAT in second argument needs 3 
 arguments

 Signed-off-by: Mike Frysinger vap...@gentoo.org

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


Re: [U-Boot] [PATCH 1/3] fw_env: fix type of len

2012-12-15 Thread Joe Hershberger
Hi Mike,

On Sat, Nov 10, 2012 at 11:47 PM, Mike Frysinger vap...@gentoo.org wrote:
 This variable is assigned by a size_t, and is printed that way, but is
 incorrectly declared as an int.  Which means we get warnings:
 fw_env.c: In function 'fw_setenv':
 fw_env.c:409:5: warning: format '%zu' expects argument of type 'size_t',
 but argument 3 has type 'int' [-Wformat]

 Signed-off-by: Mike Frysinger vap...@gentoo.org
 ---

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


Re: [U-Boot] [PATCH 3/3] fw_env: fix building w/out a config.h

2012-12-15 Thread Joe Hershberger
Hi Mike

On Sat, Nov 10, 2012 at 11:47 PM, Mike Frysinger vap...@gentoo.org wrote:
 Signed-off-by: Mike Frysinger vap...@gentoo.org
 ---
  tools/env/Makefile | 11 ++-
  tools/env/fw_env.h | 25 -
  2 files changed, 10 insertions(+), 26 deletions(-)

 diff --git a/tools/env/Makefile b/tools/env/Makefile
 index ab73c8c..62a113a 100644
 --- a/tools/env/Makefile
 +++ b/tools/env/Makefile
 @@ -24,7 +24,7 @@
  include $(TOPDIR)/config.mk

  HOSTSRCS := $(SRCTREE)/lib/crc32.c  fw_env.c  fw_env_main.c
 -HEADERS:= fw_env.h $(OBJTREE)/include/config.h
 +HEADERS:= fw_env.h

I think this is the wrong approach.  We depend on the config.h being
included and the entire default env being available.  If you want to
get this behavior, I suggest you detect if there is a configured
board, and if so, include the config.h, and if not, bake in the bit
you need to cope with not having one.

  # Compile for a hosted environment on the target
  HOSTCPPFLAGS  = -idirafter $(SRCTREE)/include \
 @@ -33,6 +33,15 @@ HOSTCPPFLAGS  = -idirafter $(SRCTREE)/include \
 -DUSE_HOSTCC \
 -DTEXT_BASE=$(TEXT_BASE)

 +# Pass CONFIG_xxx settings via the command line so that we can build w/out
 +# a config.h file existing in the first place.  Useful for generic builds.
 +CONFIG_VARS_TO_PASS = \
 +   ENV_OVERWRITE \
 +   OVERWRITE_ETHADDR_ONCE \
 +   ETHADDR

This doesn't look very maintainable, and it doesn't even include the
variables currently used.

 +HOSTCPPFLAGS += \
 +   $(foreach x,$(CONFIG_VARS_TO_PASS),$(if 
 $(CONFIG_$(x)),-DCONFIG_$(x)=$(CONFIG_$(x
 +
  ifeq ($(MTD_VERSION),old)
  HOSTCPPFLAGS += -DMTD_OLD
  endif
 diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
 index a1a6807..19703c7 100644
 --- a/tools/env/fw_env.h
 +++ b/tools/env/fw_env.h
 @@ -21,15 +21,6 @@
   * MA 02111-1307 USA
   */

 -/* Pull in the current config to define the default environment */
 -#ifndef __ASSEMBLY__
 -#define __ASSEMBLY__ /* get only #defines from config.h */
 -#include config.h
 -#undef __ASSEMBLY__
 -#else
 -#include config.h
 -#endif
 -
  /*
   * To build the utility with the static configuration
   * comment out the next line.
 @@ -52,22 +43,6 @@
  #define DEVICE2_ENVSECTORS 2
  #endif

 -#ifndef CONFIG_BAUDRATE
 -#define CONFIG_BAUDRATE115200
 -#endif
 -
 -#ifndef CONFIG_BOOTDELAY
 -#define CONFIG_BOOTDELAY   5   /* autoboot after 5 seconds */
 -#endif
 -
 -#ifndef CONFIG_BOOTCOMMAND
 -#define CONFIG_BOOTCOMMAND   
   \
 -   bootp;  
   \
 -   setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath}   
   \
 -   ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off;  
   \
 -   bootm
 -#endif
 -

I agree that some of this should be cleaned up, but not as a result of
removing the config.h.

  extern int   fw_printenv(int argc, char *argv[]);
  extern char *fw_getenv  (char *name);
  extern int fw_setenv  (int argc, char *argv[]);
 --
 1.7.12.4

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

NAK

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


[U-Boot] Pull request: u-boot-net.git master

2012-12-15 Thread Joe Hershberger
The following changes since commit ebbf0d20aa85f623c49b7ed3349ebfea450c152d:

  Prepare v2013.01-rc2 (2012-12-14 14:43:22 -0700)

are available in the git repository at:

  git://git.denx.de/u-boot-net.git master

for you to fetch changes up to e3bb3254f8c055767edd1f02e642bec386540f4c:

  net: sh_eth: add support for SH7752 (2012-12-15 12:28:24 -0600)


Joe Hershberger (1):
  net: Fix endianness bug in link-local

Michal Simek (1):
  phy: Add support for Marvell 88E1118R

Ruchika Gupta (1):
  e1000e : Correct Rx Threshold granularity

Simon Glass (1):
  net: Add tftp speed indication

Yoshihiro Shimoda (1):
  net: sh_eth: add support for SH7752

trem (1):
  powerpc: remove not used CONFIG_SYS_TFTP_LOADADDR

 README|  3 ---
 drivers/net/e1000.c   | 10 ++
 drivers/net/e1000.h   |  1 +
 drivers/net/phy/marvell.c | 11 +++
 drivers/net/sh_eth.c  |  4 ++--
 drivers/net/sh_eth.h  |  4 ++--
 include/configs/CRAYL1.h  |  1 -
 include/configs/GEN860T.h |  5 -
 include/configs/TOP860.h  |  1 -
 include/configs/ep8260.h  |  1 -
 include/configs/utx8245.h |  1 -
 net/link_local.c  |  2 +-
 net/tftp.c|  8 
 13 files changed, 35 insertions(+), 17 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 1/8] patman: Use ANSI colours only when outputting to a terminal

2012-12-15 Thread Simon Glass
It is easy to detect whether or not the process is connected to a terminal,
or piped to a file. Disable ANSI colours automatically when output is
not to a terminal.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 tools/patman/terminal.py |   11 +--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/patman/terminal.py b/tools/patman/terminal.py
index 838c828..8fad06e 100644
--- a/tools/patman/terminal.py
+++ b/tools/patman/terminal.py
@@ -24,6 +24,12 @@
 This module handles terminal interaction including ANSI color codes.
 
 
+import os
+import sys
+
+# Selection of when we want our output to be colored
+COLOR_IF_TERMINAL, COLOR_ALWAYS, COLOR_NEVER = range(3)
+
 class Color(object):
   Conditionally wraps text in ANSI color escape sequences.
   BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
@@ -32,14 +38,15 @@ class Color(object):
   BOLD_START = '\033[1m'
   RESET = '\033[0m'
 
-  def __init__(self, enabled=True):
+  def __init__(self, colored=COLOR_IF_TERMINAL):
 Create a new Color object, optionally disabling color output.
 
 Args:
   enabled: True if color output should be enabled. If False then this
 class will not add color codes at all.
 
-self._enabled = enabled
+self._enabled = (colored == COLOR_ALWAYS or
+(colored == COLOR_IF_TERMINAL and os.isatty(sys.stdout.fileno(
 
   def Start(self, color):
 Returns a start color code.
-- 
1.7.7.3

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


[U-Boot] [PATCH v2 2/8] patman: Use bright ANSI colours by default

2012-12-15 Thread Simon Glass
Rather than the rather dull colours, use bright versions which normally
look better and are easier to read.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 tools/patman/terminal.py |   19 +++
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/tools/patman/terminal.py b/tools/patman/terminal.py
index 8fad06e..337a2a4 100644
--- a/tools/patman/terminal.py
+++ b/tools/patman/terminal.py
@@ -34,7 +34,8 @@ class Color(object):
   Conditionally wraps text in ANSI color escape sequences.
   BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
   BOLD = -1
-  COLOR_START = '\033[1;%dm'
+  BRIGHT_START = '\033[1;%dm'
+  NORMAL_START = '\033[22;%dm'
   BOLD_START = '\033[1m'
   RESET = '\033[0m'
 
@@ -48,7 +49,7 @@ class Color(object):
 self._enabled = (colored == COLOR_ALWAYS or
 (colored == COLOR_IF_TERMINAL and os.isatty(sys.stdout.fileno(
 
-  def Start(self, color):
+  def Start(self, color, bright=True):
 Returns a start color code.
 
 Args:
@@ -59,7 +60,8 @@ class Color(object):
   otherwise returns empty string
 
 if self._enabled:
-  return self.COLOR_START % (color + 30)
+base = self.BRIGHT_START if bright else self.NORMAL_START
+return base % (color + 30)
 return ''
 
   def Stop(self):
@@ -70,10 +72,10 @@ class Color(object):
   returns empty string
 
 if self._enabled:
-  return self.RESET
+return self.RESET
 return ''
 
-  def Color(self, color, text):
+  def Color(self, color, text, bright=True):
 Returns text with conditionally added color escape sequences.
 
 Keyword arguments:
@@ -85,9 +87,10 @@ class Color(object):
   returns text with color escape sequences based on the value of color.
 
 if not self._enabled:
-  return text
+return text
 if color == self.BOLD:
-  start = self.BOLD_START
+start = self.BOLD_START
 else:
-  start = self.COLOR_START % (color + 30)
+base = self.BRIGHT_START if bright else self.NORMAL_START
+start = base % (color + 30)
 return start + text + self.RESET
-- 
1.7.7.3

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


[U-Boot] [PATCH v2 4/8] patman: Make command methods return a CommandResult

2012-12-15 Thread Simon Glass
Rather than returning a list of things, return an object. That makes it
easier to access the returned items, and easier to extend the return
value later.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 tools/patman/command.py |   84 +++---
 tools/patman/gitutil.py |2 +-
 tools/patman/patchstream.py |2 +-
 3 files changed, 64 insertions(+), 24 deletions(-)

diff --git a/tools/patman/command.py b/tools/patman/command.py
index 4b00250..fc085f2 100644
--- a/tools/patman/command.py
+++ b/tools/patman/command.py
@@ -20,53 +20,93 @@
 #
 
 import os
-import subprocess
+import cros_subprocess
 
 Shell command ease-ups for Python.
 
-def RunPipe(pipeline, infile=None, outfile=None,
-capture=False, oneline=False, hide_stderr=False):
+class CommandResult:
+A class which captures the result of executing a command.
+
+Members:
+stdout: stdout obtained from command, as a string
+stderr: stderr obtained from command, as a string
+return_code: Return code from command
+exception: Exception received, or None if all ok
+
+def __init__(self):
+self.stdout = None
+self.stderr = None
+self.return_code = None
+self.exception = None
+
+
+def RunPipe(pipe_list, infile=None, outfile=None,
+capture=False, capture_stderr=False, oneline=False,
+cwd=None, **kwargs):
 
 Perform a command pipeline, with optional input/output filenames.
 
-hide_stderr Don't allow output of stderr (default False)
+Args:
+pipe_list: List of command lines to execute. Each command line is
+piped into the next, and is itself a list of strings. For
+example [ ['ls', '.git'] ['wc'] ] will pipe the output of
+'ls .git' into 'wc'.
+infile: File to provide stdin to the pipeline
+outfile: File to store stdout
+capture: True to capture output
+capture_stderr: True to capture stderr
+oneline: True to strip newline chars from output
+kwargs: Additional keyword arguments to cros_subprocess.Popen()
+Returns:
+CommandResult object
 
+result = CommandResult()
 last_pipe = None
+pipeline = list(pipe_list)
 while pipeline:
 cmd = pipeline.pop(0)
-kwargs = {}
 if last_pipe is not None:
 kwargs['stdin'] = last_pipe.stdout
 elif infile:
 kwargs['stdin'] = open(infile, 'rb')
 if pipeline or capture:
-kwargs['stdout'] = subprocess.PIPE
+kwargs['stdout'] = cros_subprocess.PIPE
 elif outfile:
 kwargs['stdout'] = open(outfile, 'wb')
-if hide_stderr:
-kwargs['stderr'] = open('/dev/null', 'wb')
+if capture_stderr:
+kwargs['stderr'] = cros_subprocess.PIPE
 
-last_pipe = subprocess.Popen(cmd, **kwargs)
+try:
+last_pipe = cros_subprocess.Popen(cmd, cwd=cwd, **kwargs)
+except Exception, err:
+result.exception = err
+print 'exception', pipe_list, err
+raise Exception(Error running '%s': %s % (pipe_list, str))
 
 if capture:
-ret = last_pipe.communicate()[0]
-if not ret:
-return None
-elif oneline:
-return ret.rstrip('\r\n')
-else:
-return ret
+result.stdout, result.stderr, result.combined = (
+last_pipe.CommunicateFilter(None))
+if result.stdout and oneline:
+result.output = result.stdout.rstrip('\r\n')
+result.return_code = last_pipe.wait()
 else:
-return os.waitpid(last_pipe.pid, 0)[1] == 0
+result.return_code = os.waitpid(last_pipe.pid, 0)[1]
+if result.return_code:
+raise Exception(Error running '%s' % pipe_list)
+return result
 
 def Output(*cmd):
-return RunPipe([cmd], capture=True)
+return RunPipe([cmd], capture=True).stdout
 
-def OutputOneLine(*cmd):
-return RunPipe([cmd], capture=True, oneline=True)
+def OutputOneLine(*cmd, **kwargs):
+return (RunPipe([cmd], capture=True, oneline=True,
+**kwargs).stdout.strip())
 
 def Run(*cmd, **kwargs):
-return RunPipe([cmd], **kwargs)
+return RunPipe([cmd], **kwargs).stdout
 
 def RunList(cmd):
-return RunPipe([cmd], capture=True)
+return RunPipe([cmd], capture=True).stdout
+
+def StopAll():
+cros_subprocess.stay_alive = False
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 72d37a0..e682e86 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -40,7 +40,7 @@ def CountCommitsToBranch():
 
 pipe = [['git', 'log', '--no-color', '--oneline', '@{upstream}..'],
 ['wc', '-l']]
-stdout = command.RunPipe(pipe, capture=True, oneline=True)
+stdout = command.RunPipe(pipe, capture=True, oneline=True).stdout
 patch_count = int(stdout)

[U-Boot] [PATCH v2 3/8] patman: Add cros_subprocess library to manage subprocesses

2012-12-15 Thread Simon Glass
This adds a new library on top of subprocess which permits access to
the subprocess output as it is being generated. We can therefore
give the illusion that a process is running independently, but still
monitor its output so that we know what is going on.

It is possible to display output on a terminal as it is generated
(a little like tee). The supplied output function is called with all
stdout/stderr data as it arrives.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 tools/patman/cros_subprocess.py |  397 +++
 1 files changed, 397 insertions(+), 0 deletions(-)
 create mode 100644 tools/patman/cros_subprocess.py

diff --git a/tools/patman/cros_subprocess.py b/tools/patman/cros_subprocess.py
new file mode 100644
index 000..0fc4a06
--- /dev/null
+++ b/tools/patman/cros_subprocess.py
@@ -0,0 +1,397 @@
+# Copyright (c) 2012 The Chromium OS Authors.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# Copyright (c) 2003-2005 by Peter Astrand astr...@lysator.liu.se
+# Licensed to PSF under a Contributor Agreement.
+# See http://www.python.org/2.4/license for licensing details.
+
+Subprocress execution
+
+This module holds a subclass of subprocess.Popen with our own required
+features, mainly that we get access to the subprocess output while it
+is running rather than just at the end. This makes it easiler to show
+progress information and filter output in real time.
+
+
+import errno
+import os
+import pty
+import select
+import subprocess
+import sys
+import unittest
+
+
+# Import these here so the caller does not need to import subprocess also.
+PIPE = subprocess.PIPE
+STDOUT = subprocess.STDOUT
+PIPE_PTY = -3 # Pipe output through a pty
+stay_alive = True
+
+
+class Popen(subprocess.Popen):
+Like subprocess.Popen with ptys and incremental output
+
+This class deals with running a child process and filtering its output on
+both stdout and stderr while it is running. We do this so we can monitor
+progress, and possibly relay the output to the user if requested.
+
+The class is similar to subprocess.Popen, the equivalent is something like:
+
+Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+
+But this class has many fewer features, and two enhancement:
+
+1. Rather than getting the output data only at the end, this class sends it
+ to a provided operation as it arrives.
+2. We use pseudo terminals so that the child will hopefully flush its 
output
+ to us as soon as it is produced, rather than waiting for the end of a
+ line.
+
+Use CommunicateFilter() to handle output from the subprocess.
+
+
+
+def __init__(self, args, stdin=None, stdout=PIPE_PTY, stderr=PIPE_PTY,
+ shell=False, cwd=None, env=None, **kwargs):
+Cut-down constructor
+
+Args:
+args: Program and arguments for subprocess to execute.
+stdin: See subprocess.Popen()
+stdout: See subprocess.Popen(), except that we support the sentinel
+value of cros_subprocess.PIPE_PTY.
+stderr: See subprocess.Popen(), except that we support the sentinel
+value of cros_subprocess.PIPE_PTY.
+shell: See subprocess.Popen()
+cwd: Working directory to change to for subprocess, or None if 
none.
+env: Environment to use for this subprocess, or None to inherit 
parent.
+kwargs: No other arguments are supported at the moment.Passing 
other
+arguments will cause a ValueError to be raised.
+
+stdout_pty = None
+stderr_pty = None
+
+if stdout == PIPE_PTY:
+stdout_pty = pty.openpty()
+stdout = os.fdopen(stdout_pty[1])
+if stderr == PIPE_PTY:
+stderr_pty = pty.openpty()
+stderr = os.fdopen(stderr_pty[1])
+
+super(Popen, self).__init__(args, stdin=stdin,
+stdout=stdout, stderr=stderr, shell=shell, cwd=cwd, env=env,
+**kwargs)
+
+# If we're on a PTY, we passed the slave half of the PTY to the 
subprocess.
+# We want to use the master half on our end from now on.Setting 
this here
+# does make some assumptions about the implementation of subprocess, 
but
+# those assumptions are pretty minor.
+
+# Note that if stderr is STDOUT, then self.stderr will be set to None 
by
+# this constructor.
+if stdout_pty is not None:
+self.stdout = os.fdopen(stdout_pty[0])
+if stderr_pty is not None:
+self.stderr = os.fdopen(stderr_pty[0])
+
+# Insist that unit tests exist for other arguments we don't support.
+if kwargs:
+raise ValueError(Unit tests do not test extra args - please add 
tests)
+
+def CommunicateFilter(self, output):
+Interact with 

[U-Boot] [PATCH v2 6/8] patman: Allow reading metadata from a list of commits

2012-12-15 Thread Simon Glass
We normally read from the current branch, but buildman will need to look
at commits from another branch. Allow the metadata to be read from any
list of commits, to provide this flexibility.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 tools/patman/patchstream.py |   36 +---
 1 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index 1e4a36f..bed921d 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -237,7 +237,8 @@ class PatchStream:
 # Detect the start of a new commit
 elif commit_match:
 self.CloseCommit()
-self.commit = commit.Commit(commit_match.group(1)[:7])
+# TODO: We should store the whole hash, and just display a subset
+self.commit = commit.Commit(commit_match.group(1)[:8])
 
 # Detect tags in the commit message
 elif tag_match:
@@ -334,26 +335,47 @@ class PatchStream:
 self.Finalize()
 
 
-def GetMetaData(start, count):
+def GetMetaDataForList(commit_range, git_dir=None, count=None,
+   series = Series()):
 Reads out patch series metadata from the commits
 
 This does a 'git log' on the relevant commits and pulls out the tags we
 are interested in.
 
 Args:
-start: Commit to start from: 0=HEAD, 1=next one, etc.
-count: Number of commits to list
+commit_range: Range of commits to count (e.g. 'HEAD..base')
+git_dir: Path to git repositiory (None to use default)
+count: Number of commits to list, or None for no limit
+series: Series object to add information into. By default a new series
+is started.
+Returns:
+A Series object containing information about the commits.
 
-pipe = [['git', 'log', '--no-color', '--reverse', 'HEAD~%d' % start,
-   '-n%d' % count]]
+params = ['git', 'log', '--no-color', '--reverse', 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
-series = Series()
 ps = PatchStream(series, is_log=True)
 for line in stdout.splitlines():
 ps.ProcessLine(line)
 ps.Finalize()
 return series
 
+def GetMetaData(start, count):
+Reads out patch series metadata from the commits
+
+This does a 'git log' on the relevant commits and pulls out the tags we
+are interested in.
+
+Args:
+start: Commit to start from: 0=HEAD, 1=next one, etc.
+count: Number of commits to list
+
+return GetMetaDataForList('HEAD~%d' % start, None, count)
+
 def FixPatch(backup_dir, fname, series, commit):
 Fix up a patch file, by adding/removing as required.
 
-- 
1.7.7.3

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


[U-Boot] [PATCH v2 5/8] patman: Allow commands to raise on error, or not

2012-12-15 Thread Simon Glass
Make raise_on_error a parameter so that we can control which commands
raise and which do not. If we get an error reading the alias file, just
continue.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 tools/patman/command.py |   17 +++--
 tools/patman/gitutil.py |3 ++-
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/tools/patman/command.py b/tools/patman/command.py
index fc085f2..e6af6ed 100644
--- a/tools/patman/command.py
+++ b/tools/patman/command.py
@@ -42,7 +42,7 @@ class CommandResult:
 
 def RunPipe(pipe_list, infile=None, outfile=None,
 capture=False, capture_stderr=False, oneline=False,
-cwd=None, **kwargs):
+raise_on_error=True, cwd=None, **kwargs):
 
 Perform a command pipeline, with optional input/output filenames.
 
@@ -63,6 +63,7 @@ def RunPipe(pipe_list, infile=None, outfile=None,
 result = CommandResult()
 last_pipe = None
 pipeline = list(pipe_list)
+user_pipestr =  '|'.join([' '.join(pipe) for pipe in pipe_list])
 while pipeline:
 cmd = pipeline.pop(0)
 if last_pipe is not None:
@@ -80,8 +81,10 @@ def RunPipe(pipe_list, infile=None, outfile=None,
 last_pipe = cros_subprocess.Popen(cmd, cwd=cwd, **kwargs)
 except Exception, err:
 result.exception = err
-print 'exception', pipe_list, err
-raise Exception(Error running '%s': %s % (pipe_list, str))
+if raise_on_error:
+raise Exception(Error running '%s': %s % (user_pipestr, str))
+result.return_code = 255
+return result
 
 if capture:
 result.stdout, result.stderr, result.combined = (
@@ -91,15 +94,17 @@ def RunPipe(pipe_list, infile=None, outfile=None,
 result.return_code = last_pipe.wait()
 else:
 result.return_code = os.waitpid(last_pipe.pid, 0)[1]
-if result.return_code:
-raise Exception(Error running '%s' % pipe_list)
+if raise_on_error and result.return_code:
+raise Exception(Error running '%s' % user_pipestr)
 return result
 
 def Output(*cmd):
-return RunPipe([cmd], capture=True).stdout
+return RunPipe([cmd], capture=True, raise_on_error=False).stdout
 
 def OutputOneLine(*cmd, **kwargs):
+raise_on_error = kwargs.pop('raise_on_error', True)
 return (RunPipe([cmd], capture=True, oneline=True,
+raise_on_error=raise_on_error,
 **kwargs).stdout.strip())
 
 def Run(*cmd, **kwargs):
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index e682e86..8bbf88f 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -352,7 +352,8 @@ def GetAliasFile():
 Returns:
 Filename of git alias file, or None if none
 
-fname = command.OutputOneLine('git', 'config', 'sendemail.aliasesfile')
+fname = command.OutputOneLine('git', 'config', 'sendemail.aliasesfile',
+raise_on_error=False)
 if fname:
 fname = os.path.join(GetTopLevel(), fname.strip())
 return fname
-- 
1.7.7.3

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


[U-Boot] [PATCH v2 7/8] patman: Add additional git utilties

2012-12-15 Thread Simon Glass
Add methods to find out the commits in a branch, clone a repo and
fetch from a repo.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2: None

 tools/patman/gitutil.py |  124 ++-
 1 files changed, 123 insertions(+), 1 deletions(-)

diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 8bbf88f..5958439 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -23,11 +23,12 @@ import command
 import re
 import os
 import series
-import settings
 import subprocess
 import sys
 import terminal
 
+import settings
+
 
 def CountCommitsToBranch():
 Returns number of commits between HEAD and the tracking branch.
@@ -44,6 +45,119 @@ def CountCommitsToBranch():
 patch_count = int(stdout)
 return patch_count
 
+def GetUpstream(git_dir, branch):
+Returns the name of the upstream for a branch
+
+Args:
+git_dir: Git directory containing repo
+branch: Name of branch
+
+Returns:
+Name of upstream branch (e.g. 'upstream/master') or None if none
+
+remote = command.OutputOneLine('git', '--git-dir', git_dir, 'config',
+'branch.%s.remote' % branch)
+merge = command.OutputOneLine('git', '--git-dir', git_dir, 'config',
+'branch.%s.merge' % branch)
+if remote == '.':
+return merge
+elif remote and merge:
+leaf = merge.split('/')[-1]
+return '%s/%s' % (remote, leaf)
+else:
+raise ValueError, (Cannot determine upstream branch for branch 
+'%s' remote='%s', merge='%s' % (branch, remote, merge))
+
+
+def GetRangeInBranch(git_dir, branch, include_upstream=False):
+Returns an expression for the commits in the given branch.
+
+Args:
+git_dir: Directory containing git repo
+branch: Name of branch
+Return:
+Expression in the form 'upstream..branch' which can be used to
+access the commits.
+
+upstream = GetUpstream(git_dir, branch)
+return '%s%s..%s' % (upstream, '~' if include_upstream else '', branch)
+
+def CountCommitsInBranch(git_dir, branch, include_upstream=False):
+Returns the number of commits in the given branch.
+
+Args:
+git_dir: Directory containing git repo
+branch: Name of branch
+Return:
+Number of patches that exist on top of the branch
+
+range_expr = GetRangeInBranch(git_dir, branch, include_upstream)
+pipe = [['git', '--git-dir', git_dir, 'log', '--oneline', range_expr],
+['wc', '-l']]
+result = command.RunPipe(pipe, capture=True, oneline=True)
+patch_count = int(result.stdout)
+return patch_count
+
+def CountCommits(commit_range):
+Returns the number of commits in the given range.
+
+Args:
+commit_range: Range of commits to count (e.g. 'HEAD..base')
+Return:
+Number of patches that exist on top of the branch
+
+pipe = [['git', 'log', '--oneline', commit_range],
+['wc', '-l']]
+stdout = command.RunPipe(pipe, capture=True, oneline=True).stdout
+patch_count = int(stdout)
+return patch_count
+
+def Checkout(commit_hash, git_dir=None, work_tree=None, force=False):
+Checkout the selected commit for this build
+
+Args:
+commit_hash: Commit hash to check out
+
+pipe = ['git']
+if git_dir:
+pipe.extend(['--git-dir', git_dir])
+if work_tree:
+pipe.extend(['--work-tree', work_tree])
+pipe.append('checkout')
+if force:
+pipe.append('-f')
+pipe.append(commit_hash)
+result = command.RunPipe([pipe], capture=True, raise_on_error=False)
+if result.return_code != 0:
+raise OSError, 'git checkout (%s): %s' % (pipe, result.stderr)
+
+def Clone(git_dir, output_dir):
+Checkout the selected commit for this build
+
+Args:
+commit_hash: Commit hash to check out
+
+pipe = ['git', 'clone', git_dir, '.']
+result = command.RunPipe([pipe], capture=True, cwd=output_dir)
+if result.return_code != 0:
+raise OSError, 'git clone: %s' % result.stderr
+
+def Fetch(git_dir=None, work_tree=None):
+Fetch from the origin repo
+
+Args:
+commit_hash: Commit hash to check out
+
+pipe = ['git']
+if git_dir:
+pipe.extend(['--git-dir', git_dir])
+if work_tree:
+pipe.extend(['--work-tree', work_tree])
+pipe.append('fetch')
+result = command.RunPipe([pipe], capture=True)
+if result.return_code != 0:
+raise OSError, 'git fetch: %s' % result.stderr
+
 def CreatePatches(start, count, series):
 Create a series of patches from the top of the current branch.
 
@@ -385,6 +499,14 @@ def Setup():
 if alias_fname:
 settings.ReadGitAliases(alias_fname)
 
+def GetHead():
+Get the hash of the current HEAD
+
+Returns:
+Hash of HEAD
+
+return command.OutputOneLine('git', 'show', '-s', '--pretty=format:%H')
+
 if __name__ == __main__:
 

Re: [U-Boot] Atheros ART data crc calculation

2012-12-15 Thread Drassal, Allan
Dmytro,
Thank you for your reply, and sorry for my late reply.
I was successful in changing the MAC address of the device.
Although I have questioned if I changed the correct two bytes in the ART data 
to create the correct CRC.
I am going to copy the guide that I created in effort to help me remember if I 
have to do this again in the future,
I hope it will be of some help to someone who encounters this same problem 
later.

As far as the buc_crc variable, if it is deleted from the enviornment, U-Boot 
recreates it upon startup.
Therefore I don't need to recalculate this one, however, the ART CRC 
calculation is required.
The ART data CRC must equal 0x upon the Atheros driver reading the data.
There are two discrete data places in the flash, one for 2.4Ghz, and one for 
5.8Ghz, each has its own data and CRC, which are outlined below.

I thank you again for your help previously, as I would not have been able to 
reload the FLASH without the RAM loadable software you provided.

However, the two versions provided each has some issues, but together I was 
able to reload the device.

The first revision was able to erase the FLASH correctly, and the ethernet 
initialized correctly, however, there was no cp command to copy from RAM to 
FLASH.
The second revision had the cp instruction and could write to the FLASH (at 
least the upper area where the bootloader was stored), however, ethernet did 
not function, and it could not erase the FLASH correctly.
I would like to recompile a fully working RAM loadable U-Boot incase problems 
arise the the future, but am not sure what you changed between the two 
versions, so if you could share that, I would be happy, or share how to change 
the ethernet type, FLASH type, etc.

Below if a copy of the guide I created to change the MAC address stored in the 
ART partition, and while I am not sure I edited the correct two bytes to 
correct the CRC, it does function, and there seem to be no side effects.

Thanks,
Allan


BUFFALO WZR-HP-AG300H
***In order to change the MAC address of the wireless, we need to edit the
***FLASH where the ART (Atheros Radio Test) data is stored.

***This data is at address 0xbf05 and runs to 0xbf05
***however, it does not use the whole area
***the 2.4ghz information is from 0xbf051000 to 0xbf051fff
***the 5.8ghz information is from 0xbf055000 to 0xbf055fff

***the MAC address for 2.4ghz is stored at 0xbf05120c (3 bytes)
***the MAC address for 5.8ghz is stored at 0xbf05520c (3 bytes)

***this is an example of the two ethernet addresses and where they are stored
0005120c 106f3f0e5b3c
0005520c 106f3f0e5b3d

***we can't directly edit bytes in the flash since an entire page has to be
***erased and written at a time... therefore we copy the data to DRAM
***edit it, then erase the flash area and rewrite it

***copy a flash sector out so we can edit it
cp.b 0xbf05 0x8400 0x1

***display the current 2.4ghz ethernet address
md 0x84001200
***edit the 2.4ghz ethernet address (edits the last two bytes)
***end the write command with a . and enter
mm.b 0x84001210

***display the current 5.8ghz ethernet address
md 0x84005200
***edit the 5.8ghz ethernet address (edits the last two bytes)
mm.b 0x84005210

***we need to recalculate the CRC, or the Atheros driver will not load
***in order to do this, erase the current CRC bytes (two bytes)

***so, reset the following bytes to ff

***2.4ghz CRC bytes
mm.b 0x84001202

***5.8ghz CRC bytes
mm.b 0x84005202

***write the sector back into flash
protect off 0xbf05 0xbf05
erase 0xbf05 0xbf05
cp.b 0x8400 0xbf05 0x1
protect on 0xbf05 0xbf05

***display the updated information in flash
md 0xbf05
md 0xbf051200
md 0xbf055200

***reboot the board and let dd-wrt load, a failed EEPROM CRC error can be
***ignored for now, we can fix that later, use CTRL+C to exit the error
***then use boot to load dd-wrt

***then, when dd-wrt loads, login and do a dmesg | grep ath: and
***the failed CRC value will be displayed, make note of these two bytes
***we will write them into FLASH to make the CRC calculation of 0x
***come out corrently

***use the following commands to once again rewrite the ART area of the FLASH
***copy a flash sector out so we can edit it

cp.b 0xbf05 0x8400 0x1
***2.4ghz CRC bytes
mm.b 0x84001202

***5.8ghz CRC bytes
mm.b 0x84005202

***write the sector back into flash
protect off 0xbf05 0xbf05
erase 0xbf05 0xbf05
cp.b 0x8400 0xbf05 0x1
protect on 0xbf05 0xbf05

***to fix the EEPROM CRC failed error, erase the CRC enviornment variable
***it will be recreated on next reboot
setenv buf_crc
saveenv
reset




From: Dmytro [dioptimi...@gmail.com]
Sent: Friday, December 14, 2012 15:31
To: Drassal, Allan
Cc: U-Boot Mailing List
Subject: Re: Atheros ART data crc calculation

Hello again Allan,
Can you on work device (with correct ART section and with no checksum
error), enter the 

Re: [U-Boot] Atheros ART data crc calculation

2012-12-15 Thread Drassal, Allan
Made a slight correction on which bytes to change to 0xff for the CRC 
calculation for the ART data.

BUFFALO WZR-HP-AG300H
***In order to change the MAC address of the wireless, we need to edit the
***FLASH where the ART (Atheros Radio Test) data is stored.

***This data is at address 0xbf05 and runs to 0xbf05
***however, it does not use the whole area
***the 2.4ghz information is from 0xbf051000 to 0xbf051fff
***the 5.8ghz information is from 0xbf055000 to 0xbf055fff

***the MAC address for 2.4ghz is stored at 0xbf05120c (3 bytes)
***the MAC address for 5.8ghz is stored at 0xbf05520c (3 bytes)

***this is an example of the two ethernet addresses and where they are stored
0005120c 106f3f0e5b3c
0005520c 106f3f0e5b3d

***we can't directly edit bytes in the flash since an entire page has to be
***erased and written at a time... therefore we copy the data to DRAM
***edit it, then erase the flash area and rewrite it

***copy a flash sector out so we can edit it
cp.b 0xbf05 0x8400 0x1

***display the current 2.4ghz ethernet address
md 0x84001200
***edit the 2.4ghz ethernet address (edits the last two bytes)
***end the write command with a . and enter
mm.b 0x84001210

***display the current 5.8ghz ethernet address
md 0x84005200
***edit the 5.8ghz ethernet address (edits the last two bytes)
mm.b 0x84005210

***we need to recalculate the CRC, or the Atheros driver will not load
***in order to do this, erase the current CRC bytes (two bytes)

***so, reset the following four bytes (two bytes for 2.4Ghz and two bytes for 
5.8Ghz) to ff

***2.4ghz CRC bytes (two bytes starting at the following address)
mm.b 0x84001202
***set them to 0xff and 0xff

***5.8ghz CRC bytes (two bytes starting at the following address)
mm.b 0x84005202
***set them to 0xff and 0xff

***write the sector back into flash
protect off 0xbf05 0xbf05
erase 0xbf05 0xbf05
cp.b 0x8400 0xbf05 0x1
protect on 0xbf05 0xbf05

***display the updated information in flash
md 0xbf05
md 0xbf051200
md 0xbf055200

***reboot the board and let dd-wrt load, a failed EEPROM CRC error can be
***ignored for now, we can fix that later, use CTRL+C to exit the error
***then use boot to load dd-wrt

***then, when dd-wrt loads, login and do a dmesg | grep ath: and
***the failed CRC value will be displayed, make note of these two bytes
***we will write them into FLASH to make the CRC calculation of 0x
***come out corrently

***use the following commands to once again rewrite the ART area of the FLASH
***copy a flash sector out so we can edit it

cp.b 0xbf05 0x8400 0x1
***2.4ghz CRC bytes
mm.b 0x84001202

***5.8ghz CRC bytes
mm.b 0x84005202

***write the sector back into flash
protect off 0xbf05 0xbf05
erase 0xbf05 0xbf05
cp.b 0x8400 0xbf05 0x1
protect on 0xbf05 0xbf05

***to fix the EEPROM CRC failed error, erase the CRC enviornment variable
***it will be recreated on next reboot
setenv buf_crc
saveenv
reset


From: Dmytro [dioptimi...@gmail.com]
Sent: Friday, December 14, 2012 15:31
To: Drassal, Allan
Cc: U-Boot Mailing List
Subject: Re: Atheros ART data crc calculation

Hello again Allan,
Can you on work device (with correct ART section and with no checksum
error), enter the u-boot command - printenv ?
Also would you please share your ART section of the same device?

Idea is this, it is necessary to calculate the checksum of ART section
(only not clearly what part of the calculate, with empty sectors FF
or workspace) in CRC32 format, then correct this checksum in buf_crc
environment variable.

https://forum.openwrt.org/viewtopic.php?pid=153580#p153580

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


Re: [U-Boot] [PATCH resend] armv7/ltimer: Add support for local timer on armv7 cpus

2012-12-15 Thread Dennis Lan (dlan)
Hi


On Sat, Dec 15, 2012 at 6:20 AM, Wolfgang Denk w...@denx.de wrote:

 Dear Vipin Kumar,

 In message 50caf0cb.1050...@st.com you wrote:
  ping again

 pong ;-)

  On 12/6/2012 2:52 PM, Vipin KUMAR wrote:
   Certain ARMV7 cpus eg. CortexA9 contains a local and a global timer
 within the
   CPU core itself.  This patch adds generic support for local timer.

 What would be the use of such timer support?  Is there any code that
 actually needs it, and why does it need anything beyond the existing
 timer support we have?

Hi wolfgang:
  I think vipin here is trying to provide a generic timer support for ARMV7
architecture,
which contains private(local) and global timer. It's general a good thing
which means we can maximize the code usage..
  Actually I was planing to test the code, but haven't find the time yet ;-)

Hi vipin:
  why you only support local timer(private)? shouldn't it different to
support global timer too?


 Best regards,

 Wolfgang Denk

 --
 DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
 There is a time in the tides of men, Which, taken at its flood, leads
 on to success. On the other hand, don't count on it.   - T. K. Lawson
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

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