Re: [U-Boot] [PATCH v2 11/12] RFC: Use binman for a sunxi board

2016-10-02 Thread Simon Glass
Hi Tom,

On 1 October 2016 at 18:46, Tom Rini  wrote:
> On Sat, Oct 01, 2016 at 06:29:42PM -0600, Simon Glass wrote:
>> Hi Tom,
>>
>> On 1 October 2016 at 18:15, Tom Rini  wrote:
>> > On Wed, Sep 28, 2016 at 09:46:25AM -0600, Simon Glass wrote:
>> >> Hi Tom,
>> >>
>> >> On 27 September 2016 at 19:55, Tom Rini  wrote:
>> >> > On Sun, Sep 25, 2016 at 03:52:27PM -0600, Simon Glass wrote:
>> >> >
>> >> >> Add an example usage of binman for a sunxi board. This involves adding 
>> >> >> the
>> >> >> image definition to the device tree and using it in the Makefile.
>> >> >>
>> >> >> This is for example only.
>> >> >>
>> >> >> Signed-off-by: Simon Glass 
>> >> >> ---
>> >> >>
>> >> >> Changes in v2: None
>> >> >>
>> >> >>  Makefile|  4 +---
>> >> >>  arch/arm/dts/sun7i-a20-pcduino3.dts | 12 
>> >> >
>> >> > I think this shows the big problem with using binman today.  For the
>> >> > common case of ARM, where we sync in the dts* files from upstream, this
>> >> > will add hunks that must not be overwritten each time.
>> >> >
>> >> > Looking at scripts/Makefile.lib::cmd_fdt I wonder if we couldn't come up
>> >> > with some wildcard rule and check if, somewhere CONFIG'd ? $(BOARDDIR)/
>> >> > ? u-boot.dtsi exists add in -include that/file.dtsi to the CPP rule so
>> >> > that we can keep the parts that will never get upstream separate.
>> >>
>> >> We can do that, but I have found that most boards with the same SoC
>> >> are the same, or similar. So for x86 [1] I put it in a separate patch
>> >> with just an #include in the .dts file.
>> >>
>> >> We could have binman be a bit smarter about where it looks - e.g. if
>> >> there is no binman node, it could look in the same directory for a
>> >> file that matches the board name, or part of it?
>> >
>> > I'd really like to try and better solve the generic problem we have tho
>> > too while we're at it.  ie the u-boot,dm-pre-reloc tag on various nodes
>> > could also go into this file.
>>
>> What sort of solution are you thinking of? A U-Boot .dtsi include that
>> is #included at the top of all files?
>
> Something like:
> ifneq ($(wildcard 
> $(srctree)/arch/$(CONFIG_SYS_ARCH)/cpu/$(CONFIG_SYS_CPU)/$(CONFIG_SYS_SOC)/u-boot.dtsi),)
> dtc_cpp_flags += -include
> $(srctree)/arch/$(CONFIG_SYS_ARCH)/cpu/$(CONFIG_SYS_CPU)/$(CONFIG_SYS_SOC)/u-boot.dtsi
> endif
>
> And maybe a few other wildcards, I'm not sure, so that for everything
> rockchip related, ie what binman needs, what nodes need to be pre-reloc,
> etc, can end up in that one file.  And we use -include to get it so that
> arch/arm/dts/ can be unmodified from upstream.

OK, I was worried that's what you might mean :-)

I'll take a look.

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


[U-Boot] [PATCH 09/12] dm: video: Add driver-model support to vesa graphics

2016-10-02 Thread Simon Glass
Provide a function to run the Vesa BIOS for a given PCI device and obtain
the resulting configuration (e.g. display size) for use by the video
uclass. This makes it easier to write a video driver that uses vesa and
supports driver model.

Signed-off-by: Simon Glass 
---

 drivers/pci/pci_rom.c | 55 +++
 include/vbe.h |  2 ++
 2 files changed, 57 insertions(+)

diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c
index 399055b..1805dac 100644
--- a/drivers/pci/pci_rom.c
+++ b/drivers/pci/pci_rom.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -348,3 +349,57 @@ err:
free(ram);
return ret;
 }
+
+#ifdef CONFIG_DM_VIDEO
+int vbe_setup_video_priv(struct vesa_mode_info *vesa,
+struct video_priv *uc_priv,
+struct video_uc_platdata *plat)
+{
+   if (!vesa->x_resolution)
+   return -ENXIO;
+   uc_priv->xsize = vesa->x_resolution;
+   uc_priv->ysize = vesa->y_resolution;
+   switch (vesa->bits_per_pixel) {
+   case 32:
+   case 24:
+   uc_priv->bpix = VIDEO_BPP32;
+   break;
+   case 16:
+   uc_priv->bpix = VIDEO_BPP16;
+   break;
+   default:
+   return -EPROTONOSUPPORT;
+   }
+   plat->base = vesa->phys_base_ptr;
+   plat->size = vesa->bytes_per_scanline * vesa->y_resolution;
+
+   return 0;
+}
+
+int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void))
+{
+   struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+   struct video_priv *uc_priv = dev_get_uclass_priv(dev);
+   int ret;
+
+   /* If we are running from EFI or coreboot, this can't work */
+   if (!ll_boot_init())
+   return -EPERM;
+   bootstage_start(BOOTSTAGE_ID_ACCUM_LCD, "vesa display");
+   ret = dm_pci_run_vga_bios(dev, int15_handler, PCI_ROM_USE_NATIVE |
+   PCI_ROM_ALLOW_FALLBACK);
+   bootstage_accum(BOOTSTAGE_ID_ACCUM_LCD);
+   if (ret) {
+   debug("failed to run video BIOS: %d\n", ret);
+   return ret;
+   }
+
+   ret = vbe_setup_video_priv(_info.vesa, uc_priv, plat);
+   if (ret) {
+   debug("No video mode configured\n");
+   return ret;
+   }
+
+   return 0;
+}
+#endif
diff --git a/include/vbe.h b/include/vbe.h
index 164ccae..a743892 100644
--- a/include/vbe.h
+++ b/include/vbe.h
@@ -106,5 +106,7 @@ extern struct vbe_mode_info mode_info;
 
 struct graphic_device;
 int vbe_get_video_info(struct graphic_device *gdev);
+struct video_priv;
+int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void));
 
 #endif
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 12/12] dm: x86: Move link to use driver model for video

2016-10-02 Thread Simon Glass
Update the configuration to use the new driver. Drop the existing plumbing
code and unused header files.

Signed-off-by: Simon Glass 
---

 arch/x86/cpu/ivybridge/Makefile   |   1 -
 arch/x86/cpu/ivybridge/bd82x6x.c  |  12 -
 arch/x86/cpu/ivybridge/early_me.c |   1 -
 arch/x86/cpu/ivybridge/gma.c  | 850 --
 arch/x86/cpu/ivybridge/gma.h  | 156 -
 arch/x86/cpu/ivybridge/model_206ax.c  |   1 -
 arch/x86/cpu/ivybridge/sata.c |   1 -
 arch/x86/include/asm/arch-ivybridge/bd82x6x.h |  12 -
 arch/x86/include/asm/cpu.h|   1 -
 configs/chromebook_link_defconfig |   2 +
 10 files changed, 2 insertions(+), 1035 deletions(-)
 delete mode 100644 arch/x86/cpu/ivybridge/gma.c
 delete mode 100644 arch/x86/cpu/ivybridge/gma.h
 delete mode 100644 arch/x86/include/asm/arch-ivybridge/bd82x6x.h

diff --git a/arch/x86/cpu/ivybridge/Makefile b/arch/x86/cpu/ivybridge/Makefile
index 9cdb07b..498e71a 100644
--- a/arch/x86/cpu/ivybridge/Makefile
+++ b/arch/x86/cpu/ivybridge/Makefile
@@ -9,7 +9,6 @@ obj-y += fsp_configs.o ivybridge.o
 else
 obj-y += cpu.o
 obj-y += early_me.o
-obj-y += gma.o
 obj-y += lpc.o
 obj-y += model_206ax.o
 obj-y += northbridge.o
diff --git a/arch/x86/cpu/ivybridge/bd82x6x.c b/arch/x86/cpu/ivybridge/bd82x6x.c
index 5b58d6c..e63ea6b 100644
--- a/arch/x86/cpu/ivybridge/bd82x6x.c
+++ b/arch/x86/cpu/ivybridge/bd82x6x.c
@@ -9,14 +9,12 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -155,22 +153,12 @@ void pch_iobp_update(struct udevice *dev, u32 address, 
u32 andvalue,
 
 static int bd82x6x_probe(struct udevice *dev)
 {
-   struct udevice *gma_dev;
-   int ret;
-
if (!(gd->flags & GD_FLG_RELOC))
return 0;
 
/* Cause the SATA device to do its init */
uclass_first_device(UCLASS_AHCI, );
 
-   ret = syscon_get_by_driver_data(X86_SYSCON_GMA, _dev);
-   if (ret)
-   return ret;
-   ret = gma_func0_init(gma_dev);
-   if (ret)
-   return ret;
-
return 0;
 }
 #endif /* CONFIG_HAVE_FSP */
diff --git a/arch/x86/cpu/ivybridge/early_me.c 
b/arch/x86/cpu/ivybridge/early_me.c
index cda96ab..5435a92 100644
--- a/arch/x86/cpu/ivybridge/early_me.c
+++ b/arch/x86/cpu/ivybridge/early_me.c
@@ -162,7 +162,6 @@ int intel_early_me_init_done(struct udevice *dev, struct 
udevice *me_dev,
 
 static const struct udevice_id ivybridge_syscon_ids[] = {
{ .compatible = "intel,me", .data = X86_SYSCON_ME },
-   { .compatible = "intel,gma", .data = X86_SYSCON_GMA },
{ }
 };
 
diff --git a/arch/x86/cpu/ivybridge/gma.c b/arch/x86/cpu/ivybridge/gma.c
deleted file mode 100644
index 37e2e6e..000
--- a/arch/x86/cpu/ivybridge/gma.c
+++ /dev/null
@@ -1,850 +0,0 @@
-/*
- * From Coreboot file of the same name
- *
- * Copyright (C) 2011 Chromium OS Authors
- *
- * SPDX-License-Identifier:GPL-2.0
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-struct gt_powermeter {
-   u16 reg;
-   u32 value;
-};
-
-static const struct gt_powermeter snb_pm_gt1[] = {
-   { 0xa200, 0xcc00 },
-   { 0xa204, 0x0740 },
-   { 0xa208, 0xfe00 },
-   { 0xa20c, 0x },
-   { 0xa210, 0x1700 },
-   { 0xa214, 0x0021 },
-   { 0xa218, 0x0817fe19 },
-   { 0xa21c, 0x },
-   { 0xa220, 0x },
-   { 0xa224, 0xcc00 },
-   { 0xa228, 0x0740 },
-   { 0xa22c, 0xfe00 },
-   { 0xa230, 0x },
-   { 0xa234, 0x1700 },
-   { 0xa238, 0x0021 },
-   { 0xa23c, 0x0817fe19 },
-   { 0xa240, 0x },
-   { 0xa244, 0x },
-   { 0xa248, 0x8000421e },
-   { 0 }
-};
-
-static const struct gt_powermeter snb_pm_gt2[] = {
-   { 0xa200, 0x33a6 },
-   { 0xa204, 0x402d0031 },
-   { 0xa208, 0x00165f83 },
-   { 0xa20c, 0xf100 },
-   { 0xa210, 0x },
-   { 0xa214, 0x00160016 },
-   { 0xa218, 0x002a002b },
-   { 0xa21c, 0x },
-   { 0xa220, 0x },
-   { 0xa224, 0x33a6 },
-   { 0xa228, 0x402d0031 },
-   { 0xa22c, 0x00165f83 },
-   { 0xa230, 0xf100 },
-   { 0xa234, 0x },
-   { 0xa238, 0x00160016 },
-   { 0xa23c, 0x002a002b },
-   { 0xa240, 0x },
-   { 0xa244, 0x },
-   { 0xa248, 0x8000421e },
-   { 0 }
-};
-
-static const struct gt_powermeter ivb_pm_gt1[] = {
-   { 0xa800, 0x },
-   { 0xa804, 0x00021c00 },
-   { 0xa808, 0x0403 },
-   { 0xa80c, 0x02001700 },
-   { 0xa810, 0x05000200 },
-   { 0xa814, 0x },
-   { 0xa818, 0x00690500 },
-   { 0xa81c, 0x007f },
-   { 0xa820, 

[U-Boot] [PATCH 11/12] dm: x86: Move samus to use new driver model support

2016-10-02 Thread Simon Glass
Update the samus driver to avoid the direct call to the video BIOS setup.

Signed-off-by: Simon Glass 
---

 arch/x86/cpu/broadwell/sdram.c |  1 -
 drivers/video/broadwell_igd.c  | 39 +++
 2 files changed, 7 insertions(+), 33 deletions(-)

diff --git a/arch/x86/cpu/broadwell/sdram.c b/arch/x86/cpu/broadwell/sdram.c
index e7befde..74736cd 100644
--- a/arch/x86/cpu/broadwell/sdram.c
+++ b/arch/x86/cpu/broadwell/sdram.c
@@ -291,7 +291,6 @@ void board_debug_uart_init(void)
 
 static const struct udevice_id broadwell_syscon_ids[] = {
{ .compatible = "intel,me", .data = X86_SYSCON_ME },
-   { .compatible = "intel,gma", .data = X86_SYSCON_GMA },
{ }
 };
 
diff --git a/drivers/video/broadwell_igd.c b/drivers/video/broadwell_igd.c
index 4286fd0..beef770 100644
--- a/drivers/video/broadwell_igd.c
+++ b/drivers/video/broadwell_igd.c
@@ -9,10 +9,8 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -20,11 +18,9 @@
 #include 
 #include 
 #include 
-#include 
 #include "i915_reg.h"
 
 struct broadwell_igd_priv {
-   GraphicDevice ctfb;
u8 *regs;
 };
 
@@ -664,10 +660,7 @@ static int broadwell_igd_probe(struct udevice *dev)
 {
struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
-   struct broadwell_igd_priv *priv = dev_get_priv(dev);
bool is_broadwell;
-   GraphicDevice *gdev = >ctfb;
-   int bits_per_pixel;
int ret;
 
if (!ll_boot_init()) {
@@ -683,13 +676,9 @@ static int broadwell_igd_probe(struct udevice *dev)
debug("%s: is_broadwell=%d\n", __func__, is_broadwell);
ret = igd_pre_init(dev, is_broadwell);
if (!ret) {
-   ret = dm_pci_run_vga_bios(dev, broadwell_igd_int15_handler,
- PCI_ROM_USE_NATIVE |
- PCI_ROM_ALLOW_FALLBACK);
-   if (ret) {
-   printf("failed to run video BIOS: %d\n", ret);
-   ret = -EIO;
-   }
+   ret = vbe_setup_video(dev, broadwell_igd_int15_handler);
+   if (ret)
+   debug("failed to run video BIOS: %d\n", ret);
}
if (!ret)
ret = igd_post_init(dev, is_broadwell);
@@ -697,13 +686,8 @@ static int broadwell_igd_probe(struct udevice *dev)
if (ret)
return ret;
 
-   if (vbe_get_video_info(gdev)) {
-   printf("No video mode configured\n");
-   return -ENXIO;
-   }
-
-   /* Use write-through for the graphics memory, 256MB */
-   ret = mtrr_add_request(MTRR_TYPE_WRTHROUGH, gdev->pciBase, 256 << 20);
+   /* Use write-combining for the graphics memory, 256MB */
+   ret = mtrr_add_request(MTRR_TYPE_WRCOMB, plat->base, 256 << 20);
if (!ret)
ret = mtrr_commit(true);
if (ret && ret != -ENOSYS) {
@@ -711,17 +695,8 @@ static int broadwell_igd_probe(struct udevice *dev)
   ret);
}
 
-   bits_per_pixel = gdev->gdfBytesPP * 8;
-   sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY,
-   bits_per_pixel);
-   printf("%s\n", gdev->modeIdent);
-   uc_priv->xsize = gdev->winSizeX;
-   uc_priv->ysize = gdev->winSizeY;
-   uc_priv->bpix = ilog2(bits_per_pixel);
-   plat->base = gdev->pciBase;
-   plat->size = gdev->memSize;
-   debug("fb=%x, size %x, display size=%d %d %d\n", gdev->pciBase,
- gdev->memSize, uc_priv->xsize, uc_priv->ysize, uc_priv->bpix);
+   debug("fb=%lx, size %x, display size=%d %d %d\n", plat->base,
+ plat->size, uc_priv->xsize, uc_priv->ysize, uc_priv->bpix);
 
return 0;
 }
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 07/12] dm: x86: video: Add a driver-model driver for ivybridge graphics

2016-10-02 Thread Simon Glass
At present we use the legacy vesa driver for graphics. Add a driver which
supports driver model. This can be probed only when needed, removing the
need to start up the display if it is not used.

Signed-off-by: Simon Glass 
---

 drivers/video/Kconfig |  12 +
 drivers/video/Makefile|   1 +
 drivers/video/ivybridge.c | 842 ++
 3 files changed, 855 insertions(+)
 create mode 100644 drivers/video/ivybridge.c

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 97dbb64..fd26690 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -374,6 +374,18 @@ config VIDEO_BROADWELL_IGD
  a special tool which configures the VGA ROM, but the graphics
  resolution can be selected in U-Boot.
 
+config VIDEO_IVYBRIDGE_IGD
+   bool "Enable Intel Ivybridge integration graphics support"
+   depends on X86
+   help
+ This enables support for integrated graphics on Intel ivybridge
+ devices. Initialisation is mostly performed by a VGA boot ROM, with
+ some setup handled by U-Boot itself. The graphics adaptor works as
+ a VESA device and supports LCD panels, eDP and LVDS outputs.
+ Configuration of most aspects of device operation is performed using
+ a special tool which configures the VGA ROM, but the graphics
+ resolution can be selected in U-Boot.
+
 config VIDEO_ROCKCHIP
bool "Enable Rockchip video support"
depends on DM_VIDEO
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 3f045fe..2fc88b0 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_CONSOLE_TRUETYPE) += console_truetype.o fonts/
 endif
 
 obj-$(CONFIG_VIDEO_BROADWELL_IGD) += broadwell_igd.o
+obj-$(CONFIG_VIDEO_IVYBRIDGE_IGD) += ivybridge.o
 
 obj-$(CONFIG_ATI_RADEON_FB) += ati_radeon_fb.o videomodes.o
 obj-$(CONFIG_ATMEL_HLCD) += atmel_hlcdfb.o
diff --git a/drivers/video/ivybridge.c b/drivers/video/ivybridge.c
new file mode 100644
index 000..751c9a0
--- /dev/null
+++ b/drivers/video/ivybridge.c
@@ -0,0 +1,842 @@
+1/*
+ * Copyright (C) 2016 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct gt_powermeter {
+   u16 reg;
+   u32 value;
+};
+
+static const struct gt_powermeter snb_pm_gt1[] = {
+   { 0xa200, 0xcc00 },
+   { 0xa204, 0x0740 },
+   { 0xa208, 0xfe00 },
+   { 0xa20c, 0x },
+   { 0xa210, 0x1700 },
+   { 0xa214, 0x0021 },
+   { 0xa218, 0x0817fe19 },
+   { 0xa21c, 0x },
+   { 0xa220, 0x },
+   { 0xa224, 0xcc00 },
+   { 0xa228, 0x0740 },
+   { 0xa22c, 0xfe00 },
+   { 0xa230, 0x },
+   { 0xa234, 0x1700 },
+   { 0xa238, 0x0021 },
+   { 0xa23c, 0x0817fe19 },
+   { 0xa240, 0x },
+   { 0xa244, 0x },
+   { 0xa248, 0x8000421e },
+   { 0 }
+};
+
+static const struct gt_powermeter snb_pm_gt2[] = {
+   { 0xa200, 0x33a6 },
+   { 0xa204, 0x402d0031 },
+   { 0xa208, 0x00165f83 },
+   { 0xa20c, 0xf100 },
+   { 0xa210, 0x },
+   { 0xa214, 0x00160016 },
+   { 0xa218, 0x002a002b },
+   { 0xa21c, 0x },
+   { 0xa220, 0x },
+   { 0xa224, 0x33a6 },
+   { 0xa228, 0x402d0031 },
+   { 0xa22c, 0x00165f83 },
+   { 0xa230, 0xf100 },
+   { 0xa234, 0x },
+   { 0xa238, 0x00160016 },
+   { 0xa23c, 0x002a002b },
+   { 0xa240, 0x },
+   { 0xa244, 0x },
+   { 0xa248, 0x8000421e },
+   { 0 }
+};
+
+static const struct gt_powermeter ivb_pm_gt1[] = {
+   { 0xa800, 0x },
+   { 0xa804, 0x00021c00 },
+   { 0xa808, 0x0403 },
+   { 0xa80c, 0x02001700 },
+   { 0xa810, 0x05000200 },
+   { 0xa814, 0x },
+   { 0xa818, 0x00690500 },
+   { 0xa81c, 0x007f },
+   { 0xa820, 0x01002501 },
+   { 0xa824, 0x0300 },
+   { 0xa828, 0x01000331 },
+   { 0xa82c, 0x000c },
+   { 0xa830, 0x00010016 },
+   { 0xa834, 0x01100101 },
+   { 0xa838, 0x00010103 },
+   { 0xa83c, 0x00041300 },
+   { 0xa840, 0x0b30 },
+   { 0xa844, 0x },
+   { 0xa848, 0x7f00 },
+   { 0xa84c, 0x0508 },
+   { 0xa850, 0x0001 },
+   { 0xa854, 0x0004 },
+   { 0xa858, 0x0007 },
+   { 0xa85c, 0x },
+   { 0xa860, 0x0001 },
+   { 0xa248, 0x221e },
+   { 0xa900, 0x },
+   { 0xa904, 0x1c00 },
+   { 0xa908, 0x },
+   { 0xa90c, 0x0600 },
+   { 0xa910, 0x09000200 },
+   { 0xa914, 0x },
+   { 0xa918, 0x0059 },
+   { 0xa91c, 0x },
+   { 0xa920, 0x04002501 },
+   { 0xa924, 

[U-Boot] [PATCH 10/12] x86: Adjust config to support DM_VIDEO

2016-10-02 Thread Simon Glass
Update the common configuration so that it works correctly when
CONFIG_DM_VIDEO is enabled. This involves dropping the legacy CONFIG_VIDEO
option and changing the stdio device from "vga" to "vidconsole".

Signed-off-by: Simon Glass 
---

 include/configs/x86-chromebook.h | 10 --
 include/configs/x86-common.h |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/configs/x86-chromebook.h b/include/configs/x86-chromebook.h
index 312987e..7fba716 100644
--- a/include/configs/x86-chromebook.h
+++ b/include/configs/x86-chromebook.h
@@ -53,8 +53,14 @@
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 
+#ifdef CONFIG_DM_VIDEO
+#define VIDEO_DEV "vidconsole"
+#else
+#define VIDEO_DEV "vga"
+#endif
+
 #define CONFIG_STD_DEVICES_SETTINGS "stdin=usbkbd,i8042-kbd,serial\0" \
-   "stdout=vga,serial\0" \
-   "stderr=vga,serial\0"
+   "stdout=" VIDEO_DEV ",serial\0" \
+   "stderr=" VIDEO_DEV ",serial\0"
 
 #endif
diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
index 74b2522..96c53b8 100644
--- a/include/configs/x86-common.h
+++ b/include/configs/x86-common.h
@@ -131,11 +131,13 @@
 /*---
  * Video Configuration
  */
+#ifndef CONFIG_DM_VIDEO
 #define CONFIG_VIDEO
 #define CONFIG_VIDEO_SW_CURSOR
 #define VIDEO_FB_16BPP_WORD_SWAP
 #define CONFIG_VGA_AS_SINGLE_DEVICE
 #define CONFIG_CFB_CONSOLE
+#endif
 #define CONFIG_CONSOLE_SCROLL_LINES 5
 
 /*---
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 08/12] dm: stdio: Allow lazy probing of video devices

2016-10-02 Thread Simon Glass
At present all video devices are probed on start-up. It would be better to
probe a device only when it is needed. This can happen if it is referenced
in the stdout environment variable, for example.

Add support for this by searching for a suitable device when needed, probing
it, and finding the stdio device it creates.

Signed-off-by: Simon Glass 
---

 common/stdio.c | 67 ++
 1 file changed, 63 insertions(+), 4 deletions(-)

diff --git a/common/stdio.c b/common/stdio.c
index f99cfe7..b58b3c7 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -121,19 +121,76 @@ struct list_head* stdio_get_list(void)
return &(devs.list);
 }
 
+#ifdef CONFIG_DM_VIDEO
+/**
+ * stdio_probe_device() - Find a device which provides the given stdio device
+ *
+ * This looks for a device of the given uclass which provides a particular
+ * stdio device. It is currently really only useful for UCLASS_VIDEO.
+ *
+ * Ultimately we want to be able to probe a device by its stdio name. At
+ * present devices register in their probe function (for video devices this
+ * is done in vidconsole_post_probe()) and we don't know what name they will
+ * use until they do so.
+ * TODO(s...@chromium.org): We should be able to determine the name before
+ * probing, and probe the required device.
+ *
+ * @name:  stdio device name (e.g. "vidconsole")
+ * id: Uclass ID of device to look for (e.g. UCLASS_VIDEO)
+ * @sdevp: Returns stdout device, if found, else NULL
+ * @return 0 if found, -ENOENT if no device found with that name, other -ve
+ *on other error
+ */
+static int stdio_probe_device(const char *name, enum uclass_id id,
+ struct stdio_dev **sdevp)
+{
+   struct stdio_dev *sdev;
+   struct udevice *dev;
+   int seq, ret;
+
+   *sdevp = NULL;
+   seq = trailing_strtoln(name, NULL);
+   if (seq == -1)
+   ret = uclass_first_device_err(id, );
+   else
+   ret = uclass_get_device_by_seq(id, seq, );
+   if (ret) {
+   debug("No %s device for seq %d (%s)\n", uclass_get_name(id),
+ seq, name);
+   return ret;
+   }
+   /* The device should be be the last one registered */
+   sdev = list_empty() ? NULL :
+   list_last_entry(, struct stdio_dev, list);
+   if (!sdev || strcmp(sdev->name, name)) {
+   debug("Device '%s' did not register with stdio as '%s'\n",
+ dev->name, name);
+   return -ENOENT;
+   }
+   *sdevp = sdev;
+
+   return 0;
+}
+#endif
+
 struct stdio_dev* stdio_get_by_name(const char *name)
 {
struct list_head *pos;
-   struct stdio_dev *dev;
+   struct stdio_dev *sdev;
 
if(!name)
return NULL;
 
list_for_each(pos, &(devs.list)) {
-   dev = list_entry(pos, struct stdio_dev, list);
-   if(strcmp(dev->name, name) == 0)
-   return dev;
+   sdev = list_entry(pos, struct stdio_dev, list);
+   if (strcmp(sdev->name, name) == 0)
+   return sdev;
}
+#ifdef CONFIG_DM_VIDEO
+   if (!strncmp(name, "vidconsole", 10) && !strchr(name, ',') &&
+   !stdio_probe_device(name, UCLASS_VIDEO, ))
+   return sdev;
+#endif
 
return NULL;
 }
@@ -282,6 +339,7 @@ int stdio_add_devices(void)
 #endif
 #endif
 #ifdef CONFIG_DM_VIDEO
+#ifndef CONFIG_SYS_CONSOLE_IS_IN_ENV
struct udevice *vdev;
 # ifndef CONFIG_DM_KEYBOARD
int ret;
@@ -293,6 +351,7 @@ int stdio_add_devices(void)
;
if (ret)
printf("%s: Video device failed (ret=%d)\n", __func__, ret);
+#endif /* !CONFIG_SYS_CONSOLE_IS_IN_ENV */
 #else
 # if defined(CONFIG_LCD)
drv_lcd_init ();
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 04/12] list: Add list_last_entry() to find the last entry

2016-10-02 Thread Simon Glass
We have list_first_entry() but in some cases it is useful to find the last
item added to the list. Add a macro for this.

Signed-off-by: Simon Glass 
---

 include/linux/list.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/list.h b/include/linux/list.h
index b78851c..5b8d1df 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -338,6 +338,17 @@ static inline void list_splice_tail_init(struct list_head 
*list,
list_entry((ptr)->next, type, member)
 
 /**
+ * list_last_entry - get the last element from a list
+ * @ptr:   the list head to take the element from.
+ * @type:  the type of the struct this is embedded in.
+ * @member:the name of the list_struct within the struct.
+ *
+ * Note, that list is expected to be not empty.
+ */
+#define list_last_entry(ptr, type, member) \
+   list_entry((ptr)->prev, type, member)
+
+/**
  * list_for_each   -   iterate over a list
  * @pos:   the  list_head to use as a loop cursor.
  * @head:  the head for your list.
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 06/12] x86: video: Fix typo in broadwell Kconfig

2016-10-02 Thread Simon Glass
'enabled' should be 'enables'. Fixit.

Signed-off-by: Simon Glass 
---

 drivers/video/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 8361a71..97dbb64 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -366,7 +366,7 @@ config VIDEO_BROADWELL_IGD
bool "Enable Intel Broadwell integrated graphics device"
depends on X86
help
- This enabled support for integrated graphics on Intel broadwell
+ This enables support for integrated graphics on Intel broadwell
  devices. Initialisation is mostly performed by a VGA boot ROM, with
  some setup handled by U-Boot itself. The graphics adaptor works as
  a VESA device and supports LCD panels, eDP and LVDS outputs.
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 02/12] x86: Add an accelerated memmove() function

2016-10-02 Thread Simon Glass
Bring in a faster memmove() from Linux 4.7. This speeds up scrolling on the
display.

Signed-off-by: Simon Glass 
---

 arch/x86/include/asm/string.h |   2 +-
 arch/x86/lib/Makefile |   1 +
 arch/x86/lib/memmove.c| 193 ++
 3 files changed, 195 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/lib/memmove.c

diff --git a/arch/x86/include/asm/string.h b/arch/x86/include/asm/string.h
index 0ad612f..38afd23 100644
--- a/arch/x86/include/asm/string.h
+++ b/arch/x86/include/asm/string.h
@@ -17,7 +17,7 @@ extern char * strchr(const char * s, int c);
 #define __HAVE_ARCH_MEMCPY
 extern void * memcpy(void *, const void *, __kernel_size_t);
 
-#undef __HAVE_ARCH_MEMMOVE
+#define __HAVE_ARCH_MEMMOVE
 extern void * memmove(void *, const void *, __kernel_size_t);
 
 #undef __HAVE_ARCH_MEMCHR
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index e17f0bb..b380d62 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -17,6 +17,7 @@ obj-y += gcc.o
 obj-y  += init_helpers.o
 obj-y  += interrupts.o
 obj-y  += lpc-uclass.o
+obj-y  += memmove.o
 obj-y  += mpspec.o
 obj-$(CONFIG_ENABLE_MRC_CACHE) += mrccache.o
 obj-y += cmd_mtrr.o
diff --git a/arch/x86/lib/memmove.c b/arch/x86/lib/memmove.c
new file mode 100644
index 000..504a184
--- /dev/null
+++ b/arch/x86/lib/memmove.c
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2016 Google, Inc
+ * Taken from Linux v4.7. There is no copyright notice on the original file.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+
+void *memmove(void *dest, const void *src, size_t n)
+{
+   int d0, d1, d2, d3, d4, d5;
+   char *ret = dest;
+
+   __asm__ __volatile__(
+   /* Handle more 16 bytes in loop */
+   "cmp $0x10, %0\n\t"
+   "jb 1f\n\t"
+
+   /* Decide forward/backward copy mode */
+   "cmp %2, %1\n\t"
+   "jb 2f\n\t"
+
+   /*
+* movs instruction have many startup latency
+* so we handle small size by general register.
+*/
+   "cmp  $680, %0\n\t"
+   "jb 3f\n\t"
+   /*
+* movs instruction is only good for aligned case.
+*/
+   "mov %1, %3\n\t"
+   "xor %2, %3\n\t"
+   "and $0xff, %3\n\t"
+   "jz 4f\n\t"
+   "3:\n\t"
+   "sub $0x10, %0\n\t"
+
+   /*
+* We gobble 16 bytes forward in each loop.
+*/
+   "3:\n\t"
+   "sub $0x10, %0\n\t"
+   "mov 0*4(%1), %3\n\t"
+   "mov 1*4(%1), %4\n\t"
+   "mov  %3, 0*4(%2)\n\t"
+   "mov  %4, 1*4(%2)\n\t"
+   "mov 2*4(%1), %3\n\t"
+   "mov 3*4(%1), %4\n\t"
+   "mov  %3, 2*4(%2)\n\t"
+   "mov  %4, 3*4(%2)\n\t"
+   "lea  0x10(%1), %1\n\t"
+   "lea  0x10(%2), %2\n\t"
+   "jae 3b\n\t"
+   "add $0x10, %0\n\t"
+   "jmp 1f\n\t"
+
+   /*
+* Handle data forward by movs.
+*/
+   ".p2align 4\n\t"
+   "4:\n\t"
+   "mov -4(%1, %0), %3\n\t"
+   "lea -4(%2, %0), %4\n\t"
+   "shr $2, %0\n\t"
+   "rep movsl\n\t"
+   "mov %3, (%4)\n\t"
+   "jmp 11f\n\t"
+   /*
+* Handle data backward by movs.
+*/
+   ".p2align 4\n\t"
+   "6:\n\t"
+   "mov (%1), %3\n\t"
+   "mov %2, %4\n\t"
+   "lea -4(%1, %0), %1\n\t"
+   "lea -4(%2, %0), %2\n\t"
+   "shr $2, %0\n\t"
+   "std\n\t"
+   "rep movsl\n\t"
+   "mov %3,(%4)\n\t"
+   "cld\n\t"
+   "jmp 11f\n\t"
+
+   /*
+* Start to prepare for backward copy.
+*/
+   ".p2align 4\n\t"
+   "2:\n\t"
+   "cmp  $680, %0\n\t"
+   "jb 5f\n\t"
+   "mov %1, %3\n\t"
+   "xor %2, %3\n\t"
+   "and $0xff, %3\n\t"
+   "jz 6b\n\t"
+
+   /*
+* Calculate copy position to tail.
+*/
+   "5:\n\t"
+   "add %0, %1\n\t"
+   "add %0, %2\n\t"
+   "sub $0x10, %0\n\t"
+
+   /*
+* We gobble 16 bytes backward in each loop.
+*/
+   "7:\n\t"
+   "sub $0x10, %0\n\t"
+
+   "mov -1*4(%1), %3\n\t"
+   "mov -2*4(%1), %4\n\t"
+   "mov  %3, -1*4(%2)\n\t"
+   "mov  %4, -2*4(%2)\n\t"
+   "mov -3*4(%1), %3\n\t"
+   "mov -4*4(%1), %4\n\t"
+   "mov  %3, -3*4(%2)\n\t"
+   

[U-Boot] [PATCH 03/12] Fix return value in trailing_strtoln()

2016-10-02 Thread Simon Glass
This function should return -1 if there is no trailing integer in the
string. Instead it returns 0. Fix it by checking for this condition at the
start.

Signed-off-by: Simon Glass 
---

 lib/strto.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/strto.c b/lib/strto.c
index a6c0157..e93a4f5 100644
--- a/lib/strto.c
+++ b/lib/strto.c
@@ -160,9 +160,11 @@ long trailing_strtoln(const char *str, const char *end)
 
if (!end)
end = str + strlen(str);
-   for (p = end - 1; p > str; p--) {
-   if (!isdigit(*p))
-   return simple_strtoul(p + 1, NULL, 10);
+   if (isdigit(end[-1])) {
+   for (p = end - 1; p > str; p--) {
+   if (!isdigit(*p))
+   return simple_strtoul(p + 1, NULL, 10);
+   }
}
 
return -1;
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 00/12] dm: x86: Improve vesa driver-model support

2016-10-02 Thread Simon Glass
At present samus uses driver model but link does not. This series fixes
this and adds a few features to make it easier to support driver-model
video on other machines that use vesa.

It also includes a faster memmove() function which speeds up scrolling
dramatically.


Simon Glass (12):
  Revert "x86: broadwell: gpio: Remove the codes to set up pin control"
  x86: Add an accelerated memmove() function
  Fix return value in trailing_strtoln()
  list: Add list_last_entry() to find the last entry
  dm: core: Add a function to get a uclass name
  x86: video: Fix typo in broadwell Kconfig
  dm: x86: video: Add a driver-model driver for ivybridge graphics
  dm: stdio: Allow lazy probing of video devices
  dm: video: Add driver-model support to vesa graphics
  x86: Adjust config to support DM_VIDEO
  dm: x86: Move samus to use new driver model support
  dm: x86: Move link to use driver model for video

 arch/x86/cpu/broadwell/sdram.c |   1 -
 arch/x86/cpu/ivybridge/Makefile|   1 -
 arch/x86/cpu/ivybridge/bd82x6x.c   |  12 --
 arch/x86/cpu/ivybridge/early_me.c  |   1 -
 arch/x86/cpu/ivybridge/gma.h   | 156 -
 arch/x86/cpu/ivybridge/model_206ax.c   |   1 -
 arch/x86/cpu/ivybridge/sata.c  |   1 -
 arch/x86/include/asm/arch-ivybridge/bd82x6x.h  |  12 --
 arch/x86/include/asm/cpu.h |   1 -
 arch/x86/include/asm/string.h  |   2 +-
 arch/x86/lib/Makefile  |   1 +
 arch/x86/lib/memmove.c | 193 +
 common/stdio.c |  67 ++-
 configs/chromebook_link_defconfig  |   2 +
 drivers/core/uclass.c  |   9 +
 drivers/gpio/intel_broadwell_gpio.c|   7 +
 drivers/pci/pci_rom.c  |  55 ++
 drivers/video/Kconfig  |  14 +-
 drivers/video/Makefile |   1 +
 drivers/video/broadwell_igd.c  |  39 +
 .../ivybridge/gma.c => drivers/video/ivybridge.c   |  78 -
 include/configs/x86-chromebook.h   |  10 +-
 include/configs/x86-common.h   |   2 +
 include/dm/uclass.h|   8 +
 include/linux/list.h   |  11 ++
 include/vbe.h  |   2 +
 lib/strto.c|   8 +-
 27 files changed, 423 insertions(+), 272 deletions(-)
 delete mode 100644 arch/x86/cpu/ivybridge/gma.h
 delete mode 100644 arch/x86/include/asm/arch-ivybridge/bd82x6x.h
 create mode 100644 arch/x86/lib/memmove.c
 rename arch/x86/cpu/ivybridge/gma.c => drivers/video/ivybridge.c (94%)

-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 05/12] dm: core: Add a function to get a uclass name

2016-10-02 Thread Simon Glass
It is useful in debug() statements to display the name of the uclass for a
device. Add a simple function to provide this.

Signed-off-by: Simon Glass 
---

 drivers/core/uclass.c | 9 +
 include/dm/uclass.h   | 8 
 2 files changed, 17 insertions(+)

diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index de602ae..60610e5 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -148,6 +148,15 @@ int uclass_get(enum uclass_id id, struct uclass **ucp)
return 0;
 }
 
+const char *uclass_get_name(enum uclass_id id)
+{
+   struct uclass *uc;
+
+   if (uclass_get(id, ))
+   return NULL;
+   return uc->uc_drv->name;
+}
+
 int uclass_find_device(enum uclass_id id, int index, struct udevice **devp)
 {
struct uclass *uc;
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index 84f05bc..34e2bdc 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -119,6 +119,14 @@ struct uclass_driver {
 int uclass_get(enum uclass_id key, struct uclass **ucp);
 
 /**
+ * uclass_get_name() - Get the name of a uclass drive
+ *
+ * @id: ID to look up
+ * @returns the name of the uclass driver for that ID, or NULL if none
+ */
+const char *uclass_get_name(enum uclass_id id);
+
+/**
  * uclass_get_device() - Get a uclass device based on an ID and index
  *
  * The device is probed to activate it ready for use.
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 01/12] Revert "x86: broadwell: gpio: Remove the codes to set up pin control"

2016-10-02 Thread Simon Glass
This makes the assumption that setting up pinctrl in cpu_init_r() is safe.
On samus we need GPIOs before relocation in order to support power control.
This commit fixes the following message on boot:

   initcall sequence ffe5c6f4 failed at call ffe01d3d (err=-1)
   ### ERROR ### Please RESET the board ###

In any case it seems better to leave init to driver model, so that it can
pick up the GPIO driver when it needs it. Since pinctrl is a dependency of
the GPIO driver, we may as well put the dependency there and avoid these
problems.

This reverts commit 9769e05bcf79939bad23a719982dd1f85a110f3c.

Signed-off-by: Simon Glass 
---

 drivers/gpio/intel_broadwell_gpio.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpio/intel_broadwell_gpio.c 
b/drivers/gpio/intel_broadwell_gpio.c
index 8b50900..81ce446 100644
--- a/drivers/gpio/intel_broadwell_gpio.c
+++ b/drivers/gpio/intel_broadwell_gpio.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -118,6 +119,12 @@ static int broadwell_gpio_probe(struct udevice *dev)
struct broadwell_bank_platdata *plat = dev_get_platdata(dev);
struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
struct broadwell_bank_priv *priv = dev_get_priv(dev);
+   struct udevice *pinctrl;
+   int ret;
+
+   /* Set up pin control if available */
+   ret = syscon_get_by_driver_data(X86_SYSCON_PINCONF, );
+   debug("%s, pinctrl=%p, ret=%d\n", __func__, pinctrl, ret);
 
uc_priv->gpio_count = GPIO_PER_BANK;
uc_priv->bank_name = plat->bank_name;
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 14/16] README: Drop README.imx31

2016-10-02 Thread Simon Glass
The only content of this file is CONFIG options which are no-longer present
in U-Boot. Drop it.

Signed-off-by: Simon Glass 
---

 doc/README.imx31 | 29 -
 1 file changed, 29 deletions(-)
 delete mode 100644 doc/README.imx31

diff --git a/doc/README.imx31 b/doc/README.imx31
deleted file mode 100644
index 91ef766..000
--- a/doc/README.imx31
+++ /dev/null
@@ -1,29 +0,0 @@
-U-Boot for Freescale i.MX31
-
-This file contains information for the port of U-Boot to the Freescale
-i.MX31 SoC.
-
-1. CONFIGURATION OPTIONS/SETTINGS
--
-
-1.1 Configuration of MC13783 SPI bus
-
-   The power management companion chip MC13783 is connected to the
-   i.MX31 via an SPI bus. Use the following configuration options
-   to setup the bus and chip select used for a particular board.
-
-   CONFIG_MC13783_SPI_BUS  -- defines the SPI bus the MC13783 is connected 
to.
-  Note that 0 is CSPI1, 1 is CSPI2 and 2 is CSPI3.
-   CONFIG_MC13783_SPI_CS   -- define the chip select the MC13783 s 
connected to.
-
-1.2 Timer precision

-   CONFIG_MX31_TIMER_HIGH_PRECISION
-
-   Enable higher precision timer. The low-precision timer
-   (default) provides approximately 4% error, whereas the
-   high-precision timer is about 0.4% accurate. The extra
-   accuracy is achieved at the cost of higher computational
-   overhead, which, in places where time is measured, should
-   not be critical, so, it should be safe to enable this
-   option.
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 16/16] README: Fix CONFIG_SYS_NAND_MAX_DEVICE typo

2016-10-02 Thread Simon Glass
This should be CONFIG_SYS_MAX_NAND_DEVICE. Fix it.

Signed-off-by: Simon Glass 
---

 doc/README.nand | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/README.nand b/doc/README.nand
index f1c20ff..2295bb2 100644
--- a/doc/README.nand
+++ b/doc/README.nand
@@ -160,7 +160,7 @@ Configuration Options:
 
/*
 * devnum is the device number to be used in nand commands
-* and in mtd->name.  Must be less than CONFIG_SYS_NAND_MAX_DEVICE.
+* and in mtd->name.  Must be less than CONFIG_SYS_MAX_NAND_DEVICE.
 */
if (nand_register(devnum, mtd))
error out
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 11/16] README: Drop CONFIG_SYS_INIT_DATA_SIZE

2016-10-02 Thread Simon Glass
This appears to be calculated automatically now. Drop the old reference.

Signed-off-by: Simon Glass 
---

 README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README b/README
index 614a81c..17dc34b 100644
--- a/README
+++ b/README
@@ -4480,7 +4480,7 @@ Low Level (hardware related) configuration options:
CONFIG_SYS_GBL_DATA_OFFSET is chosen such that the initial
data is located at the end of the available space
(sometimes written as (CONFIG_SYS_INIT_RAM_SIZE -
-   CONFIG_SYS_INIT_DATA_SIZE), and the initial stack is just
+   GENERATED_GBL_DATA_SIZE), and the initial stack is just
below that area (growing from (CONFIG_SYS_INIT_RAM_ADDR +
CONFIG_SYS_GBL_DATA_OFFSET) downward.
 
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 15/16] README: Drop CONFIG_MPC8349ADS

2016-10-02 Thread Simon Glass
This option is not used now.

Signed-off-by: Simon Glass 
---

 doc/README.mpc83xxads | 1 -
 1 file changed, 1 deletion(-)

diff --git a/doc/README.mpc83xxads b/doc/README.mpc83xxads
index 7a8b706..372fdd9 100644
--- a/doc/README.mpc83xxads
+++ b/doc/README.mpc83xxads
@@ -50,7 +50,6 @@ Freescale MPC83xx ADS Boards
 
 CONFIG_MPC83xx MPC83xx family
 CONFIG_MPC8349 MPC8349 specific
-CONFIG_MPC8349ADS  MPC8349ADS board specific
 CONFIG_TSEC_ENET   Use on-chip 10/100/1000 ethernet
 
 
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 13/16] atmel: Drop README.at91-soc

2016-10-02 Thread Simon Glass
This issue covered by this doc appears to be fixed, so let's remove the
README.

Signed-off-by: Simon Glass 
---

 doc/README.at91-soc | 48 
 1 file changed, 48 deletions(-)
 delete mode 100644 doc/README.at91-soc

diff --git a/doc/README.at91-soc b/doc/README.at91-soc
deleted file mode 100644
index 9a9f74e..000
--- a/doc/README.at91-soc
+++ /dev/null
@@ -1,48 +0,0 @@
- New C structure AT91 SoC access
-=
-
-The goal
-
-
-Currently the at91 arch uses hundreds of address defines and special
-at91__write/read functions to access the SOC.
-The u-boot project perferred method is to access memory mapped hw
-regisister via a c structure.
-
-e.g. old
-
-   *AT91C_PIOA_IDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
-   *AT91C_PIOC_PUDR = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
-   *AT91C_PIOC_PER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
-   *AT91C_PIOC_OER = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
-   *AT91C_PIOC_PIO = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
-
-   at91_sys_write(AT91_RSTC_CR,
-   AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
-
-e.g new
-   pin = AT91_PMX_AA_TWD | AT91_PMX_AA_TWCK;
-   writel(pin, >pioa.idr);
-   writel(pin, >pioa.pudr);
-   writel(pin, >pioa.per);
-   writel(pin, >pioa.oer);
-   writel(pin, >pioa.sodr);
-
-   writel(AT91_RSTC_KEY | AT91_RSTC_CR_PROCRST |
-   AT91_RSTC_CR_PERRST, >cr);
-
-The method for updating
-
-
-1. add's the temporary CONFIG_AT91_LEGACY to all at91 board configs
-2. Display a compile time warning, if the board has not been converted
-3. add new structures for SoC access
-4. Convert arch, driver and boards file to new SoC
-5. remove legacy code, if all boards and drives are ready
-
-2013-10-30 Andreas Bießmann :
-
-The goal is almost reached, we could remove the CONFIG_AT91_LEGACY switch but
-remain the CONFIG_ATMEL_LEGACY switch until the GPIO disaster is fixed. The
-AT91 spi driver has also some CONFIG_ATMEL_LEGACY stuff left, so another point
-to fix until this README can be removed.
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 10/16] README: i2c: Drop unused i2c CONFIG options

2016-10-02 Thread Simon Glass
CONFIG_SYS_NUM_I2C_ADAPTERS and CONFIG_SYS_I2C_MULTI_NOPROBES are not used
in U-Boot, so drop them.

Signed-off-by: Simon Glass 
---

 README | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/README b/README
index 0c90415..614a81c 100644
--- a/README
+++ b/README
@@ -2326,10 +2326,7 @@ CBFS (Coreboot Filesystem) support
additional defines:
 
CONFIG_SYS_NUM_I2C_BUSES
-   Hold the number of i2c buses you want to use. If you
-   don't use/have i2c muxes on your i2c bus, this
-   is equal to CONFIG_SYS_NUM_I2C_ADAPTERS, and you can
-   omit this define.
+   Hold the number of i2c buses you want to use.
 
CONFIG_SYS_I2C_DIRECT_BUS
define this, if you don't use i2c muxes on your hardware.
@@ -2543,7 +2540,7 @@ CBFS (Coreboot Filesystem) support
will skip addresses 0x50 and 0x68 on a board with one I2C bus
 
#define CONFIG_I2C_MULTI_BUS
-   #define CONFIG_SYS_I2C_MULTI_NOPROBES   
{{0,0x50},{0,0x68},{1,0x54}}
+   #define CONFIG_SYS_I2C_NOPROBES 
{{0,0x50},{0,0x68},{1,0x54}}
 
will skip addresses 0x50 and 0x68 on bus 0 and address 0x54 on 
bus 1
 
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 12/16] README: Drop CONFIG_SYS_USE_OSCCLK

2016-10-02 Thread Simon Glass
This is not used in U-Boot so drop it.

Signed-off-by: Simon Glass 
---

 README | 5 -
 1 file changed, 5 deletions(-)

diff --git a/README b/README
index 17dc34b..1d7d2e3 100644
--- a/README
+++ b/README
@@ -4539,11 +4539,6 @@ Low Level (hardware related) configuration options:
enable SPI microcode relocation patch (MPC8xx);
define relocation offset in DPRAM [SCC4]
 
-- CONFIG_SYS_USE_OSCCLK:
-   Use OSCM clock mode on MBX8xx board. Be careful,
-   wrong setting might damage your board. Read
-   doc/README.MBX before setting this variable!
-
 - CONFIG_SYS_CPM_POST_WORD_ADDR: (MPC8xx, MPC8260 only)
Offset of the bootmode word in DPRAM used by post
(Power On Self Tests). This definition overrides
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 09/16] README: sh: Drop CONFIG_SYS_I2C_SH_BASE5

2016-10-02 Thread Simon Glass
This is not used in U-Boot. Drop both the BASE and the SIZE config.

Signed-off-by: Simon Glass 
---

 README | 2 --
 1 file changed, 2 deletions(-)

diff --git a/README b/README
index 7f5de6b..0c90415 100644
--- a/README
+++ b/README
@@ -2273,8 +2273,6 @@ CBFS (Coreboot Filesystem) support
  - CONFIG_SYS_I2C_SH_SPEED3 for for the speed channel 3
  - CONFIG_SYS_I2C_SH_BASE4 for setting the register channel 4
  - CONFIG_SYS_I2C_SH_SPEED4 for for the speed channel 4
- - CONFIG_SYS_I2C_SH_BASE5 for setting the register channel 5
- - CONFIG_SYS_I2C_SH_SPEED5 for for the speed channel 5
  - CONFIG_SYS_I2C_SH_NUM_CONTROLLERS for number of i2c buses
 
- drivers/i2c/omap24xx_i2c.c
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 08/16] README: Drop CONFIG_SYS_USB_BRG_CLK

2016-10-02 Thread Simon Glass
This is not used in U-Boot.

Signed-off-by: Simon Glass 
---

 README | 4 
 1 file changed, 4 deletions(-)

diff --git a/README b/README
index 43e4d99..7f5de6b 100644
--- a/README
+++ b/README
@@ -1481,10 +1481,6 @@ The following options need to be configured:
Derive USB clock from external clock "blah"
- CONFIG_SYS_USB_EXTC_CLK 0x02
 
-   CONFIG_SYS_USB_BRG_CLK 0xBLAH
-   Derive USB clock from brgclk
-   - CONFIG_SYS_USB_BRG_CLK 0x04
-
If you have a USB-IF assigned VendorID then you may wish to
define your own vendor specific values either in BoardName.h
or directly in usbd_vendor_info.h. If you don't define
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 07/16] README: Drop CONFIG_LAN91C96_BASE

2016-10-02 Thread Simon Glass
This is not used in U-Boot.

Signed-off-by: Simon Glass 
---

 README | 4 
 1 file changed, 4 deletions(-)

diff --git a/README b/README
index da1c033..43e4d99 100644
--- a/README
+++ b/README
@@ -1297,10 +1297,6 @@ The following options need to be configured:
CONFIG_LAN91C96
Support for SMSC's LAN91C96 chips.
 
-   CONFIG_LAN91C96_BASE
-   Define this to hold the physical address
-   of the LAN91C96's I/O space
-
CONFIG_LAN91C96_USE_32_BIT
Define this to enable 32 bit addressing
 
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 06/16] README: Drop CONFIG_OF_BOOT_CPU

2016-10-02 Thread Simon Glass
This is not used in U-Boot.

Signed-off-by: Simon Glass 
---

 README | 5 -
 1 file changed, 5 deletions(-)

diff --git a/README b/README
index 703c5f4..da1c033 100644
--- a/README
+++ b/README
@@ -695,11 +695,6 @@ The following options need to be configured:
This causes ft_system_setup() to be called before booting
the kernel.
 
-   CONFIG_OF_BOOT_CPU
-
-   This define fills in the correct boot CPU in the boot
-   param header, the default value is zero if undefined.
-
CONFIG_OF_IDE_FIXUP
 
U-Boot can detect if an IDE device is present or not.
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 04/16] README: Drop unused JFFS2 options

2016-10-02 Thread Simon Glass
There appear to be neither implemented nor used. Drop them.

Signed-off-by: Simon Glass 
---

 README| 12 +---
 doc/README.JFFS2  | 43 +++
 doc/README.JFFS2_NAND | 20 ++--
 3 files changed, 6 insertions(+), 69 deletions(-)

diff --git a/README b/README
index 57dd79c..cdd58db 100644
--- a/README
+++ b/README
@@ -1649,23 +1649,13 @@ The following options need to be configured:
Default is GPT_ENTRY_NAME (currently "gpt") if undefined.
 
 - Journaling Flash filesystem support:
-   CONFIG_JFFS2_NAND, CONFIG_JFFS2_NAND_OFF, 
CONFIG_JFFS2_NAND_SIZE,
-   CONFIG_JFFS2_NAND_DEV
+   CONFIG_JFFS2_NAND
Define these for a default partition on a NAND device
 
CONFIG_SYS_JFFS2_FIRST_SECTOR,
CONFIG_SYS_JFFS2_FIRST_BANK, CONFIG_SYS_JFFS2_NUM_BANKS
Define these for a default partition on a NOR device
 
-   CONFIG_SYS_JFFS_CUSTOM_PART
-   Define this to create an own partition. You have to provide a
-   function struct part_info* jffs2_part_info(int part_num)
-
-   If you define only one JFFS2 partition you may also want to
-   #define CONFIG_SYS_JFFS_SINGLE_PART 1
-   to disable the command chpart. This is the default when you
-   have not defined a custom partition
-
 - FAT(File Allocation Table) filesystem write function support:
CONFIG_FAT_WRITE
 
diff --git a/doc/README.JFFS2 b/doc/README.JFFS2
index f0e9bc1..604e5b9 100644
--- a/doc/README.JFFS2
+++ b/doc/README.JFFS2
@@ -19,52 +19,15 @@ more or less a bubble sort. That algorithm is known to be 
O(n^2),
 thus you should really consider if you can avoid it!
 
 
-There is two ways for JFFS2 to find the disk. The default way uses
-the flash_info structure to find the start of a JFFS2 disk (called
-partition in the code) and you can change where the partition is with
-two defines.
+There only one way for JFFS2 to find the disk. It uses the flash_info
+structure to find the start of a JFFS2 disk (called partition in the code)
+and you can change where the partition is with two defines.
 
 CONFIG_SYS_JFFS2_FIRST_BANK
defined the first flash bank to use
 
 CONFIG_SYS_JFFS2_FIRST_SECTOR
defines the first sector to use
-
-
-The second way is to define CONFIG_SYS_JFFS_CUSTOM_PART and implement the
-jffs2_part_info(int part_num) function in your board specific files.
-In this mode CONFIG_SYS_JFFS2_FIRST_BANK and CONFIG_SYS_JFFS2_FIRST_SECTOR is 
not
-used.
-
-The input is a partition number starting with 0.
-Return a pointer to struct part_info or NULL for error;
-
-Ex jffs2_part_info() for one partition.

-#if defined CONFIG_SYS_JFFS_CUSTOM_PART
-#include 
-
-static struct part_info part;
-
-struct part_info*
-jffs2_part_info(int part_num)
-{
-   if(part_num==0){
-   if(part.usr_priv==(void*)1)
-   return 
-
-   memset(, 0, sizeof(part));
-   part.offset=(char*)0xFF80;
-   part.size=1024*1024*8;
-
-   /* Mark the struct as ready */
-   part.usr_priv=(void*)1;
-
-   return 
-   }
-   return 0;
-}
-#endif
 ---
 
 TODO.
diff --git a/doc/README.JFFS2_NAND b/doc/README.JFFS2_NAND
index 09788d5..92fa0f6 100644
--- a/doc/README.JFFS2_NAND
+++ b/doc/README.JFFS2_NAND
@@ -2,23 +2,7 @@ JFFS2 NAND support:
 
 To enable, use the following #define in the board configuration file:
 
-#define CONFIG_JFFS2_NAND 1
+#define CONFIG_JFFS2_NAND
 
 Configuration of partitions is similar to how this is done in  U-Boot
-for  JFFS2  on top NOR flash. If a single partition is used, it can be
-configured using the following #defines in the configuration file:
-
-#define CONFIG_JFFS2_NAND_DEV 0/* nand device jffs2 
lives on */
-#define CONFIG_JFFS2_NAND_OFF 0/* start of jffs2 
partition */
-#define CONFIG_JFFS2_NAND_SIZE 2*1024*1024 /* size of jffs2 partition */
-
-If more than a single partition is desired, the user can define a
-CONFIG_SYS_JFFS_CUSTOM_PART macro and implement a
-
-   struct part_info* jffs2_part_info(int part_num)
-
-function in a board-specific module. An example of such function is
-available in common/cmd_jffs2.c
-
-The default configuration for the DAVE board has a single JFFS2
-partition of 2 MB size.
+for  JFFS2  on top NOR flash.
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 05/16] README: Drop unused CONFIG_SYS_LS_MC_FW_... options

2016-10-02 Thread Simon Glass
Drop a few that are not used in U-Boot.

Signed-off-by: Simon Glass 
---

 README | 20 
 include/configs/ls2080a_simu.h |  3 ---
 2 files changed, 23 deletions(-)

diff --git a/README b/README
index cdd58db..703c5f4 100644
--- a/README
+++ b/README
@@ -4805,10 +4805,6 @@ within that device.
Specifies that QE/FMAN firmware is located on the primary SD/MMC
device.  CONFIG_SYS_FMAN_FW_ADDR is the byte offset on that device.
 
-- CONFIG_SYS_QE_FMAN_FW_IN_SPIFLASH
-   Specifies that QE/FMAN firmware is located on the primary SPI
-   device.  CONFIG_SYS_FMAN_FW_ADDR is the byte offset on that device.
-
 - CONFIG_SYS_QE_FMAN_FW_IN_REMOTE
Specifies that QE/FMAN firmware is located in the remote (master)
memory space.   CONFIG_SYS_FMAN_FW_ADDR is a virtual address which
@@ -4827,22 +4823,6 @@ within that device.
 - CONFIG_FSL_MC_ENET
Enable the MC driver for Layerscape SoCs.
 
-- CONFIG_SYS_LS_MC_FW_ADDR
-   The address in the storage device where the firmware is located.  The
-   meaning of this address depends on which CONFIG_SYS_LS_MC_FW_IN_xxx 
macro
-   is also specified.
-
-- CONFIG_SYS_LS_MC_FW_LENGTH
-   The maximum possible size of the firmware.  The firmware binary format
-   has a field that specifies the actual size of the firmware, but it
-   might not be possible to read any part of the firmware unless some
-   local storage is allocated to hold the entire firmware first.
-
-- CONFIG_SYS_LS_MC_FW_IN_NOR
-   Specifies that MC firmware is located in NOR flash, mapped as
-   normal addressable memory via the LBC. CONFIG_SYS_LS_MC_FW_ADDR is the
-   virtual address in NOR flash.
-
 Freescale Layerscape Debug Server Support:
 ---
 The Freescale Layerscape Debug Server Support supports the loading of
diff --git a/include/configs/ls2080a_simu.h b/include/configs/ls2080a_simu.h
index 1851d41..f0ec6c4 100644
--- a/include/configs/ls2080a_simu.h
+++ b/include/configs/ls2080a_simu.h
@@ -146,9 +146,6 @@
 #define CONFIG_SYS_DEBUG_SERVER_FW_ADDR0x580C0ULL
 
 /* MC firmware */
-#define CONFIG_SYS_LS_MC_FW_IN_NOR
-#define CONFIG_SYS_LS_MC_FW_ADDR   0x58020ULL
-
 #define CONFIG_SYS_LS_MC_DPL_IN_NOR
 #define CONFIG_SYS_LS_MC_DPL_ADDR  0x5806CULL
 
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 02/16] README: Drop CONFIG_COGENT and related options

2016-10-02 Thread Simon Glass
These are no-longer present in U-Boot. Drop them.

Signed-off-by: Simon Glass 
---

 README | 25 -
 1 file changed, 25 deletions(-)

diff --git a/README b/README
index 5499a4c..e0c78fb 100644
--- a/README
+++ b/README
@@ -325,27 +325,6 @@ The following options need to be configured:
 - CPU Daughterboard Type: (if CONFIG_ATSTK1000 is defined)
Define exactly one, e.g. CONFIG_ATSTK1002
 
-- CPU Module Type: (if CONFIG_COGENT is defined)
-   Define exactly one of
-   CONFIG_CMA286_60_OLD
 FIXME --- not tested yet:
-   CONFIG_CMA286_60, CONFIG_CMA286_21, CONFIG_CMA286_60P,
-   CONFIG_CMA287_23, CONFIG_CMA287_50
-
-- Motherboard Type: (if CONFIG_COGENT is defined)
-   Define exactly one of
-   CONFIG_CMA101, CONFIG_CMA102
-
-- Motherboard I/O Modules: (if CONFIG_COGENT is defined)
-   Define one or more of
-   CONFIG_CMA302
-
-- Motherboard Options: (if CONFIG_CMA101 or CONFIG_CMA102 are defined)
-   Define one or more of
-   CONFIG_LCD_HEARTBEAT- update a character position on
- the LCD display every second with
- a "rotator" |\-/|\-/
-
 - Marvell Family Member
CONFIG_SYS_MVFS - define it if you want to enable
  multiple fs option at one time
@@ -3746,10 +3725,6 @@ Configuration Settings:
 - CONFIG_SYS_SDRAM_BASE:
Physical start address of SDRAM. _Must_ be 0 here.
 
-- CONFIG_SYS_MBIO_BASE:
-   Physical start address of Motherboard I/O (if using a
-   Cogent motherboard)
-
 - CONFIG_SYS_FLASH_BASE:
Physical start address of Flash memory.
 
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 01/16] README: Drop old Intel Monahans comment

2016-10-02 Thread Simon Glass
This is no longer in the U-Boot source code, so drop this note from the
README.

Signed-off-by: Simon Glass 
---

 README | 14 --
 1 file changed, 14 deletions(-)

diff --git a/README b/README
index bc626dc..5499a4c 100644
--- a/README
+++ b/README
@@ -578,20 +578,6 @@ The following options need to be configured:
CONFIG_SYS_FSL_SEC_LE
Defines the SEC controller register space as Little Endian
 
-- Intel Monahans options:
-   CONFIG_SYS_MONAHANS_RUN_MODE_OSC_RATIO
-
-   Defines the Monahans run mode to oscillator
-   ratio. Valid values are 8, 16, 24, 31. The core
-   frequency is this value multiplied by 13 MHz.
-
-   CONFIG_SYS_MONAHANS_TURBO_RUN_MODE_RATIO
-
-   Defines the Monahans turbo mode to oscillator
-   ratio. Valid values are 1 (default if undefined) and
-   2. The core frequency as calculated above is multiplied
-   by this value.
-
 - MIPS CPU options:
CONFIG_SYS_INIT_SP_OFFSET
 
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 03/16] README: Correct CONFIG_ENV_OFFSET_RENDUND typo

2016-10-02 Thread Simon Glass
Change this to CONFIG_ENV_OFFSET_REDUND.

Signed-off-by: Simon Glass 
---

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

diff --git a/README b/README
index e0c78fb..57dd79c 100644
--- a/README
+++ b/README
@@ -4156,7 +4156,7 @@ to save the current settings.
  This setting describes a second storage area of CONFIG_ENV_SIZE
  size used to hold a redundant copy of the environment data, so
  that there is a valid backup copy in case there is a power failure
- during a "saveenv" operation. CONFIG_ENV_OFFSET_RENDUND must be
+ during a "saveenv" operation. CONFIG_ENV_OFFSET_REDUND must be
  aligned to an erase sector boundary.
 
- CONFIG_ENV_SPI_BUS (optional):
@@ -4207,7 +4207,7 @@ but it can not erase, write this NOR flash by SRIO or 
PCIE interface.
  This setting describes a second storage area of CONFIG_ENV_SIZE
  size used to hold a redundant copy of the environment data, so
  that there is a valid backup copy in case there is a power failure
- during a "saveenv" operation.  CONFIG_ENV_OFFSET_RENDUND must be
+ during a "saveenv" operation.  CONFIG_ENV_OFFSET_REDUND must be
  aligned to an erase block boundary.
 
- CONFIG_ENV_RANGE (optional):
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 4/6] libfdt: Bring in upstream stringlist functions

2016-10-02 Thread Simon Glass
These have now landed upstream. The naming is different and in one case the
function signature has changed. Update the code to match.

This applies the following upstream commits by
Thierry Reding  :

   604e61e fdt: Add functions to retrieve strings
   8702bd1 fdt: Add a function to get the index of a string
   2218387 fdt: Add a function to count strings

Signed-off-by: Simon Glass 
---

 arch/arm/mach-tegra/xusb-padctl-common.c |  14 ++---
 arch/arm/mach-uniphier/board_late_init.c |   5 +-
 arch/x86/cpu/irq.c   |   5 +-
 common/image-fit.c   |  19 +++---
 common/image.c   |  19 +++---
 drivers/clk/clk-uclass.c |   6 +-
 drivers/core/device.c|   2 +-
 drivers/gpio/dwapb_gpio.c|   3 +-
 drivers/i2c/mxc_i2c.c|   2 +-
 drivers/mailbox/mailbox-uclass.c |   6 +-
 drivers/net/sun8i_emac.c |   5 +-
 drivers/pinctrl/exynos/pinctrl-exynos.c  |   9 ++-
 drivers/pinctrl/meson/pinctrl-meson.c|   2 +-
 drivers/pinctrl/pinctrl-generic.c|  10 +--
 drivers/pinctrl/pinctrl-uclass.c |   2 +-
 drivers/reset/reset-uclass.c |   6 +-
 drivers/video/sunxi_display.c|   2 +-
 include/libfdt.h |  86 +++--
 lib/fdtdec.c |   2 +-
 lib/libfdt/fdt_ro.c  | 104 +++
 test/overlay/cmd_ut_overlay.c|   5 +-
 21 files changed, 179 insertions(+), 135 deletions(-)

diff --git a/arch/arm/mach-tegra/xusb-padctl-common.c 
b/arch/arm/mach-tegra/xusb-padctl-common.c
index 18ad7bf..6867065 100644
--- a/arch/arm/mach-tegra/xusb-padctl-common.c
+++ b/arch/arm/mach-tegra/xusb-padctl-common.c
@@ -78,11 +78,11 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl 
*padctl,
 const void *fdt, int node)
 {
unsigned int i;
-   int len, err;
+   int len;
 
group->name = fdt_get_name(fdt, node, );
 
-   len = fdt_count_strings(fdt, node, "nvidia,lanes");
+   len =  fdt_stringlist_count(fdt, node, "nvidia,lanes");
if (len < 0) {
error("failed to parse \"nvidia,lanes\" property");
return -EINVAL;
@@ -91,9 +91,9 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl 
*padctl,
group->num_pins = len;
 
for (i = 0; i < group->num_pins; i++) {
-   err = fdt_get_string_index(fdt, node, "nvidia,lanes", i,
-  >pins[i]);
-   if (err < 0) {
+   group->pins[i] = fdt_stringlist_get(fdt, node, "nvidia,lanes",
+   i, NULL);
+   if (!group->pins[i]) {
error("failed to read string from \"nvidia,lanes\" 
property");
return -EINVAL;
}
@@ -101,8 +101,8 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl 
*padctl,
 
group->num_pins = len;
 
-   err = fdt_get_string(fdt, node, "nvidia,function", >func);
-   if (err < 0) {
+   group->func = fdt_stringlist_get(fdt, node, "nvidia,function", 0, NULL);
+   if (!group->func) {
error("failed to parse \"nvidia,func\" property");
return -EINVAL;
}
diff --git a/arch/arm/mach-uniphier/board_late_init.c 
b/arch/arm/mach-uniphier/board_late_init.c
index a454126..f23295f 100644
--- a/arch/arm/mach-uniphier/board_late_init.c
+++ b/arch/arm/mach-uniphier/board_late_init.c
@@ -37,13 +37,12 @@ static int uniphier_set_fdt_file(void)
const char *compat;
char dtb_name[256];
int buf_len = 256;
-   int ret;
 
if (getenv("fdt_file"))
return 0;   /* do nothing if it is already set */
 
-   ret = fdt_get_string(gd->fdt_blob, 0, "compatible", );
-   if (ret)
+   compat = fdt_stringlist_get(gd->fdt_blob, 0, "compatible", 0, NULL);
+   if (!compat)
return -EINVAL;
 
if (strncmp(compat, VENDOR_PREFIX, strlen(VENDOR_PREFIX)))
diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c
index df3cd0a..9364410 100644
--- a/arch/x86/cpu/irq.c
+++ b/arch/x86/cpu/irq.c
@@ -103,11 +103,12 @@ static int create_pirq_routing_table(struct udevice *dev)
/* extract the bdf from fdt_pci_addr */
priv->bdf = dm_pci_get_bdf(dev->parent);
 
-   ret = fdt_find_string(blob, node, "intel,pirq-config", "pci");
+   ret = fdt_stringlist_search(blob, node, "intel,pirq-config", "pci");
if (!ret) {
priv->config = PIRQ_VIA_PCI;
} else {
-   ret = fdt_find_string(blob, node, "intel,pirq-config", "ibase");
+   ret = fdt_stringlist_search(blob, node, "intel,pirq-config",
+   "ibase");
if (!ret)
   

[U-Boot] [PATCH 5/6] libfdt: Sync fdt_for_each_subnode() with upstream

2016-10-02 Thread Simon Glass
The signature for this macro has changed. Bring in the upstream version and
adjust U-Boot's usages to suit.

Signed-off-by: Simon Glass 
---

 arch/arm/mach-tegra/xusb-padctl-common.c |  4 ++--
 common/image-fit.c   |  2 +-
 common/image-sig.c   |  8 
 drivers/net/cpsw.c   |  2 +-
 drivers/net/keystone_net.c   |  4 ++--
 drivers/net/mvpp2.c  |  2 +-
 drivers/pci/pci_tegra.c  |  2 +-
 drivers/phy/marvell/comphy_core.c|  2 +-
 drivers/pinctrl/meson/pinctrl-meson.c|  2 +-
 drivers/spi/fsl_qspi.c   |  2 +-
 include/libfdt.h | 25 ++---
 lib/fdtdec.c |  2 +-
 lib/libfdt/fdt_overlay.c |  8 
 13 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/arch/arm/mach-tegra/xusb-padctl-common.c 
b/arch/arm/mach-tegra/xusb-padctl-common.c
index 6867065..dfbc8ef 100644
--- a/arch/arm/mach-tegra/xusb-padctl-common.c
+++ b/arch/arm/mach-tegra/xusb-padctl-common.c
@@ -223,7 +223,7 @@ tegra_xusb_padctl_config_parse_dt(struct tegra_xusb_padctl 
*padctl,
 
config->name = fdt_get_name(fdt, node, NULL);
 
-   fdt_for_each_subnode(fdt, subnode, node) {
+   fdt_for_each_subnode(subnode, fdt, node) {
struct tegra_xusb_padctl_group *group;
int err;
 
@@ -253,7 +253,7 @@ static int tegra_xusb_padctl_parse_dt(struct 
tegra_xusb_padctl *padctl,
return err;
}
 
-   fdt_for_each_subnode(fdt, subnode, node) {
+   fdt_for_each_subnode(subnode, fdt, node) {
struct tegra_xusb_padctl_config *config = >config;
 
err = tegra_xusb_padctl_config_parse_dt(padctl, config, fdt,
diff --git a/common/image-fit.c b/common/image-fit.c
index d67678a..77dc011 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1026,7 +1026,7 @@ int fit_image_verify(const void *fit, int image_noffset)
}
 
/* Process all hash subnodes of the component image node */
-   fdt_for_each_subnode(fit, noffset, image_noffset) {
+   fdt_for_each_subnode(noffset, fit, image_noffset) {
const char *name = fit_get_name(fit, noffset, NULL);
 
/*
diff --git a/common/image-sig.c b/common/image-sig.c
index eda5e13..28f7a20 100644
--- a/common/image-sig.c
+++ b/common/image-sig.c
@@ -212,7 +212,7 @@ static int fit_image_verify_sig(const void *fit, int 
image_noffset,
int ret;
 
/* Process all hash subnodes of the component image node */
-   fdt_for_each_subnode(fit, noffset, image_noffset) {
+   fdt_for_each_subnode(noffset, fit, image_noffset) {
const char *name = fit_get_name(fit, noffset, NULL);
 
if (!strncmp(name, FIT_SIG_NODENAME,
@@ -260,7 +260,7 @@ int fit_image_verify_required_sigs(const void *fit, int 
image_noffset,
return 0;
}
 
-   fdt_for_each_subnode(sig_blob, noffset, sig_node) {
+   fdt_for_each_subnode(noffset, sig_blob, sig_node) {
const char *required;
int ret;
 
@@ -393,7 +393,7 @@ static int fit_config_verify_sig(const void *fit, int 
conf_noffset,
int ret;
 
/* Process all hash subnodes of the component conf node */
-   fdt_for_each_subnode(fit, noffset, conf_noffset) {
+   fdt_for_each_subnode(noffset, fit, conf_noffset) {
const char *name = fit_get_name(fit, noffset, NULL);
 
if (!strncmp(name, FIT_SIG_NODENAME,
@@ -438,7 +438,7 @@ int fit_config_verify_required_sigs(const void *fit, int 
conf_noffset,
return 0;
}
 
-   fdt_for_each_subnode(sig_blob, noffset, sig_node) {
+   fdt_for_each_subnode(noffset, sig_blob, sig_node) {
const char *required;
int ret;
 
diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index d17505e..c3018fb 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -1219,7 +1219,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice 
*dev)
active_slave = fdtdec_get_int(fdt, node, "active_slave", 0);
priv->data.active_slave = active_slave;
 
-   fdt_for_each_subnode(fdt, subnode, node) {
+   fdt_for_each_subnode(subnode, fdt, node) {
int len;
const char *name;
 
diff --git a/drivers/net/keystone_net.c b/drivers/net/keystone_net.c
index e41b7d1..f88d83e 100644
--- a/drivers/net/keystone_net.c
+++ b/drivers/net/keystone_net.c
@@ -990,7 +990,7 @@ static int ks2_eth_bind_slaves(struct udevice *dev, int 
gbe, int *gbe_0)
char *slave_name;
 
interfaces = fdt_subnode_offset(fdt, gbe, "interfaces");
-   fdt_for_each_subnode(fdt, slave, interfaces) {
+   fdt_for_each_subnode(slave, fdt, interfaces) {
int slave_no;
 
slave_no = fdtdec_get_int(fdt, slave, 

[U-Boot] [PATCH 00/16] README: Clean up old CONFIG options

2016-10-02 Thread Simon Glass
The README mentions various options that are not used in U-Boot. This
series tidies these up.

There are also some other README files that are out of date, or reference
old options. This series tidies up/removes some of these also.


Simon Glass (16):
  README: Drop old Intel Monahans comment
  README: Drop CONFIG_COGENT and related options
  README: Correct CONFIG_ENV_OFFSET_RENDUND typo
  README: Drop unused JFFS2 options
  README: Drop unused CONFIG_SYS_LS_MC_FW_... options
  README: Drop CONFIG_OF_BOOT_CPU
  README: Drop CONFIG_LAN91C96_BASE
  README: Drop CONFIG_SYS_USB_BRG_CLK
  README: sh: Drop CONFIG_SYS_I2C_SH_BASE5
  README: i2c: Drop unused i2c CONFIG options
  README: Drop CONFIG_SYS_INIT_DATA_SIZE
  README: Drop CONFIG_SYS_USE_OSCCLK
  atmel: Drop README.at91-soc
  README: Drop README.imx31
  README: Drop CONFIG_MPC8349ADS
  README: Fix CONFIG_SYS_NAND_MAX_DEVICE typo

 README | 104 +++--
 doc/README.JFFS2   |  43 ++---
 doc/README.JFFS2_NAND  |  20 +---
 doc/README.at91-soc|  48 ---
 doc/README.imx31   |  29 
 doc/README.mpc83xxads  |   1 -
 doc/README.nand|   2 +-
 include/configs/ls2080a_simu.h |   3 --
 8 files changed, 12 insertions(+), 238 deletions(-)
 delete mode 100644 doc/README.at91-soc
 delete mode 100644 doc/README.imx31

-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 6/6] libfdt: Drop inlining of fdt_path_offset()

2016-10-02 Thread Simon Glass
The fdt_path_offset() function is not inlined in upstream libfdt. Adjust
U-Boot's version to match.

Signed-off-by: Simon Glass 
---

 include/libfdt.h| 5 +
 lib/libfdt/fdt_ro.c | 5 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/libfdt.h b/include/libfdt.h
index 398748c..8746790 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -410,10 +410,7 @@ int fdt_path_offset_namelen(const void *fdt, const char 
*path, int namelen);
  * -FDT_ERR_BADSTRUCTURE,
  * -FDT_ERR_TRUNCATED, standard meanings.
  */
-static inline int fdt_path_offset(const void *fdt, const char *path)
-{
-   return fdt_path_offset_namelen(fdt, path, strlen(path));
-}
+int fdt_path_offset(const void *fdt, const char *path);
 
 /**
  * fdt_get_name - retrieve the name of a given node
diff --git a/lib/libfdt/fdt_ro.c b/lib/libfdt/fdt_ro.c
index e38aaa4..7e894b7 100644
--- a/lib/libfdt/fdt_ro.c
+++ b/lib/libfdt/fdt_ro.c
@@ -204,6 +204,11 @@ int fdt_path_offset_namelen(const void *fdt, const char 
*path, int namelen)
return offset;
 }
 
+int fdt_path_offset(const void *fdt, const char *path)
+{
+   return fdt_path_offset_namelen(fdt, path, strlen(path));
+}
+
 const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
 {
const struct fdt_node_header *nh = _fdt_offset_ptr(fdt, nodeoffset);
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] [PATCH 3/6] libfdt: Sync up with upstream

2016-10-02 Thread Simon Glass
This includes small changes to the following functions, from upstream
commit 6d1832c:

- fdt_get_max_phandle() (upstream commit 84e0e134)
- fdt_node_check_compatible (upstream commit 53bf130b)
- fdt_setprop_inplace_namelen_partial() to remove useless brackets and
 use idx instead of index
- _fdt_resize_property() to use idx instead of index
- _fdt_splice() (upstream commit d4c7c25c)

It also includes various typo fixes in libfdt.h

Signed-off-by: Simon Glass 
---

 include/libfdt.h | 77 ++--
 lib/libfdt/fdt_ro.c  | 10 +++
 lib/libfdt/fdt_rw.c  |  4 ++-
 lib/libfdt/fdt_wip.c |  6 ++--
 4 files changed, 55 insertions(+), 42 deletions(-)

diff --git a/include/libfdt.h b/include/libfdt.h
index b6a400a..3b1c788 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -61,7 +61,7 @@
 #define FDT_ERR_NOTFOUND   1
/* FDT_ERR_NOTFOUND: The requested node or property does not exist */
 #define FDT_ERR_EXISTS 2
-   /* FDT_ERR_EXISTS: Attemped to create a node or property which
+   /* FDT_ERR_EXISTS: Attempted to create a node or property which
 * already exists */
 #define FDT_ERR_NOSPACE3
/* FDT_ERR_NOSPACE: Operation needed to expand the device
@@ -213,7 +213,7 @@ int fdt_next_subnode(const void *fdt, int offset);
 #define __fdt_set_hdr(name) \
static inline void fdt_set_##name(void *fdt, uint32_t val) \
{ \
-   struct fdt_header *fdth = (struct fdt_header*)fdt; \
+   struct fdt_header *fdth = (struct fdt_header *)fdt; \
fdth->name = cpu_to_fdt32(val); \
}
 __fdt_set_hdr(magic);
@@ -288,11 +288,13 @@ const char *fdt_string(const void *fdt, int stroffset);
  * @fdt: pointer to the device tree blob
  *
  * fdt_get_max_phandle retrieves the highest phandle in the given
- * device tree
+ * device tree. This will ignore badly formatted phandles, or phandles
+ * with a value of 0 or -1.
  *
  * returns:
  *  the highest phandle on success
- *  0, if an error occurred
+ *  0, if no phandle was found in the device tree
+ *  -1, if an error occurred
  */
 uint32_t fdt_get_max_phandle(const void *fdt);
 
@@ -356,8 +358,9 @@ int fdt_subnode_offset_namelen(const void *fdt, int 
parentoffset,
  * returns:
  * structure block offset of the requested subnode (>=0), on success
  * -FDT_ERR_NOTFOUND, if the requested subnode does not exist
- * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE 
tag
- *  -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE
+ * tag
+ * -FDT_ERR_BADMAGIC,
  * -FDT_ERR_BADVERSION,
  * -FDT_ERR_BADSTATE,
  * -FDT_ERR_BADSTRUCTURE,
@@ -366,13 +369,13 @@ int fdt_subnode_offset_namelen(const void *fdt, int 
parentoffset,
 int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
 
 /**
- * fdt_path_offset_namelen - find a tree node based on substring
+ * fdt_path_offset_namelen - find a tree node by its full path
  * @fdt: pointer to the device tree blob
  * @path: full path of the node to locate
- * @namelen: number of characters of name to consider
+ * @namelen: number of characters of path to consider
  *
- * Identical to fdt_path_offset(), but only examine the first
- * namelen characters of path for matching the node path.
+ * Identical to fdt_path_offset(), but only consider the first namelen
+ * characters of path as the path name.
  */
 int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen);
 
@@ -389,7 +392,8 @@ int fdt_path_offset_namelen(const void *fdt, const char 
*path, int namelen);
  * address).
  *
  * returns:
- * structure block offset of the node with the requested path (>=0), on 
success
+ * structure block offset of the node with the requested path (>=0), on
+ * success
  * -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
  * -FDT_ERR_NOTFOUND, if the requested node does not exist
  *  -FDT_ERR_BADMAGIC,
@@ -416,10 +420,12 @@ static inline int fdt_path_offset(const void *fdt, const 
char *path)
  *
  * returns:
  * pointer to the node's name, on success
- * If lenp is non-NULL, *lenp contains the length of that name 
(>=0)
+ * If lenp is non-NULL, *lenp contains the length of that name
+ * (>=0)
  * NULL, on error
  * if lenp is non-NULL *lenp contains an error code (<0):
- * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE 
tag
+ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
+ * tag
  * -FDT_ERR_BADMAGIC,
  * -FDT_ERR_BADVERSION,
  * -FDT_ERR_BADSTATE, standard meanings
@@ -468,23 +474,26 @@ int fdt_first_property_offset(const void *fdt, int 
nodeoffset);
 int fdt_next_property_offset(const void 

[U-Boot] [PATCH 2/6] libfdt: Fix undefined behaviour in fdt_offset_ptr()

2016-10-02 Thread Simon Glass
From: David Gibson 

Using pointer arithmetic to generate a pointer outside a known object is,
technically, undefined behaviour in C.  Unfortunately, we were using that
in fdt_offset_ptr() to detect overflows.

To fix this we need to do our bounds / overflow checking on the offsets
before constructing pointers from them.

Reported-by: David Binderman 
Signed-off-by: David Gibson 
Signed-off-by: Simon Glass 
---

 lib/libfdt/fdt.c | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/libfdt/fdt.c b/lib/libfdt/fdt.c
index 96017a1..2055734 100644
--- a/lib/libfdt/fdt.c
+++ b/lib/libfdt/fdt.c
@@ -35,18 +35,19 @@ int fdt_check_header(const void *fdt)
 
 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len)
 {
-   const char *p;
+   unsigned absoffset = offset + fdt_off_dt_struct(fdt);
+
+   if ((absoffset < offset)
+   || ((absoffset + len) < absoffset)
+   || (absoffset + len) > fdt_totalsize(fdt))
+   return NULL;
 
if (fdt_version(fdt) >= 0x11)
if (((offset + len) < offset)
|| ((offset + len) > fdt_size_dt_struct(fdt)))
return NULL;
 
-   p = _fdt_offset_ptr(fdt, offset);
-
-   if (p + len < p)
-   return NULL;
-   return p;
+   return _fdt_offset_ptr(fdt, offset);
 }
 
 uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset)
-- 
2.8.0.rc3.226.g39d4020

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


[U-Boot] Please pull u-boot-rockchip

2016-10-02 Thread Simon Glass
Hi Tom,

Here is a second installment for rockchip - more rk3399 support and
some other fairly minor changes.


The following changes since commit 45b047e557bdcf68dc08e61cf207dd35b9ba8bbc:

  Merge branch 'master' of git://git.denx.de/u-boot-nds32 (2016-09-30
21:59:11 -0400)

are available in the git repository at:

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

for you to fetch changes up to 67171e13a3e0665b18c657a6704a22ca7900f4c3:

  rockchip: add boot-mode support for rk3288, rk3036 (2016-10-01 18:36:55 -0600)


Jacob Chen (4):
  rockchip: move partitons define from 3036-kylin to 3036-common
  rockchip: rename board.c to rk3288-board.c
  rockchip: move common function from board-file to rk3036-board.c
  rockchip: add boot-mode support for rk3288, rk3036

Kever Yang (7):
  rockchip: rk3399: update PPLL and pmu_pclk frequency
  rockchip: rkpwm: fix the register sequence
  power: regulator: add pwm regulator
  rockchip: evb_rk3399: init vdd_center regulator
  Kconfig: rockchip: enable DM_PWM and DM_REGULATOR
  dts: evb-rk3399: add init voltage node for vdd-center
  config: evb-rk3399: enable pwm regulator

Sandy Patterson (3):
  rockchip: Fix SPL console output when ROCKCHIP_SPL_BACK_TO_BROM is enabled
  Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.
  Enable ROCKCHIP_SPL_BACK_TO_BROM for rock2 board

Xu Ziyuan (2):
  rockchip: rk3288: sdram: fix DDR address range
  rockchip: miniarm: remove eMMC support

jacob2.chen (1):
  rockchip: add usb mass storage feature support for rk3036

 arch/arm/Kconfig   |   2 +
 arch/arm/dts/rk3288-miniarm.dtsi   |  12 
 arch/arm/dts/rk3399-evb.dts|   1 +
 arch/arm/include/asm/arch-rockchip/boot_mode.h |  19 +
 arch/arm/include/asm/arch-rockchip/cru_rk3399.h|   4 +-
 arch/arm/include/asm/arch-rockchip/pwm.h   |   2 +-
 arch/arm/mach-rockchip/Kconfig |   3 +
 arch/arm/mach-rockchip/Makefile|   3 +-
 arch/arm/mach-rockchip/rk3036-board.c  | 122
+++
 arch/arm/mach-rockchip/rk3288-board-spl.c  |   5 +-
 arch/arm/mach-rockchip/{board.c => rk3288-board.c} |  50 +++--
 arch/arm/mach-rockchip/rk3288/sdram_rk3288.c   |   7 +-
 board/rockchip/evb_rk3036/evb_rk3036.c |  66 -
 board/rockchip/evb_rk3399/evb-rk3399.c |   6 ++
 board/rockchip/kylin_rk3036/kylin_rk3036.c |  80 +
 board/rockchip/miniarm_rk3288/miniarm-rk3288.c |   8 ---
 configs/evb-rk3399_defconfig   |   1 +
 configs/rock2_defconfig|   2 +
 drivers/power/regulator/Kconfig|  10 +++
 drivers/power/regulator/Makefile   |   1 +
 drivers/power/regulator/pwm_regulator.c| 159
+
 include/configs/kylin_rk3036.h |  27 ---
 include/configs/miniarm_rk3288.h   |   7 +-
 include/configs/rk3036_common.h|  17 +
 include/configs/rk3288_common.h|   3 +
 include/configs/rock2.h|   9 +++
 26 files changed, 421 insertions(+), 205 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-rockchip/boot_mode.h
 create mode 100644 arch/arm/mach-rockchip/rk3036-board.c
 rename arch/arm/mach-rockchip/{board.c => rk3288-board.c} (80%)
 create mode 100644 drivers/power/regulator/pwm_regulator.c

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


Re: [U-Boot] [PATCH v2] cmd/fdt: add possibilty to have 'extrasize' on fdt resize

2016-10-02 Thread Simon Glass
On 22 September 2016 at 07:50, Simon Glass  wrote:
> On 20 September 2016 at 10:10, Hannes Schmelzer  wrote:
>>
>> From: Hannes Schmelzer 
>>
>> Sometimes devicetree nodes and or properties are added out of the u-boot
>> console, maybe through some script or manual interaction.
>>
>> The devicetree as loaded or embedded is quite small, so the devicetree
>> has to be resized to take up those new nodes/properties.
>>
>> In original the devicetree was only extended by effective
>> 4 * add_mem_rsv.
>>
>> With this commit we can add an argument to the "fdt resize" command,
>> which takes the extrasize to be added.
>>
>> Signed-off-by: Hannes Schmelzer 
>>
>> Signed-off-by: Hannes Schmelzer 
>> ---
>>
>> Changes in v2:
>> - add function comment in fdt_support.h
>>
>>  board/compulab/cm_fx6/cm_fx6.c |  2 +-
>>  cmd/fdt.c  |  9 +++--
>>  common/fdt_support.c   |  3 ++-
>>  common/image-fdt.c |  2 +-
>>  include/fdt_support.h  | 10 +-
>>  5 files changed, 20 insertions(+), 6 deletions(-)
>
> Acked-by: Simon Glass 

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


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-02 Thread AneoX
Like a sd card. I have emmc to sd adapter, so

dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8

and then just solder emmc to my board.

2 окт. 2016 г. 23:08 пользователь "Jagan Teki" 
написал:

On Sun, Oct 2, 2016 at 7:13 PM, Alexandr Bochkarev
 wrote:
> Already tried. The same output:
>
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###

Need few more info, how exactly you wrote SPL on emmc, could you provide
that.


--
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] MMC boot / mvebu / clearfog

2016-10-02 Thread Christoph Egger
Hi!

  MMC boot on the ClearFog (base) still seems to fail (uart boot works
fine apart from uart detection). The SPL seems to finish successfully
and jump to u-boot but there is no further output then. I'm trying to
enable even more `DEBUG` but help is indeed welcome!

Regards

  Christoph

=
spl_init()

U-Boot SPL 2016.09-dirty (Oct 02 2016 - 22:04:41)
High speed PHY - Version: 2.0
Detected Device ID 6828
board SerDes lanes topology details:
 | Lane #  | Speed |  Type   |
 
 |   0|  3   |  SATA0   |
 |   1|  0   |  SGMII1  |
 |   2|  5   |  PCIe1   |
 |   3|  5   |  USB3 HOST1  |
 |   4|  5   |  PCIe2   |
 |   5|  0   |  SGMII2  |
 
PCIe, Idx 1: detected no link
PCIe, Idx 2: detected no link
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver TIP-1.29.0
DDR3 Training Sequence - Switching XBAR Window to FastPath Window
DDR3 Training Sequence - Ended Successfully
BOOTROM_REG=0xe7001000 boot_device=0xe
SAR_REG=0xdb00331e boot_device=0x31
>>spl:board_init_r()
BOOTROM_REG=0xe7001000 boot_device=0xe
SAR_REG=0xdb00331e boot_device=0x31
Trying to boot from MMC1
sdhci_transfer_data: Error detected in status(0x408000)!
spl: mmc boot mode: raw
hdr read sector 141, count=1
mkimage signature not found - ih_magic = e1ad
read 190 sectors to 80
Jumping to U-Boot
SPL malloc() used 0x394 bytes (0 KB)
loaded - jumping to U-Boot...image entry point: 0x80

-- 
9FED 5C6C E206 B70A 5857  70CA 9655 22B9 D49A E731
Debian Developer | Lisp Hacker | CaCert Assurer
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-02 Thread AneoX
Emmc Card was the new one, so i just burn a dump of working sd. Previously
sd have been wired to board for test.

Board is a custom,  like olinuxino lime which with nand and sd slot, 512 mb
ram. So i using it defconfig and in case of sd card, it works.
Emmc lines has external pullups according to the datasheet.

2 окт. 2016 г. 23:28 пользователь "Jagan Teki" 
написал:

On Sun, Oct 2, 2016 at 10:45 PM, AneoX  wrote:
> Like a sd card. I have emmc to sd adapter, so
>
> dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8

I guess you cleaned[1] the card before doing this?

>
> and then just solder emmc to my board.

OK, which a20 board?

[1] http://linux-sunxi.org/Bootable_SD_card

thanks!
--
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-02 Thread Alexandr Bochkarev
Already tried. The same output:

> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###





> 2 окт. 2016 г., в 19:38, Jagan Teki  написал(а):
> 
> On Sun, Oct 2, 2016 at 1:07 PM, Alexandr Bochkarev
>  wrote:
>> Hi!
>> 
>> I am trying to boot my A20 board from eMMC KLM4G1FE3B-B001, but has no 
>> success.
>> Commenting mmc_change_freq has no effect.
>> U-Boot 2016.03 just says Could not determine boot source
>> 
>> I have found, that it stucks in sunxi_mmc_has_egon_boot_signature.
>> 
>> int sunxi_mmc_has_egon_boot_signature(struct mmc *mmc)
>> {
>>char *buf = malloc(512);
>>int valid_signature = 0;
>> 
>>if (buf == NULL)
>>panic("Failed to allocate memory\n");
>> 
>>if (mmc_getcd(mmc) && mmc_init(mmc) == 0 &&
>>mmc->block_dev.block_read(>block_dev, 16, 1, buf) == 1 &&
>>strncmp([4], "eGON.BT0", 8) == 0)
>>valid_signature = 1;
>> 
>>free(buf);
>>return valid_signature;
>> }
>> 
>> mmc_init(mmc) return no errors, seems good, but
>> block_read returns 0, seems it cant read emmc.
>> 
>> 
>> U-Boot 2016.09 says:
>> 
>> mmc_load_image_raw_sector: mmc block read error
>> SPL: failed to boot from all boot devices
>> ### ERROR ### Please RESET the board ###
> 
> Can you try it on master once?
> 
> -- 
> Jagan Teki
> Free Software Engineer | www.openedev.com
> U-Boot, Linux | Upstream Maintainer
> Hyderabad, India.

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


Re: [U-Boot] is there any issue with creating and using more than one hashtable?

2016-10-02 Thread Wolfgang Denk
Dear Robert,

In message  you wrote:
> 
>   i'm going to assume other net-related commands have this behaviour
> as well, yes? like ping? which would explain why ping'ing even the
> alleged gateway didn't work in this context.

Yes. This is common network code.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
One possible reason that things aren't going  according  to  plan  is
that there never was a plan in the first place.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: sun7i: dts: add support for Sinovoip/Bananapi BPI-R1

2016-10-02 Thread Stephen Arnold
I guess I'm not sure what you're saying then;  do you want a smaller
config?  Or something else?  Currently bananapi-r1 does not work at
all without its own config and .dts file.  Do you have a different
solution?  BTW, I also have kernel dts patches but everything hinges
on correctly setting up the ethernet.

https://github.com/VCTLabs/armv7-lpae-multiplatform

Basically, I really only care that all this stuff works (especially
the ethernet on a board with a switch chip) - okay, that plus sata dts
tweaks and a good quality usb cable for stable power.  Without
changing that GMAC delay parameter, you get something that looks like
it should work, but only a handful of packets ever actually make it
from one end to the other.

Steve

On Sun, Oct 2, 2016 at 11:04 AM, Jagan Teki  wrote:
> On Sun, Oct 2, 2016 at 11:26 PM, Stephen Arnold
>  wrote:
>> It can't.  Ethernet and USB are both fubar'd using lamobo-r1 on
>> bananapi-r1.  Mainly the GMAC delay is different,  If you buy one and
>> test it, you will find that they are definitely *not* compatible.
>> Period.
>
> I taking about the CONFIG_* entries which is used in defconfig, dts is
> fine anyway we need it as a separate.
>
> --
> Jagan Teki
> Free Software Engineer | www.openedev.com
> U-Boot, Linux | Upstream Maintainer
> Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: sun7i: dts: add support for Sinovoip/Bananapi BPI-R1

2016-10-02 Thread Jagan Teki
On Sun, Oct 2, 2016 at 11:26 PM, Stephen Arnold
 wrote:
> It can't.  Ethernet and USB are both fubar'd using lamobo-r1 on
> bananapi-r1.  Mainly the GMAC delay is different,  If you buy one and
> test it, you will find that they are definitely *not* compatible.
> Period.

I taking about the CONFIG_* entries which is used in defconfig, dts is
fine anyway we need it as a separate.

-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 02/12] dtoc: Adjust GetProps() in fdt_normal to use the node path

2016-10-02 Thread Simon Glass
On 25 September 2016 at 15:52, Simon Glass  wrote:
> There is no need to pass a node path separately. Instead we should use the
> path for the node provided. Correct this.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2:
> - Add new patch to adjust GetProps() in fdt_normal to use the node path
>
>  tools/dtoc/fdt_normal.py | 9 +++--
>  1 file changed, 3 insertions(+), 6 deletions(-)

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


Re: [U-Boot] [PATCH v2 03/12] dtoc: Add a way for tests to request the fallback library

2016-10-02 Thread Simon Glass
On 25 September 2016 at 15:52, Simon Glass  wrote:
> We need to test both the normal (Python libfdt module) and fallback (fdtget)
> implementations of the Fdt class. Add a way to select which implementation
> to use.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2:
> - Add a new patch to allow testing of the fallback Fdt library
>
>  tools/dtoc/fdt_select.py | 16 +---
>  1 file changed, 13 insertions(+), 3 deletions(-)

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


Re: [U-Boot] [PATCH v2 01/12] dtoc: Fix bug in GetProp()

2016-10-02 Thread Simon Glass
On 25 September 2016 at 15:52, Simon Glass  wrote:
> This does not actually call fdtget correctly when requesting a particular
> type. Fix it.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v2:
> - Add a new patch to fix a bug in GetProp()
>
>  tools/dtoc/fdt_fallback.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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


Re: [U-Boot] [PATCH] ARM: sun7i: dts: add support for Sinovoip/Bananapi BPI-R1

2016-10-02 Thread Stephen Arnold
It can't.  Ethernet and USB are both fubar'd using lamobo-r1 on
bananapi-r1.  Mainly the GMAC delay is different,  If you buy one and
test it, you will find that they are definitely *not* compatible.
Period.

Steve

On Sun, Oct 2, 2016 at 10:17 AM, Jagan Teki  wrote:
> On Sun, Oct 2, 2016 at 10:06 AM, Stephen Arnold
>  wrote:
>> From: Steve Arnold 
>>
>> * needs different GMAC_TX_DELAY than lamobo-r1 (not compatible)
>> * tested with 4.8_rc6 b53-mdio and kernel dts switch nodes
>>
>> Signed-off-by: Stephen Arnold 
>> Cc: Ian Campbell 
>> Cc: Hans De Goede 
>> ---
>>  arch/arm/dts/Makefile  |   1 +
>>  arch/arm/dts/sun7i-a20-bananapi-r1.dts | 321 
>> +
>>  configs/Bananapi_R1_defconfig  |  19 ++
>>  3 files changed, 341 insertions(+)
>>  create mode 100644 arch/arm/dts/sun7i-a20-bananapi-r1.dts
>>  create mode 100644 configs/Bananapi_R1_defconfig
>>
>> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
>> index 032c5ae..0cbae00 100644
>> --- a/arch/arm/dts/Makefile
>> +++ b/arch/arm/dts/Makefile
>> @@ -216,6 +216,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
>> sun7i-a20-ainol-aw1.dtb \
>> sun7i-a20-bananapi.dtb \
>> sun7i-a20-bananapi-m1-plus.dtb \
>> +   sun7i-a20-bananapi-r1.dtb \
>> sun7i-a20-bananapro.dtb \
>> sun7i-a20-cubieboard2.dtb \
>> sun7i-a20-cubietruck.dtb \
>> diff --git a/arch/arm/dts/sun7i-a20-bananapi-r1.dts 
>> b/arch/arm/dts/sun7i-a20-bananapi-r1.dts
>> new file mode 100644
>> index 000..30a827f
>> --- /dev/null
>> +++ b/arch/arm/dts/sun7i-a20-bananapi-r1.dts
>> @@ -0,0 +1,321 @@
>> +/*
>> + * Copyright 2015 Hans de Goede 
>> + *
>> + * Changes copyright 2016 Stephen Arnold 
>
> Did you copied this dts from somewhere in ML?
>
>> + * This file is dual-licensed: you can use it either under the terms
>> + * of the GPL or the X11 license, at your option. Note that this dual
>> + * licensing only applies to this file, and not this project as a
>> + * whole.
>> + *
>> + *  a) This file is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU General Public License as
>> + * published by the Free Software Foundation; either version 2 of the
>> + * License, or (at your option) any later version.
>> + *
>> + * This file is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + *
>> + * Or, alternatively,
>> + *
>> + *  b) Permission is hereby granted, free of charge, to any person
>> + * obtaining a copy of this software and associated documentation
>> + * files (the "Software"), to deal in the Software without
>> + * restriction, including without limitation the rights to use,
>> + * copy, modify, merge, publish, distribute, sublicense, and/or
>> + * sell copies of the Software, and to permit persons to whom the
>> + * Software is furnished to do so, subject to the following
>> + * conditions:
>> + *
>> + * The above copyright notice and this permission notice shall be
>> + * included in all copies or substantial portions of the Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
>> + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>> + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
>> + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
>> + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
>> + * OTHER DEALINGS IN THE SOFTWARE.
>> + */
>> +
>> +/dts-v1/;
>> +#include "sun7i-a20.dtsi"
>> +#include "sunxi-common-regulators.dtsi"
>> +
>> +#include 
>> +#include 
>> +#include 
>> +
>> +/ {
>> +   model = "Banana Pi BPI-R1";
>> +   compatible = "sinovoip,bpi-r1", "allwinner,sun7i-a20";
>> +
>> +   aliases {
>> +   serial0 = 
>> +   serial1 = 
>> +   serial2 = 
>> +   serial3 = 
>> +   };
>> +
>> +   chosen {
>> +   stdout-path = "serial0:115200n8";
>> +   };
>> +
>> +   leds {
>> +   compatible = "gpio-leds";
>> +   pinctrl-names = "default";
>> +   pinctrl-0 = <_pins_bpi_r1>;
>> +
>> +   green {
>> +   label = "bpi-r1:green:usr";
>> +   gpios = < 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
>> +   linux,default-trigger = "heartbeat";
>> +   };
>> +   };
>> +
>> +   

Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-02 Thread Jagan Teki
On Sun, Oct 2, 2016 at 10:45 PM, AneoX  wrote:
> Like a sd card. I have emmc to sd adapter, so
>
> dd if=u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8

I guess you cleaned[1] the card before doing this?

>
> and then just solder emmc to my board.

OK, which a20 board?

[1] http://linux-sunxi.org/Bootable_SD_card

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: sun7i: dts: add support for Sinovoip/Bananapi BPI-R1

2016-10-02 Thread Jagan Teki
On Sun, Oct 2, 2016 at 10:06 AM, Stephen Arnold
 wrote:
> From: Steve Arnold 
>
> * needs different GMAC_TX_DELAY than lamobo-r1 (not compatible)
> * tested with 4.8_rc6 b53-mdio and kernel dts switch nodes
>
> Signed-off-by: Stephen Arnold 
> Cc: Ian Campbell 
> Cc: Hans De Goede 
> ---
>  arch/arm/dts/Makefile  |   1 +
>  arch/arm/dts/sun7i-a20-bananapi-r1.dts | 321 
> +
>  configs/Bananapi_R1_defconfig  |  19 ++
>  3 files changed, 341 insertions(+)
>  create mode 100644 arch/arm/dts/sun7i-a20-bananapi-r1.dts
>  create mode 100644 configs/Bananapi_R1_defconfig
>
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 032c5ae..0cbae00 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -216,6 +216,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
> sun7i-a20-ainol-aw1.dtb \
> sun7i-a20-bananapi.dtb \
> sun7i-a20-bananapi-m1-plus.dtb \
> +   sun7i-a20-bananapi-r1.dtb \
> sun7i-a20-bananapro.dtb \
> sun7i-a20-cubieboard2.dtb \
> sun7i-a20-cubietruck.dtb \
> diff --git a/arch/arm/dts/sun7i-a20-bananapi-r1.dts 
> b/arch/arm/dts/sun7i-a20-bananapi-r1.dts
> new file mode 100644
> index 000..30a827f
> --- /dev/null
> +++ b/arch/arm/dts/sun7i-a20-bananapi-r1.dts
> @@ -0,0 +1,321 @@
> +/*
> + * Copyright 2015 Hans de Goede 
> + *
> + * Changes copyright 2016 Stephen Arnold 

Did you copied this dts from somewhere in ML?

> + * This file is dual-licensed: you can use it either under the terms
> + * of the GPL or the X11 license, at your option. Note that this dual
> + * licensing only applies to this file, and not this project as a
> + * whole.
> + *
> + *  a) This file is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of the
> + * License, or (at your option) any later version.
> + *
> + * This file is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * Or, alternatively,
> + *
> + *  b) Permission is hereby granted, free of charge, to any person
> + * obtaining a copy of this software and associated documentation
> + * files (the "Software"), to deal in the Software without
> + * restriction, including without limitation the rights to use,
> + * copy, modify, merge, publish, distribute, sublicense, and/or
> + * sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following
> + * conditions:
> + *
> + * The above copyright notice and this permission notice shall be
> + * included in all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +/dts-v1/;
> +#include "sun7i-a20.dtsi"
> +#include "sunxi-common-regulators.dtsi"
> +
> +#include 
> +#include 
> +#include 
> +
> +/ {
> +   model = "Banana Pi BPI-R1";
> +   compatible = "sinovoip,bpi-r1", "allwinner,sun7i-a20";
> +
> +   aliases {
> +   serial0 = 
> +   serial1 = 
> +   serial2 = 
> +   serial3 = 
> +   };
> +
> +   chosen {
> +   stdout-path = "serial0:115200n8";
> +   };
> +
> +   leds {
> +   compatible = "gpio-leds";
> +   pinctrl-names = "default";
> +   pinctrl-0 = <_pins_bpi_r1>;
> +
> +   green {
> +   label = "bpi-r1:green:usr";
> +   gpios = < 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
> +   linux,default-trigger = "heartbeat";
> +   };
> +   };
> +
> +   reg_gmac_3v3: gmac-3v3 {
> +   compatible = "regulator-fixed";
> +   pinctrl-names = "default";
> +   pinctrl-0 = <_power_pin_bpi_r1>;
> +   regulator-name = "gmac-3v3";
> +   regulator-min-microvolt = <330>;
> +   regulator-max-microvolt = <330>;
> +   startup-delay-us = <10>;
> +   enable-active-high;

Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-02 Thread Jagan Teki
On Sun, Oct 2, 2016 at 7:13 PM, Alexandr Bochkarev
 wrote:
> Already tried. The same output:
>
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###

Need few more info, how exactly you wrote SPL on emmc, could you provide that.


-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 00/27] Clean up address mapping functions & CONFIG_SYS_SDRAM_BASE

2016-10-02 Thread Masahiro Yamada
Hi Paul,

2016-10-01 23:19 GMT+09:00 Paul Burton :
> README states that CONFIG_SYS_SDRAM_BASE should be the physical address
> of the base of SDRAM memory. This is expected by some code such as the
> PCI layer, which uses CONFIG_SYS_SDRAM_BASE to set up a region for
> system memory. Other code such as the image loading code used by bootm
> or the generic board_f.c expect CONFIG_SYS_SDRAM_BASE to be directly
> accessible by the CPU, which necessitates that it be a virtual address.
>
> Where virtual & physical addresses aren't identity mapped, as is the
> case for MIPS, we cannot possibly satisfy both. Until now MIPS has used
> a virtual CONFIG_SYS_SDRAM_BASE. This series fixes up the mess by doing
> a few things:
>
>   - Ensuring that we provide virt_to_phys() on all architectures.
>
>   - Fixing code that expects to use CONFIG_SYS_SDRAM_BASE as a virtual
> address to instead convert it to a physical address using
> virt_to_phys().
>
>   - Converts MIPS code & all MIPS boards to provide a physical
> CONFIG_SYS_SDRAM_BASE, which typically is zero.
>


Thanks for working on this.

As you may notice, include/linux/io.h defines
the generic implementation of ioremap().

(It is guarded by #ifndef CONFIG_HAVE_ARCH_IOREMAP
so that MIPS can work-around it.)

If you go with asm-generic/io.h,
perhaps should we be consistent, that is,
move the generic ioremap() to asm-generic/io.h?

We do not have to do it in this series,
but it would be appreciated
if you volunteer to make it in a better way.


Thanks,

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


Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-02 Thread Jagan Teki
On Sun, Oct 2, 2016 at 1:07 PM, Alexandr Bochkarev
 wrote:
> Hi!
>
> I am trying to boot my A20 board from eMMC KLM4G1FE3B-B001, but has no 
> success.
> Commenting mmc_change_freq has no effect.
> U-Boot 2016.03 just says Could not determine boot source
>
> I have found, that it stucks in sunxi_mmc_has_egon_boot_signature.
>
> int sunxi_mmc_has_egon_boot_signature(struct mmc *mmc)
> {
> char *buf = malloc(512);
> int valid_signature = 0;
>
> if (buf == NULL)
> panic("Failed to allocate memory\n");
>
> if (mmc_getcd(mmc) && mmc_init(mmc) == 0 &&
> mmc->block_dev.block_read(>block_dev, 16, 1, buf) == 1 &&
> strncmp([4], "eGON.BT0", 8) == 0)
> valid_signature = 1;
>
> free(buf);
> return valid_signature;
> }
>
> mmc_init(mmc) return no errors, seems good, but
> block_read returns 0, seems it cant read emmc.
>
>
> U-Boot 2016.09 says:
>
> mmc_load_image_raw_sector: mmc block read error
> SPL: failed to boot from all boot devices
> ### ERROR ### Please RESET the board ###

Can you try it on master once?

-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 2/3] ARM: dts: imx6qdl-icore: Add FEC support

2016-10-02 Thread Jagan Teki
From: Jagan Teki 

Add FEC dts support for Engicam i.CoreM6 dql modules.

Cc: Joe Hershberger 
Cc: Stefano Babic 
Cc: Matteo Lisi 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/dts/imx6qdl-icore.dtsi | 24 
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/dts/imx6qdl-icore.dtsi b/arch/arm/dts/imx6qdl-icore.dtsi
index f424cd5..a485c3e 100644
--- a/arch/arm/dts/imx6qdl-icore.dtsi
+++ b/arch/arm/dts/imx6qdl-icore.dtsi
@@ -75,6 +75,14 @@
assigned-clock-parents = < IMX6QDL_CLK_OSC>;
 };
 
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_enet>;
+   phy-reset-gpios = < 12 GPIO_ACTIVE_LOW>;
+   phy-mode = "rmii";
+   status = "okay";
+};
+
  {
pinctrl-names = "default";
pinctrl-0 = <_gpmi_nand>;
@@ -118,6 +126,22 @@
 };
 
  {
+   pinctrl_enet: enetgrp {
+   fsl,pins = <
+   MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN  0x1b0b0
+   MX6QDL_PAD_GPIO_16__ENET_REF_CLK0x1b0b1
+   MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN   0x1b0b0
+   MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1 0x1b0b0
+   MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0 0x1b0b0
+   MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1 0x1b0b0
+   MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0 0x1b0b0
+   MX6QDL_PAD_ENET_MDC__ENET_MDC   0x1b0b0
+   MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
+   MX6QDL_PAD_ENET_REF_CLK__GPIO1_IO23 0x1b0b0
+   MX6QDL_PAD_GPIO_17__GPIO7_IO12  0x1b0b0
+   >;
+   };
+
pinctrl_flexcan1: flexcan1grp {
fsl,pins = <
MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX 0x1b020
-- 
2.7.4

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


[U-Boot] [PATCH v3 3/3] icorem6: Use CONFIG_DM_ETH support

2016-10-02 Thread Jagan Teki
From: Jagan Teki 

Use CONFIG_DM_ETH and remove board_eth_init code
from board files.

Cc: Joe Hershberger 
Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 arch/arm/cpu/armv7/mx6/Kconfig   |  1 +
 board/engicam/icorem6/icorem6.c  | 71 
 configs/imx6qdl_icore_mmc_defconfig  |  1 -
 configs/imx6qdl_icore_nand_defconfig |  1 -
 4 files changed, 1 insertion(+), 73 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
index 762a581..8456b0e 100644
--- a/arch/arm/cpu/armv7/mx6/Kconfig
+++ b/arch/arm/cpu/armv7/mx6/Kconfig
@@ -100,6 +100,7 @@ config TARGET_MX6Q_ICORE
select MX6QDL
select OF_CONTROL
select DM
+   select DM_ETH
select DM_GPIO
select DM_MMC
select DM_THERMAL
diff --git a/board/engicam/icorem6/icorem6.c b/board/engicam/icorem6/icorem6.c
index c152007..587775e 100644
--- a/board/engicam/icorem6/icorem6.c
+++ b/board/engicam/icorem6/icorem6.c
@@ -7,8 +7,6 @@
  */
 
 #include 
-#include 
-#include 
 
 #include 
 #include 
@@ -27,80 +25,11 @@ DECLARE_GLOBAL_DATA_PTR;
PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED |   \
PAD_CTL_DSE_40ohm   | PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
 
-#define ENET_PAD_CTRL  (PAD_CTL_PKE | PAD_CTL_PUE |\
-   PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED   | \
-   PAD_CTL_DSE_40ohm   | PAD_CTL_HYS)
-
 static iomux_v3_cfg_t const uart4_pads[] = {
IOMUX_PADS(PAD_KEY_COL0__UART4_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
IOMUX_PADS(PAD_KEY_ROW0__UART4_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)),
 };
 
-static iomux_v3_cfg_t const enet_pads[] = {
-   IOMUX_PADS(PAD_ENET_CRS_DV__ENET_RX_EN | MUX_PAD_CTRL(ENET_PAD_CTRL)),
-   IOMUX_PADS(PAD_GPIO_16__ENET_REF_CLK | MUX_PAD_CTRL(ENET_PAD_CTRL | 
PAD_CTL_SRE_FAST)),
-   IOMUX_PADS(PAD_ENET_TX_EN__ENET_TX_EN | MUX_PAD_CTRL(ENET_PAD_CTRL)),
-   IOMUX_PADS(PAD_ENET_RXD1__ENET_RX_DATA1 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
-   IOMUX_PADS(PAD_ENET_RXD0__ENET_RX_DATA0 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
-   IOMUX_PADS(PAD_ENET_TXD1__ENET_TX_DATA1 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
-   IOMUX_PADS(PAD_ENET_TXD0__ENET_TX_DATA0 | MUX_PAD_CTRL(ENET_PAD_CTRL)),
-   IOMUX_PADS(PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL)),
-   IOMUX_PADS(PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL)),
-   IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | MUX_PAD_CTRL(NO_PAD_CTRL)),
-};
-
-#ifdef CONFIG_FEC_MXC
-#define ENET_PHY_RST   IMX_GPIO_NR(7, 12)
-static int setup_fec(void)
-{
-   struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
-   struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
-   s32 timeout = 10;
-   u32 reg = 0;
-   int ret;
-
-   /* Enable fec clock */
-   setbits_le32(>CCGR1, MXC_CCM_CCGR1_ENET_MASK);
-
-   /* use 50MHz */
-   ret = enable_fec_anatop_clock(0, ENET_50MHZ);
-   if (ret)
-   return ret;
-
-   /* Enable PLLs */
-   reg = readl(>pll_enet);
-   reg &= ~BM_ANADIG_PLL_SYS_POWERDOWN;
-   writel(reg, >pll_enet);
-   reg = readl(>pll_enet);
-   reg |= BM_ANADIG_PLL_SYS_ENABLE;
-   while (timeout--) {
-   if (readl(>pll_enet) & BM_ANADIG_PLL_SYS_LOCK)
-   break;
-   }
-   if (timeout <= 0)
-   return -EIO;
-   reg &= ~BM_ANADIG_PLL_SYS_BYPASS;
-   writel(reg, >pll_enet);
-
-   /* reset the phy */
-   gpio_direction_output(ENET_PHY_RST, 0);
-   udelay(1);
-   gpio_set_value(ENET_PHY_RST, 1);
-
-   return 0;
-}
-
-int board_eth_init(bd_t *bis)
-{
-   int ret;
-
-   SETUP_IOMUX_PADS(enet_pads);
-   setup_fec();
-
-   return ret = cpu_eth_init(bis);
-}
-#endif
-
 #ifdef CONFIG_NAND_MXS
 
 #define GPMI_PAD_CTRL0 (PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_PUS_100K_UP)
diff --git a/configs/imx6qdl_icore_mmc_defconfig 
b/configs/imx6qdl_icore_mmc_defconfig
index b2d8cdf..a8199d5 100644
--- a/configs/imx6qdl_icore_mmc_defconfig
+++ b/configs/imx6qdl_icore_mmc_defconfig
@@ -28,7 +28,6 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_LIBFDT=y
 CONFIG_FEC_MXC=y
 CONFIG_MXC_UART=y
-CONFIG_NETDEVICES=y
 CONFIG_IMX_THERMAL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
diff --git a/configs/imx6qdl_icore_nand_defconfig 
b/configs/imx6qdl_icore_nand_defconfig
index ca4ff0f..45f4808 100644
--- a/configs/imx6qdl_icore_nand_defconfig
+++ b/configs/imx6qdl_icore_nand_defconfig
@@ -24,7 +24,6 @@ CONFIG_OF_LIBFDT=y
 CONFIG_FEC_MXC=y
 CONFIG_MXC_UART=y
 CONFIG_NAND_MXS=y
-CONFIG_NETDEVICES=y
 CONFIG_IMX_THERMAL=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de

[U-Boot] [PATCH v3 1/3] net: fec_mxc: Convert into driver model

2016-10-02 Thread Jagan Teki
From: Jagan Teki 

This patch add driver model support for fec_mxc driver.

Cc: Simon Glass 
Cc: Joe Hershberger 
Cc: Peng Fan 
Cc: Stefano Babic 
Cc: Michael Trimarchi 
Signed-off-by: Jagan Teki 
---
 drivers/net/fec_mxc.c | 273 +-
 drivers/net/fec_mxc.h |  11 ++
 2 files changed, 258 insertions(+), 26 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index e871b3e..d4f6a08 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -9,6 +9,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -362,17 +363,32 @@ static void fec_rbd_clean(int last, struct fec_bd *pRbd)
writew(0, >data_length);
 }
 
+#ifdef CONFIG_DM_ETH
+static int fec_get_hwaddr(struct udevice *dev, int dev_id,
+   unsigned char *mac)
+#else
 static int fec_get_hwaddr(struct eth_device *dev, int dev_id,
unsigned char *mac)
+#endif
 {
imx_get_mac_from_fuse(dev_id, mac);
return !is_valid_ethaddr(mac);
 }
 
+#ifdef CONFIG_DM_ETH
+static int fecmxc_set_hwaddr(struct udevice *dev)
+#else
 static int fec_set_hwaddr(struct eth_device *dev)
+#endif
 {
+#ifdef CONFIG_DM_ETH
+   struct fec_priv *fec = dev_get_priv(dev);
+   struct eth_pdata *pdata = dev_get_platdata(dev);
+   uchar *mac = pdata->enetaddr;
+#else
uchar *mac = dev->enetaddr;
struct fec_priv *fec = (struct fec_priv *)dev->priv;
+#endif
 
writel(0, >eth->iaddr1);
writel(0, >eth->iaddr2);
@@ -427,9 +443,17 @@ static void fec_reg_setup(struct fec_priv *fec)
  * Start the FEC engine
  * @param[in] dev Our device to handle
  */
+#ifdef CONFIG_DM_ETH
+static int fec_open(struct udevice *dev)
+#else
 static int fec_open(struct eth_device *edev)
+#endif
 {
+#ifdef CONFIG_DM_ETH
+   struct fec_priv *fec = dev_get_priv(dev);
+#else
struct fec_priv *fec = (struct fec_priv *)edev->priv;
+#endif
int speed;
uint32_t addr, size;
int i;
@@ -535,14 +559,26 @@ static int fec_open(struct eth_device *edev)
return 0;
 }
 
+#ifdef CONFIG_DM_ETH
+static int fecmxc_init(struct udevice *dev)
+#else
 static int fec_init(struct eth_device *dev, bd_t* bd)
+#endif
 {
+#ifdef CONFIG_DM_ETH
+   struct fec_priv *fec = dev_get_priv(dev);
+#else
struct fec_priv *fec = (struct fec_priv *)dev->priv;
+#endif
uint32_t mib_ptr = (uint32_t)>eth->rmon_t_drop;
int i;
 
/* Initialize MAC address */
+#ifdef CONFIG_DM_ETH
+   fecmxc_set_hwaddr(dev);
+#else
fec_set_hwaddr(dev);
+#endif
 
/*
 * Setup transmit descriptors, there are two in total.
@@ -596,9 +632,17 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
  * Halt the FEC engine
  * @param[in] dev Our device to handle
  */
+#ifdef CONFIG_DM_ETH
+static void fecmxc_halt(struct udevice *dev)
+#else
 static void fec_halt(struct eth_device *dev)
+#endif
 {
+#ifdef CONFIG_DM_ETH
+   struct fec_priv *fec = dev_get_priv(dev);
+#else
struct fec_priv *fec = (struct fec_priv *)dev->priv;
+#endif
int counter = 0x;
 
/*
@@ -638,7 +682,11 @@ static void fec_halt(struct eth_device *dev)
  * @param[in] length Data count in bytes
  * @return 0 on success
  */
+#ifdef CONFIG_DM_ETH
+static int fecmxc_send(struct udevice *dev, void *packet, int length)
+#else
 static int fec_send(struct eth_device *dev, void *packet, int length)
+#endif
 {
unsigned int status;
uint32_t size, end;
@@ -650,7 +698,11 @@ static int fec_send(struct eth_device *dev, void *packet, 
int length)
 * This routine transmits one frame.  This routine only accepts
 * 6-byte Ethernet addresses.
 */
+#ifdef CONFIG_DM_ETH
+   struct fec_priv *fec = dev_get_priv(dev);
+#else
struct fec_priv *fec = (struct fec_priv *)dev->priv;
+#endif
 
/*
 * Check for valid length of data.
@@ -783,9 +835,17 @@ out:
  * @param[in] dev Our ethernet device to handle
  * @return Length of packet read
  */
+#ifdef CONFIG_DM_ETH
+static int fecmxc_recv(struct udevice *dev, int flags, uchar **packetp)
+#else
 static int fec_recv(struct eth_device *dev)
+#endif
 {
+#ifdef CONFIG_DM_ETH
+   struct fec_priv *fec = dev_get_priv(dev);
+#else
struct fec_priv *fec = (struct fec_priv *)dev->priv;
+#endif
struct fec_bd *rbd = >rbd_base[fec->rbd_index];
unsigned long ievent;
int frame_length, len = 0;
@@ -801,8 +861,13 @@ static int fec_recv(struct eth_device *dev)
writel(ievent, >eth->ievent);
debug("fec_recv: ievent 0x%lx\n", ievent);
if (ievent & FEC_IEVENT_BABR) {
+#ifdef CONFIG_DM_ETH
+   fecmxc_halt(dev);
+   fecmxc_init(dev);
+#else

[U-Boot] [PATCH v3 0/3] net: fec_mxc: Convert to DM

2016-10-02 Thread Jagan Teki
From: Jagan Teki 

This series convert fec_mxc to DM and tested both dm and
non-dm code. This is on top of engicam qdl[1]

Changes for v3:
- Add ARM: dts: imx6qdl-icore: Add FEC support
- icorem6: Use CONFIG_DM_ETH support
Changes for v2:
- Add TODO for implementing the enet reset code

[1] https://www.mail-archive.com/u-boot@lists.denx.de/msg226671.html

Jagan Teki (3):
  net: fec_mxc: Convert into driver model
  ARM: dts: imx6qdl-icore: Add FEC support
  icorem6: Use CONFIG_DM_ETH support

 arch/arm/cpu/armv7/mx6/Kconfig   |   1 +
 arch/arm/dts/imx6qdl-icore.dtsi  |  24 +++
 board/engicam/icorem6/icorem6.c  |  71 -
 configs/imx6qdl_icore_mmc_defconfig  |   1 -
 configs/imx6qdl_icore_nand_defconfig |   1 -
 drivers/net/fec_mxc.c| 273 +++
 drivers/net/fec_mxc.h|  11 ++
 7 files changed, 283 insertions(+), 99 deletions(-)

-- 
2.7.4

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


Re: [U-Boot] net, cmd: fix misaligned cache operation warning

2016-10-02 Thread Joe Hershberger
Hi Tom,

On Sun, Oct 2, 2016 at 7:03 AM, Tom Rini  wrote:
> On Mon, Aug 29, 2016 at 07:46:47AM +0200, Heiko Schocher wrote:
>
>> when using tftp on the smartweb board, it prints, when
>> using the tftp command:
>>
>> Using ethernet@fffc4000 device
>> TFTP from server 192.168.1.1; our IP address is 192.168.20.80
>> Filename '/tftpboot/smartweb_hw/tbot/u-boot.bin'.
>> Load address: 0x2100
>> Loading: ###
>>  73.2 KiB/s
>> done
>> Bytes transferred = 391560 (5f988 hex)
>> CACHE: Misaligned operation at range [2100, 2105f988]
>> U-Boot#
>>
>> Fixing this.
>>
>> Signed-off-by: Heiko Schocher 
>
> NAK, we need to sort out:
> xtensa:  +   xtfpga   
> avr32:  +   atngw100mkii grasshopper atstk1002 atngw100
>  sparc:  +   gr_cpci_ax2000 gr_xc3s_1500 gr_ep2s60
> microblaze:  +   microblaze-generic
>
> Lacking a define for CONFIG_SYS_CACHELINE_SIZE first.

https://patchwork.ozlabs.org/patch/669691/

...is the approach I prefer to take instead of this patch.

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


[U-Boot] [PATCH] ARM: sun7i: dts: add support for Sinovoip/Bananapi BPI-R1

2016-10-02 Thread Stephen Arnold
From: Steve Arnold 

* needs different GMAC_TX_DELAY than lamobo-r1 (not compatible)
* tested with 4.8_rc6 b53-mdio and kernel dts switch nodes

Signed-off-by: Steve Arnold 
---
 arch/arm/dts/Makefile  |   1 +
 arch/arm/dts/sun7i-a20-bananapi-r1.dts | 321 +
 configs/Bananapi_R1_defconfig  |  19 ++
 3 files changed, 341 insertions(+)
 create mode 100644 arch/arm/dts/sun7i-a20-bananapi-r1.dts
 create mode 100644 configs/Bananapi_R1_defconfig

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 032c5ae..0cbae00 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -216,6 +216,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
sun7i-a20-ainol-aw1.dtb \
sun7i-a20-bananapi.dtb \
sun7i-a20-bananapi-m1-plus.dtb \
+   sun7i-a20-bananapi-r1.dtb \
sun7i-a20-bananapro.dtb \
sun7i-a20-cubieboard2.dtb \
sun7i-a20-cubietruck.dtb \
diff --git a/arch/arm/dts/sun7i-a20-bananapi-r1.dts 
b/arch/arm/dts/sun7i-a20-bananapi-r1.dts
new file mode 100644
index 000..30a827f
--- /dev/null
+++ b/arch/arm/dts/sun7i-a20-bananapi-r1.dts
@@ -0,0 +1,321 @@
+/*
+ * Copyright 2015 Hans de Goede 
+ *
+ * Changes copyright 2015 Stephen Arnold 
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include 
+#include 
+#include 
+
+/ {
+   model = "Banana Pi BPI-R1";
+   compatible = "sinovoip,bpi-r1", "allwinner,sun7i-a20";
+
+   aliases {
+   serial0 = 
+   serial1 = 
+   serial2 = 
+   serial3 = 
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   leds {
+   compatible = "gpio-leds";
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_bpi_r1>;
+
+   green {
+   label = "bpi-r1:green:usr";
+   gpios = < 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
+   linux,default-trigger = "heartbeat";
+   };
+   };
+
+   reg_gmac_3v3: gmac-3v3 {
+   compatible = "regulator-fixed";
+   pinctrl-names = "default";
+   pinctrl-0 = <_power_pin_bpi_r1>;
+   regulator-name = "gmac-3v3";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   startup-delay-us = <10>;
+   enable-active-high;
+   gpio = < 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
+   };
+
+};
+
+ {
+   target-supply = <_ahci_5v>;
+   status = "okay";
+};
+
+ {
+   cpu-supply = <_dcdc2>;
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_rgmii_a>;
+   phy = <>;
+   phy-mode = "rgmii";
+   

Re: [U-Boot] [bug report] sunxi: booting from eMMC

2016-10-02 Thread Alexandr Bochkarev
Hi!

I am trying to boot my A20 board from eMMC KLM4G1FE3B-B001, but has no success. 
Commenting mmc_change_freq has no effect. 
U-Boot 2016.03 just says Could not determine boot source

I have found, that it stucks in sunxi_mmc_has_egon_boot_signature. 

int sunxi_mmc_has_egon_boot_signature(struct mmc *mmc)
{
char *buf = malloc(512);
int valid_signature = 0;

if (buf == NULL)
panic("Failed to allocate memory\n");

if (mmc_getcd(mmc) && mmc_init(mmc) == 0 &&
mmc->block_dev.block_read(>block_dev, 16, 1, buf) == 1 &&
strncmp([4], "eGON.BT0", 8) == 0)
valid_signature = 1;

free(buf);
return valid_signature;
}

mmc_init(mmc) return no errors, seems good, but
block_read returns 0, seems it cant read emmc.


U-Boot 2016.09 says:

mmc_load_image_raw_sector: mmc block read error
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ARM: sun7i: dts: add support for Sinovoip/Bananapi BPI-R1

2016-10-02 Thread Stephen Arnold
From: Steve Arnold 

* needs different GMAC_TX_DELAY than lamobo-r1 (not compatible)
* tested with 4.8_rc6 b53-mdio and kernel dts switch nodes

Signed-off-by: Stephen Arnold 
Cc: Ian Campbell 
Cc: Hans De Goede 
---
 arch/arm/dts/Makefile  |   1 +
 arch/arm/dts/sun7i-a20-bananapi-r1.dts | 321 +
 configs/Bananapi_R1_defconfig  |  19 ++
 3 files changed, 341 insertions(+)
 create mode 100644 arch/arm/dts/sun7i-a20-bananapi-r1.dts
 create mode 100644 configs/Bananapi_R1_defconfig

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 032c5ae..0cbae00 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -216,6 +216,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
sun7i-a20-ainol-aw1.dtb \
sun7i-a20-bananapi.dtb \
sun7i-a20-bananapi-m1-plus.dtb \
+   sun7i-a20-bananapi-r1.dtb \
sun7i-a20-bananapro.dtb \
sun7i-a20-cubieboard2.dtb \
sun7i-a20-cubietruck.dtb \
diff --git a/arch/arm/dts/sun7i-a20-bananapi-r1.dts 
b/arch/arm/dts/sun7i-a20-bananapi-r1.dts
new file mode 100644
index 000..30a827f
--- /dev/null
+++ b/arch/arm/dts/sun7i-a20-bananapi-r1.dts
@@ -0,0 +1,321 @@
+/*
+ * Copyright 2015 Hans de Goede 
+ *
+ * Changes copyright 2016 Stephen Arnold 
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include 
+#include 
+#include 
+
+/ {
+   model = "Banana Pi BPI-R1";
+   compatible = "sinovoip,bpi-r1", "allwinner,sun7i-a20";
+
+   aliases {
+   serial0 = 
+   serial1 = 
+   serial2 = 
+   serial3 = 
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   leds {
+   compatible = "gpio-leds";
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins_bpi_r1>;
+
+   green {
+   label = "bpi-r1:green:usr";
+   gpios = < 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */
+   linux,default-trigger = "heartbeat";
+   };
+   };
+
+   reg_gmac_3v3: gmac-3v3 {
+   compatible = "regulator-fixed";
+   pinctrl-names = "default";
+   pinctrl-0 = <_power_pin_bpi_r1>;
+   regulator-name = "gmac-3v3";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   startup-delay-us = <10>;
+   enable-active-high;
+   gpio = < 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
+   };
+
+};
+
+ {
+   target-supply = <_ahci_5v>;
+   status = "okay";
+};
+
+ {
+   cpu-supply = <_dcdc2>;
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
+ {
+   pinctrl-names = "default";
+ 

Re: [U-Boot] net, cmd: fix misaligned cache operation warning

2016-10-02 Thread Tom Rini
On Mon, Aug 29, 2016 at 07:46:47AM +0200, Heiko Schocher wrote:

> when using tftp on the smartweb board, it prints, when
> using the tftp command:
> 
> Using ethernet@fffc4000 device
> TFTP from server 192.168.1.1; our IP address is 192.168.20.80
> Filename '/tftpboot/smartweb_hw/tbot/u-boot.bin'.
> Load address: 0x2100
> Loading: ###
>  73.2 KiB/s
> done
> Bytes transferred = 391560 (5f988 hex)
> CACHE: Misaligned operation at range [2100, 2105f988]
> U-Boot#
> 
> Fixing this.
> 
> Signed-off-by: Heiko Schocher 

NAK, we need to sort out:
xtensa:  +   xtfpga 
  avr32:  +   atngw100mkii grasshopper atstk1002 atngw100
 sparc:  +   gr_cpci_ax2000 gr_xc3s_1500 gr_ep2s60
microblaze:  +   microblaze-generic

Lacking a define for CONFIG_SYS_CACHELINE_SIZE first.

-- 
Tom


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


Re: [U-Boot] [PATCH v3 4/7] efi_loader: Track size of pool allocations to allow freeing

2016-10-02 Thread Alexander Graf


On 01.10.16 23:32, Stefan Brüns wrote:
> allocate_pool has to return a buffer which is 8-byte aligned. Shift the
> region returned by allocate_pages by 8 byte and store the size in the
> headroom. The 8 byte overhead is neglegible, but provides the required
> size when freeing the allocation later.

The description doesn't say why you're doing what you're doing :).
Basically you want to say

  * We want to free
  * to free we need the size
  * to get the size we need to include it with the allocation
  * move allocations into their own struct for that
  * it's legal because allocations have to be 64bit aligned
  * fixes free

> 
> Signed-off-by: Stefan Brüns 
> ---
>  include/efi_loader.h  |  2 ++
>  lib/efi_loader/efi_boottime.c |  6 +++---
>  lib/efi_loader/efi_memory.c   | 40 +++-
>  3 files changed, 44 insertions(+), 4 deletions(-)
> 
> diff --git a/include/efi_loader.h b/include/efi_loader.h
> index 40e7beb..341d4a4 100644
> --- a/include/efi_loader.h
> +++ b/include/efi_loader.h
> @@ -122,6 +122,8 @@ efi_status_t efi_free_pages(uint64_t memory, unsigned 
> long pages);
>  /* EFI memory allocator for small allocations, called by EFI payloads */
>  efi_status_t efi_allocate_pool(int pool_type, unsigned long size,
>  void **buffer);
> +/* EFI pool memory free function. */
> +efi_status_t efi_free_pool(void *buffer);
>  /* Returns the EFI memory map */
>  efi_status_t efi_get_memory_map(unsigned long *memory_map_size,
>   struct efi_mem_desc *memory_map,
> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
> index eb74cb0..8274d8e 100644
> --- a/lib/efi_loader/efi_boottime.c
> +++ b/lib/efi_loader/efi_boottime.c
> @@ -141,12 +141,12 @@ static efi_status_t EFIAPI efi_allocate_pool_ext(int 
> pool_type,
>   return EFI_EXIT(r);
>  }
>  
> -static efi_status_t EFIAPI efi_free_pool(void *buffer)
> +static efi_status_t EFIAPI efi_free_pool_ext(void *buffer)
>  {
>   efi_status_t r;
>  
>   EFI_ENTRY("%p", buffer);
> - r = efi_free_pages((ulong)buffer, 0);
> + r = efi_free_pool(buffer);
>   return EFI_EXIT(r);
>  }
>  
> @@ -736,7 +736,7 @@ static const struct efi_boot_services efi_boot_services = 
> {
>   .free_pages = efi_free_pages_ext,
>   .get_memory_map = efi_get_memory_map_ext,
>   .allocate_pool = efi_allocate_pool_ext,
> - .free_pool = efi_free_pool,
> + .free_pool = efi_free_pool_ext,
>   .create_event = efi_create_event,
>   .set_timer = efi_set_timer,
>   .wait_for_event = efi_wait_for_event,
> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
> index 045558d..fa5c639 100644
> --- a/lib/efi_loader/efi_memory.c
> +++ b/lib/efi_loader/efi_memory.c
> @@ -34,6 +34,18 @@ void *efi_bounce_buffer;
>  #endif
>  
>  /*
> + * U-Boot services each EFI AllocatePool request as a separate
> + * (multiple) page allocation.  We have to track the number of pages
> + * to be able to free the correct amount later.
> + * EFI requires 8 byte alignement for pool allocations, so it is

alignment

> + * possible to reserve some headroom and serve the remainder.

Any way you could write this in a way that makes it more obvious for
future readers what's going on? Maybe something like

EFI requires 8 byte alignment for pool allocations, so we can extend
every allocation by an internal 64bit variable that holds the size of
the allocation. That way we know how much to free later on.

> + */
> +struct efi_pool_allocation {
> + u64 num_pages;
> + char data[];
> +};
> +
> +/*
>   * Sorts the memory list from highest address to lowest address
>   *
>   * When allocating memory we should always start from the highest
> @@ -332,9 +344,35 @@ efi_status_t efi_allocate_pool(int pool_type, unsigned 
> long size,
>  {
>   efi_status_t r;
>   efi_physical_addr_t t;
> - u64 num_pages = (size + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
> + u64 num_pages = (size + sizeof(u64) + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
> +
> + if (size == 0) {
> + *buffer = NULL;
> + return EFI_EXIT(EFI_SUCCESS);

Please don't call EFI_EXIT() inside functions that are not also calling
EFI_ENTRY.

> + }
>  
>   r = efi_allocate_pages(0, pool_type, num_pages, );
> +
> + if (r == EFI_SUCCESS) {
> + struct efi_pool_allocation *alloc = (void *)(uintptr_t)t;
> + alloc->num_pages = num_pages;
> + *buffer = &(alloc->data);

This should work without the &, as you're referring to an array (which
is a pointer).

> + assert(((uintptr_t)(*buffer) & 0x7) == 0);

This should be a given if t is 64bit aligned, as the compiler takes care
of the alignment for you here.

> + }
> +
> + return EFI_EXIT(r);

See above

> +}
> +
> +efi_status_t efi_free_pool(void *buffer)
> +{
> + efi_status_t r;
> + struct efi_pool_allocation *alloc;
> +
> +  

Re: [U-Boot] [PATCH v3 3/7] efi_loader: Move efi_allocate_pool implementation to efi_memory.c

2016-10-02 Thread Alexander Graf


On 01.10.16 23:32, Stefan Brüns wrote:
> Implementation essentially unchanged, but use EFI_PAGE_MASK/SHIFT
> instead of numeric constants.

Sorry for being nitpicky about the commit message again. Imagine you're
a distribution maintainer for U-Boot and you need to read the commit
messages of all commits in the tree to figure out whether you need to
cherry-pick a patch or not. Or you git bisect down to this commit and
need to figure out what the original intention of this patch was.

How about something like

---

We currently handle efi_allocate_pool() inside of our boot time service
file. In the following patch, pool allocation will receive additional
internal semantics that we should preserve inside efi_memory.c instead.

As foundation for those changes, split the function into an externally
facing helper efi_allocate_pool_ext() for use by payloads and an
internal function efi_allocate_pool() in efi_memory.c that handles the
actual allocation.

While at it, change the magic 0xfff / 12 constants to the more obvious
EFI_PAGE_MASK/SHIFT defines.

---


Alex

> 
> Signed-off-by: Stefan Brüns 
> ---
>  include/efi_loader.h  |  3 +++
>  lib/efi_loader/efi_boottime.c | 11 +--
>  lib/efi_loader/efi_memory.c   | 11 +++
>  3 files changed, 19 insertions(+), 6 deletions(-)
> 
> diff --git a/include/efi_loader.h b/include/efi_loader.h
> index 9738835..40e7beb 100644
> --- a/include/efi_loader.h
> +++ b/include/efi_loader.h
> @@ -119,6 +119,9 @@ efi_status_t efi_allocate_pages(int type, int 
> memory_type, unsigned long pages,
>   uint64_t *memory);
>  /* EFI memory free function. Not implemented today */
>  efi_status_t efi_free_pages(uint64_t memory, unsigned long pages);
> +/* EFI memory allocator for small allocations, called by EFI payloads */

The function that gets called by EFI payloads is actually the _ext one,
as that's the one that swizzles the gd pointer as well. Just remove the
last bit of the sentence.

> +efi_status_t efi_allocate_pool(int pool_type, unsigned long size,
> +void **buffer);
>  /* Returns the EFI memory map */
>  efi_status_t efi_get_memory_map(unsigned long *memory_map_size,
>   struct efi_mem_desc *memory_map,
> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
> index 784891b..eb74cb0 100644
> --- a/lib/efi_loader/efi_boottime.c
> +++ b/lib/efi_loader/efi_boottime.c
> @@ -130,15 +130,14 @@ efi_status_t EFIAPI efi_get_memory_map_ext(unsigned 
> long *memory_map_size,
>   return EFI_EXIT(r);
>  }
>  
> -static efi_status_t EFIAPI efi_allocate_pool(int pool_type, unsigned long 
> size,
> -  void **buffer)
> +static efi_status_t EFIAPI efi_allocate_pool_ext(int pool_type,
> +  unsigned long size,
> +  void **buffer)
>  {
>   efi_status_t r;
> - efi_physical_addr_t t;
>  
>   EFI_ENTRY("%d, %ld, %p", pool_type, size, buffer);
> - r = efi_allocate_pages(0, pool_type, (size + 0xfff) >> 12, );
> - *buffer = (void *)(uintptr_t)t;
> + r = efi_allocate_pool(pool_type, size, buffer);
>   return EFI_EXIT(r);
>  }
>  
> @@ -736,7 +735,7 @@ static const struct efi_boot_services efi_boot_services = 
> {
>   .allocate_pages = efi_allocate_pages_ext,
>   .free_pages = efi_free_pages_ext,
>   .get_memory_map = efi_get_memory_map_ext,
> - .allocate_pool = efi_allocate_pool,
> + .allocate_pool = efi_allocate_pool_ext,
>   .free_pool = efi_free_pool,
>   .create_event = efi_create_event,
>   .set_timer = efi_set_timer,
> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
> index 5d71fdf..045558d 100644
> --- a/lib/efi_loader/efi_memory.c
> +++ b/lib/efi_loader/efi_memory.c
> @@ -327,6 +327,17 @@ efi_status_t efi_free_pages(uint64_t memory, unsigned 
> long pages)
>   return EFI_SUCCESS;
>  }
>  
> +efi_status_t efi_allocate_pool(int pool_type, unsigned long size,
> +void **buffer)
> +{
> + efi_status_t r;
> + efi_physical_addr_t t;
> + u64 num_pages = (size + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
> +
> + r = efi_allocate_pages(0, pool_type, num_pages, );

This is missing the *buffer update, no?

> + return EFI_EXIT(r);

Double EFI_EXIT is fatal. Please just return r here.


Alex

> +}
> +
>  efi_status_t efi_get_memory_map(unsigned long *memory_map_size,
>  struct efi_mem_desc *memory_map,
>  unsigned long *map_key,
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/7] efi_loader: Fix memory map size check to avoid out-of-bounds access

2016-10-02 Thread Alexander Graf


On 01.10.16 23:32, Stefan Brüns wrote:
> Do not overwrite the specified size of the provided buffer without
> having checked it is sufficient.
> 
> If the buffer is to small, memory_map_size is updated to indicate the
> required size, and an error code is returned.
> 
> Signed-off-by: Stefan Brüns 

Usually the pattern I like for commit messages is:

  * current state
  * why current state is bad
  * what this patch does to change it
  * what bugs/features this patch enables

So in your case, that would be along the lines of:

---

The current efi_get_memory_map() function overwrites the map_size
property before reading its value. That way the sanity check whether our
memory map fits into the given array always succeeds, potentially
overwriting arbitrary payload memory.

This patch moves the property update write after its sanity check, so
that the check actually verifies the correct value.

So far this has not triggered any known bugs, but we're better off safe
than sorry.

---

> ---
>  lib/efi_loader/efi_memory.c | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
> index ebe8e94..5d71fdf 100644
> --- a/lib/efi_loader/efi_memory.c
> +++ b/lib/efi_loader/efi_memory.c
> @@ -342,16 +342,18 @@ efi_status_t efi_get_memory_map(unsigned long 
> *memory_map_size,
>  
>   map_size = map_entries * sizeof(struct efi_mem_desc);
>  
> - *memory_map_size = map_size;
> -
>   if (descriptor_size)
>   *descriptor_size = sizeof(struct efi_mem_desc);
>  
>   if (descriptor_version)
>   *descriptor_version = EFI_MEMORY_DESCRIPTOR_VERSION;
>  
> - if (*memory_map_size < map_size)
> + if (*memory_map_size < map_size) {
> + *memory_map_size = map_size;
>   return EFI_BUFFER_TOO_SMALL;
> + }
> +
> + *memory_map_size = map_size;

Sorry for making you go in circles, but I'm afraid that while the code
flow is pretty obvious for us two now, it feels prone to break by anyone
who touches it next.

Could we instead make the whole thing explicit? Something like this:

diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index 80e4e26..eb3cfd1 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -328,6 +328,7 @@ efi_status_t efi_get_memory_map(unsigned long
*memory_map_size,
ulong map_size = 0;
int map_entries = 0;
struct list_head *lhandle;
+   unsigned long max_memory_map_size = *memory_map_size;

list_for_each(lhandle, _mem)
map_entries++;
@@ -342,7 +343,7 @@ efi_status_t efi_get_memory_map(unsigned long
*memory_map_size,
if (descriptor_version)
*descriptor_version = EFI_MEMORY_DESCRIPTOR_VERSION;

-   if (*memory_map_size < map_size)
+   if (max_memory_map_size < map_size)
return EFI_BUFFER_TOO_SMALL;

/* Copy list into array */


Since most of the other patches can stay basically untouched, you can
also send only an updated v4 of this particular patch. For that, check
the mail header of v3 2/7 for a "message id":

  

Then use that as reply-to field in the email send

  git format-patch -n --subject-prefix="PATCH v4" -o v4 origin/master
  git send-email
--in-reply-to=""
--to u-boot@lists.denx.de --cc ag...@suse.de v4/0002*

Unless of course you need to rewrite half the patch set. Then you're
better off resending the whole thing :)

Also your threading is somehow broken for the cover letter. How do you
send that one?


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


Re: [U-Boot] [PATCH v3 1/7] efi_loader: Update description of internal efi_mem_carve_out

2016-10-02 Thread Alexander Graf


On 01.10.16 23:32, Stefan Brüns wrote:
> In 74c16acce30bb882ad5951829d8dafef8eea564c the return values where
> changed, but the description was kept.
> 
> Signed-off-by: Stefan Brüns 

Reviewed-by: Alexander Graf 


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


Re: [U-Boot] is there any issue with creating and using more than one hashtable?

2016-10-02 Thread Robert P. J. Day
On Sat, 1 Oct 2016, Wolfgang Denk wrote:

... snip ...

> Actually the TFTP will not access the environment directly to
> determine the boot parameters like bootfile, ipaddr, gatewayip,
> netmask, serverip, etc.; instead, it uses internal variables.  So
> your environment settings for "ipaddr" and "gatewayip" may contain
> totally different values than the variables net_ip resp.
> net_gateway which get used by the TFTP code.
>
> These variables get set through the U_BOOT_ENV_CALLBACK functionality,
> i. e. as a callback whenever the corresponfing variable gets set.
> "setting" here means that the value in the hash table gets changed -
> see function _compare_and_overwrite_entry() in "hashtable.c":
>
> 244 /* If there is a callback, call it */
> 245 if (htab->table[idx].entry.callback &&
> 246 htab->table[idx].entry.callback(item.key,
> 247 item.data, env_op_overwrite, flag)) {
> 248 debug("callback() rejected setting 
> variable "
> 249 "%s, skipping it!\n", item.key);
> 250 __set_errno(EINVAL);
> 251 *retval = NULL;
> 252 return 0;
> 253 }

... snip ...

  i'm going to assume other net-related commands have this behaviour
as well, yes? like ping? which would explain why ping'ing even the
alleged gateway didn't work in this context.

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday


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


Re: [U-Boot] is there any issue with creating and using more than one hashtable?

2016-10-02 Thread Robert P. J. Day
On Sat, 1 Oct 2016, Wolfgang Denk wrote:

> Dear Robert,
>
> In message  you 
> wrote:
> >
> > > 244 /* If there is a callback, call it */
> > > 245 if (htab->table[idx].entry.callback &&
> > > 246 htab->table[idx].entry.callback(item.key,
> ...
>
> >   just to follow up, the simple solution for me would be to *not*
> > create that second hashtable with recognized u-boot variable names
> > like "ipaddr", "gatewayip", "serverip" unless i absolutely plan on
> > using those new values.
>
> Well, I guess you don't need the callback funtionality for your
> purposes, and you will probably not pull the data from the second
> hash table back into the primary one, so why can you not just clear
> the "callback" for any entries you process?
>
> That would suppress the unwanted actions...
>
> >   this is what i use to add/modify a new env variable -- is this the
> > correct approach, to add it to the "env_htab" hashtable?
> >
> >   int
> >   add_entry_to_env(ENTRY* e)
> >   {
> > ENTRY*  ep;
> >
> > printf("Adding stuff k: [%s], d: [%s] to env.\n", e->key, e->data);
>
> Insert:
>
>   e->callback = NULL;
>
> here?

  that would be one solution, yes. i assume i would, of course, set
that callback before adding the entry to the hashtable; otherwise,
wouldn't do much good.

  ok, i think we've settled this, thanks.

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday


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


Re: [U-Boot] [PATCH 01/27] Provide a generic io.h & address mapping functions

2016-10-02 Thread Angelo Dureghello

Hi Paul,

On 01/10/2016 16:19, Paul Burton wrote:

Most architectures currently supported by U-Boot use trivial
implementations of map_to_physmem & virt_to_phys which simply cast a
physical address to a pointer for use a virtual address & vice-versa.
This results in a lot of duplicate implementations of these mapping
functions.

The functions provided by different architectures also differs, with
some having implementations of phys_to_virt & others not. A later patch
in this series will make use of phys_to_virt, so requires that it be
provided for all architectures.

This patch introduces an asm-generic/io.h which provides generic
implementations of address mapping functions, allowing the duplication
of them between architectures to be removed. Once architectures are
converted to make use of this generic header it will also ensure that
all of phys_to_virt, virt_to_phys, map_physmem & unmap_physmem are
provided. The 2 families of functions differ in that map_physmem may
create dynamic mappings whilst phys_to_virt may not & therefore is more
limited in scope but doesn't require information such as a length &
flags.

This patch doesn't convert any architectures to make use of this generic
header - later patches in the series will do so.

Signed-off-by: Paul Burton 
Cc: Albert Aribaud 
Cc: Alexey Brodkin 
Cc: Alison Wang 
Cc: Angelo Dureghello 
Cc: Bin Meng 
Cc: Daniel Schwierzeck 
Cc: Francois Retief 
Cc: Macpaul Lin 
Cc: Michal Simek 
Cc: Mike Frysinger 
Cc: Nobuhiro Iwamatsu 
Cc: Scott McNutt 
Cc: Sonic Zhang 
Cc: Thomas Chou 
Cc: Wolfgang Denk 
---

 include/asm-generic/io.h | 110 +++
 1 file changed, 110 insertions(+)
 create mode 100644 include/asm-generic/io.h

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
new file mode 100644
index 000..dd3a46d
--- /dev/null
+++ b/include/asm-generic/io.h
@@ -0,0 +1,110 @@
+/*
+ * Generic I/O functions.
+ *
+ * Copyright (c) 2016 Imagination Technologies Ltd.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __ASM_GENERIC_IO_H__
+#define __ASM_GENERIC_IO_H__
+
+/*
+ * This file should be included at the end of each architecture-specific
+ * asm/io.h such that we may provide generic implementations without
+ * conflicting with architecture-specific code.
+ */
+
+#ifndef __ASSEMBLY__
+
+/**
+ * phys_to_virt() - Return a virtual address mapped to a given physical address
+ * @paddr: the physical address
+ *
+ * Returns a virtual address which the CPU can access that maps to the physical
+ * address @paddr. This should only be used where it is known that no dynamic
+ * mapping is required. In general, map_physmem should be used instead.
+ *
+ * Returns: a virtual address which maps to @paddr
+ */
+#ifndef phys_to_virt
+static inline void *phys_to_virt(phys_addr_t paddr)
+{
+   return (void *)(unsigned long)paddr;
+}
+#endif
+
+/**
+ * virt_to_phys() - Return the physical address that a virtual address maps to
+ * @vaddr: the virtual address
+ *
+ * Returns the physical address which the CPU-accessible virtual address @vaddr
+ * maps to.
+ *
+ * Returns: the physical address which @vaddr maps to
+ */
+#ifndef virt_to_phys
+static inline phys_addr_t virt_to_phys(void *vaddr)
+{
+   return (phys_addr_t)((unsigned long)vaddr);
+}
+#endif
+
+/*
+ * Flags for use with map_physmem() & unmap_physmem(). Architectures need not
+ * support all of these, in which case they will be defined as zero here &
+ * ignored. Callers that may run on multiple architectures should therefore
+ * treat them as hints rather than requirements.
+ */
+#ifndef MAP_NOCACHE
+# define MAP_NOCACHE   0   /* Produce an uncached mapping */
+#endif
+#ifndef MAP_WRCOMBINE
+# define MAP_WRCOMBINE 0   /* Allow write-combining on the mapping */
+#endif
+#ifndef MAP_WRBACK
+# define MAP_WRBACK0   /* Map using write-back caching */
+#endif
+#ifndef MAP_WRTHROUGH
+# define MAP_WRTHROUGH 0   /* Map using write-through caching */
+#endif
+
+/**
+ * map_physmem() - Return a virtual address mapped to a given physical address
+ * @paddr: the physical address
+ * @len: the length of the required mapping
+ * @flags: flags affecting the type of mapping
+ *
+ * Return a virtual address through which the CPU may access the memory at
+ * physical address @paddr. The mapping will be valid for at least @len bytes,
+ * and may be affected by flags passed to the @flags argument. This function
+ * may create new mappings, so should generally be paired with a matching call
+ * to unmap_physmem once the caller is finished with the memory in question.
+ *
+ * Returns: a virtual 

Re: [U-Boot] [PATCH 05/27] m68k: Use asm-generic/io.h

2016-10-02 Thread Angelo Dureghello

Dear Paul,

On 01/10/2016 16:19, Paul Burton wrote:

Convert the m68k architecture to make use of the new asm-generic/io.h to
provide address mapping functions. As the generic implementations are
suitable for m68k this is primarily a matter of emoving code.

Feedback from architecture maintainers is welcome.

Signed-off-by: Paul Burton 
Cc: Huan Wang 
Cc: Angelo Dureghello 
---

 arch/m68k/include/asm/io.h | 29 +
 1 file changed, 1 insertion(+), 28 deletions(-)

diff --git a/arch/m68k/include/asm/io.h b/arch/m68k/include/asm/io.h
index 384308b..dfe77f0 100644
--- a/arch/m68k/include/asm/io.h
+++ b/arch/m68k/include/asm/io.h
@@ -253,33 +253,6 @@ static inline void sync(void)
 */
 }

-/*
- * Given a physical address and a length, return a virtual address
- * that can be used to access the memory range with the caching
- * properties specified by "flags".
- */
-#define MAP_NOCACHE(0)
-#define MAP_WRCOMBINE  (0)
-#define MAP_WRBACK (0)
-#define MAP_WRTHROUGH  (0)
-
-static inline void *map_physmem(phys_addr_t paddr, unsigned long len,
-   unsigned long flags)
-{
-   return (void *)paddr;
-}
-
-/*
- * Take down a mapping set up by map_physmem().
- */
-static inline void unmap_physmem(void *vaddr, unsigned long flags)
-{
-
-}
-
-static inline phys_addr_t virt_to_phys(void * vaddr)
-{
-   return (phys_addr_t)(vaddr);
-}
+#include 

 #endif /* __ASM_M68K_IO_H__ */

 
tested on mcf5307 amcore board.


Acked-by: Angelo Dureghello 
Tested-by: Angelo Dureghello 

many thanks,
Best regards,
Angelo Dureghello

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