Re: [U-Boot] [PATCH v2 7/7] arm: ls102xa: Add SD boot support for LS1021ATWR board

2014-10-15 Thread Huan Wang
Hi, York,

> On 09/26/2014 03:33 AM, Alison Wang wrote:
> > This patch adds SD boot support for LS1021ATWR board. SPL framework
> is
> > used. PBL initialize the internal RAM and copy SPL to it, then SPL
> > initialize DDR using SPD and copy u-boot from SD card to DDR, finally
> > SPL transfer control to u-boot.
> >
> > Signed-off-by: Chen Lu 
> > Signed-off-by: Alison Wang 
> > Signed-off-by: Jason Jin 
> > ---
> > Change log:
> >  v2: Use generic u-boot-spl.lds.
> 
> Please update status and maintainers for this board.
>
[Alison Wang] I will update in v3. Thanks.


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


Re: [U-Boot] [PATCH v2 6/7] arm: ls102xa: Add SD boot support for LS1021AQDS board

2014-10-15 Thread Huan Wang
Hi, York,

> On 09/26/2014 03:33 AM, Alison Wang wrote:
> > This patch adds SD boot support for LS1021AQDS board. SPL framework
> is
> > used. PBL initialize the internal RAM and copy SPL to it, then SPL
> > initialize DDR using SPD and copy u-boot from SD card to DDR, finally
> > SPL transfer control to u-boot.
> >
> > Signed-off-by: Alison Wang 
> > Signed-off-by: Jason Jin 
> > ---
> > Change log:
> >  v2: Use generic u-boot-spl.lds.
> >
> 
> Please update status and maintainers for this board.
> 

[Alison Wang] I will update in v3. Thanks.


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


Re: [U-Boot] buildman: display list of boards with warnings/errors during build?

2014-10-15 Thread Simon Glass
Hi Albert,

On 15 October 2014 08:28, Albert ARIBAUD  wrote:
> Hello,
>
> Apologies if I have missed the answer to my question in
> tools/buildman/README or the buildman -h output.

Also -H which gives the full README.

>
> When buildman runs on a large set of boards (such as when I run
> 'tools/buildman/buildman -k aarch64 arm') it shows a summary of how
> many boards so far have built fine, built with warnings and built with
> errors, which is good, and a list of notes, warnings and errors emitted
> by the compiler so far, which is good when building branches. But when
> building architectures, as I do, I would prefer that buildman just list
> the boards that have failed clean building (and list them again when
> invoked with -s)
>
> Did I just miss the option or option combination which produces this,
> or should I go and patch buildman to add such an option?

Does -l do what you want?

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


Re: [U-Boot] [PATCH 1/2][v3] fsl_sec: Add hardware accelerated SHA256 and SHA1

2014-10-15 Thread Simon Glass
Hi,

On 15 October 2014 08:05, Ruchika Gupta  wrote:
> SHA-256 and SHA-1 accelerated using SEC hardware in Freescale SoC's
> The driver for SEC (CAAM) IP is based on linux drivers/crypto/caam.
> The platforms needto add the MACRO CONFIG_FSL_CAAM inorder to
> enable initialization of this hardware IP.
>
> Signed-off-by: Ruchika Gupta 
> CC: York Sun 
> ---
> Changes from v2:
> CAAM init was earlier enabled by default for all platforms with SEC > 4.
> Restricting it to platforms which want to enable CAAM
>
> Changes from v1:
> Added a common function run_descriptor_jr to avoid repetition
> of common code

Are you able to plumb this into hash.c? See hash_algo[].

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


Re: [U-Boot] [PATCH 0/3] Serial Flash: call spi_flash_free more coherently

2014-10-15 Thread Jagan Teki
On 10 October 2014 16:53, Valentin Longchamp
 wrote:
> Hello Jagannadha,
>
> On 01/21/2014 11:03 AM, Valentin Longchamp wrote:
>> On 09/17/2013 08:46 AM, Valentin Longchamp wrote:
>>> Some board require spi_flash_free to be called after all the accesses,
>>> in order, for instance, to restore the pin multiplexing configuration in
>>> the case where the SPI pins are multiplexed.
>>>
>>> This patch series tries to enhance this. Patch 1 adds spi_flash_free
>>> calls to env_sf so that the SPI interface is always "cleaned up" after
>>> the env read/writes. Patch 2 adds a 'sf release' command that implicitly
>>> calls spi_flash_free and is thus the pendant of 'sf probe'. Patch 3 uses
>>> the 'sf command' for the km_arm board scripts.
>>>
>>>
>>> Valentin Longchamp (3):
>>>   env_sf: generalize call to spi_flash_free after accesses
>>>   cmd_sf: add 'release' command
>>>   km_arm: call 'sf release' in the newenv and update scripts
>>>
>>>  common/cmd_sf.c | 13 -
>>>  common/env_sf.c | 34 --
>>>  include/configs/km/km_arm.h |  6 --
>>>  3 files changed, 32 insertions(+), 21 deletions(-)
>>>
>>
>> I have sent this series 4 months ago and while it is according to patchwork
>> under review I have not received any feedback yet.
>>
>> That would be nice if this goes into the next merge window since they have 
>> been
>> floating around for 4 months now.
>>
>
> Here I ping again ! I have sent this series more than a year ago and you had
> promised me a off list a review "in a few days" at the beginning of march 2014
> ... but I have seen nothing. The only thing that has happened is that the 
> first
> patch of the series was rejected by you.
>
> I don't mind that the patch was rejected. But this is a required patch for us
> and I want it to be mainlined, because I have to rebase it internally for 
> every
> release. Without the feedback about why it was rejected, I cannot however
> improve it and resubmit it.
>
> Can you please review this series and give me a feedback about it ?

Sorry, for long run. Will give my comments soon.

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


Re: [U-Boot] [PATCH 2/2] video: ipu_disp: remove pixclk fixup

2014-10-15 Thread Jeroen Hofstee

Hello Stefano,

On 14-10-14 20:37, Jeroen Hofstee wrote:

The ipu display insists on having a lower_margin smaller
then 2. If this is not the case it will attempt to force
it and adjust the pixclk accordingly. This multiplies pixclk
in Hz with the width and height, since this is typically
a * 10^7 * b * 10^2 * c * 10^2 this will overflow the
uint_32 and make things even worse. Since this is a
bootloader and the adjustment is neglectible, just force
it to two and warn about it.

Cc: Stefano Babic 
Signed-off-by: Jeroen Hofstee 

The lower_margin should be larger then 1 / _not_
smalller then 2 actually.

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


Re: [U-Boot] [PATCH V7] ARM: mx6: Add support for Kosagi Novena

2014-10-15 Thread Sean Cross
On 15/10/2014 12:47, Nikolay Dimitrov wrote:
> Hi Marek,
>
> On 10/15/2014 12:38 AM, Marek Vasut wrote:
>> On Sunday, October 12, 2014 at 08:33:21 AM, Sean Cross wrote:
>>> On 12/10/2014 05:04, Fabio Estevam wrote:
 On Sat, Oct 11, 2014 at 11:21 AM, Sean Cross  wrote:
>> Ok, understood. Just curious: which Ethernet PHY is used on the
>> novena
>> board?
>
> It's the same Micrel PHY used on the Sabrelite, the KSZ9021.

 nitrogen/sabrelite holds Ethernet PHY reset low for 10ms, which is in
 accordance with ksz9021 datasheet.

 Shouldn't we wait 10ms here as well?
>>>
>>> The reference manual for the PHY indicates that you should hold reset
>>> low for 10ms after the supply voltage stabilizes.  So long as it takes
>>> at least 10msto get from the point at which the CPU starts executing
>>> its
>>> ROM code  to the point at which the reset line is toggled, we will
>>> be fine.
>>
>> This definitelly is the case, so I presume we don't need the delay ?
>
> Well, here's how I see the case.
>
> After power on, the PHY unfortunately is out of reset (R20G is DNP,
> imx6 pin pulled high internally after reset). At some unknown point in
> time the CPU reaches novena_spl_setup_iomux_enet(). During all this
> time the PHY is still out of reset. Neither this complies with the
> recommended sequence, and even more doesn't comply if we remove the
> delay.
>
> If we leave the delay as it is currently implemented, the actual reset
> sequence is just delayed (by the time it takes the CPU to reach the
> PHY reset code). At this later point we enforce the proper reset
> sequence: supply rail is obviously now stable, and we keep the PHY
> reset low for the minimum specified time: 10ms.
>
> My understanding is that this is simple and efficient way to guarantee
> that for all different cases (different temperatures, different CPU
> silicon revisions, differently configured drivers/subsystems), the PHY
> reset timing is generated properly, and will be generated properly in
> the future when the code evolves.
>
> Please tell me if I'm missing something.
I generally think we'd be fine without the delay, putting it into reset
in the SPL and pulling it out of reset in U-Boot, but I can understand
the need for future-proofing and clarity.  If someone were to copy the
code from Novena to a new board, they may find the PHY behaving unreliably

If 10ms is the difference between "we ought to be fine" and "we'll
definitely be fine and not surprise anyone", then we should leave the
delay in.


Sean

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


[U-Boot] [PATCH 08/11] fdt: Add ft_system_setup() function for system device tree additions

2014-10-15 Thread Simon Glass
Add an additional function for adding information to the device tree before
booting. This permits additions which are not board-specific.

Signed-off-by: Simon Glass 
---

 README|  9 -
 common/cmd_fdt.c  | 15 +++
 common/image-fdt.c|  6 ++
 include/fdt_support.h | 12 
 include/image.h   |  6 ++
 5 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/README b/README
index 46def00..6ecb3e0 100644
--- a/README
+++ b/README
@@ -670,6 +670,13 @@ The following options need to be configured:
Board code has addition modification that it wants to make
to the flat device tree before handing it off to the kernel
 
+   CONFIG_OF_SYSTEM_SETUP
+
+   Other code has addition modification that it wants to make
+   to the flat device tree before handing it off to the kernel
+   This causes ft_board_setup() to be called before booting the
+   kernel.
+
CONFIG_OF_BOOT_CPU
 
This define fills in the correct boot CPU in the boot
@@ -3401,7 +3408,7 @@ FIT uImage format:
to 128 or 256, although it does not have to be power of 2).
 
default: 4096
-   
+
CONFIG_MTD_UBI_BEB_LIMIT
This option specifies the maximum bad physical eraseblocks UBI
expects on the MTD device (per 1024 eraseblocks). If the
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index 51341ac..ece8bce 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -576,6 +576,18 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
}
}
 #endif
+#ifdef CONFIG_OF_SYSTEM_SETUP
+   /* Call the board-specific fixup routine */
+   else if (strncmp(argv[1], "sys", 3) == 0) {
+   int err = ft_system_setup(working_fdt, gd->bd);
+
+   if (err) {
+   printf("Failed to add system information to FDT: %s\n",
+  fdt_strerror(err));
+   return CMD_RET_FAILURE;
+   }
+   }
+#endif
/* Create a chosen node */
else if (strncmp(argv[1], "cho", 3) == 0) {
unsigned long initrd_start = 0, initrd_end = 0;
@@ -1015,6 +1027,9 @@ static char fdt_help_text[] =
 #ifdef CONFIG_OF_BOARD_SETUP
"fdt boardsetup  - Do board-specific set up\n"
 #endif
+#ifdef CONFIG_OF_SYSTEM_SETUP
+   "fdt systemsetup - Do system-specific set up\n"
+#endif
"fdt move  - Copy the fdt to  and make 
it active\n"
"fdt resize  - Resize fdt to size + padding to 
4k addr\n"
"fdt print   []  - Recursive print starting at 
\n"
diff --git a/common/image-fdt.c b/common/image-fdt.c
index 8fbb0d0..8211ab4 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -476,6 +476,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
goto err;
}
}
+   if (IMAGE_OF_SYSTEM_SETUP) {
+   if (ft_system_setup(blob, gd->bd)) {
+   printf("ERROR: system-specific fdt fixup failed\n");
+   goto err;
+   }
+   }
fdt_fixup_ethernet(blob);
 
/* Delete the old LMB reservation */
diff --git a/include/fdt_support.h b/include/fdt_support.h
index f65ebfa..f916171 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -98,6 +98,18 @@ void ft_board_setup_ex(void *blob, bd_t *bd);
 void ft_cpu_setup(void *blob, bd_t *bd);
 void ft_pci_setup(void *blob, bd_t *bd);
 
+/**
+ * Add system-specific data to the FDT before booting the OS.
+ *
+ * Use CONFIG_SYS_FDT_PAD to ensure there is sufficient space.
+ * This function is called if CONFIG_OF_SYSTEM_SETUP is defined
+ *
+ * @param blob FDT blob to update
+ * @param bd_t Pointer to board data
+ * @return 0 if ok, or -FDT_ERR_... on error
+ */
+int ft_system_setup(void *blob, bd_t *bd);
+
 void set_working_fdt_addr(void *addr);
 int fdt_shrink_to_minimum(void *blob);
 int fdt_increase_size(void *fdt, int add_len);
diff --git a/include/image.h b/include/image.h
index 4347532..2896716 100644
--- a/include/image.h
+++ b/include/image.h
@@ -119,6 +119,12 @@ struct lmb;
 # define IMAGE_OF_BOARD_SETUP  0
 #endif
 
+#ifdef CONFIG_OF_SYSTEM_SETUP
+# define IMAGE_OF_SYSTEM_SETUP 1
+#else
+# define IMAGE_OF_SYSTEM_SETUP 0
+#endif
+
 /*
  * Operating System Codes
  */
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 06/11] fdt: Enhance flashmap function to deal with region properties

2014-10-15 Thread Simon Glass
Flash regions can optionally be compressed or hashed. Add the ability to
read this information from the flashmap.

Signed-off-by: Simon Glass 
---

 include/fdtdec.h | 16 
 lib/fdtdec.c |  8 
 2 files changed, 24 insertions(+)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 11083e2..8e9ebbb 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -580,10 +580,26 @@ const u8 *fdtdec_locate_byte_array(const void *blob, int 
node,
 int fdtdec_decode_region(const void *blob, int node, const char *prop_name,
 fdt_addr_t *basep, fdt_size_t *sizep);
 
+enum fmap_compress_t {
+   FMAP_COMPRESS_NONE,
+   FMAP_COMPRESS_LZO,
+};
+
+enum fmap_hash_t {
+   FMAP_HASH_NONE,
+   FMAP_HASH_SHA1,
+   FMAP_HASH_SHA256,
+};
+
 /* A flash map entry, containing an offset and length */
 struct fmap_entry {
uint32_t offset;
uint32_t length;
+   uint32_t used;  /* Number of bytes used in region */
+   enum fmap_compress_t compress_algo; /* Compression type */
+   enum fmap_hash_t hash_algo; /* Hash algorithm */
+   const uint8_t *hash;/* Hash value */
+   int hash_size;  /* Hash size */
 };
 
 /**
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index f998c21..65911fb 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -704,6 +704,7 @@ int fdtdec_decode_region(const void *blob, int node, const 
char *prop_name,
 int fdtdec_read_fmap_entry(const void *blob, int node, const char *name,
   struct fmap_entry *entry)
 {
+   const char *prop;
u32 reg[2];
 
if (fdtdec_get_int_array(blob, node, "reg", reg, 2)) {
@@ -712,6 +713,13 @@ int fdtdec_read_fmap_entry(const void *blob, int node, 
const char *name,
}
entry->offset = reg[0];
entry->length = reg[1];
+   entry->used = fdtdec_get_int(blob, node, "used", entry->length);
+   prop = fdt_getprop(blob, node, "compress", NULL);
+   entry->compress_algo = prop && !strcmp(prop, "lzo") ?
+   FMAP_COMPRESS_LZO : FMAP_COMPRESS_NONE;
+   prop = fdt_getprop(blob, node, "hash", &entry->hash_size);
+   entry->hash_algo = prop ? FMAP_HASH_SHA256 : FMAP_HASH_NONE;
+   entry->hash = (uint8_t *)prop;
 
return 0;
 }
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 03/11] fdt: Export the fdt_find_or_add_subnode() function

2014-10-15 Thread Simon Glass
This function is useful for ensuring that a node exists. Export it so it
can be used more widely.

Signed-off-by: Simon Glass 
---

 common/fdt_support.c  | 12 +---
 include/fdt_support.h | 12 
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index 3f64156..dc41222 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -112,17 +112,7 @@ int fdt_find_and_setprop(void *fdt, const char *node, 
const char *prop,
return fdt_setprop(fdt, nodeoff, prop, val, len);
 }
 
-/**
- * fdt_find_or_add_subnode - find or possibly add a subnode of a given node
- * @fdt: pointer to the device tree blob
- * @parentoffset: structure block offset of a node
- * @name: name of the subnode to locate
- *
- * fdt_subnode_offset() finds a subnode of the node with a given name.
- * If the subnode does not exist, it will be created.
- */
-static int fdt_find_or_add_subnode(void *fdt, int parentoffset,
-  const char *name)
+int fdt_find_or_add_subnode(void *fdt, int parentoffset, const char *name)
 {
int offset;
 
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 41ce535..c0278d6 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -65,6 +65,18 @@ int fdt_pci_dma_ranges(void *blob, int phb_off, struct 
pci_controller *hose);
 #endif
 
 /**
+ * fdt_find_or_add_subnode() - find or possibly add a subnode of a given node
+ *
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ *
+ * fdt_subnode_offset() finds a subnode of the node with a given name.
+ * If the subnode does not exist, it will be created.
+ */
+int fdt_find_or_add_subnode(void *fdt, int parentoffset, const char *name);
+
+/**
  * Add board-specific data to the FDT before booting the OS.
  *
  * Use CONFIG_SYS_FDT_PAD to ensure there is sufficient space.
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 01/11] fdt: Allow ft_board_setup() to report failure

2014-10-15 Thread Simon Glass
This function can fail if the device tree runs out of space. Rather than
silently booting with an incomplete device tree, allow the failure to be
detected.

Unfortunately this involves changing a lot of places in the code. I have
not changed behvaiour to return an error where one is not currently
returned, to avoid unexpected breakage.

Eventually it would be nice to allow boards to register functions to be
called to update the device tree. This would avoid all the many functions
to do this. However it's not clear yet if this should be done using driver
model or with a linker list. This work is left for later.

Signed-off-by: Simon Glass 
---

 arch/nios2/cpu/fdt.c|  8 ++--
 arch/powerpc/cpu/ppc4xx/fdt.c   |  7 +--
 board/a3m071/a3m071.c   |  4 +++-
 board/a4m072/a4m072.c   |  5 +++--
 board/amcc/canyonlands/canyonlands.c|  6 --
 board/amcc/sequoia/sequoia.c| 13 -
 board/cm5200/cm5200.c   |  4 +++-
 board/compulab/cm_fx6/cm_fx6.c  |  4 +++-
 board/compulab/cm_t54/cm_t54.c  |  4 +++-
 board/davedenx/aria/aria.c  |  4 +++-
 board/esd/cpci405/cpci405.c |  4 +++-
 board/esd/mecp5123/mecp5123.c   |  4 +++-
 board/esd/pmc405de/pmc405de.c   |  4 +++-
 board/esd/pmc440/pmc440.c   |  4 +++-
 board/esd/vme8349/vme8349.c |  4 +++-
 board/exmeritus/hww1u1a/hww1u1a.c   |  4 +++-
 board/freescale/b4860qds/b4860qds.c |  4 +++-
 board/freescale/bsc9131rdb/bsc9131rdb.c |  4 +++-
 board/freescale/bsc9132qds/bsc9132qds.c |  4 +++-
 board/freescale/c29xpcie/c29xpcie.c |  4 +++-
 board/freescale/common/cds_pci_ft.c |  5 +++--
 board/freescale/corenet_ds/corenet_ds.c |  4 +++-
 board/freescale/ls1021aqds/ls1021aqds.c |  4 +++-
 board/freescale/ls1021atwr/ls1021atwr.c |  4 +++-
 board/freescale/ls2085a/ls2085a.c   |  4 +++-
 board/freescale/mpc5121ads/mpc5121ads.c |  4 +++-
 board/freescale/mpc7448hpc2/mpc7448hpc2.c   |  5 +++--
 board/freescale/mpc8308rdb/mpc8308rdb.c |  4 +++-
 board/freescale/mpc8313erdb/mpc8313erdb.c   |  4 +++-
 board/freescale/mpc8315erdb/mpc8315erdb.c   |  4 +++-
 board/freescale/mpc8323erdb/mpc8323erdb.c   |  4 +++-
 board/freescale/mpc832xemds/mpc832xemds.c   |  4 +++-
 board/freescale/mpc8349emds/mpc8349emds.c   |  4 +++-
 board/freescale/mpc8349itx/mpc8349itx.c |  4 +++-
 board/freescale/mpc8360emds/mpc8360emds.c   |  4 +++-
 board/freescale/mpc8360erdk/mpc8360erdk.c   |  4 +++-
 board/freescale/mpc837xemds/mpc837xemds.c   |  4 +++-
 board/freescale/mpc837xerdb/mpc837xerdb.c   |  4 +++-
 board/freescale/mpc8536ds/mpc8536ds.c   |  3 ++-
 board/freescale/mpc8540ads/mpc8540ads.c |  5 +++--
 board/freescale/mpc8544ds/mpc8544ds.c   |  4 +++-
 board/freescale/mpc8560ads/mpc8560ads.c |  5 +++--
 board/freescale/mpc8568mds/mpc8568mds.c |  4 +++-
 board/freescale/mpc8569mds/mpc8569mds.c |  4 +++-
 board/freescale/mpc8572ds/mpc8572ds.c   |  4 +++-
 board/freescale/mpc8610hpcd/mpc8610hpcd.c   |  5 +++--
 board/freescale/mpc8641hpcn/mpc8641hpcn.c   |  5 +++--
 board/freescale/p1010rdb/p1010rdb.c |  4 +++-
 board/freescale/p1022ds/p1022ds.c   |  4 +++-
 board/freescale/p1023rdb/p1023rdb.c |  4 +++-
 board/freescale/p1_p2_rdb/p1_p2_rdb.c   | 18 --
 board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 14 +-
 board/freescale/p1_twr/p1_twr.c |  4 +++-
 board/freescale/p2020come/p2020come.c   |  4 +++-
 board/freescale/p2020ds/p2020ds.c   |  4 +++-
 board/freescale/p2041rdb/p2041rdb.c |  4 +++-
 board/freescale/qemu-ppce500/qemu-ppce500.c |  4 +++-
 board/freescale/t1040qds/t1040qds.c |  4 +++-
 board/freescale/t104xrdb/t104xrdb.c |  4 +++-
 board/freescale/t208xqds/t208xqds.c |  4 +++-
 board/freescale/t208xrdb/t208xrdb.c |  4 +++-
 board/freescale/t4qds/t4240emu.c|  4 +++-
 board/freescale/t4qds/t4240qds.c|  4 +++-
 board/freescale/t4rdb/t4240rdb.c|  4 +++-
 board/galaxy5200/galaxy5200.c   |  4 +++-
 board/gateworks/gw_ventana/gw_ventana.c | 10 ++
 board/gdsys/intip/intip.c   |  4 +++-
 board/gdsys/p1022/controlcenterd.c  |  4 +++-
 board/highbank/highbank.c   |  4 +++-
 board/icecube/icecube.c |  5 +++--
 board/ids/ids8247/ids8247.c |  4 +++-
 board/ids/ids8313/ids8313.c |  4 +++-
 board/ifm/ac14xx/ac14xx.c   |  4 +++-
 board/ifm/o2dnt2/o2dnt2.c   |  4 +++-
 board/intercontrol/digsy_mtc/digsy_mtc.c|  4 +++-
 board/ipek01/ipek01.c   |  4 +++-
 board/jupiter/jupiter.c |  5 +++--
 board/keymile/km82xx/km82xx.c   |  4 +++-
 

[U-Boot] [PATCH 05/11] fdt: Use the correct return types for fdtdec_decode_region()

2014-10-15 Thread Simon Glass
Use the correct FDT data types for this function. Also add more debugging.

Signed-off-by: Simon Glass 
---

 include/fdtdec.h | 10 +-
 lib/fdtdec.c | 19 ---
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 926485e..11083e2 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -573,12 +573,12 @@ const u8 *fdtdec_locate_byte_array(const void *blob, int 
node,
  * @param blob FDT blob
  * @param node node to examine
  * @param prop_namename of property to find
- * @param ptrp returns pointer to region, or NULL if no address
- * @param size returns size of region
- * @return 0 if ok, -1 on error (propery not found)
+ * @param basepReturns base address of region
+ * @param size Returns size of region
+ * @return 0 if ok, -1 on error (property not found)
  */
-int fdtdec_decode_region(const void *blob, int node,
-   const char *prop_name, void **ptrp, size_t *size);
+int fdtdec_decode_region(const void *blob, int node, const char *prop_name,
+fdt_addr_t *basep, fdt_size_t *sizep);
 
 /* A flash map entry, containing an offset and length */
 struct fmap_entry {
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index fd9ef2c..f998c21 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -670,20 +670,25 @@ char *fdtdec_get_config_string(const void *blob, const 
char *prop_name)
return (char *)nodep;
 }
 
-int fdtdec_decode_region(const void *blob, int node,
-   const char *prop_name, void **ptrp, size_t *size)
+int fdtdec_decode_region(const void *blob, int node, const char *prop_name,
+fdt_addr_t *basep, fdt_size_t *sizep)
 {
const fdt_addr_t *cell;
int len;
 
-   debug("%s: %s\n", __func__, prop_name);
+   debug("%s: %s: %s\n", __func__, fdt_get_name(blob, node, NULL),
+ prop_name);
cell = fdt_getprop(blob, node, prop_name, &len);
-   if (!cell || (len != sizeof(fdt_addr_t) * 2))
+   if (!cell || (len < sizeof(fdt_addr_t) * 2)) {
+   debug("cell=%p, len=%d\n", cell, len);
return -1;
+   }
+
+   *basep = fdt_addr_to_cpu(*cell);
+   *sizep = fdt_size_to_cpu(cell[1]);
+   debug("%s: base=%08lx, size=%lx\n", __func__, (ulong)*basep,
+ (ulong)*sizep);
 
-   *ptrp = map_sysmem(fdt_addr_to_cpu(*cell), *size);
-   *size = fdt_size_to_cpu(cell[1]);
-   debug("%s: size=%zx\n", __func__, *size);
return 0;
 }
 
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 02/11] fdt: Report failure of ft_board_setup()

2014-10-15 Thread Simon Glass
Since this function can fail, print a message when it does.

Signed-off-by: Simon Glass 
---

 common/cmd_fdt.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index 5640ded..51341ac 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -566,8 +566,15 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
}
 #ifdef CONFIG_OF_BOARD_SETUP
/* Call the board-specific fixup routine */
-   else if (strncmp(argv[1], "boa", 3) == 0)
-   ft_board_setup(working_fdt, gd->bd);
+   else if (strncmp(argv[1], "boa", 3) == 0) {
+   int err = ft_board_setup(working_fdt, gd->bd);
+
+   if (err) {
+   printf("Failed to add board information to FDT: %s\n",
+  fdt_strerror(err));
+   return CMD_RET_FAILURE;
+   }
+   }
 #endif
/* Create a chosen node */
else if (strncmp(argv[1], "cho", 3) == 0) {
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 04/11] fdt: Add device tree memory bindings

2014-10-15 Thread Simon Glass
From: Michael Pratt 

Support a default memory bank, specified in reg, as well as
board-specific memory banks in subtree board-id nodes.

This allows memory information to be provided in the device tree,
rather than hard-coded in, which will make it simpler to handle
similar devices with different memory banks, as the board-id values
or masks can be used to match devices.

Signed-off-by: Michael Pratt 
Signed-off-by: Simon Glass 
Reviewed-by: Vadim Bendebury 
---

 common/fdt_support.c   |   2 +-
 doc/device-tree-bindings/memory/memory.txt |  67 ++
 include/fdtdec.h   |  34 +
 lib/fdtdec.c   | 107 +
 4 files changed, 209 insertions(+), 1 deletion(-)
 create mode 100644 doc/device-tree-bindings/memory/memory.txt

diff --git a/common/fdt_support.c b/common/fdt_support.c
index dc41222..b792bb4 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -372,7 +372,7 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat,
 /*
  * fdt_pack_reg - pack address and size array into the "reg"-suitable stream
  */
-static int fdt_pack_reg(const void *fdt, void *buf, uint64_t *address,
+int fdt_pack_reg(const void *fdt, void *buf, uint64_t *address,
uint64_t *size, int n)
 {
int i;
diff --git a/doc/device-tree-bindings/memory/memory.txt 
b/doc/device-tree-bindings/memory/memory.txt
new file mode 100644
index 000..321894e
--- /dev/null
+++ b/doc/device-tree-bindings/memory/memory.txt
@@ -0,0 +1,67 @@
+* Memory binding
+
+The memory binding for U-Boot is as in the ePAPR with the following additions:
+
+Optional subnodes can be used defining the memory layout for different board
+ID masks. To match a set of board ids, a board-id node may define match-mask
+and match-value ints to define a mask to apply to the board id, and the value
+that the result should have for the match to be considered valid. The mask
+defaults to -1, meaning that the value must fully match the board id.
+
+If subnodes are present, then the /memory node must define these properties:
+
+- #address-cells: should be 1.
+- #size-cells: should be 0.
+
+Each subnode must define
+
+ reg - board ID or mask for this subnode
+ memory-banks - list of memory banks in the same format as normal
+
+Each subnode may optionally define:
+
+ match-mask - A mask to apply to the board id.  This must be accompanied by
+  match-value.
+ match-value - The required resulting value of the board id mask for the given
+  node to be considered a match.
+ auto-size - Indicates that the value given for a bank is the maximum size,
+each bank is probed to determine its actual size, which may be
+smaller
+
+
+The board id determination is up to the vendor and is not defined by this
+binding.
+
+Example:
+
+memory {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   reg = <0x2000 0x2000
+   0x4000 0x2000
+   0x6000 0x2000
+   0x8000 0x2000>;
+   auto-size;
+   board-id@0 {
+   match-value = <17>;
+   reg = <0x2000 0x2000
+   0x4000 0x2000>;
+   };
+   board-id@1 {
+   match-mask = <2>;
+   match-value = <2>;
+   reg = <0x2000 0x2000
+   0x4000 0x2000
+   0x6000 0x2000
+   0x8000 0x2000
+   0xa000 0x2000
+   0xc000 0x2000
+   0xe000 0x2000>;
+   };
+};
+
+
+This shows a system with the following properties:
+* Default of 2GB of memory, auto-sized, so could be smaller
+* 3.5GB of memory (with no auto-size) if (board id & 2) is 2
+* 1GB of memory (with no auto-size) if board id is 17.
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 2590d30..926485e 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -597,4 +597,38 @@ struct fmap_entry {
  */
 int fdtdec_read_fmap_entry(const void *blob, int node, const char *name,
   struct fmap_entry *entry);
+
+/**
+ * Decode the size of memory
+ *
+ * RAM size is normally set in a /memory node and consists of a list of
+ * (base, size) cells in the 'reg' property. This information is used to
+ * determine the total available memory as well as the address and size
+ * of each bank.
+ *
+ * Optionally the memory configuration can vary depending on a board id,
+ * typically read from strapping resistors or an EEPROM on the board.
+ *
+ * Finally, memory size can be detected (within certain limits) by probing
+ * the available memory. It is safe to do so within the limits provides by
+ * the board's device tree information. This makes it possible to produce
+ * boards with different memory sizes, where the device tree specifies the
+ * ma

[U-Boot] [PATCH 11/11] fdt: Try to use fdt_address_cells()/fdt_size_cells()

2014-10-15 Thread Simon Glass
Use these new functions where possible. They default to a value of 2 so we
cannot use them in some places where we need a default value of 1.

Signed-off-by: Simon Glass 
---

 board/freescale/mpc8641hpcn/mpc8641hpcn.c |  7 +++---
 common/fdt_support.c  | 41 ++-
 2 files changed, 12 insertions(+), 36 deletions(-)

diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c 
b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
index 1ab72f9..94633b5 100644
--- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c
+++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
@@ -123,7 +123,7 @@ int ft_board_setup(void *blob, bd_t *bd)
 {
int off;
u64 *tmp;
-   u32 *addrcells;
+   int addrcells;
 
ft_cpu_setup(blob, bd);
 
@@ -135,12 +135,13 @@ int ft_board_setup(void *blob, bd_t *bd)
 * which is defined by the "reg" property in the soc node.
 */
off = fdt_path_offset(blob, "/soc8641");
-   addrcells = (u32 *)fdt_getprop(blob, 0, "#address-cells", NULL);
+   addrcells = fdt_address_cells(blob, 0);
tmp = (u64 *)fdt_getprop(blob, off, "reg", NULL);
 
if (tmp) {
u64 addr;
-   if (addrcells && (*addrcells == 1))
+
+   if (addrcells == 1)
addr = *(u32 *)tmp;
else
addr = *tmp;
diff --git a/common/fdt_support.c b/common/fdt_support.c
index ee514ae..193ec02 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -16,22 +16,6 @@
 #include 
 #include 
 
-/*
- * Get cells len in bytes
- * if #-cells property is 2 then len is 8
- * otherwise len is 4
- */
-static int get_cells_len(const void *fdt, const char *nr_cells_name)
-{
-   const fdt32_t *cell;
-
-   cell = fdt_getprop(fdt, 0, nr_cells_name, NULL);
-   if (cell && fdt32_to_cpu(*cell) == 2)
-   return 8;
-
-   return 4;
-}
-
 /**
  * fdt_getprop_u32_default_node - Return a node's property or a default
  *
@@ -236,7 +220,7 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong 
initrd_end)
return err;
}
 
-   is_u64 = (get_cells_len(fdt, "#address-cells") == 8);
+   is_u64 = (fdt_address_cells(fdt, 0) == 2);
 
err = fdt_setprop_uxx(fdt, nodeoffset, "linux,initrd-start",
  (uint64_t)initrd_start, is_u64);
@@ -376,18 +360,18 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 
*address, u64 *size,
int n)
 {
int i;
-   int address_len = get_cells_len(fdt, "#address-cells");
-   int size_len = get_cells_len(fdt, "#size-cells");
+   int address_len = fdt_address_cells(fdt, 0);
+   int size_len = fdt_size_cells(fdt, 0);
char *p = buf;
 
for (i = 0; i < n; i++) {
-   if (address_len == 8)
+   if (address_len == 2)
*(fdt64_t *)p = cpu_to_fdt64(address[i]);
else
*(fdt32_t *)p = cpu_to_fdt32(address[i]);
p += address_len;
 
-   if (size_len == 8)
+   if (size_len == 2)
*(fdt64_t *)p = cpu_to_fdt64(size[i]);
else
*(fdt32_t *)p = cpu_to_fdt32(size[i]);
@@ -958,13 +942,8 @@ void of_bus_default_count_cells(void *blob, int 
parentoffset,
 {
const fdt32_t *prop;
 
-   if (addrc) {
-   prop = fdt_getprop(blob, parentoffset, "#address-cells", NULL);
-   if (prop)
-   *addrc = be32_to_cpup(prop);
-   else
-   *addrc = 2;
-   }
+   if (addrc)
+   *addrc = fdt_address_cells(blob, parentoffset);
 
if (sizec) {
prop = fdt_getprop(blob, parentoffset, "#size-cells", NULL);
@@ -1409,11 +1388,7 @@ u64 fdt_get_base_address(void *fdt, int node)
u32 naddr;
const fdt32_t *prop;
 
-   prop = fdt_getprop(fdt, node, "#address-cells", &size);
-   if (prop && size == 4)
-   naddr = be32_to_cpup(prop);
-   else
-   naddr = 2;
+   naddr = fdt_address_cells(fdt, node);
 
prop = fdt_getprop(fdt, node, "ranges", &size);
 
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 09/11] fdt: Change fdt_pack_reg() to static and fix types

2014-10-15 Thread Simon Glass
This function is only called within this file so make it static. Also
fix its argument types to be consistent with its caller.

Signed-off-by: Simon Glass 
---

 common/fdt_support.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index b792bb4..ee514ae 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -372,8 +372,8 @@ void do_fixup_by_compat_u32(void *fdt, const char *compat,
 /*
  * fdt_pack_reg - pack address and size array into the "reg"-suitable stream
  */
-int fdt_pack_reg(const void *fdt, void *buf, uint64_t *address,
-   uint64_t *size, int n)
+static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
+   int n)
 {
int i;
int address_len = get_cells_len(fdt, "#address-cells");
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 07/11] fdt: Tidy up error handling in image_setup_libfdt()

2014-10-15 Thread Simon Glass
The message about needing to reset should be printed no matter what error
is printed. Also, an error should always be printed.

Signed-off-by: Simon Glass 
---

 common/image-fdt.c| 27 +--
 include/fdt_support.h |  1 +
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/common/image-fdt.c b/common/image-fdt.c
index a2342fa..8fbb0d0 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -460,19 +460,22 @@ int image_setup_libfdt(bootm_headers_t *images, void 
*blob,
 {
ulong *initrd_start = &images->initrd_start;
ulong *initrd_end = &images->initrd_end;
-   int ret;
+   int ret = -EPERM;
 
if (fdt_chosen(blob) < 0) {
-   puts("ERROR: /chosen node create failed");
-   puts(" - must RESET the board to recover.\n");
-   return -1;
+   printf("ERROR: /chosen node create failed\n");
+   goto err;
}
if (arch_fixup_fdt(blob) < 0) {
-   puts("ERROR: arch specific fdt fixup failed");
-   return -1;
+   printf("ERROR: arch-specific fdt fixup failed\n");
+   goto err;
+   }
+   if (IMAGE_OF_BOARD_SETUP) {
+   if (ft_board_setup(blob, gd->bd)) {
+   printf("ERROR: board-specific fdt fixup failed\n");
+   goto err;
+   }
}
-   if (IMAGE_OF_BOARD_SETUP)
-   ft_board_setup(blob, gd->bd);
fdt_fixup_ethernet(blob);
 
/* Delete the old LMB reservation */
@@ -481,7 +484,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 
ret = fdt_shrink_to_minimum(blob);
if (ret < 0)
-   return ret;
+   goto err;
of_size = ret;
 
if (*initrd_start && *initrd_end) {
@@ -493,7 +496,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 
fdt_initrd(blob, *initrd_start, *initrd_end);
if (!ft_verify_fdt(blob))
-   return -1;
+   goto err;
 
 #if defined(CONFIG_SOC_KEYSTONE)
if (IMAGE_OF_BOARD_SETUP)
@@ -501,4 +504,8 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 #endif
 
return 0;
+err:
+   printf(" - must RESET the board to recover.\n\n");
+
+   return ret;
 }
diff --git a/include/fdt_support.h b/include/fdt_support.h
index c0278d6..f65ebfa 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -80,6 +80,7 @@ int fdt_find_or_add_subnode(void *fdt, int parentoffset, 
const char *name);
  * Add board-specific data to the FDT before booting the OS.
  *
  * Use CONFIG_SYS_FDT_PAD to ensure there is sufficient space.
+ * This function is called if CONFIG_OF_BOARD_SETUP is defined
  *
  * @param blob FDT blob to update
  * @param bd_t Pointer to board data
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 10/11] fdt: Add a function to decode a named memory region

2014-10-15 Thread Simon Glass
Permit decoding of a named memory region from the device tree. This allows
easy run-time configuration of the address of on-chip SRAM, SDRAM, etc.

Signed-off-by: Simon Glass 
---

 include/fdtdec.h | 28 ++
 lib/fdtdec.c | 61 
 2 files changed, 89 insertions(+)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 8e9ebbb..8122ff2 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -647,4 +647,32 @@ int fdtdec_read_fmap_entry(const void *blob, int node, 
const char *name,
  */
 int fdtdec_decode_ram_size(const void *blob, const char *area, int board_id,
   phys_addr_t *basep, phys_size_t *sizep, bd_t *bd);
+
+/**
+ * Decode a named region within a memory bank of a given type.
+ *
+ * This function handles selection of a memory region. The region is
+ * specified as an offset/size within a particular type of memory.
+ *
+ * The properties used are:
+ *
+ * -memory for the name of the memory bank
+ * -offset for the offset in that bank
+ *
+ * The property value must have an offset and a size. The function checks
+ * that the region is entirely within the memory bank.5
+ *
+ * @param blob FDT blob
+ * @param node Node containing the properties (-1 for /config)
+ * @param mem_type Type of memory to use, which is a name, such as
+ * "u-boot" or "kernel".
+ * @param suffix   String to append to the memory/offset
+ * property names
+ * @param basepReturns base of region
+ * @param sizepReturns size of region
+ * @return 0 if OK, -ive on error
+ */
+int fdtdec_decode_memory_region(const void *blob, int node,
+   const char *mem_type, const char *suffix,
+   fdt_addr_t *basep, fdt_size_t *sizep);
 #endif
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 65911fb..ab1ea77 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -828,4 +828,65 @@ int fdtdec_decode_ram_size(const void *blob, const char 
*area, int board_id,
 
return 0;
 }
+
+int fdtdec_decode_memory_region(const void *blob, int config_node,
+   const char *mem_type, const char *suffix,
+   fdt_addr_t *basep, fdt_size_t *sizep)
+{
+   char prop_name[50];
+   const char *mem;
+   fdt_size_t size, offset_size;
+   fdt_addr_t base, offset;
+   int node;
+
+   if (config_node == -1) {
+   config_node = fdt_path_offset(blob, "/config");
+   if (config_node < 0) {
+   debug("%s: Cannot find /config node\n", __func__);
+   return -ENOENT;
+   }
+   }
+   if (!suffix)
+   suffix = "";
+
+   snprintf(prop_name, sizeof(prop_name), "%s-memory%s", mem_type,
+suffix);
+   mem = fdt_getprop(blob, config_node, prop_name, NULL);
+   if (!mem) {
+   debug("%s: No memory type for '%s', using /memory\n", __func__,
+ prop_name);
+   mem = "/memory";
+   }
+
+   node = fdt_path_offset(blob, mem);
+   if (node < 0) {
+   debug("%s: Failed to find node '%s': %s\n", __func__, mem,
+ fdt_strerror(node));
+   return -ENOENT;
+   }
+
+   /*
+* Not strictly correct - the memory may have multiple banks. We just
+* use the first
+*/
+   if (fdtdec_decode_region(blob, node, "reg", &base, &size)) {
+   debug("%s: Failed to decode memory region %s\n", __func__,
+ mem);
+   return -EINVAL;
+   }
+
+   snprintf(prop_name, sizeof(prop_name), "%s-offset%s", mem_type,
+suffix);
+   if (fdtdec_decode_region(blob, config_node, prop_name, &offset,
+&offset_size)) {
+   debug("%s: Failed to decode memory region '%s'\n", __func__,
+ prop_name);
+   return -EINVAL;
+   }
+
+   *basep = base + offset;
+   *sizep = offset_size;
+
+   return 0;
+}
 #endif
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH] patman: Use the full commit hash for 'git checkout'

2014-10-15 Thread Simon Glass
Even with the initial 8 characeters of the hash we will sometimes get a
collision. Use the full hash.

Signed-off-by: Simon Glass 
---

 tools/buildman/control.py   | 2 +-
 tools/patman/patchstream.py | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 8b8c826..96ba2d9 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -70,7 +70,7 @@ def ShowActions(series, why_selected, boards_selected, 
builder, options):
 if commits:
 for upto in range(0, len(series.commits), options.step):
 commit = series.commits[upto]
-print '   ', col.Color(col.YELLOW, commit.hash, bright=False),
+print '   ', col.Color(col.YELLOW, commit.hash[:8], bright=False),
 print commit.subject
 print
 for arg in why_selected:
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index d630157..da04883 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -248,8 +248,7 @@ class PatchStream:
 # Detect the start of a new commit
 elif commit_match:
 self.CloseCommit()
-# TODO: We should store the whole hash, and just display a subset
-self.commit = commit.Commit(commit_match.group(1)[:8])
+self.commit = commit.Commit(commit_match.group(1))
 
 # Detect tags in the commit message
 elif tag_match:
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v9 0/12] Enable driver model for GPIOs on Tegra and Exynos

2014-10-15 Thread Simon Glass
(Note: Tegra patches have been applied, I am resending with exynos only)

Now that driver model is part of U-Boot, the task of converting drivers over
to it begins. GPIO is one of the easiest to convert, since it already has a
sandbox driver and a uclass driver.

The Tegra GPIO driver is relatively simple since it has a linear numbering
and already uses the generic GPIO framework. Each GPIO bank has a separate
device. Some arguments have been made that a single device should support
all the GPIO banks, but currently the driver model uclass does not work that
way and it would require a second-level data structure to handle the bank
feature.

This driver has been tested on:

- Seaboard (Tegra 20)
- Beaver (Tegra 30)
- Jetson-TK1 (Tegra 124).

I don't have a Tegra 114 board (Dalmore seems to be the only one with U-Boot
support) but I am quite confident that it works.

For exynos, the pinctrl device tree files are brought in from the kernel
and cut down to remove the groupings which we don't yet use. Very small
additions are made to avoid replicating the awful tables that Linux has
for every exynos SoC. This series sits on top of the exynos refactors.

The 'gpio' command is updated to support display of only the allocated
GPIOs. This is much more friendly than displaying a large table.

A few related clean-ups are provided as well.

This series is available at u-boot-dm.git, branch working.

Changes in v9:
- Change compatible string to s5pc110-pinctrl for s5p_goni
- Add missing compatible strings from exynos_gpio_ids[]

Changes in v8:
- Adjust odroid device tree file to use #include instead of /include/
- Add missing special case reg property for exynos5420 GPX0
- Add patch containing pinctrl settings for s5p_goni
- Add patch containing pinctrl settings for s5p_goni
- Add new patch to move smdkc100 to generic board
- Add new patch to move s5p_goni to generic board
- Enable driver model for smdkc100 and s5p_goni separately

Changes in v7:
- Bring in patches from the SPI series to move post-reloc DM init earlier

Changes in v6:
- Fix typo in compatible string
- Remove exynos5420.dtsi which is not used in U-Boot
- Move U-Boot changes into their own file
- Use exynos54xx everywhere instead of exynos5420

Changes in v5:
- Put this patch before the others to avoid breaking bisectability
- Add additional gpio_request() calls for other samsung boards
- Use a mask instead of division in gpio_request() naming call
- Remove RFC label now that build errors are fixed
- Tidy up and update cover letter message
- Avoid reordering functions

Changes in v4:
- Add patches for exynos GPIO support

Simon Glass (12):
  dm: exynos: dts: Convert /include/ to #include
  dm: exynos: Bring in pinctrl dts files from Linux kernel
  dm: exynos: dts: Remove unused pinctrl information to save space
  dm: exynos: dts: Adjust device tree files for U-Boot
  dm: exynos: Add pinctrl settings for smdkc100
  dm: exynos: Add pinctrl settings for s5p_goni
  dm: exynos: Move smdkc100 to generic board
  dm: exynos: Move s5p_goni to generic board
  dm: exynos: Tidy up GPIO headers
  dm: exynos: Tidy up GPIO defines
  dm: exynos: Make sure that GPIOs are requested
  dm: exynos: gpio: Convert to driver model

 arch/arm/cpu/armv7/exynos/pinmux.c |   5 +-
 arch/arm/dts/exynos4.dtsi  |   9 +-
 arch/arm/dts/exynos4210-origen.dts |   4 +-
 arch/arm/dts/exynos4210-pinctrl-uboot.dtsi |  27 ++
 arch/arm/dts/exynos4210-pinctrl.dtsi   | 306 
 arch/arm/dts/exynos4210-smdkv310.dts   |   2 +-
 arch/arm/dts/exynos4210-trats.dts  |   2 +-
 arch/arm/dts/exynos4210-universal_c210.dts |   2 +-
 arch/arm/dts/exynos4210.dtsi   | 155 ++
 arch/arm/dts/exynos4412-odroid.dts |   2 +-
 arch/arm/dts/exynos4412-trats2.dts |   2 +-
 arch/arm/dts/exynos4412.dtsi   |  38 +++
 arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi |  46 +++
 arch/arm/dts/exynos4x12-pinctrl.dtsi   | 346 ++
 arch/arm/dts/exynos4x12.dtsi   | 114 
 arch/arm/dts/exynos5.dtsi  |  56 +++-
 arch/arm/dts/exynos5250-pinctrl-uboot.dtsi |  40 +++
 arch/arm/dts/exynos5250-pinctrl.dtsi   | 333 +
 arch/arm/dts/exynos5250-smdk5250.dts   |   2 +-
 arch/arm/dts/exynos5250-snow.dts   |   2 +-
 arch/arm/dts/exynos5250.dtsi   |  40 ++-
 arch/arm/dts/exynos5420-peach-pit.dts  |   2 +-
 arch/arm/dts/exynos5420-smdk5420.dts   |   2 +-
 arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi |  40 +++
 arch/arm/dts/exynos54xx-pinctrl.dtsi   | 305 
 arch/arm/dts/exynos54xx.dtsi   |  44 ++-
 arch/arm/dts/s5pc100-pinctrl.dtsi  | 180 
 arch/arm/dts/s5pc110-pinctrl.dtsi  | 273 ++
 arch/arm/dts/s5pc1xx-goni.dts  |   7 +
 arch/arm/dts/s5pc1xx-smdkc100.dts  |   7 +
 arch/arm/include/asm/arch-exynos/gpio.h|   5 -
 arch/arm/include

[U-Boot] [PATCH v9 08/12] dm: exynos: Move s5p_goni to generic board

2014-10-15 Thread Simon Glass
The generic board deadline is approaching, and we need this feature to
enable driver model. Enable CONFIG_SYS_GENERIC_BOARD for s5p_goni.

Signed-off-by: Simon Glass 
---

Changes in v9: None
Changes in v8:
- Add new patch to move s5p_goni to generic board

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None

 include/configs/s5p_goni.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index 0c6e9c7..fa0e737 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -286,4 +286,6 @@
 
 #define CONFIG_OF_LIBFDT
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 #endif /* __CONFIG_H */
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v9 05/12] dm: exynos: Add pinctrl settings for smdkc100

2014-10-15 Thread Simon Glass
These describe the GPIOs in enough detail for U-Boot's GPIO driver to
operate.

Signed-off-by: Simon Glass 
---

Changes in v9: None
Changes in v8:
- Add patch containing pinctrl settings for s5p_goni

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None

 arch/arm/dts/s5pc100-pinctrl.dtsi | 180 ++
 arch/arm/dts/s5pc1xx-smdkc100.dts |   7 ++
 2 files changed, 187 insertions(+)
 create mode 100644 arch/arm/dts/s5pc100-pinctrl.dtsi

diff --git a/arch/arm/dts/s5pc100-pinctrl.dtsi 
b/arch/arm/dts/s5pc100-pinctrl.dtsi
new file mode 100644
index 000..bd9f97c
--- /dev/null
+++ b/arch/arm/dts/s5pc100-pinctrl.dtsi
@@ -0,0 +1,180 @@
+/*
+ * U-Boot additions to enable a generic Exynos GPIO driver
+ *
+ * Copyright (c) 2014 Google, Inc
+ */
+
+/ {
+   pinctrl@e030 {
+   gpa0: gpa0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpa1: gpa1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpb: gpb {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpc: gpc {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpd: gpd {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpe0: gpe0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpe1: gpe1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpf0: gpf0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpf1: gpf1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpf2: gpf2 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpf3: gpf3 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpg0: gpg0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpg1: gpg1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpg2: gpg2 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpg3: gpg3 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpi: gpi {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpj0: gpj0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpj1: gpj1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpj2: gpj2 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpj3: gpj3 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpj4: gpj4 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpk0: gpk0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpk1: gpk1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpk2: gpk2 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpk3: gpk3 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpl0: gpl0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpl1: gpl1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpl2: gpl2 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpl3: gpl3 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpl4: gpl4 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gph0: gph0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+

[U-Boot] [PATCH v9 01/12] dm: exynos: dts: Convert /include/ to #include

2014-10-15 Thread Simon Glass
We should be consistent about this. The kernel has moved to #include
which breaks error reporting to some extent but does allow us to include
binding files.

Signed-off-by: Simon Glass 
---

Changes in v9: None
Changes in v8:
- Adjust odroid device tree file to use #include instead of /include/

Changes in v7: None
Changes in v6: None
Changes in v5:
- Put this patch before the others to avoid breaking bisectability

Changes in v4: None

 arch/arm/dts/exynos4.dtsi  | 2 +-
 arch/arm/dts/exynos4210-origen.dts | 4 ++--
 arch/arm/dts/exynos4210-smdkv310.dts   | 2 +-
 arch/arm/dts/exynos4210-trats.dts  | 2 +-
 arch/arm/dts/exynos4210-universal_c210.dts | 2 +-
 arch/arm/dts/exynos4412-odroid.dts | 2 +-
 arch/arm/dts/exynos4412-trats2.dts | 2 +-
 arch/arm/dts/exynos5.dtsi  | 2 +-
 arch/arm/dts/exynos5250-smdk5250.dts   | 2 +-
 arch/arm/dts/exynos5250-snow.dts   | 2 +-
 arch/arm/dts/exynos5250.dtsi   | 2 +-
 arch/arm/dts/exynos5420-peach-pit.dts  | 2 +-
 arch/arm/dts/exynos5420-smdk5420.dts   | 2 +-
 arch/arm/dts/exynos54xx.dtsi   | 2 +-
 14 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/arm/dts/exynos4.dtsi b/arch/arm/dts/exynos4.dtsi
index 110eb43..6b83516 100644
--- a/arch/arm/dts/exynos4.dtsi
+++ b/arch/arm/dts/exynos4.dtsi
@@ -7,7 +7,7 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
serial@1380 {
diff --git a/arch/arm/dts/exynos4210-origen.dts 
b/arch/arm/dts/exynos4210-origen.dts
index 15059d2..556a3a2 100644
--- a/arch/arm/dts/exynos4210-origen.dts
+++ b/arch/arm/dts/exynos4210-origen.dts
@@ -8,8 +8,8 @@
  */
 
 /dts-v1/;
-/include/ "skeleton.dtsi"
-/include/ "exynos4.dtsi"
+#include "skeleton.dtsi"
+#include "exynos4.dtsi"
 
 / {
model = "Insignal Origen evaluation board based on Exynos4210";
diff --git a/arch/arm/dts/exynos4210-smdkv310.dts 
b/arch/arm/dts/exynos4210-smdkv310.dts
index c390c8f..00cad04 100644
--- a/arch/arm/dts/exynos4210-smdkv310.dts
+++ b/arch/arm/dts/exynos4210-smdkv310.dts
@@ -7,7 +7,7 @@
  */
 
 /dts-v1/;
-/include/ "exynos4.dtsi"
+#include "exynos4.dtsi"
 
 / {
model = "Samsung SMDKV310 on Exynos4210";
diff --git a/arch/arm/dts/exynos4210-trats.dts 
b/arch/arm/dts/exynos4210-trats.dts
index 0ff6939..71202d0 100644
--- a/arch/arm/dts/exynos4210-trats.dts
+++ b/arch/arm/dts/exynos4210-trats.dts
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "exynos4.dtsi"
+#include "exynos4.dtsi"
 
 / {
model = "Samsung Trats based on Exynos4210";
diff --git a/arch/arm/dts/exynos4210-universal_c210.dts 
b/arch/arm/dts/exynos4210-universal_c210.dts
index 6941906..d30f131 100644
--- a/arch/arm/dts/exynos4210-universal_c210.dts
+++ b/arch/arm/dts/exynos4210-universal_c210.dts
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "exynos4.dtsi"
+#include "exynos4.dtsi"
 
 / {
model = "Samsung Universal C210 based on Exynos4210 rev0";
diff --git a/arch/arm/dts/exynos4412-odroid.dts 
b/arch/arm/dts/exynos4412-odroid.dts
index 24d0bf1..4c5e2b3 100644
--- a/arch/arm/dts/exynos4412-odroid.dts
+++ b/arch/arm/dts/exynos4412-odroid.dts
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "exynos4.dtsi"
+#include "exynos4.dtsi"
 
 / {
model = "Odroid based on Exynos4412";
diff --git a/arch/arm/dts/exynos4412-trats2.dts 
b/arch/arm/dts/exynos4412-trats2.dts
index cc58c87..9d22de7 100644
--- a/arch/arm/dts/exynos4412-trats2.dts
+++ b/arch/arm/dts/exynos4412-trats2.dts
@@ -8,7 +8,7 @@
  */
 
 /dts-v1/;
-/include/ "exynos4.dtsi"
+#include "exynos4.dtsi"
 
 / {
model = "Samsung Trats2 based on Exynos4412";
diff --git a/arch/arm/dts/exynos5.dtsi b/arch/arm/dts/exynos5.dtsi
index a2b533a..329a89a 100644
--- a/arch/arm/dts/exynos5.dtsi
+++ b/arch/arm/dts/exynos5.dtsi
@@ -5,7 +5,7 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-/include/ "skeleton.dtsi"
+#include "skeleton.dtsi"
 
 / {
compatible = "samsung,exynos5";
diff --git a/arch/arm/dts/exynos5250-smdk5250.dts 
b/arch/arm/dts/exynos5250-smdk5250.dts
index 9020382..8850409 100644
--- a/arch/arm/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/dts/exynos5250-smdk5250.dts
@@ -10,7 +10,7 @@
 */
 
 /dts-v1/;
-/include/ "exynos5250.dtsi"
+#include "exynos5250.dtsi"
 
 / {
model = "SAMSUNG SMDK5250 board based on EXYNOS5250";
diff --git a/arch/arm/dts/exynos5250-snow.dts b/arch/arm/dts/exynos5250-snow.dts
index ab4f2f8..2003412 100644
--- a/arch/arm/dts/exynos5250-snow.dts
+++ b/arch/arm/dts/exynos5250-snow.dts
@@ -10,7 +10,7 @@
 */
 
 /dts-v1/;
-/include/ "exynos5250.dtsi"
+#include "exynos5250.dtsi"
 
 / {
model = "Google Snow";
diff --git a/arch/arm/dts/exynos5250.dtsi b/arch/arm/dts/exynos5250.dtsi
index 0c644e7..771f8d3 100644
--- a/arch/arm/dts/exynos5250.dtsi
+++ b/arch/arm/dts/exynos5250.dtsi
@@ -5,7 +5,7 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-/include/ "exynos5.dtsi"
+#include "exynos5.dtsi"
 
 / {

[U-Boot] [PATCH v9 03/12] dm: exynos: dts: Remove unused pinctrl information to save space

2014-10-15 Thread Simon Glass
We don't include the pinctrl functions for U-Boot as they use up quite
a bit of space and are not used.

We could instead perhaps eliminate this material with fdtgrep, but so far
this tool has not made it to upstream.

Signed-off-by: Simon Glass 
---

Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None

 arch/arm/dts/exynos4210-pinctrl.dtsi | 543 ---
 arch/arm/dts/exynos4x12-pinctrl.dtsi | 612 ---
 arch/arm/dts/exynos4x12.dtsi | 100 --
 arch/arm/dts/exynos5250-pinctrl.dtsi | 459 --
 arch/arm/dts/exynos54xx-pinctrl.dtsi | 384 --
 5 files changed, 2098 deletions(-)

diff --git a/arch/arm/dts/exynos4210-pinctrl.dtsi 
b/arch/arm/dts/exynos4210-pinctrl.dtsi
index a7c2128..bda17f7 100644
--- a/arch/arm/dts/exynos4210-pinctrl.dtsi
+++ b/arch/arm/dts/exynos4210-pinctrl.dtsi
@@ -144,281 +144,6 @@
#interrupt-cells = <2>;
};
 
-   uart0_data: uart0-data {
-   samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <0x2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart0_fctl: uart0-fctl {
-   samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart1_data: uart1-data {
-   samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart1_fctl: uart1-fctl {
-   samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   i2c2_bus: i2c2-bus {
-   samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart2_data: uart2-data {
-   samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart2_fctl: uart2-fctl {
-   samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart_audio_a: uart-audio-a {
-   samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   i2c3_bus: i2c3-bus {
-   samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart3_data: uart3-data {
-   samsung,pins = "gpa1-4", "gpa1-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   uart_audio_b: uart-audio-b {
-   samsung,pins = "gpa1-4", "gpa1-5";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
-   };
-
-   spi0_bus: spi0-bus {
-   samsung,pins = "gpb-0", "gpb-2", "gpb-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
-   };
-
-   i2c4_bus: i2c4-bus {
-   samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
-   };
-
-   spi1_bus: spi1-bus {
-   samsung,pins = "gpb-4", "gpb-6", "gpb-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
-   };
-
-   i2c5_bus: i2c5-bus {
-   samsung,pins = "gpb-6", "gpb-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
- 

[U-Boot] [PATCH v9 07/12] dm: exynos: Move smdkc100 to generic board

2014-10-15 Thread Simon Glass
The generic board deadline is approaching, and we need this feature to
enable driver model. Enable CONFIG_SYS_GENERIC_BOARD for smdkc100.

Signed-off-by: Simon Glass 
---

Changes in v9: None
Changes in v8:
- Add new patch to move smdkc100 to generic board

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None

 include/configs/smdkc100.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/smdkc100.h b/include/configs/smdkc100.h
index 22835ff..a7eb33e 100644
--- a/include/configs/smdkc100.h
+++ b/include/configs/smdkc100.h
@@ -223,4 +223,6 @@
 
 #define CONFIG_OF_LIBFDT
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 #endif /* __CONFIG_H */
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v9 06/12] dm: exynos: Add pinctrl settings for s5p_goni

2014-10-15 Thread Simon Glass
These describe the GPIOs in enough detail for U-Boot's GPIO driver to
operate.

Signed-off-by: Simon Glass 
---

Changes in v9:
- Change compatible string to s5pc110-pinctrl for s5p_goni

Changes in v8:
- Add patch containing pinctrl settings for s5p_goni

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None

 arch/arm/dts/s5pc110-pinctrl.dtsi | 273 ++
 arch/arm/dts/s5pc1xx-goni.dts |   7 +
 2 files changed, 280 insertions(+)
 create mode 100644 arch/arm/dts/s5pc110-pinctrl.dtsi

diff --git a/arch/arm/dts/s5pc110-pinctrl.dtsi 
b/arch/arm/dts/s5pc110-pinctrl.dtsi
new file mode 100644
index 000..d21b6ab
--- /dev/null
+++ b/arch/arm/dts/s5pc110-pinctrl.dtsi
@@ -0,0 +1,273 @@
+/*
+ * U-Boot additions to enable a generic Exynos GPIO driver
+ *
+ * Copyright (c) 2014 Google, Inc
+ */
+
+/ {
+   pinctrl@e020 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   gpa0: gpa0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpa1: gpa1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpb: gpb {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpc0: gpc0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpc1: gpc1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpd0: gpd0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpd1: gpd1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpe0: gpe0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpe1: gpe1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpf0: gpf0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpf1: gpf1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpf2: gpf2 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpf3: gpf3 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpg0: gpg0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpg1: gpg1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpg2: gpg2 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpg3: gpg3 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpi: gpi {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpj0: gpj0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpj1: gpj1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpj2: gpj2 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpj3: gpj3 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpj4: gpj4 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpmp01: gpmp01 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpmp02: gpmp02 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpmp03: gpmp03 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpmp04: gpmp04 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpmp05: gpmp05 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpmp06: gpmp06 {
+   gpio-controller;
+   #gpio-cells = <2>;
+   };
+
+   gpmp07: gpmp07 {
+   gpio-controller;
+   #gpio-cells = <2>;
+

[U-Boot] [PATCH v9 04/12] dm: exynos: dts: Adjust device tree files for U-Boot

2014-10-15 Thread Simon Glass
The pinctrl bindings used by Linux are an incomplete description of the
hardware. It is possible in most cases to determine the register address
of each, but not in all cases. By adding an additional property we can
fix this, and avoid adding a table to U-Boot for every single Exynos
SOC.

Signed-off-by: Simon Glass 
---

Changes in v9: None
Changes in v8:
- Add missing special case reg property for exynos5420 GPX0

Changes in v7: None
Changes in v6:
- Move U-Boot changes into their own file
- Use exynos54xx everywhere instead of exynos5420

Changes in v5: None
Changes in v4: None

 arch/arm/dts/exynos4210-pinctrl-uboot.dtsi | 27 ++
 arch/arm/dts/exynos4210-pinctrl.dtsi   |  2 ++
 arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi | 46 ++
 arch/arm/dts/exynos4x12-pinctrl.dtsi   |  2 ++
 arch/arm/dts/exynos5250-pinctrl-uboot.dtsi | 40 ++
 arch/arm/dts/exynos5250-pinctrl.dtsi   |  2 ++
 arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi | 40 ++
 arch/arm/dts/exynos54xx-pinctrl.dtsi   |  2 ++
 arch/arm/dts/exynos54xx.dtsi   |  1 +
 9 files changed, 162 insertions(+)
 create mode 100644 arch/arm/dts/exynos4210-pinctrl-uboot.dtsi
 create mode 100644 arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi
 create mode 100644 arch/arm/dts/exynos5250-pinctrl-uboot.dtsi
 create mode 100644 arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi

diff --git a/arch/arm/dts/exynos4210-pinctrl-uboot.dtsi 
b/arch/arm/dts/exynos4210-pinctrl-uboot.dtsi
new file mode 100644
index 000..ee071c1
--- /dev/null
+++ b/arch/arm/dts/exynos4210-pinctrl-uboot.dtsi
@@ -0,0 +1,27 @@
+/*
+ * U-Boot additions to enable a generic Exynos GPIO driver
+ *
+ * Copyright (c) 2014 Google, Inc
+ */
+
+/{
+   pinctrl_0: pinctrl@1140 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "samsung,exynos4210-pinctrl";
+   };
+
+   pinctrl_1: pinctrl@1100 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   gpy0: gpy0 {
+   reg = <0xc00>;
+   };
+   };
+
+   pinctrl_2: pinctrl@0386 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
+
+};
diff --git a/arch/arm/dts/exynos4210-pinctrl.dtsi 
b/arch/arm/dts/exynos4210-pinctrl.dtsi
index bda17f7..87f162b 100644
--- a/arch/arm/dts/exynos4210-pinctrl.dtsi
+++ b/arch/arm/dts/exynos4210-pinctrl.dtsi
@@ -14,6 +14,8 @@
  * published by the Free Software Foundation.
 */
 
+#include "exynos4210-pinctrl-uboot.dtsi"
+
 / {
pinctrl@1140 {
gpa0: gpa0 {
diff --git a/arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi 
b/arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi
new file mode 100644
index 000..c02796d
--- /dev/null
+++ b/arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi
@@ -0,0 +1,46 @@
+/*
+ * U-Boot additions to enable a generic Exynos GPIO driver
+ *
+ * Copyright (c) 2014 Google, Inc
+ */
+
+/{
+   pinctrl_0: pinctrl@1140 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   gpf0: gpf0 {
+   reg = <0xc180>;
+   };
+   gpj0: gpj0 {
+   reg = <0x240>;
+   };
+   };
+
+   pinctrl_1: pinctrl@1100 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   gpk0: gpk0 {
+   reg = <0x40>;
+   };
+   gpm0: gpm0 {
+   reg = <0x260>;
+   };
+   gpy0: gpy0 {
+   reg = <0x120>;
+   };
+   gpx0: gpx0 {
+   reg = <0xc00>;
+   };
+   };
+
+   pinctrl_2: pinctrl@0386 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
+
+   pinctrl_3: pinctrl@106E {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   };
+
+};
diff --git a/arch/arm/dts/exynos4x12-pinctrl.dtsi 
b/arch/arm/dts/exynos4x12-pinctrl.dtsi
index 93f3998..f40de1f 100644
--- a/arch/arm/dts/exynos4x12-pinctrl.dtsi
+++ b/arch/arm/dts/exynos4x12-pinctrl.dtsi
@@ -12,6 +12,8 @@
  * published by the Free Software Foundation.
 */
 
+#include "exynos4x12-pinctrl-uboot.dtsi"
+
 / {
pinctrl@1140 {
gpa0: gpa0 {
diff --git a/arch/arm/dts/exynos5250-pinctrl-uboot.dtsi 
b/arch/arm/dts/exynos5250-pinctrl-uboot.dtsi
new file mode 100644
index 000..7edb0ca
--- /dev/null
+++ b/arch/arm/dts/exynos5250-pinctrl-uboot.dtsi
@@ -0,0 +1,40 @@
+/*
+ * U-Boot additions to enable a generic Exynos GPIO driver
+ *
+ * Copyright (c) 2014 Google, Inc
+ */
+
+/{
+   pinctrl_0: pinctrl@1140 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   gpc4: gpc4 {
+   reg = <0x2e0>;
+   };
+   gpx0: gpx0 {
+  

[U-Boot] [PATCH v9 10/12] dm: exynos: Tidy up GPIO defines

2014-10-15 Thread Simon Glass
The defines at the top of the GPIO driver use single-character names for
parameters which are not very descriptive.

Improve these to use descriptive parameter names.

Signed-off-by: Simon Glass 
---

Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None

 drivers/gpio/s5p_gpio.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index aa60188..99f2dd8 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -11,19 +11,20 @@
 
 #define S5P_GPIO_GET_PIN(x)(x % GPIO_PER_BANK)
 
-#define CON_MASK(x)(0xf << ((x) << 2))
-#define CON_SFR(x, v)  ((v) << ((x) << 2))
+#define CON_MASK(val)  (0xf << ((val) << 2))
+#define CON_SFR(gpio, cfg) ((cfg) << ((gpio) << 2))
+#define CON_SFR_UNSHIFT(val, gpio) ((val) >> ((gpio) << 2))
 
-#define DAT_MASK(x)(0x1 << (x))
-#define DAT_SET(x) (0x1 << (x))
+#define DAT_MASK(gpio) (0x1 << (gpio))
+#define DAT_SET(gpio)  (0x1 << (gpio))
 
-#define PULL_MASK(x)   (0x3 << ((x) << 1))
-#define PULL_MODE(x, v)((v) << ((x) << 1))
+#define PULL_MASK(gpio)(0x3 << ((gpio) << 1))
+#define PULL_MODE(gpio, pull)  ((pull) << ((gpio) << 1))
 
-#define DRV_MASK(x)(0x3 << ((x) << 1))
-#define DRV_SET(x, m)  ((m) << ((x) << 1))
-#define RATE_MASK(x)   (0x1 << (x + 16))
-#define RATE_SET(x)(0x1 << (x + 16))
+#define DRV_MASK(gpio) (0x3 << ((gpio) << 1))
+#define DRV_SET(gpio, mode)((mode) << ((gpio) << 1))
+#define RATE_MASK(gpio)(0x1 << (gpio + 16))
+#define RATE_SET(gpio) (0x1 << (gpio + 16))
 
 #define name_to_gpio(n) s5p_name_to_gpio(n)
 static inline int s5p_name_to_gpio(const char *name)
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH v9 11/12] dm: exynos: Make sure that GPIOs are requested

2014-10-15 Thread Simon Glass
With driver model GPIOs must be requested before use. Make sure this is
done correctly.

(Note that the soft SPI part of universal is omitted, since this driver
is about to be replaced with a driver-model-aware version)

Signed-off-by: Simon Glass 
---

Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5:
- Add additional gpio_request() calls for other samsung boards
- Use a mask instead of division in gpio_request() naming call

Changes in v4: None

 arch/arm/cpu/armv7/exynos/pinmux.c   |  3 +++
 board/samsung/arndale/arndale.c  |  2 ++
 board/samsung/common/misc.c  |  2 ++
 board/samsung/goni/goni.c|  2 ++
 board/samsung/smdk5250/exynos5-dt.c  |  7 +++
 board/samsung/smdk5420/smdk5420.c|  4 
 board/samsung/trats/trats.c  | 15 ---
 board/samsung/trats2/trats2.c| 26 +-
 board/samsung/universal_c210/universal.c |  3 +++
 drivers/mmc/s5p_sdhci.c  |  7 ++-
 10 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 2caeb3e..3d95dc3 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -172,6 +172,9 @@ static int exynos5420_mmc_config(int peripheral, int flags)
 * this same assumption.
 */
if ((peripheral == PERIPH_ID_SDMMC0) && (i == (start + 2))) {
+#ifndef CONFIG_SPL_BUILD
+   gpio_request(i, "sdmmc0_vdden");
+#endif
gpio_set_value(i, 1);
gpio_cfg_pin(i, S5P_GPIO_OUTPUT);
} else {
diff --git a/board/samsung/arndale/arndale.c b/board/samsung/arndale/arndale.c
index e39795d..881d080 100644
--- a/board/samsung/arndale/arndale.c
+++ b/board/samsung/arndale/arndale.c
@@ -19,6 +19,8 @@ int board_usb_init(int index, enum usb_init_type init)
/* Configure gpios for usb 3503 hub:
 * disconnect, toggle reset and connect
 */
+   gpio_request(EXYNOS5_GPIO_D17, "usb_connect");
+   gpio_request(EXYNOS5_GPIO_X35, "usb_reset");
gpio_direction_output(EXYNOS5_GPIO_D17, 0);
gpio_direction_output(EXYNOS5_GPIO_X35, 0);
 
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index b935922..4538ac7 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -411,6 +411,8 @@ void check_boot_mode(void)
 void keys_init(void)
 {
/* Set direction to input */
+   gpio_request(KEY_VOL_UP_GPIO, "volume-up");
+   gpio_request(KEY_VOL_DOWN_GPIO, "volume-down");
gpio_direction_input(KEY_VOL_UP_GPIO);
gpio_direction_input(KEY_VOL_DOWN_GPIO);
 }
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index 01be714..22f4995 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -80,6 +80,7 @@ int board_mmc_init(bd_t *bis)
int i, ret, ret_sd = 0;
 
/* MASSMEMORY_EN: XMSMDATA7: GPJ2[7] output high */
+   gpio_request(S5PC110_GPIO_J27, "massmemory_en");
gpio_direction_output(S5PC110_GPIO_J27, 1);
 
/*
@@ -108,6 +109,7 @@ int board_mmc_init(bd_t *bis)
 * SD card (T_FLASH) detect and init
 * T_FLASH_DETECT: EINT28: GPH3[4] input mode
 */
+   gpio_request(S5PC110_GPIO_H34, "t_flash_detect");
gpio_cfg_pin(S5PC110_GPIO_H34, S5P_GPIO_INPUT);
gpio_set_pull(S5PC110_GPIO_H34, S5P_GPIO_PULL_UP);
 
diff --git a/board/samsung/smdk5250/exynos5-dt.c 
b/board/samsung/smdk5250/exynos5-dt.c
index d6ce133..53ff706 100644
--- a/board/samsung/smdk5250/exynos5-dt.c
+++ b/board/samsung/smdk5250/exynos5-dt.c
@@ -29,6 +29,7 @@ DECLARE_GLOBAL_DATA_PTR;
 static void board_enable_audio_codec(void)
 {
/* Enable MAX98095 Codec */
+   gpio_request(EXYNOS5_GPIO_X17, "max98095_enable");
gpio_direction_output(EXYNOS5_GPIO_X17, 1);
gpio_set_pull(EXYNOS5_GPIO_X17, S5P_GPIO_PULL_NONE);
 }
@@ -199,16 +200,19 @@ static int board_dp_bridge_setup(void)
/* Setup the GPIOs */
 
/* PD is ACTIVE_LOW, and initially de-asserted */
+   gpio_request(EXYNOS5_GPIO_Y25, "dp_bridge_pd");
gpio_set_pull(EXYNOS5_GPIO_Y25, S5P_GPIO_PULL_NONE);
gpio_direction_output(EXYNOS5_GPIO_Y25, 1);
 
/* Reset is ACTIVE_LOW */
+   gpio_request(EXYNOS5_GPIO_X15, "dp_bridge_reset");
gpio_set_pull(EXYNOS5_GPIO_X15, S5P_GPIO_PULL_NONE);
gpio_direction_output(EXYNOS5_GPIO_X15, 0);
 
udelay(10);
gpio_set_value(EXYNOS5_GPIO_X15, 1);
 
+   gpio_request(EXYNOS5_GPIO_X07, "dp_bridge_hpd");
gpio_direction_input(EXYNOS5_GPIO_X07);
 
/*
@@ -236,10 +240,12 @@ static int board_dp_bridge_setup(void)
 void exynos_cfg_lcd_gpio(void)
 {
/* For Backlight */
+   gpio_request(EXYNOS5_GPIO_B20, "lcd_backlight");
gpio_cfg_pin(EXYNOS5_GPIO_B20, 

[U-Boot] [PATCH v9 09/12] dm: exynos: Tidy up GPIO headers

2014-10-15 Thread Simon Glass
The wrong header is being included, thus requiring the code to re-declare
the generic GPIO interface in each GPIO header.

Fix this.

Signed-off-by: Simon Glass 
---

Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None

 arch/arm/cpu/armv7/exynos/pinmux.c   | 2 +-
 arch/arm/include/asm/arch-exynos/gpio.h  | 5 -
 arch/arm/include/asm/arch-s5pc1xx/gpio.h | 4 
 board/samsung/arndale/arndale.c  | 2 +-
 board/samsung/common/board.c | 2 +-
 board/samsung/common/misc.c  | 1 -
 board/samsung/goni/goni.c| 2 +-
 board/samsung/origen/origen.c| 2 +-
 board/samsung/smdk5420/smdk5420.c| 2 +-
 board/samsung/smdkc100/smdkc100.c| 2 +-
 board/samsung/smdkv310/smdkv310.c| 2 +-
 board/samsung/trats/trats.c  | 2 +-
 board/samsung/trats2/trats2.c| 1 +
 board/samsung/universal_c210/universal.c | 1 -
 drivers/gpio/s5p_gpio.c  | 3 +--
 15 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index b929486..2caeb3e 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -7,7 +7,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/arch/arm/include/asm/arch-exynos/gpio.h 
b/arch/arm/include/asm/arch-exynos/gpio.h
index 8fb5c23..ba169b9 100644
--- a/arch/arm/include/asm/arch-exynos/gpio.h
+++ b/arch/arm/include/asm/arch-exynos/gpio.h
@@ -1504,12 +1504,7 @@ static const struct gpio_name_num_table 
exynos5420_gpio_table[] = {
 void gpio_cfg_pin(int gpio, int cfg);
 void gpio_set_pull(int gpio, int mode);
 void gpio_set_drv(int gpio, int mode);
-int gpio_direction_input(unsigned gpio);
-int gpio_direction_output(unsigned gpio, int value);
-int gpio_set_value(unsigned gpio, int value);
-int gpio_get_value(unsigned gpio);
 void gpio_set_rate(int gpio, int mode);
-struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned gpio);
 int s5p_gpio_get_pin(unsigned gpio);
 #endif
 
diff --git a/arch/arm/include/asm/arch-s5pc1xx/gpio.h 
b/arch/arm/include/asm/arch-s5pc1xx/gpio.h
index d5dbc22..bd6f2d2 100644
--- a/arch/arm/include/asm/arch-s5pc1xx/gpio.h
+++ b/arch/arm/include/asm/arch-s5pc1xx/gpio.h
@@ -815,11 +815,7 @@ static const struct gpio_name_num_table 
s5pc110_gpio_table[] = {
 void gpio_cfg_pin(int gpio, int cfg);
 void gpio_set_pull(int gpio, int mode);
 void gpio_set_drv(int gpio, int mode);
-int gpio_direction_output(unsigned gpio, int value);
-int gpio_set_value(unsigned gpio, int value);
-int gpio_get_value(unsigned gpio);
 void gpio_set_rate(int gpio, int mode);
-struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned gpio);
 int s5p_gpio_get_pin(unsigned gpio);
 
 /* GPIO pins per bank  */
diff --git a/board/samsung/arndale/arndale.c b/board/samsung/arndale/arndale.c
index 83fd3bd..e39795d 100644
--- a/board/samsung/arndale/arndale.c
+++ b/board/samsung/arndale/arndale.c
@@ -6,9 +6,9 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index 5c3c5bb..c119641 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -13,10 +13,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 8766f0c..b935922 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -14,7 +14,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index eb0f9bf..01be714 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -7,7 +7,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c
index a539267..99a2fac 100644
--- a/board/samsung/origen/origen.c
+++ b/board/samsung/origen/origen.c
@@ -6,8 +6,8 @@
 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/board/samsung/smdk5420/smdk5420.c 
b/board/samsung/smdk5420/smdk5420.c
index 270ee83..47998ab 100644
--- a/board/samsung/smdk5420/smdk5420.c
+++ b/board/samsung/smdk5420/smdk5420.c
@@ -11,9 +11,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/board/samsung/smdkc100/smdkc100.c 
b/board/samsung/smdkc100/smdkc100.c
index e009564..66b6a98 100644
--- a/board/samsung/smdkc100/smdkc100.c
+++ b/board/samsung/smdkc100/smdkc100.c
@@ -7,9 +7,9 @@
  */
 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/samsung/smdkv310/smdkv310.c 
b/board/samsung/smdkv310/smdkv310.c
index 8eca358

[U-Boot] [PATCH v9 02/12] dm: exynos: Bring in pinctrl dts files from Linux kernel

2014-10-15 Thread Simon Glass
Bring in required device tree files for pinctrl from Linux v3.14. These
are initially unchanged and have a number of pieces not needed by U-Boot.

Note that exynos5420 is renamed to exynos54xx here since we want to
support exynos5422 also.

Signed-off-by: Simon Glass 
---

Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6:
- Fix typo in compatible string
- Remove exynos5420.dtsi which is not used in U-Boot

Changes in v5: None
Changes in v4: None

 arch/arm/dts/exynos4.dtsi  |   7 +
 arch/arm/dts/exynos4210-origen.dts |   2 +-
 arch/arm/dts/exynos4210-pinctrl.dtsi   | 847 +
 arch/arm/dts/exynos4210-trats.dts  |   2 +-
 arch/arm/dts/exynos4210-universal_c210.dts |   2 +-
 arch/arm/dts/exynos4210.dtsi   | 155 +
 arch/arm/dts/exynos4412-trats2.dts |   2 +-
 arch/arm/dts/exynos4412.dtsi   |  38 ++
 arch/arm/dts/exynos4x12-pinctrl.dtsi   | 956 +
 arch/arm/dts/exynos4x12.dtsi   | 214 +++
 arch/arm/dts/exynos5.dtsi  |  54 ++
 arch/arm/dts/exynos5250-pinctrl.dtsi   | 790 
 arch/arm/dts/exynos5250.dtsi   |  38 ++
 arch/arm/dts/exynos54xx-pinctrl.dtsi   | 687 +
 arch/arm/dts/exynos54xx.dtsi   |  41 ++
 15 files changed, 3831 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/exynos4210-pinctrl.dtsi
 create mode 100644 arch/arm/dts/exynos4210.dtsi
 create mode 100644 arch/arm/dts/exynos4412.dtsi
 create mode 100644 arch/arm/dts/exynos4x12-pinctrl.dtsi
 create mode 100644 arch/arm/dts/exynos4x12.dtsi
 create mode 100644 arch/arm/dts/exynos5250-pinctrl.dtsi
 create mode 100644 arch/arm/dts/exynos54xx-pinctrl.dtsi

diff --git a/arch/arm/dts/exynos4.dtsi b/arch/arm/dts/exynos4.dtsi
index 6b83516..77fad48 100644
--- a/arch/arm/dts/exynos4.dtsi
+++ b/arch/arm/dts/exynos4.dtsi
@@ -10,6 +10,13 @@
 #include "skeleton.dtsi"
 
 / {
+   combiner: interrupt-controller@1044 {
+   compatible = "samsung,exynos4210-combiner";
+   #interrupt-cells = <2>;
+   interrupt-controller;
+   reg = <0x1044 0x1000>;
+   };
+
serial@1380 {
compatible = "samsung,exynos4210-uart";
reg = <0x1380 0x3c>;
diff --git a/arch/arm/dts/exynos4210-origen.dts 
b/arch/arm/dts/exynos4210-origen.dts
index 556a3a2..dd2476c 100644
--- a/arch/arm/dts/exynos4210-origen.dts
+++ b/arch/arm/dts/exynos4210-origen.dts
@@ -9,7 +9,7 @@
 
 /dts-v1/;
 #include "skeleton.dtsi"
-#include "exynos4.dtsi"
+#include "exynos4210.dtsi"
 
 / {
model = "Insignal Origen evaluation board based on Exynos4210";
diff --git a/arch/arm/dts/exynos4210-pinctrl.dtsi 
b/arch/arm/dts/exynos4210-pinctrl.dtsi
new file mode 100644
index 000..a7c2128
--- /dev/null
+++ b/arch/arm/dts/exynos4210-pinctrl.dtsi
@@ -0,0 +1,847 @@
+/*
+ * Samsung's Exynos4210 SoC pin-mux and pin-config device tree source
+ *
+ * Copyright (c) 2011-2012 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ * Copyright (c) 2011-2012 Linaro Ltd.
+ * www.linaro.org
+ *
+ * Samsung's Exynos4210 SoC pin-mux and pin-config optiosn are listed as device
+ * tree nodes are listed in this file.
+ *
+ * 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.
+*/
+
+/ {
+   pinctrl@1140 {
+   gpa0: gpa0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   };
+
+   gpa1: gpa1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   };
+
+   gpb: gpb {
+   gpio-controller;
+   #gpio-cells = <2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   };
+
+   gpc0: gpc0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   };
+
+   gpc1: gpc1 {
+   gpio-controller;
+   #gpio-cells = <2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   };
+
+   gpd0: gpd0 {
+   gpio-controller;
+   #gpio-cells = <2>;
+
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   };
+
+   gpd1: gpd1 {
+  

[U-Boot] puts() and newlines (was Re: Discussion topics / issues)

2014-10-15 Thread Pavel Machek
Hi!

> First, we have a compatibility problem here.  GCC assumes that puts()
> will add a newline character after the string; U-Boot puts() does NOT
> do this.  So the GCC auto-converted printf()s will all be wrong, as
> they are missing the newline. [1]

> [1] One might argue that this is a bug in U-Boot and should be fixed,
> but that is another topic.

I believe we should fix that, yes.

I did quick grep,

pavel@duo:~/wagabuibui/u-boot$ grep -ri puts . | wc -l
4287

and that is probably too much to change in one go. So what about this?

Best regards,
 Pavel
---

Introduce __puts() that puts strings without trailing newline. Plan is
to move the existing puts() users into __puts(), when no puts() users
are left, fix the puts() to add the newline, and move users that want
newline back to puts().

Signed-off-by: Pavel Machek 

--- a/include/common.h
+++ b/include/common.h
@@ -836,6 +836,8 @@ int tstc(void);
 /* stdout */
 void   putc(const char c);
 void   puts(const char *s);
+static inline void __puts(const char *s) { puts(s); }
+
 intprintf(const char *fmt, ...)
__attribute__ ((format (__printf__, 1, 2)));
 intvprintf(const char *fmt, va_list args);




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


[U-Boot] [PATCH v9 12/12] dm: exynos: gpio: Convert to driver model

2014-10-15 Thread Simon Glass
Convert the exynos GPIO driver to driver model. This implements the generic
GPIO interface but not the extra Exynos-specific functions.

Signed-off-by: Simon Glass 
---

Changes in v9:
- Add missing compatible strings from exynos_gpio_ids[]

Changes in v8:
- Enable driver model for smdkc100 and s5p_goni separately

Changes in v7:
- Bring in patches from the SPI series to move post-reloc DM init earlier

Changes in v6: None
Changes in v5:
- Remove RFC label now that build errors are fixed
- Tidy up and update cover letter message
- Avoid reordering functions

Changes in v4:
- Add patches for exynos GPIO support

 drivers/gpio/s5p_gpio.c | 424 +++-
 include/configs/exynos-common.h |   4 +
 include/configs/s5p_goni.h  |   3 +
 include/configs/smdkc100.h  |   3 +
 4 files changed, 298 insertions(+), 136 deletions(-)

diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index 99f2dd8..13d74eb 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -6,8 +6,15 @@
  */
 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
 
 #define S5P_GPIO_GET_PIN(x)(x % GPIO_PER_BANK)
 
@@ -26,100 +33,45 @@
 #define RATE_MASK(gpio)(0x1 << (gpio + 16))
 #define RATE_SET(gpio) (0x1 << (gpio + 16))
 
-#define name_to_gpio(n) s5p_name_to_gpio(n)
-static inline int s5p_name_to_gpio(const char *name)
+#define GPIO_NAME_SIZE 20
+
+/* Platform data for each bank */
+struct exynos_gpio_platdata {
+   struct s5p_gpio_bank *bank;
+   const char *bank_name;  /* Name of port, e.g. 'gpa0" */
+};
+
+/* Information about each bank at run-time */
+struct exynos_bank_info {
+   char label[GPIO_PER_BANK][GPIO_NAME_SIZE];
+   struct s5p_gpio_bank *bank;
+};
+
+static struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned int gpio)
 {
-   unsigned num, irregular_set_number, irregular_bank_base;
-   const struct gpio_name_num_table *tabp;
-   char this_bank, bank_name, irregular_bank_name;
-   char *endp;
-
-   /*
-* The gpio name starts with either 'g' or 'gp' followed by the bank
-* name character. Skip one or two characters depending on the prefix.
-*/
-   if (name[0] == 'g' && name[1] == 'p')
-   name += 2;
-   else if (name[0] == 'g')
-   name++;
-   else
-   return -1; /* Name must start with 'g' */
-
-   bank_name = *name++;
-   if (!*name)
-   return -1; /* At least one digit is required/expected. */
-
-   /*
-* On both exynos5 and exynos5420 architectures there is a bank of
-* GPIOs which does not fall into the regular address pattern. Those
-* banks are c4 on Exynos5 and y7 on Exynos5420. The rest of the below
-* assignments help to handle these irregularities.
-*/
-#if defined(CONFIG_EXYNOS4) || defined(CONFIG_EXYNOS5)
-   if (cpu_is_exynos5()) {
-   if (proid_is_exynos5420()) {
-   tabp = exynos5420_gpio_table;
-   irregular_bank_name = 'y';
-   irregular_set_number = '7';
-   irregular_bank_base = EXYNOS5420_GPIO_Y70;
-   } else {
-   tabp = exynos5_gpio_table;
-   irregular_bank_name = 'c';
-   irregular_set_number = '4';
-   irregular_bank_base = EXYNOS5_GPIO_C40;
-   }
-   } else {
-   if (proid_is_exynos4412())
-   tabp = exynos4x12_gpio_table;
-   else
-   tabp = exynos4_gpio_table;
-   irregular_bank_name = 0;
-   irregular_set_number = 0;
-   irregular_bank_base = 0;
-   }
-#else
-   if (cpu_is_s5pc110())
-   tabp = s5pc110_gpio_table;
-   else
-   tabp = s5pc100_gpio_table;
-   irregular_bank_name = 0;
-   irregular_set_number = 0;
-   irregular_bank_base = 0;
-#endif
+   const struct gpio_info *data;
+   unsigned int upto;
+   int i, count;
 
-   this_bank = tabp->bank;
-   do {
-   if (bank_name == this_bank) {
-   unsigned pin_index; /* pin number within the bank */
-   if ((bank_name == irregular_bank_name) &&
-   (name[0] == irregular_set_number)) {
-   pin_index = name[1] - '0';
-   /* Irregular sets have 8 pins. */
-   if (pin_index >= GPIO_PER_BANK)
-   return -1;
-   num = irregular_bank_base + pin_index;
-   } else {
-   pin_index = simple_strtoul(name, &endp, 8);
-   pin_index -= tabp->bank_offset;
-

Re: [U-Boot] [PATCH for-next] arndale: Enable config_distro_defaults.h

2014-10-15 Thread Ian Campbell
On Fri, 2014-09-26 at 15:25 +0100, Ian Campbell wrote:
> From: Ian Campbell 
> 
> ...and remove explicit setting of things which this implies.
> 
> I'm mainly interested in CONFIG_CMD_BOOTZ and CONFIG_SUPPORT_RAW_INITRD
> 
> Signed-off-by: Ian Campbell 

So it seems I need to rebase this over "config: Move arndale to use
common exynos5250 file" which has made me wonder where in the chain
arndale.h -> exynos5250-common.h -> exynos5-common.h -> exynos-common.h
it would be appropriate to introduce the common config stuff.

Since config_cmd_default.h is in exynos-common.h my initial thought
would be to do both distro_defaults and distro_bootcmd in
exynos-common.h. Sound sane?

Ian.

> ---
>  include/configs/arndale.h | 22 ++
>  1 file changed, 2 insertions(+), 20 deletions(-)
> 
> diff --git a/include/configs/arndale.h b/include/configs/arndale.h
> index 75f9933..197d0fc 100644
> --- a/include/configs/arndale.h
> +++ b/include/configs/arndale.h
> @@ -45,7 +45,6 @@
>  #define CONFIG_SETUP_MEMORY_TAGS
>  #define CONFIG_CMDLINE_TAG
>  #define CONFIG_INITRD_TAG
> -#define CONFIG_CMDLINE_EDITING
>  
>  /* Power Down Modes */
>  #define S5P_CHECK_SLEEP  0x0BAD
> @@ -98,15 +97,9 @@
>  /* Command definition*/
>  #include 
>  
> -#define CONFIG_CMD_PING
> -#define CONFIG_CMD_ELF
>  #define CONFIG_CMD_MMC
> -#define CONFIG_CMD_EXT2
> -#define CONFIG_CMD_FAT
> -#define CONFIG_CMD_NET
>  #define CONFIG_CMD_HASH
>  
> -#define CONFIG_BOOTDELAY 3
>  #define CONFIG_ZERO_BOOTDELAY_CHECK
>  
>  /* USB */
> @@ -133,8 +126,6 @@
>  #define CONFIG_BOOTCOMMAND   "mmc read 40007000 451 2000; bootm 40007000"
>  
>  /* Miscellaneous configurable options */
> -#define CONFIG_SYS_LONGHELP  /* undef to save memory */
> -#define CONFIG_SYS_HUSH_PARSER   /* use "hush" command parser
> */
>  #define CONFIG_SYS_PROMPT"ARNDALE # "
>  #define CONFIG_SYS_CBSIZE256 /* Console I/O Buffer Size */
>  #define CONFIG_SYS_PBSIZE384 /* Print Buffer Size */
> @@ -201,8 +192,6 @@
>  #define BL2_START_OFFSET (CONFIG_BL2_OFFSET/512)
>  #define BL2_SIZE_BLOC_COUNT  (CONFIG_BL2_SIZE/512)
>  
> -#define CONFIG_DOS_PARTITION
> -#define CONFIG_EFI_PARTITION
>  #define CONFIG_CMD_PART
>  #define CONFIG_PARTITION_UUIDS
>  
> @@ -221,6 +210,8 @@
>  #define CONFIG_SYS_I2C_S3C24X0_SLAVE0x0
>  #define CONFIG_I2C_EDID
>  
> +#include 
> +
>  /* PMIC */
>  #define CONFIG_PMIC
>  #define CONFIG_POWER_I2C
> @@ -238,15 +229,6 @@
>  #define CONFIG_ENV_SROM_BANK 1
>  #endif /*CONFIG_CMD_NET*/
>  
> -/* Enable PXE Support */
> -#ifdef CONFIG_CMD_NET
> -#define CONFIG_CMD_PXE
> -#define CONFIG_MENU
> -#endif
> -
> -/* Enable devicetree support */
> -#define CONFIG_OF_LIBFDT
> -
>  /* Enable Time Command */
>  #define CONFIG_CMD_TIME
>  


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


[U-Boot] Fw: [PATCH 1/2][v3] fsl_sec: Add hardware accelerated SHA256 and SHA1

2014-10-15 Thread Ruchika Gupta
Th message bounced back due to some encoding issue. Forwarding the reply again.


From: Gupta Ruchika-R66431
Sent: Wednesday, October 15, 2014 2:32 PM
To: Simon Glass
Cc: U-Boot Mailing List; Sun York-R58495
Subject: RE: [U-Boot] [PATCH 1/2][v3] fsl_sec: Add hardware accelerated SHA256 
and SHA1

Hi Simon,

I have defined the functions for hardware acceleration  which are already 
present in hash.c for Freescale platforms.

In hash.c
static struct hash_algo hash_algo[] = {
/*
 * CONFIG_SHA_HW_ACCEL is defined if hardware acceleration is
 * available.
 */
#ifdef CONFIG_SHA_HW_ACCEL
{
"sha1",
SHA1_SUM_LEN,
hw_sha1,
CHUNKSZ_SHA1,
}, {
"sha256",
SHA256_SUM_LEN,
hw_sha256,
CHUNKSZ_SHA256,
},
#endif
/*

In the patch below, I have added defined the above functions for Freescale 
platforms.

+void hw_sha256(const unsigned char *pbuf, unsigned int buf_len,
+   unsigned char *pout, unsigned int chunk_size)
+{
+   if (caam_hash(pbuf, buf_len, pout, SHA256))
+   printf("CAAM was not setup properly or it is faulty\n");
+}
+
+void hw_sha1(const unsigned char *pbuf, unsigned int buf_len,
+   unsigned char *pout, unsigned int chunk_size)
+{
+   if (caam_hash(pbuf, buf_len, pout, SHA1))
+   printf("CAAM was not setup properly or it is faulty\n");
+}

Regards,
Ruchika

> -Original Message-
> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass
> Sent: Wednesday, October 15, 2014 12:56 PM
> To: Gupta Ruchika-R66431
> Cc: U-Boot Mailing List; Sun York-R58495
> Subject: Re: [U-Boot] [PATCH 1/2][v3] fsl_sec: Add hardware accelerated
> SHA256 and SHA1
>
> Hi,>
> On 15 October 2014 08:05, Ruchika Gupta  wrote:
> > SHA-256 and SHA-1 accelerated using SEC hardware in Freescale SoC's
> > The driver for SEC (CAAM) IP is based on linux drivers/crypto/caam.
> > The platforms needto add the MACRO CONFIG_FSL_CAAM inorder to enable
> > initialization of this hardware IP.
> >
> > Signed-off-by: Ruchika Gupta 
> > CC: York Sun 
> > ---
> > Changes from v2:
> > CAAM init was earlier enabled by default for all platforms with SEC > 4.
> > Restricting it to platforms which want to enable CAAM
> >
> > Changes from v1:
> > Added a common function run_descriptor_jr to avoid repetition of
> > common code
>
> Are you able to plumb this into hash.c? See hash_algo[].
>
> Regards,
> Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] fdt_support: fix unaligned u64 accesses in fdt_fixup_memory_banks

2014-10-15 Thread Rob Herring
From: Rob Herring 

Commit f18295d3837c282f (fdt_support: fix an endian bug of
fdt_fixup_memory_banks) changed fdt_fixup_memory_banks cell writing from a
byte at a time to casting the buffer pointer to a 64-bit pointer. This can
result in unaligned accesses when there is a mixture of cell sizes of 1
and 2.

Cc: Masahiro Yamada 
Signed-off-by: Rob Herring 
---
 common/fdt_support.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index 3f64156..9c41f3a 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -388,19 +388,22 @@ static int fdt_pack_reg(const void *fdt, void *buf, 
uint64_t *address,
int i;
int address_len = get_cells_len(fdt, "#address-cells");
int size_len = get_cells_len(fdt, "#size-cells");
+   u64 cell;
char *p = buf;
 
for (i = 0; i < n; i++) {
if (address_len == 8)
-   *(fdt64_t *)p = cpu_to_fdt64(address[i]);
+   cell = cpu_to_fdt64(address[i]);
else
-   *(fdt32_t *)p = cpu_to_fdt32(address[i]);
+   cell = cpu_to_fdt32(address[i]);
+   memcpy(p, &cell, address_len);
p += address_len;
 
if (size_len == 8)
-   *(fdt64_t *)p = cpu_to_fdt64(size[i]);
+   cell = cpu_to_fdt64(size[i]);
else
-   *(fdt32_t *)p = cpu_to_fdt32(size[i]);
+   cell = cpu_to_fdt32(size[i]);
+   memcpy(p, &cell, size_len);
p += size_len;
}
 
-- 
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 4/7] common: spl: Add interactive DDR debugger support for SPL

2014-10-15 Thread Huan Wang
Hi, York,

> On 09/26/2014 03:33 AM, Alison Wang wrote:
> > For LS102xA, interactive DDR debugger is still needed in SPL part.
> > So build the needed files in SPL image too.
> >
> > Signed-off-by: Alison Wang 
> > ---
> > Change log:
> >  v2: No change.
> >
> >  common/Makefile | 20 ++--
> >  1 file changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/common/Makefile b/common/Makefile index b19d379..a166e4c
> > 100644
> > --- a/common/Makefile
> > +++ b/common/Makefile
> > @@ -8,22 +8,12 @@
> >  # core
> >  ifndef CONFIG_SPL_BUILD
> >  obj-y += main.o
> > -obj-y += command.o
> >  obj-y += exports.o
> >  obj-y += hash.o
> >  ifdef CONFIG_SYS_HUSH_PARSER
> >  obj-y += cli_hush.o
> >  endif
> >
> > -# We always have this since drivers/ddr/fs/interactive.c needs it
> > -obj-y += cli_simple.o
> > -
> > -obj-y += cli.o
> > -obj-y += cli_readline.o
> > -obj-y += s_record.o
> > -obj-y += xyzModem.o
> > -obj-y += cmd_disk.o
> > -
> >  # This option is not just y/n - it can have a numeric value  ifdef
> > CONFIG_BOOTDELAY  obj-y += autoboot.o @@ -265,4 +255,14 @@ obj-y +=
> > aboot.o  obj-y += fb_mmc.o  endif
> >
> > +# We always have this since drivers/ddr/fs/interactive.c needs it
> > +obj-y += cli_simple.o
> > +
> > +obj-y += cli.o
> > +obj-y += cli_readline.o
> > +obj-y += command.o
> > +obj-y += s_record.o
> > +obj-y += xyzModem.o
> > +obj-y += cmd_disk.o
> > +
> >  CFLAGS_env_embedded.o := -Wa,--no-warn -DENV_CRC=$(shell
> tools/envcrc
> > 2>/dev/null)
> >
> 
> 
> Can you explain more in commit message why moving them around adds
> interactive DDR debugging?
[Alison Wang] ok, I will explain more in v3. Let me explain here first.

To support interactive DDR debugger, cli_simple.o, cli.o, cli_readline.o, 
command.o,
s_record.o, xyzModem.o and cmd_disk.o are all needed for 
drivers/ddr/fsl/interactive.c.

In current common/Makefile, the above .o files are only produced when 
CONFIG_SPL_BUILD
is disabled.

For LS102xA, interactive DDR debugger is needed in SD/NAND boot too, and I 
enabled
CONFIG_FSL_DDR_INTERACTIVE. But according to the current common/Makfile, all 
the above .o
files are not produced in SPL part because CONFIG_SPL_BUILD is enabled in SPL 
part,
the following error will be shown,

drivers/ddr/fsl/built-in.o: In function `fsl_ddr_interactive':
/home/wangh/layerscape/u-boot/drivers/ddr/fsl/interactive.c:1871: undefined 
reference to `cli_readline_into_buffer'
/home/wangh/layerscape/u-boot/drivers/ddr/fsl/interactive.c:1873: undefined 
reference to `cli_simple_parse_line'
make[1]: *** [spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl] Error 2

So this patch fixed this issue and the above .o files will be produced no matter
CONFIG_SPL_BUILD is enabled or disabled.

Thanks.

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


Re: [U-Boot] puts() and newlines (was Re: Discussion topics / issues)

2014-10-15 Thread Pavel Machek
On Wed 2014-10-15 10:40:12, Pavel Machek wrote:
> Hi!
> 
> > First, we have a compatibility problem here.  GCC assumes that puts()
> > will add a newline character after the string; U-Boot puts() does NOT
> > do this.  So the GCC auto-converted printf()s will all be wrong, as
> > they are missing the newline. [1]
> 
> > [1] One might argue that this is a bug in U-Boot and should be fixed,
> > but that is another topic.
> 
> I believe we should fix that, yes.
> 
> I did quick grep,
> 
> pavel@duo:~/wagabuibui/u-boot$ grep -ri puts . | wc -l
> 4287
> 
> and that is probably too much to change in one go. So what about
> this?

Next step is probably

diff --git a/include/common.h b/include/common.h
index d5020c8..95b2377 100644
--- a/include/common.h
+++ b/include/common.h
@@ -836,6 +836,9 @@ int tstc(void);
 /* stdout */
 void   putc(const char c);
 void   puts(const char *s);
+static inline void __puts(const char *s) { puts(s); }
+static inline void putsnl(const char *s) { puts(s); putc('\n'); }
+
 intprintf(const char *fmt, ...)
__attribute__ ((format (__printf__, 1, 2)));
 intvprintf(const char *fmt, va_list args);

Then run 

sed 's/puts(\(.*\)\\n")/putsnl(\1")/' `find . -name "*.[ch]"`

... to get existing users converted. Then we can convert the rest to
to either __puts or putsnl, and finally get rid of putsnl and convert
it back to puts.

(Patch is >400KB, so I'll not post it here).

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


Re: [U-Boot] [PATCH v3 2/3] net: Add a command to access the EEPROM from ethernet devices

2014-10-15 Thread Alban Bedel
On Tue, 14 Oct 2014 21:18:37 +0200
Simon Glass  wrote:

> Hi Joe,
> 
> On 14 October 2014 21:14, Joe Hershberger  wrote:
> >
> > On Tue, Oct 14, 2014 at 12:21 PM, Simon Glass  wrote:
> > >
> > > Hi,
> > >
> > > On 14 October 2014 18:26, Alban Bedel  
> > > wrote:
> > > > Many ethernet devices use an EEPROM to store various settings, most
> > > > commonly the device MAC address. But on some devices it can contains
> > > > a lot more, for example USB device might also have many USB related
> > > > parameters.
> > > >
> > > > This commit add a set of commands to read/write this EEPROM, write a
> > > > default configuration and read/write the device MAC address. The
> > > > defaults command allow priming the EEPROM for devices that need more
> > > > than just a MAC address in the EEPROM.
> > > >
> > > > Signed-off-by: Alban Bedel 
> > > > ---
> > > > v2: * No changes since v1
> > > > v3: * Replace the dedicated 'eth_eeprom' command with a subcommand
> > > >   to the newly introduced 'eth' command
> > >
> > > I see a few EEPROM implementations in the code base. It feels to me
> > > like we need an EEPROM interface. In driver model terms this could be
> > > a uclass. I started something here:
> > >
> > > http://patchwork.ozlabs.org/patch/399039/
> > >
> > > Of course we don't have DM for Ethernet yet - when we do I think a
> > > child EEPROM device below the Ethernet would make sense. It could be
> > > created by the Ethernet driver when it knows that this information
> > > exists. But even without that I feel that the EEPROM should be
> > > logically separated from Ethernet.
> > >
> > > So I suggest that instead of an #ifdef to adjust the Ethernet API, add
> > > a pointer to another struct containing the EEPROM API and put it in
> > > its own header. I also feel that there should ultimately be an eeprom
> > > command which operates on these. Then the only Ethernet API call would
> > > be to find the EEPROM pointer, if there is one.
> > >
> > > If someone feels like taking it on, driver model support for Ethernet
> > > should be pretty easy. Or even EEPROM could be done now and this might
> > > avoid churn. But I would be happy for this series to be applied as is
> > > while working on a driver model version. I just don't feel we should
> > > be adding new subsystems that don't use driver model.
> >
> > I agree that we shouldn't add new subsystems that don't use DM.  I think
> > this (adding eeprom access to Ethernet) is a decent compromise until
> > we have driver model for Ethernet.  I do like your idea of having an
> > eeprom class / subsystem / command that can operate on this type of
> > thing the same way no matter where it's connected, but it probably
> > isn't a good idea to add an "eeprom" command for that without using DM
> > first.
> >
> > So your idea sounds good, but it leaves me with one question... if we want
> > to accept this now as it is, then do we want to introduce a new
> > command (eth eeprom) when we already know we want to change its
> > behavior or delete it once we add a uclass for eeproms?
> 
> Good question, in general I suppose we want to avoid changing the
> commands, although if you get to Ethernet in this merge window then it
> might not matter much. One option is to indicate in the help that it
> is a temporary command and the syntax may change.
>

A generic EEPROM driver / command sounds good, however we would still
need a few ethernet driver specific commands like the ones to
manipulate the MAC address.

If possible I would really like to settle the command syntax, so I
would suggest using the following scheme for the future eeprom command:

  eeprom   [...]

If this command is also available internally with an interface such as:

  int eeprom_cmd(struct eeprom_device *dev,
 int argc, char * const argv[]);

the 'eth eeprom' implementation could easily provides its own commands
on the eeprom while falling back on eeprom_cmd() for the generic ones.
That would avoid any code duplication while keeping the 'eth eeprom'
functionality.

I'm unsure about the 'defaults' commands, I would tend to see it at
the eeprom level as it might be needed in various situations. However
it must be provided by the device, not the eeprom driver itself.
It might also make sense to drop the callback in favour of a simple
data array as it would allow setting it from device tree.

Alban


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


[U-Boot] [PATCH 1/2] sunxi: axp152: Keep DRAM / Vddr at bootloader set value

2014-10-15 Thread Hans de Goede
Some fex files contain wrong values, causing stability issues.

Signed-off-by: Hans de Goede 
---
 drivers/power/axp152.c | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/power/axp152.c b/drivers/power/axp152.c
index 77132e1..3b8e68f 100644
--- a/drivers/power/axp152.c
+++ b/drivers/power/axp152.c
@@ -541,15 +541,17 @@ static struct regulator_init_data 
regl_init_data[AXP152_REGULATOR_COUNT] = {
.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
}
},
-   [axp152_dcdc3] = { /* Vddr, power on 1.5V, Android from fex */
+   [axp152_dcdc3] = { /* Vddr, power on 1.5V, use u-boot value */
.num_consumer_supplies = 1,
.consumer_supplies = &axp152_dcdc3_supply,
.constraints = {
-   .min_uV =  1500 * 1000,
-   .max_uV =  1500 * 1000,
+   .min_uV =  1000 * 1000,
+   .max_uV =  1600 * 1000,
.always_on = 1,
-   .apply_uV = 1,
-   .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
+   /*
+* We do not allow changing the DRAM voltage, because
+* of stability, so no REGULATOR_CHANGE_VOLTAGE.
+*/
}
},
[axp152_dcdc4] = { /* Vcpu, power on 1.25V, Android from fex */
@@ -622,11 +624,11 @@ static int __init axp_board_init(void)
 
/* Note we ignore the dcdc2_vol key as dcdc2 is set by the dvfs code */
 
-   ret = script_parser_fetch("target", "dcdc3_vol", &val, sizeof(int));
-   if (ret == 0) {
-   regl_init_data[axp152_dcdc3].constraints.min_uV = val * 1000;
-   regl_init_data[axp152_dcdc3].constraints.max_uV = val * 1000;
-   }
+   /*
+* Note we ignore the dcdc3_vol key as that sometimes contains wrong
+* values make the dram unstable, instead we stick with the bootloader
+* set voltage.
+*/
 
ret = script_parser_fetch("target", "dcdc4_vol", &val, sizeof(int));
if (ret == 0) {
-- 
2.1.0

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


[U-Boot] [PATCH 2/2] sunxi: nand: Fix nand clk calculation

2014-10-15 Thread Hans de Goede
Before the u-boot dram cleanup u-boot would always set PLL5 factor m to
2 (reg value 1) and div p to 1, and get_cmu_clk in the nand code
would calculate the pll5p clk like this:

clk = 24 * factor_n * factor_k / div_p / factor_m;

aka:

clk = 24 * factor_n * factor_k / (div_p * factor_m);

This is wrong however, factor_m is not used to calculate pll5p, and div_p is
not a straight divider, but it divides by 2 ^ div_p. Since with the m == 2 and
p == 1 settings used before the dram cleanup, this happend to do the right
thing in the form of dividing by 2. But with the new dram code div_p is 0,
and then the old get_cmu_clk code fails with a divide by 0 error.

This commit fixes this, by changing the clk calculation to the correct form of:

clk = (24 * factor_n * factor_k) >> div_p;

Signed-off-by: Hans de Goede 
---
 drivers/block/sunxi_nand/nfd/nand_blk.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/block/sunxi_nand/nfd/nand_blk.c 
b/drivers/block/sunxi_nand/nfd/nand_blk.c
index a632453..2169301 100644
--- a/drivers/block/sunxi_nand/nfd/nand_blk.c
+++ b/drivers/block/sunxi_nand/nfd/nand_blk.c
@@ -1095,16 +1095,15 @@ __u32 get_cmu_clk(void)
 {
__u32 reg_val;
__u32 div_p, factor_n;
-   __u32 factor_k, factor_m;
+   __u32 factor_k;
__u32 clock;
 
reg_val  = *(volatile unsigned int *)(0xf1c2 + 0x20);
div_p= (reg_val >> 16) & 0x3;
factor_n = (reg_val >> 8) & 0x1f;
factor_k = ((reg_val >> 4) & 0x3) + 1;
-   factor_m = ((reg_val >> 0) & 0x3) + 1;
 
-   clock = 24 * factor_n * factor_k/div_p/factor_m;
+   clock = (24 * factor_n * factor_k) >> div_p;
 
return clock;
 }
-- 
2.1.0

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


Re: [U-Boot] [PATCH 1/2] sunxi: axp152: Keep DRAM / Vddr at bootloader set value

2014-10-15 Thread Hans de Goede
Hi,

Ugh, this series is for the linux-sunxi 3.4 kernels and should have gone to a 
different
list. Please ignore, I'll remove it from patchwork right away.

Regards,

Hans


On 10/15/2014 11:56 AM, Hans de Goede wrote:
> Some fex files contain wrong values, causing stability issues.
> 
> Signed-off-by: Hans de Goede 
> ---
>  drivers/power/axp152.c | 22 --
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/power/axp152.c b/drivers/power/axp152.c
> index 77132e1..3b8e68f 100644
> --- a/drivers/power/axp152.c
> +++ b/drivers/power/axp152.c
> @@ -541,15 +541,17 @@ static struct regulator_init_data 
> regl_init_data[AXP152_REGULATOR_COUNT] = {
>   .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
>   }
>   },
> - [axp152_dcdc3] = { /* Vddr, power on 1.5V, Android from fex */
> + [axp152_dcdc3] = { /* Vddr, power on 1.5V, use u-boot value */
>   .num_consumer_supplies = 1,
>   .consumer_supplies = &axp152_dcdc3_supply,
>   .constraints = {
> - .min_uV =  1500 * 1000,
> - .max_uV =  1500 * 1000,
> + .min_uV =  1000 * 1000,
> + .max_uV =  1600 * 1000,
>   .always_on = 1,
> - .apply_uV = 1,
> - .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
> + /*
> +  * We do not allow changing the DRAM voltage, because
> +  * of stability, so no REGULATOR_CHANGE_VOLTAGE.
> +  */
>   }
>   },
>   [axp152_dcdc4] = { /* Vcpu, power on 1.25V, Android from fex */
> @@ -622,11 +624,11 @@ static int __init axp_board_init(void)
>  
>   /* Note we ignore the dcdc2_vol key as dcdc2 is set by the dvfs code */
>  
> - ret = script_parser_fetch("target", "dcdc3_vol", &val, sizeof(int));
> - if (ret == 0) {
> - regl_init_data[axp152_dcdc3].constraints.min_uV = val * 1000;
> - regl_init_data[axp152_dcdc3].constraints.max_uV = val * 1000;
> - }
> + /*
> +  * Note we ignore the dcdc3_vol key as that sometimes contains wrong
> +  * values make the dram unstable, instead we stick with the bootloader
> +  * set voltage.
> +  */
>  
>   ret = script_parser_fetch("target", "dcdc4_vol", &val, sizeof(int));
>   if (ret == 0) {
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Revert "sunxi: dram: Use divisor P=1 for PLL5"

2014-10-15 Thread Hans de Goede
This change breaks various hardcoded assumptions in the linux-sunxi-3.4
kernels, causing a divide by 0 error in the linux-sunxi-3.4 nand driver,
rendering 3.4 kernels unbootable. Besides this problem, it also breaks LCD
output (on devices without nand).

Fixes for these issues are being added to the linux-sunxi-3.4 kernel, but for
now it seems better to revert this.

This reverts commit 013f2d746955147439215a4939655c9ed6bdd866.

Signed-off-by: Hans de Goede 
---
 arch/arm/cpu/armv7/sunxi/dram.c | 28 +---
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/arch/arm/cpu/armv7/sunxi/dram.c b/arch/arm/cpu/armv7/sunxi/dram.c
index 584f742..8c4dd51 100644
--- a/arch/arm/cpu/armv7/sunxi/dram.c
+++ b/arch/arm/cpu/armv7/sunxi/dram.c
@@ -256,7 +256,7 @@ static void mctl_setup_dram_clock(u32 clk, u32 mbus_clk)
/* PLL5P and PLL6 are the potential clock sources for MBUS */
u32 pll6x_div, pll5p_div;
u32 pll6x_clk = clock_get_pll6() / 100;
-   u32 pll5p_clk = clk / 24 * 48;
+   u32 pll5p_clk = clk / 24 * 24;
u32 pll5p_rate, pll6x_rate;
 #ifdef CONFIG_SUN7I
pll6x_clk *= 2; /* sun7i uses PLL6*2, sun5i uses just PLL6 */
@@ -269,40 +269,46 @@ static void mctl_setup_dram_clock(u32 clk, u32 mbus_clk)
reg_val &= ~CCM_PLL5_CTRL_N_MASK;   /* set N to 0 (x0) */
reg_val &= ~CCM_PLL5_CTRL_P_MASK;   /* set P to 0 (x1) */
if (clk >= 540 && clk < 552) {
-   /* dram = 540MHz, pll5p = 1080MHz */
-   pll5p_clk = 1080;
+   /* dram = 540MHz, pll5p = 540MHz */
+   pll5p_clk = 540;
reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(2));
reg_val |= CCM_PLL5_CTRL_K(CCM_PLL5_CTRL_K_X(3));
reg_val |= CCM_PLL5_CTRL_N(CCM_PLL5_CTRL_N_X(15));
+   reg_val |= CCM_PLL5_CTRL_P(1);
} else if (clk >= 512 && clk < 528) {
-   /* dram = 512MHz, pll5p = 1536MHz */
-   pll5p_clk = 1536;
+   /* dram = 512MHz, pll5p = 384MHz */
+   pll5p_clk = 384;
reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(3));
reg_val |= CCM_PLL5_CTRL_K(CCM_PLL5_CTRL_K_X(4));
reg_val |= CCM_PLL5_CTRL_N(CCM_PLL5_CTRL_N_X(16));
+   reg_val |= CCM_PLL5_CTRL_P(2);
} else if (clk >= 496 && clk < 504) {
-   /* dram = 496MHz, pll5p = 1488MHz */
-   pll5p_clk = 1488;
+   /* dram = 496MHz, pll5p = 372MHz */
+   pll5p_clk = 372;
reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(3));
reg_val |= CCM_PLL5_CTRL_K(CCM_PLL5_CTRL_K_X(2));
reg_val |= CCM_PLL5_CTRL_N(CCM_PLL5_CTRL_N_X(31));
+   reg_val |= CCM_PLL5_CTRL_P(2);
} else if (clk >= 468 && clk < 480) {
-   /* dram = 468MHz, pll5p = 936MHz */
-   pll5p_clk = 936;
+   /* dram = 468MHz, pll5p = 468MHz */
+   pll5p_clk = 468;
reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(2));
reg_val |= CCM_PLL5_CTRL_K(CCM_PLL5_CTRL_K_X(3));
reg_val |= CCM_PLL5_CTRL_N(CCM_PLL5_CTRL_N_X(13));
+   reg_val |= CCM_PLL5_CTRL_P(1);
} else if (clk >= 396 && clk < 408) {
-   /* dram = 396MHz, pll5p = 792MHz */
-   pll5p_clk = 792;
+   /* dram = 396MHz, pll5p = 396MHz */
+   pll5p_clk = 396;
reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(2));
reg_val |= CCM_PLL5_CTRL_K(CCM_PLL5_CTRL_K_X(3));
reg_val |= CCM_PLL5_CTRL_N(CCM_PLL5_CTRL_N_X(11));
+   reg_val |= CCM_PLL5_CTRL_P(1);
} else  {
/* any other frequency that is a multiple of 24 */
reg_val |= CCM_PLL5_CTRL_M(CCM_PLL5_CTRL_M_X(2));
reg_val |= CCM_PLL5_CTRL_K(CCM_PLL5_CTRL_K_X(2));
reg_val |= CCM_PLL5_CTRL_N(CCM_PLL5_CTRL_N_X(clk / 24));
+   reg_val |= CCM_PLL5_CTRL_P(CCM_PLL5_CTRL_P_X(2));
}
reg_val &= ~CCM_PLL5_CTRL_VCO_GAIN; /* PLL VCO Gain off */
reg_val |= CCM_PLL5_CTRL_EN;/* PLL On */
-- 
2.1.0

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


[U-Boot] [PATCH] ARM: bootm: Allow booting in secure mode on hyp capable systems

2014-10-15 Thread Hans de Goede
Older Linux kernels will not properly boot in hype mode, add support for a
bootm_boot_mode environment variable, which when set to "sec" will cause
u-boot to boot in secure mode even when build with non-sec (and hyp) support.

Signed-off-by: Hans de Goede 
---
 arch/arm/lib/bootm.c | 23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 39fe7a1..037fc8d 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -235,6 +235,18 @@ static void boot_prep_linux(bootm_headers_t *images)
}
 }
 
+#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
+static bool boot_nonsec(void)
+{
+   char *s = getenv("bootm_boot_mode");
+
+   if (s && !strcmp(s, "sec"))
+   return false;
+
+   return true;
+}
+#endif
+
 /* Subcommand: GO */
 static void boot_jump_linux(bootm_headers_t *images, int flag)
 {
@@ -283,12 +295,13 @@ static void boot_jump_linux(bootm_headers_t *images, int 
flag)
 
if (!fake) {
 #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
-   armv7_init_nonsec();
-   secure_ram_addr(_do_nonsec_entry)(kernel_entry,
- 0, machid, r2);
-#else
-   kernel_entry(0, machid, r2);
+   if (boot_nonsec()) {
+   armv7_init_nonsec();
+   secure_ram_addr(_do_nonsec_entry)(kernel_entry,
+ 0, machid, r2);
+   }
 #endif
+   kernel_entry(0, machid, r2);
}
 #endif
 }
-- 
2.1.0

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


Re: [U-Boot] buildman: display list of boards with warnings/errors during build?

2014-10-15 Thread Albert ARIBAUD
Hi Simon,

On Wed, 15 Oct 2014 09:24:34 +0200, Simon Glass 
wrote:

> Hi Albert,
> 
> On 15 October 2014 08:28, Albert ARIBAUD  wrote:
> > Hello,
> >
> > Apologies if I have missed the answer to my question in
> > tools/buildman/README or the buildman -h output.
> 
> Also -H which gives the full README.
> 
> >
> > When buildman runs on a large set of boards (such as when I run
> > 'tools/buildman/buildman -k aarch64 arm') it shows a summary of how
> > many boards so far have built fine, built with warnings and built with
> > errors, which is good, and a list of notes, warnings and errors emitted
> > by the compiler so far, which is good when building branches. But when
> > building architectures, as I do, I would prefer that buildman just list
> > the boards that have failed clean building (and list them again when
> > invoked with -s)
> >
> > Did I just miss the option or option combination which produces this,
> > or should I go and patch buildman to add such an option?
> 
> Does -l do what you want?

Not exactly: -l does list the failing boards, but it does so as
they are found, mixing the warning and error cases. MAKEALL lists them
at the end, in a summary, where all boards with warning are listed
together and so are all boards with errors. I don't mind getting the
list displayed before the end, for instance each time a new board
fails, but I really would like it to be grouped by failure type
(warning or error) and ideally, sorted in alphabetical board name order.

Also, -l apparently does not prevent all notes, warnings and error
diagnostics from being emitted by the compiler during builds.

Plus, with -l, there seems to be a weird bug whereby a single board gets
listed a bazillion times for a warning.

To make things easier, I have pushed the commit I am using with
buildman as branch "buildman_test" on u-boot-arm, and here is the
command line I use, without -l:

tools/buildman/buildman -o build -k odroid apalis_t30
tricorder_flash tricorder edminiv2 wireless_space

And with -l

tools/buildman/buildman -o build -k odroid apalis_t30
tricorder_flash tricorder edminiv2 wireless_space -l

The first four boards have warnings or errors (the last two ones are
just added as known guild build cases) with gcc version 4.8.2
(Ubuntu/Linaro 4.8.2-16ubuntu4).

Again, if this is not possible, I am willing to contribute a patch to
get it done.

> Regards,
> Simon

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


Re: [U-Boot] [PATCH] ARM: bootm: Allow booting in secure mode on hyp capable systems

2014-10-15 Thread Marc Zyngier
On Wed, Oct 15 2014 at 11:13:05 AM, Hans de Goede  wrote:
> Older Linux kernels will not properly boot in hype mode, add support for a
> bootm_boot_mode environment variable, which when set to "sec" will cause
> u-boot to boot in secure mode even when build with non-sec (and hyp) support.
>
> Signed-off-by: Hans de Goede 

Looks good to me.

Acked-by: Marc Zyngier 

M.
-- 
Jazz is not dead. It just smells funny.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: bootm: Allow booting in secure mode on hyp capable systems

2014-10-15 Thread Siarhei Siamashka
On Wed, 15 Oct 2014 12:13:05 +0200
Hans de Goede  wrote:

> Older Linux kernels will not properly boot in hype mode, add support for a
> bootm_boot_mode environment variable, which when set to "sec" will cause
> u-boot to boot in secure mode even when build with non-sec (and hyp) support.
> 
> Signed-off-by: Hans de Goede 
> ---
>  arch/arm/lib/bootm.c | 23 ++-
>  1 file changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index 39fe7a1..037fc8d 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -235,6 +235,18 @@ static void boot_prep_linux(bootm_headers_t *images)
>   }
>  }
>  
> +#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> +static bool boot_nonsec(void)
> +{
> + char *s = getenv("bootm_boot_mode");
> +
> + if (s && !strcmp(s, "sec"))
> + return false;
> +
> + return true;
> +}
> +#endif
> +
>  /* Subcommand: GO */
>  static void boot_jump_linux(bootm_headers_t *images, int flag)
>  {
> @@ -283,12 +295,13 @@ static void boot_jump_linux(bootm_headers_t *images, 
> int flag)
>  
>   if (!fake) {
>  #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> - armv7_init_nonsec();
> - secure_ram_addr(_do_nonsec_entry)(kernel_entry,
> -   0, machid, r2);
> -#else
> - kernel_entry(0, machid, r2);
> + if (boot_nonsec()) {
> + armv7_init_nonsec();
> + secure_ram_addr(_do_nonsec_entry)(kernel_entry,
> +   0, machid, r2);
> + }
>  #endif
> + kernel_entry(0, machid, r2);
>   }
>  #endif
>  }

BTW, I'm currently achieving the same result, but without the need to do
extra environment configuration gymnastics for the end users:

https://github.com/ssvb/u-boot-sunxi-dram/commit/e914abe551e712a59a8fc1ac9a4b8490e8e7c866

-- 
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] ARM: bootm: Allow booting in secure mode on hyp capable systems

2014-10-15 Thread Albert ARIBAUD
Hi Marc, Hans,

On Wed, 15 Oct 2014 11:18:28 +0100, Marc Zyngier 
wrote:

> On Wed, Oct 15 2014 at 11:13:05 AM, Hans de Goede  wrote:
> > Older Linux kernels will not properly boot in hype mode, add support for a
> > bootm_boot_mode environment variable, which when set to "sec" will cause
> > u-boot to boot in secure mode even when build with non-sec (and hyp) 
> > support.
> >
> > Signed-off-by: Hans de Goede 
> 
> Looks good to me.
> 
> Acked-by: Marc Zyngier 
> 
>   M.

Should we consider this a bugfix? For instance, hHow old are these
"older kernels"?

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


Re: [U-Boot] [PATCH 6/7] arm: ls102xa: Add SD boot support for LS1021AQDS board

2014-10-15 Thread Albert ARIBAUD
Hi Huan,

On Wed, 15 Oct 2014 06:56:37 +, Huan Wang
 wrote:

> Hi, Albert,
> 
> > On Wed, 8 Oct 2014 09:53:03 +, Huan Wang 
> > wrote:
> > 
> > > Hi, Albert,
> > >
> > > > On Thu, 25 Sep 2014 06:45:00 +, Huan Wang
> > > >  wrote:
> > > >
> > > > > Hi, Albert,
> > > > >
> > > > > > On Mon, 22 Sep 2014 06:46:20 +, Huan Wang
> > > > > >  wrote:
> > > > > >
> > > > > > > Hi, Albert,
> > > > > > >
> > > > > > > > > On Thu, 18 Sep 2014 13:47:18 +0800, Alison Wang
> > > > > > > > > 
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > +
> > > > > > > > > > + . = ALIGN(4);
> > > > > > > > > > + .u_boot_list : {
> > > > > > > > > > + KEEP(*(SORT(.u_boot_list*_i2c_*)));
> > > > > > > > > > + }
> > > > > > > > >
> > > > > > > > > IS this required? And if it is, could it not be added to
> > > > > > > > > the arch/arm/cpu/u-boot-spl.lds file? This way you would
> > > > > > > > > not need an .lds file at all.
> > > > > > > > >
> > > > > > > > > [Alison Wang] Yes, it is required.
> > > > > > > >
> > > > > > > > Ok -- what for? :)
> > > > > > > [Alison Wang] In SPL part, DDR is initialized by reading SPD
> > > > > > > through
> > > > > > I2C interface.
> > > > > > > For I2C, ll_entry_count() is called, and it returns the
> > number
> > > > > > > of elements of a linker-generated array placed into
> > subsection
> > > > > > > of .u_boot_list section specified by _list argument. So I
> > need
> > > > > > > to
> > > > add
> > > > > > this to make I2C work in SPL.
> > > > > >
> > > > > > Understood. So your SPL code uses I2C, and for I2C, you need a
> > > > > > linker list. But then:
> > > > > >
> > > > > > > > > I would like to add it in arch/arm/cpu/u-boot-spl.lds. I
> > > > > > > > > was not sure adding it in arch/arm/cpu/u-boot-spl.lds is
> > > > > > > > > acceptable or
> > > > > > not.
> > > > > > > >
> > > > > > > > (assuming the reason why it is needed is valid) If it
> > causes
> > > > > > > > no change to boards which do not use it right now (and I
> > > > > > > > mean 'no change' ad 'binary identical') then this is
> > > > > > > > acceptable. Make sure you check the binary invariance and
> > > > > > > > that you mention it in the
> > > > > > commit.
> > > > > > > >
> > > > > > > [Alison Wang] It will cause the binary is not identical for
> > > > > > > other
> > > > > > board.
> > > > > >
> > > > > > Is this a prediction or an actual observation of compared
> > builds
> > > > > > with and without the I2C linker liste addition to the generic
> > > > SPL .lds?
> > > > >
> > > > > [Alison Wang] I use mx31pdk as example. I compared the binaries
> > > > > with and Without the I2C linker list in
> > > > > arch/arm/cpu/u-boot-spl.lds. The binaries are not identical.
> > > >
> > > > I have just checked mx31pdk: the u-boot binaries (u-boot,
> > > > u-boot.bin, u-boot-with-spl.bin, u-boot.map, u-boot.srec) are
> > indeed
> > > > different, but that's just normal considering the repository state
> > > > and build date and time are included in the binaries [1].
> > > >
> > > > OTOH, I see that the u-boot-spl.bin files are identical.
> > > >
> > > > The only change I made between the two builds was inserting
> > > >
> > > > > . = ALIGN(4);
> > > > > +   .u_boot_list : {
> > > > > +   KEEP(*(SORT(.u_boot_list*_i2c_*)));
> > > > > +   }
> > > >
> > > > in arch/arm/cpu/u-boot-spl.lds at line 34.
> > > >
> > > > Can you re-check?
> > >
> > > [Alison Wang] Yes, you are right. u-boot-spl.bin files are identical.
> > > The u-boot binaries (u-boot, u-boot.bin, u-boot-with-spl.bin, u-
> > boot.map, u-boot.srec) are different only in build date and time.
> > > >
> > > > [1] BTW, how do you folks out here proceed when trying to compare
> > u-
> > > > boot.bin files from different builds of the same target without the
> > > > repo state or build date and time affecting the comparison? I use a
> > > > patch to Makefile that fakes the commit and repo state, and I also
> > > > use fakelib to force timestamps, but there might be a simpler way.
> > > >
> > > [Alison Wang] Oh, your way is very good. I just used vimdiff.
> > 
> > I'll run a larger-scale check today, to see which SPLs are affected by
> > adding u-boot_list*, not just u_boot_list*_i2c_*, i.e., maybe we can
> > make this identical in u-boot.lds and u-boot-spl.lds for ARM.
> > 
> [Alison Wang] I can't agree with you more on making this identical in 
> u-boot.lds
> and u-boot-spl.lds for ARM. Anyway, I need to confirm it through your 
> larger-scale
> check result.

I have been slightly side-tracked on this, but I'll run the test in a
few hours and publish the results in this thread.

> Best Regards,
> Alison Wang

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


Re: [U-Boot] [PATCH] ARM: bootm: Allow booting in secure mode on hyp capable systems

2014-10-15 Thread Marc Zyngier
On Wed, Oct 15 2014 at 11:25:10 AM, Siarhei Siamashka 
 wrote:
> On Wed, 15 Oct 2014 12:13:05 +0200
> Hans de Goede  wrote:
>
>> Older Linux kernels will not properly boot in hype mode, add support for a
>> bootm_boot_mode environment variable, which when set to "sec" will cause
>> u-boot to boot in secure mode even when build with non-sec (and hyp) support.
>> 
>> Signed-off-by: Hans de Goede 
>> ---
>>  arch/arm/lib/bootm.c | 23 ++-
>>  1 file changed, 18 insertions(+), 5 deletions(-)
>> 
>> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
>> index 39fe7a1..037fc8d 100644
>> --- a/arch/arm/lib/bootm.c
>> +++ b/arch/arm/lib/bootm.c
>> @@ -235,6 +235,18 @@ static void boot_prep_linux(bootm_headers_t *images)
>>  }
>>  }
>>  
>> +#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
>> +static bool boot_nonsec(void)
>> +{
>> +char *s = getenv("bootm_boot_mode");
>> +
>> +if (s && !strcmp(s, "sec"))
>> +return false;
>> +
>> +return true;
>> +}
>> +#endif
>> +
>>  /* Subcommand: GO */
>>  static void boot_jump_linux(bootm_headers_t *images, int flag)
>>  {
>> @@ -283,12 +295,13 @@ static void boot_jump_linux(bootm_headers_t *images, 
>> int flag)
>>  
>>  if (!fake) {
>>  #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
>> -armv7_init_nonsec();
>> -secure_ram_addr(_do_nonsec_entry)(kernel_entry,
>> -  0, machid, r2);
>> -#else
>> -kernel_entry(0, machid, r2);
>> +if (boot_nonsec()) {
>> +armv7_init_nonsec();
>> +secure_ram_addr(_do_nonsec_entry)(kernel_entry,
>> +  0, machid, r2);
>> +}
>>  #endif
>> +kernel_entry(0, machid, r2);
>>  }
>>  #endif
>>  }
>
> BTW, I'm currently achieving the same result, but without the need to do
> extra environment configuration gymnastics for the end users:
> 
> https://github.com/ssvb/u-boot-sunxi-dram/commit/e914abe551e712a59a8fc1ac9a4b8490e8e7c866

And thus preventing kernels with appended DT (not provided by u-boot),
but still using HYP/non-sec/PSCI from booting.

Sorry, but using DT as a way to distinguish between all these cases is
just wrong.

Thanks,

M.
-- 
Jazz is not dead. It just smells funny.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Revert "sunxi: dram: Use divisor P=1 for PLL5"

2014-10-15 Thread Siarhei Siamashka
On Wed, 15 Oct 2014 12:12:11 +0200
Hans de Goede  wrote:

> This change breaks various hardcoded assumptions in the linux-sunxi-3.4
> kernels, causing a divide by 0 error in the linux-sunxi-3.4 nand driver,
> rendering 3.4 kernels unbootable. Besides this problem, it also breaks LCD
> output (on devices without nand).
> 
> Fixes for these issues are being added to the linux-sunxi-3.4 kernel, but for
> now it seems better to revert this.
> 
> This reverts commit 013f2d746955147439215a4939655c9ed6bdd866.

As mentioned in the commit message
https://www.mail-archive.com/linux-sunxi@googlegroups.com/msg07884.html
the hardcoded assumptions in the sunxi-3.4 kernel are still bad
with or without this revert if somebody tries to use higher DRAM
clock speeds.

The patch in question just smokes out bugs, which are otherwise still
there.

Going forward, the mainline kernel needs the G2D driver and it needs
to run at a decent clock speed to be provide reasonable performance.
Low PLL5P clock speed is limiting our options.

This revert does not do anyone any favour and only postpones the
resolution of the problem.

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


[U-Boot] [PATCH 0/10] Provide inttypes.h to avoid 32/64 bit problems with printf()

2014-10-15 Thread Simon Glass
In quite a few situations we have to print a 64-bit value. Unfortunately
the type used for 64-bit can vary depending on the machine. For 64-bit
machines it might be 'long' and for 32-bit machines it might be
'long long'.

As a result we need to use either %ld or %lld depending on the architecture.
Add the inttypes.h header file to provide defines for this and clean up the
code to use these defines in a few places.

The stdint.h file is bundled with recent versions of gcc and it is generally
better to use this rather than our own versions. Add an option to use the
internal stdint.h file.


Gabe Black (2):
  Provide option to avoid defining a custom version of uintptr_t.
  Add some standard headers external code might need

Simon Glass (8):
  ext4: Use inttypes for printf() string
  Use uint64_t for time types
  Use uint64_t instead of u64 in put_dec()
  Tidy up data sizes and function comment in display_options
  x86: Use correct printf() format string for uintptr_t
  scsi: Use correct printf() format string for uintptr_t
  usb: Use correct printf() format string for uintptr_t
  test: Add a simple test to detected warnings with uint64_t, uintptr_t

 README   |   5 +
 arch/sandbox/include/asm/types.h |   5 +
 arch/x86/include/asm/types.h |   5 +
 arch/x86/lib/relocate.c  |   3 +-
 common/cmd_scsi.c|   9 +-
 common/usb_storage.c |  11 +-
 config.mk|   5 +
 fs/ext4/ext4_common.c|   3 +-
 include/common.h |  19 ++-
 include/compiler.h   |  11 +-
 include/inttypes.h   | 287 +++
 include/linux/types.h|   9 +-
 include/stdlib.h |  12 ++
 lib/display_options.c|  14 +-
 lib/time.c   |  12 +-
 lib/vsprintf.c   |   2 +-
 test/stdint/int-types.c  |  13 ++
 test/stdint/test-includes.sh |  58 
 18 files changed, 450 insertions(+), 33 deletions(-)
 create mode 100644 include/inttypes.h
 create mode 100644 include/stdlib.h
 create mode 100644 test/stdint/int-types.c
 create mode 100755 test/stdint/test-includes.sh

-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 01/10] Provide option to avoid defining a custom version of uintptr_t.

2014-10-15 Thread Simon Glass
From: Gabe Black 

There's a definition in stdint.h (provided by gcc) which will be more correct
if available.

Define CONFIG_USE_STDINT to use this feature, or USE_STDINT=1 on the 'make'
commmand.

This adjusts the settings for x86 and sandbox, with both have 64-bit options.

Signed-off-by: Gabe Black 
Reviewed-by: Gabe Black 
Tested-by: Gabe Black 
Reviewed-by: Bill Richardson 
Rewritten to be an option, since stdint.h is often available only in glibc.
Changed to preserve a clear boundary between stdint and non-stdint
Signed-off-by: Simon Glass 

---

 README   |  5 +
 arch/sandbox/include/asm/types.h |  5 +
 arch/x86/include/asm/types.h |  5 +
 config.mk|  5 +
 include/compiler.h   | 11 ---
 include/linux/types.h|  9 -
 6 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/README b/README
index 6ecb3e0..72e8db9 100644
--- a/README
+++ b/README
@@ -4055,6 +4055,11 @@ Configuration Settings:
be asserted. See doc/README.omap-reset-time for details on how
the value can be calulated on a given board.
 
+- CONFIG_USE_STDINT
+   If stdint.h is available with your toolchain you can define this
+   option to enable it. You can provide option 'USE_STDINT=1' when
+   building U-Boot to enable this.
+
 The following definitions that deal with the placement and management
 of environment data (variable area); in general, we support the
 following configurations:
diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h
index 6d3eb1f..42c09e2 100644
--- a/arch/sandbox/include/asm/types.h
+++ b/arch/sandbox/include/asm/types.h
@@ -42,8 +42,13 @@ typedef unsigned short u16;
 typedef signed int s32;
 typedef unsigned int u32;
 
+#if !defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__)
 typedef signed long long s64;
 typedef unsigned long long u64;
+#else
+typedef __INT64_TYPE__ s64;
+typedef __UINT64_TYPE__ u64;
+#endif
 
 #define BITS_PER_LONG  CONFIG_SANDBOX_BITS_PER_LONG
 
diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h
index e9fde88..e272c90 100644
--- a/arch/x86/include/asm/types.h
+++ b/arch/x86/include/asm/types.h
@@ -36,8 +36,13 @@ typedef unsigned short u16;
 typedef signed int s32;
 typedef unsigned int u32;
 
+#if !defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__)
 typedef signed long long s64;
 typedef unsigned long long u64;
+#else
+typedef __INT64_TYPE__ s64;
+typedef __UINT64_TYPE__ u64;
+#endif
 
 #define BITS_PER_LONG 32
 
diff --git a/config.mk b/config.mk
index 2157537..1ddfdbb 100644
--- a/config.mk
+++ b/config.mk
@@ -57,6 +57,11 @@ ifdef FTRACE
 PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE
 endif
 
+# Allow use of stdint.h if available
+ifneq ($(USE_STDINT),)
+PLATFORM_CPPFLAGS += -DCONFIG_USE_STDINT
+endif
+
 #
 
 RELFLAGS := $(PLATFORM_RELFLAGS)
diff --git a/include/compiler.h b/include/compiler.h
index 2103602..47c296e 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -112,6 +112,14 @@ typedef unsigned int uint;
 
 #else /* !USE_HOSTCC */
 
+#ifdef CONFIG_USE_STDINT
+/* Provided by gcc. */
+#include 
+#else
+/* Type for `void *' pointers. */
+typedef unsigned long int uintptr_t;
+#endif
+
 #include 
 #include 
 #include 
@@ -128,9 +136,6 @@ typedef unsigned int uint;
 #define __WORDSIZE 32
 #endif
 
-/* Type for `void *' pointers. */
-typedef unsigned long int uintptr_t;
-
 #endif /* USE_HOSTCC */
 
 #define likely(x)  __builtin_expect(!!(x), 1)
diff --git a/include/linux/types.h b/include/linux/types.h
index 9aebc4e..c9a8d9a 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -104,7 +104,8 @@ typedef __u8uint8_t;
 typedef__u16   uint16_t;
 typedef__u32   uint32_t;
 
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
+   (!defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__))
 typedef__u64   uint64_t;
 typedef__u64   u_int64_t;
 typedef__s64   int64_t;
@@ -112,6 +113,12 @@ typedef__s64   int64_t;
 
 #endif /* __KERNEL_STRICT_NAMES */
 
+#if defined(CONFIG_USE_STDINT) && defined(__INT64_TYPE__)
+typedef__UINT64_TYPE__ uint64_t;
+typedef__UINT64_TYPE__ u_int64_t;
+typedef__INT64_TYPE__  int64_t;
+#endif
+
 /*
  * Below are truly Linux-specific types that should never collide with
  * any application/library that wants linux/types.h.
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 02/10] Add some standard headers external code might need

2014-10-15 Thread Simon Glass
From: Gabe Black 

inttypes.h defines format specifiers for printf which work with data types of
particular sizes. stdlib.h is currently just a passthrough to malloc.h which
has declarations of the various *alloc functions.

Add the required #define to common.h so that these printf format specifiers
will be made available.

Signed-off-by: Gabe Black 
Reviewed-by: Gabe Black 
Tested-by: Gabe Black 
Reviewed-by: Bill Richardson 
Signed-off-by: Simon Glass 
(Replaced with a GPL version from glibc)

---

 include/common.h   |   3 +
 include/inttypes.h | 287 +
 include/stdlib.h   |  12 +++
 3 files changed, 302 insertions(+)
 create mode 100644 include/inttypes.h
 create mode 100644 include/stdlib.h

diff --git a/include/common.h b/include/common.h
index d5020c8..d8584dd 100644
--- a/include/common.h
+++ b/include/common.h
@@ -86,6 +86,9 @@ typedef volatile unsigned charvu_char;
 #include 
 #include 
 
+/* Bring in printf format macros if inttypes.h is included */
+#define __STDC_FORMAT_MACROS
+
 #ifdef __LP64__
 #define CONFIG_SYS_SUPPORT_64BIT_DATA
 #endif
diff --git a/include/inttypes.h b/include/inttypes.h
new file mode 100644
index 000..e2e569d
--- /dev/null
+++ b/include/inttypes.h
@@ -0,0 +1,287 @@
+/*
+ * Copyright (C) 1997-2001, 2004, 2007 Free Software Foundation, Inc.
+ *
+ * This file is taken from the GNU C Library v2.15, with the unimplemented
+ * functions removed and a few style fixes.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/*
+ * ISO C99: 7.8 Format conversion of integer types 
+ */
+
+#ifndef _INTTYPES_H
+#define _INTTYPES_H1
+
+#include 
+
+/* Get a definition for wchar_t.  But we must not define wchar_t itself.  */
+#ifndef gwchar_t_defined
+# ifdef __cplusplus
+#  define __gwchar_t wchar_t
+# elif defined __WCHAR_TYPE__
+typedef __WCHAR_TYPE__ __gwchar_t;
+# else
+#  define __need_wchar_t
+#  include 
+typedef wchar_t __gwchar_t;
+# endif
+# define gwchar_t_defined  1
+#endif
+
+
+/* The ISO C99 standard specifies that these macros must only be
+   defined if explicitly requested.  */
+#if !defined __cplusplus || defined __STDC_FORMAT_MACROS
+
+#ifdef CONFIG_USE_STDINT
+# if __WORDSIZE == 64
+#  define __PRI64_PREFIX   "l"
+#  define __PRIPTR_PREFIX  "l"
+# else
+#  define __PRI64_PREFIX   "ll"
+#  define __PRIPTR_PREFIX
+# endif
+#else
+/* linux/types.h always uses long long for 64-bit and long for uintptr_t */
+# define __PRI64_PREFIX"ll"
+# define __PRIPTR_PREFIX   "l"
+#endif
+
+/* Macros for printing format specifiers.  */
+
+/* Decimal notation.  */
+# define PRId8 "d"
+# define PRId16"d"
+# define PRId32"d"
+# define PRId64__PRI64_PREFIX "d"
+
+# define PRIdLEAST8"d"
+# define PRIdLEAST16   "d"
+# define PRIdLEAST32   "d"
+# define PRIdLEAST64   __PRI64_PREFIX "d"
+
+# define PRIdFAST8 "d"
+# define PRIdFAST16__PRIPTR_PREFIX "d"
+# define PRIdFAST32__PRIPTR_PREFIX "d"
+# define PRIdFAST64__PRI64_PREFIX "d"
+
+
+# define PRIi8 "i"
+# define PRIi16"i"
+# define PRIi32"i"
+# define PRIi64__PRI64_PREFIX "i"
+
+# define PRIiLEAST8"i"
+# define PRIiLEAST16   "i"
+# define PRIiLEAST32   "i"
+# define PRIiLEAST64   __PRI64_PREFIX "i"
+
+# define PRIiFAST8 "i"
+# define PRIiFAST16__PRIPTR_PREFIX "i"
+# define PRIiFAST32__PRIPTR_PREFIX "i"
+# define PRIiFAST64__PRI64_PREFIX "i"
+
+/* Octal notation.  */
+# define PRIo8 "o"
+# define PRIo16"o"
+# define PRIo32"o"
+# define PRIo64__PRI64_PREFIX "o"
+
+# define PRIoLEAST8"o"
+# define PRIoLEAST16   "o"
+# define PRIoLEAST32   "o"
+# define PRIoLEAST64   __PRI64_PREFIX "o"
+
+# define PRIoFAST8 "o"
+# define PRIoFAST16__PRIPTR_PREFIX "o"
+# define PRIoFAST32__PRIPTR_PREFIX "o"
+# define PRIoFAST64__PRI64_PREFIX "o"
+
+/* Unsigned integers.  */
+# define PRIu8 "u"
+# define PRIu16"u"
+# define PRIu32"u"
+# define PRIu64__PRI64_PREFIX "u"
+
+# define PRIuLEAST8"u"
+# define PRIuLEAST16   "u"
+# define PRIuLEAST32   "u"
+# define PRIuLEAST64   __PRI64_PREFIX "u"
+
+# define PRIuFAST8 "u"
+# define PRIuFAST16__PRIPTR_PREFIX "u"
+# define PRIuFAST32__PRIPTR_PREFIX "u"
+# define PRIuFAST64__PRI64_PREFIX "u"
+
+/* lowercase hexadecimal notation.  */
+# define PRIx8 "x"
+# define PRIx16"x"
+# define PRIx32"x"
+# define PRIx64__PRI64_PREFIX "x"
+
+# define PRIxLEAST8"x"
+# define PRIxLEAST16   "x"
+# define PRIxLEAST32   "x"
+# define PRIxLEAST64   __PRI64_PREFIX "x"
+
+# define PRIxFAST8 "x"
+# define PRIxFAST16__PRIPTR_PREFIX "x"
+# define PRIxFAST32__PRIPTR_PREFIX "x"
+# define PRIxFAST64__PRI64_PREFIX "x"
+
+/* UPPERCASE hexadecimal notation.  */
+# define PRIX8  

[U-Boot] [PATCH 10/10] test: Add a simple test to detected warnings with uint64_t, uintptr_t

2014-10-15 Thread Simon Glass
These types are problematic because they are typically declared in a
non-standard way in U-Boot. For example, U-Boot uses 'long long' for
int64_t even on a 64-bit machine whereas stdint.h uses 'long'.
Similarly, U-Boot always uses 'long' for intptr_t whereas stdint.h mostly
uses 'int'.

This simple test script runs a few toolchains on a few archs to check for
warnings.

Signed-off-by: Simon Glass 
---

 test/stdint/int-types.c  | 13 ++
 test/stdint/test-includes.sh | 58 
 2 files changed, 71 insertions(+)
 create mode 100644 test/stdint/int-types.c
 create mode 100755 test/stdint/test-includes.sh

diff --git a/test/stdint/int-types.c b/test/stdint/int-types.c
new file mode 100644
index 000..2660084
--- /dev/null
+++ b/test/stdint/int-types.c
@@ -0,0 +1,13 @@
+#include 
+#include 
+
+int test_types(void)
+{
+   uintptr_t uintptr = 0;
+   uint64_t uint64 = 0;
+   u64 u64_val = 0;
+
+   printf("uintptr = %" PRIuPTR "\n", uintptr);
+   printf("uint64 = %" PRIu64 "\n", uint64);
+   printf("u64 = %" PRIu64 "\n", u64_val);
+}
diff --git a/test/stdint/test-includes.sh b/test/stdint/test-includes.sh
new file mode 100755
index 000..077bdc7
--- /dev/null
+++ b/test/stdint/test-includes.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+# Test script to check uintptr_t and 64-bit types for warnings
+#
+# It builds a few boards with different toolchains. If there are no warnings
+# then all is well.
+#
+# Usage:
+#
+# Make sure that your toolchains are correct at the bottom of this file
+#
+# Then:
+#  ./test/stdint/test-includes.sh
+
+out=/tmp/test-includes.tmp
+
+try_test() {
+   local board=$1
+   local arch=$2
+   local soc=$3
+   local gcc=$4
+   local flags="$5"
+
+   echo $@
+   if ! which ${gcc} >/dev/null 2>&1; then
+   echo "Not found: ${gcc}"
+   return
+   fi
+
+   rm -rf ${out}
+   mkdir -p ${out}
+   touch ${out}/config.h
+   mkdir -p ${out}/generated
+   touch ${out}/generated/generic-asm-offsets.h
+   mkdir -p ${out}/include/asm
+   ln -s $(pwd)/arch/${arch}/include/asm/arch-${soc} \
+   ${out}/include/asm/arch
+
+   cmd="${gcc} -c -D__KERNEL__ ${flags} \
+   -fno-builtin -ffreestanding \
+   -Iarch/${arch}/include \
+   -Iinclude \
+   -I${out} -I${out}/include \
+   -include configs/${board}.h test/stdint/int-types.c \
+   -o /dev/null"
+   $cmd
+}
+
+# Run a test with and without CONFIG_USE_STDINT
+try_both() {
+   try_test $@
+   try_test $@ -DCONFIG_USE_STDINT
+}
+
+# board arch soc path-to-gcc
+try_both sandbox sandbox - gcc
+try_both coreboot x86 - x86_64-linux-gnu-gcc
+try_both seaboard arm tegra20 
/opt/linaro/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/bin/arm-linux-gnueabihf-gcc
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 07/10] x86: Use correct printf() format string for uintptr_t

2014-10-15 Thread Simon Glass
Use the inttypes header file to provide this.

Signed-off-by: Simon Glass 
---

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

diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c
index 526daaf..faca38f 100644
--- a/arch/x86/lib/relocate.c
+++ b/arch/x86/lib/relocate.c
@@ -16,6 +16,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -94,7 +95,7 @@ int do_elf_reloc_fixups(void)
*offset_ptr_ram += gd->reloc_off;
} else {
debug("   %p: rom reloc %x, ram %p, value %x,"
-   " limit %lx\n", re_src,
+   " limit %" PRIXPTR "\n", re_src,
re_src->r_offset, offset_ptr_ram,
*offset_ptr_ram,
CONFIG_SYS_TEXT_BASE + size);
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 06/10] Tidy up data sizes and function comment in display_options

2014-10-15 Thread Simon Glass
Use inttypes.h and uint64_t to correct the code so that it will not issue
warnings on 64-bit machines where 'uint64_t' is 'unsigned long'.

Signed-off-by: Simon Glass 
---

 include/common.h  | 14 +-
 lib/display_options.c | 14 +-
 2 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/include/common.h b/include/common.h
index 02befa6..3ccde60 100644
--- a/include/common.h
+++ b/include/common.h
@@ -256,7 +256,19 @@ intcpu_init(void);
 /* */
 phys_size_t initdram (int);
 intdisplay_options (void);
-void   print_size(unsigned long long, const char *);
+
+/**
+ * print_size() - Print a size with a suffic
+ *
+ * print sizes as "xxx KiB", "xxx.y KiB", "xxx MiB", "xxx.y MiB",
+ * xxx GiB, xxx.y GiB, etc as needed; allow for optional trailing string
+ * (like "\n")
+ *
+ * @size:  Size to print
+ * @suffix String to print after the size
+ */
+void print_size(uint64_t size, const char *suffix);
+
 int print_buffer(ulong addr, const void *data, uint width, uint count,
 uint linelen);
 
diff --git a/lib/display_options.c b/lib/display_options.c
index 4c0c886..d5d17b2 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -7,6 +7,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -21,15 +22,10 @@ int display_options (void)
return 0;
 }
 
-/*
- * print sizes as "xxx KiB", "xxx.y KiB", "xxx MiB", "xxx.y MiB",
- * xxx GiB, xxx.y GiB, etc as needed; allow for optional trailing string
- * (like "\n")
- */
-void print_size(unsigned long long size, const char *s)
+void print_size(uint64_t size, const char *s)
 {
unsigned long m = 0, n;
-   unsigned long long f;
+   uint64_t f;
static const char names[] = {'E', 'P', 'T', 'G', 'M', 'K'};
unsigned long d = 10 * ARRAY_SIZE(names);
char c = 0;
@@ -43,7 +39,7 @@ void print_size(unsigned long long size, const char *s)
}
 
if (!c) {
-   printf("%llu Bytes%s", size, s);
+   printf("%" PRIu64 " Bytes%s", size, s);
return;
}
 
@@ -127,7 +123,7 @@ int print_buffer(ulong addr, const void *data, uint width, 
uint count,
else
x = lb.uc[i] = *(volatile uint8_t *)data;
 #ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
-   printf(" %0*llx", width * 2, x);
+   printf(" %0*" PRIx64, width * 2, x);
 #else
printf(" %0*x", width * 2, x);
 #endif
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 08/10] scsi: Use correct printf() format string for uintptr_t

2014-10-15 Thread Simon Glass
Use the inttypes header file to provide this.

Signed-off-by: Simon Glass 
---

 common/cmd_scsi.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index b3f7687..cbc107e 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -10,6 +10,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -391,7 +392,7 @@ static ulong scsi_read(int device, lbaint_t blknr, lbaint_t 
blkcnt,
blks=0;
}
debug("scsi_read_ext: startblk " LBAF
- ", blccnt %x buffer %lx\n",
+ ", blccnt %x buffer %" PRIXPTR "\n",
  start, smallblks, buf_addr);
if (scsi_exec(pccb) != true) {
scsi_print_error(pccb);
@@ -401,7 +402,7 @@ static ulong scsi_read(int device, lbaint_t blknr, lbaint_t 
blkcnt,
buf_addr+=pccb->datalen;
} while(blks!=0);
debug("scsi_read_ext: end startblk " LBAF
- ", blccnt %x buffer %lx\n", start, smallblks, buf_addr);
+ ", blccnt %x buffer %" PRIXPTR "\n", start, smallblks, buf_addr);
return(blkcnt);
 }
 
@@ -445,7 +446,7 @@ static ulong scsi_write(int device, lbaint_t blknr,
start += blks;
blks = 0;
}
-   debug("%s: startblk " LBAF ", blccnt %x buffer %lx\n",
+   debug("%s: startblk " LBAF ", blccnt %x buffer %" PRIXPTR "\n",
  __func__, start, smallblks, buf_addr);
if (scsi_exec(pccb) != true) {
scsi_print_error(pccb);
@@ -454,7 +455,7 @@ static ulong scsi_write(int device, lbaint_t blknr,
}
buf_addr += pccb->datalen;
} while (blks != 0);
-   debug("%s: end startblk " LBAF ", blccnt %x buffer %lx\n",
+   debug("%s: end startblk " LBAF ", blccnt %x buffer %" PRIXPTR "\n",
  __func__, start, smallblks, buf_addr);
return blkcnt;
 }
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 03/10] ext4: Use inttypes for printf() string

2014-10-15 Thread Simon Glass
On 64-bit platforms (like sandbox) 64-bit integers may be 'long' rather
than 'long long'. Use the inttypes header to avoid compiler warnings.

Signed-off-by: Simon Glass 
---

 fs/ext4/ext4_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 33d69c9..06a 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -73,7 +74,7 @@ void put_ext4(uint64_t off, void *buf, uint32_t size)
if ((startblock + (size >> log2blksz)) >
(part_offset + fs->total_sect)) {
printf("part_offset is " LBAFU "\n", part_offset);
-   printf("total_sector is %llu\n", fs->total_sect);
+   printf("total_sector is %" PRIu64 "\n", fs->total_sect);
printf("error: overflow occurs\n");
return;
}
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 05/10] Use uint64_t instead of u64 in put_dec()

2014-10-15 Thread Simon Glass
Use the correct type required by do_div().

Signed-off-by: Simon Glass 
---

 lib/vsprintf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 7ec758e..b585713 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -270,7 +270,7 @@ static char *put_dec_full(char *buf, unsigned q)
return buf;
 }
 /* No inlining helps gcc to use registers better */
-static noinline char *put_dec(char *buf, u64 num)
+static noinline char *put_dec(char *buf, uint64_t num)
 {
while (1) {
unsigned rem;
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 09/10] usb: Use correct printf() format string for uintptr_t

2014-10-15 Thread Simon Glass
Use the inttypes header file to provide this.

Signed-off-by: Simon Glass 
---

 common/usb_storage.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/common/usb_storage.c b/common/usb_storage.c
index 6ac358d..eb7706c 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -33,6 +33,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -1071,7 +1072,7 @@ unsigned long usb_stor_read(int device, lbaint_t blknr,
blks = blkcnt;
 
debug("\nusb_read: dev %d startblk " LBAF ", blccnt " LBAF
- " buffer %lx\n", device, start, blks, buf_addr);
+ " buffer %" PRIxPTR "\n", device, start, blks, buf_addr);
 
do {
/* XXX need some comment here */
@@ -1101,7 +1102,7 @@ retry_it:
ss->flags &= ~USB_READY;
 
debug("usb_read: end startblk " LBAF
- ", blccnt %x buffer %lx\n",
+ ", blccnt %x buffer %" PRIxPTR "\n",
  start, smallblks, buf_addr);
 
usb_disable_asynch(0); /* asynch transfer allowed */
@@ -1145,7 +1146,7 @@ unsigned long usb_stor_write(int device, lbaint_t blknr,
blks = blkcnt;
 
debug("\nusb_write: dev %d startblk " LBAF ", blccnt " LBAF
- " buffer %lx\n", device, start, blks, buf_addr);
+ " buffer %" PRIxPTR "\n", device, start, blks, buf_addr);
 
do {
/* If write fails retry for max retry count else
@@ -1176,8 +1177,8 @@ retry_it:
} while (blks != 0);
ss->flags &= ~USB_READY;
 
-   debug("usb_write: end startblk " LBAF ", blccnt %x buffer %lx\n",
- start, smallblks, buf_addr);
+   debug("usb_write: end startblk " LBAF ", blccnt %x buffer %"
+ PRIxPTR "\n", start, smallblks, buf_addr);
 
usb_disable_asynch(0); /* asynch transfer allowed */
if (blkcnt >= USB_MAX_XFER_BLK)
-- 
2.1.0.rc2.206.gedb03e5

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


[U-Boot] [PATCH 04/10] Use uint64_t for time types

2014-10-15 Thread Simon Glass
Unfortunately 'unsigned long long' and 'uint64_t' are not necessarily
compatible on 64-bit machines. Use the correct typedef instead of
writing the supposed type out in full.

Signed-off-by: Simon Glass 
---

 include/common.h |  2 +-
 lib/time.c   | 12 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/common.h b/include/common.h
index d8584dd..02befa6 100644
--- a/include/common.h
+++ b/include/common.h
@@ -776,7 +776,7 @@ voidinvalidate_dcache_all(void);
 void   invalidate_icache_all(void);
 
 /* arch/$(ARCH)/lib/ticks.S */
-unsigned long long get_ticks(void);
+uint64_t get_ticks(void);
 void   wait_ticks(unsigned long);
 
 /* arch/$(ARCH)/lib/time.c */
diff --git a/lib/time.c b/lib/time.c
index c7b0264..fe43ccb 100644
--- a/lib/time.c
+++ b/lib/time.c
@@ -41,7 +41,7 @@ unsigned long notrace timer_read_counter(void)
 extern unsigned long __weak timer_read_counter(void);
 #endif
 
-unsigned long long __weak notrace get_ticks(void)
+uint64_t __weak notrace get_ticks(void)
 {
unsigned long now = timer_read_counter();
 
@@ -49,11 +49,11 @@ unsigned long long __weak notrace get_ticks(void)
if (now < gd->timebase_l)
gd->timebase_h++;
gd->timebase_l = now;
-   return ((unsigned long long)gd->timebase_h << 32) | gd->timebase_l;
+   return ((uint64_t)gd->timebase_h << 32) | gd->timebase_l;
 }
 
 /* Returns time in milliseconds */
-static unsigned long long notrace tick_to_time(unsigned long long tick)
+static uint64_t notrace tick_to_time(uint64_t tick)
 {
ulong div = get_tbclk();
 
@@ -78,9 +78,9 @@ unsigned long __weak notrace timer_get_us(void)
return tick_to_time(get_ticks() * 1000);
 }
 
-static unsigned long long usec_to_tick(unsigned long usec)
+static uint64_t usec_to_tick(unsigned long usec)
 {
-   unsigned long long tick = usec;
+   uint64_t tick = usec;
tick *= get_tbclk();
do_div(tick, 100);
return tick;
@@ -88,7 +88,7 @@ static unsigned long long usec_to_tick(unsigned long usec)
 
 void __weak __udelay(unsigned long usec)
 {
-   unsigned long long tmp;
+   uint64_t tmp;
 
tmp = get_ticks() + usec_to_tick(usec); /* get current timestamp */
 
-- 
2.1.0.rc2.206.gedb03e5

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


Re: [U-Boot] [PATCH] ARM: bootm: Allow booting in secure mode on hyp capable systems

2014-10-15 Thread Siarhei Siamashka
On Wed, 15 Oct 2014 11:31:44 +0100
Marc Zyngier  wrote:

> On Wed, Oct 15 2014 at 11:25:10 AM, Siarhei Siamashka 
>  wrote:
> > On Wed, 15 Oct 2014 12:13:05 +0200
> > Hans de Goede  wrote:
> >
> >> Older Linux kernels will not properly boot in hype mode, add support for a
> >> bootm_boot_mode environment variable, which when set to "sec" will cause
> >> u-boot to boot in secure mode even when build with non-sec (and hyp) 
> >> support.
> >> 
> >> Signed-off-by: Hans de Goede 
> >> ---
> >>  arch/arm/lib/bootm.c | 23 ++-
> >>  1 file changed, 18 insertions(+), 5 deletions(-)
> >> 
> >> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> >> index 39fe7a1..037fc8d 100644
> >> --- a/arch/arm/lib/bootm.c
> >> +++ b/arch/arm/lib/bootm.c
> >> @@ -235,6 +235,18 @@ static void boot_prep_linux(bootm_headers_t *images)
> >>}
> >>  }
> >>  
> >> +#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> >> +static bool boot_nonsec(void)
> >> +{
> >> +  char *s = getenv("bootm_boot_mode");
> >> +
> >> +  if (s && !strcmp(s, "sec"))
> >> +  return false;
> >> +
> >> +  return true;
> >> +}
> >> +#endif
> >> +
> >>  /* Subcommand: GO */
> >>  static void boot_jump_linux(bootm_headers_t *images, int flag)
> >>  {
> >> @@ -283,12 +295,13 @@ static void boot_jump_linux(bootm_headers_t *images, 
> >> int flag)
> >>  
> >>if (!fake) {
> >>  #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> >> -  armv7_init_nonsec();
> >> -  secure_ram_addr(_do_nonsec_entry)(kernel_entry,
> >> -0, machid, r2);
> >> -#else
> >> -  kernel_entry(0, machid, r2);
> >> +  if (boot_nonsec()) {
> >> +  armv7_init_nonsec();
> >> +  secure_ram_addr(_do_nonsec_entry)(kernel_entry,
> >> +0, machid, r2);
> >> +  }
> >>  #endif
> >> +  kernel_entry(0, machid, r2);
> >>}
> >>  #endif
> >>  }
> >
> > BTW, I'm currently achieving the same result, but without the need to do
> > extra environment configuration gymnastics for the end users:
> > 
> > https://github.com/ssvb/u-boot-sunxi-dram/commit/e914abe551e712a59a8fc1ac9a4b8490e8e7c866
> 
> And thus preventing kernels with appended DT (not provided by u-boot),
> but still using HYP/non-sec/PSCI from booting.
> 
> Sorry, but using DT as a way to distinguish between all these cases is
> just wrong.
> 
> Thanks,

Do you see the HACK prefix in the summary of that patch?

Or are you saying that it is really impossible to distinguish your
use case of having the appended DT without resorting to the use of the
environment config options?

-- 
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] ARM: bootm: Allow booting in secure mode on hyp capable systems

2014-10-15 Thread Marc Zyngier
On Wed, Oct 15 2014 at 11:25:43 AM, Albert ARIBAUD  
wrote:
> Hi Marc, Hans,
>
> On Wed, 15 Oct 2014 11:18:28 +0100, Marc Zyngier 
> wrote:
>
>> On Wed, Oct 15 2014 at 11:13:05 AM, Hans de Goede  
>> wrote:
>> > Older Linux kernels will not properly boot in hype mode, add support for a
>> > bootm_boot_mode environment variable, which when set to "sec" will cause
>> > u-boot to boot in secure mode even when build with non-sec (and hyp) 
>> > support.
>> >
>> > Signed-off-by: Hans de Goede 
>> 
>> Looks good to me.
>> 
>> Acked-by: Marc Zyngier 
>> 
>>  M.
>
> Should we consider this a bugfix? For instance, hHow old are these
> "older kernels"?

No idea. Probably in the low 3.x range, for x <= 4. Not sure if that's a
bug fix though...

M.
-- 
Jazz is not dead. It just smells funny.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] sunxi: Add CONFIG_MACH_TYPE defines to sun4i, sun5i and sun7i

2014-10-15 Thread Siarhei Siamashka
On Mon, 13 Oct 2014 14:55:35 +0200
Hans de Goede  wrote:

> Many people are still using old linux-sunxi-3.4 kernels on sunxi devices,
> adding the proper MACH_TYPE defines for this allows people to switch to
> upstream u-boot, so that we can stop maintaining the linux-sunxi u-boot fork.
> 
> These machine-ids are all properly registered at:
> 
> http://www.arm.linux.org.uk/developer/machines/
> 
> Signed-off-by: Hans de Goede 
> ---
>  include/configs/sun4i.h | 1 +
>  include/configs/sun5i.h | 1 +
>  include/configs/sun7i.h | 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/include/configs/sun4i.h b/include/configs/sun4i.h
> index 5611ecc..d0191a3 100644
> --- a/include/configs/sun4i.h
> +++ b/include/configs/sun4i.h
> @@ -15,6 +15,7 @@
>  #define CONFIG_CLK_FULL_SPEED100800
>  
>  #define CONFIG_SYS_PROMPT"sun4i# "
> +#define CONFIG_MACH_TYPE 4104
>  
>  #ifdef CONFIG_USB_EHCI
>  #define CONFIG_USB_EHCI_SUNXI
> diff --git a/include/configs/sun5i.h b/include/configs/sun5i.h
> index 6066371..7b683e9 100644
> --- a/include/configs/sun5i.h
> +++ b/include/configs/sun5i.h
> @@ -15,6 +15,7 @@
>  #define CONFIG_CLK_FULL_SPEED100800
>  
>  #define CONFIG_SYS_PROMPT"sun5i# "
> +#define CONFIG_MACH_TYPE 4138
>  
>  #ifdef CONFIG_USB_EHCI
>  #define CONFIG_USB_EHCI_SUNXI
> diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
> index a902b84..966cbd8 100644
> --- a/include/configs/sun7i.h
> +++ b/include/configs/sun7i.h
> @@ -16,6 +16,7 @@
>  #define CONFIG_CLK_FULL_SPEED91200
>  
>  #define CONFIG_SYS_PROMPT"sun7i# "
> +#define CONFIG_MACH_TYPE 4283
>  
>  #ifdef CONFIG_USB_EHCI
>  #define CONFIG_USB_EHCI_SUNXI

This patch is just trying to remove the safety guards (which exist
there for a reason!) without addressing the real compatibility
issues. This is a very bad idea in my opinion. We can do a better
job.

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


[U-Boot] [PATCH] lcd: Fix build error with CONFIG_LCD_BMP_RLE8

2014-10-15 Thread Simon Glass
Add a block to avoid a build error with the variable declaration.
Enable the option on sandbox to prevent an error being introduced in
future.

Signed-off-by: Simon Glass 
---

 common/lcd.c  | 4 ++--
 include/configs/sandbox.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 217ec9d..689d30e 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -1023,7 +1023,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
 
switch (bmp_bpix) {
case 1: /* pass through */
-   case 8:
+   case 8: {
 #ifdef CONFIG_LCD_BMP_RLE8
u32 compression = get_unaligned_le32(&bmp->header.compression);
if (compression == BMP_BI_RLE8) {
@@ -1056,7 +1056,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
fb -= byte_width + lcd_line_length;
}
break;
-
+   }
 #if defined(CONFIG_BMP_16BPP)
case 16:
for (i = 0; i < height; ++i) {
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 6972643..022629f 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -172,6 +172,7 @@
 #define CONFIG_CONSOLE_MUX
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 #define LCD_BPPLCD_COLOR16
+#define CONFIG_LCD_BMP_RLE8
 
 #define CONFIG_CROS_EC_KEYB
 #define CONFIG_KEYBOARD
-- 
2.1.0.rc2.206.gedb03e5

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


Re: [U-Boot] [PATCH for-next] arndale: Enable config_distro_defaults.h

2014-10-15 Thread Simon Glass
Hi Ian,

On 15 October 2014 10:57, Ian Campbell  wrote:
> On Fri, 2014-09-26 at 15:25 +0100, Ian Campbell wrote:
>> From: Ian Campbell 
>>
>> ...and remove explicit setting of things which this implies.
>>
>> I'm mainly interested in CONFIG_CMD_BOOTZ and CONFIG_SUPPORT_RAW_INITRD
>>
>> Signed-off-by: Ian Campbell 
>
> So it seems I need to rebase this over "config: Move arndale to use
> common exynos5250 file" which has made me wonder where in the chain
> arndale.h -> exynos5250-common.h -> exynos5-common.h -> exynos-common.h
> it would be appropriate to introduce the common config stuff.
>
> Since config_cmd_default.h is in exynos-common.h my initial thought
> would be to do both distro_defaults and distro_bootcmd in
> exynos-common.h. Sound sane?

I like that idea.

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


Re: [U-Boot] [PATCH] ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux tables

2014-10-15 Thread Albert ARIBAUD
Hi Tom,

On Tue, 14 Oct 2014 23:14:24 +, Tom Warren 
wrote:

> Albert,
> 
> Please pull u-boot-tegra/master into ARM/master. Thanks!
> 
> The following changes since commit a7f99bf139b3aaa0d5494693fd0395084355e41a:
> 
>   arm: Fix _start for CONFIG_SYS_DV_NOR_BOOT_CFG (2014-09-11 18:04:39 +0200)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-tegra.git master
> 
> for you to fetch changes up to 90a565acf3a18c61170ec0e0b2046c98cb7ecc85:
> 
>   arm: tegra: initial support for apalis t30 (2014-09-17 11:15:04 -0700)
> 
> 
> Marcel Ziswiler (1):
>   arm: tegra: initial support for apalis t30
> 
> Stephen Warren (1):
>   ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux tables

This new board fails when I merge this branch to u-boot-arm/master,
with the following diagnostics:

include/configs/apalis_t30.h:17:0: warning: "CONFIG_OF_SEPARATE"
redefined [enabled by default]
In file included
from /home/albert.u.boot/src/u-boot-arm/include/linux/kconfig.h:4:0,
 from :0:
include/generated/autoconf.h:8:0: note: this is the location of the
previous definition

(actually, there is a lot of these, for various config options)

Device Tree Source is not correctly specified.
Please define 'CONFIG_DEFAULT_DEVICE_TREE'
or build with 'DEVICE_TREE=' argument

(This one is fatal even though it does not explicitly state "error:")

This failure does not happen on the tegra branch; it is obviously due
to the Kbuild stuff.

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


Re: [U-Boot] [PATCH] ARM: bootm: Allow booting in secure mode on hyp capable systems

2014-10-15 Thread Marc Zyngier
On Wed, Oct 15 2014 at 11:40:24 AM, Siarhei Siamashka 
 wrote:
> On Wed, 15 Oct 2014 11:31:44 +0100
> Marc Zyngier  wrote:
>
>> On Wed, Oct 15 2014 at 11:25:10 AM, Siarhei Siamashka
>>  wrote:
>> > On Wed, 15 Oct 2014 12:13:05 +0200
>> > Hans de Goede  wrote:
>> >
>> >> Older Linux kernels will not properly boot in hype mode, add support for a
>> >> bootm_boot_mode environment variable, which when set to "sec" will cause
>> >> u-boot to boot in secure mode even when build with non-sec (and hyp) 
>> >> support.
>> >> 
>> >> Signed-off-by: Hans de Goede 
>> >> ---
>> >>  arch/arm/lib/bootm.c | 23 ++-
>> >>  1 file changed, 18 insertions(+), 5 deletions(-)
>> >> 
>> >> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
>> >> index 39fe7a1..037fc8d 100644
>> >> --- a/arch/arm/lib/bootm.c
>> >> +++ b/arch/arm/lib/bootm.c
>> >> @@ -235,6 +235,18 @@ static void boot_prep_linux(bootm_headers_t *images)
>> >>   }
>> >>  }
>> >>  
>> >> +#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
>> >> +static bool boot_nonsec(void)
>> >> +{
>> >> + char *s = getenv("bootm_boot_mode");
>> >> +
>> >> + if (s && !strcmp(s, "sec"))
>> >> + return false;
>> >> +
>> >> + return true;
>> >> +}
>> >> +#endif
>> >> +
>> >>  /* Subcommand: GO */
>> >>  static void boot_jump_linux(bootm_headers_t *images, int flag)
>> >>  {
>> >> @@ -283,12 +295,13 @@ static void boot_jump_linux(bootm_headers_t 
>> >> *images, int flag)
>> >>  
>> >>   if (!fake) {
>> >>  #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
>> >> - armv7_init_nonsec();
>> >> - secure_ram_addr(_do_nonsec_entry)(kernel_entry,
>> >> -   0, machid, r2);
>> >> -#else
>> >> - kernel_entry(0, machid, r2);
>> >> + if (boot_nonsec()) {
>> >> + armv7_init_nonsec();
>> >> + secure_ram_addr(_do_nonsec_entry)(kernel_entry,
>> >> +   0, machid, r2);
>> >> + }
>> >>  #endif
>> >> + kernel_entry(0, machid, r2);
>> >>   }
>> >>  #endif
>> >>  }
>> >
>> > BTW, I'm currently achieving the same result, but without the need to do
>> > extra environment configuration gymnastics for the end users:
>> > 
>> > https://github.com/ssvb/u-boot-sunxi-dram/commit/e914abe551e712a59a8fc1ac9a4b8490e8e7c866
>> 
>> And thus preventing kernels with appended DT (not provided by u-boot),
>> but still using HYP/non-sec/PSCI from booting.
>> 
>> Sorry, but using DT as a way to distinguish between all these cases is
>> just wrong.
>> 
>> Thanks,
>
> Do you see the HACK prefix in the summary of that patch?

I do. But the fact that you even mention it here makes me think that you
believe it is a better approach that Hans'.

> Or are you saying that it is really impossible to distinguish your
> use case of having the appended DT without resorting to the use of the
> environment config options?

Think of it. How do you find out about what the kernel wants? This is
just a blob...

M.
-- 
Jazz is not dead. It just smells funny.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] buildman: display list of boards with warnings/errors during build?

2014-10-15 Thread Simon Glass
Hi Albert,

On 15 October 2014 12:17, Albert ARIBAUD  wrote:
> Hi Simon,
>
> On Wed, 15 Oct 2014 09:24:34 +0200, Simon Glass 
> wrote:
>
>> Hi Albert,
>>
>> On 15 October 2014 08:28, Albert ARIBAUD  wrote:
>> > Hello,
>> >
>> > Apologies if I have missed the answer to my question in
>> > tools/buildman/README or the buildman -h output.
>>
>> Also -H which gives the full README.
>>
>> >
>> > When buildman runs on a large set of boards (such as when I run
>> > 'tools/buildman/buildman -k aarch64 arm') it shows a summary of how
>> > many boards so far have built fine, built with warnings and built with
>> > errors, which is good, and a list of notes, warnings and errors emitted
>> > by the compiler so far, which is good when building branches. But when
>> > building architectures, as I do, I would prefer that buildman just list
>> > the boards that have failed clean building (and list them again when
>> > invoked with -s)
>> >
>> > Did I just miss the option or option combination which produces this,
>> > or should I go and patch buildman to add such an option?
>>
>> Does -l do what you want?
>
> Not exactly: -l does list the failing boards, but it does so as
> they are found, mixing the warning and error cases. MAKEALL lists them
> at the end, in a summary, where all boards with warning are listed
> together and so are all boards with errors. I don't mind getting the
> list displayed before the end, for instance each time a new board
> fails, but I really would like it to be grouped by failure type
> (warning or error) and ideally, sorted in alphabetical board name order.
>
> Also, -l apparently does not prevent all notes, warnings and error
> diagnostics from being emitted by the compiler during builds.
>
> Plus, with -l, there seems to be a weird bug whereby a single board gets
> listed a bazillion times for a warning.
>
> To make things easier, I have pushed the commit I am using with
> buildman as branch "buildman_test" on u-boot-arm, and here is the
> command line I use, without -l:
>
> tools/buildman/buildman -o build -k odroid apalis_t30
> tricorder_flash tricorder edminiv2 wireless_space
>
> And with -l
>
> tools/buildman/buildman -o build -k odroid apalis_t30
> tricorder_flash tricorder edminiv2 wireless_space -l
>
> The first four boards have warnings or errors (the last two ones are
> just added as known guild build cases) with gcc version 4.8.2
> (Ubuntu/Linaro 4.8.2-16ubuntu4).

OK I see. I think this is a bit wrong at the moment - I pushed a few
patches to u-boot-x86 in branch 'buildman' for you to try.

>
> Again, if this is not possible, I am willing to contribute a patch to
> get it done.

Well beyond the possible fixes I just pushed, yes it would be great if
you could implement the features you need.

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


Re: [U-Boot] [PATCH] ARM: bootm: Allow booting in secure mode on hyp capable systems

2014-10-15 Thread Siarhei Siamashka
On Wed, 15 Oct 2014 13:42:33 +0100
Marc Zyngier  wrote:

> On Wed, Oct 15 2014 at 11:40:24 AM, Siarhei Siamashka 
>  wrote:
> > On Wed, 15 Oct 2014 11:31:44 +0100
> > Marc Zyngier  wrote:
> >
> >> On Wed, Oct 15 2014 at 11:25:10 AM, Siarhei Siamashka
> >>  wrote:
> >> > On Wed, 15 Oct 2014 12:13:05 +0200
> >> > Hans de Goede  wrote:
> >> >
> >> >> Older Linux kernels will not properly boot in hype mode, add support 
> >> >> for a
> >> >> bootm_boot_mode environment variable, which when set to "sec" will cause
> >> >> u-boot to boot in secure mode even when build with non-sec (and hyp) 
> >> >> support.
> >> >> 
> >> >> Signed-off-by: Hans de Goede 
> >> >> ---
> >> >>  arch/arm/lib/bootm.c | 23 ++-
> >> >>  1 file changed, 18 insertions(+), 5 deletions(-)
> >> >> 
> >> >> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> >> >> index 39fe7a1..037fc8d 100644
> >> >> --- a/arch/arm/lib/bootm.c
> >> >> +++ b/arch/arm/lib/bootm.c
> >> >> @@ -235,6 +235,18 @@ static void boot_prep_linux(bootm_headers_t 
> >> >> *images)
> >> >> }
> >> >>  }
> >> >>  
> >> >> +#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> >> >> +static bool boot_nonsec(void)
> >> >> +{
> >> >> +   char *s = getenv("bootm_boot_mode");
> >> >> +
> >> >> +   if (s && !strcmp(s, "sec"))
> >> >> +   return false;
> >> >> +
> >> >> +   return true;
> >> >> +}
> >> >> +#endif
> >> >> +
> >> >>  /* Subcommand: GO */
> >> >>  static void boot_jump_linux(bootm_headers_t *images, int flag)
> >> >>  {
> >> >> @@ -283,12 +295,13 @@ static void boot_jump_linux(bootm_headers_t 
> >> >> *images, int flag)
> >> >>  
> >> >> if (!fake) {
> >> >>  #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
> >> >> -   armv7_init_nonsec();
> >> >> -   secure_ram_addr(_do_nonsec_entry)(kernel_entry,
> >> >> - 0, machid, r2);
> >> >> -#else
> >> >> -   kernel_entry(0, machid, r2);
> >> >> +   if (boot_nonsec()) {
> >> >> +   armv7_init_nonsec();
> >> >> +   secure_ram_addr(_do_nonsec_entry)(kernel_entry,
> >> >> + 0, machid, 
> >> >> r2);
> >> >> +   }
> >> >>  #endif
> >> >> +   kernel_entry(0, machid, r2);
> >> >> }
> >> >>  #endif
> >> >>  }
> >> >
> >> > BTW, I'm currently achieving the same result, but without the need to do
> >> > extra environment configuration gymnastics for the end users:
> >> > 
> >> > https://github.com/ssvb/u-boot-sunxi-dram/commit/e914abe551e712a59a8fc1ac9a4b8490e8e7c866
> >> 
> >> And thus preventing kernels with appended DT (not provided by u-boot),
> >> but still using HYP/non-sec/PSCI from booting.
> >> 
> >> Sorry, but using DT as a way to distinguish between all these cases is
> >> just wrong.
> >> 
> >> Thanks,
> >
> > Do you see the HACK prefix in the summary of that patch?
> 
> I do. But the fact that you even mention it here makes me think that you
> believe it is a better approach that Hans'.

The need to meddle with the environment variables makes Hans' approach
immensely less useful for the end users.

In your Ivory Tower, you may think that you have resolved the problem.
But in reality, u-boot will still have to be patched before deploying
it to the end users in order to prevent them from running into troubles.

Other than this, are you really happy about granting the users full
rights to allow booting the kernel in the secure mode via a simple
environment variables tweak? Can't it potentially become a security
breach in some scenarios?

> > Or are you saying that it is really impossible to distinguish your
> > use case of having the appended DT without resorting to the use of the
> > environment config options?
> 
> Think of it. How do you find out about what the kernel wants? This is
> just a blob...

The FDT blob has a header with an easily recognisable signature. So we
can see the difference between the FDT and FEX blobs if the blob is
provided to u-boot. And if no blob is provided at all, then we are sure
that it can't be booted by the sunxi-3.4 kernel.

I can see only one theoretically problematic scenario, where u-boot is
provided with the non-FDT and non-FEX blob, but loads a kernel, which
has FDT statically compiled in. How does this actually play with PSCI?
And what about the new device drivers model, which is going to depend
on FDT information itself? Are we really happy allowing to use different
FDT blobs for the u-boot and the kernel in the same system?

Or have I missed something?

Either way, following the least surprise principle, IMHO u-boot should
log the reason for making a decision about whether it is switching to
the non-secure mode or not. This is useful for troubleshooting.

-- 
Best regards,
Siarhei Siamashka
___
U-Boot mailing list
U-Boot@lists

Re: [U-Boot] [PATCH] ARM: bootm: Allow booting in secure mode on hyp capable systems

2014-10-15 Thread Mark Rutland
[...]

> Other than this, are you really happy about granting the users full
> rights to allow booting the kernel in the secure mode via a simple
> environment variables tweak? Can't it potentially become a security
> breach in some scenarios?

U-Boot must be running in secure mode in order to boot a kernel in
secure mode. If U-Boot has been placed in secure mode with such an
option, there is obviously nothing in the secure world to protect. As
the user is in charge of booting the kernel, there is nothing in the
normal world to protect.

There is no security breach here.

> > > Or are you saying that it is really impossible to distinguish your
> > > use case of having the appended DT without resorting to the use of the
> > > environment config options?
> > 
> > Think of it. How do you find out about what the kernel wants? This is
> > just a blob...
> 
> The FDT blob has a header with an easily recognisable signature. So we
> can see the difference between the FDT and FEX blobs if the blob is
> provided to u-boot. And if no blob is provided at all, then we are sure
> that it can't be booted by the sunxi-3.4 kernel.

FEX vs DT is specific to sunxi, whereas an explcit boot mode option is
more generally useful. It is possible to have a kernel which can boot in
either mode, where the security state the kernel runs in is a user
choice, regardless of the presence or absence of a DTB.

Trying to guess how an OS will react and working around that is only
going to cause problems when that OS changes over time.

> I can see only one theoretically problematic scenario, where u-boot is
> provided with the non-FDT and non-FEX blob, but loads a kernel, which
> has FDT statically compiled in. How does this actually play with PSCI?

It would be completely orthogonal, just as the presence or absence of a
DTB is orthogonal to the presence or absence of PSCI

> And what about the new device drivers model, which is going to depend
> on FDT information itself? Are we really happy allowing to use different
> FDT blobs for the u-boot and the kernel in the same system?

There are already differences between what U-Boot needs to know and the
kernel needs to know, e.g. secure peripherals if the kernel is booted in
a non-secure mode. So in general you might need separate DTBs; the
physical address spaces are different.

> Or have I missed something?
> 
> Either way, following the least surprise principle, IMHO u-boot should
> log the reason for making a decision about whether it is switching to
> the non-secure mode or not. This is useful for troubleshooting.

Printing a message would make sense regardless of how the mode is
selected.

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


Re: [U-Boot] [PATCH] powerpc/BSC9132QDS: Enable creation of dynamic partition for NAND and NOR

2014-10-15 Thread York Sun
OK. Please mark old patches superseded.

York


On 10/15/2014 02:04 AM, Kumar Ashish-B37399 wrote:
> Hi York,
> 
> Please see the attached mail.
> Since SPI is not supported by fdt_fixup_mtdparts() same is removed in V2
> 
> Regards
> Ashish
> 
> -Original Message-
> From: Sun York-R58495 
> Sent: Wednesday, October 15, 2014 1:51 AM
> To: Kumar Ashish-B37399
> Cc: Wood Scott-B07421; u-Boot@lists.denx.de
> Subject: Re: [PATCH] powerpc/BSC9132QDS: Enable creation of dynamic partition 
> for NAND and NOR
> 
> On 10/14/2014 01:19 PM, Kumar Ashish-B37399 wrote:
>> Hi York,
>>
>> Yes, I should superseed/reject the below patches
>>
>> http://patchwork.ozlabs.org/patch/391991/
> 
> I think your v2 patch reduced the size of SPI. Please check before you mark 
> them superseded.
> 
> York
> 
>> http://patchwork.ozlabs.org/patch/391990/
>>
>> Regards
>> Ashish
>>
>> -Original Message-
>> From: Sun York-R58495
>> Sent: Wednesday, October 15, 2014 1:44 AM
>> To: Kumar Ashish-B37399; u-Boot@lists.denx.de
>> Cc: Wood Scott-B07421
>> Subject: Re: [PATCH] powerpc/BSC9132QDS: Enable creation of dynamic 
>> partition for NAND and NOR
>>
>> On 10/06/2014 05:54 AM, Ashish Kumar wrote:
>>>  * fdt_fixup_mtdparts is called from ft_board_setup
>>>  * run "mtdparts default" to create NAND, NOR partition on uboot
>>>  * Use mtdparts to create partitions dynamically rather
>>> than using static partitions in device tree
>>>
>>> Signed-off-by: Ashish Kumar 
>>> ---
>>>  board/freescale/bsc9132qds/bsc9132qds.c |   12 
>>>  include/configs/BSC9132QDS.h|   21 +
>>>  2 files changed, 33 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/board/freescale/bsc9132qds/bsc9132qds.c
>>> b/board/freescale/bsc9132qds/bsc9132qds.c
>>> index 10580bc..c88838b 100644
>>> --- a/board/freescale/bsc9132qds/bsc9132qds.c
>>> +++ b/board/freescale/bsc9132qds/bsc9132qds.c
>>> @@ -21,6 +21,9 @@
>>>  #include 
>>>  #include 
>>>  #include 
>>> +#include 
>>> +#include 
>>> +#include 
>>>  
>>>  #ifdef CONFIG_PCI
>>>  #include 
>>> @@ -354,6 +357,12 @@ void fdt_del_node_compat(void *blob, const char
>>> *compatible)  }
>>>  
>>>  #if defined(CONFIG_OF_BOARD_SETUP)
>>> +#ifdef CONFIG_FDT_FIXUP_PARTITIONS
>>> +struct node_info nodes[] = {
>>> +   { "cfi-flash",  MTD_DEV_TYPE_NOR,  },
>>> +   { "fsl,ifc-nand",   MTD_DEV_TYPE_NAND, },
>>> +};
>>> +#endif
>>>  void ft_board_setup(void *blob, bd_t *bd)  {
>>> phys_addr_t base;
>>> @@ -369,6 +378,9 @@ void ft_board_setup(void *blob, bd_t *bd)
>>> #endif
>>>  
>>> fdt_fixup_memory(blob, (u64)base, (u64)size);
>>> +#ifdef CONFIG_FDT_FIXUP_PARTITIONS
>>> +   fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes)); #endif
>>>  
>>> ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
>>> u32 porbmsr = in_be32(&gur->porbmsr); diff --git 
>>> a/include/configs/BSC9132QDS.h b/include/configs/BSC9132QDS.h index
>>> aeded6d..da78a19 100644
>>> --- a/include/configs/BSC9132QDS.h
>>> +++ b/include/configs/BSC9132QDS.h
>>> @@ -630,6 +630,27 @@ combinations. this should be removed later 
>>> #endif
>>>  
>>>  /*
>>> + * Dynamic MTD Partition support with mtdparts  */ #ifndef 
>>> +CONFIG_SYS_NO_FLASH #define CONFIG_MTD_DEVICE #define 
>>> +CONFIG_MTD_PARTITIONS #define CONFIG_CMD_MTDPARTS #define 
>>> +CONFIG_FLASH_CFI_MTD #define MTDIDS_DEFAULT 
>>> +"nor0=8800.nor,nand0=ff80.flash,"
>>> +#define MTDPARTS_DEFAULT "mtdparts=8800.nor:256k(dtb),7m(kernel)," \
>>> +   "55m(fs),1m(uboot);ff80.flash:1m(uboot)," \
>>> +   "8m(kernel),512k(dtb),-(fs)"
>>> +#endif
>>
>>
>> Isn't this patch conflict with your earlier patch?
>> http://patchwork.ozlabs.org/patch/391991/
>>
>> York
>>
> 

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


Re: [U-Boot] [PATCH] ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux tables

2014-10-15 Thread Stephen Warren

On 10/15/2014 05:43 AM, Albert ARIBAUD wrote:

Hi Tom,

On Tue, 14 Oct 2014 23:14:24 +, Tom Warren 
wrote:


Albert,

Please pull u-boot-tegra/master into ARM/master. Thanks!

The following changes since commit a7f99bf139b3aaa0d5494693fd0395084355e41a:

   arm: Fix _start for CONFIG_SYS_DV_NOR_BOOT_CFG (2014-09-11 18:04:39 +0200)

are available in the git repository at:

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

for you to fetch changes up to 90a565acf3a18c61170ec0e0b2046c98cb7ecc85:

   arm: tegra: initial support for apalis t30 (2014-09-17 11:15:04 -0700)


Marcel Ziswiler (1):
   arm: tegra: initial support for apalis t30

Stephen Warren (1):
   ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux tables


This new board fails when I merge this branch to u-boot-arm/master,
with the following diagnostics:

include/configs/apalis_t30.h:17:0: warning: "CONFIG_OF_SEPARATE"
redefined [enabled by default]
In file included
from /home/albert.u.boot/src/u-boot-arm/include/linux/kconfig.h:4:0,
  from :0:
include/generated/autoconf.h:8:0: note: this is the location of the
previous definition

(actually, there is a lot of these, for various config options)

Device Tree Source is not correctly specified.
Please define 'CONFIG_DEFAULT_DEVICE_TREE'
or build with 'DEVICE_TREE=' argument

(This one is fatal even though it does not explicitly state "error:")

This failure does not happen on the tegra branch; it is obviously due
to the Kbuild stuff.


This issue should be fixed by:

https://patchwork.ozlabs.org/patch/398793/
[U-Boot] tegra: apalis_t30: master revamp

However, I would assert that at this point during the release cycle, we 
probably shouldn't be adding new boards/features, but just fixing bugs. 
Perhaps we should drop the Apalis patch completely and re-apply it once 
the release is out?

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


Re: [U-Boot] [PATCH] ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux tables

2014-10-15 Thread Albert ARIBAUD
Hi Stephen,

On Wed, 15 Oct 2014 09:34:49 -0600, Stephen Warren
 wrote:

> On 10/15/2014 05:43 AM, Albert ARIBAUD wrote:
> > Hi Tom,
> >
> > On Tue, 14 Oct 2014 23:14:24 +, Tom Warren 
> > wrote:
> >
> >> Albert,
> >>
> >> Please pull u-boot-tegra/master into ARM/master. Thanks!
> >>
> >> The following changes since commit 
> >> a7f99bf139b3aaa0d5494693fd0395084355e41a:
> >>
> >>arm: Fix _start for CONFIG_SYS_DV_NOR_BOOT_CFG (2014-09-11 18:04:39 
> >> +0200)
> >>
> >> are available in the git repository at:
> >>
> >>git://git.denx.de/u-boot-tegra.git master
> >>
> >> for you to fetch changes up to 90a565acf3a18c61170ec0e0b2046c98cb7ecc85:
> >>
> >>arm: tegra: initial support for apalis t30 (2014-09-17 11:15:04 -0700)
> >>
> >> 
> >> Marcel Ziswiler (1):
> >>arm: tegra: initial support for apalis t30
> >>
> >> Stephen Warren (1):
> >>ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux tables
> >
> > This new board fails when I merge this branch to u-boot-arm/master,
> > with the following diagnostics:
> >
> > include/configs/apalis_t30.h:17:0: warning: "CONFIG_OF_SEPARATE"
> > redefined [enabled by default]
> > In file included
> > from /home/albert.u.boot/src/u-boot-arm/include/linux/kconfig.h:4:0,
> >   from :0:
> > include/generated/autoconf.h:8:0: note: this is the location of the
> > previous definition
> >
> > (actually, there is a lot of these, for various config options)
> >
> > Device Tree Source is not correctly specified.
> > Please define 'CONFIG_DEFAULT_DEVICE_TREE'
> > or build with 'DEVICE_TREE=' argument
> >
> > (This one is fatal even though it does not explicitly state "error:")
> >
> > This failure does not happen on the tegra branch; it is obviously due
> > to the Kbuild stuff.
> 
> This issue should be fixed by:
> 
> https://patchwork.ozlabs.org/patch/398793/
> [U-Boot] tegra: apalis_t30: master revamp
> 
> However, I would assert that at this point during the release cycle, we 
> probably shouldn't be adding new boards/features, but just fixing bugs. 
> Perhaps we should drop the Apalis patch completely and re-apply it once 
> the release is out?

Ok. Should I still apply the TK1 pinmux patch, or should I consider the
whole PR to be for -next?

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


Re: [U-Boot] [PATCH 2/4] ARM: HYP/non-sec: Make armv7_init_nonsec() usable before relocation

2014-10-15 Thread York Sun
On 10/09/2014 01:11 AM, yuantian.t...@freescale.com wrote:
> From: Tang Yuantian 
> 
> Defining variable gic_dist_addr as a globe one prevents function
> armv7_init_nonsec() from being used before relocation which is
> the case in the deep sleep resume process on Freescale QorIQ SoC
> platforms.
> This patch removes this limitation by adding a extra same meaning
> local variable. In this way, no exsiting codes get corrupts.
> 
> Signed-off-by: Tang Yuantian 
> ---
>  arch/arm/cpu/armv7/virt-v7.c | 14 --
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/virt-v7.c b/arch/arm/cpu/armv7/virt-v7.c
> index 651ca40..e1dfce9 100644
> --- a/arch/arm/cpu/armv7/virt-v7.c
> +++ b/arch/arm/cpu/armv7/virt-v7.c
> @@ -75,6 +75,7 @@ int armv7_init_nonsec(void)
>  {
>   unsigned int reg;
>   unsigned itlinesnr, i;
> + unsigned long gic_base_addr;
>  
>   /* check whether the CPU supports the security extensions */
>   reg = read_id_pfr1();
> @@ -89,23 +90,24 @@ int armv7_init_nonsec(void)
>* any access to it will trap.
>*/
>  
> - gic_dist_addr = get_gicd_base_address();
> - if (gic_dist_addr == -1)
> + gic_base_addr = get_gicd_base_address();
> + gic_dist_addr = gic_base_addr;
> + if (gic_base_addr == -1)
>   return -1;
>  
>   /* enable the GIC distributor */
> - writel(readl(gic_dist_addr + GICD_CTLR) | 0x03,
> -gic_dist_addr + GICD_CTLR);
> + writel(readl(gic_base_addr + GICD_CTLR) | 0x03,
> +gic_base_addr + GICD_CTLR);
>  
>   /* TYPER[4:0] contains an encoded number of available interrupts */
> - itlinesnr = readl(gic_dist_addr + GICD_TYPER) & 0x1f;
> + itlinesnr = readl(gic_base_addr + GICD_TYPER) & 0x1f;
>  
>   /* set all bits in the GIC group registers to one to allow access
>* from non-secure state. The first 32 interrupts are private per
>* CPU and will be set later when enabling the GIC for each core
>*/
>   for (i = 1; i <= itlinesnr; i++)
> - writel((unsigned)-1, gic_dist_addr + GICD_IGROUPRn + 4 * i);
> + writel((unsigned)-1, gic_base_addr + GICD_IGROUPRn + 4 * i);
>  
>  #ifndef CONFIG_ARMV7_PSCI
>   smp_set_core_boot_addr((unsigned long)secure_ram_addr(_smp_pen), -1);
> 

Wouldn't it be better to declare gic_dist_base as a local variable? It is only
used once outside function armv7_switch_nonsec(). It could be replaced with
get_gicd_base_address() call.

York

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


[U-Boot] [PATCH V2 0/5] Add EXT filesystem support to SPL

2014-10-15 Thread Guillaume GARDET
Changes in V2:
 * Rebase on v2014.10

V1 :
 * This patch set adds EXT filesystem support to SPL and enables it for OMAP4 
boards.
 * Build is succesful on all omap4 and omap5 boards.
 * Note that some OMAP3 boards (omap3_beagle and omap3_overo) may need to 
disable some functions in order to support EXT in SPL, otherwise the MLO (SPL) 
may be too big to fit in SRAM.
 * I tested it succesfully on a Pandaboard (rev. A3) and on a Beagleboard xM 
(rev. B).

Signed-off-by: Guillaume GARDET 
Cc: Tom Rini 


Regards,

Guillaume

---

Guillaume GARDET (5):
  Rename some defines containing FAT in their name to be filesystem
generic MMCSD_MODE_FAT => MMCSD_MODE_FS
CONFIG_SPL_FAT_LOAD_ARGS_NAME => CONFIG_SPL_FS_LOAD_ARGS_NAME
CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME => CONFIG_SPL_FS_LOAD_PAYLOAD_NAME 
   CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION =>
CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION
  spl: Add EXT support to SPL
  doc: Update documentation according to the EXT SPL support patch set
  spl: do not hang in spl_register_fat_device but return error value.   
 It allows to use both CONFIG_SPL_FAT_SUPPORT and
CONFIG_SPL_EXT_SUPPORT.
  TI:OMAP4: enable EXT support in SPL for OMAP4 boards

 README   |  17 ++--
 arch/arm/cpu/arm1136/mx35/generic.c  |   2 +-
 arch/arm/cpu/armv7/omap-common/boot-common.c |   4 +-
 arch/arm/cpu/armv7/omap3/board.c |   2 +-
 arch/arm/cpu/armv7/zynq/spl.c|   2 +-
 arch/arm/cpu/at91-common/spl.c   |   2 +-
 arch/arm/imx-common/spl.c|   2 +-
 common/spl/Makefile  |   1 +
 common/spl/spl_ext.c | 138 +++
 common/spl/spl_fat.c |   8 +-
 common/spl/spl_mmc.c |  24 -
 common/spl/spl_sata.c|   2 +-
 common/spl/spl_usb.c |   2 +-
 doc/README.SPL   |   1 +
 fs/Makefile  |   1 +
 include/configs/am3517_crane.h   |   4 +-
 include/configs/am3517_evm.h |   4 +-
 include/configs/cm_t35.h |   4 +-
 include/configs/devkit8000.h |   8 +-
 include/configs/imx6_spl.h   |   4 +-
 include/configs/mcx.h|   4 +-
 include/configs/omap3_evm.h  |   4 +-
 include/configs/omap3_evm_quick_mmc.h|   4 +-
 include/configs/sama5d3_xplained.h   |   4 +-
 include/configs/sama5d3xek.h |   4 +-
 include/configs/siemens-am33x-common.h   |   4 +-
 include/configs/tao3530.h|   4 +-
 include/configs/ti814x_evm.h |   4 +-
 include/configs/ti816x_evm.h |   4 +-
 include/configs/ti_armv7_common.h|   8 +-
 include/configs/ti_omap4_common.h|   3 +
 include/configs/tricorder.h  |   4 +-
 include/configs/zynq-common.h|   8 +-
 include/spl.h|   6 +-
 34 files changed, 231 insertions(+), 66 deletions(-)
 create mode 100644 common/spl/spl_ext.c

-- 
1.8.4.5

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


[U-Boot] [PATCH V2 1/5] Rename some defines containing FAT in their name to be filesystem generic

2014-10-15 Thread Guillaume GARDET
Rename some defines containing FAT in their name to be filesystem generic:
MMCSD_MODE_FAT => MMCSD_MODE_FS
CONFIG_SPL_FAT_LOAD_ARGS_NAME => CONFIG_SPL_FS_LOAD_ARGS_NAME
CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME => CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION => CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION

Signed-off-by: Guillaume GARDET 
Cc: Tom Rini 

---
 arch/arm/cpu/arm1136/mx35/generic.c  | 2 +-
 arch/arm/cpu/armv7/omap-common/boot-common.c | 4 ++--
 arch/arm/cpu/armv7/omap3/board.c | 2 +-
 arch/arm/cpu/armv7/zynq/spl.c| 2 +-
 arch/arm/cpu/at91-common/spl.c   | 2 +-
 arch/arm/imx-common/spl.c| 2 +-
 common/spl/spl_fat.c | 6 +++---
 common/spl/spl_mmc.c | 8 
 common/spl/spl_sata.c| 2 +-
 common/spl/spl_usb.c | 2 +-
 include/configs/am3517_crane.h   | 4 ++--
 include/configs/am3517_evm.h | 4 ++--
 include/configs/cm_t35.h | 4 ++--
 include/configs/devkit8000.h | 8 
 include/configs/imx6_spl.h   | 4 ++--
 include/configs/mcx.h| 4 ++--
 include/configs/omap3_evm.h  | 4 ++--
 include/configs/omap3_evm_quick_mmc.h| 4 ++--
 include/configs/sama5d3_xplained.h   | 4 ++--
 include/configs/sama5d3xek.h | 4 ++--
 include/configs/siemens-am33x-common.h   | 4 ++--
 include/configs/tao3530.h| 4 ++--
 include/configs/ti814x_evm.h | 4 ++--
 include/configs/ti816x_evm.h | 4 ++--
 include/configs/ti_armv7_common.h| 8 
 include/configs/tricorder.h  | 4 ++--
 include/configs/zynq-common.h| 8 
 include/spl.h| 2 +-
 28 files changed, 57 insertions(+), 57 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx35/generic.c 
b/arch/arm/cpu/arm1136/mx35/generic.c
index 8d3f92c..bc98edd 100644
--- a/arch/arm/cpu/arm1136/mx35/generic.c
+++ b/arch/arm/cpu/arm1136/mx35/generic.c
@@ -531,7 +531,7 @@ u32 spl_boot_mode(void)
switch (spl_boot_device()) {
case BOOT_DEVICE_MMC1:
 #ifdef CONFIG_SPL_FAT_SUPPORT
-   return MMCSD_MODE_FAT;
+   return MMCSD_MODE_FS;
 #else
return MMCSD_MODE_RAW;
 #endif
diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c 
b/arch/arm/cpu/armv7/omap-common/boot-common.c
index 3033564..fb535eb 100644
--- a/arch/arm/cpu/armv7/omap-common/boot-common.c
+++ b/arch/arm/cpu/armv7/omap-common/boot-common.c
@@ -81,8 +81,8 @@ u32 spl_boot_mode(void)
 
if (val == MMCSD_MODE_RAW)
return MMCSD_MODE_RAW;
-   else if (val == MMCSD_MODE_FAT)
-   return MMCSD_MODE_FAT;
+   else if (val == MMCSD_MODE_FS)
+   return MMCSD_MODE_FS;
else
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
return MMCSD_MODE_EMMCBOOT;
diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 667e77f..9bcca9d 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -65,7 +65,7 @@ u32 spl_boot_mode(void)
case BOOT_DEVICE_MMC2:
return MMCSD_MODE_RAW;
case BOOT_DEVICE_MMC1:
-   return MMCSD_MODE_FAT;
+   return MMCSD_MODE_FS;
break;
default:
puts("spl: ERROR:  unknown device - can't select boot mode\n");
diff --git a/arch/arm/cpu/armv7/zynq/spl.c b/arch/arm/cpu/armv7/zynq/spl.c
index 9ff2ef2..31627f9 100644
--- a/arch/arm/cpu/armv7/zynq/spl.c
+++ b/arch/arm/cpu/armv7/zynq/spl.c
@@ -63,7 +63,7 @@ u32 spl_boot_device(void)
 #ifdef CONFIG_SPL_MMC_SUPPORT
 u32 spl_boot_mode(void)
 {
-   return MMCSD_MODE_FAT;
+   return MMCSD_MODE_FS;
 }
 #endif
 
diff --git a/arch/arm/cpu/at91-common/spl.c b/arch/arm/cpu/at91-common/spl.c
index cbb5a52..674a470 100644
--- a/arch/arm/cpu/at91-common/spl.c
+++ b/arch/arm/cpu/at91-common/spl.c
@@ -102,7 +102,7 @@ u32 spl_boot_mode(void)
switch (spl_boot_device()) {
 #ifdef CONFIG_SYS_USE_MMC
case BOOT_DEVICE_MMC1:
-   return MMCSD_MODE_FAT;
+   return MMCSD_MODE_FS;
break;
 #endif
case BOOT_DEVICE_NONE:
diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
index 9a02a64..9d3c31a 100644
--- a/arch/arm/imx-common/spl.c
+++ b/arch/arm/imx-common/spl.c
@@ -68,7 +68,7 @@ u32 spl_boot_mode(void)
case BOOT_DEVICE_MMC1:
case BOOT_DEVICE_MMC2:
 #ifdef CONFIG_SPL_FAT_SUPPORT
-   return MMCSD_MODE_FAT;
+   return MMCSD_MODE_FS;
 #else
return MMCSD_MODE_RAW;
 #endif
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 56be943..91481fc 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -106,18 +106,18 @@ int spl_load_image_fat_os(b

[U-Boot] [PATCH V2 3/5] doc: Update documentation according to the EXT SPL support patch set

2014-10-15 Thread Guillaume GARDET
Update documentation according to the EXT SPL support patch set.

Signed-off-by: Guillaume GARDET 
Cc: Tom Rini 

---
 README | 17 ++---
 doc/README.SPL |  1 +
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/README b/README
index 46def00..43b460c 100644
--- a/README
+++ b/README
@@ -3541,7 +3541,7 @@ FIT uImage format:
 
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR,
CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS,
-   CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION
+   CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION
Address, size and partition on the MMC to load U-Boot from
when the MMC is being used in raw mode.
 
@@ -3558,16 +3558,19 @@ FIT uImage format:
CONFIG_SPL_FAT_SUPPORT
Support for fs/fat/libfat.o in SPL binary
 
-   CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME
-   Filename to read to load U-Boot when reading from FAT
+   CONFIG_SPL_EXT_SUPPORT
+   Support for EXT filesystem in SPL binary
 
-   CONFIG_SPL_FAT_LOAD_KERNEL_NAME
+   CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
+   Filename to read to load U-Boot when reading from filesystem
+
+   CONFIG_SPL_FS_LOAD_KERNEL_NAME
Filename to read to load kernel uImage when reading
-   from FAT (for Falcon mode)
+   from filesystem (for Falcon mode)
 
-   CONFIG_SPL_FAT_LOAD_ARGS_NAME
+   CONFIG_SPL_FS_LOAD_ARGS_NAME
Filename to read to load kernel argument parameters
-   when reading from FAT (for Falcon mode)
+   when reading from filesystem (for Falcon mode)
 
CONFIG_SPL_MPC83XX_WAIT_FOR_NAND
Set this for NAND SPL on PPC mpc83xx targets, so that
diff --git a/doc/README.SPL b/doc/README.SPL
index c283dcf..3ba313c 100644
--- a/doc/README.SPL
+++ b/doc/README.SPL
@@ -54,6 +54,7 @@ CONFIG_SPL_SERIAL_SUPPORT (drivers/serial/libserial.o)
 CONFIG_SPL_SPI_FLASH_SUPPORT (drivers/mtd/spi/libspi_flash.o)
 CONFIG_SPL_SPI_SUPPORT (drivers/spi/libspi.o)
 CONFIG_SPL_FAT_SUPPORT (fs/fat/libfat.o)
+CONFIG_SPL_EXT_SUPPORT
 CONFIG_SPL_LIBGENERIC_SUPPORT (lib/libgeneric.o)
 CONFIG_SPL_POWER_SUPPORT (drivers/power/libpower.o)
 CONFIG_SPL_NAND_SUPPORT (drivers/mtd/nand/libnand.o)
-- 
1.8.4.5

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


[U-Boot] [PATCH V2 2/5] spl: Add EXT support to SPL

2014-10-15 Thread Guillaume GARDET
Add EXT filesystem support to SPL.

Signed-off-by: Guillaume GARDET 
Cc: Tom Rini 

---
 common/spl/Makefile  |   1 +
 common/spl/spl_ext.c | 138 +++
 common/spl/spl_mmc.c |  18 ++-
 fs/Makefile  |   1 +
 include/spl.h|   4 ++
 5 files changed, 160 insertions(+), 2 deletions(-)
 create mode 100644 common/spl/spl_ext.c

diff --git a/common/spl/Makefile b/common/spl/Makefile
index 64569c2..10a4589 100644
--- a/common/spl/Makefile
+++ b/common/spl/Makefile
@@ -18,5 +18,6 @@ obj-$(CONFIG_SPL_NET_SUPPORT) += spl_net.o
 obj-$(CONFIG_SPL_MMC_SUPPORT) += spl_mmc.o
 obj-$(CONFIG_SPL_USB_SUPPORT) += spl_usb.o
 obj-$(CONFIG_SPL_FAT_SUPPORT) += spl_fat.o
+obj-$(CONFIG_SPL_EXT_SUPPORT) += spl_ext.o
 obj-$(CONFIG_SPL_SATA_SUPPORT) += spl_sata.o
 endif
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
new file mode 100644
index 000..7342268
--- /dev/null
+++ b/common/spl/spl_ext.c
@@ -0,0 +1,138 @@
+/*
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifdef CONFIG_SPL_EXT_SUPPORT
+int spl_load_image_ext(block_dev_desc_t *block_dev,
+   int partition,
+   const char *filename)
+{
+   s32 err;
+   struct image_header *header;
+   int filelen;
+   disk_partition_t part_info = {};
+
+   header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
+   sizeof(struct image_header));
+
+   if (get_partition_info(block_dev,
+   partition, &part_info)) {
+   printf("spl: no partition table found\n");
+   goto end;
+   }
+
+   ext4fs_set_blk_dev(block_dev, &part_info);
+
+   err = ext4fs_mount(0);
+   if (!err) {
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+   printf("%s: ext4fs mount err - %d\n", __func__, err);
+#endif
+   goto end;
+   }
+
+   filelen = err = ext4fs_open(filename);
+   if (err < 0) {
+   puts("spl: ext4fs_open failed\n");
+   goto end;
+   }
+   err = ext4fs_read((char *)header, sizeof(struct image_header));
+   if (err <= 0) {
+   puts("spl: ext4fs_read failed\n");
+   goto end;
+   }
+
+   spl_parse_image_header(header);
+
+   err = ext4fs_read((char *)spl_image.load_addr, filelen);
+
+end:
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+   if (err <= 0)
+   printf("%s: error reading image %s, err - %d\n",
+  __func__, filename, err);
+#endif
+
+   return (err <= 0);
+}
+
+#ifdef CONFIG_SPL_OS_BOOT
+int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
+{
+   int err;
+   int filelen;
+   disk_partition_t part_info = {};
+   __maybe_unused char *file;
+   
+   if (get_partition_info(block_dev,
+   partition, &part_info)) {
+   printf("spl: no partition table found\n");
+   return -1;
+   }
+
+   ext4fs_set_blk_dev(block_dev, &part_info);
+
+   err = ext4fs_mount(0);
+   if (!err) {
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+   printf("%s: ext4fs mount err - %d\n", __func__, err);
+#endif
+   return -1;
+   }
+
+#if defined(CONFIG_SPL_ENV_SUPPORT) && defined(CONFIG_SPL_OS_BOOT)
+   file = getenv("falcon_args_file");
+   if (file) {
+   filelen = err = ext4fs_open(file);
+   if (err < 0) {
+   puts("spl: ext4fs_open failed\n");
+   goto defaults;
+   }
+   err = ext4fs_read( (void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
+   if (err <= 0) {
+   printf("spl: error reading image %s, err - %d, falling 
back to default\n",
+  file, err);
+   goto defaults;
+   }
+   file = getenv("falcon_image_file");
+   if (file) {
+   err = spl_load_image_ext(block_dev, partition, file);
+   if (err != 0) {
+   puts("spl: falling back to default\n");
+   goto defaults;
+   }
+
+   return 0;
+   } else
+   puts("spl: falcon_image_file not set in environment, 
falling back to default\n");
+   } else
+   puts("spl: falcon_args_file not set in environment, falling 
back to default\n");
+
+defaults:
+#endif
+
+   filelen = err = ext4fs_open(CONFIG_SPL_FS_LOAD_ARGS_NAME);
+   if (err < 0) {
+   puts("spl: ext4fs_open failed\n");
+   }
+   err = ext4fs_read( (void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen);
+   if (err <= 0) {
+#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+   printf("%s: error reading image %s, err - %d\n",
+

[U-Boot] [PATCH V2 5/5] TI:OMAP4: enable EXT support in SPL for OMAP4 boards

2014-10-15 Thread Guillaume GARDET
Enable EXT support in SPL for OMAP4 boards.
Build tested for duovero, omap4_sdp4430 and omap4_panda.
Run time tested on omap4_panda.

Signed-off-by: Guillaume GARDET 
Cc: Tom Rini 

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

diff --git a/include/configs/ti_omap4_common.h 
b/include/configs/ti_omap4_common.h
index b0f199e..1c93aab 100644
--- a/include/configs/ti_omap4_common.h
+++ b/include/configs/ti_omap4_common.h
@@ -167,6 +167,9 @@
 #define CONFIG_SYS_SPL_ARGS_ADDR   (CONFIG_SYS_SDRAM_BASE + \
 (128 << 20))
 
+/* SPL: Allow to use an EXT partition */
+#define CONFIG_SPL_EXT_SUPPORT
+
 #ifdef CONFIG_NAND
 #define CONFIG_SPL_NAND_AM33XX_BCH /* ELM support */
 #endif
-- 
1.8.4.5

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


[U-Boot] [PATCH V2 4/5] spl: do not hang in spl_register_fat_device but return error value. It allows to use both CONFIG_SPL_FAT_SUPPORT and CONFIG_SPL_EXT_SUPPORT.

2014-10-15 Thread Guillaume GARDET
Do not hang in spl_register_fat_device but return an error value.
It allows to use both CONFIG_SPL_FAT_SUPPORT and CONFIG_SPL_EXT_SUPPORT.
If FAT load fails, then EXT load is tried.

Signed-off-by: Guillaume GARDET 
Cc: Tom Rini 

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

diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 91481fc..350f7d9 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -30,7 +30,7 @@ static int spl_register_fat_device(block_dev_desc_t 
*block_dev, int partition)
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: fat register err - %d\n", __func__, err);
 #endif
-   hang();
+   return err;
}
 
fat_registered = 1;
-- 
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] ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux tables

2014-10-15 Thread Tom Warren
Albert,

I did a Makeall -s tegra before sending the PR (as I always do), and I saw no 
failures. But I haven't rebased against ARM master in a few weeks.

I think the Jetson TK1 change is still valid and should go in.

Thanks,

Tom

> -Original Message-
> From: Albert ARIBAUD [mailto:albert.u.b...@aribaud.net]
> Sent: Wednesday, October 15, 2014 8:40 AM
> To: Stephen Warren
> Cc: Tom Warren; u-boot@lists.denx.de; Simon Glass; Tom Rini; Stephen
> Warren; Thierry Reding
> Subject: Re: [U-Boot] [PATCH] ARM: tegra: add PCIe-related pins to the
> Jetson TK1 pinmux tables
> 
> Hi Stephen,
> 
> On Wed, 15 Oct 2014 09:34:49 -0600, Stephen Warren
>  wrote:
> 
> > On 10/15/2014 05:43 AM, Albert ARIBAUD wrote:
> > > Hi Tom,
> > >
> > > On Tue, 14 Oct 2014 23:14:24 +, Tom Warren 
> > > wrote:
> > >
> > >> Albert,
> > >>
> > >> Please pull u-boot-tegra/master into ARM/master. Thanks!
> > >>
> > >> The following changes since commit
> a7f99bf139b3aaa0d5494693fd0395084355e41a:
> > >>
> > >>arm: Fix _start for CONFIG_SYS_DV_NOR_BOOT_CFG (2014-09-11
> > >> 18:04:39 +0200)
> > >>
> > >> are available in the git repository at:
> > >>
> > >>git://git.denx.de/u-boot-tegra.git master
> > >>
> > >> for you to fetch changes up to
> 90a565acf3a18c61170ec0e0b2046c98cb7ecc85:
> > >>
> > >>arm: tegra: initial support for apalis t30 (2014-09-17 11:15:04
> > >> -0700)
> > >>
> > >> 
> > >> Marcel Ziswiler (1):
> > >>arm: tegra: initial support for apalis t30
> > >>
> > >> Stephen Warren (1):
> > >>ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux
> > >> tables
> > >
> > > This new board fails when I merge this branch to u-boot-arm/master,
> > > with the following diagnostics:
> > >
> > > include/configs/apalis_t30.h:17:0: warning: "CONFIG_OF_SEPARATE"
> > > redefined [enabled by default]
> > > In file included
> > > from /home/albert.u.boot/src/u-boot-arm/include/linux/kconfig.h:4:0,
> > >   from :0:
> > > include/generated/autoconf.h:8:0: note: this is the location of the
> > > previous definition
> > >
> > > (actually, there is a lot of these, for various config options)
> > >
> > > Device Tree Source is not correctly specified.
> > > Please define 'CONFIG_DEFAULT_DEVICE_TREE'
> > > or build with 'DEVICE_TREE=' argument
> > >
> > > (This one is fatal even though it does not explicitly state
> > > "error:")
> > >
> > > This failure does not happen on the tegra branch; it is obviously
> > > due to the Kbuild stuff.
> >
> > This issue should be fixed by:
> >
> > https://patchwork.ozlabs.org/patch/398793/
> > [U-Boot] tegra: apalis_t30: master revamp
> >
> > However, I would assert that at this point during the release cycle,
> > we probably shouldn't be adding new boards/features, but just fixing bugs.
> > Perhaps we should drop the Apalis patch completely and re-apply it
> > once the release is out?
> 
> Ok. Should I still apply the TK1 pinmux patch, or should I consider the whole
> PR to be for -next?
> 
> Amicalement,
> --
> Albert.
---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2][v3] fsl_sec: Add hardware accelerated SHA256 and SHA1

2014-10-15 Thread Simon Glass
Hi,

On 15 October 2014 11:02, Ruchika Gupta  wrote:
> Hi Simon,
>
> I have defined the functions for hardware acceleration  which are already 
> present in hash.c for Freescale platforms.
>
> In hash.c
> static struct hash_algo hash_algo[] = {
> /*
>  * CONFIG_SHA_HW_ACCEL is defined if hardware acceleration is
>  * available.
>  */
> #ifdef CONFIG_SHA_HW_ACCEL
> {
> "sha1",
> SHA1_SUM_LEN,
> hw_sha1,
> CHUNKSZ_SHA1,
> }, {
> "sha256",
> SHA256_SUM_LEN,
> hw_sha256,
> CHUNKSZ_SHA256,
> },
> #endif
> /*
>
> In the patch below, I have added defined the above functions for Freescale 
> platforms.
>
> +void hw_sha256(const unsigned char *pbuf, unsigned int buf_len,
> +   unsigned char *pout, unsigned int chunk_size)
> +{
> +   if (caam_hash(pbuf, buf_len, pout, SHA256))
> +   printf("CAAM was not setup properly or it is faulty\n");
> +}
> +
> +void hw_sha1(const unsigned char *pbuf, unsigned int buf_len,
> +   unsigned char *pout, unsigned int chunk_size)
> +{
> +   if (caam_hash(pbuf, buf_len, pout, SHA1))
> +   printf("CAAM was not setup properly or it is faulty\n");
> +}

OK I see, thanks for explaining this.

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


Re: [U-Boot] buildman: display list of boards with warnings/errors during build?

2014-10-15 Thread Albert ARIBAUD
Hi Simon,

On Wed, 15 Oct 2014 14:44:06 +0200, Simon Glass 
wrote:

> Hi Albert,
> 
> On 15 October 2014 12:17, Albert ARIBAUD  wrote:
> > Hi Simon,
> >
> > On Wed, 15 Oct 2014 09:24:34 +0200, Simon Glass 
> > wrote:
> >
> >> Hi Albert,
> >>
> >> On 15 October 2014 08:28, Albert ARIBAUD  wrote:
> >> > Hello,
> >> >
> >> > Apologies if I have missed the answer to my question in
> >> > tools/buildman/README or the buildman -h output.
> >>
> >> Also -H which gives the full README.
> >>
> >> >
> >> > When buildman runs on a large set of boards (such as when I run
> >> > 'tools/buildman/buildman -k aarch64 arm') it shows a summary of how
> >> > many boards so far have built fine, built with warnings and built with
> >> > errors, which is good, and a list of notes, warnings and errors emitted
> >> > by the compiler so far, which is good when building branches. But when
> >> > building architectures, as I do, I would prefer that buildman just list
> >> > the boards that have failed clean building (and list them again when
> >> > invoked with -s)
> >> >
> >> > Did I just miss the option or option combination which produces this,
> >> > or should I go and patch buildman to add such an option?
> >>
> >> Does -l do what you want?
> >
> > Not exactly: -l does list the failing boards, but it does so as
> > they are found, mixing the warning and error cases. MAKEALL lists them
> > at the end, in a summary, where all boards with warning are listed
> > together and so are all boards with errors. I don't mind getting the
> > list displayed before the end, for instance each time a new board
> > fails, but I really would like it to be grouped by failure type
> > (warning or error) and ideally, sorted in alphabetical board name order.
> >
> > Also, -l apparently does not prevent all notes, warnings and error
> > diagnostics from being emitted by the compiler during builds.
> >
> > Plus, with -l, there seems to be a weird bug whereby a single board gets
> > listed a bazillion times for a warning.
> >
> > To make things easier, I have pushed the commit I am using with
> > buildman as branch "buildman_test" on u-boot-arm, and here is the
> > command line I use, without -l:
> >
> > tools/buildman/buildman -o build -k odroid apalis_t30
> > tricorder_flash tricorder edminiv2 wireless_space
> >
> > And with -l
> >
> > tools/buildman/buildman -o build -k odroid apalis_t30
> > tricorder_flash tricorder edminiv2 wireless_space -l
> >
> > The first four boards have warnings or errors (the last two ones are
> > just added as known guild build cases) with gcc version 4.8.2
> > (Ubuntu/Linaro 4.8.2-16ubuntu4).
> 
> OK I see. I think this is a bit wrong at the moment - I pushed a few
> patches to u-boot-x86 in branch 'buildman' for you to try.

The commit to fix -l works.

The commit to preselect -e only when not in summary mode does not
exactly match what I would like, because I want to hide compiler
diagnostics in summary mode as well as in non-summary mode. IOW, when I
build all of arm+aarch64 I am primarily looking at the list of boards
which fail, not (at this point) at the reason why they do; this I can
find later by looking at the err files.

I guess removing entirely the 'options.show_errors = True' statement
would be better, and anyway, I see one problem in automatically setting
it True despite -e not being specified on the command line: in that
case, the user has no way to set it back to False on the command line.

On the other hand, removing the automatic setting of -e from the
non-branch case causes a call to buildman to just produce the failing
board names, which is close enough to what I want:

$ tools/buildman/buildman -k odroid apalis_t30 tricorder_flash
tricorder edminiv2 wireless_space   
Building current source for 6 boards (6 threads, 2 jobs per thread)
   arm: +   odroid
   arm: +   apalis_t30
   arm: +   tricorder_flash   
   arm: +   tricorder  
213 /6  0:00:05  : tricorder 
$

$ tools/buildman/buildman -k odroid apalis_t30 tricorder_flash
tricorder edminiv2 wireless_space -s

$ tools/buildman/buildman -k odroid apalis_t30 tricorder_flash
tricorder edminiv2 wireless_space -s
boards.cfg is up to date. Nothing to do.
Summary of current source for 6 boards (6 threads, 2 jobs per thread)
   arm: +   tricorder tricorder_flash odroid apalis_t30
$

$ tools/buildman/buildman -k odroid apalis_t30 tricorder_flash
tricorder edminiv2 wireless_space -s -e
boards.cfg is up to date. Nothing to do.
Summary of current source for 6 boards (6 threads, 2 jobs per thread)
   arm: +   tricorder tricorder_flash odroid apalis_t30
[awful lots of notes, warnings, errors]
$

Would it be ok to remove 'options.show_errors = True' altogether in the
non-branch case?

> Regards,
> Simon

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de

Re: [U-Boot] buildman: display list of boards with warnings/errors during build?

2014-10-15 Thread Simon Glass
Hi Albert,

On 15 October 2014 18:30, Albert ARIBAUD  wrote:
> Hi Simon,
>
> On Wed, 15 Oct 2014 14:44:06 +0200, Simon Glass 
> wrote:
>
>> Hi Albert,
>>
>> On 15 October 2014 12:17, Albert ARIBAUD  wrote:
>> > Hi Simon,
>> >
>> > On Wed, 15 Oct 2014 09:24:34 +0200, Simon Glass 
>> > wrote:
>> >
>> >> Hi Albert,
>> >>
>> >> On 15 October 2014 08:28, Albert ARIBAUD  
>> >> wrote:
>> >> > Hello,
>> >> >
>> >> > Apologies if I have missed the answer to my question in
>> >> > tools/buildman/README or the buildman -h output.
>> >>
>> >> Also -H which gives the full README.
>> >>
>> >> >
>> >> > When buildman runs on a large set of boards (such as when I run
>> >> > 'tools/buildman/buildman -k aarch64 arm') it shows a summary of how
>> >> > many boards so far have built fine, built with warnings and built with
>> >> > errors, which is good, and a list of notes, warnings and errors emitted
>> >> > by the compiler so far, which is good when building branches. But when
>> >> > building architectures, as I do, I would prefer that buildman just list
>> >> > the boards that have failed clean building (and list them again when
>> >> > invoked with -s)
>> >> >
>> >> > Did I just miss the option or option combination which produces this,
>> >> > or should I go and patch buildman to add such an option?
>> >>
>> >> Does -l do what you want?
>> >
>> > Not exactly: -l does list the failing boards, but it does so as
>> > they are found, mixing the warning and error cases. MAKEALL lists them
>> > at the end, in a summary, where all boards with warning are listed
>> > together and so are all boards with errors. I don't mind getting the
>> > list displayed before the end, for instance each time a new board
>> > fails, but I really would like it to be grouped by failure type
>> > (warning or error) and ideally, sorted in alphabetical board name order.
>> >
>> > Also, -l apparently does not prevent all notes, warnings and error
>> > diagnostics from being emitted by the compiler during builds.
>> >
>> > Plus, with -l, there seems to be a weird bug whereby a single board gets
>> > listed a bazillion times for a warning.
>> >
>> > To make things easier, I have pushed the commit I am using with
>> > buildman as branch "buildman_test" on u-boot-arm, and here is the
>> > command line I use, without -l:
>> >
>> > tools/buildman/buildman -o build -k odroid apalis_t30
>> > tricorder_flash tricorder edminiv2 wireless_space
>> >
>> > And with -l
>> >
>> > tools/buildman/buildman -o build -k odroid apalis_t30
>> > tricorder_flash tricorder edminiv2 wireless_space -l
>> >
>> > The first four boards have warnings or errors (the last two ones are
>> > just added as known guild build cases) with gcc version 4.8.2
>> > (Ubuntu/Linaro 4.8.2-16ubuntu4).
>>
>> OK I see. I think this is a bit wrong at the moment - I pushed a few
>> patches to u-boot-x86 in branch 'buildman' for you to try.
>
> The commit to fix -l works.
>
> The commit to preselect -e only when not in summary mode does not
> exactly match what I would like, because I want to hide compiler
> diagnostics in summary mode as well as in non-summary mode. IOW, when I
> build all of arm+aarch64 I am primarily looking at the list of boards
> which fail, not (at this point) at the reason why they do; this I can
> find later by looking at the err files.
>
> I guess removing entirely the 'options.show_errors = True' statement
> would be better, and anyway, I see one problem in automatically setting
> it True despite -e not being specified on the command line: in that
> case, the user has no way to set it back to False on the command line.
>
> On the other hand, removing the automatic setting of -e from the
> non-branch case causes a call to buildman to just produce the failing
> board names, which is close enough to what I want:
>
> $ tools/buildman/buildman -k odroid apalis_t30 tricorder_flash
> tricorder edminiv2 wireless_space
> Building current source for 6 boards (6 threads, 2 jobs per thread)
>arm: +   odroid
>arm: +   apalis_t30
>arm: +   tricorder_flash
>arm: +   tricorder
> 213 /6  0:00:05  : tricorder
> $
>
> $ tools/buildman/buildman -k odroid apalis_t30 tricorder_flash
> tricorder edminiv2 wireless_space -s
>
> $ tools/buildman/buildman -k odroid apalis_t30 tricorder_flash
> tricorder edminiv2 wireless_space -s
> boards.cfg is up to date. Nothing to do.
> Summary of current source for 6 boards (6 threads, 2 jobs per thread)
>arm: +   tricorder tricorder_flash odroid apalis_t30
> $
>
> $ tools/buildman/buildman -k odroid apalis_t30 tricorder_flash
> tricorder edminiv2 wireless_space -s -e
> boards.cfg is up to date. Nothing to do.
> Summary of current source for 6 boards (6 threads, 2 jobs per thread)
>arm: +   tricorder tricorder_flash odroid apalis_t30
> [awful lots of notes, warnings, errors]
> $
>
> Would it be ok to remove 'options.show_errors = True' altogether in the
> non-branch ca

Re: [U-Boot] [PATCH] ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux tables

2014-10-15 Thread Albert ARIBAUD
Hi Tom,

On Wed, 15 Oct 2014 15:59:44 +, Tom Warren 
wrote:

> Albert,
> 
> I did a Makeall -s tegra before sending the PR (as I always do), and I saw no 
> failures. But I haven't rebased against ARM master in a few weeks.
> 
> I think the Jetson TK1 change is still valid and should go in.

Ok. Seeing as this is a single patch to pick and board-, not arm-,
specific, maybe Tom (Rini, promoted to To:) can pick it up directly
instead of going through an ARM PR?

> Thanks,
> 
> Tom

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


Re: [U-Boot] [PATCH] ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux tables

2014-10-15 Thread Stephen Warren

On 10/15/2014 09:39 AM, Albert ARIBAUD wrote:

Hi Stephen,

On Wed, 15 Oct 2014 09:34:49 -0600, Stephen Warren
 wrote:


On 10/15/2014 05:43 AM, Albert ARIBAUD wrote:

Hi Tom,

On Tue, 14 Oct 2014 23:14:24 +, Tom Warren 
wrote:


Albert,

Please pull u-boot-tegra/master into ARM/master. Thanks!

The following changes since commit a7f99bf139b3aaa0d5494693fd0395084355e41a:

arm: Fix _start for CONFIG_SYS_DV_NOR_BOOT_CFG (2014-09-11 18:04:39 +0200)

are available in the git repository at:

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

for you to fetch changes up to 90a565acf3a18c61170ec0e0b2046c98cb7ecc85:

arm: tegra: initial support for apalis t30 (2014-09-17 11:15:04 -0700)


Marcel Ziswiler (1):
arm: tegra: initial support for apalis t30

Stephen Warren (1):
ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux tables


This new board fails when I merge this branch to u-boot-arm/master,
with the following diagnostics:

include/configs/apalis_t30.h:17:0: warning: "CONFIG_OF_SEPARATE"
redefined [enabled by default]
In file included
from /home/albert.u.boot/src/u-boot-arm/include/linux/kconfig.h:4:0,
   from :0:
include/generated/autoconf.h:8:0: note: this is the location of the
previous definition

(actually, there is a lot of these, for various config options)

Device Tree Source is not correctly specified.
Please define 'CONFIG_DEFAULT_DEVICE_TREE'
or build with 'DEVICE_TREE=' argument

(This one is fatal even though it does not explicitly state "error:")

This failure does not happen on the tegra branch; it is obviously due
to the Kbuild stuff.


This issue should be fixed by:

https://patchwork.ozlabs.org/patch/398793/
[U-Boot] tegra: apalis_t30: master revamp

However, I would assert that at this point during the release cycle, we
probably shouldn't be adding new boards/features, but just fixing bugs.
Perhaps we should drop the Apalis patch completely and re-apply it once
the release is out?


Ok. Should I still apply the TK1 pinmux patch, or should I consider the
whole PR to be for -next?


I consider the Jetson TK1 pinmux patch a bug-fix; it adds entries that 
always should have been there.

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


Re: [U-Boot] [PATCH] ARM: bootm: Allow booting in secure mode on hyp capable systems

2014-10-15 Thread Marc Zyngier
On Wed, Oct 15 2014 at 03:05:24 PM, Siarhei Siamashka 
 wrote:
> On Wed, 15 Oct 2014 13:42:33 +0100
> Marc Zyngier  wrote:
>
>> On Wed, Oct 15 2014 at 11:40:24 AM, Siarhei Siamashka
>>  wrote:
>> > On Wed, 15 Oct 2014 11:31:44 +0100
>> > Marc Zyngier  wrote:
>> >
>> >> On Wed, Oct 15 2014 at 11:25:10 AM, Siarhei Siamashka
>> >>  wrote:
>> >> > On Wed, 15 Oct 2014 12:13:05 +0200
>> >> > Hans de Goede  wrote:
>> >> >
>> >> >> Older Linux kernels will not properly boot in hype mode, add support 
>> >> >> for a
>> >> >> bootm_boot_mode environment variable, which when set to "sec" will 
>> >> >> cause
>> >> >> u-boot to boot in secure mode even when build with non-sec (and hyp) 
>> >> >> support.
>> >> >> 
>> >> >> Signed-off-by: Hans de Goede 
>> >> >> ---
>> >> >>  arch/arm/lib/bootm.c | 23 ++-
>> >> >>  1 file changed, 18 insertions(+), 5 deletions(-)
>> >> >> 
>> >> >> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
>> >> >> index 39fe7a1..037fc8d 100644
>> >> >> --- a/arch/arm/lib/bootm.c
>> >> >> +++ b/arch/arm/lib/bootm.c
>> >> >> @@ -235,6 +235,18 @@ static void boot_prep_linux(bootm_headers_t 
>> >> >> *images)
>> >> >>}
>> >> >>  }
>> >> >>  
>> >> >> +#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
>> >> >> +static bool boot_nonsec(void)
>> >> >> +{
>> >> >> +  char *s = getenv("bootm_boot_mode");
>> >> >> +
>> >> >> +  if (s && !strcmp(s, "sec"))
>> >> >> +  return false;
>> >> >> +
>> >> >> +  return true;
>> >> >> +}
>> >> >> +#endif
>> >> >> +
>> >> >>  /* Subcommand: GO */
>> >> >>  static void boot_jump_linux(bootm_headers_t *images, int flag)
>> >> >>  {
>> >> >> @@ -283,12 +295,13 @@ static void boot_jump_linux(bootm_headers_t 
>> >> >> *images, int flag)
>> >> >>  
>> >> >>if (!fake) {
>> >> >>  #if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
>> >> >> -  armv7_init_nonsec();
>> >> >> -  secure_ram_addr(_do_nonsec_entry)(kernel_entry,
>> >> >> -0, machid, r2);
>> >> >> -#else
>> >> >> -  kernel_entry(0, machid, r2);
>> >> >> +  if (boot_nonsec()) {
>> >> >> +  armv7_init_nonsec();
>> >> >> +  secure_ram_addr(_do_nonsec_entry)(kernel_entry,
>> >> >> +0, machid, 
>> >> >> r2);
>> >> >> +  }
>> >> >>  #endif
>> >> >> +  kernel_entry(0, machid, r2);
>> >> >>}
>> >> >>  #endif
>> >> >>  }
>> >> >
>> >> > BTW, I'm currently achieving the same result, but without the need to do
>> >> > extra environment configuration gymnastics for the end users:
>> >> > 
>> >> > https://github.com/ssvb/u-boot-sunxi-dram/commit/e914abe551e712a59a8fc1ac9a4b8490e8e7c866
>> >> 
>> >> And thus preventing kernels with appended DT (not provided by u-boot),
>> >> but still using HYP/non-sec/PSCI from booting.
>> >> 
>> >> Sorry, but using DT as a way to distinguish between all these cases is
>> >> just wrong.
>> >> 
>> >> Thanks,
>> >
>> > Do you see the HACK prefix in the summary of that patch?
>> 
>> I do. But the fact that you even mention it here makes me think that you
>> believe it is a better approach that Hans'.
>
> The need to meddle with the environment variables makes Hans' approach
> immensely less useful for the end users.
>
> In your Ivory Tower, you may think that you have resolved the problem.
> But in reality, u-boot will still have to be patched before deploying
> it to the end users in order to prevent them from running into troubles.

My position in a nice ivory tower allows me to see further than you seem
to do, and makes me prefer robust solutions, as opposed to random hacks
that impact unsuspecting users by modifying the way things gets booted
based on decisions made by someone who may or may not have any idea of
what said users are trying to achieve.

Hans' solution is simple, robust, and doesn't randomly change
behaviour. That's definitely good enough for me.

M.
-- 
Jazz is not dead. It just smells funny.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [U-boot] [Patch v5 0/6] keystone2: add k2l SoC and k2l_evm board support

2014-10-15 Thread Ivan Khoronzhuk
This patch series adds Keystone II Lamar (K2L) SoC and k2l_evm
board support.

Based on
"[U-boot] [Patch v2] keystone: usb: add support of usb xhci"
https://patchwork.ozlabs.org/patch/386506/

v5..v4
- ARM: keystone2: spl: move board specific code
this patch replace "ARM: keystone2: spl: add K2L SoC support"
as result of moving board specific code to board directory.

v4..v3
- keystone2: k2l-evm: add board support
remove dimm name reading

v3..v2
- keystone2: k2l-evm: add board support
Add maintainers information
Enable SPL by default

v2..v1
Rebased according to changes of c338f09e965a300ddd78af73e86c4af4c9464ce4
"keystone: kconfig: move board select menu and common settings"

Hao Zhang (6):
  ARM: keystone2: add K2L device hardware definitions
  keystone2: clock: add K2L clock definitions and commands
  keystone2: msmc: add MSMC cache coherency support for K2L SOC
  ARM: keystone2: spl: move board specific code
  keystone2: enable OSR clock domain for K2L SoC
  keystone2: k2l-evm: add board support

 arch/arm/cpu/armv7/keystone/Kconfig|   3 +
 arch/arm/cpu/armv7/keystone/Makefile   |   2 +-
 arch/arm/cpu/armv7/keystone/clock-k2l.c| 138 +
 arch/arm/cpu/armv7/keystone/cmd_clock.c|  10 ++
 arch/arm/cpu/armv7/keystone/init.c |  52 
 arch/arm/cpu/armv7/keystone/spl.c  |  53 
 arch/arm/include/asm/arch-keystone/clock-k2l.h |  94 ++
 arch/arm/include/asm/arch-keystone/clock.h |   4 +
 arch/arm/include/asm/arch-keystone/hardware-k2hk.h |   2 -
 arch/arm/include/asm/arch-keystone/hardware-k2l.h  |  99 +++
 arch/arm/include/asm/arch-keystone/hardware.h  |  14 +++
 arch/arm/include/asm/arch-keystone/spl.h   |  12 --
 board/ti/ks2_evm/Kconfig   |  16 +++
 board/ti/ks2_evm/MAINTAINERS   |   2 +
 board/ti/ks2_evm/Makefile  |   2 +
 board/ti/ks2_evm/board.c   |  19 +++
 board/ti/ks2_evm/board.h   |   1 +
 board/ti/ks2_evm/board_k2e.c   |  11 ++
 board/ti/ks2_evm/board_k2hk.c  |  12 ++
 board/ti/ks2_evm/board_k2l.c   |  72 +++
 board/ti/ks2_evm/ddr3_cfg.c|  36 ++
 board/ti/ks2_evm/ddr3_cfg.h|   3 +
 board/ti/ks2_evm/ddr3_k2l.c|  38 ++
 configs/k2l_evm_defconfig  |   4 +
 include/configs/k2l_evm.h  |  37 ++
 25 files changed, 668 insertions(+), 68 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/keystone/clock-k2l.c
 delete mode 100644 arch/arm/cpu/armv7/keystone/spl.c
 create mode 100644 arch/arm/include/asm/arch-keystone/clock-k2l.h
 create mode 100644 arch/arm/include/asm/arch-keystone/hardware-k2l.h
 delete mode 100644 arch/arm/include/asm/arch-keystone/spl.h
 create mode 100644 board/ti/ks2_evm/board_k2l.c
 create mode 100644 board/ti/ks2_evm/ddr3_k2l.c
 create mode 100644 configs/k2l_evm_defconfig
 create mode 100644 include/configs/k2l_evm.h

-- 
1.8.3.2

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


[U-Boot] [U-boot] [Patch v5 1/6] ARM: keystone2: add K2L device hardware definitions

2014-10-15 Thread Ivan Khoronzhuk
From: Hao Zhang 

This patch adds hardware definitions specific to Keystone II
Lamar (K2L) SoC.

Acked-by: Vitaly Andrianov 
Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---
 arch/arm/include/asm/arch-keystone/hardware-k2hk.h |  2 -
 arch/arm/include/asm/arch-keystone/hardware-k2l.h  | 74 ++
 arch/arm/include/asm/arch-keystone/hardware.h  | 13 
 3 files changed, 87 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-keystone/hardware-k2l.h

diff --git a/arch/arm/include/asm/arch-keystone/hardware-k2hk.h 
b/arch/arm/include/asm/arch-keystone/hardware-k2hk.h
index 43c2c42..2db806c 100644
--- a/arch/arm/include/asm/arch-keystone/hardware-k2hk.h
+++ b/arch/arm/include/asm/arch-keystone/hardware-k2hk.h
@@ -10,8 +10,6 @@
 #ifndef __ASM_ARCH_HARDWARE_K2HK_H
 #define __ASM_ARCH_HARDWARE_K2HK_H
 
-#define KS2_MISC_CTRL  (KS2_DEVICE_STATE_CTRL_BASE + 0xc7c)
-
 #define KS2_ARM_PLL_EN BIT(13)
 
 /* PA SS Registers */
diff --git a/arch/arm/include/asm/arch-keystone/hardware-k2l.h 
b/arch/arm/include/asm/arch-keystone/hardware-k2l.h
new file mode 100644
index 000..3402d0c
--- /dev/null
+++ b/arch/arm/include/asm/arch-keystone/hardware-k2l.h
@@ -0,0 +1,74 @@
+/*
+ * K2L: SoC definitions
+ *
+ * (C) Copyright 2012-2014
+ * Texas Instruments Incorporated, 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_K2L_H
+#define __ASM_ARCH_HARDWARE_K2L_H
+
+#define KS2_ARM_PLL_EN BIT(13)
+
+/* PA SS Registers */
+#define KS2_PASS_BASE  0x2600
+
+/* Power and Sleep Controller (PSC) Domains */
+#define KS2_LPSC_MOD   0
+#define KS2_LPSC_DFE_IQN_SYS   1
+#define KS2_LPSC_USB   2
+#define KS2_LPSC_EMIF25_SPI3
+#define KS2_LPSC_TSIP   4
+#define KS2_LPSC_DEBUGSS_TRC   5
+#define KS2_LPSC_TETB_TRC  6
+#define KS2_LPSC_PKTPROC   7
+#define KS2_LPSC_PAKS2_LPSC_PKTPROC
+#define KS2_LPSC_SGMII 8
+#define KS2_LPSC_CPGMACKS2_LPSC_SGMII
+#define KS2_LPSC_CRYPTO9
+#define KS2_LPSC_PCIE0 10
+#define KS2_LPSC_PCIE1 11
+#define KS2_LPSC_JESD_MISC 12
+#define KS2_LPSC_CHIP_SRSS 13
+#define KS2_LPSC_MSMC  14
+#define KS2_LPSC_GEM_1 16
+#define KS2_LPSC_GEM_2 17
+#define KS2_LPSC_GEM_3 18
+#define KS2_LPSC_EMIF4F_DDR3   23
+#define KS2_LPSC_TAC   25
+#define KS2_LPSC_RAC   26
+#define KS2_LPSC_DDUC4X_CFR2X_BB   27
+#define KS2_LPSC_FFTC_A28
+#define KS2_LPSC_OSR   34
+#define KS2_LPSC_TCP3D_0   35
+#define KS2_LPSC_TCP3D_1   37
+#define KS2_LPSC_VCP2X4_A  39
+#define KS2_LPSC_VCP2X4_B  40
+#define KS2_LPSC_VCP2X4_C  41
+#define KS2_LPSC_VCP2X4_D  42
+#define KS2_LPSC_BCP   47
+#define KS2_LPSC_DPD4X 48
+#define KS2_LPSC_FFTC_B49
+#define KS2_LPSC_IQN_AIL   50
+
+/* Chip Interrupt Controller */
+#define KS2_CIC2_DDR3_ECC_IRQ_NUM  0x0D3
+#define KS2_CIC2_DDR3_ECC_CHAN_NUM 0x01D
+
+/* Number of DSP cores */
+#define KS2_NUM_DSPS   4
+
+/* NETCP pktdma */
+#define KS2_NETCP_PDMA_CTRL_BASE   0x26186000
+#define KS2_NETCP_PDMA_TX_BASE 0x26187000
+#define KS2_NETCP_PDMA_TX_CH_NUM   21
+#define KS2_NETCP_PDMA_RX_BASE 0x26188000
+#define KS2_NETCP_PDMA_RX_CH_NUM   91
+#define KS2_NETCP_PDMA_SCHED_BASE  0x26186100
+#define KS2_NETCP_PDMA_RX_FLOW_BASE0x26189000
+#define KS2_NETCP_PDMA_RX_FLOW_NUM 96
+#define KS2_NETCP_PDMA_TX_SND_QUEUE896
+
+#endif /* __ASM_ARCH_HARDWARE_K2L_H */
diff --git a/arch/arm/include/asm/arch-keystone/hardware.h 
b/arch/arm/include/asm/arch-keystone/hardware.h
index c1642a5..adae69e 100644
--- a/arch/arm/include/asm/arch-keystone/hardware.h
+++ b/arch/arm/include/asm/arch-keystone/hardware.h
@@ -143,6 +143,7 @@ typedef volatile unsigned int   *dv_reg_p;
 /* Device speed */
 #define KS2_REV1_DEVSPEED  (KS2_DEVICE_STATE_CTRL_BASE + 0xc98)
 #define KS2_EFUSE_BOOTROM  (KS2_DEVICE_STATE_CTRL_BASE + 0xc90)
+#define KS2_MISC_CTRL  (KS2_DEVICE_STATE_CTRL_BASE + 0xc7c)
 
 /* Queue manager */
 #define KS2_QM_BASE_ADDRESS0x23a8
@@ -177,6 +178,10 @@ typedef volatile unsigned int   *dv_reg_p;
 #include 
 #endif
 
+#ifdef CONFIG_SOC_K2L
+#include 
+#endif
+
 #ifndef __ASSEMBLY__
 static inline int cpu_is_k2hk(void)
 {
@@ -194,6 +199,14 @@ static inline int cpu_is_k2e(void)
return (part_no == 0xb9a6) ? 1 : 0;
 }
 
+static inline int cpu_is_k2l(void)
+{
+   unsigned int jtag_id= __raw_readl(KS2_JTAG_ID_REG);
+   unsigned in

[U-Boot] [U-boot] [Patch v5 3/6] keystone2: msmc: add MSMC cache coherency support for K2L SOC

2014-10-15 Thread Ivan Khoronzhuk
From: Hao Zhang 

This patch adds Keystone II Lamar (K2L) SoC specific definitions
to support MSMC cache coherency.

Acked-by: Vitaly Andrianov 
Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---
 arch/arm/cpu/armv7/keystone/init.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/cpu/armv7/keystone/init.c 
b/arch/arm/cpu/armv7/keystone/init.c
index a8f8aee..a0ecfa2 100644
--- a/arch/arm/cpu/armv7/keystone/init.c
+++ b/arch/arm/cpu/armv7/keystone/init.c
@@ -32,6 +32,9 @@ int arch_cpu_init(void)
 #ifdef CONFIG_SOC_K2E
msmc_share_all_segments(13); /* PCIE 1 */
 #endif
+#ifdef CONFIG_SOC_K2L
+   msmc_share_all_segments(14); /* PCIE 1 */
+#endif
 
/*
 * just initialise the COM2 port so that TI specific
-- 
1.8.3.2

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


[U-Boot] [U-boot] [Patch v5 6/6] keystone2: k2l-evm: add board support

2014-10-15 Thread Ivan Khoronzhuk
From: Hao Zhang 

This patch adds Keystone II Lammar (K2L) EVM board support.

Acked-by: Vitaly Andrianov 
Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---
 arch/arm/cpu/armv7/keystone/Kconfig|  3 ++
 arch/arm/include/asm/arch-keystone/clock-k2l.h |  6 +++
 board/ti/ks2_evm/Kconfig   | 16 ++
 board/ti/ks2_evm/MAINTAINERS   |  2 +
 board/ti/ks2_evm/Makefile  |  2 +
 board/ti/ks2_evm/board_k2l.c   | 72 ++
 board/ti/ks2_evm/ddr3_cfg.c| 36 +
 board/ti/ks2_evm/ddr3_cfg.h|  3 ++
 board/ti/ks2_evm/ddr3_k2l.c| 38 ++
 configs/k2l_evm_defconfig  |  4 ++
 include/configs/k2l_evm.h  | 37 +
 11 files changed, 219 insertions(+)
 create mode 100644 board/ti/ks2_evm/board_k2l.c
 create mode 100644 board/ti/ks2_evm/ddr3_k2l.c
 create mode 100644 configs/k2l_evm_defconfig
 create mode 100644 include/configs/k2l_evm.h

diff --git a/arch/arm/cpu/armv7/keystone/Kconfig 
b/arch/arm/cpu/armv7/keystone/Kconfig
index 24d0cbe..91211fd 100644
--- a/arch/arm/cpu/armv7/keystone/Kconfig
+++ b/arch/arm/cpu/armv7/keystone/Kconfig
@@ -9,6 +9,9 @@ config TARGET_K2HK_EVM
 config TARGET_K2E_EVM
bool "TI Keystone 2 Edison EVM"
 
+config TARGET_K2L_EVM
+   bool "TI Keystone 2 Lamar EVM"
+
 endchoice
 
 config SYS_CPU
diff --git a/arch/arm/include/asm/arch-keystone/clock-k2l.h 
b/arch/arm/include/asm/arch-keystone/clock-k2l.h
index 8cacee0..b3f4e71 100644
--- a/arch/arm/include/asm/arch-keystone/clock-k2l.h
+++ b/arch/arm/include/asm/arch-keystone/clock-k2l.h
@@ -69,7 +69,9 @@ enum {
 
 #define CORE_PLL_799   {CORE_PLL, 13, 1, 2}
 #define CORE_PLL_983   {CORE_PLL, 16, 1, 2}
+#define CORE_PLL_1000  {CORE_PLL, 114, 7, 2}
 #define CORE_PLL_1167  {CORE_PLL, 19, 1, 2}
+#define CORE_PLL_1198  {CORE_PLL, 39, 2, 2}
 #define CORE_PLL_1228  {CORE_PLL, 20, 1, 2}
 #define PASS_PLL_1228  {PASS_PLL, 20, 1, 2}
 #define PASS_PLL_983   {PASS_PLL, 16, 1, 2}
@@ -78,8 +80,12 @@ enum {
 #define TETRIS_PLL_737 {TETRIS_PLL, 12, 1, 2}
 #define TETRIS_PLL_799 {TETRIS_PLL, 13, 1, 2}
 #define TETRIS_PLL_983 {TETRIS_PLL, 16, 1, 2}
+#define TETRIS_PLL_1000{TETRIS_PLL, 114, 7, 2}
 #define TETRIS_PLL_1167{TETRIS_PLL, 19, 1, 2}
+#define TETRIS_PLL_1198{TETRIS_PLL, 39, 2, 2}
 #define TETRIS_PLL_1228{TETRIS_PLL, 20, 1, 2}
+#define TETRIS_PLL_1352{TETRIS_PLL, 22, 1, 2}
+#define TETRIS_PLL_1401{TETRIS_PLL, 114, 5, 2}
 #define DDR3_PLL_200   {DDR3_PLL, 4, 1, 2}
 #define DDR3_PLL_400   {DDR3_PLL, 16, 1, 4}
 #define DDR3_PLL_800   {DDR3_PLL, 16, 1, 2}
diff --git a/board/ti/ks2_evm/Kconfig b/board/ti/ks2_evm/Kconfig
index 3108782..36c31ff 100644
--- a/board/ti/ks2_evm/Kconfig
+++ b/board/ti/ks2_evm/Kconfig
@@ -29,3 +29,19 @@ config SYS_CONFIG_NAME
default "k2hk_evm"
 
 endif
+
+if TARGET_K2L_EVM
+
+config SYS_BOARD
+   string
+   default "ks2_evm"
+
+config SYS_VENDOR
+   string
+   default "ti"
+
+config SYS_CONFIG_NAME
+   string
+   default "k2l_evm"
+
+endif
diff --git a/board/ti/ks2_evm/MAINTAINERS b/board/ti/ks2_evm/MAINTAINERS
index 595a80a..87c36c9 100644
--- a/board/ti/ks2_evm/MAINTAINERS
+++ b/board/ti/ks2_evm/MAINTAINERS
@@ -6,3 +6,5 @@ F:  include/configs/k2hk_evm.h
 F: configs/k2hk_evm_defconfig
 F: include/configs/k2e_evm.h
 F: configs/k2e_evm_defconfig
+F: include/configs/k2l_evm.h
+F: configs/k2l_evm_defconfig
diff --git a/board/ti/ks2_evm/Makefile b/board/ti/ks2_evm/Makefile
index 00f1164..071dbee 100644
--- a/board/ti/ks2_evm/Makefile
+++ b/board/ti/ks2_evm/Makefile
@@ -11,3 +11,5 @@ obj-$(CONFIG_K2HK_EVM) += board_k2hk.o
 obj-$(CONFIG_K2HK_EVM) += ddr3_k2hk.o
 obj-$(CONFIG_K2E_EVM) += board_k2e.o
 obj-$(CONFIG_K2E_EVM) += ddr3_k2e.o
+obj-$(CONFIG_K2L_EVM) += board_k2l.o
+obj-$(CONFIG_K2L_EVM) += ddr3_k2l.o
diff --git a/board/ti/ks2_evm/board_k2l.c b/board/ti/ks2_evm/board_k2l.c
new file mode 100644
index 000..559d20c
--- /dev/null
+++ b/board/ti/ks2_evm/board_k2l.c
@@ -0,0 +1,72 @@
+/*
+ * K2L EVM : Board initialization
+ *
+ * (C) Copyright 2014
+ * Texas Instruments Incorporated, 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+unsigned int external_clk[ext_clk_count] = {
+   [sys_clk]   = 12288,
+   [alt_core_clk]  = 1,
+   [pa_clk]= 12288,
+   [tetris_clk]= 12288,
+   [ddr3_clk]  = 1,
+   [pcie_clk]  = 1,
+   [sgmii_clk] = 15625,
+   [usb_clk]   = 1,
+};
+
+static struct pll_init_data core_pll_config[] = {
+   CORE_PLL_799,
+   CORE_PLL_1000,
+   CORE_PLL_1198,
+};
+
+static struct pll_init_data tetris_pll_config[] = {
+   TETRIS_PLL_799,
+   TETRIS_PLL_1000,
+   TETRIS_P

[U-Boot] [U-boot] [Patch v5 5/6] keystone2: enable OSR clock domain for K2L SoC

2014-10-15 Thread Ivan Khoronzhuk
From: Hao Zhang 

This patches enables the On-chip Shared Ram clock domain for K2L SoC.

Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---
 arch/arm/cpu/armv7/keystone/init.c| 49 +++
 arch/arm/include/asm/arch-keystone/hardware-k2l.h | 25 
 arch/arm/include/asm/arch-keystone/hardware.h |  1 +
 3 files changed, 75 insertions(+)

diff --git a/arch/arm/cpu/armv7/keystone/init.c 
b/arch/arm/cpu/armv7/keystone/init.c
index a0ecfa2..2228132 100644
--- a/arch/arm/cpu/armv7/keystone/init.c
+++ b/arch/arm/cpu/armv7/keystone/init.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 void chip_configuration_unlock(void)
 {
@@ -20,6 +21,53 @@ void chip_configuration_unlock(void)
__raw_writel(KS2_KICK1_MAGIC, KS2_KICK1);
 }
 
+#ifdef CONFIG_SOC_K2L
+void osr_init(void)
+{
+   u32 i;
+   u32 j;
+   u32 val;
+   u32 base = KS2_OSR_CFG_BASE;
+   u32 ecc_ctrl[KS2_OSR_NUM_RAM_BANKS];
+
+   /* Enable the OSR clock domain */
+   psc_enable_module(KS2_LPSC_OSR);
+
+   /* Disable OSR ECC check for all the ram banks */
+   for (i = 0; i < KS2_OSR_NUM_RAM_BANKS; i++) {
+   val = i | KS2_OSR_ECC_VEC_TRIG_RD |
+   (KS2_OSR_ECC_CTRL << KS2_OSR_ECC_VEC_RD_ADDR_SH);
+
+   writel(val , base + KS2_OSR_ECC_VEC);
+
+   /**
+* wait till read is done.
+* Print should be added after earlyprintk support is added.
+*/
+   for (j = 0; j < 1; j++) {
+   val = readl(base + KS2_OSR_ECC_VEC);
+   if (val & KS2_OSR_ECC_VEC_RD_DONE)
+   break;
+   }
+
+   ecc_ctrl[i] = readl(base + KS2_OSR_ECC_CTRL) ^
+   KS2_OSR_ECC_CTRL_CHK;
+
+   writel(ecc_ctrl[i], KS2_MSMC_DATA_BASE + i * 4);
+   writel(ecc_ctrl[i], base + KS2_OSR_ECC_CTRL);
+   }
+
+   /* Reset OSR memory to all zeros */
+   for (i = 0; i < KS2_OSR_SIZE; i += 4)
+   writel(0, KS2_OSR_DATA_BASE + i);
+
+   /* Enable OSR ECC check for all the ram banks */
+   for (i = 0; i < KS2_OSR_NUM_RAM_BANKS; i++)
+   writel(ecc_ctrl[i] |
+  KS2_OSR_ECC_CTRL_CHK, base + KS2_OSR_ECC_CTRL);
+}
+#endif
+
 int arch_cpu_init(void)
 {
chip_configuration_unlock();
@@ -34,6 +82,7 @@ int arch_cpu_init(void)
 #endif
 #ifdef CONFIG_SOC_K2L
msmc_share_all_segments(14); /* PCIE 1 */
+   osr_init();
 #endif
 
/*
diff --git a/arch/arm/include/asm/arch-keystone/hardware-k2l.h 
b/arch/arm/include/asm/arch-keystone/hardware-k2l.h
index 3402d0c..dfde040 100644
--- a/arch/arm/include/asm/arch-keystone/hardware-k2l.h
+++ b/arch/arm/include/asm/arch-keystone/hardware-k2l.h
@@ -57,6 +57,31 @@
 #define KS2_CIC2_DDR3_ECC_IRQ_NUM  0x0D3
 #define KS2_CIC2_DDR3_ECC_CHAN_NUM 0x01D
 
+/* OSR */
+#define KS2_OSR_DATA_BASE  0x7000  /* OSR data base */
+#define KS2_OSR_CFG_BASE   0x02348c00  /* OSR config base */
+#define KS2_OSR_ECC_VEC0x08/* ECC Vector 
reg */
+#define KS2_OSR_ECC_CTRL   0x14/* ECC control reg */
+
+/* OSR ECC Vector register */
+#define KS2_OSR_ECC_VEC_TRIG_RDBIT(15) /* trigger a 
read op */
+#define KS2_OSR_ECC_VEC_RD_DONEBIT(24) /* read 
complete */
+
+#define KS2_OSR_ECC_VEC_RAM_ID_SH  0   /* RAM ID shift */
+#define KS2_OSR_ECC_VEC_RD_ADDR_SH 16  /* read address shift */
+
+/* OSR ECC control register */
+#define KS2_OSR_ECC_CTRL_ENBIT(0)  /* ECC enable bit */
+#define KS2_OSR_ECC_CTRL_CHK   BIT(1)  /* ECC check bit */
+#define KS2_OSR_ECC_CTRL_RMW   BIT(2)  /* ECC check bit */
+
+/* Number of OSR RAM banks */
+#define KS2_OSR_NUM_RAM_BANKS  4
+
+/* OSR memory size */
+#define KS2_OSR_SIZE   0x10
+
+
 /* Number of DSP cores */
 #define KS2_NUM_DSPS   4
 
diff --git a/arch/arm/include/asm/arch-keystone/hardware.h 
b/arch/arm/include/asm/arch-keystone/hardware.h
index adae69e..29f7bf1 100644
--- a/arch/arm/include/asm/arch-keystone/hardware.h
+++ b/arch/arm/include/asm/arch-keystone/hardware.h
@@ -163,6 +163,7 @@ typedef volatile unsigned int   *dv_reg_p;
 
 /* MSMC control */
 #define KS2_MSMC_CTRL_BASE 0x0bc0
+#define KS2_MSMC_DATA_BASE 0x0c00
 
 /* USB */
 #define KS2_USB_SS_BASE0x0268
-- 
1.8.3.2

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


[U-Boot] [U-boot] [Patch v5 4/6] ARM: keystone2: spl: move board specific code

2014-10-15 Thread Ivan Khoronzhuk
From: Hao Zhang 

The initialization of PLLs is a part of board specific code, so
move it appropriate places.

Acked-by: Vitaly Andrianov 
Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---
 arch/arm/cpu/armv7/keystone/Makefile |  1 -
 arch/arm/cpu/armv7/keystone/spl.c| 53 
 arch/arm/include/asm/arch-keystone/spl.h | 12 
 board/ti/ks2_evm/board.c | 19 
 board/ti/ks2_evm/board.h |  1 +
 board/ti/ks2_evm/board_k2e.c | 11 +++
 board/ti/ks2_evm/board_k2hk.c| 12 
 7 files changed, 43 insertions(+), 66 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/keystone/spl.c
 delete mode 100644 arch/arm/include/asm/arch-keystone/spl.h

diff --git a/arch/arm/cpu/armv7/keystone/Makefile 
b/arch/arm/cpu/armv7/keystone/Makefile
index 4750371..57f6ea6 100644
--- a/arch/arm/cpu/armv7/keystone/Makefile
+++ b/arch/arm/cpu/armv7/keystone/Makefile
@@ -14,6 +14,5 @@ obj-$(CONFIG_SOC_K2L) += clock-k2l.o
 obj-y  += cmd_clock.o
 obj-y  += cmd_mon.o
 obj-y  += msmc.o
-obj-$(CONFIG_SPL_BUILD)+= spl.o
 obj-y  += ddr3.o
 obj-y  += keystone.o
diff --git a/arch/arm/cpu/armv7/keystone/spl.c 
b/arch/arm/cpu/armv7/keystone/spl.c
deleted file mode 100644
index d4b0e9b..000
--- a/arch/arm/cpu/armv7/keystone/spl.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * common spl init code
- *
- * (C) Copyright 2012-2014
- * Texas Instruments Incorporated, 
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#ifdef CONFIG_K2HK_EVM
-static struct pll_init_data spl_pll_config[] = {
-   CORE_PLL_799,
-   TETRIS_PLL_500,
-};
-#endif
-
-#ifdef CONFIG_K2E_EVM
-static struct pll_init_data spl_pll_config[] = {
-   CORE_PLL_800,
-};
-#endif
-
-void spl_init_keystone_plls(void)
-{
-   init_plls(ARRAY_SIZE(spl_pll_config), spl_pll_config);
-}
-
-void spl_board_init(void)
-{
-   spl_init_keystone_plls();
-   preloader_console_init();
-}
-
-u32 spl_boot_device(void)
-{
-#if defined(CONFIG_SPL_SPI_LOAD)
-   return BOOT_DEVICE_SPI;
-#else
-   puts("Unknown boot device\n");
-   hang();
-#endif
-}
diff --git a/arch/arm/include/asm/arch-keystone/spl.h 
b/arch/arm/include/asm/arch-keystone/spl.h
deleted file mode 100644
index a7102d5..000
--- a/arch/arm/include/asm/arch-keystone/spl.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * (C) Copyright 2012-2014
- * Texas Instruments, 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-#ifndef _ASM_ARCH_SPL_H_
-#define _ASM_ARCH_SPL_H_
-
-#define BOOT_DEVICE_SPI2
-
-#endif
diff --git a/board/ti/ks2_evm/board.c b/board/ti/ks2_evm/board.c
index dfe7be6..c07d284 100644
--- a/board/ti/ks2_evm/board.c
+++ b/board/ti/ks2_evm/board.c
@@ -9,6 +9,7 @@
 
 #include "board.h"
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -83,6 +84,24 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_SPL_BUILD
+void spl_board_init(void)
+{
+   spl_init_keystone_plls();
+   preloader_console_init();
+}
+
+u32 spl_boot_device(void)
+{
+#if defined(CONFIG_SPL_SPI_LOAD)
+   return BOOT_DEVICE_SPI;
+#else
+   puts("Unknown boot device\n");
+   hang();
+#endif
+}
+#endif
+
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 void ft_board_setup(void *blob, bd_t *bd)
 {
diff --git a/board/ti/ks2_evm/board.h b/board/ti/ks2_evm/board.h
index d91ef73..7a613ac 100644
--- a/board/ti/ks2_evm/board.h
+++ b/board/ti/ks2_evm/board.h
@@ -15,5 +15,6 @@
 extern struct eth_priv_t eth_priv_cfg[];
 
 int get_num_eth_ports(void);
+void spl_init_keystone_plls(void);
 
 #endif
diff --git a/board/ti/ks2_evm/board_k2e.c b/board/ti/ks2_evm/board_k2e.c
index 5472a43..810a8e2 100644
--- a/board/ti/ks2_evm/board_k2e.c
+++ b/board/ti/ks2_evm/board_k2e.c
@@ -52,3 +52,14 @@ int board_early_init_f(void)
return 0;
 }
 #endif
+
+#ifdef CONFIG_SPL_BUILD
+static struct pll_init_data spl_pll_config[] = {
+   CORE_PLL_800,
+};
+
+void spl_init_keystone_plls(void)
+{
+   init_plls(ARRAY_SIZE(spl_pll_config), spl_pll_config);
+}
+#endif
diff --git a/board/ti/ks2_evm/board_k2hk.c b/board/ti/ks2_evm/board_k2hk.c
index 6fb3d21..d7dd292 100644
--- a/board/ti/ks2_evm/board_k2hk.c
+++ b/board/ti/ks2_evm/board_k2hk.c
@@ -100,3 +100,15 @@ int board_early_init_f(void)
return 0;
 }
 #endif
+
+#ifdef CONFIG_SPL_BUILD
+static struct pll_init_data spl_pll_config[] = {
+   CORE_PLL_799,
+   TETRIS_PLL_500,
+};
+
+void spl_init_keystone_plls(void)
+{
+   init_plls(ARRAY_SIZE(spl_pll_config), spl_pll_config);
+}
+#endif
-- 
1.8.3.2

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


Re: [U-Boot] [PATCH] ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux tables

2014-10-15 Thread Simon Glass
Hi,

On 15 October 2014 18:38, Stephen Warren  wrote:
> On 10/15/2014 09:39 AM, Albert ARIBAUD wrote:
>>
>> Hi Stephen,
>>
>> On Wed, 15 Oct 2014 09:34:49 -0600, Stephen Warren
>>  wrote:
>>
>>> On 10/15/2014 05:43 AM, Albert ARIBAUD wrote:

 Hi Tom,

 On Tue, 14 Oct 2014 23:14:24 +, Tom Warren 
 wrote:

> Albert,
>
> Please pull u-boot-tegra/master into ARM/master. Thanks!
>
> The following changes since commit
> a7f99bf139b3aaa0d5494693fd0395084355e41a:
>
> arm: Fix _start for CONFIG_SYS_DV_NOR_BOOT_CFG (2014-09-11 18:04:39
> +0200)
>
> are available in the git repository at:
>
> git://git.denx.de/u-boot-tegra.git master
>
> for you to fetch changes up to
> 90a565acf3a18c61170ec0e0b2046c98cb7ecc85:
>
> arm: tegra: initial support for apalis t30 (2014-09-17 11:15:04
> -0700)
>
> 
> Marcel Ziswiler (1):
> arm: tegra: initial support for apalis t30
>
> Stephen Warren (1):
> ARM: tegra: add PCIe-related pins to the Jetson TK1 pinmux
> tables


 This new board fails when I merge this branch to u-boot-arm/master,
 with the following diagnostics:

 include/configs/apalis_t30.h:17:0: warning: "CONFIG_OF_SEPARATE"
 redefined [enabled by default]
 In file included
 from /home/albert.u.boot/src/u-boot-arm/include/linux/kconfig.h:4:0,
from :0:
 include/generated/autoconf.h:8:0: note: this is the location of the
 previous definition

 (actually, there is a lot of these, for various config options)

 Device Tree Source is not correctly specified.
 Please define 'CONFIG_DEFAULT_DEVICE_TREE'
 or build with 'DEVICE_TREE=' argument

 (This one is fatal even though it does not explicitly state "error:")

 This failure does not happen on the tegra branch; it is obviously due
 to the Kbuild stuff.
>>>
>>>
>>> This issue should be fixed by:
>>>
>>> https://patchwork.ozlabs.org/patch/398793/
>>> [U-Boot] tegra: apalis_t30: master revamp
>>>
>>> However, I would assert that at this point during the release cycle, we
>>> probably shouldn't be adding new boards/features, but just fixing bugs.
>>> Perhaps we should drop the Apalis patch completely and re-apply it once
>>> the release is out?
>>
>>
>> Ok. Should I still apply the TK1 pinmux patch, or should I consider the
>> whole PR to be for -next?
>
>
> I consider the Jetson TK1 pinmux patch a bug-fix; it adds entries that
> always should have been there.

BTW the release has already gone out. Also what is the status of the
Norrin patch? Will that go into Tegra soon?

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


[U-Boot] [U-boot] [Patch v5 2/6] keystone2: clock: add K2L clock definitions and commands

2014-10-15 Thread Ivan Khoronzhuk
From: Hao Zhang 

This patch adds clock definitions and commands to support Keystone II
K2L SOC.

Acked-by: Vitaly Andrianov 
Signed-off-by: Hao Zhang 
Signed-off-by: Ivan Khoronzhuk 
---
 arch/arm/cpu/armv7/keystone/Makefile   |   1 +
 arch/arm/cpu/armv7/keystone/clock-k2l.c| 138 +
 arch/arm/cpu/armv7/keystone/cmd_clock.c|  10 ++
 arch/arm/include/asm/arch-keystone/clock-k2l.h |  88 
 arch/arm/include/asm/arch-keystone/clock.h |   4 +
 5 files changed, 241 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/keystone/clock-k2l.c
 create mode 100644 arch/arm/include/asm/arch-keystone/clock-k2l.h

diff --git a/arch/arm/cpu/armv7/keystone/Makefile 
b/arch/arm/cpu/armv7/keystone/Makefile
index 3d8fb70..4750371 100644
--- a/arch/arm/cpu/armv7/keystone/Makefile
+++ b/arch/arm/cpu/armv7/keystone/Makefile
@@ -10,6 +10,7 @@ obj-y += psc.o
 obj-y  += clock.o
 obj-$(CONFIG_SOC_K2HK) += clock-k2hk.o
 obj-$(CONFIG_SOC_K2E) += clock-k2e.o
+obj-$(CONFIG_SOC_K2L) += clock-k2l.o
 obj-y  += cmd_clock.o
 obj-y  += cmd_mon.o
 obj-y  += msmc.o
diff --git a/arch/arm/cpu/armv7/keystone/clock-k2l.c 
b/arch/arm/cpu/armv7/keystone/clock-k2l.c
new file mode 100644
index 000..1c5e4d5
--- /dev/null
+++ b/arch/arm/cpu/armv7/keystone/clock-k2l.c
@@ -0,0 +1,138 @@
+/*
+ * Keystone2: get clk rate for K2L
+ *
+ * (C) Copyright 2012-2014
+ * Texas Instruments Incorporated, 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+
+const struct keystone_pll_regs keystone_pll_regs[] = {
+   [CORE_PLL] = {KS2_MAINPLLCTL0, KS2_MAINPLLCTL1},
+   [PASS_PLL] = {KS2_PASSPLLCTL0, KS2_PASSPLLCTL1},
+   [TETRIS_PLL] = {KS2_ARMPLLCTL0,  KS2_ARMPLLCTL1},
+   [DDR3_PLL] = {KS2_DDR3APLLCTL0, KS2_DDR3APLLCTL1},
+};
+
+int dev_speeds[] = {
+   SPD800,
+   SPD1000,
+   SPD1200,
+   SPD800,
+   SPD800,
+   SPD800,
+   SPD800,
+   SPD800,
+   SPD1200,
+   SPD1000,
+   SPD800,
+   SPD800,
+   SPD800,
+};
+
+int arm_speeds[] = {
+   SPD800,
+   SPD1000,
+   SPD1200,
+   SPD1350,
+   SPD1400,
+   SPD800,
+   SPD1400,
+   SPD1350,
+   SPD1200,
+   SPD1000,
+   SPD800,
+   SPD800,
+   SPD800,
+};
+
+/**
+ * pll_freq_get - get pll frequency
+ * Fout = Fref * NF(mult) / NR(prediv) / OD
+ * @pll:   pll identifier
+ */
+static unsigned long pll_freq_get(int pll)
+{
+   unsigned long mult = 1, prediv = 1, output_div = 2;
+   unsigned long ret;
+   u32 tmp, reg;
+
+   if (pll == CORE_PLL) {
+   ret = external_clk[sys_clk];
+   if (pllctl_reg_read(pll, ctl) & PLLCTL_PLLEN) {
+   /* PLL mode */
+   tmp = __raw_readl(KS2_MAINPLLCTL0);
+   prediv = (tmp & PLL_DIV_MASK) + 1;
+   mult = (((tmp & PLLM_MULT_HI_SMASK) >> 6) |
+   (pllctl_reg_read(pll, mult) &
+   PLLM_MULT_LO_MASK)) + 1;
+   output_div = ((pllctl_reg_read(pll, secctl) >>
+   PLL_CLKOD_SHIFT) & PLL_CLKOD_MASK) + 1;
+
+   ret = ret / prediv / output_div * mult;
+   }
+   } else {
+   switch (pll) {
+   case PASS_PLL:
+   ret = external_clk[pa_clk];
+   reg = KS2_PASSPLLCTL0;
+   break;
+   case TETRIS_PLL:
+   ret = external_clk[tetris_clk];
+   reg = KS2_ARMPLLCTL0;
+   break;
+   case DDR3_PLL:
+   ret = external_clk[ddr3_clk];
+   reg = KS2_DDR3APLLCTL0;
+   break;
+   default:
+   return 0;
+   }
+
+   tmp = __raw_readl(reg);
+   if (!(tmp & PLLCTL_BYPASS)) {
+   /* Bypass disabled */
+   prediv = (tmp & PLL_DIV_MASK) + 1;
+   mult = ((tmp >> PLL_MULT_SHIFT) & PLL_MULT_MASK) + 1;
+   output_div = ((tmp >> PLL_CLKOD_SHIFT) &
+ PLL_CLKOD_MASK) + 1;
+   ret = ((ret / prediv) * mult) / output_div;
+   }
+   }
+
+   return ret;
+}
+
+unsigned long clk_get_rate(unsigned int clk)
+{
+   switch (clk) {
+   case core_pll_clk:  return pll_freq_get(CORE_PLL);
+   case pass_pll_clk:  return pll_freq_get(PASS_PLL);
+   case tetris_pll_clk:return pll_freq_get(TETRIS_PLL);
+   case ddr3_pll_clk:  return pll_freq_get(DDR3_PLL);
+   case sys_clk0_1_clk:
+   case sys_clk0_clk:  return pll_freq_get(CORE_PLL) / pll0div_read(1);
+   case sys_clk1_clk:  return pll_freq_get(CORE_PLL) / pll0div_read(2);
+   case sys_clk2_clk:  return pll_

[U-Boot] [PATCH v2 0/6] Addition of new board Peach-Pi

2014-10-15 Thread Akshay Saraswat
Now we are adding a new Peach-Pi board which is a variant of Peach-Pit
and is based on Exynos5800. Exynos5800 itself is a variant of Exynos5420,
hence, most of the hardware config and settings are reused for this board.

Changes since v1:
- Rebased all the patches.

Akshay Saraswat (5):
  Exynos5800: Introduce new proid for Exynos5800
  Exynos5800: Add DTS for new board Peach-Pi
  Config: Exynos5800: Enable build for Peach-Pi
  Config: Exynos5420: Refactor SDRAM Bank and Size
  Exynos5: ddr3: Choose between single or double channel config

Alim Akhtar (1):
  DMC: Exynos5: Enable update mode for DREX controller

 arch/arm/cpu/armv7/exynos/Kconfig  |   6 +-
 arch/arm/cpu/armv7/exynos/clock.c  |  19 +--
 arch/arm/cpu/armv7/exynos/clock_init_exynos5.c |   2 +-
 arch/arm/cpu/armv7/exynos/dmc_init_ddr3.c  |  29 +
 arch/arm/cpu/armv7/exynos/pinmux.c |   2 +-
 arch/arm/dts/Makefile  |   3 +-
 arch/arm/dts/exynos5800-peach-pi.dts   | 157 +
 arch/arm/include/asm/arch-exynos/cpu.h |  10 +-
 arch/arm/include/asm/arch-exynos/dmc.h |   1 +
 arch/arm/include/asm/arch-exynos/gpio.h|   4 +-
 board/samsung/smdk5420/Kconfig |  16 +++
 board/samsung/smdk5420/MAINTAINERS |   2 +
 configs/peach-pi_defconfig |   5 +
 drivers/gpio/s5p_gpio.c|   2 +-
 include/configs/exynos5420-common.h|   7 +-
 include/configs/peach-pi.h |  49 
 include/configs/peach-pit.h|   8 +-
 include/configs/smdk5420.h |   4 +
 18 files changed, 302 insertions(+), 24 deletions(-)
 create mode 100644 arch/arm/dts/exynos5800-peach-pi.dts
 create mode 100644 configs/peach-pi_defconfig
 create mode 100644 include/configs/peach-pi.h

-- 
1.9.1

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


[U-Boot] [PATCH v2 3/6] Config: Exynos5800: Enable build for Peach-Pi

2014-10-15 Thread Akshay Saraswat
This adds following things :
- New config and defconfig for Peach-Pi board.
- Alterations in Kconfig and MAINTAINERS.
- Addition of CONFIG_EXYNOS5800.
- ADdition of exynos5800-peach-pi in dts list.

Signed-off-by: Akshay Saraswat 
---
 arch/arm/cpu/armv7/exynos/Kconfig   |  6 -
 board/samsung/smdk5420/Kconfig  | 16 +
 board/samsung/smdk5420/MAINTAINERS  |  2 ++
 configs/peach-pi_defconfig  |  5 +
 include/configs/exynos5420-common.h |  3 ++-
 include/configs/peach-pi.h  | 45 +
 include/configs/peach-pit.h |  4 ++--
 7 files changed, 77 insertions(+), 4 deletions(-)
 create mode 100644 configs/peach-pi_defconfig
 create mode 100644 include/configs/peach-pi.h

diff --git a/arch/arm/cpu/armv7/exynos/Kconfig 
b/arch/arm/cpu/armv7/exynos/Kconfig
index 7a0d182..3a25fee 100644
--- a/arch/arm/cpu/armv7/exynos/Kconfig
+++ b/arch/arm/cpu/armv7/exynos/Kconfig
@@ -38,10 +38,14 @@ config TARGET_SMDK5420
bool "SMDK5420 board"
select OF_CONTROL if !SPL_BUILD
 
-config TARGET_PEACH_PIT
+config TARGET_PEACH_PI
bool "Peach Pi board"
select OF_CONTROL if !SPL_BUILD
 
+config TARGET_PEACH_PIT
+   bool "Peach Pit board"
+   select OF_CONTROL if !SPL_BUILD
+
 endchoice
 
 config SYS_CPU
diff --git a/board/samsung/smdk5420/Kconfig b/board/samsung/smdk5420/Kconfig
index d3a5b7f..e7aafe5 100644
--- a/board/samsung/smdk5420/Kconfig
+++ b/board/samsung/smdk5420/Kconfig
@@ -1,3 +1,19 @@
+if TARGET_PEACH_PI
+
+config SYS_BOARD
+   string
+   default "smdk5420"
+
+config SYS_VENDOR
+   string
+   default "samsung"
+
+config SYS_CONFIG_NAME
+   string
+   default "peach-pi"
+
+endif
+
 if TARGET_PEACH_PIT
 
 config SYS_BOARD
diff --git a/board/samsung/smdk5420/MAINTAINERS 
b/board/samsung/smdk5420/MAINTAINERS
index e0f5c7a..1423f83 100644
--- a/board/samsung/smdk5420/MAINTAINERS
+++ b/board/samsung/smdk5420/MAINTAINERS
@@ -6,3 +6,5 @@ F:  include/configs/peach-pit.h
 F: configs/peach-pit_defconfig
 F: include/configs/smdk5420.h
 F: configs/smdk5420_defconfig
+F: include/configs/peach-pi.h
+F: configs/peach-pi_defconfig
diff --git a/configs/peach-pi_defconfig b/configs/peach-pi_defconfig
new file mode 100644
index 000..8ada0db
--- /dev/null
+++ b/configs/peach-pi_defconfig
@@ -0,0 +1,5 @@
+CONFIG_SPL=y
++S:CONFIG_ARM=y
++S:CONFIG_ARCH_EXYNOS=y
++S:CONFIG_TARGET_PEACH_PI=y
+CONFIG_DEFAULT_DEVICE_TREE="exynos5800-peach-pi"
diff --git a/include/configs/exynos5420-common.h 
b/include/configs/exynos5420-common.h
index b0f940c..b6f2b5a 100644
--- a/include/configs/exynos5420-common.h
+++ b/include/configs/exynos5420-common.h
@@ -10,6 +10,7 @@
 #define __CONFIG_EXYNOS5420_H
 
 #define CONFIG_EXYNOS5420
+#define CONFIG_EXYNOS5800  /* A variant of Exynos5420 (Exynos5 
Family) */
 
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_SPI_FLASH
@@ -38,7 +39,7 @@
 
 #define CONFIG_SPL_MAX_FOOTPRINT   (30 * 1024)
 
-#define CONFIG_DEVICE_TREE_LIST "exynos5420-peach-pit exynos5420-smdk5420"
+#define CONFIG_DEVICE_TREE_LIST "exynos5800-peach-pi exynos5420-peach-pit 
exynos5420-smdk5420"
 
 #define CONFIG_MAX_I2C_NUM 11
 
diff --git a/include/configs/peach-pi.h b/include/configs/peach-pi.h
new file mode 100644
index 000..be5d87f
--- /dev/null
+++ b/include/configs/peach-pi.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ *
+ * Configuration settings for the SAMSUNG/GOOGLE PEACH-PI board.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __CONFIG_PEACH_PI_H
+#define __CONFIG_PEACH_PI_H
+
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_SPI_FLASH
+#define CONFIG_ENV_SPI_BASE0x12D3
+#define FLASH_SIZE (0x4 << 20)
+#define CONFIG_ENV_OFFSET  (FLASH_SIZE - CONFIG_BL2_SIZE)
+
+#include 
+#include 
+
+#define CONFIG_BOARD_COMMON
+
+/* select serial console configuration */
+#define CONFIG_SERIAL3 /* use SERIAL 3 */
+
+#define CONFIG_SYS_PROMPT  "Peach-Pi # "
+#define CONFIG_IDENT_STRING" for Peach-Pi"
+
+#define CONFIG_VIDEO_PARADE
+
+/* Display */
+#define CONFIG_LCD
+#ifdef CONFIG_LCD
+#define CONFIG_EXYNOS_FB
+#define CONFIG_EXYNOS_DP
+#define LCD_BPPLCD_COLOR16
+#endif
+
+#define CONFIG_POWER_TPS65090_EC
+#define CONFIG_CROS_EC_SPI /* Support CROS_EC over SPI */
+
+#define CONFIG_USB_XHCI
+#define CONFIG_USB_XHCI_EXYNOS
+
+#endif /* __CONFIG_PEACH_PI_H */
diff --git a/include/configs/peach-pit.h b/include/configs/peach-pit.h
index ab8ac60..dc9ac87 100644
--- a/include/configs/peach-pit.h
+++ b/include/configs/peach-pit.h
@@ -23,8 +23,8 @@
 /* select serial console configuration */
 #define CONFIG_SERIAL3 /* use SERIAL 3 */
 
-#define CONFIG_SYS_PROMPT  "Peach # "
-#define CONFIG_IDENT_STRING" for Peach"
+#define CONFIG_SYS_PROMPT  "Peach-Pit # "
+#define CONFIG_IDENT_STRING" for Peach-Pit"
 
 #define CONFIG_VIDEO_PARADE
 
-- 
1.9.

[U-Boot] [PATCH v2 5/6] Config: Exynos5420: Refactor SDRAM Bank and Size

2014-10-15 Thread Akshay Saraswat
Since, not every board may have all memory channels configured
and all available banks of DMC used, we wish to refactor configs
for Memory Bank size and numbers as per board memory config.
For Example, Peach-Pit has 2GB memory and will be using only 4 banks
but Peach-Pi has 3.5GB memory and will be using all 7 available
SDRAM banks.

Signed-off-by: Akshay Saraswat 
---
 include/configs/exynos5420-common.h | 4 
 include/configs/peach-pi.h  | 4 
 include/configs/peach-pit.h | 4 
 include/configs/smdk5420.h  | 4 
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/include/configs/exynos5420-common.h 
b/include/configs/exynos5420-common.h
index b6f2b5a..341d980 100644
--- a/include/configs/exynos5420-common.h
+++ b/include/configs/exynos5420-common.h
@@ -55,10 +55,6 @@
  */
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_IRAM_TOP - 0x800)
 
-/* DRAM Memory Banks */
-#define CONFIG_NR_DRAM_BANKS   7
-#define SDRAM_BANK_SIZE(512UL << 20UL) /* 512 MB */
-
 /* Miscellaneous configurable options */
 #define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
 
diff --git a/include/configs/peach-pi.h b/include/configs/peach-pi.h
index be5d87f..ccba3eb 100644
--- a/include/configs/peach-pi.h
+++ b/include/configs/peach-pi.h
@@ -42,4 +42,8 @@
 #define CONFIG_USB_XHCI
 #define CONFIG_USB_XHCI_EXYNOS
 
+/* DRAM Memory Banks */
+#define CONFIG_NR_DRAM_BANKS   7
+#define SDRAM_BANK_SIZE(512UL << 20UL) /* 512 MB */
+
 #endif /* __CONFIG_PEACH_PI_H */
diff --git a/include/configs/peach-pit.h b/include/configs/peach-pit.h
index dc9ac87..5cbaa54 100644
--- a/include/configs/peach-pit.h
+++ b/include/configs/peach-pit.h
@@ -42,4 +42,8 @@
 #define CONFIG_USB_XHCI
 #define CONFIG_USB_XHCI_EXYNOS
 
+/* DRAM Memory Banks */
+#define CONFIG_NR_DRAM_BANKS   4
+#define SDRAM_BANK_SIZE(512UL << 20UL) /* 512 MB */
+
 #endif /* __CONFIG_PEACH_PIT_H */
diff --git a/include/configs/smdk5420.h b/include/configs/smdk5420.h
index fd2d482..5c9a3c0 100644
--- a/include/configs/smdk5420.h
+++ b/include/configs/smdk5420.h
@@ -23,4 +23,8 @@
 #define CONFIG_IDENT_STRING" for SMDK5420"
 #define CONFIG_DEFAULT_CONSOLE "console=ttySAC1,115200n8\0"
 
+/* DRAM Memory Banks */
+#define CONFIG_NR_DRAM_BANKS   7
+#define SDRAM_BANK_SIZE(512UL << 20UL) /* 512 MB */
+
 #endif /* __CONFIG_SMDK5420_H */
-- 
1.9.1

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


  1   2   >