Re: [U-Boot] [PATCH 07/14] sandbox: Move CONFIG_TPM_TIS_SANDBOX to Kconfig

2015-04-08 Thread Simon Glass
On 6 March 2015 at 13:19, Simon Glass s...@chromium.org wrote:
 Move this over to Kconfig and tidy up.

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

  configs/sandbox_defconfig | 1 +
  drivers/tpm/Kconfig   | 7 +++
  include/configs/sandbox.h | 4 
  3 files changed, 8 insertions(+), 4 deletions(-)

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


Re: [U-Boot] [PATCH 06/14] sandbox: Move CONFIG_SPI_FLASH_SANDBOX to Kconfig

2015-04-08 Thread Simon Glass
On 6 March 2015 at 13:19, Simon Glass s...@chromium.org wrote:
 Move this over to Kconfig and tidy up.

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

  configs/sandbox_defconfig |  1 +
  drivers/mtd/spi/Kconfig   | 10 ++
  drivers/spi/Kconfig   |  2 +-
  include/configs/sandbox.h |  1 -
  4 files changed, 12 insertions(+), 2 deletions(-)

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


Re: [U-Boot] Testing u-boot-dm/next

2015-04-08 Thread Simon Glass
(Correcting address for Masahiro, sorry)


On 8 April 2015 at 21:07, Simon Glass s...@chromium.org wrote:

 Hi,

 I have quite a few patches queued up in the next branch of u-boot-dm,
 ready for when the merge window options.

 If anyone has time and can give it a spin on their board, it would be much
 appreciated!

 Regards,
 Simon


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


Re: [U-Boot] [PATCH V3 2/4] dm: core: Extend struct udevice by '.uclass_platdata' field.

2015-04-08 Thread Simon Glass
On 8 April 2015 at 11:06, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This commit adds 'uclass_platdata' field to 'struct udevice', which
 can be automatically allocated at bind. The allocation size is defined
 in 'struct uclass_driver' as 'per_device_platdata_auto_alloc_size'.

 New device's flag is added: DM_FLAG_ALLOC_UCLASS_PDATA, which is used
 for memory freeing at device unbind method.

 As for other udevice's fields, a complementary function is added:
 - dev_get_uclass_platdata()

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 Cc: Simon Glass s...@chromium.org
 ---
 Changes V2:
 - none

 Changes V3:
 - none
 ---
  drivers/core/device-remove.c |  4 
  drivers/core/device.c| 33 +
  include/dm/device.h  | 17 -
  include/dm/uclass.h  |  4 
  4 files changed, 53 insertions(+), 5 deletions(-)

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


Re: [U-Boot] [PATCH v2 01/11] sunxi: Replace the pcDuino3 config with FDT version

2015-04-08 Thread Simon Glass
On 5 April 2015 at 16:07, Simon Glass s...@chromium.org wrote:
 We currently have Linksprite_pcDuino3 and Linksprite_pcDuino3_fdt. Drop the
 former in favour of the latter.

 Signed-off-by: Simon Glass s...@chromium.org
 Acked-by: Hans de Goede hdego...@redhat.com
 Acked-by: Ian Campbell i...@hellion.org.uk
 ---

 Changes in v2:
 - Rebase on dm/next

  configs/Linksprite_pcDuino3_defconfig |  7 +++
  configs/Linksprite_pcDuino3_fdt_defconfig | 15 ---
  2 files changed, 7 insertions(+), 15 deletions(-)
  delete mode 100644 configs/Linksprite_pcDuino3_fdt_defconfig

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


Re: [U-Boot] [PATCH v2 08/11] dm: net: Tidy up designware driver ready for driver model

2015-04-08 Thread Simon Glass
On 5 April 2015 at 16:07, Simon Glass s...@chromium.org wrote:
 Adjust the error handling to use errno.h instead of returning -1. Change
 leaf functions to pass in the arguments they require rather than struct
 eth_device. Apart from simplifying the code it makes is easier to reuse
 these functions for driver model, since mostly they actually only use
 struct dw_eth_priv (which we can keep).

 Create a stub for each Ethernet operation function. This will allow use to
 share code with the driver model versions.

 Signed-off-by: Simon Glass s...@chromium.org
 Acked-by: Joe Hershberger joe.hershber...@ni.com
 ---

 Changes in v2: None

  drivers/net/designware.c | 87 
 +---
  1 file changed, 53 insertions(+), 34 deletions(-)

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


Re: [U-Boot] [PATCH V3 4/4] dm: test: Add tests for get/find uclass devices

2015-04-08 Thread Simon Glass
On 8 April 2015 at 11:06, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This commit introduces simple tests for functions:
 - uclass_find_first_device()
 - uclass_find_next_device()
 - uclass_first_device()
 - uclass_next_device()

 Tests added by this commit:
 - Test: dm_test_uclass_devices_find:
   * call uclass_find_first_device(), then check if: (dev != NULL), (ret == 0)
   * for the rest devices, call uclass_find_next_device() and do the same check

 - Test: dm_test_uclass_devices_get:
   * call uclass_first_device(), then check if:
 -- (dev != NULL), (ret == 0), device_active()
   * for the rest devices, call uclass_next_device() and do the same check

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 Cc: Simon Glass s...@chromium.org

 Changes V3:
 - new commit
 ---
  test/dm/core.c | 34 +-
  1 file changed, 33 insertions(+), 1 deletion(-)

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

See below.


 diff --git a/test/dm/core.c b/test/dm/core.c
 index 009ad36..3a8dd1d 100644
 --- a/test/dm/core.c
 +++ b/test/dm/core.c
 @@ -656,9 +656,41 @@ static int dm_test_uclass_before_ready(struct 
 dm_test_state *dms)

 return 0;
  }
 -
  DM_TEST(dm_test_uclass_before_ready, 0);

 +static int dm_test_uclass_devices_find(struct dm_test_state *dms)
 +{
 +   struct udevice *dev;
 +   int ret;
 +
 +   for (ret = uclass_find_first_device(UCLASS_TEST, dev);
 +dev;
 +ret = uclass_find_next_device(dev)) {
 +   ut_assert(!ret);
 +   ut_assert(dev);

  ut_assert(!device_active(dev));

If you like I can add that when I apply.

 +   }
 +
 +   return 0;
 +}
 +DM_TEST(dm_test_uclass_devices_find, DM_TESTF_SCAN_PDATA);
 +
 +static int dm_test_uclass_devices_get(struct dm_test_state *dms)
 +{
 +   struct udevice *dev;
 +   int ret;
 +
 +   for (ret = uclass_first_device(UCLASS_TEST, dev);
 +dev;
 +ret = uclass_next_device(dev)) {
 +   ut_assert(!ret);
 +   ut_assert(dev);
 +   ut_assert(device_active(dev));
 +   }
 +
 +   return 0;
 +}
 +DM_TEST(dm_test_uclass_devices_get, DM_TESTF_SCAN_PDATA);
 +
  static int dm_test_device_get_uclass_id(struct dm_test_state *dms)
  {
 struct udevice *dev;
 --
 1.9.1


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


[U-Boot] [PATCH v2] omap3: pandora: use common configuration

2015-04-08 Thread Grazvydas Ignotas
This allows to clean up the config a good deal and also converts
pandora to Generic Board.

Signed-off-by: Grazvydas Ignotas nota...@gmail.com
---
v2: dropped unintended From: line.

 include/configs/omap3_pandora.h | 177 
 1 file changed, 36 insertions(+), 141 deletions(-)

diff --git a/include/configs/omap3_pandora.h b/include/configs/omap3_pandora.h
index 11d7b86..8d3531c 100644
--- a/include/configs/omap3_pandora.h
+++ b/include/configs/omap3_pandora.h
@@ -10,22 +10,13 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-/*
- * High Level Configuration Options
- */
-#define CONFIG_OMAP1   /* in a TI OMAP core */
-#define CONFIG_OMAP3_PANDORA   1   /* working with pandora */
-#define CONFIG_OMAP_GPIO
-#define CONFIG_OMAP_COMMON
-/* Common ARM Erratas */
-#define CONFIG_ARM_ERRATA_454179
-#define CONFIG_ARM_ERRATA_430973
-#define CONFIG_ARM_ERRATA_621766
+#define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
+#define CONFIG_NAND
 
-#define CONFIG_SDRC/* The chip has SDRC controller */
+/* override base for compatibility with MLO the device ships with */
+#define CONFIG_SYS_TEXT_BASE   0x80008000
 
-#include asm/arch/cpu.h  /* get chip and board defs */
-#include asm/arch/omap.h
+#include configs/ti_omap3_common.h
 
 /*
  * Display CPU and Board information
@@ -33,79 +24,42 @@
 #define CONFIG_DISPLAY_CPUINFO 1
 #define CONFIG_DISPLAY_BOARDINFO   1
 
-/* Clock Defines */
-#define V_OSCK 2600/* Clock output from T2 */
-#define V_SCLK (V_OSCK  1)
-
 #define CONFIG_MISC_INIT_R
-
-#define CONFIG_CMDLINE_TAG 1   /* enable passing of ATAGs */
-#define CONFIG_SETUP_MEMORY_TAGS   1
-#define CONFIG_INITRD_TAG  1
 #define CONFIG_REVISION_TAG1
 
-#define CONFIG_OF_LIBFDT   1
-
-/*
- * Size of malloc() pool
- */
 #define CONFIG_ENV_SIZE(128  10) /* 128 KiB */
-#define CONFIG_SYS_MALLOC_LEN  (1024 * 1024 + CONFIG_ENV_SIZE)
+
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV   1
+#define CONFIG_SYS_DEVICE_NULLDEV  1
 
 /*
  * Hardware drivers
  */
 
-#define CONFIG_SYS_CONSOLE_IS_IN_ENV   1
-#define CONFIG_SYS_DEVICE_NULLDEV  1
+/* I2C Support */
+#define CONFIG_SYS_I2C_OMAP34XX
 
-/* USB */
-#define CONFIG_MUSB_UDC1
-#define CONFIG_USB_OMAP3   1
-#define CONFIG_TWL4030_USB 1
+/* TWL4030 LED */
+#define CONFIG_TWL4030_LED
 
-/* USB device configuration */
-#define CONFIG_USB_DEVICE  1
-#define CONFIG_USB_TTY 1
+/* Initialize GPIOs by default */
+#define CONFIG_OMAP3_GPIO_4/* GPIO96..127 is in GPIO Bank 4 */
+#define CONFIG_OMAP3_GPIO_6/* GPIO160..191 is in GPIO Bank 6 */
 
 /*
  * NS16550 Configuration
  */
-#define V_NS16550_CLK  4800/* 48MHz (APLL96/2) */
-
-#define CONFIG_SYS_NS16550
+#undef CONFIG_OMAP_SERIAL
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE(-4)
 #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
-
-/*
- * select serial console configuration
- */
-#define CONFIG_CONS_INDEX  3
 #define CONFIG_SYS_NS16550_COM3OMAP34XX_UART3
 #define CONFIG_SERIAL3 3
 
-/* allow to overwrite serial and ethaddr */
-#define CONFIG_ENV_OVERWRITE
-#define CONFIG_BAUDRATE115200
-#define CONFIG_SYS_BAUDRATE_TABLE  {4800, 9600, 19200, 38400, 57600, \
-   115200}
-#define CONFIG_GENERIC_MMC 1
-#define CONFIG_MMC 1
-#define CONFIG_OMAP_HSMMC  1
-#define CONFIG_DOS_PARTITION   1
-
 /* commands to include */
 #include config_cmd_default.h
 
-#define CONFIG_CMD_EXT2/* EXT2 Support */
-#define CONFIG_CMD_FAT /* FAT support  */
-
-#define CONFIG_CMD_I2C /* I2C serial bus support   */
-#define CONFIG_CMD_MMC /* MMC support  */
-#define CONFIG_CMD_NAND/* NAND support */
 #define CONFIG_CMD_CACHE   /* Cache control*/
-
 #undef CONFIG_CMD_FLASH/* flinfo, erase, protect   */
 #undef CONFIG_CMD_FPGA /* FPGA configuration Support   */
 #undef CONFIG_CMD_IMI  /* iminfo   */
@@ -113,53 +67,36 @@
 #undef CONFIG_CMD_NET  /* bootp, tftpboot, rarpboot*/
 #undef CONFIG_CMD_NFS  /* NFS support  */
 
-#define CONFIG_SYS_NO_FLASH
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_OMAP24_I2C_SPEED10
-#define CONFIG_SYS_OMAP24_I2C_SLAVE1
-#define CONFIG_SYS_I2C_OMAP34XX
-
-/*
- * TWL4030
- */
-#define CONFIG_TWL4030_POWER   1
-#define CONFIG_TWL4030_LED 1
-
 /*
  * Board NAND Info.
  */
-#define CONFIG_NAND_OMAP_GPMC
 #define CONFIG_SYS_NAND_ADDR   NAND_BASE

Re: [U-Boot] [PATCH 10/14] sandbox: exynos: Move CONFIG_I2S to Kconfig

2015-04-08 Thread Simon Glass
On 6 March 2015 at 13:19, Simon Glass s...@chromium.org wrote:
 Move this over to Kconfig and tidy up.

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

  configs/arndale_defconfig   | 1 +
  configs/smdk5250_defconfig  | 1 +
  configs/snow_defconfig  | 1 +
  drivers/sound/Kconfig   | 9 +
  include/configs/exynos5250-common.h | 1 -
  5 files changed, 12 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH 14/14] sandbox: exynos: Move CONFIG_SOUND_SANDBOX to Kconfig

2015-04-08 Thread Simon Glass
On 6 March 2015 at 13:19, Simon Glass s...@chromium.org wrote:
 Move this over to Kconfig and tidy up.

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

  configs/sandbox_defconfig | 1 +
  drivers/sound/Kconfig | 9 +
  include/configs/sandbox.h | 2 --
  3 files changed, 10 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH 13/14] sandbox: exynos: Move CONFIG_SOUND_WM8994 to Kconfig

2015-04-08 Thread Simon Glass
On 6 March 2015 at 13:19, Simon Glass s...@chromium.org wrote:
 Move this over to Kconfig and tidy up.

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

  configs/snow_defconfig  | 1 +
  drivers/sound/Kconfig   | 8 
  include/configs/exynos5250-common.h | 5 -
  3 files changed, 9 insertions(+), 5 deletions(-)

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


Re: [U-Boot] [PATCH 04/14] sandbox: Move CONFIG_SYS_I2C_SANDBOX to Kconfig

2015-04-08 Thread Simon Glass
On 9 March 2015 at 01:28, Heiko Schocher h...@denx.de wrote:
 Hello Simon,

 Am 06.03.2015 21:19, schrieb Simon Glass:

 Move this over to Kconfig and tidy up.

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

   configs/sandbox_defconfig |  1 +
   drivers/i2c/Kconfig   | 30 ++
   include/configs/sandbox.h |  1 -
   3 files changed, 31 insertions(+), 1 deletion(-)


 Thanks!

 Acked-by: Heiko Schocherh...@denx.de

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


Re: [U-Boot] [PATCH 02/14] sandbox: Move CONFIG_SYS_VSNPRINTF to Kconfig

2015-04-08 Thread Simon Glass
On 6 March 2015 at 13:19, Simon Glass s...@chromium.org wrote:
 Move this over to Kconfig and tidy up.

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

  arch/x86/Kconfig | 3 +++
  configs/sandbox_defconfig| 1 +
  include/configs/sandbox.h| 2 --
  include/configs/x86-common.h | 1 -
  lib/Kconfig  | 9 +
  5 files changed, 13 insertions(+), 3 deletions(-)

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


Re: [U-Boot] [PATCH v3 3/3] usb: Early failure when the first descriptor read fails or is invalid

2015-04-08 Thread Paul Kocialkowski
Le mardi 07 avril 2015 à 23:41 -0600, Stephen Warren a écrit :
 On 04/07/2015 11:07 PM, Stephen Warren wrote:
  On 04/04/2015 07:12 AM, Paul Kocialkowski wrote:
  This may happen when using an USB1 device on a controller that only 
  supports
  USB2 (e.g. EHCI). Reading the first descriptor will fail (read 0 byte), so 
  we
  can abort the process at this point instead of failing later and wasting 
  time.
  
  FYI, this patch breaks USB keyboard (or perhaps any USB 1.x device)
  support on the RPi.

Damn, I'm really sorry about that, I wish I had had more hardware
available to test it thoroughly and that I had thought twice about it
and foresaw that issue. My sincerest apologies for that mistake and of
course, thanks for noticing and picking it up!

  diff --git a/common/usb.c b/common/usb.c
  
  @@ -956,7 +956,7 @@ int usb_new_device(struct usb_device *dev)
  */
   #ifndef CONFIG_USB_XHCI
 err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, 64);
  -  if (err  0) {
  +  if (err  sizeof(struct usb_device_descriptor)) {
 debug(usb_new_device: usb_get_descriptor() failed\n);
 return -EIO;
 }
  
  The value returned here is 8 not 18 (the sizeof the descriptor), so the
  code bails out with an error.

That makes sense on USB low speed devices.

  Given the description of what this patch is attempting to achieve,
  shouldn't the replacement check be:
  
  if (err = 0) {
  
  My guess for why the value 8 is returned is because the device's
  maxpacket is 8, and the DWC2 driver only attempts to transfer 1 packet
  because the requested transfer size is 64, and the default packet size
  is 64, which means 1 packet. Note that DWC2 HW (perhaps unlike e.g.
  EHCI) requires the driver to specify the number of packets transferred,
  not a byte count. However, I haven't validated that yet. My device is a
  USB 1.x FS keyboard.
 
 Yes, I can avoid the error by hacking dwc2.c's assignment of max:
 
  int chunk_msg(struct usb_device *dev, unsigned long pipe, int *pid, int in,
void *buffer, int len, bool ignore_ack)
  {
 ...
  int max = usb_maxpacket(dev, pipe);
 
 and forcing that to 8 rather than 64 for the data transfer phase of the
 first transaction to each USB device (my keyboard has a built-in hub, so
 I need to override a few different transactions).
 
 Thinking about the fix more, perhaps something like the following is
 appropriate:
 
 if (err  offsetof(struct usb_device_descriptor, idVendor))

I would be happy with using 8 directly since that's AFAIK the smallest
packet size that should be used on USB. Using offsetof, while not
requiring any hardcoded value, seems a bit unclean to me as it abstracts
that fact.

 ... since idVendor is the first field that's not used by the code that
 processes the results of the initial descriptor read. Hopefully there
 are no devices with a control endpoint bMaxPacketSize0 less than 8
 (which is what that offsetof evaluates to).
 http://www.usbmadesimple.co.uk/ums_3.htm seems to imply that's the case,
 saying for control transfers:

That makes sense, too.

 The max packet size for the data stage is 8 bytes at low speed, 8, 16,
 32 or 64 at full Speed and 64 for high speed.
 
 (although one of my keyboards has a maxPacket of 4 for EP 2, but I
 thinkt hat's something different)
 
 Also note the comment a little before the code this patch affects in
 U-Boot's common/usb.c:
 
  /* send 64-byte GET-DEVICE-DESCRIPTOR request.  Since the descriptor is
   * only 18 bytes long, this will terminate with a short packet.  But if
   * the maxpacket size is 8 or 16 the device may be waiting to transmit
   * some more, or keeps on retransmitting the 8 byte header. */



signature.asc
Description: This is a digitally signed message part
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] usb: fix first descriptor fetch error handling

2015-04-08 Thread Stephen Warren
When fetching the first descriptor from a new device, only validate that
we received at least 8 bytes, not that we received the entire descriptor.
The reasoning is:
- The code only uses fields in the first 8 bytes, so that's all we need
  to have fetched at this stage.
- The smallest maxpacket size is 8 bytes. Before we know the actual
  maxpacket the device uses, the USB controller may only accept a single
  packet (see the DWC2 note in the comment added in the commit).
  Consequently we are only guaranteed to receive 1 packet (at least 8
  bytes) even in a non-error case.

Fixes: 1a7758044b04 (usb: Early failure when the first descriptor read
fails or is invalid)
Cc: Paul Kocialkowski cont...@paulk.fr
Signed-off-by: Stephen Warren swar...@wwwdotorg.org
---
 common/usb.c | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/common/usb.c b/common/usb.c
index f6488475a7f2..bf76c4159341 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -956,7 +956,22 @@ int usb_new_device(struct usb_device *dev)
 */
 #ifndef CONFIG_USB_XHCI
err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, 64);
-   if (err  sizeof(struct usb_device_descriptor)) {
+   /*
+* Validate we've received only at least 8 bytes, not that we've
+* received the entire descriptor. The reasoning is:
+* - The code only uses fields in the first 8 bytes, so that's all we
+*   need to have fetched at this stage.
+* - The smallest maxpacket size is 8 bytes. Before we know the actual
+*   maxpacket the device uses, the USB controller may only accept a
+*   single packet. Consequently we are only guaranteed to receive 1
+*   packet (at least 8 bytes) even in a non-error case.
+*
+* At least the DWC2 controller needs to be programmed with the number
+* of packets in addition to the number of bytes. A request for 64
+* bytes of data with the maxpacket guessed as 64 (above) yields a
+* request for 1 packet.
+*/
+   if (err  8) {
debug(usb_new_device: usb_get_descriptor() failed\n);
return -EIO;
}
-- 
1.9.1

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


Re: [U-Boot] [PATCH] Kconfig: Move CONFIG_BOOTSTAGE to Kconfig

2015-04-08 Thread Simon Glass
On 2 March 2015 at 17:04, Simon Glass s...@chromium.org wrote:
 Move CONFIG_BOOT_STAGE and its associated options to Kconfig. Adjust
 existing users and code.

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

  README   |  49 
  arch/x86/Kconfig |   9 
  arch/x86/cpu/cpu.c   |   2 +-
  common/Kconfig   | 106 
 +++
  common/cmd_bootstage.c   |   7 +--
  configs/sandbox_defconfig|   1 +
  include/bootstage.h  |   2 +-
  include/configs/sandbox.h|   1 -
  include/configs/x86-common.h |   3 --
  9 files changed, 119 insertions(+), 61 deletions(-)

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


Re: [U-Boot] [PATCH v2 07/11] dm: net: Adjust PHY interface to work with CONFIG_DM_ETH

2015-04-08 Thread Simon Glass
On 5 April 2015 at 16:07, Simon Glass s...@chromium.org wrote:
 When driver model is used for Ethernet a few functions are passed a udevice
 instead of an eth_device. Also add a function to find a PHY type given its
 name. This will be used to decode the device tree node.

 Finally, put a phy_interface field in struct eth_pdata since this is an
 important part of the platform data for Ethernet.

 Signed-off-by: Simon Glass s...@chromium.org
 Acked-by: Joe Hershberger joe.hershber...@ni.com
 ---

 Changes in v2: None

  common/miiphyutil.c   |  1 +
  drivers/net/phy/phy.c | 22 ++
  include/net.h |  2 ++
  include/phy.h | 23 ++-
  4 files changed, 47 insertions(+), 1 deletion(-)

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


[U-Boot] [PATCH] omap3: pandora: use common configuration

2015-04-08 Thread Grazvydas Ignotas
From: notaz nota...@gmail.com

This allows to clean up the config a good deal and also converts
pandora to Generic Board.

Signed-off-by: Grazvydas Ignotas nota...@gmail.com
---
 include/configs/omap3_pandora.h | 177 
 1 file changed, 36 insertions(+), 141 deletions(-)

diff --git a/include/configs/omap3_pandora.h b/include/configs/omap3_pandora.h
index 11d7b86..8d3531c 100644
--- a/include/configs/omap3_pandora.h
+++ b/include/configs/omap3_pandora.h
@@ -10,22 +10,13 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-/*
- * High Level Configuration Options
- */
-#define CONFIG_OMAP1   /* in a TI OMAP core */
-#define CONFIG_OMAP3_PANDORA   1   /* working with pandora */
-#define CONFIG_OMAP_GPIO
-#define CONFIG_OMAP_COMMON
-/* Common ARM Erratas */
-#define CONFIG_ARM_ERRATA_454179
-#define CONFIG_ARM_ERRATA_430973
-#define CONFIG_ARM_ERRATA_621766
+#define CONFIG_NR_DRAM_BANKS   2   /* CS1 may or may not be populated */
+#define CONFIG_NAND
 
-#define CONFIG_SDRC/* The chip has SDRC controller */
+/* override base for compatibility with MLO the device ships with */
+#define CONFIG_SYS_TEXT_BASE   0x80008000
 
-#include asm/arch/cpu.h  /* get chip and board defs */
-#include asm/arch/omap.h
+#include configs/ti_omap3_common.h
 
 /*
  * Display CPU and Board information
@@ -33,79 +24,42 @@
 #define CONFIG_DISPLAY_CPUINFO 1
 #define CONFIG_DISPLAY_BOARDINFO   1
 
-/* Clock Defines */
-#define V_OSCK 2600/* Clock output from T2 */
-#define V_SCLK (V_OSCK  1)
-
 #define CONFIG_MISC_INIT_R
-
-#define CONFIG_CMDLINE_TAG 1   /* enable passing of ATAGs */
-#define CONFIG_SETUP_MEMORY_TAGS   1
-#define CONFIG_INITRD_TAG  1
 #define CONFIG_REVISION_TAG1
 
-#define CONFIG_OF_LIBFDT   1
-
-/*
- * Size of malloc() pool
- */
 #define CONFIG_ENV_SIZE(128  10) /* 128 KiB */
-#define CONFIG_SYS_MALLOC_LEN  (1024 * 1024 + CONFIG_ENV_SIZE)
+
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV   1
+#define CONFIG_SYS_DEVICE_NULLDEV  1
 
 /*
  * Hardware drivers
  */
 
-#define CONFIG_SYS_CONSOLE_IS_IN_ENV   1
-#define CONFIG_SYS_DEVICE_NULLDEV  1
+/* I2C Support */
+#define CONFIG_SYS_I2C_OMAP34XX
 
-/* USB */
-#define CONFIG_MUSB_UDC1
-#define CONFIG_USB_OMAP3   1
-#define CONFIG_TWL4030_USB 1
+/* TWL4030 LED */
+#define CONFIG_TWL4030_LED
 
-/* USB device configuration */
-#define CONFIG_USB_DEVICE  1
-#define CONFIG_USB_TTY 1
+/* Initialize GPIOs by default */
+#define CONFIG_OMAP3_GPIO_4/* GPIO96..127 is in GPIO Bank 4 */
+#define CONFIG_OMAP3_GPIO_6/* GPIO160..191 is in GPIO Bank 6 */
 
 /*
  * NS16550 Configuration
  */
-#define V_NS16550_CLK  4800/* 48MHz (APLL96/2) */
-
-#define CONFIG_SYS_NS16550
+#undef CONFIG_OMAP_SERIAL
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE(-4)
 #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
-
-/*
- * select serial console configuration
- */
-#define CONFIG_CONS_INDEX  3
 #define CONFIG_SYS_NS16550_COM3OMAP34XX_UART3
 #define CONFIG_SERIAL3 3
 
-/* allow to overwrite serial and ethaddr */
-#define CONFIG_ENV_OVERWRITE
-#define CONFIG_BAUDRATE115200
-#define CONFIG_SYS_BAUDRATE_TABLE  {4800, 9600, 19200, 38400, 57600, \
-   115200}
-#define CONFIG_GENERIC_MMC 1
-#define CONFIG_MMC 1
-#define CONFIG_OMAP_HSMMC  1
-#define CONFIG_DOS_PARTITION   1
-
 /* commands to include */
 #include config_cmd_default.h
 
-#define CONFIG_CMD_EXT2/* EXT2 Support */
-#define CONFIG_CMD_FAT /* FAT support  */
-
-#define CONFIG_CMD_I2C /* I2C serial bus support   */
-#define CONFIG_CMD_MMC /* MMC support  */
-#define CONFIG_CMD_NAND/* NAND support */
 #define CONFIG_CMD_CACHE   /* Cache control*/
-
 #undef CONFIG_CMD_FLASH/* flinfo, erase, protect   */
 #undef CONFIG_CMD_FPGA /* FPGA configuration Support   */
 #undef CONFIG_CMD_IMI  /* iminfo   */
@@ -113,53 +67,36 @@
 #undef CONFIG_CMD_NET  /* bootp, tftpboot, rarpboot*/
 #undef CONFIG_CMD_NFS  /* NFS support  */
 
-#define CONFIG_SYS_NO_FLASH
-#define CONFIG_SYS_I2C
-#define CONFIG_SYS_OMAP24_I2C_SPEED10
-#define CONFIG_SYS_OMAP24_I2C_SLAVE1
-#define CONFIG_SYS_I2C_OMAP34XX
-
-/*
- * TWL4030
- */
-#define CONFIG_TWL4030_POWER   1
-#define CONFIG_TWL4030_LED 1
-
 /*
  * Board NAND Info.
  */
-#define CONFIG_NAND_OMAP_GPMC
 #define CONFIG_SYS_NAND_ADDR   NAND_BASE   

Re: [U-Boot] [PATCH v2 06/11] Avoid calling print_eths() with driver model

2015-04-08 Thread Simon Glass
On 5 April 2015 at 16:07, Simon Glass s...@chromium.org wrote:
 This function is not supported with driver model.

 Signed-off-by: Simon Glass s...@chromium.org
 Acked-by: Joe Hershberger joe.hershber...@ni.com
 ---
 Note from Joe Hershberger joe.hershber...@ni.com

 At this point I don't see much value in listing the Ethernet devices in
 bdinfo. It seems like a bit of a spurious thing to display and as such I
 didn't feel like rewriting it to be compatible with DM or implementing the
 functions bdinfo's print_eths() uses.  Also, it is only supported on ARM
 and Microblaze. The inconsistency also led to my decision to drop it.

 Changes in v2: None

  common/cmd_bdinfo.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH v2 10/11] dm: sunxi: Support driver model for Ethernet

2015-04-08 Thread Simon Glass
On 5 April 2015 at 16:07, Simon Glass s...@chromium.org wrote:
 Adjust the Ethernet initialisation code to support driver model.
 It is no-longer necessary to call designware_initialize(). The device will
 be probed when it is used. The PHY type and GMAC base will come from the
 device tree.

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

 Changes in v2:
 - Remove unwanted printf()

  board/sunxi/gmac.c | 10 +++---
  1 file changed, 7 insertions(+), 3 deletions(-)

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


Re: [U-Boot] [PATCH v2 09/11] dm: net: Adjust designware driver to support driver model

2015-04-08 Thread Simon Glass
On 6 April 2015 at 15:09, Joe Hershberger joe.hershber...@gmail.com wrote:
 Hi Simon,

 On Sun, Apr 5, 2015 at 5:07 PM, Simon Glass s...@chromium.org wrote:

 Add driver model support to the designware driver. This reuses most of the
 existing code except for some duplication in the probe() method.

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

 Acked-by: Joe Hershberger joe.hershber...@ni.com

 Changes in v2:
 - Use the new recv() method and the free_pkt() method

  drivers/net/designware.c | 167
 ++-
  drivers/net/designware.h |   3 +-
  2 files changed, 153 insertions(+), 17 deletions(-)

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


Re: [U-Boot] [PATCH 05/14] sandbox: Move CONFIG_SANDBOX_SPI to Kconfig

2015-04-08 Thread Simon Glass
On 6 March 2015 at 13:19, Simon Glass s...@chromium.org wrote:
 Move this over to Kconfig and tidy up.

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

  configs/sandbox_defconfig |  1 +
  drivers/spi/Kconfig   | 25 +
  include/configs/sandbox.h |  1 -
  3 files changed, 26 insertions(+), 1 deletion(-)

I merged in the fix to the Kconfig which appears in the next patch. It
was in the wrong place.

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


Re: [U-Boot] [PATCH 01/14] sandbox: Move GPIO CONFIGs to Kconfig

2015-04-08 Thread Simon Glass
On 6 March 2015 at 13:19, Simon Glass s...@chromium.org wrote:
 Move these over to Kconfig and tidy up/

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

  configs/sandbox_defconfig |  1 +
  drivers/gpio/Kconfig  | 21 +
  include/configs/sandbox.h |  2 --
  3 files changed, 22 insertions(+), 2 deletions(-)

Changed / to . in the comment message.

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


[U-Boot] Testing u-boot-dm/next

2015-04-08 Thread Simon Glass
Hi,

I have quite a few patches queued up in the next branch of u-boot-dm, ready
for when the merge window options.

If anyone has time and can give it a spin on their board, it would be much
appreciated!

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


Re: [U-Boot] [PATCH V3 3/4] dm: test: Add tests for device's uclass platform data

2015-04-08 Thread Simon Glass
On 8 April 2015 at 11:06, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This test introduces new test structure type:dm_test_perdev_uc_pdata.
 The structure consists of three int values only. For the test purposes,
 three pattern values are defined by enum, starting with TEST_UC_PDATA_INTVAL1.

 This commit adds two test cases for uclass platform data:
 - Test: dm_test_autobind_uclass_pdata_alloc - this tests if:
   * uclass driver sets: .per_device_platdata_auto_alloc_size field
   * the devices's: dev-uclass_platdata is non-NULL

 - Test: dm_test_autobind_uclass_pdata_valid - this tests:
   * if the devices's: dev-uclass_platdata is non-NULL
   * the structure of type 'dm_test_perdev_uc_pdata' allocated at address
 pointed by dev-uclass_platdata. Each structure field, should be equal
 to proper pattern data, starting from .intval1 == TEST_UC_PDATA_INTVAL1.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 Cc: Simon Glass s...@chromium.org
 ---
 Changes V2:
 - update test functions with calls: uclass_find_first/next_device()

 Changes V3:
 - none
 ---
  include/dm/test.h | 20 +++
  test/dm/core.c| 55 
 +++
  test/dm/test-uclass.c | 11 +++
  3 files changed, 86 insertions(+)

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


Re: [U-Boot] [PATCH V3 1/4] dm: core: add internal functions for getting the device without probe

2015-04-08 Thread Simon Glass
On 8 April 2015 at 11:06, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This commit extends the uclass-internal functions by:
 - uclass_find_first_device()
 - uclass_find_next_device()
 For both functions, the returned device is not probed.

 After some cleanup, the above functions are called by:
 - uclass_first_device()
 - uclass_next_device()
 for which, the returned device is probed.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 Cc: Simon Glass s...@chromium.org
 ---
 Changes V2:
 - new commit

 Changes V3:
 - none
 ---
  drivers/core/uclass.c| 59 
 +---
  include/dm/uclass-internal.h | 22 +
  2 files changed, 56 insertions(+), 25 deletions(-)

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


Re: [U-Boot] [PATCH 11/14] sandbox: exynos: Move CONFIG_I2S_SAMSUNG to Kconfig

2015-04-08 Thread Simon Glass
On 6 March 2015 at 13:19, Simon Glass s...@chromium.org wrote:
 Move this over to Kconfig and tidy up.

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

  configs/arndale_defconfig   |  1 +
  configs/smdk5250_defconfig  |  1 +
  configs/snow_defconfig  |  1 +
  drivers/sound/Kconfig   | 10 ++
  include/configs/exynos5250-common.h |  1 -
  5 files changed, 13 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH 12/14] sandbox: exynos: Move CONFIG_SOUND_MAX98095 to Kconfig

2015-04-08 Thread Simon Glass
On 6 March 2015 at 13:19, Simon Glass s...@chromium.org wrote:
 Move this over to Kconfig and tidy up.

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

  configs/arndale_defconfig   | 1 +
  configs/smdk5250_defconfig  | 1 +
  drivers/sound/Kconfig   | 8 
  include/configs/exynos5250-common.h | 1 -
  4 files changed, 10 insertions(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH 08/14] sandbox: exynos: Move CONFIG_SOUND to Kconfig

2015-04-08 Thread Simon Glass
On 6 March 2015 at 13:19, Simon Glass s...@chromium.org wrote:
 Move this over to Kconfig and tidy up.

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

  configs/arndale_defconfig   |  1 +
  configs/sandbox_defconfig   |  1 +
  configs/smdk5250_defconfig  |  1 +
  configs/snow_defconfig  |  1 +
  drivers/sound/Kconfig   | 11 +++
  include/configs/exynos5250-common.h |  1 -
  include/configs/sandbox.h   |  1 -
  7 files changed, 15 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH 09/14] sandbox: exynos: Move CONFIG_CMD_SOUND to Kconfig

2015-04-08 Thread Simon Glass
On 6 March 2015 at 13:19, Simon Glass s...@chromium.org wrote:
 Move this over to Kconfig and tidy up.

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

  common/Kconfig  | 10 ++
  configs/arndale_defconfig   |  1 +
  configs/sandbox_defconfig   |  1 +
  configs/smdk5250_defconfig  |  1 +
  configs/snow_defconfig  |  1 +
  include/configs/exynos5250-common.h |  1 -
  include/configs/sandbox.h   |  1 -
  7 files changed, 14 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH] x86: minnowmax: add GPIO mapping support

2015-04-08 Thread gabriel huau

Hi Simon,

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

Hi Gabriel,

On 6 April 2015 at 00:10, Gabriel Huau cont...@huau-gabriel.fr wrote:

Hi Simon,


On 04/05/2015 11:31 AM, Simon Glass wrote:

Hi Gabriel,

On 1 April 2015 at 05:20, Gabriel Huau cont...@huau-gabriel.fr wrote:

Hi Simon,


On 03/31/2015 07:32 PM, Simon Glass wrote:

Hi Gabriel,

On 27 February 2015 at 01:52, Bin Meng bmeng...@gmail.com wrote:

Hi Gabriel,

On Fri, Feb 27, 2015 at 3:54 PM, gabriel huau cont...@huau-gabriel.fr
wrote:

Hi Bin,


On 02/26/2015 07:30 PM, Bin Meng wrote:

Hi Gabriel,

On Thu, Feb 26, 2015 at 12:27 AM, Gabriel Huau
cont...@huau-gabriel.fr
wrote:

Hi Bin,


On 02/24/2015 11:52 PM, Bin Meng wrote:

Hi Gabriel,

On Mon, Feb 16, 2015 at 5:55 AM, Gabriel Huau
cont...@huau-gabriel.fr
wrote:

Configure the pinctrl as it required to make some IO controllers
working (USB/UART/I2C/...).
The idea would be in the next version to modify the pch GPIO
driver
and
configure these pins through the device tree.

These modifications are ported from the coreboot project.

Signed-off-by: Gabriel Huau cont...@huau-gabriel.fr
---
  arch/x86/cpu/baytrail/Makefile|   1 +
  arch/x86/cpu/baytrail/gpio.c  | 206
+++
  arch/x86/include/asm/arch-baytrail/gpio.h | 364
++
  arch/x86/include/asm/arch-baytrail/iomap.h|  73 ++
  arch/x86/include/asm/arch-baytrail/irq.h  | 119 +
  arch/x86/include/asm/arch-baytrail/irqroute.h |  67 +
  arch/x86/include/asm/arch-baytrail/pci_devs.h | 144
++
  arch/x86/include/asm/arch-baytrail/pmc.h  | 253
++
  board/intel/minnowmax/minnowmax.c | 212
+++
  include/configs/minnowmax.h   |  11 +
  10 files changed, 1450 insertions(+)
  create mode 100644 arch/x86/cpu/baytrail/gpio.c
  create mode 100644 arch/x86/include/asm/arch-baytrail/iomap.h
  create mode 100644 arch/x86/include/asm/arch-baytrail/irq.h
  create mode 100644
arch/x86/include/asm/arch-baytrail/irqroute.h
  create mode 100644
arch/x86/include/asm/arch-baytrail/pci_devs.h
  create mode 100644 arch/x86/include/asm/arch-baytrail/pmc.h


[snip]


diff --git a/include/configs/minnowmax.h
b/include/configs/minnowmax.h
index 823e051..738c6fa 100644
--- a/include/configs/minnowmax.h
+++ b/include/configs/minnowmax.h
@@ -69,4 +69,15 @@
  /* Avoid a warning in the Realtek Ethernet driver */
  #define CONFIG_SYS_CACHELINE_SIZE 16

+/*
+ * Baytrail has 3 GPIOs bank over PCI, there is no
+ * driver at the moment so let's disable the command
+ * and the default x86 driver to avoid any collision
+ * with the GPIO mapping code.
+ * @TODO: adding a baytrail-gpio driver and configure
+ * the muxing through the device tree
+ */
+#undef CONFIG_INTEL_ICH6_GPIO
+#undef CONFIG_CMD_GPIO
+

Why undef these two? The BayTrail SoC does support GPIO banks in
the
legacy bridge.

I might misunderstood the GPIO subsystem but I thought there was 2
banks
available through the PCU iLB GPIO controller which contains the
SCORE
and
SSUS (102 / 44 pins).
The intel_ich6_gpio has a limitation of 32 GPIOs per bank and I
thought
it
was just a different controller from the Baytrail, but if I can use
it
to
control all the GPIOs + doing the IO mapping, I'll be glad to do it!

I checked the BayTrail datasheet. Its GPIO is in the iLB (legacy
bridge), which is the same as other IA chipset (Ivybridge,
TunnelCreek, Quark). It has 4 banks in core domain and 2 banks in sus
domain. So 6 banks in total. You need define 6 gpio nodes in the
minnowmax board dts file. You should be able to use the existing gpio
driver to configure.


Thanks for the clarification!
Actually, I saw it today when I was doing some tests and I configured
the 6
banks in the devices tree. I also fixed the GPIO base address to 0x48
but I
got some issues like the fact I'm reading only 0 from all the
registers.

Yep, the offset should be 0x48 for BayTrail.


The registers are configured to be in the IO Space (0x500), I checked
the
PCI configuration space to make sure that everything is enabled
correctly,
but I'm still missing something.

I checked the gpio driver codes, and it currently has:

   /*
* Okay, I guess we're looking at the right device. The
actual
* GPIO registers are in the PCI device's I/O space, starting
* at the offset that we just read. Bit 0 indicates that it's
* an I/O address, not a memory address, so mask that off.
*/
   gpiobase = tmplong  0xfffe;

This should be changed to

   gpiobase = tmplong  0xfffc;

as bit1 is the enable bit on BayTrail (Intel changes this GPIO base
register again for BayTrail, sigh...)


Once I'll be able to use these GPIOs, I will update the entire patch
to
remove the port from Coreboot as this is not necessary.


  #endif /* __CONFIG_H */
--

What is the next step 

Re: [U-Boot] [PATCH v2 11/11] dm: sunxi: Use driver model for Ethernet on Linksprite pcDuino3

2015-04-08 Thread Simon Glass
On 5 April 2015 at 16:07, Simon Glass s...@chromium.org wrote:
 Switch this board over to use driver model for Ethernet.

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

 Changes in v2:
 - Drop bugfix patches that were incorporated in the Ethernet dm conversion
 - Drop the CONFIG_BOOTP_VCI_STRING patch

  configs/Linksprite_pcDuino3_defconfig | 1 +
  1 file changed, 1 insertion(+)

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


Re: [U-Boot] [PATCH v2 03/11] dts: sunxi: Bring in Ethernet device tree bindings

2015-04-08 Thread Simon Glass
On 5 April 2015 at 16:07, Simon Glass s...@chromium.org wrote:
 Since we will use these bindings on sunxi, bring them in from Linux
 4.0-rc1.

 Signed-off-by: Simon Glass s...@chromium.org
 Acked-by: Ian Campbell i...@hellion.org.uk
 ---

 Changes in v2: None

  .../net/allwinner,sun4i-emac.txt   | 19 +++
  .../net/allwinner,sun4i-mdio.txt   | 27 ++
  .../net/allwinner,sun7i-a20-gmac.txt   | 27 ++
  doc/device-tree-bindings/net/ethernet.txt  | 25 +
  doc/device-tree-bindings/net/stmmac.txt| 63 
 ++
  5 files changed, 161 insertions(+)
  create mode 100644 doc/device-tree-bindings/net/allwinner,sun4i-emac.txt
  create mode 100644 doc/device-tree-bindings/net/allwinner,sun4i-mdio.txt
  create mode 100644 doc/device-tree-bindings/net/allwinner,sun7i-a20-gmac.txt
  create mode 100644 doc/device-tree-bindings/net/ethernet.txt
  create mode 100644 doc/device-tree-bindings/net/stmmac.txt

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


Re: [U-Boot] [PATCH v2 02/11] Kconfig: Move CONFIG_DESIGNWARE_ETH to Kconfig

2015-04-08 Thread Simon Glass
On 5 April 2015 at 16:07, Simon Glass s...@chromium.org wrote:
 Move this to Kconfig and clean up board config files that use it. Also
 rename it to CONFIG_ETH_DESIGNWARE to fit with the naming that exists
 in drivers/net/Kconfig.

 Signed-off-by: Simon Glass s...@chromium.org
 Version 1:
 Acked-by: Joe Hershberger joe.hershber...@ni.com

 ---

 Changes in v2:
 - Add Ethernet for Orangepi, galileo
 - Add Ethernet for Orangepi_mini, Wits_Pro_A20_DKT, Mele_I7
 - Rebase on dm/next

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


Re: [U-Boot] [PATCH v2 05/11] dm: net: Use existing Ethernet init for driver model

2015-04-08 Thread Simon Glass
On 5 April 2015 at 16:07, Simon Glass s...@chromium.org wrote:
 At present even with driver model is used there is still much manual init
 of related devices: PHY, environment and board init. Until these requirements
 are dealt with in another way we need to keep them around.

 Break out the init portion of the legacy eth_initialize() into a separate
 function and call it from both the legacy and driver model eth_initialize()
 functions.

 Signed-off-by: Simon Glass s...@chromium.org
 Acked-by: Joe Hershberger joe.hershber...@ni.com
 ---

 Changes in v2: None

  net/eth.c | 78 
 ++-
  1 file changed, 42 insertions(+), 36 deletions(-)

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


Re: [U-Boot] [PATCH v5 0/8] Extend LPC32xx functionality and add LPC32xx-based work_92015 board

2015-04-08 Thread Albert ARIBAUD
Hi Simon,

Le Tue, 7 Apr 2015 21:20:22 -0600, Simon Glass s...@chromium.org a
écrit :

 Well the problem is that we don't have driver model support in rtc, We
 do have an eeprom uclass, but it is currently implemented only for
 sandbox. We don't have a hwmon uclass (although there is thermal, and
 I wonder if that is similar?

No idea. :/

 I'd be willing to create an rtc uclass and convert over ds1374 if you
 are happy to test it?

I can test ds1374 right now, but that is not a hardware that I can keep.
I should be able to test eeprom on some other HW which I own.

 Regards,
 Simon

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


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

2015-04-08 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
---

Changes in v2: None

 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 v2 04/25] net: cosmetic: Name ethaddr variables consistently

2015-04-08 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
---

Changes in v2: None

 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, 

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

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

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

Changes in v2: None

 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 2bca7de..ea5b4f4 100644
--- a/net/link_local.c
+++ b/net/link_local.c
@@ -97,7 +97,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);
 }
@@ -138,7 +138,7 @@ static void link_local_timeout(void)
 
nprobes++;
debug_cond(DEBUG_LL_STATE, probe/%u %s@%pI4\n,
-   nprobes, eth_get_name(), ip);
+  nprobes, eth_get_name(), ip);
arp_raw_request(zero_ip, net_null_ethaddr, ip);
timeout_ms = PROBE_MIN * 1000;
timeout_ms += random_delay_ms(PROBE_MAX - PROBE_MIN);
@@ -147,7 +147,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;
}
@@ -159,7 +159,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;
@@ -170,7 +170,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 {
@@ -224,7 +224,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);
@@ -239,9 +239,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;
@@ -249,18 +248,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;
}
@@ -287,8 +285,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 conflict = 
+ 

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

2015-04-08 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
---

Changes in v2: None

 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 1deebf2..0270ac3 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 v2 08/25] net: cosmetic: Clean up ARP variables and functions

2015-04-08 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
---

Changes in v2: None

 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 6841b61..953f312 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);
+ 

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

2015-04-08 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
---

Changes in v2: None

 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 

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

2015-04-08 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
---

Changes in v2: None

 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 f740052..bb67884 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)
 {
  

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

2015-04-08 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
---

Changes in v2: None

 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 v2 25/25] sandbox: Enable more network features for sandbox

2015-04-08 Thread Joe Hershberger
More net features enabled and supported on sandbox to allow more testing

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

Changes in v2:
-New to series

 include/configs/sandbox.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index c49a847..a9ac106 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -130,6 +130,15 @@
 /* include default commands */
 #include config_cmd_default.h
 
+#define CONFIG_KEEP_SERVERADDR
+#define CONFIG_UDP_CHECKSUM
+#define CONFIG_CMD_LINK_LOCAL
+#define CONFIG_CMD_CDP
+#define CONFIG_CMD_DNS
+#define CONFIG_CMD_NFS
+#define CONFIG_CMD_SNTP
+#define CONFIG_TIMESTAMP
+#define CONFIG_CMD_RARP
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DHCP
 #define CONFIG_BOOTP_DNS
-- 
1.7.11.5

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


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

2015-04-08 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
---

Changes in v2: None

 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; 

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

2015-04-08 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
---

Changes in v2: None

 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 0270ac3..a672d77 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_server.s_addr) {
ip_to_string(net_ntp_server, 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);
 
 /* 

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

2015-04-08 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
---

Changes in v2:
-Fixed build failures in ip conversion patch

 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  |  27 ++
 net/net.c | 100 +++--
 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, 363 insertions(+), 337 deletions(-)

diff --git a/common/cmd_net.c b/common/cmd_net.c
index 3f52edc..53760a2 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_server.s_addr) {
+   ip_to_string(net_ntp_server, 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: 

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

2015-04-08 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
---

Changes in v2: None

 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)
 {

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

2015-04-08 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.

Changes in v2:
-Fixed build failures in ip conversion patch
-New to series

Joe Hershberger (23):
  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
  net: Fix compile errors when SNTP enabled and not DATE
  sandbox: Enable more network features for sandbox

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 

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

2015-04-08 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
---

Changes in v2: None

 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 1133f79..1395276 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 v2 21/25] net: cosmetic: Fix checkpatch.pl failures in net.c

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

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

Changes in v2: None

 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 a672d77..b2f3c7b 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, 

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

2015-04-08 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
---

Changes in v2: None

 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 

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

2015-04-08 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
---

Changes in v2: None

 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 53760a2..d75718c 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 

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

2015-04-08 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
---

Changes in v2: None

 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 5898260..b8acbb4 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 

[U-Boot] [PATCH v2 24/25] net: Fix compile errors when SNTP enabled and not DATE

2015-04-08 Thread Joe Hershberger
When SNTP is enabled and DATE is not, to_tm() is not built in. It could
be defined when TIMESTAMP is defined, so check for that.

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

Changes in v2:
-New to series

 net/sntp.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/sntp.c b/net/sntp.c
index d3427d8..6422eef 100644
--- a/net/sntp.c
+++ b/net/sntp.c
@@ -50,17 +50,20 @@ static void sntp_timeout_handler(void)
 static void sntp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
 unsigned src, unsigned len)
 {
+#ifdef CONFIG_TIMESTAMP
struct sntp_pkt_t *rpktp = (struct sntp_pkt_t *)pkt;
struct rtc_time tm;
ulong seconds;
+#endif
 
debug(%s\n, __func__);
 
if (dest != sntp_our_port)
return;
 
+#ifdef CONFIG_TIMESTAMP
/*
-* As the RTC's used in U-Boot sepport second resolution only
+* As the RTC's used in U-Boot support second resolution only
 * we simply ignore the sub-second field.
 */
memcpy(seconds, rpktp-transmit_timestamp, sizeof(ulong));
@@ -72,6 +75,7 @@ static void sntp_handler(uchar *pkt, unsigned dest, struct 
in_addr sip,
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);
+#endif
 
net_set_state(NETLOOP_SUCCESS);
 }
-- 
1.7.11.5

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


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

2015-04-08 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
---

Changes in v2: None

 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 87c4ed1..1deebf2 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? 

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

2015-04-08 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
---

Changes in v2: None

 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 6c23293..a159432 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 v2 03/25] net: cosmetic: Fixup var names for DHCP strings

2015-04-08 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
---

Changes in v2: None

 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 d75718c..87c4ed1 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;
}

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

2015-04-08 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
---

Changes in v2: None

 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;
 

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

2015-04-08 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
---

Changes in v2: None

 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


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

2015-04-08 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
---

Changes in v2: None

 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 bb67884..6c23293 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 f50d2fb..204e03c 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


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

2015-04-08 Thread Joe Hershberger
Hi Simon,

On Tue, Apr 7, 2015 at 8:26 PM, Simon Glass s...@chromium.org wrote:

 Hi Joe,

 On 3 April 2015 at 15:14, Joe Hershberger joe.hershber...@ni.com wrote:
  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
  ---

 I see the following breakage on this patch (my build is incomplete,
 but it looks like it is just one problem in cmd_net.c).

Oops... looks like a few errors as a result of the not having some of the
net features enabled on any of the boards I built.

I added most net features to sandbox to prevent such misses in the future.

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


Re: [U-Boot] [PATCH 3/3] ARM: omap3: remove non-generic boards

2015-04-08 Thread Anatolij Gustschin
Hi,

On Wed,  8 Apr 2015 18:15:55 +0900
Masahiro Yamada yamada.masah...@socionext.com wrote:

 Remove board support for sdp3430, pandora, dig297, mcx, and mvblx.

I'll submit a patch for mcx board, please do not remove it.

Thanks,

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


[U-Boot] [PATCH] mcx: update maintainer and convert to generic board

2015-04-08 Thread Anatolij Gustschin
Remove obsolete email address from MAINTAINERS.

Signed-off-by: Anatolij Gustschin ag...@denx.de
Cc: Masahiro Yamada yamada.masah...@socionext.com
Cc: Tom Rini tr...@konsulko.com

---
 board/htkw/mcx/MAINTAINERS |2 +-
 include/configs/mcx.h  |2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/board/htkw/mcx/MAINTAINERS b/board/htkw/mcx/MAINTAINERS
index c5f8873..513d19d 100644
--- a/board/htkw/mcx/MAINTAINERS
+++ b/board/htkw/mcx/MAINTAINERS
@@ -1,5 +1,5 @@
 MCX BOARD
-M: Ilya Yanok ya...@emcraft.com
+M: Anatolij Gustschin ag...@denx.de
 S: Maintained
 F: board/htkw/mcx/
 F: include/configs/mcx.h
diff --git a/include/configs/mcx.h b/include/configs/mcx.h
index 3fd3184..de7792a 100644
--- a/include/configs/mcx.h
+++ b/include/configs/mcx.h
@@ -25,6 +25,8 @@
 #define CONFIG_MACH_TYPE   MACH_TYPE_MCX
 #define CONFIG_BOARD_LATE_INIT
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 #define CONFIG_SYS_CACHELINE_SIZE  64
 
 #define CONFIG_EMIF4   /* The chip has EMIF4 controller */
-- 
1.7.9.5

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


Re: [U-Boot] printf(%d) breaks u-boot 2015.01+

2015-04-08 Thread Pavel Machek
Hi!

 maybe this helps? I just stepped into same problem on an am335x,
 but had not yet time to look deeper in it ...
 
 I did not try the cleanup_before_linux(), but dcache off should have
 same effect, right?
 
 Hmm.. not exactly... cleanup_before_linux() does also disable the mmu.

Seems like I found the reason. CONFIG_THUMB_BUILD was set, and 
that causes problems in put_dec_trunc() function (and elsewhere).

commit 1602a502985d42bafb58cc6862b469ac03a7d634
Author: Pavel pa...@ucw.cz
Date:   Wed Apr 8 14:08:18 2015 +0200

Disable thumb build; it breaks put_dec_trunc() function on toolchain
from eldk-5.6 and eldk-5.4, and some other place, too.

Signed-off-by: Pavel Machek pa...@denx.de

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 6d93472..6608d7d 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -11,7 +11,7 @@
 /* Virtual target or real hardware */
 #undef CONFIG_SOCFPGA_VIRTUAL_TARGET
 
-#define CONFIG_SYS_THUMB_BUILD
+#undef CONFIG_SYS_THUMB_BUILD
 
 #define CONFIG_SOCFPGA
 


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] ARM: zynq: disable CONFIG_SYS_MALLOC_F to fix MMC boot

2015-04-08 Thread Michal Simek
On 04/08/2015 07:25 AM, Masahiro Yamada wrote:
 Since commit 326a682358c1 (malloc_f: enable SYS_MALLOC_F by default
 if DM is on), Zynq MMC boot hangs up after printing the following:
 
 U-Boot SPL 2015.04-rc5-00053-gadcc570 (Apr 08 2015 - 12:59:11)
 mmc boot
 reading system.dtb
 
 Prior to commit 326a682358c1, Zynq boards enabled CONFIG_DM, but
 not CONFIG_SYS_MALLOC_F.  That commit forcibly turned on
 CONFIG_SYS_MALLOC_F.  I have not figured out the root cause, but
 anyway it looks like CONFIG_SYS_MALLOC_F gave a bad impact on the
 Zynq MMC boot.
 
 We are planning to have the v2015.04 release in a few days.
 I know this is a defensive fixup, but what I can do now is to add
# CONFIG_SYS_MALLOC_F is not set
 to every Zynq defconfig file to get back the original behavior.
 
 Tested on:
   - Zedboard
   - ZC706 board
 
 Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
 Cc: Michal Simek michal.si...@xilinx.com
 Cc: Simon Glass s...@chromium.org
 ---
 
 This problem is urgent!
 
 If we cannot find the better solution, please apply this patch
 by the v2015.04 release.
 ^^^

Tested-by: Michal Simek michal.si...@xilinx.com

Tom: Can you please add it to your tree?

Thanks,
Michal


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


Re: [U-Boot] [PATCH v4 0/2] ARM: mx5: add support for USB armory board

2015-04-08 Thread Stefano Babic
On 01/04/2015 13:32, Stefano Babic wrote:
 Hi Chris,
 
 On 01/04/2015 04:46, Chris Kuethe wrote:
 Any chance of this being accepted into 2015.04?

 

checpatch reports some issues by patch 2/2. Can you please fix them and
resubmit ? Thanks !

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
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-08 Thread Lukasz Majewski
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;
   }
  

Applied to u-boot-dfu branch.

Thanks!

-- 
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


[U-Boot] [PATCH] MAINTAINERS: fix TI DaVinci directory path and add KeyStone

2015-04-08 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
---

 MAINTAINERS | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 26780f4..26d0d27 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -151,10 +151,10 @@ ARM TI
 M: Tom Rini tr...@konsulko.com
 S: Maintained
 T: git git://git.denx.de/u-boot-ti.git
-F: arch/arm/cpu/arm926ejs/davinci/
+F: arch/arm/mach-davinci/
+F: arch/arm/mach-keystone/
 F: arch/arm/cpu/arm926ejs/omap/
 F: arch/arm/cpu/armv7/omap*/
-F: arch/arm/include/asm/arch-davinci/
 F: arch/arm/include/asm/arch-omap*/
 F: arch/arm/include/asm/ti-common/
 
-- 
1.9.1

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


Re: [U-Boot] [PATCH 3/3] ARM: omap3: remove non-generic boards

2015-04-08 Thread Masahiro Yamada
2015-04-08 20:33 GMT+09:00 Anatolij Gustschin ag...@denx.de:
 Hi,

 On Wed,  8 Apr 2015 18:15:55 +0900
 Masahiro Yamada yamada.masah...@socionext.com wrote:

 Remove board support for sdp3430, pandora, dig297, mcx, and mvblx.

 I'll submit a patch for mcx board, please do not remove it.


As requested by Anatolij and Grazvydas, I marked this patch as Deferred.



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


Re: [U-Boot] [PATCH v4 0/3] i2c: sunxi: Support every i2c controller on each supported platform

2015-04-08 Thread Hans de Goede

Hi,

On 08-04-15 13:05, Paul Kocialkowski wrote:

Actually, I'd prefer that you do not merge this since some ifdef logic
around controller 0 is still missing and mvtwsi code still assumes that
controller 0 will be defined. It may be the case that users wish to only
enable controller [1-4]. I think the Kconfig logic is also not necessary
and not a great addition to have since sunxi will be the sole user of it
(while other boards will keep using the option defined in the config
header). I'll work those issues out soon and provide a v5.

What do you think about all this?


I've not yet had a chance to take a look at your V4, but reducing
the amount of necessary conditionals sounds good, so go for it.

Regards,

Hans



Le mardi 07 avril 2015 à 22:19 +0200, Paul Kocialkowski a écrit :

Changes since v3:
* Kconfig support for MVTWSI
* Only enable twsi0 by default for platforms that always use it for the AXP
* Remove enabling other I2C busses by default on boards that expose them on pin
   headers since those might be used for some other functionalities

Changes since v2:
* I2C/TWI busses enable for Cubietruck as well

Changes since v1:
* Kconfig option to enable I2C/TWI controllers 1-4 (when applicable)
* Following patch to enable exposed busses on a few community-supported
   single-board-computers

This series adds support for every i2c controller found on
sun4i/sun5i/sun6i/sun7i/sun8i platforms and shouldn't break support for Marvell
platforms (orion5x, kirkwood, armada xp) the driver was originally written for.

Regarding sunxi, I double-checked that this doesn't conflict with
VIDEO_LCD_PANEL_I2C.

I would be interested in having this tested on sun8i (A23), since I changed TWI0
muxing (to PH2-PH3 instead of PB0-PB1), according to the user manual and what
is being done on the upstream Linux kernel. I2C was either not working before,
or it was being muxed correctly by the bootrom, probably to communicate with the
AXP, which luckily made it work in U-Boot too, since the I/O base address was
already correct.

My use case here is that I'm writing a slave-side bitbang i2c implementation
(with an Arduino) for a school project, using a Cubieboard2 as master and
U-Boot as POC. However, only TWI1 was available through the expansion pins,
hence the need for this series.

___
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


[U-Boot] [patch] armv7: better comment in start.S

2015-04-08 Thread Pavel Machek

Fix big/small letters in comment.

Signed-off-by: Pavel Machek pa...@denx.de

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 5ed0f45..1c7e6f0 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -22,10 +22,9 @@
  *
  * Startup Code (reset vector)
  *
- * do important init only if we don't start from memory!
- * setup Memory and board specific bits prior to relocation.
- * relocate armboot to ram
- * setup stack
+ * Do important init only if we don't start from memory!
+ * Setup memory and board specific bits prior to relocation.
+ * Relocate armboot to ram. Setup stack.
  *
  */
 


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] socfpga: missing DECLARE_GLOBAL_DATA_PTR in timer.c

2015-04-08 Thread Pavel Machek

for A in `find . -name *.c`; do if grep DECLARE_GLOBAL_DATA_PTR $A; then echo 
-n; else echo $A; fi; done

reveals a few files that probably should have DECLARE_GLOBAL_DATA_PTR.

This fixes it for arch/arm/cpu/armv7/socfpga/timer.c .

Signed-off-by: Pavel Machek pa...@denx.de

index 253cde3..2dd8376 100644
--- a/arch/arm/cpu/armv7/socfpga/timer.c
+++ b/arch/arm/cpu/armv7/socfpga/timer.c
@@ -8,6 +8,8 @@
 #include asm/io.h
 #include asm/arch/timer.h
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #define TIMER_LOAD_VAL 0x
 
 static const struct socfpga_timer *timer_base = (void *)CONFIG_SYS_TIMERBASE;

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/3] i2c: sunxi: Support every i2c controller on each supported platform

2015-04-08 Thread Paul Kocialkowski
Actually, I'd prefer that you do not merge this since some ifdef logic
around controller 0 is still missing and mvtwsi code still assumes that
controller 0 will be defined. It may be the case that users wish to only
enable controller [1-4]. I think the Kconfig logic is also not necessary
and not a great addition to have since sunxi will be the sole user of it
(while other boards will keep using the option defined in the config
header). I'll work those issues out soon and provide a v5.

What do you think about all this?

Le mardi 07 avril 2015 à 22:19 +0200, Paul Kocialkowski a écrit :
 Changes since v3:
 * Kconfig support for MVTWSI
 * Only enable twsi0 by default for platforms that always use it for the AXP
 * Remove enabling other I2C busses by default on boards that expose them on 
 pin
   headers since those might be used for some other functionalities
 
 Changes since v2:
 * I2C/TWI busses enable for Cubietruck as well
 
 Changes since v1:
 * Kconfig option to enable I2C/TWI controllers 1-4 (when applicable)
 * Following patch to enable exposed busses on a few community-supported
   single-board-computers
 
 This series adds support for every i2c controller found on
 sun4i/sun5i/sun6i/sun7i/sun8i platforms and shouldn't break support for 
 Marvell
 platforms (orion5x, kirkwood, armada xp) the driver was originally written 
 for.
 
 Regarding sunxi, I double-checked that this doesn't conflict with
 VIDEO_LCD_PANEL_I2C.
 
 I would be interested in having this tested on sun8i (A23), since I changed 
 TWI0
 muxing (to PH2-PH3 instead of PB0-PB1), according to the user manual and what
 is being done on the upstream Linux kernel. I2C was either not working before,
 or it was being muxed correctly by the bootrom, probably to communicate with 
 the
 AXP, which luckily made it work in U-Boot too, since the I/O base address was
 already correct.
 
 My use case here is that I'm writing a slave-side bitbang i2c implementation
 (with an Arduino) for a school project, using a Cubieboard2 as master and
 U-Boot as POC. However, only TWI1 was available through the expansion pins,
 hence the need for this series.
 
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot



signature.asc
Description: This is a digitally signed message part
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mx53loco: Disable printing cpuinfo

2015-04-08 Thread Stefano Babic
Hi Fabio,

On 08/04/2015 04:19, Fabio Estevam wrote:
 Tom/Stefano,
 
 On Tue, Apr 7, 2015 at 12:46 AM, hui@freescale.com

 Signed-off-by: Fabio Estevam fabio.este...@freescale.com

 Acked-by: Jason Liu r64...@freescale.com
 
 Can we have this one applied for 2015.04? It fixes some bogus boot logs.
 

I pick it up now.

Stefano


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/3] ARM: mx6: Fix errata workarounds for i.MX6

2015-04-08 Thread Stefano Babic
Hi Troy, Nitin,

On 07/04/2015 01:33, Troy Kisky wrote:
 On 4/6/2015 12:01 PM, nitin.g...@freescale.com wrote:
 From: Nitin Garg nitin.g...@freescale.com

 Since MX6 is Cortex-A9 r2p10, enable ARM errata
 751472, 794072, 761320 only applied to the
 following configuration:

 This erratum affects configurations with either:
   - One processor if the ACP is present
   - Two or more processors

 i.MX6 family does not have the ACP and thus only the MPCore
 system will be impacted, which are the i.MX6DQ, i.MX6DL.

 Signed-off-by: Nitin Garg nitin.g...@freescale.com
 ---

 Changes in v3:
 Split the patch as suggested by Fabio.

 Changes in v2: None

  include/configs/mx6_common.h |3 +++
  1 file changed, 3 insertions(+)

 diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
 index e0528ce..e22336e 100644
 --- a/include/configs/mx6_common.h
 +++ b/include/configs/mx6_common.h
 @@ -18,9 +18,12 @@
  #define __MX6_COMMON_H
  
  #define CONFIG_ARM_ERRATA_743622
 +#if (defined(CONFIG_MX6Q) || defined(CONFIG_MX6DL) ||\
 +defined(CONFIG_MX6QDL))  !defined(CONFIG_MX6S)
  #define CONFIG_ARM_ERRATA_751472
  #define CONFIG_ARM_ERRATA_794072
  #define CONFIG_ARM_ERRATA_761320
 +#endif
 
 
 
 We definitely want to allow 1 binary for CONFIG_MX6DL/ CONFIG_MX6S
 
 so perhaps this needs to be a runtime check ?
 

Indeed. If static options seem to work with most of SOC, this forbids
having single binary for MX6. We should use some quirk as in kernel to
provide SOC specific fixes.

I see that there is already a similar case for cp15, and there is a
_weak function for it:

void __weak v7_arch_cp15_set_acr(u32,..

and SOC can have there specialties there. Maybe you can add the fix as
weak function in ARM code, and then in arch/arm/cpu/armv7/mx6/soc.c you
can do the runtime check.

Best regards,
Stefano Babics


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/3] ARM: remove non-generic boards.

2015-04-08 Thread Masahiro Yamada

In spite of several times alerts, there are still many boards
left unconverted.

This series removes some of non-generic (=unmaitained) boards.

If there is a problem with this series, please speak up!



Masahiro Yamada (3):
  ARM: at91: remove non-generic boards
  ARM: davinci: remove non-generic boards
  ARM: omap3: remove non-generic boards

 arch/arm/cpu/armv7/omap3/Kconfig   |   21 -
 arch/arm/mach-at91/Kconfig |   15 -
 arch/arm/mach-at91/arm926ejs/at91sam9260_devices.c |2 +-
 arch/arm/mach-davinci/Kconfig  |   37 -
 arch/arm/mach-davinci/Makefile |5 -
 arch/arm/mach-davinci/cpu.c|   54 -
 arch/arm/mach-davinci/dm355.c  |   30 -
 arch/arm/mach-davinci/dm365.c  |   20 -
 arch/arm/mach-davinci/dm365_lowlevel.c |  460 
 arch/arm/mach-davinci/dm644x.c |   81 --
 arch/arm/mach-davinci/dm646x.c |   26 -
 arch/arm/mach-davinci/include/mach/aintc_defs.h|   36 -
 arch/arm/mach-davinci/include/mach/emac_defs.h |   25 +-
 arch/arm/mach-davinci/include/mach/gpio.h  |5 +-
 arch/arm/mach-davinci/include/mach/hardware.h  |   61 --
 arch/arm/mach-davinci/include/mach/psc_defs.h  |   70 --
 arch/arm/mach-davinci/include/mach/syscfg_defs.h   |   50 -
 arch/arm/mach-davinci/lowlevel_init.S  |  664 
 arch/arm/mach-davinci/psc.c|   63 --
 arch/arm/mach-davinci/spl.c|3 -
 board/afeb9260/Kconfig |9 -
 board/afeb9260/MAINTAINERS |6 -
 board/afeb9260/Makefile|   13 -
 board/afeb9260/afeb9260.c  |  159 ---
 board/afeb9260/config.mk   |1 -
 board/afeb9260/partition.c |   21 -
 board/ait/cam_enc_4xx/Kconfig  |   12 -
 board/ait/cam_enc_4xx/MAINTAINERS  |6 -
 board/ait/cam_enc_4xx/Makefile |   10 -
 board/ait/cam_enc_4xx/cam_enc_4xx.c| 1106 
 board/ait/cam_enc_4xx/config.mk|   20 -
 board/ait/cam_enc_4xx/u-boot-spl.lds   |   57 -
 board/ait/cam_enc_4xx/ublimage.cfg |   31 -
 board/calao/sbc35_a9g20/Kconfig|   12 -
 board/calao/sbc35_a9g20/MAINTAINERS|7 -
 board/calao/sbc35_a9g20/Makefile   |   13 -
 board/calao/sbc35_a9g20/config.mk  |1 -
 board/calao/sbc35_a9g20/sbc35_a9g20.c  |  155 ---
 board/calao/sbc35_a9g20/spi.c  |   41 -
 board/calao/tny_a9260/Kconfig  |   12 -
 board/calao/tny_a9260/MAINTAINERS  |9 -
 board/calao/tny_a9260/Makefile |   13 -
 board/calao/tny_a9260/config.mk|1 -
 board/calao/tny_a9260/spi.c|   34 -
 board/calao/tny_a9260/tny_a9260.c  |   85 --
 board/comelit/dig297/Kconfig   |   12 -
 board/comelit/dig297/MAINTAINERS   |6 -
 board/comelit/dig297/Makefile  |8 -
 board/comelit/dig297/dig297.c  |  182 
 board/comelit/dig297/dig297.h  |  367 ---
 board/davinci/dm355evm/Kconfig |   12 -
 board/davinci/dm355evm/MAINTAINERS |6 -
 board/davinci/dm355evm/Makefile|   10 -
 board/davinci/dm355evm/config.mk   |   11 -
 board/davinci/dm355evm/dm355evm.c  |  144 ---
 board/davinci/dm355leopard/Kconfig |   12 -
 board/davinci/dm355leopard/MAINTAINERS |6 -
 board/davinci/dm355leopard/Makefile|   10 -
 board/davinci/dm355leopard/config.mk   |6 -
 board/davinci/dm355leopard/dm355leopard.c  |   86 --
 board/davinci/dm365evm/Kconfig |   12 -
 board/davinci/dm365evm/MAINTAINERS |6 -
 board/davinci/dm365evm/Makefile|   10 -
 board/davinci/dm365evm/config.mk   |   11 -
 board/davinci/dm365evm/dm365evm.c  |  139 ---
 board/davinci/dm6467evm/Kconfig|   12 -
 board/davinci/dm6467evm/MAINTAINERS|7 -
 board/davinci/dm6467evm/Makefile   |   10 -
 board/davinci/dm6467evm/config.mk  |2 -
 board/davinci/dm6467evm/dm6467evm.c|   76 --
 board/davinci/dvevm/Kconfig|   12 -
 board/davinci/dvevm/MAINTAINERS|6 -
 board/davinci/dvevm/Makefile   |   11 -
 board/davinci/dvevm/board_init.S   |   16 -
 board/davinci/dvevm/config.mk  |   39 -
 

Re: [U-Boot] [PATCH v2 2/3] sunxi: Complete i2c support for each supported platform

2015-04-08 Thread Hans de Goede

Hi,

On 07-04-15 22:53, Simon Glass wrote:

Hi,

On 6 April 2015 at 02:43, Hans de Goede hdego...@redhat.com wrote:

Hi Simon and Paul,

On 05-04-15 22:56, Paul Kocialkowski wrote:


Le dimanche 05 avril 2015 à 12:31 -0600, Simon Glass a écrit :


Hi Paul,

On 4 April 2015 at 14:49, Paul Kocialkowski cont...@paulk.fr wrote:


Sunxi platforms come with at least 3 TWI (I2C) controllers and some
platforms
even have up to 5. This adds support for every controller on each
supported
platform, which is especially useful when using expansion ports on
single-board-
computers.

Signed-off-by: Paul Kocialkowski cont...@paulk.fr
---
   arch/arm/include/asm/arch-sunxi/cpu_sun4i.h |  7 +++
   arch/arm/include/asm/arch-sunxi/gpio.h  | 15 +-
   arch/arm/include/asm/arch-sunxi/i2c.h   | 13 +
   board/sunxi/Kconfig | 31 
   board/sunxi/board.c | 75
-
   5 files changed, 138 insertions(+), 3 deletions(-)



snip



diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index ccc2080..d3b5bad 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -269,6 +269,37 @@ config USB2_VBUS_PIN
  ---help---
  See USB1_VBUS_PIN help text.

+config I2C1_ENABLE
+   bool Enable I2C/TWI controller 1
+   default n
+   ---help---
+   This allows enabling I2C/TWI controller 1 by muxing its pins,
enabling
+   its clock and setting up the bus. This is especially useful on
devices
+   with slaves connected to the bus or with pins exposed through
e.g. an
+   expansion port/header.
+
+config I2C2_ENABLE
+   bool Enable I2C/TWI controller 2
+   default n
+   ---help---
+   See I2C1_ENABLE help text.
+
+if MACH_SUN6I || MACH_SUN7I
+config I2C3_ENABLE
+   bool Enable I2C/TWI controller 3
+   default n
+   ---help---
+   See I2C1_ENABLE help text.
+endif
+
+if MACH_SUN7I
+config I2C4_ENABLE
+   bool Enable I2C/TWI controller 4
+   default n
+   ---help---
+   See I2C1_ENABLE help text.
+endif



It seems wrong to me to add these when they are already in the device
tree for the board. Can we not use that?



Well, Hans has a point when saying that some users may use those pins as
GPIO while some others may use the TWI/I2C functions, so it makes sense
to make this configurable via Kconfig instead of being statically
defined.


If you would rather wait until we have driver model I2C on sunxi
(mvtwsi, I think) then I'd be happy to do the conversion. It's pretty
easy.



I would be happy to see U-Boot on sunxi use devicetree and driver model
for TWI/I2C as well (provided users can still configure what busses to
enable). Still, I'd like to see this getting merged as a short term
solution.


How can we get sunxi moved over before there is an explosion of these
sorts of things (as we have already seen with video options)?



I fully support moving sunxi over the devicemodel + devicetree in my
mind the following steps need to be taken:

0) Get the devicemode usb patches merged in to u-boot-dm/next
Then on top pf u-boot-dm/next:

1) Move all the sunxi boards over to use dm + dt like we're already
doing for the pcduino


This could be a bit tricky unless someone has all the boards. I
suppose if we do it at the very start of the merge window and then we
have time to fix any problems.


If you look at:
board/sunxi/MAINTAINERS

And then the large block at the top, that lists the 30+ boards I've,
or at least it lists all the boards for which I've added support to
upstream u-boot I still have a couple which I need to add ...

Anyways, I should be able to test this on say 2 boards of each soc
generation, which should shake out most (if not all) bugs. The limit
here is not hardware access but how much time I want to spend on
testing :)


2) Start using dm for usb on sunxi

3) Enable ohci support on sunxi boards next to ehci


That's not currently supported, but I could perhaps take a look at it.


Correct, but it is desirable so that plugging in a usb keyboard
directly (without a usb-2 hub between the board and the keyboard)
will work.


4) Move other stuff over on a step by step basis

Note that we will likely have a mix of Kconfig + devicetree for
quite a while though since certain things which we support in
u-boot are not supported in the kernel yet so they do not have
stable devicetree bindings yet, video being the big one here.


Yes that makes things tricky.




I think Hans will know better (than myself) how to do this right.



Not really, other then having the the generic outline above in my head,
I do not really have much experience with the devicemodel in u-boot yet,
also I do not have all that much time to work one this, so help on
this from you would certainly be very welcome. I can answer any sunxi
questions you may have, and I believe it is safe to say that Simon
can answer any device-model questions you may have.

Regards,

Hans

p.s.

Paul I'm 

Re: [U-Boot] Zynq board is boken

2015-04-08 Thread Michal Simek
Hi,

On 04/08/2015 07:14 AM, Masahiro Yamada wrote:
 Simon,
 
 Thanks for checking this.
 
 2015-04-08 12:25 GMT+09:00 Simon Glass s...@chromium.org:
 Hi Masahiro,

 On 7 April 2015 at 06:06, Masahiro Yamada yamada.masah...@socionext.com 
 wrote:
 Hi Michal,
 (cc Simon)

 Bad new.


 My Zedboard would not boot from MMC card with the U-Boot mainline.

 U-Boot hangs after printing reading system.dtb.
 I think, other zynq board types, too.

 I did git-bisect and the first bad commit is:

 commit 326a682358c16afcf2c7a9617e9811e72a1f0929
 Author: Masahiro Yamada yamada.masah...@socionext.com
 Date:   Thu Mar 19 19:42:55 2015 +0900

 malloc_f: enable SYS_MALLOC_F by default if DM is on



 Uh, sorry. My commit.


 The commit 36a6823 enables
 CONFIG_SYS_MALLOC_F=y
 CONFIG_SYS_MALLOC_F_LEN=0x400
 to the .config file.

 I suspect it changed how Zynq initializes malloc area in SPL.
 I have not figured out how to fix it.

 Any hint is appreciated.

 My guess is that CONFIG_SYS_SPL_MALLOC_START is defined, and they conflict.

 See common/spl/spl.c, board_init_r() where it decides which malloc()
 stack to init.

 The problem could be in dlmalloc.c:

 #ifdef CONFIG_SYS_MALLOC_F_LEN
 if (gd  !(gd-flags  GD_FLG_FULL_MALLOC_INIT))
 return malloc_simple(bytes);
 #endif

 But since the simple malloc() is not inited, this breaks.

 
 But, the GD_FLG_FULL_MALLOC_INIT flag has already been set by board_init_r().
 
 Dlmalloc should never fall back into malloc_simpile(), I think.

Is there enough space for malloc? just print address which you want to
use to make sure that all addresses are right.

Thanks,
Michal


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


[U-Boot] [PATCH 1/3] ARM: at91: remove non-generic boards

2015-04-08 Thread Masahiro Yamada
Remove board support for afeb9260, tny_a9260, and sbc35_a9g20.

They have not been converted into Generic Board yet.
See doc/README.generic-board for details.

Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
Cc: Sergey Lapin sla...@ossfans.org
Cc: Albin Tonnerre albin.tonne...@free-electrons.com
Cc: Andreas Bießmann andreas.de...@googlemail.com
---

 arch/arm/mach-at91/Kconfig |  15 --
 arch/arm/mach-at91/arm926ejs/at91sam9260_devices.c |   2 +-
 board/afeb9260/Kconfig |   9 --
 board/afeb9260/MAINTAINERS |   6 -
 board/afeb9260/Makefile|  13 --
 board/afeb9260/afeb9260.c  | 159 ---
 board/afeb9260/config.mk   |   1 -
 board/afeb9260/partition.c |  21 ---
 board/calao/sbc35_a9g20/Kconfig|  12 --
 board/calao/sbc35_a9g20/MAINTAINERS|   7 -
 board/calao/sbc35_a9g20/Makefile   |  13 --
 board/calao/sbc35_a9g20/config.mk  |   1 -
 board/calao/sbc35_a9g20/sbc35_a9g20.c  | 155 ---
 board/calao/sbc35_a9g20/spi.c  |  41 -
 board/calao/tny_a9260/Kconfig  |  12 --
 board/calao/tny_a9260/MAINTAINERS  |   9 --
 board/calao/tny_a9260/Makefile |  13 --
 board/calao/tny_a9260/config.mk|   1 -
 board/calao/tny_a9260/spi.c|  34 -
 board/calao/tny_a9260/tny_a9260.c  |  85 ---
 configs/afeb9260_defconfig |   3 -
 configs/sbc35_a9g20_eeprom_defconfig   |   4 -
 configs/sbc35_a9g20_nandflash_defconfig|   4 -
 configs/tny_a9260_eeprom_defconfig |   4 -
 configs/tny_a9260_nandflash_defconfig  |   4 -
 configs/tny_a9g20_eeprom_defconfig |   4 -
 configs/tny_a9g20_nandflash_defconfig  |   4 -
 doc/README.scrapyard   |  19 ++-
 include/configs/afeb9260.h | 156 ---
 include/configs/sbc35_a9g20.h  | 169 -
 include/configs/tny_a9260.h| 150 --
 31 files changed, 12 insertions(+), 1118 deletions(-)
 delete mode 100644 board/afeb9260/Kconfig
 delete mode 100644 board/afeb9260/MAINTAINERS
 delete mode 100644 board/afeb9260/Makefile
 delete mode 100644 board/afeb9260/afeb9260.c
 delete mode 100644 board/afeb9260/config.mk
 delete mode 100644 board/afeb9260/partition.c
 delete mode 100644 board/calao/sbc35_a9g20/Kconfig
 delete mode 100644 board/calao/sbc35_a9g20/MAINTAINERS
 delete mode 100644 board/calao/sbc35_a9g20/Makefile
 delete mode 100644 board/calao/sbc35_a9g20/config.mk
 delete mode 100644 board/calao/sbc35_a9g20/sbc35_a9g20.c
 delete mode 100644 board/calao/sbc35_a9g20/spi.c
 delete mode 100644 board/calao/tny_a9260/Kconfig
 delete mode 100644 board/calao/tny_a9260/MAINTAINERS
 delete mode 100644 board/calao/tny_a9260/Makefile
 delete mode 100644 board/calao/tny_a9260/config.mk
 delete mode 100644 board/calao/tny_a9260/spi.c
 delete mode 100644 board/calao/tny_a9260/tny_a9260.c
 delete mode 100644 configs/afeb9260_defconfig
 delete mode 100644 configs/sbc35_a9g20_eeprom_defconfig
 delete mode 100644 configs/sbc35_a9g20_nandflash_defconfig
 delete mode 100644 configs/tny_a9260_eeprom_defconfig
 delete mode 100644 configs/tny_a9260_nandflash_defconfig
 delete mode 100644 configs/tny_a9g20_eeprom_defconfig
 delete mode 100644 configs/tny_a9g20_nandflash_defconfig
 delete mode 100644 include/configs/afeb9260.h
 delete mode 100644 include/configs/sbc35_a9g20.h
 delete mode 100644 include/configs/tny_a9260.h

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 30c4e17..de3343f 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -23,18 +23,10 @@ config TARGET_ETHERNUT5
bool Ethernut5 board
select CPU_ARM926EJS
 
-config TARGET_TNY_A9260
-   bool Caloa TNY A9260 board
-   select CPU_ARM926EJS
-
 config TARGET_SNAPPER9260
bool Support snapper9260
select CPU_ARM926EJS
 
-config TARGET_AFEB9260
-   bool Support afeb9260
-   select CPU_ARM926EJS
-
 config TARGET_AT91SAM9261EK
bool Atmel at91sam9261 reference board
select CPU_ARM926EJS
@@ -55,10 +47,6 @@ config TARGET_PM9263
bool Ronetix pm9263 board
select CPU_ARM926EJS
 
-config TARGET_SBC35_A9G20
-   bool Support sbc35_a9g20
-   select CPU_ARM926EJS
-
 config TARGET_STAMP9G20
bool Support stamp9g20
select CPU_ARM926EJS
@@ -151,11 +139,8 @@ source board/atmel/sama5d4_xplained/Kconfig
 source board/atmel/sama5d4ek/Kconfig
 source board/BuS/eb_cpux9k2/Kconfig
 source board/eukrea/cpuat91/Kconfig
-source board/afeb9260/Kconfig
 source 

Re: [U-Boot] [PATCH] Fix mxc_hab documenation for DEK blob generation

2015-04-08 Thread Stefano Babic
On 27/03/2015 15:08, ulises.carde...@freescale.com wrote:
 From: Ulises Cardenas ulises.carde...@freescale.com
 
 Include/fsl_sec.h defines sec_in and sec_out, according to the
 platform's endianess. Therefore, CONFIG_SYS_FSL_LE needs to be
 declared in the configuration file of the target, in order to use
 enable the DEK blob generation command. This requirement is not
 explicit in the README.mxc_hab.
 
 Signed-off-by: Ulises Cardenas ulises.carde...@freescale.com
 ---
 
  doc/README.mxc_hab | 1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/doc/README.mxc_hab b/doc/README.mxc_hab
 index e9340dd..a1b1d34 100644
 --- a/doc/README.mxc_hab
 +++ b/doc/README.mxc_hab
 @@ -69,6 +69,7 @@ CONFIG_SECURE_BOOT
  CONFIG_SYS_FSL_SEC_COMPAT4 /* HAB version */
  CONFIG_FSL_CAAM
  CONFIG_CMD_DEKBLOB
 +CONFIG_SYS_FSL_LE

Applied to u-boot-imx master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mx53loco: Disable printing cpuinfo

2015-04-08 Thread Stefano Babic
On 06/04/2015 16:23, Fabio Estevam wrote:
 Since commit 32df39c741788e (mx5: fix get_reset_cause) we have the following
 boot messages on a mx53qsb:
 
 U-Boot 2015.04-rc5-00029-gd68df02 (Apr 06 2015 - 11:15:39)
   
   
   
 CPU:   Freescale i.MX53 rev2.1 at 800 MHz 
   
 Reset cause: POR  
   
 Board: MX53 LOCO  
   
 I2C:   ready  
   
 DRAM:  1 GiB  
   
 MMC:   FSL_SDHC: 0, FSL_SDHC: 1   
   
 In:serial 
   
 Out:   serial 
   
 Err:   serial 
   
 CPU:   Freescale i.MX53 rev2.1 at 1000 MHz
   
 Reset cause: unknown reset
   
 Net:   FEC [PRIME] 
 
 The CPU and Reset cause lines appear twice.
 
 Initially mx53 boots at 800MHz, then at a later point the PMIC is configured 
 via
 I2C to raise the CPU voltage so that it can run at 1GHz.
 
 To avoid such misleading double printings, disable printing cpu info for now. 
 
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 02/12] dm: select CONFIG_DM* options

2015-04-08 Thread Simon Glass
On 30 March 2015 at 21:47, Masahiro Yamada
yamada.masah...@socionext.com wrote:
 As mentioned in the previous commit, adding default values in each
 Kconfig causes problems because it does not co-exist with the
 depends on syntax.  (Please note this is not a bug of Kconfig.)
 We should not do so unless we have a special reason.  Actually,
 for CONFIG_DM*, we have no good reason to do so.

 Generally, CONFIG_DM is not a user-configurable option.  Once we
 convert a driver into Driver Model, the board only works with Driver
 Model, i.e. CONFIG_DM must be always enabled for that board.
 So, using select DM is more suitable rather than allowing users to
 modify it.  Another good thing is, Kconfig warns unmet dependencies
 for select syntax, so we easily notice bugs.

 Actually, CONFIG_DM and other related options have been added
 without consistency: some into arch/*/Kconfig, some into
 board/*/Kconfig, and some into configs/*_defconfig.

 This commit prefers select and cleans up the following issues.

 [1] Never use CONFIG_DM=n in defconfig files

 It is really rare to add CONFIG_FOO=n to disable CONFIG options.
 It is more common to use # CONFIG_FOO is not set.  But here, we
 do not even have to do it.
 Less than half of OMAP3 boards have been converted to Driver Model.
 Adding the default values to arch/arm/cpu/armv7/omap3/Kconfig is
 weird.  Instead, add select DM only to appropriate boards, which
 eventually eliminates CONFIG_DM=n, etc.

 [2] Delete redundant CONFIGs

 Sandbox sets CONFIG_DM in arch/sandbox/Kconfig and defines it again
 in configs/sandbox_defconfig.
 Likewise, OMAP3 sets CONFIG_DM arch/arm/cpu/armv7/omap3/Kconfig and
 defines it also in omap3_beagle_defconfig and devkit8000_defconfig.

 Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
 ---

  arch/Kconfig |  9 
  arch/arm/Kconfig | 35 
 
  arch/arm/cpu/armv7/exynos/Kconfig| 15 --
  arch/arm/cpu/armv7/omap3/Kconfig | 27 
  arch/arm/mach-bcm283x/Kconfig|  9 
  arch/arm/mach-tegra/Kconfig  | 18 
  arch/powerpc/cpu/ppc4xx/Kconfig  |  2 ++
  arch/sandbox/Kconfig | 18 
  arch/x86/Kconfig |  9 
  board/amcc/canyonlands/Kconfig   |  6 --
  board/compulab/cm_t335/Kconfig   |  9 
  board/gumstix/pepper/Kconfig |  9 
  board/isee/igep0033/Kconfig  |  9 
  board/phytec/pcm051/Kconfig  |  9 
  board/samsung/goni/Kconfig   |  9 
  board/samsung/smdkc100/Kconfig   |  9 
  board/silica/pengwyn/Kconfig |  9 
  board/ti/am335x/Kconfig  |  9 
  configs/am335x_boneblack_vboot_defconfig |  1 -
  configs/am3517_crane_defconfig   |  3 ---
  configs/am3517_evm_defconfig |  3 ---
  configs/cm_t3517_defconfig   |  3 ---
  configs/cm_t35_defconfig |  3 ---
  configs/devkit8000_defconfig |  3 ---
  configs/dig297_defconfig |  3 ---
  configs/eco5pk_defconfig |  3 ---
  configs/mcx_defconfig|  3 ---
  configs/mt_ventoux_defconfig |  3 ---
  configs/nokia_rx51_defconfig |  3 ---
  configs/omap3_beagle_defconfig   |  3 ---
  configs/omap3_evm_defconfig  |  3 ---
  configs/omap3_evm_quick_mmc_defconfig|  3 ---
  configs/omap3_evm_quick_nand_defconfig   |  3 ---
  configs/omap3_ha_defconfig   |  3 ---
  configs/omap3_logic_defconfig|  3 ---
  configs/omap3_mvblx_defconfig|  3 ---
  configs/omap3_pandora_defconfig  |  3 ---
  configs/omap3_sdp3430_defconfig  |  3 ---
  configs/sandbox_defconfig|  1 -
  configs/tao3530_defconfig|  3 ---
  configs/tricorder_defconfig  |  3 ---
  configs/tricorder_flash_defconfig|  3 ---
  configs/twister_defconfig|  3 ---
  43 files changed, 64 insertions(+), 227 deletions(-)

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


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

2015-04-08 Thread Przemyslaw Marczak

Hello Simon,

On 04/08/2015 03:47 AM, Simon Glass wrote:

Hi Przemyslaw,

On 7 April 2015 at 09:31, Przemyslaw Marczak p.marc...@samsung.com wrote:

Hello Simon,


On 04/05/2015 08:30 PM, Simon Glass wrote:


Hi Przemyslaw,

On 3 April 2015 at 10:09, Przemyslaw Marczak p.marc...@samsung.com
wrote:


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:



[snip]




+
+   info-min_uV = fdtdec_get_int(gd-fdt_blob, offset,
+ regulator-min-microvolt, -1);
+   if (info-min_uV  0)
+   return -ENXIO;
+
+   info-max_uV = fdtdec_get_int(gd-fdt_blob, offset,
+ regulator-max-microvolt, -1);
+   if (info-max_uV  0)
+   return -ENXIO;
+
+   /* Optional constraints */
+   info-min_uA = fdtdec_get_int(gd-fdt_blob, offset,
+ regulator-min-microamp, -1);
+   info-max_uA = fdtdec_get_int(gd-fdt_blob, offset,
+ regulator-max-microamp, -1);
+   info-always_on = fdtdec_get_bool(gd-fdt_blob, offset,
+regulator-always-on);
+   info-boot_on = fdtdec_get_bool(gd-fdt_blob, offset,
+regulator-boot-on);
+
+   return 0;
+}
+
+int regulator_get(char *name, struct udevice **devp)
+{
+   struct dm_regulator_info *info;
+   struct udevice *dev;
+   int ret;
+
+   *devp = NULL;
+
+   for (ret = uclass_first_device(UCLASS_REGULATOR, dev);
+dev;
+ret = uclass_next_device(dev)) {




This will probe all devices. See my suggestion about creating
uclass_find_first_device()/uclass_find_next_device() in the next
patch.

As before, I think this could use a function like
uclass_get_device_by_name().



Yes, this is the same. But in this case, there is one more  issue, which
is
the regulator device name.
Usually after bind - the dev-name is the same as node name. This is
good,
since it's natural that regulator IC, provides e.g ldo1, or some other
device-output name.
But we would like check the regulator-name property. For this
patch-set,
the name is fixed at device probe stage, when dev-ofdata_to_platdata()
is
called, and the regulator constraints, the same as it's name goes to
struct
dm_regulator_info.

I put the dm_regulator_info into uclass priv, because it it
uclass-specific,
the same as struct dm_i2c_bus is specific for i2c buses.

But, the ucalss priv is allocated at device probe stage.

I can't use the .per_child_platdata_auto_alloc_size, since the parent is
a
pmic, and its uclass type is different.

Actually I could, move the dm_regulator_info only to device platdata, but
then, the drivers should take care of this uclass-specific structure
allocation.
Is it acceptable?

But then, also ambiguous seem to be filling platdata (struct
dm_regulator_info) in uclass post_bind() method.

So then, maybe reasonable is:
- move dm_regulator_info from dev-uclass_priv to dev-platdata - is
allocated after device bind

- add .post_bind() method to regulator uclass, and get the
regulator-name
in it - only

- fill all platdata constraints on call to dev-ofdata_to_platdata()

Then, I could avoid probing every device, when checking the regulator
name.
But, still I can't use the uclass.c functions, since I'm checking the
regulator info at dev-platdata.

So I update the function as below:

+ uclass_foreach_dev(dev, uc) {
+   if (!dev-platdata)
+   continue;
+
+   info = dev-platdata;
+   if (!strcmp(name, info-name)) {
+   ret = device_probe(dev);
+   if (ret)
+  
+   *regulator = dev;
+   return ret;
+   }
+   }




The problem here is similar to I2C which uses per-child platdata
(specified by the uclass) for the bus address. This is different from
device platdata. I think you are suggesting that we should support
uclass platdata. In this case we would have for each device:

- device platform data
- parent platform data
- uclass platform data



Yes, but note, that the uclass type is the same for I2C bus and i2c chip.
This is a different than for the PMIC, for which childs uclass type are
usually different than for the parent.
In this case I can't use the field per-child-platdata.


The I2C bus uses UCLASS_I2C. The chips use a different UCLASS. If
there is no specific driver for the chip then we will use
UCLASS_I2C_GENERIC, but in general it could be anything. So perhaps
there is no difference here?

Per-child platdata works for I2C buses because its children are all
I2C chips, whatever their uclass.



Sorry, I wrote nonsense. I meant something different.
We could use per-child-platdata field for pmic uclass driver with the 
assumption, that each pmic's child's uclass is the same type (e.g. 
regulator). 

[U-Boot] [PATCH] ARM: zynq: Remove Jagan from list of maintainers

2015-04-08 Thread Michal Simek
Email address is not longer valid that's why remove it.

Signed-off-by: Michal Simek michal.si...@xilinx.com
---

 board/xilinx/zynq/MAINTAINERS |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/board/xilinx/zynq/MAINTAINERS b/board/xilinx/zynq/MAINTAINERS
index 382e921..e0dc4fe 100644
--- a/board/xilinx/zynq/MAINTAINERS
+++ b/board/xilinx/zynq/MAINTAINERS
@@ -1,6 +1,5 @@
 ZYNQ BOARD
 M: Michal Simek mon...@monstr.eu
-M: Jagannadha Sutradharudu Teki jaga...@xilinx.com
 S: Maintained
 F: board/xilinx/zynq/
 F: include/configs/zynq*.h
-- 
1.7.2.3

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


Re: [U-Boot] [PATCH v5 00/14] Add PSCI support for Jetson TK1/Tegra124 + CNTFRQ fix

2015-04-08 Thread Jan Kiszka
On 2015-03-19 16:02, Thierry Reding wrote:
 On Mon, Mar 09, 2015 at 08:00:10AM +0100, Jan Kiszka wrote:
 Changes in v4:
  - rebased over master
  - implemented psci_get_cpu_id as weak function
  - implemented psci_disable/enable_smp as weak functions
  - adjusted register interface of psci_get_cpu_stack_top

 This version (+ the non-cached memory init fix) can also be found at
 https://github.com/siemens/u-boot/tree/jetson-tk1-v5.

 Jan

 CC: Ian Campbell i...@hellion.org.uk
 CC: Marc Zyngier marc.zyng...@arm.com

 Ian Campbell (3):
   tegra124: Add more registers to struct mc_ctlr
   jetson-tk1: Add PSCI configuration options and reserve secure code
   tegra124: Reserve secure RAM using MC_SECURITY_CFG{0, 1}_0

 Jan Kiszka (11):
   sun7i: Remove duplicate call to psci_arch_init
   ARM: Factor out common psci_get_cpu_id
   ARM: Factor out reusable psci_cpu_off_common
   ARM: Factor out reusable psci_cpu_entry
   ARM: Factor out reusable psci_get_cpu_stack_top
   ARM: Put target PC for PSCI CPU_ON on per-CPU stack
   virt-dt: Allow reservation of secure region when in a RAM carveout
   tegra: Make tegra_powergate_power_on public
   tegra: Add ap_pm_init hook
   tegra124: Add PSCI support for Tegra124
   tegra: Set CNTFRQ for secondary CPUs

  arch/arm/cpu/armv7/psci.S   | 121 
 
  arch/arm/cpu/armv7/sunxi/psci.S | 112 -
  arch/arm/cpu/armv7/virt-dt.c|  29 +++
  arch/arm/cpu/armv7/virt-v7.c|   5 ++
  arch/arm/include/asm/arch-tegra/ap.h|   5 ++
  arch/arm/include/asm/arch-tegra/powergate.h |   1 +
  arch/arm/include/asm/arch-tegra124/flow.h   |   6 ++
  arch/arm/include/asm/arch-tegra124/mc.h |  35 +++-
  arch/arm/include/asm/armv7.h|   1 +
  arch/arm/include/asm/system.h   |   1 +
  arch/arm/lib/bootm-fdt.c|   5 ++
  arch/arm/mach-tegra/Makefile|   4 +
  arch/arm/mach-tegra/ap.c|  15 
  arch/arm/mach-tegra/powergate.c |   2 +-
  arch/arm/mach-tegra/psci.S  | 114 ++
  arch/arm/mach-tegra/tegra124/Kconfig|   2 +
  arch/arm/mach-tegra/tegra124/Makefile   |   4 +
  arch/arm/mach-tegra/tegra124/ap.c   |  55 +
  board/nvidia/common/board.c |   4 +
  include/configs/jetson-tk1.h|   5 ++
  20 files changed, 428 insertions(+), 98 deletions(-)
  create mode 100644 arch/arm/mach-tegra/psci.S
  create mode 100644 arch/arm/mach-tegra/tegra124/ap.c
 
 For the series:
 
 Reviewed-by: Thierry Reding tred...@nvidia.com
 Tested-by: Thierry Reding tred...@nvidia.com

Thanks for all feedback - what's next? Anything missing? Should I rebase
(didn't check yet if that is necessary) and resend?

Jan

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 00/14] Add PSCI support for Jetson TK1/Tegra124 + CNTFRQ fix

2015-04-08 Thread Tom Rini
On Wed, Apr 08, 2015 at 06:13:23PM +0200, Jan Kiszka wrote:
 On 2015-04-08 17:54, Tom Rini wrote:
  On Wed, Apr 08, 2015 at 04:12:21PM +0200, Jan Kiszka wrote:
  On 2015-04-08 16:02, Tom Rini wrote:
  On Wed, Apr 08, 2015 at 03:55:44PM +0200, Jan Kiszka wrote:
  On 2015-04-08 15:43, Tom Rini wrote:
  On Wed, Apr 08, 2015 at 10:37:40AM +0200, Jan Kiszka wrote:
  On 2015-03-19 16:02, Thierry Reding wrote:
  On Mon, Mar 09, 2015 at 08:00:10AM +0100, Jan Kiszka wrote:
  Changes in v4:
   - rebased over master
   - implemented psci_get_cpu_id as weak function
   - implemented psci_disable/enable_smp as weak functions
   - adjusted register interface of psci_get_cpu_stack_top
 
  This version (+ the non-cached memory init fix) can also be found at
  https://github.com/siemens/u-boot/tree/jetson-tk1-v5.
 
  Jan
 
  CC: Ian Campbell i...@hellion.org.uk
  CC: Marc Zyngier marc.zyng...@arm.com
 
  Ian Campbell (3):
tegra124: Add more registers to struct mc_ctlr
jetson-tk1: Add PSCI configuration options and reserve secure code
tegra124: Reserve secure RAM using MC_SECURITY_CFG{0, 1}_0
 
  Jan Kiszka (11):
sun7i: Remove duplicate call to psci_arch_init
ARM: Factor out common psci_get_cpu_id
ARM: Factor out reusable psci_cpu_off_common
ARM: Factor out reusable psci_cpu_entry
ARM: Factor out reusable psci_get_cpu_stack_top
ARM: Put target PC for PSCI CPU_ON on per-CPU stack
virt-dt: Allow reservation of secure region when in a RAM carveout
tegra: Make tegra_powergate_power_on public
tegra: Add ap_pm_init hook
tegra124: Add PSCI support for Tegra124
tegra: Set CNTFRQ for secondary CPUs
 
   arch/arm/cpu/armv7/psci.S   | 121 
  
   arch/arm/cpu/armv7/sunxi/psci.S | 112 
  -
   arch/arm/cpu/armv7/virt-dt.c|  29 +++
   arch/arm/cpu/armv7/virt-v7.c|   5 ++
   arch/arm/include/asm/arch-tegra/ap.h|   5 ++
   arch/arm/include/asm/arch-tegra/powergate.h |   1 +
   arch/arm/include/asm/arch-tegra124/flow.h   |   6 ++
   arch/arm/include/asm/arch-tegra124/mc.h |  35 +++-
   arch/arm/include/asm/armv7.h|   1 +
   arch/arm/include/asm/system.h   |   1 +
   arch/arm/lib/bootm-fdt.c|   5 ++
   arch/arm/mach-tegra/Makefile|   4 +
   arch/arm/mach-tegra/ap.c|  15 
   arch/arm/mach-tegra/powergate.c |   2 +-
   arch/arm/mach-tegra/psci.S  | 114 
  ++
   arch/arm/mach-tegra/tegra124/Kconfig|   2 +
   arch/arm/mach-tegra/tegra124/Makefile   |   4 +
   arch/arm/mach-tegra/tegra124/ap.c   |  55 +
   board/nvidia/common/board.c |   4 +
   include/configs/jetson-tk1.h|   5 ++
   20 files changed, 428 insertions(+), 98 deletions(-)
   create mode 100644 arch/arm/mach-tegra/psci.S
   create mode 100644 arch/arm/mach-tegra/tegra124/ap.c
 
  For the series:
 
  Reviewed-by: Thierry Reding tred...@nvidia.com
  Tested-by: Thierry Reding tred...@nvidia.com
 
  Thanks for all feedback - what's next? Anything missing? Should I 
  rebase
  (didn't check yet if that is necessary) and resend?
 
  Please rebase (it doesn't apply cleanly) and throw Reviewed/Tested-by's
  into the commit messages and then I'll apply, thanks!
 
 
  Base on master (there it applies fine but causes a trivial build
  warning) or some other tree?
 
  Applying: virt-dt: Allow reservation of secure region when in a RAM
  carveout
  Using index info to reconstruct a base tree...
  Falling back to patching base and 3-way merge...
  Auto-merging arch/arm/lib/bootm-fdt.c
  Auto-merging arch/arm/include/asm/armv7.h
  CONFLICT (content): Merge conflict in arch/arm/include/asm/armv7.h
  Auto-merging arch/arm/cpu/armv7/virt-dt.c
  CONFLICT (content): Merge conflict in arch/arm/cpu/armv7/virt-dt.c
  Recorded preimage for 'arch/arm/cpu/armv7/virt-dt.c'
  Recorded preimage for 'arch/arm/include/asm/armv7.h'
  Failed to merge in the changes.
  Patch failed at 0008 virt-dt: Allow reservation of secure region when in
  a RAM carveout
 
  Is what I saw trying to git am -3 the current series to top of tree
  master.
 
  adcc5705? Strange, doesn't happen here.
  
  Nope, 820ca15
 
 Then please don't forget to push that baseline eventually ;). Or is
 public git.denx.de updated only once a day or so? There used to be some
 delay in the past, IIRC.

Bah, 820ca15 wasn't public and was the first 7 parts of the series
applied, but same problem with git am on adcc5705 :)

-- 
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 v4 0/2] ARM: mx5: add support for USB armory board

2015-04-08 Thread Vagrant Cascadian
On 2015-04-08, Stefano Babic wrote:
 On 01/04/2015 13:32, Stefano Babic wrote:
 On 01/04/2015 04:46, Chris Kuethe wrote:
 Any chance of this being accepted into 2015.04?

 checpatch reports some issues by patch 2/2. Can you please fix them and
 resubmit ? Thanks !

Applying the patch below corrects most of the issues, but not all of the
reported issues:

Cleaned 2 patches
0 errors, 1 warnings, 0 checks for
0001-ARM-mx5-move-to-a-standard-arch-board-approach.patch:
warning: arch/arm/Kconfig,440: please write a paragraph that describes
the config symbol fully

0 errors, 1 warnings, 1 checks for
0002-ARM-mx5-add-support-for-USB-armory-board.patch:
check: board/inversepath/usbarmory/usbarmory.c,382: Alignment should
match open parenthesis
warning: include/configs/usbarmory.h,41: line over 80 characters

checkpatch.pl found 0 error(s), 2 warning(s), 1 checks(s)

diff --git a/board/inversepath/usbarmory/usbarmory.c 
b/board/inversepath/usbarmory/usbarmory.c
index 3e60a86..573d586 100644
--- a/board/inversepath/usbarmory/usbarmory.c
+++ b/board/inversepath/usbarmory/usbarmory.c
@@ -68,13 +68,13 @@ static void setup_iomux_sd(void)
NEW_PAD_CTRL(MX53_PAD_SD1_CMD__ESDHC1_CMD, SD_CMD_PAD_CTRL),
NEW_PAD_CTRL(MX53_PAD_SD1_CLK__ESDHC1_CLK, MX53_SDHC_PAD_CTRL),
NEW_PAD_CTRL(MX53_PAD_SD1_DATA0__ESDHC1_DAT0,
-   MX53_SDHC_PAD_CTRL),
+MX53_SDHC_PAD_CTRL),
NEW_PAD_CTRL(MX53_PAD_SD1_DATA1__ESDHC1_DAT1,
-   MX53_SDHC_PAD_CTRL),
+MX53_SDHC_PAD_CTRL),
NEW_PAD_CTRL(MX53_PAD_SD1_DATA2__ESDHC1_DAT2,
-   MX53_SDHC_PAD_CTRL),
+MX53_SDHC_PAD_CTRL),
NEW_PAD_CTRL(MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
-   MX53_SDHC_PAD_CTRL),
+MX53_SDHC_PAD_CTRL),
MX53_PAD_EIM_DA13__GPIO3_13,
};
 
@@ -85,7 +85,7 @@ static void setup_iomux_led(void)
 {
static const iomux_v3_cfg_t pads[] = {
NEW_PAD_CTRL(MX53_PAD_DISP0_DAT6__GPIO4_27,
-   PAD_CTL_PUS_100K_DOWN),
+PAD_CTL_PUS_100K_DOWN),
};
 
imx_iomux_v3_setup_multiple_pads(pads, ARRAY_SIZE(pads));
@@ -107,9 +107,9 @@ static void setup_iomux_pinheader(void)
NEW_PAD_CTRL(MX53_PAD_CSI0_DAT8__GPIO5_26, PAD_CTRL_UP),
NEW_PAD_CTRL(MX53_PAD_CSI0_DAT9__GPIO5_27, PAD_CTRL_UP),
NEW_PAD_CTRL(MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
-   MX53_UART_PAD_CTRL),
+MX53_UART_PAD_CTRL),
NEW_PAD_CTRL(MX53_PAD_CSI0_DAT11__UART1_RXD_MUX,
-   MX53_UART_PAD_CTRL),
+MX53_UART_PAD_CTRL),
NEW_PAD_CTRL(MX53_PAD_CSI0_DAT12__GPIO5_30, PAD_CTRL_UP),
};
 
@@ -119,7 +119,6 @@ static void setup_iomux_pinheader(void)
 static void setup_iomux_unused_boot(void)
 {
static const iomux_v3_cfg_t pads[] = {
-
/* Pulled-up pads */
NEW_PAD_CTRL(MX53_PAD_EIM_A21__GPIO2_17, PAD_CTRL_UP),
NEW_PAD_CTRL(MX53_PAD_EIM_DA0__GPIO3_0, PAD_CTRL_UP),
@@ -155,7 +154,6 @@ static void setup_iomux_unused_nc(void)
   ROM is executed so we force all the not connected pins
   to a known state */
static const iomux_v3_cfg_t pads[] = {
-
/* CONTROL PINS block */
NEW_PAD_CTRL(MX53_PAD_GPIO_0__GPIO1_0, PAD_CTRL_UP),
NEW_PAD_CTRL(MX53_PAD_GPIO_1__GPIO1_1, PAD_CTRL_UP),


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] KIRKWOOD - PARTITIONS and BOOTSTRAP

2015-04-08 Thread Tom Rini
On Wed, Apr 08, 2015 at 07:24:34AM +0200, drEagle wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256
 
 Hi,
 
 Le 07/04/2015 02:39, Tom Rini a écrit :
  On Sat, Apr 04, 2015 at 06:13:18PM +0200, drEagle wrote:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA256
 
  Le 03/04/2015 23:46, Vagrant Cascadian a écrit :
  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.
 
 ...
  I'll likely remove openrd_ultimate from future uploads to Debian if I
  can't get confirmation about how to fix this properly.
 
  The same may be a problem for SHEEVAPLUG and GURUPLUG, may be also all 
  KIRKWOOD derivatives.
  We need to get a more robust and compatible way to define the NAND PARTS, 
  the BOOTLOAD and the NAND UPGRADE.
  Each distribution has differents needs.
 
  It's a discution needed upstream because it ill impact all distribution 
  and users.
  
  It's possible that by removing some CONFIG options things can fit under
  the size limit and not require env to be moved.
 
 I do not agree with a stay in the past situation.
 I have proposed these refresh to help kirkwood plugs become useable.
 This is a platform that was looking promising and had also been not so user 
 frendly in the beginning.
 The features like the sheevaplug MMC/SD driver was a pain.
 UBOOT have greatly gain in a peace of software more robust that in was few 
 years ago.
 For Kirkwood Sheevaplugs we have also a device, SD cards, which was simply 
 unuseable.
 
 So I decided to get this driver upstream.
 
 So what now ?
 USB layer get fixed.
 IDE layer get fixed.
 UBIFS is a new standard.
 EXT4 support helpfull.
 DEVICETREE is needed for linux kernel support.
 
 What I proposed is to get a refresh for :
 - - The NAND partitions (with a possible study to be friendly with most 
 distributions around)
 - - To discuss about the better BOOTSTRAP method (I may used a script, 
 propose defaults ENV. We may need to boot from IDE, USB, NAND, NET, ...)
 
 It's an open discussion to get a friendly users, understand with the lesser 
 patch in each distribution, with the most possibility afford.
 
 I do not think that, all around customisation is the solution.

I am fine with whatever the general community of users for these parts
wants to do of course.  And more functionality being used is better for
everyone IMHO.  The only thing I would really make a hard suggestion on
is making sure that when growing the partitions to make sure it's got as
much room as feasible for future growth.

-- 
Tom


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


[U-Boot] [PATCH] odroid-XU3: update board maintainer

2015-04-08 Thread Przemyslaw Marczak
At present Hyungwon can't take care of this board in U-Boot,
so I will keep it working.

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Hyungwon Hwang human.hw...@samsung.com
---
 board/samsung/smdk5420/MAINTAINERS | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/board/samsung/smdk5420/MAINTAINERS 
b/board/samsung/smdk5420/MAINTAINERS
index 1423f83..a26ea68 100644
--- a/board/samsung/smdk5420/MAINTAINERS
+++ b/board/samsung/smdk5420/MAINTAINERS
@@ -8,3 +8,9 @@ F:  include/configs/smdk5420.h
 F: configs/smdk5420_defconfig
 F: include/configs/peach-pi.h
 F: configs/peach-pi_defconfig
+
+ODROID-XU3 BOARD
+M: Przemyslaw Marczak p.marc...@samsung.com
+S: Maintained
+F: board/samsung/smdk5420/
+F: include/configs/odroid_xu3.h
-- 
1.9.1

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


[U-Boot] [PATCH V2 3/3] dm: test: Add tests for device's uclass platform data

2015-04-08 Thread Przemyslaw Marczak
This test introduces new test structure type:dm_test_perdev_uc_pdata.
The structure consists of three int values only. For the test purposes,
three pattern values are defined by enum, starting with TEST_UC_PDATA_INTVAL1.

This commit adds two test cases for uclass platform data:
- Test: dm_test_autobind_uclass_pdata_alloc - this tests if:
  * uclass driver sets: .per_device_platdata_auto_alloc_size field
  * the devices's: dev-uclass_platdata is non-NULL

- Test: dm_test_autobind_uclass_pdata_valid - this tests:
  * if the devices's: dev-uclass_platdata is non-NULL
  * the structure of type 'dm_test_perdev_uc_pdata' allocated at address
pointed by dev-uclass_platdata. Each structure field, should be equal
to proper pattern data, starting from .intval1 == TEST_UC_PDATA_INTVAL1.

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Simon Glass s...@chromium.org
---
Changes V2:
- update test functions with calls: uclass_find_first/next_device()
---
 include/dm/test.h | 20 +++
 test/dm/core.c| 55 +++
 test/dm/test-uclass.c | 11 +++
 3 files changed, 86 insertions(+)

diff --git a/include/dm/test.h b/include/dm/test.h
index 9c4b8d3..f03fbcb 100644
--- a/include/dm/test.h
+++ b/include/dm/test.h
@@ -98,6 +98,26 @@ struct dm_test_parent_data {
int flag;
 };
 
+/* Test values for test device's uclass platform data */
+enum {
+   TEST_UC_PDATA_INTVAL1 = 2,
+   TEST_UC_PDATA_INTVAL2 = 334,
+   TEST_UC_PDATA_INTVAL3 = 789452,
+};
+
+/**
+ * struct dm_test_uclass_platda - uclass's information on each device
+ *
+ * @intval1: set to TEST_UC_PDATA_INTVAL1 in .post_bind method of test uclass
+ * @intval2: set to TEST_UC_PDATA_INTVAL2 in .post_bind method of test uclass
+ * @intval3: set to TEST_UC_PDATA_INTVAL3 in .post_bind method of test uclass
+ */
+struct dm_test_perdev_uc_pdata {
+   int intval1;
+   int intval2;
+   int intval3;
+};
+
 /*
  * Operation counts for the test driver, used to check that each method is
  * called correctly
diff --git a/test/dm/core.c b/test/dm/core.c
index 990d390..009ad36 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -129,6 +129,61 @@ static int dm_test_autobind(struct dm_test_state *dms)
 }
 DM_TEST(dm_test_autobind, 0);
 
+/* Test that binding with uclass platdata allocation occurs correctly */
+static int dm_test_autobind_uclass_pdata_alloc(struct dm_test_state *dms)
+{
+   struct dm_test_perdev_uc_pdata *uc_pdata;
+   struct udevice *dev;
+   struct uclass *uc;
+
+   ut_assertok(uclass_get(UCLASS_TEST, uc));
+   ut_assert(uc);
+
+   /**
+* Test if test uclass driver requires allocation for the uclass
+* platform data and then check the dev-uclass_platdata pointer.
+*/
+   ut_assert(uc-uc_drv-per_device_platdata_auto_alloc_size);
+
+   for (uclass_find_first_device(UCLASS_TEST, dev);
+dev;
+uclass_find_next_device(dev)) {
+   ut_assert(dev);
+
+   uc_pdata = dev_get_uclass_platdata(dev);
+   ut_assert(uc_pdata);
+   }
+
+   return 0;
+}
+DM_TEST(dm_test_autobind_uclass_pdata_alloc, DM_TESTF_SCAN_PDATA);
+
+/* Test that binding with uclass platdata setting occurs correctly */
+static int dm_test_autobind_uclass_pdata_valid(struct dm_test_state *dms)
+{
+   struct dm_test_perdev_uc_pdata *uc_pdata;
+   struct udevice *dev;
+
+   /**
+* In the test_postbind() method of test uclass driver, the uclass
+* platform data should be set to three test int values - test it.
+*/
+   for (uclass_find_first_device(UCLASS_TEST, dev);
+dev;
+uclass_find_next_device(dev)) {
+   ut_assert(dev);
+
+   uc_pdata = dev_get_uclass_platdata(dev);
+   ut_assert(uc_pdata);
+   ut_assert(uc_pdata-intval1 == TEST_UC_PDATA_INTVAL1);
+   ut_assert(uc_pdata-intval2 == TEST_UC_PDATA_INTVAL2);
+   ut_assert(uc_pdata-intval3 == TEST_UC_PDATA_INTVAL3);
+   }
+
+   return 0;
+}
+DM_TEST(dm_test_autobind_uclass_pdata_valid, DM_TESTF_SCAN_PDATA);
+
 /* Test that autoprobe finds all the expected devices */
 static int dm_test_autoprobe(struct dm_test_state *dms)
 {
diff --git a/test/dm/test-uclass.c b/test/dm/test-uclass.c
index 7cb37f7..4ae75ef 100644
--- a/test/dm/test-uclass.c
+++ b/test/dm/test-uclass.c
@@ -30,9 +30,18 @@ int test_ping(struct udevice *dev, int pingval, int *pingret)
 
 static int test_post_bind(struct udevice *dev)
 {
+   struct dm_test_perdev_uc_pdata *uc_pdata;
+
dm_testdrv_op_count[DM_TEST_OP_POST_BIND]++;
ut_assert(!device_active(dev));
 
+   uc_pdata = dev_get_uclass_platdata(dev);
+   ut_assert(uc_pdata);
+
+   uc_pdata-intval1 = TEST_UC_PDATA_INTVAL1;
+   uc_pdata-intval2 = TEST_UC_PDATA_INTVAL2;
+   uc_pdata-intval3 = TEST_UC_PDATA_INTVAL3;
+
return 

[U-Boot] [PATCH V2 2/3] dm: core: Extend struct udevice by '.uclass_platdata' field.

2015-04-08 Thread Przemyslaw Marczak
This commit adds 'uclass_platdata' field to 'struct udevice', which
can be automatically allocated at bind. The allocation size is defined
in 'struct uclass_driver' as 'per_device_platdata_auto_alloc_size'.

New device's flag is added: DM_FLAG_ALLOC_UCLASS_PDATA, which is used
for memory freeing at device unbind method.

As for other udevice's fields, a complementary function is added:
- dev_get_uclass_platdata()

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Simon Glass s...@chromium.org
---
Changes V2:
- none
---
 drivers/core/device-remove.c |  4 
 drivers/core/device.c| 33 +
 include/dm/device.h  | 17 -
 include/dm/uclass.h  |  4 
 4 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
index 7fee1c0..6a16b4f 100644
--- a/drivers/core/device-remove.c
+++ b/drivers/core/device-remove.c
@@ -92,6 +92,10 @@ int device_unbind(struct udevice *dev)
free(dev-platdata);
dev-platdata = NULL;
}
+   if (dev-flags  DM_FLAG_ALLOC_UCLASS_PDATA) {
+   free(dev-uclass_platdata);
+   dev-uclass_platdata = NULL;
+   }
if (dev-flags  DM_FLAG_ALLOC_PARENT_PDATA) {
free(dev-parent_platdata);
dev-parent_platdata = NULL;
diff --git a/drivers/core/device.c b/drivers/core/device.c
index ccaa99c..80eb55b 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -30,7 +30,7 @@ int device_bind(struct udevice *parent, const struct driver 
*drv,
 {
struct udevice *dev;
struct uclass *uc;
-   int ret = 0;
+   int size, ret = 0;
 
*devp = NULL;
if (!name)
@@ -79,9 +79,19 @@ int device_bind(struct udevice *parent, const struct driver 
*drv,
goto fail_alloc1;
}
}
-   if (parent) {
-   int size = parent-driver-per_child_platdata_auto_alloc_size;
 
+   size = uc-uc_drv-per_device_platdata_auto_alloc_size;
+   if (size) {
+   dev-flags |= DM_FLAG_ALLOC_UCLASS_PDATA;
+   dev-uclass_platdata = calloc(1, size);
+   if (!dev-uclass_platdata) {
+   ret = -ENOMEM;
+   goto fail_alloc2;
+   }
+   }
+
+   if (parent) {
+   size = parent-driver-per_child_platdata_auto_alloc_size;
if (!size) {
size = parent-uclass-uc_drv-
per_child_platdata_auto_alloc_size;
@@ -91,7 +101,7 @@ int device_bind(struct udevice *parent, const struct driver 
*drv,
dev-parent_platdata = calloc(1, size);
if (!dev-parent_platdata) {
ret = -ENOMEM;
-   goto fail_alloc2;
+   goto fail_alloc3;
}
}
}
@@ -139,6 +149,11 @@ fail_uclass_bind:
free(dev-parent_platdata);
dev-parent_platdata = NULL;
}
+fail_alloc3:
+   if (dev-flags  DM_FLAG_ALLOC_UCLASS_PDATA) {
+   free(dev-uclass_platdata);
+   dev-uclass_platdata = NULL;
+   }
 fail_alloc2:
if (dev-flags  DM_FLAG_ALLOC_PDATA) {
free(dev-platdata);
@@ -314,6 +329,16 @@ void *dev_get_parent_platdata(struct udevice *dev)
return dev-parent_platdata;
 }
 
+void *dev_get_uclass_platdata(struct udevice *dev)
+{
+   if (!dev) {
+   dm_warn(%s: null device, __func__);
+   return NULL;
+   }
+
+   return dev-uclass_platdata;
+}
+
 void *dev_get_priv(struct udevice *dev)
 {
if (!dev) {
diff --git a/include/dm/device.h b/include/dm/device.h
index c11342c..ad002fe 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -30,8 +30,11 @@ struct driver_info;
 /* DM is responsible for allocating and freeing parent_platdata */
 #define DM_FLAG_ALLOC_PARENT_PDATA (1  3)
 
+/* DM is responsible for allocating and freeing uclass_platdata */
+#define DM_FLAG_ALLOC_UCLASS_PDATA (1  4)
+
 /* Allocate driver private data on a DMA boundary */
-#define DM_FLAG_ALLOC_PRIV_DMA (1  4)
+#define DM_FLAG_ALLOC_PRIV_DMA (1  5)
 
 /**
  * struct udevice - An instance of a driver
@@ -54,6 +57,7 @@ struct driver_info;
  * @name: Name of device, typically the FDT node name
  * @platdata: Configuration data for this device
  * @parent_platdata: The parent bus's configuration data for this device
+ * @uclass_platdata: The uclass's configuration data for this device
  * @of_offset: Device tree node offset for this device (- for none)
  * @driver_data: Driver data word for the entry that matched this device with
  * its driver
@@ -75,6 +79,7 @@ struct udevice {
const char *name;
void *platdata;
void *parent_platdata;
+   

[U-Boot] [PATCH V2 0/3] dm: core: add device's uclass platform data and tests

2015-04-08 Thread Przemyslaw Marczak
The struct udevice provides two fields for device's platform data:
- .platdata- to keep platform-dependent data for the device driver
- .parent_platdata - to keep platform-dependent data for the device parent

Some implementations may need addidional platform data, which could be owned
by the uclass. For example, the regulator device's constraints.

This patchset adds the additional field:
- .uclass_platdata - to keep platform-dependend data for the uclass driver

Two tests are added to the test framework:
- one for check dev-uclass_platdata pointer
- second for validation the data assigned to by test uclass's post_bind() method

Change in V2:
- implementation of functions for getting the uclass's device without probe it
- cleanup test code

Przemyslaw Marczak (3):
  dm: core: add internal functions for getting the device without probe
  dm: core: Extend struct udevice by '.uclass_platdata' field.
  dm: test: Add tests for device's uclass platform data

 drivers/core/device-remove.c |  4 +++
 drivers/core/device.c| 33 ++---
 drivers/core/uclass.c| 59 +---
 include/dm/device.h  | 17 -
 include/dm/test.h| 20 +++
 include/dm/uclass-internal.h | 22 +
 include/dm/uclass.h  |  4 +++
 test/dm/core.c   | 55 +
 test/dm/test-uclass.c| 11 +
 9 files changed, 195 insertions(+), 30 deletions(-)

-- 
1.9.1

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


[U-Boot] [PATCH V2 1/3] dm: core: add internal functions for getting the device without probe

2015-04-08 Thread Przemyslaw Marczak
This commit extends the uclass-internal functions by:
- uclass_find_first_device()
- uclass_find_next_device()
For both functions, the returned device is not probed.

After some cleanup, the above functions are called by:
- uclass_first_device()
- uclass_next_device()
for which, the returned device is probed.

Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
Cc: Simon Glass s...@chromium.org
---
Changes V2:
- new commit
---
 drivers/core/uclass.c| 59 +---
 include/dm/uclass-internal.h | 22 +
 2 files changed, 56 insertions(+), 25 deletions(-)

diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 98c15e5..21ab0d5 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -156,6 +156,36 @@ int uclass_find_device(enum uclass_id id, int index, 
struct udevice **devp)
return -ENODEV;
 }
 
+int uclass_find_first_device(enum uclass_id id, struct udevice **devp)
+{
+   struct uclass *uc;
+   int ret;
+
+   *devp = NULL;
+   ret = uclass_get(id, uc);
+   if (ret)
+   return ret;
+   if (list_empty(uc-dev_head))
+   return 0;
+
+   *devp = list_first_entry(uc-dev_head, struct udevice, uclass_node);
+
+   return 0;
+}
+
+int uclass_find_next_device(struct udevice **devp)
+{
+   struct udevice *dev = *devp;
+
+   *devp = NULL;
+   if (list_is_last(dev-uclass_node, dev-uclass-dev_head))
+   return 0;
+
+   *devp = list_entry(dev-uclass_node.next, struct udevice, uclass_node);
+
+   return 0;
+}
+
 int uclass_find_device_by_seq(enum uclass_id id, int seq_or_req_seq,
  bool find_req_seq, struct udevice **devp)
 {
@@ -274,24 +304,12 @@ int uclass_get_device_by_of_offset(enum uclass_id id, int 
node,
 
 int uclass_first_device(enum uclass_id id, struct udevice **devp)
 {
-   struct uclass *uc;
struct udevice *dev;
int ret;
 
*devp = NULL;
-   ret = uclass_get(id, uc);
-   if (ret)
-   return ret;
-   if (list_empty(uc-dev_head))
-   return 0;
-
-   dev = list_first_entry(uc-dev_head, struct udevice, uclass_node);
-   ret = device_probe(dev);
-   if (ret)
-   return ret;
-   *devp = dev;
-
-   return 0;
+   ret = uclass_find_first_device(id, dev);
+   return uclass_get_device_tail(dev, ret, devp);
 }
 
 int uclass_next_device(struct udevice **devp)
@@ -300,17 +318,8 @@ int uclass_next_device(struct udevice **devp)
int ret;
 
*devp = NULL;
-   if (list_is_last(dev-uclass_node, dev-uclass-dev_head))
-   return 0;
-
-   dev = list_entry(dev-uclass_node.next, struct udevice,
-uclass_node);
-   ret = device_probe(dev);
-   if (ret)
-   return ret;
-   *devp = dev;
-
-   return 0;
+   ret = uclass_find_next_device(dev);
+   return uclass_get_device_tail(dev, ret, devp);
 }
 
 int uclass_bind_device(struct udevice *dev)
diff --git a/include/dm/uclass-internal.h b/include/dm/uclass-internal.h
index ae2a93d..befbae5 100644
--- a/include/dm/uclass-internal.h
+++ b/include/dm/uclass-internal.h
@@ -24,6 +24,28 @@
 int uclass_find_device(enum uclass_id id, int index, struct udevice **devp);
 
 /**
+ * uclass_find_first_device() - Return the first device in a uclass
+ * @id:Id number of the uclass
+ * #devp:  Returns pointer to device, or NULL on error
+ *
+ * The device is not prepared for use - this is an internal function
+ *
+ * @return 0 if OK (found or not found), -1 on error
+ */
+int uclass_find_first_device(enum uclass_id id, struct udevice **devp);
+
+/**
+ * uclass_find_next_device() - Return the next device in a uclass
+ * @devp: On entry, pointer to device to lookup. On exit, returns pointer
+ * to the next device in the same uclass, or NULL if none
+ *
+ * The device is not prepared for use - this is an internal function
+ *
+ * @return 0 if OK (found or not found), -1 on error
+ */
+int uclass_find_next_device(struct udevice **devp);
+
+/**
  * uclass_bind_device() - Associate device with a uclass
  *
  * Connect the device into uclass's list of devices.
-- 
1.9.1

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


Re: [U-Boot] [PATCH V2 1/3] dm: core: add internal functions for getting the device without probe

2015-04-08 Thread Simon Glass
Hi Przemyslaw,

On 8 April 2015 at 09:32, Przemyslaw Marczak p.marc...@samsung.com wrote:
 This commit extends the uclass-internal functions by:
 - uclass_find_first_device()
 - uclass_find_next_device()
 For both functions, the returned device is not probed.

 After some cleanup, the above functions are called by:
 - uclass_first_device()
 - uclass_next_device()
 for which, the returned device is probed.

 Signed-off-by: Przemyslaw Marczak p.marc...@samsung.com
 Cc: Simon Glass s...@chromium.org
 ---
 Changes V2:
 - new commit
 ---
  drivers/core/uclass.c| 59 
 +---
  include/dm/uclass-internal.h | 22 +
  2 files changed, 56 insertions(+), 25 deletions(-)


Looks good, can you add a test?

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


Re: [U-Boot] [PATCH v4 0/2] ARM: mx5: add support for USB armory board

2015-04-08 Thread Stefano Babic
Hi,

On 08/04/2015 17:37, Vagrant Cascadian wrote:
 On 2015-04-08, Stefano Babic wrote:
 On 01/04/2015 13:32, Stefano Babic wrote:
 On 01/04/2015 04:46, Chris Kuethe wrote:
 Any chance of this being accepted into 2015.04?

 checpatch reports some issues by patch 2/2. Can you please fix them and
 resubmit ? Thanks !
 
 Applying the patch below corrects most of the issues, but not all of the
 reported issues:
 
 Cleaned 2 patches
 0 errors, 1 warnings, 0 checks for
 0001-ARM-mx5-move-to-a-standard-arch-board-approach.patch:
 warning: arch/arm/Kconfig,440: please write a paragraph that describes
 the config symbol fully
 

This is not an issue. Patch 1/1 can be applied without changes.

 0 errors, 1 warnings, 1 checks for
 0002-ARM-mx5-add-support-for-USB-armory-board.patch:
 check: board/inversepath/usbarmory/usbarmory.c,382: Alignment should
 match open parenthesis
 warning: include/configs/usbarmory.h,41: line over 80 characters
 

Both of them must be fixed.

 checkpatch.pl found 0 error(s), 2 warning(s), 1 checks(s)
 
 diff --git a/board/inversepath/usbarmory/usbarmory.c 
 b/board/inversepath/usbarmory/usbarmory.c
 index 3e60a86..573d586 100644
 --- a/board/inversepath/usbarmory/usbarmory.c
 +++ b/board/inversepath/usbarmory/usbarmory.c
 @@ -68,13 +68,13 @@ static void setup_iomux_sd(void)
   NEW_PAD_CTRL(MX53_PAD_SD1_CMD__ESDHC1_CMD, SD_CMD_PAD_CTRL),
   NEW_PAD_CTRL(MX53_PAD_SD1_CLK__ESDHC1_CLK, MX53_SDHC_PAD_CTRL),
   NEW_PAD_CTRL(MX53_PAD_SD1_DATA0__ESDHC1_DAT0,
 - MX53_SDHC_PAD_CTRL),
 +  MX53_SDHC_PAD_CTRL),
   NEW_PAD_CTRL(MX53_PAD_SD1_DATA1__ESDHC1_DAT1,
 - MX53_SDHC_PAD_CTRL),
 +  MX53_SDHC_PAD_CTRL),
   NEW_PAD_CTRL(MX53_PAD_SD1_DATA2__ESDHC1_DAT2,
 - MX53_SDHC_PAD_CTRL),
 +  MX53_SDHC_PAD_CTRL),
   NEW_PAD_CTRL(MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
 - MX53_SDHC_PAD_CTRL),
 +  MX53_SDHC_PAD_CTRL),
   MX53_PAD_EIM_DA13__GPIO3_13,
   };
  
 @@ -85,7 +85,7 @@ static void setup_iomux_led(void)
  {
   static const iomux_v3_cfg_t pads[] = {
   NEW_PAD_CTRL(MX53_PAD_DISP0_DAT6__GPIO4_27,
 - PAD_CTL_PUS_100K_DOWN),
 +  PAD_CTL_PUS_100K_DOWN),
   };
  
   imx_iomux_v3_setup_multiple_pads(pads, ARRAY_SIZE(pads));
 @@ -107,9 +107,9 @@ static void setup_iomux_pinheader(void)
   NEW_PAD_CTRL(MX53_PAD_CSI0_DAT8__GPIO5_26, PAD_CTRL_UP),
   NEW_PAD_CTRL(MX53_PAD_CSI0_DAT9__GPIO5_27, PAD_CTRL_UP),
   NEW_PAD_CTRL(MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
 - MX53_UART_PAD_CTRL),
 +  MX53_UART_PAD_CTRL),
   NEW_PAD_CTRL(MX53_PAD_CSI0_DAT11__UART1_RXD_MUX,
 - MX53_UART_PAD_CTRL),
 +  MX53_UART_PAD_CTRL),
   NEW_PAD_CTRL(MX53_PAD_CSI0_DAT12__GPIO5_30, PAD_CTRL_UP),
   };
  
 @@ -119,7 +119,6 @@ static void setup_iomux_pinheader(void)
  static void setup_iomux_unused_boot(void)
  {
   static const iomux_v3_cfg_t pads[] = {
 -
   /* Pulled-up pads */
   NEW_PAD_CTRL(MX53_PAD_EIM_A21__GPIO2_17, PAD_CTRL_UP),
   NEW_PAD_CTRL(MX53_PAD_EIM_DA0__GPIO3_0, PAD_CTRL_UP),
 @@ -155,7 +154,6 @@ static void setup_iomux_unused_nc(void)
  ROM is executed so we force all the not connected pins
  to a known state */
   static const iomux_v3_cfg_t pads[] = {
 -
   /* CONTROL PINS block */
   NEW_PAD_CTRL(MX53_PAD_GPIO_0__GPIO1_0, PAD_CTRL_UP),
   NEW_PAD_CTRL(MX53_PAD_GPIO_1__GPIO1_1, PAD_CTRL_UP),
 
 

Ok, but I need that the patch is sent again (no following up patch) with
git send-email to avoid issues with the mailer.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] printf(%d) breaks u-boot 2015.01+

2015-04-08 Thread Tom Rini
On Wed, Apr 08, 2015 at 04:06:34PM +0200, Pavel Machek wrote:
 On Wed 2015-04-08 09:49:53, Tom Rini wrote:
  On Wed, Apr 08, 2015 at 02:09:57PM +0200, Pavel Machek wrote:
   Hi!
   
maybe this helps? I just stepped into same problem on an am335x,
but had not yet time to look deeper in it ...

I did not try the cleanup_before_linux(), but dcache off should have
same effect, right?

Hmm.. not exactly... cleanup_before_linux() does also disable the mmu.
   
   Seems like I found the reason. CONFIG_THUMB_BUILD was set, and 
   that causes problems in put_dec_trunc() function (and elsewhere).
   
   commit 1602a502985d42bafb58cc6862b469ac03a7d634
   Author: Pavel pa...@ucw.cz
   Date:   Wed Apr 8 14:08:18 2015 +0200
   
   Disable thumb build; it breaks put_dec_trunc() function on toolchain
   from eldk-5.6 and eldk-5.4, and some other place, too.
   
   Signed-off-by: Pavel Machek pa...@denx.de
   
   diff --git a/include/configs/socfpga_common.h 
   b/include/configs/socfpga_common.h
   index 6d93472..6608d7d 100644
   --- a/include/configs/socfpga_common.h
   +++ b/include/configs/socfpga_common.h
   @@ -11,7 +11,7 @@
/* Virtual target or real hardware */
#undef CONFIG_SOCFPGA_VIRTUAL_TARGET

   -#define CONFIG_SYS_THUMB_BUILD
   +#undef CONFIG_SYS_THUMB_BUILD

#define CONFIG_SOCFPGA
  
  OK, this is kind of scary.  What is wrong with those toolchains OR how
  we're telling them to build things as no, we should be able to use thumb
  mode just fine and need to for size reasons in various cases.
 
 Well.. it is scary, as put_dec_trunc() is very straightforward
 function. It works in 2014.10, even with thumb on.
 
  If this
  is a generic problem then for example, omap4_panda + ELDK 5.4/5.6 just
  shouldn't work either and we _must_ use thumb there for at least SPL.
 
 I don't know enough about thumb in u-boot. And yes, I'd like people to
 confirm if u-boot works for them on socfpga...

I'll fire up ELDK 5.4 + Pandaboard later today (which uses thumb) but I
think you need to bisect down to when exactly things break since my gut
is telling me it's not toolchain / thumb but something else that broke
things.

-- 
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] printf(%d) breaks u-boot 2015.01+

2015-04-08 Thread Pavel Machek
On Wed 2015-04-08 11:53:38, Tom Rini wrote:
 On Wed, Apr 08, 2015 at 04:06:34PM +0200, Pavel Machek wrote:
  On Wed 2015-04-08 09:49:53, Tom Rini wrote:
   On Wed, Apr 08, 2015 at 02:09:57PM +0200, Pavel Machek wrote:
Hi!

 maybe this helps? I just stepped into same problem on an am335x,
 but had not yet time to look deeper in it ...
 
 I did not try the cleanup_before_linux(), but dcache off should 
 have
 same effect, right?
 
 Hmm.. not exactly... cleanup_before_linux() does also disable the mmu.

Seems like I found the reason. CONFIG_THUMB_BUILD was set, and 
that causes problems in put_dec_trunc() function (and elsewhere).

commit 1602a502985d42bafb58cc6862b469ac03a7d634
Author: Pavel pa...@ucw.cz
Date:   Wed Apr 8 14:08:18 2015 +0200

Disable thumb build; it breaks put_dec_trunc() function on toolchain
from eldk-5.6 and eldk-5.4, and some other place, too.

Signed-off-by: Pavel Machek pa...@denx.de

diff --git a/include/configs/socfpga_common.h 
b/include/configs/socfpga_common.h
index 6d93472..6608d7d 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -11,7 +11,7 @@
 /* Virtual target or real hardware */
 #undef CONFIG_SOCFPGA_VIRTUAL_TARGET
 
-#define CONFIG_SYS_THUMB_BUILD
+#undef CONFIG_SYS_THUMB_BUILD
 
 #define CONFIG_SOCFPGA
   
   OK, this is kind of scary.  What is wrong with those toolchains OR how
   we're telling them to build things as no, we should be able to use thumb
   mode just fine and need to for size reasons in various cases.
  
  Well.. it is scary, as put_dec_trunc() is very straightforward
  function. It works in 2014.10, even with thumb on.
  
   If this
   is a generic problem then for example, omap4_panda + ELDK 5.4/5.6 just
   shouldn't work either and we _must_ use thumb there for at least SPL.
  
  I don't know enough about thumb in u-boot. And yes, I'd like people to
  confirm if u-boot works for them on socfpga...
 
 I'll fire up ELDK 5.4 + Pandaboard later today (which uses thumb) but I
 think you need to bisect down to when exactly things break since my gut
 is telling me it's not toolchain / thumb but something else that broke
 things.

Thanks.

Well, it broke between 2014.10 and 2015.01, so I think it should be
toolchain (because broken socfpga for 4 months... someone would
notice, no?).

Marek told me I should mention... I'm using USE_PRIVATE_LIBGCC because
compilation does not work without that.

Best regards,
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] printf(%d) breaks u-boot 2015.01+

2015-04-08 Thread Tom Rini
On Wed, Apr 08, 2015 at 11:53:38AM -0400, Tom Rini wrote:
 On Wed, Apr 08, 2015 at 04:06:34PM +0200, Pavel Machek wrote:
  On Wed 2015-04-08 09:49:53, Tom Rini wrote:
   On Wed, Apr 08, 2015 at 02:09:57PM +0200, Pavel Machek wrote:
Hi!

 maybe this helps? I just stepped into same problem on an am335x,
 but had not yet time to look deeper in it ...
 
 I did not try the cleanup_before_linux(), but dcache off should 
 have
 same effect, right?
 
 Hmm.. not exactly... cleanup_before_linux() does also disable the mmu.

Seems like I found the reason. CONFIG_THUMB_BUILD was set, and 
that causes problems in put_dec_trunc() function (and elsewhere).

commit 1602a502985d42bafb58cc6862b469ac03a7d634
Author: Pavel pa...@ucw.cz
Date:   Wed Apr 8 14:08:18 2015 +0200

Disable thumb build; it breaks put_dec_trunc() function on toolchain
from eldk-5.6 and eldk-5.4, and some other place, too.

Signed-off-by: Pavel Machek pa...@denx.de

diff --git a/include/configs/socfpga_common.h 
b/include/configs/socfpga_common.h
index 6d93472..6608d7d 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -11,7 +11,7 @@
 /* Virtual target or real hardware */
 #undef CONFIG_SOCFPGA_VIRTUAL_TARGET
 
-#define CONFIG_SYS_THUMB_BUILD
+#undef CONFIG_SYS_THUMB_BUILD
 
 #define CONFIG_SOCFPGA
   
   OK, this is kind of scary.  What is wrong with those toolchains OR how
   we're telling them to build things as no, we should be able to use thumb
   mode just fine and need to for size reasons in various cases.
  
  Well.. it is scary, as put_dec_trunc() is very straightforward
  function. It works in 2014.10, even with thumb on.
  
   If this
   is a generic problem then for example, omap4_panda + ELDK 5.4/5.6 just
   shouldn't work either and we _must_ use thumb there for at least SPL.
  
  I don't know enough about thumb in u-boot. And yes, I'd like people to
  confirm if u-boot works for them on socfpga...
 
 I'll fire up ELDK 5.4 + Pandaboard later today (which uses thumb) but I
 think you need to bisect down to when exactly things break since my gut
 is telling me it's not toolchain / thumb but something else that broke
 things.

Panda + ELDK 5.4, which sets CONFIG_SYS_THUMB_BUILD for both SPL and
U-Boot boots up fine on top of tree, cold boot tested even.

-- 
Tom


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


  1   2   3   >