[U-Boot] please pull u-boot-arc master

2015-04-03 Thread Alexey Brodkin
Dear Tom,

The following changes since commit
8a5c9ca4d0b8aa13a1bb321494d24f656a9a7d72:

  Prepare v2015.04-rc5 (2015-03-31 20:53:59 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-arc.git 

for you to fetch changes up to d5717e894497124fd44289a37f818ee301640c70:

  board: AXS10x - update SDIO clock value (2015-04-03 09:47:50 +0300)


Alexey Brodkin (12):
  serial/serial_arc: set registers address during compilation
  arc: cache - build invalidate_icache_all() and
invalidate_dcache_all() always
  arc: merge common start-up code between ARC and ARCv2
  arc: move low-level interrupt and exception handlers in a separate
file
  arc: clean-up init procedure
  arc: re-generate defconfigs
  arc: get rid of CONFIG_SYS_GENERIC_GLOBAL_DATA
  arc: minor fixes in Kconfig
  serial-arc: switch to DM
  board: Switch Abilis TB-100 board to Driver Model for serial port
  arc: add support for SLC (System Level Cache, AKA L2-cache)
  board: AXS10x - update SDIO clock value

 arch/Kconfig|   1 +
 arch/arc/Kconfig|  10 ++-
 arch/arc/cpu/arcv1/Makefile |   2 +-
 arch/arc/cpu/arcv1/ivt.S|  27 
 arch/arc/cpu/arcv1/start.S  | 254
--
 arch/arc/cpu/arcv2/Makefile |   2 +-
 arch/arc/cpu/arcv2/ivt.S|  27 
 arch/arc/cpu/arcv2/start.S  | 254
--
 arch/arc/dts/Makefile   |  12 
 arch/arc/dts/abilis_tb100.dts   |  24 +++
 arch/arc/dts/arcangel4.dts  |  24 +++
 arch/arc/dts/skeleton.dtsi  |  13 
 arch/arc/include/asm/arcregs.h  |   4 ++
 arch/arc/include/asm/cache.h|  11 
 arch/arc/include/asm/config.h   |   1 -
 arch/arc/include/asm/init_helpers.h |  12 
 arch/arc/include/asm/relocate.h |  16 +
 arch/arc/include/asm/u-boot-arc.h   |   3 +
 arch/arc/lib/Makefile   |   3 +
 arch/arc/lib/cache.c|  58 +++--
 arch/arc/lib/cpu.c  |  13 
 arch/arc/lib/init_helpers.c |  25 
 arch/arc/lib/ints_low.S | 151

 arch/arc/lib/relocate.c |  19 ++
 arch/arc/lib/start.S|  63 +++
 board/synopsys/axs101/axs101.c  |   4 +-
 common/board_f.c|   8 +--
 configs/arcangel4-be_defconfig  |   9 ++-
 configs/arcangel4_defconfig |   7 ++-
 configs/axs101_defconfig|   6 +-
 configs/axs103_defconfig|   4 +-
 configs/tb100_defconfig |   9 ++-
 drivers/serial/serial_arc.c | 103
--
 include/configs/tb100.h |   6 +-
 34 files changed, 602 insertions(+), 583 deletions(-)
 create mode 100644 arch/arc/cpu/arcv1/ivt.S
 delete mode 100644 arch/arc/cpu/arcv1/start.S
 create mode 100644 arch/arc/cpu/arcv2/ivt.S
 delete mode 100644 arch/arc/cpu/arcv2/start.S
 create mode 100644 arch/arc/dts/Makefile
 create mode 100644 arch/arc/dts/abilis_tb100.dts
 create mode 100644 arch/arc/dts/arcangel4.dts
 create mode 100644 arch/arc/dts/skeleton.dtsi
 create mode 100644 arch/arc/include/asm/init_helpers.h
 create mode 100644 arch/arc/include/asm/relocate.h
 create mode 100644 arch/arc/lib/init_helpers.c
 create mode 100644 arch/arc/lib/ints_low.S
 create mode 100644 arch/arc/lib/start.S

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


Re: [U-Boot] PCIE Switch Support in u-boot-2015.01

2015-04-03 Thread Bin Meng
On Fri, Apr 3, 2015 at 2:32 PM, Ashish Khetan curieux.khe...@gmail.com wrote:
 Hi,
 I am using u-boot-2015.01 loader on MPC8641D based Board. I have following
 queries Related to PCIe bus
 1. Does it provide support to pcie switch(PES64H16AG2) support?
 2. Do I need any specific driver for this switch to make it up?

PCIe switch is nothing special but a PCI bridge from software
perspective. Current PCI enumeration process should work with any PCIe
switch. PES64H16AG2 should work without a specific driver unless it
has to do something to make it visible in the PCI configuration space.


 After booting its not showing any link the logs are:

 U-Boot 2015.01 (Mar 23 2015 - 16:02:00)

 CPU:   8641D, Version: 3.0, (0x80900130)
 Core:  e600 Core 0, Version: 2.2, (0x80040202)
 Clock Configuration:
CPU:1200 MHz, MPX:400  MHz
DDR:200  MHz (400 MT/s data rate), LBC:25   MHz
 L1:D-cache 32 KiB enabled
I-cache 32 KiB enabled
 L2:512 KiB enabled
 Board: ESM From Vrinda Technologies Pvt Ltd (ref: BOSS)
 I2C:   ready
 DRAM:  1 GiB
 Flash: 384 MiB
 SRIO1: enabled
 PCIe1: Root Complex, no link, regs @ 0xd0008000
 PCIe1: Bus 00 - 00
 In:serial
 Out:   serial
 Err:   serial
 Net:   eTSEC1 [PRIME], eTSEC2, eTSEC3, eTSEC4
 Hit any key to stop autoboot:  0

 Any pointers/debugging tips to bring it up will be really helpful


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


[U-Boot] PCIE Switch Support in u-boot-2015.01

2015-04-03 Thread Ashish Khetan
Hi,
I am using u-boot-2015.01 loader on MPC8641D based Board. I have following
queries Related to PCIe bus
1. Does it provide support to pcie switch(PES64H16AG2) support?
2. Do I need any specific driver for this switch to make it up?


After booting its not showing any link the logs are:

U-Boot 2015.01 (Mar 23 2015 - 16:02:00)

CPU:   8641D, Version: 3.0, (0x80900130)
Core:  e600 Core 0, Version: 2.2, (0x80040202)
Clock Configuration:
   CPU:1200 MHz, MPX:400  MHz
   DDR:200  MHz (400 MT/s data rate), LBC:25   MHz
L1:D-cache 32 KiB enabled
   I-cache 32 KiB enabled
L2:512 KiB enabled
Board: ESM From Vrinda Technologies Pvt Ltd (ref: BOSS)
I2C:   ready
DRAM:  1 GiB
Flash: 384 MiB
SRIO1: enabled
PCIe1: Root Complex, no link, regs @ 0xd0008000
PCIe1: Bus 00 - 00
In:serial
Out:   serial
Err:   serial
Net:   eTSEC1 [PRIME], eTSEC2, eTSEC3, eTSEC4
Hit any key to stop autoboot:  0

Any pointers/debugging tips to bring it up will be really helpful


Thanks  Regards
@$HI$H
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] patman: cover letter shows like 00/xx if more than 10 patches

2015-04-03 Thread Josh Wu
Make cover letter shows like 0/x, 00/xx and 000/xxx etc.

Signed-off-by: Josh Wu josh...@atmel.com
---

Changes in v2:
- use math.log10() function instead

 tools/patman/patchstream.py | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index 8c3a0ec..6d3c41f 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -3,6 +3,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+import math
 import os
 import re
 import shutil
@@ -468,8 +469,10 @@ def InsertCoverLetter(fname, series, count):
 prefix = series.GetPatchPrefix()
 for line in lines:
 if line.startswith('Subject:'):
-# TODO: if more than 10 patches this should save 00/xx, not 0/xx
-line = 'Subject: [%s 0/%d] %s\n' % (prefix, count, text[0])
+# if more than 10 or 100 patches, it should say 00/xx, 000/xxx, etc
+zero_repeat = int(math.log10(count)) + 1
+zero = '0' * zero_repeat
+line = 'Subject: [%s %s/%d] %s\n' % (prefix, zero, count, text[0])
 
 # Insert our cover letter
 elif line.startswith('*** BLURB HERE ***'):
-- 
1.9.1

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


Re: [U-Boot] [PATCH 1/3] common/armflash: Support for ARM flash images

2015-04-03 Thread Linus Walleij
On Mon, Mar 16, 2015 at 3:12 PM, Tom Rini tr...@konsulko.com wrote:
 On Mon, Mar 16, 2015 at 01:23:51PM +0100, Linus Walleij wrote:

 The ARM reference designs all use a special flash image format
 that stores a footer (two versions exist) at the end of the last
 erase block of the image in flash memory.

 Version one of the footer is indicated by the magic number
 0xA09F at 12 bytes before the end of the flash block and
 version two is indicated by the magic number 0x464F4F54 0x464C5348
 (ASCII for FLSHFOOT) in the very last 8 bytes of the erase block.

 This command driver implements support for both versions of the
 AFS images (the name comes from the Linux driver in drivers/mtd/afs.c)
 and makes it possible to list images and load an image by name into
 the memory with these commands:

 afs - lists flash contents
 afs load image - loads image to address indicated in the image
 afs load image addres - loads image to a specified address

 This image scheme is used on the ARM Integrator family, ARM
 Versatile family, ARM RealView family (not yet supported in U-Boot)
 and ARM Versatile Express family up to and including the new
 Juno board for 64 bit development.

 Signed-off-by: Linus Walleij linus.wall...@linaro.org

 Reviewed-by: Tom Rini tr...@konsulko.com

So who's picking up these three patches?

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


Re: [U-Boot] [RESEND] [PATCH] fastboot: Proper download gadget unregister and clear when cable is missing

2015-04-03 Thread Lukasz Majewski
Hi Marek,

 On Monday, March 30, 2015 at 10:06:13 AM, Lukasz Majewski wrote:
  Hi Paul,
  
   Signed-off-by: Paul Kocialkowski cont...@paulk.fr
   ---
   
common/cmd_fastboot.c | 2 ++
1 file changed, 2 insertions(+)
   
   diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
   index 346ab80..7956a5b 100644
   --- a/common/cmd_fastboot.c
   +++ b/common/cmd_fastboot.c
   @@ -23,6 +23,8 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int
   flag, int argc, char *const argv[]) if
   (!g_dnl_board_usb_cable_connected()) { puts(\rUSB cable not
   detected.\n \
   
  Command exit.\n);
   
   + g_dnl_unregister();
   + g_dnl_clear_detach();
   
 return CMD_RET_FAILURE;
 
 }
  
  This is just a minor comment - in your future patches please add
  some commit message even for this very short patch.
  
  Despite that,
  
  Acked-by: Lukasz Majewski l.majew...@samsung.com
  
  If other (Marek, Tom) don't mind I will take this through -dfu tree.
 
 Please do, thanks!
 
 btw. is this for current or next release ?
 
 Best regards,
 Marek Vasut

I thought to add this code in the next merge window, since now we have
-rc5.

The v2015.04 is scheduled for 13.04.

-- 
Best regards,

Lukasz Majewski

Samsung RD Institute Poland (SRPOL) | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RESEND] [PATCH] fastboot: Proper download gadget unregister and clear when cable is missing

2015-04-03 Thread Marek Vasut
On Friday, April 03, 2015 at 09:35:00 AM, Lukasz Majewski wrote:
 Hi Marek,
 
  On Monday, March 30, 2015 at 10:06:13 AM, Lukasz Majewski wrote:
   Hi Paul,
   
Signed-off-by: Paul Kocialkowski cont...@paulk.fr
---

 common/cmd_fastboot.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
index 346ab80..7956a5b 100644
--- a/common/cmd_fastboot.c
+++ b/common/cmd_fastboot.c
@@ -23,6 +23,8 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int
flag, int argc, char *const argv[]) if
(!g_dnl_board_usb_cable_connected()) { puts(\rUSB cable not
detected.\n \

 Command exit.\n);

+   g_dnl_unregister();
+   g_dnl_clear_detach();

return CMD_RET_FAILURE;

}
   
   This is just a minor comment - in your future patches please add
   some commit message even for this very short patch.
   
   Despite that,
   
   Acked-by: Lukasz Majewski l.majew...@samsung.com
   
   If other (Marek, Tom) don't mind I will take this through -dfu tree.
  
  Please do, thanks!
  
  btw. is this for current or next release ?
  
  Best regards,
  Marek Vasut
 
 I thought to add this code in the next merge window, since now we have
 -rc5.
 
 The v2015.04 is scheduled for 13.04.

Roger that, thanks!

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


Re: [U-Boot] [PATCH 1/3] common/armflash: Support for ARM flash images

2015-04-03 Thread Tom Rini
On Fri, Apr 03, 2015 at 12:20:48PM +0200, Linus Walleij wrote:
 On Mon, Mar 16, 2015 at 3:12 PM, Tom Rini tr...@konsulko.com wrote:
  On Mon, Mar 16, 2015 at 01:23:51PM +0100, Linus Walleij wrote:
 
  The ARM reference designs all use a special flash image format
  that stores a footer (two versions exist) at the end of the last
  erase block of the image in flash memory.
 
  Version one of the footer is indicated by the magic number
  0xA09F at 12 bytes before the end of the flash block and
  version two is indicated by the magic number 0x464F4F54 0x464C5348
  (ASCII for FLSHFOOT) in the very last 8 bytes of the erase block.
 
  This command driver implements support for both versions of the
  AFS images (the name comes from the Linux driver in drivers/mtd/afs.c)
  and makes it possible to list images and load an image by name into
  the memory with these commands:
 
  afs - lists flash contents
  afs load image - loads image to address indicated in the image
  afs load image addres - loads image to a specified address
 
  This image scheme is used on the ARM Integrator family, ARM
  Versatile family, ARM RealView family (not yet supported in U-Boot)
  and ARM Versatile Express family up to and including the new
  Juno board for 64 bit development.
 
  Signed-off-by: Linus Walleij linus.wall...@linaro.org
 
  Reviewed-by: Tom Rini tr...@konsulko.com
 
 So who's picking up these three patches?

I will, post release.

-- 
Tom


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


Re: [U-Boot] [PATCH v3 13/17] doc: driver-model: pmic and regulator uclass documentation

2015-04-03 Thread Przemyslaw Marczak

Hello Simon,

On 03/29/2015 03:08 PM, Simon Glass wrote:

Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
---
Changes v2, V3:
- update documentation with the framework api changes
- remove doc file name 'dm' prefix
---
  doc/driver-model/pmic-framework.txt | 350 
  1 file changed, 350 insertions(+)
  create mode 100644 doc/driver-model/pmic-framework.txt

diff --git a/doc/driver-model/pmic-framework.txt 
b/doc/driver-model/pmic-framework.txt
new file mode 100644
index 000..72651dc
--- /dev/null
+++ b/doc/driver-model/pmic-framework.txt
@@ -0,0 +1,350 @@
+#
+# (C) Copyright 2014-2015 Samsung Electronics
+# Przemyslaw Marczak p.marc...@samsung.com
+#
+# SPDX-License-Identifier:  GPL-2.0+
+#
+
+PMIC framework based on Driver Model
+
+TOC:
+1. Introduction
+2. How does it work
+3. Pmic driver api
+4. Pmic driver
+5. Pmic command
+6. Regulator driver api
+7. Regulator driver
+8. Regulator command
+
+1. Introduction
+===
+This is an introduction to driver-model multi uclass PMIC devices support.
+At present it is based on two uclass types:
+
+- UCLASS_PMIC  - basic uclass type for PMIC I/O, which provides common
+ read/write interface.
+- UCLASS_REGULATOR - additional uclass type for specific PMIC features, which
+ are various voltage regulators.
+
+New files:
+UCLASS_PMIC:
+- drivers/power/pmic-uclass.c
+- include/power/pmic.h
+UCLASS_REGULATOR:
+- drivers/power/regulator-uclass.c
+- include/power/regulator.h
+
+Commands:
+- lib/cmd_pmic.c
+- lib/cmd_regulator.c
+
+2. How doees it work
+
+The Power Management Integrated Circuits (PMIC) are used in embedded systems
+to provide stable, precise and specific voltage power source with over-voltage
+and thermal protection circuits.
+
+The single PMIC can provide various functionalities with single or multiple
+interfaces, like in the example below.
+
+-- SoC
+ |
+ |__
+ | BUS 0 |   Multi interface PMIC IC|-- LDO out 1
+ | e.g.I2C0  |  |-- LDO out N
+ |---| PMIC device 0 (READ/WRITE ops)   |
+ | or SPI0   ||_ REGULATOR device (ldo/... ops) |-- BUCK out 1
+ |   ||_ CHARGER device (charger ops)   |-- BUCK out M
+ |   ||_ MUIC device (microUSB con ops) |
+ | BUS 1 ||_ ...|--- BATTERY
+ | e.g.I2C1  |  |
+ |---| PMIC device 1 (READ/WRITE ops)   |--- USB in 1
+ . or SPI1   ||_ RTC device (rtc ops)   |--- USB in 2
+ .   |__|--- USB out
+ .
+
+Since U-Boot provides driver model features for I2C and SPI bus drivers,
+the PMIC devices should also support this. With the new basic uclass types
+for PMIC I/O and regulator features, PMIC drivers can simply provide common
+features, with multiple interface and instance support.
+
+Basic design assumptions:
+
+- Common I/O api - UCLASS_PMIC
+The main assumption is to use UCLASS_PMIC device to provide I/O interface,


an I/O interface


+for devices other uclass types. It is no matter what is the type of device
+physical I/O interface.


devices of other uclass types. It doesn't matter what type of physical
I/O interface is used.


Usually PMIC devices are using SPI or I2C interface,

s/are using/use/


+but use of any other interface (e.g. when PMIC is not directly connected
+to the SoC) - is now possible. Drivers can use the same read/write api.
+
+- Common regulator api - UCLASS_REGULATOR
+For setting the attributes of verious types of regulators with common api,


various

with a common


+this uclass can be implemented. This allows to drive the each regulator output


allows driving each regulator's output


+value, on/off state and custom defined operation modes. It also provides the


custom-defined

or perhaps just 'particular'


+user interface for all operations.
+For the very simple implementation, the regulator drivers are not required,


For simple implementations, regulator drivers are not required, so the
code can use pmic read/write directly.


+so the code could base on pmic read/write only.
+
+When board device-tree file includes pmic subnode and the U_Boot compatible
+driver exists, then the pmic device bind should looks like this:
+
+|_ root - will bind the device for I2C/SPI bus node
+  |_ i2c/spi - should bind a device for pmic node
+|_ pmic (parent) - should bind child devices for its features
+  |_ regulator (child)
+  |_ charger   (child)
+  |_ other (child)
+
+Usually PMIC design provides:
+ - single I/O interface (single UCLASS_PMIC driver)
+   Then UCLASS_PMIC device should be a parent of all pmic devices, where each
+   is usually different uclass type, but 

Re: [U-Boot] [PATCH v3 15/17] odroid: board: add support to dm pmic api

2015-04-03 Thread Przemyslaw Marczak

Hello Simon,

On 03/29/2015 03:08 PM, Simon Glass wrote:

  Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:

This commit change the old pmic framework calls with the new ones.

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
---
Changes v2:
- remove board_init_i2c() call
- update regulator calls
- update headers
- samsung/misc.c: include required header

Changes v3:
- adjust regulator calls to new api
---
  board/samsung/common/misc.c   |   1 +
  board/samsung/odroid/odroid.c | 113 +-
  2 files changed, 91 insertions(+), 23 deletions(-)

diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 1a77c82..f0d69d4 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -16,6 +16,7 @@
  #include asm/arch/cpu.h
  #include asm/gpio.h
  #include linux/input.h
+#include dm.h
  #include power/pmic.h
  #include mmc.h

diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c
index ae41c29..aa3b0ff 100644
--- a/board/samsung/odroid/odroid.c
+++ b/board/samsung/odroid/odroid.c
@@ -12,7 +12,9 @@
  #include asm/arch/gpio.h
  #include asm/gpio.h
  #include asm/arch/cpu.h
+#include dm.h
  #include power/pmic.h
+#include power/regulator.h
  #include power/max77686_pmic.h
  #include errno.h
  #include mmc.h
@@ -405,15 +407,62 @@ static void board_gpio_init(void)

  static int pmic_init_max77686(void)
  {
-   struct pmic *p = pmic_get(MAX77686_PMIC);
+   struct udevice *dev;
+   int ret;

-   if (pmic_probe(p))
-   return -ENODEV;
+   ret = regulator_get(VDDQ_EMMC_1.8V, dev);
+   if (ret) {
+   error(Regulator get error: %d, ret);
+   return ret;
+   }
+
+   ret = regulator_set_value(dev, 180);
+   if (ret) {
+   error(Regulator %s value setting error: %d, dev-name, ret);
+   return ret;
+   }
+
+   ret = regulator_set_enable(dev, true);
+   if (ret) {
+   error(Regulator %s enable error: %d, dev-name, ret);
+   return ret;
+   }


How about adding a function that finds a regulator, sets its voltage
and enables it? Then you can avoid duplicating the same code 3 times.



Yes, will add something like this.


+
+   ret = regulator_get(TFLASH_2.8V, dev);
+   if (ret) {
+   error(Regulator get error: %d, ret);
+   return ret;
+   }
+
+   ret = regulator_set_value(dev, 280);
+   if (ret) {
+   error(Regulator %s value setting error: %d, dev-name, ret);
+   return ret;
+   }
+
+   ret = regulator_set_enable(dev, true);
+   if (ret) {
+   error(Regulator %s enable error: %d, dev-name, ret);
+   return ret;
+   }
+
+   ret = regulator_get(VDDQ_EMMC_2.8V, dev);
+   if (ret) {
+   error(Regulator get error: %d, ret);
+   return ret;
+   }

-   /* Set LDO Voltage */
-   max77686_set_ldo_voltage(p, 20, 180);   /* LDO20 eMMC */
-   max77686_set_ldo_voltage(p, 21, 280);   /* LDO21 SD */
-   max77686_set_ldo_voltage(p, 22, 280);   /* LDO22 eMMC */
+   ret = regulator_set_value(dev, 280);
+   if (ret) {
+   error(Regulator %s value setting error: %d, dev-name, ret);
+   return ret;
+   }
+
+   ret = regulator_set_enable(dev, true);
+   if (ret) {
+   error(Regulator %s enable error: %d, dev-name, ret);
+   return ret;
+   }

 return 0;
  }
@@ -434,7 +483,6 @@ int exynos_init(void)

  int exynos_power_init(void)
  {
-   pmic_init(0);
 pmic_init_max77686();

 return 0;
@@ -443,19 +491,20 @@ int exynos_power_init(void)
  #ifdef CONFIG_USB_GADGET
  static int s5pc210_phy_control(int on)
  {
-   struct pmic *p_pmic;
-
-   p_pmic = pmic_get(MAX77686_PMIC);
-   if (!p_pmic)
-   return -ENODEV;
+   struct udevice *dev;
+   int ret;

-   if (pmic_probe(p_pmic))
-   return -1;
+   ret = regulator_get(VDD_UOTG_3.0V, dev);
+   if (ret) {
+   error(Regulator get error: %d, ret);
+   return ret;
+   }

 if (on)
-   return max77686_set_ldo_mode(p_pmic, 12, OPMODE_ON);
+   return regulator_set_mode(dev, OPMODE_ON);
 else
-   return max77686_set_ldo_mode(p_pmic, 12, OPMODE_LPM);
+   return regulator_set_mode(dev, OPMODE_LPM);
+
  }

  struct s3c_plat_otg_data s5pc210_otg_data = {
@@ -472,7 +521,8 @@ struct s3c_plat_otg_data s5pc210_otg_data = {
  int board_usb_init(int index, enum usb_init_type init)
  {
  #ifdef CONFIG_CMD_USB
-   struct pmic *p_pmic;
+   struct udevice *dev;
+   int ret;

 /* Set Ref freq 0 = 24MHz, 1 = 26MHz*/
 /* Odroid Us have it at 24MHz, Odroid Xs at 26MHz */
@@ -490,14 +540,31 @@ int 

Re: [U-Boot] [PATCH v3 17/17] odroid: config: enable dm pmic, dm regulator and max77686 driver

2015-04-03 Thread Przemyslaw Marczak

Hello Simon,

On 03/29/2015 03:10 PM, Simon Glass wrote:

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:

This change enables the configs required to init and setup max77686
regulator driver, using the new driver model pmic and regulator API.

This commits enables:
- CONFIG_ERRNO_STR
- CONFIG_DM_PMIC
- CONFIG_DM_PMIC_CMD
- CONFIG_DM_PMIC_MAX77686
- CONFIG_DM_REGULATOR
- CONFIG_DM_REGULATOR_CMD
- CONFIG_DM_REGULATOR_MAX77686

And removes the unused:
- CONFIG_DM_I2C_COMPAT
- CONFIG_POWER
- CONFIG_POWER_I2C
- CONFIG_POWER_MAX77686

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com


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

(but pelase rename the commands so that they are CONFIG_CMD_DM_PCI and
CONFIG_CMD_DM_REGULATOR)



Yes, will do this.


---
Changes V2:
- config: enable dm i2c; cleanup
- remove CONFIG_DM_I2C_COMPAT
- enable regulator command

Changes V3:
- move options to defconfig
---
  configs/odroid_defconfig | 8 +++-
  include/configs/odroid.h | 5 -
  2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/configs/odroid_defconfig b/configs/odroid_defconfig
index d32b5b5..1e29abe 100644
--- a/configs/odroid_defconfig
+++ b/configs/odroid_defconfig
@@ -4,5 +4,11 @@ CONFIG_TARGET_ODROID=y
  CONFIG_OF_CONTROL=y
  CONFIG_DEFAULT_DEVICE_TREE=exynos4412-odroid
  CONFIG_DM_I2C=y
-CONFIG_DM_I2C_COMPAT=y
  # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_ERRNO_STR=y
+CONFIG_DM_PMIC=y
+CONFIG_DM_PMIC_CMD=y
+CONFIG_DM_PMIC_MAX77686=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_CMD=y
+CONFIG_DM_REGULATOR_MAX77686=y
diff --git a/include/configs/odroid.h b/include/configs/odroid.h
index 5ee0abe..3874baa 100644
--- a/include/configs/odroid.h
+++ b/include/configs/odroid.h
@@ -182,11 +182,6 @@
  #define CONFIG_SYS_I2C_S3C24X0_SPEED   10
  #define CONFIG_SYS_I2C_S3C24X0_SLAVE   0

-/* POWER */
-#define CONFIG_POWER
-#define CONFIG_POWER_I2C
-#define CONFIG_POWER_MAX77686
-
  /* GPT */
  #define CONFIG_RANDOM_UUID

--
1.9.1





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


[U-Boot] [PATCH 1/4] mtd: vf610_nfc: use in-band bad block table

2015-04-03 Thread Stefan Agner
Use in-band bad block table (NAND_BBT_NO_OOB) which allows to
use the full OOB for hardare ECC purposes. Since there is no
ECC correction on the OOB it is also safer to use in-band area
to store the bad block table marker.

Signed-off-by: Stefan Agner ste...@agner.ch
---
 drivers/mtd/nand/vf610_nfc.c | 29 ++---
 1 file changed, 2 insertions(+), 27 deletions(-)

diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index 75c2493..8608ac3 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -155,29 +155,6 @@ struct vf610_nfc {
 #define mtd_to_nfc(_mtd) \
(struct vf610_nfc *)((struct nand_chip *)_mtd-priv)-priv
 
-static u8 bbt_pattern[] = {'B', 'b', 't', '0' };
-static u8 mirror_pattern[] = {'1', 't', 'b', 'B' };
-
-static struct nand_bbt_descr bbt_main_descr = {
-   .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE |
-  NAND_BBT_2BIT | NAND_BBT_VERSION,
-   .offs = 11,
-   .len = 4,
-   .veroffs = 15,
-   .maxblocks = 4,
-   .pattern = bbt_pattern,
-};
-
-static struct nand_bbt_descr bbt_mirror_descr = {
-   .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE |
-  NAND_BBT_2BIT | NAND_BBT_VERSION,
-   .offs = 11,
-   .len = 4,
-   .veroffs = 15,
-   .maxblocks = 4,
-   .pattern = mirror_pattern,
-};
-
 static struct nand_ecclayout vf610_nfc_ecc45 = {
.eccbytes = 45,
.eccpos = {19, 20, 21, 22, 23,
@@ -622,10 +599,8 @@ static int vf610_nfc_nand_init(int devnum, void __iomem 
*addr)
 
/* Bad block options. */
if (cfg.flash_bbt)
-   chip-bbt_options = NAND_BBT_USE_FLASH | NAND_BBT_CREATE;
-
-   chip-bbt_td = bbt_main_descr;
-   chip-bbt_md = bbt_mirror_descr;
+   chip-bbt_options = NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB |
+   NAND_BBT_CREATE;
 
/* Set configuration register. */
vf610_nfc_clear(mtd, NFC_FLASH_CONFIG, CONFIG_ADDR_AUTO_INCR_BIT);
-- 
2.3.5

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


[U-Boot] [PATCH 2/4] mtd: vf610_nfc: add Freescale NFC controller configs to Kconfig

2015-04-03 Thread Stefan Agner
This commit allows users to enable/disable the Freescale NFC
controller found in systems like Vybrid (VF610), MPC5125, MCF54418
or Kinetis K70 via Kconfig with more detailed help docs.

Signed-off-by: Stefan Agner ste...@agner.ch
---
 configs/vf610twr_defconfig |  2 ++
 drivers/mtd/nand/Kconfig   | 15 +++
 include/configs/vf610twr.h |  3 ---
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/configs/vf610twr_defconfig b/configs/vf610twr_defconfig
index 7de374a..5e0ac9f 100644
--- a/configs/vf610twr_defconfig
+++ b/configs/vf610twr_defconfig
@@ -1,3 +1,5 @@
 
CONFIG_SYS_EXTRA_OPTIONS=IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_MMC
 CONFIG_ARM=y
 CONFIG_TARGET_VF610TWR=y
+CONFIG_NAND_VF610_NFC=y
+CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 72825c3..8056c06 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -32,6 +32,21 @@ config NAND_DENALI_SPARE_AREA_SKIP_BYTES
  of OOB area before last ECC sector data starts.  This is potentially
  used to preserve the bad block marker in the OOB area.
 
+config NAND_VF610_NFC
+   bool Support for Freescale NFC for VF610/MPC5125
+   select SYS_NAND_SELF_INIT
+   help
+ Enables support for NAND Flash Controller on some Freescale
+ processors like the VF610, MPC5125, MCF54418 or Kinetis K70.
+ The driver supports a maximum 2k page size. The driver
+ currently does not support hardware ECC.
+
+config SYS_NAND_BUSWIDTH_16BIT
+   bool Use 16-bit NAND interface
+   depends on NAND_VF610_NFC
+   help
+ Use 16-bit wide NAND flash interface.
+
 if SPL
 
 config SPL_NAND_DENALI
diff --git a/include/configs/vf610twr.h b/include/configs/vf610twr.h
index 05bc7d0..621aa13 100644
--- a/include/configs/vf610twr.h
+++ b/include/configs/vf610twr.h
@@ -50,10 +50,7 @@
 #define CONFIG_CMD_NAND_TRIMFFS
 
 #ifdef CONFIG_CMD_NAND
-#define CONFIG_NAND_VF610_NFC
-#define CONFIG_SYS_NAND_SELF_INIT
 #define CONFIG_USE_ARCH_MEMCPY
-#define CONFIG_SYS_NAND_BUSWIDTH_16BIT
 #define CONFIG_SYS_MAX_NAND_DEVICE 1
 #define CONFIG_SYS_NAND_BASE   NFC_BASE_ADDR
 
-- 
2.3.5

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


[U-Boot] [PATCH 3/4] mtd: vf610_nfc: add 32-error correction option for HW ECC

2015-04-03 Thread Stefan Agner
Add option to choose between current 24-error correction and 32-error
correction through Kconfig. 32-error correction allow to use NAND
chips which require up to 8-bit error correction per 512 byte (when
using 2K pages).

Signed-off-by: Stefan Agner ste...@agner.ch
---
 drivers/mtd/nand/Kconfig | 15 +++
 drivers/mtd/nand/vf610_nfc.c | 38 --
 2 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 8056c06..ca14cc2 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -47,6 +47,21 @@ config SYS_NAND_BUSWIDTH_16BIT
help
  Use 16-bit wide NAND flash interface.
 
+choice
+   prompt Hardware ECC strength
+   depends on NAND_VF610_NFC
+   default SYS_NAND_VF610_NFC_45_ECC_BYTES
+   help
+ Select the ECC strength used in the hardware BCH ECC block.
+
+config SYS_NAND_VF610_NFC_45_ECC_BYTES
+   bool 24-error correction (45 ECC bytes)
+
+config SYS_NAND_VF610_NFC_60_ECC_BYTES
+   bool 32-error correction (60 ECC bytes)
+
+endchoice
+
 if SPL
 
 config SPL_NAND_DENALI
diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index 8608ac3..a8af00e 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -71,6 +71,7 @@
 /* NFC ECC mode define */
 #define ECC_BYPASS 0
 #define ECC_45_BYTE6
+#define ECC_60_BYTE7
 
 /*** Register Mask and bit definitions */
 
@@ -155,7 +156,10 @@ struct vf610_nfc {
 #define mtd_to_nfc(_mtd) \
(struct vf610_nfc *)((struct nand_chip *)_mtd-priv)-priv
 
-static struct nand_ecclayout vf610_nfc_ecc45 = {
+#if defined (CONFIG_SYS_NAND_VF610_NFC_45_ECC_BYTES)
+#define ECC_HW_MODE ECC_45_BYTE
+
+static struct nand_ecclayout vf610_nfc_ecc = {
.eccbytes = 45,
.eccpos = {19, 20, 21, 22, 23,
   24, 25, 26, 27, 28, 29, 30, 31,
@@ -167,6 +171,24 @@ static struct nand_ecclayout vf610_nfc_ecc45 = {
{.offset = 8,
 .length = 11} }
 };
+#elif defined (CONFIG_SYS_NAND_VF610_NFC_60_ECC_BYTES)
+#define ECC_HW_MODE ECC_60_BYTE
+
+static struct nand_ecclayout vf610_nfc_ecc = {
+   .eccbytes = 60,
+   .eccpos = { 4,  5,  6,  7,  8,  9, 10, 11,
+  12, 13, 14, 15, 16, 17, 18, 19,
+  20, 21, 22, 23, 24, 25, 26, 27,
+  28, 29, 30, 31, 32, 33, 34, 35,
+  36, 37, 38, 39, 40, 41, 42, 43,
+  44, 45, 46, 47, 48, 49, 50, 51,
+  52, 53, 54, 55, 56, 57, 58, 59,
+  60, 61, 62, 63 },
+   .oobfree = {
+   {.offset = 2,
+.length = 2} }
+};
+#endif
 
 static inline u32 vf610_nfc_read(struct mtd_info *mtd, uint reg)
 {
@@ -333,7 +355,7 @@ static void vf610_nfc_command(struct mtd_info *mtd, 
unsigned command,
vf610_nfc_send_commands(nfc-regs, NAND_CMD_SEQIN,
command, PROGRAM_PAGE_CMD_CODE);
vf610_nfc_addr_cycle(mtd, column, page);
-   vf610_nfc_ecc_mode(mtd, ECC_45_BYTE);
+   vf610_nfc_ecc_mode(mtd, ECC_HW_MODE);
break;
 
case NAND_CMD_RESET:
@@ -362,7 +384,7 @@ static void vf610_nfc_command(struct mtd_info *mtd, 
unsigned command,
vf610_nfc_send_commands(nfc-regs, NAND_CMD_READ0,
NAND_CMD_READSTART, READ_PAGE_CMD_CODE);
vf610_nfc_addr_cycle(mtd, column, page);
-   vf610_nfc_ecc_mode(mtd, ECC_45_BYTE);
+   vf610_nfc_ecc_mode(mtd, ECC_HW_MODE);
break;
 
case NAND_CMD_ERASE1:
@@ -643,17 +665,21 @@ static int vf610_nfc_nand_init(int devnum, void __iomem 
*addr)
goto error;
}
 
-   chip-ecc.layout = vf610_nfc_ecc45;
-
/* propagate ecc.layout to mtd_info */
mtd-ecclayout = chip-ecc.layout;
chip-ecc.read_page = vf610_nfc_read_page;
chip-ecc.write_page = vf610_nfc_write_page;
chip-ecc.mode = NAND_ECC_HW;
 
-   chip-ecc.bytes = 45;
chip-ecc.size = PAGE_2K;
+   chip-ecc.layout = vf610_nfc_ecc;
+#if defined(CONFIG_SYS_NAND_VF610_NFC_45_ECC_BYTES)
chip-ecc.strength = 24;
+   chip-ecc.bytes = 45;
+#elif defined(CONFIG_SYS_NAND_VF610_NFC_60_ECC_BYTES)
+   chip-ecc.strength = 32;
+   chip-ecc.bytes = 60;
+#endif
 
/* Enable ECC_STATUS */
vf610_nfc_set(mtd, NFC_FLASH_CONFIG, CONFIG_ECC_SRAM_REQ_BIT);
-- 
2.3.5

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


Re: [U-Boot] [PATCH v3 00/17] Power(full) framework based on Driver Model

2015-04-03 Thread Przemyslaw Marczak

Hello Simon,

On 03/29/2015 03:05 PM, Simon Glass wrote:

Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:

Hello,
Here is the third RFC version of the new PMIC framework.Big thanks to
Simon Glass, your comments were really helpful, and I think, that this
version is much more better to discuss, than the previous. The changes
made in this version are described below each commit. Sorry that I didn't
reply to each patch, I agreed with most and just started the work.


This is looking really good. Here are a few overall comments.

1. There is one oddity that I'd like to address before merging.

I don't think the fdt_node_check_prop_compatible() is a good idea, nor
necessary. I don't think we should consider the regulator-compatible
property to be a compatible string. It has values like LDO8, LDO9 and
these don't look like compatible strings, which are normally unique
and point to a driver. Here they point to a particular device.



Right, those compatibles don't point to a driver. This is a specific 
case of use from the kernel.



A similar problem is faced in pinctrl and if you look at
gpio_exynos_bind() you will see that it works through the sub-nodes,
creating devices as needed.

I don't think using udevice_id is right here either.



Yes, I know how it's done. But we haven't the compatibles for each GPIO 
as for the regulators, and each GPIO driver, bind the childs by its own 
implementation.


I tried to reuse the existing code. It was nice, but I missed one 
thing...if there are more, than one driver with the same e.g. LDO1 
compatible, then the first one will bind - and it could be the wrong one...


But, it could be tune-up, to get the right drivers list by arg.


Here is my suggestion:

a. Create a new structure like this:

struct pmic_child_info {
const char *prefix;   // LDO or BUCK
const char *driver_name;   // max77686_ldo or max77686_buck
};

b. Pass a list of these to pmic_child_node_scan(). In your case there
will be three entries, one for LDO, one for BUCK, plus a NULL
termination entry,



Ok, this could be good.


c. It can work through the subnodes looking for the given prefixes. It
then calls device_bind_driver() on each. Then it changes the returned
device's of_data to hold the correct value (obtained with strtol() on
the part of the name that follows the prefix - e.g. 17 for LDO17).
This will be easier if you rebase on u-boot-dm/usb-working, where the
data is just a long, not a device tree pointer.


Yes, it's easy. I made something like this in the first version of this 
patchset, to parse the nodes and fill the max77686 regulator descriptors 
in function get_desc_for_compat(), from this patch:

http://lists.denx.de/pipermail/u-boot/2014-October/191024.html



d. Now you have the same effect as before, but you can drop the tables
like max77686_ldo_ids[] and avoid misappropriating driver model's
device lookup.


Yes, this is an advantage.

I wonder about the usage of struct udevice_id, which should contain 
the data, defined only by the driver, right?


In the method you mentioned, we bind the pmic childs and then
we modify the dev-of_id-data by putting the regulator number from 
matched prefix in it.


This is ok, but I think, that the second part of this idea should be 
done by the driver. I think, that the external function shouldn't modify 
this driver data on bind.


This could be solved by leave this job for the device driver. For 
example on max77686, we could leave the dev-of_id as null and use 
dev-priv for the node prefix id.


So, it's not a big problem.

Here, I would like mention the problem with the regulator_get() by name, 
for which we want use the regulator-name constraint.


For this version, it requires probing of all regulator devices,
since it uses the dev-uclass_priv, which I think, is a good place to 
provide the framework-specific structure type for regulator constraints 
and mode descriptors.


What about moving it back to dev-platdata?
Then:
- the structure type: dm_regulator_info, will move to 
dm_regulator_platdata


- only its .name field could be assigned at regulator bind stage from 
the regulator-name constraint


- the bind could fail, when the constraint name not found

- the rest of constraints will assign in .ofdata_to_platdata() function 
call as it is at the present version


Then, we also don't need probe each regulator device, when using 
regulator_get() function.




2. Should we put the regulator stuff in drivers/regulator, as with Linux?


I will do this in the next version.



3. Can you please bring in the regulator and pmic device tree binding
files, plus max77686?


Right, I forgot about this.



4. We really do need tests! I suspect that you could create a sandbox
I2C pmic that has a few registers and regulators. See
i2c_eeprom_emul.c for a basic example. Then you can write some tests
that find the pmi,c find the regulator, read and write a few
registers, and read and write a few 

[U-Boot] [PATCH 4/4] mtd: vf610_nfc: support subpage write

2015-04-03 Thread Stefan Agner
Support subpage writes using a custom implementation of write_subpage.
The driver loads the page into SRAM buffer using NAND_CMD_READ0, when
the framework requests the NAND_CMD_SEQIN command. Then, the buffer is
updated by the custom write_subpage implementation. Upon write, the
controller calculates the hardware ECC across the whole page before
programming the page.

This method saves transferring the whole page over the bus to the NFC
IP, which would happen when using NAND_NO_SUBPAGE_WRITE.

Signed-off-by: Stefan Agner ste...@agner.ch
---
This implements the procedure as discussed on the ML:
http://lists.denx.de/pipermail/u-boot/2015-March/209567.html
http://lists.denx.de/pipermail/u-boot/2015-March/209671.html

The drivers mxc_nand and mpc5121_nfc implement a similar subpage write.

 drivers/mtd/nand/vf610_nfc.c | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index a8af00e..d552bed 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -566,6 +566,19 @@ static int vf610_nfc_write_page(struct mtd_info *mtd, 
struct nand_chip *chip,
return 0;
 }
 
+static int vf610_nfc_write_subpage(struct mtd_info *mtd, struct nand_chip 
*chip,
+   uint32_t offset, uint32_t data_len,
+   const uint8_t *buf, int oob_required)
+{
+   struct vf610_nfc *nfc = mtd_to_nfc(mtd);
+   nfc-column = offset;
+   vf610_nfc_write_buf(mtd, buf, data_len);
+   if (oob_required)
+   vf610_nfc_write_buf(mtd, chip-oob_poi, mtd-oobsize);
+
+   return 0;
+}
+
 struct vf610_nfc_config {
int hardware_ecc;
int width;
@@ -608,9 +621,6 @@ static int vf610_nfc_nand_init(int devnum, void __iomem 
*addr)
vf610_nfc_clear(mtd, NFC_FLASH_CONFIG, CONFIG_16BIT);
}
 
-   /* Disable subpage writes as we do not provide ecc-hwctl */
-   chip-options |= NAND_NO_SUBPAGE_WRITE;
-
chip-dev_ready = vf610_nfc_dev_ready;
chip-cmdfunc = vf610_nfc_command;
chip-read_byte = vf610_nfc_read_byte;
@@ -669,6 +679,7 @@ static int vf610_nfc_nand_init(int devnum, void __iomem 
*addr)
mtd-ecclayout = chip-ecc.layout;
chip-ecc.read_page = vf610_nfc_read_page;
chip-ecc.write_page = vf610_nfc_write_page;
+   chip-ecc.write_subpage = vf610_nfc_write_subpage;
chip-ecc.mode = NAND_ECC_HW;
 
chip-ecc.size = PAGE_2K;
-- 
2.3.5

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


Re: [U-Boot] [PATCH v2 1/7] arc: cache - build invalidate_icache_all() and invalidate_dcache_all() always

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
 Make both invalidate_icache_all() and invalidate_dcache_all() available
 even if U-Boot is configured with CONFIG_SYS_DCACHE_OFF and/or
 CONFIG_SYS_ICACHE_OFF.
 
 This is useful because configuration of U-Boot may not match actual
 hardware features. Real board may have cache(s) but for some reason we
 may want to run U-Boot with cache(s) disabled (for example if some
 peripherals work improperly with existing drivers if data cache is
 enabled). So board may start with cache(s) enabled (that's the case for
 ARC cores with built-in caches) but early in U-Boot we disable cache(s)
 and make sure all contents of data cache gets flushed in RAM.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Applied, thanks.

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


Re: [U-Boot] [PATCH v2 3/7] arc: move low-level interrupt and exception handlers in a separate file

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
 This separation makes maintenance of code easier because those low-level
 interrupt- or exception handling routines are pretty static and usually
 require not much care while start-up code is a subject of modifications
 and enhancements.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Applied, thanks.

-Alexey

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


Re: [U-Boot] [PATCH v2 2/7] arc: merge common start-up code between ARC and ARCv2

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
 Even though ARCompact and ARCv2 are not binary compatible most of
 assembly instructions are used in both. With this change we'll get rid
 of duplicate code.
 
 Still IVTs are implemented differently so we're keeping them in separate
 files.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 ---

Applied, thanks.

-Alexey

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


Re: [U-Boot] [PATCH v2 4/7] arc: clean-up init procedure

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
 Intention behind this work was elimination of as much assembly-written
 code as it is possible.
 
 In case of ARC we already have relocation fix-up implemented in C so why
 don't we use C for U-Boot copying, .bss zeroing etc.
 
 It turned out x86 uses pretty similar approach so we re-used parts of
 code in board_f.c initially implemented for x86.
 
 Now assembly usage during init is limited to stack- and frame-pointer
 setup before and after relocation.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 Cc: Simon Glass s...@chromium.org

Applied, thanks.

-Alexey

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


Re: [U-Boot] [PATCH v2 5/7] arc: re-generate defconfigs

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
 Before that moment our defconfigs were manually modified with addition
 of new options. That means once anybody wants to add another option and
 re-genarate defconfig with make defconfig there will be lots of
 differences. So to make future modifications more clean we'll do bulk
 re-generation right away.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 Cc: Masahiro Yamada yamada.masah...@socionext.com

Applied, thanks.

-Alexey

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


Re: [U-Boot] [PATCH v3 06/17] dm: regulator: add implementation of driver model regulator uclass

2015-04-03 Thread Przemyslaw Marczak

Hello Simon,

On 03/29/2015 03:07 PM, Simon Glass wrote:

Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:

This is the implementation of driver model regulator uclass api.
To use it, the CONFIG_DM_PMIC is required with driver implementation,
since it provides pmic devices basic I/O API.

To get the regulator device:
- regulator_get() - get the regulator device

The regulator framework is based on a 'struct dm_regulator_ops'.
It provides a common function calls, for it's basic features:
- regulator_info()- get the regulator info structure
- regulator_mode()- get the regulator mode info structure
- regulator_get/set_value()   - get/set the regulator output voltage
- regulator_get/set_current() - get/set the regulator output current
- regulator_get/set_enable()  - get/set the regulator output enable state
- regulator_get/set_mode()- get/set the regulator output operation mode

An optional and useful regulator framework features are two descriptors:
- struct dm_regulator_info- describes the regulator name and output value limits

- struct dm_regulator_mode - (array) describes the regulators operation modes

The regulator framework features are described in file:
- include/power/regulator.h

Main files:
- drivers/power/regulator-uclass.c - provides regulator common functions api
- include/power/regulator.h - define all structures required by the regulator

Changes:
- new uclass-id: UCLASS_PMIC_REGULATOR
- new config: CONFIG_DM_REGULATOR

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
---
Changes V2:
- new operations for regulator uclass:
-- get/set output state - for output on/off setting
--- add enum: REGULATOR_OFF, REGULATOR_ON

- regulator uclass code rework and cleanup:
-- change name of:
--- enum 'regulator_desc_type' to 'regulator_type'
--- add type DVS
--- struct 'regulator_desc' to 'regulator_value_desc'

-- regulator ops function calls:
--- remove 'ldo/buck' from naming
--- add new argument 'type' for define regulator type

-- regulator.h - update comments

Changes V3:
- regulator-uclass.c and regulator.h:
   -- api cleanup
   -- new function regulator_ofdata_to_platdata()
   -- update of comments
   -- add Kconfig
---
  drivers/power/Kconfig|  33 -
  drivers/power/Makefile   |   1 +
  drivers/power/regulator-uclass.c | 219 +
  include/dm/uclass-id.h   |   1 +
  include/power/regulator.h| 259 +++
  5 files changed, 512 insertions(+), 1 deletion(-)
  create mode 100644 drivers/power/regulator-uclass.c
  create mode 100644 include/power/regulator.h

diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 3513b46..1e73c7a 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -66,7 +66,38 @@ config DM_PMIC
 So the call will looks like below:
 'pmic_write(regulator-parent, addr, value, len);'

-config AXP221_POWER
+config DM_REGULATOR


Can you move this to drivers/power/regulator?



Ok, will do this.


+   bool Enable Driver Model for REGULATOR drivers (UCLASS_REGULATOR)
+   depends on DM
+   ---help---
+   This config enables the driver-model regulator uclass support, which
+   provides implementation of driver model regulator uclass api.
+
+   Regulator uclass API calls:
+   To get the regulator device:
+   - regulator_get() - get the regulator device
+
+   The regulator framework is based on a 'struct dm_regulator_ops'.
+   It provides a common function calls, for it's basic features:
+   - regulator_info()- get the regulator info structure
+   - regulator_mode()- get the regulator mode info structure
+   - regulator_get/set_value()   - operate on output voltage value
+   - regulator_get/set_current() - operate on output current value
+   - regulator_get/set_enable()  - operate on output enable state
+   - regulator_get/set_mode()- operate on output operation mode
+
+   An optional and useful regulator framework features are two descriptors:
+   - struct dm_regulator_info - describes the regulator name and output 
limits
+   - struct dm_regulator_mode - describes the regulators operation mode
+
+   The regulator framework features are described in file:
+   - include/power/regulator.h
+
+   Main files:
+   - drivers/power/regulator-uclass.c - provides regulator common 
functions api
+   - include/power/regulator.h - define all structures required by the 
regulato
+
+   config AXP221_POWER


I don't think this should be indented.



Right, will fix.


 boolean axp221 / axp223 pmic support
 depends on MACH_SUN6I || MACH_SUN8I
 default y
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 5c9a189..a6b7012 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -22,3 +22,4 @@ 

Re: [U-Boot] [PATCH v3 08/17] dm: regulator: add regulator command

2015-04-03 Thread Przemyslaw Marczak

Hello Simon,

On 03/29/2015 03:07 PM, Simon Glass wrote:

Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:

This command is based on driver model regulator api.
User interface features:
- list   - list UCLASS regulator devices
- regulator dev [id] - show or [set] operating regulator device
- regulator [info]   - print constraints info
- regulator [status] - print operating status
- regulator [value] [-f] - print/[set] voltage value [uV] (force)
- regulator [current]- print/[set] current value [uA]
- regulator [mode_id]- print/[set] operating mode id
- regulator [enable] - enable the regulator output
- regulator [disable]- disable the regulator output

The 'force' option can be used for setting the value which exceeds the limits,
which are found in device-tree and are keept in regulators info structure.

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com

---
Changes v3:
- new file
- Kconfig entry
---
  common/Kconfig |  22 +++
  common/Makefile|   1 +
  common/cmd_regulator.c | 385 +
  3 files changed, 408 insertions(+)
  create mode 100644 common/cmd_regulator.c

diff --git a/common/Kconfig b/common/Kconfig
index 1125e6d..48f360f 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -348,5 +348,27 @@ config DM_PMIC_CMD
   - pmic read address  - read byte of register at address
   - pmic write address - write byte to register at address
   The only one change for this command is 'dev' subcommand.
+
+config DM_REGULATOR_CMD


CMD_DM_REGULATOR



Ok


+   bool Enable Driver Model REGULATOR command
+   depends on DM_REGULATOR
+   help
+ This command is based on driver model regulator api.
+ User interface features:
+ - list   - list UCLASS regulator devices


Do you need 'UCLASS in there? What does it mean?



Right, it has no sense...


+ - regulator dev [id] - show or [set] operating regulator device
+ - regulator [info]   - print constraints info
+ - regulator [status] - print operating status
+ - regulator [value] [-f] - print/[set] voltage value [uV] (force)
+ - regulator [current]- print/[set] current value [uA]
+ - regulator [mode_id]- print/[set] operating mode id
+ - regulator [enable] - enable the regulator output
+ - regulator [disable]- disable the regulator output


I don't think the sub-commands should be in [].



Right, will fix it.


+
+ The 'force' option can be used for setting the value which exceeds
+ the limit which are found in device-tree and are keept in regulators
+ info structure.
+
  endmenu
+
  endmenu
diff --git a/common/Makefile b/common/Makefile
index d908851..d63fe12 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -211,6 +211,7 @@ obj-$(CONFIG_CMD_GPT) += cmd_gpt.o

  # Power
  obj-$(CONFIG_DM_PMIC_CMD) += cmd_pmic.o
+obj-$(CONFIG_DM_REGULATOR_CMD) += cmd_regulator.o
  endif

  ifdef CONFIG_SPL_BUILD
diff --git a/common/cmd_regulator.c b/common/cmd_regulator.c
new file mode 100644
index 000..d388b14
--- /dev/null
+++ b/common/cmd_regulator.c
@@ -0,0 +1,385 @@
+/*
+ * Copyright (C) 2014-2015 Samsung Electronics
+ * Przemyslaw Marczak p.marc...@samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+#include common.h
+#include linux/types.h
+#include linux/ctype.h
+#include fdtdec.h
+#include dm.h
+#include power/pmic.h
+#include power/regulator.h
+#include dm/device-internal.h
+#include dm/uclass-internal.h
+#include dm/root.h
+#include dm/lists.h
+#include i2c.h
+#include compiler.h
+#include errno.h
+
+#define LIMIT_SEQ  3
+#define LIMIT_DEVNAME  20
+#define LIMIT_OFNAME   20
+#define LIMIT_INFO 12
+
+static struct udevice *reg_curr;
+
+static int failed(const char *getset, const char *thing,
+ const char *for_dev, int ret)
+{
+   printf(Can't %s %s %s.\nError: %d (%s)\n, getset, thing, for_dev,
+   ret, errno_str(ret));
+   return CMD_RET_FAILURE;
+}
+
+static int do_dev(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   struct dm_regulator_info *info;
+   int seq, ret = CMD_RET_FAILURE;
+
+   switch (argc) {
+   case 2:
+   seq = simple_strtoul(argv[1], NULL, 0);
+   uclass_get_device_by_seq(UCLASS_REGULATOR, seq, reg_curr);


This can return an error.



Yes, but there is no case break, and the below regulator_info(), checks 
if reg_curr isn't NULL, and here the ret is returned.



+   case 1:
+   ret = regulator_info(reg_curr, info);
+   if (ret)
+   return failed(get, the, device, ret);
+
+   printf(dev: %d @ %s\n, reg_curr-seq, info-name);
+   }
+
+   return CMD_RET_SUCCESS;
+}
+
+static int 

Re: [U-Boot] [PATCH v3 11/17] dm: regulator: add max77686 regulator driver

2015-04-03 Thread Przemyslaw Marczak

Hello Simon,

On 03/29/2015 03:08 PM, Simon Glass wrote:

Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:

This commit adds support to max77686 regulator driver
based on a uclass regulator driver-model api, which
provides implementation of all uclass regulator api
function calls.

New file: drivers/power/regulator/max77686.c
New config: CONFIG_DM_REGULATOR_MAX77686

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com


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

See nit below.


---
Changes V2:
- change debug() to error()
- code cleanup
- fix data types
- ldo/buck state implementation
- adjust to new uclass api

Changes V3:
- regulator/max77686.c:
   -- adjust to api changes
   -- add separeted drivers for buck and ldo
   -- bind regulators by its compatibles
- Kconfig: add regulator max77686 entry
---
  Makefile   |   1 +
  drivers/power/Kconfig  |   8 +
  drivers/power/Makefile |   1 -
  drivers/power/regulator/Makefile   |   8 +
  drivers/power/regulator/max77686.c | 876 +
  include/power/max77686_pmic.h  |  24 +-
  6 files changed, 914 insertions(+), 4 deletions(-)
  create mode 100644 drivers/power/regulator/Makefile
  create mode 100644 drivers/power/regulator/max77686.c

diff --git a/Makefile b/Makefile
index 1b3ebe7..9ecf3bb 100644
--- a/Makefile
+++ b/Makefile
@@ -632,6 +632,7 @@ libs-y += drivers/power/ \
 drivers/power/fuel_gauge/ \
 drivers/power/mfd/ \
 drivers/power/pmic/ \
+   drivers/power/regulator/ \
 drivers/power/battery/
  libs-y += drivers/spi/
  libs-$(CONFIG_FMAN_ENET) += drivers/net/fm/
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index c4d4c72..97abbf0 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -112,6 +112,14 @@ config DM_REGULATOR
 Say y here to enable support for the axp221 / axp223 pmic found on most
 sun6i (A31) / sun8i (A23) boards.

+config DM_REGULATOR_MAX77686
+   bool Enable Driver Model for REGULATOR MAX77686
+   depends on DM_REGULATOR  DM_PMIC_MAX77686
+   ---help---
+   This config enables implementation of driver-model regulator uclass
+   features for REGULATOR MAX77686. The driver implements get/set api for:
+   value, enable and mode.


This should probably go in drivers/power/regulator/Kconfig.



Ok, will fix this.

[snip]



Regards,
Simon



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


Re: [U-Boot] [PATCH v3 07/17] dm: pmic: add pmic command

2015-04-03 Thread Przemyslaw Marczak

Hello Simon,

On 03/29/2015 03:07 PM, Simon Glass wrote:

Hi Prazemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:

This is new command for the pmic devices based on driver model pmic api.
Command features are unchanged:
- list  - list UCLASS pmic devices
- pmic dev [id]  - show or [set] operating pmic device (NEW)
- pmic dump  - dump registers
- pmic read address  - read byte of register at address
- pmic write address - write byte to register at address

The only one change for this command is 'dev' subcommand.

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com

Changes v3:
- new file
- add Kconfig
---
  common/Kconfig|  14 
  common/Makefile   |   3 +
  common/cmd_pmic.c | 210 ++
  3 files changed, 227 insertions(+)
  create mode 100644 common/cmd_pmic.c

diff --git a/common/Kconfig b/common/Kconfig
index e662774..1125e6d 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -335,4 +335,18 @@ config CMD_SETGETDCR

  endmenu

+menu Power commands
+config DM_PMIC_CMD


CMD_DM_PMIC

since this fits better with the other ones



Ok


+   bool Enable Driver Model PMIC command
+   depends on DM_PMIC
+   help
+ This is new command for the pmic devices based on driver model pmic 
api.
+ Command features are unchanged:
+ - list   - list UCLASS pmic devices
+ - pmic dev [id]  - show or [set] operating pmic device (NEW)
+ - pmic dump  - dump registers
+ - pmic read address  - read byte of register at address
+ - pmic write address - write byte to register at address
+ The only one change for this command is 'dev' subcommand.
+endmenu
  endmenu
diff --git a/common/Makefile b/common/Makefile
index 7216a13..d908851 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -208,6 +208,9 @@ obj-$(CONFIG_UPDATE_TFTP) += update.o
  obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
  obj-$(CONFIG_CMD_DFU) += cmd_dfu.o
  obj-$(CONFIG_CMD_GPT) += cmd_gpt.o
+
+# Power
+obj-$(CONFIG_DM_PMIC_CMD) += cmd_pmic.o
  endif

  ifdef CONFIG_SPL_BUILD
diff --git a/common/cmd_pmic.c b/common/cmd_pmic.c
new file mode 100644
index 000..978a94a
--- /dev/null
+++ b/common/cmd_pmic.c
@@ -0,0 +1,210 @@
+/*
+ * Copyright (C) 2014-2015 Samsung Electronics
+ * Przemyslaw Marczak p.marc...@samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+#include common.h
+#include linux/types.h
+#include linux/ctype.h
+#include fdtdec.h
+#include dm.h
+#include power/pmic.h
+#include power/regulator.h
+#include dm/device-internal.h
+#include dm/uclass-internal.h
+#include dm/root.h
+#include dm/lists.h
+#include i2c.h
+#include compiler.h
+#include errno.h
+
+#define LIMIT_SEQ  3
+#define LIMIT_DEVNAME  20
+
+static struct udevice *pmic_curr;
+
+static int failed(const char *getset, const char *thing,
+ const char *for_dev, int ret)
+{
+   printf(Can't %s %s %s.\nError: %d (%s)\n, getset, thing, for_dev,
+   ret, errno_str(ret));
+   return CMD_RET_FAILURE;
+}
+
+static int do_dev(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   int seq, ret = -ENODEV;
+
+   switch (argc) {
+   case 2:
+   seq = simple_strtoul(argv[1], NULL, 0);
+   ret = uclass_get_device_by_seq(UCLASS_PMIC, seq, pmic_curr);
+   case 1:
+   if (!pmic_curr)
+   return failed(get, the, device, ret);
+
+   printf(dev: %d @ %s\n, pmic_curr-seq, pmic_curr-name);
+   }
+
+   return CMD_RET_SUCCESS;
+}
+
+static int do_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   struct udevice *dev;
+   const char *parent_uc;
+   int ret;
+
+   printf(|%*s | %-*.*s| %-*.*s| %s @ %s\n,
+  LIMIT_SEQ, Seq,
+  LIMIT_DEVNAME, LIMIT_DEVNAME, Name,
+  LIMIT_DEVNAME, LIMIT_DEVNAME, Parent name,
+  Parent uclass, seq);
+
+   for (ret = uclass_first_device(UCLASS_PMIC, dev); dev;
+ret = uclass_next_device(dev)) {


Note this will probe everything.

Perhaps we need uclass_find_first_device() and
uclass_find_next_device() which don't probe before returning each
device?




Right, I will extend the uclass.c API.


+   if (!dev)
+   continue;
+
+   /* Parent uclass name*/
+   parent_uc = dev-parent-uclass-uc_drv-name;


What do you think about a new function at some point, so you can call
dev_uclass_name(dev_get_parent(dev))? We want to avoid digging around
in the driver model data structures outside drivers/core.



Good idea, will move to uclass API.


+
+   printf(|%*d | %-*.*s| %-*.*s| %s @ %d\n,
+  LIMIT_SEQ, dev-seq,
+  LIMIT_DEVNAME, LIMIT_DEVNAME, dev-name,
+  LIMIT_DEVNAME, LIMIT_DEVNAME, 

Re: [U-Boot] [PATCH v3 05/17] dm: pmic: add implementation of driver model pmic uclass

2015-04-03 Thread Przemyslaw Marczak

Hello Simon,

On 03/29/2015 03:07 PM, Simon Glass wrote:

Hi Prazemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:

This is an introduction to driver-model multi uclass PMIC support.
It starts with UCLASS_PMIC - a common PMIC devices uclass type
to provide device read/write operations only.


Your Kconfig docs are a model to others! It describes the function
very nicely without a lot of words.

Please excuse the nits, they are intended to help it read better.



That's ok, it's better to fix if needs.



Beside two basic operations the pmic platform data is introduced,
which provides basic informations about the pmic device I/O interface
and is shared with all childs (and should also for childs new uclass
types in the future).

Usually PMIC devices provides various functionalities with single
or multiple I/O interfaces.
Using this new framework and new uclass types introduced in the future,
it can be handle like this:

_ root device
|
|_ BUS 0 device (e.g. I2C0)- UCLASS_I2C/SPI/...
| |_ PMIC device 1 (read/write ops)- UCLASS_PMIC
|   |_ REGULATOR device (ldo/buck/... ops) - UCLASS_REGULATOR
|   |_ CHARGER device (charger ops)- UCLASS_CHARGER (in the future)
|   |_ MUIC device (microUSB con ops)  - UCLASS_MUIC(in the future)
|   |_ ...
|
|_ BUS 1 device (e.g. I2C1)- UCLASS_I2C/SPI/...
   |_ PMIC device 2 (read/write ops)- UCLASS_PMIC
 |_ RTC device (rtc ops)- UCLASS_MUIC (in the future)

For each PMIC device interface, new UCLASS_PMIC device is bind with proper
pmic driver, and it's child devices provides some specified operations.

All new definitions can be found in file:
- 'include/power/pmic.h'

Uclass file:
- pmic-uclass.c - provides a common code for UCLASS_PMIC device drivers

The old pmic framework is still kept and is independent.

Changes:
- new uclass-id: UCLASS_PMIC
- new config: CONFIG_DM_PMIC

New pmic api is documented in: doc/driver-model/pmic-framework.txt

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
---
Changes V2:
- pmic uclass: adjust uclass code to the mainline changes
- pmic uclass: remove pmic_i2c and pmic_spi
- pmic uclass: modify pmic_platdata
- pmic uclass: add pmic_if_* functions
- pmic uclass: remove pmic_init_dm()
- pmic uclass: cleanup
- pmic.h: define pmic ops structure (read/write operations)
- pmic.h: add comments to functions

Changes V3:
- pmic-uclass.c and pmic.h:
   -- remove  pmic_if_* functions
   -- add new function pmic_child_node_scan()
- add Kconfig entry
---
  drivers/power/Kconfig   |  68 ++
  drivers/power/Makefile  |   1 +
  drivers/power/pmic-uclass.c | 130 +++
  include/dm/uclass-id.h  |   3 +
  include/power/pmic.h| 210 
  5 files changed, 412 insertions(+)
  create mode 100644 drivers/power/pmic-uclass.c

diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index f8f0239..3513b46 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -1,3 +1,71 @@
+config DM_PMIC
+   bool Enable Driver Model for PMIC drivers (UCLASS_PMIC)
+   depends on DM
+   ---help---
+   This config enables the driver-model multi uclass PMIC support.
+   Its basic uclass type is: UCLASS_PMIC, which is designed to provide
+   a common I/O interface for pmic child devices of various uclass types.


Should be consistent - and use PMIC instead pmic.


+
+   Usually PMIC IC's provides more than one functionality, which means


s/functionality/function/


+   that we should implement new uclass operations for each one. Usually
+   PMIC's provide those various functionalities by one or more interfaces.


functions


+   And this could looks like this:
+
+   root device
+   |_ BUS 0 device (e.g. I2C0) - UCLASS_I2C/SPI/...
+   | |_ PMIC device (READ/WRITE ops)   - UCLASS_PMIC
+   |   |  (pmic sub-devices)
+   |   |_ REGULATOR device (ldo/buck/... ops)  - UCLASS_REGULATOR
+   |   |_ CHARGER device (charger ops) - UCLASS_CHARGER (future)
+   |   |_ MUIC device (microUSB connector ops) - UCLASS_MUIC(future)
+   |   |_ ...
+   |
+   |_ BUS 1 device (e.g. I2C1) - UCLASS_I2C/SPI/...
+  |_ PMIC device (READ/WRITE ops)  - UCLASS_PMIC
+|  (pmic sub-devices)
+|_ RTC device (rtc ops)- UCLASS_MUIC (future)


Would this be UCLASS_RTC?


+
+   From the I/O interface point of view, there can be found two PMIC types:
+   - single I/O interface - then UCLASS_PMIC device should be a parent of
+ all pmic sub-devices, where each is usually different uclass type, but
+ need to access the same interface
+
+   - multiple I/O interfaces - for each interface the UCLASS_PMIC device
+ should be a parent of only those devices (different uclass types),
+  

Re: [U-Boot] [PATCH v3 12/17] dm: regulator: add fixed voltage regulator driver

2015-04-03 Thread Przemyslaw Marczak

Hello Simon,

On 03/29/2015 03:08 PM, Simon Glass wrote:

Hi Przemyslaw,

On 24 March 2015 at 14:30, Przemyslaw Marczak p.marc...@samsung.com wrote:

This driver implements regulator uclass features for fixed value regulators.
For getting the basic regulator device-tree node constraints, this driver calls
function 'regulator_ofdata_to_platdata()'. The typical fixed regulator node
provides few additional properties:
- gpio
- gpio-open-drain
- enable-active-high
- startup-delay-us
All above are checked and keept in structure of type 'fixed_regulator_priv',
which is private for each fixed-regulator device (dev-priv).

The driver implements only three of regulator uclass features:
- get_value
- get_enable
- set_enable

The regulator calls and command line features can be used for fixed-regulator,
and the proper error will be returned for prohibited.

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com

Changes v3:
- new file
- Kconfig add fixed-regulator entry
---
  drivers/power/Kconfig|   8 +++
  drivers/power/regulator/Makefile |   1 +
  drivers/power/regulator/fixed.c  | 124 +++
  3 files changed, 133 insertions(+)
  create mode 100644 drivers/power/regulator/fixed.c

diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 97abbf0..da1e866 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -120,6 +120,14 @@ config DM_REGULATOR_MAX77686
 features for REGULATOR MAX77686. The driver implements get/set api for:
 value, enable and mode.

+config DM_REGULATOR_FIXED
+   bool Enable Driver Model for REGULATOR Fixed value
+   depends on DM_REGULATOR
+   ---help---
+   This config enables implementation of driver-model regulator uclass
+   features for fixed value regulators. The driver implements get/set api
+   for enable and get only for voltage value.
+


Should be in drivers/regulator/Kconfig I think



Right, will fix.


  config AXP221_DCDC1_VOLT
 int axp221 dcdc1 voltage
 depends on AXP221_POWER
diff --git a/drivers/power/regulator/Makefile b/drivers/power/regulator/Makefile
index 9d282e3..0a6a6d9 100644
--- a/drivers/power/regulator/Makefile
+++ b/drivers/power/regulator/Makefile
@@ -5,4 +5,5 @@
  # SPDX-License-Identifier: GPL-2.0+
  #

+obj-$(CONFIG_DM_REGULATOR_FIXED) += fixed.o
  obj-$(CONFIG_DM_REGULATOR_MAX77686) += max77686.o
diff --git a/drivers/power/regulator/fixed.c b/drivers/power/regulator/fixed.c
new file mode 100644
index 000..45e9f84
--- /dev/null
+++ b/drivers/power/regulator/fixed.c
@@ -0,0 +1,124 @@
+/*
+ *  Copyright (C) 2015 Samsung Electronics
+ *
+ *  Przemyslaw Marczak p.marc...@samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include fdtdec.h
+#include i2c.h
+#include dm.h
+#include asm/gpio.h
+#include power/pmic.h
+#include power/regulator.h
+#include errno.h
+#include dm.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct fixed_regulator_priv {
+   struct gpio_desc gpio;
+   bool gpio_open_drain;
+   bool enable_active_high;
+   unsigned startup_delay_us;


Docs for these?



Right, will add.


+};
+
+static int fixed_regulator_ofdata_to_platdata(struct udevice *dev)
+{
+   struct dm_regulator_info *info = dev-uclass_priv;
+   struct fixed_regulator_priv *priv = dev-priv;
+   int ret, offset = dev-of_offset;
+
+   /* Get the basic regulator constraints */
+   ret = regulator_ofdata_to_platdata(dev);
+   if (ret) {
+   error(Can't get regulator constraints for %s, dev-name);
+   return ret;
+   }
+
+   /* Get fixed regulator gpio desc */
+   ret = gpio_request_by_name_nodev(gd-fdt_blob, offset, gpio, 0,
+priv-gpio, GPIOD_IS_OUT);


Should not use the nodev version - you have a device.



Yes, will update this.


+   if (ret) {
+   error(Fixed regulator gpio - not found! Error: %d, ret);
+   return ret;
+   }
+
+   /* Get fixed regulator addidional constraints */
+   priv-gpio_open_drain = fdtdec_get_bool(gd-fdt_blob, offset,
+   gpio-open-drain);
+   priv-enable_active_high = fdtdec_get_bool(gd-fdt_blob, offset,
+  enable-active-high);
+   priv-startup_delay_us = fdtdec_get_int(gd-fdt_blob, offset,
+   startup-delay-us, 0);
+
+   /* Set type to fixed - used by regulator command */
+   info-type = REGULATOR_TYPE_FIXED;
+
+   debug(%s:%d\n, __func__, __LINE__);
+   debug( name:%s, boot_on:%d, active_hi: %d start_delay:%u\n,
+   info-name, info-boot_on, priv-enable_active_high,
+   priv-startup_delay_us);
+
+   return 0;
+}
+
+static int fixed_regulator_get_value(struct udevice *dev)
+{
+   struct dm_regulator_info *info;
+   int ret;
+
+   ret = regulator_info(dev, 

Re: [U-Boot] [PATCH v2 7/7] arc: minor fixes in Kconfig

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
  [1] Fix misspeling in ARC_CACHE_LINE_SHIFT dependency, now cache-line
 lenth selection is correctly enabled if either I$ or D$ are enabled.
 
  [2] Add dummy entry to target list to make sure target type is always
 mentioned in defconfig. Otherwise defconfig for the first target in the
 list will not have target name and later on with addition of the new
 target on top of the list in Kconfig will lead to corrupted
 configuration expanded from defconfig.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Applied, thanks.

-Alexey

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


Re: [U-Boot] [PATCH v2 6/7] arc: get rid of CONFIG_SYS_GENERIC_GLOBAL_DATA

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
 As discussed on mailing list we're drifting away from
 CONFIG_SYS_GENERIC_GLOBAL_DATA in favour to use of board_init_f_mem()
 for global data.
 
 So do this for ARC architecture.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Applied, thanks.

-Alexey

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


Re: [U-Boot] [PATCH] arc: add support for SLC (System Level Cache, AKA L2-cache)

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:25 +0300, Alexey Brodkin wrote:
 ARCv2 cores may have built-in SLC (System Level Cache, AKA L2-cache).
 This change adds functions required for controlling SLC:
  * slc_enable/disable
  * slc_flush/invalidate
 
 For now we just disable SLC to escape DMA coherency issues until either:
  * SLC flush/invalidate is supported in DMA APIin U-Boot
  * hardware DMA coherency is implemented (that might be board specific
so probably we'll need to have a separate Kconfig option for
controlling SLC explicitly)
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Applied, thanks.

-Alexey

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


Re: [U-Boot] [PATCH] serial-arc: switch to DM

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:18 +0300, Alexey Brodkin wrote:
 Now when all infrastructure in ARC is ready for it let's switch ARC UART
 to driver model.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 Cc: Masahiro Yamada yamada.masah...@socionext.com
 Cc: Simon Glass s...@chromium.org

Applied, thanks.

-Alexey

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


Re: [U-Boot] [PATCH] kbuild: include config.mk when auto.conf is not older than .config

2015-04-03 Thread Stephen Warren

On 04/02/2015 09:30 PM, Masahiro Yamada wrote:

Since the Kconfig conversion, config.mk has been included only when
include/config/auto.conf is newer than the .config file.

It causes build error if both files have the same time-stamps.
It is actually possible because EXT* file systems have a 1s time-stamp
resolution.

The config.mk should be included when include/config/auto.conf is
*not older* than the .config file.


Tested-by: Stephen Warren swar...@nvidia.com

I ran a loop of 941 MAKEALL rpi_2 during a meeting without issue. I 
also applied the same patch to a tree that had the timestamps set in a 
way that triggered the problem, and it immediately solved it there.

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


Re: [U-Boot] [PATCH 1/2] mtd: vf610_nfc: mark page as dirty on block erase

2015-04-03 Thread Stefan Agner
On 2015-04-03 01:48, Scott Wood wrote:
 On Tue, 2015-03-31 at 11:02 -0400, Bill Pringlemeir wrote:
 On 2015-03-31 00:15, Scott Wood wrote:

  Especially since you'd be doing one write rather than four full-page
  partial writes.  Surely the bottleneck here is the NAND chip itself,
  not copying data to the buffer?

 The AHB bus that the NFC controller is on is relatively slow.  Here are
 some numbers from 'AN4947-vybrid-bus-architechure',

 Vybrid Cortex A5 to DDR (in CPU clocks 400/500MHz),

First read Subsequent
2858  all caches on
345269no cache, mmu
437371no cache, no mmu

 The NFC is on an AHB bus 32bit, 66MHz (not AXI 64bit, 133-166MHz like
 DDR).  The AHB will be about four times slower.  Also the reads and
 writes to the physical NAND must take place serially.  Here are the
 program page steps.

   1. Issue controller Read full page to NFC buffer.
   2. Copy update partial page from DDR to NFC buffer.
   3. Issue write NAND page.
 
 Why is any sort of read part of the write process?

To recalculate the correct ECC, which is done in the controller, the
controller has to have the page in the SRAM. I will send out a patch
which implements vf610_nfc_write_subpage. And the read part is done when
the MTD subsystem calls NAND_CMD_SEQIN.

Actually, the Linux NAND driver supports subpage writes already by using
the generic nand_write_subpage_hwecc function. However, in U-Boot I
added driver specific page_read/page_write due to performance reasons:
http://lists.denx.de/pipermail/u-boot/2014-August/186293.html

However, I tried driver specific page_read/page_write functions for
Linux too, but I couldn't measure noticeable performance improvements. I
think the reason why it lead to noticeable improvements for U-Boot was
because U-Boot does not use caches so far. We could also switch to the
framework functions again, but those are more complex than necessary.
Given that U-Boot uses device specific binaries anyway, there is no size
advantage by using the (shared) MTD subsystems functions.

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


[U-Boot] [PATCH 14/23] net: cosmetic: Clean up CDP variables and functions

2015-04-03 Thread Joe Hershberger
Make a thorough pass through all variables and function names contained
within cdp.c and remove CamelCase and improve naming.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 common/cmd_net.c | 17 +++---
 include/net.h|  4 ++--
 net/cdp.c| 70 ++--
 net/cdp.h|  2 +-
 net/net.c|  2 +-
 5 files changed, 46 insertions(+), 49 deletions(-)

diff --git a/common/cmd_net.c b/common/cmd_net.c
index 290c0c5..0ade0f8 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -290,18 +290,19 @@ static void cdp_update_env(void)
 {
char tmp[16];
 
-   if (CDPApplianceVLAN != htons(-1)) {
-   printf(CDP offered appliance VLAN %d\n, 
ntohs(CDPApplianceVLAN));
-   VLAN_to_string(CDPApplianceVLAN, tmp);
+   if (cdp_appliance_vlan != htons(-1)) {
+   printf(CDP offered appliance VLAN %d\n,
+  ntohs(cdp_appliance_vlan));
+   VLAN_to_string(cdp_appliance_vlan, tmp);
setenv(vlan, tmp);
-   NetOurVLAN = CDPApplianceVLAN;
+   NetOurVLAN = cdp_appliance_vlan;
}
 
-   if (CDPNativeVLAN != htons(-1)) {
-   printf(CDP offered native VLAN %d\n, ntohs(CDPNativeVLAN));
-   VLAN_to_string(CDPNativeVLAN, tmp);
+   if (cdp_native_vlan != htons(-1)) {
+   printf(CDP offered native VLAN %d\n, ntohs(cdp_native_vlan));
+   VLAN_to_string(cdp_native_vlan, tmp);
setenv(nvlan, tmp);
-   NetOurNativeVLAN = CDPNativeVLAN;
+   NetOurNativeVLAN = cdp_native_vlan;
}
 
 }
diff --git a/include/net.h b/include/net.h
index 1dc54ce..9343ade 100644
--- a/include/net.h
+++ b/include/net.h
@@ -512,8 +512,8 @@ extern struct in_addr net_ping_ip;  /* the ip address to 
ping */
 
 #if defined(CONFIG_CMD_CDP)
 /* when CDP completes these hold the return values */
-extern ushort CDPNativeVLAN;   /* CDP returned native VLAN */
-extern ushort CDPApplianceVLAN;/* CDP returned appliance VLAN 
*/
+extern ushort cdp_native_vlan; /* CDP returned native VLAN */
+extern ushort cdp_appliance_vlan;  /* CDP returned appliance VLAN */
 
 /*
  * Check for a CDP packet by examining the received MAC address field
diff --git a/net/cdp.c b/net/cdp.c
index 392437d..d8df3ea 100644
--- a/net/cdp.c
+++ b/net/cdp.c
@@ -36,17 +36,16 @@ const u8 net_cdp_ethaddr[6] = { 0x01, 0x00, 0x0c, 0xcc, 
0xcc, 0xcc };
 
 #define CDP_TIMEOUT250UL   /* one packet every 250ms */
 
-static int CDPSeq;
-static int CDPOK;
+static int cdp_seq;
+static int cdp_ok;
 
-ushort CDPNativeVLAN;
-ushort CDPApplianceVLAN;
+ushort cdp_native_vlan;
+ushort cdp_appliance_vlan;
 
-static const uchar CDP_SNAP_hdr[8] = {
+static const uchar cdp_snap_hdr[8] = {
0xAA, 0xAA, 0x03, 0x00, 0x00, 0x0C, 0x20, 0x00 };
 
-static ushort
-CDP_compute_csum(const uchar *buff, ushort len)
+static ushort cdp_compute_csum(const uchar *buff, ushort len)
 {
ushort csum;
int odd;
@@ -104,8 +103,7 @@ CDP_compute_csum(const uchar *buff, ushort len)
return csum;
 }
 
-static int
-CDPSendTrigger(void)
+static int cdp_send_trigger(void)
 {
uchar *pkt;
ushort *s;
@@ -130,8 +128,8 @@ CDPSendTrigger(void)
pkt += ETHER_HDR_SIZE;
 
/* SNAP header */
-   memcpy((uchar *)pkt, CDP_SNAP_hdr, sizeof(CDP_SNAP_hdr));
-   pkt += sizeof(CDP_SNAP_hdr);
+   memcpy((uchar *)pkt, cdp_snap_hdr, sizeof(cdp_snap_hdr));
+   pkt += sizeof(cdp_snap_hdr);
 
/* CDP header */
*pkt++ = 0x02;  /* CDP version 2 */
@@ -210,8 +208,8 @@ CDPSendTrigger(void)
len = (uchar *)s - ((uchar *)net_tx_packet + ETHER_HDR_SIZE);
et-et_protlen = htons(len);
 
-   len = ETHER_HDR_SIZE + sizeof(CDP_SNAP_hdr);
-   chksum = CDP_compute_csum((uchar *)net_tx_packet + len,
+   len = ETHER_HDR_SIZE + sizeof(cdp_snap_hdr);
+   chksum = cdp_compute_csum((uchar *)net_tx_packet + len,
  (uchar *)s - (net_tx_packet + len));
if (chksum == 0)
chksum = 0x;
@@ -221,19 +219,18 @@ CDPSendTrigger(void)
return 0;
 }
 
-static void
-CDPTimeout(void)
+static void cdp_timeout_handler(void)
 {
-   CDPSeq++;
+   cdp_seq++;
 
-   if (CDPSeq  3) {
-   NetSetTimeout(CDP_TIMEOUT, CDPTimeout);
-   CDPSendTrigger();
+   if (cdp_seq  3) {
+   NetSetTimeout(CDP_TIMEOUT, cdp_timeout_handler);
+   cdp_send_trigger();
return;
}
 
/* if not OK try again */
-   if (!CDPOK)
+   if (!cdp_ok)
NetStartAgain();
else
net_set_state(NETLOOP_SUCCESS);
@@ -247,15 +244,15 @@ void cdp_receive(const uchar *pkt, unsigned len)
ushort vlan, nvlan;
 
/* minimum size? */
-   if (len  

[U-Boot] [PATCH 06/23] net: cosmetic: Fix var naming net - eth drivers

2015-04-03 Thread Joe Hershberger
Update the naming convention used in the network stack functions and
variables that Ethernet drivers use to interact with it.

This cleans up the temporary hacks that were added to this interface
along with the DM support.

This patch has a few remaining checkpatch.pl failures that would be out
of the scope of this patch to fix (drivers that are in gross violation
of checkpatch.pl).

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 arch/mips/mach-au1x00/au1x00_eth.c   | 12 ++-
 arch/powerpc/cpu/mpc8260/ether_fcc.c |  4 ++--
 arch/powerpc/cpu/mpc8260/ether_scc.c |  4 ++--
 arch/powerpc/cpu/mpc85xx/ether_fcc.c |  4 ++--
 arch/powerpc/cpu/mpc8xx/fec.c|  6 +++---
 arch/powerpc/cpu/mpc8xx/scc.c|  5 +++--
 doc/README.drivers.eth   | 12 +--
 drivers/net/4xx_enet.c   | 14 +++-
 drivers/net/altera_tse.c | 15 +++--
 drivers/net/armada100_fec.c  |  7 +++---
 drivers/net/at91_emac.c  |  4 ++--
 drivers/net/ax88180.c|  6 +++---
 drivers/net/bcm-sf2-eth.c|  6 +++---
 drivers/net/bfin_mac.c   |  4 ++--
 drivers/net/calxedaxgmac.c   |  2 +-
 drivers/net/cpsw.c   |  4 ++--
 drivers/net/cs8900.c |  5 ++---
 drivers/net/davinci_emac.c   |  5 +++--
 drivers/net/dc2114x.c|  9 +---
 drivers/net/designware.c |  2 +-
 drivers/net/dm9000x.c|  5 +++--
 drivers/net/dnet.c   |  5 +++--
 drivers/net/e1000.c  |  2 +-
 drivers/net/eepro100.c   |  3 ++-
 drivers/net/enc28j60.c   | 13 ++--
 drivers/net/ep93xx_eth.c | 11 +-
 drivers/net/ethoc.c  |  4 ++--
 drivers/net/fec_mxc.c|  2 +-
 drivers/net/fm/eth.c |  2 +-
 drivers/net/fsl_mcdmafec.c   | 23 ++--
 drivers/net/ftgmac100.c  |  4 ++--
 drivers/net/ftmac100.c   |  4 ++--
 drivers/net/ftmac110.c   |  2 +-
 drivers/net/greth.c  |  2 +-
 drivers/net/keystone_net.c   |  2 +-
 drivers/net/ks8851_mll.c |  6 +++---
 drivers/net/lan91c96.c   | 19 +
 drivers/net/macb.c   |  8 +++
 drivers/net/mcffec.c |  5 +++--
 drivers/net/mpc512x_fec.c|  3 ++-
 drivers/net/mpc5xxx_fec.c|  2 +-
 drivers/net/mvgbe.c  | 41 +++-
 drivers/net/mvneta.c |  2 +-
 drivers/net/natsemi.c|  3 ++-
 drivers/net/ne2000_base.c|  2 +-
 drivers/net/ns8382x.c|  6 --
 drivers/net/pch_gbe.c|  2 +-
 drivers/net/pcnet.c  |  2 +-
 drivers/net/rtl8139.c|  4 ++--
 drivers/net/rtl8169.c|  2 +-
 drivers/net/sh_eth.c |  2 +-
 drivers/net/smc9.c   | 18 
 drivers/net/smc911x.c|  4 ++--
 drivers/net/sunxi_emac.c |  4 ++--
 drivers/net/tsec.c   |  7 +++---
 drivers/net/tsi108_eth.c |  8 +++
 drivers/net/uli526x.c|  5 +++--
 drivers/net/xilinx_axi_emac.c|  2 +-
 drivers/net/xilinx_emaclite.c|  2 +-
 drivers/net/xilinx_ll_temac_fifo.c   |  4 ++--
 drivers/net/xilinx_ll_temac_sdma.c   |  4 ++--
 drivers/net/zynq_gem.c   |  2 +-
 drivers/qe/uec.c |  2 +-
 drivers/usb/eth/asix.c   |  3 ++-
 drivers/usb/eth/asix88179.c  |  2 +-
 drivers/usb/eth/mcs7830.c|  2 +-
 drivers/usb/eth/smsc95xx.c   |  3 ++-
 drivers/usb/gadget/ether.c   |  5 +++--
 include/net.h|  7 --
 net/net.c| 11 --
 post/cpu/mpc8xx/ether.c  |  6 +++---
 71 files changed, 219 insertions(+), 205 deletions(-)

diff --git a/arch/mips/mach-au1x00/au1x00_eth.c 
b/arch/mips/mach-au1x00/au1x00_eth.c
index a47f088..d6ebe07 100644
--- a/arch/mips/mach-au1x00/au1x00_eth.c
+++ b/arch/mips/mach-au1x00/au1x00_eth.c
@@ -187,13 +187,14 @@ static int au1x00_recv(struct eth_device* dev){
 
if(statusRX_ERROR){
printf(Rx error 0x%x\n, status);
-   }
-   else{
+   } else {
/* Pass the packet up to the protocol layers. */
-   NetReceive(NetRxPackets[next_rx], length - 4);
+   net_process_received_packet(net_rx_packets[next_rx],
+   length - 4);
}
 
-   fifo_rx[next_rx].addr = 
(virt_to_phys(NetRxPackets[next_rx]))|RX_DMA_ENABLE;
+   fifo_rx[next_rx].addr =
+   (virt_to_phys(net_rx_packets[next_rx])) | RX_DMA_ENABLE;
 

Re: [U-Boot] [PATCH 2/4] mtd: vf610_nfc: add Freescale NFC controller configs to Kconfig

2015-04-03 Thread Stefan Agner
On 2015-04-03 22:46, Scott Wood wrote:
 On Fri, 2015-04-03 at 22:42 +0200, Stefan Agner wrote:
 On 2015-04-03 22:30, Scott Wood wrote:
  On Fri, 2015-04-03 at 20:40 +0200, Stefan Agner wrote:
  This commit allows users to enable/disable the Freescale NFC
  controller found in systems like Vybrid (VF610), MPC5125, MCF54418
  or Kinetis K70 via Kconfig with more detailed help docs.
 
  Signed-off-by: Stefan Agner ste...@agner.ch
  ---
   configs/vf610twr_defconfig |  2 ++
   drivers/mtd/nand/Kconfig   | 15 +++
   include/configs/vf610twr.h |  3 ---
   3 files changed, 17 insertions(+), 3 deletions(-)
 
  diff --git a/configs/vf610twr_defconfig b/configs/vf610twr_defconfig
  index 7de374a..5e0ac9f 100644
  --- a/configs/vf610twr_defconfig
  +++ b/configs/vf610twr_defconfig
  @@ -1,3 +1,5 @@
   
  CONFIG_SYS_EXTRA_OPTIONS=IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_MMC
   CONFIG_ARM=y
   CONFIG_TARGET_VF610TWR=y
  +CONFIG_NAND_VF610_NFC=y
  +CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
  diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
  index 72825c3..8056c06 100644
  --- a/drivers/mtd/nand/Kconfig
  +++ b/drivers/mtd/nand/Kconfig
  @@ -32,6 +32,21 @@ config NAND_DENALI_SPARE_AREA_SKIP_BYTES
  of OOB area before last ECC sector data starts.  This is potentially
  used to preserve the bad block marker in the OOB area.
 
  +config NAND_VF610_NFC
  + bool Support for Freescale NFC for VF610/MPC5125
  + select SYS_NAND_SELF_INIT
  + help
  +   Enables support for NAND Flash Controller on some Freescale
  +   processors like the VF610, MPC5125, MCF54418 or Kinetis K70.
  +   The driver supports a maximum 2k page size. The driver
  +   currently does not support hardware ECC.
  +
  +config SYS_NAND_BUSWIDTH_16BIT
  + bool Use 16-bit NAND interface
  + depends on NAND_VF610_NFC
  + help
  +   Use 16-bit wide NAND flash interface.
 
  Why does a generic-sounding config name depend on VF610?  Especially
  when README already lists three other drivers as using this option...

 That option is _not_ meant as being VF610 specific.

 Since we have the ability to specify dependencies with Kconfig, I think
 it is nice to have options only available if a driver supports it, hence
 the depends. So far the VF610 NAND driver is the only one which is in
 Kconfig and supports it... I would expect that when another driver which
 supports that option gets migrated, depends will be extended
 accordingly.

 However, I just realized that the option end up between Vybrid specific
 configs because of Patch 3. I will move the option at the very bottom in
 next revision.
 
 Could you also add a comment mentioning the other drivers that use it,
 which aren't yet kconfiged?  And then remove the old text from the
 README.

By comment, you mean a Kconfig comment at that option, so the next
stumbles upon it? So I can keep that single depends NAND_VF610_NFC for
now?

Removing CONFIG_SYS_NAND_BUSWIDTH_16BIT from doc/README.nand right? But
with that, the options for the other drivers would be undocumented for
the time being... 

--
Stefan

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


Re: [U-Boot] [PATCH 1/2] mtd: vf610_nfc: mark page as dirty on block erase

2015-04-03 Thread Scott Wood
On Fri, 2015-04-03 at 22:28 +0200, Stefan Agner wrote:
 On 2015-04-03 22:15, Scott Wood wrote:
  On Fri, 2015-04-03 at 20:09 +0200, Stefan Agner wrote:
  On 2015-04-03 01:48, Scott Wood wrote:
   On Tue, 2015-03-31 at 11:02 -0400, Bill Pringlemeir wrote:
   On 2015-03-31 00:15, Scott Wood wrote:
  
Especially since you'd be doing one write rather than four full-page
partial writes.  Surely the bottleneck here is the NAND chip itself,
not copying data to the buffer?
  
   The AHB bus that the NFC controller is on is relatively slow.  Here are
   some numbers from 'AN4947-vybrid-bus-architechure',
  
   Vybrid Cortex A5 to DDR (in CPU clocks 400/500MHz),
  
  First read Subsequent
  2858  all caches on
  345269no cache, mmu
  437371no cache, no mmu
  
   The NFC is on an AHB bus 32bit, 66MHz (not AXI 64bit, 133-166MHz like
   DDR).  The AHB will be about four times slower.  Also the reads and
   writes to the physical NAND must take place serially.  Here are the
   program page steps.
  
 1. Issue controller Read full page to NFC buffer.
 2. Copy update partial page from DDR to NFC buffer.
 3. Issue write NAND page.
  
   Why is any sort of read part of the write process?
 
  To recalculate the correct ECC, which is done in the controller, the
  controller has to have the page in the SRAM. I will send out a patch
  which implements vf610_nfc_write_subpage. And the read part is done when
  the MTD subsystem calls NAND_CMD_SEQIN.
  
  Again, if this is the only way you can do subpage accesses then you
  should not do them.
 
 Why not? IMHO, there are valid reason to do it, since we save coping
 data over the bus (we save copying page size - write len of bytes)...

According to http://www.linux-mtd.infradead.org/doc/ubi.html#L_subpage
the motivation for subpages is saving space, not time, and it's only
used for headers (specifically because using subpages may be slower). 
So it may not make a huge performance difference either way, even if
subpages are less efficient on this controller -- though it does have a
complexity cost that is higher than with most controllers.  It looks
like the space savings is around one page per block.

It'd be good to benchmark up front to be sure you're happy with the
speed/space/complexity tradeoff, though, since enabling/disabling
subpage writes breaks UBI compatibility.

 Also, I guess all NAND controller which do HW ECC need to read at least
 ECC step size back to the controller... Maybe we can move the discussion
 to the actual code (see mtd: vf610_nfc: support subpage write).

No, most controller drivers do not read from the NAND chip during the
programming process.

-Scott


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


[U-Boot] [PATCH 10/23] net: cosmetic: Clean up NFS variables and functions

2015-04-03 Thread Joe Hershberger
Make a thorough pass through all variables and function names contained
within nfs.c and remove CamelCase and improve naming.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 net/net.c |   4 +-
 net/nfs.c | 173 +++---
 net/nfs.h |   2 +-
 3 files changed, 79 insertions(+), 100 deletions(-)

diff --git a/net/net.c b/net/net.c
index 721519a..55b680f 100644
--- a/net/net.c
+++ b/net/net.c
@@ -235,7 +235,7 @@ void net_auto_load(void)
/*
 * Use NFS to load the bootfile.
 */
-   NfsStart();
+   nfs_start();
return;
}
 #endif
@@ -407,7 +407,7 @@ restart:
 #endif
 #if defined(CONFIG_CMD_NFS)
case NFS:
-   NfsStart();
+   nfs_start();
break;
 #endif
 #if defined(CONFIG_CMD_CDP)
diff --git a/net/nfs.c b/net/nfs.c
index 6899265..4357cc3 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -52,11 +52,11 @@ static char filefh[NFS_FHSIZE]; /* file handle of kernel 
image */
 
 static enum net_loop_state nfs_download_state;
 static struct in_addr nfs_server_ip;
-static int NfsSrvMountPort;
-static int NfsSrvNfsPort;
-static int NfsOurPort;
-static int NfsTimeoutCount;
-static int NfsState;
+static int nfs_server_mount_port;
+static int nfs_server_port;
+static int nfs_our_port;
+static int nfs_timeout_count;
+static int nfs_state;
 #define STATE_PRCLOOKUP_PROG_MOUNT_REQ 1
 #define STATE_PRCLOOKUP_PROG_NFS_REQ   2
 #define STATE_MOUNT_REQ3
@@ -70,8 +70,7 @@ static char *nfs_filename;
 static char *nfs_path;
 static char nfs_path_buff[2048];
 
-static inline int
-store_block(uchar *src, unsigned offset, unsigned len)
+static inline int store_block(uchar *src, unsigned offset, unsigned len)
 {
ulong newsize = offset + len;
 #ifdef CONFIG_SYS_DIRECT_FLASH_NFS
@@ -105,8 +104,7 @@ store_block(uchar *src, unsigned offset, unsigned len)
return 0;
 }
 
-static char*
-basename(char *path)
+static char *basename(char *path)
 {
char *fname;
 
@@ -121,8 +119,7 @@ basename(char *path)
return fname;
 }
 
-static char*
-dirname(char *path)
+static char *dirname(char *path)
 {
char *fname;
 
@@ -178,8 +175,7 @@ static long *rpc_add_credentials(long *p)
 /**
 RPC_LOOKUP - Lookup RPC Port numbers
 **/
-static void
-rpc_req(int rpc_prog, int rpc_proc, uint32_t *data, int datalen)
+static void rpc_req(int rpc_prog, int rpc_proc, uint32_t *data, int datalen)
 {
struct rpc_t pkt;
unsigned long id;
@@ -207,19 +203,18 @@ rpc_req(int rpc_prog, int rpc_proc, uint32_t *data, int 
datalen)
if (rpc_prog == PROG_PORTMAP)
sport = SUNRPC_PORT;
else if (rpc_prog == PROG_MOUNT)
-   sport = NfsSrvMountPort;
+   sport = nfs_server_mount_port;
else
-   sport = NfsSrvNfsPort;
+   sport = nfs_server_port;
 
net_send_udp_packet(net_server_ethaddr, nfs_server_ip, sport,
-   NfsOurPort, pktlen);
+   nfs_our_port, pktlen);
 }
 
 /**
 RPC_LOOKUP - Lookup RPC Port numbers
 **/
-static void
-rpc_lookup_req(int prog, int ver)
+static void rpc_lookup_req(int prog, int ver)
 {
uint32_t data[16];
 
@@ -236,8 +231,7 @@ rpc_lookup_req(int prog, int ver)
 /**
 NFS_MOUNT - Mount an NFS Filesystem
 **/
-static void
-nfs_mount_req(char *path)
+static void nfs_mount_req(char *path)
 {
uint32_t data[1024];
uint32_t *p;
@@ -263,14 +257,13 @@ nfs_mount_req(char *path)
 /**
 NFS_UMOUNTALL - Unmount all our NFS Filesystems on the Server
 **/
-static void
-nfs_umountall_req(void)
+static void nfs_umountall_req(void)
 {
uint32_t data[1024];
uint32_t *p;
int len;
 
-   if ((NfsSrvMountPort == -1) || (!fs_mounted))
+   if ((nfs_server_mount_port == -1) || (!fs_mounted))
/* Nothing mounted, nothing to umount */
return;
 
@@ -289,8 +282,7 @@ nfs_umountall_req(void)
  * In case of successful readlink(), the dirname is manipulated,
  * so that inside the nfs() function a recursion can be done.
  **/
-static void
-nfs_readlink_req(void)
+static void nfs_readlink_req(void)
 {
uint32_t 

[U-Boot] [PATCH 20/23] net: cosmetic: Fix checkpatch.pl failures in net.h

2015-04-03 Thread Joe Hershberger
There were still a few remaining complains in the legacy eth_device
definition that hadn't been addressed.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 include/net.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/net.h b/include/net.h
index c4a534c..069b688 100644
--- a/include/net.h
+++ b/include/net.h
@@ -143,14 +143,14 @@ struct eth_device {
phys_addr_t iobase;
int state;
 
-   int  (*init) (struct eth_device *, bd_t *);
-   int  (*send) (struct eth_device *, void *packet, int length);
-   int  (*recv) (struct eth_device *);
-   void (*halt) (struct eth_device *);
+   int (*init)(struct eth_device *, bd_t *);
+   int (*send)(struct eth_device *, void *packet, int length);
+   int (*recv)(struct eth_device *);
+   void (*halt)(struct eth_device *);
 #ifdef CONFIG_MCAST_TFTP
-   int (*mcast) (struct eth_device *, const u8 *enetaddr, u8 set);
+   int (*mcast)(struct eth_device *, const u8 *enetaddr, u8 set);
 #endif
-   int  (*write_hwaddr) (struct eth_device *);
+   int (*write_hwaddr)(struct eth_device *);
struct eth_device *next;
int index;
void *priv;
-- 
1.7.11.5

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


[U-Boot] [PATCH 04/23] net: cosmetic: Name ethaddr variables consistently

2015-04-03 Thread Joe Hershberger
Use _ethaddr at the end of variables and drop CamelCase.
Make constant values actually 'const'.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 arch/arm/mach-davinci/misc.c   |  2 +-
 arch/powerpc/cpu/mpc8260/ether_fcc.c   | 14 +--
 arch/powerpc/cpu/mpc8xx/fec.c  |  6 ++---
 board/BuR/common/common.c  |  4 ++--
 board/ait/cam_enc_4xx/cam_enc_4xx.c|  2 +-
 board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c |  2 +-
 board/bct-brettl2/bct-brettl2.c|  2 +-
 board/bf518f-ezbrd/bf518f-ezbrd.c  |  4 ++--
 board/bf526-ezbrd/bf526-ezbrd.c|  4 ++--
 board/bf527-ezkit/bf527-ezkit.c|  4 ++--
 board/bf537-minotaur/bf537-minotaur.c  |  2 +-
 board/bf537-pnav/bf537-pnav.c  |  2 +-
 board/bf537-srv1/bf537-srv1.c  |  2 +-
 board/bf537-stamp/bf537-stamp.c|  4 ++--
 board/birdland/bav335x/board.c |  4 ++--
 board/buffalo/lsxl/lsxl.c  |  2 +-
 board/cm-bf527/cm-bf527.c  |  4 ++--
 board/cm-bf537e/cm-bf537e.c|  2 +-
 board/cm-bf537u/cm-bf537u.c|  2 +-
 board/compulab/cm_fx6/cm_fx6.c |  2 +-
 board/compulab/cm_t335/cm_t335.c   |  2 +-
 board/compulab/cm_t35/cm_t35.c |  2 +-
 board/compulab/cm_t3517/cm_t3517.c |  4 ++--
 board/compulab/cm_t54/cm_t54.c |  4 ++--
 board/davinci/da8xxevm/da850evm.c  |  6 ++---
 board/dnp5370/dnp5370.c|  4 ++--
 board/gumstix/pepper/board.c   |  2 +-
 board/ifm/ac14xx/ac14xx.c  |  2 +-
 board/ip04/ip04.c  |  2 +-
 board/isee/igep0033/board.c|  2 +-
 board/phytec/pcm051/board.c|  2 +-
 board/renesas/r0p7734/r0p7734.c|  2 +-
 board/siemens/common/factoryset.c  |  4 ++--
 board/siemens/pxm2/board.c |  2 +-
 board/silica/pengwyn/board.c   |  2 +-
 board/tcm-bf518/tcm-bf518.c|  4 ++--
 board/tcm-bf537/tcm-bf537.c|  2 +-
 board/ti/am335x/board.c|  6 ++---
 board/ti/am43xx/board.c|  4 ++--
 board/ti/beagle_x15/board.c|  4 ++--
 board/ti/dra7xx/evm.c  |  4 ++--
 board/ti/ti814x/evm.c  |  2 +-
 doc/README.enetaddr|  2 +-
 drivers/net/cpsw.c | 13 +-
 drivers/net/dm9000x.c  |  4 ++--
 drivers/net/e1000.c|  2 +-
 drivers/net/fec_mxc.c  |  2 +-
 drivers/net/ftmac110.c |  2 +-
 drivers/net/macb.c |  2 +-
 drivers/net/netconsole.c   |  4 ++--
 drivers/usb/eth/smsc95xx.c |  2 +-
 drivers/usb/gadget/ether.c |  8 +++
 include/net.h  | 38 +++---
 net/arp.c  |  8 +++
 net/bootp.c| 19 ---
 net/cdp.c  |  8 +++
 net/dns.c  |  4 ++--
 net/eth.c  | 22 -
 net/link_local.c   | 18 +++---
 net/net.c  | 24 +--
 net/nfs.c  |  4 ++--
 net/ping.c |  2 +-
 net/rarp.c |  8 +++
 net/sntp.c |  4 ++--
 net/tftp.c |  6 ++---
 65 files changed, 171 insertions(+), 173 deletions(-)

diff --git a/arch/arm/mach-davinci/misc.c b/arch/arm/mach-davinci/misc.c
index e18bdfc..e699d61 100644
--- a/arch/arm/mach-davinci/misc.c
+++ b/arch/arm/mach-davinci/misc.c
@@ -49,7 +49,7 @@ int dvevm_read_mac_address(uint8_t *buf)
goto i2cerr;
 
/* Check that MAC address is valid. */
-   if (!is_valid_ether_addr(buf))
+   if (!is_valid_ethaddr(buf))
goto err;
 
return 1; /* Found */
diff --git a/arch/powerpc/cpu/mpc8260/ether_fcc.c 
b/arch/powerpc/cpu/mpc8260/ether_fcc.c
index f777ba1..240e7ae 100644
--- a/arch/powerpc/cpu/mpc8260/ether_fcc.c
+++ b/arch/powerpc/cpu/mpc8260/ether_fcc.c
@@ -637,7 +637,7 @@ eth_loopback_test (void)
 
puts (FCC Ethernet External loopback test\n);
 
-   eth_getenv_enetaddr(ethaddr, NetOurEther);
+   eth_getenv_enetaddr(ethaddr, net_ethaddr);
 
/*
 * global initialisations for all FCC channels
@@ -721,7 +721,7 @@ eth_loopback_test (void)
BD_ENET_TX_LAST | BD_ENET_TX_TC;
 
memset ((void *)bp, patbytes[i], ELBT_BUFSZ);
-   NetSetEther (bp, NetBcastAddr, 0x8000);
+   NetSetEther(bp, net_bcast_ethaddr, 

[U-Boot] [PATCH 01/23] net: cosmetic: Change IPaddr_t to struct in_addr

2015-04-03 Thread Joe Hershberger
This patch is simply clean-up to make the IPv4 type that is used match
what Linux uses. It also attempts to move all variables that are IP
addresses use good naming instead of CamelCase. No functional change.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 common/cmd_net.c  |  50 +--
 common/cmd_pxe.c  |   2 +-
 drivers/net/netconsole.c  |  37 +++---
 drivers/net/sandbox-raw.c |   8 +--
 drivers/net/sandbox.c |  14 +++---
 include/common.h  |   2 +-
 include/net.h |  63 ---
 lib/net_utils.c   |  16 +++---
 net/arp.c |  56 ++---
 net/arp.h |   6 +--
 net/bootp.c   | 125 +-
 net/bootp.h   |   8 +--
 net/dns.c |  18 +++
 net/eth.c |   8 +--
 net/link_local.c  |  21 
 net/net.c |  92 +-
 net/nfs.c |  40 ---
 net/ping.c|  22 
 net/rarp.c|   8 +--
 net/sntp.c|  11 ++--
 net/tftp.c|  69 +
 test/dm/eth.c |  10 ++--
 22 files changed, 354 insertions(+), 332 deletions(-)

diff --git a/common/cmd_net.c b/common/cmd_net.c
index 3f52edc..0a85d72 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -114,13 +114,13 @@ static void netboot_update_env(void)
 {
char tmp[22];
 
-   if (NetOurGatewayIP) {
-   ip_to_string(NetOurGatewayIP, tmp);
+   if (net_gateway.s_addr) {
+   ip_to_string(net_gateway, tmp);
setenv(gatewayip, tmp);
}
 
-   if (NetOurSubnetMask) {
-   ip_to_string(NetOurSubnetMask, tmp);
+   if (net_netmask.s_addr) {
+   ip_to_string(net_netmask, tmp);
setenv(netmask, tmp);
}
 
@@ -130,8 +130,8 @@ static void netboot_update_env(void)
if (NetOurRootPath[0])
setenv(rootpath, NetOurRootPath);
 
-   if (NetOurIP) {
-   ip_to_string(NetOurIP, tmp);
+   if (net_ip.s_addr) {
+   ip_to_string(net_ip, tmp);
setenv(ipaddr, tmp);
}
 #if !defined(CONFIG_BOOTP_SERVERIP)
@@ -139,18 +139,18 @@ static void netboot_update_env(void)
 * Only attempt to change serverip if net/bootp.c:BootpCopyNetParams()
 * could have set it
 */
-   if (NetServerIP) {
-   ip_to_string(NetServerIP, tmp);
+   if (net_server_ip.s_addr) {
+   ip_to_string(net_server_ip, tmp);
setenv(serverip, tmp);
}
 #endif
-   if (NetOurDNSIP) {
-   ip_to_string(NetOurDNSIP, tmp);
+   if (net_dns_server.s_addr) {
+   ip_to_string(net_dns_server, tmp);
setenv(dnsip, tmp);
}
 #if defined(CONFIG_BOOTP_DNS2)
-   if (NetOurDNS2IP) {
-   ip_to_string(NetOurDNS2IP, tmp);
+   if (net_dns_server2.s_addr) {
+   ip_to_string(net_dns_server2, tmp);
setenv(dnsip2, tmp);
}
 #endif
@@ -166,8 +166,8 @@ static void netboot_update_env(void)
 #endif
 #if defined(CONFIG_CMD_SNTP) \
  defined(CONFIG_BOOTP_NTPSERVER)
-   if (NetNtpServerIP) {
-   ip_to_string(NetNtpServerIP, tmp);
+   if (net_ntp_ip.s_addr) {
+   ip_to_string(net_ntp_ip, tmp);
setenv(ntpserverip, tmp);
}
 #endif
@@ -260,8 +260,8 @@ static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
if (argc  2)
return CMD_RET_USAGE;
 
-   NetPingIP = string_to_ip(argv[1]);
-   if (NetPingIP == 0)
+   net_ping_ip = string_to_ip(argv[1]);
+   if (net_ping_ip.s_addr == 0)
return CMD_RET_USAGE;
 
if (NetLoop(PING)  0) {
@@ -331,14 +331,14 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
char *toff;
 
if (argc  2) {
-   NetNtpServerIP = getenv_IPaddr(ntpserverip);
-   if (NetNtpServerIP == 0) {
+   net_ntp_server = getenv_ip(ntpserverip);
+   if (net_ntp_server.s_addr == 0) {
printf(ntpserverip not set\n);
return CMD_RET_FAILURE;
}
} else {
-   NetNtpServerIP = string_to_ip(argv[1]);
-   if (NetNtpServerIP == 0) {
+   net_ntp_server = string_to_ip(argv[1]);
+   if (net_ntp_server.s_addr == 0) {
printf(Bad NTP server IP address\n);
return CMD_RET_FAILURE;
}
@@ -352,7 +352,7 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
 
if (NetLoop(SNTP)  0) {
printf(SNTP failed: host %pI4 not responding\n,
-   NetNtpServerIP);
+

[U-Boot] [PATCH 08/23] net: cosmetic: Clean up ARP variables and functions

2015-04-03 Thread Joe Hershberger
Make a thorough pass through all variables and function names contained
within arp and remove CamelCase and improve naming.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 net/arp.c  | 69 +++---
 net/arp.h  | 16 +++
 net/net.c  | 16 +++
 net/ping.c |  8 
 4 files changed, 54 insertions(+), 55 deletions(-)

diff --git a/net/arp.c b/net/arp.c
index 691811d..f64f13d 100644
--- a/net/arp.c
+++ b/net/arp.c
@@ -30,40 +30,40 @@
 struct in_addr net_arp_wait_packet_ip;
 static struct in_addr net_arp_wait_reply_ip;
 /* MAC address of waiting packet's destination */
-uchar *NetArpWaitPacketMAC;
-intNetArpWaitTxPacketSize;
-ulong  NetArpWaitTimerStart;
-intNetArpWaitTry;
+uchar *arp_wait_packet_ethaddr;
+intarp_wait_tx_packet_size;
+ulong  arp_wait_timer_start;
+intarp_wait_try;
 
-static uchar   *net_arp_tx_packet; /* THE ARP transmit packet */
-static uchar   NetArpPacketBuf[PKTSIZE_ALIGN + PKTALIGN];
+static uchar   *arp_tx_packet; /* THE ARP transmit packet */
+static uchar   arp_tx_packet_buf[PKTSIZE_ALIGN + PKTALIGN];
 
-void ArpInit(void)
+void arp_init(void)
 {
/* XXX problem with bss workaround */
-   NetArpWaitPacketMAC = NULL;
+   arp_wait_packet_ethaddr = NULL;
net_arp_wait_packet_ip.s_addr = 0;
net_arp_wait_reply_ip.s_addr = 0;
-   NetArpWaitTxPacketSize = 0;
-   net_arp_tx_packet = NetArpPacketBuf[0] + (PKTALIGN - 1);
-   net_arp_tx_packet -= (ulong)net_arp_tx_packet % PKTALIGN;
+   arp_wait_tx_packet_size = 0;
+   arp_tx_packet = arp_tx_packet_buf[0] + (PKTALIGN - 1);
+   arp_tx_packet -= (ulong)arp_tx_packet % PKTALIGN;
 }
 
-void arp_raw_request(struct in_addr source_ip, const uchar *targetEther,
+void arp_raw_request(struct in_addr source_ip, const uchar *target_ethaddr,
struct in_addr target_ip)
 {
uchar *pkt;
struct arp_hdr *arp;
int eth_hdr_size;
 
-   debug_cond(DEBUG_DEV_PKT, ARP broadcast %d\n, NetArpWaitTry);
+   debug_cond(DEBUG_DEV_PKT, ARP broadcast %d\n, arp_wait_try);
 
-   pkt = net_arp_tx_packet;
+   pkt = arp_tx_packet;
 
eth_hdr_size = net_set_ether(pkt, net_bcast_ethaddr, PROT_ARP);
pkt += eth_hdr_size;
 
-   arp = (struct arp_hdr *) pkt;
+   arp = (struct arp_hdr *)pkt;
 
arp-ar_hrd = htons(ARP_ETHER);
arp-ar_pro = htons(PROT_IP);
@@ -73,13 +73,13 @@ void arp_raw_request(struct in_addr source_ip, const uchar 
*targetEther,
 
memcpy(arp-ar_sha, net_ethaddr, ARP_HLEN);/* source ET addr */
net_write_ip(arp-ar_spa, source_ip);  /* source IP addr */
-   memcpy(arp-ar_tha, targetEther, ARP_HLEN);/* target ET addr */
+   memcpy(arp-ar_tha, target_ethaddr, ARP_HLEN); /* target ET addr */
net_write_ip(arp-ar_tpa, target_ip);  /* target IP addr */
 
-   net_send_packet(net_arp_tx_packet, eth_hdr_size + ARP_HDR_SIZE);
+   net_send_packet(arp_tx_packet, eth_hdr_size + ARP_HDR_SIZE);
 }
 
-void ArpRequest(void)
+void arp_request(void)
 {
if ((net_arp_wait_packet_ip.s_addr  net_netmask.s_addr) !=
(net_ip.s_addr  net_netmask.s_addr)) {
@@ -96,7 +96,7 @@ void ArpRequest(void)
arp_raw_request(net_ip, net_null_ethaddr, net_arp_wait_reply_ip);
 }
 
-void ArpTimeoutCheck(void)
+void arp_timeout_check(void)
 {
ulong t;
 
@@ -106,21 +106,21 @@ void ArpTimeoutCheck(void)
t = get_timer(0);
 
/* check for arp timeout */
-   if ((t - NetArpWaitTimerStart)  ARP_TIMEOUT) {
-   NetArpWaitTry++;
+   if ((t - arp_wait_timer_start)  ARP_TIMEOUT) {
+   arp_wait_try++;
 
-   if (NetArpWaitTry = ARP_TIMEOUT_COUNT) {
+   if (arp_wait_try = ARP_TIMEOUT_COUNT) {
puts(\nARP Retry count exceeded; starting again\n);
-   NetArpWaitTry = 0;
+   arp_wait_try = 0;
NetStartAgain();
} else {
-   NetArpWaitTimerStart = t;
-   ArpRequest();
+   arp_wait_timer_start = t;
+   arp_request();
}
}
 }
 
-void ArpReceive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
+void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
 {
struct arp_hdr *arp;
struct in_addr reply_ip_addr;
@@ -205,28 +205,27 @@ void ArpReceive(struct ethernet_hdr *et, struct 
ip_udp_hdr *ip, int len)
/* matched waiting packet's address */
if (reply_ip_addr.s_addr == net_arp_wait_reply_ip.s_addr) {
debug_cond(DEBUG_DEV_PKT,
-   Got ARP REPLY, set eth addr (%pM)\n,
-   arp-ar_data);
+  Got 

[U-Boot] [PATCH 02/23] net: cosmetic: Fixup var names related to boot file

2015-04-03 Thread Joe Hershberger
The variables around the bootfile were inconsistent and used CamelCase.
Update them to make the code more readable.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 common/cmd_net.c |  9 ++---
 common/cmd_pxe.c |  2 +-
 common/update.c  |  7 ---
 include/net.h|  9 +
 net/bootp.c  | 27 ++-
 net/bootp.h  |  1 -
 net/eth.c|  3 ++-
 net/net.c| 26 +-
 net/nfs.c| 19 ++-
 net/tftp.c   | 29 +++--
 10 files changed, 70 insertions(+), 62 deletions(-)

diff --git a/common/cmd_net.c b/common/cmd_net.c
index 0a85d72..b5b0a11 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -201,11 +201,13 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t 
*cmdtp, int argc,
if (end == (argv[1] + strlen(argv[1])))
load_addr = addr;
else
-   copy_filename(BootFile, argv[1], sizeof(BootFile));
+   copy_filename(net_boot_file_name, argv[1],
+ sizeof(net_boot_file_name));
break;
 
case 3: load_addr = simple_strtoul(argv[1], NULL, 16);
-   copy_filename(BootFile, argv[2], sizeof(BootFile));
+   copy_filename(net_boot_file_name, argv[2],
+ sizeof(net_boot_file_name));
 
break;
 
@@ -216,7 +218,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t 
*cmdtp, int argc,
printf(Invalid address/size\n);
return CMD_RET_USAGE;
}
-   copy_filename(BootFile, argv[3], sizeof(BootFile));
+   copy_filename(net_boot_file_name, argv[3],
+ sizeof(net_boot_file_name));
break;
 #endif
default:
diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index 9eac5c6..5cde5b6 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -1568,7 +1568,7 @@ do_pxe_boot(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
 
destroy_pxe_menu(cfg);
 
-   copy_filename(BootFile, , sizeof(BootFile));
+   copy_filename(net_boot_file_name, , sizeof(net_boot_file_name));
 
return 0;
 }
diff --git a/common/update.c b/common/update.c
index cc830a7..bc0c48f 100644
--- a/common/update.c
+++ b/common/update.c
@@ -58,7 +58,7 @@ static int update_load(char *filename, ulong msec_max, int 
cnt_max, ulong addr)
saved_timeout_msecs = TftpRRQTimeoutMSecs;
saved_timeout_count = TftpRRQTimeoutCountMax;
saved_netretry = strdup(getenv(netretry));
-   saved_bootfile = strdup(BootFile);
+   saved_bootfile = strdup(net_boot_file_name);
 
/* set timeouts for auto-update */
TftpRRQTimeoutMSecs = msec_max;
@@ -69,7 +69,7 @@ static int update_load(char *filename, ulong msec_max, int 
cnt_max, ulong addr)
 
/* download the update file */
load_addr = addr;
-   copy_filename(BootFile, filename, sizeof(BootFile));
+   copy_filename(net_boot_file_name, filename, sizeof(net_boot_file_name));
size = NetLoop(TFTPGET);
 
if (size  0)
@@ -86,7 +86,8 @@ static int update_load(char *filename, ulong msec_max, int 
cnt_max, ulong addr)
free(saved_netretry);
 
if (saved_bootfile != NULL) {
-   copy_filename(BootFile, saved_bootfile, sizeof(BootFile));
+   copy_filename(net_boot_file_name, saved_bootfile,
+ sizeof(net_boot_file_name));
free(saved_bootfile);
}
 
diff --git a/include/net.h b/include/net.h
index 2699c44..b484d4c 100644
--- a/include/net.h
+++ b/include/net.h
@@ -470,9 +470,7 @@ extern struct in_addr net_dns_server2;
 extern charNetOurNISDomain[32];/* Our NIS domain */
 extern charNetOurHostName[32]; /* Our hostname */
 extern charNetOurRootPath[64]; /* Our root path */
-extern ushort  NetBootFileSize;/* Our boot file size in blocks */
 /** END OF BOOTP EXTENTIONS **/
-extern ulong   NetBootFileXferSize;/* size of bootfile in bytes */
 extern uchar   NetOurEther[6]; /* Our ethernet address */
 extern uchar   NetServerEther[6];  /* Boot server enet address */
 extern struct in_addr  net_ip; /* OurIP addr (0 = unknown) */
@@ -501,8 +499,11 @@ enum proto_t {
TFTPSRV, TFTPPUT, LINKLOCAL
 };
 
-/* from net/net.c */
-extern charBootFile[128];  /* Boot File name */
+extern charnet_boot_file_name[128];/* Boot File name */
+/* The actual transferred size of the bootfile (in bytes) */
+extern u32 net_boot_file_size;
+/* Boot file size in blocks as reported by the DHCP server */
+extern u32 net_boot_file_expected_size_in_blocks;
 
 #if defined(CONFIG_CMD_DNS)
 extern char *NetDNSResolve;/* The host to resolve  */
diff --git a/net/bootp.c 

[U-Boot] [PATCH 12/23] net: cosmetic: Clean up SNTP variables and functions

2015-04-03 Thread Joe Hershberger
Make a thorough pass through all variables and function names contained
within sntp.c and remove CamelCase and improve naming.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 net/net.c  |  2 +-
 net/sntp.c | 25 +++--
 net/sntp.h |  2 +-
 3 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/net/net.c b/net/net.c
index bf7fdfc..71baf35 100644
--- a/net/net.c
+++ b/net/net.c
@@ -422,7 +422,7 @@ restart:
 #endif
 #if defined(CONFIG_CMD_SNTP)
case SNTP:
-   SntpStart();
+   sntp_start();
break;
 #endif
 #if defined(CONFIG_CMD_DNS)
diff --git a/net/sntp.c b/net/sntp.c
index 1e2b678..8073ca6 100644
--- a/net/sntp.c
+++ b/net/sntp.c
@@ -14,10 +14,9 @@
 
 #define SNTP_TIMEOUT 1UL
 
-static int SntpOurPort;
+static int sntp_our_port;
 
-static void
-SntpSend(void)
+static void sntp_send(void)
 {
struct sntp_pkt_t pkt;
int pktlen = SNTP_PACKET_LEN;
@@ -34,15 +33,14 @@ SntpSend(void)
memcpy((char *)net_tx_packet + net_eth_hdr_size() + IP_UDP_HDR_SIZE,
   (char *)pkt, pktlen);
 
-   SntpOurPort = 1 + (get_timer(0) % 4096);
+   sntp_our_port = 1 + (get_timer(0) % 4096);
sport = NTP_SERVICE_PORT;
 
net_send_udp_packet(net_server_ethaddr, net_ntp_server, sport,
-   SntpOurPort, pktlen);
+   sntp_our_port, pktlen);
 }
 
-static void
-SntpTimeout(void)
+static void sntp_timeout_handler(void)
 {
puts(Timeout\n);
net_set_state(NETLOOP_FAIL);
@@ -58,7 +56,7 @@ static void sntp_handler(uchar *pkt, unsigned dest, struct 
in_addr sip,
 
debug(%s\n, __func__);
 
-   if (dest != SntpOurPort)
+   if (dest != sntp_our_port)
return;
 
/*
@@ -72,20 +70,19 @@ static void sntp_handler(uchar *pkt, unsigned dest, struct 
in_addr sip,
rtc_set(tm);
 #endif
printf(Date: %4d-%02d-%02d Time: %2d:%02d:%02d\n,
-   tm.tm_year, tm.tm_mon, tm.tm_mday,
-   tm.tm_hour, tm.tm_min, tm.tm_sec);
+  tm.tm_year, tm.tm_mon, tm.tm_mday,
+  tm.tm_hour, tm.tm_min, tm.tm_sec);
 
net_set_state(NETLOOP_SUCCESS);
 }
 
-void
-SntpStart(void)
+void sntp_start(void)
 {
debug(%s\n, __func__);
 
-   NetSetTimeout(SNTP_TIMEOUT, SntpTimeout);
+   NetSetTimeout(SNTP_TIMEOUT, sntp_timeout_handler);
net_set_udp_handler(sntp_handler);
memset(net_server_ethaddr, 0, sizeof(net_server_ethaddr));
 
-   SntpSend();
+   sntp_send();
 }
diff --git a/net/sntp.h b/net/sntp.h
index bf5bf0b..6a9c6bb 100644
--- a/net/sntp.h
+++ b/net/sntp.h
@@ -53,6 +53,6 @@ struct sntp_pkt_t {
unsigned long long transmit_timestamp;
 };
 
-extern void SntpStart(void);   /* Begin SNTP */
+void sntp_start(void); /* Begin SNTP */
 
 #endif /* __SNTP_H__ */
-- 
1.7.11.5

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


[U-Boot] [PATCH 19/23] net: cosmetic: Fix checkpatch.pl failures in eth.c

2015-04-03 Thread Joe Hershberger
There were still a few failures in net/eth.c, especially in the legacy
part of the code.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 net/eth.c | 26 --
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/net/eth.c b/net/eth.c
index e936ca0..953b6a6 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -74,8 +74,10 @@ static int eth_mac_skip(int index)
 {
char enetvar[15];
char *skip_state;
+
sprintf(enetvar, index ? eth%dmacskip : ethmacskip, index);
-   return ((skip_state = getenv(enetvar)) != NULL);
+   skip_state = getenv(enetvar);
+   return skip_state != NULL;
 }
 
 static void eth_current_changed(void);
@@ -275,8 +277,9 @@ int eth_init(void)
priv-state = ETH_STATE_ACTIVE;
return 0;
}
-   } else
+   } else {
ret = eth_errno;
+   }
 
debug(FAIL\n);
 
@@ -610,11 +613,11 @@ int eth_write_hwaddr(struct eth_device *dev, const char 
*base_name,
if (!is_zero_ethaddr(dev-enetaddr) 
memcmp(dev-enetaddr, env_enetaddr, 6)) {
printf(\nWarning: %s MAC addresses don't match:\n,
-   dev-name);
+  dev-name);
printf(Address in SROM is %pM\n,
-   dev-enetaddr);
+  dev-enetaddr);
printf(Address in environment is  %pM\n,
-   env_enetaddr);
+  env_enetaddr);
}
 
memcpy(dev-enetaddr, env_enetaddr, 6);
@@ -622,7 +625,7 @@ int eth_write_hwaddr(struct eth_device *dev, const char 
*base_name,
eth_setenv_enetaddr_by_index(base_name, eth_number,
 dev-enetaddr);
printf(\nWarning: %s using MAC address from net device\n,
-   dev-name);
+  dev-name);
} else if (is_zero_ethaddr(dev-enetaddr)) {
printf(\nError: %s address not set.\n,
   dev-name);
@@ -632,13 +635,14 @@ int eth_write_hwaddr(struct eth_device *dev, const char 
*base_name,
if (dev-write_hwaddr  !eth_mac_skip(eth_number)) {
if (!is_valid_ethaddr(dev-enetaddr)) {
printf(\nError: %s address %pM illegal value\n,
-dev-name, dev-enetaddr);
+  dev-name, dev-enetaddr);
return -EINVAL;
}
 
ret = dev-write_hwaddr(dev);
if (ret)
-   printf(\nWarning: %s failed to set MAC address\n, 
dev-name);
+   printf(\nWarning: %s failed to set MAC address\n,
+  dev-name);
}
 
return ret;
@@ -652,7 +656,8 @@ int eth_register(struct eth_device *dev)
assert(strlen(dev-name)  sizeof(dev-name));
 
if (!eth_devices) {
-   eth_current = eth_devices = dev;
+   eth_devices = dev;
+   eth_current = dev;
eth_current_changed();
} else {
for (d = eth_devices; d-next != eth_devices; d = d-next)
@@ -723,8 +728,9 @@ int eth_initialize(void)
} else if (cpu_eth_init != __def_eth_init) {
if (cpu_eth_init(gd-bd)  0)
printf(CPU Net Initialization Failed\n);
-   } else
+   } else {
printf(Net Initialization Skipped\n);
+   }
 
if (!eth_devices) {
puts(No ethernet found.\n);
-- 
1.7.11.5

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


[U-Boot] [PATCH 22/23] net: Fix incorrect DHCP/BOOTP packets on 64-bit systems

2015-04-03 Thread Joe Hershberger
From: Sergey Temerkhanov s.temerkha...@gmail.com

This commit fixes incorrect DHCP/BOOTP packet layout caused by
'ulong' type size difference on 64 and 32-bit architectures.
It also renames NetReadLong()/NetCopyLong() to
net_read_u32/net_copy_u32() accordingly.


Signed-off-by: Radha Mohan Chintakuntla rchintakun...@cavium.com
Signed-off-by: Sergey Temerkhanov s.temerkha...@gmail.com
Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 include/net.h | 10 +-
 net/bootp.c   | 33 -
 net/bootp.h   |  4 ++--
 3 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/include/net.h b/include/net.h
index e9131f7..def1fd9 100644
--- a/include/net.h
+++ b/include/net.h
@@ -410,7 +410,7 @@ struct icmp_hdr {
ushort  id;
ushort  sequence;
} echo;
-   ulong   gateway;
+   u32 gateway;
struct {
ushort  unused;
ushort  mtu;
@@ -678,9 +678,9 @@ static inline struct in_addr net_read_ip(void *from)
 }
 
 /* return ulong *in network byteorder* */
-static inline ulong net_read_long(ulong *from)
+static inline u32 net_read_u32(u32 *from)
 {
-   ulong l;
+   u32 l;
 
memcpy((void *)l, (void *)from, sizeof(l));
return l;
@@ -699,9 +699,9 @@ static inline void net_copy_ip(void *to, void *from)
 }
 
 /* copy ulong */
-static inline void net_copy_long(ulong *to, ulong *from)
+static inline void net_copy_u32(u32 *to, u32 *from)
 {
-   memcpy((void *)to, (void *)from, sizeof(ulong));
+   memcpy((void *)to, (void *)from, sizeof(u32));
 }
 
 /**
diff --git a/net/bootp.c b/net/bootp.c
index 500850c..43466af 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -51,7 +51,7 @@
 #define CONFIG_BOOTP_ID_CACHE_SIZE 4
 #endif
 
-ulong  bootp_ids[CONFIG_BOOTP_ID_CACHE_SIZE];
+u32bootp_ids[CONFIG_BOOTP_ID_CACHE_SIZE];
 unsigned int   bootp_num_ids;
 intbootp_try;
 ulong  bootp_start;
@@ -62,7 +62,7 @@ char net_root_path[64] = {0,}; /* Our bootpath */
 
 #if defined(CONFIG_CMD_DHCP)
 static dhcp_state_t dhcp_state = INIT;
-static unsigned long dhcp_leasetime;
+static u32 dhcp_leasetime;
 static struct in_addr dhcp_server_ip;
 static void dhcp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
unsigned src, unsigned len);
@@ -128,7 +128,7 @@ static int check_packet(uchar *pkt, unsigned dest, unsigned 
src, unsigned len)
retval = -4;
else if (bp-bp_hlen != HWL_ETHER)
retval = -5;
-   else if (!bootp_match_id(net_read_long((ulong *)bp-bp_id)))
+   else if (!bootp_match_id(net_read_u32(bp-bp_id)))
retval = -6;
 
debug(Filtering pkt = %d\n, retval);
@@ -356,8 +356,7 @@ static void bootp_handler(uchar *pkt, unsigned dest, struct 
in_addr sip,
store_net_params(bp);   /* Store net parameters from reply */
 
/* Retrieve extended information (we must parse the vendor area) */
-   if (net_read_long((ulong *)bp-bp_vend[0]) ==
-   htonl(BOOTP_VENDOR_MAGIC))
+   if (net_read_u32((u32 *)bp-bp_vend[0]) == htonl(BOOTP_VENDOR_MAGIC))
bootp_process_vendor((uchar *)bp-bp_vend[4], len);
 
net_set_timeout_handler(0, (thand_f *)0);
@@ -666,7 +665,7 @@ void bootp_request(void)
 #ifdef CONFIG_BOOTP_RANDOM_DELAY
ulong rand_ms;
 #endif
-   ulong bootp_id;
+   u32 bootp_id;
struct in_addr zero_ip;
struct in_addr bcast_ip;
 
@@ -734,14 +733,14 @@ void bootp_request(void)
 *  Bootp ID is the lower 4 bytes of our ethernet address
 *  plus the current time in ms.
 */
-   bootp_id = ((ulong)net_ethaddr[2]  24)
-   | ((ulong)net_ethaddr[3]  16)
-   | ((ulong)net_ethaddr[4]  8)
-   | (ulong)net_ethaddr[5];
+   bootp_id = ((u32)net_ethaddr[2]  24)
+   | ((u32)net_ethaddr[3]  16)
+   | ((u32)net_ethaddr[4]  8)
+   | (u32)net_ethaddr[5];
bootp_id += get_timer(0);
bootp_id = htonl(bootp_id);
bootp_add_id(bootp_id);
-   net_copy_long(bp-bp_id, bootp_id);
+   net_copy_u32(bp-bp_id, bootp_id);
 
/*
 * Calculate proper packet lengths taking into account the
@@ -780,7 +779,7 @@ static void dhcp_process_options(uchar *popt, struct 
bootp_hdr *bp)
 #if defined(CONFIG_CMD_SNTP)  defined(CONFIG_BOOTP_TIMEOFFSET)
case 2: /* Time offset  */
to_ptr = net_ntp_time_offset;
-   net_copy_long((ulong *)to_ptr, (ulong *)(popt + 2));
+   net_copy_u32((u32 *)to_ptr, (u32 *)(popt + 2));
net_ntp_time_offset = ntohl(net_ntp_time_offset);
break;
 #endif
@@ -816,7 +815,7 @@ static void dhcp_process_options(uchar *popt, struct 
bootp_hdr *bp)

Re: [U-Boot] [PATCH 1/2] mtd: vf610_nfc: mark page as dirty on block erase

2015-04-03 Thread Scott Wood
On Fri, 2015-04-03 at 20:09 +0200, Stefan Agner wrote:
 On 2015-04-03 01:48, Scott Wood wrote:
  On Tue, 2015-03-31 at 11:02 -0400, Bill Pringlemeir wrote:
  On 2015-03-31 00:15, Scott Wood wrote:
 
   Especially since you'd be doing one write rather than four full-page
   partial writes.  Surely the bottleneck here is the NAND chip itself,
   not copying data to the buffer?
 
  The AHB bus that the NFC controller is on is relatively slow.  Here are
  some numbers from 'AN4947-vybrid-bus-architechure',
 
  Vybrid Cortex A5 to DDR (in CPU clocks 400/500MHz),
 
 First read Subsequent
 2858  all caches on
 345269no cache, mmu
 437371no cache, no mmu
 
  The NFC is on an AHB bus 32bit, 66MHz (not AXI 64bit, 133-166MHz like
  DDR).  The AHB will be about four times slower.  Also the reads and
  writes to the physical NAND must take place serially.  Here are the
  program page steps.
 
1. Issue controller Read full page to NFC buffer.
2. Copy update partial page from DDR to NFC buffer.
3. Issue write NAND page.
  
  Why is any sort of read part of the write process?
 
 To recalculate the correct ECC, which is done in the controller, the
 controller has to have the page in the SRAM. I will send out a patch
 which implements vf610_nfc_write_subpage. And the read part is done when
 the MTD subsystem calls NAND_CMD_SEQIN.

Again, if this is the only way you can do subpage accesses then you
should not do them.

 Actually, the Linux NAND driver supports subpage writes already by using
 the generic nand_write_subpage_hwecc function. However, in U-Boot I
 added driver specific page_read/page_write due to performance reasons:
 http://lists.denx.de/pipermail/u-boot/2014-August/186293.html
 
 However, I tried driver specific page_read/page_write functions for
 Linux too, but I couldn't measure noticeable performance improvements. I
 think the reason why it lead to noticeable improvements for U-Boot was
 because U-Boot does not use caches so far.

If you care about U-Boot's performance at all, enabling cache would be
the first thing I'd try...

-Scott


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


Re: [U-Boot] u-boot: OpenRD Ultimate fails to build

2015-04-03 Thread Vagrant Cascadian
On 2015-03-25, drEagle wrote:
 Le 21/03/2015 15:53, Vagrant Cascadian a écrit :
 It seems that OpenRD Ultimate with u-boot 2015.04-rc3 and newer no
 longer builds from source, both in Debian and with mainline git. It
 appears to have overgrown the size limits set for it:

 Looks like the NAND partition map had to be changed to give more space for 
 u-boot.

The following patch gets it to build by moving the env addr and offset
later. This might cause problems with new or existing u-boot
installations on openrd if the environment needs to be at a specific
location. I have no hardware to test, so no way of confirming this
directly:

diff --git a/include/configs/openrd.h b/include/configs/openrd.h
index b6f80af..2f1e174 100644
--- a/include/configs/openrd.h
+++ b/include/configs/openrd.h
@@ -72,12 +72,12 @@
 /*
  * max 4k env size is enough, but in case of nand
  * it has to be rounded to sector size
  */
 #define CONFIG_ENV_SIZE0x2 /* 128k */
-#define CONFIG_ENV_ADDR0x6
-#define CONFIG_ENV_OFFSET  0x6 /* env starts here */
+#define CONFIG_ENV_ADDR0x8
+#define CONFIG_ENV_OFFSET  0x8 /* env starts here */
 /*
  * Environment is right behind U-Boot in flash. Make sure U-Boot
  * doesn't grow into the environment area.
  */
 #define CONFIG_BOARD_SIZE_LIMITCONFIG_ENV_OFFSET


I'll likely remove openrd_ultimate from future uploads to Debian if I
can't get confirmation about how to fix this properly.


live well,
  vagrant


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


Re: [U-Boot] [PATCH 2/4] mtd: vf610_nfc: add Freescale NFC controller configs to Kconfig

2015-04-03 Thread Scott Wood
On Fri, 2015-04-03 at 22:42 +0200, Stefan Agner wrote:
 On 2015-04-03 22:30, Scott Wood wrote:
  On Fri, 2015-04-03 at 20:40 +0200, Stefan Agner wrote:
  This commit allows users to enable/disable the Freescale NFC
  controller found in systems like Vybrid (VF610), MPC5125, MCF54418
  or Kinetis K70 via Kconfig with more detailed help docs.
 
  Signed-off-by: Stefan Agner ste...@agner.ch
  ---
   configs/vf610twr_defconfig |  2 ++
   drivers/mtd/nand/Kconfig   | 15 +++
   include/configs/vf610twr.h |  3 ---
   3 files changed, 17 insertions(+), 3 deletions(-)
 
  diff --git a/configs/vf610twr_defconfig b/configs/vf610twr_defconfig
  index 7de374a..5e0ac9f 100644
  --- a/configs/vf610twr_defconfig
  +++ b/configs/vf610twr_defconfig
  @@ -1,3 +1,5 @@
   
  CONFIG_SYS_EXTRA_OPTIONS=IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_MMC
   CONFIG_ARM=y
   CONFIG_TARGET_VF610TWR=y
  +CONFIG_NAND_VF610_NFC=y
  +CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
  diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
  index 72825c3..8056c06 100644
  --- a/drivers/mtd/nand/Kconfig
  +++ b/drivers/mtd/nand/Kconfig
  @@ -32,6 +32,21 @@ config NAND_DENALI_SPARE_AREA_SKIP_BYTES
   of OOB area before last ECC sector data starts.  This is potentially
   used to preserve the bad block marker in the OOB area.
 
  +config NAND_VF610_NFC
  +  bool Support for Freescale NFC for VF610/MPC5125
  +  select SYS_NAND_SELF_INIT
  +  help
  +Enables support for NAND Flash Controller on some Freescale
  +processors like the VF610, MPC5125, MCF54418 or Kinetis K70.
  +The driver supports a maximum 2k page size. The driver
  +currently does not support hardware ECC.
  +
  +config SYS_NAND_BUSWIDTH_16BIT
  +  bool Use 16-bit NAND interface
  +  depends on NAND_VF610_NFC
  +  help
  +Use 16-bit wide NAND flash interface.
  
  Why does a generic-sounding config name depend on VF610?  Especially
  when README already lists three other drivers as using this option...
 
 That option is _not_ meant as being VF610 specific.
 
 Since we have the ability to specify dependencies with Kconfig, I think
 it is nice to have options only available if a driver supports it, hence
 the depends. So far the VF610 NAND driver is the only one which is in
 Kconfig and supports it... I would expect that when another driver which
 supports that option gets migrated, depends will be extended
 accordingly.
 
 However, I just realized that the option end up between Vybrid specific
 configs because of Patch 3. I will move the option at the very bottom in
 next revision.

Could you also add a comment mentioning the other drivers that use it,
which aren't yet kconfiged?  And then remove the old text from the
README.

-Scott


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


[U-Boot] [PATCH 05/23] net: cosmetic: Cleanup internal packet buffer names

2015-04-03 Thread Joe Hershberger
This patch cleans up the names of internal packet buffer names that are
used within the network stack and the functions that use them.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 arch/powerpc/cpu/mpc8260/ether_fcc.c |  4 ++--
 drivers/net/netconsole.c | 13 +--
 include/net.h| 16 +++---
 net/arp.c| 20 -
 net/bootp.c  | 16 +++---
 net/cdp.c| 10 -
 net/dns.c|  7 +++---
 net/net.c| 42 ++--
 net/nfs.c|  8 +++
 net/ping.c   |  6 +++---
 net/rarp.c   |  6 +++---
 net/sntp.c   |  8 +++
 net/tftp.c   |  6 +++---
 13 files changed, 82 insertions(+), 80 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8260/ether_fcc.c 
b/arch/powerpc/cpu/mpc8260/ether_fcc.c
index 240e7ae..50d1654 100644
--- a/arch/powerpc/cpu/mpc8260/ether_fcc.c
+++ b/arch/powerpc/cpu/mpc8260/ether_fcc.c
@@ -720,8 +720,8 @@ eth_loopback_test (void)
bdp-cbd_sc = BD_ENET_TX_READY | BD_ENET_TX_PAD | \
BD_ENET_TX_LAST | BD_ENET_TX_TC;
 
-   memset ((void *)bp, patbytes[i], ELBT_BUFSZ);
-   NetSetEther(bp, net_bcast_ethaddr, 0x8000);
+   memset((void *)bp, patbytes[i], ELBT_BUFSZ);
+   net_set_ether(bp, net_bcast_ethaddr, 0x8000);
}
ecp-txbd[ELBT_NTXBD - 1].cbd_sc |= BD_ENET_TX_WRAP;
 
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 0d81b44..9aba0c5 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -125,10 +125,11 @@ void NcStart(void)
/* send arp request */
uchar *pkt;
net_set_arp_handler(nc_wait_arp_handler);
-   pkt = (uchar *)NetTxPacket + NetEthHdrSize() + IP_UDP_HDR_SIZE;
+   pkt = (uchar *)net_tx_packet + net_eth_hdr_size() +
+   IP_UDP_HDR_SIZE;
memcpy(pkt, output_packet, output_packet_len);
-   NetSendUDPPacket(nc_ether, nc_ip, nc_out_port, nc_in_port,
-   output_packet_len);
+   net_send_udp_packet(nc_ether, nc_ip, nc_out_port, nc_in_port,
+   output_packet_len);
}
 }
 
@@ -202,11 +203,11 @@ static void nc_send_packet(const char *buf, int len)
 
inited = 1;
}
-   pkt = (uchar *)NetTxPacket + NetEthHdrSize() + IP_UDP_HDR_SIZE;
+   pkt = (uchar *)net_tx_packet + net_eth_hdr_size() + IP_UDP_HDR_SIZE;
memcpy(pkt, buf, len);
ether = nc_ether;
ip = nc_ip;
-   NetSendUDPPacket(ether, ip, nc_out_port, nc_in_port, len);
+   net_send_udp_packet(ether, ip, nc_out_port, nc_in_port, len);
 
if (inited) {
if (eth_is_on_demand_init())
@@ -229,7 +230,7 @@ static int nc_start(struct stdio_dev *dev)
 
/*
 * Initialize the static IP settings and buffer pointers
-* incase we call NetSendUDPPacket before NetLoop
+* incase we call net_send_udp_packet before NetLoop
 */
net_init();
 
diff --git a/include/net.h b/include/net.h
index 33e542f..18ae7d2 100644
--- a/include/net.h
+++ b/include/net.h
@@ -475,14 +475,14 @@ extern u8 net_ethaddr[6]; /* Our ethernet 
address */
 extern u8  net_server_ethaddr[6];  /* Boot server enet address */
 extern struct in_addr  net_ip; /* OurIP addr (0 = unknown) */
 extern struct in_addr  net_server_ip;  /* Server IP addr (0 = unknown) */
-extern uchar   *NetTxPacket;   /* THE transmit packet */
+extern uchar   *net_tx_packet; /* THE transmit packet */
 #ifdef CONFIG_DM_ETH
 extern uchar   *net_rx_packets[PKTBUFSRX]; /* Receive packets */
 #else
 extern uchar   *NetRxPackets[PKTBUFSRX]; /* Receive packets */
 #endif
-extern uchar   *NetRxPacket;   /* Current receive packet */
-extern int NetRxPacketLen; /* Current rx packet length */
+extern uchar   *net_rx_packet; /* Current receive packet */
+extern int net_rx_packet_len;  /* Current rx packet length */
 extern unsignedNetIPID;/* IP ID (counting) */
 extern const u8net_bcast_ethaddr[6];   /* Ethernet broadcast 
address */
 extern const u8net_null_ethaddr[6];
@@ -550,10 +550,10 @@ void  NetStop(void);
 intNetStartAgain(void);
 
 /* Get size of the ethernet header when we send */
-intNetEthHdrSize(void);
+int net_eth_hdr_size(void);
 
 /* Set ethernet header; returns the size of the header */
-int NetSetEther(uchar *xet, const uchar 

[U-Boot] [PATCH 21/23] net: cosmetic: Fix checkpatch.pl failures in net.c

2015-04-03 Thread Joe Hershberger
Finish eliminating CamelCase from net.c and other failures

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 README   |   6 +-
 common/cmd_elf.c |   2 +-
 common/cmd_net.c |  22 +++---
 common/spl/spl_net.c |   2 +-
 common/update.c  |   2 +-
 doc/README.link-local|   4 +-
 drivers/net/netconsole.c |  12 ++--
 include/net.h|  18 ++---
 net/arp.c|   2 +-
 net/bootp.c  |  33 -
 net/cdp.c|   6 +-
 net/dns.c|   2 +-
 net/eth.c|   2 +-
 net/link_local.c |   4 +-
 net/net.c| 179 +++
 net/nfs.c|  11 +--
 net/ping.c   |   2 +-
 net/rarp.c   |   6 +-
 net/sntp.c   |   4 +-
 net/tftp.c   |  18 ++---
 test/dm/eth.c|  28 
 21 files changed, 181 insertions(+), 184 deletions(-)

diff --git a/README b/README
index 5d57eb9..25aebbc 100644
--- a/README
+++ b/README
@@ -3340,9 +3340,9 @@ Legacy uImage format:
65  net/eth.c   Ethernet found.
 
   -80  common/cmd_net.cusage wrong
-   80  common/cmd_net.cbefore calling NetLoop()
-  -81  common/cmd_net.csome error in NetLoop() occurred
-   81  common/cmd_net.cNetLoop() back without error
+   80  common/cmd_net.cbefore calling net_loop()
+  -81  common/cmd_net.csome error in net_loop() occurred
+   81  common/cmd_net.cnet_loop() back without error
   -82  common/cmd_net.csize == 0 (File with size 0 loaded)
82  common/cmd_net.ctrying automatic boot
83  common/cmd_net.crunning source command
diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index c745371..22475dc 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -170,7 +170,7 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
 * Check to see if we need to tftp the image ourselves before starting
 */
if ((argc == 2)  (strcmp(argv[1], tftp) == 0)) {
-   if (NetLoop(TFTPGET) = 0)
+   if (net_loop(TFTPGET) = 0)
return 1;
printf(Automatic boot of VxWorks image at address 0x%08lx 
...\n,
addr);
diff --git a/common/cmd_net.c b/common/cmd_net.c
index 6c8d517..09e95d5 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -158,8 +158,8 @@ static void netboot_update_env(void)
setenv(domain, net_nis_domain);
 
 #if defined(CONFIG_CMD_SNTP)  defined(CONFIG_BOOTP_TIMEOFFSET)
-   if (NetTimeOffset) {
-   sprintf(tmp, %d, NetTimeOffset);
+   if (net_ntp_time_offset) {
+   sprintf(tmp, %d, net_ntp_time_offset);
setenv(timeoffset, tmp);
}
 #endif
@@ -227,14 +227,14 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t 
*cmdtp, int argc,
}
bootstage_mark(BOOTSTAGE_ID_NET_START);
 
-   size = NetLoop(proto);
+   size = net_loop(proto);
if (size  0) {
bootstage_error(BOOTSTAGE_ID_NET_NETLOOP_OK);
return CMD_RET_FAILURE;
}
bootstage_mark(BOOTSTAGE_ID_NET_NETLOOP_OK);
 
-   /* NetLoop ok, update environment */
+   /* net_loop ok, update environment */
netboot_update_env();
 
/* done if no file was loaded (no errors though) */
@@ -267,7 +267,7 @@ static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
if (net_ping_ip.s_addr == 0)
return CMD_RET_USAGE;
 
-   if (NetLoop(PING)  0) {
+   if (net_loop(PING)  0) {
printf(ping failed; host %s is not alive\n, argv[1]);
return CMD_RET_FAILURE;
}
@@ -310,7 +310,7 @@ int do_cdp(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
 {
int r;
 
-   r = NetLoop(CDP);
+   r = net_loop(CDP);
if (r  0) {
printf(cdp failed; perhaps not a CISCO switch?\n);
return CMD_RET_FAILURE;
@@ -349,11 +349,11 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
 
toff = getenv(timeoffset);
if (toff == NULL)
-   NetTimeOffset = 0;
+   net_ntp_time_offset = 0;
else
-   NetTimeOffset = simple_strtol(toff, NULL, 10);
+   net_ntp_time_offset = simple_strtol(toff, NULL, 10);
 
-   if (NetLoop(SNTP)  0) {
+   if (net_loop(SNTP)  0) {
printf(SNTP failed: host %pI4 not responding\n,
   net_ntp_server);
return CMD_RET_FAILURE;
@@ -399,7 +399,7 @@ int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
else
net_dns_env_var = NULL;
 
-   if (NetLoop(DNS)  0) {
+   if (net_loop(DNS)  0) {
printf(dns lookup of %s failed, check setup\n, argv[1]);
   

[U-Boot] [PATCH 11/23] net: cosmetic: Clean up RARP variables and functions

2015-04-03 Thread Joe Hershberger
Make a thorough pass through all variables and function names contained
within rarp.c and remove CamelCase and improve naming.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 net/net.c  |  4 ++--
 net/rarp.c | 23 +++
 net/rarp.h |  6 +++---
 3 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/net/net.c b/net/net.c
index 55b680f..bf7fdfc 100644
--- a/net/net.c
+++ b/net/net.c
@@ -395,9 +395,9 @@ restart:
 
 #if defined(CONFIG_CMD_RARP)
case RARP:
-   RarpTry = 0;
+   rarp_try = 0;
net_ip.s_addr = 0;
-   RarpRequest();
+   rarp_request();
break;
 #endif
 #if defined(CONFIG_CMD_PING)
diff --git a/net/rarp.c b/net/rarp.c
index 7e7d0aa..2b983cc 100644
--- a/net/rarp.c
+++ b/net/rarp.c
@@ -20,7 +20,7 @@
 #define TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT)
 #endif
 
-int RarpTry;
+int rarp_try;
 
 /*
  * Handle a RARP received packet.
@@ -37,10 +37,9 @@ void rarp_receive(struct ip_udp_hdr *ip, unsigned len)
}
 
if ((ntohs(arp-ar_op) != RARPOP_REPLY) ||
-   (ntohs(arp-ar_hrd) != ARP_ETHER)   ||
-   (ntohs(arp-ar_pro) != PROT_IP) ||
-   (arp-ar_hln != 6) || (arp-ar_pln != 4)) {
-
+   (ntohs(arp-ar_hrd) != ARP_ETHER)   ||
+   (ntohs(arp-ar_pro) != PROT_IP) ||
+   (arp-ar_hln != 6) || (arp-ar_pln != 4)) {
puts(invalid RARP header\n);
} else {
net_copy_ip(net_ip, arp-ar_data[16]);
@@ -56,25 +55,25 @@ void rarp_receive(struct ip_udp_hdr *ip, unsigned len)
 /*
  * Timeout on BOOTP request.
  */
-static void RarpTimeout(void)
+static void rarp_timeout_handler(void)
 {
-   if (RarpTry = TIMEOUT_COUNT) {
+   if (rarp_try = TIMEOUT_COUNT) {
puts(\nRetry count exceeded; starting again\n);
NetStartAgain();
} else {
-   NetSetTimeout(TIMEOUT, RarpTimeout);
-   RarpRequest();
+   NetSetTimeout(TIMEOUT, rarp_timeout_handler);
+   rarp_request();
}
 }
 
 
-void RarpRequest(void)
+void rarp_request(void)
 {
uchar *pkt;
struct arp_hdr *rarp;
int eth_hdr_size;
 
-   printf(RARP broadcast %d\n, ++RarpTry);
+   printf(RARP broadcast %d\n, ++rarp_try);
pkt = net_tx_packet;
 
eth_hdr_size = net_set_ether(pkt, net_bcast_ethaddr, PROT_RARP);
@@ -96,5 +95,5 @@ void RarpRequest(void)
 
net_send_packet(net_tx_packet, eth_hdr_size + ARP_HDR_SIZE);
 
-   NetSetTimeout(TIMEOUT, RarpTimeout);
+   NetSetTimeout(TIMEOUT, rarp_timeout_handler);
 }
diff --git a/net/rarp.h b/net/rarp.h
index 93e1889..1ca8833 100644
--- a/net/rarp.h
+++ b/net/rarp.h
@@ -17,11 +17,11 @@
  * Global functions and variables.
  */
 
-extern int RarpTry;
+extern int rarp_try;
 
 /* Process the receipt of a RARP packet */
-extern void rarp_receive(struct ip_udp_hdr *ip, unsigned len);
-extern void RarpRequest(void); /* Send a RARP request */
+void rarp_receive(struct ip_udp_hdr *ip, unsigned len);
+void rarp_request(void);   /* Send a RARP request */
 
 /**/
 
-- 
1.7.11.5

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


[U-Boot] [PATCH 0/23] net: cosmetic: Fix naming and other checkpatch.pl issues in net/

2015-04-03 Thread Joe Hershberger
This series is fairly disruptive in naming, so hopefully there aren't
many network stack changes in flight that will conflict with this. This
is based on top of dm/next for now so that the dm/eth series is assumed.
This will be rebased when that is, but will likely not have issues.

Like ripping off a bandage, do it quick and all at once.


Joe Hershberger (21):
  net: cosmetic: Change IPaddr_t to struct in_addr
  net: cosmetic: Fixup var names related to boot file
  net: cosmetic: Fixup var names for DHCP strings
  net: cosmetic: Name ethaddr variables consistently
  net: cosmetic: Cleanup internal packet buffer names
  net: cosmetic: Fix var naming net - eth drivers
  net: cosmetic: Clean up TFTP variables and functions
  net: cosmetic: Clean up ARP variables and functions
  net: cosmetic: Clean up DHCP variables and functions
  net: cosmetic: Clean up NFS variables and functions
  net: cosmetic: Clean up RARP variables and functions
  net: cosmetic: Clean up SNTP variables and functions
  net: cosmetic: Clean up ping variables and functions
  net: cosmetic: Clean up CDP variables and functions
  net: cosmetic: Clean up DNS variables and functions
  net: cosmetic: Clean up netconsole variables and functions
  net: cosmetic: Clean up cmd_net variables and functions
  net: cosmetic: Fix checkpatch.pl failures in linklocal
  net: cosmetic: Fix checkpatch.pl failures in eth.c
  net: cosmetic: Fix checkpatch.pl failures in net.h
  net: cosmetic: Fix checkpatch.pl failures in net.c

Sergey Temerkhanov (2):
  net: Fix incorrect DHCP/BOOTP packets on 64-bit systems
  net: Convert protocol structures to use explicit sizes

 README |   6 +-
 arch/arm/mach-davinci/misc.c   |   2 +-
 arch/mips/mach-au1x00/au1x00_eth.c |  12 +-
 arch/powerpc/cpu/mpc8260/ether_fcc.c   |  20 +-
 arch/powerpc/cpu/mpc8260/ether_scc.c   |   4 +-
 arch/powerpc/cpu/mpc85xx/ether_fcc.c   |   4 +-
 arch/powerpc/cpu/mpc8xx/fec.c  |  12 +-
 arch/powerpc/cpu/mpc8xx/scc.c  |   5 +-
 board/BuR/common/common.c  |   4 +-
 board/ait/cam_enc_4xx/cam_enc_4xx.c|   2 +-
 board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c |   2 +-
 board/bct-brettl2/bct-brettl2.c|   2 +-
 board/bf518f-ezbrd/bf518f-ezbrd.c  |   4 +-
 board/bf526-ezbrd/bf526-ezbrd.c|   4 +-
 board/bf527-ezkit/bf527-ezkit.c|   4 +-
 board/bf537-minotaur/bf537-minotaur.c  |   2 +-
 board/bf537-pnav/bf537-pnav.c  |   2 +-
 board/bf537-srv1/bf537-srv1.c  |   2 +-
 board/bf537-stamp/bf537-stamp.c|   4 +-
 board/birdland/bav335x/board.c |   4 +-
 board/buffalo/lsxl/lsxl.c  |   2 +-
 board/cm-bf527/cm-bf527.c  |   4 +-
 board/cm-bf537e/cm-bf537e.c|   2 +-
 board/cm-bf537u/cm-bf537u.c|   2 +-
 board/compulab/cm_fx6/cm_fx6.c |   2 +-
 board/compulab/cm_t335/cm_t335.c   |   2 +-
 board/compulab/cm_t35/cm_t35.c |   2 +-
 board/compulab/cm_t3517/cm_t3517.c |   4 +-
 board/compulab/cm_t54/cm_t54.c |   4 +-
 board/davinci/da8xxevm/da850evm.c  |   6 +-
 board/dnp5370/dnp5370.c|   4 +-
 board/gumstix/pepper/board.c   |   2 +-
 board/ifm/ac14xx/ac14xx.c  |   2 +-
 board/ip04/ip04.c  |   2 +-
 board/isee/igep0033/board.c|   2 +-
 board/phytec/pcm051/board.c|   2 +-
 board/renesas/r0p7734/r0p7734.c|   2 +-
 board/siemens/common/factoryset.c  |   4 +-
 board/siemens/pxm2/board.c |   2 +-
 board/silica/pengwyn/board.c   |   2 +-
 board/tcm-bf518/tcm-bf518.c|   4 +-
 board/tcm-bf537/tcm-bf537.c|   2 +-
 board/ti/am335x/board.c|   6 +-
 board/ti/am43xx/board.c|   4 +-
 board/ti/beagle_x15/board.c|   4 +-
 board/ti/dra7xx/evm.c  |   4 +-
 board/ti/ti814x/evm.c  |   2 +-
 common/cmd_elf.c   |   2 +-
 common/cmd_net.c   | 133 +++
 common/cmd_pxe.c   |   4 +-
 common/spl/spl_net.c   |   2 +-
 common/update.c|  25 +-
 doc/README.drivers.eth |  12 +-
 doc/README.enetaddr|   2 +-
 doc/README.link-local  |   4 +-
 drivers/net/4xx_enet.c |  14 +-
 drivers/net/altera_tse.c   |  15 +-
 drivers/net/armada100_fec.c|   7 +-
 drivers/net/at91_emac.c|   4 +-
 drivers/net/ax88180.c  |   6 +-
 drivers/net/bcm-sf2-eth.c  |   6 +-
 drivers/net/bfin_mac.c |   4 +-
 drivers/net/calxedaxgmac.c |   2 +-
 

[U-Boot] [PATCH 07/23] net: cosmetic: Clean up TFTP variables and functions

2015-04-03 Thread Joe Hershberger
Make a thorough pass through all variables and function names contained
within tftp and remove CamelCase and improve naming.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 common/update.c |  16 +-
 net/net.c   |   6 +-
 net/tftp.c  | 483 
 net/tftp.h  |   8 +-
 4 files changed, 259 insertions(+), 254 deletions(-)

diff --git a/common/update.c b/common/update.c
index bc0c48f..1bf2f82 100644
--- a/common/update.c
+++ b/common/update.c
@@ -39,8 +39,8 @@
 #define CONFIG_UPDATE_TFTP_CNT_MAX 0
 #endif
 
-extern ulong TftpRRQTimeoutMSecs;
-extern int TftpRRQTimeoutCountMax;
+extern ulong tftp_timeout_ms;
+extern int tftp_timeout_count_max;
 extern flash_info_t flash_info[];
 extern ulong load_addr;
 
@@ -55,14 +55,14 @@ static int update_load(char *filename, ulong msec_max, int 
cnt_max, ulong addr)
 
rv = 0;
/* save used globals and env variable */
-   saved_timeout_msecs = TftpRRQTimeoutMSecs;
-   saved_timeout_count = TftpRRQTimeoutCountMax;
+   saved_timeout_msecs = tftp_timeout_ms;
+   saved_timeout_count = tftp_timeout_count_max;
saved_netretry = strdup(getenv(netretry));
saved_bootfile = strdup(net_boot_file_name);
 
/* set timeouts for auto-update */
-   TftpRRQTimeoutMSecs = msec_max;
-   TftpRRQTimeoutCountMax = cnt_max;
+   tftp_timeout_ms = msec_max;
+   tftp_timeout_count_max = cnt_max;
 
/* we don't want to retry the connection if errors occur */
setenv(netretry, no);
@@ -78,8 +78,8 @@ static int update_load(char *filename, ulong msec_max, int 
cnt_max, ulong addr)
flush_cache(addr, size);
 
/* restore changed globals and env variable */
-   TftpRRQTimeoutMSecs = saved_timeout_msecs;
-   TftpRRQTimeoutCountMax = saved_timeout_count;
+   tftp_timeout_ms = saved_timeout_msecs;
+   tftp_timeout_count_max = saved_timeout_count;
 
setenv(netretry, saved_netretry);
if (saved_netretry != NULL)
diff --git a/net/net.c b/net/net.c
index c47e570..e0e0724 100644
--- a/net/net.c
+++ b/net/net.c
@@ -247,7 +247,7 @@ void net_auto_load(void)
net_set_state(NETLOOP_SUCCESS);
return;
}
-   TftpStart(TFTPGET);
+   tftp_start(TFTPGET);
 }
 
 static void NetInitLoop(void)
@@ -372,11 +372,11 @@ restart:
case TFTPPUT:
 #endif
/* always use ARP to get server ethernet address */
-   TftpStart(protocol);
+   tftp_start(protocol);
break;
 #ifdef CONFIG_CMD_TFTPSRV
case TFTPSRV:
-   TftpStartServer();
+   tftp_start_server();
break;
 #endif
 #if defined(CONFIG_CMD_DHCP)
diff --git a/net/tftp.c b/net/tftp.c
index f25abaa..14acf04 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -39,21 +39,21 @@
 #define TFTP_ERROR 5
 #define TFTP_OACK  6
 
-static ulong TftpTimeoutMSecs = TIMEOUT;
-static int TftpTimeoutCountMax = TIMEOUT_COUNT;
+static ulong timeout_ms = TIMEOUT;
+static int timeout_count_max = TIMEOUT_COUNT;
 static ulong time_start;   /* Record time we started tftp */
 
 /*
  * These globals govern the timeout behavior when attempting a connection to a
- * TFTP server. TftpRRQTimeoutMSecs specifies the number of milliseconds to
+ * TFTP server. tftp_timeout_ms specifies the number of milliseconds to
  * wait for the server to respond to initial connection. Second global,
- * TftpRRQTimeoutCountMax, gives the number of such connection retries.
- * TftpRRQTimeoutCountMax must be non-negative and TftpRRQTimeoutMSecs must be
+ * tftp_timeout_count_max, gives the number of such connection retries.
+ * tftp_timeout_count_max must be non-negative and tftp_timeout_ms must be
  * positive. The globals are meant to be set (and restored) by code needing
  * non-standard timeout behavior when initiating a TFTP transfer.
  */
-ulong TftpRRQTimeoutMSecs = TIMEOUT;
-int TftpRRQTimeoutCountMax = TIMEOUT_COUNT;
+ulong tftp_timeout_ms = TIMEOUT;
+int tftp_timeout_count_max = TIMEOUT_COUNT;
 
 enum {
TFTP_ERR_UNDEFINED   = 0,
@@ -67,30 +67,32 @@ enum {
 
 static struct in_addr tftp_remote_ip;
 /* The UDP port at their end */
-static int TftpRemotePort;
+static int tftp_remote_port;
 /* The UDP port at our end */
-static int TftpOurPort;
-static int TftpTimeoutCount;
+static int tftp_our_port;
+static int timeout_count;
 /* packet sequence number */
-static ulong   TftpBlock;
+static ulong   tftp_cur_block;
 /* last packet sequence number received */
-static ulong   TftpLastBlock;
+static ulong   tftp_prev_block;
 /* count of sequence number wraparounds */
-static ulong   TftpBlockWrap;
+static ulong   tftp_block_wrap;
 /* memory offset due to wrapping */
-static ulong   TftpBlockWrapOffset;
-static int TftpState;
+static ulong   

[U-Boot] [PATCH 17/23] net: cosmetic: Clean up cmd_net variables and functions

2015-04-03 Thread Joe Hershberger
Make a thorough pass through all variables and function names contained
within common/cmd_net.c and remove CamelCase and improve naming.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 common/cmd_net.c | 29 ++---
 include/net.h| 10 +-
 net/net.c| 26 +-
 3 files changed, 32 insertions(+), 33 deletions(-)

diff --git a/common/cmd_net.c b/common/cmd_net.c
index 006524d..6c8d517 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -157,15 +157,13 @@ static void netboot_update_env(void)
if (net_nis_domain[0])
setenv(domain, net_nis_domain);
 
-#if defined(CONFIG_CMD_SNTP) \
- defined(CONFIG_BOOTP_TIMEOFFSET)
+#if defined(CONFIG_CMD_SNTP)  defined(CONFIG_BOOTP_TIMEOFFSET)
if (NetTimeOffset) {
sprintf(tmp, %d, NetTimeOffset);
setenv(timeoffset, tmp);
}
 #endif
-#if defined(CONFIG_CMD_SNTP) \
- defined(CONFIG_BOOTP_NTPSERVER)
+#if defined(CONFIG_CMD_SNTP)  defined(CONFIG_BOOTP_NTPSERVER)
if (net_ntp_ip.s_addr) {
ip_to_string(net_ntp_ip, tmp);
setenv(ntpserverip, tmp);
@@ -183,9 +181,9 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t 
*cmdtp, int argc,
ulong addr;
 
/* pre-set load_addr */
-   if ((s = getenv(loadaddr)) != NULL) {
+   s = getenv(loadaddr);
+   if (s != NULL)
load_addr = simple_strtoul(s, NULL, 16);
-   }
 
switch (argc) {
case 1:
@@ -205,7 +203,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t 
*cmdtp, int argc,
  sizeof(net_boot_file_name));
break;
 
-   case 3: load_addr = simple_strtoul(argv[1], NULL, 16);
+   case 3:
+   load_addr = simple_strtoul(argv[1], NULL, 16);
copy_filename(net_boot_file_name, argv[2],
  sizeof(net_boot_file_name));
 
@@ -214,7 +213,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t 
*cmdtp, int argc,
 #ifdef CONFIG_CMD_TFTPPUT
case 4:
if (strict_strtoul(argv[1], 16, save_addr)  0 ||
-   strict_strtoul(argv[2], 16, save_size)  0) {
+   strict_strtoul(argv[2], 16, save_size)  0) {
printf(Invalid address/size\n);
return CMD_RET_USAGE;
}
@@ -228,7 +227,8 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t 
*cmdtp, int argc,
}
bootstage_mark(BOOTSTAGE_ID_NET_START);
 
-   if ((size = NetLoop(proto))  0) {
+   size = NetLoop(proto);
+   if (size  0) {
bootstage_error(BOOTSTAGE_ID_NET_NETLOOP_OK);
return CMD_RET_FAILURE;
}
@@ -293,18 +293,17 @@ static void cdp_update_env(void)
if (cdp_appliance_vlan != htons(-1)) {
printf(CDP offered appliance VLAN %d\n,
   ntohs(cdp_appliance_vlan));
-   VLAN_to_string(cdp_appliance_vlan, tmp);
+   vlan_to_string(cdp_appliance_vlan, tmp);
setenv(vlan, tmp);
-   NetOurVLAN = cdp_appliance_vlan;
+   net_our_vlan = cdp_appliance_vlan;
}
 
if (cdp_native_vlan != htons(-1)) {
printf(CDP offered native VLAN %d\n, ntohs(cdp_native_vlan));
-   VLAN_to_string(cdp_native_vlan, tmp);
+   vlan_to_string(cdp_native_vlan, tmp);
setenv(nvlan, tmp);
-   NetOurNativeVLAN = cdp_native_vlan;
+   net_native_vlan = cdp_native_vlan;
}
-
 }
 
 int do_cdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
@@ -356,7 +355,7 @@ int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
 
if (NetLoop(SNTP)  0) {
printf(SNTP failed: host %pI4 not responding\n,
-   net_ntp_server);
+  net_ntp_server);
return CMD_RET_FAILURE;
}
 
diff --git a/include/net.h b/include/net.h
index a7aefbc..c4a534c 100644
--- a/include/net.h
+++ b/include/net.h
@@ -485,8 +485,8 @@ extern const u8 net_null_ethaddr[6];
 
 #define VLAN_NONE  4095/* untagged */
 #define VLAN_IDMASK0x0fff  /* mask of valid vlan id */
-extern ushort  NetOurVLAN; /* Our VLAN */
-extern ushort  NetOurNativeVLAN;   /* Our Native VLAN */
+extern ushort  net_our_vlan;   /* Our VLAN */
+extern ushort  net_native_vlan;/* Our Native VLAN */
 
 extern int NetRestartWrap; /* Tried all network devices */
 
@@ -785,13 +785,13 @@ void ip_to_string(struct in_addr x, char *s);
 struct in_addr string_to_ip(const char *s);
 
 /* Convert a VLAN id to a string */
-void VLAN_to_string(ushort x, char *s);
+void vlan_to_string(ushort x, char *s);
 
 /* Convert a string to a vlan id 

[U-Boot] [PATCH 03/23] net: cosmetic: Fixup var names for DHCP strings

2015-04-03 Thread Joe Hershberger
Remove CamelCase variable naming.
Move the definition to the same compilation unit as the primary use.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 common/cmd_net.c | 12 ++--
 include/net.h|  6 +++---
 net/bootp.c  | 51 +++
 net/net.c|  6 --
 4 files changed, 36 insertions(+), 39 deletions(-)

diff --git a/common/cmd_net.c b/common/cmd_net.c
index b5b0a11..290c0c5 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -124,11 +124,11 @@ static void netboot_update_env(void)
setenv(netmask, tmp);
}
 
-   if (NetOurHostName[0])
-   setenv(hostname, NetOurHostName);
+   if (net_hostname[0])
+   setenv(hostname, net_hostname);
 
-   if (NetOurRootPath[0])
-   setenv(rootpath, NetOurRootPath);
+   if (net_root_path[0])
+   setenv(rootpath, net_root_path);
 
if (net_ip.s_addr) {
ip_to_string(net_ip, tmp);
@@ -154,8 +154,8 @@ static void netboot_update_env(void)
setenv(dnsip2, tmp);
}
 #endif
-   if (NetOurNISDomain[0])
-   setenv(domain, NetOurNISDomain);
+   if (net_nis_domain[0])
+   setenv(domain, net_nis_domain);
 
 #if defined(CONFIG_CMD_SNTP) \
  defined(CONFIG_BOOTP_TIMEOFFSET)
diff --git a/include/net.h b/include/net.h
index b484d4c..2664865 100644
--- a/include/net.h
+++ b/include/net.h
@@ -467,9 +467,9 @@ extern struct in_addr net_dns_server;
 /* Our 2nd Domain Name Server (0 = unknown) */
 extern struct in_addr net_dns_server2;
 #endif
-extern charNetOurNISDomain[32];/* Our NIS domain */
-extern charNetOurHostName[32]; /* Our hostname */
-extern charNetOurRootPath[64]; /* Our root path */
+extern charnet_nis_domain[32]; /* Our IS domain */
+extern charnet_hostname[32];   /* Our hostname */
+extern charnet_root_path[64];  /* Our root path */
 /** END OF BOOTP EXTENTIONS **/
 extern uchar   NetOurEther[6]; /* Our ethernet address */
 extern uchar   NetServerEther[6];  /* Boot server enet address */
diff --git a/net/bootp.c b/net/bootp.c
index 0148c19..9251e91 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -56,6 +56,9 @@ unsigned int  bootp_num_ids;
 intBootpTry;
 ulong  bootp_start;
 ulong  bootp_timeout;
+char net_nis_domain[32] = {0,}; /* Our NIS domain */
+char net_hostname[32] = {0,}; /* Our hostname */
+char net_root_path[64] = {0,}; /* Our bootpath */
 
 #if defined(CONFIG_CMD_DHCP)
 static dhcp_state_t dhcp_state = INIT;
@@ -220,11 +223,11 @@ static void BootpVendorFieldProcess(u8 *ext)
case 11:/* RPL server - Not yet supported */
break;
case 12:/* Host name */
-   if (NetOurHostName[0] == 0) {
+   if (net_hostname[0] == 0) {
size = truncate_sz(Host Name,
-   sizeof(NetOurHostName), size);
-   memcpy(NetOurHostName, ext + 2, size);
-   NetOurHostName[size] = 0;
+   sizeof(net_hostname), size);
+   memcpy(net_hostname, ext + 2, size);
+   net_hostname[size] = 0;
}
break;
case 13:/* Boot file size */
@@ -242,11 +245,11 @@ static void BootpVendorFieldProcess(u8 *ext)
case 16:/* Swap server - Not yet supported */
break;
case 17:/* Root path */
-   if (NetOurRootPath[0] == 0) {
+   if (net_root_path[0] == 0) {
size = truncate_sz(Root Path,
-   sizeof(NetOurRootPath), size);
-   memcpy(NetOurRootPath, ext + 2, size);
-   NetOurRootPath[size] = 0;
+   sizeof(net_root_path), size);
+   memcpy(net_root_path, ext + 2, size);
+   net_root_path[size] = 0;
}
break;
case 18:/* Extension path - Not yet supported */
@@ -258,11 +261,11 @@ static void BootpVendorFieldProcess(u8 *ext)
break;
/* IP host layer fields */
case 40:/* NIS Domain name */
-   if (NetOurNISDomain[0] == 0) {
+   if (net_nis_domain[0] == 0) {
size = truncate_sz(NIS Domain Name,
-   sizeof(NetOurNISDomain), size);
-   memcpy(NetOurNISDomain, ext + 2, size);
-   NetOurNISDomain[size] = 0;
+   sizeof(net_nis_domain), size);
+   memcpy(net_nis_domain, ext + 2, size);
+   net_nis_domain[size] = 0;
}
break;
 #if 

[U-Boot] [PATCH 09/23] net: cosmetic: Clean up DHCP variables and functions

2015-04-03 Thread Joe Hershberger
Make a thorough pass through all variables and function names contained
within bootp.c and remove CamelCase and improve naming.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 net/bootp.c | 119 +---
 net/bootp.h |  14 +++
 net/net.c   |   8 ++--
 3 files changed, 69 insertions(+), 72 deletions(-)

diff --git a/net/bootp.c b/net/bootp.c
index 9788b52..fa75125 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -53,7 +53,7 @@
 
 ulong  bootp_ids[CONFIG_BOOTP_ID_CACHE_SIZE];
 unsigned int   bootp_num_ids;
-intBootpTry;
+intbootp_try;
 ulong  bootp_start;
 ulong  bootp_timeout;
 char net_nis_domain[32] = {0,}; /* Our NIS domain */
@@ -109,14 +109,14 @@ static bool bootp_match_id(ulong id)
return false;
 }
 
-static int BootpCheckPkt(uchar *pkt, unsigned dest, unsigned src, unsigned len)
+static int check_packet(uchar *pkt, unsigned dest, unsigned src, unsigned len)
 {
-   struct Bootp_t *bp = (struct Bootp_t *) pkt;
+   struct bootp_hdr *bp = (struct bootp_hdr *)pkt;
int retval = 0;
 
if (dest != PORT_BOOTPC || src != PORT_BOOTPS)
retval = -1;
-   else if (len  sizeof(struct Bootp_t) - OPT_FIELD_SIZE)
+   else if (len  sizeof(struct bootp_hdr) - OPT_FIELD_SIZE)
retval = -2;
else if (bp-bp_op != OP_BOOTREQUEST 
bp-bp_op != OP_BOOTREPLY 
@@ -139,7 +139,7 @@ static int BootpCheckPkt(uchar *pkt, unsigned dest, 
unsigned src, unsigned len)
 /*
  * Copy parameters of interest from BOOTP_REPLY/DHCP_OFFER packet
  */
-static void BootpCopyNetParams(struct Bootp_t *bp)
+static void store_net_params(struct bootp_hdr *bp)
 {
 #if !defined(CONFIG_BOOTP_SERVERIP)
struct in_addr tmp_ip;
@@ -177,12 +177,12 @@ static int truncate_sz(const char *name, int maxlen, int 
curlen)
 
 #if !defined(CONFIG_CMD_DHCP)
 
-static void BootpVendorFieldProcess(u8 *ext)
+static void bootp_process_vendor_field(u8 *ext)
 {
int size = *(ext + 1);
 
debug([BOOTP] Processing extension %d... (%d bytes)\n, *ext,
-   *(ext + 1));
+ *(ext + 1));
 
net_boot_file_expected_size_in_blocks = 0;
 
@@ -285,7 +285,7 @@ static void BootpVendorFieldProcess(u8 *ext)
}
 }
 
-static void BootpVendorProcess(u8 *ext, int size)
+static void bootp_process_vendor(u8 *ext, int size)
 {
u8 *end = ext + size;
 
@@ -299,7 +299,7 @@ static void BootpVendorProcess(u8 *ext, int size)
 
ext += ext[1] + 2;
if (ext = end)
-   BootpVendorFieldProcess(opt);
+   bootp_process_vendor_field(opt);
}
}
 
@@ -335,15 +335,15 @@ static void BootpVendorProcess(u8 *ext, int size)
 static void bootp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
  unsigned src, unsigned len)
 {
-   struct Bootp_t *bp;
+   struct bootp_hdr *bp;
 
debug(got BOOTP packet (src=%d, dst=%d, len=%d want_len=%zu)\n,
-   src, dest, len, sizeof(struct Bootp_t));
+ src, dest, len, sizeof(struct bootp_hdr));
 
-   bp = (struct Bootp_t *)pkt;
+   bp = (struct bootp_hdr *)pkt;
 
/* Filter out pkts we don't want */
-   if (BootpCheckPkt(pkt, dest, src, len))
+   if (check_packet(pkt, dest, src, len))
return;
 
/*
@@ -353,11 +353,11 @@ static void bootp_handler(uchar *pkt, unsigned dest, 
struct in_addr sip,
status_led_set(STATUS_LED_BOOT, STATUS_LED_OFF);
 #endif
 
-   BootpCopyNetParams(bp); /* Store net parameters from reply */
+   store_net_params(bp);   /* Store net parameters from reply */
 
/* Retrieve extended information (we must parse the vendor area) */
if (NetReadLong((ulong *)bp-bp_vend[0]) == htonl(BOOTP_VENDOR_MAGIC))
-   BootpVendorProcess((uchar *)bp-bp_vend[4], len);
+   bootp_process_vendor((uchar *)bp-bp_vend[4], len);
 
NetSetTimeout(0, (thand_f *)0);
bootstage_mark_name(BOOTSTAGE_ID_BOOTP_STOP, bootp_stop);
@@ -371,8 +371,7 @@ static void bootp_handler(uchar *pkt, unsigned dest, struct 
in_addr sip,
 /*
  * Timeout on BOOTP/DHCP request.
  */
-static void
-BootpTimeout(void)
+static void bootp_timeout_handler(void)
 {
ulong time_taken = get_timer(bootp_start);
 
@@ -388,8 +387,8 @@ BootpTimeout(void)
bootp_timeout *= 2;
if (bootp_timeout  2000)
bootp_timeout = 2000;
-   NetSetTimeout(bootp_timeout, BootpTimeout);
-   BootpRequest();
+   NetSetTimeout(bootp_timeout, bootp_timeout_handler);
+   bootp_request();
}
 }
 
@@ -649,25 +648,24 @@ static int bootp_extended(u8 *e)
 }
 #endif
 
-void BootpReset(void)
+void bootp_reset(void)
 {
bootp_num_ids = 0;
- 

[U-Boot] [PATCH 18/23] net: cosmetic: Fix checkpatch.pl failures in linklocal

2015-04-03 Thread Joe Hershberger
A few new rules in checkpatch.pl since linklocal.c was added.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 net/link_local.c | 36 +---
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/net/link_local.c b/net/link_local.c
index 56616d6..e2f14fc 100644
--- a/net/link_local.c
+++ b/net/link_local.c
@@ -95,7 +95,7 @@ static void configure_wait(void)
deadline_ms = MONOTONIC_MS() + timeout_ms;
 
debug_cond(DEBUG_DEV_PKT, ...wait %d %s nprobes=%u, nclaims=%u\n,
-   timeout_ms, eth_get_name(), nprobes, nclaims);
+  timeout_ms, eth_get_name(), nprobes, nclaims);
 
NetSetTimeout(timeout_ms, link_local_timeout);
 }
@@ -134,7 +134,7 @@ static void link_local_timeout(void)
if (nprobes  PROBE_NUM) {
nprobes++;
debug_cond(DEBUG_LL_STATE, probe/%u %s@%pI4\n,
-   nprobes, eth_get_name(), ip);
+  nprobes, eth_get_name(), ip);
arp_raw_request(0, net_null_ethaddr, ip);
timeout_ms = PROBE_MIN * 1000;
timeout_ms += random_delay_ms(PROBE_MAX - PROBE_MIN);
@@ -143,7 +143,7 @@ static void link_local_timeout(void)
state = ANNOUNCE;
nclaims = 0;
debug_cond(DEBUG_LL_STATE, announce/%u %s@%pI4\n,
-   nclaims, eth_get_name(), ip);
+  nclaims, eth_get_name(), ip);
arp_raw_request(ip, net_ethaddr, ip);
timeout_ms = ANNOUNCE_INTERVAL * 1000;
}
@@ -155,7 +155,7 @@ static void link_local_timeout(void)
state = ANNOUNCE;
nclaims = 0;
debug_cond(DEBUG_LL_STATE, announce/%u %s@%pI4\n,
-   nclaims, eth_get_name(), ip);
+  nclaims, eth_get_name(), ip);
arp_raw_request(ip, net_ethaddr, ip);
timeout_ms = ANNOUNCE_INTERVAL * 1000;
break;
@@ -166,7 +166,7 @@ static void link_local_timeout(void)
if (nclaims  ANNOUNCE_NUM) {
nclaims++;
debug_cond(DEBUG_LL_STATE, announce/%u %s@%pI4\n,
-   nclaims, eth_get_name(), ip);
+  nclaims, eth_get_name(), ip);
arp_raw_request(ip, net_ethaddr, ip);
timeout_ms = ANNOUNCE_INTERVAL * 1000;
} else {
@@ -220,7 +220,7 @@ void link_local_receive_arp(struct arp_hdr *arp, int len)
/* Current time is greater than the expected timeout
   time. This should never happen */
debug_cond(DEBUG_LL_STATE,
-   missed an expected timeout\n);
+  missed an expected timeout\n);
timeout_ms = 0;
} else {
debug_cond(DEBUG_INT_STATE, adjusting timeout\n);
@@ -235,9 +235,8 @@ void link_local_receive_arp(struct arp_hdr *arp, int len)
 * FIXME: links routinely go down;
 */
bb_error_msg(iface %s is down, eth_get_name());
-   if (ready) {
+   if (ready)
run(argv, deconfig, ip);
-   }
return EXIT_FAILURE;
}
continue;
@@ -245,18 +244,17 @@ void link_local_receive_arp(struct arp_hdr *arp, int len)
 #endif
 
debug_cond(DEBUG_INT_STATE, %s recv arp type=%d, op=%d,\n,
-   eth_get_name(), ntohs(arp-ar_pro),
-   ntohs(arp-ar_op));
+  eth_get_name(), ntohs(arp-ar_pro),
+  ntohs(arp-ar_op));
debug_cond(DEBUG_INT_STATE, \tsource=%pM %pI4\n,
-   arp-ar_sha,
-   arp-ar_spa);
+  arp-ar_sha,
+  arp-ar_spa);
debug_cond(DEBUG_INT_STATE, \ttarget=%pM %pI4\n,
-   arp-ar_tha,
-   arp-ar_tpa);
+  arp-ar_tha,
+  arp-ar_tpa);
 
-   if (arp-ar_op != htons(ARPOP_REQUEST)
- arp-ar_op != htons(ARPOP_REPLY)
-   ) {
+   if (arp-ar_op != htons(ARPOP_REQUEST) 
+   arp-ar_op != htons(ARPOP_REPLY)) {
configure_wait();
return;
}
@@ -283,8 +281,8 @@ void link_local_receive_arp(struct arp_hdr *arp, int len)
}
 
debug_cond(DEBUG_NET_PKT,
-   state = %d, source ip conflict = %d, target ip conflict = 
-   %d\n, state, source_ip_conflict, target_ip_conflict);
+  state = %d, source ip conflict = %d, target ip 

[U-Boot] [PATCH 15/23] net: cosmetic: Clean up DNS variables and functions

2015-04-03 Thread Joe Hershberger
Make a thorough pass through all variables and function names contained
within dns.c and remove CamelCase and improve naming.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 common/cmd_net.c |  6 +++---
 include/net.h|  4 ++--
 net/dns.c| 53 +
 net/dns.h|  2 +-
 net/net.c|  2 +-
 5 files changed, 32 insertions(+), 35 deletions(-)

diff --git a/common/cmd_net.c b/common/cmd_net.c
index 0ade0f8..006524d 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -393,12 +393,12 @@ int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
return CMD_RET_FAILURE;
}
 
-   NetDNSResolve = argv[1];
+   net_dns_resolve = argv[1];
 
if (argc == 3)
-   NetDNSenvvar = argv[2];
+   net_dns_env_var = argv[2];
else
-   NetDNSenvvar = NULL;
+   net_dns_env_var = NULL;
 
if (NetLoop(DNS)  0) {
printf(dns lookup of %s failed, check setup\n, argv[1]);
diff --git a/include/net.h b/include/net.h
index 9343ade..1275ffe 100644
--- a/include/net.h
+++ b/include/net.h
@@ -502,8 +502,8 @@ extern u32  net_boot_file_size;
 extern u32 net_boot_file_expected_size_in_blocks;
 
 #if defined(CONFIG_CMD_DNS)
-extern char *NetDNSResolve;/* The host to resolve  */
-extern char *NetDNSenvvar; /* the env var to put the ip into */
+extern char *net_dns_resolve;  /* The host to resolve  */
+extern char *net_dns_env_var;  /* the env var to put the ip into */
 #endif
 
 #if defined(CONFIG_CMD_PING)
diff --git a/net/dns.c b/net/dns.c
index 50d78ae..cf4ed86 100644
--- a/net/dns.c
+++ b/net/dns.c
@@ -29,13 +29,12 @@
 
 #include dns.h
 
-char *NetDNSResolve;   /* The host to resolve  */
-char *NetDNSenvvar;/* The envvar to store the answer in */
+char *net_dns_resolve; /* The host to resolve  */
+char *net_dns_env_var; /* The envvar to store the answer in */
 
-static int DnsOurPort;
+static int dns_our_port;
 
-static void
-DnsSend(void)
+static void dns_send(void)
 {
struct header *header;
int n, name_len;
@@ -44,12 +43,12 @@ DnsSend(void)
const char *name;
enum dns_query_type qtype = DNS_A_RECORD;
 
-   name = NetDNSResolve;
+   name = net_dns_resolve;
pkt = (uchar *)(net_tx_packet + net_eth_hdr_size() + IP_UDP_HDR_SIZE);
p = pkt;
 
/* Prepare DNS packet header */
-   header   = (struct header *) pkt;
+   header   = (struct header *)pkt;
header-tid  = 1;
header-flags= htons(0x100);/* standard query */
header-nqueries = htons(1);/* Just one query */
@@ -59,7 +58,7 @@ DnsSend(void)
 
/* Encode DNS name */
name_len = strlen(name);
-   p = (uchar *) header-data;/* For encoding host name into packet */
+   p = (uchar *)header-data; /* For encoding host name into packet */
 
do {
s = strchr(name, '.');
@@ -88,15 +87,14 @@ DnsSend(void)
n = p - pkt;/* Total packet length */
debug(Packet size %d\n, n);
 
-   DnsOurPort = random_port();
+   dns_our_port = random_port();
 
net_send_udp_packet(net_server_ethaddr, net_dns_server,
-   DNS_SERVICE_PORT, DnsOurPort, n);
+   DNS_SERVICE_PORT, dns_our_port, n);
debug(DNS packet sent\n);
 }
 
-static void
-DnsTimeout(void)
+static void dns_timeout_handler(void)
 {
puts(Timeout\n);
net_set_state(NETLOOP_FAIL);
@@ -109,20 +107,20 @@ static void dns_handler(uchar *pkt, unsigned dest, struct 
in_addr sip,
const unsigned char *p, *e, *s;
u16 type, i;
int found, stop, dlen;
-   char IPStr[22];
+   char ip_str[22];
struct in_addr ip_addr;
 
 
debug(%s\n, __func__);
-   if (dest != DnsOurPort)
+   if (dest != dns_our_port)
return;
 
for (i = 0; i  len; i += 4)
debug(0x%p - 0x%.2x  0x%.2x  0x%.2x  0x%.2x\n,
-   pkt+i, pkt[i], pkt[i+1], pkt[i+2], pkt[i+3]);
+ pkt+i, pkt[i], pkt[i+1], pkt[i+2], pkt[i+3]);
 
/* We sent one query. We want to have a single answer: */
-   header = (struct header *) pkt;
+   header = (struct header *)pkt;
if (ntohs(header-nqueries) != 1)
return;
 
@@ -151,7 +149,6 @@ static void dns_handler(uchar *pkt, unsigned dest, struct 
in_addr sip,
 
/* Loop through the answers, we want A type answer */
for (found = stop = 0; !stop  p[12]  e; ) {
-
/* Skip possible name in CNAME answer */
if (*p != 0xc0) {
while (*p  p[12]  e)
@@ -170,7 +167,8 @@ static void dns_handler(uchar *pkt, unsigned dest, struct 
in_addr sip,
p += 12 + dlen;
} 

[U-Boot] [PATCH 16/23] net: cosmetic: Clean up netconsole variables and functions

2015-04-03 Thread Joe Hershberger
Make a thorough pass through all variables and function names contained
within netconsole.c and remove CamelCase and improve naming.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 drivers/net/netconsole.c | 32 +---
 include/net.h|  2 +-
 net/net.c|  2 +-
 3 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 9aba0c5..c2e0184 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -48,7 +48,7 @@ static void nc_handler(uchar *pkt, unsigned dest, struct 
in_addr sip,
net_set_state(NETLOOP_SUCCESS); /* got input - quit net loop */
 }
 
-static void nc_timeout(void)
+static void nc_timeout_handler(void)
 {
net_set_state(NETLOOP_SUCCESS);
 }
@@ -91,8 +91,9 @@ static int refresh_settings_from_env(void)
nc_out_port = simple_strtoul(p + 1, NULL, 10);
nc_in_port = nc_out_port;
}
-   } else
+   } else {
nc_ip.s_addr = ~0; /* ncip is not set, so broadcast */
+   }
 
p = getenv(ncoutport);
if (p != NULL)
@@ -114,13 +115,13 @@ static int refresh_settings_from_env(void)
 /**
  * Called from NetLoop in net/net.c before each packet
  */
-void NcStart(void)
+void nc_start(void)
 {
refresh_settings_from_env();
if (!output_packet_len || memcmp(nc_ether, net_null_ethaddr, 6)) {
/* going to check for input packet */
net_set_udp_handler(nc_handler);
-   NetSetTimeout(net_timeout, nc_timeout);
+   NetSetTimeout(net_timeout, nc_timeout_handler);
} else {
/* send arp request */
uchar *pkt;
@@ -198,8 +199,9 @@ static void nc_send_packet(const char *buf, int len)
if (eth_init()  0)
return;
eth_set_last_protocol(NETCONS);
-   } else
+   } else {
eth_init_state_only();
+   }
 
inited = 1;
}
@@ -217,7 +219,7 @@ static void nc_send_packet(const char *buf, int len)
}
 }
 
-static int nc_start(struct stdio_dev *dev)
+static int nc_stdio_start(struct stdio_dev *dev)
 {
int retval;
 
@@ -237,7 +239,7 @@ static int nc_start(struct stdio_dev *dev)
return 0;
 }
 
-static void nc_putc(struct stdio_dev *dev, char c)
+static void nc_stdio_putc(struct stdio_dev *dev, char c)
 {
if (output_recursion)
return;
@@ -248,7 +250,7 @@ static void nc_putc(struct stdio_dev *dev, char c)
output_recursion = 0;
 }
 
-static void nc_puts(struct stdio_dev *dev, const char *s)
+static void nc_stdio_puts(struct stdio_dev *dev, const char *s)
 {
int len;
 
@@ -267,7 +269,7 @@ static void nc_puts(struct stdio_dev *dev, const char *s)
output_recursion = 0;
 }
 
-static int nc_getc(struct stdio_dev *dev)
+static int nc_stdio_getc(struct stdio_dev *dev)
 {
uchar c;
 
@@ -288,7 +290,7 @@ static int nc_getc(struct stdio_dev *dev)
return c;
 }
 
-static int nc_tstc(struct stdio_dev *dev)
+static int nc_stdio_tstc(struct stdio_dev *dev)
 {
struct eth_device *eth;
 
@@ -321,11 +323,11 @@ int drv_nc_init(void)
 
strcpy(dev.name, nc);
dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
-   dev.start = nc_start;
-   dev.putc = nc_putc;
-   dev.puts = nc_puts;
-   dev.getc = nc_getc;
-   dev.tstc = nc_tstc;
+   dev.start = nc_stdio_start;
+   dev.putc = nc_stdio_putc;
+   dev.puts = nc_stdio_puts;
+   dev.getc = nc_stdio_getc;
+   dev.tstc = nc_stdio_tstc;
 
rc = stdio_register(dev);
 
diff --git a/include/net.h b/include/net.h
index 1275ffe..a7aefbc 100644
--- a/include/net.h
+++ b/include/net.h
@@ -634,7 +634,7 @@ int net_send_udp_packet(uchar *ether, struct in_addr dest, 
int dport,
 void net_process_received_packet(uchar *in_packet, int len);
 
 #ifdef CONFIG_NETCONSOLE
-void NcStart(void);
+void nc_start(void);
 int nc_input_packet(uchar *pkt, struct in_addr src_ip, unsigned dest_port,
unsigned src_port, unsigned len);
 #endif
diff --git a/net/net.c b/net/net.c
index d5b0bc4..030ceb1 100644
--- a/net/net.c
+++ b/net/net.c
@@ -417,7 +417,7 @@ restart:
 #endif
 #if defined (CONFIG_NETCONSOLE)  !(CONFIG_SPL_BUILD)
case NETCONS:
-   NcStart();
+   nc_start();
break;
 #endif
 #if defined(CONFIG_CMD_SNTP)
-- 
1.7.11.5

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


[U-Boot] [PATCH 23/23] net: Convert protocol structures to use explicit sizes

2015-04-03 Thread Joe Hershberger
From: Sergey Temerkhanov s.temerkha...@gmail.com

Convert uchar/ushort to u8/u16 respectively.


Signed-off-by: Radha Mohan Chintakuntla rchintakun...@cavium.com
Signed-off-by: Sergey Temerkhanov s.temerkha...@gmail.com
Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 include/net.h | 112 +-
 net/bootp.h   |  14 
 2 files changed, 63 insertions(+), 63 deletions(-)

diff --git a/include/net.h b/include/net.h
index def1fd9..62e213d 100644
--- a/include/net.h
+++ b/include/net.h
@@ -253,9 +253,9 @@ u32 ether_crc(size_t len, unsigned char const *p);
  */
 
 struct ethernet_hdr {
-   uchar   et_dest[6]; /* Destination node */
-   uchar   et_src[6];  /* Source node  */
-   ushort  et_protlen; /* Protocol or length   */
+   u8  et_dest[6]; /* Destination node */
+   u8  et_src[6];  /* Source node  */
+   u16 et_protlen; /* Protocol or length   */
 };
 
 /* Ethernet header size */
@@ -264,16 +264,16 @@ struct ethernet_hdr {
 #define ETH_FCS_LEN4   /* Octets in the FCS*/
 
 struct e802_hdr {
-   uchar   et_dest[6]; /* Destination node */
-   uchar   et_src[6];  /* Source node  */
-   ushort  et_protlen; /* Protocol or length   */
-   uchar   et_dsap;/* 802 DSAP */
-   uchar   et_ssap;/* 802 SSAP */
-   uchar   et_ctl; /* 802 control  */
-   uchar   et_snap1;   /* SNAP */
-   uchar   et_snap2;
-   uchar   et_snap3;
-   ushort  et_prot;/* 802 protocol */
+   u8  et_dest[6]; /* Destination node */
+   u8  et_src[6];  /* Source node  */
+   u16 et_protlen; /* Protocol or length   */
+   u8  et_dsap;/* 802 DSAP */
+   u8  et_ssap;/* 802 SSAP */
+   u8  et_ctl; /* 802 control  */
+   u8  et_snap1;   /* SNAP */
+   u8  et_snap2;
+   u8  et_snap3;
+   u16 et_prot;/* 802 protocol */
 };
 
 /* 802 + SNAP + ethernet header size */
@@ -283,11 +283,11 @@ struct e802_hdr {
  * Virtual LAN Ethernet header
  */
 struct vlan_ethernet_hdr {
-   uchar   vet_dest[6];/* Destination node */
-   uchar   vet_src[6]; /* Source node  */
-   ushort  vet_vlan_type;  /* PROT_VLAN*/
-   ushort  vet_tag;/* TAG of VLAN  */
-   ushort  vet_type;   /* protocol type*/
+   u8  vet_dest[6];/* Destination node */
+   u8  vet_src[6]; /* Source node  */
+   u16 vet_vlan_type;  /* PROT_VLAN*/
+   u16 vet_tag;/* TAG of VLAN  */
+   u16 vet_type;   /* protocol type*/
 };
 
 /* VLAN Ethernet header size */
@@ -305,14 +305,14 @@ struct vlan_ethernet_hdr {
  * Internet Protocol (IP) header.
  */
 struct ip_hdr {
-   uchar   ip_hl_v;/* header length and version*/
-   uchar   ip_tos; /* type of service  */
-   ushort  ip_len; /* total length */
-   ushort  ip_id;  /* identification   */
-   ushort  ip_off; /* fragment offset field*/
-   uchar   ip_ttl; /* time to live */
-   uchar   ip_p;   /* protocol */
-   ushort  ip_sum; /* checksum */
+   u8  ip_hl_v;/* header length and version*/
+   u8  ip_tos; /* type of service  */
+   u16 ip_len; /* total length */
+   u16 ip_id;  /* identification   */
+   u16 ip_off; /* fragment offset field*/
+   u8  ip_ttl; /* time to live */
+   u8  ip_p;   /* protocol */
+   u16 ip_sum; /* checksum */
struct in_addr  ip_src; /* Source IP address*/
struct in_addr  ip_dst; /* 

Re: [U-Boot] [PATCH 4/4] mtd: vf610_nfc: support subpage write

2015-04-03 Thread Stefan Agner
On 2015-04-03 22:36, Scott Wood wrote:
 On Fri, 2015-04-03 at 20:40 +0200, Stefan Agner wrote:
 Support subpage writes using a custom implementation of write_subpage.
 The driver loads the page into SRAM buffer using NAND_CMD_READ0, when
 the framework requests the NAND_CMD_SEQIN command. Then, the buffer is
 updated by the custom write_subpage implementation. Upon write, the
 controller calculates the hardware ECC across the whole page before
 programming the page.

 This method saves transferring the whole page over the bus to the NFC
 IP, which would happen when using NAND_NO_SUBPAGE_WRITE.

 Signed-off-by: Stefan Agner ste...@agner.ch
 
 As previously discussed, please explain why subpage writes make sense
 with this controller.

I thought the subpage callback is just about writing an arbitrary amount
of data (e.g. 32 bytes) into a page.

I quickly checked, when doing
# nand write ${loadaddr} 0x1 0x10

vf610_nfc_write_subpage gets actually called with a data_len of 16.

This is how I understand it:
Currently, subpage writes are supported by the MTD subsystem due to the
option NAND_NO_SUBPAGE_WRITE. Due to that option, nand_write_page in
nand_base.c calls write_page which copies always the whole page into the
SRAM buffer over the AHB bus to the NFC IP (vf610_nfc_write_page uses
memcpy uses mtd-writesize).

This patch supports it naively, which means that only the updated data
(according to offset and data_len parameter of write_subpage) get copied
over the AHB bus to the NFC IP (vf610_nfc_write_subpage uses memcpy to
only copy data_len). To have reasonable data for the rest of the page,
the page gets read back when calling NAND_CMD_SEQIN.

Since the whole page get programmed, this assumes that none of the page
has been programmed before (erased page). Hence, we essentially just
read 0xff. When I think about it now, reading the page back in SEQIN is
then probably just an expensive memset 0xff replacement.

I guess when having real subpages (e.g. 4x512bytes, each subpage with
its own ECC), I would have to make sure only the affected subpage gets
ECC'ed and written.

Even without having real subpages, if somebody only writes part of a
page, memset directly into SRAM  memcpy the subpage data is
theoretically faster then memset the whole page in DDR RAM and memcpy
the whole page

Just checked what higher up the stack is actually happening:
nand_write_page anyway receives a whole page buffer as argument, which
is memset'ed with 0xff and the data to be written memcpy'ed.

I see, that this patch tries to improve something which anyway is taken
care of by the stack.

I will remove the page read on NAND_CMD_SEQIN, since we memcpy the full
page anyway. I also just realized that the page read actually happens
always and hence slows down even full page writes...

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


Re: [U-Boot] [PATCH 2/4] mtd: vf610_nfc: add Freescale NFC controller configs to Kconfig

2015-04-03 Thread Scott Wood
On Fri, 2015-04-03 at 20:40 +0200, Stefan Agner wrote:
 This commit allows users to enable/disable the Freescale NFC
 controller found in systems like Vybrid (VF610), MPC5125, MCF54418
 or Kinetis K70 via Kconfig with more detailed help docs.
 
 Signed-off-by: Stefan Agner ste...@agner.ch
 ---
  configs/vf610twr_defconfig |  2 ++
  drivers/mtd/nand/Kconfig   | 15 +++
  include/configs/vf610twr.h |  3 ---
  3 files changed, 17 insertions(+), 3 deletions(-)
 
 diff --git a/configs/vf610twr_defconfig b/configs/vf610twr_defconfig
 index 7de374a..5e0ac9f 100644
 --- a/configs/vf610twr_defconfig
 +++ b/configs/vf610twr_defconfig
 @@ -1,3 +1,5 @@
  
 CONFIG_SYS_EXTRA_OPTIONS=IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_MMC
  CONFIG_ARM=y
  CONFIG_TARGET_VF610TWR=y
 +CONFIG_NAND_VF610_NFC=y
 +CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
 index 72825c3..8056c06 100644
 --- a/drivers/mtd/nand/Kconfig
 +++ b/drivers/mtd/nand/Kconfig
 @@ -32,6 +32,21 @@ config NAND_DENALI_SPARE_AREA_SKIP_BYTES
 of OOB area before last ECC sector data starts.  This is potentially
 used to preserve the bad block marker in the OOB area.
  
 +config NAND_VF610_NFC
 + bool Support for Freescale NFC for VF610/MPC5125
 + select SYS_NAND_SELF_INIT
 + help
 +   Enables support for NAND Flash Controller on some Freescale
 +   processors like the VF610, MPC5125, MCF54418 or Kinetis K70.
 +   The driver supports a maximum 2k page size. The driver
 +   currently does not support hardware ECC.
 +
 +config SYS_NAND_BUSWIDTH_16BIT
 + bool Use 16-bit NAND interface
 + depends on NAND_VF610_NFC
 + help
 +   Use 16-bit wide NAND flash interface.

Why does a generic-sounding config name depend on VF610?  Especially
when README already lists three other drivers as using this option...

Also, the help text makes it sound like it's at the user's discretion,
rather than a description of hardware.  I'd phrase it as something like
NAND has 16-bit interface

-Scott

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


Re: [U-Boot] [PATCH 2/4] mtd: vf610_nfc: add Freescale NFC controller configs to Kconfig

2015-04-03 Thread Stefan Agner
On 2015-04-03 22:30, Scott Wood wrote:
 On Fri, 2015-04-03 at 20:40 +0200, Stefan Agner wrote:
 This commit allows users to enable/disable the Freescale NFC
 controller found in systems like Vybrid (VF610), MPC5125, MCF54418
 or Kinetis K70 via Kconfig with more detailed help docs.

 Signed-off-by: Stefan Agner ste...@agner.ch
 ---
  configs/vf610twr_defconfig |  2 ++
  drivers/mtd/nand/Kconfig   | 15 +++
  include/configs/vf610twr.h |  3 ---
  3 files changed, 17 insertions(+), 3 deletions(-)

 diff --git a/configs/vf610twr_defconfig b/configs/vf610twr_defconfig
 index 7de374a..5e0ac9f 100644
 --- a/configs/vf610twr_defconfig
 +++ b/configs/vf610twr_defconfig
 @@ -1,3 +1,5 @@
  
 CONFIG_SYS_EXTRA_OPTIONS=IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_MMC
  CONFIG_ARM=y
  CONFIG_TARGET_VF610TWR=y
 +CONFIG_NAND_VF610_NFC=y
 +CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
 index 72825c3..8056c06 100644
 --- a/drivers/mtd/nand/Kconfig
 +++ b/drivers/mtd/nand/Kconfig
 @@ -32,6 +32,21 @@ config NAND_DENALI_SPARE_AREA_SKIP_BYTES
of OOB area before last ECC sector data starts.  This is potentially
used to preserve the bad block marker in the OOB area.

 +config NAND_VF610_NFC
 +bool Support for Freescale NFC for VF610/MPC5125
 +select SYS_NAND_SELF_INIT
 +help
 +  Enables support for NAND Flash Controller on some Freescale
 +  processors like the VF610, MPC5125, MCF54418 or Kinetis K70.
 +  The driver supports a maximum 2k page size. The driver
 +  currently does not support hardware ECC.
 +
 +config SYS_NAND_BUSWIDTH_16BIT
 +bool Use 16-bit NAND interface
 +depends on NAND_VF610_NFC
 +help
 +  Use 16-bit wide NAND flash interface.
 
 Why does a generic-sounding config name depend on VF610?  Especially
 when README already lists three other drivers as using this option...

That option is _not_ meant as being VF610 specific.

Since we have the ability to specify dependencies with Kconfig, I think
it is nice to have options only available if a driver supports it, hence
the depends. So far the VF610 NAND driver is the only one which is in
Kconfig and supports it... I would expect that when another driver which
supports that option gets migrated, depends will be extended
accordingly.

However, I just realized that the option end up between Vybrid specific
configs because of Patch 3. I will move the option at the very bottom in
next revision.
 
 Also, the help text makes it sound like it's at the user's discretion,
 rather than a description of hardware.  I'd phrase it as something like
 NAND has 16-bit interface

Agreed, will change that.

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


[U-Boot] [PATCH 13/23] net: cosmetic: Clean up ping variables and functions

2015-04-03 Thread Joe Hershberger
Make a thorough pass through all variables and function names contained
within ping.c and remove CamelCase and improve naming.

Signed-off-by: Joe Hershberger joe.hershber...@ni.com
---

 net/ping.c | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/net/ping.c b/net/ping.c
index 76e8749..87da555 100644
--- a/net/ping.c
+++ b/net/ping.c
@@ -12,7 +12,7 @@
 #include ping.h
 #include arp.h
 
-static ushort PingSeqNo;
+static ushort ping_seq_number;
 
 /* The ip address to ping */
 struct in_addr net_ping_ip;
@@ -35,7 +35,7 @@ static void set_icmp_header(uchar *pkt, struct in_addr dest)
icmp-code = 0;
icmp-checksum = 0;
icmp-un.echo.id = 0;
-   icmp-un.echo.sequence = htons(PingSeqNo++);
+   icmp-un.echo.sequence = htons(ping_seq_number++);
icmp-checksum = compute_ip_checksum(icmp, ICMP_HDR_SIZE);
 }
 
@@ -65,7 +65,7 @@ static int ping_send(void)
return 1;   /* waiting */
 }
 
-static void ping_timeout(void)
+static void ping_timeout_handler(void)
 {
eth_halt();
net_set_state(NETLOOP_FAIL);/* we did not get the reply */
@@ -74,7 +74,7 @@ static void ping_timeout(void)
 void ping_start(void)
 {
printf(Using %s device\n, eth_get_name());
-   NetSetTimeout(1UL, ping_timeout);
+   NetSetTimeout(1UL, ping_timeout_handler);
 
ping_send();
 }
@@ -94,8 +94,9 @@ void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr 
*ip, int len)
case ICMP_ECHO_REQUEST:
eth_hdr_size = net_update_ether(et, et-et_src, PROT_IP);
 
-   debug_cond(DEBUG_DEV_PKT, Got ICMP ECHO REQUEST, return 
-   %d bytes\n, eth_hdr_size + len);
+   debug_cond(DEBUG_DEV_PKT,
+  Got ICMP ECHO REQUEST, return %d bytes\n,
+  eth_hdr_size + len);
 
ip-ip_sum = 0;
ip-ip_off = 0;
-- 
1.7.11.5

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


Re: [U-Boot] [PATCH 1/2] mtd: vf610_nfc: mark page as dirty on block erase

2015-04-03 Thread Stefan Agner
On 2015-04-03 22:15, Scott Wood wrote:
 On Fri, 2015-04-03 at 20:09 +0200, Stefan Agner wrote:
 On 2015-04-03 01:48, Scott Wood wrote:
  On Tue, 2015-03-31 at 11:02 -0400, Bill Pringlemeir wrote:
  On 2015-03-31 00:15, Scott Wood wrote:
 
   Especially since you'd be doing one write rather than four full-page
   partial writes.  Surely the bottleneck here is the NAND chip itself,
   not copying data to the buffer?
 
  The AHB bus that the NFC controller is on is relatively slow.  Here are
  some numbers from 'AN4947-vybrid-bus-architechure',
 
  Vybrid Cortex A5 to DDR (in CPU clocks 400/500MHz),
 
 First read Subsequent
 2858  all caches on
 345269no cache, mmu
 437371no cache, no mmu
 
  The NFC is on an AHB bus 32bit, 66MHz (not AXI 64bit, 133-166MHz like
  DDR).  The AHB will be about four times slower.  Also the reads and
  writes to the physical NAND must take place serially.  Here are the
  program page steps.
 
1. Issue controller Read full page to NFC buffer.
2. Copy update partial page from DDR to NFC buffer.
3. Issue write NAND page.
 
  Why is any sort of read part of the write process?

 To recalculate the correct ECC, which is done in the controller, the
 controller has to have the page in the SRAM. I will send out a patch
 which implements vf610_nfc_write_subpage. And the read part is done when
 the MTD subsystem calls NAND_CMD_SEQIN.
 
 Again, if this is the only way you can do subpage accesses then you
 should not do them.

Why not? IMHO, there are valid reason to do it, since we save coping
data over the bus (we save copying page size - write len of bytes)...
Also, I guess all NAND controller which do HW ECC need to read at least
ECC step size back to the controller... Maybe we can move the discussion
to the actual code (see mtd: vf610_nfc: support subpage write).
 
 Actually, the Linux NAND driver supports subpage writes already by using
 the generic nand_write_subpage_hwecc function. However, in U-Boot I
 added driver specific page_read/page_write due to performance reasons:
 http://lists.denx.de/pipermail/u-boot/2014-August/186293.html

 However, I tried driver specific page_read/page_write functions for
 Linux too, but I couldn't measure noticeable performance improvements. I
 think the reason why it lead to noticeable improvements for U-Boot was
 because U-Boot does not use caches so far.
 
 If you care about U-Boot's performance at all, enabling cache would be
 the first thing I'd try...

Yes, we have that in our downstream since some months, and patch is
pending, see:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/215896

But it was not the first thing we did, we started with the functionality
needed to boot, such as reading from NAND... Hence we could now go back
and use the MTD subsystems generic functions. I do not have a strong
opinion on this...

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


Re: [U-Boot] [PATCH 4/4] mtd: vf610_nfc: support subpage write

2015-04-03 Thread Scott Wood
On Fri, 2015-04-03 at 20:40 +0200, Stefan Agner wrote:
 Support subpage writes using a custom implementation of write_subpage.
 The driver loads the page into SRAM buffer using NAND_CMD_READ0, when
 the framework requests the NAND_CMD_SEQIN command. Then, the buffer is
 updated by the custom write_subpage implementation. Upon write, the
 controller calculates the hardware ECC across the whole page before
 programming the page.
 
 This method saves transferring the whole page over the bus to the NFC
 IP, which would happen when using NAND_NO_SUBPAGE_WRITE.
 
 Signed-off-by: Stefan Agner ste...@agner.ch

As previously discussed, please explain why subpage writes make sense
with this controller.

-Scott


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


Re: [U-Boot] [PATCH] serial-arc: switch to DM

2015-04-03 Thread Simon Glass
Hi Alexey,

On 31 March 2015 at 04:18, Alexey Brodkin alexey.brod...@synopsys.com wrote:

 Now when all infrastructure in ARC is ready for it let's switch ARC UART
 to driver model.

 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 Cc: Masahiro Yamada yamada.masah...@socionext.com
 Cc: Simon Glass s...@chromium.org
 ---
  arch/Kconfig   |   1 +
  arch/arc/dts/Makefile  |  11 +
  arch/arc/dts/arcangel4.dts |  24 ++
  arch/arc/dts/skeleton.dtsi |  13 ++
  configs/arcangel4-be_defconfig |   5 ++
  configs/arcangel4_defconfig|   5 ++
  drivers/serial/serial_arc.c| 102 
 -
  7 files changed, 129 insertions(+), 32 deletions(-)
  create mode 100644 arch/arc/dts/Makefile
  create mode 100644 arch/arc/dts/arcangel4.dts
  create mode 100644 arch/arc/dts/skeleton.dtsi

 diff --git a/arch/Kconfig b/arch/Kconfig
 index ca617e7..2ca5305 100644
 --- a/arch/Kconfig
 +++ b/arch/Kconfig
 @@ -14,6 +14,7 @@ config ARC
 select HAVE_PRIVATE_LIBGCC
 select HAVE_GENERIC_BOARD
 select SYS_GENERIC_BOARD
 +   select SUPPORT_OF_CONTROL

  config ARM
 bool ARM architecture
 diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile
 new file mode 100644
 index 000..a155311
 --- /dev/null
 +++ b/arch/arc/dts/Makefile
 @@ -0,0 +1,11 @@
 +dtb-$(CONFIG_TARGET_ARCANGEL4) +=  arcangel4.dtb
 +
 +targets += $(dtb-y)
 +
 +DTC_FLAGS += -R 4 -p 0x1000
 +
 +PHONY += dtbs
 +dtbs: $(addprefix $(obj)/, $(dtb-y))
 +   @:
 +
 +clean-files := *.dtb
 diff --git a/arch/arc/dts/arcangel4.dts b/arch/arc/dts/arcangel4.dts
 new file mode 100644
 index 000..bfcb9d8
 --- /dev/null
 +++ b/arch/arc/dts/arcangel4.dts
 @@ -0,0 +1,24 @@
 +/*
 + * Copyright (C) 2015 Synopsys, Inc. (www.synopsys.com)
 + *
 + * SPDX-License-Identifier:GPL-2.0+
 + */
 +/dts-v1/;
 +
 +#include skeleton.dtsi
 +
 +/ {
 +   #address-cells = 1;
 +   #size-cells = 1;
 +
 +   aliases {
 +   console = arcuart0;
 +   };
 +
 +   arcuart0: serial@0xc0fc1000 {
 +   compatible = snps,arc-uart;
 +   reg = 0xc0fc1000 0x100;
 +   clock-frequency = 8000;
 +   };
 +
 +};
 diff --git a/arch/arc/dts/skeleton.dtsi b/arch/arc/dts/skeleton.dtsi
 new file mode 100644
 index 000..b41d241
 --- /dev/null
 +++ b/arch/arc/dts/skeleton.dtsi
 @@ -0,0 +1,13 @@
 +/*
 + * Skeleton device tree; the bare minimum needed to boot; just include and
 + * add a compatible value.  The bootloader will typically populate the memory
 + * node.
 + */
 +
 +/ {
 +   #address-cells = 1;
 +   #size-cells = 1;
 +   chosen { };
 +   aliases { };
 +   memory { device_type = memory; reg = 0 0; };
 +};
 diff --git a/configs/arcangel4-be_defconfig b/configs/arcangel4-be_defconfig
 index 990c74a..36ea6be 100644
 --- a/configs/arcangel4-be_defconfig
 +++ b/configs/arcangel4-be_defconfig
 @@ -1,5 +1,10 @@
  CONFIG_ARC=y
  CONFIG_CPU_BIG_ENDIAN=y
  CONFIG_TARGET_ARCANGEL4=y
 +CONFIG_DM=y
 +CONFIG_DM_SERIAL=y
 +CONFIG_DEFAULT_DEVICE_TREE=arcangel4
  CONFIG_SYS_TEXT_BASE=0x8100
  CONFIG_SYS_CLK_FREQ=7000
 +CONFIG_OF_CONTROL=y
 +CONFIG_OF_EMBED=y
 diff --git a/configs/arcangel4_defconfig b/configs/arcangel4_defconfig
 index fbc0ffe..75a91c8 100644
 --- a/configs/arcangel4_defconfig
 +++ b/configs/arcangel4_defconfig
 @@ -1,4 +1,9 @@
  CONFIG_ARC=y
  CONFIG_TARGET_ARCANGEL4=y
 +CONFIG_DM=y
 +CONFIG_DM_SERIAL=y
 +CONFIG_DEFAULT_DEVICE_TREE=arcangel4
  CONFIG_SYS_TEXT_BASE=0x8100
  CONFIG_SYS_CLK_FREQ=7000
 +CONFIG_OF_CONTROL=y
 +CONFIG_OF_EMBED=y
 diff --git a/drivers/serial/serial_arc.c b/drivers/serial/serial_arc.c
 index 0ee8ce5..54e596c 100644
 --- a/drivers/serial/serial_arc.c
 +++ b/drivers/serial/serial_arc.c
 @@ -8,6 +8,7 @@
   */

  #include common.h
 +#include dm.h
  #include serial.h

  DECLARE_GLOBAL_DATA_PTR;
 @@ -23,21 +24,23 @@ struct arc_serial_regs {
 unsigned int baudh;
  };

 +
 +struct arc_serial_platdata {
 +   struct arc_serial_regs *reg;
 +   unsigned int uartclk;
 +};
 +
  /* Bit definitions of STATUS register */
  #define UART_RXEMPTY   (1  5)
  #define UART_OVERFLOW_ERR  (1  1)
  #define UART_TXEMPTY   (1  7)

 -struct arc_serial_regs *regs = (struct arc_serial_regs 
 *)CONFIG_ARC_UART_BASE;
 -
 -static void arc_serial_setbrg(void)
 +static int arc_serial_setbrg(struct udevice *dev, int baudrate)
  {
 -   int arc_console_baud;
 +   struct arc_serial_platdata *plat = dev-platdata;
 +   struct arc_serial_regs *const regs = plat-reg;
 +   int arc_console_baud = gd-cpu_clk / (baudrate * 4) - 1;

 -   if (!gd-baudrate)
 -   gd-baudrate = CONFIG_BAUDRATE;
 -
 -   arc_console_baud = gd-cpu_clk / (gd-baudrate * 4) - 1;
 writeb(arc_console_baud  0xff, regs-baudl);

  #ifdef CONFIG_ARC
 @@ -56,33 +59,49 @@ static void arc_serial_setbrg(void)
  #else
 writeb((arc_console_baud  0xff00) 

Re: [U-Boot] [PATCH] dm: eth: Provide a way for drivers to manage packet buffers

2015-04-03 Thread Simon Glass
Hi Joe,

On 1 April 2015 at 10:03, Joe Hershberger joe.hershber...@gmail.com wrote:
 Hi Simon,


 On Tue, Mar 31, 2015 at 10:32 PM, Simon Glass s...@chromium.org wrote:

 Hi Joe,

 On 30 March 2015 at 14:44, Joe Hershberger joe.hershber...@ni.com wrote:
  Some drivers need a chance to manage their receive buffers after the
  packet has been handled by the network stack. Add an operation that
  will allow the driver to be called in that case.
 
  Reported-by: Simon Glass s...@chromium.org
  Signed-off-by: Joe Hershberger joe.hershber...@ni.com
  ---
  This patch depends on dm/next
 
   include/net.h | 4 
   net/eth.c | 8 ++--
   2 files changed, 10 insertions(+), 2 deletions(-)
 
  diff --git a/include/net.h b/include/net.h
  index e7f28d7..f9df532 100644
  --- a/include/net.h
  +++ b/include/net.h
  @@ -98,6 +98,9 @@ struct eth_pdata {
* recv: Check if the hardware received a packet. If so, set the
  pointer to the
*  packet buffer in the packetp parameter. If not, return an error
  or 0 to
*  indicate that the hardware receive FIFO is empty
  + * free_pkt: Give the driver an opportunity to manage its packet buffer
  memory
  + *  when the network stack is finished processing it. This will
  only be
  + *  called when a packet was successfully returned from recv -
  optional
* stop: Stop the hardware from looking for packets - may be called
  even if
*  state == PASSIVE
* mcast: Join or leave a multicast group (for TFTP) - optional
  @@ -113,6 +116,7 @@ struct eth_ops {
  int (*start)(struct udevice *dev);
  int (*send)(struct udevice *dev, void *packet, int length);
  int (*recv)(struct udevice *dev, uchar **packetp);
  +   int (*free_pkt)(struct udevice *dev, uchar *packet, int length);
  void (*stop)(struct udevice *dev);
   #ifdef CONFIG_MCAST_TFTP
  int (*mcast)(struct udevice *dev, const u8 *enetaddr, int join);
  diff --git a/net/eth.c b/net/eth.c
  index 13b7723..889ad8f 100644
  --- a/net/eth.c
  +++ b/net/eth.c
  @@ -342,10 +342,14 @@ int eth_rx(void)
  /* Process up to 32 packets at one time */
  for (i = 0; i  32; i++) {
  ret = eth_get_ops(current)-recv(current, packet);
  -   if (ret  0)
  +   if (ret  0) {

 To match the old net stack behaviour I wonder if we should process the
 packet when it is length 0, and require recv() to return -EAGAIN when
 there is no packet? At least with designware, it processes a 0-length
 packet for some reason, and we need to call free_pkt() in that case.

 I pretty much assumed that since the driver is not expecting the network
 stack to do anything with the buffer in the retval == 0 case, the driver
 would handle its buffer management before returning from recv().

 I'm not sure which is more clear to the driver writer... to expect the
 free_pkt() call when returning 0 or to not expect it.  I guess my initial
 instinct is that you would not expect it.

Fair enough - should be documented one way or the other in the uclass
header net.h. I think a case can be made that a 0-length packet should
be handled differently in the uclass if there is any special behaviour
required, i.e. that the uclass should still call free_pkt() but may
skip processing the packet. But I'm really not sure why this happens
at all.


  net_process_received_packet(packet, ret);
  -   else
  +   if (eth_get_ops(current)-free_pkt)
  +   eth_get_ops(current)-free_pkt(current,
  packet,
  +  ret);
  +   } else {
  break;
  +   }
  }
  if (ret == -EAGAIN)
  ret = 0;
  --
  1.7.11.5
 

 Tested on pcduino3:

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

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

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


[U-Boot] [PATCH] arm: mx6: ddr: add pd_fast_exit flag to system information

2015-04-03 Thread Tim Harvey
DDR3 has a special Precharge power-down mode: fast-exit vs slow-exit.

In slow-exit mode the DLL is off but in some quiescent state that makes it easy
to turn on again in tXPDLL cycles (about 10tCK) vs the full tDLLK (512tCK).
In fast-exist mode the DLL is maintained such that it is ready again in about
3tCK.

Signed-off-by: Tim Harvey thar...@gateworks.com
---
 arch/arm/cpu/armv7/mx6/ddr.c| 7 ++-
 arch/arm/include/asm/arch-mx6/mx6-ddr.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/mx6/ddr.c b/arch/arm/cpu/armv7/mx6/ddr.c
index fef2231..653d58e 100644
--- a/arch/arm/cpu/armv7/mx6/ddr.c
+++ b/arch/arm/cpu/armv7/mx6/ddr.c
@@ -514,17 +514,21 @@ void mx6_dram_cfg(const struct mx6_ddr_sysinfo *sysinfo,
/* MR2 */
val = (sysinfo-rtt_wr  3)  9 | (ddr3_cfg-SRT  1)  7 |
  ((tcwl - 3)  3)  3;
+   debug(MR2 CS%d: 0x%08x\n, cs, (u32)MR(val, 2, 3, cs));
mmdc0-mdscr = MR(val, 2, 3, cs);
/* MR3 */
+   debug(MR3 CS%d: 0x%08x\n, cs, (u32)MR(0, 3, 3, cs));
mmdc0-mdscr = MR(0, 3, 3, cs);
/* MR1 */
val = ((sysinfo-rtt_nom  1) ? 1 : 0)  2 |
  ((sysinfo-rtt_nom  2) ? 1 : 0)  6;
+   debug(MR1 CS%d: 0x%08x\n, cs, (u32)MR(val, 1, 3, cs));
mmdc0-mdscr = MR(val, 1, 3, cs);
/* MR0 */
val = ((tcl - 1)  4) |/* CAS */
  (1  8)   |  /* DLL Reset */
  ((twr - 3)  9); /* Write Recovery */
+   debug(MR0 CS%d: 0x%08x\n, cs, (u32)MR(val, 0, 3, cs));
mmdc0-mdscr = MR(val, 0, 3, cs);
/* ZQ calibration */
val = (1  10);
@@ -535,10 +539,11 @@ void mx6_dram_cfg(const struct mx6_ddr_sysinfo *sysinfo,
mmdc0-mdpdc = (tcke  0x7)  16 |
5 12 |  /* PWDT_1: 256 cycles */
5  8 |  /* PWDT_0: 256 cycles */
-   1  7 |  /* SLOW_PD */
1  6 |  /* BOTH_CS_PD */
(tcksrx  0x7)  3 |
(tcksre  0x7);
+   if (!sysinfo-pd_fast_exit)
+   mmdc0-mdpdc |= (1  7); /* SLOW_PD */
mmdc0-mapsr = 0x1006; /* ADOPT power down enabled */
 
/* Step 11: Configure ZQ calibration: one-time and periodic 1ms */
diff --git a/arch/arm/include/asm/arch-mx6/mx6-ddr.h 
b/arch/arm/include/asm/arch-mx6/mx6-ddr.h
index 8e0d7d1..c49aa62 100644
--- a/arch/arm/include/asm/arch-mx6/mx6-ddr.h
+++ b/arch/arm/include/asm/arch-mx6/mx6-ddr.h
@@ -250,6 +250,7 @@ struct mx6_ddr_sysinfo {
u8 mif3_mode;   /* Command prediction working mode */
u8 rst_to_cke;  /* Time from SDE enable to CKE rise */
u8 sde_to_rst;  /* Time from SDE enable until DDR reset# is high */
+   u8 pd_fast_exit;/* enable precharge powerdown fast-exit */
 };
 
 /*
-- 
1.9.1

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


[U-Boot] [PATCH] fdt: nios: Fix warning in ft_cpu_setup()

2015-04-03 Thread Simon Glass
This function should not return a value.

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

 arch/nios2/cpu/fdt.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/nios2/cpu/fdt.c b/arch/nios2/cpu/fdt.c
index 5024682..79f72aa 100644
--- a/arch/nios2/cpu/fdt.c
+++ b/arch/nios2/cpu/fdt.c
@@ -34,7 +34,5 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 * Note: aliases in the dts are required for this
 */
fdt_fixup_ethernet(blob);
-
-   return 0;
 }
 #endif /* CONFIG_OF_LIBFDT  CONFIG_OF_BOARD_SETUP */
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH] power: pfuze100: fix LDO_EN bit value

2015-04-03 Thread Tim Harvey
The LDO_EN is bit 4, not value 4. This is only used on the Ventana boards so
we will change it in the header as the other values there are in terms of
values and not bit numbers.

Signed-off-by: Tim Harvey thar...@gateworks.com
---
 include/power/pfuze100_pmic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/power/pfuze100_pmic.h b/include/power/pfuze100_pmic.h
index 07199b4..8e7a22d 100644
--- a/include/power/pfuze100_pmic.h
+++ b/include/power/pfuze100_pmic.h
@@ -180,7 +180,7 @@ enum {
 #define LDOB_3_30V 15
 
 #define LDO_VOL_MASK   0xf
-#define LDO_EN 4
+#define LDO_EN (1  4)
 
 /*
  * Boost Regulator
-- 
1.9.1

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


Re: [U-Boot] multi-image uImage with fitImage

2015-04-03 Thread Simon Glass
+U-Boot again

Hi Andre,

On 30 March 2015 at 22:41, Andre Wolokita andre.wolok...@analog.com wrote:


 On 31/03/15 13:42, Stephen Warren wrote:
 On 03/30/2015 05:42 PM, Andre Wolokita wrote:
 ...
 I am able to boot a uImage produced by buildroot successfully, although I 
 still haven't tried a zImage. One point of clarification: the uImage (and 
 presumably zImage) produced by buildroot has the initrd linked in to the 
 image. Could you think of any reason that this would affect a fitImage from 
 loading?
 Presumably this combined kernel+initrd is very large, so the amount of
 space taken by the decompressed kernel (roughly located at the start of
 RAM) is much larger than typical. Perhaps the decompression is
 over-writing the DTB or something like that? Is the entire kernel_initrd
 located within the first 256MB of RAM, if you're uses AUTO_ZRELADDR in
 the kernel config?
 Well, I figured it out. It turns out that using objcopy to create a binary of 
 vmlinux and using the vmlinux.bin as the kernel as well as creating a cpio 
 of the rootfs for the ramdisk allows Linux to boot perfectly.

 Thanks for your help, Simon and Stephen. :)


OK good! I wonder if the Linux build process still creates a file
called 'Image' which does the objcopy for you?

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


[U-Boot] [PATCH v2] dm: eth: Provide a way for drivers to manage packet buffers

2015-04-03 Thread Joe Hershberger
Some drivers need a chance to manage their receive buffers after the
packet has been handled by the network stack. Add an operation that
will allow the driver to be called in that case.

Reported-by: Simon Glass s...@chromium.org
Signed-off-by: Joe Hershberger joe.hershber...@ni.com
Acked-by: Simon Glass s...@chromium.org
Tested-by: Simon Glass s...@chromium.org
Tested-on: pcduino3
---
This patch depends on dm/next

Changes in v2:
-Call free_pkt() even when driver returns 0
-Add more comments about this new behavior

 include/net.h | 8 +++-
 net/eth.c | 4 +++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/net.h b/include/net.h
index e7f28d7..35602cd 100644
--- a/include/net.h
+++ b/include/net.h
@@ -97,7 +97,12 @@ struct eth_pdata {
  * send: Send the bytes passed in packet as a packet on the wire
  * recv: Check if the hardware received a packet. If so, set the pointer to the
  *  packet buffer in the packetp parameter. If not, return an error or 0 to
- *  indicate that the hardware receive FIFO is empty
+ *  indicate that the hardware receive FIFO is empty. If 0 is returned, the
+ *  network stack will not process the empty packet, but free_pkt() will be
+ *  called if supplied
+ * free_pkt: Give the driver an opportunity to manage its packet buffer memory
+ *  when the network stack is finished processing it. This will only be
+ *  called when no error was returned from recv - optional
  * stop: Stop the hardware from looking for packets - may be called even if
  *  state == PASSIVE
  * mcast: Join or leave a multicast group (for TFTP) - optional
@@ -113,6 +118,7 @@ struct eth_ops {
int (*start)(struct udevice *dev);
int (*send)(struct udevice *dev, void *packet, int length);
int (*recv)(struct udevice *dev, uchar **packetp);
+   int (*free_pkt)(struct udevice *dev, uchar *packet, int length);
void (*stop)(struct udevice *dev);
 #ifdef CONFIG_MCAST_TFTP
int (*mcast)(struct udevice *dev, const u8 *enetaddr, int join);
diff --git a/net/eth.c b/net/eth.c
index 13b7723..05411f1 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -344,7 +344,9 @@ int eth_rx(void)
ret = eth_get_ops(current)-recv(current, packet);
if (ret  0)
net_process_received_packet(packet, ret);
-   else
+   if (ret = 0  eth_get_ops(current)-free_pkt)
+   eth_get_ops(current)-free_pkt(current, packet, ret);
+   if (ret = 0)
break;
}
if (ret == -EAGAIN)
-- 
1.7.11.5

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


Re: [U-Boot] please pull u-boot-arc master

2015-04-03 Thread Tom Rini
On Fri, Apr 03, 2015 at 06:56:13AM +, Alexey Brodkin wrote:

 Dear Tom,
 
 The following changes since commit
 8a5c9ca4d0b8aa13a1bb321494d24f656a9a7d72:
 
   Prepare v2015.04-rc5 (2015-03-31 20:53:59 -0400)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-arc.git 
 
 for you to fetch changes up to d5717e894497124fd44289a37f818ee301640c70:
 
   board: AXS10x - update SDIO clock value (2015-04-03 09:47:50 +0300)
 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 2/4] mtd: vf610_nfc: add Freescale NFC controller configs to Kconfig

2015-04-03 Thread Scott Wood
On Sat, 2015-04-04 at 00:30 +0200, Stefan Agner wrote:
 On 2015-04-03 22:46, Scott Wood wrote:
  On Fri, 2015-04-03 at 22:42 +0200, Stefan Agner wrote:
  On 2015-04-03 22:30, Scott Wood wrote:
   On Fri, 2015-04-03 at 20:40 +0200, Stefan Agner wrote:
   This commit allows users to enable/disable the Freescale NFC
   controller found in systems like Vybrid (VF610), MPC5125, MCF54418
   or Kinetis K70 via Kconfig with more detailed help docs.
  
   Signed-off-by: Stefan Agner ste...@agner.ch
   ---
configs/vf610twr_defconfig |  2 ++
drivers/mtd/nand/Kconfig   | 15 +++
include/configs/vf610twr.h |  3 ---
3 files changed, 17 insertions(+), 3 deletions(-)
  
   diff --git a/configs/vf610twr_defconfig b/configs/vf610twr_defconfig
   index 7de374a..5e0ac9f 100644
   --- a/configs/vf610twr_defconfig
   +++ b/configs/vf610twr_defconfig
   @@ -1,3 +1,5 @@

   CONFIG_SYS_EXTRA_OPTIONS=IMX_CONFIG=board/freescale/vf610twr/imximage.cfg,ENV_IS_IN_MMC
CONFIG_ARM=y
CONFIG_TARGET_VF610TWR=y
   +CONFIG_NAND_VF610_NFC=y
   +CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
   diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
   index 72825c3..8056c06 100644
   --- a/drivers/mtd/nand/Kconfig
   +++ b/drivers/mtd/nand/Kconfig
   @@ -32,6 +32,21 @@ config NAND_DENALI_SPARE_AREA_SKIP_BYTES
 of OOB area before last ECC sector data starts.  This is 
   potentially
 used to preserve the bad block marker in the OOB area.
  
   +config NAND_VF610_NFC
   +   bool Support for Freescale NFC for VF610/MPC5125
   +   select SYS_NAND_SELF_INIT
   +   help
   + Enables support for NAND Flash Controller on some Freescale
   + processors like the VF610, MPC5125, MCF54418 or Kinetis K70.
   + The driver supports a maximum 2k page size. The driver
   + currently does not support hardware ECC.
   +
   +config SYS_NAND_BUSWIDTH_16BIT
   +   bool Use 16-bit NAND interface
   +   depends on NAND_VF610_NFC
   +   help
   + Use 16-bit wide NAND flash interface.
  
   Why does a generic-sounding config name depend on VF610?  Especially
   when README already lists three other drivers as using this option...
 
  That option is _not_ meant as being VF610 specific.
 
  Since we have the ability to specify dependencies with Kconfig, I think
  it is nice to have options only available if a driver supports it, hence
  the depends. So far the VF610 NAND driver is the only one which is in
  Kconfig and supports it... I would expect that when another driver which
  supports that option gets migrated, depends will be extended
  accordingly.
 
  However, I just realized that the option end up between Vybrid specific
  configs because of Patch 3. I will move the option at the very bottom in
  next revision.
  
  Could you also add a comment mentioning the other drivers that use it,
  which aren't yet kconfiged?  And then remove the old text from the
  README.
 
 By comment, you mean a Kconfig comment at that option, so the next
 stumbles upon it? So I can keep that single depends NAND_VF610_NFC for
 now?

Yes.

 Removing CONFIG_SYS_NAND_BUSWIDTH_16BIT from doc/README.nand right? But
 with that, the options for the other drivers would be undocumented for
 the time being... 

No, it'd be documented in the kconfig file, even if it's not presented
via the kconfig tool.  It seems bad to have the option description
duplicated -- and then potentially getting changed one place and not the
other.

-Scott


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


Re: [U-Boot] [PATCH] ahci: Fix a wrong parameter pass

2015-04-03 Thread Simon Glass
On 31 March 2015 at 01:02,  yuantian.t...@freescale.com wrote:
 From: Tang Yuantian yuantian.t...@freescale.com

 In stead of user_buffer_size, transfer_size should be used to pass to
 ahci_device_data_io(). transfer_size is the length that we want the
 low level function to transfer each time.
 If we use user_buffer_size which is the totally data length as parameter,
 low level function will actually create many SGs to transfer as many data
 as possible each time. That will produce many redundant data transfer.

 Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
 ---
  drivers/block/ahci.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

I'm not an expert here but this looks right.

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


Re: [U-Boot] [PATCHv3 01/17] arm: socfpga: spl: Add main sdram code

2015-04-03 Thread Marek Vasut
On Friday, April 03, 2015 at 06:55:20 AM, Dinh Nguyen wrote:
 Hi Marek,

Hi Dinh,

 On Thu, Apr 2, 2015 at 9:00 PM, Marek Vasut ma...@denx.de wrote:
  On Tuesday, March 31, 2015 at 08:41:46 AM, Wolfgang Denk wrote:
  Dear dingu...@opensource.altera.com,
  
  In message
  1427752878-18426-2-git-send-email-dingu...@opensource.altera.com you
  wrote:
  
  ...
  
   +/* Register: sdr.ctrlgrp.ctrlcfg
   
 */ +#define SDR_CTRLGRP_CTRLCFG_ADDRESS 0x5000
   
   +/* Register: sdr.ctrlgrp.dramtiming1
   
 */ +#define SDR_CTRLGRP_DRAMTIMING1_ADDRESS 0x5004
   
   +/* Register: sdr.ctrlgrp.dramtiming2
   
 */ +#define SDR_CTRLGRP_DRAMTIMING2_ADDRESS 0x5008
   
   +/* Register: sdr.ctrlgrp.dramtiming3
   
 */ +#define SDR_CTRLGRP_DRAMTIMING3_ADDRESS 0x500c
   
   +/* Register: sdr.ctrlgrp.dramtiming4
   
 */ +#define SDR_CTRLGRP_DRAMTIMING4_ADDRESS 0x5010
   
   +/* Register: sdr.ctrlgrp.lowpwrtiming
   
 */ +#define SDR_CTRLGRP_LOWPWRTIMING_ADDRESS 0x5014
   
   +/* Register: sdr.ctrlgrp.dramodt
   
 */ +#define SDR_CTRLGRP_DRAMODT_ADDRESS 0x5018
   
   +/* Register: sdr.ctrlgrp.dramaddrw
   
 */ +#define SDR_CTRLGRP_DRAMADDRW_ADDRESS 0x502c
  
  ...
  
  First, this whole block of registers should probably made a C struct.
  Also, the comments are pretty much redundant - they do not add any new
  information that is not already included in the #define, so they could
  be omitted to make the code easier to read.
  
  Hi!
  
  Sculpting this file into shape would be the most difficult part. I guess
  Wolfgang already pointed out the largest issues. I also picked up most
  of the series to make your life easier.
  
  Is there any way I can help you with getting this patch in shape ?
 
 Thanks for picking up the other patches for the SPL. That helps out
 ALOT! I can focus on getting the SDRAM driver in better shape. Give me
 a week or 2 for an updated patch.

Roger that, thank you! If I can help with anything, please let me know.

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


[U-Boot] [PATCH] imx: ipu: fix occasional hang following disabling of channel

2015-04-03 Thread Tim Harvey
It has been observed that some IMX6SDL SoC will hang appx 0.1% of boots
between disabling the ipu channel and disabling DMA preceeding an OS boot
unless an extra delay is added here.

The specific cause is still under investigation.

Signed-off-by: Tim Harvey thar...@gateworks.com
---
 drivers/video/ipu_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/ipu_common.c b/drivers/video/ipu_common.c
index 5873531..3c1 100644
--- a/drivers/video/ipu_common.c
+++ b/drivers/video/ipu_common.c
@@ -1109,6 +1109,7 @@ int32_t ipu_disable_channel(ipu_channel_t channel)
if ((channel == MEM_BG_SYNC) || (channel == MEM_FG_SYNC) ||
(channel == MEM_DC_SYNC)) {
ipu_dp_dc_disable(channel, 0);
+   mdelay(50);
}
 
/* Disable DMA channel(s) */
-- 
1.9.1

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


Re: [U-Boot] How to reduce SDcard speed in u-boot

2015-04-03 Thread Michael Trimarchi
Hi

On Fri, Apr 3, 2015 at 9:50 PM, Marco Cavallini
cavallini.k...@gmail.com wrote:
 2015-03-30 17:32 GMT+02:00 Marco Cavallini cavallini.k...@gmail.com:
 Hello,
 I am probably working on a 'buggy hardware' based on i.MX6 that isn't
 able to manage a SDcard speed properly.
 I mean, u-boot starts, but as soon as I try to perform a fatload if
 the uImage the command won't work properly.
 I had the possibility to test the SoM on another carrier with a
 different layout and a different microSD connector and it works at
 every boot.
 The quick and dirty hack I found is to modify sd_switch() in
 drivers/mmc/mmc.c in this way

 /*
  * Reduce SD/MMC speed
  * u-boot mmc info
  * before : Tran Speed: 5000
  * after   : Tran Speed: 2500
  */
 printf(*** Skip support SD_HIGHSPEED in sd_change_freq\n) ;
 return 0;

 just before

 /* If high-speed isn't supported, we return */
 if (!(__be32_to_cpu(switch_status[3])  SD_HIGHSPEED_SUPPORTED))
 return 0;

 the problem is that on 80% of the carrier boards the problem is still 
 present.
 My questions are:
 1. is this hack the best solution in this case or can you suggest me
 another better way to proceed?
 2. would be possible to reduce the speed more than this and how?


Increase the divisor of the clock

MXC_CCM_CSCDR1_USDHC[X]_PODF_MASK
MXC_CCM_CSCDR1_USDHC[X]_PODF_OFFSET

I'm not sure because I have not a board and no time before Easter
to open documentation ;)

Michael


 thank you in advance
 --
 Marco


 Hello,
 sorry for bothering you.
 Any advice from the u-boot experts would give me a great help.
 Thank you
 ___
 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] How to reduce SDcard speed in u-boot

2015-04-03 Thread Marco Cavallini
2015-03-30 17:32 GMT+02:00 Marco Cavallini cavallini.k...@gmail.com:
 Hello,
 I am probably working on a 'buggy hardware' based on i.MX6 that isn't
 able to manage a SDcard speed properly.
 I mean, u-boot starts, but as soon as I try to perform a fatload if
 the uImage the command won't work properly.
 I had the possibility to test the SoM on another carrier with a
 different layout and a different microSD connector and it works at
 every boot.
 The quick and dirty hack I found is to modify sd_switch() in
 drivers/mmc/mmc.c in this way

 /*
  * Reduce SD/MMC speed
  * u-boot mmc info
  * before : Tran Speed: 5000
  * after   : Tran Speed: 2500
  */
 printf(*** Skip support SD_HIGHSPEED in sd_change_freq\n) ;
 return 0;

 just before

 /* If high-speed isn't supported, we return */
 if (!(__be32_to_cpu(switch_status[3])  SD_HIGHSPEED_SUPPORTED))
 return 0;

 the problem is that on 80% of the carrier boards the problem is still present.
 My questions are:
 1. is this hack the best solution in this case or can you suggest me
 another better way to proceed?
 2. would be possible to reduce the speed more than this and how?

 thank you in advance
 --
 Marco


Hello,
sorry for bothering you.
Any advice from the u-boot experts would give me a great help.
Thank you
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot