Re: [U-Boot] [PATCH 1/6] powerpc/corenet_ds: Update README.srio-boot-corenet

2012-08-06 Thread Liu Gang
Hi Andy,

It's so long time those patches resided in open source, and there are no
any comments.

http://patchwork.ozlabs.org/patch/163499/

So could you please help to apply them?

Following are some descriptions for this set of patches excerpt from the
e-mail sent to you at June 1.

"
..

Now I finished the function based your comment and add the new module of
boot from PCIE.
Right now we just need to build master image for boot from SRIO and PCIE
with normal configuration, for example with:
P4080DS_config
And then just need to set the environment "bootmaster" to "SRIO1' or
"PCIE1".

For slave image boot from SRIO and PCIE, just need one build target:
P4080DS_SRIO_PCIE_BOOT_config

Overall, we now just need one special build configuration
"P4080DS_SRIO_PCIE_BOOT_config"
for both boot from SRIO and PCIE.
..
"

Thanks a lot!


On Thu, 2012-06-07 at 14:43 +0800, Liu Gang wrote:
> Update some descriptions due to the implementation changes:
> 
> For master:
>   Get rid of the SRIOBOOT_MASTER build target, and to support
>   for serving as a SRIO boot master via environment variable.
> For slave:
>   1. When compile the slave image for boot from SRIO, no longer
>  need to specify which SRIO port it will boot from.
>   2. All slave's cores should be in hold off.
> 
> Signed-off-by: Liu Gang 
> ---
>  doc/README.srio-boot-corenet |   70 
> --
>  1 files changed, 33 insertions(+), 37 deletions(-)


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


Re: [U-Boot] [PATCH] mkconfig: fix failure on boards that don't define soc

2012-08-06 Thread Albert ARIBAUD
Hi Allen,

On Mon, 6 Aug 2012 17:07:25 -0700, Allen Martin  wrote:
> On Mon, Aug 06, 2012 at 05:04:28PM -0700, Allen Martin wrote:
> > Fix a configure failure on boards that don't define soc.  The exit
> > status of the subshell was propogating up and causing mkconfig to
> > fail.  Add an explicit exit 0 to the subshell to fix this.
> > 
> > Signed-off-by: Allen Martin 
> 
> I ran a full MAKEALL -a arm on a system where I reproduced the failure
> on jornada previously and it ran clean.
> 
> 
> -Allen

Sorry, Allen, missed this. I'd rather have this fix directly corrected in the
original tegra/master commit so that bisecting remains feasible around this.
 
Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] pull request for u-boot-tegra/master

2012-08-06 Thread Albert ARIBAUD
Hi Allen,

On Mon, 6 Aug 2012 15:46:22 -0700, Allen Martin  wrote:
> > > -Original Message-
> > > From: Albert ARIBAUD [mailto:albert.u.b...@aribaud.net]
> > > Sent: Sunday, August 05, 2012 1:01 PM
> > > To: Albert ARIBAUD
> > > Cc: Tom Warren; si...@theia.denx.de; u-boot@lists.denx.de; Stephen Warren;
> > > Tom Warren
> > > Subject: Re: [U-Boot] pull request for u-boot-tegra/master
> > > 
> > > Hi Albert,
> > > 
> > > On Sun, 5 Aug 2012 21:46:21 +0200, Albert ARIBAUD
> > >  wrote:
> > > > Hi Tom,
> > > >
> > > > On Fri, 3 Aug 2012 16:35:40 -0700, Tom Warren 
> > > wrote:
> > > > > Albert,
> > > > >
> > > > > Has this been pulled into ARM master? I don't think I saw a response
> > > > > from you, but I might have missed it.
> > > >
> > > > Sorry Tom, but I have been unavailable for some time and especially on
> > > > jul 30 and 31, so no, it has not been pulled in. :(
> > > >
> > > > I am pulling it in right now, but I have sparse access to Internet right
> > > now.
> > > 
> > > Seems like f414d013c5e129e66c04ff699bd60b34894d3d38 breaks a lot of builds
> > > with the stock Ubuntu linaro toolchain, e.g.
> > > 
> > > 
> > > --
> > > 
> > > $ ./MAKEALL jornada
> > > Configuring for jornada board...
> > > make: *** [jornada_config] Error 1
> > > arm-linux-gnueabi-size: './u-boot': No such file
> > > make: *** No rule to make target `include/autoconf.mk', needed by 
> > > `depend'.
> > > Stop.
> > > make: *** Waiting for unfinished jobs
> > > 
> 
> I think I found the problem.  For some reason I don't fully understand
> when a board doesn't have ${soc} defined the following code in mkconfig:
> 
> ( echo "ARCH   = ${arch}"
> if [ ! -z "$spl_cpu" ] ; then
> echo 'ifeq ($(CONFIG_SPL_BUILD),y)'
> echo "CPU= ${spl_cpu}"
> echo "else"
> echo "CPU= ${cpu}"
> echo "endif"
> else
> echo "CPU= ${cpu}"
> fi
> echo "BOARD  = ${board}"
> 
> [ "${vendor}" ] && echo "VENDOR = ${vendor}"
> [ "${soc}"] && echo "SOC= ${soc}" ) > config.mk
> 
> causes the subshell to return a nonzero exit status.  I think the
> behavior may change depending on what shell you have /bin/sh pointing
> to.  Can you try out the following fix to verify?  I'll put together a
> proper patch in the mean time
> 
> diff --git a/mkconfig b/mkconfig
> index 07031c6..d3363c6 100755
> --- a/mkconfig
> +++ b/mkconfig
> @@ -144,7 +144,8 @@ fi
>  echo "BOARD  = ${board}"
> 
>  [ "${vendor}" ] && echo "VENDOR = ${vendor}"
> -[ "${soc}"] && echo "SOC= ${soc}" ) > config.mk
> +[ "${soc}"] && echo "SOC= ${soc}"
> +exit 0 ) > config.mk
> 
>  # Assign board directory to BOARDIR variable
>  if [ -z "${vendor}" ] ; then

Seems to work with this fix applied on top of the current tegra/master.

Tom, can you fix the branch so that the original commit (f414d013...) contains
the fix above, rather than just adding the fix on top of the branch? That'll
help any bisecting through this branch's commits.

Also, Allen:
 
> ---
> This email message is for the sole use of the intended recipient(s) and may 
> contain
> confidential information.  Any unauthorized review, use, disclosure or 
> distribution
> is prohibited.  If you are not the intended recipient, please contact the 
> sender by
> reply email and destroy all copies of the original message.
> ---

Can this be removed from future e-mails to the list?

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


Re: [U-Boot] [PATCH] input: key_matrix: fix header inclusion

2012-08-06 Thread Michal Simek

On 08/06/2012 07:56 PM, Simon Glass wrote:

On Thu, Aug 2, 2012 at 1:49 PM, Stephan Linz  wrote:

On Microblaze with device tree support enabled we run into
the error below.

I'm not sure, but I think that all source code should include
at least the common.h and just this fix the problem on
Microblaz architecture.

The error is:

In file included from key_matrix.c:29:
include/malloc.h:364: error: conflicting types for 'memset'
include/linux/string.h:71: error: previous declaration of 'memset' was here
include/malloc.h:365: error: conflicting types for 'memcpy'
include/linux/string.h:74: error: previous declaration of 'memcpy' was here

Signed-off-by: Stephan Linz 
CC: Bernie Thompson 
CC: Simon Glass 
CC: Tom Warren 
CC: Michal Simek 


Acked-by: Simon Glass 


Acked-by: Michal Simek 


Thanks,
Michal

--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [QUESTION] "ethaddr" env. var. vs. dev->enetaddr

2012-08-06 Thread Rob Herring
On 08/06/2012 07:49 PM, Fabio Estevam wrote:
> On Mon, Aug 6, 2012 at 8:40 PM, Mike Frysinger  wrote:
> 
>> there was a patch floating around for setting up ethaddr env var 
>> automatically
>> in the net core during init if it wasn't already set
> 
> I guess you are referring to this one:
> http://patchwork.ozlabs.org/patch/136789/

Or perhaps the one from me which is in mainline now.

Rob

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

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


[U-Boot] [PATCH 2/2] tegra: convert gpio_config_uart to weak symbol

2012-08-06 Thread Lucas Stach
Most boards don't need this fixup hook. To avoid a lot of empty
implementations in board files convert it to a weak symbol.

Signed-off-by: Lucas Stach 
CC: Stephen Warren 
CC: Tom Warren 
---
 board/avionic-design/common/tamonten.c | 7 ---
 board/compal/paz00/paz00.c | 7 ---
 board/compulab/trimslice/trimslice.c   | 7 ---
 board/nvidia/common/board.c| 5 +
 board/nvidia/harmony/harmony.c | 7 ---
 board/nvidia/whistler/whistler.c   | 7 ---
 6 Dateien geändert, 5 Zeilen hinzugefügt(+), 35 Zeilen entfernt(-)

diff --git a/board/avionic-design/common/tamonten.c 
b/board/avionic-design/common/tamonten.c
index a0a4d1d..f5e6f6d 100644
--- a/board/avionic-design/common/tamonten.c
+++ b/board/avionic-design/common/tamonten.c
@@ -41,13 +41,6 @@
 #include 
 #endif
 
-/*
- * Routine: gpio_config_uart
- * Description: Does nothing on Tamonten - no conflict w/SPI.
- */
-void gpio_config_uart(void)
-{
-}
 
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 void gpio_early_init(void)
diff --git a/board/compal/paz00/paz00.c b/board/compal/paz00/paz00.c
index cd684f2..59cf41b 100644
--- a/board/compal/paz00/paz00.c
+++ b/board/compal/paz00/paz00.c
@@ -24,13 +24,6 @@
 #include 
 #endif
 
-/*
- * Routine: gpio_config_uart
- * Description: Does nothing on Paz00 - no conflict w/SPI.
- */
-void gpio_config_uart(void)
-{
-}
 
 #ifdef CONFIG_TEGRA_MMC
 /*
diff --git a/board/compulab/trimslice/trimslice.c 
b/board/compulab/trimslice/trimslice.c
index 5dae15b..f6de19e 100644
--- a/board/compulab/trimslice/trimslice.c
+++ b/board/compulab/trimslice/trimslice.c
@@ -34,13 +34,6 @@
 #include 
 #endif
 
-/*
- * Routine: gpio_config_uart
- * Description: Does nothing on TrimSlice - no UART-related GPIOs.
- */
-void gpio_config_uart(void)
-{
-}
 
 void pin_mux_spi(void)
 {
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 3bd4ff1..c4304ac 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -72,6 +72,11 @@ void __pin_mux_spi(void)
 
 void pin_mux_spi(void) __attribute__((weak, alias("__pin_mux_spi")));
 
+void __gpio_config_uart(void)
+{
+}
+
+void gpio_config_uart(void) __attribute__((weak, alias("__gpio_config_uart")));
 /*
  * Routine: power_det_init
  * Description: turn off power detects
diff --git a/board/nvidia/harmony/harmony.c b/board/nvidia/harmony/harmony.c
index 44977c7..5b75230 100644
--- a/board/nvidia/harmony/harmony.c
+++ b/board/nvidia/harmony/harmony.c
@@ -33,13 +33,6 @@
 #include 
 #endif
 
-/*
- * Routine: gpio_config_uart
- * Description: Does nothing on Harmony - no conflict w/SPI.
- */
-void gpio_config_uart(void)
-{
-}
 
 #ifdef CONFIG_TEGRA_MMC
 /*
diff --git a/board/nvidia/whistler/whistler.c b/board/nvidia/whistler/whistler.c
index c0a114d..cad7c48 100644
--- a/board/nvidia/whistler/whistler.c
+++ b/board/nvidia/whistler/whistler.c
@@ -34,13 +34,6 @@
 #include 
 #endif
 
-/*
- * Routine: gpio_config_uart
- * Description: Does nothing on Whistler - no UART-related GPIOs.
- */
-void gpio_config_uart(void)
-{
-}
 
 /*
  * Routine: pin_mux_mmc
-- 
1.7.11.2

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


[U-Boot] [PATCH 1/2] tegra: init MMC from common board init

2012-08-06 Thread Lucas Stach
Signed-off-by: Lucas Stach 
CC: Stephen Warren 
CC: Tom Warren 
---
 board/nvidia/common/board.c | 4 
 1 Datei geändert, 4 Zeilen hinzugefügt(+)

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 7ab2040..3bd4ff1 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -132,6 +132,10 @@ int board_init(void)
board_usb_init(gd->fdt_blob);
 #endif
 
+#ifdef CONFIG_TEGRA_MMC
+   board_mmc_init(gd->fdt_blob);
+#endif
+
 #ifdef CONFIG_TEGRA20_LP0
/* save Sdram params to PMC 2, 4, and 24 for WB0 */
warmboot_save_sdram_params();
-- 
1.7.11.2

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


Re: [U-Boot] [QUESTION] "ethaddr" env. var. vs. dev->enetaddr

2012-08-06 Thread Fabio Estevam
On Mon, Aug 6, 2012 at 8:40 PM, Mike Frysinger  wrote:

> there was a patch floating around for setting up ethaddr env var automatically
> in the net core during init if it wasn't already set

I guess you are referring to this one:
http://patchwork.ozlabs.org/patch/136789/

Regards,

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


Re: [U-Boot] [QUESTION] "ethaddr" env. var. vs. dev->enetaddr

2012-08-06 Thread Benoît Thébaudeau
Hi Joe,

On Tue, Aug 7, 2012 at 12:45:58 AM, Joe Hershberger wrote:
> Hi Benoît,
> 
> On Mon, Aug 6, 2012 at 2:02 PM, Benoît Thébaudeau
>  wrote:
> > Hi all,
> >
> > There's a lot of stuff in U-Boot relying on ethaddr being set, e.g.
> > the bdinfo
> > command, or the linklocal command because of seed_mac. If ethaddr
> > is not set,
> > bdinfo will report exactly that, but linklocal will wait
> > indefinitely without
> > displaying anything.
> 
> This sounds like a problem to be fixed one way or another.

OK.

> > The issue is that dev->enetaddr may be set even if ethaddr is not,
> > e.g. through
> > imx_get_mac_from_fuse. eth_write_hwaddr uses a valid ethaddr to
> > override an
> > already set dev->enetaddr, but it does not require ethaddr to be
> > set.
> 
> You should get a warning from u-boot that it is using the
> dev->enetaddr since the ethaddr is missing.

Yes, or a fallback ethaddr could be automatically set to dev->enetaddr like Mike
said.

> > Hence, shouldn't the users of ethaddr rather use dev->enetaddr, or
> > is ethaddr
> > really supposed to be required (bug or feature)?
> 
> Because of the logic that prevents dev->enetaddr set from hardware to
> override ethaddr (since ethaddr should always be the source of the
> MAC
> in all but exceptional cases), it seems to me that using ethaddr is
> correct.  Perhaps in the case of bdinfo, it could explicitly say that
> ethaddr is not set, and if dev->enetaddr is in use, it could also
> print that.

No, Mike is correct.

> In the case of linklocal, it is difficult to decide.  I don't think
> we
> want linklocal seeding its IP addresses with a random MAC address.  I
> think we want to fix this bug by warning and giving up or warning and
> seeding with 0 (the algorithm can still work this way, just not as
> well).

If ethaddr is automatically set, this solves this issue by the way.

The current code seeds with 0, which results in rand_r returning 0, so that
timeout_ms also gets 0, and the mechanism is broken.

> > If ethaddr is required, should it be up to the boards to set if for
> > cases like
> > imx_get_mac_from_fuse, or should eth_write_hwaddr set it
> > automatically if
> > dev->enetaddr is valid but ethaddr is unset or invalid?
> 
> If specific boards may have their MAC stored elsewhere (like
> imx_get_mac_from_fuse()), then it's probably OK for that board's call
> to update the ethaddr if it isn't set.  In fact it seems like
> fec_probe() in drivers/net/fec_mxc.c should not be changing
> edev->enetaddr.  It should setenv("ethaddr,...), but only if it is
> not
> set.

According to point 3 in doc/README.enetaddr, the current behavior of fec_probe()
is correct since it refers to "the driver initialized struct
eth_device->enetaddr". The priority given by eth_write_hwaddr() to ethaddr
against dev->enetaddr would also not make sense if that were not correct.

> eth_write_hwaddr() should not write it.

Why? This is what Mike was talking about. I don't find the patch Mike refers to.
However, I see an issue if eth_write_hwaddr() sets a fallback ethaddr from a
valid dev->enetaddr: depending on the config, ethaddr may be set only once, so
that will be one less move for the end user. But we can also consider that if
the MAC address has been set by any means (fuses, EEPROM, etc.), it is
equivalent to having set ethaddr once, so that could be correct. Mike, what do
you think about that?

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


[U-Boot] [PATCH] tegra20: add back USE_PRIVATE_LIBGCC

2012-08-06 Thread Lucas Stach
As discussed here [http://patchwork.ozlabs.org/patch/158202/] we want to
use USE_PRIVATE_LIBGCC still.

However commit 5286f1ce dropped it regardless. Adding this back fixes a
hang while handing over from SPL to U-Boot on Colibri T20.

Signed-off-by: Lucas Stach 
CC: Stephen Warren 
CC: Tom Warren 
---
 arch/arm/cpu/armv7/tegra20/config.mk | 2 ++
 1 Datei geändert, 2 Zeilen hinzugefügt(+)

diff --git a/arch/arm/cpu/armv7/tegra20/config.mk 
b/arch/arm/cpu/armv7/tegra20/config.mk
index 6432e75..e666f6b 100644
--- a/arch/arm/cpu/armv7/tegra20/config.mk
+++ b/arch/arm/cpu/armv7/tegra20/config.mk
@@ -23,4 +23,6 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
+USE_PRIVATE_LIBGCC = yes
+
 CONFIG_ARCH_DEVICE_TREE := tegra20
-- 
1.7.11.2

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


Re: [U-Boot] [PATCH] mkconfig: fix failure on boards that don't define soc

2012-08-06 Thread Mike Frysinger
Acked-by: Mike Frysinger 
-mike


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


Re: [U-Boot] [PATCH] mkconfig: fix failure on boards that don't define soc

2012-08-06 Thread Allen Martin
On Mon, Aug 06, 2012 at 05:04:28PM -0700, Allen Martin wrote:
> Fix a configure failure on boards that don't define soc.  The exit
> status of the subshell was propogating up and causing mkconfig to
> fail.  Add an explicit exit 0 to the subshell to fix this.
> 
> Signed-off-by: Allen Martin 

I ran a full MAKEALL -a arm on a system where I reproduced the failure
on jornada previously and it ran clean.


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


[U-Boot] [PATCH] mkconfig: fix failure on boards that don't define soc

2012-08-06 Thread Allen Martin
Fix a configure failure on boards that don't define soc.  The exit
status of the subshell was propogating up and causing mkconfig to
fail.  Add an explicit exit 0 to the subshell to fix this.

Signed-off-by: Allen Martin 
---
 mkconfig |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mkconfig b/mkconfig
index 07031c6..d3363c6 100755
--- a/mkconfig
+++ b/mkconfig
@@ -144,7 +144,8 @@ fi
 echo "BOARD  = ${board}"
 
 [ "${vendor}" ] && echo "VENDOR = ${vendor}"
-[ "${soc}"] && echo "SOC= ${soc}" ) > config.mk
+[ "${soc}"] && echo "SOC= ${soc}"
+exit 0 ) > config.mk
 
 # Assign board directory to BOARDIR variable
 if [ -z "${vendor}" ] ; then
-- 
1.7.9.5

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


[U-Boot] [PATCH 3/3] nds32: fix unused pmu_init warning

2012-08-06 Thread Mike Frysinger
Fixes the build-time warning:
board.c: At top level:
board.c:106: warning: 'pmu_init' defined but not used

This makes the ifdef logic at the call site match the logic at the
function definition.

Signed-off-by: Mike Frysinger 
---
 arch/nds32/lib/board.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index f5de266..2164a50 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -103,6 +103,7 @@ static int nds32_pci_init(void)
 #endif /* CONFIG_CMD_PCI || CONFIG_PCI */
 
 #if defined(CONFIG_PMU) || defined(CONFIG_PCU)
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 static int pmu_init(void)
 {
 #if defined(CONFIG_FTPMU010_POWER)
@@ -115,6 +116,7 @@ static int pmu_init(void)
return 0;
 }
 #endif
+#endif
 
 /*
  * Breathe some life into the board...
-- 
1.7.9.7

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


[U-Boot] [PATCH 1/3] nds32: drop bi_enetaddr from global data

2012-08-06 Thread Mike Frysinger
Nothing is using this, so punt it from the gd.  Seems to just be a copy
& paste wart from the initial port.

Signed-off-by: Mike Frysinger 
---
 arch/nds32/include/asm/u-boot.h |1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/nds32/include/asm/u-boot.h b/arch/nds32/include/asm/u-boot.h
index eabbf38..b533fea 100644
--- a/arch/nds32/include/asm/u-boot.h
+++ b/arch/nds32/include/asm/u-boot.h
@@ -40,7 +40,6 @@
 
 typedef struct bd_info {
int bi_baudrate;/* serial console baudrate */
-   unsigned char   bi_enetaddr[6]; /* Ethernet adress */
unsigned long   bi_arch_number; /* unique id for this board */
unsigned long   bi_boot_params; /* where this board expects params */
unsigned long   bi_memstart;/* start of DRAM memory */
-- 
1.7.9.7

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


[U-Boot] [PATCH 2/3] nds32: delete unused local variable

2012-08-06 Thread Mike Frysinger
Fixes the build-time warning:
board.c: In function 'board_init_r':
board.c:304: warning: unused variable 's'

Signed-off-by: Mike Frysinger 
---
 arch/nds32/lib/board.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index 7121313..f5de266 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -301,7 +301,6 @@ void board_init_f(ulong bootflag)
  */
 void board_init_r(gd_t *id, ulong dest_addr)
 {
-   char *s;
bd_t *bd;
ulong malloc_start;
 
-- 
1.7.9.7

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


Re: [U-Boot] [QUESTION] "ethaddr" env. var. vs. dev->enetaddr

2012-08-06 Thread Mike Frysinger
On Monday 06 August 2012 18:45:58 Joe Hershberger wrote:
> On Mon, Aug 6, 2012 at 2:02 PM, Benoît Thébaudeau wrote:
> > There's a lot of stuff in U-Boot relying on ethaddr being set, e.g. the
> > bdinfo command, or the linklocal command because of seed_mac. If ethaddr
> > is not set, bdinfo will report exactly that, but linklocal will wait
> > indefinitely without displaying anything.
> 
> This sounds like a problem to be fixed one way or another.

there was a patch floating around for setting up ethaddr env var automatically 
in the net core during init if it wasn't already set

> > Hence, shouldn't the users of ethaddr rather use dev->enetaddr, or is
> > ethaddr really supposed to be required (bug or feature)?
> 
> Because of the logic that prevents dev->enetaddr set from hardware to
> override ethaddr (since ethaddr should always be the source of the MAC
> in all but exceptional cases), it seems to me that using ethaddr is
> correct.  Perhaps in the case of bdinfo, it could explicitly say that
> ethaddr is not set, and if dev->enetaddr is in use, it could also
> print that.

no, nothing outside of the net layer should ever touch dev->enetaddr.  this is 
clearly documented in doc/README.enetaddr.
-mike


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


Re: [U-Boot] Testing report for i.MX51 using Linaro/Ubuntu gcc 4.6.3 (from Precise repositories), libgcc, etc.

2012-08-06 Thread Michael Hope
Hi Matt.  Let me know if you find a fault in the compiler and we'll
fix it.  A common problem is bare metal projects turning on strict
alignment fault checking in the hardware (bit 1 of SCTLR on the A9)
which causes a data fault on unaligned access.  See [1] for more.

You might try our pre-built binaries[2].  The Linux version runs on
anything RHEL 5 or later and includes both a ARMv7 and a very
compatible ARMv4T runtime.

-- Michael
[1] http://seabright.co.nz/2012/06/11/kernel-not-booting-with-linaro-gcc/
[2] https://launchpad.net/linaro-toolchain-binaries
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] pull request for u-boot-tegra/master

2012-08-06 Thread Allen Martin
> > -Original Message-
> > From: Albert ARIBAUD [mailto:albert.u.b...@aribaud.net]
> > Sent: Sunday, August 05, 2012 1:01 PM
> > To: Albert ARIBAUD
> > Cc: Tom Warren; si...@theia.denx.de; u-boot@lists.denx.de; Stephen Warren;
> > Tom Warren
> > Subject: Re: [U-Boot] pull request for u-boot-tegra/master
> > 
> > Hi Albert,
> > 
> > On Sun, 5 Aug 2012 21:46:21 +0200, Albert ARIBAUD
> >  wrote:
> > > Hi Tom,
> > >
> > > On Fri, 3 Aug 2012 16:35:40 -0700, Tom Warren 
> > wrote:
> > > > Albert,
> > > >
> > > > Has this been pulled into ARM master? I don't think I saw a response
> > > > from you, but I might have missed it.
> > >
> > > Sorry Tom, but I have been unavailable for some time and especially on
> > > jul 30 and 31, so no, it has not been pulled in. :(
> > >
> > > I am pulling it in right now, but I have sparse access to Internet right
> > now.
> > 
> > Seems like f414d013c5e129e66c04ff699bd60b34894d3d38 breaks a lot of builds
> > with the stock Ubuntu linaro toolchain, e.g.
> > 
> > 
> > --
> > 
> > $ ./MAKEALL jornada
> > Configuring for jornada board...
> > make: *** [jornada_config] Error 1
> > arm-linux-gnueabi-size: './u-boot': No such file
> > make: *** No rule to make target `include/autoconf.mk', needed by `depend'.
> > Stop.
> > make: *** Waiting for unfinished jobs
> > 

I think I found the problem.  For some reason I don't fully understand
when a board doesn't have ${soc} defined the following code in mkconfig:

( echo "ARCH   = ${arch}"
if [ ! -z "$spl_cpu" ] ; then
echo 'ifeq ($(CONFIG_SPL_BUILD),y)'
echo "CPU= ${spl_cpu}"
echo "else"
echo "CPU= ${cpu}"
echo "endif"
else
echo "CPU= ${cpu}"
fi
echo "BOARD  = ${board}"

[ "${vendor}" ] && echo "VENDOR = ${vendor}"
[ "${soc}"] && echo "SOC= ${soc}" ) > config.mk

causes the subshell to return a nonzero exit status.  I think the
behavior may change depending on what shell you have /bin/sh pointing
to.  Can you try out the following fix to verify?  I'll put together a
proper patch in the mean time

diff --git a/mkconfig b/mkconfig
index 07031c6..d3363c6 100755
--- a/mkconfig
+++ b/mkconfig
@@ -144,7 +144,8 @@ fi
 echo "BOARD  = ${board}"

 [ "${vendor}" ] && echo "VENDOR = ${vendor}"
-[ "${soc}"] && echo "SOC= ${soc}" ) > config.mk
+[ "${soc}"] && echo "SOC= ${soc}"
+exit 0 ) > config.mk

 # Assign board directory to BOARDIR variable
 if [ -z "${vendor}" ] ; then

---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [QUESTION] "ethaddr" env. var. vs. dev->enetaddr

2012-08-06 Thread Joe Hershberger
Hi Benoît,

On Mon, Aug 6, 2012 at 2:02 PM, Benoît Thébaudeau
 wrote:
> Hi all,
>
> There's a lot of stuff in U-Boot relying on ethaddr being set, e.g. the bdinfo
> command, or the linklocal command because of seed_mac. If ethaddr is not set,
> bdinfo will report exactly that, but linklocal will wait indefinitely without
> displaying anything.

This sounds like a problem to be fixed one way or another.

> The issue is that dev->enetaddr may be set even if ethaddr is not, e.g. 
> through
> imx_get_mac_from_fuse. eth_write_hwaddr uses a valid ethaddr to override an
> already set dev->enetaddr, but it does not require ethaddr to be set.

You should get a warning from u-boot that it is using the
dev->enetaddr since the ethaddr is missing.

> Hence, shouldn't the users of ethaddr rather use dev->enetaddr, or is ethaddr
> really supposed to be required (bug or feature)?

Because of the logic that prevents dev->enetaddr set from hardware to
override ethaddr (since ethaddr should always be the source of the MAC
in all but exceptional cases), it seems to me that using ethaddr is
correct.  Perhaps in the case of bdinfo, it could explicitly say that
ethaddr is not set, and if dev->enetaddr is in use, it could also
print that.

In the case of linklocal, it is difficult to decide.  I don't think we
want linklocal seeding its IP addresses with a random MAC address.  I
think we want to fix this bug by warning and giving up or warning and
seeding with 0 (the algorithm can still work this way, just not as
well).

> If ethaddr is required, should it be up to the boards to set if for cases like
> imx_get_mac_from_fuse, or should eth_write_hwaddr set it automatically if
> dev->enetaddr is valid but ethaddr is unset or invalid?

If specific boards may have their MAC stored elsewhere (like
imx_get_mac_from_fuse()), then it's probably OK for that board's call
to update the ethaddr if it isn't set.  In fact it seems like
fec_probe() in drivers/net/fec_mxc.c should not be changing
edev->enetaddr.  It should setenv("ethaddr,...), but only if it is not
set.

eth_write_hwaddr() should not write it.

> Best regards,
> Benoît
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/2] MX28: Shuffle around the power management code

2012-08-06 Thread Marek Vasut
Move some function calls to a more appropriate place, so they're
called only when needed.

Signed-off-by: Marek Vasut 
Cc: Stefano Babic 
Cc: Fabio Estevam 
---
 arch/arm/cpu/arm926ejs/mx28/spl_power_init.c |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c 
b/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c
index 4b09b0c..e06e6d6 100644
--- a/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c
+++ b/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c
@@ -657,17 +657,14 @@ void mx28_power_configure_power_source(void)
 
mx28_src_power_init();
 
-   batt_ready = mx28_is_batt_ready();
-
if (readl(&power_regs->hw_power_sts) & POWER_STS_VDD5V_GT_VDDIO) {
-   batt_good = mx28_is_batt_good();
+   batt_ready = mx28_is_batt_ready();
if (batt_ready) {
/* 5V source detected, good battery detected. */
mx28_batt_boot();
} else {
-   if (batt_good) {
-   /* 5V source detected, low battery detceted. */
-   } else {
+   batt_good = mx28_is_batt_good();
+   if (!batt_good) {
/* 5V source detected, bad battery detected. */
writel(LRADC_CONVERSION_AUTOMATIC,
&lradc_regs->hw_lradc_conversion_clr);
-- 
1.7.10.4

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


[U-Boot] [PATCH 1/2] MX28: Drop the cp15 reconfiguration from SPL

2012-08-06 Thread Marek Vasut
The SPL doesn't need the CP15 reconfiguration, as that's what the
BootROM does for us already. Moreover, when the CP15 is reconfigured
and the code returns control to BootROM, the USB boot works no more.

Remove the code and allow [1] to work properly as well.

[1] http://git.bfuser.eu/?p=marex/mxsldr.git;a=summary

Signed-off-by: Marek Vasut 
Cc: Stefano Babic 
Cc: Fabio Estevam 
---
 arch/arm/cpu/arm926ejs/mx28/start.S |   42 ---
 1 file changed, 42 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/mx28/start.S 
b/arch/arm/cpu/arm926ejs/mx28/start.S
index e572b78..7ccd337 100644
--- a/arch/arm/cpu/arm926ejs/mx28/start.S
+++ b/arch/arm/cpu/arm926ejs/mx28/start.S
@@ -180,14 +180,6 @@ _reset:
orr r0,r0,#0xd3
msr cpsr,r0
 
-   /*
-* we do sys-critical inits only at reboot,
-* not when booting from ram!
-*/
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
-   bl  cpu_init_crit
-#endif
-
bl  board_init_ll
 
/*
@@ -207,40 +199,6 @@ _reset:
pop {r0-r12,r14}
bx  lr
 
-/*
- *
- *
- * CPU_init_critical registers
- *
- * setup important registers
- * setup memory timing
- *
- *
- */
-#ifndef CONFIG_SKIP_LOWLEVEL_INIT
-cpu_init_crit:
-   /*
-* flush v4 I/D caches
-*/
-   mov r0, #0
-   mcr p15, 0, r0, c7, c7, 0   /* flush v3/v4 cache */
-   mcr p15, 0, r0, c8, c7, 0   /* flush v4 TLB */
-
-   /*
-* disable MMU stuff and caches
-*/
-   mrc p15, 0, r0, c1, c0, 0
-   bic r0, r0, #0x2300 /* clear bits 13, 9:8 (--V- --RS) */
-   bic r0, r0, #0x0087 /* clear bits 7, 2:0 (B--- -CAM) */
-   orr r0, r0, #0x0002 /* set bit 2 (A) Align */
-   orr r0, r0, #0x1000 /* set bit 12 (I) I-Cache */
-   mcr p15, 0, r0, c1, c0, 0
-
-   mov pc, lr  /* back to my caller */
-
-   .align  5
-#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
-
 _hang:
ldr sp, _TEXT_BASE  /* switch to abort stack */
 1:
-- 
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 1/4] MX28: Fix up the MMC driver DMA mode

2012-08-06 Thread Marek Vasut
Dear Marek Vasut,

> The DMA mode didn't properly configure the DMA_ENABLE bit in CTRL1.
> Also, it was using SSP0 DMA channel for all SSP devices.
> 
> Signed-off-by: Marek Vasut 
> Cc: Wolfgang Denk 
> Cc: Stefano Babic 
> Cc: Fabio Estevam 
> Cc: Andy Fleming 

Stefano, can you please apply these? They fix trouble and improve the platform 
and I ain't getting no reply from Andy and they shouldn't colide with anything 
in his tree.

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


Re: [U-Boot] [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

2012-08-06 Thread Ilya Yanok
Hi Tom,

On Tue, Aug 7, 2012 at 12:52 AM, Tom Rini  wrote:

> > By comparing of two images I've found that the difference comes from
> > ro-strings (two help strings in U_BOOT_CMD, string in printf, "sw" &
> "hw").
> > It looks like the linker doesn't collect ro-strings referenced from
> > collected functions... Probably that's a bug but I'm not sure...
>
> Yes.  What I meant was that not all of the stuff that is guarded today
> is garbage collected so the resulting image is larger than it must be.
>

Yep. And that's actually goes beyond the subject of this patch: as long as
we rely on linker GC and not putting guards by hands we will get unused
string literals compiled in.

I still think that this patch does the correct things (UNDEF_SYM is there
to protect commands from GC and we don't really want commands in SPL so
there is nothing to protect). But I will try to add guards to make net-spl
compile even without this patch.


> And yes, this is a toolchain issue of sorts (not being aggressive enough
> in collecting unreferenced data).
>

Looks like it can be fixed by forcing the compiler to emit symbols for
string literals... But I'm not really compiler guy...

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


Re: [U-Boot] [PATCH v2] fdt: Include arch specific gpio.h instead of asm-generic/gpio.h

2012-08-06 Thread Simon Glass
Him

On Mon, Aug 6, 2012 at 12:37 AM, Michal Simek  wrote:
> On 07/19/2012 12:56 AM, Mike Frysinger wrote:
>>
>> Acked-by: Mike Frysinger
>
>
> Simon: Are you OK with this patch?

Yes, thanks.

Acked-by: Simon Glass 

>
> Thanks,
> Michal
>
>
> --
> Michal Simek, Ing. (M.Eng)
> w: www.monstr.eu p: +42-0-721842854
> Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
> Microblaze U-BOOT custodian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

2012-08-06 Thread Tom Rini
On Mon, Aug 06, 2012 at 11:15:25PM +0400, Ilya Yanok wrote:
> Hi Tom,
> 
> On Mon, Aug 6, 2012 at 9:10 PM, Tom Rini  wrote:
> 
> >
> > OK, installed and it's still larger with this change than without and
> > it's not garbage collecting and dropping commands if I un-guard the
> > nandecc command for example.  Tested with omap3_beagle.
> >
> 
> Did some testing as well.
[snip]
> My interpretation: first two builds are equal, that's to be expected as in
> mainline U-Boot all command definitions are carefully guarded so remove
> undef patch has no effect at all. You said in your testing patched version
> produced bigger image... Probably you patched it by hand without commiting
> and got "-dirty" difference? (I did so initially ;) )

That would be it, yes :)

> Next, when we unguard the command we definitely get bigger image... But the
> code is not here:
> 
> $ arm-linux-gnueabi-nm ../out/undef+nandecc/spl/u-boot-spl |grep
> do_switch_ecc
> $
> 
> By comparing of two images I've found that the difference comes from
> ro-strings (two help strings in U_BOOT_CMD, string in printf, "sw" & "hw").
> It looks like the linker doesn't collect ro-strings referenced from
> collected functions... Probably that's a bug but I'm not sure...

Yes.  What I meant was that not all of the stuff that is guarded today
is garbage collected so the resulting image is larger than it must be.
And yes, this is a toolchain issue of sorts (not being aggressive enough
in collecting unreferenced data).

> 
> Regards, Ilya.

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


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


Re: [U-Boot] [PATCH v5 0/7] dfu:usb: DFU support via USB Download gadget

2012-08-06 Thread Marek Vasut
Dear Lukasz Majewski,

> Those patches add support for composite USB download gadget.
> This gadget (at least for now) is equipped with DFU download function.
> 
> A separate DFU back-end and front-end have been added.
> Back-end is placed at ./drivers/dfu directory. The front-end is implemented
> as USB function.
> 
> The back-end is written in a generic manner with storage device specific
> code separated (eMMC).
> 
> DFU specification can be found at:
> http://wiki.openmoko.org/wiki/USB_DFU_-_The_USB_Device_Firmware_Upgrade_sta
> ndard
[...]

Applied the series and pushed to u-boot-usb ... now guys, please do final 
rounds 
of tests etc. so I can submit pullRQ.

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


Re: [U-Boot] [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

2012-08-06 Thread Ilya Yanok
Hi Tom,

On Mon, Aug 6, 2012 at 9:10 PM, Tom Rini  wrote:

>
> OK, installed and it's still larger with this change than without and
> it's not garbage collecting and dropping commands if I un-guard the
> nandecc command for example.  Tested with omap3_beagle.
>

Did some testing as well.

master branch, omap3_beagle config. Trying clean master, master + remove
undef patch, master + remove undef patch + un-guard nandecc & master +
un-guard nandecc.

Here is my results:

$ ls -l ../out/master/spl/u-boot-spl.bin
-rwxrwxr-x 1 ilya ilya 44692 Aug  6 21:57 ../out/master/spl/u-boot-spl.bin
$ ls -l ../out/undef/spl/u-boot-spl.bin
-rwxrwxr-x 1 ilya ilya 44692 Aug  6 21:52 ../out/undef/spl/u-boot-spl.bin
$ ls -l ../out/undef+nandecc/spl/u-boot-spl.bin
-rwxrwxr-x 1 ilya ilya 44844 Aug  6 21:53
../out/undef+nandecc/spl/u-boot-spl.bin

(and master + un-guard ecc actually failed to build with:
$ ./MAKEALL omap3_beagle
Configuring for omap3_beagle board...
make[1]: *** [/work/u-boot/spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl.bin] Error 2
   text   databssdechexfilename
 326458   8460 266904 601822  92ede./u-boot
arch/arm/cpu/armv7/omap3/libomap3.o: In function `do_switch_ecc':
/work/u-boot/arch/arm/cpu/armv7/omap3/board.c:312: undefined reference to
`omap_nand_switch_ecc'
/work/u-boot/arch/arm/cpu/armv7/omap3/board.c:314: undefined reference to
`omap_nand_switch_ecc'
make[1]: *** [/work/u-boot/spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl.bin] Error 2

which shows that without remove undef patch do_switch_ecc() function is
preserved while with this patch it's garbage collected).

My interpretation: first two builds are equal, that's to be expected as in
mainline U-Boot all command definitions are carefully guarded so remove
undef patch has no effect at all. You said in your testing patched version
produced bigger image... Probably you patched it by hand without commiting
and got "-dirty" difference? (I did so initially ;) )
Next, when we unguard the command we definitely get bigger image... But the
code is not here:

$ arm-linux-gnueabi-nm ../out/undef+nandecc/spl/u-boot-spl |grep
do_switch_ecc
$

By comparing of two images I've found that the difference comes from
ro-strings (two help strings in U_BOOT_CMD, string in printf, "sw" & "hw").
It looks like the linker doesn't collect ro-strings referenced from
collected functions... Probably that's a bug but I'm not sure...

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


[U-Boot] [QUESTION] "ethaddr" env. var. vs. dev->enetaddr

2012-08-06 Thread Benoît Thébaudeau
Hi all,

There's a lot of stuff in U-Boot relying on ethaddr being set, e.g. the bdinfo
command, or the linklocal command because of seed_mac. If ethaddr is not set,
bdinfo will report exactly that, but linklocal will wait indefinitely without
displaying anything.

The issue is that dev->enetaddr may be set even if ethaddr is not, e.g. through
imx_get_mac_from_fuse. eth_write_hwaddr uses a valid ethaddr to override an
already set dev->enetaddr, but it does not require ethaddr to be set.

Hence, shouldn't the users of ethaddr rather use dev->enetaddr, or is ethaddr
really supposed to be required (bug or feature)?

If ethaddr is required, should it be up to the boards to set if for cases like
imx_get_mac_from_fuse, or should eth_write_hwaddr set it automatically if
dev->enetaddr is valid but ethaddr is unset or invalid?

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


[U-Boot] [PATCH] am33xx: Remove redundant timer config

2012-08-06 Thread Tom Rini
We have the timer code in arch/arm/cpu/armv7/omap-common/timer.c that
has been configuring and enabling the timer, so remove our code that
does the same thing by different methods.

Tested on EVM GP, SK-EVM and Beaglebone.

Signed-off-by: Tom Rini 
---
 arch/arm/cpu/armv7/am33xx/board.c |   20 
 1 file changed, 20 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index 2ca4ca7..5b00719 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -37,7 +37,6 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE;
-struct gptimer *timer_base = (struct gptimer *)CONFIG_SYS_TIMERBASE;
 struct uart_sys *uart_base = (struct uart_sys *)DEFAULT_UART_BASE;
 
 static const struct gpio_bank gpio_bank_am33xx[4] = {
@@ -119,22 +118,6 @@ static int read_eeprom(void)
 #define UART_SMART_IDLE_EN (0x1 << 0x3)
 #endif
 
-#ifdef CONFIG_SPL_BUILD
-/* Initialize timer */
-static void init_timer(void)
-{
-   /* Reset the Timer */
-   writel(0x2, (&timer_base->tscir));
-
-   /* Wait until the reset is done */
-   while (readl(&timer_base->tiocp_cfg) & 1)
-   ;
-
-   /* Start the Timer */
-   writel(0x1, (&timer_base->tclr));
-}
-#endif
-
 /*
  * Determine what type of DDR we have.
  */
@@ -183,9 +166,6 @@ void s_init(void)
regVal |= UART_SMART_IDLE_EN;
writel(regVal, &uart_base->uartsyscfg);
 
-   /* Initialize the Timer */
-   init_timer();
-
preloader_console_init();
 
/* Initalize the board header */
-- 
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 V4 4/4] ARM: add Raspberry Pi model B board, using BCM2835 SoC

2012-08-06 Thread Tom Rini
On Sun, Aug 05, 2012 at 08:07:22PM -0600, Stephen Warren wrote:
> The Raspberry Pi model B uses the BCM2835 SoC, has 256MB of RAM,
> contains an SMSC 9512 USB LAN/Hub chip, and various IO connectors.
> For more details, see http://www.raspberrypi.org/.
> 
> Various portions (cache enable, MACH_TYPE setup, RAM size limit, stack
> relocation to top of RAM) extracted from work by:
> Oleksandr Tymoshenko .
> 
> GPIO driver enablement by Vikram Narayanan .
> 
> Signed-off-by: Stephen Warren 

Thanks for cycling over the series again.

Acked-by: Tom Rini 

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


Re: [U-Boot] [PATCH] input: key_matrix: fix header inclusion

2012-08-06 Thread Simon Glass
On Thu, Aug 2, 2012 at 1:49 PM, Stephan Linz  wrote:
> On Microblaze with device tree support enabled we run into
> the error below.
>
> I'm not sure, but I think that all source code should include
> at least the common.h and just this fix the problem on
> Microblaz architecture.
>
> The error is:
>
> In file included from key_matrix.c:29:
> include/malloc.h:364: error: conflicting types for 'memset'
> include/linux/string.h:71: error: previous declaration of 'memset' was here
> include/malloc.h:365: error: conflicting types for 'memcpy'
> include/linux/string.h:74: error: previous declaration of 'memcpy' was here
>
> Signed-off-by: Stephan Linz 
> CC: Bernie Thompson 
> CC: Simon Glass 
> CC: Tom Warren 
> CC: Michal Simek 

Acked-by: Simon Glass 

> ---
>  drivers/input/key_matrix.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/input/key_matrix.c b/drivers/input/key_matrix.c
> index 84b898f..715e57a 100644
> --- a/drivers/input/key_matrix.c
> +++ b/drivers/input/key_matrix.c
> @@ -23,6 +23,7 @@
>   * MA 02111-1307 USA
>   */
>
> +#include 
>  #include 
>  #include 
>  #include 
> --
> 1.7.0.4
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v6] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Markus Hubig
This adds support for the AT91SAM9G20 boards by taskit GmbH.
Both boards, Stamp9G20 and PortuxG20, are integrated in one
file. PortuxG20 is basically a SBC built around the Stamp9G20.

Signed-off-by: Markus Hubig 
Cc: Andreas Bießmann 
---
Changes for v2:
- Added myself to the MAINTAINERS file.
- Fixed a missleading comments.
- Removed "Enable EMAC clock".
- Enabled the at91sam9 hw watchdog.
- Adding a timeout to PHY reset.
- Uses the generic CONFIG_MACH_TYPE in stamp9g20.h.
- Removed "mem=64M" from basicargs, its set by ATAGS.
- Increased the space for the linux kernel to 6Mb.
- Removed the "#ifdef CONFIG_MACB" switches.
- Removed all tailing whitespaces in comments.
- Removed CONFIG_USART3 its not used any more.
- CONFIG_SYS_BAUDRATE_TABLE is now generic.
- Removed the nowhere referenced CONFIG_STACKSIZE.
- Removed the unessasary IRQ stuff.
- Removed  CONFIG_RESET_PHY_R & reset_phy().

Changes for v3:
- Moved all board specifig stuff into one block.
- Fixed error in boards.cfg.
- Added some comments about the PC5 and PC9 pins.
- Making networking support configurable again.
- Added autoload and autoboot to EXTRA_ENV_SETTINGS.
- Fixed some minor issues with the timeout function.
- Enabled CONFIG_CMD_SOURCE again.

Changes for v4:
- Fixed some trailing whitespace style errors.
- Enabled the STATUS_LED framework.
- Fixed the URSTEN handling while PHY reset.

Changes for v5:
- Enables the PIOA clock in coloured_LED_init.
- Fixes some typos.
- Fixes some 'parentheses' compiler warnings.
- Unifies the calculations to use shifting '<<'.
- Removes the obsolete CONFIG_ARCH_CPU_INIT.
- Removes unused variable.
- Fixes MAINTAINERS manipulation.

Changes for v6:
- Removes my dup from MAINTAINERS. ARGH!

 MAINTAINERS|4 +
 board/taskit/stamp9g20/Makefile|   53 +++
 board/taskit/stamp9g20/led.c   |  138 +++
 board/taskit/stamp9g20/stamp9g20.c |  191 ++
 boards.cfg |2 +
 include/configs/stamp9g20.h|  266 
 6 files changed, 654 insertions(+), 0 deletions(-)
 create mode 100644 board/taskit/stamp9g20/Makefile
 create mode 100644 board/taskit/stamp9g20/led.c
 create mode 100644 board/taskit/stamp9g20/stamp9g20.c
 create mode 100644 include/configs/stamp9g20.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 84413de..8ae9274 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -681,6 +681,10 @@ Vaibhav Hiremath 
 
am3517_evm  ARM ARMV7 (AM35x SoC)
 
+Markus Hubig 
+
+   STAMP9G20   ARM926EJS
+
 Grazvydas Ignotas 
 
omap3_pandora   ARM ARMV7 (OMAP3xx SoC)
diff --git a/board/taskit/stamp9g20/Makefile b/board/taskit/stamp9g20/Makefile
new file mode 100644
index 000..4f17a27
--- /dev/null
+++ b/board/taskit/stamp9g20/Makefile
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop 
+# Lead Tech Design 
+#
+# (C) Copyright 2012
+# Markus Hubig 
+# IMKO GmbH 
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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-y+= stamp9g20.o
+COBJS-y+= led.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/taskit/stamp9g20/led.c b/board/taskit/stamp9g20/led.c
new file mode 100644
index 000..197b4da
--- /dev/null
+++ b/board/taskit/stamp9g20/led.c
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2009 Wind River Systems, Inc.
+ * Tom Rix 
+ * (C) Copyright 2009
+ * Eric Benard 
+ *
+ *

Re: [U-Boot] pull request for u-boot-tegra/master

2012-08-06 Thread Allen Martin
On Mon, Aug 06, 2012 at 08:53:42AM -0700, Tom Warren wrote:
> > Seems like f414d013c5e129e66c04ff699bd60b34894d3d38 breaks a lot of builds
> > with the stock Ubuntu linaro toolchain, e.g.
> > 
> > 
> > --
> > 
> > $ ./MAKEALL jornada
> > Configuring for jornada board...
> > make: *** [jornada_config] Error 1
> > arm-linux-gnueabi-size: './u-boot': No such file
> > make: *** No rule to make target `include/autoconf.mk', needed by `depend'.
> > Stop.
> > make: *** Waiting for unfinished jobs
> > 
> > - SUMMARY  Boards compiled:
> > 1 Boards with warnings but no errors: 1 ( jornada )
> > --
> > 
> > 
> > --
> > 
> > The .MAKELOG is empty and the .ERR says:
> > 
> > 
> > --
> > make: *** No rule to make target `include/autoconf.mk', needed by `depend'.
> > Sto p.
> > make: *** Waiting for unfinished jobs
> > 
> > --
> 
> Here's my log using linaro 4.6.2 on my Ubuntu 10.04LTS dev system:
> 
> $ arm-linux-gnueabi-gcc --version
> arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.6.2-14ubuntu2~ppa1) 4.6.2
> Copyright (C) 2011 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> $ printenv CROSS_COMPILE
> arm-linux-gnueabi-
> 
> $ ./MAKEALL jornada
> Configuring for jornada board...
>text  data bss dec hex filename
>  131282  27244596  138602   21d6a ./u-boot
> 
> - SUMMARY 
> Boards compiled: 1
> --
> $ 
> 
> I don't see the same warning - in fact it builds fine. I always run an ARM 
> MAKEALL before submitting a pull request, using my default (4.4.1) toolchain.
> 
> Allen did the SPL work - adding him for comment.
> 

I'm trying to reproduce now.  f414d013c5e129e66c04ff699bd60b34894d3d38
only changes the generation of include/config.mk.  When it fails does
include/config.mk get generated and does it look correct?

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


[U-Boot] [PATCH v5] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Markus Hubig
This adds support for the AT91SAM9G20 boards by taskit GmbH.
Both boards, Stamp9G20 and PortuxG20, are integrated in one
file. PortuxG20 is basically a SBC built around the Stamp9G20.

Signed-off-by: Markus Hubig 
Cc: Andreas Bießmann 
---
Changes for v2:
- Added myself to the MAINTAINERS file.
- Fixed a missleading comments.
- Removed "Enable EMAC clock".
- Enabled the at91sam9 hw watchdog.
- Adding a timeout to PHY reset.
- Uses the generic CONFIG_MACH_TYPE in stamp9g20.h.
- Removed "mem=64M" from basicargs, its set by ATAGS.
- Increased the space for the linux kernel to 6Mb.
- Removed the "#ifdef CONFIG_MACB" switches.
- Removed all tailing whitespaces in comments.
- Removed CONFIG_USART3 its not used any more.
- CONFIG_SYS_BAUDRATE_TABLE is now generic.
- Removed the nowhere referenced CONFIG_STACKSIZE.
- Removed the unessasary IRQ stuff.
- Removed  CONFIG_RESET_PHY_R & reset_phy().

Changes for v3:
- Moved all board specifig stuff into one block.
- Fixed error in boards.cfg.
- Added some comments about the PC5 and PC9 pins.
- Making networking support configurable again.
- Added autoload and autoboot to EXTRA_ENV_SETTINGS.
- Fixed some minor issues with the timeout function.
- Enabled CONFIG_CMD_SOURCE again.

Changes for v4:
- Fixed some trailing whitespace style errors.
- Enabled the STATUS_LED framework.
- Fixed the URSTEN handling while PHY reset.

Changes for v5:
- Enables the PIOA clock in coloured_LED_init.
- Fixes some typos.
- Fixes some 'parentheses' compiler warnings.
- Unifies the calculations to use shifting '<<'.
- Removes the obsolete CONFIG_ARCH_CPU_INIT.
- Removes unused variable.
- Fixes MAINTAINERS manipulation.

 MAINTAINERS|8 +
 board/taskit/stamp9g20/Makefile|   53 +++
 board/taskit/stamp9g20/led.c   |  138 +++
 board/taskit/stamp9g20/stamp9g20.c |  191 ++
 boards.cfg |2 +
 include/configs/stamp9g20.h|  266 
 6 files changed, 658 insertions(+), 0 deletions(-)
 create mode 100644 board/taskit/stamp9g20/Makefile
 create mode 100644 board/taskit/stamp9g20/led.c
 create mode 100644 board/taskit/stamp9g20/stamp9g20.c
 create mode 100644 include/configs/stamp9g20.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 84413de..1c090db 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -243,6 +243,10 @@ Klaus Heydeck 
KUP4K   MPC855
KUP4X   MPC859
 
+Markus Hubig 
+
+   STAMP9G20   ARM926EJS
+
 Ilko Iliev 
 
PM9261  AT91SAM9261
@@ -681,6 +685,10 @@ Vaibhav Hiremath 
 
am3517_evm  ARM ARMV7 (AM35x SoC)
 
+Markus Hubig 
+
+   STAMP9G20   ARM926EJS
+
 Grazvydas Ignotas 
 
omap3_pandora   ARM ARMV7 (OMAP3xx SoC)
diff --git a/board/taskit/stamp9g20/Makefile b/board/taskit/stamp9g20/Makefile
new file mode 100644
index 000..4f17a27
--- /dev/null
+++ b/board/taskit/stamp9g20/Makefile
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop 
+# Lead Tech Design 
+#
+# (C) Copyright 2012
+# Markus Hubig 
+# IMKO GmbH 
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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-y+= stamp9g20.o
+COBJS-y+= led.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/taskit/stamp9g20/led.c b/board/taskit/stamp9g20/led.c
new file mode 100644
index 000..197b4da
--- /dev/null
+++ b/board/taskit/stamp9g2

Re: [U-Boot] [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

2012-08-06 Thread Tom Rini
On Mon, Aug 6, 2012 at 8:31 AM, Ilya Yanok
 wrote:
> On Mon, Aug 6, 2012 at 7:30 PM, Tom Rini  wrote:
>
>> On 08/06/2012 08:10 AM, Ilya Yanok wrote:
>> > Hi Tom,
>> >
>> > On Mon, Aug 6, 2012 at 2:36 AM, Tom Rini > > > wrote:
>> >
>> > On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
>> > > > > wrote:
>> > > __u_boot_cmd* symbols are not used in SPL so there is no need
>> > > to tell the linker that they are undefined. With these symbols
>> > > marked as undefined linker fails to garbage collect some unused
>> > > functions and even fails to build the resulting image.
>> >
>> > I don't like this because it causes SPL to bloat when the commands
>> > aren't also removed from the build.  But I assume a number of
>> commands
>> >
>> >
>> > Nah. As far as I understand it,  UNDEF_SYM stuff is there to protect
>> > commands from being purged by linker garbage collector. This is needed
>> > for main U-Boot as commands are referenced inderectly.
>> > I seems to me that this stuff was just copy-pasted into SPL Makefile. As
>> > far as we don't need commands in SPL we don't care about them being
>> > garbage collected (well, actually we want them to be collected). So it
>> > has nothing to do about bloating, actually SPL image is smaller with
>> > this patch applied.
>>
>> What toolchain are you using?  In my tests they have not been collected.
>>
>
> ELDK 5.2

OK, installed and it's still larger with this change than without and
it's not garbage collecting and dropping commands if I un-guard the
nandecc command for example.  Tested with omap3_beagle.

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


Re: [U-Boot] [PATCH v4] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Markus Hubig
On Mon, Aug 06, 2012 at 03:01:40PM +0200, Andreas Bießmann wrote:
> On 06.08.2012 11:11, Markus Hubig wrote:
> >
> > +static unsigned int saved_state[3] = {STATUS_LED_OFF,
> > +   STATUS_LED_OFF, STATUS_LED_OFF};
> > +
> > +void coloured_LED_init(void)
> > +{
> > +   /* Clock is enabled in board_early_init_f() */
> 
> But coloured_LED_init() is called way before!
> 
> Beware, this coloured LED stuff is sometimes used for very early debug
> purposes. To get this working you will need to switch the clocks here.
> 
> If you not insist on this colour LED framework I would appreciate to not
> add this coloured_LED_init for the stamp9g20 but use the status LED
> framework -> README.LED

Are you shure about this? Is I just remove this and put the 

> > +   at91_set_gpio_output(CONFIG_RED_LED, 1);
> > +   at91_set_gpio_output(CONFIG_GREEN_LED, 1);
> > +   at91_set_gpio_output(CONFIG_YELLOW_LED, 1);

in __led_init() I have no LED's at all and the commandlie tool 'led'
stopps working... At all the Status LED stuff is a bit confusing ...

- It's not clear to me if the STATUS_LED_BIT should be e.g. 1 or
  e.g. AT91_PIN_PC5.

- It's not clear what the benefit of using this is.

- It's not clear if the coloured_LED stuff is part of it or something
  extra.

Maybe it's better is I just switch on the green LED in board_init?

For now I just switched the clock on in coloured_LED_init. At least I
have some LED now.

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


Re: [U-Boot] U-boot not finding NAND chip on imx28EVK - Gives DMA read error

2012-08-06 Thread Bill

Thanks.  That did it - grabbed recent version and it works.

Best,
Bill


On 8/6/2012 10:34 AM, Fabio Estevam wrote:

Bill,

On Mon, Aug 6, 2012 at 11:34 AM, Bill  wrote:

All,

I enabled my U-boot for NAND support for my imx28EVK and I get the
following error when U-Boot starts:


NAND:  MXS NAND: Error sending command
MXS NAND: Error sending command
MXS NAND: DMA read error
MXS NAND: DMA read error
MXS NAND: Error sending command
...

 I am using U-boot version  U-Boot 2012.07-rc1.   I also have the NAND
support enabled in /include/configs/mx28evk.h  by adding  CONFIG_CMD_NAND.
 The NAND chip I am using is:  Micron  MT29F1G08ABADA.

I have just tried the most recent u-boot-imx git, enabled
CONFIG_CMD_NAND in the mx28evk.h and the NAND is detected fine:

U-Boot 2012.07-08388-g9ce4714-dirty (Aug 06 2012 - 12:26:16)

CPU:   Freescale i.MX28 rev1.2 at 454 MHz
BOOT:  SSP SD/MMC #0, 3V3
I2C:   ready
DRAM:  128 MiB
NAND:  2048 MiB
MMC:   MXS MMC: 0
In:serial
Out:   serial
Err:   serial
Net:   FEC0, FEC1
Hit any key to stop autoboot:  0

MX28EVK U-Boot>  nand info

Device 0: nand0, sector size 256 KiB
   Page size  2048 b
   OOB size 64 b
   Erase size   262144 b
MX28EVK U-Boot>

The NAND I am using is K9LAG08U0M.

Regards,

Fabio Estevam


--
William (Bill) L. Sousan, Ph.D.
(w) 402.331.4977 ext. 4002
bsou...@techsi.com
Technical Support Inc.
11253 John Galt Blvd
Omaha, NE 68137
www.techsi.com
8(a) SDB Certified, ISO 9001:2008


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


Re: [U-Boot] [PATCH] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Markus Hubig
On Mon, Aug 06, 2012 at 02:49:51PM +0200, Andreas Bießmann wrote:
> On 02.08.2012 16:14, Markus Hubig wrote:
> > On Wed, Aug 01, 2012 at 11:58:22AM +0200, Andreas Bießmann wrote:
> >> On 30.07.12 20:01, Markus Hubig wrote:
> > 
> > PC9 is somewhat strange. If I set it to 0 I don't have a console!
> 
> can you please ask at taskit what function this pin has and document it
> here?

I'm already waiting for an aswer ...

> > So I tried to put both
> > 
> > | at91_set_gpio_output(AT91_PIN_PC9, 1);
> > | at91_seriald_hw_init();
> > 
> > into board_early_init_f() to avoid the strange characters at boot time,
> > but again no console output ...
> > 
> > Further tests showed that It seems that I can't use at91_set_gpio_output()
> > inside board_early_init_f(). Switching on the red LED with PC5 also do not
> > work in board_early_init_f() ...
> > 
> > Any ideas?
> 
> Not currently. Maybe the PC9 has some vital functionality for UART to
> work (some switch, power, ...) and is reset by another part running
> after board_early_init_f()?

But how can I reset this PIN without using 'AT91_PIN_PC9'? I'm grep'ed all
over the source code but don't find nothing! Is there another way of setting
the PIO pins?

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


Re: [U-Boot] pull request for u-boot-tegra/master

2012-08-06 Thread Tom Warren
Albert,

> -Original Message-
> From: Albert ARIBAUD [mailto:albert.u.b...@aribaud.net]
> Sent: Sunday, August 05, 2012 1:01 PM
> To: Albert ARIBAUD
> Cc: Tom Warren; si...@theia.denx.de; u-boot@lists.denx.de; Stephen Warren;
> Tom Warren
> Subject: Re: [U-Boot] pull request for u-boot-tegra/master
> 
> Hi Albert,
> 
> On Sun, 5 Aug 2012 21:46:21 +0200, Albert ARIBAUD
>  wrote:
> > Hi Tom,
> >
> > On Fri, 3 Aug 2012 16:35:40 -0700, Tom Warren 
> wrote:
> > > Albert,
> > >
> > > Has this been pulled into ARM master? I don't think I saw a response
> > > from you, but I might have missed it.
> >
> > Sorry Tom, but I have been unavailable for some time and especially on
> > jul 30 and 31, so no, it has not been pulled in. :(
> >
> > I am pulling it in right now, but I have sparse access to Internet right
> now.
> 
> Seems like f414d013c5e129e66c04ff699bd60b34894d3d38 breaks a lot of builds
> with the stock Ubuntu linaro toolchain, e.g.
> 
> 
> --
> 
> $ ./MAKEALL jornada
> Configuring for jornada board...
> make: *** [jornada_config] Error 1
> arm-linux-gnueabi-size: './u-boot': No such file
> make: *** No rule to make target `include/autoconf.mk', needed by `depend'.
> Stop.
> make: *** Waiting for unfinished jobs
> 
> - SUMMARY  Boards compiled:
> 1 Boards with warnings but no errors: 1 ( jornada )
> --
> 
> 
> --
> 
> The .MAKELOG is empty and the .ERR says:
> 
> 
> --
> make: *** No rule to make target `include/autoconf.mk', needed by `depend'.
> Sto p.
> make: *** Waiting for unfinished jobs
> 
> --

Here's my log using linaro 4.6.2 on my Ubuntu 10.04LTS dev system:

$ arm-linux-gnueabi-gcc --version
arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.6.2-14ubuntu2~ppa1) 4.6.2
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ printenv CROSS_COMPILE
arm-linux-gnueabi-

$ ./MAKEALL jornada
Configuring for jornada board...
   textdata bss dec hex filename
 13128227244596  138602   21d6a ./u-boot

- SUMMARY 
Boards compiled: 1
--
$ 

I don't see the same warning - in fact it builds fine. I always run an ARM 
MAKEALL before submitting a pull request, using my default (4.4.1) toolchain.

Allen did the SPL work - adding him for comment.

Tom

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


Re: [U-Boot] [PATCH v4] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Markus Hubig
On Mon, Aug 06, 2012 at 03:49:22PM +0200, Andreas Bießmann wrote:
> On 06.08.2012 15:46, Andreas Bießmann wrote:
> > 
> > One more thing to mention!
> 
> and some more ;)



> Please test your code with the MAKEALL script before sending.

| $ ./MAKEALL portuxg20 stamp9g20
| Configuring for portuxg20 - Board: stamp9g20, Options: AT91SAM9G20,PORTUXG20
|text  data bss dec hex filename
|  200037  6040  268996  475073   73fc1 ./u-boot
| Configuring for stamp9g20 - Board: stamp9g20, Options: AT91SAM9G20
|text  data bss dec hex filename
|  173966  5828  256864  436658   6a9b2 ./u-boot
| 
| - SUMMARY 
| Boards compiled: 2
| --

Fixed! ;-)

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


Re: [U-Boot] [PATCH 2/2] imx27lite: update with gpio api change

2012-08-06 Thread Stefano Babic
On 06/08/2012 17:27, Philippe Reynes wrote:

> Oh, I understand. As I don't have this board, I've done the smallest
> change to fix the compilation.
> I add the driver mxc_gpio on imx27lite, remove this direct acces to gpio
> register,
>  and send the new version of the patch.

I think I can test it, at least the base functionality.

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 v4] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Markus Hubig
On Mon, Aug 06, 2012 at 03:46:49PM +0200, Andreas Bießmann wrote:
> Dear Markus Hubig,
> 
> One more thing to mention!



> stamp9g20.c: In function 'stamp9G20_macb_hw_init':
> stamp9g20.c:113:2: warning: suggest parentheses around arithmetic in
> operand of '|' [-Wparentheses]

Fixed!

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


Re: [U-Boot] U-boot not finding NAND chip on imx28EVK - Gives DMA read error

2012-08-06 Thread Fabio Estevam
Bill,

On Mon, Aug 6, 2012 at 11:34 AM, Bill  wrote:
> All,
>
>I enabled my U-boot for NAND support for my imx28EVK and I get the
> following error when U-Boot starts:
>
>
> NAND:  MXS NAND: Error sending command
> MXS NAND: Error sending command
> MXS NAND: DMA read error
> MXS NAND: DMA read error
> MXS NAND: Error sending command
> ...
>
> I am using U-boot version  U-Boot 2012.07-rc1.   I also have the NAND
> support enabled in /include/configs/mx28evk.h  by adding  CONFIG_CMD_NAND.
> The NAND chip I am using is:  Micron  MT29F1G08ABADA.

I have just tried the most recent u-boot-imx git, enabled
CONFIG_CMD_NAND in the mx28evk.h and the NAND is detected fine:

U-Boot 2012.07-08388-g9ce4714-dirty (Aug 06 2012 - 12:26:16)

CPU:   Freescale i.MX28 rev1.2 at 454 MHz
BOOT:  SSP SD/MMC #0, 3V3
I2C:   ready
DRAM:  128 MiB
NAND:  2048 MiB
MMC:   MXS MMC: 0
In:serial
Out:   serial
Err:   serial
Net:   FEC0, FEC1
Hit any key to stop autoboot:  0

MX28EVK U-Boot > nand info

Device 0: nand0, sector size 256 KiB
  Page size  2048 b
  OOB size 64 b
  Erase size   262144 b
MX28EVK U-Boot >

The NAND I am using is K9LAG08U0M.

Regards,

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


Re: [U-Boot] [PATCH 2/2] imx27lite: update with gpio api change

2012-08-06 Thread Philippe Reynes


>On 05/08/2012 12:00, Philippe Reynes wrote:
>> Signed-off-by: Philippe Reynes 
>> ---
>>  board/logicpd/imx27lite/imx27lite.c |    7 ---
>>  1 files changed, 4 insertions(+), 3 deletions(-)
>> 

>Hi Philippe,

Hi Stefano,


>>  {
>> -    struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
>> +    struct gpio_port_regs *regs = (struct gpio_port_regs *)IMX_GPIO_BASE;
>>  #if defined(CONFIG_SYS_NAND_LARGEPAGE)
>>      struct system_control_regs *sc_regs =
>>          (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
>> @@ -43,8 +44,8 @@ int board_init(void)
>>  #ifdef CONFIG_FEC_MXC
>>      mx27_fec_init_pins();
>>      imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
>> -    writel(readl(®s->port[PORTC].dr) | (1 << 31),
>> -                ®s->port[PORTC].dr);
>> +    writel(readl(®s->port[PORTC].gpio_dr) | (1 << 31),
>> +                ®s->port[PORTC].gpio_dr);

>This is not what I am expecting from the patch when it will move to
>generic GPIO API.

>The GPIO API uses really generic as in kernel functions, independently
>from the SOC where it is running. This hides the physical registers of
>the GPIOs.

>Instead of that, gpio_set_value(), gpio_get_value(),
>gpio_direction_input() and gpio_direction_output() should be used. You
>can take a look at other iMX (MX3, MX28, MX5, MX6), that are already
>using the generic API.

Oh, I understand. As I don't have this board, I've done the smallest change to 
fix the compilation.
I add the driver mxc_gpio on imx27lite, remove this direct acces to gpio 
register,
 and send the new version of the patch.

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


Re: [U-Boot] [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

2012-08-06 Thread Ilya Yanok
On Mon, Aug 6, 2012 at 7:30 PM, Tom Rini  wrote:

> On 08/06/2012 08:10 AM, Ilya Yanok wrote:
> > Hi Tom,
> >
> > On Mon, Aug 6, 2012 at 2:36 AM, Tom Rini  > > wrote:
> >
> > On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
> >  > > wrote:
> > > __u_boot_cmd* symbols are not used in SPL so there is no need
> > > to tell the linker that they are undefined. With these symbols
> > > marked as undefined linker fails to garbage collect some unused
> > > functions and even fails to build the resulting image.
> >
> > I don't like this because it causes SPL to bloat when the commands
> > aren't also removed from the build.  But I assume a number of
> commands
> >
> >
> > Nah. As far as I understand it,  UNDEF_SYM stuff is there to protect
> > commands from being purged by linker garbage collector. This is needed
> > for main U-Boot as commands are referenced inderectly.
> > I seems to me that this stuff was just copy-pasted into SPL Makefile. As
> > far as we don't need commands in SPL we don't care about them being
> > garbage collected (well, actually we want them to be collected). So it
> > has nothing to do about bloating, actually SPL image is smaller with
> > this patch applied.
>
> What toolchain are you using?  In my tests they have not been collected.
>

ELDK 5.2

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


Re: [U-Boot] [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

2012-08-06 Thread Tom Rini
On 08/06/2012 08:10 AM, Ilya Yanok wrote:
> Hi Tom,
> 
> On Mon, Aug 6, 2012 at 2:36 AM, Tom Rini  > wrote:
> 
> On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
>  > wrote:
> > __u_boot_cmd* symbols are not used in SPL so there is no need
> > to tell the linker that they are undefined. With these symbols
> > marked as undefined linker fails to garbage collect some unused
> > functions and even fails to build the resulting image.
> 
> I don't like this because it causes SPL to bloat when the commands
> aren't also removed from the build.  But I assume a number of commands
> 
> 
> Nah. As far as I understand it,  UNDEF_SYM stuff is there to protect
> commands from being purged by linker garbage collector. This is needed
> for main U-Boot as commands are referenced inderectly.
> I seems to me that this stuff was just copy-pasted into SPL Makefile. As
> far as we don't need commands in SPL we don't care about them being
> garbage collected (well, actually we want them to be collected). So it
> has nothing to do about bloating, actually SPL image is smaller with
> this patch applied.

What toolchain are you using?  In my tests they have not been collected.

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


[U-Boot] [PATCH 2/2] imx27lite: update with gpio api change (v3)

2012-08-06 Thread Philippe Reynes
Signed-off-by: Philippe Reynes 
---
 board/logicpd/imx27lite/imx27lite.c |5 ++---
 include/configs/imx27lite-common.h  |5 +
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/board/logicpd/imx27lite/imx27lite.c 
b/board/logicpd/imx27lite/imx27lite.c
index 8a5015c..b38e5ab 100644
--- a/board/logicpd/imx27lite/imx27lite.c
+++ b/board/logicpd/imx27lite/imx27lite.c
@@ -23,12 +23,12 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
 int board_init(void)
 {
-   struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
 #if defined(CONFIG_SYS_NAND_LARGEPAGE)
struct system_control_regs *sc_regs =
(struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
@@ -43,8 +43,7 @@ int board_init(void)
 #ifdef CONFIG_FEC_MXC
mx27_fec_init_pins();
imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
-   writel(readl(®s->port[PORTC].dr) | (1 << 31),
-   ®s->port[PORTC].dr);
+   gpio_set_value(GPIO_PORTC | 31, 1);
 #endif
 #ifdef CONFIG_MXC_MMC
 #if defined(CONFIG_MAGNESIUM)
diff --git a/include/configs/imx27lite-common.h 
b/include/configs/imx27lite-common.h
index 7d2876b..2e79a9e 100644
--- a/include/configs/imx27lite-common.h
+++ b/include/configs/imx27lite-common.h
@@ -162,6 +162,11 @@
 #define CONFIG_DOS_PARTITION
 
 /*
+ * GPIO
+ */
+#define CONFIG_MXC_GPIO
+
+/*
  * MTD partitions
  */
 #define CONFIG_CMD_MTDPARTS
-- 
1.7.4.4

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


[U-Boot] [PATCH 1/2] gpio: add gpio api support to mx27 (v2)

2012-08-06 Thread Philippe Reynes
There is a little change on gpio_get_value because
on mx27 the register to read is ssr and not dr.

Signed-off-by: Philippe Reynes 
---
 arch/arm/cpu/arm926ejs/mx27/generic.c |   11 +++---
 arch/arm/include/asm/arch-mx27/gpio.h |   55 +
 arch/arm/include/asm/arch-mx27/imx-regs.h |   30 
 drivers/gpio/mxc_gpio.c   |   12 +--
 4 files changed, 77 insertions(+), 31 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-mx27/gpio.h

diff --git a/arch/arm/cpu/arm926ejs/mx27/generic.c 
b/arch/arm/cpu/arm926ejs/mx27/generic.c
index 65c4813..41bb84b 100644
--- a/arch/arm/cpu/arm926ejs/mx27/generic.c
+++ b/arch/arm/cpu/arm926ejs/mx27/generic.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #ifdef CONFIG_MXC_MMC
 #include 
 #endif
@@ -209,7 +210,7 @@ int cpu_mmc_init(bd_t *bis)
 
 void imx_gpio_mode(int gpio_mode)
 {
-   struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
+   struct gpio_port_regs *regs = (struct gpio_port_regs *)IMX_GPIO_BASE;
unsigned int pin = gpio_mode & GPIO_PIN_MASK;
unsigned int port = (gpio_mode & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT;
unsigned int ocr = (gpio_mode & GPIO_OCR_MASK) >> GPIO_OCR_SHIFT;
@@ -228,11 +229,11 @@ void imx_gpio_mode(int gpio_mode)
 
/* Data direction */
if (gpio_mode & GPIO_OUT) {
-   writel(readl(®s->port[port].ddir) | 1 << pin,
-   ®s->port[port].ddir);
+   writel(readl(®s->port[port].gpio_dir) | 1 << pin,
+   ®s->port[port].gpio_dir);
} else {
-   writel(readl(®s->port[port].ddir) & ~(1 << pin),
-   ®s->port[port].ddir);
+   writel(readl(®s->port[port].gpio_dir) & ~(1 << pin),
+   ®s->port[port].gpio_dir);
}
 
/* Primary / alternate function */
diff --git a/arch/arm/include/asm/arch-mx27/gpio.h 
b/arch/arm/include/asm/arch-mx27/gpio.h
new file mode 100644
index 000..965b584
--- /dev/null
+++ b/arch/arm/include/asm/arch-mx27/gpio.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2012
+ * Philippe Reynes 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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
+ */
+
+
+#ifndef __ASM_ARCH_MX27_GPIO_H
+#define __ASM_ARCH_MX27_GPIO_H
+
+/* GPIO registers */
+struct gpio_regs {
+   u32 gpio_dir; /* DDIR */
+   u32 ocr1;
+   u32 ocr2;
+   u32 iconfa1;
+   u32 iconfa2;
+   u32 iconfb1;
+   u32 iconfb2;
+   u32 gpio_dr; /* DR */
+   u32 gius;
+   u32 ssr;
+   u32 icr1;
+   u32 icr2;
+   u32 imr;
+   u32 isr;
+   u32 gpr;
+   u32 swr;
+   u32 puen;
+   u32 res[0x2f];
+};
+
+/* This structure is used by the function imx_gpio_mode */
+struct gpio_port_regs {
+   struct gpio_regs port[6];
+};
+
+#endif
diff --git a/arch/arm/include/asm/arch-mx27/imx-regs.h 
b/arch/arm/include/asm/arch-mx27/imx-regs.h
index ced5b2a..4035d2b 100644
--- a/arch/arm/include/asm/arch-mx27/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx27/imx-regs.h
@@ -162,29 +162,6 @@ struct gpt_regs {
 #define PORTE 4
 #define PORTF 5
 
-struct gpio_regs {
-   struct {
-   u32 ddir;
-   u32 ocr1;
-   u32 ocr2;
-   u32 iconfa1;
-   u32 iconfa2;
-   u32 iconfb1;
-   u32 iconfb2;
-   u32 dr;
-   u32 gius;
-   u32 ssr;
-   u32 icr1;
-   u32 icr2;
-   u32 imr;
-   u32 isr;
-   u32 gpr;
-   u32 swr;
-   u32 puen;
-   u32 res[0x2f];
-   } port[6];
-};
-
 /* IIM Control Registers */
 struct iim_regs {
u32 iim_stat;
@@ -471,6 +448,13 @@ struct fuse_bank0_regs {
 #define TSTAT_CAPT (1 << 1)/* Capture event */
 #define TSTAT_COMP 1   /* Compare event */
 
+#define GPIO1_BASE_ADDR 0x10015000
+#define GPIO2_BASE_ADDR 0x10015100
+#define GPIO3_BASE_ADDR 0x10015200
+#define GPIO4_BASE_ADDR 0x10015300
+#define GPIO5_BASE_ADDR 0x10015400
+#define GPIO6_BASE_ADDR 0x10015500
+
 #define GPIO_PIN_MASK  0x1f
 
 #define GPIO_PORT_SHIFT5
dif

Re: [U-Boot] pull request for u-boot-tegra/master

2012-08-06 Thread Tom Warren
Albert,

On Sun, Aug 5, 2012 at 12:46 PM, Albert ARIBAUD
 wrote:
> Hi Tom,
>
> On Fri, 3 Aug 2012 16:35:40 -0700, Tom Warren  
> wrote:
>> Albert,
>>
>> Has this been pulled into ARM master? I don't think I saw a response
>> from you, but I might have missed it.
>
> Sorry Tom, but I have been unavailable for some time and especially on jul 30 
> and 31,
> so no, it has not been pulled in. :(
No worries, just checking. Thanks.

Tom
>
> I am pulling it in right now, but I have sparse access to Internet right now.
>
>> Thanks,
>>
>> Tom
>
> Amicalement,
> --
> Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Markus Hubig
On Mon, Aug 06, 2012 at 03:01:40PM +0200, Andreas Bießmann wrote:
> On 06.08.2012 11:11, Markus Hubig wrote:
> > This adds support for the AT91SAM9G20 boards by taskit GmbH.
> > Both boards, Stamp9G20 and PortuxG20, are integrated in one
> > file. PortuxG20 is basically a SBC built around the Stamp9G20.
> > 
> > Signed-off-by: Markus Hubig 
> > Cc: Andreas Bießmann 
> > ---
> 
> please read http://www.denx.de/wiki/U-Boot/Patches, especially
> http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions
> 
> (patch changes missing)

OK will include them onto my next patch!

> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 84413de..7eb55db 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -243,12 +243,6 @@ Klaus Heydeck 
> > KUP4K   MPC855
> > KUP4X   MPC859
> >  
> > -Ilko Iliev 
> > -
> > -   PM9261  AT91SAM9261
> > -   PM9263  AT91SAM9263
> > -   PM9G45  ARM926EJS (AT91SAM9G45 SoC)
> > -
> 
> NAK, this is a separate patch (already on the list)

Ups ... Fixed!

> > +static unsigned int saved_state[3] = {STATUS_LED_OFF,
> > +   STATUS_LED_OFF, STATUS_LED_OFF};
> > +
> > +void coloured_LED_init(void)
> > +{
> > +   /* Clock is enabled in board_early_init_f() */
> 
> But coloured_LED_init() is called way before!
> 
> Beware, this coloured LED stuff is sometimes used for very early debug
> purposes. To get this working you will need to switch the clocks here.
> 
> If you not insist on this colour LED framework I would appreciate to not
> add this coloured_LED_init for the stamp9g20 but use the status LED
> framework -> README.LED

OK I'll try to get rid of the coloured_LED stuff but the README.LED should
better be called a CONFUSEME.LED ... Maybe later I can include a better
example ...

> > +#ifdef CONFIG_MACB
> > +int board_eth_init(bd_t *bis)
> > +{
> > +   int rc = 0;
> please remove this unused value

Fixed!

> > +/* Misc CPU related settings */
> > +#define CONFIG_ARCH_CPU_INIT   /* call arch_cpu_init() */
> please remove this, it is not longer required cause of
> a21c65115bd95572cc80092a31b0e9ecb8710e9f

Fixed!

> > +/* setting board spezific options */
> ---^

Fixed!

> > +#ifdef CONFIG_PORTUXG20
> > +# define CONFIG_MACH_TYPE  MACH_TYPE_PORTUXG20
> > +# define CONFIG_MACB
> 
> This looks really good to me. Maybe a short comment showing why you
> disable MACB for the stamp by default would be useful.

There is already a comment, but a bit later at the ethernet "section".
I think this is the best place, someone who is missing ethernet support
will have a look ...

> > +/*
> > + * SDRAM: 1 bank, 64 MB, base address 0x2000
> > + * Already initialized before u-boot gets started.
> > + */
> > +#define CONFIG_NR_DRAM_BANKS   1
> > +#define CONFIG_SYS_SDRAM_BASE  ATMEL_BASE_CS1
> > +#define CONFIG_SYS_SDRAM_SIZE  (64 * (1024 << 10))
> 
> just a side note: shifting by 10 bit is KiB, shifting by 20 bit is MiB
> -> 64<<20 == 64*(1024<<10)

Hmm OK. Now I unified all calculations to use the shifting OP '<<'.

> 
> I think some minor tweaks for the led stuff and then we can apply this
> patch.

Fine! ;-)

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


Re: [U-Boot] [PATCH v4 3/5] OMAP: spl: call timer_inti() from SPL

2012-08-06 Thread Tom Rini
On Mon, Aug 6, 2012 at 8:02 AM, Ilya Yanok
 wrote:
> Hi Tom,
>
> On Mon, Aug 6, 2012 at 2:35 AM, Tom Rini  wrote:
>
>> On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
>>  wrote:
>> > We need to initialize timer properly, otherwise all delays
>> > inside SPL will be wrong.
>> >
>> > Signed-off-by: Ilya Yanok 
>> > ---
>> >
>> >  arch/arm/cpu/armv7/omap-common/spl.c |2 ++
>> >  1 file changed, 2 insertions(+)
>> >
>> > diff --git a/arch/arm/cpu/armv7/omap-common/spl.c
>> b/arch/arm/cpu/armv7/omap-common/spl.c
>> > index 4d1ac85..f0d766c 100644
>> > --- a/arch/arm/cpu/armv7/omap-common/spl.c
>> > +++ b/arch/arm/cpu/armv7/omap-common/spl.c
>> > @@ -152,6 +152,8 @@ void board_init_r(gd_t *id, ulong dummy)
>> > mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
>> > CONFIG_SYS_SPL_MALLOC_SIZE);
>> >
>> > +   timer_init();
>> > +
>> >  #ifdef CONFIG_SPL_BOARD_INIT
>> > spl_board_init();
>> >  #endif
>>
>> Calling it twice has other bad side-effects so there should be a
>> timer_init removal somewhere too.
>
>
> Hm, I can see any so far. I think you are mixing it with init_timer()
> function you fixed in commit 2ab2810 (BTW, these two functions deal with
> the same piece of hardware. do we really need both?).
> Speaking about 2ab2810, I think the problem was not init_timer() being
> called twice but init_timer() called _after_ timer_init() (timer_init()
> programs the timer to get correct delays but init_timer() resets the timer
> so delays are wrong again).

Ug, that is a mess, your patch is fine, I'll go figure out what's
going on in the am33xx-specific portion.

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


Re: [U-Boot] [PATCH v4 2/5] spl: don't mark __u_boot_cmd* as undefined

2012-08-06 Thread Ilya Yanok
Hi Tom,

On Mon, Aug 6, 2012 at 2:36 AM, Tom Rini  wrote:

> On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
>  wrote:
> > __u_boot_cmd* symbols are not used in SPL so there is no need
> > to tell the linker that they are undefined. With these symbols
> > marked as undefined linker fails to garbage collect some unused
> > functions and even fails to build the resulting image.
>
> I don't like this because it causes SPL to bloat when the commands
> aren't also removed from the build.  But I assume a number of commands
>

Nah. As far as I understand it,  UNDEF_SYM stuff is there to protect
commands from being purged by linker garbage collector. This is needed for
main U-Boot as commands are referenced inderectly.
I seems to me that this stuff was just copy-pasted into SPL Makefile. As
far as we don't need commands in SPL we don't care about them being garbage
collected (well, actually we want them to be collected). So it has nothing
to do about bloating, actually SPL image is smaller with this patch applied.

were being pulled in as part of the networking stack?
>

Not really, only some functions.

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


Re: [U-Boot] [PATCH v4 3/5] OMAP: spl: call timer_inti() from SPL

2012-08-06 Thread Ilya Yanok
Hi Tom,

On Mon, Aug 6, 2012 at 2:35 AM, Tom Rini  wrote:

> On Sun, Aug 5, 2012 at 2:21 PM, Ilya Yanok
>  wrote:
> > We need to initialize timer properly, otherwise all delays
> > inside SPL will be wrong.
> >
> > Signed-off-by: Ilya Yanok 
> > ---
> >
> >  arch/arm/cpu/armv7/omap-common/spl.c |2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/arm/cpu/armv7/omap-common/spl.c
> b/arch/arm/cpu/armv7/omap-common/spl.c
> > index 4d1ac85..f0d766c 100644
> > --- a/arch/arm/cpu/armv7/omap-common/spl.c
> > +++ b/arch/arm/cpu/armv7/omap-common/spl.c
> > @@ -152,6 +152,8 @@ void board_init_r(gd_t *id, ulong dummy)
> > mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
> > CONFIG_SYS_SPL_MALLOC_SIZE);
> >
> > +   timer_init();
> > +
> >  #ifdef CONFIG_SPL_BOARD_INIT
> > spl_board_init();
> >  #endif
>
> Calling it twice has other bad side-effects so there should be a
> timer_init removal somewhere too.


Hm, I can see any so far. I think you are mixing it with init_timer()
function you fixed in commit 2ab2810 (BTW, these two functions deal with
the same piece of hardware. do we really need both?).
Speaking about 2ab2810, I think the problem was not init_timer() being
called twice but init_timer() called _after_ timer_init() (timer_init()
programs the timer to get correct delays but init_timer() resets the timer
so delays are wrong again).

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


[U-Boot] U-boot not finding NAND chip on imx28EVK - Gives DMA read error

2012-08-06 Thread Bill

All,

   I enabled my U-boot for NAND support for my imx28EVK and I get 
the following error when U-Boot starts:



NAND:  MXS NAND: Error sending command
MXS NAND: Error sending command
MXS NAND: DMA read error
MXS NAND: DMA read error
MXS NAND: Error sending command
...

I am using U-boot version  U-Boot 2012.07-rc1.   I also have the 
NAND support enabled in /include/configs/mx28evk.h  by adding  
CONFIG_CMD_NAND.

The NAND chip I am using is:  Micron  MT29F1G08ABADA.

Thanks,
Bill








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


Re: [U-Boot] [PATCH v4] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Andreas Bießmann
Dear Markus Hubig,

On 06.08.2012 15:46, Andreas Bießmann wrote:
> Dear Markus Hubig,
> 
> One more thing to mention!

and some more ;)

---8<---
Configuring for portuxg20 - Board: stamp9g20, Options: AT91SAM9G20,PORTUXG20
   textdata bss dec hex filename
 1999416040  269068  475049   73fa9 /tmp/build_at91/u-boot
env_nand.c: In function 'saveenv':
env_nand.c:199:3: warning: suggest parentheses around '+' inside '<<'
[-Wparentheses]
env_nand.c:204:3: warning: suggest parentheses around '+' inside '<<'
[-Wparentheses]
env_nand.c:207:3: warning: suggest parentheses around '+' inside '<<'
[-Wparentheses]
env_nand.c:212:3: warning: suggest parentheses around '+' inside '<<'
[-Wparentheses]
env_nand.c: In function 'env_relocate_spec':
env_nand.c:345:2: warning: suggest parentheses around '+' inside '<<'
[-Wparentheses]
env_nand.c:348:2: warning: suggest parentheses around '+' inside '<<'
[-Wparentheses]
stamp9g20.c: In function 'stamp9G20_macb_hw_init':
stamp9g20.c:113:2: warning: suggest parentheses around arithmetic in
operand of '|' [-Wparentheses]
stamp9g20.c: In function 'board_eth_init':
stamp9g20.c:189:6: warning: unused variable 'rc' [-Wunused-variable]
Configuring for stamp9g20 - Board: stamp9g20, Options: AT91SAM9G20
   textdata bss dec hex filename
 1740225828  256808  436658   6a9b2 /tmp/build_at91/u-boot
env_nand.c: In function 'saveenv':
env_nand.c:199:3: warning: suggest parentheses around '+' inside '<<'
[-Wparentheses]
env_nand.c:204:3: warning: suggest parentheses around '+' inside '<<'
[-Wparentheses]
env_nand.c:207:3: warning: suggest parentheses around '+' inside '<<'
[-Wparentheses]
env_nand.c:212:3: warning: suggest parentheses around '+' inside '<<'
[-Wparentheses]
env_nand.c: In function 'env_relocate_spec':
env_nand.c:345:2: warning: suggest parentheses around '+' inside '<<'
[-Wparentheses]
env_nand.c:348:2: warning: suggest parentheses around '+' inside '<<'
[-Wparentheses]
--->8---

Please test your code with the MAKEALL script before sending.

Best regards

Andreas Bießmann

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


Re: [U-Boot] [PATCH 1/2] mx51evk: do not overwrite the console

2012-08-06 Thread Fabio Estevam
On Mon, Aug 6, 2012 at 5:15 AM, Stefano Babic  wrote:

> Hi Fabio,
>
> it seems you agree with my patch from yesterday - I will apply all three
> patches soon !

Yes, your solution is very good.

Thanks,

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


Re: [U-Boot] [PATCH] MX5: mx53loco: do not overwrite the console

2012-08-06 Thread Fabio Estevam
On Sun, Aug 5, 2012 at 7:18 AM, Stefano Babic  wrote:
> On this board, the console is always set to the serial line.
> Do not allow to overwrite it when video is enabled.
>
> Signed-off-by: Stefano Babic 
> CC: Fabio Estevam 

Tested-by: Fabio Estevam 

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


Re: [U-Boot] [PATCH v4] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Andreas Bießmann
Dear Markus Hubig,

One more thing to mention!

On 06.08.2012 15:01, Andreas Bießmann wrote:
> Dear Markus Hubig,



>> diff --git a/board/taskit/stamp9g20/stamp9g20.c 
>> b/board/taskit/stamp9g20/stamp9g20.c
>> new file mode 100644
>> index 000..c85e6c3
>> --- /dev/null
>> +++ b/board/taskit/stamp9g20/stamp9g20.c
>> @@ -0,0 +1,192 @@
>> +/*
>> + * (C) Copyright 2007-2008
>> + * Stelian Pop 
>> + * Lead Tech Design 
>> + *
>> + * Achim Ehrlich 
>> + * taskit GmbH 
>> + *
>> + * (C) Copyright 2012-
>> + * Markus Hubig 
>> + * IMKO GmbH 
>> + *
>> + * See file CREDITS for list of people who contributed to this
>> + * project.
>> + *
>> + * 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 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#ifdef CONFIG_MACB
>> +# include 
>> +# include 
>> +#endif
>> +
>> +DECLARE_GLOBAL_DATA_PTR;
>> +
>> +static void stamp9G20_nand_hw_init(void)
>> +{
>> +struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
>> +struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX;
>> +unsigned long csa;
>> +
>> +/* Assign CS3 to NAND/SmartMedia Interface */
>> +csa = readl(&matrix->ebicsa);
>> +csa |= AT91_MATRIX_CS3A_SMC_SMARTMEDIA;
>> +writel(csa, &matrix->ebicsa);
>> +
>> +/* Configure SMC CS3 for NAND/SmartMedia */
>> +writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
>> +AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
>> +&smc->cs[3].setup);
>> +writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(3) |
>> +AT91_SMC_PULSE_NRD(3) | AT91_SMC_PULSE_NCS_RD(3),
>> +&smc->cs[3].pulse);
>> +writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(5),
>> +&smc->cs[3].cycle);
>> +writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
>> +AT91_SMC_MODE_EXNW_DISABLE |
>> +AT91_SMC_MODE_DBW_8 |
>> +AT91_SMC_MODE_TDF_CYCLE(2),
>> +&smc->cs[3].mode);
>> +
>> +/* Configure RDY/BSY */
>> +at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
>> +
>> +/* Enable NandFlash */
>> +at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
>> +}
>> +
>> +#ifdef CONFIG_MACB
>> +static void stamp9G20_macb_hw_init(void)
>> +{
>> +struct at91_port *pioa = (struct at91_port *)ATMEL_BASE_PIOA;
>> +struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
>> +unsigned long erstl;
>> +
>> +/* Enable the PHY Chip via PA26 on the Stamp 2 Adaptor */
>> +at91_set_gpio_output(AT91_PIN_PA26, 0);
>> +
>> +/*
>> + * Disable pull-up on:
>> + *  RXDV (PA17) => PHY normal mode (not Test mode)
>> + *  ERX0 (PA14) => PHY ADDR0
>> + *  ERX1 (PA15) => PHY ADDR1
>> + *  ERX2 (PA25) => PHY ADDR2
>> + *  ERX3 (PA26) => PHY ADDR3
>> + *  ECRS (PA28) => PHY ADDR4  => PHYADDR = 0x0
>> + *
>> + * PHY has internal pull-down
>> + */
>> +writel(pin_to_mask(AT91_PIN_PA14) |
>> +pin_to_mask(AT91_PIN_PA15) |
>> +pin_to_mask(AT91_PIN_PA17) |
>> +pin_to_mask(AT91_PIN_PA18) |
>> +pin_to_mask(AT91_PIN_PA28),
>> +&pioa->pudr);
>> +
>> +erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
>> +
>> +/* Need to reset PHY -> 500ms reset */
>> +writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13)
>> +& ~AT91_RSTC_MR_URSTEN, &rstc->mr);

stamp9g20.c: In function 'stamp9G20_macb_hw_init':
stamp9g20.c:113:2: warning: suggest parentheses around arithmetic in
operand of '|' [-Wparentheses]



Best regards

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


[U-Boot] [PATCH 4/4] EXYNOS: Update pinmux to use gpio numbering

2012-08-06 Thread Rajeshwari Shinde
Update pinmux by calling generic gpio_* functions instead s5p_gpio_*
functions

Signed-off-by: Leela Krishna Amudala 
Signed-off-by: Rajeshwari Shinde 
---
 arch/arm/cpu/armv7/exynos/pinmux.c |  150 +++-
 1 files changed, 63 insertions(+), 87 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 13f75e0..ed2201e 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -28,97 +28,83 @@
 
 static void exynos5_uart_config(int peripheral)
 {
-   struct exynos5_gpio_part1 *gpio1 =
-   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
-   struct s5p_gpio_bank *bank;
int i, start, count;
 
switch (peripheral) {
case PERIPH_ID_UART0:
-   bank = &gpio1->a0;
-   start = 0;
+   start = GPIO_A00;
count = 4;
break;
case PERIPH_ID_UART1:
-   bank = &gpio1->d0;
-   start = 0;
+   start = GPIO_D00;
count = 4;
break;
case PERIPH_ID_UART2:
-   bank = &gpio1->a1;
-   start = 0;
+   start = GPIO_A10;
count = 4;
break;
case PERIPH_ID_UART3:
-   bank = &gpio1->a1;
-   start = 4;
+   start = GPIO_A14;
count = 2;
break;
}
for (i = start; i < start + count; i++) {
-   s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
-   s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
+   gpio_set_pull(i, GPIO_PULL_NONE);
+   gpio_cfg_pin(i, GPIO_FUNC(0x2));
}
 }
 
 static int exynos5_mmc_config(int peripheral, int flags)
 {
-   struct exynos5_gpio_part1 *gpio1 =
-   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
-   struct s5p_gpio_bank *bank, *bank_ext;
-   int i, start = 0, gpio_func = 0;
+   int i, start, start_ext, gpio_func = 0;
 
switch (peripheral) {
case PERIPH_ID_SDMMC0:
-   bank = &gpio1->c0;
-   bank_ext = &gpio1->c1;
-   start = 0;
+   start = GPIO_C00;
+   start_ext = GPIO_C10;
gpio_func = GPIO_FUNC(0x2);
break;
case PERIPH_ID_SDMMC1:
-   bank = &gpio1->c2;
-   bank_ext = NULL;
+   start = GPIO_C20;
+   start_ext = 0;
break;
case PERIPH_ID_SDMMC2:
-   bank = &gpio1->c3;
-   bank_ext = &gpio1->c4;
-   start = 3;
+   start = GPIO_C30;
+   start_ext = GPIO_C43;
gpio_func = GPIO_FUNC(0x3);
break;
case PERIPH_ID_SDMMC3:
-   bank = &gpio1->c4;
-   bank_ext = NULL;
+   start = GPIO_C40;
+   start_ext = 0;
break;
}
-   if ((flags & PINMUX_FLAG_8BIT_MODE) && !bank_ext) {
+   if ((flags & PINMUX_FLAG_8BIT_MODE) && !start_ext) {
debug("SDMMC device %d does not support 8bit mode",
peripheral);
return -1;
}
if (flags & PINMUX_FLAG_8BIT_MODE) {
-   for (i = start; i <= (start + 3); i++) {
-   s5p_gpio_cfg_pin(bank_ext, i, gpio_func);
-   s5p_gpio_set_pull(bank_ext, i, GPIO_PULL_UP);
-   s5p_gpio_set_drv(bank_ext, i, GPIO_DRV_4X);
+   for (i = start_ext; i <= (start_ext + 3); i++) {
+   gpio_cfg_pin(i, gpio_func);
+   gpio_set_pull(i, GPIO_PULL_UP);
+   gpio_set_drv(i, GPIO_DRV_4X);
}
}
for (i = 0; i < 2; i++) {
-   s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
-   s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
-   s5p_gpio_set_drv(bank, i, GPIO_DRV_4X);
+   gpio_cfg_pin(start + i, GPIO_FUNC(0x2));
+   gpio_set_pull(start + i, GPIO_PULL_NONE);
+   gpio_set_drv(start + i, GPIO_DRV_4X);
}
for (i = 3; i <= 6; i++) {
-   s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
-   s5p_gpio_set_pull(bank, i, GPIO_PULL_UP);
-   s5p_gpio_set_drv(bank, i, GPIO_DRV_4X);
+   gpio_cfg_pin(start + i, GPIO_FUNC(0x2));
+   gpio_set_pull(start + i, GPIO_PULL_UP);
+   gpio_set_drv(start + i, GPIO_DRV_4X);
}
return 0;
 }
 
 static void exynos5_sromc_config(int flags)
 {
-   struct exynos5_gpio_part1 *gpio1 =
-   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
int i;
 
/*
@@ -136,13 +122,13 @@ static void exynos5_sromc_config(int flags)
 * GPY1[2]  SROM_WAIT(2)
 * GPY1[3]

Re: [U-Boot] [PATCH v4] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Andreas Bießmann
Dear Markus Hubig,

On 06.08.2012 11:11, Markus Hubig wrote:
> This adds support for the AT91SAM9G20 boards by taskit GmbH.
> Both boards, Stamp9G20 and PortuxG20, are integrated in one
> file. PortuxG20 is basically a SBC built around the Stamp9G20.
> 
> Signed-off-by: Markus Hubig 
> Cc: Andreas Bießmann 
> ---

please read http://www.denx.de/wiki/U-Boot/Patches, especially
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions

(patch changes missing)

>  MAINTAINERS|   16 ++-
>  board/taskit/stamp9g20/Makefile|   53 +++
>  board/taskit/stamp9g20/led.c   |  134 ++
>  board/taskit/stamp9g20/stamp9g20.c |  192 ++
>  boards.cfg |2 +
>  include/configs/stamp9g20.h|  267 
> 
>  6 files changed, 658 insertions(+), 6 deletions(-)
>  create mode 100644 board/taskit/stamp9g20/Makefile
>  create mode 100644 board/taskit/stamp9g20/led.c
>  create mode 100644 board/taskit/stamp9g20/stamp9g20.c
>  create mode 100644 include/configs/stamp9g20.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 84413de..7eb55db 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -243,12 +243,6 @@ Klaus Heydeck 
>   KUP4K   MPC855
>   KUP4X   MPC859
>  
> -Ilko Iliev 
> -
> - PM9261  AT91SAM9261
> - PM9263  AT91SAM9263
> - PM9G45  ARM926EJS (AT91SAM9G45 SoC)
> -

NAK, this is a separate patch (already on the list)

>  Gary Jennejohn 
>  
>   quad100hd   PPC405EP
> @@ -681,10 +675,20 @@ Vaibhav Hiremath 
>  
>   am3517_evm  ARM ARMV7 (AM35x SoC)
>  
> +Markus Hubig 
> +
> + STAMP9G20   ARM926EJS
> +
>  Grazvydas Ignotas 
>  
>   omap3_pandora   ARM ARMV7 (OMAP3xx SoC)
>  
> +Ilko Iliev 
> +
> + PM9261  AT91SAM9261
> + PM9263  AT91SAM9263
> + PM9G45  ARM926EJS (AT91SAM9G45 SoC)
> +
>  Michael Jones 
>  
>   omap3_mvblx ARM ARMV7 (OMAP3xx SoC)
> diff --git a/board/taskit/stamp9g20/Makefile b/board/taskit/stamp9g20/Makefile
> new file mode 100644
> index 000..4f17a27
> --- /dev/null
> +++ b/board/taskit/stamp9g20/Makefile
> @@ -0,0 +1,53 @@
> +#
> +# (C) Copyright 2003-2008
> +# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
> +#
> +# (C) Copyright 2008
> +# Stelian Pop 
> +# Lead Tech Design 
> +#
> +# (C) Copyright 2012
> +# Markus Hubig 
> +# IMKO GmbH 
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# 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-y  += stamp9g20.o
> +COBJS-y  += led.o
> +
> +SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
> +OBJS := $(addprefix $(obj),$(COBJS-y))
> +SOBJS:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):  $(obj).depend $(OBJS) $(SOBJS)
> + $(call cmd_link_o_target, $(OBJS) $(SOBJS))
> +
> +#
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#
> diff --git a/board/taskit/stamp9g20/led.c b/board/taskit/stamp9g20/led.c
> new file mode 100644
> index 000..13dae39
> --- /dev/null
> +++ b/board/taskit/stamp9g20/led.c
> @@ -0,0 +1,134 @@
> +/*
> + * Copyright (c) 2009 Wind River Systems, Inc.
> + * Tom Rix 
> + * (C) Copyright 2009
> + * Eric Benard 
> + *
> + * (C) Copyright 2012
> + * Markus Hubig 
> + * IMKO GmbH 
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * 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 Gene

[U-Boot] [PATCH 3/4] EXYNOS5: Enable GPIO Numbering.

2012-08-06 Thread Rajeshwari Shinde
This patch enables gpio numbering for EXYNOS5.

Signed-off-by: Rajeshwari Shinde 
---
 include/configs/smdk5250.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index 4b9093c..ed8e80f 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -242,6 +242,9 @@
 #define CONFIG_ENV_SPI_MAX_HZ  5000
 #endif
 
+/* Enable GPIO Numbering */
+#define HAVE_GENERIC_GPIO
+
 /* Enable devicetree support */
 #define CONFIG_OF_LIBFDT
 
-- 
1.7.4.4

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


[U-Boot] [PATCH 2/4] S5P: GPIO: Add GPIO pin numbering to driver

2012-08-06 Thread Rajeshwari Shinde
API's for GPIO pin numbering support are added to the generic S5P
gpio driver

Signed-off-by: Leela Krishna Amudala 
Signed-off-by: Simon Glass 
Signed-off-by: Rajeshawari Shinde 
---
 drivers/gpio/s5p_gpio.c |  158 +--
 1 files changed, 152 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index 47f3213..5c051d4 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -142,20 +142,165 @@ void s5p_gpio_set_rate(struct s5p_gpio_bank *bank, int 
gpio, int mode)
writel(value, &bank->drv);
 }
 
-struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned gpio)
+
+int s5p_gpio_get_pin(unsigned gpio)
 {
-   int bank = gpio / GPIO_PER_BANK;
-   bank *= sizeof(struct s5p_gpio_bank);
+   return gpio % GPIO_PER_BANK;
+}
 
-   return (struct s5p_gpio_bank *) (s5p_gpio_base(gpio) + bank);
+#ifdef HAVE_GENERIC_GPIO
+static struct s5p_gpio_bank *gpio_get_bank(unsigned int gpio)
+{
+   int bank_offset;
+
+   if (gpio < GPIO_MAX_PORT_PART_1) {
+   bank_offset = gpio / GPIO_PER_BANK;
+   return (struct s5p_gpio_bank *) (EXYNOS5_GPIO_PART1_BASE + 
(bank_offset *
+   sizeof(struct s5p_gpio_bank)));
+   } else if (gpio < GPIO_MAX_PORT_PART_2) {
+   bank_offset = (gpio - GPIO_MAX_PORT_PART_1) / GPIO_PER_BANK;
+   return (struct s5p_gpio_bank *) (EXYNOS5_GPIO_PART2_BASE + 
(bank_offset *
+   sizeof(struct s5p_gpio_bank)));
+   } else if (gpio < GPIO_MAX_PORT_PART_3) {
+   bank_offset = (gpio - GPIO_MAX_PORT_PART_2) / GPIO_PER_BANK;
+   return (struct s5p_gpio_bank *) (EXYNOS5_GPIO_PART3_BASE + 
(bank_offset *
+   sizeof(struct s5p_gpio_bank)));
+   }
+   else
+   return (struct s5p_gpio_bank *) EXYNOS5_GPIO_PART4_BASE;
+
+   return NULL;
 }
 
-int s5p_gpio_get_pin(unsigned gpio)
+void gpio_cfg_pin(int gpio, int cfg)
 {
-   return gpio % GPIO_PER_BANK;
+   unsigned int value;
+   struct s5p_gpio_bank *bank = gpio_get_bank(gpio);
+
+   value = readl(&bank->con);
+   value &= ~CON_MASK(GPIO_BIT(gpio));
+   value |= CON_SFR(GPIO_BIT(gpio), cfg);
+   writel(value, &bank->con);
+}
+
+void gpio_set_pull(int gpio, int mode)
+{
+   unsigned int value;
+   struct s5p_gpio_bank *bank = gpio_get_bank(gpio);
+
+   value = readl(&bank->pull);
+   value &= ~PULL_MASK(GPIO_BIT(gpio));
+
+   switch (mode) {
+   case GPIO_PULL_DOWN:
+   case GPIO_PULL_UP:
+   value |= PULL_MODE(GPIO_BIT(gpio), mode);
+   break;
+   default:
+   break;
+   }
+
+   writel(value, &bank->pull);
+}
+
+void gpio_set_drv(int gpio, int mode)
+{
+   unsigned int value;
+   struct s5p_gpio_bank *bank = gpio_get_bank(gpio);
+
+   value = readl(&bank->drv);
+   value &= ~DRV_MASK(GPIO_BIT(gpio));
+
+   switch (mode) {
+   case GPIO_DRV_1X:
+   case GPIO_DRV_2X:
+   case GPIO_DRV_3X:
+   case GPIO_DRV_4X:
+   value |= DRV_SET(GPIO_BIT(gpio), mode);
+   break;
+   default:
+   return;
+   }
+
+   writel(value, &bank->drv);
 }
 
+void gpio_set_rate(int gpio, int mode)
+{
+   unsigned int value;
+   struct s5p_gpio_bank *bank = gpio_get_bank(gpio);
+
+   value = readl(&bank->drv);
+   value &= ~RATE_MASK(GPIO_BIT(gpio));
+
+   switch (mode) {
+   case GPIO_DRV_FAST:
+   case GPIO_DRV_SLOW:
+   value |= RATE_SET(GPIO_BIT(gpio));
+   break;
+   default:
+   return;
+   }
+
+   writel(value, &bank->drv);
+}
+
+int gpio_direction_input(unsigned gpio)
+{
+   gpio_cfg_pin(gpio, GPIO_INPUT);
+
+   return 0;
+}
+
+int gpio_direction_output(unsigned gpio, int value)
+{
+   unsigned int val;
+   struct s5p_gpio_bank *bank = gpio_get_bank(gpio);
+
+   gpio_cfg_pin(gpio, GPIO_OUTPUT);
+
+   val = readl(&bank->dat);
+   val &= ~DAT_MASK(GPIO_BIT(gpio));
+   if (value)
+   val |= DAT_SET(GPIO_BIT(gpio));
+   writel(val, &bank->dat);
+
+   return 0;
+}
+
+int gpio_get_value(unsigned gpio)
+{
+   unsigned int value;
+   struct s5p_gpio_bank *bank = gpio_get_bank(gpio);
+
+   value = readl(&bank->dat);
+   return !!(value & DAT_MASK(GPIO_BIT(gpio)));
+}
+
+
+int gpio_set_value(unsigned gpio, int value)
+{
+   unsigned int val;
+   struct s5p_gpio_bank *bank = gpio_get_bank(gpio);
+
+   val = readl(&bank->dat);
+   val &= ~DAT_MASK(GPIO_BIT(gpio));
+   if (value)
+   val |= DAT_SET(GPIO_BIT(gpio));
+   writel(val, &bank->dat);
+
+   return 0;
+}
+
+#else
 /* Common GPIO API */
+struct s5p_gpio_bank *s5p_gpio_get_bank(unsigned gpio)
+{
+   int bank = gpio / GPIO_PER_BANK;
+   

[U-Boot] [PATCH 1/4] EXYNOS5: Add GPIO unique pin numbering support

2012-08-06 Thread Rajeshwari Shinde
Define GPIO unique pin numbering for Exynos5 boards
Also calculates the gpio bank address for the given GPIO number

Signed-off-by: Leela Krishna Amudala 
Signed-off-by: Rajeshwari Shinde 
---
 arch/arm/include/asm/arch-exynos/gpio.h |  351 +++
 1 files changed, 351 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/gpio.h 
b/arch/arm/include/asm/arch-exynos/gpio.h
index 97be4ea..cf679d5 100644
--- a/arch/arm/include/asm/arch-exynos/gpio.h
+++ b/arch/arm/include/asm/arch-exynos/gpio.h
@@ -187,6 +187,13 @@ void s5p_gpio_set_rate(struct s5p_gpio_bank *bank, int 
gpio, int mode);
- EXYNOS5_GPIO_PART3_BASE) / sizeof(struct s5p_gpio_bank)) \
  * GPIO_PER_BANK) + pin) + EXYNOS5_GPIO_PART2_MAX)
 
+#define EXYNOS5_GPIO_PART3_MAX ((sizeof(struct exynos5_gpio_part3) \
+   / sizeof(struct s5p_gpio_bank)) * GPIO_PER_BANK)
+
+/* This macro gets gpio pin offset from 0..7 */
+#define GPIO_BIT(x)((x) & 0x7)
+
+
 static inline unsigned int s5p_gpio_base(int nr)
 {
if (cpu_is_exynos5()) {
@@ -207,6 +214,349 @@ static inline unsigned int s5p_gpio_base(int nr)
return 0;
 }
 
+/* A list of valid GPIO numbers for the asm-generic/gpio.h interface */
+enum exynos5_gpio_pin {
+   /* GPIO_PART1_STARTS */
+   GPIO_A00,
+   GPIO_A01,
+   GPIO_A02,
+   GPIO_A03,
+   GPIO_A04,
+   GPIO_A05,
+   GPIO_A06,
+   GPIO_A07,
+   GPIO_A10,
+   GPIO_A11,
+   GPIO_A12,
+   GPIO_A13,
+   GPIO_A14,
+   GPIO_A15,
+   GPIO_A16,
+   GPIO_A17,
+   GPIO_A20,
+   GPIO_A21,
+   GPIO_A22,
+   GPIO_A23,
+   GPIO_A24,
+   GPIO_A25,
+   GPIO_A26,
+   GPIO_A27,
+   GPIO_B00,
+   GPIO_B01,
+   GPIO_B02,
+   GPIO_B03,
+   GPIO_B04,
+   GPIO_B05,
+   GPIO_B06,
+   GPIO_B07,
+   GPIO_B10,
+   GPIO_B11,
+   GPIO_B12,
+   GPIO_B13,
+   GPIO_B14,
+   GPIO_B15,
+   GPIO_B16,
+   GPIO_B17,
+   GPIO_B20,
+   GPIO_B21,
+   GPIO_B22,
+   GPIO_B23,
+   GPIO_B24,
+   GPIO_B25,
+   GPIO_B26,
+   GPIO_B27,
+   GPIO_B30,
+   GPIO_B31,
+   GPIO_B32,
+   GPIO_B33,
+   GPIO_B34,
+   GPIO_B35,
+   GPIO_B36,
+   GPIO_B37,
+   GPIO_C00,
+   GPIO_C01,
+   GPIO_C02,
+   GPIO_C03,
+   GPIO_C04,
+   GPIO_C05,
+   GPIO_C06,
+   GPIO_C07,
+   GPIO_C10,
+   GPIO_C11,
+   GPIO_C12,
+   GPIO_C13,
+   GPIO_C14,
+   GPIO_C15,
+   GPIO_C16,
+   GPIO_C17,
+   GPIO_C20,
+   GPIO_C21,
+   GPIO_C22,
+   GPIO_C23,
+   GPIO_C24,
+   GPIO_C25,
+   GPIO_C26,
+   GPIO_C27,
+   GPIO_C30,
+   GPIO_C31,
+   GPIO_C32,
+   GPIO_C33,
+   GPIO_C34,
+   GPIO_C35,
+   GPIO_C36,
+   GPIO_C37,
+   GPIO_D00,
+   GPIO_D01,
+   GPIO_D02,
+   GPIO_D03,
+   GPIO_D04,
+   GPIO_D05,
+   GPIO_D06,
+   GPIO_D07,
+   GPIO_D10,
+   GPIO_D11,
+   GPIO_D12,
+   GPIO_D13,
+   GPIO_D14,
+   GPIO_D15,
+   GPIO_D16,
+   GPIO_D17,
+   GPIO_Y00,
+   GPIO_Y01,
+   GPIO_Y02,
+   GPIO_Y03,
+   GPIO_Y04,
+   GPIO_Y05,
+   GPIO_Y06,
+   GPIO_Y07,
+   GPIO_Y10,
+   GPIO_Y11,
+   GPIO_Y12,
+   GPIO_Y13,
+   GPIO_Y14,
+   GPIO_Y15,
+   GPIO_Y16,
+   GPIO_Y17,
+   GPIO_Y20,
+   GPIO_Y21,
+   GPIO_Y22,
+   GPIO_Y23,
+   GPIO_Y24,
+   GPIO_Y25,
+   GPIO_Y26,
+   GPIO_Y27,
+   GPIO_Y30,
+   GPIO_Y31,
+   GPIO_Y32,
+   GPIO_Y33,
+   GPIO_Y34,
+   GPIO_Y35,
+   GPIO_Y36,
+   GPIO_Y37,
+   GPIO_Y40,
+   GPIO_Y41,
+   GPIO_Y42,
+   GPIO_Y43,
+   GPIO_Y44,
+   GPIO_Y45,
+   GPIO_Y46,
+   GPIO_Y47,
+   GPIO_Y50,
+   GPIO_Y51,
+   GPIO_Y52,
+   GPIO_Y53,
+   GPIO_Y54,
+   GPIO_Y55,
+   GPIO_Y56,
+   GPIO_Y57,
+   GPIO_Y60,
+   GPIO_Y61,
+   GPIO_Y62,
+   GPIO_Y63,
+   GPIO_Y64,
+   GPIO_Y65,
+   GPIO_Y66,
+   GPIO_Y67,
+   GPIO_C40 = GPIO_Y67 + 1 + (0x3 * GPIO_PER_BANK),
+   GPIO_C41,
+   GPIO_C42,
+   GPIO_C43,
+   GPIO_C44,
+   GPIO_C45,
+   GPIO_C46,
+   GPIO_C47,
+   GPIO_X00 = GPIO_C47 + 1 + (0x48 * GPIO_PER_BANK),
+   GPIO_X01,
+   GPIO_X02,
+   GPIO_X03,
+   GPIO_X04,
+   GPIO_X05,
+   GPIO_X06,
+   GPIO_X07,
+   GPIO_X10,
+   GPIO_X11,
+   GPIO_X12,
+   GPIO_X13,
+   GPIO_X14,
+   GPIO_X15,
+   GPIO_X16,
+   GPIO_X17,
+   GPIO_X20,
+   GPIO_X21,
+   GPIO_X22,
+   GPIO_X23,
+   GPIO_X24,
+   GPIO_X25,
+   GPIO_X26,
+   GPIO_X27,
+   GPIO_X30,
+   GPIO_X31,
+   GPIO_X32,
+   GPIO_X33,
+   GPIO_X34,
+   GPIO_X35,
+   GPIO_X36,
+   GPIO_X

[U-Boot] [PATCH 0/4] EXYNOS5: Add GPIO numbering feature

2012-08-06 Thread Rajeshwari Shinde
This patchset adds GPIO numbering feature where pinmux setting
can be done just by seding the pin munber and we do not have to
remember which bank it belongs to.

Rajeshwari Shinde (4):
  EXYNOS5: Add GPIO unique pin numbering support
  S5P: GPIO: Add GPIO pin numbering to driver
  EXYNOS5: Enable GPIO Numbering.
  EXYNOS: Update pinmux to use gpio numbering

 arch/arm/cpu/armv7/exynos/pinmux.c  |  150 ++
 arch/arm/include/asm/arch-exynos/gpio.h |  351 +++
 drivers/gpio/s5p_gpio.c |  158 +-
 include/configs/smdk5250.h  |3 +
 4 files changed, 569 insertions(+), 93 deletions(-)

-- 
1.7.4.4

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


Re: [U-Boot] [PATCH] MAINTAINERS: cleanup for km ppc boards

2012-08-06 Thread Heiko Schocher

Hello Holger,

On 06.08.2012 14:16, Holger Brunck wrote:

Signed-off-by: Holger Brunck
cc: Heiko Schocher
cc: Valentin Longchamp
cc: Gerlando Falauto

---
  MAINTAINERS |6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)


Acked-by: Heiko Schocher 

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


Re: [U-Boot] [PATCH] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Andreas Bießmann
Dear Markus Hubig,

On 02.08.2012 16:14, Markus Hubig wrote:
> On Wed, Aug 01, 2012 at 11:58:22AM +0200, Andreas Bießmann wrote:
>> On 30.07.12 20:01, Markus Hubig wrote:
>>>
> 
> 
> 
>>> +int board_early_init_f(void)
>>> +{
>>> +   struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
>>> +
>>> +   /* Enable clocks for all PIOs */
>>> +   writel((1 << ATMEL_ID_PIOA) | (1 << ATMEL_ID_PIOB) |
>>> +   (1 << ATMEL_ID_PIOC), &pmc->pcer);
>>
>> you should initialize seriald_hw here to avoid strange characters on
>> serial line when switching from at91bootstrap to u-boot.
> 
> 
> 
>>> +   /* adress of boot parameters */
>>> +   gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
>>> +
>>> +   at91_set_gpio_output(AT91_PIN_PC9, 1);
>>> +   at91_set_gpio_output(AT91_PIN_PC5, 1);
>>
>> Can you please add some comment why switching these pins?
> 
> OK now I now that PC5 switches the red LED on and there since is a
> LED framework in u-boot I will use that in a later patch.
> 
> PC9 is somewhat strange. If I set it to 0 I don't have a console!

can you please ask at taskit what function this pin has and document it
here?

> So I tried to put both
> 
> | at91_set_gpio_output(AT91_PIN_PC9, 1);
> | at91_seriald_hw_init();
> 
> into board_early_init_f() to avoid the strange characters at boot time,
> but again no console output ...
> 
> Further tests showed that It seems that I can't use at91_set_gpio_output()
> inside board_early_init_f(). Switching on the red LED with PC5 also do not
> work in board_early_init_f() ...
> 
> Any ideas?

Not currently. Maybe the PC9 has some vital functionality for UART to
work (some switch, power, ...) and is reset by another part running
after board_early_init_f()?

> 
> Cheers, Markus

Best regards

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


[U-Boot] [PATCH v5 6/7] arm:trats: Support for USB UDC driver at TRATS board.

2012-08-06 Thread Lukasz Majewski
Support for USB UDC driver at trats board.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
Cc: Minkyu Kang 

---
Changes for v2:
- replace puts to debug

Changes for v3:
- None

Changes for v4:
- None

Changes for v5:
- None
---
 board/samsung/trats/trats.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index a8b2b11..4f9cb5a 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -59,6 +59,8 @@ static int hwrevision(int rev)
return (board_rev & 0xf) == rev;
 }
 
+struct s3c_plat_otg_data s5pc210_otg_data;
+
 int board_init(void)
 {
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
@@ -259,6 +261,12 @@ struct s3c_plat_otg_data s5pc210_otg_data = {
.usb_phy_ctrl   = EXYNOS4_USBPHY_CONTROL,
.usb_flags  = PHY0_SLEEP,
 };
+
+void board_usb_init(void)
+{
+   debug("USB_udc_probe\n");
+   s3c_udc_probe(&s5pc210_otg_data);
+}
 #endif
 
 static void pmic_reset(void)
-- 
1.7.2.3

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


[U-Boot] [PATCH v5 7/7] arm:trats: Enable g_dnl composite USB gadget with embedded DFU function on TRATS

2012-08-06 Thread Lukasz Majewski
Enable the g_dnl composite USB gadget driver with embedded DFU function on it.
It now uses the composite gadget framework to support download specific
USB functions (like enabled DFU or USB Mass Storage).

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 
Cc: Minkyu Kang 

---
Change for v2:
- Move the G_DNL_{VENDOR_NUM, PRODUCT_NUM and MANUFACTURER} definitions to
  ./include/configs/.h

Changes for v3:
- None

Changes for v4:
- None

Changes for v5:
- None
---
 include/configs/trats.h |   24 +++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/include/configs/trats.h b/include/configs/trats.h
index eb269b2..75a23b0 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -94,6 +94,21 @@
 #undef CONFIG_CMD_ONENAND
 #undef CONFIG_CMD_MTDPARTS
 #define CONFIG_CMD_MMC
+#define CONFIG_CMD_DFU
+
+/* FAT */
+#define CONFIG_CMD_FAT
+#define CONFIG_FAT_WRITE
+
+/* USB Composite download gadget - g_dnl */
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_MMC
+
+/* USB Samsung's IDs */
+#define CONFIG_G_DNL_VENDOR_NUM 0x04E8
+#define CONFIG_G_DNL_PRODUCT_NUM 0x6601
+#define CONFIG_G_DNL_MANUFACTURER "Samsung"
 
 #define CONFIG_BOOTDELAY   1
 #define CONFIG_ZERO_BOOTDELAY_CHECK
@@ -104,6 +119,11 @@
 #define CONFIG_BOOTBLOCK   "10"
 #define CONFIG_ENV_COMMON_BOOT "${console} ${meminfo}"
 
+#define CONFIG_DFU_ALT \
+   "dfu_alt_info=" \
+   "u-boot mmc 80 400;" \
+   "uImage fat 0 2\0" \
+
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
@@ -146,7 +166,8 @@
"mmcdev=0\0" \
"mmcbootpart=2\0" \
"mmcrootpart=3\0" \
-   "opts=always_resume=1"
+   "opts=always_resume=1\0" \
+   CONFIG_DFU_ALT
 
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
@@ -209,6 +230,7 @@
 #define CONFIG_USB_GADGET
 #define CONFIG_USB_GADGET_S3C_UDC_OTG
 #define CONFIG_USB_GADGET_DUALSPEED
+#define CONFIG_USB_GADGET_VBUS_DRAW2
 
 /* LCD */
 #define CONFIG_EXYNOS_FB
-- 
1.7.2.3

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


[U-Boot] [PATCH v5 5/7] dfu:cmd: Support for DFU u-boot command

2012-08-06 Thread Lukasz Majewski
Support for u-boot's command line command "dfu   [list]".

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 

---
Changes for v2:
- None

Changes for v3:
- Remove unnecessary initialization to NULL of dynamic variables
- goto done added to reduce code duplication
- static definition of do_dfu()

Changes for v4:
- Define "dfu" string as an array

Changes for v5:
- None
---
 common/Makefile  |1 +
 common/cmd_dfu.c |   81 ++
 2 files changed, 82 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_dfu.c

diff --git a/common/Makefile b/common/Makefile
index 483eb4d..32d44e5 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -183,6 +183,7 @@ COBJS-$(CONFIG_MENU) += menu.o
 COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
 COBJS-$(CONFIG_UPDATE_TFTP) += update.o
 COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
+COBJS-$(CONFIG_CMD_DFU) += cmd_dfu.o
 endif
 
 ifdef CONFIG_SPL_BUILD
diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c
new file mode 100644
index 000..62fb890
--- /dev/null
+++ b/common/cmd_dfu.c
@@ -0,0 +1,81 @@
+/*
+ * cmd_dfu.c -- dfu command
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ * authors: Andrzej Pietrasiewicz 
+ * Lukasz Majewski 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   const char *str_env;
+   char s[] = "dfu";
+   char *env_bkp;
+   int ret;
+
+   if (argc < 3)
+   return CMD_RET_USAGE;
+
+   str_env = getenv("dfu_alt_info");
+   if (str_env == NULL) {
+   printf("%s: \"dfu_alt_info\" env variable not defined!\n",
+  __func__);
+   return CMD_RET_FAILURE;
+   }
+
+   env_bkp = strdup(str_env);
+   ret = dfu_config_entities(env_bkp, argv[1],
+   (int)simple_strtoul(argv[2], NULL, 10));
+   if (ret)
+   return CMD_RET_FAILURE;
+
+   if (strcmp(argv[3], "list") == 0) {
+   dfu_show_entities();
+   goto done;
+   }
+
+   board_usb_init();
+   g_dnl_register(s);
+   while (1) {
+   if (ctrlc())
+   goto exit;
+
+   usb_gadget_handle_interrupts();
+   }
+exit:
+   g_dnl_unregister();
+done:
+   dfu_free_entities();
+   free(env_bkp);
+
+   return CMD_RET_SUCCESS;
+}
+
+U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu,
+   "Device Firmware Upgrade",
+   "  [list]\n"
+   "  - device firmware upgrade on a device \n"
+   "attached to interface \n"
+   "[list] - list available alt settings"
+);
-- 
1.7.2.3

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


[U-Boot] [PATCH v5 4/7] dfu: MMC specific routines for DFU operation

2012-08-06 Thread Lukasz Majewski
Support for MMC storage devices to work with DFU framework.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 

---
Changes for v2:
- None

Changes for v3:
- Provide special abstraction layer (mmc_{block|file}_{read|write})
  to alleviate switch to new device model (DM)
- More verbose messages when not supported layout encountered
- Calls to strncmp() replaced with strcmp()

Changes for v4:
- Remove superfluous memset() calls
- Replace ALLOC_CACHE_ALIGN_BUFFER with plain table definition
- Cosmetic changes with pointers definition

Changes for v5:
- None
---
 drivers/dfu/Makefile  |1 +
 drivers/dfu/dfu_mmc.c |  162 +
 2 files changed, 163 insertions(+), 0 deletions(-)
 create mode 100644 drivers/dfu/dfu_mmc.c

diff --git a/drivers/dfu/Makefile b/drivers/dfu/Makefile
index 7736485..7b717bc 100644
--- a/drivers/dfu/Makefile
+++ b/drivers/dfu/Makefile
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)libdfu.o
 
 COBJS-$(CONFIG_DFU_FUNCTION) += dfu.o
+COBJS-$(CONFIG_DFU_MMC) += dfu_mmc.o
 
 SRCS:= $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS-y))
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
new file mode 100644
index 000..060145b
--- /dev/null
+++ b/drivers/dfu/dfu_mmc.c
@@ -0,0 +1,162 @@
+/*
+ * dfu.c -- DFU back-end routines
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ * author: Lukasz Majewski 
+ *
+ * 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 
+#include 
+#include 
+
+enum dfu_mmc_op {
+   DFU_OP_READ = 1,
+   DFU_OP_WRITE,
+};
+
+static int mmc_block_op(enum dfu_mmc_op op, struct dfu_entity *dfu,
+   void *buf, long *len)
+{
+   char cmd_buf[DFU_CMD_BUF_SIZE];
+
+   sprintf(cmd_buf, "mmc %s 0x%x %x %x",
+   op == DFU_OP_READ ? "read" : "write",
+   (unsigned int) buf,
+   dfu->data.mmc.lba_start,
+   dfu->data.mmc.lba_size);
+
+   if (op == DFU_OP_READ)
+   *len = dfu->data.mmc.lba_blk_size * dfu->data.mmc.lba_size;
+
+   debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf);
+   return run_command(cmd_buf, 0);
+}
+
+static inline int mmc_block_write(struct dfu_entity *dfu, void *buf, long *len)
+{
+   return mmc_block_op(DFU_OP_WRITE, dfu, buf, len);
+}
+
+static inline int mmc_block_read(struct dfu_entity *dfu, void *buf, long *len)
+{
+   return mmc_block_op(DFU_OP_READ, dfu, buf, len);
+}
+
+static int mmc_file_op(enum dfu_mmc_op op, struct dfu_entity *dfu,
+   void *buf, long *len)
+{
+   char cmd_buf[DFU_CMD_BUF_SIZE];
+   char *str_env;
+   int ret;
+
+   sprintf(cmd_buf, "fat%s mmc %d:%d 0x%x %s %lx",
+   op == DFU_OP_READ ? "load" : "write",
+   dfu->data.mmc.dev, dfu->data.mmc.part,
+   (unsigned int) buf, dfu->name, *len);
+
+   debug("%s: %s 0x%p\n", __func__, cmd_buf, cmd_buf);
+
+   ret = run_command(cmd_buf, 0);
+   if (ret) {
+   puts("dfu: Read error!\n");
+   return ret;
+   }
+
+   if (dfu->layout != DFU_RAW_ADDR) {
+   str_env = getenv("filesize");
+   if (str_env == NULL) {
+   puts("dfu: Wrong file size!\n");
+   return -1;
+   }
+   *len = simple_strtoul(str_env, NULL, 16);
+   }
+
+   return ret;
+}
+
+static inline int mmc_file_write(struct dfu_entity *dfu, void *buf, long *len)
+{
+   return mmc_file_op(DFU_OP_WRITE, dfu, buf, len);
+}
+
+static inline int mmc_file_read(struct dfu_entity *dfu, void *buf, long *len)
+{
+   return mmc_file_op(DFU_OP_READ, dfu, buf, len);
+}
+
+int dfu_write_medium_mmc(struct dfu_entity *dfu, void *buf, long *len)
+{
+   int ret = -1;
+
+   switch (dfu->layout) {
+   case DFU_RAW_ADDR:
+   ret = mmc_block_write(dfu, buf, len);
+   break;
+   case DFU_FS_FAT:
+   ret = mmc_file_write(dfu, buf, len);
+   break;
+   default:
+   printf("%s: Layout (%s) not (yet) supported!\n", __func__,
+  dfu_get_layout(dfu->layout));
+   }
+
+   return ret;
+}
+
+int dfu_read_medium_mmc(struct dfu_entity *dfu, void *buf, long

[U-Boot] [PATCH v5 3/7] dfu: DFU backend implementation

2012-08-06 Thread Lukasz Majewski
New, separate driver at ./drivers/dfu has been added. It allows platform
and storage independent operation of DFU.
It has been extended to use new MMC level of command abstraction.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 

---
Changes for v2:
- None

Changes for v3:
- Remove unnecessary NULL and 0 initialization of dynamic variables
- Combine two puts to one
- Adding const qualifier to device and layout definitions
- Remove unnecessary casting at dfu->name passing
- Provide more meaningful names for dfu layouts and device types
- Removal of dfu_extract_{token|entity} functions and replace them
  with strsep calls

Changes for v4:
- Remove unnecessary memset
- const added where applicable
- Handling calloc failure in dfu_config_entries()

Changes for v5:
- Replace several calls to calloc(sizeof(struct dfu_entity), 1);
  with only one, done outside the for loop
---
 Makefile |1 +
 drivers/dfu/Makefile |   43 +
 drivers/dfu/dfu.c|  238 ++
 include/dfu.h|  103 ++
 4 files changed, 385 insertions(+), 0 deletions(-)
 create mode 100644 drivers/dfu/Makefile
 create mode 100644 drivers/dfu/dfu.c
 create mode 100644 include/dfu.h

diff --git a/Makefile b/Makefile
index eb37ea1..67c627d 100644
--- a/Makefile
+++ b/Makefile
@@ -271,6 +271,7 @@ LIBS += drivers/pci/libpci.o
 LIBS += drivers/pcmcia/libpcmcia.o
 LIBS += drivers/power/libpower.o
 LIBS += drivers/spi/libspi.o
+LIBS += drivers/dfu/libdfu.o
 ifeq ($(CPU),mpc83xx)
 LIBS += drivers/qe/libqe.o
 LIBS += arch/powerpc/cpu/mpc8xxx/ddr/libddr.o
diff --git a/drivers/dfu/Makefile b/drivers/dfu/Makefile
new file mode 100644
index 000..7736485
--- /dev/null
+++ b/drivers/dfu/Makefile
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2012 Samsung Electronics
+# Lukasz Majewski 
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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)libdfu.o
+
+COBJS-$(CONFIG_DFU_FUNCTION) += dfu.o
+
+SRCS:= $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
new file mode 100644
index 000..e8477fb
--- /dev/null
+++ b/drivers/dfu/dfu.c
@@ -0,0 +1,238 @@
+/*
+ * dfu.c -- DFU back-end routines
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ * author: Lukasz Majewski 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static LIST_HEAD(dfu_list);
+static int dfu_alt_num;
+
+static int dfu_find_alt_num(const char *s)
+{
+   int i = 0;
+
+   for (; *s; s++)
+   if (*s == ';')
+   i++;
+
+   return ++i;
+}
+
+static unsigned char __aligned(CONFIG_SYS_CACHELINE_SIZE)
+dfu_buf[DFU_DATA_BUF_SIZE];
+
+int dfu_write(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
+{
+   static unsigned char *i_buf;
+   static int i_blk_seq_num;
+   long w_size = 0;
+   int ret = 0;
+
+   debug("%s: name: %s buf: 0x%p size: 0x%x p_num: 0x%x i_buf: 0x%p\n",
+  __func__, dfu->name, buf, size, blk_seq_num, i_buf);
+
+   if (blk_seq_num == 0) {
+

[U-Boot] [PATCH v5 2/7] dfu:usb: DFU USB function (f_dfu) support for g_dnl composite gadget

2012-08-06 Thread Lukasz Majewski
Support for f_dfu USB function.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 

---
Changes for v2:

- Replace kzalloc and kfree with free and calloc
- Reorganization of calloc calls
- Misspelling corrected
- Redesign of DFU state machine from "switch case" to function pointers
- Split the dfu_handle method to separate functions for each DFU state

Changes for v3:
- Missing parenthesis added to sizeof call

Changes for v4:
- Replace two puts with one
- Remove the 0xff at handle_getstate function
- Add const qualifier to struct definitions when possible

Changes for v5:
- None
---
 drivers/usb/gadget/Makefile |1 +
 drivers/usb/gadget/f_dfu.c  |  749 +++
 drivers/usb/gadget/f_dfu.h  |  100 ++
 3 files changed, 850 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/f_dfu.c
 create mode 100644 drivers/usb/gadget/f_dfu.h

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 2c067c8..5bbdd36 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -30,6 +30,7 @@ ifdef CONFIG_USB_GADGET
 COBJS-y += epautoconf.o config.o usbstring.o
 COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
 COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
+COBJS-$(CONFIG_DFU_FUNCTION) += f_dfu.o
 endif
 ifdef CONFIG_USB_ETHER
 COBJS-y += ether.o epautoconf.o config.o usbstring.o
diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
new file mode 100644
index 000..3ec4c65
--- /dev/null
+++ b/drivers/usb/gadget/f_dfu.c
@@ -0,0 +1,749 @@
+/*
+ * f_dfu.c -- Device Firmware Update USB function
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ * authors: Andrzej Pietrasiewicz 
+ *  Lukasz Majewski 
+ *
+ * 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 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include "f_dfu.h"
+
+struct f_dfu {
+   struct usb_function usb_function;
+
+   struct usb_descriptor_header**function;
+   struct usb_string   *strings;
+
+   /* when configured, we have one config */
+   u8  config;
+   u8  altsetting;
+   enum dfu_state  dfu_state;
+   unsigned intdfu_status;
+
+   /* Send/received block number is handy for data integrity check */
+   int blk_seq_num;
+};
+
+typedef int (*dfu_state_fn) (struct f_dfu *,
+const struct usb_ctrlrequest *,
+struct usb_gadget *,
+struct usb_request *);
+
+static inline struct f_dfu *func_to_dfu(struct usb_function *f)
+{
+   return container_of(f, struct f_dfu, usb_function);
+}
+
+static const struct dfu_function_descriptor dfu_func = {
+   .bLength =  sizeof dfu_func,
+   .bDescriptorType =  DFU_DT_FUNC,
+   .bmAttributes = DFU_BIT_WILL_DETACH |
+   DFU_BIT_MANIFESTATION_TOLERANT |
+   DFU_BIT_CAN_UPLOAD |
+   DFU_BIT_CAN_DNLOAD,
+   .wDetachTimeOut =   0,
+   .wTransferSize =DFU_USB_BUFSIZ,
+   .bcdDFUVersion =__constant_cpu_to_le16(0x0110),
+};
+
+static struct usb_interface_descriptor dfu_intf_runtime = {
+   .bLength =  sizeof dfu_intf_runtime,
+   .bDescriptorType =  USB_DT_INTERFACE,
+   .bNumEndpoints =0,
+   .bInterfaceClass =  USB_CLASS_APP_SPEC,
+   .bInterfaceSubClass =   1,
+   .bInterfaceProtocol =   1,
+   /* .iInterface = DYNAMIC */
+};
+
+static struct usb_descriptor_header *dfu_runtime_descs[] = {
+   (struct usb_descriptor_header *) &dfu_intf_runtime,
+   NULL,
+};
+
+static const struct usb_qualifier_descriptor dev_qualifier = {
+   .bLength =  sizeof dev_qualifier,
+   .bDescriptorType =  USB_DT_DEVICE_QUALIFIER,
+   .bcdUSB =   __constant_cpu_to_le16(0x0200),
+   .bDeviceClass = USB_CLASS_VENDOR_SPEC,
+   .bNumConfigurations =   1,
+};
+
+static const char dfu_name[] = "Device Firmware Upgrade";
+
+/*
+ * static strings, in UTF-8
+ *
+ * dfu

[U-Boot] [PATCH v5 1/7] dfu:usb: Support for g_dnl composite download gadget.

2012-08-06 Thread Lukasz Majewski
Composite USB download gadget support (g_dnl) for download functions.
This code works on top of composite gadget.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Marek Vasut 

---
Changes for v2:

- G_DNL_{VENDOR_NUM, PRODUCT_NUM and MANUFACTURER} defined at
./include/configs/.h
- Suspend and resume stub methods removed
- '\0' repleaced with plain 0

Changes for v3:
- Remove unused #includes
- Replace strncpy and strncat with strcpy and strcat. It was possible
  due to new approach to g_dnl name generation (at g_dnl_register function)
- Rename the g_dnl_{init|cleanup} to g_dnl_{register|unregister}
- Replace the G_DNL_* CONFIG_G_DNL_*

Changes for v4:
- Remove unnecessary otg calls
- odin prefix replaced with g_dnl
- Single space indentation between type and variable name

Changes for v5:
- None
---
 drivers/usb/gadget/Makefile |1 +
 drivers/usb/gadget/g_dnl.c  |  202 +++
 include/g_dnl.h |   33 +++
 3 files changed, 236 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/g_dnl.c
 create mode 100644 include/g_dnl.h

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 87d1918..2c067c8 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -29,6 +29,7 @@ LIB   := $(obj)libusb_gadget.o
 ifdef CONFIG_USB_GADGET
 COBJS-y += epautoconf.o config.o usbstring.o
 COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
+COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
 endif
 ifdef CONFIG_USB_ETHER
 COBJS-y += ether.o epautoconf.o config.o usbstring.o
diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
new file mode 100644
index 000..7d87050
--- /dev/null
+++ b/drivers/usb/gadget/g_dnl.c
@@ -0,0 +1,202 @@
+/*
+ * g_dnl.c -- USB Downloader Gadget
+ *
+ * Copyright (C) 2012 Samsung Electronics
+ * Lukasz Majewski  
+ *
+ * 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 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include "f_dfu.h"
+
+#include "gadget_chips.h"
+#include "composite.c"
+
+/*
+ * One needs to define the following:
+ * CONFIG_G_DNL_VENDOR_NUM
+ * CONFIG_G_DNL_PRODUCT_NUM
+ * CONFIG_G_DNL_MANUFACTURER
+ * at e.g. ./include/configs/.h
+ */
+
+#define STRING_MANUFACTURER 25
+#define STRING_PRODUCT 2
+#define STRING_USBDOWN 2
+#define CONFIG_USBDOWNLOADER 2
+
+#define DRIVER_VERSION "usb_dnl 2.0"
+
+static const char shortname[] = "usb_dnl_";
+static const char product[] = "USB download gadget";
+static const char manufacturer[] = CONFIG_G_DNL_MANUFACTURER;
+
+static struct usb_device_descriptor device_desc = {
+   .bLength = sizeof device_desc,
+   .bDescriptorType = USB_DT_DEVICE,
+
+   .bcdUSB = __constant_cpu_to_le16(0x0200),
+   .bDeviceClass = USB_CLASS_COMM,
+   .bDeviceSubClass = 0x02, /*0x02:CDC-modem , 0x00:CDC-serial*/
+
+   .idVendor = __constant_cpu_to_le16(CONFIG_G_DNL_VENDOR_NUM),
+   .idProduct = __constant_cpu_to_le16(CONFIG_G_DNL_PRODUCT_NUM),
+   .iProduct = STRING_PRODUCT,
+   .bNumConfigurations = 1,
+};
+
+/* static strings, in UTF-8 */
+static struct usb_string g_dnl_string_defs[] = {
+   { 0, manufacturer, },
+   { 1, product, },
+};
+
+static struct usb_gadget_strings g_dnl_string_tab = {
+   .language = 0x0409, /* en-us */
+   .strings = g_dnl_string_defs,
+};
+
+static struct usb_gadget_strings *g_dnl_composite_strings[] = {
+   &g_dnl_string_tab,
+   NULL,
+};
+
+static int g_dnl_unbind(struct usb_composite_dev *cdev)
+{
+   debug("%s\n", __func__);
+   return 0;
+}
+
+static int g_dnl_do_config(struct usb_configuration *c)
+{
+   const char *s = c->cdev->driver->name;
+   int ret = -1;
+
+   debug("%s: configuration: 0x%p composite dev: 0x%p\n",
+ __func__, c, c->cdev);
+
+   printf("GADGET DRIVER: %s\n", s);
+   if (!strcmp(s, "usb_dnl_dfu"))
+   ret = dfu_add(c);
+
+   return ret;
+}
+
+static int g_dnl_config_register(struct usb_composite_dev *cdev)
+{
+   static struct usb_configuration config = {
+   .label = "usb_dnload",
+   .bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
+   .bConfigurationValue =  CONFIG_USBDOWNLOADER,
+   .iConfigu

[U-Boot] [PATCH v5 0/7] dfu:usb: DFU support via USB Download gadget

2012-08-06 Thread Lukasz Majewski
Those patches add support for composite USB download gadget.
This gadget (at least for now) is equipped with DFU download function.

A separate DFU back-end and front-end have been added.
Back-end is placed at ./drivers/dfu directory. The front-end is implemented
as USB function.

The back-end is written in a generic manner with storage device specific
code separated (eMMC).

DFU specification can be found at:
http://wiki.openmoko.org/wiki/USB_DFU_-_The_USB_Device_Firmware_Upgrade_standard

Example usage:

u-boot side: dfu mmc 0
PC: dfu-util -U IMAGE.bin -a uImage (for upload)
dfu-util -D uImage -a uImage (download)

To list the alt settings:
dfu mmc 0 list

Test HW:
Exynos4210 Trats board

Lukasz Majewski (7):
  dfu:usb: Support for g_dnl composite download gadget.
  dfu:usb: DFU USB function (f_dfu) support for g_dnl composite gadget
  dfu: DFU backend implementation
  dfu: MMC specific routines for DFU operation
  dfu:cmd: Support for DFU u-boot command
  arm:trats: Support for USB UDC driver at TRATS board.
  arm:trats: Enable g_dnl composite USB gadget with embedded DFU
function on TRATS

 Makefile|1 +
 board/samsung/trats/trats.c |8 +
 common/Makefile |1 +
 common/cmd_dfu.c|   81 +
 drivers/dfu/Makefile|   44 +++
 drivers/dfu/dfu.c   |  238 ++
 drivers/dfu/dfu_mmc.c   |  162 ++
 drivers/usb/gadget/Makefile |2 +
 drivers/usb/gadget/f_dfu.c  |  749 +++
 drivers/usb/gadget/f_dfu.h  |  100 ++
 drivers/usb/gadget/g_dnl.c  |  202 
 include/configs/trats.h |   24 ++-
 include/dfu.h   |  103 ++
 include/g_dnl.h |   33 ++
 14 files changed, 1747 insertions(+), 1 deletions(-)
 create mode 100644 common/cmd_dfu.c
 create mode 100644 drivers/dfu/Makefile
 create mode 100644 drivers/dfu/dfu.c
 create mode 100644 drivers/dfu/dfu_mmc.c
 create mode 100644 drivers/usb/gadget/f_dfu.c
 create mode 100644 drivers/usb/gadget/f_dfu.h
 create mode 100644 drivers/usb/gadget/g_dnl.c
 create mode 100644 include/dfu.h
 create mode 100644 include/g_dnl.h

-- 
1.7.2.3

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


Re: [U-Boot] [PATCHv2] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Andreas Bießmann
Dear Markus Hubig,

On 02.08.2012 12:46, Markus Hubig wrote:
> On Wed, Aug 01, 2012 at 10:59:10PM +0200, Andreas Bießmann wrote:
>> On 01.08.12 21:57, Markus Hubig wrote:

> Btw: I think it would be easier to handle if all the options in
> env_common.h would be prefixed with CONFIG_ENV_* ...

feel free to send patches. I dunno if they will be accepted.

Best regards

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


Re: [U-Boot] [PATCH] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Andreas Bießmann
Dear Markus Hubig,

On 03.08.2012 14:05, Markus Hubig wrote:
> On Thu, Aug 02, 2012 at 03:28:30PM +0200, Markus Hubig wrote:
>> On Wed, Aug 01, 2012 at 10:21:04PM +0200, Andreas Bießmann wrote:
>>> On 01.08.12 21:28, Markus Hubig wrote:
 On Wed, Aug 01, 2012 at 11:58:22AM +0200, Andreas Bießmann wrote:
>> +/* Need to reset PHY -> 500ms reset */
>> +writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13) |
>> +AT91_RSTC_MR_URSTEN, &rstc->mr);
>
> Hmm ... is it OK to generate the user reset here? I know this is the
> same in at least at91sam9263ek, can you please check if we should
> instead delete that bit in MR?

 MR? Sorry I don't get this one. Please explain a bit ...
>>>
>>> I talked about URSTEN bit in RSTC_MR (Reset Controller Mode Register;
>>> p99 in at91sam9g20 datasheet). The URSTEN bit set to 1 means disable low
>>> level detection on NRST pin. Which in fact disables external reset with
>>> the reset key. One have to check if this is true or maybe I'm wrong here.
>>
>> Hmm ok I'll investigate this a bit further ...
> 
> OK I looked this up in the at91sam9g20 datasheet, but as fahr as I understand
> it, setting AT91_RSTC_MR_URSTEN enables the *detection* of a low level on NRST
> to trigger USER RESET, while in order to perform the PHY Reset, NRST just hast
> to get low. To get NRST low, one has to set EXTRST in RSTC_CR.

correct.

> 
> So to perform a PHY Reset, the correct code should be:
> 
> | /* Reset PHY for 500ms */
> | writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13)
> | & ~AT91_RSTC_MR_URSTEN, &rstc->mr);
> | writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);
> 
> I tested it with my PortuxG20 and Network is still working!
> 
> Unfortunatlie the Portux has no reset button, but I think for all at91sam9g20
> boards with a reset button the AT91_RSTC_MR_URSTEN has to be high by default,
> so somewhere in arch/arm/cpu/arm926ejs/at91/ there has to be some code like
> this:
> 
> |#ifdef CONFIG_AT91_RESET_BUTTON
> |struct at91_rstc *rstc = (struct at91_rstc *)ATMEL_BASE_RSTC;
> |writel(AT91_RSTC_KEY | AT91_RSTC_MR_URSTEN, &rstc->mr);
> |#endif

Well, I think it is up to the board maintainer to verify the reset
switch is working.

Best regards

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


[U-Boot] [PATCH] MAINTAINERS: cleanup for km ppc boards

2012-08-06 Thread Holger Brunck
Signed-off-by: Holger Brunck 
cc: Heiko Schocher 
cc: Valentin Longchamp 
cc: Gerlando Falauto 

---
 MAINTAINERS |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 84413de..c8d66b8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -72,6 +72,9 @@ Holger Brunck 
 
kmeter1 MPC8360
kmcoge5ne   MPC8360
+   mgcoge  MPC8247
+   mgcoge3ne   MPC8247
+   suvd3   MPC8321
tuge1   MPC8321
tuxx1   MPC8321
 
@@ -441,13 +444,10 @@ Heiko Schocher 
ids8247 MPC8247
jupiter MPC5200
kmsupx5 MPC8321
-   mgcoge  MPC8247
-   mgcoge3ne   MPC8247
mucmc52 MPC5200
muas3001MPC8270
municse MPC5200
sc3 PPC405GP
-   suvd3   MPC8321
uc101   MPC5200
ve8313  MPC8313
 
-- 
1.7.1

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


Re: [U-Boot] [PATCH 1/2] m28evk: Turn on caches

2012-08-06 Thread Marek Vasut
Dear Stefano Babic,

> On 05/08/2012 18:23, Marek Vasut wrote:
> > Dear Fabio Estevam,
> > 
> >> From: Fabio Estevam 
> >> 
> >> Turn on data and instruction caches.
> >> 
> >> Signed-off-by: Fabio Estevam 
> > 
> > [...]
> > 
> > I'd like to put this one on hold until I can properly test all
> > components. I had this in my tree for a while, but I still want to
> > retest SPI and MMC /w DMA before I go for this.
> 
> Right - but maybe it is not bad in the meantime to get some feedback
> from other users to check for problems. Maybe Veli-Pekkola can test this
> on his board, too.

Ok, right ... apply and we'll have until the .10 release to fix it ;-)

> Best regards,
> Stefano Babic

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


Re: [U-Boot] [PATCH v1 1/6] mxs: reorganize source directory for easy sharing of code in i.MXS SoCs

2012-08-06 Thread Otavio Salvador
On Mon, Aug 6, 2012 at 8:37 AM, Marek Vasut  wrote:
> Dear Stefano Babic,
>
>> On 05/08/2012 21:05, Otavio Salvador wrote:
>> > Most code can be shared between i.MX23 and i.MX28 as both are from
>> > i.MXS family; this source directory structure makes easy to share code
>> > among them.
>> >
>> > Signed-off-by: Otavio Salvador 
>> > ---
>> > Changes in v1:
>> > - rebase against imx/master
>> > - rework due apx4devkit board addition
>>
>> Hi Otavio,
>>
>> as far as I can see there is nothing that can break the current mx28
>> boards in mainline. I will wait for a while, but I think the series can
>> be merged into mainline.
>
> Lets do it and scream at Otavio if it does
>
>> Acked-by: Stefano Babic 
>>
>> Best regards,
>> Stefano Babic
>
> Best regards,
> Marek Vasut

I am feeling under pression now ;-)

-- 
Otavio Salvador O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v1 1/6] mxs: reorganize source directory for easy sharing of code in i.MXS SoCs

2012-08-06 Thread Otavio Salvador
On Mon, Aug 6, 2012 at 5:20 AM, Stefano Babic  wrote:
> as far as I can see there is nothing that can break the current mx28
> boards in mainline. I will wait for a while, but I think the series can
> be merged into mainline.

That'd be great so I reduce the amount of changes I have to keep
updated in my tree and easy sharing work among other people for MX233
support.

-- 
Otavio Salvador O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854  http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v1 1/6] mxs: reorganize source directory for easy sharing of code in i.MXS SoCs

2012-08-06 Thread Marek Vasut
Dear Stefano Babic,

> On 05/08/2012 21:05, Otavio Salvador wrote:
> > Most code can be shared between i.MX23 and i.MX28 as both are from
> > i.MXS family; this source directory structure makes easy to share code
> > among them.
> > 
> > Signed-off-by: Otavio Salvador 
> > ---
> > Changes in v1:
> > - rebase against imx/master
> > - rework due apx4devkit board addition
> 
> Hi Otavio,
> 
> as far as I can see there is nothing that can break the current mx28
> boards in mainline. I will wait for a while, but I think the series can
> be merged into mainline.

Lets do it and scream at Otavio if it does

> Acked-by: Stefano Babic 
> 
> Best regards,
> Stefano Babic

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


Re: [U-Boot] [PATCH 2/2] imx27lite: update with gpio api change

2012-08-06 Thread Stefano Babic
On 05/08/2012 12:00, Philippe Reynes wrote:
> Signed-off-by: Philippe Reynes 
> ---
>  board/logicpd/imx27lite/imx27lite.c |7 ---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 

Hi Philippe,


>  {
> - struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE;
> + struct gpio_port_regs *regs = (struct gpio_port_regs *)IMX_GPIO_BASE;
>  #if defined(CONFIG_SYS_NAND_LARGEPAGE)
>   struct system_control_regs *sc_regs =
>   (struct system_control_regs *)IMX_SYSTEM_CTL_BASE;
> @@ -43,8 +44,8 @@ int board_init(void)
>  #ifdef CONFIG_FEC_MXC
>   mx27_fec_init_pins();
>   imx_gpio_mode((GPIO_PORTC | GPIO_OUT | GPIO_PUEN | GPIO_GPIO | 31));
> - writel(readl(®s->port[PORTC].dr) | (1 << 31),
> - ®s->port[PORTC].dr);
> + writel(readl(®s->port[PORTC].gpio_dr) | (1 << 31),
> + ®s->port[PORTC].gpio_dr);

This is not what I am expecting from the patch when it will move to
generic GPIO API.

The GPIO API uses really generic as in kernel functions, independently
from the SOC where it is running. This hides the physical registers of
the GPIOs.

Instead of that, gpio_set_value(), gpio_get_value(),
gpio_direction_input() and gpio_direction_output() should be used. You
can take a look at other iMX (MX3, MX28, MX5, MX6), that are already
using the generic API.

Best regards,
Stefano Babic


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


[U-Boot] [Pull request] u-boot-onenand

2012-08-06 Thread Lukasz Majewski
Hi Wolfgang,

Please pull following commits:


The following changes since commit
56249fea3d5e32cddcd9160e51ec93a9c4327c6b:

  powerpc/82xx: adapt SDRAM settings for mgcoge3ne (2012-07-31 22:36:38
  +0200)

are available in the git repository at:
  git://git.denx.de/u-boot-onenand.git master

David du Colombier (1):
  env_onenand: set ONENAND_MAX_ENV_SIZE to CONFIG_ENV_SIZE

 common/env_onenand.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Markus Hubig
On Mon, Aug 06, 2012 at 11:05:03AM +0200, Markus Hubig wrote:
> This adds support for the AT91SAM9G20 boards by taskit GmbH.
> Both boards, Stamp9G20 and PortuxG20, are integrated in one
> file. PortuxG20 is basically a SBC built around the Stamp9G20.

Ignore this. I started a new thread with [PATCH v4] in the subject.

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


[U-Boot] [PATCH v4] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Markus Hubig
This adds support for the AT91SAM9G20 boards by taskit GmbH.
Both boards, Stamp9G20 and PortuxG20, are integrated in one
file. PortuxG20 is basically a SBC built around the Stamp9G20.

Signed-off-by: Markus Hubig 
Cc: Andreas Bießmann 
---
 MAINTAINERS|   16 ++-
 board/taskit/stamp9g20/Makefile|   53 +++
 board/taskit/stamp9g20/led.c   |  134 ++
 board/taskit/stamp9g20/stamp9g20.c |  192 ++
 boards.cfg |2 +
 include/configs/stamp9g20.h|  267 
 6 files changed, 658 insertions(+), 6 deletions(-)
 create mode 100644 board/taskit/stamp9g20/Makefile
 create mode 100644 board/taskit/stamp9g20/led.c
 create mode 100644 board/taskit/stamp9g20/stamp9g20.c
 create mode 100644 include/configs/stamp9g20.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 84413de..7eb55db 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -243,12 +243,6 @@ Klaus Heydeck 
KUP4K   MPC855
KUP4X   MPC859
 
-Ilko Iliev 
-
-   PM9261  AT91SAM9261
-   PM9263  AT91SAM9263
-   PM9G45  ARM926EJS (AT91SAM9G45 SoC)
-
 Gary Jennejohn 
 
quad100hd   PPC405EP
@@ -681,10 +675,20 @@ Vaibhav Hiremath 
 
am3517_evm  ARM ARMV7 (AM35x SoC)
 
+Markus Hubig 
+
+   STAMP9G20   ARM926EJS
+
 Grazvydas Ignotas 
 
omap3_pandora   ARM ARMV7 (OMAP3xx SoC)
 
+Ilko Iliev 
+
+   PM9261  AT91SAM9261
+   PM9263  AT91SAM9263
+   PM9G45  ARM926EJS (AT91SAM9G45 SoC)
+
 Michael Jones 
 
omap3_mvblx ARM ARMV7 (OMAP3xx SoC)
diff --git a/board/taskit/stamp9g20/Makefile b/board/taskit/stamp9g20/Makefile
new file mode 100644
index 000..4f17a27
--- /dev/null
+++ b/board/taskit/stamp9g20/Makefile
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop 
+# Lead Tech Design 
+#
+# (C) Copyright 2012
+# Markus Hubig 
+# IMKO GmbH 
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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-y+= stamp9g20.o
+COBJS-y+= led.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/taskit/stamp9g20/led.c b/board/taskit/stamp9g20/led.c
new file mode 100644
index 000..13dae39
--- /dev/null
+++ b/board/taskit/stamp9g20/led.c
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2009 Wind River Systems, Inc.
+ * Tom Rix 
+ * (C) Copyright 2009
+ * Eric Benard 
+ *
+ * (C) Copyright 2012
+ * Markus Hubig 
+ * IMKO GmbH 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 
+#include 
+#include 
+#include 
+
+static unsigned int saved_state[3] = {STATUS_LED_OFF,
+   STATUS_LED_OFF, STATUS_LED_OFF};
+
+void coloured_LED_init(void)
+{
+   /* Clock is enabled in board_early_init_f() */
+
+   at91_set_gpio_output(CONFIG_RED_LED, 1);
+   at91_set_gpio_output(CONFIG_GREEN_LED, 1);
+   at91_set_gpio_output(CONFIG_Y

Re: [U-Boot] [PATCH] env_onenand: set ONENAND_MAX_ENV_SIZE to CONFIG_ENV_SIZE

2012-08-06 Thread Lukasz Majewski
Dear David du Colombier,

> > This fix prevents env_import() CRC to fail when CONFIG_ENV_SIZE
> > is not equal to 4096 bytes
> > It also prevents mtd->read and mtd->write to be incomplete when
> > the environment is larger than 4096 bytes.
> > 
> > Signed-off-by: David du Colombier <0in...@gmail.com>
> > ---
> >  common/env_onenand.c |2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/common/env_onenand.c b/common/env_onenand.c
> > index 7197ab6..da35071 100644
> > --- a/common/env_onenand.c
> > +++ b/common/env_onenand.c
> > @@ -39,7 +39,7 @@
> >  
> >  char *env_name_spec = "OneNAND";
> >  
> > -#define ONENAND_MAX_ENV_SIZE   4096
> > +#define ONENAND_MAX_ENV_SIZE   CONFIG_ENV_SIZE
> >  #define ONENAND_ENV_SIZE(mtd)  (ONENAND_MAX_ENV_SIZE -
> > ENV_HEADER_SIZE) 
> >  DECLARE_GLOBAL_DATA_PTR;
> 
> Could you please take a look? It fixes environment
> saving and restoring on IGEPv2.
> 
> Thanks.
> 

Tested-by: Lukasz Majewski 

Test HW: S5PC110 GONI

Applied to u-boot-onenand repository,


-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] at91: Add support for taskit AT91SAM9G20 boards.

2012-08-06 Thread Markus Hubig
This adds support for the AT91SAM9G20 boards by taskit GmbH.
Both boards, Stamp9G20 and PortuxG20, are integrated in one
file. PortuxG20 is basically a SBC built around the Stamp9G20.

Signed-off-by: Markus Hubig 
Cc: Andreas Bießmann 
---
 MAINTAINERS|   16 ++-
 board/taskit/stamp9g20/Makefile|   53 +++
 board/taskit/stamp9g20/led.c   |  134 ++
 board/taskit/stamp9g20/stamp9g20.c |  192 ++
 boards.cfg |2 +
 include/configs/stamp9g20.h|  267 
 6 files changed, 658 insertions(+), 6 deletions(-)
 create mode 100644 board/taskit/stamp9g20/Makefile
 create mode 100644 board/taskit/stamp9g20/led.c
 create mode 100644 board/taskit/stamp9g20/stamp9g20.c
 create mode 100644 include/configs/stamp9g20.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 84413de..7eb55db 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -243,12 +243,6 @@ Klaus Heydeck 
KUP4K   MPC855
KUP4X   MPC859
 
-Ilko Iliev 
-
-   PM9261  AT91SAM9261
-   PM9263  AT91SAM9263
-   PM9G45  ARM926EJS (AT91SAM9G45 SoC)
-
 Gary Jennejohn 
 
quad100hd   PPC405EP
@@ -681,10 +675,20 @@ Vaibhav Hiremath 
 
am3517_evm  ARM ARMV7 (AM35x SoC)
 
+Markus Hubig 
+
+   STAMP9G20   ARM926EJS
+
 Grazvydas Ignotas 
 
omap3_pandora   ARM ARMV7 (OMAP3xx SoC)
 
+Ilko Iliev 
+
+   PM9261  AT91SAM9261
+   PM9263  AT91SAM9263
+   PM9G45  ARM926EJS (AT91SAM9G45 SoC)
+
 Michael Jones 
 
omap3_mvblx ARM ARMV7 (OMAP3xx SoC)
diff --git a/board/taskit/stamp9g20/Makefile b/board/taskit/stamp9g20/Makefile
new file mode 100644
index 000..4f17a27
--- /dev/null
+++ b/board/taskit/stamp9g20/Makefile
@@ -0,0 +1,53 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop 
+# Lead Tech Design 
+#
+# (C) Copyright 2012
+# Markus Hubig 
+# IMKO GmbH 
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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-y+= stamp9g20.o
+COBJS-y+= led.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/taskit/stamp9g20/led.c b/board/taskit/stamp9g20/led.c
new file mode 100644
index 000..13dae39
--- /dev/null
+++ b/board/taskit/stamp9g20/led.c
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2009 Wind River Systems, Inc.
+ * Tom Rix 
+ * (C) Copyright 2009
+ * Eric Benard 
+ *
+ * (C) Copyright 2012
+ * Markus Hubig 
+ * IMKO GmbH 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 
+#include 
+#include 
+#include 
+
+static unsigned int saved_state[3] = {STATUS_LED_OFF,
+   STATUS_LED_OFF, STATUS_LED_OFF};
+
+void coloured_LED_init(void)
+{
+   /* Clock is enabled in board_early_init_f() */
+
+   at91_set_gpio_output(CONFIG_RED_LED, 1);
+   at91_set_gpio_output(CONFIG_GREEN_LED, 1);
+   at91_set_gpio_output(CONFIG_Y

Re: [U-Boot] [PATCH v1 1/6] mxs: reorganize source directory for easy sharing of code in i.MXS SoCs

2012-08-06 Thread Stefano Babic
On 05/08/2012 21:05, Otavio Salvador wrote:
> Most code can be shared between i.MX23 and i.MX28 as both are from
> i.MXS family; this source directory structure makes easy to share code
> among them.
> 
> Signed-off-by: Otavio Salvador 
> ---
> Changes in v1:
> - rebase against imx/master
> - rework due apx4devkit board addition


Hi Otavio,

as far as I can see there is nothing that can break the current mx28
boards in mainline. I will wait for a while, but I think the series can
be merged into mainline.

Acked-by: Stefano Babic 

Best regards,
Stefano Babic

-- 
=
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/2] mx51evk: do not overwrite the console

2012-08-06 Thread Stefano Babic
On 05/08/2012 19:31, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> On this board, the console is always set to the serial line.
> Do not allow to overwrite it when video is enabled.
> 
> Signed-off-by: Fabio Estevam 
> ---

Hi Fabio,

it seems you agree with my patch from yesterday - I will apply all three
patches soon !

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/2] m28evk: Turn on caches

2012-08-06 Thread Stefano Babic
On 05/08/2012 18:23, Marek Vasut wrote:
> Dear Fabio Estevam,
> 
>> From: Fabio Estevam 
>>
>> Turn on data and instruction caches.
>>
>> Signed-off-by: Fabio Estevam 
> [...]
> 
> I'd like to put this one on hold until I can properly test all components. I 
> had 
> this in my tree for a while, but I still want to retest SPI and MMC /w DMA 
> before I go for this.

Right - but maybe it is not bad in the meantime to get some feedback
from other users to check for problems. Maybe Veli-Pekkola can test this
on his board, too.

Best regards,
Stefano Babic

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


[U-Boot] [PATCH] block: systemace: Simplify base and width initialization

2012-08-06 Thread Michal Simek
Use CONFIG parameters only at one location to simplify
the code. Also create ace_readw/writew functions.

Signed-off-by: Michal Simek 
---
 drivers/block/systemace.c |   38 +-
 1 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/drivers/block/systemace.c b/drivers/block/systemace.c
index 58402b9..247cf06 100644
--- a/drivers/block/systemace.c
+++ b/drivers/block/systemace.c
@@ -51,24 +51,36 @@
  * to be the base address for the chip, usually in the local
  * peripheral bus.
  */
-#if (CONFIG_SYS_SYSTEMACE_WIDTH == 8)
+
+static u32 base = CONFIG_SYS_SYSTEMACE_BASE;
+static u32 width = CONFIG_SYS_SYSTEMACE_WIDTH;
+
+static void ace_writew(u16 val, unsigned off)
+{
+   if (width == 8) {
 #if !defined(__BIG_ENDIAN)
-#define ace_readw(off) ((readb(CONFIG_SYS_SYSTEMACE_BASE+off)<<8) | \
-   (readb(CONFIG_SYS_SYSTEMACE_BASE+off+1)))
-#define ace_writew(val, off) {writeb(val>>8, CONFIG_SYS_SYSTEMACE_BASE+off); \
- writeb(val, CONFIG_SYS_SYSTEMACE_BASE+off+1);}
+   writeb(val >> 8, base + off);
+   writeb(val, base + off + 1);
 #else
-#define ace_readw(off) ((readb(CONFIG_SYS_SYSTEMACE_BASE+off)) | \
-   (readb(CONFIG_SYS_SYSTEMACE_BASE+off+1)<<8))
-#define ace_writew(val, off) {writeb(val, CONFIG_SYS_SYSTEMACE_BASE+off); \
- writeb(val>>8, CONFIG_SYS_SYSTEMACE_BASE+off+1);}
+   writeb(val, base + off);
+   writeb(val >> 8, base + off + 1);
 #endif
+   }
+   out16(base + off, val);
+}
+
+static u16 ace_readw(unsigned off)
+{
+   if (width == 8) {
+#if !defined(__BIG_ENDIAN)
+   return (readb(base + off) << 8) | readb(base + off + 1);
 #else
-#define ace_readw(off) (in16(CONFIG_SYS_SYSTEMACE_BASE+off))
-#define ace_writew(val, off) (out16(CONFIG_SYS_SYSTEMACE_BASE+off,val))
+   return readb(base + off) | (readb(base + off + 1) << 8);
 #endif
+   }
 
-/* */
+   return in16(base + off);
+}
 
 static unsigned long systemace_read(int dev, unsigned long start,
unsigned long blkcnt, void *buffer);
@@ -121,7 +133,7 @@ block_dev_desc_t *systemace_get_dev(int dev)
/*
 * Ensure the correct bus mode (8/16 bits) gets enabled
 */
-   ace_writew(CONFIG_SYS_SYSTEMACE_WIDTH == 8 ? 0 : 0x0001, 0);
+   ace_writew(width == 8 ? 0 : 0x0001, 0);
 
init_part(&systemace_dev);
 
-- 
1.7.0.4

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


[U-Boot] [PATCH v2 7/7] microblaze: board: Use bi_flashstart instead of CONFIG_SYS_FLASH_BASE

2012-08-06 Thread Michal Simek
Prepare for device-tree driven configuration.

Signed-off-by: Michal Simek 

---
v2: Move bi_flashsize and bi_flashoffset from other patch
---
 arch/microblaze/lib/board.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index b450367..674b573 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -136,9 +136,8 @@ void board_init_f(ulong not_used)
 #if defined(CONFIG_CMD_FLASH)
puts ("Flash: ");
bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
-   if (0 < (flash_size = flash_init ())) {
-   bd->bi_flashsize = flash_size;
-   bd->bi_flashoffset = CONFIG_SYS_FLASH_BASE + flash_size;
+   flash_size = flash_init();
+   if (bd->bi_flashstart && flash_size > 0) {
 # ifdef CONFIG_SYS_FLASH_CHECKSUM
print_size (flash_size, "");
/*
@@ -149,13 +148,16 @@ void board_init_f(ulong not_used)
s = getenv ("flashchecksum");
if (s && (*s == 'y')) {
printf ("  CRC: %08X",
-   crc32 (0, (const unsigned char *) 
CONFIG_SYS_FLASH_BASE, flash_size)
+   crc32(0, (const u8 *)bd->bi_flashstart,
+   flash_size)
);
}
putc ('\n');
 # else /* !CONFIG_SYS_FLASH_CHECKSUM */
print_size (flash_size, "\n");
 # endif /* CONFIG_SYS_FLASH_CHECKSUM */
+   bd->bi_flashsize = flash_size;
+   bd->bi_flashoffset = bd->bi_flashstart + flash_size;
} else {
puts ("Flash init FAILED");
bd->bi_flashstart = 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 v2 6/7] microblaze: Clean microblaze initialization

2012-08-06 Thread Michal Simek
Move board specific function to board_init function in board/ folder
Remove externs from generic board.c
Use board_init_f function in board.c file.

Signed-off-by: Michal Simek 

---
v2: Remove global pointer
Define board_init function in header
---
 arch/microblaze/cpu/start.S|2 +-
 arch/microblaze/include/asm/processor.h|3 +++
 arch/microblaze/lib/board.c|   17 +++--
 .../xilinx/microblaze-generic/microblaze-generic.c |9 +
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S
index 8a2f634..8564c4e 100644
--- a/arch/microblaze/cpu/start.S
+++ b/arch/microblaze/cpu/start.S
@@ -149,7 +149,7 @@ clear_bss:
cmp r6, r5, r4 /* check if we have reach the end */
bneir6, 2b
 3: /* jumping to board_init */
-   braiboard_init
+   braiboard_init_f
 1: bri 1b
 
 /*
diff --git a/arch/microblaze/include/asm/processor.h 
b/arch/microblaze/include/asm/processor.h
index 2295d0a..2c4d5ff 100644
--- a/arch/microblaze/include/asm/processor.h
+++ b/arch/microblaze/include/asm/processor.h
@@ -28,4 +28,7 @@
 extern char __end[];
 extern char __text_start[];
 
+/* Microblaze board initialization function */
+void board_init(void);
+
 #endif /* __ASM_MICROBLAZE_PROCESSOR_H */
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index fde109f..b450367 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -39,13 +39,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_SYS_GPIO_0
-extern int gpio_init (void);
-#endif
-#ifdef CONFIG_SYS_FSL_2
-extern void fsl_init2 (void);
-#endif
-
 /*
  * All attempts to come up with a "common" initialization sequence
  * that works for all boards and architectures failed: some of the
@@ -67,20 +60,14 @@ init_fnc_t *init_sequence[] = {
 #endif
serial_init,
console_init_f,
-#ifdef CONFIG_SYS_GPIO_0
-   gpio_init,
-#endif
interrupts_init,
timer_init,
-#ifdef CONFIG_SYS_FSL_2
-   fsl_init2,
-#endif
NULL,
 };
 
 unsigned long monitor_flash_len;
 
-void board_init (void)
+void board_init_f(ulong not_used)
 {
bd_t *bd;
init_fnc_t **init_fnc_ptr;
@@ -189,6 +176,8 @@ void board_init (void)
/* Initialize the console (after the relocation and devices init) */
console_init_r();
 
+   board_init();
+
/* Initialize from environment */
load_addr = getenv_ulong("loadaddr", 16, load_addr);
 
diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c 
b/board/xilinx/microblaze-generic/microblaze-generic.c
index a1e2bfe..b75e62c 100644
--- a/board/xilinx/microblaze-generic/microblaze-generic.c
+++ b/board/xilinx/microblaze-generic/microblaze-generic.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -69,6 +70,14 @@ int fsl_init2 (void) {
 }
 #endif
 
+void board_init(void)
+{
+   gpio_init();
+#ifdef CONFIG_SYS_FSL_2
+   fsl_init2();
+#endif
+}
+
 int board_eth_init(bd_t *bis)
 {
int ret = 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 v2 5/7] microblaze: timer: Prepare for device-tree initialization

2012-08-06 Thread Michal Simek
microblaze: Fix CONFIG_SYS_HZ usage in board config

Do not use hardcoded value. Use CONFIG_SYS_HZ instead.
Separate static configuration to single block.

Signed-off-by: Michal Simek 

---
v2: Fix irq type irq == -1 means no IRQ
---
 arch/microblaze/cpu/timer.c|   69 ---
 arch/microblaze/include/asm/microblaze_timer.h |3 +
 arch/microblaze/lib/board.c|5 --
 include/configs/microblaze-generic.h   |   12 +
 4 files changed, 41 insertions(+), 48 deletions(-)

diff --git a/arch/microblaze/cpu/timer.c b/arch/microblaze/cpu/timer.c
index cc6b897..1330401 100644
--- a/arch/microblaze/cpu/timer.c
+++ b/arch/microblaze/cpu/timer.c
@@ -27,42 +27,30 @@
 #include 
 
 volatile int timestamp = 0;
+microblaze_timer_t *tmr;
 
-#ifdef CONFIG_SYS_TIMER_0
 ulong get_timer (ulong base)
 {
-   return (timestamp - base);
+   if (tmr)
+   return timestamp - base;
+   return timestamp++ - base;
 }
-#else
-ulong get_timer (ulong base)
-{
-   return (timestamp++ - base);
-}
-#endif
 
-#ifdef CONFIG_SYS_TIMER_0
 void __udelay(unsigned long usec)
 {
-   int i;
+   u32 i;
 
-   i = get_timer(0);
-   while ((get_timer(0) - i) < (usec / 1000))
-   ;
+   if (tmr) {
+   i = get_timer(0);
+   while ((get_timer(0) - i) < (usec / 1000))
+   ;
+   } else {
+   for (i = 0; i < (usec * XILINX_CLOCK_FREQ / 1000); i++)
+   ;
+   }
 }
-#else
-void __udelay(unsigned long usec)
-{
-   unsigned int i;
 
-   for (i = 0; i < (usec * CONFIG_XILINX_CLOCK_FREQ / 1000); i++)
-   ;
-}
-#endif
-
-#ifdef CONFIG_SYS_TIMER_0
-microblaze_timer_t *tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);
-
-void timer_isr (void *arg)
+static void timer_isr(void *arg)
 {
timestamp++;
tmr->control = tmr->control | TIMER_INTERRUPT;
@@ -70,15 +58,30 @@ void timer_isr (void *arg)
 
 int timer_init (void)
 {
-   tmr->loadreg = CONFIG_SYS_TIMER_0_PRELOAD;
-   tmr->control = TIMER_INTERRUPT | TIMER_RESET;
-   tmr->control =
-   TIMER_ENABLE | TIMER_ENABLE_INTR | TIMER_RELOAD | TIMER_DOWN_COUNT;
-   timestamp = 0;
-   install_interrupt_handler (CONFIG_SYS_TIMER_0_IRQ, timer_isr, (void 
*)tmr);
+   int irq = -1;
+   u32 preload = 0;
+   u32 ret = 0;
+
+#if defined(CONFIG_SYS_TIMER_0_ADDR) && defined(CONFIG_SYS_INTC_0_NUM)
+   preload = XILINX_CLOCK_FREQ / CONFIG_SYS_HZ;
+   irq = CONFIG_SYS_TIMER_0_IRQ;
+   tmr = (microblaze_timer_t *) (CONFIG_SYS_TIMER_0_ADDR);
+#endif
+
+   if (tmr && preload && irq >= 0) {
+   tmr->loadreg = preload;
+   tmr->control = TIMER_INTERRUPT | TIMER_RESET;
+   tmr->control = TIMER_ENABLE | TIMER_ENABLE_INTR |\
+   TIMER_RELOAD | TIMER_DOWN_COUNT;
+   timestamp = 0;
+   ret = install_interrupt_handler (irq, timer_isr, (void *)tmr);
+   if (ret)
+   tmr = NULL;
+   }
+
+   /* No problem if timer is not found/initialized */
return 0;
 }
-#endif
 
 /*
  * This function is derived from PowerPC code (read timebase as long long).
diff --git a/arch/microblaze/include/asm/microblaze_timer.h 
b/arch/microblaze/include/asm/microblaze_timer.h
index 844c8db..28e8b02 100644
--- a/arch/microblaze/include/asm/microblaze_timer.h
+++ b/arch/microblaze/include/asm/microblaze_timer.h
@@ -39,3 +39,6 @@ typedef volatile struct microblaze_timer_t {
int loadreg; /* load register TLR */
int counter; /* timer/counter register */
 } microblaze_timer_t;
+
+int timer_init(void);
+
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index b5f21d8..fde109f 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -42,9 +42,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #ifdef CONFIG_SYS_GPIO_0
 extern int gpio_init (void);
 #endif
-#ifdef CONFIG_SYS_TIMER_0
-extern int timer_init (void);
-#endif
 #ifdef CONFIG_SYS_FSL_2
 extern void fsl_init2 (void);
 #endif
@@ -74,9 +71,7 @@ init_fnc_t *init_sequence[] = {
gpio_init,
 #endif
interrupts_init,
-#ifdef CONFIG_SYS_TIMER_0
timer_init,
-#endif
 #ifdef CONFIG_SYS_FSL_2
fsl_init2,
 #endif
diff --git a/include/configs/microblaze-generic.h 
b/include/configs/microblaze-generic.h
index 1266cf7..21ddb2b 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -115,19 +115,11 @@
 #endif
 
 /* timer */
-#ifdef XILINX_TIMER_BASEADDR
-# if (XILINX_TIMER_IRQ != -1)
-#  define CONFIG_SYS_TIMER_0   1
+#if defined(XILINX_TIMER_BASEADD) && defined(XILINX_TIMER_IRQ)
 #  define CONFIG_SYS_TIMER_0_ADDR  XILINX_TIMER_BASEADDR
 #  define CONFIG_SYS_TIMER_0_IRQ   XILINX_TIMER_IRQ
-#  define FREQUENCEXILINX_CLOCK_FREQ
-#  define CONFIG_SYS_TIMER_0_PRELOAD   ( FREQU

[U-Boot] [PATCH v2 4/7] microblaze: intc: Coding style cleanup

2012-08-06 Thread Michal Simek
Just coding style cleanup.
Remove unneeded externs.

Signed-off-by: Michal Simek 
Acked-by: Simon Glass 

--
v2: Rebase - depends on previous intc patch
---
 arch/microblaze/cpu/interrupts.c |   26 +-
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c
index 08f6bad..7f2ee64 100644
--- a/arch/microblaze/cpu/interrupts.c
+++ b/arch/microblaze/cpu/interrupts.c
@@ -32,15 +32,12 @@
 
 #undef DEBUG_INT
 
-extern void microblaze_disable_interrupts (void);
-extern void microblaze_enable_interrupts (void);
-
-void enable_interrupts (void)
+void enable_interrupts(void)
 {
MSRSET(0x2);
 }
 
-int disable_interrupts (void)
+int disable_interrupts(void)
 {
unsigned int msr;
 
@@ -58,20 +55,21 @@ microblaze_intc_t *intc;
 /* default handler */
 static void def_hdlr(void)
 {
-   puts ("def_hdlr\n");
+   puts("def_hdlr\n");
 }
 
 static void enable_one_interrupt(int irq)
 {
int mask;
int offset = 1;
+
offset <<= irq;
mask = intc->ier;
intc->ier = (mask | offset);
 #ifdef DEBUG_INT
-   printf ("Enable one interrupt irq %x - mask %x,ier %x\n", offset, mask,
+   printf("Enable one interrupt irq %x - mask %x,ier %x\n", offset, mask,
intc->ier);
-   printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
+   printf("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
intc->iar, intc->mer);
 #endif
 }
@@ -80,13 +78,14 @@ static void disable_one_interrupt(int irq)
 {
int mask;
int offset = 1;
+
offset <<= irq;
mask = intc->ier;
intc->ier = (mask & ~offset);
 #ifdef DEBUG_INT
-   printf ("Disable one interrupt irq %x - mask %x,ier %x\n", irq, mask,
+   printf("Disable one interrupt irq %x - mask %x,ier %x\n", irq, mask,
intc->ier);
-   printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
+   printf("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
intc->iar, intc->mer);
 #endif
 }
@@ -94,9 +93,10 @@ static void disable_one_interrupt(int irq)
 int install_interrupt_handler(int irq, interrupt_handler_t *hdlr, void *arg)
 {
struct irq_action *act;
+
/* irq out of range */
if ((irq < 0) || (irq > irq_no)) {
-   puts ("IRQ out of range\n");
+   puts("IRQ out of range\n");
return -1;
}
act = &vecs[irq];
@@ -124,7 +124,7 @@ static void intc_init(void)
/* XIntc_Start - hw_interrupt enable and all interrupt enable */
intc->mer = 0x3;
 #ifdef DEBUG_INT
-   printf ("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
+   printf("INTC isr %x, ier %x, iar %x, mer %x\n", intc->isr, intc->ier,
intc->iar, intc->mer);
 #endif
 }
@@ -159,7 +159,7 @@ int interrupts_init(void)
return 0;
 }
 
-void interrupt_handler (void)
+void interrupt_handler(void)
 {
int irqs = intc->ivr;   /* find active interrupt */
int mask = 1;
-- 
1.7.0.4

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


[U-Boot] [PATCH v2 3/7] microblaze: intc: Registering interrupt should return value

2012-08-06 Thread Michal Simek
Return value to find out if un/registration was succesful.

Signed-off-by: Michal Simek 

---
v2: Add comment to header file to describe parameters and return codes
---
 arch/microblaze/cpu/interrupts.c  |   16 +---
 arch/microblaze/include/asm/microblaze_intc.h |   11 ++-
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/arch/microblaze/cpu/interrupts.c b/arch/microblaze/cpu/interrupts.c
index ee67082..08f6bad 100644
--- a/arch/microblaze/cpu/interrupts.c
+++ b/arch/microblaze/cpu/interrupts.c
@@ -91,14 +91,13 @@ static void disable_one_interrupt(int irq)
 #endif
 }
 
-/* adding new handler for interrupt */
-void install_interrupt_handler (int irq, interrupt_handler_t * hdlr, void *arg)
+int install_interrupt_handler(int irq, interrupt_handler_t *hdlr, void *arg)
 {
struct irq_action *act;
/* irq out of range */
if ((irq < 0) || (irq > irq_no)) {
puts ("IRQ out of range\n");
-   return;
+   return -1;
}
act = &vecs[irq];
if (hdlr) { /* enable */
@@ -106,11 +105,14 @@ void install_interrupt_handler (int irq, 
interrupt_handler_t * hdlr, void *arg)
act->arg = arg;
act->count = 0;
enable_one_interrupt (irq);
-   } else {/* disable */
-   act->handler = (interrupt_handler_t *) def_hdlr;
-   act->arg = (void *)irq;
-   disable_one_interrupt (irq);
+   return 0;
}
+
+   /* Disable */
+   act->handler = (interrupt_handler_t *) def_hdlr;
+   act->arg = (void *)irq;
+   disable_one_interrupt(irq);
+   return 1;
 }
 
 /* initialization interrupt controller - hardware */
diff --git a/arch/microblaze/include/asm/microblaze_intc.h 
b/arch/microblaze/include/asm/microblaze_intc.h
index 6142b9c..e9640f5 100644
--- a/arch/microblaze/include/asm/microblaze_intc.h
+++ b/arch/microblaze/include/asm/microblaze_intc.h
@@ -39,7 +39,16 @@ struct irq_action {
int count; /* number of interrupt */
 };
 
-void install_interrupt_handler (int irq, interrupt_handler_t * hdlr,
+/**
+ * Register and unregister interrupt handler rutines
+ *
+ * @param irq  IRQ number
+ * @param hdlr Interrupt handler rutine
+ * @param arg  Pointer to argument which is passed to int. handler rutine
+ * @return 0 if registration pass, 1 if unregistration pass,
+ * or an error code < 0 otherwise
+ */
+int install_interrupt_handler(int irq, interrupt_handler_t *hdlr,
   void *arg);
 
 int interrupts_init(void);
-- 
1.7.0.4

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


[U-Boot] [PATCH v2 2/7] microblaze: board: Remove compilation warning

2012-08-06 Thread Michal Simek
Variable is used when CONFIG_SYS_FLASH_CHECKSUM is used.

Warning log:
board.c: In function 'board_init':
board.c:101: warning: unused variable 's'

Signed-off-by: Michal Simek 

---
v2: Use __mabe_unused prefix
---
 arch/microblaze/lib/board.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index 942e18c..b5f21d8 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -91,7 +92,7 @@ void board_init (void)
gd = (gd_t *) (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_GBL_DATA_OFFSET);
bd = (bd_t *) (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_GBL_DATA_OFFSET \
- GENERATED_BD_INFO_SIZE);
-   char *s;
+   __maybe_unused char *s;
 #if defined(CONFIG_CMD_FLASH)
ulong flash_size = 0;
 #endif
-- 
1.7.0.4

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


[U-Boot] [PATCH v2 1/7] microblaze: Add support for device tree driven board configuration

2012-08-06 Thread Michal Simek
This is minimum code required to be able to use device-tree
for u-boot initialization.
Currently only for device driver initialization.

Linker script change ensures DTB to be aligned
for both options CONFIG_OF_EMBED and CONFIG_OF_SEPARATE.

Signed-off-by: Michal Simek 
CC: Simon Glass 

---
v2: Show message about DTB address in bootlog
---
 arch/microblaze/config.mk |2 ++
 arch/microblaze/cpu/u-boot.lds|1 +
 arch/microblaze/include/asm/global_data.h |1 +
 arch/microblaze/lib/board.c   |   24 
 4 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk
index aca79e2..b4935f0 100644
--- a/arch/microblaze/config.mk
+++ b/arch/microblaze/config.mk
@@ -31,3 +31,5 @@ CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F0
 PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
 
 LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
+
+CONFIG_ARCH_DEVICE_TREE := microblaze
diff --git a/arch/microblaze/cpu/u-boot.lds b/arch/microblaze/cpu/u-boot.lds
index ee41145..d033a28 100644
--- a/arch/microblaze/cpu/u-boot.lds
+++ b/arch/microblaze/cpu/u-boot.lds
@@ -45,6 +45,7 @@ SECTIONS
.data ALIGN(0x4):
{
__data_start = .;
+   dts/libdts.o (.data)
*(.data)
__data_end = .;
}
diff --git a/arch/microblaze/include/asm/global_data.h 
b/arch/microblaze/include/asm/global_data.h
index 6e8537c..e802e4e 100644
--- a/arch/microblaze/include/asm/global_data.h
+++ b/arch/microblaze/include/asm/global_data.h
@@ -43,6 +43,7 @@ typedef   struct  global_data {
unsigned long   precon_buf_idx; /* Pre-Console buffer index */
 #endif
unsigned long   env_addr;   /* Address  of Environment struct */
+   const void  *fdt_blob;  /* Our device tree, NULL if none */
unsigned long   env_valid;  /* Checksum of Environment valid? */
unsigned long   fb_base;/* base address of frame buffer */
void**jt;   /* jump table */
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index b80250a..942e18c 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -63,6 +64,9 @@ typedef int (init_fnc_t) (void);
 
 init_fnc_t *init_sequence[] = {
env_init,
+#ifdef CONFIG_OF_CONTROL
+   fdtdec_check_fdt,
+#endif
serial_init,
console_init_f,
 #ifdef CONFIG_SYS_GPIO_0
@@ -103,6 +107,17 @@ void board_init (void)
 
monitor_flash_len = __end - __text_start;
 
+#ifdef CONFIG_OF_EMBED
+   /* Get a pointer to the FDT */
+   gd->fdt_blob = _binary_dt_dtb_start;
+#elif defined CONFIG_OF_SEPARATE
+   /* FDT is at end of image */
+   gd->fdt_blob = (void *)__end;
+#endif
+   /* Allow the early environment to override the fdt address */
+   gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
+   (uintptr_t)gd->fdt_blob);
+
/*
 * The Malloc area is immediately below the monitor copy in DRAM
 * aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off
@@ -121,6 +136,15 @@ void board_init (void)
}
}
 
+#ifdef CONFIG_OF_CONTROL
+   /* For now, put this check after the console is ready */
+   if (fdtdec_prepare_fdt()) {
+   panic("** CONFIG_OF_CONTROL defined but no FDT - please see "
+   "doc/README.fdt-control");
+   } else
+   printf("DTB: 0x%x\n", (u32)gd->fdt_blob);
+#endif
+
puts ("SDRAM :\n");
printf ("\t\tIcache:%s\n", icache_status() ? "ON" : "OFF");
printf ("\t\tDcache:%s\n", dcache_status() ? "ON" : "OFF");
-- 
1.7.0.4

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


Re: [U-Boot] [PATCH v2] fdt: Include arch specific gpio.h instead of asm-generic/gpio.h

2012-08-06 Thread Michal Simek

On 07/19/2012 12:56 AM, Mike Frysinger wrote:

Acked-by: Mike Frysinger


Simon: Are you OK with this patch?

Thanks,
Michal


--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   >