Re: [U-Boot] Patman failure on Linux Mint 14

2013-07-15 Thread Stefano Babic
Hi Gerhard,

On 14/07/2013 12:18, Gerhard Sittig wrote:
 Hi there!
 
 Patman for some reason doesn't work for me.  It won't find
 commits from the sandbox/repo, but wants me to specify -c
 manually.  Then it won't detect or cannot grok subject prefixes
 and fails to determine email addresses.  From the documentation I
 see how useful the tool is and feel how great and desirable it is
 to have such a tool at hand when iterating a series through
 review.  It's a pity that it won't run here.  Since it works for
 others, the problem must be in my setup.
 
 
 The git history suggests that Python 2.7.4 is required, while my
 distribution (Linux Mint 14, derived from Ubuntu 12.10) ships
 with 2.7.3.

It is not definetly a problem. It works on Ubuntu 12.04 LTS (python
2.7.3), as well as on later versions.

One point could be your ~/.patman file. You should define an alias for
each pattern in the subject line. Let's take as example the commit
7d47d1caa01682fd7b12631409927139f09ba041, it has a subject line:

arm: omap4: panda: Add reading of the board revision

patman tries to resolv an e-mail address for each pattern, and I have in
my ~/.patman an entry for each of them (arm--Albert, omap and panda --
Tom).

The other question is if you have set up the toolchain when you run
patman. If you set up ELDK, some tools are taken from the toolchain
instead from the PC, and patman fails - sometimes with weird errors. I
usually run patman in a shell where I have not set the environment for
the cross-compiler.

 
 OTOH this very Python version works for others, and a local
 installation of 2.7.5 (default configure except for --prefix
 $HOME) doesn't help either.
 
 
 The unit test output is rather lengthy, yet apparently condenses
 into just two spots and a lot of followup errors:
 
 The testIndent() case in test.py won't pass (succeeds although
 it's supposed to fail).  Changing 'tab' in GetData() from a
 verbatim tab in quotes into an explicit '\t' doesn't help (but
 visually more clearly reflects the specific type of whitespace).
 Running the script under 'env LC_ALL=C' didn't help either.  Is
 this some language or locale specific stuff that can be overcome
 from outside, or do I have a more severe problem with the
 Python runtime where string operation and whitespace handling
 isn't dependable?

It seems to me too much and an indication that your environment could be
responsible for this issue. I do not think that your Ubuntu derivative
is the problem.

Have you tried with a fresh shell or by logging with another user if you
have the same errors ?

 
 Am I missing some external dependencies or proper configuration
 (either in the system, in Python, in git, or in patman)?

IMHO you get in python an error by import if something is missing, and
this is not your case. By the way, I have not set up anything, and
patman works flawlessly.

  What
 can I do to better diagnose the issue or make patman work here as
 well?  It's so great a tool!

My first suggestion should be to try to check your environment, or try
with another user if you have not changed for some reason /etc/profile.

Regards,
Stefano

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


Re: [U-Boot] [PATCH] mx6qsabrelite: Remove mx6qsabrelite code in favor of nitrogen6x

2013-07-15 Thread Stefano Babic
Hi Fabio,

On 15/07/2013 04:40, Fabio Estevam wrote:
 From: Fabio Estevam fabio.este...@freescale.com
 
 mx6qsabrelite and nitrogen6q boards are hardware compatible, so let's avoid 
 the
 code duplication and only use the nitrogen6x source code to make board code
 maintainance easier.
 
 Tested booting a mainline device tree kernel on a mx6qsabrelite board.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---
  .../nitrogen6x/README.mx6qsabrelite}   |   0
  .../nitrogen6x/{README = README.nitrogen6x}   |   0
  board/freescale/mx6qsabrelite/Makefile |  41 -
  board/freescale/mx6qsabrelite/mx6qsabrelite.c  | 848 
 -
  boards.cfg |   2 +-
  include/configs/mx6qsabrelite.h| 297 
  include/configs/nitrogen6x.h   |  80 +-

Should we update the MAINTAINERS, too ? It is weird that we have two
maintainers for the same code.

Best regards,
Stefano

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


Re: [U-Boot] [PATCH 1/1] OMAP3: igep00x0: allow booting with a FDT from MMC

2013-07-15 Thread Enric Balletbo Serra
Hi Javier,

2013/7/14 Javier Martinez Canillas jav...@dowhile0.org:
 IGEP boards now have Device Tree support in the mainline
 kernel. To boot an IGEP board using a DT, a uEnv.txt plain
 text file could be used to define a custom uenvcmd that will
 be run by the default boot command.

 It is more convenient to change the default boot command to
 allow loading a FDT if it is stored in a uSD/MMC partition.
 If no FDT is found then the command behaves just as it used
 so this change won't break existing setup for current users.

 Signed-off-by: Javier Martinez Canillas javier.marti...@collabora.co.uk
 ---
  board/isee/igep00x0/igep00x0.c |   14 ++
  include/configs/igep00x0.h |9 +
  2 files changed, 23 insertions(+), 0 deletions(-)

 diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c
 index 0d4679d..fdd2773 100644
 --- a/board/isee/igep00x0/igep00x0.c
 +++ b/board/isee/igep00x0/igep00x0.c
 @@ -154,6 +154,18 @@ int board_mmc_init(bd_t *bis)
  }
  #endif

 +void set_fdt(void)
 +{
 +   switch (gd-bd-bi_arch_number) {
 +   case MACH_TYPE_IGEP0020:
 +   setenv(fdtfile, omap3-igep0020.dtb);
 +   break;
 +   case MACH_TYPE_IGEP0030:
 +   setenv(fdtfile, omap3-igep0030.dtb);
 +   break;
 +   }
 +}
 +
  /*
   * Routine: misc_init_r
   * Description: Configure board specific parts
 @@ -166,6 +178,8 @@ int misc_init_r(void)

 dieid_num_r();

 +   set_fdt();
 +
 return 0;
  }

 diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h
 index 1d8090b..72752af 100644
 --- a/include/configs/igep00x0.h
 +++ b/include/configs/igep00x0.h
 @@ -149,6 +149,7 @@
  #define CONFIG_EXTRA_ENV_SETTINGS \
 usbtty=cdc_acm\0 \
 loadaddr=0x8200\0 \
 +   fdtaddr=0x8160\0 \
 usbtty=cdc_acm\0 \
 console=ttyO2,115200n8\0 \
 mpurate=auto\0 \
 @@ -180,9 +181,12 @@
 importbootenv=echo Importing environment from mmc ...;  \
 env import -t $loadaddr $filesize\0 \
 loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0 \
 +   loadfdt=fatload mmc ${mmcdev} ${fdtaddr} ${fdtfile}\0 \
 mmcboot=echo Booting from mmc ...;  \
 run mmcargs;  \
 bootm ${loadaddr}\0 \
 +   mmcbootfdt=echo Booting with DT from mmc ...;  \
 +   bootm ${loadaddr} - ${fdtaddr}\0 \
 nandboot=echo Booting from onenand ...;  \
 run nandargs;  \
 onenand read ${loadaddr} 28 40;  \
 @@ -199,6 +203,11 @@
 run uenvcmd; \
 fi; \
 if run loaduimage; then  \
 +   if test -n $fdtfile; then  \
 +   if run loadfdt; then  \
 +   run mmcbootfdt; \
 +   fi; \
 +   fi; \
 run mmcboot; \
 fi; \
 fi; \
 --
 1.7.7.6


As merge window is closed, I think we have time to discuss a bit more
this patch before sending for next merge window. I think it's time to
redefine the default boot arguments for all IGEP boards and unify as
possible the bootargs for IGEP0020, IGEP0030, IGEP0032 and IGEP0033.

I made also some work in this line, but is not finished yet. We can
send a the patch series for next merge window. These are the things
that I think the patches should have.

   1. Enable the use of CMD_EXT4, CMD_FS_GENERIC and zImage.
   
https://github.com/eballetbo/u-boot/commit/38036e80a66f266f2c3fae82906c5c46a575f06b
   As uImage is deprecated we should use zImages.

2. Add support for Flattened Device Tree.
For IGEP0033
   
https://github.com/eballetbo/u-boot/commit/46ddafddc5bb6968190848d273b9ca8fbbd120de
For IGEP0020/30/32
   Your patch

Note that I made some modifications on where the zImage and the DTB
file is located. MLO and u-boot.img are from boot partition, and
zImage and dtb file are from rootfs partition (/boot/ directory). What
do you think about this ?

3. Boot from NAND using a ubifs
 
https://github.com/eballetbo/u-boot/commit/ebd8ab99b02ccbf08b4d50c60107b04c8129a8dd
I think is better use ubifs instead of jffs2, also note that
the zImage and the dtb are from rootfs partition using the ubifsload.

More ideas, comments ...

I would like that the bootargs betwen IGEP0020/30/32 and IGEP0033 were
as similar as possible.

Best regards,

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


Re: [U-Boot] [PATCH 1/3] spi: bfin_spi: Use DIV_ROUND_UP instead of open-coded

2013-07-15 Thread Sonic Zhang
Acked-by: Sonic Zhang sonic.zh...@analog.com

On Fri, Jul 12, 2013 at 5:39 PM, Axel Lin axel@ingics.com wrote:
 Use DIV_ROUND_UP to simplify the code.

 Signed-off-by: Axel Lin axel@ingics.com
 ---
  drivers/spi/bfin_spi.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

 diff --git a/drivers/spi/bfin_spi.c b/drivers/spi/bfin_spi.c
 index a9a4d92..f7192c2 100644
 --- a/drivers/spi/bfin_spi.c
 +++ b/drivers/spi/bfin_spi.c
 @@ -144,10 +144,8 @@ void spi_set_speed(struct spi_slave *slave, uint hz)
 u32 baud;

 sclk = get_sclk();
 -   baud = sclk / (2 * hz);
 /* baud should be rounded up */
 -   if (sclk % (2 * hz))
 -   baud += 1;
 +   baud = DIV_ROUND_UP(sclk, 2 * hz);
 if (baud  2)
 baud = 2;
 else if (baud  (u16)-1)
 --
 1.8.1.2



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


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Hector Palacios

Hi Marek,

On 07/12/2013 06:48 PM, Marek Vasut wrote:

 [...]



but I found something:
It is very strange that the timeouts appear always after transferring
between 20 and 24 MiB. So I thought maybe it was not an issue with the
size of the file or the number of packets received, but instead a timed
issue (an issue that happens after some period of time). I checked, and in
fact the timeouts occur exactly 10 seconds after running the tftp command.
I verified that this is what is happening by adding a udelay(10) at
fec_send(). In this case, the timeout also occurs after 10 seconds, but
due to the delay, I have transferred only a few Kbytes.


Holy moly!


I tried to change different timeout related constants at tftp.c but still
the issue happens after 10s.
It's like if, after these 10 seconds, the PHY lost the link or something.
Really odd. Does it tell you anything?


LAN8720 phy, right? Try implementing something like [1], by clearing the
EDPWRDOWN bit , the PHY will never enter low-power mode. It's just a simple PHY
register RMW which you can stick somewhere into the PHY net/phy/smsc.c code.

[1]
https://kernel.googlesource.com/pub/scm/linux/kernel/git/djbw/dmaengine/+/b629820d18fa65cc598390e4b9712fd5f83ee693%5E!/#F0


No, my PHY is a Micrel KSZ8031RNLI.

The hint about the PHY possibly going to power down mode is interesting but I checked 
the PHY registers and EDPD mode (Energy Detect Power Down) is off, at least before 
running the tftp command. Power Down mode is off too, so unless these are somehow 
enabled during the TFTP process, this is not what's happening.


The sniffer shows that the TFTP server simply stops sending data packets. I can see 
however the target sending several times the ACK packet to the last received data 
packet. This would point to the TFTP server (as Albert suggested), but the fact is the 
problem occurs with different TFTP servers (I tried three different servers) and it 
does not happen with an old v2009 U-Boot using the same target.


Many times, though not always, after the timeout occurs, I cancel with CTRL+C and run 
the tftp command again, and then the file downloads completely.

The PHY is my usual suspect...

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


Re: [U-Boot] [PATCH 1/1] OMAP3: igep00x0: allow booting with a FDT from MMC

2013-07-15 Thread Javier Martinez Canillas
On Mon, Jul 15, 2013 at 9:43 AM, Enric Balletbo Serra
eballe...@gmail.com wrote:
 Hi Javier,


Hi Enric,

Thanks a lot for your feedback.

 2013/7/14 Javier Martinez Canillas jav...@dowhile0.org:
 IGEP boards now have Device Tree support in the mainline
 kernel. To boot an IGEP board using a DT, a uEnv.txt plain
 text file could be used to define a custom uenvcmd that will
 be run by the default boot command.

 It is more convenient to change the default boot command to
 allow loading a FDT if it is stored in a uSD/MMC partition.
 If no FDT is found then the command behaves just as it used
 so this change won't break existing setup for current users.

 Signed-off-by: Javier Martinez Canillas javier.marti...@collabora.co.uk
 ---
  board/isee/igep00x0/igep00x0.c |   14 ++
  include/configs/igep00x0.h |9 +
  2 files changed, 23 insertions(+), 0 deletions(-)

 diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c
 index 0d4679d..fdd2773 100644
 --- a/board/isee/igep00x0/igep00x0.c
 +++ b/board/isee/igep00x0/igep00x0.c
 @@ -154,6 +154,18 @@ int board_mmc_init(bd_t *bis)
  }
  #endif

 +void set_fdt(void)
 +{
 +   switch (gd-bd-bi_arch_number) {
 +   case MACH_TYPE_IGEP0020:
 +   setenv(fdtfile, omap3-igep0020.dtb);
 +   break;
 +   case MACH_TYPE_IGEP0030:
 +   setenv(fdtfile, omap3-igep0030.dtb);
 +   break;
 +   }
 +}
 +
  /*
   * Routine: misc_init_r
   * Description: Configure board specific parts
 @@ -166,6 +178,8 @@ int misc_init_r(void)

 dieid_num_r();

 +   set_fdt();
 +
 return 0;
  }

 diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h
 index 1d8090b..72752af 100644
 --- a/include/configs/igep00x0.h
 +++ b/include/configs/igep00x0.h
 @@ -149,6 +149,7 @@
  #define CONFIG_EXTRA_ENV_SETTINGS \
 usbtty=cdc_acm\0 \
 loadaddr=0x8200\0 \
 +   fdtaddr=0x8160\0 \
 usbtty=cdc_acm\0 \
 console=ttyO2,115200n8\0 \
 mpurate=auto\0 \
 @@ -180,9 +181,12 @@
 importbootenv=echo Importing environment from mmc ...;  \
 env import -t $loadaddr $filesize\0 \
 loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0 \
 +   loadfdt=fatload mmc ${mmcdev} ${fdtaddr} ${fdtfile}\0 \
 mmcboot=echo Booting from mmc ...;  \
 run mmcargs;  \
 bootm ${loadaddr}\0 \
 +   mmcbootfdt=echo Booting with DT from mmc ...;  \
 +   bootm ${loadaddr} - ${fdtaddr}\0 \
 nandboot=echo Booting from onenand ...;  \
 run nandargs;  \
 onenand read ${loadaddr} 28 40;  \
 @@ -199,6 +203,11 @@
 run uenvcmd; \
 fi; \
 if run loaduimage; then  \
 +   if test -n $fdtfile; then  \
 +   if run loadfdt; then  \
 +   run mmcbootfdt; \
 +   fi; \
 +   fi; \
 run mmcboot; \
 fi; \
 fi; \
 --
 1.7.7.6


 As merge window is closed, I think we have time to discuss a bit more
 this patch before sending for next merge window. I think it's time to
 redefine the default boot arguments for all IGEP boards and unify as
 possible the bootargs for IGEP0020, IGEP0030, IGEP0032 and IGEP0033.


Yes, I like the idea to redefine the default boot arguments. I just
have been doing minor changes in the past like using ttyO for console,
using EXT4 as mmcrootfstype, etc. But I agree that a major rethink
will be good to make it more usable.

 I made also some work in this line, but is not finished yet. We can
 send a the patch series for next merge window. These are the things
 that I think the patches should have.

1. Enable the use of CMD_EXT4, CMD_FS_GENERIC and zImage.

 https://github.com/eballetbo/u-boot/commit/38036e80a66f266f2c3fae82906c5c46a575f06b
As uImage is deprecated we should use zImages.


+1

 2. Add support for Flattened Device Tree.
 For IGEP0033

 https://github.com/eballetbo/u-boot/commit/46ddafddc5bb6968190848d273b9ca8fbbd120de
 For IGEP0020/30/32
Your patch

 Note that I made some modifications on where the zImage and the DTB
 file is located. MLO and u-boot.img are from boot partition, and
 zImage and dtb file are from rootfs partition (/boot/ directory). What
 do you think about this ?


I'm not so fond in using /boot from the rootfs partition instead of a
boot partition for two reasons:

1- It leaks boot information to the distro and makes the /boot
directory content different for each board
2- It forces to use the same filesystem type for both the boot
partition and rootfs or at least constraint to filesytems supported by
U-Boot instead allowing to use any file system that is supported by
Linux.

Basically I want my 

Re: [U-Boot] [PATCH] OpenRD: relocate environment to 640kB

2013-07-15 Thread Sascha Silbe
Albert ARIBAUD albert.u.b...@aribaud.net writes:

 The situation has gotten better recently and U-Boot fits into the
 previous partition size of 384KiB again. So it isn't broken on OpenRD
 anymore and the above would seem like a good approach.
 How well does it fit again, and do you have any idea what caused the
 increase in size, and what caused the decrease?

I had the same questions and tried a few buildman runs, but didn't get a
clear picture. The size was going up and down for various slices of
commits.

With v2013.07-rc3, we are now at 376344B (≈ 96% of 384KiB) for
openrd_ultimate when built on Debian Wheezy using
gcc-4.7-arm-linux-gnueabi from Emdebian.

Is there an equivalent to CONFIG_SPL_MAX_SIZE for the regular U-Boot?
Detecting the overlap at build time would prevent bricking the device
using saveenv at run time. As an additional benefit, commits that push
the size beyond the limit would also show up in buildman reports as
build failures.

Sascha


pgpBUpjog_PVY.pgp
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] dfu, nand, ubi: add partubi alt settings for updating ubi partition

2013-07-15 Thread Heiko Schocher
updating an ubi partition needs a completely erased mtd partition,
see:
http://lists.infradead.org/pipermail/linux-mtd/2011-May/035416.html

So, add partubi alt setting for the dfu_alt_info environment
variable to mark this partition as an ubi partition. In case we
update an ubi partition, we erase after flashing the image into the
partition, the remaining sektors.

Signed-off-by: Heiko Schocher h...@denx.de
Cc: Pantelis Antoniou pa...@antoniou-consulting.com
Cc: Tom Rini tr...@ti.com
Cc: Lukasz Majewski l.majew...@samsung.com
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut ma...@denx.de
Cc: Wolfgang Denk w...@denx.de

---

- This patch is also a good starting point to fix up updating ubi, as
  we currently use nand erase for erasing the sektors. This is
  not the prefered way for writing an ubi image, see:
  http://www.linux-mtd.infradead.org/faq/ubi.html#L_flash_img

  This must be fixed ... we have no ubiformat in u-boot, or?
---
 drivers/dfu/dfu.c  | 33 -
 drivers/dfu/dfu_nand.c | 26 ++
 include/dfu.h  |  2 ++
 3 Dateien geändert, 60 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index 0521752..04059be 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -23,6 +23,7 @@
 #include errno.h
 #include malloc.h
 #include mmc.h
+#include nand.h
 #include fat.h
 #include dfu.h
 #include linux/list.h
@@ -176,6 +177,37 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int size, 
int blk_seq_num)
ret = dfu-flush_medium(dfu);
printf(\nDFU complete CRC32: 0x%08x\n, dfu-crc);
 
+   /* in case of ubi partition, erase rest of the partition */
+   if (dfu-ubi == 1) {
+   int ret;
+   nand_info_t *nand;
+   /* erase complete partition */
+   nand_erase_options_t opts;
+
+   if (nand_curr_device  0 ||
+   nand_curr_device = CONFIG_SYS_MAX_NAND_DEVICE ||
+   !nand_info[nand_curr_device].name) {
+   printf(%s: invalid nand device\n, __func__);
+   return -1;
+   }
+
+   nand = nand_info[nand_curr_device];
+
+   memset(opts, 0, sizeof(opts));
+   opts.offset = dfu-data.nand.start + dfu-offset +
+   dfu-bad_skip;
+   opts.length = dfu-data.nand.start +
+   dfu-data.nand.size - opts.offset;
+   opts.lim = opts.length;
+   opts.spread = 1;
+   opts.quiet = 0;
+   ret = nand_erase_opts(nand, opts);
+   if (ret) {
+   printf(Failure erase: %d\n, ret);
+   return ret;
+   }
+   }
+
/* clear everything */
dfu_free_buf();
dfu-crc = 0;
@@ -186,7 +218,6 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int size, 
int blk_seq_num)
dfu-i_buf = dfu-i_buf_start;
 
dfu-inited = 0;
-
}
 
return ret = 0 ? size : ret;
diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index 07dee89..d8afc48 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -153,6 +153,7 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s)
char *st;
int ret, dev, part;
 
+   dfu-ubi = 0;
dfu-dev_type = DFU_DEV_NAND;
st = strsep(s,  );
if (!strcmp(st, raw)) {
@@ -185,7 +186,32 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s)
 
dfu-data.nand.start = pi-offset;
dfu-data.nand.size = pi-size;
+   } else if (!strcmp(st, partubi)) {
+   char mtd_id[32];
+   struct mtd_device *mtd_dev;
+   u8 part_num;
+   struct part_info *pi;
+
+   dfu-layout = DFU_RAW_ADDR;
 
+   dev = simple_strtoul(s, s, 10);
+   s++;
+   part = simple_strtoul(s, s, 10);
+
+   sprintf(mtd_id, %s%d,%d, nand, dev, part - 1);
+   printf(using id '%s'\n, mtd_id);
+
+   mtdparts_init();
+
+   ret = find_dev_and_part(mtd_id, mtd_dev, part_num, pi);
+   if (ret != 0) {
+   printf(Could not locate '%s'\n, mtd_id);
+   return -1;
+   }
+
+   dfu-data.nand.start = pi-offset;
+   dfu-data.nand.size = pi-size;
+   dfu-ubi = 1;
} else {
printf(%s: Memory layout (%s) not supported!\n, __func__, st);
return -1;
diff --git a/include/dfu.h b/include/dfu.h
index 124653c..7bbe42d 

[U-Boot] [PATCH 1/7 v8] powerpc: deleted unused symbol CONFIG_SPL_NAND_MINIMAL and enabled some functionality for common SPL

2013-07-15 Thread ying.zhang
From: Ying Zhang b40...@freescale.com

1. The symbol CONFIG_SPL_NAND_MINIMAL is unused, so deleted it.
2. Some functions were unused in the minimal SPL, but it is useful
in the common SPL. So, enabled some functionality for common SPL.

Signed-off-by: Ying Zhang b40...@freescale.com
---
Change from v7:
- No change.
Change from v6:
- No change.
Change from v5:
- No change.
Change from v4:
- Use !defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_INIT_MINIMAL)
- to replace to new symbols.
Change from v3:
- Give up new symbol and delete the line
- ifndef CONFIG_SPL_BUILD in common/env_common.c
Change from v2:
- Split from Add the symbol for the minimal SPL used to eliminate unused
- code
Change from v1:
- Split from boot from SD card/SPI flash with SPL.

 arch/powerpc/cpu/mpc85xx/tlb.c |3 ++-
 arch/powerpc/cpu/mpc8xxx/law.c |6 --
 include/configs/MPC8313ERDB.h  |1 -
 include/configs/P1022DS.h  |1 -
 include/configs/p1_p2_rdb_pc.h |1 -
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/tlb.c b/arch/powerpc/cpu/mpc85xx/tlb.c
index 0dff37f..b903d02 100644
--- a/arch/powerpc/cpu/mpc85xx/tlb.c
+++ b/arch/powerpc/cpu/mpc85xx/tlb.c
@@ -55,7 +55,8 @@ void init_tlbs(void)
return ;
 }
 
-#if !defined(CONFIG_NAND_SPL)  !defined(CONFIG_SPL_BUILD)
+#if !defined(CONFIG_NAND_SPL)  \
+   (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_INIT_MINIMAL))
 void read_tlbcam_entry(int idx, u32 *valid, u32 *tsize, unsigned long *epn,
   phys_addr_t *rpn)
 {
diff --git a/arch/powerpc/cpu/mpc8xxx/law.c b/arch/powerpc/cpu/mpc8xxx/law.c
index 6f9d568..6c0a307 100644
--- a/arch/powerpc/cpu/mpc8xxx/law.c
+++ b/arch/powerpc/cpu/mpc8xxx/law.c
@@ -92,7 +92,8 @@ void disable_law(u8 idx)
return;
 }
 
-#if !defined(CONFIG_NAND_SPL)  !defined(CONFIG_SPL_BUILD)
+#if !defined(CONFIG_NAND_SPL)  \
+   (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_INIT_MINIMAL))
 static int get_law_entry(u8 i, struct law_entry *e)
 {
u32 lawar;
@@ -122,7 +123,8 @@ int set_next_law(phys_addr_t addr, enum law_size sz, enum 
law_trgt_if id)
return idx;
 }
 
-#if !defined(CONFIG_NAND_SPL)  !defined(CONFIG_SPL_BUILD)
+#if !defined(CONFIG_NAND_SPL)  \
+   (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_INIT_MINIMAL))
 int set_last_law(phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
 {
u32 idx;
diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h
index 1d753e7..0c15195 100644
--- a/include/configs/MPC8313ERDB.h
+++ b/include/configs/MPC8313ERDB.h
@@ -40,7 +40,6 @@
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_NAND_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
 #define CONFIG_SPL_TARGET  u-boot-with-spl.bin
 #define CONFIG_SPL_MPC83XX_WAIT_FOR_NAND
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index 9c27182..bcbda30 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -41,7 +41,6 @@
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_NAND_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
 #define CONFIG_SPL_TARGET  u-boot-with-spl.bin
 
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index 2fa5372..b35b966 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -159,7 +159,6 @@
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SPL_NAND_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
 #define CONFIG_SPL_TARGET  u-boot-with-spl.bin
 
-- 
1.7.0.4


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


[U-Boot] [PATCH 3/7 v8] powerpc: p1022ds: Enable P1022DS to boot from SD Card with SPL

2013-07-15 Thread ying.zhang
From: Ying Zhang b40...@freescale.com

Enable p1022ds to start from eSDHC with SPL.

Signed-off-by: Ying Zhang b40...@freescale.com
---
Change from v7:
- No change.
Change from v6:
- Split from the patch powerpc/p1022ds: boot from SD Card with SPL,
- this patch only enables p1022ds to boot from SD Card with SPL.
Change from v5:
- No change.
Change from v4:
- No change.
Change from v3:
- No change.
Change from v2:
- No change.
Change from v1:
- No change.


 README   |4 ++
 board/freescale/common/Makefile  |2 -
 board/freescale/p1022ds/Makefile |3 +
 board/freescale/p1022ds/spl.c|  111 ++
 board/freescale/p1022ds/tlb.c|9 +++-
 include/configs/P1022DS.h|   54 ---
 6 files changed, 173 insertions(+), 10 deletions(-)
 create mode 100644 board/freescale/p1022ds/spl.c

diff --git a/README b/README
index eb453d8..a44d96a 100644
--- a/README
+++ b/README
@@ -3019,6 +3019,10 @@ FIT uImage format:
Set for the SPL on PPC mpc8xxx targets, support for
arch/powerpc/cpu/mpc8xxx/ddr/libddr.o in SPL binary.
 
+   CONFIG_SPL_COMMON_INIT_DDR
+   Set for common ddr init with serial presence detect in
+   SPL binary.
+
CONFIG_SYS_NAND_5_ADDR_CYCLE, CONFIG_SYS_NAND_PAGE_COUNT,
CONFIG_SYS_NAND_PAGE_SIZE, CONFIG_SYS_NAND_OOBSIZE,
CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_BAD_BLOCK_POS,
diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index 37236d0..e991def 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -61,9 +61,7 @@ COBJS-$(CONFIG_MPC8555CDS)+= cds_pci_ft.o
 
 COBJS-$(CONFIG_MPC8536DS)  += ics307_clk.o
 COBJS-$(CONFIG_MPC8572DS)  += ics307_clk.o
-ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_P1022DS)+= ics307_clk.o
-endif
 COBJS-$(CONFIG_P2020DS)+= ics307_clk.o
 COBJS-$(CONFIG_P3041DS)+= ics307_clk.o
 COBJS-$(CONFIG_P4080DS)+= ics307_clk.o
diff --git a/board/freescale/p1022ds/Makefile b/board/freescale/p1022ds/Makefile
index 0eeef05..9746063 100644
--- a/board/freescale/p1022ds/Makefile
+++ b/board/freescale/p1022ds/Makefile
@@ -24,6 +24,9 @@ ifdef MINIMAL
 COBJS-y+= spl_minimal.o tlb.o law.o
 
 else
+ifdef CONFIG_SPL_BUILD
+COBJS-y += spl.o
+endif
 COBJS-y+= $(BOARD).o
 COBJS-y+= ddr.o
 COBJS-y+= law.o
diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c
new file mode 100644
index 000..9927671
--- /dev/null
+++ b/board/freescale/p1022ds/spl.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#include common.h
+#include ns16550.h
+#include malloc.h
+#include mmc.h
+#include nand.h
+#include i2c.h
+#include ../common/ngpixis.h
+#include fsl_esdhc.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static const u32 sysclk_tbl[] = {
+   6000, 7499900, 83332500, 800,
+   9000, 1000, 12499800, 1200
+};
+
+ulong get_effective_memsize(void)
+{
+   return CONFIG_SYS_L2_SIZE;
+}
+
+void board_init_f(ulong bootflag)
+{
+   int px_spd;
+   u32 plat_ratio, sys_clk, bus_clk;
+   ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+
+   console_init_f();
+
+   /* Set pmuxcr to allow both i2c1 and i2c2 */
+   setbits_be32(gur-pmuxcr, in_be32(gur-pmuxcr) | 0x1000);
+   setbits_be32(gur-pmuxcr,
+   in_be32(gur-pmuxcr) | MPC85xx_PMUXCR_SD_DATA);
+
+   /* Read back the register to synchronize the write. */
+   in_be32(gur-pmuxcr);
+
+   /* initialize selected port with appropriate baud rate */
+   px_spd = in_8((unsigned char *)(PIXIS_BASE + PIXIS_SPD));
+   sys_clk = sysclk_tbl[px_spd  PIXIS_SPD_SYSCLK_MASK];
+   plat_ratio = in_be32(gur-porpllsr)  MPC85xx_PORPLLSR_PLAT_RATIO;
+   bus_clk = sys_clk * plat_ratio / 2;
+
+   NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
+   bus_clk / 16 / CONFIG_BAUDRATE);
+#ifdef CONFIG_SPL_MMC_BOOT
+   puts(\nSD boot...\n);
+#endif
+
+   /* copy code to RAM and jump to it - this should not return */
+   /* NOTE - code has 

[U-Boot] [PATCH 4/7 v8] powerpc : spi flash : Support to start from eSPI with SPL

2013-07-15 Thread ying.zhang
From: Ying Zhang b40...@freescale.com

This patch introduces SPL to enable a loader stub that being loaded by
the code from the internal on-chip ROM. It loads the final uboot image
into DDR, then jump to it to begin execution.

The SPL's size is sizeable, the maximum size must not exceed the size of L2
SRAM. It initializes the DDR through SPD code, and copys final uboot image
to DDR. So there are two stage uboot images:
* spl_boot, 96KB size. The env variables are copied to L2 SRAM, so
that ddr spd code can get the interleaving mode setting in env. It
loads final uboot image from offset 96KB.
* final uboot image, size is variable depends on the functions
enabled.

Signed-off-by: Ying Zhang b40...@freescale.com
---
Change from v7:
- No change.
Change from v6:
- No change.
Change from v5:
- Split from powerpc/p1022ds: boot from spi flash with SPL
- this patch add the capability starting from eSPI with SPL.
Change from v4:
- No change.
Change from v3:
- No change.
Change from v2:
- No change.
Change from v1:
- Split from boot from SD card/SPI flash with SPL.

 drivers/mtd/spi/Makefile   |1 +
 drivers/mtd/spi/fsl_espi_spl.c |   78 
 drivers/mtd/spi/spi_flash.c|2 +
 3 files changed, 81 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/spi/fsl_espi_spl.c

diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index ecbb210..39e4e1d 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -27,6 +27,7 @@ LIB   := $(obj)libspi_flash.o
 
 ifdef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_SPL_SPI_LOAD)   += spi_spl_load.o
+COBJS-$(CONFIG_SPL_SPI_BOOT)   += fsl_espi_spl.o
 endif
 
 COBJS-$(CONFIG_SPI_FLASH)  += spi_flash.o
diff --git a/drivers/mtd/spi/fsl_espi_spl.c b/drivers/mtd/spi/fsl_espi_spl.c
new file mode 100644
index 000..443c2e1
--- /dev/null
+++ b/drivers/mtd/spi/fsl_espi_spl.c
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#include common.h
+#include spi_flash.h
+#include malloc.h
+
+#define ESPI_BOOT_IMAGE_SIZE   0x48
+#define ESPI_BOOT_IMAGE_ADDR   0x50
+#define CONFIG_CFG_DATA_SECTOR 0
+
+/*
+ * The main entry for SPI booting. It's necessary that SDRAM is already
+ * configured and available since this code loads the main U-Boot image
+ * from SPI into SDRAM and starts it from there.
+ */
+void spi_boot(void)
+{
+   void (*uboot)(void) __noreturn;
+   u32 offset, code_len;
+   unsigned char *buf = NULL;
+   struct spi_flash *flash;
+
+   flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
+   CONFIG_ENV_SPI_MAX_HZ, CONFIG_ENV_SPI_MODE);
+   if (flash == NULL) {
+   puts(\nspi_flash_probe failed);
+   hang();
+   }
+
+   /*
+   * Load U-Boot image from SPI flash into RAM
+   */
+   buf = malloc(flash-page_size);
+   if (buf == NULL) {
+   puts(\nmalloc failed);
+   hang();
+   }
+   memset(buf, 0, flash-page_size);
+
+   spi_flash_read(flash, CONFIG_CFG_DATA_SECTOR, \
+   flash-page_size, (void *)buf);
+   offset = *(u32 *)(buf + ESPI_BOOT_IMAGE_ADDR);
+   /* Skip spl code */
+   offset += CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS;
+   /* Get the code size from offset 0x48 */
+   code_len = *(u32 *)(buf + ESPI_BOOT_IMAGE_SIZE);
+   /* Skip spl code */
+   code_len = code_len - CONFIG_SPL_MAX_SIZE;
+   /* copy code to DDR */
+   spi_flash_read(flash, offset, code_len, \
+   (void *)CONFIG_SYS_SPI_FLASH_U_BOOT_DST);
+   /*
+   * Jump to U-Boot image
+   */
+   flush_cache(CONFIG_SYS_SPI_FLASH_U_BOOT_DST, \
+   code_len);
+   uboot = (void *) CONFIG_SYS_SPI_FLASH_U_BOOT_START;
+   (*uboot)();
+}
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 6a6fe37..e474f5c 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -554,12 +554,14 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
goto err_manufacturer_probe;
}
 #endif
+#ifndef CONFIG_SPL_BUILD
printf(SF: Detected %s with page 

[U-Boot] [PATCH 2/7 v8] powerpc: mpc85xx: Support booting from SD Card with SPL

2013-07-15 Thread ying.zhang
From: Ying Zhang b40...@freescale.com

This patch introduces SPL to enable a loader stub that being loaded by
the code from the internal on-chip ROM. It loads the final uboot image
into DDR, then jump to it to begin execution.

The SPL's size is sizeable, the maximum size must not exceed the size of L2
SRAM. It initializes the DDR through SPD code, and copys final uboot image
to DDR. So there are two stage uboot images:
* spl_boot, 96KB size. The env variables are copied to L2 SRAM, so
that ddr spd code can get the interleaving mode setting in env. It
loads final uboot image from offset 96KB.
* final uboot image, size is variable depends on the functions
enabled.
This patch is on top of the patch:
SPL: Makefile: Build a separate autoconf.mk for SPL.

Signed-off-by: Ying Zhang b40...@freescale.com
---
Change from v7:
- No change.
Change from v6:
- Split to the patch Support booting from SD Card with SPL and the patch
- Enable P1022DS to boot from SD Card with SPL. this patch only support
- booting from SD Card with SPL
Change from v5:
- Add new symbol CONFIG_SPL_ENV_IMPORT for contain the functionality
- env_import.
Change from v4:
- No change.
Change from v3:
- No change.
Change from v2:
- No change.
Change from v1:
- Split from boot from SD card/SPI flash with SPL.

 README |4 +
 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds|5 +
 .../cpu/mpc8xxx/ddr/lc_common_dimm_params.c|4 +
 doc/README.mpc85xx-sd-spi-boot |   81 
 drivers/mmc/Makefile   |3 +
 drivers/mmc/fsl_esdhc_spl.c|  131 
 drivers/mmc/mmc.c  |2 +
 include/fsl_esdhc.h|1 +
 spl/Makefile   |3 +
 9 files changed, 234 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.mpc85xx-sd-spi-boot
 create mode 100644 drivers/mmc/fsl_esdhc_spl.c

diff --git a/README b/README
index 33b5728..eb453d8 100644
--- a/README
+++ b/README
@@ -3015,6 +3015,10 @@ FIT uImage format:
Support for NAND boot using simple NAND drivers that
expose the cmd_ctrl() interface.
 
+   CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
+   Set for the SPL on PPC mpc8xxx targets, support for
+   arch/powerpc/cpu/mpc8xxx/ddr/libddr.o in SPL binary.
+
CONFIG_SYS_NAND_5_ADDR_CYCLE, CONFIG_SYS_NAND_PAGE_COUNT,
CONFIG_SYS_NAND_PAGE_SIZE, CONFIG_SYS_NAND_OOBSIZE,
CONFIG_SYS_NAND_BLOCK_SIZE, CONFIG_SYS_NAND_BAD_BLOCK_POS,
diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds 
b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
index 20284ed..8aeb1a0 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
@@ -60,6 +60,11 @@ SECTIONS
}
_edata  =  .;
 
+   . = .;
+   __start___ex_table = .;
+   __ex_table : { *(__ex_table) }
+   __stop___ex_table = .;
+
. = ALIGN(8);
__init_begin = .;
__init_end = .;
diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c 
b/arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c
index e958e13..56128a7 100644
--- a/arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c
+++ b/arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c
@@ -218,12 +218,16 @@ compute_lowest_common_dimm_parameters(const dimm_params_t 
*dimm_params,
if (dimm_params[i].n_ranks) {
if (dimm_params[i].registered_dimm) {
temp1 = 1;
+#ifndef CONFIG_SPL_BUILD
printf(Detected RDIMM %s\n,
dimm_params[i].mpart);
+#endif
} else {
temp2 = 1;
+#ifndef CONFIG_SPL_BUILD
printf(Detected UDIMM %s\n,
dimm_params[i].mpart);
+#endif
}
}
}
diff --git a/doc/README.mpc85xx-sd-spi-boot b/doc/README.mpc85xx-sd-spi-boot
new file mode 100644
index 000..d5043cc
--- /dev/null
+++ b/doc/README.mpc85xx-sd-spi-boot
@@ -0,0 +1,81 @@
+
+Booting from On-Chip ROM (eSDHC or eSPI)
+
+
+boot_format is a tool to write SD bootable images to a filesystem and build
+SD/SPI images to a binary file for writing later.
+
+When booting from an SD card/MMC, boot_format puts the configuration file and
+the RAM-based U-Boot image on the card.
+When booting from an EEPROM, boot_format generates a binary image that is used
+to boot from this EEPROM.
+
+Where to get boot_format:
+
+
+you can browse it online at:
+http://git.freescale.com/git/cgit.cgi/ppc/sdk/boot-format.git/
+
+Building

[U-Boot] [PATCH 7/7 v8] powerpc: p1022ds: add TPL for p1022ds nand boot

2013-07-15 Thread ying.zhang
From: Ying Zhang b40...@freescale.com

TPL is introduced in the patch NAND: TPL : introduce the TPL
based on the SPL, here enable TPL for p1022ds nand boot.

Signed-off-by: Ying Zhang b40...@freescale.com
---
Change from v7:
- No change.
Change from v6:
- Delete the file board/freescale/p1022ds/tpl.c.
- Reuse the file board/freescale/p1022ds/spl.c in the TPL.
Change from v5:
- Change functionality nand_load_image to nand_load, it is called in TPL.
Change from v4:
- No change.
Change from v3:
- No change.
Change from v2:
- No change.
Change from v1:
- Split from powerpc/p1022ds: nand: introduce the TPL based on the SPL.

 board/freescale/p1022ds/spl.c |   15 +++
 board/freescale/p1022ds/spl_minimal.c |   53 ++--
 include/configs/P1022DS.h |   70 ++--
 3 files changed, 77 insertions(+), 61 deletions(-)

diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c
index b6669f3..79e3ac4 100644
--- a/board/freescale/p1022ds/spl.c
+++ b/board/freescale/p1022ds/spl.c
@@ -101,21 +101,36 @@ void board_init_r(gd_t *gd, ulong dest_addr)
get_clocks();
mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR, \
CONFIG_SPL_RELOC_MALLOC_SIZE);
+#ifndef CONFIG_SPL_NAND_BOOT
env_init();
+#endif
 #ifdef CONFIG_SPL_MMC_BOOT
mmc_initialize(bd);
 #endif
/* relocate environment function pointers etc. */
+#ifdef CONFIG_SPL_NAND_BOOT
+   nand_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
+   (uchar *)CONFIG_ENV_ADDR);
+   gd-env_addr  = (ulong)(CONFIG_ENV_ADDR);
+   gd-env_valid = 1;
+#else
env_relocate();
+#endif
 
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 
gd-ram_size = initdram(0);
+#ifdef CONFIG_SPL_NAND_BOOT
+   puts(Tertiary program loader running in sram...);
+#else
puts(Second program loader running in sram...\n);
+#endif
 
 #ifdef CONFIG_SPL_MMC_BOOT
mmc_boot();
 #elif defined(CONFIG_SPL_SPI_BOOT)
spi_boot();
+#elif defined(CONFIG_SPL_NAND_BOOT)
+   nand_boot();
 #endif
 }
diff --git a/board/freescale/p1022ds/spl_minimal.c 
b/board/freescale/p1022ds/spl_minimal.c
index 8d12fa6..efb2af3 100644
--- a/board/freescale/p1022ds/spl_minimal.c
+++ b/board/freescale/p1022ds/spl_minimal.c
@@ -27,51 +27,6 @@
 #include asm/fsl_ddr_sdram.h
 
 
-/*
- * Fixed sdram init -- doesn't use serial presence detect.
- */
-void sdram_init(void)
-{
-   volatile ccsr_ddr_t *ddr = (ccsr_ddr_t *)CONFIG_SYS_MPC8xxx_DDR_ADDR;
-
-   __raw_writel(CONFIG_SYS_DDR_CS0_BNDS, ddr-cs0_bnds);
-   __raw_writel(CONFIG_SYS_DDR_CS0_CONFIG, ddr-cs0_config);
-#if CONFIG_CHIP_SELECTS_PER_CTRL  1
-   __raw_writel(CONFIG_SYS_DDR_CS1_BNDS, ddr-cs1_bnds);
-   __raw_writel(CONFIG_SYS_DDR_CS1_CONFIG, ddr-cs1_config);
-#endif
-   __raw_writel(CONFIG_SYS_DDR_TIMING_3, ddr-timing_cfg_3);
-   __raw_writel(CONFIG_SYS_DDR_TIMING_0, ddr-timing_cfg_0);
-   __raw_writel(CONFIG_SYS_DDR_TIMING_1, ddr-timing_cfg_1);
-   __raw_writel(CONFIG_SYS_DDR_TIMING_2, ddr-timing_cfg_2);
-
-   __raw_writel(CONFIG_SYS_DDR_CONTROL_2, ddr-sdram_cfg_2);
-   __raw_writel(CONFIG_SYS_DDR_MODE_1, ddr-sdram_mode);
-   __raw_writel(CONFIG_SYS_DDR_MODE_2, ddr-sdram_mode_2);
-
-   __raw_writel(CONFIG_SYS_DDR_INTERVAL, ddr-sdram_interval);
-   __raw_writel(CONFIG_SYS_DDR_DATA_INIT, ddr-sdram_data_init);
-   __raw_writel(CONFIG_SYS_DDR_CLK_CTRL, ddr-sdram_clk_cntl);
-
-   __raw_writel(CONFIG_SYS_DDR_TIMING_4, ddr-timing_cfg_4);
-   __raw_writel(CONFIG_SYS_DDR_TIMING_5, ddr-timing_cfg_5);
-   __raw_writel(CONFIG_SYS_DDR_ZQ_CONTROL, ddr-ddr_zq_cntl);
-   __raw_writel(CONFIG_SYS_DDR_WRLVL_CONTROL, ddr-ddr_wrlvl_cntl);
-
-   /* Set, but do not enable the memory */
-   __raw_writel(CONFIG_SYS_DDR_CONTROL  ~SDRAM_CFG_MEM_EN,
-   ddr-sdram_cfg);
-
-   in_be32(ddr-sdram_cfg);
-   udelay(500);
-
-   /* Let the controller go */
-   out_be32(ddr-sdram_cfg, in_be32(ddr-sdram_cfg) | SDRAM_CFG_MEM_EN);
-   in_be32(ddr-sdram_cfg);
-
-   set_next_law(0, CONFIG_SYS_SDRAM_SIZE_LAW, LAW_TRGT_IF_DDR_1);
-}
-
 const static u32 sysclk_tbl[] = {
6000, 7499900, 83332500, 800,
9000, 1000, 12499800, 1200
@@ -83,6 +38,10 @@ void board_init_f(ulong bootflag)
u32 plat_ratio, sys_clk, bus_clk;
ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
 
+#if defined(CONFIG_SYS_NAND_BR_PRELIM)  defined(CONFIG_SYS_NAND_OR_PRELIM)
+   set_lbc_br(0, CONFIG_SYS_NAND_BR_PRELIM);
+   set_lbc_or(0, CONFIG_SYS_NAND_OR_PRELIM);
+#endif
/* for FPGA */
set_lbc_br(2, CONFIG_SYS_BR2_PRELIM);
set_lbc_or(2, CONFIG_SYS_OR2_PRELIM);
@@ -98,9 +57,6 @@ void board_init_f(ulong bootflag)
 
puts(\nNAND boot... );
 
-   /* Initialize the DDR3 */
-   sdram_init();
-
/* copy code to RAM and jump to it - 

[U-Boot] [PATCH 5/7 v8] powerpc : p1022ds : enable p1022ds to start from eSPI with SPL

2013-07-15 Thread ying.zhang
From: Ying Zhang b40...@freescale.com

Enable p1022ds to start from eSPI with SPL.

Signed-off-by: Ying Zhang b40...@freescale.com
---
Change from v7:
- No change.
Change from v6:
- No longer changes the header file included by the file
- board/freescale/p1022ds/spl.c
Change from v5:
- Split from powerpc/p1022ds: boot from spi flash with SPL
- this patch enable P1022DS to start from eSPI with SPL.
Change from v4:
- No change.
Change from v3:
- No change.
Change from v2:
- No change.
Change from v1:
- Split from boot from SD card/SPI flash with SPL.

 board/freescale/p1022ds/spl.c |   10 ++
 include/configs/P1022DS.h |   36 +---
 2 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c
index 9927671..b6669f3 100644
--- a/board/freescale/p1022ds/spl.c
+++ b/board/freescale/p1022ds/spl.c
@@ -27,6 +27,7 @@
 #include i2c.h
 #include ../common/ngpixis.h
 #include fsl_esdhc.h
+#include spi_flash.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -53,6 +54,11 @@ void board_init_f(ulong bootflag)
setbits_be32(gur-pmuxcr,
in_be32(gur-pmuxcr) | MPC85xx_PMUXCR_SD_DATA);
 
+#ifdef CONFIG_SPL_SPI_BOOT
+   /* Enable the SPI */
+   clrsetbits_8(pixis-brdcfg0, PIXIS_ELBC_SPI_MASK, PIXIS_SPI);
+#endif
+
/* Read back the register to synchronize the write. */
in_be32(gur-pmuxcr);
 
@@ -66,6 +72,8 @@ void board_init_f(ulong bootflag)
bus_clk / 16 / CONFIG_BAUDRATE);
 #ifdef CONFIG_SPL_MMC_BOOT
puts(\nSD boot...\n);
+#elif defined(CONFIG_SPL_SPI_BOOT)
+   puts(\nSPI Flash boot...\n);
 #endif
 
/* copy code to RAM and jump to it - this should not return */
@@ -107,5 +115,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
 
 #ifdef CONFIG_SPL_MMC_BOOT
mmc_boot();
+#elif defined(CONFIG_SPL_SPI_BOOT)
+   spi_boot();
 #endif
 }
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index 5a532f4..11c464e 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -48,11 +48,33 @@
 #endif
 
 #ifdef CONFIG_SPIFLASH
-#define CONFIG_RAMBOOT_SPIFLASH
-#define CONFIG_SYS_RAMBOOT
-#define CONFIG_SYS_EXTRA_ENV_RELOC
-#define CONFIG_SYS_TEXT_BASE   0x1100
-#define CONFIG_RESET_VECTOR_ADDRESS0x1107fffc
+#define CONFIG_SPL
+#define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
+#define CONFIG_SPL_ENV_SUPPORT
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_MINIMAL
+#define CONFIG_SPL_FLUSH_IMAGE
+#define CONFIG_SPL_TARGET  u-boot-with-spl.bin
+#define CONFIG_SPL_LIBGENERIC_SUPPORT
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_I2C_SUPPORT
+#define CONFIG_FSL_LAW /* Use common FSL init code */
+#define CONFIG_SYS_TEXT_BASE   0x11001000
+#define CONFIG_SPL_TEXT_BASE   0xf8f81000
+#define CONFIG_SPL_PAD_TO  0x18000
+#define CONFIG_SPL_MAX_SIZE(96 * 1024)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE   (512  10)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_DST(0x1100)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_START  (0x1100)
+#define CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS   (96  10)
+#define CONFIG_SYS_MPC85XX_NO_RESETVEC
+#define CONFIG_SYS_LDSCRIPTarch/powerpc/cpu/mpc85xx/u-boot.lds
+#define CONFIG_SPL_SPI_BOOT
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SPL_COMMON_INIT_DDR
+#endif
 #endif
 
 #define CONFIG_NAND_FSL_ELBC
@@ -318,7 +340,7 @@
  * Config the L2 Cache as L2 SRAM
 */
 #if defined(CONFIG_SPL_BUILD)
-#if defined(CONFIG_SDCARD)
+#if defined(CONFIG_SDCARD) || defined(CONFIG_SPIFLASH)
 #define CONFIG_SYS_INIT_L2_ADDR0xf8f8
 #define CONFIG_SYS_INIT_L2_ADDR_PHYS   CONFIG_SYS_INIT_L2_ADDR
 #define CONFIG_SYS_L2_SIZE (256  10)
@@ -562,7 +584,7 @@
 /*
  * Environment
  */
-#ifdef CONFIG_RAMBOOT_SPIFLASH
+#ifdef CONFIG_SPIFLASH
 #define CONFIG_ENV_IS_IN_SPI_FLASH
 #define CONFIG_ENV_SPI_BUS 0
 #define CONFIG_ENV_SPI_CS  0
-- 
1.7.0.4


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


[U-Boot] [PATCH 6/7 v8] NAND: TPL : introduce the TPL based on the SPL

2013-07-15 Thread ying.zhang
From: Ying Zhang b40...@freescale.com

Due to the nand SPL on some board(e.g. P1022DS)has a size limit, it can
not be more than 4K. So, the SPL cannot initialize the DDR with the SPD
code. This patch introduces TPL to enable a loader stub that is loaded
by the code from the SPL. It initializes the DDR with the SPD or other
operations.

The TPL's size is sizeable, the maximum size is decided by the memory's
size that TPL runs. It initializes the DDR through SPD code, and copys
final uboot image to DDR. So there are three stage uboot images:
* spl_boot, * tpl_boot, * final uboot image

This patch is on top of the patch:
SPL: Makefile: Build a separate autoconf.mk for SPL

Signed-off-by: Ying Zhang b40...@freescale.com
---
Change from v7:
- Modify the doc/README.TPL
- Modify the spl/Makefile.
Change from v6:
- Modify the description of the patch.
- Add the separate the autoconf.mk for TPL.
- Delete the file tpl/Makefile and the directory tpl.
- Reuse the spl/Makefie in TPL.
Change from v5:
- Use ifdef to define nand_load_image to non-static for non-SPL.
Change from v4:
- No change.
Change from v3:
- No change.
Change from v2:
- No change.
Change from v1:
- Split from powerpc/p1022ds: nand: introduce the TPL based on the SPL.

 Makefile|   44 +---
 README  |9 +
 config.mk   |   17 +
 doc/README.TPL  |   71 +++
 drivers/mtd/nand/Makefile   |1 +
 drivers/mtd/nand/fsl_elbc_spl.c |5 ++-
 include/nand.h  |3 ++
 spl/Makefile|   25 +++---
 8 files changed, 164 insertions(+), 11 deletions(-)
 create mode 100644 doc/README.TPL

diff --git a/Makefile b/Makefile
index 64e0ea1..b5c1538 100644
--- a/Makefile
+++ b/Makefile
@@ -413,6 +413,7 @@ ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
 ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
 ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
+ALL-$(CONFIG_TPL) += $(obj)spl/u-boot-tpl.bin
 ALL-$(CONFIG_OF_SEPARATE) += $(obj)u-boot.dtb $(obj)u-boot-dtb.bin
 ifneq ($(CONFIG_SPL_TARGET),)
 ALL-$(CONFIG_SPL) += $(obj)$(subst ,,$(CONFIG_SPL_TARGET))
@@ -492,12 +493,25 @@ $(obj)u-boot.dis: $(obj)u-boot
$(OBJDUMP) -d $  $@
 
 
-
+ifdef CONFIG_TPL
+$(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(obj)spl/u-boot-tpl.bin \
+   $(obj)u-boot.bin
+   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
+   -I binary -O binary \
+   $(obj)spl/u-boot-spl.bin $(obj)spl/u-boot-spl-pad.bin
+   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
+   -I binary -O binary \
+   $(obj)spl/u-boot-tpl.bin $(obj)spl/u-boot-tpl-pad.bin
+   cat $(obj)spl/u-boot-spl-pad.bin $(obj)spl/u-boot-tpl-pad.bin \
+   $(obj)u-boot.bin  $@
+   rm $(obj)spl/u-boot-spl-pad.bin $(obj)spl/u-boot-tpl-pad.bin
+else
 $(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
-I binary -O binary $ $(obj)spl/u-boot-spl-pad.bin
cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin  $@
rm $(obj)spl/u-boot-spl-pad.bin
+endif
 
 $(obj)u-boot-with-spl.imx: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
$(MAKE) -C $(SRCTREE)/arch/arm/imx-common \
@@ -621,7 +635,12 @@ $(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin
cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin  
$(obj)u-boot-nand.bin
 
 $(obj)spl/u-boot-spl.bin:  $(SUBDIR_TOOLS) depend
-   $(MAKE) -C spl all
+   $(MAKE) -C spl clean
+   $(MAKE) -C spl all CONFIG_SPL_BUILD=y
+
+$(obj)spl/u-boot-tpl.bin:  $(SUBDIR_TOOLS) depend
+   $(MAKE) -C spl clean
+   $(MAKE) -C spl all CONFIG_TPL_BUILD=y CONFIG_SPL_BUILD=y
 
 updater:
$(MAKE) -C tools/updater all
@@ -630,6 +649,7 @@ updater:
 # parallel sub-makes creating .depend files simultaneously.
 depend dep:$(TIMESTAMP_FILE) $(VERSION_FILE) \
$(obj)include/spl-autoconf.mk \
+   $(obj)include/tpl-autoconf.mk \
$(obj)include/autoconf.mk \
$(obj)include/generated/generic-asm-offsets.h \
$(obj)include/generated/asm-offsets.h
@@ -704,8 +724,16 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
$(CPP) $(CFLAGS) -DDO_DEPS_ONLY -dM include/common.h | \
sed -n -f tools/scripts/define2mk.sed  $@.tmp  \
mv $@.tmp $@
-
 # Auto-generate the spl-autoconf.mk file (which is included by all makefiles 
for SPL)
+$(obj)include/tpl-autoconf.mk: $(obj)include/config.h
+   @$(XECHO) Generating $@ ; \
+   

[U-Boot] [U-boot] uboot.lst file question

2013-07-15 Thread TigerLiu
Hi, experts:
I found no *.lst file produced in root directory after compiling uboot
source code.

In the Makefile in older version uboot souce code:
..
uboot.bin:  uboot
$(OBJCOPY) ${OBJCFLAGS} -O binary $ $@
$(OBJDUMP) -d -EL -h -M reg-names-raw --syms
--full-contents -marm $  uboot.lst
..

I think uboot.lst is very useful .

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


Re: [U-Boot] [PATCH v3] drivers:power:max77686: add function to set voltage and mode

2013-07-15 Thread Piotr Wilczek

Dear Tom,

This patch is delegated to you. Could you review this patch for the next 
release?


Best regards,
Piotr Wilczek

--
Samsung RD Institute Poland (SRPOL)

On 06/25/2013 09:59 AM, Piotr Wilczek wrote:

This patch add new functions to pmic max77686 to set voltage and mode.

Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
CC: Minkyu Kang mk7.k...@samsung.com
CC: Rajeshwari Shinde rajeshwar...@samsung.com

Acked-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
Changes in v3:
- removed magic values
- used ARRAY_SIZE() for array size calculation
- used switch case instead if else if
- added return when pmic read error occurs

Changes in v2:
- changed printf to debug

  drivers/power/pmic/pmic_max77686.c |  192 
  include/power/max77686_pmic.h  |   26 +
  2 files changed, 218 insertions(+)

diff --git a/drivers/power/pmic/pmic_max77686.c 
b/drivers/power/pmic/pmic_max77686.c
index 7fcb4c0..3960ca9 100644
--- a/drivers/power/pmic/pmic_max77686.c
+++ b/drivers/power/pmic/pmic_max77686.c
@@ -30,6 +30,198 @@

  DECLARE_GLOBAL_DATA_PTR;

+static const char max77686_buck_addr[] = {
+   0xff, 0x10, 0x12, 0x1c, 0x26, 0x30, 0x32, 0x34, 0x36, 0x38
+};
+
+static unsigned int max77686_ldo_volt2hex(int ldo, ulong uV)
+{
+   unsigned int hex = 0;
+
+   switch (ldo) {
+   case 1:
+   case 2:
+   case 6:
+   case 7:
+   case 8:
+   case 15:
+   hex = (uV - 80) / 25000;
+   break;
+   default:
+   hex = (uV - 80) / 5;
+   }
+
+   if (hex = 0  hex = MAX77686_LDO_VOLT_MAX_HEX)
+   return hex;
+
+   debug(%s: %ld is wrong voltage value for LDO%d\n, __func__, uV, ldo);
+   return 0;
+}
+
+int max77686_set_ldo_voltage(struct pmic *p, int ldo, ulong uV)
+{
+   unsigned int val, ret, hex, adr;
+
+   if (ldo  1  ldo  26) {
+   printf(%s: %d is wrong ldo number\n, __func__, ldo);
+   return -1;
+   }
+
+   adr = MAX77686_REG_PMIC_LDO1CTRL1 + ldo - 1;
+   hex = max77686_ldo_volt2hex(ldo, uV);
+
+   if (!hex)
+   return -1;
+
+   ret = pmic_reg_read(p, adr, val);
+   if (ret)
+   return ret;
+
+   val = ~MAX77686_LDO_VOLT_MASK;
+   val |= hex;
+   ret |= pmic_reg_write(p, adr, val);
+
+   return ret;
+}
+
+int max77686_set_ldo_mode(struct pmic *p, int ldo, char opmode)
+{
+   unsigned int val, ret, adr, mode;
+
+   if (ldo  1  26  ldo) {
+   printf(%s: %d is wrong ldo number\n, __func__, ldo);
+   return -1;
+   }
+
+   adr = MAX77686_REG_PMIC_LDO1CTRL1 + ldo - 1;
+
+   /* mode */
+   switch (opmode) {
+   case OPMODE_OFF:
+   mode = MAX77686_LDO_MODE_OFF;
+   break;
+   case OPMODE_STANDBY:
+   switch (ldo) {
+   case 2:
+   case 6:
+   case 7:
+   case 8:
+   case 10:
+   case 11:
+   case 12:
+   case 14:
+   case 15:
+   case 16:
+   mode = MAX77686_LDO_MODE_STANDBY;
+   break;
+   default:
+   mode = 0xff;
+   }
+   break;
+   case OPMODE_LPM:
+   mode = MAX77686_LDO_MODE_LPM;
+   break;
+   case OPMODE_ON:
+   mode = MAX77686_LDO_MODE_ON;
+   break;
+   default:
+   mode = 0xff;
+   }
+
+   if (mode == 0xff) {
+   printf(%s: %d is not supported on LDO%d\n,
+  __func__, opmode, ldo);
+   return -1;
+   }
+
+   ret = pmic_reg_read(p, adr, val);
+   if (ret)
+   return ret;
+
+   val = ~MAX77686_LDO_MODE_MASK;
+   val |= mode;
+   ret |= pmic_reg_write(p, adr, val);
+
+   return ret;
+}
+
+int max77686_set_buck_mode(struct pmic *p, int buck, char opmode)
+{
+   unsigned int val, ret, mask, adr, size, mode, mode_shift;
+
+   size = ARRAY_SIZE(max77686_buck_addr);
+   if (buck = size) {
+   printf(%s: %d is wrong buck number\n, __func__, buck);
+   return -1;
+   }
+
+   adr = max77686_buck_addr[buck];
+
+   /* mask */
+   switch (buck) {
+   case 2:
+   case 3:
+   case 4:
+   mode_shift = MAX77686_BUCK_MODE_SHIFT_2;
+   break;
+   default:
+   mode_shift = MAX77686_BUCK_MODE_SHIFT_1;
+   }
+
+   mask = MAX77686_BUCK_MODE_MASK  mode_shift;
+
+   /* mode */
+   switch (opmode) {
+   case OPMODE_OFF:
+   mode = MAX77686_BUCK_MODE_OFF;
+   break;
+   case OPMODE_STANDBY:
+   switch (buck) {
+   case 1:
+   case 2:
+   case 3:
+   case 4:
+   

Re: [U-Boot] [PATCH] OpenRD: relocate environment to 640kB

2013-07-15 Thread Albert ARIBAUD
Hi Sascha,

On Mon, 15 Jul 2013 11:23:54 +0200, Sascha Silbe
t-ub...@infra-silbe.de wrote:

 Albert ARIBAUD albert.u.b...@aribaud.net writes:
 
  The situation has gotten better recently and U-Boot fits into the
  previous partition size of 384KiB again. So it isn't broken on OpenRD
  anymore and the above would seem like a good approach.
  How well does it fit again, and do you have any idea what caused the
  increase in size, and what caused the decrease?
 
 I had the same questions and tried a few buildman runs, but didn't get a
 clear picture. The size was going up and down for various slices of
 commits.
 
 With v2013.07-rc3, we are now at 376344B (≈ 96% of 384KiB) for
 openrd_ultimate when built on Debian Wheezy using
 gcc-4.7-arm-linux-gnueabi from Emdebian.

Thanks for the info.

 Is there an equivalent to CONFIG_SPL_MAX_SIZE for the regular U-Boot?
 Detecting the overlap at build time would prevent bricking the device
 using saveenv at run time. As an additional benefit, commits that push
 the size beyond the limit would also show up in buildman reports as
 build failures.

I don't know of a feature like CONFIG_SPL_MAX_SIZE for regular U-Boot.
You could 'port it over' as something like CONFIG_MAX_IMAGE_SIZE for
U-Boot.

Somehow I gather that an approach like the one I sketched out in
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/165510
could bring benefits like making CONFIG_SPL_MAX_SIZE a feature of a
constraints component which could be built as well in U-Boot as in
SPL; but that's at the very early RFC stage anyway -- actually, it drew
no reaction at all so far, leading me to think it's not that useful.

 Sascha

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


[U-Boot] [PATCH V3 0/6] omap3_beagle: configs: improve BOOT_CMD options

2013-07-15 Thread Nishanth Menon
With the latest transition to device tree, there is a need to simplify
the load of device tree depending on board type etc. While at it, simplify
few other changes as well.

Testing:
with a uEnv.txt as:
bootdir=/
bootpart=0:1

The following were the boot results:
Beagle (rev C1D): http://pastebin.com/fMdsKkgr
Beagle XM (rev C1): http://pastebin.com/p1zp9AhG

Changes in V3 since v2:
- Minor fixes for RevB beagleboard DVIpup handling
http://marc.info/?t=13735797054r=1w=2
- Picked up acked-by from http://marc.info/?t=13735797077r=1w=2

V2: http://marc.info/?l=u-bootm=137358206228251w=2
V1: http://marc.info/?l=u-bootm=137357963227510w=2

Nishanth Menon (6):
  omap3_beagle: remove JFFS2 support.
  omap3_beagle: replace uImage.beagle with generic uImage
  beagleboard: remove RevB support for BeagleBoard Xm
  omap3_beagle: enable CMD_FS_GENERIC and simplify load of
image/ramdisk
  omap3_beagle: support findfdt and loadfdt for devicetree support
  omap3_beagle: support booting from zImage and device tree as last
option

 board/ti/beagle/beagle.c   |   28 +++--
 board/ti/beagle/beagle.h   |3 +--
 include/configs/omap3_beagle.h |   44 
 3 files changed, 39 insertions(+), 36 deletions(-)

-- 
1.7.9.5

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


[U-Boot] [PATCH V3 4/6] omap3_beagle: enable CMD_FS_GENERIC and simplify load of image/ramdisk

2013-07-15 Thread Nishanth Menon
CMD_FS_GENERIC allows us to simplify where we load up our image from
either from ext2/fat etc. So, lets use that instead of cumbersome
options we currently use. Sticking with existing conventions,
defaults will be:
ramdisk=ramdisk.gz
bootpart=0:2 (second partition)
bootdir=/boot (/boot in second partition)

This matches with the default behavior, these can be overriden by
env files as needed.

Signed-off-by: Nishanth Menon n...@ti.com
---
 include/configs/omap3_beagle.h |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index e152d3c..bdeee17 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -150,6 +150,7 @@
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_EXT2/* EXT2 Support */
 #define CONFIG_CMD_FAT /* FAT support  */
+#define CONFIG_CMD_FS_GENERIC  /* Generic FS support */
 #define CONFIG_CMD_MTDPARTS/* Enable MTD parts commands */
 #define CONFIG_MTD_DEVICE  /* needed for mtdparts commands */
 #define MTDIDS_DEFAULT nand0=nand
@@ -211,6 +212,9 @@
rdaddr=0x8100\0 \
usbtty=cdc_acm\0 \
bootfile=uImage\0 \
+   ramdisk=ramdisk.gz\0 \
+   bootdir=/boot\0 \
+   bootpart=0:2\0 \
console=ttyO2,115200n8\0 \
mpurate=auto\0 \
buddy=none\0 \
@@ -259,9 +263,8 @@
omapdss.def_disp=${defaultdisplay}  \
root=${ramroot}  \
rootfstype=${ramrootfstype}\0 \
-   loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz\0 \
-   loaduimagefat=fatload mmc ${mmcdev} ${loadaddr} uImage\0 \
-   loaduimage=ext2load mmc ${mmcdev}:2 ${loadaddr} /boot/uImage\0 \
+   loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0 \
+   loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0 \
mmcboot=echo Booting from mmc ...;  \
run mmcargs;  \
bootm ${loadaddr}\0 \
@@ -293,7 +296,7 @@
echo Running uenvcmd ...; \
run uenvcmd; \
fi; \
-   if run loaduimage; then  \
+   if run loadimage; then  \
run mmcboot; \
fi; \
fi; \
-- 
1.7.9.5

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


[U-Boot] [PATCH V3 2/6] omap3_beagle: replace uImage.beagle with generic uImage

2013-07-15 Thread Nishanth Menon
e682930867f7dfc4a01784fe452fad9e962d65a
(BeagleBoard: config: use uImage.beagle for tftp)

Introduced uImage.beagle which does not happen to be default output
file of Linux kernel build make uImage (output is uImage).

So, replace uImage.beagle with uImage

Signed-off-by: Nishanth Menon n...@ti.com
---
 include/configs/omap3_beagle.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 9adf4a5..e152d3c 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -210,7 +210,7 @@
loadaddr=0x8020\0 \
rdaddr=0x8100\0 \
usbtty=cdc_acm\0 \
-   bootfile=uImage.beagle\0 \
+   bootfile=uImage\0 \
console=ttyO2,115200n8\0 \
mpurate=auto\0 \
buddy=none\0 \
-- 
1.7.9.5

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


[U-Boot] [PATCH V3 3/6] beagleboard: remove RevB support for BeagleBoard Xm

2013-07-15 Thread Nishanth Menon
As reported in http://marc.info/?l=u-bootm=137358037827735w=2

There is no need for the xMB variant, as the gpio pins used for
identification where never changed from the xMA when the newer silcon
was used for the xMB, So rename XM A revision as AB revision
and report accordingly

Reported-by: Robert Nelson robertcnel...@gmail.com
Signed-off-by: Nishanth Menon n...@ti.com
---

V3 updates based on http://marc.info/?t=13735797054r=1w=2

 board/ti/beagle/beagle.c |   28 +++-
 board/ti/beagle/beagle.h |3 +--
 2 files changed, 8 insertions(+), 23 deletions(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index c686f40..c48dece 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -182,8 +182,7 @@ void get_board_mem_timings(struct board_sdrc_timings 
*timings)
timings-rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
break;
}
-   case REVISION_XM_A:
-   case REVISION_XM_B:
+   case REVISION_XM_AB:
case REVISION_XM_C:
if (pop_mfr == 0) {
/* 256MB DDR */
@@ -256,8 +255,7 @@ static void beagle_display_init(void)
case REVISION_C4:
omap3_dss_panel_config(dvid_cfg);
break;
-   case REVISION_XM_A:
-   case REVISION_XM_B:
+   case REVISION_XM_AB:
case REVISION_XM_C:
default:
omap3_dss_panel_config(dvid_cfg_xm);
@@ -276,12 +274,11 @@ static void beagle_dvi_pup(void)
case REVISION_AXBX:
case REVISION_CX:
case REVISION_C4:
-   case REVISION_XM_A:
gpio_request(170, );
gpio_direction_output(170, 0);
gpio_set_value(170, 1);
break;
-   case REVISION_XM_B:
+   case REVISION_XM_AB:
case REVISION_XM_C:
default:
#define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3)
@@ -359,19 +356,9 @@ int misc_init_r(void)
TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
break;
-   case REVISION_XM_A:
-   printf(Beagle xM Rev A\n);
-   setenv(beaglerev, xMA);
-   MUX_BEAGLE_XM();
-   /* Set VAUX2 to 1.8V for EHCI PHY */
-   twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
-   TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
-   TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
-   TWL4030_PM_RECEIVER_DEV_GRP_P1);
-   break;
-   case REVISION_XM_B:
-   printf(Beagle xM Rev B\n);
-   setenv(beaglerev, xMB);
+   case REVISION_XM_AB:
+   printf(Beagle xM Rev A/B\n);
+   setenv(beaglerev, xMAB);
MUX_BEAGLE_XM();
/* Set VAUX2 to 1.8V for EHCI PHY */
twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
@@ -484,8 +471,7 @@ int misc_init_r(void)
 
twl4030_power_init();
switch (get_board_revision()) {
-   case REVISION_XM_A:
-   case REVISION_XM_B:
+   case REVISION_XM_AB:
twl4030_led_init(TWL4030_LED_LEDEN_LEDBON);
break;
default:
diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h
index 6d71bbc..27f8b12 100644
--- a/board/ti/beagle/beagle.h
+++ b/board/ti/beagle/beagle.h
@@ -39,8 +39,7 @@ const omap3_sysinfo sysinfo = {
 #define REVISION_AXBX  0x7
 #define REVISION_CX0x6
 #define REVISION_C40x5
-#define REVISION_XM_A  0x0
-#define REVISION_XM_B  0x1
+#define REVISION_XM_AB 0x0
 #define REVISION_XM_C  0x2
 
 /*
-- 
1.7.9.5

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


[U-Boot] [PATCH V3 5/6] omap3_beagle: support findfdt and loadfdt for devicetree support

2013-07-15 Thread Nishanth Menon
For folks not using concatenated device tree with uImage, having
an handy function to find and load device tree is very handy.

So introduce findfdt and loadfdt and run findfdt by default to make
it easier on user scripts.

Signed-off-by: Nishanth Menon n...@ti.com
---
V3: Fixes typo mistake reported in http://marc.info/?t=13735821236r=1w=2

 include/configs/omap3_beagle.h |   15 +++
 1 file changed, 15 insertions(+)

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index bdeee17..5ec8ade 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -210,6 +210,8 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
loadaddr=0x8020\0 \
rdaddr=0x8100\0 \
+   fdt_high=0x\0 \
+   fdtaddr=0x80f8\0 \
usbtty=cdc_acm\0 \
bootfile=uImage\0 \
ramdisk=ramdisk.gz\0 \
@@ -250,6 +252,17 @@
omapdss.def_disp=${defaultdisplay}  \
root=${nandroot}  \
rootfstype=${nandrootfstype}\0 \
+   findfdt= \
+   if test $beaglerev = AxBx; then  \
+   setenv fdtfile omap3-beagle.dtb; fi;  \
+   if test $beaglerev = Cx; then  \
+   setenv fdtfile omap3-beagle.dtb; fi;  \
+   if test $beaglerev = xMAB; then  \
+   setenv fdtfile omap3-beagle-xm.dtb; fi;  \
+   if test $beaglerev = xMC; then  \
+   setenv fdtfile omap3-beagle-xm.dtb; fi;  \
+   if test $fdtfile = undefined; then  \
+   echo WARNING: Could not determine device tree to use; 
fi; \0 \
bootenv=uEnv.txt\0 \
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0 \
importbootenv=echo Importing environment from mmc ...;  \
@@ -265,6 +278,7 @@
rootfstype=${ramrootfstype}\0 \
loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0 \
loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0 \
+   loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0 \
mmcboot=echo Booting from mmc ...;  \
run mmcargs;  \
bootm ${loadaddr}\0 \
@@ -281,6 +295,7 @@
userbutton_nonxm=gpio input 7;\0
 /* run userbutton will return 1 (false) if pressed and 0 (true) if not */
 #define CONFIG_BOOTCOMMAND \
+   run findfdt;  \
mmc dev ${mmcdev}; if mmc rescan; then  \
if run userbutton; then  \
setenv bootenv uEnv.txt; \
-- 
1.7.9.5

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


[U-Boot] [PATCH V3 6/6] omap3_beagle: support booting from zImage and device tree as last option

2013-07-15 Thread Nishanth Menon
If no other bootoption works, try loading up device tree and zImage.

This is selected as the last option to allow backward compatibility as
well as support the recent trend in moving kernel boot to using zImage
and device tree.

NOTE: if uImage is present in bootpart, it will try this first and
will assume this is to be booted with bootm (so may be concatenated
image or plain vanilla ATAG MACHINE_ID based image)

Signed-off-by: Nishanth Menon n...@ti.com
---
 include/configs/omap3_beagle.h |8 
 1 file changed, 8 insertions(+)

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 5ec8ade..a2e6971 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -282,6 +282,9 @@
mmcboot=echo Booting from mmc ...;  \
run mmcargs;  \
bootm ${loadaddr}\0 \
+   mmcbootz=echo Booting with DT from mmc${mmcdev} ...;  \
+   run mmcargs;  \
+   bootz ${loadaddr} - ${fdtaddr}\0 \
nandboot=echo Booting from nand ...;  \
run nandargs;  \
nand read ${loadaddr} 28 40;  \
@@ -316,6 +319,11 @@
fi; \
fi; \
run nandboot; \
+   setenv bootfile zImage; \
+   if run loadimage; then  \
+   run loadfdt; \
+   run mmcbootz;  \
+   fi;  \
 
 #define CONFIG_AUTO_COMPLETE   1
 /*
-- 
1.7.9.5

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


[U-Boot] [PATCH V3 1/6] omap3_beagle: remove JFFS2 support.

2013-07-15 Thread Nishanth Menon
We do not use JFFS2 by default and it conflicts with
CONFIG_CMD_FS_GENERIC (ls command is the same). Since most of our
BOOTCMD can be simplified by using the FS_GENERIC, dropping JFFS2

Signed-off-by: Nishanth Menon n...@ti.com
Acked-by: Joel Fernandes jo...@ti.com
---
 include/configs/omap3_beagle.h |8 
 1 file changed, 8 deletions(-)

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 48ce4c0..9adf4a5 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -150,7 +150,6 @@
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_EXT2/* EXT2 Support */
 #define CONFIG_CMD_FAT /* FAT support  */
-#define CONFIG_CMD_JFFS2   /* JFFS2 Support*/
 #define CONFIG_CMD_MTDPARTS/* Enable MTD parts commands */
 #define CONFIG_MTD_DEVICE  /* needed for mtdparts commands */
 #define MTDIDS_DEFAULT nand0=nand
@@ -203,13 +202,6 @@
 
 #define CONFIG_SYS_MAX_NAND_DEVICE 1   /* Max number of NAND */
/* devices */
-#define CONFIG_JFFS2_NAND
-/* nand device jffs2 lives on */
-#define CONFIG_JFFS2_DEV   nand0
-/* start of jffs2 partition */
-#define CONFIG_JFFS2_PART_OFFSET   0x68
-#define CONFIG_JFFS2_PART_SIZE 0xf98   /* size of jffs2 */
-   /* partition */
 
 /* Environment information */
 #define CONFIG_BOOTDELAY   3
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH] OpenRD: relocate environment to 640kB

2013-07-15 Thread Tom Rini
On Mon, Jul 15, 2013 at 11:23:54AM +0200, Sascha Silbe wrote:
 Albert ARIBAUD albert.u.b...@aribaud.net writes:
 
  The situation has gotten better recently and U-Boot fits into the
  previous partition size of 384KiB again. So it isn't broken on OpenRD
  anymore and the above would seem like a good approach.
  How well does it fit again, and do you have any idea what caused the
  increase in size, and what caused the decrease?
 
 I had the same questions and tried a few buildman runs, but didn't get a
 clear picture. The size was going up and down for various slices of
 commits.
 
 With v2013.07-rc3, we are now at 376344B (??? 96% of 384KiB) for
 openrd_ultimate when built on Debian Wheezy using
 gcc-4.7-arm-linux-gnueabi from Emdebian.
 
 Is there an equivalent to CONFIG_SPL_MAX_SIZE for the regular U-Boot?
 Detecting the overlap at build time would prevent bricking the device
 using saveenv at run time. As an additional benefit, commits that push
 the size beyond the limit would also show up in buildman reports as
 build failures.

Yes, you can try using CONFIG_BOARD_SIZE_LIMIT, which is missing from
the README, but does have a few examples (git grep around).  A patch to
document it, and then a patch to enable for openrd would be much
appreciated.  Thanks!

 
 Sascha



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


-- 
Tom


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


Re: [U-Boot] [PATCH V3 5/6] omap3_beagle: support findfdt and loadfdt for devicetree support

2013-07-15 Thread Koen Kooi

Op 15 jul. 2013, om 14:11 heeft Nishanth Menon n...@ti.com het volgende 
geschreven:

 For folks not using concatenated device tree with uImage, having
 an handy function to find and load device tree is very handy.
 
 So introduce findfdt and loadfdt and run findfdt by default to make
 it easier on user scripts.
 
 Signed-off-by: Nishanth Menon n...@ti.com
 ---
 V3: Fixes typo mistake reported in http://marc.info/?t=13735821236r=1w=2
 
 include/configs/omap3_beagle.h |   15 +++
 1 file changed, 15 insertions(+)
 
 diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
 index bdeee17..5ec8ade 100644
 --- a/include/configs/omap3_beagle.h
 +++ b/include/configs/omap3_beagle.h
 @@ -210,6 +210,8 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
   loadaddr=0x8020\0 \
   rdaddr=0x8100\0 \
 + fdt_high=0x\0 \
 + fdtaddr=0x80f8\0 \
   usbtty=cdc_acm\0 \
   bootfile=uImage\0 \
   ramdisk=ramdisk.gz\0 \
 @@ -250,6 +252,17 @@
   omapdss.def_disp=${defaultdisplay}  \
   root=${nandroot}  \
   rootfstype=${nandrootfstype}\0 \
 + findfdt= \
 + if test $beaglerev = AxBx; then  \
 + setenv fdtfile omap3-beagle.dtb; fi;  \
 + if test $beaglerev = Cx; then  \
 + setenv fdtfile omap3-beagle.dtb; fi;  \
 + if test $beaglerev = xMAB; then  \
 + setenv fdtfile omap3-beagle-xm.dtb; fi;  \
 + if test $beaglerev = xMC; then  \
 + setenv fdtfile omap3-beagle-xm.dtb; fi;  \
 + if test $fdtfile = undefined; then  \
 + echo WARNING: Could not determine device tree to use; 
 fi; \0 \

With the remote chance of a future xM rev D, can you make the fallthrough be 
'omap3-beagle-xm.dtb' intead of 'undefined'?


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


Re: [U-Boot] [PATCH V3 5/6] omap3_beagle: support findfdt and loadfdt for devicetree support

2013-07-15 Thread Nishanth Menon
On 14:16-20130715, Koen Kooi wrote:
 
 Op 15 jul. 2013, om 14:11 heeft Nishanth Menon n...@ti.com het volgende 
 geschreven:
 
  For folks not using concatenated device tree with uImage, having
  an handy function to find and load device tree is very handy.
  
  So introduce findfdt and loadfdt and run findfdt by default to make
  it easier on user scripts.
  
  Signed-off-by: Nishanth Menon n...@ti.com
  ---
  V3: Fixes typo mistake reported in 
  http://marc.info/?t=13735821236r=1w=2
  
  include/configs/omap3_beagle.h |   15 +++
  1 file changed, 15 insertions(+)
  
  diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
  index bdeee17..5ec8ade 100644
  --- a/include/configs/omap3_beagle.h
  +++ b/include/configs/omap3_beagle.h
  @@ -210,6 +210,8 @@
  #define CONFIG_EXTRA_ENV_SETTINGS \
  loadaddr=0x8020\0 \
  rdaddr=0x8100\0 \
  +   fdt_high=0x\0 \
  +   fdtaddr=0x80f8\0 \
  usbtty=cdc_acm\0 \
  bootfile=uImage\0 \
  ramdisk=ramdisk.gz\0 \
  @@ -250,6 +252,17 @@
  omapdss.def_disp=${defaultdisplay}  \
  root=${nandroot}  \
  rootfstype=${nandrootfstype}\0 \
  +   findfdt= \
  +   if test $beaglerev = AxBx; then  \
  +   setenv fdtfile omap3-beagle.dtb; fi;  \
  +   if test $beaglerev = Cx; then  \
  +   setenv fdtfile omap3-beagle.dtb; fi;  \
  +   if test $beaglerev = xMAB; then  \
  +   setenv fdtfile omap3-beagle-xm.dtb; fi;  \
  +   if test $beaglerev = xMC; then  \
  +   setenv fdtfile omap3-beagle-xm.dtb; fi;  \
  +   if test $fdtfile = undefined; then  \
  +   echo WARNING: Could not determine device tree to use; 
  fi; \0 \
 
 With the remote chance of a future xM rev D, can you make the fallthrough be 
 'omap3-beagle-xm.dtb' intead of 'undefined'?
Lets add the detection of xMD and along with that we add
omap3-beagle-xm.dtb detection - makes sense? OR do we assume all
un-matched devices default to beagle xMD? what if there was a vanilla
beagle rev D?

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


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Marek Vasut
Dear Hector Palacios,

 Hi Marek,
 
 On 07/12/2013 06:48 PM, Marek Vasut wrote:
   [...]
  
  but I found something:
  It is very strange that the timeouts appear always after transferring
  between 20 and 24 MiB. So I thought maybe it was not an issue with the
  size of the file or the number of packets received, but instead a timed
  issue (an issue that happens after some period of time). I checked, and
  in fact the timeouts occur exactly 10 seconds after running the tftp
  command. I verified that this is what is happening by adding a
  udelay(10) at fec_send(). In this case, the timeout also occurs
  after 10 seconds, but due to the delay, I have transferred only a few
  Kbytes.
  
  Holy moly!
  
  I tried to change different timeout related constants at tftp.c but
  still the issue happens after 10s.
  It's like if, after these 10 seconds, the PHY lost the link or
  something. Really odd. Does it tell you anything?
  
  LAN8720 phy, right? Try implementing something like [1], by clearing the
  EDPWRDOWN bit , the PHY will never enter low-power mode. It's just a
  simple PHY register RMW which you can stick somewhere into the PHY
  net/phy/smsc.c code.
  
  [1]
  https://kernel.googlesource.com/pub/scm/linux/kernel/git/djbw/dmaengine/+
  /b629820d18fa65cc598390e4b9712fd5f83ee693%5E!/#F0
 
 No, my PHY is a Micrel KSZ8031RNLI.
 
 The hint about the PHY possibly going to power down mode is interesting but
 I checked the PHY registers and EDPD mode (Energy Detect Power Down) is
 off, at least before running the tftp command. Power Down mode is off too,
 so unless these are somehow enabled during the TFTP process, this is not
 what's happening.

OK, makes sense.

 The sniffer shows that the TFTP server simply stops sending data packets. I
 can see however the target sending several times the ACK packet to the
 last received data packet. This would point to the TFTP server (as Albert
 suggested), but the fact is the problem occurs with different TFTP servers
 (I tried three different servers) and it does not happen with an old v2009
 U-Boot using the same target.

Can you try running dcache off command before running the TFTP transfer? Does 
it still behave like this?

You might need to define #define CONFIG_CMD_CACHE for this to work.

 Many times, though not always, after the timeout occurs, I cancel with
 CTRL+C and run the tftp command again, and then the file downloads
 completely.
 The PHY is my usual suspect...

Dang :-(

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


Re: [U-Boot] [U-boot] uboot.lst file question

2013-07-15 Thread Albert ARIBAUD
Hi tiger...@viatech.com.cn,

On Mon, 15 Jul 2013 19:26:31 +0800, tiger...@viatech.com.cn wrote:

 Hi, experts:
 I found no *.lst file produced in root directory after compiling uboot
 source code.
 
 In the Makefile in older version uboot souce code:
 ..
 uboot.bin:uboot
   $(OBJCOPY) ${OBJCFLAGS} -O binary $ $@
   $(OBJDUMP) -d -EL -h -M reg-names-raw --syms
 --full-contents -marm $  uboot.lst
 ..
 
 I think uboot.lst is very useful .

Then you should submit a patch for this, I guess. Note however that the
above implementation makes u-boot.lst a by-product of u-boot.bin; a
cleaner approach would be to make u-boot.lst a Make target of it own
-- which would admittedly depend on the 'u-boot' ELF file, like
u-boot.bin does.

 Best wishes,

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


Re: [U-Boot] [PATCH V3 5/6] omap3_beagle: support findfdt and loadfdt for devicetree support

2013-07-15 Thread Koen Kooi

Op 15 jul. 2013, om 14:25 heeft Nishanth Menon n...@ti.com het volgende 
geschreven:

 On 14:16-20130715, Koen Kooi wrote:
 
 Op 15 jul. 2013, om 14:11 heeft Nishanth Menon n...@ti.com het volgende 
 geschreven:
 
 For folks not using concatenated device tree with uImage, having
 an handy function to find and load device tree is very handy.
 
 So introduce findfdt and loadfdt and run findfdt by default to make
 it easier on user scripts.
 
 Signed-off-by: Nishanth Menon n...@ti.com
 ---
 V3: Fixes typo mistake reported in 
 http://marc.info/?t=13735821236r=1w=2
 
 include/configs/omap3_beagle.h |   15 +++
 1 file changed, 15 insertions(+)
 
 diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
 index bdeee17..5ec8ade 100644
 --- a/include/configs/omap3_beagle.h
 +++ b/include/configs/omap3_beagle.h
 @@ -210,6 +210,8 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
 loadaddr=0x8020\0 \
 rdaddr=0x8100\0 \
 +   fdt_high=0x\0 \
 +   fdtaddr=0x80f8\0 \
 usbtty=cdc_acm\0 \
 bootfile=uImage\0 \
 ramdisk=ramdisk.gz\0 \
 @@ -250,6 +252,17 @@
 omapdss.def_disp=${defaultdisplay}  \
 root=${nandroot}  \
 rootfstype=${nandrootfstype}\0 \
 +   findfdt= \
 +   if test $beaglerev = AxBx; then  \
 +   setenv fdtfile omap3-beagle.dtb; fi;  \
 +   if test $beaglerev = Cx; then  \
 +   setenv fdtfile omap3-beagle.dtb; fi;  \
 +   if test $beaglerev = xMAB; then  \
 +   setenv fdtfile omap3-beagle-xm.dtb; fi;  \
 +   if test $beaglerev = xMC; then  \
 +   setenv fdtfile omap3-beagle-xm.dtb; fi;  \
 +   if test $fdtfile = undefined; then  \
 +   echo WARNING: Could not determine device tree to use; 
 fi; \0 \
 
 With the remote chance of a future xM rev D, can you make the fallthrough be 
 'omap3-beagle-xm.dtb' intead of 'undefined'?
 Lets add the detection of xMD and along with that we add
 omap3-beagle-xm.dtb detection - makes sense? OR do we assume all
 un-matched devices default to beagle xMD? what if there was a vanilla
 beagle rev D?

The fallthrough case should always be the most recent board rev, any other way 
will just make the HW guys spoof the ID in the design and we all know how that 
ends :(
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Revert MIPS: Jz4740: Add qi_lb60 board support

2013-07-15 Thread Tom Rini
The files board/qi/qi_lb60/qi_lb60.c and include/configs/qi_lb60.h were
licensed under the GPL v3 or later, and not v2 or later.  As this is
incompatible with the project, revert this board support until the
responsible parties are available to re-license (if so desired) under
GPL v2.

Signed-off-by: Tom Rini tr...@ti.com
---
 MAINTAINERS|4 -
 MAKEALL|5 --
 board/qi/qi_lb60/Makefile  |   40 -
 board/qi/qi_lb60/config.mk |   31 ---
 board/qi/qi_lb60/qi_lb60.c |  104 --
 boards.cfg |1 -
 include/configs/qi_lb60.h  |  206 
 7 files changed, 391 deletions(-)
 delete mode 100644 board/qi/qi_lb60/Makefile
 delete mode 100644 board/qi/qi_lb60/config.mk
 delete mode 100644 board/qi/qi_lb60/qi_lb60.c
 delete mode 100644 include/configs/qi_lb60.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 3e70b03..5b0e75b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1133,10 +1133,6 @@ Stefan Roese s...@denx.de
 
vct_xxx MIPS32 4Kc
 
-Xiangfu Liu xian...@openmobilefree.net
-
-   qi_lb60 MIPS32 (XBurst Jz4740 SoC)
-
 -
 
 Unknown / orphaned boards:
diff --git a/MAKEALL b/MAKEALL
index 2e16e0d..a80340e 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -435,16 +435,11 @@ LIST_mips=   \
 ## MIPS Systems(little endian)
 #
 
-LIST_xburst_el=   \
-   qi_lb60 \
-
-
 LIST_au1xx0_el=   \
dbau1550_el \
pb1000  \
 
 LIST_mips_el= \
-   ${LIST_xburst_el}   \
${LIST_au1xx0_el}   \
 
 #
diff --git a/board/qi/qi_lb60/Makefile b/board/qi/qi_lb60/Makefile
deleted file mode 100644
index 5dae11b..000
--- a/board/qi/qi_lb60/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# (C) Copyright 2006
-# Ingenic Semiconductor, jl...@ingenic.cn
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(BOARD).o
-
-COBJS  := $(BOARD).o
-
-SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-
-$(LIB):$(obj).depend $(OBJS) $(SOBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/board/qi/qi_lb60/config.mk b/board/qi/qi_lb60/config.mk
deleted file mode 100644
index 858e6a2..000
--- a/board/qi/qi_lb60/config.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# (C) Copyright 2006 Qi Hardware, Inc.
-# Author: Xiangfu Liu xiangf...@gmail.com
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-#
-# Qi Hardware, Inc. Ben NanoNote (QI_LB60)
-#
-
-ifndef TEXT_BASE
-# ROM version
-# TEXT_BASE = 0x8800
-
-# RAM version
-TEXT_BASE = 0x8010
-endif
diff --git a/board/qi/qi_lb60/qi_lb60.c b/board/qi/qi_lb60/qi_lb60.c
deleted file mode 100644
index d975209..000
--- a/board/qi/qi_lb60/qi_lb60.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Authors: Xiangfu Liu xian...@sharism.cc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 3 of the License, or (at your option) any later version.
- */
-
-#include 

[U-Boot] [PATCH] drivers/mmc/dw_mmc - remove extra arch specific asm/arch/clk.h inclusion

2013-07-15 Thread Alexey Brodkin
1. No contents of asm/arch/clk.h is used within dw_mmc.c.
2. If arch doesn't have asm/arch/clk.h driver won't build.

Without mentioned inclusion dw_mmc driver could be built for arches
other than ARM. For ARM driver still builds without it.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Cc: Mischa Jonker mjon...@synopsys.com
Cc: Andy Fleming aflem...@gmail.com
Cc: Rajeshwari Shinde rajeshwar...@samsung.com
Cc: Amar amarendra...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
Cc: Jaehoon Chung jh80.ch...@samsung.com
---
 drivers/mmc/dw_mmc.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index 5da20ed..684a2a8 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -23,7 +23,6 @@
 #include malloc.h
 #include mmc.h
 #include dwmmc.h
-#include asm/arch/clk.h
 #include asm-generic/errno.h
 
 #define PAGE_SIZE 4096
-- 
1.7.10.4

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


Re: [U-Boot] random compile error unrecognized command line option '-mshort-load-bytes' with arm-eabi-gcc 4.6.x

2013-07-15 Thread Yingchun Li
Here is the reply from google developer, who think this is a race condition:
The Android build system isn't designed to use recursive calls to make,
and the result in that case is subject to race conditions and therefore
very undefined.

You can try to build without -j, you can try to add the pseudo-target
showcommands to your command line, but the real debugging is likely to be
in the makefiles you're invoking recursively, not in the Android build
system.

But I have encontered this problem sometimes.

On Mon, Jul 15, 2013 at 1:22 PM, Yingchun Li sword.l.dra...@gmail.comwrote:

 I have ported u-boot to my android4.2 source and use the android
 toolchain,
 which has a gcc version 4.6.x-google 20120106.
 my envisionment for build: ubuntu 10.04, with a host gcc version 4.4.3.
 my platform is arm-v7, cotex-a5.
 the problem is that some times u-boot will encounter the following compile
 error(I use a 'make -j32' for building android):

 target thumb C++: libGLES_trace = 
 frameworks/native/opengl/libs/GLES_trace/src/gltrace_context.cpp
   CC  ispi.c
 target thumb C++: libGLES_trace = 
 frameworks/native/opengl/libs/GLES_trace/src/gltrace_egl.cpp
   CC  spl.c
 target thumb C++: libGLES_trace = 
 frameworks/native/opengl/libs/GLES_trace/src/gltrace_eglapi.cpp

   MAKEarch/arm/lib/
   CC  timer.c
 cc1: error: unrecognized command line option '-mshort-load-bytes'
 make[2]: *** 
 [/home/jenkins/workspace/droid-4.2.2_r1/out/target/product/aere/obj/u-boot/arch/arm/cpu/armv7/rda/timer.o]
  Error 1
 make[1]: *** 
 [/home/jenkins/workspace/droid-4.2.2_r1/out/target/product/aere/obj/u-boot/arch/arm/cpu/armv7/rda/librda.o]
  Error 2
 make[1]: Leaving directory `/home/jenkins/workspace/rdadroid-4.2.2_r1/u-boot'
 make: *** [out/target/product/aere/obj/u-boot/u-boot.img] Error 2
 make: *** Waiting for unfinished jobs


 but if I build it again, the compile error disappeared。

 I know the gcc after 3.5 don't support option -mshort-load-bytes, but my
 gcc-version
 is 4.6, and I checked include/generated/cc_options.mk, if build fail, the
 content is:
 CC_OPTIONS += -marm
 CC_OPTIONS += -mno-thumb-interwork
 CC_OPTIONS += -mabi=apcs-gnu
 CC_OPTIONS += -mabi=aapcs-linux
 CC_OPTIONS += -march=armv7-a
 CC_OPTIONS += -fno-stack-protector
 CC_OPTIONS += -Wno-format-nonliteral
 CC_OPTIONS += -Wno-format-security
 CC_OPTIONS += -fstack-usage
 CC_OPTIONS += -fno-toplevel-reorder
 CC_OPTIONS += -mshort-load-bytes
 
 if success, there is no CC_OPTIONS += -mshort-load-bytes.
 so, anyone can tell me how to debug this problems?
 thank you!

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


Re: [U-Boot] [U-boot] uboot.lst file question

2013-07-15 Thread Gerhard Sittig
On Mon, Jul 15, 2013 at 19:26 +0800, tiger...@viatech.com.cn wrote:
 
 Hi, experts:
 I found no *.lst file produced in root directory after compiling uboot
 source code.
 
 In the Makefile in older version uboot souce code:
 ..
 uboot.bin:uboot
   $(OBJCOPY) ${OBJCFLAGS} -O binary $ $@
   $(OBJDUMP) -d -EL -h -M reg-names-raw --syms
 --full-contents -marm $  uboot.lst
 ..
 
 I think uboot.lst is very useful .

Which older version would that have been?

A quick search shows that there has not been such a feature in
U-Boot as far as git can see (that's back to Nov 2002).  Neither
has the binary gone under the 'uboot' or 'uboot.bin' names.

There used to be .lst files, but they held completely different
information than assembler listings.  This isn't either what you
wanted.

What you cite is rather specific for an individual platform and
hightly unportable.  The search suggests that you are either
referring to an ancient version (more than eleven years old) or a
version that is not the U-Boot project.

You may invoke the objdump(1) tool any time you like.  How often
is it actually that you need to read assembler instructions?  And
isn't it that you'd rather want .i or .s files then from the
compiler, instead of 'objdump -d' output that shows a rather
different perspective?


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Albert ARIBAUD
Hi Troy,

On Fri, 12 Jul 2013 19:43:07 -0700, Troy Kisky
troy.ki...@boundarydevices.com wrote:

 On 7/11/2013 4:18 PM, Fabio Estevam wrote:
  On Thu, Jul 11, 2013 at 8:03 PM, Marek Vasut ma...@denx.de wrote:
  The MX28 multi-layer AHB bus can be too slow and trigger the
  FEC DMA too early, before all the data hit the DRAM. This patch
  ensures the data are written in the RAM before the DMA starts.
  Please see the comment in the patch for full details.
 
  This patch was produced with an amazing help from Albert Aribaud,
  who pointed out it can possibly be such a bus synchronisation
  issue.
 
  Signed-off-by: Marek Vasut ma...@denx.de
  Cc: Albert ARIBAUD albert.u.b...@aribaud.net
  Cc: Fabio Estevam fabio.este...@freescale.com
  Cc: Stefano Babic sba...@denx.de
  Excellent, managed to transfer 90MB via TFTP on mx28evk without a
  single timeout.
 
  Tested-by: Fabio Estevam fabio.este...@freescale.com
  ___
  U-Boot mailing list
  U-Boot@lists.denx.de
  http://lists.denx.de/mailman/listinfo/u-boot
 
 Perhaps this because our memory barriers are lacking.
 
 Linux has this code
 asm/io.h:#define writel(v,c)({ __iowmb(); 
 writel_relaxed(v,c); })
 
 asm/io.h-#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
 asm/io.h-#include asm/barrier.h
 asm/io.h-#define __iormb()  rmb()
 asm/io.h:#define __iowmb()  wmb()
 asm/io.h-#else
 asm/io.h-#define __iormb()  do { } while (0)
 asm/io.h:#define __iowmb()  do { } while (0)
 asm/io.h-#endif
 
 asm/io.h-#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
 asm/io.h-#include asm/barrier.h
 asm/io.h-#define __iormb()  rmb()
 asm/io.h:#define __iowmb()  wmb()
 asm/io.h-#else
 asm/io.h-#define __iormb()  do { } while (0)
 asm/io.h:#define __iowmb()  do { } while (0)
 asm/io.h-#endif
 
 asm/barrier.h-#elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || 
 defined(CONFIG_SMP)
 asm/barrier.h-#define mb()  do { dsb(); outer_sync(); } 
 while (0)
 asm/barrier.h-#define rmb() dsb()
 asm/barrier.h:#define wmb() mb()
 asm/barrier.h-#else
 asm/barrier.h-#define mb()  barrier()
 asm/barrier.h-#define rmb() barrier()
 asm/barrier.h:#define wmb() barrier()
 asm/barrier.h-#endif
 
 asm/barrier.h-#if __LINUX_ARM_ARCH__ = 7
 asm/barrier.h-#define isb() __asm__ __volatile__ (isb : : : memory)
 asm/barrier.h:#define dsb() __asm__ __volatile__ (dsb : : : memory)
 asm/barrier.h-#define dmb() __asm__ __volatile__ (dmb : : : memory)
 asm/barrier.h-#elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6
 asm/barrier.h-#define isb() __asm__ __volatile__ (mcr p15, 0, %0, c7, 
 c5, 4 \
 asm/barrier.h-  : : r (0) : memory)
 asm/barrier.h:#define dsb() __asm__ __volatile__ (mcr p15, 0, %0, c7, 
 c10, 4 \
 asm/barrier.h-  : : r (0) : memory)
 asm/barrier.h-#define dmb() __asm__ __volatile__ (mcr p15, 0, %0, c7, 
 c10, 5 \
 
 _
 Can you try just adding a dsb() instead of the dummy read?
 
 If this also fixes your problem, it seems better to fix our writel macro

Not sure I understand who you are answering to exactly, as Fabio
indicates his problem is solved.

Besides, Marek and I had in fact investigated barriers, adding some as
I did in times past in mvgbe.c, and fiddling with the one already in
dcache_flush_range(). None of this had any effect.

However, if our barriers are lacking, then they may fail us somehow on
other occasions, so best is if we analyze the failings. Can you clarify
in what respect exactly they are lacking? For instance, are all our
barriers lacking, or only some, and which ones?

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


Re: [U-Boot] [U-boot] uboot.lst file question

2013-07-15 Thread Gerhard Sittig
On Mon, Jul 15, 2013 at 15:33 +0200, Gerhard Sittig wrote:
 
 On Mon, Jul 15, 2013 at 19:26 +0800, tiger...@viatech.com.cn wrote:
  
  [ uboot.lst file, disassembler listing ]
 
 A quick search shows that there has not been such a feature in
 U-Boot as far as git can see (that's back to Nov 2002).  Neither
 has the binary gone under the 'uboot' or 'uboot.bin' names.

I was too quick.  There hasn't been a .lst file (or it was used
for unrelated purposes).  Although there is the u-boot.dis file,
has been since at least Nov 2002, and still is.  Does this help
you?


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] fsl_esdhc: Touch only relevant sys ctrl bits

2013-07-15 Thread Dirk Behme
Dealing with the sys ctrl register should touch only the
relevant bits and not accidently the whole register. On i.MX6,
the sys control register contains bits which shouldn't be reset to
0, e.g. SYS_CTRL[3-0] and IPP_RST_N (SYS_CTRL[23]).

Do this by read/modify/write instead of just a 32bit write.

Signed-off-by: Dirk Behme dirk.be...@de.bosch.com
---
 drivers/mmc/fsl_esdhc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 973b19f..431dac2 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -470,7 +470,7 @@ static int esdhc_init(struct mmc *mmc)
int timeout = 1000;
 
/* Reset the entire host controller */
-   esdhc_write32(regs-sysctl, SYSCTL_RSTA);
+   esdhc_setbits32(regs-sysctl, SYSCTL_RSTA);
 
/* Wait until the controller is available */
while ((esdhc_read32(regs-sysctl)  SYSCTL_RSTA)  --timeout)
@@ -481,7 +481,7 @@ static int esdhc_init(struct mmc *mmc)
esdhc_write32(regs-scr, 0x0040);
 #endif
 
-   esdhc_write32(regs-sysctl, SYSCTL_HCKEN | SYSCTL_IPGEN);
+   esdhc_setbits32(regs-sysctl, SYSCTL_HCKEN | SYSCTL_IPGEN);
 
/* Set the initial clock speed */
mmc_set_clock(mmc, 40);
@@ -515,7 +515,7 @@ static void esdhc_reset(struct fsl_esdhc *regs)
unsigned long timeout = 100; /* wait max 100 ms */
 
/* reset the controller */
-   esdhc_write32(regs-sysctl, SYSCTL_RSTA);
+   esdhc_setbits32(regs-sysctl, SYSCTL_RSTA);
 
/* hardware clears the bit when it is done */
while ((esdhc_read32(regs-sysctl)  SYSCTL_RSTA)  --timeout)
-- 
1.8.2

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


[U-Boot] [PATCH] mxc_gpio: Correct the GPIO handling in gpio_direction_output()

2013-07-15 Thread Dirk Behme
Setting the direction and an output value should be done by

First, set the desired output value.

Then, switch to output.

If this is done in the inverse order, like at the moment,
there can be a glitch on the GPIO line while switching first
the old output value and aftwards the new one.

Fix this by inverting the order of the direction/set_value
calls.

Signed-off-by: Dirk Behme dirk.be...@de.bosch.com
---
 drivers/gpio/mxc_gpio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index a388064..1d820d4 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -143,10 +143,10 @@ int gpio_direction_input(unsigned gpio)
 
 int gpio_direction_output(unsigned gpio, int value)
 {
-   int ret = mxc_gpio_direction(gpio, MXC_GPIO_DIRECTION_OUT);
+   int ret = gpio_set_value(gpio, value);
 
if (ret  0)
return ret;
 
-   return gpio_set_value(gpio, value);
+   return mxc_gpio_direction(gpio, MXC_GPIO_DIRECTION_OUT);
 }
-- 
1.8.2

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


Re: [U-Boot] [PATCH v8 3/3] MIPS: Jz4740: Add qi_lb60 board support

2013-07-15 Thread Tom Rini
On Sat, Jul 13, 2013 at 07:51:13AM +0200, Dirk Behme wrote:

 Dear Wolfgang and Tom,
 
 Am 03.07.2013 11:54, schrieb Wolfgang Denk:
 Dear Xiangfu Liu,
 
 In message 4e95a3ba.8000...@pobox.com you wrote:
 
 Add support for the qi_lb60 (a.k.a QI Ben NanoNote) clamshell device
 from Qi hardware:
 
 http://en.qi-hardware.com/wiki/Ben_NanoNote
 http://en.qi-hardware.com/wiki/Main_Page
 http://en.wikipedia.org/wiki/Qi_hardware
 
 This Jz4740-based clamshell device does not use NOR flash to boot.
 The initial bring-up assumes that U-Boot is directly loaded into SDRAM
 using USB boot tool, and starts from 0x8010.
 ...
   MAINTAINERS |4 +
   MAKEALL |4 +-
   board/qi/qi_lb60/Makefile   |   45 +
   board/qi/qi_lb60/config.mk  |   31 +++
   board/qi/qi_lb60/qi_lb60.c  |  104 +
   board/qi/qi_lb60/u-boot.lds |   61 +
   boards.cfg  |1 +
   include/configs/qi_lb60.h   |  211 
  +++
   8 files changed, 460 insertions(+), 1 deletions(-)
   create mode 100644 board/qi/qi_lb60/Makefile
   create mode 100644 board/qi/qi_lb60/config.mk
   create mode 100644 board/qi/qi_lb60/qi_lb60.c
   create mode 100644 board/qi/qi_lb60/u-boot.lds
   create mode 100644 include/configs/qi_lb60.h
 
 It has been pointed out (see [1]) that the files
 
  board/qi/qi_lb60/qi_lb60.c
  include/configs/qi_lb60.h
 
 added by this patch are licensed as GPL version 3 of the License, or
 (at your option) any later version - however, this is incompatible
 with the GPLv2 and GPLv2+ licenses that cover the rest of U-Boot.
 
 Would you be willing to re-license these files under GPLv2+ (and
 submit apatch to do that) ?  Otherwise we would probably be forced to
 remove the qi_lb60 board support to be legally clean.
 
 Sorry for the inconvenience, but obviously this issue slipped through
 at the initial review of the code...
 
 [1] http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/164965
 
 No answer since  one week.
 
 Should we revert this for v2013.07, then?

Yes.  I've done the revert and posted the patch, and I shall push it
later today (barring an update from the authors) along with a few other
things in prepartion for release.

-- 
Tom


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


Re: [U-Boot] [PATCH V3 5/6] omap3_beagle: support findfdt and loadfdt for devicetree support

2013-07-15 Thread Nishanth Menon
On 15:07-20130715, Koen Kooi wrote:
 Op 15 jul. 2013, om 14:25 heeft Nishanth Menon n...@ti.com het volgende 
 geschreven:
  On 14:16-20130715, Koen Kooi wrote:
  Op 15 jul. 2013, om 14:11 heeft Nishanth Menon n...@ti.com het volgende 
  geschreven:
  
[..]
  + findfdt= \
  + if test $beaglerev = AxBx; then  \
  + setenv fdtfile omap3-beagle.dtb; fi;  \
  + if test $beaglerev = Cx; then  \
  + setenv fdtfile omap3-beagle.dtb; fi;  \
  + if test $beaglerev = xMAB; then  \
  + setenv fdtfile omap3-beagle-xm.dtb; fi;  \
  + if test $beaglerev = xMC; then  \
  + setenv fdtfile omap3-beagle-xm.dtb; fi;  \
  + if test $fdtfile = undefined; then  \
  + echo WARNING: Could not determine device tree to use; 
  fi; \0 \
  
  With the remote chance of a future xM rev D, can you make the fallthrough 
  be 'omap3-beagle-xm.dtb' intead of 'undefined'?
  Lets add the detection of xMD and along with that we add
  omap3-beagle-xm.dtb detection - makes sense? OR do we assume all
  un-matched devices default to beagle xMD? what if there was a vanilla
  beagle rev D?
 
 The fallthrough case should always be the most recent board rev, any other 
 way will just make the HW guys spoof the ID in the design and we all know how 
 that ends :(
Fair enough. Anyone else has a contrary opinion?

If none, the following is the replacement patch, wont repost unless a new series
is needed:

From 07e1787cc59f4622c764d7da33da2684cf122d41 Mon Sep 17 00:00:00 2001
From: Nishanth Menon n...@ti.com
Date: Thu, 11 Jul 2013 16:25:09 -0500
Subject: [PATCH V4] omap3_beagle: support findfdt and loadfdt for devicetree
 support

For folks not using concatenated device tree with uImage, having
an handy function to find and load device tree is very handy.

So introduce findfdt and loadfdt and run findfdt by default to make
it easier on user scripts.

Signed-off-by: Nishanth Menon n...@ti.com
---
 include/configs/omap3_beagle.h |   18 ++
 1 file changed, 18 insertions(+)

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index bdeee17..7e6e38c 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -210,6 +210,8 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
loadaddr=0x8020\0 \
rdaddr=0x8100\0 \
+   fdt_high=0x\0 \
+   fdtaddr=0x80f8\0 \
usbtty=cdc_acm\0 \
bootfile=uImage\0 \
ramdisk=ramdisk.gz\0 \
@@ -250,6 +252,20 @@
omapdss.def_disp=${defaultdisplay}  \
root=${nandroot}  \
rootfstype=${nandrootfstype}\0 \
+   findfdt= \
+   if test $beaglerev = AxBx; then  \
+   setenv fdtfile omap3-beagle.dtb; fi;  \
+   if test $beaglerev = Cx; then  \
+   setenv fdtfile omap3-beagle.dtb; fi;  \
+   if test $beaglerev = xMAB; then  \
+   setenv fdtfile omap3-beagle-xm.dtb; fi;  \
+   if test $beaglerev = xMC; then  \
+   setenv fdtfile omap3-beagle-xm.dtb; fi;  \
+   if test $fdtfile = undefined; then  \
+   setenv fdtfile omap3-beagle-xm.dtb; \
+   echo WARNING: Could not determine device tree to use; 
\
+   echo WARNING: assuming ${fdtfile}; \
+   fi; \0 \
bootenv=uEnv.txt\0 \
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0 \
importbootenv=echo Importing environment from mmc ...;  \
@@ -265,6 +281,7 @@
rootfstype=${ramrootfstype}\0 \
loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0 \
loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0 \
+   loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0 \
mmcboot=echo Booting from mmc ...;  \
run mmcargs;  \
bootm ${loadaddr}\0 \
@@ -281,6 +298,7 @@
userbutton_nonxm=gpio input 7;\0
 /* run userbutton will return 1 (false) if pressed and 0 (true) if not */
 #define CONFIG_BOOTCOMMAND \
+   run findfdt;  \
mmc dev ${mmcdev}; if mmc rescan; then  \
if run userbutton; then  \
setenv bootenv uEnv.txt; \
-- 
1.7.9.5


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


[U-Boot] [PATCH] arm:samsung:trats:fix: Restore proper orientation of TRATS's LCD panel

2013-07-15 Thread Lukasz Majewski
Before setting: mipi_lcd_device.reverse_panel = 1, the Trats's LCD panel
was flipped by 180 degrees.

The flip was caused by following change:
Exynos: Change get_timer() to work correctly
SHA1: 3d00c0cb96ff93a929700b80d89cb905e5ab5315

This commit fixed udelay(), which is necessary (due to HW LCD controller 
oddity) for mipi-dsi correct operation. As a result the display orientation
has been switched.

As a follow up, the hwrevision() function has been removed, since it was
used only in this particular place.

Test HW: Trats Exynos4210 rev 0.

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
---
 board/samsung/trats/trats.c |   10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index e20fb3d..71fe767 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -58,12 +58,6 @@ u32 get_board_rev(void)
 #endif
 
 static void check_hw_revision(void);
-
-static int hwrevision(int rev)
-{
-   return (board_rev  0xf) == rev;
-}
-
 struct s3c_plat_otg_data s5pc210_otg_data;
 
 int board_init(void)
@@ -773,9 +767,7 @@ void init_panel_info(vidinfo_t *vid)
 #ifdef CONFIG_TIZEN
get_tizen_logo_info(vid);
 #endif
-
-   if (hwrevision(2))
-   mipi_lcd_device.reverse_panel = 1;
+   mipi_lcd_device.reverse_panel = 1;
 
strcpy(s6e8ax0_platform_data.lcd_panel_name, mipi_lcd_device.name);
s6e8ax0_platform_data.lcd_power = lcd_power;
-- 
1.7.10.4

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


Re: [U-Boot] [PATCH] mx6qsabrelite: Remove mx6qsabrelite code in favor of nitrogen6x

2013-07-15 Thread Eric Nelson

Hi Fabio,

On 07/14/2013 09:23 PM, Fabio Estevam wrote:

Hi Eric,

On Mon, Jul 15, 2013 at 1:09 AM, Eric Nelson
eric.nel...@boundarydevices.com wrote:


Agreed :-)

Reviewed-by: Otavio Salvador ota...@ossystems.com.br



+1

We should also add something to the README file though.


In this patch I am still using the original README's:



Thanks for pointing it out. I had missed this.


rename board/{freescale/mx6qsabrelite/README =
boundary/nitrogen6x/README.mx6qsabrelite} (100%)


I also have to admit not having read this README.

It appears to give pretty bad advice, suggesting that the
user use the iMX6DQ_SPI_to_uSDHC3.bin shim to force
boot from SDHC3.

I think this explains how people keep ending up at that
stale Linaro post.


rename board/boundary/nitrogen6x/{README = README.nitrogen6x} (100%)

What would you like me to the README?



It seems that there are two policy differences between
the mx6qsabrelite.h and nitrogen6x.h files:

1. Use of MMC for environment storage
2. Use of boot script in nitrogen6x

I think we can dispense with #1. Can you think of any reason
a user would care where this is stored?

The second is a bit more subtle. The boot script approach
allows booting any O/S from any FAT or ext2/3/4 from any
SD card or SATA).

OTOH, if there are a significant number of people who don't
have boot scripts in their image(s), we'll give them a
minor speed bump during the transition.

Since these are all environment settings, it seems easy
enough to allow things to be configured in the Freescale way
by adding a layer of in-direction.

i.e. we could point 'bootcmd' at either 'bootcmd_boundary'
or 'bootcmd_freescale' and allow a user to select their
flavour of boot.

This would prevent the need for a compile-time switch.

The other difference I note in the default environment
is the inclusion of network boot.

I don't think including this bit does any harm, though
I would suggest that it be a conscious choice and not
an automatic fall-back. In order to enable network
boot, a user already needs to configure at least the
server IP and boot path. Why not also ask them to
set 'bootcmd' to 'bootcmd_net'?

Let me know your thoughts.

Regards,


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


Re: [U-Boot] [PATCH v2 1/6] am335x_evm: Make NAND support modular

2013-07-15 Thread Justin Waters
Stefan,

On Fri, 2013-07-12 at 07:30 -0400, Stefan Agner wrote:
 Am 2013-07-11 15:54, schrieb Justin Waters:
  Give the user the ability to disable NAND support by defining
  CONFIG_NO_NAND. This will allow custom hardware to easily support
  this configuration.
 
 If NAND is not enabled, we could also ifdef the SPI/MTD/CMD_FS
 configurations since they are not used on BeagleBone Black either. Maybe
 something for a follow-up patch rather than a new version of this
 patchset.

Agreed on all accounts. I focused on the NAND mostly because the logic
was gumming up the environment storage, and I needed it out of the way
for the eMMC boot. It was an added bonus that it decreases the image
size and cleans up the initialization. The others were more innocuous,
so I skipped them for the time being.

-Justin


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


Re: [U-Boot] [PATCH v3] drivers:power:max77686: add function to set voltage and mode

2013-07-15 Thread Tom Rini
On Tue, Jun 25, 2013 at 09:59:47AM +0200, Piotr Wilczek wrote:

 This patch add new functions to pmic max77686 to set voltage and mode.
 
 Signed-off-by: Piotr Wilczek p.wilc...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 CC: Minkyu Kang mk7.k...@samsung.com
 CC: Rajeshwari Shinde rajeshwar...@samsung.com
 
 Acked-by: Rajeshwari Shinde rajeshwar...@samsung.com

Acked-by: Tom Rini tr...@ti.com

And re-assigned to Minkyu as I assume there's other patches needed that
enable this on a samsung board of some sort.

-- 
Tom


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


Re: [U-Boot] [PATCH 1/3] arm: spl: Fix SPL booting for OMAP3

2013-07-15 Thread Tom Rini
On Fri, Jun 14, 2013 at 10:54:59AM +0200, Stefan Roese wrote:

 SPL already has GD set to the correct location (in s_init), we mustn't
 move it around now since some data (clocks etc) is already present.
 
 This error was detected on the SPL port for the Compulab CM-T35 board
 (OMAP3530).
 
 Signed-off-by: Stefan Roese s...@denx.de
 Cc: Tom Rini tr...@ti.com
 Cc: Albert ARIBAUD albert.u.b...@aribaud.net

While we have a problem here, it's not a problem that's visible on
current SPL using platforms, just the CM-T35, yes?  I just gave my
beagleboard (classic and xM) a spin and they're OK.  I've got a few more
platforms I can dig out if needed, but I'm inclined to hold this until
after v2013.07 and we can take one of the paths Albert outlined (change
s_init to system_init, add to the function table, call that way).  Does
that work or have I underestimated the impact of this issue?  Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH V3 5/6] omap3_beagle: support findfdt and loadfdt for devicetree support

2013-07-15 Thread Tom Rini
On Mon, Jul 15, 2013 at 02:16:50PM +0200, Koen Kooi wrote:
 
 Op 15 jul. 2013, om 14:11 heeft Nishanth Menon n...@ti.com het volgende 
 geschreven:
 
  For folks not using concatenated device tree with uImage, having
  an handy function to find and load device tree is very handy.
  
  So introduce findfdt and loadfdt and run findfdt by default to make
  it easier on user scripts.
  
  Signed-off-by: Nishanth Menon n...@ti.com
  ---
  V3: Fixes typo mistake reported in 
  http://marc.info/?t=13735821236r=1w=2
  
  include/configs/omap3_beagle.h |   15 +++
  1 file changed, 15 insertions(+)
  
  diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
  index bdeee17..5ec8ade 100644
  --- a/include/configs/omap3_beagle.h
  +++ b/include/configs/omap3_beagle.h
  @@ -210,6 +210,8 @@
  #define CONFIG_EXTRA_ENV_SETTINGS \
  loadaddr=0x8020\0 \
  rdaddr=0x8100\0 \
  +   fdt_high=0x\0 \
  +   fdtaddr=0x80f8\0 \
  usbtty=cdc_acm\0 \
  bootfile=uImage\0 \
  ramdisk=ramdisk.gz\0 \
  @@ -250,6 +252,17 @@
  omapdss.def_disp=${defaultdisplay}  \
  root=${nandroot}  \
  rootfstype=${nandrootfstype}\0 \
  +   findfdt= \
  +   if test $beaglerev = AxBx; then  \
  +   setenv fdtfile omap3-beagle.dtb; fi;  \
  +   if test $beaglerev = Cx; then  \
  +   setenv fdtfile omap3-beagle.dtb; fi;  \
  +   if test $beaglerev = xMAB; then  \
  +   setenv fdtfile omap3-beagle-xm.dtb; fi;  \
  +   if test $beaglerev = xMC; then  \
  +   setenv fdtfile omap3-beagle-xm.dtb; fi;  \
  +   if test $fdtfile = undefined; then  \
  +   echo WARNING: Could not determine device tree to use; 
  fi; \0 \
 
 With the remote chance of a future xM rev D, can you make the
 fallthrough be 'omap3-beagle-xm.dtb' intead of 'undefined'?

I don't like that idea.  On am335x_evm configs we have undefined and
then say hey, it's undefined! so it's clear that we don't know what to
do.  That in theory future xM rev D might need a different device tree
for example.

-- 
Tom


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


Re: [U-Boot] [PATCH V3 5/6] omap3_beagle: support findfdt and loadfdt for devicetree support

2013-07-15 Thread Koen Kooi

Op 15 jul. 2013, om 16:49 heeft Tom Rini tr...@ti.com het volgende geschreven:

 On Mon, Jul 15, 2013 at 02:16:50PM +0200, Koen Kooi wrote:
 
 Op 15 jul. 2013, om 14:11 heeft Nishanth Menon n...@ti.com het volgende 
 geschreven:
 
 For folks not using concatenated device tree with uImage, having
 an handy function to find and load device tree is very handy.
 
 So introduce findfdt and loadfdt and run findfdt by default to make
 it easier on user scripts.
 
 Signed-off-by: Nishanth Menon n...@ti.com
 ---
 V3: Fixes typo mistake reported in 
 http://marc.info/?t=13735821236r=1w=2
 
 include/configs/omap3_beagle.h |   15 +++
 1 file changed, 15 insertions(+)
 
 diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
 index bdeee17..5ec8ade 100644
 --- a/include/configs/omap3_beagle.h
 +++ b/include/configs/omap3_beagle.h
 @@ -210,6 +210,8 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
 loadaddr=0x8020\0 \
 rdaddr=0x8100\0 \
 +   fdt_high=0x\0 \
 +   fdtaddr=0x80f8\0 \
 usbtty=cdc_acm\0 \
 bootfile=uImage\0 \
 ramdisk=ramdisk.gz\0 \
 @@ -250,6 +252,17 @@
 omapdss.def_disp=${defaultdisplay}  \
 root=${nandroot}  \
 rootfstype=${nandrootfstype}\0 \
 +   findfdt= \
 +   if test $beaglerev = AxBx; then  \
 +   setenv fdtfile omap3-beagle.dtb; fi;  \
 +   if test $beaglerev = Cx; then  \
 +   setenv fdtfile omap3-beagle.dtb; fi;  \
 +   if test $beaglerev = xMAB; then  \
 +   setenv fdtfile omap3-beagle-xm.dtb; fi;  \
 +   if test $beaglerev = xMC; then  \
 +   setenv fdtfile omap3-beagle-xm.dtb; fi;  \
 +   if test $fdtfile = undefined; then  \
 +   echo WARNING: Could not determine device tree to use; 
 fi; \0 \
 
 With the remote chance of a future xM rev D, can you make the
 fallthrough be 'omap3-beagle-xm.dtb' intead of 'undefined'?
 
 I don't like that idea.  On am335x_evm configs we have undefined and
 then say hey, it's undefined! so it's clear that we don't know what to
 do.  That in theory future xM rev D might need a different device tree
 for example.

And that's patched out on the build that actually ships with the beaglebone and 
beaglebone black so it will fall back to BBB when it can't ID the board. You'll 
see that the u-boot bits that need the ID for the xM also fallback to the 
latest rev. I don't see why the boardfile and script need to have different 
behaviour.

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


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Hector Palacios

Hi Marek,

On 07/15/2013 02:30 PM, Marek Vasut wrote:

Dear Hector Palacios,


Hi Marek,

On 07/12/2013 06:48 PM, Marek Vasut wrote:

  [...]

but I found something:
It is very strange that the timeouts appear always after transferring
between 20 and 24 MiB. So I thought maybe it was not an issue with the
size of the file or the number of packets received, but instead a timed
issue (an issue that happens after some period of time). I checked, and
in fact the timeouts occur exactly 10 seconds after running the tftp
command. I verified that this is what is happening by adding a
udelay(10) at fec_send(). In this case, the timeout also occurs
after 10 seconds, but due to the delay, I have transferred only a few
Kbytes.


Holy moly!


I tried to change different timeout related constants at tftp.c but
still the issue happens after 10s.
It's like if, after these 10 seconds, the PHY lost the link or
something. Really odd. Does it tell you anything?


LAN8720 phy, right? Try implementing something like [1], by clearing the
EDPWRDOWN bit , the PHY will never enter low-power mode. It's just a
simple PHY register RMW which you can stick somewhere into the PHY
net/phy/smsc.c code.

[1]
https://kernel.googlesource.com/pub/scm/linux/kernel/git/djbw/dmaengine/+
/b629820d18fa65cc598390e4b9712fd5f83ee693%5E!/#F0


No, my PHY is a Micrel KSZ8031RNLI.

The hint about the PHY possibly going to power down mode is interesting but
I checked the PHY registers and EDPD mode (Energy Detect Power Down) is
off, at least before running the tftp command. Power Down mode is off too,
so unless these are somehow enabled during the TFTP process, this is not
what's happening.


OK, makes sense.


The sniffer shows that the TFTP server simply stops sending data packets. I
can see however the target sending several times the ACK packet to the
last received data packet. This would point to the TFTP server (as Albert
suggested), but the fact is the problem occurs with different TFTP servers
(I tried three different servers) and it does not happen with an old v2009
U-Boot using the same target.


Can you try running dcache off command before running the TFTP transfer? Does
it still behave like this?

You might need to define #define CONFIG_CMD_CACHE for this to work.


Sourcery!
It's not that it works with dcache off, I found something even more strange:
The way I reproduce this issue is by setting the 'bootcmd' to 'dboot ${loadaddr} 
file100M'. When you set the 'bootcmd' like this:


setenv bootcmd tftp ${loadaddr} file100M

this eventually expands to

bootcmd=tftp 0x4200 file100M

So this is the command that runs automatically after the bootdelay.
I just discovered that if instead of letting the auto boot run, I press a key to stop 
the auto boot and run the command by hand (either running 'boot' or typing the command 
'tftp 0x4200 file100M'), the tftp transfer works perfectly.
On the other hand, if I do the same but use the environment variable ${loadaddr}, i.e. 
'tftp ${loadaddr} file100M'. It will stop after 10 seconds.


And to make things funnier I just reproduced this issue on the MX28EVK using the imx 
U-Boot custodian tree at commit a3f170cdbf7ae0bd24c94c2f46725699bbd69f05. That 
discards being a platform issue.

@Fabio: could you manually run the command 'tftp ${loadaddr} file100M' in your 
EVK?
If it doesn't fail, could you try running it again after playing with the environment 
(setting/printing some variables).
As I said, this issue appeared with different TFTP servers and is independent of 
whether the dcache is or not enabled.


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


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Marek Vasut
Hi Hector,

 Hi Marek,
 
 On 07/15/2013 02:30 PM, Marek Vasut wrote:
  Dear Hector Palacios,
  
  Hi Marek,
  
  On 07/12/2013 06:48 PM, Marek Vasut wrote:
[...]
  
  but I found something:
  It is very strange that the timeouts appear always after transferring
  between 20 and 24 MiB. So I thought maybe it was not an issue with the
  size of the file or the number of packets received, but instead a
  timed issue (an issue that happens after some period of time). I
  checked, and in fact the timeouts occur exactly 10 seconds after
  running the tftp command. I verified that this is what is happening
  by adding a udelay(10) at fec_send(). In this case, the timeout
  also occurs after 10 seconds, but due to the delay, I have
  transferred only a few Kbytes.
  
  Holy moly!
  
  I tried to change different timeout related constants at tftp.c but
  still the issue happens after 10s.
  It's like if, after these 10 seconds, the PHY lost the link or
  something. Really odd. Does it tell you anything?
  
  LAN8720 phy, right? Try implementing something like [1], by clearing
  the EDPWRDOWN bit , the PHY will never enter low-power mode. It's just
  a simple PHY register RMW which you can stick somewhere into the PHY
  net/phy/smsc.c code.
  
  [1]
  https://kernel.googlesource.com/pub/scm/linux/kernel/git/djbw/dmaengine
  /+ /b629820d18fa65cc598390e4b9712fd5f83ee693%5E!/#F0
  
  No, my PHY is a Micrel KSZ8031RNLI.
  
  The hint about the PHY possibly going to power down mode is interesting
  but I checked the PHY registers and EDPD mode (Energy Detect Power
  Down) is off, at least before running the tftp command. Power Down mode
  is off too, so unless these are somehow enabled during the TFTP
  process, this is not what's happening.
  
  OK, makes sense.
  
  The sniffer shows that the TFTP server simply stops sending data
  packets. I can see however the target sending several times the ACK
  packet to the last received data packet. This would point to the TFTP
  server (as Albert suggested), but the fact is the problem occurs with
  different TFTP servers (I tried three different servers) and it does
  not happen with an old v2009 U-Boot using the same target.
  
  Can you try running dcache off command before running the TFTP
  transfer? Does it still behave like this?
  
  You might need to define #define CONFIG_CMD_CACHE for this to work.
 
 Sourcery!
 It's not that it works with dcache off, I found something even more
 strange: The way I reproduce this issue is by setting the 'bootcmd' to
 'dboot ${loadaddr} file100M'. When you set the 'bootcmd' like this:
 
   setenv bootcmd tftp ${loadaddr} file100M
 
 this eventually expands to
 
   bootcmd=tftp 0x4200 file100M
 
 So this is the command that runs automatically after the bootdelay.
 I just discovered that if instead of letting the auto boot run, I press a
 key to stop the auto boot and run the command by hand (either running
 'boot' or typing the command 'tftp 0x4200 file100M'), the tftp
 transfer works perfectly.
 On the other hand, if I do the same but use the environment variable
 ${loadaddr}, i.e. 'tftp ${loadaddr} file100M'. It will stop after 10
 seconds.

Count it be your hardware needs some more delay to stabilize?

 And to make things funnier I just reproduced this issue on the MX28EVK
 using the imx U-Boot custodian tree at commit
 a3f170cdbf7ae0bd24c94c2f46725699bbd69f05. That discards being a platform
 issue.

It still might be a PHY issue, no?

 @Fabio: could you manually run the command 'tftp ${loadaddr} file100M'

I guess that'd be a 100MB file?

 in
 your EVK? If it doesn't fail, could you try running it again after playing
 with the environment (setting/printing some variables).
 As I said, this issue appeared with different TFTP servers and is
 independent of whether the dcache is or not enabled.
 
 Best regards,
 --
 Hector Palacios

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


[U-Boot] Antwort: Re: [PATCH] mx6qsabrelite: Remove mx6qsabrelite code in favor of nitrogen6x

2013-07-15 Thread Stephan Bauroth
Hi Eric, Hi everyone else,

 It seems that there are two policy differences between
 the mx6qsabrelite.h and nitrogen6x.h files:

 1. Use of MMC for environment storage
 2. Use of boot script in nitrogen6x

 I think we can dispense with #1. Can you think of any reason
 a user would care where this is stored?

I don't agree. I usually don't have a MMC put into the slot on my board, 
as I want to boot my board via NFS. Last week I had exactly the situation 
that my environment was resetted everytime i rebooted the board. Since i 
was testing a very unstable kernel, this happened a lot and i had to 
reinitialise the environment for networking booting every time. At the end 
it took me half an hour to find the swtich and the thing was done. But 
mentioning the fact in the README would have saved some time. :)


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


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Hector Palacios

On 07/15/2013 05:12 PM, Marek Vasut wrote:

Hi Hector,


Hi Marek,

On 07/15/2013 02:30 PM, Marek Vasut wrote:

Dear Hector Palacios,


Hi Marek,

On 07/12/2013 06:48 PM, Marek Vasut wrote:

   [...]

but I found something:
It is very strange that the timeouts appear always after transferring
between 20 and 24 MiB. So I thought maybe it was not an issue with the
size of the file or the number of packets received, but instead a
timed issue (an issue that happens after some period of time). I
checked, and in fact the timeouts occur exactly 10 seconds after
running the tftp command. I verified that this is what is happening
by adding a udelay(10) at fec_send(). In this case, the timeout
also occurs after 10 seconds, but due to the delay, I have
transferred only a few Kbytes.


Holy moly!


I tried to change different timeout related constants at tftp.c but
still the issue happens after 10s.
It's like if, after these 10 seconds, the PHY lost the link or
something. Really odd. Does it tell you anything?


LAN8720 phy, right? Try implementing something like [1], by clearing
the EDPWRDOWN bit , the PHY will never enter low-power mode. It's just
a simple PHY register RMW which you can stick somewhere into the PHY
net/phy/smsc.c code.

[1]
https://kernel.googlesource.com/pub/scm/linux/kernel/git/djbw/dmaengine
/+ /b629820d18fa65cc598390e4b9712fd5f83ee693%5E!/#F0


No, my PHY is a Micrel KSZ8031RNLI.

The hint about the PHY possibly going to power down mode is interesting
but I checked the PHY registers and EDPD mode (Energy Detect Power
Down) is off, at least before running the tftp command. Power Down mode
is off too, so unless these are somehow enabled during the TFTP
process, this is not what's happening.


OK, makes sense.


The sniffer shows that the TFTP server simply stops sending data
packets. I can see however the target sending several times the ACK
packet to the last received data packet. This would point to the TFTP
server (as Albert suggested), but the fact is the problem occurs with
different TFTP servers (I tried three different servers) and it does
not happen with an old v2009 U-Boot using the same target.


Can you try running dcache off command before running the TFTP
transfer? Does it still behave like this?

You might need to define #define CONFIG_CMD_CACHE for this to work.


Sourcery!
It's not that it works with dcache off, I found something even more
strange: The way I reproduce this issue is by setting the 'bootcmd' to
'dboot ${loadaddr} file100M'. When you set the 'bootcmd' like this:

setenv bootcmd tftp ${loadaddr} file100M

this eventually expands to

bootcmd=tftp 0x4200 file100M

So this is the command that runs automatically after the bootdelay.
I just discovered that if instead of letting the auto boot run, I press a
key to stop the auto boot and run the command by hand (either running
'boot' or typing the command 'tftp 0x4200 file100M'), the tftp
transfer works perfectly.
On the other hand, if I do the same but use the environment variable
${loadaddr}, i.e. 'tftp ${loadaddr} file100M'. It will stop after 10
seconds.


Count it be your hardware needs some more delay to stabilize?


It's not a problem of running the command later. If I run the command later, manually, 
but use ${loadaddr} instead of the hardcoded value 0x4200, then it will fail. It's 
like if accessing the environment for grabbing the value of ${loadaddr} or for 
grabbing the value of ${bootcmd}, made the problem appear, while if I run a manual 
command that does not require accesing the environment, it works.



And to make things funnier I just reproduced this issue on the MX28EVK
using the imx U-Boot custodian tree at commit
a3f170cdbf7ae0bd24c94c2f46725699bbd69f05. That discards being a platform
issue.


It still might be a PHY issue, no?


I guess it might, but the MX28EVK uses a different PHY. An SMSC, I believe.


@Fabio: could you manually run the command 'tftp ${loadaddr} file100M'


I guess that'd be a 100MB file?


Yes. The size is not that important as far as it takes more than 10 seconds to 
download. The keypoint here is using the environment variable, rather than an hex value.


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


Re: [U-Boot] [PATCH] mx6qsabrelite: Remove mx6qsabrelite code in favor of nitrogen6x

2013-07-15 Thread Fabio Estevam
Hi Eric,

On Mon, Jul 15, 2013 at 11:20 AM, Eric Nelson
eric.nel...@boundarydevices.com wrote:

 Thanks for pointing it out. I had missed this.


 rename board/{freescale/mx6qsabrelite/README =
 boundary/nitrogen6x/README.mx6qsabrelite} (100%)


 I also have to admit not having read this README.

 It appears to give pretty bad advice, suggesting that the
 user use the iMX6DQ_SPI_to_uSDHC3.bin shim to force
 boot from SDHC3.

 I think this explains how people keep ending up at that
 stale Linaro post.

As I explained to Otavio, this patch does not attempt to introduce any
change in current behaviour.

The only intention here is to get rid of code duplication.

If we want to change the current behaviour and align it with
nitrogen6x, then we should do this on a separate patch.

I will address Stefano's suggestion of changing the MAINTAINER file
and plan to send a v2 later today.

Thanks,

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


Re: [U-Boot] Antwort: Re: [PATCH] mx6qsabrelite: Remove mx6qsabrelite code in favor of nitrogen6x

2013-07-15 Thread Eric Nelson

Hi Stephan,

On 07/15/2013 07:55 AM, Stephan Bauroth wrote:

Hi Eric, Hi everyone else,

  It seems that there are two policy differences between
  the mx6qsabrelite.h and nitrogen6x.h files:

  1. Use of MMC for environment storage
  2. Use of boot script in nitrogen6x

  I think we can dispense with #1. Can you think of any reason
  a user would care where this is stored?

I don't agree. I usually don't have a MMC put into the slot on my board,
as I want to boot my board via NFS.


This sounds like a vote for having the environment in SPI-NOR.

 Last week I had exactly the situation that my environment was
 resetted everytime i rebooted the board. Since i was testing a
 very unstable kernel, this happened a lot and i had to
 reinitialise the environment for networking booting every

time.


I'm not sure what you're not agreeing with. I'm suggesting that
in order to configure for boot to network, you'll need to
run a few commands:

U-Boot  setenv serverip 192.168.0.44
U-Boot  setenv nfsroot /path/to/rootfs
U-Boot  setenv bootcmd run bootcmd_net
U-Boot  saveenv

The 'bootcmd' is the question I have. The mx6qsabrelite.h file
currently has this:

   mmc dev ${mmcdev}; if mmc rescan; then  \
   if run loadbootscript; then  \
   run bootscript;  \
   else  \
   if run loaduimage; then  \
   run mmcboot;  \
   else run netboot;  \
   fi;  \
   fi;  \
   else run netboot; fi

That is, try to run from SD card, and network if that fails.

What I'm suggesting is that we make the SD card part of
things above 'bootcmd_freescale', so you have three choices
for configurations:

U-Boot  setenv bootcmd run bootcmd_boundary
U-Boot  setenv bootcmd run bootcmd_freescale
U-Boot  setenv bootcmd run bootcmd_net

'bootcmd_freescale' and 'bootcmd_net' can be essentially
the Freescale scripts, so they match documentation done
by the Freescale team. 'bootcmd_boundary' would be the
default for boards we ship.

Any of these can be saved to SPI NOR for use at POR.

 At the end it took me half an hour to find the swtich and the

thing was done. But mentioning the fact in the README would have saved
some time. :)



I think we're all in agreement about proper notes in the README.
We're just trying to figure out the policy to document.

Also note that since a user can over-ride 'bootcmd', all of this
are just defaults.

When I'm doing network boots, I find it easier to simply set the
'bootargs' and 'bootcmd' variables directly

U-Boot  setenv bootargs ... root=/dev/nfs nfsroot=...
U-Boot  setenv bootcmd 'dhcp 1080 192.168.0.44:uImage  bootm'

This skips all of the conditionals and is much easier to verify.

Regards,


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


Re: [U-Boot] [PATCH] mx6qsabrelite: Remove mx6qsabrelite code in favor of nitrogen6x

2013-07-15 Thread Eric Nelson

On 07/15/2013 08:33 AM, Fabio Estevam wrote:

Hi Eric,

On Mon, Jul 15, 2013 at 11:20 AM, Eric Nelson
eric.nel...@boundarydevices.com wrote:


Thanks for pointing it out. I had missed this.



rename board/{freescale/mx6qsabrelite/README =
boundary/nitrogen6x/README.mx6qsabrelite} (100%)



I also have to admit not having read this README.

It appears to give pretty bad advice, suggesting that the
user use the iMX6DQ_SPI_to_uSDHC3.bin shim to force
boot from SDHC3.

I think this explains how people keep ending up at that
stale Linaro post.


As I explained to Otavio, this patch does not attempt to introduce any
change in current behaviour.

The only intention here is to get rid of code duplication.

If we want to change the current behaviour and align it with
nitrogen6x, then we should do this on a separate patch.

I will address Stefano's suggestion of changing the MAINTAINER file
and plan to send a v2 later today.



Ok.

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


Re: [U-Boot] [PATCH v2 1/1] patman: README documentation nits (unit test)

2013-07-15 Thread Tom Rini
On Sun, Jul 14, 2013 at 10:51:08AM -0700, Simon Glass wrote:
 On Sun, Jul 14, 2013 at 2:27 AM, Gerhard Sittig g...@denx.de wrote:
 
  adjust instructions for the invocation of Patman's self test: the -t
  flag appears to have a different meaning now, refer to the --test option
  for the builtin unit test; adjust a directory location and make sure to
  run the file which resides in the source directory
 
  Signed-off-by: Gerhard Sittig g...@denx.de
 
 
 Acked-by: Simon Glass s...@chromium.org
 
 Tom, would you like to pick this fix up now, or should I do it in the next
 merge window?

I shall pick this up later today, thanks!

-- 
Tom


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


Re: [U-Boot] [ANN] v2013.07-rc3

2013-07-15 Thread Stephen Warren
On 07/12/2013 11:17 PM, Stephen Warren wrote:
 On 07/12/2013 03:27 PM, Tom Rini wrote:
 Hey all,

 I've tagged and pushed v2013.07-rc3 out, and it should sync its
 way around in a few hours.  I believe we should be all sorted out
 with FIT images and bootz and bootm finally, but a quick check that
 we've really got things merged would be greatly appreciated.
 
 Everything seems to work fine on Raspberry Pi.

I also did a /quick/ test on Tegra Seaboard and that seems fine too.

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


Re: [U-Boot] [PATCH] arm: omap5_uevm: Correct the console sys prompt for 5432

2013-07-15 Thread Tom Rini
On Thu, Jun 27, 2013 at 09:00:59AM +0200, Albert ARIBAUD wrote:
 Hi Tom,
 
 On Mon, 24 Jun 2013 16:30:54 -0400, Tom Rini tr...@ti.com wrote:
[snip]
  True.  Looking ahead however, given device trees and the need to know
  what tree to request/load, I hope more boards will go with enabling
  CONFIG_ENV_VARS_UBOOT_CONFIG and can then use cpu/board/board_name as
  needed to determine those things at run-time.
 
 How about announcing (as in, letting the whole world know by slipping
 it in our public announcement of 2013.07) that custom prompts will be
 deprecated starting with 2013.10 and that targets still having them by
 2014.01 will be retired?
 
 That's what we did for ARM ELF relocation IIRC.
 
 Of course, that would require a few round of e-mails to maintainers, at
 least to those whose targets' config header files still have custom
 prompts when reaching 2014.01-rc1; and there will be some yelling that
 such or such board has been dropped from U-Boot and why were users not
 told, etc.
 
 Alternatively, we could announce and deprecate in 2013.10 and remove
 all custom prompts in 2013.14 ourselves, then wait for annoyed people
 to yell at us, and advise them to enable CONFIG_ENV_VARS_UBOOT_CONFIG
 and uptate their scripts. Less prep work, slightly more yelling.
 
 We could even shift the schedule, deprecate for 2013.07 and remove in
 2013.10. Same amount of work, yelling goes away earlier.
 
 My vote goes to this last proposal. :)

With the self-inflicted bootm/FIT problems, I set this email aside for a
bit longer than I had wanted.  My plan, right now, is to just start with
letting the wider world know, in the releae email, that hey, we have
more reliable methods of determing what board you are on, at run time.
And seeing where things go from there.

-- 
Tom


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


[U-Boot] [PATCH v2] mx6qsabrelite: Remove mx6qsabrelite code in favor of nitrogen6x

2013-07-15 Thread Fabio Estevam
mx6qsabrelite and nitrogen6q boards are hardware compatible, so let's avoid the
code duplication and only use the nitrogen6x source code to make board code
maintainance easier.

Tested booting a mainline device tree kernel on a mx6qsabrelite board.

Signed-off-by: Fabio Estevam fabio.este...@freescale.com
---
Changes since v1:
- Update MAINTAINERS file

 MAINTAINERS|   2 +-
 .../nitrogen6x/README.mx6qsabrelite}   |   0
 .../nitrogen6x/{README = README.nitrogen6x}   |   0
 board/freescale/mx6qsabrelite/Makefile |  41 -
 board/freescale/mx6qsabrelite/mx6qsabrelite.c  | 848 -
 boards.cfg |   2 +-
 include/configs/mx6qsabrelite.h| 297 
 include/configs/nitrogen6x.h   |  80 +-
 8 files changed, 81 insertions(+), 1189 deletions(-)
 rename board/{freescale/mx6qsabrelite/README = 
boundary/nitrogen6x/README.mx6qsabrelite} (100%)
 rename board/boundary/nitrogen6x/{README = README.nitrogen6x} (100%)
 delete mode 100644 board/freescale/mx6qsabrelite/Makefile
 delete mode 100644 board/freescale/mx6qsabrelite/mx6qsabrelite.c
 delete mode 100644 include/configs/mx6qsabrelite.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 001b42d..c4ed128 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -600,7 +600,6 @@ Jason Liu r64...@freescale.com
mx53evk i.MX53
mx53locoi.MX53
mx6qarm2i.MX6Q
-   mx6qsabrelite   i.MX6Q
 
 Enric Balletbo i Serra eballe...@iseebcn.com
 
@@ -1054,6 +1053,7 @@ Pali Roh??r pali.ro...@gmail.com
nokia_rx51  ARM ARMV7 (OMAP34xx SoC)
 
 Eric Nelson eric.nel...@boundarydevices.com
+   mx6qsabrelite   i.MX6Q  1GB
nitrogen6dl i.MX6DL 1GB
nitrogen6dl2g   i.MX6DL 2GB
nitrogen6q  i.MX6Q/6D   1GB
diff --git a/board/freescale/mx6qsabrelite/README 
b/board/boundary/nitrogen6x/README.mx6qsabrelite
similarity index 100%
rename from board/freescale/mx6qsabrelite/README
rename to board/boundary/nitrogen6x/README.mx6qsabrelite
diff --git a/board/boundary/nitrogen6x/README 
b/board/boundary/nitrogen6x/README.nitrogen6x
similarity index 100%
rename from board/boundary/nitrogen6x/README
rename to board/boundary/nitrogen6x/README.nitrogen6x
diff --git a/board/freescale/mx6qsabrelite/Makefile 
b/board/freescale/mx6qsabrelite/Makefile
deleted file mode 100644
index cf344e4..000
diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c 
b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
deleted file mode 100644
index 862bc30..000
diff --git a/boards.cfg b/boards.cfg
index db56488..86e2fd6 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -259,7 +259,7 @@ vision2  arm armv7   
vision2 ttcontr
 cgtqmx6qevalarm armv7   
cgtqmx6eval congatec   mx6 
cgtqmx6eval:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q
 mx6qarm2 arm armv7   mx6qarm2
freescale  mx6
mx6qarm2:IMX_CONFIG=board/freescale/mx6qarm2/imximage.cfg
 mx6qsabreautoarm armv7   mx6qsabreauto   
freescale  mx6
mx6qsabreauto:IMX_CONFIG=board/freescale/mx6qsabreauto/imximage.cfg,MX6Q
-mx6qsabrelitearm armv7   mx6qsabrelite   
freescale  mx6
mx6qsabrelite:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg
+mx6qsabrelitearm armv7   nitrogen6x  
boundary   mx6
nitrogen6x:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6q.cfg,MX6Q,DDR_MB=1024,SABRELITE
 mx6dlsabresd arm armv7   mx6sabresd  
freescale  mx6
mx6sabresd:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6dl.cfg,MX6DL
 mx6qsabresd  arm armv7   mx6sabresd  
freescale  mx6
mx6sabresd:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q
 mx6slevk arm armv7   mx6slevk
freescale  mx6
mx6slevk:IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL
diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h
deleted file mode 100644
index c7db81d..000
diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 74df66c..85eecfc 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -186,6 +186,80 @@
 
 #define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
 
+#if defined(CONFIG_SABRELITE)
+#define CONFIG_EXTRA_ENV_SETTINGS \
+   script=boot.scr\0 \
+   uimage=uImage\0 \
+   console=ttymxc1\0 \
+   fdt_high=0x\0 \
+   initrd_high=0x\0 \
+   fdt_file=imx6q-sabrelite.dtb\0 \
+   

Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Troy Kisky

On 7/15/2013 6:41 AM, Albert ARIBAUD wrote:

Hi Troy,

On Fri, 12 Jul 2013 19:43:07 -0700, Troy Kisky
troy.ki...@boundarydevices.com wrote:


On 7/11/2013 4:18 PM, Fabio Estevam wrote:

On Thu, Jul 11, 2013 at 8:03 PM, Marek Vasut ma...@denx.de wrote:

The MX28 multi-layer AHB bus can be too slow and trigger the
FEC DMA too early, before all the data hit the DRAM. This patch
ensures the data are written in the RAM before the DMA starts.
Please see the comment in the patch for full details.

This patch was produced with an amazing help from Albert Aribaud,
who pointed out it can possibly be such a bus synchronisation
issue.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Albert ARIBAUD albert.u.b...@aribaud.net
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Stefano Babic sba...@denx.de

Excellent, managed to transfer 90MB via TFTP on mx28evk without a
single timeout.

Tested-by: Fabio Estevam fabio.este...@freescale.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Perhaps this because our memory barriers are lacking.

Linux has this code
asm/io.h:#define writel(v,c)({ __iowmb();
writel_relaxed(v,c); })

asm/io.h-#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
asm/io.h-#include asm/barrier.h
asm/io.h-#define __iormb()  rmb()
asm/io.h:#define __iowmb()  wmb()
asm/io.h-#else
asm/io.h-#define __iormb()  do { } while (0)
asm/io.h:#define __iowmb()  do { } while (0)
asm/io.h-#endif

asm/io.h-#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
asm/io.h-#include asm/barrier.h
asm/io.h-#define __iormb()  rmb()
asm/io.h:#define __iowmb()  wmb()
asm/io.h-#else
asm/io.h-#define __iormb()  do { } while (0)
asm/io.h:#define __iowmb()  do { } while (0)
asm/io.h-#endif

asm/barrier.h-#elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) ||
defined(CONFIG_SMP)
asm/barrier.h-#define mb()  do { dsb(); outer_sync(); }
while (0)
asm/barrier.h-#define rmb() dsb()
asm/barrier.h:#define wmb() mb()
asm/barrier.h-#else
asm/barrier.h-#define mb()  barrier()
asm/barrier.h-#define rmb() barrier()
asm/barrier.h:#define wmb() barrier()
asm/barrier.h-#endif

asm/barrier.h-#if __LINUX_ARM_ARCH__ = 7
asm/barrier.h-#define isb() __asm__ __volatile__ (isb : : : memory)
asm/barrier.h:#define dsb() __asm__ __volatile__ (dsb : : : memory)
asm/barrier.h-#define dmb() __asm__ __volatile__ (dmb : : : memory)
asm/barrier.h-#elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6
asm/barrier.h-#define isb() __asm__ __volatile__ (mcr p15, 0, %0, c7,
c5, 4 \
asm/barrier.h-  : : r (0) : memory)
asm/barrier.h:#define dsb() __asm__ __volatile__ (mcr p15, 0, %0, c7,
c10, 4 \
asm/barrier.h-  : : r (0) : memory)
asm/barrier.h-#define dmb() __asm__ __volatile__ (mcr p15, 0, %0, c7,
c10, 5 \

_
Can you try just adding a dsb() instead of the dummy read?

If this also fixes your problem, it seems better to fix our writel macro

Not sure I understand who you are answering to exactly, as Fabio
indicates his problem is solved.

Besides, Marek and I had in fact investigated barriers, adding some as
I did in times past in mvgbe.c, and fiddling with the one already in
dcache_flush_range(). None of this had any effect.


You tried adding a  dsb()  to dcache_flush_range()?
That should have fixed the problem as well.



However, if our barriers are lacking, then they may fail us somehow on
other occasions, so best is if we analyze the failings. Can you clarify
in what respect exactly they are lacking? For instance, are all our
barriers lacking, or only some, and which ones?

Amicalement,


Linux has

Kconfig:config ARM_DMA_MEM_BUFFERABLE
Kconfig-bool Use non-cacheable memory for DMA if (CPU_V6 || 
CPU_V6K)  !CPU_V7
Kconfig-depends on !(MACH_REALVIEW_PB1176 || REALVIEW_EB_ARM11MP 
|| \

Kconfig- MACH_REALVIEW_PB11MP)
Kconfig-default y if CPU_V6 || CPU_V6K || CPU_V7
Kconfig-help


So, if this symbol is y then all writel/readl will be preceded by a 
dsb() as shown above.


However, u-boot probably uses cacheable memory for dma, so maybe u-boot 
is also correct with


asm/io.h-#define dmb()  __asm__ __volatile__ ( : : : memory)
asm/io.h-#define __iormb()dmb()
asm/io.h:#define __iowmb()dmb()


and no dsb(), but perhaps flush_dcache still needs one at the end.


Troy


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


Re: [U-Boot] [PATCH v2] mx6qsabrelite: Remove mx6qsabrelite code in favor of nitrogen6x

2013-07-15 Thread Otavio Salvador
On Mon, Jul 15, 2013 at 2:29 PM, Fabio Estevam
fabio.este...@freescale.com wrote:
 mx6qsabrelite and nitrogen6q boards are hardware compatible, so let's avoid 
 the
 code duplication and only use the nitrogen6x source code to make board code
 maintainance easier.

 Tested booting a mainline device tree kernel on a mx6qsabrelite board.

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

Reviewed-by: Otavio Salvador ota...@ossystems.com.br

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Troy Kisky

On 7/15/2013 10:39 AM, Troy Kisky wrote:

On 7/15/2013 6:41 AM, Albert ARIBAUD wrote:

Hi Troy,

On Fri, 12 Jul 2013 19:43:07 -0700, Troy Kisky
troy.ki...@boundarydevices.com wrote:


On 7/11/2013 4:18 PM, Fabio Estevam wrote:

On Thu, Jul 11, 2013 at 8:03 PM, Marek Vasut ma...@denx.de wrote:

The MX28 multi-layer AHB bus can be too slow and trigger the
FEC DMA too early, before all the data hit the DRAM. This patch
ensures the data are written in the RAM before the DMA starts.
Please see the comment in the patch for full details.

This patch was produced with an amazing help from Albert Aribaud,
who pointed out it can possibly be such a bus synchronisation
issue.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Albert ARIBAUD albert.u.b...@aribaud.net
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Stefano Babic sba...@denx.de

Excellent, managed to transfer 90MB via TFTP on mx28evk without a
single timeout.

Tested-by: Fabio Estevam fabio.este...@freescale.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Perhaps this because our memory barriers are lacking.

Linux has this code
asm/io.h:#define writel(v,c)({ __iowmb();
writel_relaxed(v,c); })

asm/io.h-#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
asm/io.h-#include asm/barrier.h
asm/io.h-#define __iormb()  rmb()
asm/io.h:#define __iowmb()  wmb()
asm/io.h-#else
asm/io.h-#define __iormb()  do { } while (0)
asm/io.h:#define __iowmb()  do { } while (0)
asm/io.h-#endif

asm/io.h-#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
asm/io.h-#include asm/barrier.h
asm/io.h-#define __iormb()  rmb()
asm/io.h:#define __iowmb()  wmb()
asm/io.h-#else
asm/io.h-#define __iormb()  do { } while (0)
asm/io.h:#define __iowmb()  do { } while (0)
asm/io.h-#endif

asm/barrier.h-#elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) ||
defined(CONFIG_SMP)
asm/barrier.h-#define mb()  do { dsb(); outer_sync(); }
while (0)
asm/barrier.h-#define rmb() dsb()
asm/barrier.h:#define wmb() mb()
asm/barrier.h-#else
asm/barrier.h-#define mb()  barrier()
asm/barrier.h-#define rmb() barrier()
asm/barrier.h:#define wmb() barrier()
asm/barrier.h-#endif

asm/barrier.h-#if __LINUX_ARM_ARCH__ = 7
asm/barrier.h-#define isb() __asm__ __volatile__ (isb : : : memory)
asm/barrier.h:#define dsb() __asm__ __volatile__ (dsb : : : memory)
asm/barrier.h-#define dmb() __asm__ __volatile__ (dmb : : : memory)
asm/barrier.h-#elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6
asm/barrier.h-#define isb() __asm__ __volatile__ (mcr p15, 0, %0, c7,
c5, 4 \
asm/barrier.h-  : : r (0) : memory)
asm/barrier.h:#define dsb() __asm__ __volatile__ (mcr p15, 0, %0, c7,
c10, 4 \
asm/barrier.h-  : : r (0) : memory)
asm/barrier.h-#define dmb() __asm__ __volatile__ (mcr p15, 0, %0, c7,
c10, 5 \

_
Can you try just adding a dsb() instead of the dummy read?

If this also fixes your problem, it seems better to fix our writel 
macro

Not sure I understand who you are answering to exactly, as Fabio
indicates his problem is solved.

Besides, Marek and I had in fact investigated barriers, adding some as
I did in times past in mvgbe.c, and fiddling with the one already in
dcache_flush_range(). None of this had any effect.


You tried adding a  dsb()  to dcache_flush_range()?
That should have fixed the problem as well.



However, if our barriers are lacking, then they may fail us somehow on
other occasions, so best is if we analyze the failings. Can you clarify
in what respect exactly they are lacking? For instance, are all our
barriers lacking, or only some, and which ones?

Amicalement,


Linux has

Kconfig:config ARM_DMA_MEM_BUFFERABLE
Kconfig-bool Use non-cacheable memory for DMA if (CPU_V6 || 
CPU_V6K)  !CPU_V7
Kconfig-depends on !(MACH_REALVIEW_PB1176 || 
REALVIEW_EB_ARM11MP || \

Kconfig- MACH_REALVIEW_PB11MP)
Kconfig-default y if CPU_V6 || CPU_V6K || CPU_V7
Kconfig-help


So, if this symbol is y then all writel/readl will be preceded by a 
dsb() as shown above.


However, u-boot probably uses cacheable memory for dma, so maybe 
u-boot is also correct with


asm/io.h-#define dmb()  __asm__ __volatile__ ( : : : memory)
asm/io.h-#define __iormb()dmb()
asm/io.h:#define __iowmb()dmb()


and no dsb(), but perhaps flush_dcache still needs one at the end.


Troy



for armv7, flush dcache does have a dsb.

//u-boot
#define CP15DSB asm volatile (mcr p15, 0, %0, c7, c10, 4 : : r (0))

//linux
asm/barrier.h:#define dsb() __asm__ __volatile__ (mcr p15, 0, %0, c7, 
c10, 4  : : r (0) : memory)




Don't know why I didn't see that before.
So, I don't know why that wasn't good enough.

Maybe  CONFIG_SYS_DCACHE_OFF was set and

void 

Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Albert ARIBAUD
Hi Troy,

On Mon, 15 Jul 2013 10:39:54 -0700, Troy Kisky
troy.ki...@boundarydevices.com wrote:

  Besides, Marek and I had in fact investigated barriers, adding some as
  I did in times past in mvgbe.c, and fiddling with the one already in
  dcache_flush_range(). None of this had any effect.
 
 You tried adding a  dsb()  to dcache_flush_range()?
 That should have fixed the problem as well.

There already was a memory barrier -- the only one kind known bu
ARM926J-S, which is a write buffer(s) drain -- and no, it should not
have fixed the problem (and did not), because the issue is not about
pushing the transactions out of the CPU soon enough; it is about having
the EMI perform them before it passes our 'go' command to the ENET DMA.

  However, if our barriers are lacking, then they may fail us somehow on
  other occasions, so best is if we analyze the failings. Can you clarify
  in what respect exactly they are lacking? For instance, are all our
  barriers lacking, or only some, and which ones?
 
  Amicalement,
 
 Linux has
 
 Kconfig:config ARM_DMA_MEM_BUFFERABLE
 Kconfig-bool Use non-cacheable memory for DMA if (CPU_V6 || 
 CPU_V6K)  !CPU_V7
 Kconfig-depends on !(MACH_REALVIEW_PB1176 || REALVIEW_EB_ARM11MP 
 || \
 Kconfig- MACH_REALVIEW_PB11MP)
 Kconfig-default y if CPU_V6 || CPU_V6K || CPU_V7
 Kconfig-help
 
 
 So, if this symbol is y then all writel/readl will be preceded by a 
 dsb() as shown above.

While I do understand what is done there, I do not see the interest
since 1) in our issue, the problem was not in any writel() or readl(),
and 2) U-Boot uses readl() and writel() for device memory ranges, which
are not cached at all and thus do not need any flush, invalidate or
barrier.

 However, u-boot probably uses cacheable memory for dma, so maybe u-boot 
 is also correct with

Actually, in the driver where the issue occurred, U-boot does use
cacheable memory for DMA; that's why the driver contains calls to
flush_dcache_range() and invalidate_dcache_range() on the descriptors...

 asm/io.h-#define dmb()  __asm__ __volatile__ ( : : : memory)
 asm/io.h-#define __iormb()dmb()
 asm/io.h:#define __iowmb()dmb()
 
 and no dsb(), but perhaps flush_dcache still needs one at the end.

... but that's for descriptors, which are not accessed uwing writel()
or readl(); for device registers, such as ENET, we use writel() and
readl() but no cache.

So far we never had to use any data memory barrier on peripheral
accesses. The worst that happened AFAIK is when we needed instruction
barriers to prevent the compiler from mis-ordering device writes wrt
their source code order; and at that time, our readl() and writel()
implementations were not volatile. Today, I am pretty sure that these
instruction barriers are uneeded.

 Troy

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


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Albert ARIBAUD
Hi Troy,

On Mon, 15 Jul 2013 12:59:56 -0700, Troy Kisky
troy.ki...@boundarydevices.com wrote:

 On 7/15/2013 10:39 AM, Troy Kisky wrote:
  On 7/15/2013 6:41 AM, Albert ARIBAUD wrote:
  Hi Troy,
 
  On Fri, 12 Jul 2013 19:43:07 -0700, Troy Kisky
  troy.ki...@boundarydevices.com wrote:
 
  On 7/11/2013 4:18 PM, Fabio Estevam wrote:
  On Thu, Jul 11, 2013 at 8:03 PM, Marek Vasut ma...@denx.de wrote:
  The MX28 multi-layer AHB bus can be too slow and trigger the
  FEC DMA too early, before all the data hit the DRAM. This patch
  ensures the data are written in the RAM before the DMA starts.
  Please see the comment in the patch for full details.
 
  This patch was produced with an amazing help from Albert Aribaud,
  who pointed out it can possibly be such a bus synchronisation
  issue.
 
  Signed-off-by: Marek Vasut ma...@denx.de
  Cc: Albert ARIBAUD albert.u.b...@aribaud.net
  Cc: Fabio Estevam fabio.este...@freescale.com
  Cc: Stefano Babic sba...@denx.de
  Excellent, managed to transfer 90MB via TFTP on mx28evk without a
  single timeout.
 
  Tested-by: Fabio Estevam fabio.este...@freescale.com
  ___
  U-Boot mailing list
  U-Boot@lists.denx.de
  http://lists.denx.de/mailman/listinfo/u-boot
 
  Perhaps this because our memory barriers are lacking.
 
  Linux has this code
  asm/io.h:#define writel(v,c)({ __iowmb();
  writel_relaxed(v,c); })
 
  asm/io.h-#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
  asm/io.h-#include asm/barrier.h
  asm/io.h-#define __iormb()  rmb()
  asm/io.h:#define __iowmb()  wmb()
  asm/io.h-#else
  asm/io.h-#define __iormb()  do { } while (0)
  asm/io.h:#define __iowmb()  do { } while (0)
  asm/io.h-#endif
 
  asm/io.h-#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
  asm/io.h-#include asm/barrier.h
  asm/io.h-#define __iormb()  rmb()
  asm/io.h:#define __iowmb()  wmb()
  asm/io.h-#else
  asm/io.h-#define __iormb()  do { } while (0)
  asm/io.h:#define __iowmb()  do { } while (0)
  asm/io.h-#endif
 
  asm/barrier.h-#elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) ||
  defined(CONFIG_SMP)
  asm/barrier.h-#define mb()  do { dsb(); outer_sync(); }
  while (0)
  asm/barrier.h-#define rmb() dsb()
  asm/barrier.h:#define wmb() mb()
  asm/barrier.h-#else
  asm/barrier.h-#define mb()  barrier()
  asm/barrier.h-#define rmb() barrier()
  asm/barrier.h:#define wmb() barrier()
  asm/barrier.h-#endif
 
  asm/barrier.h-#if __LINUX_ARM_ARCH__ = 7
  asm/barrier.h-#define isb() __asm__ __volatile__ (isb : : : memory)
  asm/barrier.h:#define dsb() __asm__ __volatile__ (dsb : : : memory)
  asm/barrier.h-#define dmb() __asm__ __volatile__ (dmb : : : memory)
  asm/barrier.h-#elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6
  asm/barrier.h-#define isb() __asm__ __volatile__ (mcr p15, 0, %0, c7,
  c5, 4 \
  asm/barrier.h-  : : r (0) : memory)
  asm/barrier.h:#define dsb() __asm__ __volatile__ (mcr p15, 0, %0, c7,
  c10, 4 \
  asm/barrier.h-  : : r (0) : memory)
  asm/barrier.h-#define dmb() __asm__ __volatile__ (mcr p15, 0, %0, c7,
  c10, 5 \
 
  _
  Can you try just adding a dsb() instead of the dummy read?
 
  If this also fixes your problem, it seems better to fix our writel 
  macro
  Not sure I understand who you are answering to exactly, as Fabio
  indicates his problem is solved.
 
  Besides, Marek and I had in fact investigated barriers, adding some as
  I did in times past in mvgbe.c, and fiddling with the one already in
  dcache_flush_range(). None of this had any effect.
 
  You tried adding a  dsb()  to dcache_flush_range()?
  That should have fixed the problem as well.
 
 
  However, if our barriers are lacking, then they may fail us somehow on
  other occasions, so best is if we analyze the failings. Can you clarify
  in what respect exactly they are lacking? For instance, are all our
  barriers lacking, or only some, and which ones?
 
  Amicalement,
 
  Linux has
 
  Kconfig:config ARM_DMA_MEM_BUFFERABLE
  Kconfig-bool Use non-cacheable memory for DMA if (CPU_V6 || 
  CPU_V6K)  !CPU_V7
  Kconfig-depends on !(MACH_REALVIEW_PB1176 || 
  REALVIEW_EB_ARM11MP || \
  Kconfig- MACH_REALVIEW_PB11MP)
  Kconfig-default y if CPU_V6 || CPU_V6K || CPU_V7
  Kconfig-help
 
 
  So, if this symbol is y then all writel/readl will be preceded by a 
  dsb() as shown above.
 
  However, u-boot probably uses cacheable memory for dma, so maybe 
  u-boot is also correct with
 
  asm/io.h-#define dmb()  __asm__ __volatile__ ( : : : memory)
  asm/io.h-#define __iormb()dmb()
  asm/io.h:#define __iowmb()dmb()
 
 
  and no dsb(), but perhaps flush_dcache still needs one at the end.
 
 
  Troy
 
 
 for armv7, flush dcache does have a dsb.
 
 //u-boot
 #define 

[U-Boot] [PATCH v2] mpc83xx: add support for mpc8306

2013-07-15 Thread Matevz Langus

This processor is most similar to the MPC8309, but lacks PCI.

Signed-off-by: Matevz Langus matevz.langus at borea.si
---
Changes for v2:
   - Remove invalid Threads from QE SNUM allocation table for MPC8306  
and MPC8309 to be in line with Freescale QEIWRM 4.4


 arch/powerpc/cpu/mpc83xx/cpu.c |  1 +
 arch/powerpc/cpu/mpc83xx/cpu_init.c|  4 +++
 arch/powerpc/cpu/mpc83xx/speed.c   | 24 ++--
 arch/powerpc/include/asm/global_data.h |  2 +-
 arch/powerpc/include/asm/immap_83xx.h  | 52 + 
+++--

 arch/powerpc/include/asm/immap_qe.h|  2 +-
 drivers/qe/qe.c| 10 +--
 include/mpc83xx.h  |  9 +++---
 8 files changed, 85 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/ 
cpu.c

index cc20234..13fd502 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -55,6 +55,7 @@ int checkcpu(void)
char name[15];
u32 partid;
} cpu_type_list [] = {
+   CPU_TYPE_ENTRY(8306),
CPU_TYPE_ENTRY(8308),
CPU_TYPE_ENTRY(8309),
CPU_TYPE_ENTRY(8311),
diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/ 
mpc83xx/cpu_init.c

index 5153351..8beefc1 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c
@@ -334,7 +334,11 @@ void cpu_init_f (volatile immap_t * im)
struct usb_ehci *ehci = (struct usb_ehci *)CONFIG_SYS_FSL_USB_ADDR;

/* Configure interface. */
+#ifdef CONFIG_MPC8306
+   setbits_be32(ehci-control, REFSEL_16MHZ | PHY_CLK_SEL_ULPI);
+#else
setbits_be32(ehci-control, REFSEL_16MHZ | UTMI_PHY_EN);
+#endif

/* Wait for clock to stabilize */
do {
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/ 
mpc83xx/speed.c

index 6be0e3a..7c2a3bd 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -105,7 +105,7 @@ int get_clocks(void)
u32 tsec1_clk;
u32 tsec2_clk;
u32 usbdr_clk;
-#elif defined(CONFIG_MPC8309)
+#elif defined(CONFIG_MPC8306) || defined(CONFIG_MPC8309)
u32 usbdr_clk;
 #endif
 #ifdef CONFIG_MPC834x
@@ -122,7 +122,7 @@ int get_clocks(void)
 #if defined(CONFIG_FSL_ESDHC)
u32 sdhc_clk;
 #endif
-#if !defined(CONFIG_MPC8309)
+#if !defined(CONFIG_MPC8306)  !defined(CONFIG_MPC8309)
u32 enc_clk;
 #endif
u32 lbiu_clk;
@@ -166,7 +166,11 @@ int get_clocks(void)
}

spmf = (im-clk.spmr  SPMR_SPMF)  SPMR_SPMF_SHIFT;
+#if defined(CONFIG_MPC8306)
+   csb_clk = CONFIG_83XX_CLKIN * spmf;
+#else
csb_clk = pci_sync_in * (1 + clkin_div) * spmf;
+#endif

sccr = im-clk.sccr;

@@ -267,7 +271,7 @@ int get_clocks(void)
return -6;
}
 #endif
-#if !defined(CONFIG_MPC8309)
+#if !defined(CONFIG_MPC8306)  !defined(CONFIG_MPC8309)
switch ((sccr  SCCR_ENCCM)  SCCR_ENCCM_SHIFT) {
case 0:
enc_clk = 0;
@@ -338,7 +342,7 @@ int get_clocks(void)
i2c1_clk = sdhc_clk;
 #elif defined(CONFIG_MPC837x)
i2c1_clk = enc_clk;
-#elif defined(CONFIG_MPC8309)
+#elif defined(CONFIG_MPC8306) || defined(CONFIG_MPC8309)
i2c1_clk = csb_clk;
 #endif
 #if !defined(CONFIG_MPC832x)
@@ -458,7 +462,11 @@ int get_clocks(void)
 #if defined(CONFIG_QE)
qepmf = (im-clk.spmr  SPMR_CEPMF)  SPMR_CEPMF_SHIFT;
qepdf = (im-clk.spmr  SPMR_CEPDF)  SPMR_CEPDF_SHIFT;
+#if defined(CONFIG_MPC8306)
+   qe_clk = (CONFIG_83XX_QE_CLKIN * qepmf) / (1 + qepdf);
+#else
qe_clk = (pci_sync_in * qepmf) / (1 + qepdf);
+#endif
brg_clk = qe_clk / 2;
 #endif

@@ -468,7 +476,7 @@ int get_clocks(void)
gd-arch.tsec1_clk = tsec1_clk;
gd-arch.tsec2_clk = tsec2_clk;
gd-arch.usbdr_clk = usbdr_clk;
-#elif defined(CONFIG_MPC8309)
+#elif defined(CONFIG_MPC8306) || defined(CONFIG_MPC8309)
gd-arch.usbdr_clk = usbdr_clk;
 #endif
 #if defined(CONFIG_MPC834x)
@@ -485,7 +493,7 @@ int get_clocks(void)
 #if !defined(CONFIG_MPC832x)
gd-arch.i2c2_clk = i2c2_clk;
 #endif
-#if !defined(CONFIG_MPC8309)
+#if !defined(CONFIG_MPC8306)  !defined(CONFIG_MPC8309)
gd-arch.enc_clk = enc_clk;
 #endif
gd-arch.lbiu_clk = lbiu_clk;
@@ -555,7 +563,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag,  
int argc, char * const argv[])

printf(  DDR Secondary:   %-4s MHz\n,
   strmhz(buf, gd-arch.mem_sec_clk));
 #endif
-#if !defined(CONFIG_MPC8309)
+#if !defined(CONFIG_MPC8306)  !defined(CONFIG_MPC8309)
printf(  SEC: %-4s MHz\n,
   strmhz(buf, gd-arch.enc_clk));
 #endif
@@ -581,7 +589,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag,  
int argc, char * const argv[])

   strmhz(buf, gd-arch.tsec2_clk));
printf(  USB DR:  %-4s MHz\n,
   strmhz(buf, gd-arch.usbdr_clk));

Re: [U-Boot] [ANN] v2013.07-rc2

2013-07-15 Thread Tom Rini
On Tue, Jul 02, 2013 at 01:38:43PM +0200, Dirk Eibach wrote:
 Hi Andy,
 
  If you've got changes outstanding still, please start gently poking
  custodians with patchwork links.  I've got a good bit of stuff I need to
  deal with myself still, but please prod me all the same.
 
 my series [PATCH v7 0/5] Add gdsys ControlCenter Digital board is
 still missing.
 
 You can find it here:
 http://patchwork.ozlabs.org/patch/254751/
 http://patchwork.ozlabs.org/patch/254749/
 http://patchwork.ozlabs.org/patch/254748/
 http://patchwork.ozlabs.org/patch/254750/
 http://patchwork.ozlabs.org/patch/254754/

Sorry, this got lost in the noise of the bootm changes.  Both the 4xx
series and 85xx series were posted before the merge window closed.
Andy, Stefan, do you want to pick these up, or do you want me to, or are
there changes needed still?  Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 0/5] Introducing SPDX-License-Identifiers

2013-07-15 Thread Stephen Warren
On 07/10/2013 01:37 AM, Wolfgang Denk wrote:
 Like many other projects, U-Boot has a tradition of including big
 blocks of License headers in all files.  This not only blows up the
 source code with mostly redundant information, but also makes it very
 difficult to generate License Clearing Reports.  An additional problem
 is that even the same lincenses are referred to by a number of
 slightly varying text blocks (full, abbreviated, different
 indentation, line wrapping and/or white space, with obsolete address
 information, ...) which makes automatic processing a nightmare.
 
 To make this easier, such license headers in the source files will be
 replaced with a single line reference to Unique Lincense Identifiers
 as defined by the Linux Foundation's SPDX project [1].  For example,
 in a source file the full GPL v2.0 or later header text will be
 replaced by a single line:
 
 SPDX-License-Identifier:GPL-2.0+
 
 We use the SPDX Unique Lincense Identifiers here; these are available
 at [2].
 
 Note: From the legal point of view, this patch is supposed to be only
 a change to the textual representation of the license information,
 but in no way any change to the actual license terms. With this patch
 applied, all files will still be licensed under the same terms they
 were before.

NVIDIA legal pointed out one potential issue with removing the license
headers from files, and simply pointing at a separate license file:

Some licenses include text that states that redistribution in source
forms requires the license text (or a list of conditions) to be
reproduced. Arguably, reproducing them in the separate license files
you've added to the Licenses directory covers this. However, there may
be a fine line here, and the complete answer may vary from license to
license depending on the exact wording.

Still, I don't think this issue was thought to apply to any of the
licenses that you've touched in this series, so we could simply defer
this discussion until it's thought to apply in practice, if that ever
happens.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Troy Kisky

On 7/15/2013 1:20 PM, Albert ARIBAUD wrote:

Hi Troy,

On Mon, 15 Jul 2013 10:39:54 -0700, Troy Kisky
troy.ki...@boundarydevices.com wrote:


Besides, Marek and I had in fact investigated barriers, adding some as
I did in times past in mvgbe.c, and fiddling with the one already in
dcache_flush_range(). None of this had any effect.

You tried adding a  dsb()  to dcache_flush_range()?
That should have fixed the problem as well.

There already was a memory barrier -- the only one kind known bu
ARM926J-S, which is a write buffer(s) drain -- and no, it should not
have fixed the problem (and did not), because the issue is not about
pushing the transactions out of the CPU soon enough; it is about having
the EMI perform them before it passes our 'go' command to the ENET DMA.


Thanks for straightening me out. My back just popped a couple of times.

Troy

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


Re: [U-Boot] [PATCH 6/7 v8] NAND: TPL : introduce the TPL based on the SPL

2013-07-15 Thread Scott Wood

On 07/15/2013 04:36:29 AM, ying.zh...@freescale.com wrote:

+ifdef CONFIG_TPL
+$(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin  
$(obj)spl/u-boot-tpl.bin \

+   $(obj)u-boot.bin
+   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
+   -I binary -O binary \
+			$(obj)spl/u-boot-spl.bin  
$(obj)spl/u-boot-spl-pad.bin

+   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
+   -I binary -O binary \
+			$(obj)spl/u-boot-tpl.bin  
$(obj)spl/u-boot-tpl-pad.bin
+		cat $(obj)spl/u-boot-spl-pad.bin  
$(obj)spl/u-boot-tpl-pad.bin \

+   $(obj)u-boot.bin  $@
+		rm $(obj)spl/u-boot-spl-pad.bin  
$(obj)spl/u-boot-tpl-pad.bin

+else
 $(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(CONFIG_SPL_PAD_TO) \
 			-I binary -O binary $  
$(obj)spl/u-boot-spl-pad.bin

cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin  $@
rm $(obj)spl/u-boot-spl-pad.bin
+endif


Are you sure CONFIG_SPL_PAD_TO will always be the same for both stages?

How about something like:

# $@ is output, $(1) and $(2) are inputs, $(3) is padded intermediate,  
$(4) is pad-to

SPL_PAD_APPEND = \
$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(4) -I binary -O  
binary \

$(1) $(obj)$(3); \
cat $(obj)$(3) $(obj)$(2)  $@; \
rm $(obj)$(3)

$(obj)u-boot-with-spl.bin: $(obj)spl/u-boot-spl.bin  
$(obj)tpl/u-boot-with-tpl.bin
$(call  
SPL_PAD_APPEND,$,u-boot-with-tpl.bin,spl/u-boot-spl-pad.bin,$(CONFIG_SPL_PAD_TO))


$(obj)u-boot-with-tpl.bin: $(obj)tpl/u-boot-tpl.bin $(obj)u-boot.bin
$(call  
SPL_PAD_APPEND,$,u-boot.bin,tpl/u-boot-tpl-pad.bin,$(CONFIG_TPL_PAD_TO))


@@ -621,7 +635,12 @@ $(obj)u-boot-nand.bin:	nand_spl  
$(obj)u-boot.bin
 		cat $(obj)nand_spl/u-boot-spl-16k.bin  
$(obj)u-boot.bin  $(obj)u-boot-nand.bin


 $(obj)spl/u-boot-spl.bin:  $(SUBDIR_TOOLS) depend
-   $(MAKE) -C spl all
+   $(MAKE) -C spl clean
+   $(MAKE) -C spl all CONFIG_SPL_BUILD=y
+
+$(obj)spl/u-boot-tpl.bin:  $(SUBDIR_TOOLS) depend
+   $(MAKE) -C spl clean
+   $(MAKE) -C spl all CONFIG_TPL_BUILD=y CONFIG_SPL_BUILD=y


This will break in a parallel build, among other problems.  Please use  
a separate tpl directory.



+ifeq ($(CONFIG_TPL_BUILD),y)
+LDFLAGS_u-boot-tpl += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+LDFLAGS_u-boot-tpl += -Ttext $(CONFIG_SPL_TEXT_BASE)
+endif
+else
+ifeq ($(CONFIG_SPL_BUILD),y)
 LDFLAGS_u-boot-spl += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
 ifneq ($(CONFIG_SPL_TEXT_BASE),)
 LDFLAGS_u-boot-spl += -Ttext $(CONFIG_SPL_TEXT_BASE)
 endif
+endif
+endif



Why do we need separate LDFLAGS for SPL and TPL?  It doesn't look like  
you define them any differently.  Can you use $(SPL_BIN) (a.k.a.  
$(FILENAME)) here?  Making sure to ifdef CONFIG_SPL_BUILD so that we  
don't define $(LDFLAGS_) in other contexts.



 # Linus' kernel sanity checking tool
 CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
diff --git a/doc/README.TPL b/doc/README.TPL
new file mode 100644
index 000..3056696
--- /dev/null
+++ b/doc/README.TPL
@@ -0,0 +1,71 @@
+Generic TPL framework
+=
+
+Overview
+
+
+TPL---Third Program Loader.
+
+Due to the SPL on some boards(powerpc mpc85xx) has a size limit and  
cannot
+be compatible with all the external device(e.g. DDR). So add a  
tertiary
+program loader (TPL) to enable a loader stub loaded by the code from  
the
+SPL. It loads the final uboot image into DDR, then jump to it to  
begin
+execution. Now, only the powerpc mpc85xx has this requirement and  
will

+implemente it.
+
+Keep consistent with SPL, with this framework almost all source  
files for a
+board can be reused. No code duplication or symlinking is necessary  
anymore.

+
+How it works
+
+
+There has been a directory TOPDIR/spl which contains only a  
Makefile. It is
+shared by SPL and TPL. By the way, TPL will share something with  
SPL, such

+as options defined in the board config files.
+
+The object files are built separately for SPL/TPL and placed in this
+directory. The final binaries which are generated are  
u-boot-{spl|tpl},

+u-boot-{spl|tpl}.bin and u-boot-{spl|tpl}.map.
+
+During the TPL build a variable named CONFIG_TPL_BUILD is exported  
in the
+make environment and also appended to CPPFLAGS with  
-DCONFIG_TPL_BUILD.
+Source files can be compiled for TPL with options choosed in the  
board

+config file, based on whether CONFIG_TPL_BUILD is set.
+
+For example:
+
+drivers/mtd/nand/Makefile:
+COBJS-$(CONFIG_SPL_NAND_INIT) += nand.o
+
+CONFIG_SPL_NAND_INIT is set in the include/configs/P1022DS.h:
+#ifdef CONFIG_TPL_BUILD
+#define CONFIG_SPL_NAND_INIT
+#endif
+
+The building of TPL images can be with:
+

Re: [U-Boot] [PATCH] arm:exynos:fix: Fix clock calculation for Exynos4210 based targets.

2013-07-15 Thread Simon Glass
On Fri, Jul 12, 2013 at 11:08 AM, Lukasz Majewski l.majew...@samsung.comwrote:

 Provide proper setting for the APLL fout frequency calculation for
 Exynos4 based targets (especially Exynos4210 - Trats board).


 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Cc: Minkyu Kang mk7.k...@samsung.com


This also fixes booting on snow.

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



 ---
  arch/arm/cpu/armv7/exynos/clock.c |9 -
  1 file changed, 4 insertions(+), 5 deletions(-)

 diff --git a/arch/arm/cpu/armv7/exynos/clock.c
 b/arch/arm/cpu/armv7/exynos/clock.c
 index 9f07181..5a5cfa1 100644
 --- a/arch/arm/cpu/armv7/exynos/clock.c
 +++ b/arch/arm/cpu/armv7/exynos/clock.c
 @@ -141,18 +141,17 @@ static int exynos_get_pll_clk(int pllreg, unsigned
 int r, unsigned int k)
 fout = (m + k / div) * (freq / (p * (1  s)));
 } else {
 /*
 -* Exynos4210
 +* Exynos4412 / Exynos5250
  * FOUT = MDIV * FIN / (PDIV * 2^SDIV)
  *
 -* Exynos4412 / Exynos5250
 +* Exynos4210
  * FOUT = MDIV * FIN / (PDIV * 2^(SDIV-1))
  */
 if (proid_is_exynos4210())
 -   fout = m * (freq / (p * (1  s)));
 -   else
 fout = m * (freq / (p * (1  (s - 1;
 +   else
 +   fout = m * (freq / (p * (1  s)));
 }
 -
 return fout;
  }

 --
 1.7.10.4

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

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


Re: [U-Boot] [PATCH] arm:samsung:trats:fix: Restore proper orientation of TRATS's LCD panel

2013-07-15 Thread Minkyu Kang
Dear Tom,

On 15/07/13 23:09, Lukasz Majewski wrote:
 Before setting: mipi_lcd_device.reverse_panel = 1, the Trats's LCD panel
 was flipped by 180 degrees.
 
 The flip was caused by following change:
 Exynos: Change get_timer() to work correctly
 SHA1: 3d00c0cb96ff93a929700b80d89cb905e5ab5315
 
 This commit fixed udelay(), which is necessary (due to HW LCD controller 
 oddity) for mipi-dsi correct operation. As a result the display orientation
 has been switched.
 
 As a follow up, the hwrevision() function has been removed, since it was
 used only in this particular place.
 
 Test HW: Trats Exynos4210 rev 0.
 
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 Cc: Minkyu Kang mk7.k...@samsung.com
 ---
  board/samsung/trats/trats.c |   10 +-
  1 file changed, 1 insertion(+), 9 deletions(-)
 

Acked-by: Minkyu Kang mk7.k...@samsung.com

Thanks,
Minkyu Kang.

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


Re: [U-Boot] [U-boot] uboot.lst file question

2013-07-15 Thread TigerLiu
Hi, Sittig:
Got it!
Thanks!

On Mon, Jul 15, 2013 at 15:33 +0200, Gerhard Sittig wrote:
 
 On Mon, Jul 15, 2013 at 19:26 +0800, tiger...@viatech.com.cn wrote:
  
  [ uboot.lst file, disassembler listing ]
 
 A quick search shows that there has not been such a feature in
 U-Boot as far as git can see (that's back to Nov 2002).  Neither
 has the binary gone under the 'uboot' or 'uboot.bin' names.

I was too quick.  There hasn't been a .lst file (or it was used
for unrelated purposes).  Although there is the u-boot.dis file,
has been since at least Nov 2002, and still is.  Does this help
you?


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Fabio Estevam
On Mon, Jul 15, 2013 at 12:09 PM, Hector Palacios
hector.palac...@digi.com wrote:

 @Fabio: could you manually run the command 'tftp ${loadaddr} file100M' in
 your EVK?

Yes, this is what I have been running since the beginning.

 If it doesn't fail, could you try running it again after playing with the
 environment (setting/printing some variables).

I can't reproduce the problem here.

 As I said, this issue appeared with different TFTP servers and is
 independent of whether the dcache is or not enabled.

Can you transfer from a PC to another PC via TFTP?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Fabio Estevam
On Tue, Jul 16, 2013 at 12:51 AM, Fabio Estevam feste...@gmail.com wrote:
 On Mon, Jul 15, 2013 at 12:09 PM, Hector Palacios
 hector.palac...@digi.com wrote:

 @Fabio: could you manually run the command 'tftp ${loadaddr} file100M' in
 your EVK?

 Yes, this is what I have been running since the beginning.

 If it doesn't fail, could you try running it again after playing with the
 environment (setting/printing some variables).

 I can't reproduce the problem here.

 As I said, this issue appeared with different TFTP servers and is
 independent of whether the dcache is or not enabled.

 Can you transfer from a PC to another PC via TFTP?

This is my tftp configuration for your reference:

$ cat /etc/xinetd.d/tftp
service tftp
{
protocol= udp
port= 69
socket_type = dgram
wait= yes
user= nobody
server  = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net: fec: Avoid MX28 bus sync issue

2013-07-15 Thread Marek Vasut
Dear Fabio Estevam,

 On Tue, Jul 16, 2013 at 12:51 AM, Fabio Estevam feste...@gmail.com wrote:
  On Mon, Jul 15, 2013 at 12:09 PM, Hector Palacios
  
  hector.palac...@digi.com wrote:
  @Fabio: could you manually run the command 'tftp ${loadaddr} file100M'
  in your EVK?
  
  Yes, this is what I have been running since the beginning.
  
  If it doesn't fail, could you try running it again after playing with
  the environment (setting/printing some variables).
  
  I can't reproduce the problem here.
  
  As I said, this issue appeared with different TFTP servers and is
  independent of whether the dcache is or not enabled.
  
  Can you transfer from a PC to another PC via TFTP?
 
 This is my tftp configuration for your reference:
 
 $ cat /etc/xinetd.d/tftp
 service tftp
 {
 protocol= udp
 port= 69
 socket_type = dgram
 wait= yes
 user= nobody
 server  = /usr/sbin/in.tftpd
 server_args = /tftpboot
 disable = no
 }

Another thing of interest would be a 'tcpdump' pcap capture of that connection.

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


[U-Boot] [PATCH v2] dfu, nand, ubi: add partubi alt settings for updating ubi partition

2013-07-15 Thread Heiko Schocher
updating an ubi partition needs a completely erased mtd partition,
see:
http://lists.infradead.org/pipermail/linux-mtd/2011-May/035416.html

So, add partubi alt setting for the dfu_alt_info environment
variable to mark this partition as an ubi partition. In case we
update an ubi partition, we erase after flashing the image into the
partition, the remaining sektors.

Signed-off-by: Heiko Schocher h...@denx.de
Cc: Pantelis Antoniou pa...@antoniou-consulting.com
Cc: Tom Rini tr...@ti.com
Cc: Lukasz Majewski l.majew...@samsung.com
Cc: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut ma...@denx.de
Cc: Wolfgang Denk w...@denx.de

---

- This patch is also a good starting point to fix up updating ubi, as
  we currently use nand erase for erasing the sektors. This is
  not the prefered way for writing an ubi image, see:
  http://www.linux-mtd.infradead.org/faq/ubi.html#L_flash_img

  This must be fixed ... we have no ubiformat in u-boot, or?

- changes for v2:
  - do not use spread = 1 for nand_erase_opts, to prevent
errormessage if there are bad blocks in the erase range.
---
 drivers/dfu/dfu.c  | 30 +-
 drivers/dfu/dfu_nand.c | 26 ++
 include/dfu.h  |  2 ++
 3 Dateien geändert, 57 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index 0521752..7ba7026 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -23,6 +23,7 @@
 #include errno.h
 #include malloc.h
 #include mmc.h
+#include nand.h
 #include fat.h
 #include dfu.h
 #include linux/list.h
@@ -176,6 +177,34 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int size, 
int blk_seq_num)
ret = dfu-flush_medium(dfu);
printf(\nDFU complete CRC32: 0x%08x\n, dfu-crc);
 
+   /* in case of ubi partition, erase rest of the partition */
+   if (dfu-ubi == 1) {
+   int ret;
+   nand_info_t *nand;
+   /* erase complete partition */
+   nand_erase_options_t opts;
+
+   if (nand_curr_device  0 ||
+   nand_curr_device = CONFIG_SYS_MAX_NAND_DEVICE ||
+   !nand_info[nand_curr_device].name) {
+   printf(%s: invalid nand device\n, __func__);
+   return -1;
+   }
+
+   nand = nand_info[nand_curr_device];
+
+   memset(opts, 0, sizeof(opts));
+   opts.offset = dfu-data.nand.start + dfu-offset +
+   dfu-bad_skip;
+   opts.length = dfu-data.nand.start +
+   dfu-data.nand.size - opts.offset;
+   ret = nand_erase_opts(nand, opts);
+   if (ret != 0) {
+   printf(Failure erase: %d\n, ret);
+   return ret;
+   }
+   }
+
/* clear everything */
dfu_free_buf();
dfu-crc = 0;
@@ -186,7 +215,6 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int size, 
int blk_seq_num)
dfu-i_buf = dfu-i_buf_start;
 
dfu-inited = 0;
-
}
 
return ret = 0 ? size : ret;
diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index 07dee89..d8afc48 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -153,6 +153,7 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s)
char *st;
int ret, dev, part;
 
+   dfu-ubi = 0;
dfu-dev_type = DFU_DEV_NAND;
st = strsep(s,  );
if (!strcmp(st, raw)) {
@@ -185,7 +186,32 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s)
 
dfu-data.nand.start = pi-offset;
dfu-data.nand.size = pi-size;
+   } else if (!strcmp(st, partubi)) {
+   char mtd_id[32];
+   struct mtd_device *mtd_dev;
+   u8 part_num;
+   struct part_info *pi;
+
+   dfu-layout = DFU_RAW_ADDR;
 
+   dev = simple_strtoul(s, s, 10);
+   s++;
+   part = simple_strtoul(s, s, 10);
+
+   sprintf(mtd_id, %s%d,%d, nand, dev, part - 1);
+   printf(using id '%s'\n, mtd_id);
+
+   mtdparts_init();
+
+   ret = find_dev_and_part(mtd_id, mtd_dev, part_num, pi);
+   if (ret != 0) {
+   printf(Could not locate '%s'\n, mtd_id);
+   return -1;
+   }
+
+   dfu-data.nand.start = pi-offset;
+   dfu-data.nand.size = pi-size;
+   dfu-ubi = 1;
} else {
printf(%s: Memory layout (%s) not supported!\n, __func__, st);
return -1;
diff --git a/include/dfu.h b/include/dfu.h
index 

Re: [U-Boot] [PATCH v2] dfu, nand, ubi: add partubi alt settings for updating ubi partition

2013-07-15 Thread Marek Vasut
Dear Heiko Schocher,

 updating an ubi partition needs a completely erased mtd partition,
 see:
 http://lists.infradead.org/pipermail/linux-mtd/2011-May/035416.html
 
 So, add partubi alt setting for the dfu_alt_info environment
 variable to mark this partition as an ubi partition. In case we
 update an ubi partition, we erase after flashing the image into the
 partition, the remaining sektors.
 
 Signed-off-by: Heiko Schocher h...@denx.de
 Cc: Pantelis Antoniou pa...@antoniou-consulting.com
 Cc: Tom Rini tr...@ti.com
 Cc: Lukasz Majewski l.majew...@samsung.com
 Cc: Kyungmin Park kyungmin.p...@samsung.com
 Cc: Marek Vasut ma...@denx.de
 Cc: Wolfgang Denk w...@denx.de
 
 ---
 
 - This patch is also a good starting point to fix up updating ubi, as
   we currently use nand erase for erasing the sektors. This is
   not the prefered way for writing an ubi image, see:
   http://www.linux-mtd.infradead.org/faq/ubi.html#L_flash_img
 
   This must be fixed ... we have no ubiformat in u-boot, or?
 
 - changes for v2:
   - do not use spread = 1 for nand_erase_opts, to prevent
 errormessage if there are bad blocks in the erase range.
 ---
  drivers/dfu/dfu.c  | 30 +-
  drivers/dfu/dfu_nand.c | 26 ++
  include/dfu.h  |  2 ++
  3 Dateien geändert, 57 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
 
 diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
 index 0521752..7ba7026 100644
 --- a/drivers/dfu/dfu.c
 +++ b/drivers/dfu/dfu.c
 @@ -23,6 +23,7 @@
  #include errno.h
  #include malloc.h
  #include mmc.h
 +#include nand.h
  #include fat.h
  #include dfu.h
  #include linux/list.h
 @@ -176,6 +177,34 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int
 size, int blk_seq_num) ret = dfu-flush_medium(dfu);
   printf(\nDFU complete CRC32: 0x%08x\n, dfu-crc);
 
 + /* in case of ubi partition, erase rest of the partition */
 + if (dfu-ubi == 1) {
 + int ret;
 + nand_info_t *nand;
 + /* erase complete partition */
 + nand_erase_options_t opts;
 +
 + if (nand_curr_device  0 ||
 + nand_curr_device = CONFIG_SYS_MAX_NAND_DEVICE ||
 + !nand_info[nand_curr_device].name) {
 + printf(%s: invalid nand device\n, __func__);
 + return -1;
 + }
 +
 + nand = nand_info[nand_curr_device];
 +
 + memset(opts, 0, sizeof(opts));
 + opts.offset = dfu-data.nand.start + dfu-offset +
 + dfu-bad_skip;
 + opts.length = dfu-data.nand.start +
 + dfu-data.nand.size - opts.offset;
 + ret = nand_erase_opts(nand, opts);
 + if (ret != 0) {
 + printf(Failure erase: %d\n, ret);
 + return ret;

Are you not leaking memory here ? I suspect you should call dfu_free_buf() as 
below ?

 + }
 + }
 +
   /* clear everything */
   dfu_free_buf();
   dfu-crc = 0;
 @@ -186,7 +215,6 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int
 size, int blk_seq_num) dfu-i_buf = dfu-i_buf_start;
 
   dfu-inited = 0;
 -
   }
 
   return ret = 0 ? size : ret;
 diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
 index 07dee89..d8afc48 100644
 --- a/drivers/dfu/dfu_nand.c
 +++ b/drivers/dfu/dfu_nand.c
 @@ -153,6 +153,7 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char
 *s) char *st;
   int ret, dev, part;
 
 + dfu-ubi = 0;
   dfu-dev_type = DFU_DEV_NAND;
   st = strsep(s,  );
   if (!strcmp(st, raw)) {
 @@ -185,7 +186,32 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char
 *s)
 
   dfu-data.nand.start = pi-offset;
   dfu-data.nand.size = pi-size;
 + } else if (!strcmp(st, partubi)) {
 + char mtd_id[32];
 + struct mtd_device *mtd_dev;
 + u8 part_num;
 + struct part_info *pi;
 +
 + dfu-layout = DFU_RAW_ADDR;
 
 + dev = simple_strtoul(s, s, 10);
 + s++;
 + part = simple_strtoul(s, s, 10);
 +
 + sprintf(mtd_id, %s%d,%d, nand, dev, part - 1);
 + printf(using id '%s'\n, mtd_id);
 +
 + mtdparts_init();
 +
 + ret = find_dev_and_part(mtd_id, mtd_dev, part_num, pi);
 + if (ret != 0) {
 + printf(Could not locate '%s'\n, mtd_id);
 + return -1;
 + }
 +
 + dfu-data.nand.start = pi-offset;
 + dfu-data.nand.size = pi-size;
 + dfu-ubi = 1;
   } else {
   printf(%s: Memory layout (%s) not supported!\n, __func__, st);
  

Re: [U-Boot] [PATCH v2] dfu, nand, ubi: add partubi alt settings for updating ubi partition

2013-07-15 Thread Heiko Schocher

Hello Marek,

Am 16.07.2013 07:00, schrieb Marek Vasut:

Dear Heiko Schocher,


updating an ubi partition needs a completely erased mtd partition,
see:
http://lists.infradead.org/pipermail/linux-mtd/2011-May/035416.html

So, add partubi alt setting for the dfu_alt_info environment
variable to mark this partition as an ubi partition. In case we
update an ubi partition, we erase after flashing the image into the
partition, the remaining sektors.

Signed-off-by: Heiko Schocherh...@denx.de
Cc: Pantelis Antonioupa...@antoniou-consulting.com
Cc: Tom Rinitr...@ti.com
Cc: Lukasz Majewskil.majew...@samsung.com
Cc: Kyungmin Parkkyungmin.p...@samsung.com
Cc: Marek Vasutma...@denx.de
Cc: Wolfgang Denkw...@denx.de

---

- This patch is also a good starting point to fix up updating ubi, as
   we currently use nand erase for erasing the sektors. This is
   not the prefered way for writing an ubi image, see:
   http://www.linux-mtd.infradead.org/faq/ubi.html#L_flash_img

   This must be fixed ... we have no ubiformat in u-boot, or?

- changes for v2:
   - do not use spread = 1 for nand_erase_opts, to prevent
 errormessage if there are bad blocks in the erase range.
---
  drivers/dfu/dfu.c  | 30 +-
  drivers/dfu/dfu_nand.c | 26 ++
  include/dfu.h  |  2 ++
  3 Dateien geändert, 57 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index 0521752..7ba7026 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -23,6 +23,7 @@
  #includeerrno.h
  #includemalloc.h
  #includemmc.h
+#includenand.h
  #includefat.h
  #includedfu.h
  #includelinux/list.h
@@ -176,6 +177,34 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int
size, int blk_seq_num) ret = dfu-flush_medium(dfu);
printf(\nDFU complete CRC32: 0x%08x\n, dfu-crc);

+   /* in case of ubi partition, erase rest of the partition */
+   if (dfu-ubi == 1) {
+   int ret;
+   nand_info_t *nand;
+   /* erase complete partition */
+   nand_erase_options_t opts;
+
+   if (nand_curr_device  0 ||
+   nand_curr_device= CONFIG_SYS_MAX_NAND_DEVICE ||
+   !nand_info[nand_curr_device].name) {
+   printf(%s: invalid nand device\n, __func__);
+   return -1;
+   }
+
+   nand =nand_info[nand_curr_device];
+
+   memset(opts, 0, sizeof(opts));
+   opts.offset = dfu-data.nand.start + dfu-offset +
+   dfu-bad_skip;
+   opts.length = dfu-data.nand.start +
+   dfu-data.nand.size - opts.offset;
+   ret = nand_erase_opts(nand,opts);
+   if (ret != 0) {
+   printf(Failure erase: %d\n, ret);
+   return ret;


Are you not leaking memory here ? I suspect you should call dfu_free_buf() as
below ?


Yes, fixed. Thanks!

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