[U-Boot] [PATCH] serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

2015-09-28 Thread Masahiro Yamada
It looks like this line was copy-pasted, but not modified.

Signed-off-by: Masahiro Yamada 
---

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

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index ccb80d2..ddb725d 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -111,7 +111,7 @@ config DEBUG_UART_SHIFT
 
 config ROCKCHIP_SERIAL
bool "Rockchip on-chip UART support"
-   depends on ARCH_UNIPHIER && DM_SERIAL
+   depends on ARCH_ROCKCHIP && DM_SERIAL
help
  Select this to enable a debug UART for Rockchip devices. This uses
  the ns16550 driver. You will need to #define CONFIG_SYS_NS16550 in
-- 
1.9.1

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


[U-Boot] PCI issues for bringing up ACPI support on QEMU and Minnowmax target

2015-09-28 Thread Saket Sinha
Hi,

This is regarding the PCI configuration issue I am facing for bringing up
ACPI Support on QEMU  and Minnowmax.

Please find below my observations for the QEMU architecture.

I am comparing  arch/x86/cpu/qemu/acpi/pci-crs.asl
and arch/x86/dts/qemu-x86_q35.dts and we find there are different ranges
been specified for PCI configuration in both the files.


I have found out the following things --

a) What does ACPI tell the OS -

The most important chips which responsible for the BIOS code handling are
the southbridge and northbridge.

The northbridge acts as the address forwarder, meaning: it responds to this
"special" memory address in different fashion compared to "normal" memory
address which is forwarded directly to RAM.

The southbridge acts as the address decoder, meaning: it decodes this
"special" memory addresses into the right chip "beneath" it, such as the
BIOS chip.

Below is an example:*Physical Address**Also Known As**Used by**Address
Aliasing Note*000F_h - 000F_hF_seg / F_segment1 Mbit, 2 MBit, and 4
Mbit BIOSalias to _h - _h in *all* chipset just after
power-up000E_h - 000E_hE_seg / E_segment1 Mbit, 2 Mbit, and 4 Mbit
BIOSalias to FFFE_h - FFFE_h in *some* chipset just after
power-upFFFD_h
- FFFD_hD_seg / D_segment2 Mbit, and 4 Mbit BIOS-FFFC_h -
FFFC_hC_seg
/ C_segment2 Mbit, and 4 Mbit BIOS-FFF8_h - FFFB_h-4 Mbit BIOS-


The address ranges shown above contain the BIOS code(part of the ACPI) and
pretty much system specific. Thus all this is communicated by the ACPI to
the OS.

b) What does Device Tree tell the OS -

>From 0x8000 to 0xe000 is the PCI memory space, I/O space and
prefetch space where memory mapping of the PCI bus.  This is what device
tree is dictating.

To sum up Device Tree and ACPI do NOT  the same things and thus play
different values to make devices connected to PCI bus available.


The issue I am facing is that I am  getting configuration errors with BARs.

>> [0.660567] pci :00:01.0: can't claim BAR 0 [mem
>> 0xd000-0xd0ff pref]: no compatible bridge window
>> [0.662083] pci :00:01.0: can't claim BAR 2 [mem
>> 0xc000-0xcfff]: no compatible bridge window
>> [0.663062] pci :00:02.0: can't claim BAR 0 [mem
>> 0xc002-0xc003]: no compatible bridge window
>> [0.664164] pci :00:1f.2: can't claim BAR 5 [mem
>> 0xc008-0xc0080fff]: no compatible bridge window

 BARs are part of the so-called PCI configuration register. Every PCI
device must implement the PCI configuration register dictated by the PCI
specification.
Otherwise, the device will not be regarded as a valid PCI device.

As per my understanding for Qemu q35 (emulation of the ICH9 hostchipset)
where we have PCIe support which is made possible by PCI express enhanced
accessmechanism (ECAM).
This address is 0xe000 which is what I have put
in arch/x86/dts/qemu-x86_q35.dts when I am memory mapping the PCI bus.

Any inputs regarding the issue, as to what I am doing wrong here, are
welcome.


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


Re: [U-Boot] [PATCH v2 02/13] x86: fsp: Report correct number of E820 table entries

2015-09-28 Thread Simon Glass
On 28 September 2015 at 03:11, Bin Meng  wrote:
> The logic to calculate the number of E820 table entries is wrong
> when walking through the FSP HOB tables. Fix it.
>
> Signed-off-by: Bin Meng 
> Tested-by: Jian Luo 
>
> ---
> Simon, I think we need get this fix in v2015.10 release.
>
> Changes in v2: None
>
>  arch/x86/lib/fsp/fsp_dram.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

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


Re: [U-Boot] Please pull u-boot-x86

2015-09-28 Thread Simon Glass
Hi Bin,

On 28 September 2015 at 22:48, Bin Meng  wrote:
> Hi Simon,
>
> On Tue, Sep 29, 2015 at 12:46 PM, Simon Glass  wrote:
>> Hi,
>>
>> A little bug fix,
>>
>> The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:
>>
>>   Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)
>>
>> are available in the git repository at:
>>
>>   git://git.denx.de/u-boot-x86.git
>>
>> for you to fetch changes up to c1446ac6c11dab19490a552f16ab39df8d5b3de3:
>>
>>   x86: chromebook_link: Expand early malloc() memory (2015-09-28 22:27:17 
>> -0600)
>>
>> 
>> Simon Glass (1):
>>   x86: chromebook_link: Expand early malloc() memory
>>
>>  configs/chromebook_link_defconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>
> Do you have a chance to check this one?
> http://patchwork.ozlabs.org/patch/523266/

I'll take a look. Tom can you hold off on this pull request? I'll try
to make this the last one.

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


[U-Boot] [PATCH 2/6] dm: core: Adjust device.h header file order

2015-09-28 Thread Simon Glass
Move a few functions around so that the ordering is consistent.

Signed-off-by: Simon Glass 
---

 include/dm/device.h | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/dm/device.h b/include/dm/device.h
index f152008..e09f897 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -233,6 +233,16 @@ void *dev_get_parent_platdata(struct udevice *dev);
 void *dev_get_uclass_platdata(struct udevice *dev);
 
 /**
+ * dev_get_priv() - Get the private data for a device
+ *
+ * This checks that dev is not NULL, but no other checks for now
+ *
+ * @devDevice to check
+ * @return private data, or NULL if none
+ */
+void *dev_get_priv(struct udevice *dev);
+
+/**
  * dev_get_parent_priv() - Get the parent private data for a device
  *
  * The parent private data is data stored in the device but owned by the
@@ -247,14 +257,14 @@ void *dev_get_uclass_platdata(struct udevice *dev);
 void *dev_get_parent_priv(struct udevice *dev);
 
 /**
- * dev_get_priv() - Get the private data for a device
+ * dev_get_uclass_priv() - Get the private uclass data for a device
  *
  * This checks that dev is not NULL, but no other checks for now
  *
  * @devDevice to check
- * @return private data, or NULL if none
+ * @return private uclass data for this device, or NULL if none
  */
-void *dev_get_priv(struct udevice *dev);
+void *dev_get_uclass_priv(struct udevice *dev);
 
 /**
  * struct dev_get_parent() - Get the parent of a device
@@ -265,16 +275,6 @@ void *dev_get_priv(struct udevice *dev);
 struct udevice *dev_get_parent(struct udevice *child);
 
 /**
- * dev_get_uclass_priv() - Get the private uclass data for a device
- *
- * This checks that dev is not NULL, but no other checks for now
- *
- * @devDevice to check
- * @return private uclass data for this device, or NULL if none
- */
-void *dev_get_uclass_priv(struct udevice *dev);
-
-/**
  * dev_get_driver_data() - get the driver data used to bind a device
  *
  * When a device is bound using a device tree node, it matches a
-- 
2.6.0.rc2.230.g3dd15c0

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


[U-Boot] [PATCH 6/6] dm: core: Tidy up comments in device.h

2015-09-28 Thread Simon Glass
Correct a few nits found in a recent review. Expand the comments in
dev_get_driver_data() to make it clearer.

Signed-off-by: Simon Glass 
---

 include/dm/device.h | 19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/include/dm/device.h b/include/dm/device.h
index 0e40aaf..28ba4ca 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -278,13 +278,26 @@ struct udevice *dev_get_parent(struct udevice *child);
  * dev_get_driver_data() - get the driver data used to bind a device
  *
  * When a device is bound using a device tree node, it matches a
- * particular compatible string as in struct udevice_id. This function
+ * particular compatible string in struct udevice_id. This function
  * returns the associated data value for that compatible string. This is
  * the 'data' field in struct udevice_id.
  *
+ * As an example, consider this structure:
+ * static const struct udevice_id tegra_i2c_ids[] = {
+ * { .compatible = "nvidia,tegra114-i2c", .data = TYPE_114 },
+ * { .compatible = "nvidia,tegra20-i2c", .data = TYPE_STD },
+ * { .compatible = "nvidia,tegra20-i2c-dvc", .data = TYPE_DVC },
+ * { }
+ * };
+ *
+ * When driver model finds a driver for this it will store the 'data' value
+ * corresponding to the compatible string it matches. This function returns
+ * that value. This allows the driver to handle several variants of a device.
+ *
  * For USB devices, this is the driver_info field in struct usb_device_id.
  *
  * @dev:   Device to check
+ * @return driver data (0 if none is provided)
  */
 ulong dev_get_driver_data(struct udevice *dev);
 
@@ -299,7 +312,7 @@ ulong dev_get_driver_data(struct udevice *dev);
  */
 const void *dev_get_driver_ops(struct udevice *dev);
 
-/*
+/**
  * device_get_uclass_id() - return the uclass ID of a device
  *
  * @dev:   Device to check
@@ -307,7 +320,7 @@ const void *dev_get_driver_ops(struct udevice *dev);
  */
 enum uclass_id device_get_uclass_id(struct udevice *dev);
 
-/*
+/**
  * dev_get_uclass_name() - return the uclass name of a device
  *
  * This checks that dev is not NULL.
-- 
2.6.0.rc2.230.g3dd15c0

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


[U-Boot] [PATCH 3/6] dm: core: Fix device flag whitespace

2015-09-28 Thread Simon Glass
Line up the flag values in the code for easier readability.

Signed-off-by: Simon Glass 
---

 include/dm/device.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/dm/device.h b/include/dm/device.h
index e09f897..286a702 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -21,13 +21,13 @@
 struct driver_info;
 
 /* Driver is active (probed). Cleared when it is removed */
-#define DM_FLAG_ACTIVATED  (1 << 0)
+#define DM_FLAG_ACTIVATED  (1 << 0)
 
 /* DM is responsible for allocating and freeing platdata */
-#define DM_FLAG_ALLOC_PDATA(1 << 1)
+#define DM_FLAG_ALLOC_PDATA(1 << 1)
 
 /* DM should init this device prior to relocation */
-#define DM_FLAG_PRE_RELOC  (1 << 2)
+#define DM_FLAG_PRE_RELOC  (1 << 2)
 
 /* DM is responsible for allocating and freeing parent_platdata */
 #define DM_FLAG_ALLOC_PARENT_PDATA (1 << 3)
@@ -36,10 +36,10 @@ struct driver_info;
 #define DM_FLAG_ALLOC_UCLASS_PDATA (1 << 4)
 
 /* Allocate driver private data on a DMA boundary */
-#define DM_FLAG_ALLOC_PRIV_DMA (1 << 5)
+#define DM_FLAG_ALLOC_PRIV_DMA (1 << 5)
 
 /* Device is bound */
-#define DM_FLAG_BOUND  (1 << 6)
+#define DM_FLAG_BOUND  (1 << 6)
 
 /**
  * struct udevice - An instance of a driver
-- 
2.6.0.rc2.230.g3dd15c0

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


[U-Boot] [PATCH 4/6] dm: core: Tidy up devres comments

2015-09-28 Thread Simon Glass
Adjust the devres comments to be consistent with the rest of the file, and
add one for the struct udevice member. Also rename the 'p' parameter to
'ptr' to avoid single-character names.

Signed-off-by: Simon Glass 
---

 include/dm/device.h | 50 --
 1 file changed, 24 insertions(+), 26 deletions(-)

diff --git a/include/dm/device.h b/include/dm/device.h
index 286a702..f60d153 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -78,6 +78,10 @@ struct driver_info;
  * @req_seq: Requested sequence number for this device (-1 = any)
  * @seq: Allocated sequence number for this device (-1 = none). This is set up
  * when the device is probed and will be unique within the device's uclass.
+ * @devres_head: List of memory allocations associated with this device.
+ * When CONFIG_DEVRES is enabled, devm_kmalloc() and friends will
+ * add to this list. Memory so-allocated will be freed
+ * automatically when the device is removed / unbound
  */
 struct udevice {
const struct driver *driver;
@@ -512,7 +516,7 @@ void *_devres_alloc(dr_release_t release, size_t size, 
gfp_t gfp);
 #endif
 
 /**
- * devres_alloc - Allocate device resource data
+ * devres_alloc() - Allocate device resource data
  * @release: Release function devres will be associated with
  * @size: Allocation size
  * @gfp: Allocation flags
@@ -528,7 +532,7 @@ void *_devres_alloc(dr_release_t release, size_t size, 
gfp_t gfp);
_devres_alloc(release, size, gfp | __GFP_ZERO)
 
 /**
- * devres_free - Free device resource data
+ * devres_free() - Free device resource data
  * @res: Pointer to devres data to free
  *
  * Free devres created with devres_alloc().
@@ -536,7 +540,7 @@ void *_devres_alloc(dr_release_t release, size_t size, 
gfp_t gfp);
 void devres_free(void *res);
 
 /**
- * devres_add - Register device resource
+ * devres_add() - Register device resource
  * @dev: Device to add resource to
  * @res: Resource to register
  *
@@ -547,7 +551,7 @@ void devres_free(void *res);
 void devres_add(struct udevice *dev, void *res);
 
 /**
- * devres_find - Find device resource
+ * devres_find() - Find device resource
  * @dev: Device to lookup resource from
  * @release: Look for resources associated with this release function
  * @match: Match function (optional)
@@ -557,14 +561,13 @@ void devres_add(struct udevice *dev, void *res);
  * and for which @match returns 1.  If @match is NULL, it's considered
  * to match all.
  *
- * RETURNS:
- * Pointer to found devres, NULL if not found.
+ * @return pointer to found devres, NULL if not found.
  */
 void *devres_find(struct udevice *dev, dr_release_t release,
  dr_match_t match, void *match_data);
 
 /**
- * devres_get - Find devres, if non-existent, add one atomically
+ * devres_get() - Find devres, if non-existent, add one atomically
  * @dev: Device to lookup or add devres for
  * @new_res: Pointer to new initialized devres to add if not found
  * @match: Match function (optional)
@@ -574,14 +577,13 @@ void *devres_find(struct udevice *dev, dr_release_t 
release,
  * as @new_res and for which @match return 1.  If found, @new_res is
  * freed; otherwise, @new_res is added atomically.
  *
- * RETURNS:
- * Pointer to found or added devres.
+ * @return ointer to found or added devres.
  */
 void *devres_get(struct udevice *dev, void *new_res,
 dr_match_t match, void *match_data);
 
 /**
- * devres_remove - Find a device resource and remove it
+ * devres_remove() - Find a device resource and remove it
  * @dev: Device to find resource from
  * @release: Look for resources associated with this release function
  * @match: Match function (optional)
@@ -592,14 +594,13 @@ void *devres_get(struct udevice *dev, void *new_res,
  * match all.  If found, the resource is removed atomically and
  * returned.
  *
- * RETURNS:
- * Pointer to removed devres on success, NULL if not found.
+ * @return ointer to removed devres on success, NULL if not found.
  */
 void *devres_remove(struct udevice *dev, dr_release_t release,
dr_match_t match, void *match_data);
 
 /**
- * devres_destroy - Find a device resource and destroy it
+ * devres_destroy() - Find a device resource and destroy it
  * @dev: Device to find resource from
  * @release: Look for resources associated with this release function
  * @match: Match function (optional)
@@ -613,14 +614,13 @@ void *devres_remove(struct udevice *dev, dr_release_t 
release,
  * only the devres-allocated data will be freed.  The caller becomes
  * responsible for freeing any other data.
  *
- * RETURNS:
- * 0 if devres is found and freed, -ENOENT if not found.
+ * @return 0 if devres is found and freed, -ENOENT if not found.
  */
 int devres_destroy(struct udevice *dev, dr_release_t release,
   dr_match_t match, void *match_data);
 
 /**
- * devres_release - Find a device resource and destroy 

Re: [U-Boot] [PATCH] serial: rockchip: make ROCKCHIP_SERIAL depend on ARCH_ROCKCHIP

2015-09-28 Thread Simon Glass
On 28 September 2015 at 21:32, Masahiro Yamada
 wrote:
> It looks like this line was copy-pasted, but not modified.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  drivers/serial/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks!

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


Re: [U-Boot] PCI issues for bringing up ACPI support on QEMU and Minnowmax target

2015-09-28 Thread Bin Meng
Hi Saket,

Changing email format to plain text, not sure if the mailing list allows HTML ..

On Tue, Sep 29, 2015 at 12:36 PM, Saket Sinha  wrote:
>
> Hi,
>
> This is regarding the PCI configuration issue I am facing for bringing up 
> ACPI Support on QEMU  and Minnowmax.
>
> Please find below my observations for the QEMU architecture.
>
> I am comparing  arch/x86/cpu/qemu/acpi/pci-crs.asl and 
> arch/x86/dts/qemu-x86_q35.dts and we find there are different ranges
> been specified for PCI configuration in both the files.
>
>
> I have found out the following things --
>
> a) What does ACPI tell the OS -
>
> The most important chips which responsible for the BIOS code handling are the 
> southbridge and northbridge.
>
> The northbridge acts as the address forwarder, meaning: it responds to this 
> "special" memory address in different fashion compared to "normal" memory 
> address which is forwarded directly to RAM.
>
> The southbridge acts as the address decoder, meaning: it decodes this 
> "special" memory addresses into the right chip "beneath" it, such as the BIOS 
> chip.
>
> Below is an example:
> Physical AddressAlso Known AsUsed byAddress Aliasing Note
> 000F_h - 000F_hF_seg / F_segment1 Mbit, 2 MBit, and 4 Mbit BIOSalias 
> to _h - _h in all chipset just after power-up
> 000E_h - 000E_hE_seg / E_segment1 Mbit, 2 Mbit, and 4 Mbit BIOSalias 
> to FFFE_h - FFFE_h in some chipset just after power-up
> FFFD_h - FFFD_hD_seg / D_segment2 Mbit, and 4 Mbit BIOS-
> FFFC_h - FFFC_hC_seg / C_segment2 Mbit, and 4 Mbit BIOS-
> FFF8_h - FFFB_h-4 Mbit BIOS-
>
>
> The address ranges shown above contain the BIOS code(part of the ACPI) and 
> pretty much system specific. Thus all this is communicated by the ACPI to the 
> OS.
>
> b) What does Device Tree tell the OS -
>
> From 0x8000 to 0xe000 is the PCI memory space, I/O space and prefetch 
> space where memory mapping of the PCI bus.  This is what device tree is 
> dictating.
>
> To sum up Device Tree and ACPI do NOT  the same things and thus play 
> different values to make devices connected to PCI bus available.
>
>
> The issue I am facing is that I am  getting configuration errors with BARs.
>
> >> [0.660567] pci :00:01.0: can't claim BAR 0 [mem
> >> 0xd000-0xd0ff pref]: no compatible bridge window
> >> [0.662083] pci :00:01.0: can't claim BAR 2 [mem
> >> 0xc000-0xcfff]: no compatible bridge window
> >> [0.663062] pci :00:02.0: can't claim BAR 0 [mem
> >> 0xc002-0xc003]: no compatible bridge window
> >> [0.664164] pci :00:1f.2: can't claim BAR 5 [mem
> >> 0xc008-0xc0080fff]: no compatible bridge window
>
>  BARs are part of the so-called PCI configuration register. Every PCI device 
> must implement the PCI configuration register dictated by the PCI 
> specification.
> Otherwise, the device will not be regarded as a valid PCI device.
>
> As per my understanding for Qemu q35 (emulation of the ICH9 hostchipset) 
> where we have PCIe support which is made possible by PCI express enhanced 
> accessmechanism (ECAM).
> This address is 0xe000 which is what I have put in 
> arch/x86/dts/qemu-x86_q35.dts when I am memory mapping the PCI bus.
>
> Any inputs regarding the issue, as to what I am doing wrong here, are welcome.
>

I don't quite understand what you are trying to ask in this thread. I
remember I answered your confusion regarding to PCI memory-mapped
space vs. ECAM in another thread before.

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


[U-Boot] [PATCH 1/6] dm: Rename dev_get_parentdata() to dev_get_parent_priv()

2015-09-28 Thread Simon Glass
The current name is inconsistent with other driver model data access
functions. Rename it and fix up all users.

Signed-off-by: Simon Glass 
---

 common/cmd_usb.c  | 10 +-
 common/usb_hub.c  |  4 ++--
 common/usb_storage.c  |  2 +-
 doc/driver-model/usb-info.txt |  4 ++--
 drivers/core/device.c |  2 +-
 drivers/misc/cros_ec_spi.c|  4 ++--
 drivers/mtd/spi/sf_dataflash.c|  2 +-
 drivers/mtd/spi/sf_probe.c|  2 +-
 drivers/spi/fsl_qspi.c|  2 +-
 drivers/spi/ich.c |  2 +-
 drivers/spi/soft_spi.c|  2 +-
 drivers/spi/spi-uclass.c  |  8 
 drivers/usb/eth/smsc95xx.c|  4 ++--
 drivers/usb/eth/usb_ether.c   |  2 +-
 drivers/usb/host/ehci-hcd.c   |  6 +++---
 drivers/usb/host/usb-uclass.c |  8 
 drivers/usb/host/xhci.c   |  4 ++--
 drivers/usb/musb-new/usb-compat.h | 10 +-
 include/dm/device.h   | 10 +-
 include/pci.h |  2 +-
 include/spi.h |  2 +-
 include/usb.h |  2 +-
 test/dm/bus.c | 26 +-
 23 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 6bdbbc5..1ef55dc 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -281,7 +281,7 @@ static struct usb_device *usb_find_device(int devnum)
 
if (!device_active(hub))
continue;
-   udev = dev_get_parentdata(hub);
+   udev = dev_get_parent_priv(hub);
if (udev->devnum == devnum)
return udev;
 
@@ -291,7 +291,7 @@ static struct usb_device *usb_find_device(int devnum)
if (!device_active(hub))
continue;
 
-   udev = dev_get_parentdata(dev);
+   udev = dev_get_parent_priv(dev);
if (udev->devnum == devnum)
return udev;
}
@@ -407,7 +407,7 @@ static void usb_show_tree_graph(struct usb_device *dev, 
char *pre)
if (!device_active(child))
continue;
 
-   udev = dev_get_parentdata(child);
+   udev = dev_get_parent_priv(child);
 
/* Ignore emulators, we only want real devices */
if (device_get_uclass_id(child) != UCLASS_USB_EMUL) {
@@ -553,7 +553,7 @@ static void show_info(struct udevice *dev)
struct udevice *child;
struct usb_device *udev;
 
-   udev = dev_get_parentdata(dev);
+   udev = dev_get_parent_priv(dev);
usb_display_desc(udev);
usb_display_config(udev);
for (device_find_first_child(dev, );
@@ -641,7 +641,7 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 
device_find_first_child(bus, );
if (dev && device_active(dev)) {
-   udev = dev_get_parentdata(dev);
+   udev = dev_get_parent_priv(dev);
usb_show_tree(udev);
}
}
diff --git a/common/usb_hub.c b/common/usb_hub.c
index 415b45c..a92c9fb 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -230,7 +230,7 @@ int legacy_hub_port_reset(struct usb_device *dev, int port,
 #ifdef CONFIG_DM_USB
 int hub_port_reset(struct udevice *dev, int port, unsigned short *portstat)
 {
-   struct usb_device *udev = dev_get_parentdata(dev);
+   struct usb_device *udev = dev_get_parent_priv(dev);
 
return legacy_hub_port_reset(udev, port, portstat);
 }
@@ -610,7 +610,7 @@ int usb_hub_probe(struct usb_device *dev, int ifnum)
 #ifdef CONFIG_DM_USB
 int usb_hub_scan(struct udevice *hub)
 {
-   struct usb_device *udev = dev_get_parentdata(hub);
+   struct usb_device *udev = dev_get_parent_priv(hub);
 
return usb_hub_configure(udev);
 }
diff --git a/common/usb_storage.c b/common/usb_storage.c
index b390310..0ccaeb4 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -1408,7 +1408,7 @@ int usb_stor_get_info(struct usb_device *dev, struct 
us_data *ss,
 
 static int usb_mass_storage_probe(struct udevice *dev)
 {
-   struct usb_device *udev = dev_get_parentdata(dev);
+   struct usb_device *udev = dev_get_parent_priv(dev);
int ret;
 
usb_disable_asynch(1); /* asynch transfer not allowed */
diff --git a/doc/driver-model/usb-info.txt b/doc/driver-model/usb-info.txt
index 66f2dae..e07e5ba 100644
--- a/doc/driver-model/usb-info.txt
+++ b/doc/driver-model/usb-info.txt
@@ -84,7 +84,7 @@ The following primary data structures are in use:
This holds information about a device on the bus. All devices have
this structure, even the root hub. The controller itself does not
have this 

Re: [U-Boot] [PATCH] board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

2015-09-28 Thread Hannes Schmelzer

Hi Bin,

works now well.
Also the thing with bootvx and the bootline works fine.

I will send some v2 of my patch today.

many thanks and best regards,
Hannes


On 29.09.2015 04:46, Bin Meng wrote:

Hi Hannes,

On Mon, Sep 28, 2015 at 8:01 PM, Bin Meng  wrote:

Hi Hannes,

On Mon, Sep 28, 2015 at 7:08 PM, Hannes Schmelzer
 wrote:

Hi Bin,

i am not able to apply your patch from
http://patchwork.ozlabs.org/patch/523289/
to most current master.

schmelzerh@hpm-debian ~/work/u-boot $ git am
U-Boot-v2-01-13-Reorder-defconfigs-with-savedefconfig.patch
Applying: Reorder defconfigs with 'savedefconfig'
error: patch failed: configs/e2220-1170_defconfig:9
error: configs/e2220-1170_defconfig: patch does not apply
error: patch failed: configs/p2371-_defconfig:9
error: configs/p2371-_defconfig: patch does not apply
error: patch failed: configs/p2571_defconfig:9
error: configs/p2571_defconfig: patch does not apply
Patch failed at 0001 Reorder defconfigs with 'savedefconfig'

maybe you've to rebase your working branch.


Sorry. Yes, I forgot to rebase. Will send a new patch soon.


The patch#1 has been merged into u-boot/master. Please apply patch
2-13 on top of latest mainline in the series and have a try.

Regards,
Bin




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


Re: [U-Boot] [PATCH] fdt: fix fdtdec_get_addr_size not to require any size cells

2015-09-28 Thread Simon Glass
On 28 September 2015 at 04:41, Przemyslaw Marczak  wrote:
> Hello Stephen,
>
>
> On 09/25/2015 06:11 PM, Stephen Warren wrote:
>>
>> From: Stephen Warren 
>>
>> fdtdec_get_addr_size() may be used in two cases:
>> a) With sizep supplied, in which case both an address and a size are
>> parsed from DT. In this case, the DT property must be large enough to
>> contain both values.
>> b) With sizep NULL, in which case only an address is parsed from DT.
>> In this case, the DT property only need be large enough to contain this
>> address value. Commit 02464e386bb5 "fdt: add new fdt address parsing
>> functions" broke this relaxed checking, and required the DT property to
>> contain both an address and a size value in all cases.
>>
>> Fix fdtdec_get_addr_size() to vary ns based on whether the size value
>> is being parsed from the DT or not. This is safe since the function only
>> parses the first entry in the property, so the overall value of (na + ns)
>> need not be accurate, since it is never used to step through the property
>> data to find other entries. Besides, this fixed behaviour essentially
>> matches the original behaviour before the patch this patch fixes. (The
>> original code validated that the property was exactly the length of
>> either na or (na + ns), whereas the current code only validates that the
>> property is at least that long. For non-failure cases, the two behaviours
>> are identical).
>>
>> Cc: Przemyslaw Marczak 
>> Cc: Simon Glass 
>> Cc: Thierry Reding 
>> Cc: Bin Meng 
>> Cc: Michal Suchanek 
>> Fixes: 02464e386bb5 ("fdt: add new fdt address parsing functions")
>> Reported-by: Przemyslaw Marczak 
>> Signed-off-by: Stephen Warren 
>> ---
>>   lib/fdtdec.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)

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


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

2015-09-28 Thread Simon Glass
Hi,

A little bug fix,

The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:

  Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)

are available in the git repository at:

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

for you to fetch changes up to c1446ac6c11dab19490a552f16ab39df8d5b3de3:

  x86: chromebook_link: Expand early malloc() memory (2015-09-28 22:27:17 -0600)


Simon Glass (1):
  x86: chromebook_link: Expand early malloc() memory

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

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


Re: [U-Boot] [PATCH 2/3] fix: s5p_gpio: call: dev_get_addr() instead of fdtdec_get_addr()

2015-09-28 Thread Simon Glass
On 25 September 2015 at 09:48, Stephen Warren  wrote:
> On 09/25/2015 02:36 AM, Przemyslaw Marczak wrote:
>>
>> Hello Stephen,
>>
>> On 09/24/2015 07:29 PM, Stephen Warren wrote:
>>>
>>> On 09/24/2015 09:29 AM, Przemyslaw Marczak wrote:

 After rework in lib/fdtdec.c, the function fdtdec_get_addr()
 doesn't work for nodes with #size-cells property, set to 0.

 To get GPIO's 'reg' property, the code should use one of:
 fdtdec_get_addr_size_auto_no/parent() function.

 Fortunately dm core provides a function to get the property.

 This commit reworks function gpio_exynos_bind(), to properly
 use dev_get_addr() for GPIO device.

 This prevents setting a wrong base register for Exynos GPIOs.
>>>
>>>
>>> Migrating everything to dev_get_addr() is the correct long-term fix, so
>>> this patch,
>>>
>>> Acked-by: Stephen Warren 
>>>
>>> ... although I'd have liked to see a smaller diff that didn't both
>>> re-order all the code /and/ call a different function, but I suppose
>>> that's not possible given the need to pass the device object to
>>> dev_get_addr(). You could have used fdtdec_get_addr_size_auto_parent()
>>> directly.
>>
>>
>> Yes, it's not a single line diff, but the driver supports driver-model,
>> so it's natural that it should use driver model API if can, instead of
>> fdtdec API.
>>
>> This approach makes things easier to test and catch mistakes in the
>> future.
>>
>>>
>>>
>>> I think it'd be good to fix fdtdec_get_addr_size() to have the same
>>> semantics that it previously did. There might be other code in U-Boot
>>> that's affected by the same issue, and fixing fdtdec_get_addr_size()
>>> would make sure that all got fixed too. Are you willing to send that
>>> patch too?
>>>
>>> Essentially, fdtdec_get_addr_size() used to assume:
>>>
>>> #address-cells == sizeof(fdt_addr_t)
>>> if sizep == NULL:
>>>  #size-cells == 0
>>> else:
>>>  #size-cells == sizeof(fdt_addr_t)
>>>
>>> However, it now assumes:
>>>
>>> #address-cells == sizeof(fdt_addr_t)
>>> #size-cells == sizeof(fdt_addr_t)
>>>
>>> Let's just add that condition back by doing something like the following
>>> in fdtdec_get_addr_size():
>>>
>>> u32 ns;
>>>
>>> if (sizep)
>>>  ns = sizeof(fdt_size_t) / sizeof(fdt32_t);
>>> else
>>>  ns = 0;
>>>
>>> ... and replacing the ns parameter that's passed to
>>> fdtdec_get_addr_size_fixed() with that variable, rather than hard-coding
>>> it.
>>
>>
>> Sorry, currently I have some other things to do, and I wouldn't prefer
>> fixing this without proper testing. Such core things should be tested in
>> sandbox by couple of unit tests.
>
>
> OK, I'll take a stab at it.
>
>> This seem to be okay, but is still wrong.
>>
>> We should always call fdtdec_get_addr_size_fixed() with arguments, which
>> fits to the dtb, instead of hardcoded values.
>>
>> So, only the implementation of function
>>
>> fdtdec_get_addr_size_auto_parent()
>>
>> seem to be correct.
>>
>> It check the real #address-cells and #size-cells.
>
>
> Right. All "client" code should be migrated to call function which look at
> #address-cells and #size-cells. That's what
> fdtdec_get_addr_size_auto_parent(), fdtdec_get_addr_size_auto_noparent(),
> and dev_get_addr() do.
>
> However, there is code in U-Boot which (incorrectly) used fdtdec_get_addr()
> to parse properties other than reg. Those properties aren't affected by
> #address-cells and #size-cells. Hence, the hard-coding of na and ns inside
> fdtdec_get_addr_size() is required to support those use-case. Hopefully once
> everything that parses reg is migrated to the functions that look at
> #address-cells and #size-cells, fdtdec_get_addr_size() can be renamed to
> make it obvious it shouldn't be used for parsing reg.
>
>> If this is slow, then maybe we need some cache with nodes, its
>> parents/childs and its size/addr cells to be checked only once?
>
>
> Hopefully all (or almost all) use-cases can use dev_get_addr(). There's no
> slowness there, since there's no searching of the DT to find the parent;
> it's already known directly.

Tested on snow:
Tested-by: Simon Glass 

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


Re: [U-Boot] [PATCH V2 3/3] mach-exynos: clock: restore calling dead exynos4_get_mmc_clk()

2015-09-28 Thread Simon Glass
Hi,

On 28 September 2015 at 06:17, Przemyslaw Marczak  wrote:
> After rework of code by:
>
> commit: d952796 Exynos5: Use clock_get_periph_rate generic API
>
> function get_mmc_clk() always returns -1 for Exynos 4.
>
> This was caused by omitting, that SDHCI driver for Exynos 4,
> calls get_mmc_clk(), with mmc device number as argument,
> instead of pinmux peripheral id, like DW MMC driver for Exynos 5.
>
> By this commit, the code directly calls a proper function
> to get mmc clock for Exynos 4, without checking the peripheral id.
>
> Signed-off-by: Przemyslaw Marczak 
> ---
> Changes V2:
> - cleanup commit message
> ---
>  arch/arm/mach-exynos/clock.c | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)

I'll pick this up if needed. I tested that it does not break exynos5,
but have not tested it on exynos4.

Acked-by: Simon Glass 

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


Re: [U-Boot] [PATCH V2 1/3] fdtdec: fix parsing 'reg' property with zero value in '#size-cells'

2015-09-28 Thread Simon Glass
On 28 September 2015 at 06:17, Przemyslaw Marczak  wrote:
> After rework of lib/fdtdec.c by:
>
> commit: 02464e3 fdt: add new fdt address parsing functions
>
> the function fdtdec_get_addr() doesn't work as previous,
> because the implementation assumes that properties '#address-cells'
> and '#size-cells' are equal to 1, which can be not true sometimes.
>
> The new API introduced fdtdec_get_addr_size_auto_parent() for the 'reg'
> property parsing, but the implementation assumes, that #size-cells
> can't be less than 1.
>
> This causes that the following children's 'reg' property can't be reached:
>
> parent@0x100 {
>  #address-cells = <1>;
>  #size-cells = <0>;
>  children@0x100 {
>  reg = < 0x100 >;
>  };
> };
>
> Change the condition value from '1' to '0', which allows parsing property
> with at least zero #size-cells, fixes the issue.
>
> Now, fdtdec_get_addr_size_auto_parent() works properly.
>
> Signed-off-by: Przemyslaw Marczak 
> Acked-by: Stephen Warren 
> ---
> Changes V2:
> - cleanup commit message
> - add acked-by
> ---
>  lib/fdtdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I'll pick this series up if no one else is planning to.

Tested on snow
Tested-by: Simon Glass 

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


[U-Boot] [PATCH 5/6] dm: core: Remove a comment about dropping per_child_auto_alloc_size

2015-09-28 Thread Simon Glass
This has proven useful and we no-longer intend to remove it. Drop the
comment.

Signed-off-by: Simon Glass 
---

 include/dm/device.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/include/dm/device.h b/include/dm/device.h
index f60d153..0e40aaf 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -170,10 +170,6 @@ struct udevice_id {
  * @per_child_auto_alloc_size: Each device can hold private data owned by
  * its parent. If required this will be automatically allocated if this
  * value is non-zero.
- * TODO(s...@chromium.org): I'm considering dropping this, and just having
- * device_probe_child() pass it in. So far the use case for allocating it
- * is SPI, but I found that unsatisfactory. Since it is here I will leave it
- * until things are clearer.
  * @per_child_platdata_auto_alloc_size: A bus likes to store information about
  * its children. If non-zero this is the size of this data, to be allocated
  * in the child's parent_platdata pointer.
-- 
2.6.0.rc2.230.g3dd15c0

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


Re: [U-Boot] [PATCH 01/10] x86: chromebook_link: Expand early malloc() memory

2015-09-28 Thread Simon Glass
On 14 September 2015 at 06:15, Bin Meng  wrote:
>
> On Wed, Sep 9, 2015 at 7:52 AM, Simon Glass  wrote:
> > Now that PCI bridges are probed before relocation we need additional memory.
> > Each PCI bridge takes 240 bytes at present since it uses the same uclass as
> > the PCI controller. Probably we should split this out so that bridges have
> > their own uclass.
> >
> > Expand the memory on link so that it works correctly.
> >
> > Signed-off-by: Simon Glass 
> > ---
> >
> >  configs/chromebook_link_defconfig | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/configs/chromebook_link_defconfig 
> > b/configs/chromebook_link_defconfig
> > index 9855736..b3ae925 100644
> > --- a/configs/chromebook_link_defconfig
> > +++ b/configs/chromebook_link_defconfig
> > @@ -1,4 +1,5 @@
> >  CONFIG_X86=y
> > +CONFIG_SYS_MALLOC_F_LEN=0x1800
> >  CONFIG_VENDOR_GOOGLE=y
> >  CONFIG_DEFAULT_DEVICE_TREE="chromebook_link"
> >  CONFIG_TARGET_CHROMEBOOK_LINK=y
> > --
>
> Reviewed-by: Bin Meng 

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


Re: [U-Boot] [PATCH v2] nios2: convert nios2 cpu to driver model

2015-09-28 Thread Marek Vasut
On Tuesday, September 29, 2015 at 03:28:01 AM, Thomas Chou wrote:
> Convert nios2 cpu to driver model. The cpu parameters are
> extracted from device tree and saved to global data structure.
> We will use them to replace the custom_fpga.h .
> 
> Signed-off-by: Thomas Chou 

Hi!

Minor nitpicks below.

> ---
> v2
>   move cpu param setup to arch_cpu_init_dm, remove probe.
> 
>  arch/Kconfig |  3 ++
>  arch/nios2/cpu/cpu.c | 76
> ++-- arch/nios2/dts/3c120_devboard.dts   
> |  1 +
>  arch/nios2/include/asm/global_data.h |  8 
>  configs/nios2-generic_defconfig  |  2 -
>  5 files changed, 85 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/Kconfig b/arch/Kconfig
> index 207c778..9be1538 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -64,6 +64,9 @@ config NIOS2
>   select HAVE_GENERIC_BOARD
>   select SYS_GENERIC_BOARD
>   select SUPPORT_OF_CONTROL
> + select OF_CONTROL
> + select DM
> + select CPU

What's this CONFIG_CPU for please ?

>  config OPENRISC
>   bool "OpenRISC architecture"
> diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
> index 39ae972..88984e2 100644
> --- a/arch/nios2/cpu/cpu.c
> +++ b/arch/nios2/cpu/cpu.c
> @@ -6,7 +6,9 @@
>   */
> 
>  #include 
> -#include 
> +#include 
> +#include 
> +#include 
>  #include 
> 
>  DECLARE_GLOBAL_DATA_PTR;
> @@ -51,10 +53,78 @@ void dcache_disable(void)
>   flush_dcache(CONFIG_SYS_DCACHE_SIZE, CONFIG_SYS_DCACHELINE_SIZE);
>  }
> 
> -int arch_cpu_init(void)
> +int arch_cpu_init_dm(void)
>  {
> - gd->cpu_clk = CONFIG_SYS_CLK_FREQ;
> + struct udevice *dev;
> +
> + uclass_first_device(UCLASS_CPU, );
> + if (!dev)
> + return -ENODEV;
> +
> + gd->cpu_clk = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
> + "clock-frequency", 0);
> + gd->arch.dcache_line_size = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
> + "dcache-line-size", 0);
> + gd->arch.icache_line_size = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
> + "icache-line-size", 0);
> + gd->arch.dcache_size = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
> + "dcache-size", 0);
> + gd->arch.icache_size = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
> + "icache-size", 0);
> + gd->arch.reset_addr = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
> + "altr,reset-addr", 0);
> + gd->arch.exception_addr = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
> + "altr,exception-addr", 0);
> + gd->arch.has_mmu = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
> + "altr,has-mmu", 0);

Shouldn't there be some sort of return value checking here ?

> + gd->arch.io_region_base = gd->arch.has_mmu ? 0xe000 : 0x800;
>   gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
> 
>   return 0;
>  }
> +
> +static int altera_nios2_get_desc(struct udevice *dev, char *buf, int size)
> +{
> + const char *cpu_name = "Nios-II";
> +
> + if (size < strlen(cpu_name))
> + return -ENOSPC;
> + strcpy(buf, cpu_name);
> +
> + return 0;
> +}
> +
> +static int altera_nios2_get_info(struct udevice *dev, struct cpu_info
> *info) +{
> +
> + info->cpu_freq = gd->cpu_clk;
> + info->features = 1 << CPU_FEAT_L1_CACHE
> + | (gd->arch.has_mmu ? 1 << CPU_FEAT_MMU : 0);

I'd add parenthesis around the bitshifts, for the sake of clarity.
Also, please put the ORR operator at the end of the line.

> + return 0;
> +}

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


Re: [U-Boot] Please pull u-boot-x86

2015-09-28 Thread Bin Meng
Hi Simon,

On Tue, Sep 29, 2015 at 12:46 PM, Simon Glass  wrote:
> Hi,
>
> A little bug fix,
>
> The following changes since commit 1f8836396de8215b7f460616926052b32597bb29:
>
>   Prepare v2015.10-rc4 (2015-09-28 16:57:42 -0400)
>
> are available in the git repository at:
>
>   git://git.denx.de/u-boot-x86.git
>
> for you to fetch changes up to c1446ac6c11dab19490a552f16ab39df8d5b3de3:
>
>   x86: chromebook_link: Expand early malloc() memory (2015-09-28 22:27:17 
> -0600)
>
> 
> Simon Glass (1):
>   x86: chromebook_link: Expand early malloc() memory
>
>  configs/chromebook_link_defconfig | 1 +
>  1 file changed, 1 insertion(+)
>

Do you have a chance to check this one?
http://patchwork.ozlabs.org/patch/523266/

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


Re: [U-Boot] [PATCH 03/11] Kconfig: add CONFIG_SYS_BOOTM_LEN

2015-09-28 Thread Hans de Goede

Hi,

On 28-09-15 17:10, Tom Rini wrote:

On Wed, Sep 23, 2015 at 10:25:35AM -0700, Ryan Harkin wrote:


As config migrates from board config files to Kconfig, when adding
CONFIG_SYS_BOOTM_LEN to a platform, I decided to add
Kconfig support for CONFIG_SYS_BOOTM_LEN.

Signed-off-by: Ryan Harkin 
Reviewed-by: Linus Walleij 
CC: Masahiro Yamada 
CC: Simon Glass 
CC: Linus Walleij 


Thanks for trying to do this.  The problem however is that you need to
use tools/moveconfig.py so that all of the other boards (which is a lot)
get updated too, otherwise they fail to build.


No, just no, not more polluting of defconfig files with things which really
belong in a per SoC file not a per board file.

I think we can fix the "make savedefconfig" warnings by doing something like
this in a per SoC Kconfig file:

if ARCH_SUNXI

defconfig SYS_BOOTM_LEN
default 0x0f00 if ARCH_SUNXI

endif

The second "if ARCH_SUNXI" is necessary to stop the script calling
"make savedefconfig" for all boards to clean the defconfig files from 
complaining.

Please let set per SoC defaults this way rather then turning the defconfig
files in a mixture of board / soc settings where as they should really
only select the SoC and then contain board specific settings on top of
that.

Regards,

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


Re: [U-Boot] [PATCH v2 4/4] exynos: more debug and cleanup in do_sdhci_init()

2015-09-28 Thread Przemyslaw Marczak

Hello,

On 09/25/2015 07:18 PM, Tobias Jakobi wrote:

Add more debug printfs in do_sdhci_init() for calls
that can potentially fail.

Signed-off-by: Tobias Jakobi 
---
  drivers/mmc/s5p_sdhci.c | 20 +++-
  1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index b60bc23..f88d76b 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -102,29 +102,31 @@ struct sdhci_host sdhci_host[SDHCI_MAX_HOSTS];

  static int do_sdhci_init(struct sdhci_host *host)
  {
-   int dev_id, flag;
-   int err = 0;
+   int dev_id, flag, ret;

flag = host->bus_width == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE;
dev_id = host->index + PERIPH_ID_SDMMC0;

if (dm_gpio_is_valid(>pwr_gpio)) {
dm_gpio_set_value(>pwr_gpio, 1);
-   err = exynos_pinmux_config(dev_id, flag);
-   if (err) {
+   ret = exynos_pinmux_config(dev_id, flag);
+   if (ret) {
debug("MMC not configured\n");
-   return err;
+   return ret;
}
}

if (dm_gpio_is_valid(>cd_gpio)) {
-   if (dm_gpio_get_value(>cd_gpio))
+   ret = dm_gpio_get_value(>cd_gpio);
+   if (ret) {
+   debug("no SD card detected (%d)\n", ret);
return -ENODEV;
+   }

-   err = exynos_pinmux_config(dev_id, flag);
-   if (err) {
+   ret = exynos_pinmux_config(dev_id, flag);
+   if (ret) {
printf("external SD not configured\n");
-   return err;
+   return ret;
}
}




Acked-by: Przemyslaw Marczak 

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


Re: [U-Boot] [PATCH v6 8/9] armv8: cavium: Add an implementation of ATF calling functions

2015-09-28 Thread Tom Rini
On Mon, Sep 28, 2015 at 07:27:57PM +0300, Sergei Temerkhanov wrote:
> On Mon, Sep 28, 2015 at 5:47 PM, Tom Rini  wrote:
> > On Fri, Sep 25, 2015 at 07:17:18PM +0300, Sergey Temerkhanov wrote:
> >
> >> This commit adds functions issuing calls to the product-specific ATF
> >> services
> >>
> >> Signed-off-by: Sergey Temerkhanov 
> >> Signed-off-by: Radha Mohan Chintakuntla 
> >
> > OK, problem:
> >
> >> +#ifdef CONFIG_CMD_ATF
> >> +
> >> +static void atf_print_ver(void)
> >> +{
> >> + struct pt_regs regs;
> >> + regs.regs[0] = ARM_STD_SVC_VERSION;
> >> +
> >> + smc_call();
> >> +
> >> + printf("ARM Std FW version: %ld.%ld\n", regs.regs[0], regs.regs[1]);
> >> +
> >> + regs.regs[0] = THUNDERX_SVC_VERSION;
> >> +
> >> + smc_call();
> >> +
> >> + printf("ThunderX OEM ver: %ld.%ld\n", regs.regs[0], regs.regs[1]);
> >> +}
> >> +
> >> +static void atf_print_uid(void)
> >> +{
> >> +}
> >> +
> >> +static void atf_print_part_table(void)
> >> +{
> >> + size_t pcount;
> >> + unsigned long i;
> >> + int ret;
> >> + char *ptype;
> >> +
> >> + struct storage_partition *part = (void *)CONFIG_SYS_LOWMEM_BASE;
> >> +
> >> + pcount = atf_get_pcount();
> >> +
> >> + printf("Partition count: %lu\n\n", pcount);
> >> + printf("%10s %10s %10s\n", "Type", "Size", "Offset");
> >> +
> >> + for (i = 0; i < pcount; i++) {
> >> + ret = atf_get_part(part, i);
> >> +
> >> + if (ret < 0) {
> >> + printf("Uknown error while reading partition: %d\n",
> >> +ret);
> >> + return;
> >> + }
> >> +
> >> + switch (part->type) {
> >> + case PARTITION_NBL1FW_REST:
> >> + ptype = "NBL1FW";
> >> + break;
> >> + case PARTITION_BL2_BL31:
> >> + ptype = "BL2_BL31";
> >> + break;
> >> + case PARTITION_UBOOT:
> >> + ptype = "BOOTLDR";
> >> + break;
> >> + case PARTITION_KERNEL:
> >> + ptype = "KERNEL";
> >> + break;
> >> + case PARTITION_DEVICE_TREE:
> >> + ptype = "DEVTREE";
> >> + break;
> >> + default:
> >> + ptype = "UNKNOWN";
> >> + }
> >> + printf("%10s %10d %10lx\n", ptype, part->size, part->offset);
> >> + }
> >> +}
> >> +
> >> +int do_atf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> >> +{
> >> + ssize_t ret;
> >> + size_t size, offset;
> >> + void *buffer = 0;
> >> + unsigned int index, node;
> >> + char str[4 * sizeof(uint64_t)];
> >> +
> >> + if ((argc == 5) && !strcmp(argv[1], "readmmc")) {
> >> + buffer = (void *)simple_strtoul(argv[2], NULL, 16);
> >> + offset = simple_strtoul(argv[3], NULL, 10);
> >> + size = simple_strtoul(argv[4], NULL, 10);
> >> +
> >> + ret = atf_read_mmc(offset, buffer, size);
> >> + } else if ((argc == 5) && !strcmp(argv[1], "readnor")) {
> >> + buffer = (void *)simple_strtoul(argv[2], NULL, 16);
> >> + offset = simple_strtoul(argv[3], NULL, 10);
> >> + size = simple_strtoul(argv[4], NULL, 10);
> >> +
> >> + ret = atf_read_nor(offset, buffer, size);
> >> + } else if ((argc == 5) && !strcmp(argv[1], "writemmc")) {
> >> + buffer = (void *)simple_strtoul(argv[2], NULL, 16);
> >> + offset = simple_strtoul(argv[3], NULL, 10);
> >> + size = simple_strtoul(argv[4], NULL, 10);
> >> +
> >> + ret = atf_write_mmc(offset, buffer, size);
> >> + } else if ((argc == 5) && !strcmp(argv[1], "writenor")) {
> >> + buffer = (void *)simple_strtoul(argv[2], NULL, 16);
> >> + offset = simple_strtoul(argv[3], NULL, 10);
> >> + size = simple_strtoul(argv[4], NULL, 10);
> >> +
> >> + ret = atf_write_nor(offset, buffer, size);
> >> + } else if ((argc == 2) && !strcmp(argv[1], "part")) {
> >> + atf_print_part_table();
> >> + } else if ((argc == 4) && !strcmp(argv[1], "erasenor")) {
> >> + offset = simple_strtoul(argv[2], NULL, 10);
> >> + size = simple_strtoul(argv[3], NULL, 10);
> >> +
> >> + ret = atf_erase_nor(offset, size);
> >> + } else if ((argc == 2) && !strcmp(argv[1], "envcount")) {
> >> + ret = atf_env_count();
> >> + printf("Number of environment strings: %zd\n", ret);
> >> + } else if ((argc == 3) && !strcmp(argv[1], "envstring")) {
> >> + index = simple_strtoul(argv[2], NULL, 10);
> >> + ret = atf_env_string(index, str);
> >> + if (ret > 0)
> >> + printf("Environment string %d: %s\n", index, 

Re: [U-Boot] Reproducible U-Boot build support, using SOURCE_DATE_EPOCH

2015-09-28 Thread Siarhei Siamashka
On Thu, 24 Sep 2015 09:05:10 -0700
Vagrant Cascadian  wrote:

> On 2015-07-26, Paul Kocialkowski wrote:
> > In order to achieve reproducible builds in U-Boot, timestamps that are 
> > defined
> > at build-time have to be somewhat eliminated. The SOURCE_DATE_EPOCH 
> > environment
> > variable allows setting a fixed value for those timestamps.
> ...
> > However, some other devices might need some more tweaks, especially 
> > regarding
> > the image generation tools.
> 
> With this patch, there is still variation based on timezone in any of
> the u-boot.img and u-boot-sunxi-with-spl.bin produced in the Debian
> packages:
> 
>   https://reproducible.debian.net/rb-pkg/unstable/armhf/u-boot.html
> 
> The good news is that all the u-boot.bin targets are produced
> reproducibly, so here's to progress!

Hello,

I see that Debian is building U-Boot 2015.07 according to the
information from that link. It may be a good idea to ensure that
the following simple patch is also applied:

http://git.denx.de/?p=u-boot.git;a=commitdiff;h=bfb05d0187d70274c77d02dc0de5e728e1f8be05

It had been submitted at the day when somebody (probably you) was
troubleshooting reproducible build issues and asking questions in
the U-Boot IRC channel.

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


Re: [U-Boot] [PATCH v2 2/4] exynos: Fix passing of errors in exynos_mmc_init()

2015-09-28 Thread Przemyslaw Marczak

Hello Tobias,

On 09/25/2015 07:18 PM, Tobias Jakobi wrote:

exynos_mmc_init() always returns zero, so for the caller
it looks like it never fails.

Correct this by returning the error code of process_nodes().
For process_nodes() do something similar and return early
when do_sdhci_init() fails.

v2: Only fail in process_nodes() if we fail on all
 available nodes.

Signed-off-by: Tobias Jakobi 
---
  drivers/mmc/s5p_sdhci.c | 18 --
  1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index e9c43a9..b461fde 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -172,6 +172,7 @@ static int process_nodes(const void *blob, int node_list[], 
int count)
  {
struct sdhci_host *host;
int i, node;
+   int failed = 0;

debug("%s: count = %d\n", __func__, count);

@@ -185,11 +186,18 @@ static int process_nodes(const void *blob, int 
node_list[], int count)

if (sdhci_get_config(blob, node, host)) {
printf("%s: failed to decode dev %d\n",   __func__, 
i);
-   return -1;
+   failed++;
+   continue;
+   }
+
+   if (do_sdhci_init(host)) {
+   printf("%s: failed to initialize dev %d\n", __func__, 
i);
+   failed++;
}
-   do_sdhci_init(host);
}
-   return 0;
+
+   /* we only consider it an error when all nodes fail */
+   return (failed == count ? -1 : 0);
  }

  int exynos_mmc_init(const void *blob)
@@ -201,8 +209,6 @@ int exynos_mmc_init(const void *blob)
COMPAT_SAMSUNG_EXYNOS_MMC, node_list,
SDHCI_MAX_HOSTS);

-   process_nodes(blob, node_list, count);
-
-   return 0;
+   return process_nodes(blob, node_list, count);
  }
  #endif



Acked-by: Przemyslaw Marczak 

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


Re: [U-Boot] [PATCH v2 1/4] exynos: Properly initialize host_caps in s5p_sdhci_core_init()

2015-09-28 Thread Przemyslaw Marczak

Hello Tobias,

On 09/25/2015 07:18 PM, Tobias Jakobi wrote:

The sdhci_host struct is allocated in s5p_sdhci_init() but the
fields are not initialized.

Acked-by: Lukasz Majewski 
Signed-off-by: Tobias Jakobi 
---
  drivers/mmc/s5p_sdhci.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index 4db51d6..e9c43a9 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -76,6 +76,7 @@ static int s5p_sdhci_core_init(struct sdhci_host *host)
host->set_control_reg = _sdhci_set_control_reg;
host->set_clock = set_mmc_clk;

+   host->host_caps = 0;
if (host->bus_width == 8)
host->host_caps |= MMC_MODE_8BIT;




Good point, but we usually initialize only required fields of structures.

What about use of calloc() instead of malloc() for this structure 
allocation, in s5p_sdhci_init() function?


Some time ago, the the memory reserved for malloc was initialized with 
zeroes at early init, so potentially "bugs" like this one, were hidden 
very well.


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


Re: [U-Boot] [PATCH v2 3/4] exynos: be more verbose in process_nodes()

2015-09-28 Thread Przemyslaw Marczak

Hello Tobias,

On 09/25/2015 07:18 PM, Tobias Jakobi wrote:

In case sdhci_get_config() or do_sdhci_init() fail, show
the error code that was returned.

Signed-off-by: Tobias Jakobi 
---
  drivers/mmc/s5p_sdhci.c | 12 +++-
  1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
index b461fde..b60bc23 100644
--- a/drivers/mmc/s5p_sdhci.c
+++ b/drivers/mmc/s5p_sdhci.c
@@ -171,7 +171,7 @@ static int sdhci_get_config(const void *blob, int node, 
struct sdhci_host *host)
  static int process_nodes(const void *blob, int node_list[], int count)
  {
struct sdhci_host *host;
-   int i, node;
+   int i, node, ret;
int failed = 0;

debug("%s: count = %d\n", __func__, count);
@@ -184,14 +184,16 @@ static int process_nodes(const void *blob, int 
node_list[], int count)

host = _host[i];

-   if (sdhci_get_config(blob, node, host)) {
-   printf("%s: failed to decode dev %d\n",   __func__, 
i);



+   ret = sdhci_get_config(blob, node, host);
+   if (ret) {
+   printf("%s: failed to decode dev %d (%d)\n",  __func__, 
i, ret);
failed++;
continue;
}

-   if (do_sdhci_init(host)) {
-   printf("%s: failed to initialize dev %d\n", __func__, 
i);
+   ret = do_sdhci_init(host);
+   if (ret) {
+   printf("%s: failed to initialize dev %d (%d)\n", 
__func__, i, ret);
failed++;
}
}



Acked-by: Przemyslaw Marczak 

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


Re: [U-Boot] Reproducible U-Boot build support, using SOURCE_DATE_EPOCH

2015-09-28 Thread Paul Kocialkowski
Le jeudi 24 septembre 2015 à 09:05 -0700, Vagrant Cascadian a écrit :
> On 2015-07-26, Paul Kocialkowski wrote:
> > In order to achieve reproducible builds in U-Boot, timestamps that are 
> > defined
> > at build-time have to be somewhat eliminated. The SOURCE_DATE_EPOCH 
> > environment
> > variable allows setting a fixed value for those timestamps.
> ...
> > However, some other devices might need some more tweaks, especially 
> > regarding
> > the image generation tools.
> 
> With this patch, there is still variation based on timezone in any of
> the u-boot.img and u-boot-sunxi-with-spl.bin produced in the Debian
> packages:
> 
>   https://reproducible.debian.net/rb-pkg/unstable/armhf/u-boot.html

Thanks for reporting this!

> The good news is that all the u-boot.bin targets are produced
> reproducibly, so here's to progress!

Good, that's a nice first step forward.

> I think the use of "time = mktime(time_universal);" is where the problem
> lies:

[…]

> According to the mktime manpage:
> 
>The  mktime()  function converts a broken-down time structure,
>expressed as local time, to calendar time representation.  
> 
> So my interpetation is that it's taking the UTC time and converts it
> into local time using the configured timezone... not sure what would be
> a viable alternative to mktime.

That seems to make sense. Come to think of it, it probably was not
necessary to call gmtime in the first place: if SOURCE_DATE_EPOCH is
always in UTC, we should be able to stick that as-is in the time
variable. At best, gmtime + mktime (assuming mktime working in UTC)
would give us back the same timestamp.

What do you think? Please let me know if I'm wrong.

> Running with the TZ=UTC environment variable exported works around the
> problem; not sure if it would be appropriate to always run with TZ=UTC
> when SOURCE_DATE_EPOCH is set...

Well that's too much of a workaround to be a reliable solution for the
long term, IMHO.

-- 
Paul Kocialkowski, Replicant developer

Replicant is a fully free Android distribution running on several
devices, a free software mobile operating system putting the emphasis on
freedom and privacy/security.

Website: https://www.replicant.us/
Blog: https://blog.replicant.us/
Wiki/tracker/forums: https://redmine.replicant.us/



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


Re: [U-Boot] [U-Boot, v2, 2/8] ARM: hikey: Add ATF makefile referenced by README

2015-09-28 Thread Tom Rini
On Thu, Sep 10, 2015 at 09:55:12PM +0100, Peter Griffin wrote:

> Rather than relying on an external URL in the README
> include the Makefile in the hikey directory.
> 
> Signed-off-by: Peter Griffin 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 7/8] ARM: hikey: hi6220: Migrate over to DM_SERIAL and use UART3 by default.

2015-09-28 Thread Tom Rini
On Thu, Sep 10, 2015 at 09:55:17PM +0100, Peter Griffin wrote:

> Use DM for the pl01x serial driver on hikey. Also allow UART0 or
> UART3 to be chosen via Kconfig.
> 
> By default we now output to UART3 as the latest version of ATF outputs
> to this UART. Also UART3 comes out on the LS connector, as opposed to
> UART0 which goes to a unpopulated header.
> 
> As part of this change we also enable CONFIG_BOARD_EARLY_INIT_F and
> call the pinmux configuration code for the UART. Before we were
> relying on ATF having already configured the pin configuration.
> 
> NB: Upstream Linux kernel doesn't yet support UART3, so serial console
> will still be output on UART0 when booting a upstream kernel.
> 
> Signed-off-by: Peter Griffin 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 8/8] ARM: hikey: Adjust SDRAM_1_SIZE to 0x3EFFFFFF

2015-09-28 Thread Tom Rini
On Thu, Sep 10, 2015 at 09:55:18PM +0100, Peter Griffin wrote:

> DRAM region 0x3f00 - 0x3fff is reserved for OP-TEE. Touching
> 0x3f00 memory location from unsecure world causes the board
> to hang.
> 
> Signed-off-by: Peter Griffin 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 5/8] ARM: hikey: Remove resetting gd->flags in board_init()

2015-09-28 Thread Tom Rini
On Thu, Sep 10, 2015 at 09:55:15PM +0100, Peter Griffin wrote:

> This causes exceptions and other strange behaviour
> when enabling CONFIG_SYS_MALLOC_F_LEN which is required to
> migrate the serial driver over to DM_SERIAL.
> 
> As GD_FLG_FULL_MALLOC_INIT flag gets reset, after relocation
> we don't end up using the full malloc which ultimately ends up
> causing a synchronus abort.
> 
> Signed-off-by: Peter Griffin 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot,2/6] arm: Remove da830evm board

2015-09-28 Thread Tom Rini
On Sat, Sep 12, 2015 at 11:50:08AM -0600, Simon Glass wrote:

> This board has not been converted to generic board by the deadline.
> Remove it.
> 
> Signed-off-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot,3/6] arm: Remove wireless_space board

2015-09-28 Thread Tom Rini
On Sat, Sep 12, 2015 at 11:50:09AM -0600, Simon Glass wrote:

> This board has not been converted to generic board by the deadline.
> Remove it.
> 
> Signed-off-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 4/8] ARM: hi6220: Add UART0 and UART3 base addresses

2015-09-28 Thread Tom Rini
On Thu, Sep 10, 2015 at 09:55:14PM +0100, Peter Griffin wrote:

> Signed-off-by: Peter Griffin 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 3/8] ARM: hikey: Use linux/sizes.h for malloc size

2015-09-28 Thread Tom Rini
On Thu, Sep 10, 2015 at 09:55:13PM +0100, Peter Griffin wrote:

> Use the #defines in linux/sizes for malloc size as it is
> more readable.
> 
> Signed-off-by: Peter Griffin 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 6/8] ARM: hikey: Select DM, DM_GPIO from Kconfig

2015-09-28 Thread Tom Rini
On Thu, Sep 10, 2015 at 09:55:16PM +0100, Peter Griffin wrote:

> Most platforms enable these options from Kconfig rather
> than the configs header file.
> 
> Signed-off-by: Peter Griffin 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 02/10] Kconfig: fix typo in CONFIG_FIT description

2015-09-28 Thread Tom Rini
On Wed, Aug 26, 2015 at 05:54:45PM +0300, Igor Grinberg wrote:

> Fix typo in CONFIG_FIT description - remove the accidentially added
> redundand 'the'.
> 
> Signed-off-by: Igor Grinberg 
> Cc: Masahiro Yamada 
> Cc: Simon Glass 
> Reviewed-by: Simon Glass 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, v2, 1/8] ARM: hikey: Update README with various corrections

2015-09-28 Thread Tom Rini
On Thu, Sep 10, 2015 at 09:55:11PM +0100, Peter Griffin wrote:

> The README had a few mistakes, and one of the URL's
> had changed. Also update the boot log with the latest
> boot trace from ATF, which now includes the mcuimage.bin.
> 
> Signed-off-by: Peter Griffin 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 03/11] Kconfig: add CONFIG_SYS_BOOTM_LEN

2015-09-28 Thread Tom Rini
On Mon, Sep 28, 2015 at 09:22:35PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 28-09-15 17:10, Tom Rini wrote:
> >On Wed, Sep 23, 2015 at 10:25:35AM -0700, Ryan Harkin wrote:
> >
> >>As config migrates from board config files to Kconfig, when adding
> >>CONFIG_SYS_BOOTM_LEN to a platform, I decided to add
> >>Kconfig support for CONFIG_SYS_BOOTM_LEN.
> >>
> >>Signed-off-by: Ryan Harkin 
> >>Reviewed-by: Linus Walleij 
> >>CC: Masahiro Yamada 
> >>CC: Simon Glass 
> >>CC: Linus Walleij 
> >
> >Thanks for trying to do this.  The problem however is that you need to
> >use tools/moveconfig.py so that all of the other boards (which is a lot)
> >get updated too, otherwise they fail to build.
> 
> No, just no, not more polluting of defconfig files with things which really
> belong in a per SoC file not a per board file.

Well, we should be putting SoC/arch-specific stuff into the defaults and
also using this as a chance to look at places where defaults differ
pointlessly.

But, I also hear your concern.  I see Masahiro has been working with
merge_config.sh from the kernel in the kernel.   How crazy would it be
to re-work things (in some cases..) to have a merge in the config
process so that there could be a sunxi-common config fragment.  Or
can/should we really just use default foo if Y in more places.

-- 
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] Please pull u-boot-ubi master

2015-09-28 Thread Tom Rini
On Mon, Sep 28, 2015 at 08:31:06AM +0200, Heiko Schocher wrote:

> Hello Tom,
> 
> Please pull from u-boot-ubi master
> 
> The following changes since commit 1a9c229bf754c89f42b085451ad506693f326427:
> 
>   Merge branch 'master' of git://www.denx.de/git/u-boot-imx (2015-09-24 
> 12:28:10 -0400)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-ubi.git master
> 
> for you to fetch changes up to a6800af969c4db86fd6ff3e403bfcd94fc3650f1:
> 
>   ubifs: Add missing macros for U-boot build (2015-09-28 06:01:19 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] malloc_simple: fix malloc_ptr calculation

2015-09-28 Thread Tom Rini
On Tue, Sep 08, 2015 at 12:41:24PM +0200, Philipp Rosenberger wrote:

> The gd->malloc_ptr and the gd->malloc_limit are offsets to gd->malloc_base.
> But the addr variable contains the absolute address. The new_ptr must be:
> addr + bytes - gd->malloc_base.
> 
> Signed-off-by: Philipp Rosenberger 
> Reviewed-by: Hans de Goede 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [U-Boot, 01/10] configs: remove remnants of CONFIG_SYS_NAND_QUIET_TEST

2015-09-28 Thread Tom Rini
On Wed, Aug 26, 2015 at 05:54:44PM +0300, Igor Grinberg wrote:

> The config option has been removed by one of the syncs with the Linux
> mainline MTD subsystem:
> ff94bc40af (mtd, ubi, ubifs: resync with Linux-3.14)
> It has been left inside the config files. Currently does not look to
> serve any purpose, so remove it now from all the configs.
> 
> Signed-off-by: Igor Grinberg 
> Cc: Matthias Fuchs 
> Cc: Stefan Roese 
> Cc: "Albert ARIBAUD (3ADEV)" 
> Cc: Peter Barada 
> Cc: Steve Sakoman 
> Cc: Peter Tyser 
> Cc: Joe Hershberger 
> Cc: Simon Glass 
> Acked-by: Stefan Roese 

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [ANN] U-Boot v2015.10-rc4 released

2015-09-28 Thread Tom Rini
Hey all,

I've pushed v2015.10-rc4 out to the repository and tarballs should exist
soon.

We're coming up on the release date and I think things are in reasonable
shape overall.  Please speak up if there's some fixes I'm still
overlooking, I thought I grabbed them all by now but I may have still
missed something.

-- 
Tom


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


Re: [U-Boot] [PATCH v6 8/9] armv8: cavium: Add an implementation of ATF calling functions

2015-09-28 Thread Tom Rini
On Fri, Sep 25, 2015 at 07:17:18PM +0300, Sergey Temerkhanov wrote:

> This commit adds functions issuing calls to the product-specific ATF
> services
> 
> Signed-off-by: Sergey Temerkhanov 
> Signed-off-by: Radha Mohan Chintakuntla 

OK, problem:

> +#ifdef CONFIG_CMD_ATF
> +
> +static void atf_print_ver(void)
> +{
> + struct pt_regs regs;
> + regs.regs[0] = ARM_STD_SVC_VERSION;
> +
> + smc_call();
> +
> + printf("ARM Std FW version: %ld.%ld\n", regs.regs[0], regs.regs[1]);
> +
> + regs.regs[0] = THUNDERX_SVC_VERSION;
> +
> + smc_call();
> +
> + printf("ThunderX OEM ver: %ld.%ld\n", regs.regs[0], regs.regs[1]);
> +}
> +
> +static void atf_print_uid(void)
> +{
> +}
> +
> +static void atf_print_part_table(void)
> +{
> + size_t pcount;
> + unsigned long i;
> + int ret;
> + char *ptype;
> +
> + struct storage_partition *part = (void *)CONFIG_SYS_LOWMEM_BASE;
> +
> + pcount = atf_get_pcount();
> +
> + printf("Partition count: %lu\n\n", pcount);
> + printf("%10s %10s %10s\n", "Type", "Size", "Offset");
> +
> + for (i = 0; i < pcount; i++) {
> + ret = atf_get_part(part, i);
> +
> + if (ret < 0) {
> + printf("Uknown error while reading partition: %d\n",
> +ret);
> + return;
> + }
> +
> + switch (part->type) {
> + case PARTITION_NBL1FW_REST:
> + ptype = "NBL1FW";
> + break;
> + case PARTITION_BL2_BL31:
> + ptype = "BL2_BL31";
> + break;
> + case PARTITION_UBOOT:
> + ptype = "BOOTLDR";
> + break;
> + case PARTITION_KERNEL:
> + ptype = "KERNEL";
> + break;
> + case PARTITION_DEVICE_TREE:
> + ptype = "DEVTREE";
> + break;
> + default:
> + ptype = "UNKNOWN";
> + }
> + printf("%10s %10d %10lx\n", ptype, part->size, part->offset);
> + }
> +}
> +
> +int do_atf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> +{
> + ssize_t ret;
> + size_t size, offset;
> + void *buffer = 0;
> + unsigned int index, node;
> + char str[4 * sizeof(uint64_t)];
> +
> + if ((argc == 5) && !strcmp(argv[1], "readmmc")) {
> + buffer = (void *)simple_strtoul(argv[2], NULL, 16);
> + offset = simple_strtoul(argv[3], NULL, 10);
> + size = simple_strtoul(argv[4], NULL, 10);
> +
> + ret = atf_read_mmc(offset, buffer, size);
> + } else if ((argc == 5) && !strcmp(argv[1], "readnor")) {
> + buffer = (void *)simple_strtoul(argv[2], NULL, 16);
> + offset = simple_strtoul(argv[3], NULL, 10);
> + size = simple_strtoul(argv[4], NULL, 10);
> +
> + ret = atf_read_nor(offset, buffer, size);
> + } else if ((argc == 5) && !strcmp(argv[1], "writemmc")) {
> + buffer = (void *)simple_strtoul(argv[2], NULL, 16);
> + offset = simple_strtoul(argv[3], NULL, 10);
> + size = simple_strtoul(argv[4], NULL, 10);
> +
> + ret = atf_write_mmc(offset, buffer, size);
> + } else if ((argc == 5) && !strcmp(argv[1], "writenor")) {
> + buffer = (void *)simple_strtoul(argv[2], NULL, 16);
> + offset = simple_strtoul(argv[3], NULL, 10);
> + size = simple_strtoul(argv[4], NULL, 10);
> +
> + ret = atf_write_nor(offset, buffer, size);
> + } else if ((argc == 2) && !strcmp(argv[1], "part")) {
> + atf_print_part_table();
> + } else if ((argc == 4) && !strcmp(argv[1], "erasenor")) {
> + offset = simple_strtoul(argv[2], NULL, 10);
> + size = simple_strtoul(argv[3], NULL, 10);
> +
> + ret = atf_erase_nor(offset, size);
> + } else if ((argc == 2) && !strcmp(argv[1], "envcount")) {
> + ret = atf_env_count();
> + printf("Number of environment strings: %zd\n", ret);
> + } else if ((argc == 3) && !strcmp(argv[1], "envstring")) {
> + index = simple_strtoul(argv[2], NULL, 10);
> + ret = atf_env_string(index, str);
> + if (ret > 0)
> + printf("Environment string %d: %s\n", index, str);
> + else
> + printf("Return code: %zd\n", ret);
> + } else if ((argc == 3) && !strcmp(argv[1], "dramsize")) {
> + node = simple_strtoul(argv[2], NULL, 10);
> + ret = atf_dram_size(node);
> + printf("DRAM size: %zd Mbytes\n", ret >> 20);
> + } else if ((argc == 2) && !strcmp(argv[1], "nodes")) {
> + ret = atf_node_count();
> + printf("Nodes count: %zd\n", ret);
> + } else if ((argc == 2) && 

Re: [U-Boot] [PATCH v6 7/9] armv8: cavium: Add ThunderX 88xx board definition

2015-09-28 Thread Tom Rini
On Fri, Sep 25, 2015 at 07:17:17PM +0300, Sergey Temerkhanov wrote:

> This commit adds basic Cavium ThunderX 88xx board definitions and support.
> 
> Signed-off-by: Sergey Temerkhanov 
> Signed-off-by: Radha Mohan Chintakuntla 
[snip]
>  configs/thunderx_88xx_defconfig   |  29 

This is not the output of 'savedefconfig' which is how I found the ATF
problem.  Please use 'savedefconfig' to generate this config, thanks.

Also, the new entry in arch/arm/Kconfig should be added alphabetically
and should not re-add deleted boards back in :)

-- 
Tom


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


Re: [U-Boot] [PATCH v6 7/9] armv8: cavium: Add ThunderX 88xx board definition

2015-09-28 Thread Sergei Temerkhanov
On Mon, Sep 28, 2015 at 5:47 PM, Tom Rini  wrote:
> On Fri, Sep 25, 2015 at 07:17:17PM +0300, Sergey Temerkhanov wrote:
>
>> This commit adds basic Cavium ThunderX 88xx board definitions and support.
>>
>> Signed-off-by: Sergey Temerkhanov 
>> Signed-off-by: Radha Mohan Chintakuntla 
> [snip]
>>  configs/thunderx_88xx_defconfig   |  29 
>
> This is not the output of 'savedefconfig' which is how I found the ATF
> problem.  Please use 'savedefconfig' to generate this config, thanks.

OK, thanks for the tip

>
> Also, the new entry in arch/arm/Kconfig should be added alphabetically
> and should not re-add deleted boards back in :)

Must be some rebasing/merging residue.

>
> --
> Tom

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


Re: [U-Boot] [PATCH 04/11] vexpress64: Kconfig: add CONFIG_SYS_BOOTM_LEN

2015-09-28 Thread Tom Rini
On Wed, Sep 23, 2015 at 10:25:36AM -0700, Ryan Harkin wrote:

> vexpress64 kernels are usually over 8 MBytes in length, so setting the
> max uImage length to 0x400 (64 Mbytes) should give us plenty of
> scope for expansion.
> 
> I mostly chose this length to match other board configs that use
> "(64 << 20)", however, Kconfig doesn't allow arithmetic operations.
> 
> Signed-off-by: Ryan Harkin 
> Reviewed-by: Linus Walleij 
> CC: Masahiro Yamada  CC: Linus Walleij 
> ---
>  board/armltd/vexpress64/Kconfig | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/board/armltd/vexpress64/Kconfig b/board/armltd/vexpress64/Kconfig
> index 8da3bec..72679be 100644
> --- a/board/armltd/vexpress64/Kconfig
> +++ b/board/armltd/vexpress64/Kconfig
> @@ -1,3 +1,6 @@
> +config CONFIG_SYS_BOOTM_LEN
> + default 0x400
> +
>  config SYS_BOARD
>   default "vexpress64"

First, this is a typo (should be SYS_BOOTM_LEN, not
CONFIG_SYS_BOOTM_LEN) and second, this sounds more like it should be set
as the default for say aarch64 when adding the option to Kconfig.  Or
maybe a more broad default even.  moveconfig.py will help make it
clearer how many boards use what.

-- 
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 03/11] Kconfig: add CONFIG_SYS_BOOTM_LEN

2015-09-28 Thread Ryan Harkin
Thanks Tom.

On 28 September 2015 at 16:10, Tom Rini  wrote:

> On Wed, Sep 23, 2015 at 10:25:35AM -0700, Ryan Harkin wrote:
>
> > As config migrates from board config files to Kconfig, when adding
> > CONFIG_SYS_BOOTM_LEN to a platform, I decided to add
> > Kconfig support for CONFIG_SYS_BOOTM_LEN.
> >
> > Signed-off-by: Ryan Harkin 
> > Reviewed-by: Linus Walleij 
> > CC: Masahiro Yamada 
> > CC: Simon Glass 
> > CC: Linus Walleij 
>
> Thanks for trying to do this.  The problem however is that you need to
> use tools/moveconfig.py so that all of the other boards (which is a lot)
> get updated too, otherwise they fail to build.
>

Yes, I just read another email on the list about using moveconfig.py.
That's a big job, as you say.


> Since that's kind of a big thing, can you split this series into a v2 of
> things which really should be in before the release, and then nice
> cleanups like this which can go in once the merge window is open again?

Thanks!
>

So I should post a v2 that uses CONFIG_SYS_BOOTM_LEN like all the other
boards for now?  Then submit a new series to use moveconfig.py to Kconfig?

I already tried using moveconfig.py for this and it fails on every
instance, from what I can tell.  I think the other board configs using the
shift operation makes this tricky.

I guess there are two options: make Kconfig support complex values (eg. to
allow << operators, etc.) or convert all the other boards to use absolute
values.  Of course, another option is to leave it alone.



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


Re: [U-Boot] [PATCH 05/11] vexpress64: fvp dram: add DRAM configuration

2015-09-28 Thread Tom Rini
On Wed, Sep 23, 2015 at 10:25:37AM -0700, Ryan Harkin wrote:

> Create an additional FVP configuration to boot images pre-loaded into
> DRAM.
> 
> Sometimes it's preferential to boot the model by loading the files
> directly into DRAM via model parameters, rather than using
> SemiHosting.
> 
> An example of model parmaters that are used to pre-load the files
> into DRAM:
> --data cluster0.cpu0=Image@0x8008 \
> --data cluster0.cpu0=fvp-base-gicv2-psci.dtb@0x8300 \
> --data cluster0.cpu0=uInitrd@0x8400
> 
> Signedoff-by: Ryan Harkin 
> Reviewed-by: Linus Walleij 
> CC: David Feng 
> CC: Bhupesh Sharma 
> CC: Linus Walleij 
> ---
>  arch/arm/Kconfig   |  4 
>  configs/vexpress_aemv8a_dram_defconfig | 19 +++

Make sure you add an entry to board/armltd/vexpress64/MAINTAINERS for this
board too so buildman doesn't warn about a missing maintainer.  Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 1/5] fs/fat/fat_write: Fix buffer alignments

2015-09-28 Thread Tom Rini
On Mon, Sep 28, 2015 at 03:45:28PM +0200, Benoît Thébaudeau wrote:

> set_cluster() was using a temporary buffer without enforcing its
> alignment for DMA and cache. Moreover, it did not check the alignment of
> the passed buffer, which can come directly from applicative code or from
> the user.
> 
> This could cause random data corruption, which has been observed on
> i.MX25 writing to an SD card.
> 
> Fix this by only passing ARCH_DMA_MINALIGN-aligned buffers to
> disk_write(), which requires the introduction of a buffer bouncing
> mechanism for the misaligned buffers passed to set_cluster().
> 
> By the way, improve the handling of the corresponding return values from
> disk_write():
>  - print them with debug() in case of error,
>  - consider that there is an error is disk_write() returns a smaller
>block count than the requested one, not only if its return value is
>negative.
> 
> After this change, set_cluster() and get_cluster() are almost
> symmetrical.
> 
> Signed-off-by: Benoît Thébaudeau 

OK.  I know Stephen has a series to replace all of the FAT code for
the next release once some performance issues are addressed.  But I'm
inclined to take this series (after some reviews and so forth) for this
release at least because this sounds like some bad bugs and more things
are starting to rely on fatwrite functionality (for example, env saved
as a file in FAT is getting common on community-style boards).

-- 
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 05/11] vexpress64: fvp dram: add DRAM configuration

2015-09-28 Thread Ryan Harkin
On 28 September 2015 at 16:14, Tom Rini  wrote:

> On Wed, Sep 23, 2015 at 10:25:37AM -0700, Ryan Harkin wrote:
>
> > Create an additional FVP configuration to boot images pre-loaded into
> > DRAM.
> >
> > Sometimes it's preferential to boot the model by loading the files
> > directly into DRAM via model parameters, rather than using
> > SemiHosting.
> >
> > An example of model parmaters that are used to pre-load the files
> > into DRAM:
> > --data cluster0.cpu0=Image@0x8008 \
> > --data cluster0.cpu0=fvp-base-gicv2-psci.dtb@0x8300 \
> > --data cluster0.cpu0=uInitrd@0x8400
> >
> > Signedoff-by: Ryan Harkin 
> > Reviewed-by: Linus Walleij 
> > CC: David Feng 
> > CC: Bhupesh Sharma 
> > CC: Linus Walleij 
> > ---
> >  arch/arm/Kconfig   |  4 
> >  configs/vexpress_aemv8a_dram_defconfig | 19 +++
>
> Make sure you add an entry to board/armltd/vexpress64/MAINTAINERS for this
> board too so buildman doesn't warn about a missing maintainer.  Thanks!
>

Good point, thanks.  I'll do it for v2.


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


Re: [U-Boot] [PATCH v6 8/9] armv8: cavium: Add an implementation of ATF calling functions

2015-09-28 Thread Sergei Temerkhanov
On Mon, Sep 28, 2015 at 5:47 PM, Tom Rini  wrote:
> On Fri, Sep 25, 2015 at 07:17:18PM +0300, Sergey Temerkhanov wrote:
>
>> This commit adds functions issuing calls to the product-specific ATF
>> services
>>
>> Signed-off-by: Sergey Temerkhanov 
>> Signed-off-by: Radha Mohan Chintakuntla 
>
> OK, problem:
>
>> +#ifdef CONFIG_CMD_ATF
>> +
>> +static void atf_print_ver(void)
>> +{
>> + struct pt_regs regs;
>> + regs.regs[0] = ARM_STD_SVC_VERSION;
>> +
>> + smc_call();
>> +
>> + printf("ARM Std FW version: %ld.%ld\n", regs.regs[0], regs.regs[1]);
>> +
>> + regs.regs[0] = THUNDERX_SVC_VERSION;
>> +
>> + smc_call();
>> +
>> + printf("ThunderX OEM ver: %ld.%ld\n", regs.regs[0], regs.regs[1]);
>> +}
>> +
>> +static void atf_print_uid(void)
>> +{
>> +}
>> +
>> +static void atf_print_part_table(void)
>> +{
>> + size_t pcount;
>> + unsigned long i;
>> + int ret;
>> + char *ptype;
>> +
>> + struct storage_partition *part = (void *)CONFIG_SYS_LOWMEM_BASE;
>> +
>> + pcount = atf_get_pcount();
>> +
>> + printf("Partition count: %lu\n\n", pcount);
>> + printf("%10s %10s %10s\n", "Type", "Size", "Offset");
>> +
>> + for (i = 0; i < pcount; i++) {
>> + ret = atf_get_part(part, i);
>> +
>> + if (ret < 0) {
>> + printf("Uknown error while reading partition: %d\n",
>> +ret);
>> + return;
>> + }
>> +
>> + switch (part->type) {
>> + case PARTITION_NBL1FW_REST:
>> + ptype = "NBL1FW";
>> + break;
>> + case PARTITION_BL2_BL31:
>> + ptype = "BL2_BL31";
>> + break;
>> + case PARTITION_UBOOT:
>> + ptype = "BOOTLDR";
>> + break;
>> + case PARTITION_KERNEL:
>> + ptype = "KERNEL";
>> + break;
>> + case PARTITION_DEVICE_TREE:
>> + ptype = "DEVTREE";
>> + break;
>> + default:
>> + ptype = "UNKNOWN";
>> + }
>> + printf("%10s %10d %10lx\n", ptype, part->size, part->offset);
>> + }
>> +}
>> +
>> +int do_atf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>> +{
>> + ssize_t ret;
>> + size_t size, offset;
>> + void *buffer = 0;
>> + unsigned int index, node;
>> + char str[4 * sizeof(uint64_t)];
>> +
>> + if ((argc == 5) && !strcmp(argv[1], "readmmc")) {
>> + buffer = (void *)simple_strtoul(argv[2], NULL, 16);
>> + offset = simple_strtoul(argv[3], NULL, 10);
>> + size = simple_strtoul(argv[4], NULL, 10);
>> +
>> + ret = atf_read_mmc(offset, buffer, size);
>> + } else if ((argc == 5) && !strcmp(argv[1], "readnor")) {
>> + buffer = (void *)simple_strtoul(argv[2], NULL, 16);
>> + offset = simple_strtoul(argv[3], NULL, 10);
>> + size = simple_strtoul(argv[4], NULL, 10);
>> +
>> + ret = atf_read_nor(offset, buffer, size);
>> + } else if ((argc == 5) && !strcmp(argv[1], "writemmc")) {
>> + buffer = (void *)simple_strtoul(argv[2], NULL, 16);
>> + offset = simple_strtoul(argv[3], NULL, 10);
>> + size = simple_strtoul(argv[4], NULL, 10);
>> +
>> + ret = atf_write_mmc(offset, buffer, size);
>> + } else if ((argc == 5) && !strcmp(argv[1], "writenor")) {
>> + buffer = (void *)simple_strtoul(argv[2], NULL, 16);
>> + offset = simple_strtoul(argv[3], NULL, 10);
>> + size = simple_strtoul(argv[4], NULL, 10);
>> +
>> + ret = atf_write_nor(offset, buffer, size);
>> + } else if ((argc == 2) && !strcmp(argv[1], "part")) {
>> + atf_print_part_table();
>> + } else if ((argc == 4) && !strcmp(argv[1], "erasenor")) {
>> + offset = simple_strtoul(argv[2], NULL, 10);
>> + size = simple_strtoul(argv[3], NULL, 10);
>> +
>> + ret = atf_erase_nor(offset, size);
>> + } else if ((argc == 2) && !strcmp(argv[1], "envcount")) {
>> + ret = atf_env_count();
>> + printf("Number of environment strings: %zd\n", ret);
>> + } else if ((argc == 3) && !strcmp(argv[1], "envstring")) {
>> + index = simple_strtoul(argv[2], NULL, 10);
>> + ret = atf_env_string(index, str);
>> + if (ret > 0)
>> + printf("Environment string %d: %s\n", index, str);
>> + else
>> + printf("Return code: %zd\n", ret);
>> + } else if ((argc == 3) && !strcmp(argv[1], "dramsize")) {
>> + node = simple_strtoul(argv[2], NULL, 10);
>> + ret = atf_dram_size(node);
>> + printf("DRAM size: %zd Mbytes\n", ret >> 20);

Re: [U-Boot] [PATCH 03/11] Kconfig: add CONFIG_SYS_BOOTM_LEN

2015-09-28 Thread Tom Rini
On Wed, Sep 23, 2015 at 10:25:35AM -0700, Ryan Harkin wrote:

> As config migrates from board config files to Kconfig, when adding
> CONFIG_SYS_BOOTM_LEN to a platform, I decided to add
> Kconfig support for CONFIG_SYS_BOOTM_LEN.
> 
> Signed-off-by: Ryan Harkin 
> Reviewed-by: Linus Walleij 
> CC: Masahiro Yamada 
> CC: Simon Glass 
> CC: Linus Walleij 

Thanks for trying to do this.  The problem however is that you need to
use tools/moveconfig.py so that all of the other boards (which is a lot)
get updated too, otherwise they fail to build.

Since that's kind of a big thing, can you split this series into a v2 of
things which really should be in before the release, and then nice
cleanups like this which can go in once the merge window is open again?
Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 03/11] Kconfig: add CONFIG_SYS_BOOTM_LEN

2015-09-28 Thread Tom Rini
On Mon, Sep 28, 2015 at 04:35:09PM +0100, Ryan Harkin wrote:
> Thanks Tom.
> 
> On 28 September 2015 at 16:10, Tom Rini  wrote:
> 
> > On Wed, Sep 23, 2015 at 10:25:35AM -0700, Ryan Harkin wrote:
> >
> > > As config migrates from board config files to Kconfig, when adding
> > > CONFIG_SYS_BOOTM_LEN to a platform, I decided to add
> > > Kconfig support for CONFIG_SYS_BOOTM_LEN.
> > >
> > > Signed-off-by: Ryan Harkin 
> > > Reviewed-by: Linus Walleij 
> > > CC: Masahiro Yamada 
> > > CC: Simon Glass 
> > > CC: Linus Walleij 
> >
> > Thanks for trying to do this.  The problem however is that you need to
> > use tools/moveconfig.py so that all of the other boards (which is a lot)
> > get updated too, otherwise they fail to build.
> >
> 
> Yes, I just read another email on the list about using moveconfig.py.
> That's a big job, as you say.
> 
> 
> > Since that's kind of a big thing, can you split this series into a v2 of
> > things which really should be in before the release, and then nice
> > cleanups like this which can go in once the merge window is open again?
> 
> Thanks!
> >
> 
> So I should post a v2 that uses CONFIG_SYS_BOOTM_LEN like all the other
> boards for now?  Then submit a new series to use moveconfig.py to Kconfig?

Yeah, for this release at least.

> I already tried using moveconfig.py for this and it fails on every
> instance, from what I can tell.  I think the other board configs using the
> shift operation makes this tricky.
> 
> I guess there are two options: make Kconfig support complex values (eg. to
> allow << operators, etc.) or convert all the other boards to use absolute
> values.  Of course, another option is to leave it alone.

Well, if you can convince the Kconfig folks to take shift operations as
valid values on numeric inputs I bet other projects would appreciate it.
But it might be easier to start with a "simple" script that finds all of
the configs that define it to a shifted value and use printf to convert
it to hex.  Then moveconfig.py should be able to convert.

-- 
Tom


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


[U-Boot] Please pull u-boot-ubi master

2015-09-28 Thread Heiko Schocher

Hello Tom,

Please pull from u-boot-ubi master

The following changes since commit 1a9c229bf754c89f42b085451ad506693f326427:

  Merge branch 'master' of git://www.denx.de/git/u-boot-imx (2015-09-24 
12:28:10 -0400)

are available in the git repository at:

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

for you to fetch changes up to a6800af969c4db86fd6ff3e403bfcd94fc3650f1:

  ubifs: Add missing macros for U-boot build (2015-09-28 06:01:19 +0200)


Kevin Smith (1):
  ubifs: Add missing macros for U-boot build

 fs/ubifs/io.c | 8 
 1 file changed, 8 insertions(+)

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

2015-09-28 Thread Hannes Schmelzer
Since we don't have for sure a valid IP-setup during
board_late_init(...) because it maybe allready stored in environment or
not, we cannot form a proper vxWorks bootline at this place.

So we move to the way, forming the bootline just before
executing/launching vxWorks with "go ".
At this time we have a valid IP-setup for sure because it is either in
environment or defined through CONFIG_PREBOOT command.

To do this, we overload the __weak function "do_go_exec(...)" with our
own and do the job.

Signed-off-by: Hannes Schmelzer 

---

 board/BuR/kwb/board.c | 23 ++-
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
index 039ec20..703a474 100644
--- a/board/BuR/kwb/board.c
+++ b/board/BuR/kwb/board.c
@@ -281,6 +281,19 @@ int board_late_init(void)
} else {
puts("ERROR: i2c_set_bus_speed failed! (scratchregister)\n");
}
+   /*
+* reset VBAR registers to its reset location, VxWorks 6.9.3.2 does
+* expect that vectors are there, original u-boot moves them to _start
+*/
+   __asm__("ldr r0,=0x2");
+   __asm__("mcr p15, 0, r0, c12, c0, 0"); /* Set VBAR */
+
+   return 0;
+}
+#endif /* CONFIG_BOARD_LATE_INIT */
+unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
+char * const argv[])
+{
/* setup vxworks bootline */
char *vxworksbootline = (char *)VXWORKS_BOOTLINE;
sprintf(vxworksbootline,
@@ -295,13 +308,5 @@ int board_late_init(void)
(u32)getenv_ulong("vx_romfsbase", 16, 0),
(u32)getenv_ulong("vx_romfssize", 16, 0));
 
-   /*
-* reset VBAR registers to its reset location, VxWorks 6.9.3.2 does
-* expect that vectors are there, original u-boot moves them to _start
-*/
-   __asm__("ldr r0,=0x2");
-   __asm__("mcr p15, 0, r0, c12, c0, 0"); /* Set VBAR */
-
-   return 0;
+   return entry(argc, argv);
 }
-#endif /* CONFIG_BOARD_LATE_INIT */
-- 
1.9.1

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


Re: [U-Boot] [Patch v2 09/16] ARMv8/FSL_LSCH2: Add FSL_LSCH2 SoC

2015-09-28 Thread Hu Vincent


> -Original Message-
> From: Kushwaha Prabhakar-B32579
> Sent: Sunday, September 27, 2015 12:11 PM
> To: Sun York-R58495; Hu Mingkai-B21284; Gong Qianyu-B52263; u-
> b...@lists.denx.de
> Cc: Wood Scott-B07421; Li Yang-Leo-R58472; Hou Zhiqiang-B48286; Song
> Wenbin-B53747
> Subject: RE: [U-Boot] [Patch v2 09/16] ARMv8/FSL_LSCH2: Add FSL_LSCH2 SoC
> 
> 
> > -Original Message-
> > From: U-Boot [mailto:u-boot-boun...@lists.denx.de] On Behalf Of York
> > Sun
> > Sent: Friday, September 25, 2015 8:23 PM
> > To: Hu Mingkai-B21284 ; Gong Qianyu-B52263
> > ; u-boot@lists.denx.de
> > Cc: Wood Scott-B07421 ; Li Yang-Leo-R58472
> > ; Hou Zhiqiang-B48286 ;
> > Song Wenbin-B53747 
> > Subject: Re: [U-Boot] [Patch v2 09/16] ARMv8/FSL_LSCH2: Add FSL_LSCH2
> > SoC
> >
> >
> >
> > On 09/25/2015 05:28 AM, Hu Mingkai-B21284 wrote:
> > >
> > >
> > >> -Original Message-
> > >> From: Sun York-R58495
> > >> Sent: Tuesday, September 22, 2015 1:27 AM
> > >> To: Gong Qianyu-B52263; u-boot@lists.denx.de
> > >> Cc: Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Song
> > >> Wenbin- B53747; Xie Shaohui-B21989; Wood Scott-B07421; Li
> > >> Yang-Leo-R58472
> > >> Subject: Re: [Patch v2 09/16] ARMv8/FSL_LSCH2: Add FSL_LSCH2 SoC
> > >>
> > >>
> > >>
> > >> On 09/17/2015 12:06 AM, Gong Qianyu wrote:
> > >>> From: Mingkai Hu 
> > >>>
> > >>> Freescale LayerScape with Chassis Generation 2 is a set of SoCs
> > >>> with
> > >>> ARMv8 cores and 2rd generation of Chassis.
> > >>>
> > >>> Signed-off-by: Li Yang 
> > >>> Signed-off-by: Hou Zhiqiang 
> > >>> Signed-off-by: Mingkai Hu 
> > >>> Signed-off-by: Gong Qianyu 
> > >>> ---
> > >>> V2:
> > >>> remove FSL_LS102xA_DEVDISR3_PCIE from immap_lsch2.h
> > >>>
> > >>>  arch/arm/cpu/armv8/Makefile   |   1 +
> > >>>  arch/arm/cpu/armv8/fsl-lsch2/Makefile |  12 +
> > >>>  arch/arm/cpu/armv8/fsl-lsch2/README   |  10 +
> > >>>  arch/arm/cpu/armv8/fsl-lsch2/cpu.c| 414
> > >> ++
> > >>
> > >> Too much duplication. Please work with Alison/Prabhakar to move out
> > >> the common code in cpu.c.
> > >>
> > >
> > > I agree, there are too much duplications between lsch2 and lsch3:
> > >
> > > arch/arm/cpu/armv8/fsl-lsch*
> > > arch/arm/include/asm/arch-fsl-lsch*
> > >
> > > I am considering to consolidate the code between lsch2 and lsch3
> > > using
> > arch-layerscape. The basic idea is to add the following directory for
> > ARMv8 layerscape for the common files and use CONFIG_FSL_LSCH2/
> > CONFIG_FSL_LSCH3 to differentiate the difference between these two
> > chassis in the same file if necessary.
> > >
> > > arch/arm/cpu/armv8/fsl-layerscape
> > > arch/arm/include/asm/arch-fsl-layerscape/
> > >
> > > what is your suggestion?
> 
> Other than CONFIG_FSL_LSCH2 and CONFIG_FSL_LSCH3, we should also have
> CONFIG_FSL_LAYERSCAPE to enabled common code.
> 
Sure. We need a macro to enable the common code.
Thanks,
Mingkai
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/8] Better support of booting VxWorks via 'bootvx'

2015-09-28 Thread Jian Luo

Hi,

please add

Tested-by: Jian Luo  on crownbay


Best regards,

Jian Luo

On 24.09.2015 11:21, Bin Meng wrote:
> This series adds better support of booting VxWorks using 'bootvx'.
>
> Tested by booting a VxWorks 6.9.4 kernel on Intel Crown Bay, and
> a VxWorks 7 kernel on Intel Galileo.
>
>
> Bin Meng (8):
>   x86: Initialize GDT entry 1 to be the 32-bit CS as well
>   cmd: Convert CONFIG_CMD_ELF to Kconfig
>   cmd: Clean up cmd_elf a little bit
>   cmd: elf: Reorder load_elf_image_phdr() and load_elf_image_shdr()
>   cmd: bootvx: Pass netmask and gatewayip to VxWorks bootline
>   cmd: bootvx: Always get VxWorks bootline from env
>   cmd: bootvx: Pass E820 information to an x86 VxWorks kernel
>   doc: Complement document about booting VxWorks
>
>  README  |  12 +-
>  arch/x86/cpu/cpu.c  |   7 +-
>  common/Kconfig  |   6 +
>  common/cmd_elf.c| 404 
+---

>  configs/A10-OLinuXino-Lime_defconfig|   2 +-
>  configs/Bananapi_defconfig  |   2 +-
>  configs/Bananapro_defconfig |   2 +-
>  configs/Chuwi_V7_CW0825_defconfig   |   2 +-
>  configs/M5208EVBE_defconfig |   2 +-
>  configs/M52277EVB_defconfig |   2 +-
>  configs/M5235EVB_defconfig  |   2 +-
>  configs/M5272C3_defconfig   |   2 +-
>  configs/M5275EVB_defconfig  |   2 +-
>  configs/M5282EVB_defconfig  |   2 +-
>  configs/M53017EVB_defconfig |   2 +-
>  configs/M5329AFEE_defconfig |   2 +-
>  configs/M5329BFEE_defconfig |   2 +-
>  configs/M5373EVB_defconfig  |   2 +-
>  configs/M54418TWR_defconfig |   2 +-
>  configs/M54418TWR_nand_mii_defconfig|   2 +-
>  configs/M54418TWR_nand_rmii_defconfig   |   2 +-
>  configs/M54418TWR_nand_rmii_lowfreq_defconfig   |   2 +-
>  configs/M54418TWR_serial_mii_defconfig  |   2 +-
>  configs/M54418TWR_serial_rmii_defconfig |   2 +-
>  configs/M54451EVB_defconfig |   2 +-
>  configs/M54455EVB_defconfig |   2 +-
>  configs/M5475AFE_defconfig  |   2 +-
>  configs/M5475BFE_defconfig  |   2 +-
>  configs/M5475CFE_defconfig  |   2 +-
>  configs/M5475DFE_defconfig  |   2 +-
>  configs/M5475EFE_defconfig  |   2 +-
>  configs/M5475FFE_defconfig  |   2 +-
>  configs/M5475GFE_defconfig  |   2 +-
>  configs/M5485AFE_defconfig  |   2 +-
>  configs/M5485BFE_defconfig  |   2 +-
>  configs/M5485CFE_defconfig  |   2 +-
>  configs/M5485DFE_defconfig  |   2 +-
>  configs/M5485EFE_defconfig  |   2 +-
>  configs/M5485FFE_defconfig  |   2 +-
>  configs/M5485GFE_defconfig  |   2 +-
>  configs/M5485HFE_defconfig  |   2 +-
>  configs/MPC8349ITXGP_defconfig  |   2 +-
>  configs/MPC8349ITX_LOWBOOT_defconfig|   2 +-
>  configs/MPC8349ITX_defconfig|   2 +-
>  configs/MSI_Primo81_defconfig   |   2 +-
>  configs/Mini-X_defconfig|   2 +-
>  configs/PATI_defconfig  |   2 +-
>  configs/UCP1020_defconfig   |   2 +-
>  configs/VCMA9_defconfig |   2 +-
>  configs/Wexler_TAB7200_defconfig|   2 +-
>  configs/ac14xx_defconfig|   2 +-
>  configs/alt_defconfig   |   2 +-
>  configs/am335x_boneblack_defconfig  |   2 +-
>  configs/am335x_gp_evm_defconfig |   1 -
>  configs/am335x_sl50_defconfig   |   1 -
>  configs/am3517_crane_defconfig  |   2 +-
>  configs/am3517_evm_defconfig|   2 +-
>  configs/amcore_defconfig|   2 +-
>  configs/apalis_t30_defconfig|   4 +-
>  configs/apf27_defconfig |   2 +-
>  configs/arcangel4-be_defconfig  |   2 +-
>  configs/arcangel4_defconfig |   4 +-
>  configs/arndale_defconfig   |   4 +-
>  configs/astro_mcf5373l_defconfig|   2 +-
>  configs/at91rm9200ek_defconfig  |   2 +-
>  configs/at91rm9200ek_ram_defconfig  |   2 +-
>  configs/at91sam9260ek_dataflash_cs0_defconfig   |   2 +-
>  configs/at91sam9260ek_dataflash_cs1_defconfig   |   2 +-
>  configs/at91sam9260ek_nandflash_defconfig   |   2 +-
>  configs/at91sam9261ek_dataflash_cs0_defconfig   

[U-Boot] [PATCH v2 5/5] defconfig: am335x: gp_evm: enable mmc driver model

2015-09-28 Thread Mugunthan V N
enable mmc driver model for am335x gp_evm as omap_hsmmc
supports driver model

Signed-off-by: Mugunthan V N 
Reviewed-by: Tom Rini 
---
 configs/am335x_gp_evm_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am335x_gp_evm_defconfig b/configs/am335x_gp_evm_defconfig
index c87d7a9..50e7d3f 100644
--- a/configs/am335x_gp_evm_defconfig
+++ b/configs/am335x_gp_evm_defconfig
@@ -13,3 +13,4 @@ CONFIG_SPL_DISABLE_OF_CONTROL=y
 CONFIG_SPI_FLASH=y
 CONFIG_RSA=y
 CONFIG_DM_ETH=y
+CONFIG_DM_MMC=y
-- 
2.6.0.rc2.10.gf4d9753

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


[U-Boot] [PATCH v2 4/5] defconfig: am335x: bbb: enable mmc driver model

2015-09-28 Thread Mugunthan V N
enable mmc driver model for am335x bbb as omap_hsmmc
supports driver model

Signed-off-by: Mugunthan V N 
Reviewed-by: Tom Rini 
---
 configs/am335x_boneblack_vboot_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am335x_boneblack_vboot_defconfig 
b/configs/am335x_boneblack_vboot_defconfig
index 117a146..011239b 100644
--- a/configs/am335x_boneblack_vboot_defconfig
+++ b/configs/am335x_boneblack_vboot_defconfig
@@ -14,3 +14,4 @@ CONFIG_SYS_EXTRA_OPTIONS="EMMC_BOOT,ENABLE_VBOOT"
 CONFIG_OF_CONTROL=y
 CONFIG_SPI_FLASH=y
 CONFIG_DM_ETH=y
+CONFIG_DM_MMC=y
-- 
2.6.0.rc2.10.gf4d9753

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


[U-Boot] [PATCH v2 3/5] drivers: mmc: omap_hsmmc: convert driver to adopt device driver model

2015-09-28 Thread Mugunthan V N
adopt omap_hsmmc driver to device driver model

Signed-off-by: Mugunthan V N 
---
 drivers/mmc/omap_hsmmc.c | 117 ++-
 1 file changed, 116 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index d7b388f..4de7373 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -35,6 +35,9 @@
 #include 
 #include 
 #include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
 
 /* simplify defines to OMAP_HSMMC_USE_GPIO */
 #if (defined(CONFIG_OMAP_GPIO) && !defined(CONFIG_SPL_BUILD)) || \
@@ -52,9 +55,15 @@ struct omap_hsmmc_data {
struct hsmmc *base_addr;
struct mmc_config cfg;
 #ifdef OMAP_HSMMC_USE_GPIO
+#ifdef CONFIG_DM_MMC
+   struct gpio_desc cd_gpio;   /* Change Detect GPIO */
+   struct gpio_desc wp_gpio;   /* Write Protect GPIO */
+   bool cd_inverted;
+#else
int cd_gpio;
int wp_gpio;
 #endif
+#endif
 };
 
 /* If we fail after 1 second wait, something is really bad */
@@ -64,7 +73,7 @@ static int mmc_read_data(struct hsmmc *mmc_base, char *buf, 
unsigned int size);
 static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
unsigned int siz);
 
-#ifdef OMAP_HSMMC_USE_GPIO
+#if defined(OMAP_HSMMC_USE_GPIO) && !defined(CONFIG_DM_MMC)
 static int omap_mmc_setup_gpio_in(int gpio, const char *label)
 {
int ret;
@@ -600,6 +609,34 @@ static void omap_hsmmc_set_ios(struct mmc *mmc)
 }
 
 #ifdef OMAP_HSMMC_USE_GPIO
+#ifdef CONFIG_DM_MMC
+static int omap_hsmmc_getcd(struct mmc *mmc)
+{
+   struct omap_hsmmc_data *priv = mmc->priv;
+   int value;
+
+   value = dm_gpio_get_value(>cd_gpio);
+   /* if no CD return as 1 */
+   if (value < 0)
+   return 1;
+
+   if (priv->cd_inverted)
+   return !value;
+   return value;
+}
+
+static int omap_hsmmc_getwp(struct mmc *mmc)
+{
+   struct omap_hsmmc_data *priv = mmc->priv;
+   int value;
+
+   value = dm_gpio_get_value(>wp_gpio);
+   /* if no WP return as 0 */
+   if (value < 0)
+   return 0;
+   return value;
+}
+#else
 static int omap_hsmmc_getcd(struct mmc *mmc)
 {
struct omap_hsmmc_data *priv_data = mmc->priv;
@@ -628,6 +665,7 @@ static int omap_hsmmc_getwp(struct mmc *mmc)
return gpio_get_value(wp_gpio);
 }
 #endif
+#endif
 
 static const struct mmc_ops omap_hsmmc_ops = {
.send_cmd   = omap_hsmmc_send_cmd,
@@ -639,6 +677,7 @@ static const struct mmc_ops omap_hsmmc_ops = {
 #endif
 };
 
+#ifndef CONFIG_DM_MMC
 int omap_mmc_init(int dev_index, uint host_caps_mask, uint f_max, int cd_gpio,
int wp_gpio)
 {
@@ -724,3 +763,79 @@ int omap_mmc_init(int dev_index, uint host_caps_mask, uint 
f_max, int cd_gpio,
 
return 0;
 }
+#else
+static int omap_hsmmc_ofdata_to_platdata(struct udevice *dev)
+{
+   struct omap_hsmmc_data *priv = dev_get_priv(dev);
+   const void *fdt = gd->fdt_blob;
+   int node = dev->of_offset;
+   struct mmc_config *cfg;
+   int val;
+
+   priv->base_addr = (struct hsmmc *)dev_get_addr(dev);
+   cfg = >cfg;
+
+   cfg->host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS;
+   val = fdtdec_get_int(fdt, node, "bus-width", -1);
+   if (val < 0) {
+   printf("error: bus-width property missing\n");
+   return -ENOENT;
+   }
+
+   switch (val) {
+   case 0x8:
+   cfg->host_caps |= MMC_MODE_8BIT;
+   case 0x4:
+   cfg->host_caps |= MMC_MODE_4BIT;
+   break;
+   default:
+   printf("error: invalid bus-width property\n");
+   return -ENOENT;
+   }
+
+   cfg->f_min = 40;
+   cfg->f_max = fdtdec_get_int(fdt, node, "max-frequency", 5200);
+   cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
+   cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
+
+   priv->cd_inverted = fdtdec_get_bool(fdt, node, "cd-inverted");
+
+   return 0;
+}
+
+static int omap_hsmmc_probe(struct udevice *dev)
+{
+   struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
+   struct omap_hsmmc_data *priv = dev_get_priv(dev);
+   struct mmc_config *cfg;
+   struct mmc *mmc;
+
+   cfg = >cfg;
+   cfg->name = "OMAP SD/MMC";
+   cfg->ops = _hsmmc_ops;
+
+   mmc = mmc_create(cfg, priv);
+   if (mmc == NULL)
+   return -1;
+
+   upriv->mmc = mmc;
+
+   return 0;
+}
+
+static const struct udevice_id omap_hsmmc_ids[] = {
+   { .compatible = "ti,omap3-hsmmc" },
+   { .compatible = "ti,omap4-hsmmc" },
+   { .compatible = "ti,am33xx-hsmmc" },
+   { }
+};
+
+U_BOOT_DRIVER(omap_hsmmc) = {
+   .name   = "omap_hsmmc",
+   .id = UCLASS_MMC,
+   .of_match = omap_hsmmc_ids,
+   .ofdata_to_platdata = omap_hsmmc_ofdata_to_platdata,
+   .probe  = omap_hsmmc_probe,
+   .priv_auto_alloc_size = sizeof(struct 

[U-Boot] [PATCH v2 2/5] am335x_evm: mmc: do not define DM_MMC for spl

2015-09-28 Thread Mugunthan V N
Since spl doesn't support DM currently, do not define DM_MMC
for spl build.

Signed-off-by: Mugunthan V N 
Reviewed-by: Tom Rini 
---
 include/configs/am335x_evm.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 29e0801..0a103ca 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -322,6 +322,14 @@
 #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
 #endif /* CONFIG_USB_MUSB_GADGET */
 
+/*
+ * Disable MMC DM for SPL build and can be re-enabled after adding
+ * DM support in SPL
+ */
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_DM_MMC
+#endif
+
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
 /* Remove other SPL modes. */
 #undef CONFIG_SPL_YMODEM_SUPPORT
-- 
2.6.0.rc2.10.gf4d9753

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


[U-Boot] [PATCH v2 1/5] omap_hsmmc: update struct hsmmc to accomodate base address from DT

2015-09-28 Thread Mugunthan V N
Existing driver gets the actual omap hammc base address + 0x100
bytes as the first 0x100 bytes is not used by the driver. But
with DM conversion the base address from DT is different, to
accommodate the offset adding res0[0x100] to struct hsmmc.

Signed-off-by: Mugunthan V N 
Reviewed-by: Tom Rini 
---
 arch/arm/include/asm/omap_mmc.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/include/asm/omap_mmc.h b/arch/arm/include/asm/omap_mmc.h
index 617e22f..b69d073 100644
--- a/arch/arm/include/asm/omap_mmc.h
+++ b/arch/arm/include/asm/omap_mmc.h
@@ -26,6 +26,9 @@
 #define OMAP_MMC_H_
 
 struct hsmmc {
+#ifdef CONFIG_DM_MMC
+   unsigned char res0[0x100];
+#endif
unsigned char res1[0x10];
unsigned int sysconfig; /* 0x10 */
unsigned int sysstatus; /* 0x14 */
-- 
2.6.0.rc2.10.gf4d9753

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


[U-Boot] [PATCH v2 0/5] device model bringup of hsmmc on am335x bone black and gp evm

2015-09-28 Thread Mugunthan V N
This patch seires enables omap_hsmmc to adopt driver model. This
has been tested on AM335x beagle bone black and GP EVM (logs [1]).
Also pushed a branch for testing [2]

[1]: http://pastebin.ubuntu.com/12600659/
[2]: git://git.ti.com/~mugunthanvnm/ti-u-boot/mugunth-ti-u-boot.git mmc-dm-v2

Changes from initial version:
* Added additional compatibles as per Tom's comment
* Fixed $subject for enabling DM_MMC patch

Mugunthan V N (5):
  omap_hsmmc: update struct hsmmc to accomodate base address from DT
  am335x_evm: mmc: do not define DM_MMC for spl
  drivers: mmc: omap_hsmmc: convert driver to adopt device driver model
  defconfig: am335x: bbb: enable mmc driver model
  defconfig: am335x: gp_evm: enable mmc driver model

 arch/arm/include/asm/omap_mmc.h  |   3 +
 configs/am335x_boneblack_vboot_defconfig |   1 +
 configs/am335x_gp_evm_defconfig  |   1 +
 drivers/mmc/omap_hsmmc.c | 117 ++-
 include/configs/am335x_evm.h |   8 +++
 5 files changed, 129 insertions(+), 1 deletion(-)

-- 
2.6.0.rc2.10.gf4d9753

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


Re: [U-Boot] [PATCH 5/6] am437x: Add am437x_gp_evm_defconfig using CONFIG_DM

2015-09-28 Thread Lokesh Vutla


On Monday 28 September 2015 04:17 PM, Mugunthan V N wrote:
> Import various DT files for am4372, an43xx pinctrl and
> am437x-gp-evm from Linux Kernel v4.2
> Add config file for this board, enable DM, DM_GPIO, DM_SERIAL
> and DM_MMC.

Reviewed-by: Lokesh Vutla 

Thanks and regards,
Lokesh


> 
> Signed-off-by: Mugunthan V N 
> ---
>  arch/arm/dts/Makefile|   1 +
>  arch/arm/dts/am4372.dtsi | 999 
> +++
>  arch/arm/dts/am437x-gp-evm.dts   | 797 
>  arch/arm/dts/am43xx-clocks.dtsi  | 757 ++
>  configs/am437x_gp_evm_defconfig  |  17 +
>  include/dt-bindings/pinctrl/am43xx.h |  33 ++
>  include/dt-bindings/pwm/pwm.h|  14 +
>  7 files changed, 2618 insertions(+)
>  create mode 100644 arch/arm/dts/am4372.dtsi
>  create mode 100644 arch/arm/dts/am437x-gp-evm.dts
>  create mode 100644 arch/arm/dts/am43xx-clocks.dtsi
>  create mode 100644 configs/am437x_gp_evm_defconfig
>  create mode 100644 include/dt-bindings/pinctrl/am43xx.h
>  create mode 100644 include/dt-bindings/pwm/pwm.h
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 5f10243..716b5b7 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -61,6 +61,7 @@ dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
>   zynq-zc770-xm012.dtb \
>   zynq-zc770-xm013.dtb
>  dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-evm.dtb
> +dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb
>  
>  dtb-$(CONFIG_ARCH_SOCFPGA) +=\
>   socfpga_arria5_socdk.dtb\
> diff --git a/arch/arm/dts/am4372.dtsi b/arch/arm/dts/am4372.dtsi
> new file mode 100644
> index 000..ade28c7
> --- /dev/null
> +++ b/arch/arm/dts/am4372.dtsi
> @@ -0,0 +1,999 @@
> +/*
> + * Device Tree Source for AM4372 SoC
> + *
> + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
> + *
> + * This file is licensed under the terms of the GNU General Public License
> + * version 2.  This program is licensed "as is" without any warranty of any
> + * kind, whether express or implied.
> + */
> +
> +#include 
> +#include 
> +
> +#include "skeleton.dtsi"
> +
> +/ {
> + compatible = "ti,am4372", "ti,am43";
> + interrupt-parent = <>;
> +
> +
> + aliases {
> + i2c0 = 
> + i2c1 = 
> + i2c2 = 
> + serial0 = 
> + ethernet0 = _emac0;
> + ethernet1 = _emac1;
> + };
> +
> + cpus {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + cpu: cpu@0 {
> + compatible = "arm,cortex-a9";
> + device_type = "cpu";
> + reg = <0>;
> +
> + clocks = <_mpu_ck>;
> + clock-names = "cpu";
> +
> + clock-latency = <30>; /* From omap-cpufreq driver */
> + };
> + };
> +
> + gic: interrupt-controller@48241000 {
> + compatible = "arm,cortex-a9-gic";
> + interrupt-controller;
> + #interrupt-cells = <3>;
> + reg = <0x48241000 0x1000>,
> +   <0x48240100 0x0100>;
> + interrupt-parent = <>;
> + };
> +
> + wakeupgen: interrupt-controller@48281000 {
> + compatible = "ti,omap4-wugen-mpu";
> + interrupt-controller;
> + #interrupt-cells = <3>;
> + reg = <0x48281000 0x1000>;
> + interrupt-parent = <>;
> + };
> +
> + l2-cache-controller@48242000 {
> + compatible = "arm,pl310-cache";
> + reg = <0x48242000 0x1000>;
> + cache-unified;
> + cache-level = <2>;
> + };
> +
> + ocp {
> + compatible = "ti,am4372-l3-noc", "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> + ti,hwmods = "l3_main";
> + reg = <0x4400 0x40
> +0x4480 0x40>;
> + interrupts = ,
> +  ;
> +
> + l4_wkup: l4_wkup@44c0 {
> + compatible = "ti,am4-l4-wkup", "simple-bus";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 0x44c0 0x287000>;
> +
> + prcm: prcm@1f {
> + compatible = "ti,am4-prcm";
> + reg = <0x1f 0x11000>;
> +
> + prcm_clocks: clocks {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + };
> +
> + prcm_clockdomains: clockdomains {
> + };
> + };
> +
> + scm: 

Re: [U-Boot] [PATCH 6/6] am437x: Add am437x_sk_evm_defconfig using CONFIG_DM

2015-09-28 Thread Lokesh Vutla


On Monday 28 September 2015 04:17 PM, Mugunthan V N wrote:
> Import various DT files for am437x-sk-evm from Linux Kernel v4.2
> Add config file for this board, enable DM, DM_GPIO, DM_SERIAL
> and DM_MMC.

Reviewed-by: Lokesh Vutla 

Thanks and regards,
Lokesh
> 
> Signed-off-by: Mugunthan V N 
> ---
>  arch/arm/dts/Makefile   |   2 +-
>  arch/arm/dts/am437x-sk-evm.dts  | 704 
> 
>  configs/am437x_sk_evm_defconfig |  17 +
>  3 files changed, 722 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/dts/am437x-sk-evm.dts
>  create mode 100644 configs/am437x_sk_evm_defconfig
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 716b5b7..29ef892 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -61,7 +61,7 @@ dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
>   zynq-zc770-xm012.dtb \
>   zynq-zc770-xm013.dtb
>  dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-evm.dtb
> -dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb
> +dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb
>  
>  dtb-$(CONFIG_ARCH_SOCFPGA) +=\
>   socfpga_arria5_socdk.dtb\
> diff --git a/arch/arm/dts/am437x-sk-evm.dts b/arch/arm/dts/am437x-sk-evm.dts
> new file mode 100644
> index 000..3f9d808
> --- /dev/null
> +++ b/arch/arm/dts/am437x-sk-evm.dts
> @@ -0,0 +1,704 @@
> +/*
> + * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +/* AM437x SK EVM */
> +
> +/dts-v1/;
> +
> +#include "am4372.dtsi"
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/ {
> + model = "TI AM437x SK EVM";
> + compatible = "ti,am437x-sk-evm","ti,am4372","ti,am43";
> +
> + aliases {
> + display0 = 
> + };
> +
> + chosen {
> + stdout-path = 
> + };
> +
> + backlight {
> + compatible = "pwm-backlight";
> + pwms = < 0 5 PWM_POLARITY_INVERTED>;
> + brightness-levels = <0 51 53 56 62 75 101 152 255>;
> + default-brightness-level = <8>;
> + };
> +
> + sound {
> + compatible = "ti,da830-evm-audio";
> + ti,model = "AM437x-SK-EVM";
> + ti,audio-codec = <>;
> + ti,mcasp-controller = <>;
> + ti,codec-clock-rate = <2400>;
> + ti,audio-routing =
> + "Headphone Jack",   "HPLOUT",
> + "Headphone Jack",   "HPROUT";
> + };
> +
> + matrix_keypad: matrix_keypad@0 {
> + compatible = "gpio-matrix-keypad";
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <_keypad_pins>;
> +
> + debounce-delay-ms = <5>;
> + col-scan-delay-us = <5>;
> +
> + row-gpios = < 5 GPIO_ACTIVE_HIGH  /* Bank5, pin5 
> */
> +  6 GPIO_ACTIVE_HIGH>; /* Bank5, pin6 
> */
> +
> + col-gpios = < 13 GPIO_ACTIVE_HIGH /* Bank5, pin13 
> */
> +  4 GPIO_ACTIVE_HIGH>; /* Bank5, pin4 
> */
> +
> + linux,keymap = <
> + MATRIX_KEY(0, 0, KEY_DOWN)
> + MATRIX_KEY(0, 1, KEY_RIGHT)
> + MATRIX_KEY(1, 0, KEY_LEFT)
> + MATRIX_KEY(1, 1, KEY_UP)
> + >;
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <_pins>;
> +
> + led@0 {
> + label = "am437x-sk:red:heartbeat";
> + gpios = < 0 GPIO_ACTIVE_HIGH>;/* Bank 5, pin 
> 0 */
> + linux,default-trigger = "heartbeat";
> + default-state = "off";
> + };
> +
> + led@1 {
> + label = "am437x-sk:green:mmc1";
> + gpios = < 1 GPIO_ACTIVE_HIGH>;/* Bank 5, pin 
> 1 */
> + linux,default-trigger = "mmc0";
> + default-state = "off";
> + };
> +
> + led@2 {
> + label = "am437x-sk:blue:cpu0";
> + gpios = < 2 GPIO_ACTIVE_HIGH>;/* Bank 5, pin 
> 2 */
> + linux,default-trigger = "cpu0";
> + default-state = "off";
> + };
> +
> + led@3 {
> + label = "am437x-sk:blue:usr3";
> + gpios = < 3 GPIO_ACTIVE_HIGH>;/* Bank 5, pin 
> 3 */
> + default-state = "off";
> + };
> + };
> +
> + lcd0: display {
> + compatible = 

[U-Boot] [PATCH V2 2/3] gpio: s5p: call: dev_get_addr() instead of fdtdec_get_addr()

2015-09-28 Thread Przemyslaw Marczak
After rework in lib/fdtdec.c, the function fdtdec_get_addr()
doesn't work for nodes with #size-cells property set to 0.

To get GPIO's 'reg' property, the code should use one of:
fdtdec_get_addr_size_auto_no/parent() function.

Fortunately dm core provides a function to get the property.

This commit reworks function gpio_exynos_bind(), to properly
use dev_get_addr() for GPIO device.

This prevents setting a wrong base register for Exynos GPIOs.

Signed-off-by: Przemyslaw Marczak 
Acked-by: Stephen Warren 
---
Changes V2:
- add acked-by
---
 drivers/gpio/s5p_gpio.c | 18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index 17fcfbf..0f22b23 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -341,18 +341,22 @@ static int gpio_exynos_bind(struct udevice *parent)
plat = calloc(1, sizeof(*plat));
if (!plat)
return -ENOMEM;
-   reg = fdtdec_get_addr(blob, node, "reg");
-   if (reg != FDT_ADDR_T_NONE)
-   bank = (struct s5p_gpio_bank *)((ulong)base + reg);
-   plat->bank = bank;
-   plat->bank_name = fdt_get_name(blob, node, NULL);
-   debug("dev at %p: %s\n", bank, plat->bank_name);
 
+   plat->bank_name = fdt_get_name(blob, node, NULL);
ret = device_bind(parent, parent->driver,
-   plat->bank_name, plat, -1, );
+ plat->bank_name, plat, -1, );
if (ret)
return ret;
+
dev->of_offset = node;
+
+   reg = dev_get_addr(dev);
+   if (reg != FDT_ADDR_T_NONE)
+   bank = (struct s5p_gpio_bank *)((ulong)base + reg);
+
+   plat->bank = bank;
+
+   debug("dev at %p: %s\n", bank, plat->bank_name);
}
 
return 0;
-- 
1.9.1

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


[U-Boot] [PATCH V2 3/3] mach-exynos: clock: restore calling dead exynos4_get_mmc_clk()

2015-09-28 Thread Przemyslaw Marczak
After rework of code by:

commit: d952796 Exynos5: Use clock_get_periph_rate generic API

function get_mmc_clk() always returns -1 for Exynos 4.

This was caused by omitting, that SDHCI driver for Exynos 4,
calls get_mmc_clk(), with mmc device number as argument,
instead of pinmux peripheral id, like DW MMC driver for Exynos 5.

By this commit, the code directly calls a proper function
to get mmc clock for Exynos 4, without checking the peripheral id.

Signed-off-by: Przemyslaw Marczak 
---
Changes V2:
- cleanup commit message
---
 arch/arm/mach-exynos/clock.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c
index 1c6baa1..18eadf5 100644
--- a/arch/arm/mach-exynos/clock.c
+++ b/arch/arm/mach-exynos/clock.c
@@ -1661,6 +1661,9 @@ unsigned long get_mmc_clk(int dev_index)
 {
enum periph_id id;
 
+   if (cpu_is_exynos4())
+   return exynos4_get_mmc_clk(dev_index);
+
switch (dev_index) {
case 0:
id = PERIPH_ID_SDMMC0;
@@ -1679,12 +1682,7 @@ unsigned long get_mmc_clk(int dev_index)
return -1;
}
 
-   if (cpu_is_exynos5())
-   return clock_get_periph_rate(id);
-   else if (cpu_is_exynos4())
-   return exynos4_get_mmc_clk(dev_index);
-
-   return 0;
+   return clock_get_periph_rate(id);
 }
 
 void set_mmc_clk(int dev_index, unsigned int div)
-- 
1.9.1

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


[U-Boot] [PATCH V2 1/3] fdtdec: fix parsing 'reg' property with zero value in '#size-cells'

2015-09-28 Thread Przemyslaw Marczak
After rework of lib/fdtdec.c by:

commit: 02464e3 fdt: add new fdt address parsing functions

the function fdtdec_get_addr() doesn't work as previous,
because the implementation assumes that properties '#address-cells'
and '#size-cells' are equal to 1, which can be not true sometimes.

The new API introduced fdtdec_get_addr_size_auto_parent() for the 'reg'
property parsing, but the implementation assumes, that #size-cells
can't be less than 1.

This causes that the following children's 'reg' property can't be reached:

parent@0x100 {
 #address-cells = <1>;
 #size-cells = <0>;
 children@0x100 {
 reg = < 0x100 >;
 };
};

Change the condition value from '1' to '0', which allows parsing property
with at least zero #size-cells, fixes the issue.

Now, fdtdec_get_addr_size_auto_parent() works properly.

Signed-off-by: Przemyslaw Marczak 
Acked-by: Stephen Warren 
---
Changes V2:
- cleanup commit message
- add acked-by
---
 lib/fdtdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 9f0b65d..9cf57b9 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -149,7 +149,7 @@ fdt_addr_t fdtdec_get_addr_size_auto_parent(const void 
*blob, int parent,
}
 
ns = fdt_size_cells(blob, parent);
-   if (ns < 1) {
+   if (ns < 0) {
debug("(bad #size-cells)\n");
return FDT_ADDR_T_NONE;
}
-- 
1.9.1

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


Re: [U-Boot] [PATCH 3/6] am43xx_evm.h: : switch to CONFIG_OMAP_SERIAL for non-SPL DM_SERIAL

2015-09-28 Thread Mugunthan V N
On Monday 28 September 2015 04:25 PM, Lokesh Vutla wrote:
> 
> On Monday 28 September 2015 04:17 PM, Mugunthan V N wrote:
>> > Tested on am437x gp evm and am437x sk evm
>> > 
>> > Signed-off-by: Mugunthan V N 
>> > ---
>> >  include/configs/am43xx_evm.h | 6 +-
>> >  1 file changed, 5 insertions(+), 1 deletion(-)
>> > 
>> > diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
>> > index d868442..03713e3 100644
>> > --- a/include/configs/am43xx_evm.h
>> > +++ b/include/configs/am43xx_evm.h
>> > @@ -23,9 +23,13 @@
>> >  
>> >  /* NS16550 Configuration */
>> >  #define CONFIG_SYS_NS16550
>> > +#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_DM_SERIAL)
>> >  #define CONFIG_SYS_NS16550_SERIAL
>> > -#define CONFIG_SYS_NS16550_REG_SIZE   (-4)
>> >  #define CONFIG_SYS_NS16550_CLK4800
>> > +#define CONFIG_SYS_NS16550_REG_SIZE   (-4)
> You are deleting and adding the same line under if. Is this really
> necessary?
> 
> Rest looks good to me.

Oops, thats not needed, Copy paste error (was playing with serial clock
during debug). Will fix in v2.

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


Re: [U-Boot] [PATCH] common: add CMD_GPIO to Kconfig

2015-09-28 Thread Marek Vasut
On Monday, September 28, 2015 at 02:34:39 AM, Thomas Chou wrote:
> Hi Marek,

Hi Thomas,

> On 09/26/2015 04:16 PM, Marek Vasut wrote:
> >  If you ever figure out how to use buildman for your tests, I'd be glad
> > 
> > if you share that information -- something like "buildman, the warstory".
> > I'm struggling with the same thing ;-)
> 
> Surely I will if I ever do.

I'm so looking forward to it :-)

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


[U-Boot] [PATCH V2 0/3] Fix fdt 'reg' parsing and unbreak few Exynos4 boards

2015-09-28 Thread Przemyslaw Marczak
Booting of Odroid U3 with SD card, ends with error:

MMC:   EXYNOS DWMMC: 0
Card did not respond to voltage select!
*** Warning - MMC init failed, using default environment

Generally this was broken, because of wrong addresses,
assigned to GPIOs.
The source of the problem was in rework of lib/fdtdec.c, after which
function fdtdec_get_addr() doesn't work as previous and function
dev_get_addr() doesn't work as expected.

The code after rework in lib/fdtdec.c assumed, that #size-cells property,
should be always greater or equal to 1, this was wrong, because it can be 0.

In case of debugging the issue, I found, that mmc clock was computed wrong,
for Exynos4, because of function get_mmc_clk(), which always returns -1 for
this SoC.

The patchset should fix booting on all Exynos4 boards, however it was tested
on: Odroid X2 / U3 / XU3 and Trats2.

Przemyslaw Marczak (3):
  fdtdec: fix parsing 'reg' property with zero value in '#size-cells'
  gpio: s5p: call: dev_get_addr() instead of fdtdec_get_addr()
  mach-exynos: clock: restore calling dead exynos4_get_mmc_clk()

 arch/arm/mach-exynos/clock.c | 10 --
 drivers/gpio/s5p_gpio.c  | 18 +++---
 lib/fdtdec.c |  2 +-
 3 files changed, 16 insertions(+), 14 deletions(-)

-- 
1.9.1

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


Re: [U-Boot] [PATCH] arm, at91: small updates for the smartweb board

2015-09-28 Thread Andreas Bießmann
Hi Heiko,

> Am 25.09.2015 um 13:17 schrieb Heiko Schocher :
> 
> - add CONFIG_BOOT_RETRY_TIME to 30
> - fex LED colors
> - fix button pressed combination
> - add
>  CONFIG_USB_HOST_ETHER
>  CONFIG_USB_ETHER_ASIX
>  CONFIG_USB_ETHER_MCS7830
> - change U-Boot prompt to "U-Boot> "
> 
> Signed-off-by: Heiko Schocher 
> Signed-off-by: Matthias Michel 
> ---
> $ ./tools/buildman/buildman -b 20150923 at91
> WARNING: no status info for 'dra72_evm'
> WARNING: no maintainers for 'dra72_evm'
> WARNING: no status info for 'am335x_gp_evm'
> WARNING: no maintainers for 'am335x_gp_evm'
> WARNING: no status info for 'hikey'
> WARNING: no maintainers for 'hikey'
> Building 5 commits for 61 boards (8 threads, 1 job per thread)
> Cloning repo for thread 0
> Cloning repo for thread 1
> Cloning repo for thread 2
> Cloning repo for thread 3
> Cloning repo for thread 4
> Cloning repo for thread 5
> Cloning repo for thread 6
> Cloning repo for thread 7
>  30500 /305axm
> 
> board/siemens/smartweb/smartweb.c | 25 ++---
> include/configs/smartweb.h|  5 +
> 2 files changed, 19 insertions(+), 11 deletions(-)
> 
> diff --git a/board/siemens/smartweb/smartweb.c 
> b/board/siemens/smartweb/smartweb.c
> index 2d42488..d82f1b7 100644
> --- a/board/siemens/smartweb/smartweb.c
> +++ b/board/siemens/smartweb/smartweb.c
> @@ -90,7 +90,8 @@ static void smartweb_macb_hw_init(void)
>pin_to_mask(AT91_PIN_PA17) |
>pin_to_mask(AT91_PIN_PA25) |
>pin_to_mask(AT91_PIN_PA26) |
> -pin_to_mask(AT91_PIN_PA28),
> +pin_to_mask(AT91_PIN_PA28) |
> +pin_to_mask(AT91_PIN_PA29),
>>pudr);
> 
>at91_phy_reset();
> @@ -101,7 +102,8 @@ static void smartweb_macb_hw_init(void)
>pin_to_mask(AT91_PIN_PA17) |
>pin_to_mask(AT91_PIN_PA25) |
>pin_to_mask(AT91_PIN_PA26) |
> -pin_to_mask(AT91_PIN_PA28),
> +pin_to_mask(AT91_PIN_PA28) |
> +pin_to_mask(AT91_PIN_PA29),
>>puer);
> 
>/* Initialize EMAC=MACB hardware */
> @@ -141,13 +143,6 @@ int board_early_init_f(void)
> 
> int board_init(void)
> {
> -/* Adress of boot parameters */
> -gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
> -
> -smartweb_nand_hw_init();
> -#ifdef CONFIG_MACB
> -smartweb_macb_hw_init();
> -#endif
>/* power LED red */
>at91_set_gpio_output(AT91_PIN_PC6, 0);
>at91_set_gpio_output(AT91_PIN_PC7, 1);
> @@ -163,6 +158,13 @@ int board_init(void)
>at91_udc_probe(_udc_data);
> #endif
> 
> +/* Adress of boot parameters */
> +gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
> +
> +smartweb_nand_hw_init();
> +#ifdef CONFIG_MACB
> +smartweb_macb_hw_init();
> +#endif
>return 0;
> }
> 
> @@ -197,6 +199,7 @@ void matrix_init(void)
> 
> void spl_board_init(void)
> {
> +/* power LED orange */
>at91_set_gpio_output(AT91_PIN_PC6, 1);
>at91_set_gpio_output(AT91_PIN_PC7, 1);
>/* alarm LED orange */
> @@ -212,8 +215,8 @@ void spl_board_init(void)
> 
>/* check if both  button are pressed */
>if (at91_get_gpio_value(AT91_PIN_PA28) == 0 &&
> -at91_get_gpio_value(AT91_PIN_PA29) == 0) {
> -debug("Recovery button pressed\n");
> +at91_get_gpio_value(AT91_PIN_PA29) == 0) {
> +smartweb_nand_hw_init();
>nand_init();
>spl_nand_erase_one(0, 0);
>}
> diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h
> index d189c3f..fbb66d5 100644
> --- a/include/configs/smartweb.h
> +++ b/include/configs/smartweb.h
> @@ -117,6 +117,9 @@
>  *
>  */
> #define CONFIG_MACB
> +#define CONFIG_USB_HOST_ETHER
> +#define CONFIG_USB_ETHER_ASIX
> +#define CONFIG_USB_ETHER_MCS7830
> #define CONFIG_RMII/* use reduced MII inteface */
> #define CONFIG_NET_RETRY_COUNT20  /* # of DHCP/BOOTP retries */
> #define CONFIG_AT91_WANTS_COMMON_PHY
> @@ -182,6 +185,8 @@
> /* General Boot Parameter */
> #define CONFIG_BOOTDELAY3
> #define CONFIG_BOOTCOMMAND"run flashboot"
> +#define CONFIG_BOOT_RETRY_TIME  30
> +#define CONFIG_SYS_PROMPT"U-Boot> "

could you please use KConfig for at least the SYS_PROMPT setting?

Andreas

> #define CONFIG_SYS_CBSIZE512
> #define CONFIG_SYS_MAXARGS16
> #define CONFIG_SYS_PBSIZE \
> -- 
> 2.1.0
> 
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 00/13] Better support of booting VxWorks via 'bootvx'

2015-09-28 Thread Bin Meng
This series adds better support of booting VxWorks using 'bootvx'.

Tested by booting a VxWorks 6.9.4 kernel on Intel Crown Bay, and
a VxWorks 7 kernel on Intel Galileo.

Note:

Patch#1 and patch#2 are recommended to be included in v2015.10 release,
other patches in this series can target for next release.

http://patchwork.ozlabs.org/patch/522185/ was a single patch previously,
now is included in this v2 series as it fixed a bug which could prevent
VxWorks from booting.

Changes in v2:
- New patch to move install_e820_map() out of zimage.c
- New patch to remove quotation mark in CONFIG_HOSTNAME
- Split the defconfig reorder to another patch, making this patch
  as CONFIG_CMD_ELF mods only
- Update sparc and avr32 boards to unset CONFIG_CMD_ELF
- Fix the endian issue for netmask
- New patch to add asmlinkage to the VxWorks x86 entry
- Describe typical values for bootaddr, e820data, e820info.

Bin Meng (13):
  Reorder defconfigs with 'savedefconfig'
  x86: fsp: Report correct number of E820 table entries
  x86: Initialize GDT entry 1 to be the 32-bit CS as well
  x86: Move install_e820_map() out of zimage.c
  x86: Remove quotation mark in CONFIG_HOSTNAME
  cmd: Convert CONFIG_CMD_ELF to Kconfig
  cmd: Clean up cmd_elf a little bit
  cmd: elf: Reorder load_elf_image_phdr() and load_elf_image_shdr()
  cmd: bootvx: Pass netmask and gatewayip to VxWorks bootline
  cmd: bootvx: Always get VxWorks bootline from env
  cmd: bootvx: Pass E820 information to an x86 VxWorks kernel
  cmd: bootvx: Add asmlinkage to the VxWorks x86 entry
  doc: Complement document about booting VxWorks

 README  |  12 +-
 arch/x86/cpu/cpu.c  |   7 +-
 arch/x86/include/asm/e820.h |   3 +
 arch/x86/include/asm/zimage.h   |   3 -
 arch/x86/lib/Makefile   |   1 +
 arch/x86/lib/e820.c |  37 +++
 arch/x86/lib/fsp/fsp_dram.c |   3 +-
 arch/x86/lib/zimage.c   |  26 --
 common/Kconfig  |   6 +
 common/cmd_elf.c| 411 +---
 configs/A10-OLinuXino-Lime_defconfig|   2 +-
 configs/Bananapi_defconfig  |   2 +-
 configs/Bananapro_defconfig |   2 +-
 configs/Chuwi_V7_CW0825_defconfig   |   2 +-
 configs/M5208EVBE_defconfig |   2 +-
 configs/M52277EVB_defconfig |   2 +-
 configs/M5235EVB_defconfig  |   2 +-
 configs/M5272C3_defconfig   |   2 +-
 configs/M5275EVB_defconfig  |   2 +-
 configs/M5282EVB_defconfig  |   2 +-
 configs/M53017EVB_defconfig |   2 +-
 configs/M5329AFEE_defconfig |   2 +-
 configs/M5329BFEE_defconfig |   2 +-
 configs/M5373EVB_defconfig  |   2 +-
 configs/M54418TWR_defconfig |   2 +-
 configs/M54418TWR_nand_mii_defconfig|   2 +-
 configs/M54418TWR_nand_rmii_defconfig   |   2 +-
 configs/M54418TWR_nand_rmii_lowfreq_defconfig   |   2 +-
 configs/M54418TWR_serial_mii_defconfig  |   2 +-
 configs/M54418TWR_serial_rmii_defconfig |   2 +-
 configs/M54451EVB_defconfig |   2 +-
 configs/M54455EVB_defconfig |   2 +-
 configs/M5475AFE_defconfig  |   2 +-
 configs/M5475BFE_defconfig  |   2 +-
 configs/M5475CFE_defconfig  |   2 +-
 configs/M5475DFE_defconfig  |   2 +-
 configs/M5475EFE_defconfig  |   2 +-
 configs/M5475FFE_defconfig  |   2 +-
 configs/M5475GFE_defconfig  |   2 +-
 configs/M5485AFE_defconfig  |   2 +-
 configs/M5485BFE_defconfig  |   2 +-
 configs/M5485CFE_defconfig  |   2 +-
 configs/M5485DFE_defconfig  |   2 +-
 configs/M5485EFE_defconfig  |   2 +-
 configs/M5485FFE_defconfig  |   2 +-
 configs/M5485GFE_defconfig  |   2 +-
 configs/M5485HFE_defconfig  |   2 +-
 configs/MPC8349ITXGP_defconfig  |   2 +-
 configs/MPC8349ITX_LOWBOOT_defconfig|   2 +-
 configs/MPC8349ITX_defconfig|   2 +-
 configs/MSI_Primo81_defconfig   |   2 +-
 configs/Mini-X_defconfig|   2 +-
 configs/PATI_defconfig  |   2 +-
 configs/UCP1020_defconfig   |   2 +-
 configs/VCMA9_defconfig |   2 +-
 configs/Wexler_TAB7200_defconfig|   2 +-
 configs/ac14xx_defconfig|   2 +-
 configs/adp-ag101p_defconfig|   2 +-
 

[U-Boot] [PATCH v2 02/13] x86: fsp: Report correct number of E820 table entries

2015-09-28 Thread Bin Meng
The logic to calculate the number of E820 table entries is wrong
when walking through the FSP HOB tables. Fix it.

Signed-off-by: Bin Meng 
Tested-by: Jian Luo 

---
Simon, I think we need get this fix in v2015.10 release.

Changes in v2: None

 arch/x86/lib/fsp/fsp_dram.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/lib/fsp/fsp_dram.c b/arch/x86/lib/fsp/fsp_dram.c
index 28552fa..e51ca96 100644
--- a/arch/x86/lib/fsp/fsp_dram.c
+++ b/arch/x86/lib/fsp/fsp_dram.c
@@ -72,9 +72,10 @@ unsigned install_e820_map(unsigned max_entries, struct 
e820entry *entries)
entries[num_entries].type = E820_RAM;
else if (res_desc->type == RES_MEM_RESERVED)
entries[num_entries].type = E820_RESERVED;
+
+   num_entries++;
}
hdr = get_next_hob(hdr);
-   num_entries++;
}
 
/* Mark PCIe ECAM address range as reserved */
-- 
1.8.2.1

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


[U-Boot] [PATCH v2 09/13] cmd: bootvx: Pass netmask and gatewayip to VxWorks bootline

2015-09-28 Thread Bin Meng
There are fields in VxWorks bootline for netmask and gatewayip.
We can get these from U-Boot environment variables and pass them
to VxWorks, just like ipaddr and serverip.

Signed-off-by: Bin Meng 

---

Changes in v2:
- Fix the endian issue for netmask

 common/cmd_elf.c | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index 62863df..9e6aa01 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -287,13 +287,25 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
"%s:file ", CONFIG_SYS_VXWORKS_SERVERNAME);
 
tmp = getenv("ipaddr");
-   if (tmp)
-   sprintf(_buf[strlen(build_buf)], "e=%s ", tmp);
+   if (tmp) {
+   sprintf(_buf[strlen(build_buf)], "e=%s", tmp);
+   tmp = getenv("netmask");
+   if (tmp)
+   sprintf(_buf[strlen(build_buf)],
+   ":%08x ",
+   ntohl(getenv_ip("netmask").s_addr));
+   else
+   sprintf(_buf[strlen(build_buf)], " ");
+   }
 
tmp = getenv("serverip");
if (tmp)
sprintf(_buf[strlen(build_buf)], "h=%s ", tmp);
 
+   tmp = getenv("gatewayip");
+   if (tmp)
+   sprintf(_buf[strlen(build_buf)], "g=%s ", tmp);
+
tmp = getenv("hostname");
if (tmp)
sprintf(_buf[strlen(build_buf)], "tn=%s ", tmp);
-- 
1.8.2.1

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


[U-Boot] [PATCH 6/6] am437x: Add am437x_sk_evm_defconfig using CONFIG_DM

2015-09-28 Thread Mugunthan V N
Import various DT files for am437x-sk-evm from Linux Kernel v4.2
Add config file for this board, enable DM, DM_GPIO, DM_SERIAL
and DM_MMC.

Signed-off-by: Mugunthan V N 
---
 arch/arm/dts/Makefile   |   2 +-
 arch/arm/dts/am437x-sk-evm.dts  | 704 
 configs/am437x_sk_evm_defconfig |  17 +
 3 files changed, 722 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/am437x-sk-evm.dts
 create mode 100644 configs/am437x_sk_evm_defconfig

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 716b5b7..29ef892 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -61,7 +61,7 @@ dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
zynq-zc770-xm012.dtb \
zynq-zc770-xm013.dtb
 dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-evm.dtb
-dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb
+dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb
 
 dtb-$(CONFIG_ARCH_SOCFPGA) +=  \
socfpga_arria5_socdk.dtb\
diff --git a/arch/arm/dts/am437x-sk-evm.dts b/arch/arm/dts/am437x-sk-evm.dts
new file mode 100644
index 000..3f9d808
--- /dev/null
+++ b/arch/arm/dts/am437x-sk-evm.dts
@@ -0,0 +1,704 @@
+/*
+ * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/* AM437x SK EVM */
+
+/dts-v1/;
+
+#include "am4372.dtsi"
+#include 
+#include 
+#include 
+#include 
+
+/ {
+   model = "TI AM437x SK EVM";
+   compatible = "ti,am437x-sk-evm","ti,am4372","ti,am43";
+
+   aliases {
+   display0 = 
+   };
+
+   chosen {
+   stdout-path = 
+   };
+
+   backlight {
+   compatible = "pwm-backlight";
+   pwms = < 0 5 PWM_POLARITY_INVERTED>;
+   brightness-levels = <0 51 53 56 62 75 101 152 255>;
+   default-brightness-level = <8>;
+   };
+
+   sound {
+   compatible = "ti,da830-evm-audio";
+   ti,model = "AM437x-SK-EVM";
+   ti,audio-codec = <>;
+   ti,mcasp-controller = <>;
+   ti,codec-clock-rate = <2400>;
+   ti,audio-routing =
+   "Headphone Jack",   "HPLOUT",
+   "Headphone Jack",   "HPROUT";
+   };
+
+   matrix_keypad: matrix_keypad@0 {
+   compatible = "gpio-matrix-keypad";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_keypad_pins>;
+
+   debounce-delay-ms = <5>;
+   col-scan-delay-us = <5>;
+
+   row-gpios = < 5 GPIO_ACTIVE_HIGH  /* Bank5, pin5 
*/
+6 GPIO_ACTIVE_HIGH>; /* Bank5, pin6 
*/
+
+   col-gpios = < 13 GPIO_ACTIVE_HIGH /* Bank5, pin13 
*/
+4 GPIO_ACTIVE_HIGH>; /* Bank5, pin4 
*/
+
+   linux,keymap = <
+   MATRIX_KEY(0, 0, KEY_DOWN)
+   MATRIX_KEY(0, 1, KEY_RIGHT)
+   MATRIX_KEY(1, 0, KEY_LEFT)
+   MATRIX_KEY(1, 1, KEY_UP)
+   >;
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+
+   led@0 {
+   label = "am437x-sk:red:heartbeat";
+   gpios = < 0 GPIO_ACTIVE_HIGH>;/* Bank 5, pin 
0 */
+   linux,default-trigger = "heartbeat";
+   default-state = "off";
+   };
+
+   led@1 {
+   label = "am437x-sk:green:mmc1";
+   gpios = < 1 GPIO_ACTIVE_HIGH>;/* Bank 5, pin 
1 */
+   linux,default-trigger = "mmc0";
+   default-state = "off";
+   };
+
+   led@2 {
+   label = "am437x-sk:blue:cpu0";
+   gpios = < 2 GPIO_ACTIVE_HIGH>;/* Bank 5, pin 
2 */
+   linux,default-trigger = "cpu0";
+   default-state = "off";
+   };
+
+   led@3 {
+   label = "am437x-sk:blue:usr3";
+   gpios = < 3 GPIO_ACTIVE_HIGH>;/* Bank 5, pin 
3 */
+   default-state = "off";
+   };
+   };
+
+   lcd0: display {
+   compatible = "newhaven,nhd-4.3-480272ef-atxl", "panel-dpi";
+   label = "lcd";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+
+   enable-gpios = < 7 GPIO_ACTIVE_HIGH>;
+
+   panel-timing {
+   clock-frequency = <900>;

[U-Boot] [PATCH 4/6] am43xx_evm: mmc: do not define DM_MMC for spl

2015-09-28 Thread Mugunthan V N
Since spl doesn't support DM currently, do not define DM_MMC
for spl build.

Signed-off-by: Mugunthan V N 
---
 include/configs/am43xx_evm.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h
index 03713e3..3bd104d 100644
--- a/include/configs/am43xx_evm.h
+++ b/include/configs/am43xx_evm.h
@@ -140,6 +140,14 @@
 #define CONFIG_USB_GADGET_DUALSPEED
 #endif
 
+/*
+ * Disable MMC DM for SPL build and can be re-enabled after adding
+ * DM support in SPL
+ */
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_DM_MMC
+#endif
+
 #ifndef CONFIG_SPL_BUILD
 /* USB Device Firmware Update support */
 #define CONFIG_USB_FUNCTION_DFU
-- 
2.6.0.rc2.10.gf4d9753

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


Re: [U-Boot] [PATCH] spi: ignore set speed and mode if not available

2015-09-28 Thread Jagan Teki
On 22 September 2015 at 13:40, Marek Vasut  wrote:
> On Tuesday, September 22, 2015 at 09:41:21 AM, Thomas Chou wrote:
>> Some cores, such as Altera SPI and QuadSPI, can not change
>> speed and mode at runtime. Ignore the operation which is
>> not available.
>>
>> Signed-off-by: Thomas Chou 
>
> Acked-by: Marek Vasut 

Reviewed-by: Jagan Teki 

Pick this one as well.

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


Re: [U-Boot] [PATCH 0/8] Better support of booting VxWorks via 'bootvx'

2015-09-28 Thread Bin Meng
Hi Jian,

On Mon, Sep 28, 2015 at 3:39 PM, Jian Luo  wrote:
> Hi,
>
> please add
>
> Tested-by: Jian Luo  on crownbay
>

Thanks for testing. I've added your 'Tested-by' tag in various commits
in the v2 series.

> Best regards,
>
> Jian Luo
>
>

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


[U-Boot] [PATCH 2/2] odroid: Add boot script (boot.scr) support

2015-09-28 Thread Guillaume GARDET
Signed-off-by: Guillaume GARDET 
Cc: Przemyslaw Marczak 
Cc: Minkyu Kang 

---
 include/configs/odroid.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/include/configs/odroid.h b/include/configs/odroid.h
index e45b00e..cc9f818 100644
--- a/include/configs/odroid.h
+++ b/include/configs/odroid.h
@@ -108,6 +108,8 @@
  * 2.  ROOT:  -
 */
 #define CONFIG_EXTRA_ENV_SETTINGS \
+   "loadbootscript=load mmc ${mmcbootdev}:${mmcbootpart} ${loadaddr} " \
+   "boot.scr\0" \
"loadkernel=load mmc ${mmcbootdev}:${mmcbootpart} ${kerneladdr} " \
"${kernelname}\0" \
"loadinitrd=load mmc ${mmcbootdev}:${mmcbootpart} ${initrdaddr} " \
@@ -129,6 +131,8 @@
"kernel_args=" \
"setenv bootargs root=/dev/mmcblk${mmcrootdev}p${mmcrootpart}" \
" rootwait ${console} ${opts}\0" \
+   "bootscript=echo Running bootscript from 
mmc${mmcbootdev}:${mmcbootpart} ...; " \
+   "source ${loadaddr}\0" \
"boot_fit=" \
"setenv kerneladdr 0x4200;" \
"setenv kernelname Image.itb;" \
@@ -152,6 +156,9 @@
"run kernel_args;" \
"bootz ${kerneladdr} ${initrd_addr} ${fdt_addr};\0" \
"autoboot=" \
+   "if run loadbootscript; then " \
+   "run bootscript; " \
+   "fi; " \
"if test -e mmc 0 Image.itb; then; " \
"run boot_fit;" \
"elif test -e mmc 0 zImage; then; " \
@@ -171,6 +178,7 @@
"consoleoff=set console console=ram; save; reset\0" \
"initrdname=uInitrd\0" \
"initrdaddr=4200\0" \
+   "loadaddr=0x4200\0" \
"fdtaddr=4080\0"
 
 /* I2C */
-- 
1.8.4.5

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


Re: [U-Boot] [PATCH] board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

2015-09-28 Thread Hannes Schmelzer
> Hi Hannes,
Hi Bin,
thanks for reply.

> 
> On Mon, Sep 28, 2015 at 4:33 PM, Hannes Schmelzer  
wrote:
> > Since we don't have for sure a valid IP-setup during
> > board_late_init(...) because it maybe allready stored in environment 
or
> > not, we cannot form a proper vxWorks bootline at this place.
> >
> > So we move to the way, forming the bootline just before
> > executing/launching vxWorks with "go ".
> > At this time we have a valid IP-setup for sure because it is either in
> > environment or defined through CONFIG_PREBOOT command.
> >
> > To do this, we overload the __weak function "do_go_exec(...)" with our
> > own and do the job.
> >
> > Signed-off-by: Hannes Schmelzer 
> >
> 
> I don't understand the technical details here on this board, but can
> we use the generic 'bootvx' command to handle the VxWorks bootline?

At first i had a look to this, but unfortunately it is not useable for my 
case, because we are passing 
serveral things more through the bootline to our vxWorks kernel.
Especially o=... contains several information like framebuffer address, 
factory-settings address and so on.
Further we have FTP-Filesystem, so we pass additional arguments (
u=vxWorksFTP pw=vxWorks).

> 
> > ---
> >
> >  board/BuR/kwb/board.c | 23 ++-
> >  1 file changed, 14 insertions(+), 9 deletions(-)
> >
> > diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
> > index 039ec20..703a474 100644
> > --- a/board/BuR/kwb/board.c
> > +++ b/board/BuR/kwb/board.c
> > @@ -281,6 +281,19 @@ int board_late_init(void)
> > } else {
> > puts("ERROR: i2c_set_bus_speed failed! 
(scratchregister)\n");
> > }
> > +   /*
> > +* reset VBAR registers to its reset location, VxWorks 6.9.3.2 
does
> > +* expect that vectors are there, original u-boot moves them 
to _start
> > +*/
> > +   __asm__("ldr r0,=0x2");
> > +   __asm__("mcr p15, 0, r0, c12, c0, 0"); /* Set VBAR */
> > +
> > +   return 0;
> > +}
> > +#endif /* CONFIG_BOARD_LATE_INIT */
> > +unsigned long do_go_exec(ulong (*entry)(int, char * const []), int 
argc,
> > +char * const argv[])
> > +{
> > /* setup vxworks bootline */
> > char *vxworksbootline = (char *)VXWORKS_BOOTLINE;
> > sprintf(vxworksbootline,
> > @@ -295,13 +308,5 @@ int board_late_init(void)
> > (u32)getenv_ulong("vx_romfsbase", 16, 0),
> > (u32)getenv_ulong("vx_romfssize", 16, 0));
> >
> > -   /*
> > -* reset VBAR registers to its reset location, VxWorks 6.9.3.2 
does
> > -* expect that vectors are there, original u-boot moves them 
to _start
> > -*/
> > -   __asm__("ldr r0,=0x2");
> > -   __asm__("mcr p15, 0, r0, c12, c0, 0"); /* Set VBAR */
> > -
> > -   return 0;
> > +   return entry(argc, argv);
> >  }
> > -#endif /* CONFIG_BOARD_LATE_INIT */
> > --
> > 1.9.1
> 
> Regards,
> Bin
best regards,
Hannes



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


[U-Boot] Antwort: Re: Re: [PATCH] board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

2015-09-28 Thread Hannes Schmelzer
> Hi Hannes,
Hi,

> 
> On Mon, Sep 28, 2015 at 5:17 PM, Hannes Schmelzer
>  wrote:
> >> Hi Hannes,
> > Hi Bin,
> > thanks for reply.
> >
> >>
> >> On Mon, Sep 28, 2015 at 4:33 PM, Hannes Schmelzer 
> > wrote:
> >> > Since we don't have for sure a valid IP-setup during
> >> > board_late_init(...) because it maybe allready stored in 
environment
> > or
> >> > not, we cannot form a proper vxWorks bootline at this place.
> >> >
> >> > So we move to the way, forming the bootline just before
> >> > executing/launching vxWorks with "go ".
> >> > At this time we have a valid IP-setup for sure because it is either 
in
> >> > environment or defined through CONFIG_PREBOOT command.
> >> >
> >> > To do this, we overload the __weak function "do_go_exec(...)" with 
our
> >> > own and do the job.
> >> >
> >> > Signed-off-by: Hannes Schmelzer 
> >> >
> >>
> >> I don't understand the technical details here on this board, but can
> >> we use the generic 'bootvx' command to handle the VxWorks bootline?
> >
> > At first i had a look to this, but unfortunately it is not useable for 
my
> > case, because we are passing
> > serveral things more through the bootline to our vxWorks kernel.
> > Especially o=... contains several information like framebuffer 
address,
> > factory-settings address and so on.
> > Further we have FTP-Filesystem, so we pass additional arguments (
> > u=vxWorksFTP pw=vxWorks).
> >
> 
> Could you please try this patch series [1] instead?
> 
> With that series, we can construct VxWorks bootline from U-Boot env.
> Like you can store your additional bootline info to U-Boot env
> variable "othbootargs", like
> 
> => setenv othbootargs u=vxWorksFTP pw=vxWorks o=fb_addr=xxx 
factory_setting=yyy
I will have a closer look to this.
The framebuffer base is stored at this time in gd->fb_base

sprintf(vxworksbootline,
"%s h=%s e=%s:%s g=%s %s o=0x%08x;0x%08x;0x%08x;0x%08x",
DEFAULT_BOOTLINE,
getenv("serverip"),
getenv("ipaddr"), getenv("netmask"),
getenv("gatewayip"),
VXWORKS_USER,
(unsigned int) gd->fb_base-0x20,
(u32)getenv_ulong("vx_memtop", 16, gd->fb_base-0x20),
(u32)getenv_ulong("vx_romfsbase", 16, 0),
(u32)getenv_ulong("vx_romfssize", 16, 0));

do you thank that i cal realize a bootline like this with current tools?

> 
> 
> [1] http://patchwork.ozlabs.org/patch/523276/
> 
> Regards,
> Bin
best regars,
Hannes



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


Re: [U-Boot] [PATCH] board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

2015-09-28 Thread Hannes Schmelzer
> Hi Hannes,
Hi,

> >>
> >> Could you please try this patch series [1] instead?
> >>
> >> With that series, we can construct VxWorks bootline from U-Boot env.
> >> Like you can store your additional bootline info to U-Boot env
> >> variable "othbootargs", like
> >>
> >> => setenv othbootargs u=vxWorksFTP pw=vxWorks o=fb_addr=xxx
> > factory_setting=yyy
> > I will have a closer look to this.
> > The framebuffer base is stored at this time in gd->fb_base
> >
> > sprintf(vxworksbootline,
> > "%s h=%s e=%s:%s g=%s %s 
o=0x%08x;0x%08x;0x%08x;0x%08x",
> > DEFAULT_BOOTLINE,
> > getenv("serverip"),
> > getenv("ipaddr"), getenv("netmask"),
> > getenv("gatewayip"),
> > VXWORKS_USER,
> > (unsigned int) gd->fb_base-0x20,
> > (u32)getenv_ulong("vx_memtop", 16, gd->fb_base-0x20),
> > (u32)getenv_ulong("vx_romfsbase", 16, 0),
> > (u32)getenv_ulong("vx_romfssize", 16, 0));
> >
> > do you thank that i cal realize a bootline like this with current 
tools?
> >
> 
> Yes, I think you can do something like setenv("othbootargs",
> addtional_bootlines) where addtional_bootlines holds the value for
> frame buffer address from gd->fb_base.

OK, the plan would be:

a) setup some othbootargs out from board.c (because gd->fb_base isn't 
accessible through cli)
b) call bootvx instead go ... to start vxWorks kernel

right?

> 
> Regards,
> Bin
regards,
Hannes



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


Re: [U-Boot] [PATCH] fdt: fix fdtdec_get_addr_size not to require any size cells

2015-09-28 Thread Przemyslaw Marczak

Hello Stephen,

On 09/25/2015 06:11 PM, Stephen Warren wrote:

From: Stephen Warren 

fdtdec_get_addr_size() may be used in two cases:
a) With sizep supplied, in which case both an address and a size are
parsed from DT. In this case, the DT property must be large enough to
contain both values.
b) With sizep NULL, in which case only an address is parsed from DT.
In this case, the DT property only need be large enough to contain this
address value. Commit 02464e386bb5 "fdt: add new fdt address parsing
functions" broke this relaxed checking, and required the DT property to
contain both an address and a size value in all cases.

Fix fdtdec_get_addr_size() to vary ns based on whether the size value
is being parsed from the DT or not. This is safe since the function only
parses the first entry in the property, so the overall value of (na + ns)
need not be accurate, since it is never used to step through the property
data to find other entries. Besides, this fixed behaviour essentially
matches the original behaviour before the patch this patch fixes. (The
original code validated that the property was exactly the length of
either na or (na + ns), whereas the current code only validates that the
property is at least that long. For non-failure cases, the two behaviours
are identical).

Cc: Przemyslaw Marczak 
Cc: Simon Glass 
Cc: Thierry Reding 
Cc: Bin Meng 
Cc: Michal Suchanek 
Fixes: 02464e386bb5 ("fdt: add new fdt address parsing functions")
Reported-by: Przemyslaw Marczak 
Signed-off-by: Stephen Warren 
---
  lib/fdtdec.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 9f0b65de3831..1fdb4f0d9ce9 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -180,10 +180,11 @@ fdt_addr_t fdtdec_get_addr_size_auto_noparent(const void 
*blob, int node,
  fdt_addr_t fdtdec_get_addr_size(const void *blob, int node,
const char *prop_name, fdt_size_t *sizep)
  {
+   int ns = sizep ? (sizeof(fdt_size_t) / sizeof(fdt32_t)) : 0;
+
return fdtdec_get_addr_size_fixed(blob, node, prop_name, 0,
  sizeof(fdt_addr_t) / sizeof(fdt32_t),
- sizeof(fdt_size_t) / sizeof(fdt32_t),
- sizep);
+ ns, sizep);
  }

  fdt_addr_t fdtdec_get_addr(const void *blob, int node,



I tested this on top of latest mainline and it fixes the issue for use 
of fdtdec_get_addr(), however my fixes should be also applied.


Tested-by: Przemyslaw Marczak 

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


Re: [U-Boot] [PATCH 2/6] drivers: serial: serial_omap: add comaptibles for all ti platforms

2015-09-28 Thread Lokesh Vutla


On Monday 28 September 2015 04:17 PM, Mugunthan V N wrote:
> Adding compatibles for am335x, am437x and dra7 platforms.

Reviewed-by: Lokesh Vutla 

Thanks and regards,
Lokesh
> 
> Signed-off-by: Mugunthan V N 
> ---
>  drivers/serial/serial_omap.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/serial/serial_omap.c b/drivers/serial/serial_omap.c
> index 9709444..891cd7b 100644
> --- a/drivers/serial/serial_omap.c
> +++ b/drivers/serial/serial_omap.c
> @@ -16,8 +16,12 @@ DECLARE_GLOBAL_DATA_PTR;
>  
>  #if CONFIG_IS_ENABLED(OF_CONTROL)
>  static const struct udevice_id omap_serial_ids[] = {
> + { .compatible = "ti,omap2-uart" },
>   { .compatible = "ti,omap3-uart" },
>   { .compatible = "ti,omap4-uart" },
> + { .compatible = "ti,am3352-uart" },
> + { .compatible = "ti,am4372-uart" },
> + { .compatible = "ti,dra742-uart" },
>   { }
>  };
>  
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/6] drivers: serial: serial_omap: populate default clock frequency when not found in dt

2015-09-28 Thread Lokesh Vutla


On Monday 28 September 2015 04:17 PM, Mugunthan V N wrote:
> In some platforms like am437x, serial node is not populated with
> clock-frequency node. So in that case have a default clock-clock
> frequency.
Reviewed-by: Lokesh Vutla 

Thanks and regards,
Lokesh
> 
> Signed-off-by: Mugunthan V N 
> ---
>  drivers/serial/serial_omap.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/serial/serial_omap.c b/drivers/serial/serial_omap.c
> index e8d544f..9709444 100644
> --- a/drivers/serial/serial_omap.c
> +++ b/drivers/serial/serial_omap.c
> @@ -12,6 +12,8 @@
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> +#define DEFAULT_CLK_SPEED 4800 /* 48Mhz */
> +
>  #if CONFIG_IS_ENABLED(OF_CONTROL)
>  static const struct udevice_id omap_serial_ids[] = {
>   { .compatible = "ti,omap3-uart" },
> @@ -28,7 +30,7 @@ static int omap_serial_ofdata_to_platdata(struct udevice 
> *dev)
>   if (ret)
>   return ret;
>   plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
> -  "clock-frequency", -1);
> +  "clock-frequency", DEFAULT_CLK_SPEED);
>   plat->reg_shift = 2;
>  
>   return 0;
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 06/13] cmd: Convert CONFIG_CMD_ELF to Kconfig

2015-09-28 Thread Bin Meng
Convert CONFIG_CMD_ELF to Kconfig and tidy up affected boards.

Signed-off-by: Bin Meng 

---

Changes in v2:
- Split the defconfig reorder to another patch, making this patch
  as CONFIG_CMD_ELF mods only
- Update sparc and avr32 boards to unset CONFIG_CMD_ELF

 common/Kconfig  | 6 ++
 configs/atngw100_defconfig  | 1 +
 configs/atngw100mkii_defconfig  | 1 +
 configs/atstk1002_defconfig | 1 +
 configs/dbau1000_defconfig  | 1 +
 configs/dbau1100_defconfig  | 1 +
 configs/dbau1500_defconfig  | 1 +
 configs/dbau1550_defconfig  | 1 +
 configs/dbau1550_el_defconfig   | 1 +
 configs/dlvision-10g_defconfig  | 1 +
 configs/dlvision_defconfig  | 1 +
 configs/gr_cpci_ax2000_defconfig| 1 +
 configs/gr_ep2s60_defconfig | 1 +
 configs/gr_xc3s_1500_defconfig  | 1 +
 configs/grasshopper_defconfig   | 1 +
 configs/grsim_defconfig | 1 +
 configs/grsim_leon2_defconfig   | 1 +
 configs/io_defconfig| 1 +
 configs/iocon_defconfig | 1 +
 configs/neo_defconfig   | 1 +
 configs/pb1000_defconfig| 1 +
 configs/sandbox_defconfig   | 1 +
 configs/vct_platinum_onenand_small_defconfig| 1 +
 configs/vct_platinum_small_defconfig| 1 +
 configs/vct_platinumavc_onenand_small_defconfig | 1 +
 configs/vct_platinumavc_small_defconfig | 1 +
 configs/vct_premium_onenand_small_defconfig | 1 +
 configs/vct_premium_small_defconfig | 1 +
 include/config_cmd_all.h| 1 -
 include/config_distro_defaults.h| 1 -
 include/configs/B4860QDS.h  | 1 -
 include/configs/BSC9131RDB.h| 1 -
 include/configs/BSC9132QDS.h| 1 -
 include/configs/C29XPCIE.h  | 1 -
 include/configs/CPCI2DP.h   | 1 -
 include/configs/CPCI4052.h  | 1 -
 include/configs/M5208EVBE.h | 1 -
 include/configs/M52277EVB.h | 1 -
 include/configs/M5235EVB.h  | 1 -
 include/configs/M5272C3.h   | 1 -
 include/configs/M5275EVB.h  | 1 -
 include/configs/M53017EVB.h | 1 -
 include/configs/M5329EVB.h  | 1 -
 include/configs/M5373EVB.h  | 1 -
 include/configs/M54418TWR.h | 1 -
 include/configs/M54451EVB.h | 1 -
 include/configs/M54455EVB.h | 1 -
 include/configs/M5475EVB.h  | 1 -
 include/configs/M5485EVB.h  | 1 -
 include/configs/MIP405.h| 1 -
 include/configs/MPC8536DS.h | 1 -
 include/configs/MPC8540ADS.h| 1 -
 include/configs/MPC8541CDS.h| 1 -
 include/configs/MPC8544DS.h | 1 -
 include/configs/MPC8548CDS.h| 1 -
 include/configs/MPC8555CDS.h| 1 -
 include/configs/MPC8560ADS.h| 1 -
 include/configs/MPC8568MDS.h| 1 -
 include/configs/MPC8569MDS.h| 1 -
 include/configs/MPC8572DS.h | 1 -
 include/configs/P1010RDB.h  | 1 -
 include/configs/P1022DS.h   | 1 -
 include/configs/P2041RDB.h  | 1 -
 include/configs/PIP405.h| 1 -
 include/configs/PLU405.h| 1 -
 include/configs/PMC405DE.h  | 1 -
 include/configs/PMC440.h| 1 -
 include/configs/T102xQDS.h  | 1 -
 include/configs/T102xRDB.h  | 1 -
 include/configs/T1040QDS.h  | 1 -
 include/configs/T104xRDB.h  | 1 -
 include/configs/T208xQDS.h  | 1 -
 include/configs/T208xRDB.h  | 1 -
 include/configs/T4240RDB.h  | 1 -
 include/configs/TQM823L.h   | 1 -
 include/configs/TQM823M.h   | 1 -
 include/configs/TQM850L.h   | 1 -
 include/configs/TQM850M.h   | 1 -
 include/configs/TQM855L.h   | 1 -
 include/configs/TQM855M.h   | 1 -
 include/configs/TQM860L.h   | 1 -
 include/configs/TQM860M.h   | 1 -
 include/configs/TQM862L.h   | 1 -
 include/configs/TQM862M.h   | 1 -
 include/configs/TQM866M.h   | 1 -
 include/configs/UCP1020.h  

[U-Boot] [PATCH v2 07/13] cmd: Clean up cmd_elf a little bit

2015-09-28 Thread Bin Meng
This commit cleans up cmd_elf.c per U-Boot coding convention,
and removes the unnecessary DECLARE_GLOBAL_DATA_PTR and out-of-date
powerpc comments (it actually supports not only powerpc targets).

Signed-off-by: Bin Meng 
Reviewed-by: Tom Rini 
---

Changes in v2: None

 common/cmd_elf.c | 171 ---
 1 file changed, 73 insertions(+), 98 deletions(-)

diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index 22475dc..c5e4432 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -14,23 +14,17 @@
  */
 
 #include 
-#include 
 #include 
-#include 
-#include 
 #include 
+#include 
 #include 
 
-#if defined(CONFIG_WALNUT) || defined(CONFIG_SYS_VXWORKS_MAC_PTR)
-DECLARE_GLOBAL_DATA_PTR;
-#endif
-
 static unsigned long load_elf_image_phdr(unsigned long addr);
 static unsigned long load_elf_image_shdr(unsigned long addr);
 
 /* Allow ports to override the default behavior */
 static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]),
-  int argc, char * const argv[])
+int argc, char * const argv[])
 {
unsigned long ret;
 
@@ -54,18 +48,16 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, 
char * const[]),
return ret;
 }
 
-/* ==
+/*
  * Determine if a valid ELF image exists at the given memory location.
- * First looks at the ELF header magic field, the makes sure that it is
- * executable and makes sure that it is for a PowerPC.
- * == */
+ * First look at the ELF header magic field, then make sure that it is
+ * executable.
+ */
 int valid_elf_image(unsigned long addr)
 {
-   Elf32_Ehdr *ehdr;   /* Elf header structure pointer */
-
-   /* -- */
+   Elf32_Ehdr *ehdr; /* Elf header structure pointer */
 
-   ehdr = (Elf32_Ehdr *) addr;
+   ehdr = (Elf32_Ehdr *)addr;
 
if (!IS_ELF(*ehdr)) {
printf("## No elf image at address 0x%08lx\n", addr);
@@ -77,27 +69,17 @@ int valid_elf_image(unsigned long addr)
return 0;
}
 
-#if 0
-   if (ehdr->e_machine != EM_PPC) {
-   printf("## Not a PowerPC elf image at address 0x%08lx\n", addr);
-   return 0;
-   }
-#endif
-
return 1;
 }
 
-/* ==
- * Interpreter command to boot an arbitrary ELF image from memory.
- * == */
+/* Interpreter command to boot an arbitrary ELF image from memory */
 int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-   unsigned long addr; /* Address of the ELF image */
-   unsigned long rc;   /* Return value from user code  */
+   unsigned long addr; /* Address of the ELF image */
+   unsigned long rc; /* Return value from user code */
char *sload, *saddr;
const char *ep = getenv("autostart");
 
-   /* -- */
int rcode = 0;
 
sload = saddr = NULL;
@@ -138,28 +120,27 @@ int do_bootelf(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
rcode = 1;
 
printf("## Application terminated, rc = 0x%lx\n", rc);
+
return rcode;
 }
 
-/* ==
+/*
  * Interpreter command to boot VxWorks from a memory image.  The image can
  * be either an ELF image or a raw binary.  Will attempt to setup the
  * bootline and other parameters correctly.
- * == */
+ */
 int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-   unsigned long addr; /* Address of image*/
-   unsigned long bootaddr; /* Address to put the bootline */
-   char *bootline; /* Text of the bootline*/
-   char *tmp;  /* Temporary char pointer  */
-   char build_buf[128];/* Buffer for building the bootline */
-
-   /* ---
-*
+   unsigned long addr; /* Address of image */
+   unsigned long bootaddr; /* Address to put the bootline */
+   char *bootline; /* Text of the bootline */
+   char *tmp; /* Temporary char pointer */
+   char build_buf[128]; /* Buffer for building the bootline */
+
+   /*
 * Check the loadaddr variable.
 * If we don't know where the image is then we're done.
 */
-
if (argc < 2)
addr = load_addr;
else
@@ -167,7 +148,8 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])

[U-Boot] [PATCH v2 05/13] x86: Remove quotation mark in CONFIG_HOSTNAME

2015-09-28 Thread Bin Meng
CONFIG_HOSTNAME is an environment varible, so that quotation mark
is not needed.

Signed-off-by: Bin Meng 

---

Changes in v2:
- New patch to remove quotation mark in CONFIG_HOSTNAME

 include/configs/x86-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/x86-common.h b/include/configs/x86-common.h
index 3f153f2..44765f6 100644
--- a/include/configs/x86-common.h
+++ b/include/configs/x86-common.h
@@ -217,7 +217,7 @@
 
 /* Default environment */
 #define CONFIG_ROOTPATH"/opt/nfsroot"
-#define CONFIG_HOSTNAME"x86"
+#define CONFIG_HOSTNAMEx86
 #define CONFIG_BOOTFILE"bzImage"
 #define CONFIG_LOADADDR0x100
 
-- 
1.8.2.1

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


[U-Boot] [PATCH v2 03/13] x86: Initialize GDT entry 1 to be the 32-bit CS as well

2015-09-28 Thread Bin Meng
Some OS (like VxWorks) requires GDT entry 1 to be the 32-bit CS.

Signed-off-by: Bin Meng 
Tested-by: Jian Luo 
---

Changes in v2: None

 arch/x86/cpu/cpu.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index 1b76ca1..812c5e4 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -142,7 +142,12 @@ void arch_setup_gd(gd_t *new_gd)
 
gdt_addr = new_gd->arch.gdt;
 
-   /* CS: code, read/execute, 4 GB, base 0 */
+   /*
+* CS: code, read/execute, 4 GB, base 0
+*
+* Some OS (like VxWorks) requires GDT entry 1 to be the 32-bit CS
+*/
+   gdt_addr[X86_GDT_ENTRY_UNUSED] = GDT_ENTRY(0xc09b, 0, 0xf);
gdt_addr[X86_GDT_ENTRY_32BIT_CS] = GDT_ENTRY(0xc09b, 0, 0xf);
 
/* DS: data, read/write, 4 GB, base 0 */
-- 
1.8.2.1

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


[U-Boot] [PATCH v2 04/13] x86: Move install_e820_map() out of zimage.c

2015-09-28 Thread Bin Meng
install_e820_map() has nothing to do with zimage related codes.
Move it to a dedicated place.

Signed-off-by: Bin Meng 

---

Changes in v2:
- New patch to move install_e820_map() out of zimage.c

 arch/x86/include/asm/e820.h   |  3 +++
 arch/x86/include/asm/zimage.h |  3 ---
 arch/x86/lib/Makefile |  1 +
 arch/x86/lib/e820.c   | 37 +
 arch/x86/lib/zimage.c | 26 --
 5 files changed, 41 insertions(+), 29 deletions(-)
 create mode 100644 arch/x86/lib/e820.c

diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h
index 21bc633..351f021 100644
--- a/arch/x86/include/asm/e820.h
+++ b/arch/x86/include/asm/e820.h
@@ -23,4 +23,7 @@ struct e820entry {
 
 #endif /* __ASSEMBLY__ */
 
+/* Implementation defined function to install an e820 map */
+unsigned install_e820_map(unsigned max_entries, struct e820entry *);
+
 #endif /* _ASM_X86_E820_H */
diff --git a/arch/x86/include/asm/zimage.h b/arch/x86/include/asm/zimage.h
index bf351ed..94fa2a7 100644
--- a/arch/x86/include/asm/zimage.h
+++ b/arch/x86/include/asm/zimage.h
@@ -31,9 +31,6 @@
 #define BZIMAGE_LOAD_ADDR  0x10
 #define ZIMAGE_LOAD_ADDR   0x1
 
-/* Implementation defined function to install an e820 map. */
-unsigned install_e820_map(unsigned max_entries, struct e820entry *);
-
 struct boot_params *load_zimage(char *image, unsigned long kernel_size,
ulong *load_addressp);
 int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 6ecd6db..169062e 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_CMD_BOOTM) += bootm.o
 obj-y  += cmd_boot.o
 obj-$(CONFIG_HAVE_FSP) += cmd_hob.o
 obj-$(CONFIG_EFI) += efi/
+obj-y  += e820.o
 obj-y  += gcc.o
 obj-y  += init_helpers.o
 obj-y  += interrupts.o
diff --git a/arch/x86/lib/e820.c b/arch/x86/lib/e820.c
new file mode 100644
index 000..5babfde
--- /dev/null
+++ b/arch/x86/lib/e820.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2015, Bin Meng 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Install a default e820 table with 4 entries as follows:
+ *
+ * 0x00-0x0a   Useable RAM
+ * 0x0a-0x10   Reserved for ISA
+ * 0x10-gd->ram_size   Useable RAM
+ * CONFIG_PCIE_ECAM_BASE   PCIe ECAM
+ */
+__weak unsigned install_e820_map(unsigned max_entries,
+struct e820entry *entries)
+{
+   entries[0].addr = 0;
+   entries[0].size = ISA_START_ADDRESS;
+   entries[0].type = E820_RAM;
+   entries[1].addr = ISA_START_ADDRESS;
+   entries[1].size = ISA_END_ADDRESS - ISA_START_ADDRESS;
+   entries[1].type = E820_RESERVED;
+   entries[2].addr = ISA_END_ADDRESS;
+   entries[2].size = gd->ram_size - ISA_END_ADDRESS;
+   entries[2].type = E820_RAM;
+   entries[3].addr = CONFIG_PCIE_ECAM_BASE;
+   entries[3].size = CONFIG_PCIE_ECAM_SIZE;
+   entries[3].type = E820_RESERVED;
+
+   return 4;
+}
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index a1ec57e..1b33c77 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -42,32 +42,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define COMMAND_LINE_SIZE  2048
 
-/*
- * Install a default e820 table with 3 entries as follows:
- *
- * 0x00-0x0a   Useable RAM
- * 0x0a-0x10   Reserved for ISA
- * 0x10-gd->ram_size   Useable RAM
- */
-__weak unsigned install_e820_map(unsigned max_entries,
-struct e820entry *entries)
-{
-   entries[0].addr = 0;
-   entries[0].size = ISA_START_ADDRESS;
-   entries[0].type = E820_RAM;
-   entries[1].addr = ISA_START_ADDRESS;
-   entries[1].size = ISA_END_ADDRESS - ISA_START_ADDRESS;
-   entries[1].type = E820_RESERVED;
-   entries[2].addr = ISA_END_ADDRESS;
-   entries[2].size = gd->ram_size - ISA_END_ADDRESS;
-   entries[2].type = E820_RAM;
-   entries[3].addr = CONFIG_PCIE_ECAM_BASE;
-   entries[3].size = CONFIG_PCIE_ECAM_SIZE;
-   entries[3].type = E820_RESERVED;
-
-   return 4;
-}
-
 static void build_command_line(char *command_line, int auto_boot)
 {
char *env_command_line;
-- 
1.8.2.1

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


[U-Boot] [PATCH v2 10/13] cmd: bootvx: Always get VxWorks bootline from env

2015-09-28 Thread Bin Meng
So far VxWorks bootline can be contructed from various environment
variables, but when these variables do not exist we get these from
corresponding config macros. This is not helpful as it requires
rebuilding U-Boot, and to make sure these config macros take effect
we should not have these environment variables. This is a little
bit complex and confusing.

Now we change the logic to always contruct the bootline from
environments (the only single source), by adding two new variables
"bootdev" and "othbootargs", and adding some comments about network
related settings mentioning they are optional. The doc about the
bootline handling is also updated.

Signed-off-by: Bin Meng 
Reviewed-by: Tom Rini 
---

Changes in v2: None

 README|  12 +-
 common/cmd_elf.c  | 121 +++---
 include/vxworks.h |  22 --
 3 files changed, 72 insertions(+), 83 deletions(-)

diff --git a/README b/README
index a13705a..7ed85d2 100644
--- a/README
+++ b/README
@@ -794,18 +794,10 @@ The following options need to be configured:
 - vxWorks boot parameters:
 
bootvx constructs a valid bootline using the following
-   environments variables: bootfile, ipaddr, serverip, hostname.
+   environments variables: bootdev, bootfile, ipaddr, netmask,
+   serverip, gatewayip, hostname, othbootargs.
It loads the vxWorks image pointed bootfile.
 
-   CONFIG_SYS_VXWORKS_BOOT_DEVICE - The vxworks device name
-   CONFIG_SYS_VXWORKS_MAC_PTR - Ethernet 6 byte MA -address
-   CONFIG_SYS_VXWORKS_SERVERNAME - Name of the server
-   CONFIG_SYS_VXWORKS_BOOT_ADDR - Address of boot parameters
-
-   CONFIG_SYS_VXWORKS_ADD_PARAMS
-
-   Add it at the end of the bootline. E.g "u=username pw=secret"
-
Note: If a "bootargs" environment is defined, it will overwride
the defaults discussed just above.
 
diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index 9e6aa01..b71da25 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -256,68 +256,89 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
 
/*
 * Use bootaddr to find the location in memory that VxWorks
-* will look for the bootline string. The default value for
-* PowerPC is LOCAL_MEM_LOCAL_ADRS + BOOT_LINE_OFFSET which
-* defaults to 0x4200.
+* will look for the bootline string. The default value is
+* (LOCAL_MEM_LOCAL_ADRS + BOOT_LINE_OFFSET) as defined by
+* VxWorks BSP. For example, on PowerPC it defaults to 0x4200.
 */
tmp = getenv("bootaddr");
-   if (!tmp)
-   bootaddr = CONFIG_SYS_VXWORKS_BOOT_ADDR;
-   else
+   if (!tmp) {
+   printf("## VxWorks bootline address not specified\n");
+   } else {
bootaddr = simple_strtoul(tmp, NULL, 16);
 
-   /*
-* Check to see if the bootline is defined in the 'bootargs'
-* parameter. If it is not defined, we may be able to
-* construct the info.
-*/
-   bootline = getenv("bootargs");
-   if (bootline) {
-   memcpy((void *)bootaddr, bootline,
-  max(strlen(bootline), (size_t)255));
-   flush_cache(bootaddr, max(strlen(bootline), (size_t)255));
-   } else {
-   sprintf(build_buf, CONFIG_SYS_VXWORKS_BOOT_DEVICE);
-   tmp = getenv("bootfile");
-   if (tmp)
-   sprintf(_buf[strlen(build_buf)],
-   "%s:%s ", CONFIG_SYS_VXWORKS_SERVERNAME, tmp);
-   else
-   sprintf(_buf[strlen(build_buf)],
-   "%s:file ", CONFIG_SYS_VXWORKS_SERVERNAME);
+   /*
+* Check to see if the bootline is defined in the 'bootargs'
+* parameter. If it is not defined, we may be able to
+* construct the info.
+*/
+   bootline = getenv("bootargs");
+   if (bootline) {
+   memcpy((void *)bootaddr, bootline,
+  max(strlen(bootline), (size_t)255));
+   flush_cache(bootaddr, max(strlen(bootline),
+ (size_t)255));
+   } else {
+   tmp = getenv("bootdev");
+   if (tmp)
+   sprintf(build_buf, tmp);
+   else
+   printf("## VxWorks boot device not 
specified\n");
 
-   tmp = getenv("ipaddr");
-   if (tmp) {
-   sprintf(_buf[strlen(build_buf)], "e=%s", tmp);
-   tmp = getenv("netmask");
+   tmp = getenv("bootfile");
 

[U-Boot] [PATCH v2 12/13] cmd: bootvx: Add asmlinkage to the VxWorks x86 entry

2015-09-28 Thread Bin Meng
VxWorks on x86 uses stack to pass parameters.

Reported-by: Jian Luo 
Signed-off-by: Bin Meng 

---

Changes in v2:
- New patch to add asmlinkage to the VxWorks x86 entry

 common/cmd_elf.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index 1c5bf0d..fdf0b4a 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -20,6 +20,7 @@
 #include 
 #ifdef CONFIG_X86
 #include 
+#include 
 #endif
 
 /*
@@ -384,7 +385,12 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
printf("## Starting vxWorks at 0x%08lx ...\n", addr);
 
dcache_disable();
+#ifdef CONFIG_X86
+   /* VxWorks on x86 uses stack to pass parameters */
+   ((asmlinkage void (*)(int))addr)(0);
+#else
((void (*)(int))addr)(0);
+#endif
 
puts("## vxWorks terminated\n");
 
-- 
1.8.2.1

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


[U-Boot] [PATCH v2 11/13] cmd: bootvx: Pass E820 information to an x86 VxWorks kernel

2015-09-28 Thread Bin Meng
E820 is critical to the kernel as it provides system memory map
information. Pass it to an x86 VxWorks kernel.

Signed-off-by: Bin Meng 
Reviewed-by: Tom Rini 
Tested-by: Jian Luo 
---

Changes in v2: None

 common/cmd_elf.c  | 30 ++
 include/vxworks.h | 29 +
 2 files changed, 59 insertions(+)

diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index b71da25..1c5bf0d 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -18,6 +18,9 @@
 #include 
 #include 
 #include 
+#ifdef CONFIG_X86
+#include 
+#endif
 
 /*
  * A very simple elf loader, assumes the image is valid, returns the
@@ -213,6 +216,10 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
char *bootline; /* Text of the bootline */
char *tmp; /* Temporary char pointer */
char build_buf[128]; /* Buffer for building the bootline */
+#ifdef CONFIG_X86
+   struct e820info *info;
+   struct e820entry *data;
+#endif
 
/*
 * Check the loadaddr variable.
@@ -341,6 +348,29 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
   (char *)bootaddr);
}
 
+#ifdef CONFIG_X86
+   /*
+* Since E820 information is critical to the kernel, if we don't
+* specify these in the environments, use a default one.
+*/
+   tmp = getenv("e820data");
+   if (tmp)
+   data = (struct e820entry *)simple_strtoul(tmp, NULL, 16);
+   else
+   data = (struct e820entry *)VXWORKS_E820_DATA_ADDR;
+   tmp = getenv("e820info");
+   if (tmp)
+   info = (struct e820info *)simple_strtoul(tmp, NULL, 16);
+   else
+   info = (struct e820info *)VXWORKS_E820_INFO_ADDR;
+
+   memset(info, 0, sizeof(struct e820info));
+   info->sign = E820_SIGNATURE;
+   info->entries = install_e820_map(E820MAX, data);
+   info->addr = (info->entries - 1) * sizeof(struct e820entry) +
+VXWORKS_E820_DATA_ADDR;
+#endif
+
/*
 * If the data at the load address is an elf image, then
 * treat it like an elf image. Otherwise, assume that it is a
diff --git a/include/vxworks.h b/include/vxworks.h
index 297a70f..f69b008 100644
--- a/include/vxworks.h
+++ b/include/vxworks.h
@@ -8,6 +8,35 @@
 #ifndef _VXWORKS_H_
 #define _VXWORKS_H_
 
+/*
+ * VxWorks x86 E820 related stuff
+ *
+ * VxWorks on x86 gets E820 information from pre-defined address @
+ * 0x4a00 and 0x4000. At 0x4a00 it's an information table defined
+ * by VxWorks and the actual E820 table entries starts from 0x4000.
+ * As defined by the BIOS E820 spec, the maximum number of E820 table
+ * entries is 128 and each entry occupies 20 bytes, so it's 128 * 20
+ * = 2560 (0xa00) bytes in total. That's where VxWorks stores some
+ * information that is retrieved from the BIOS E820 call and saved
+ * later for sanity test during the kernel boot-up.
+ */
+#define VXWORKS_E820_DATA_ADDR 0x4000
+#define VXWORKS_E820_INFO_ADDR 0x4a00
+
+/* E820 info signatiure "SMAP" - System MAP */
+#define E820_SIGNATURE 0x534d4150
+
+struct e820info {
+   u32 sign;   /* "SMAP" signature */
+   u32 x0; /* don't care, used by VxWorks */
+   u32 x1; /* don't care, used by VxWorks */
+   u32 x2; /* don't care, used by VxWorks */
+   u32 addr;   /* last e820 table entry addr */
+   u32 x3; /* don't care, used by VxWorks */
+   u32 entries;/* e820 table entry count */
+   u32 error;  /* must be zero */
+};
+
 int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 void boot_prep_vxworks(bootm_headers_t *images);
 void boot_jump_vxworks(bootm_headers_t *images);
-- 
1.8.2.1

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


[U-Boot] [PATCH v2 08/13] cmd: elf: Reorder load_elf_image_phdr() and load_elf_image_shdr()

2015-09-28 Thread Bin Meng
Move load_elf_image_phdr() and load_elf_image_shdr() to the beginning
of the cmd_elf.c so that forward declaration is not needed.

Signed-off-by: Bin Meng 
Reviewed-by: Tom Rini 
---

Changes in v2: None

 common/cmd_elf.c | 161 +++
 1 file changed, 79 insertions(+), 82 deletions(-)

diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index c5e4432..62863df 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -19,8 +19,85 @@
 #include 
 #include 
 
-static unsigned long load_elf_image_phdr(unsigned long addr);
-static unsigned long load_elf_image_shdr(unsigned long addr);
+/*
+ * A very simple elf loader, assumes the image is valid, returns the
+ * entry point address.
+ */
+static unsigned long load_elf_image_phdr(unsigned long addr)
+{
+   Elf32_Ehdr *ehdr; /* Elf header structure pointer */
+   Elf32_Phdr *phdr; /* Program header structure pointer */
+   int i;
+
+   ehdr = (Elf32_Ehdr *)addr;
+   phdr = (Elf32_Phdr *)(addr + ehdr->e_phoff);
+
+   /* Load each program header */
+   for (i = 0; i < ehdr->e_phnum; ++i) {
+   void *dst = (void *)(uintptr_t)phdr->p_paddr;
+   void *src = (void *)addr + phdr->p_offset;
+   debug("Loading phdr %i to 0x%p (%i bytes)\n",
+ i, dst, phdr->p_filesz);
+   if (phdr->p_filesz)
+   memcpy(dst, src, phdr->p_filesz);
+   if (phdr->p_filesz != phdr->p_memsz)
+   memset(dst + phdr->p_filesz, 0x00,
+  phdr->p_memsz - phdr->p_filesz);
+   flush_cache((unsigned long)dst, phdr->p_filesz);
+   ++phdr;
+   }
+
+   return ehdr->e_entry;
+}
+
+static unsigned long load_elf_image_shdr(unsigned long addr)
+{
+   Elf32_Ehdr *ehdr; /* Elf header structure pointer */
+   Elf32_Shdr *shdr; /* Section header structure pointer */
+   unsigned char *strtab = 0; /* String table pointer */
+   unsigned char *image; /* Binary image pointer */
+   int i; /* Loop counter */
+
+   ehdr = (Elf32_Ehdr *)addr;
+
+   /* Find the section header string table for output info */
+   shdr = (Elf32_Shdr *)(addr + ehdr->e_shoff +
+(ehdr->e_shstrndx * sizeof(Elf32_Shdr)));
+
+   if (shdr->sh_type == SHT_STRTAB)
+   strtab = (unsigned char *)(addr + shdr->sh_offset);
+
+   /* Load each appropriate section */
+   for (i = 0; i < ehdr->e_shnum; ++i) {
+   shdr = (Elf32_Shdr *)(addr + ehdr->e_shoff +
+(i * sizeof(Elf32_Shdr)));
+
+   if (!(shdr->sh_flags & SHF_ALLOC) ||
+   shdr->sh_addr == 0 || shdr->sh_size == 0) {
+   continue;
+   }
+
+   if (strtab) {
+   debug("%sing %s @ 0x%08lx (%ld bytes)\n",
+ (shdr->sh_type == SHT_NOBITS) ? "Clear" : "Load",
+  [shdr->sh_name],
+  (unsigned long)shdr->sh_addr,
+  (long)shdr->sh_size);
+   }
+
+   if (shdr->sh_type == SHT_NOBITS) {
+   memset((void *)(uintptr_t)shdr->sh_addr, 0,
+  shdr->sh_size);
+   } else {
+   image = (unsigned char *)addr + shdr->sh_offset;
+   memcpy((void *)(uintptr_t)shdr->sh_addr,
+  (const void *)image, shdr->sh_size);
+   }
+   flush_cache(shdr->sh_addr, shdr->sh_size);
+   }
+
+   return ehdr->e_entry;
+}
 
 /* Allow ports to override the default behavior */
 static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]),
@@ -253,86 +330,6 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
return 1;
 }
 
-/*
- * A very simple elf loader, assumes the image is valid, returns the
- * entry point address.
- */
-static unsigned long load_elf_image_phdr(unsigned long addr)
-{
-   Elf32_Ehdr *ehdr; /* Elf header structure pointer */
-   Elf32_Phdr *phdr; /* Program header structure pointer */
-   int i;
-
-   ehdr = (Elf32_Ehdr *)addr;
-   phdr = (Elf32_Phdr *)(addr + ehdr->e_phoff);
-
-   /* Load each program header */
-   for (i = 0; i < ehdr->e_phnum; ++i) {
-   void *dst = (void *)(uintptr_t)phdr->p_paddr;
-   void *src = (void *)addr + phdr->p_offset;
-   debug("Loading phdr %i to 0x%p (%i bytes)\n",
- i, dst, phdr->p_filesz);
-   if (phdr->p_filesz)
-   memcpy(dst, src, phdr->p_filesz);
-   if (phdr->p_filesz != phdr->p_memsz)
-   memset(dst + phdr->p_filesz, 0x00,
-  phdr->p_memsz - phdr->p_filesz);
-   

Re: [U-Boot] [PATCH] board/BuR/kwb: implement board-specific do_go_exec to form vxWorks bootline

2015-09-28 Thread Bin Meng
Hi Hannes,

On Mon, Sep 28, 2015 at 5:17 PM, Hannes Schmelzer
 wrote:
>> Hi Hannes,
> Hi Bin,
> thanks for reply.
>
>>
>> On Mon, Sep 28, 2015 at 4:33 PM, Hannes Schmelzer 
> wrote:
>> > Since we don't have for sure a valid IP-setup during
>> > board_late_init(...) because it maybe allready stored in environment
> or
>> > not, we cannot form a proper vxWorks bootline at this place.
>> >
>> > So we move to the way, forming the bootline just before
>> > executing/launching vxWorks with "go ".
>> > At this time we have a valid IP-setup for sure because it is either in
>> > environment or defined through CONFIG_PREBOOT command.
>> >
>> > To do this, we overload the __weak function "do_go_exec(...)" with our
>> > own and do the job.
>> >
>> > Signed-off-by: Hannes Schmelzer 
>> >
>>
>> I don't understand the technical details here on this board, but can
>> we use the generic 'bootvx' command to handle the VxWorks bootline?
>
> At first i had a look to this, but unfortunately it is not useable for my
> case, because we are passing
> serveral things more through the bootline to our vxWorks kernel.
> Especially o=... contains several information like framebuffer address,
> factory-settings address and so on.
> Further we have FTP-Filesystem, so we pass additional arguments (
> u=vxWorksFTP pw=vxWorks).
>

Could you please try this patch series [1] instead?

With that series, we can construct VxWorks bootline from U-Boot env.
Like you can store your additional bootline info to U-Boot env
variable "othbootargs", like

=> setenv othbootargs u=vxWorksFTP pw=vxWorks o=fb_addr=xxx factory_setting=yyy


[1] http://patchwork.ozlabs.org/patch/523276/

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


Re: [U-Boot] [PATCH] arm, at91: small updates for the smartweb board

2015-09-28 Thread Heiko Schocher

Hello Andreas,

Am 28.09.2015 um 10:51 schrieb Andreas Bießmann:

Hi Heiko,


Am 25.09.2015 um 13:17 schrieb Heiko Schocher :

- add CONFIG_BOOT_RETRY_TIME to 30
- fex LED colors
- fix button pressed combination
- add
  CONFIG_USB_HOST_ETHER
  CONFIG_USB_ETHER_ASIX
  CONFIG_USB_ETHER_MCS7830
- change U-Boot prompt to "U-Boot> "

Signed-off-by: Heiko Schocher 
Signed-off-by: Matthias Michel 
---
$ ./tools/buildman/buildman -b 20150923 at91
WARNING: no status info for 'dra72_evm'
WARNING: no maintainers for 'dra72_evm'
WARNING: no status info for 'am335x_gp_evm'
WARNING: no maintainers for 'am335x_gp_evm'
WARNING: no status info for 'hikey'
WARNING: no maintainers for 'hikey'
Building 5 commits for 61 boards (8 threads, 1 job per thread)
Cloning repo for thread 0
Cloning repo for thread 1
Cloning repo for thread 2
Cloning repo for thread 3
Cloning repo for thread 4
Cloning repo for thread 5
Cloning repo for thread 6
Cloning repo for thread 7
  30500 /305axm

board/siemens/smartweb/smartweb.c | 25 ++---
include/configs/smartweb.h|  5 +
2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/board/siemens/smartweb/smartweb.c 
b/board/siemens/smartweb/smartweb.c
index 2d42488..d82f1b7 100644
--- a/board/siemens/smartweb/smartweb.c
+++ b/board/siemens/smartweb/smartweb.c
@@ -90,7 +90,8 @@ static void smartweb_macb_hw_init(void)
pin_to_mask(AT91_PIN_PA17) |
pin_to_mask(AT91_PIN_PA25) |
pin_to_mask(AT91_PIN_PA26) |
-pin_to_mask(AT91_PIN_PA28),
+pin_to_mask(AT91_PIN_PA28) |
+pin_to_mask(AT91_PIN_PA29),
>pudr);

at91_phy_reset();
@@ -101,7 +102,8 @@ static void smartweb_macb_hw_init(void)
pin_to_mask(AT91_PIN_PA17) |
pin_to_mask(AT91_PIN_PA25) |
pin_to_mask(AT91_PIN_PA26) |
-pin_to_mask(AT91_PIN_PA28),
+pin_to_mask(AT91_PIN_PA28) |
+pin_to_mask(AT91_PIN_PA29),
>puer);

/* Initialize EMAC=MACB hardware */
@@ -141,13 +143,6 @@ int board_early_init_f(void)

int board_init(void)
{
-/* Adress of boot parameters */
-gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
-
-smartweb_nand_hw_init();
-#ifdef CONFIG_MACB
-smartweb_macb_hw_init();
-#endif
/* power LED red */
at91_set_gpio_output(AT91_PIN_PC6, 0);
at91_set_gpio_output(AT91_PIN_PC7, 1);
@@ -163,6 +158,13 @@ int board_init(void)
at91_udc_probe(_udc_data);
#endif

+/* Adress of boot parameters */
+gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+
+smartweb_nand_hw_init();
+#ifdef CONFIG_MACB
+smartweb_macb_hw_init();
+#endif
return 0;
}

@@ -197,6 +199,7 @@ void matrix_init(void)

void spl_board_init(void)
{
+/* power LED orange */
at91_set_gpio_output(AT91_PIN_PC6, 1);
at91_set_gpio_output(AT91_PIN_PC7, 1);
/* alarm LED orange */
@@ -212,8 +215,8 @@ void spl_board_init(void)

/* check if both  button are pressed */
if (at91_get_gpio_value(AT91_PIN_PA28) == 0 &&
-at91_get_gpio_value(AT91_PIN_PA29) == 0) {
-debug("Recovery button pressed\n");
+at91_get_gpio_value(AT91_PIN_PA29) == 0) {
+smartweb_nand_hw_init();
nand_init();
spl_nand_erase_one(0, 0);
}
diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h
index d189c3f..fbb66d5 100644
--- a/include/configs/smartweb.h
+++ b/include/configs/smartweb.h
@@ -117,6 +117,9 @@
  *
  */
#define CONFIG_MACB
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_ASIX
+#define CONFIG_USB_ETHER_MCS7830
#define CONFIG_RMII/* use reduced MII inteface */
#define CONFIG_NET_RETRY_COUNT20  /* # of DHCP/BOOTP retries */
#define CONFIG_AT91_WANTS_COMMON_PHY
@@ -182,6 +185,8 @@
/* General Boot Parameter */
#define CONFIG_BOOTDELAY3
#define CONFIG_BOOTCOMMAND"run flashboot"
+#define CONFIG_BOOT_RETRY_TIME  30
+#define CONFIG_SYS_PROMPT"U-Boot> "


could you please use KConfig for at least the SYS_PROMPT setting?


fixed. Removed this line from the patch, as SYS_PROMPT is already
correct in the smartweb_defconfig.

bye,
Heiko


Andreas


#define CONFIG_SYS_CBSIZE512
#define CONFIG_SYS_MAXARGS16
#define CONFIG_SYS_PBSIZE \
--
2.1.0

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




--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >