[PATCH] ARM: Fix nv variable bootargs.base

2015-02-27 Thread Teresa Gámez
Some console parameters where faulty named bootargs.base. Which does
not have any effect. Removed them where possible and renamed the others
to linux.bootargs.console.

Signed-off-by: Teresa Gámez 
---
 arch/arm/boards/highbank/env/nv/bootargs.base| 1 -
 arch/arm/boards/highbank/env/nv/linux.bootargs.console   | 1 +
 .../boards/phytec-phycard-imx6/defaultenv-phycard-imx6/nv/bootargs.base  | 1 -
 .../boards/phytec-som-am335x/defaultenv-physom-am335x/nv/bootargs.base   | 1 -
 arch/arm/boards/telit-evk-pro3/env/nv/bootargs.base  | 1 -
 arch/arm/boards/telit-evk-pro3/env/nv/linux.bootargs.console | 1 +
 6 files changed, 2 insertions(+), 4 deletions(-)
 delete mode 100644 arch/arm/boards/highbank/env/nv/bootargs.base
 create mode 100644 arch/arm/boards/highbank/env/nv/linux.bootargs.console
 delete mode 100644 
arch/arm/boards/phytec-phycard-imx6/defaultenv-phycard-imx6/nv/bootargs.base
 delete mode 100644 
arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/nv/bootargs.base
 delete mode 100644 arch/arm/boards/telit-evk-pro3/env/nv/bootargs.base
 create mode 100644 arch/arm/boards/telit-evk-pro3/env/nv/linux.bootargs.console

diff --git a/arch/arm/boards/highbank/env/nv/bootargs.base 
b/arch/arm/boards/highbank/env/nv/bootargs.base
deleted file mode 100644
index 826debe..000
--- a/arch/arm/boards/highbank/env/nv/bootargs.base
+++ /dev/null
@@ -1 +0,0 @@
-console=ttyAMA0,115200n8 CONSOLE=/dev/ttyAMA0
diff --git a/arch/arm/boards/highbank/env/nv/linux.bootargs.console 
b/arch/arm/boards/highbank/env/nv/linux.bootargs.console
new file mode 100644
index 000..826debe
--- /dev/null
+++ b/arch/arm/boards/highbank/env/nv/linux.bootargs.console
@@ -0,0 +1 @@
+console=ttyAMA0,115200n8 CONSOLE=/dev/ttyAMA0
diff --git 
a/arch/arm/boards/phytec-phycard-imx6/defaultenv-phycard-imx6/nv/bootargs.base 
b/arch/arm/boards/phytec-phycard-imx6/defaultenv-phycard-imx6/nv/bootargs.base
deleted file mode 100644
index 6b62c99..000
--- 
a/arch/arm/boards/phytec-phycard-imx6/defaultenv-phycard-imx6/nv/bootargs.base
+++ /dev/null
@@ -1 +0,0 @@
-console=ttymxc2,115200
diff --git 
a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/nv/bootargs.base 
b/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/nv/bootargs.base
deleted file mode 100644
index d7b01a1..000
--- 
a/arch/arm/boards/phytec-som-am335x/defaultenv-physom-am335x/nv/bootargs.base
+++ /dev/null
@@ -1 +0,0 @@
-console=ttyO0,115200
diff --git a/arch/arm/boards/telit-evk-pro3/env/nv/bootargs.base 
b/arch/arm/boards/telit-evk-pro3/env/nv/bootargs.base
deleted file mode 100644
index 476b1fb..000
--- a/arch/arm/boards/telit-evk-pro3/env/nv/bootargs.base
+++ /dev/null
@@ -1 +0,0 @@
-console=ttyS0,115200
diff --git a/arch/arm/boards/telit-evk-pro3/env/nv/linux.bootargs.console 
b/arch/arm/boards/telit-evk-pro3/env/nv/linux.bootargs.console
new file mode 100644
index 000..476b1fb
--- /dev/null
+++ b/arch/arm/boards/telit-evk-pro3/env/nv/linux.bootargs.console
@@ -0,0 +1 @@
+console=ttyS0,115200
-- 
1.9.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] net: cpsw: invalidate complete buffer

2015-02-27 Thread Jan Weitzel
Without invalidating the complete buffer before giving it to
dma_inv_range, we got strange packets.

Signed-off-by: Jan Weitzel 
Tested-by: Teresa Gámez 
---
 drivers/net/cpsw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 799fac8..33afdc3 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -886,7 +886,7 @@ static int cpsw_recv(struct eth_device *edev)
int len;
 
while (cpdma_process(priv, &priv->rx_chan, &buffer, &len) >= 0) {
-   dma_inv_range((ulong)buffer, (ulong)buffer + len);
+   dma_inv_range((ulong)buffer, (ulong)buffer + PKTSIZE);
net_receive(edev, buffer, len);
cpdma_submit(priv, &priv->rx_chan, buffer, PKTSIZE);
}
-- 
1.9.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] net: cpsw: invalidate complete buffer

2015-02-27 Thread Lucas Stach
Am Freitag, den 27.02.2015, 10:56 +0100 schrieb Jan Weitzel:
> Without invalidating the complete buffer before giving it to
> dma_inv_range, we got strange packets.
> 

This is most likely not the correct fix. If this helps then our
dma_inv_range functions aren't working properly, which would be really
bad. How do those "strange packets" look like?

> Signed-off-by: Jan Weitzel 
> Tested-by: Teresa Gámez 
> ---
>  drivers/net/cpsw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
> index 799fac8..33afdc3 100644
> --- a/drivers/net/cpsw.c
> +++ b/drivers/net/cpsw.c
> @@ -886,7 +886,7 @@ static int cpsw_recv(struct eth_device *edev)
>   int len;
>  
>   while (cpdma_process(priv, &priv->rx_chan, &buffer, &len) >= 0) {
> - dma_inv_range((ulong)buffer, (ulong)buffer + len);
> + dma_inv_range((ulong)buffer, (ulong)buffer + PKTSIZE);
>   net_receive(edev, buffer, len);
>   cpdma_submit(priv, &priv->rx_chan, buffer, PKTSIZE);
>   }

-- 
Pengutronix e.K. | Lucas Stach |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 1/2] ARM: Allow to mask data aborts

2015-02-27 Thread Jan Lübbe
On Do, 2015-02-26 at 19:05 +0100, Sascha Hauer wrote:
> +int data_abort_unmask(void)
> +{
> +   arm_ignore_data_abort = 0;
> +
> +   return arm_data_abort_occured;
> +}

arm_data_abort_occured is set to &arm_data_abort_occured when an abort
occurs. Should we return arm_data_abort_occured != 0?

Also occured is actually spelled occurred.

Thanks,
Jan
-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 1/2] ARM: Allow to mask data aborts

2015-02-27 Thread Sascha Hauer
On Fri, Feb 27, 2015 at 01:04:53PM +0100, Jan Lübbe wrote:
> On Do, 2015-02-26 at 19:05 +0100, Sascha Hauer wrote:
> > +int data_abort_unmask(void)
> > +{
> > +   arm_ignore_data_abort = 0;
> > +
> > +   return arm_data_abort_occured;
> > +}
> 
> arm_data_abort_occured is set to &arm_data_abort_occured when an abort
> occurs. Should we return arm_data_abort_occured != 0?

Yes, sounds good. Changed that.

> 
> Also occured is actually spelled occurred.

Fixed, thanks

Sascha


-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: on barebox logo

2015-02-27 Thread Robert Schwebel
On Fri, Feb 27, 2015 at 03:04:40PM +0800, Jean-Christophe PLAGNIOL-VILLARD 
wrote:
> > In this patch you have added barebox logo:

We have a new logo which will be available soon.

rsc
-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] net: cpsw: invalidate complete buffer

2015-02-27 Thread Jan Weitzel
On Fri, Feb 27, 2015 at 12:47:24PM +0100, Lucas Stach wrote:
> Am Freitag, den 27.02.2015, 10:56 +0100 schrieb Jan Weitzel:
> > Without invalidating the complete buffer before giving it to
> > dma_inv_range, we got strange packets.
> > 
> 
> This is most likely not the correct fix. If this helps then our
> dma_inv_range functions aren't working properly, which would be really
> bad. How do those "strange packets" look like?
> 
We saw the problem with tftp transfers of a 76 byte image. Debug print in
tftp_handler

good:
tftp_handler: len:76 blocksize:1432 to fifo
: 06 08 ba de 7d 27 e1 2c 52 2f cf 77 e0 d3 23 da}'.,R/.w..#.
0010: 62 d4 42 3e 03 20 3a c2 51 aa 51 15 73 be 9e 21b.B>. :.Q.Q.s..!
0020: 03 ac 78 a9 e3 4f cd 4d 6d ba 93 fe 83 dc fe 82..x..O.Mm...   
  
0030: bb f8 24 29 6e 6f 53 1c 91 52 4b 77 1b 72 ff a0..$)noS..RKw.r..   
  
0040: 5b 98 1c 20 28 09 0f 4c 93 3c 22 08[.. (..L.<". 

bad:
tftp_handler: len:76 blocksize:1432 to fifo:
  
: 06 08 ba de 7d 27 e1 2c 52 2f cf 77 e0 d3 23 da}'.,R/.w..#.   
  
0010: 62 d4 6b 73 69 7a 65 00 31 34 33 32 00 b0 1b d1b.ksize.1432   
  
0020: 5b d4 78 a9 e3 4f cd 4d 6d ba 93 fe 83 dc fe 82[.x..O.Mm...
0030: bb f8 24 29 6e 6f 53 1c 91 52 4b 77 1b 72 ff a0..$)noS..RKw.r..
0040: 5b 98 1c 20 28 09 0f 4c 93 3c 22 08[.. (..L.<".


The ethernet package has 122 Bytes and the error in the received file is on
offset 18. The data "b.ksize.1432" comes also from tftp packets.

Jan

> > Signed-off-by: Jan Weitzel 
> > Tested-by: Teresa Gámez 
> > ---
> >  drivers/net/cpsw.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
> > index 799fac8..33afdc3 100644
> > --- a/drivers/net/cpsw.c
> > +++ b/drivers/net/cpsw.c
> > @@ -886,7 +886,7 @@ static int cpsw_recv(struct eth_device *edev)
> > int len;
> >  
> > while (cpdma_process(priv, &priv->rx_chan, &buffer, &len) >= 0) {
> > -   dma_inv_range((ulong)buffer, (ulong)buffer + len);
> > +   dma_inv_range((ulong)buffer, (ulong)buffer + PKTSIZE);
> > net_receive(edev, buffer, len);
> > cpdma_submit(priv, &priv->rx_chan, buffer, PKTSIZE);
> > }
> 
> -- 
> Pengutronix e.K. | Lucas Stach |
> Industrial Linux Solutions   | http://www.pengutronix.de/  |
> 

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] net: cpsw: invalidate complete buffer

2015-02-27 Thread Lucas Stach
Am Freitag, den 27.02.2015, 14:14 +0100 schrieb Jan Weitzel:
> On Fri, Feb 27, 2015 at 12:47:24PM +0100, Lucas Stach wrote:
> > Am Freitag, den 27.02.2015, 10:56 +0100 schrieb Jan Weitzel:
> > > Without invalidating the complete buffer before giving it to
> > > dma_inv_range, we got strange packets.
> > > 
> > 
> > This is most likely not the correct fix. If this helps then our
> > dma_inv_range functions aren't working properly, which would be really
> > bad. How do those "strange packets" look like?
> > 
> We saw the problem with tftp transfers of a 76 byte image. Debug print in
> tftp_handler
> 
> good:
> tftp_handler: len:76 blocksize:1432 to fifo
> : 06 08 ba de 7d 27 e1 2c 52 2f cf 77 e0 d3 23 da}'.,R/.w..#.
> 0010: 62 d4 42 3e 03 20 3a c2 51 aa 51 15 73 be 9e 21b.B>. :.Q.Q.s..!
> 0020: 03 ac 78 a9 e3 4f cd 4d 6d ba 93 fe 83 dc fe 82..x..O.Mm... 
> 
> 0030: bb f8 24 29 6e 6f 53 1c 91 52 4b 77 1b 72 ff a0..$)noS..RKw.r.. 
> 
> 0040: 5b 98 1c 20 28 09 0f 4c 93 3c 22 08[.. (..L.<". 
> 
> bad:
> tftp_handler: len:76 blocksize:1432 to fifo:  
> 
> : 06 08 ba de 7d 27 e1 2c 52 2f cf 77 e0 d3 23 da}'.,R/.w..#. 
> 
> 0010: 62 d4 6b 73 69 7a 65 00 31 34 33 32 00 b0 1b d1b.ksize.1432 
> 
> 0020: 5b d4 78 a9 e3 4f cd 4d 6d ba 93 fe 83 dc fe 82[.x..O.Mm...
> 0030: bb f8 24 29 6e 6f 53 1c 91 52 4b 77 1b 72 ff a0..$)noS..RKw.r..
> 0040: 5b 98 1c 20 28 09 0f 4c 93 3c 22 08[.. (..L.<".
> 
> 
> The ethernet package has 122 Bytes and the error in the received file is on
> offset 18. The data "b.ksize.1432" comes also from tftp packets.
> 
This doesn't look like a problem to invalidate the cache, but more like
writeback of old cachelines while the hardware owns the buffer. Can you
try the series "Phasing out direct usage of asm/mmu.h on ARM" and see if
this still happens there? If I'm correct this series should fix this
problem.

I'll send an updated version of this series in the evening, but you
should be able to correct the typo in cpsw.c yourself for testing. :)

Regards,
Lucas

-- 
Pengutronix e.K. | Lucas Stach |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] net: cpsw: invalidate complete buffer

2015-02-27 Thread Lucas Stach
Am Freitag, den 27.02.2015, 14:39 +0100 schrieb Lucas Stach:
> Am Freitag, den 27.02.2015, 14:14 +0100 schrieb Jan Weitzel:
> > On Fri, Feb 27, 2015 at 12:47:24PM +0100, Lucas Stach wrote:
> > > Am Freitag, den 27.02.2015, 10:56 +0100 schrieb Jan Weitzel:
> > > > Without invalidating the complete buffer before giving it to
> > > > dma_inv_range, we got strange packets.
> > > > 
> > > 
> > > This is most likely not the correct fix. If this helps then our
> > > dma_inv_range functions aren't working properly, which would be really
> > > bad. How do those "strange packets" look like?
> > > 
> > We saw the problem with tftp transfers of a 76 byte image. Debug print in
> > tftp_handler
> > 
> > good:
> > tftp_handler: len:76 blocksize:1432 to fifo
> > : 06 08 ba de 7d 27 e1 2c 52 2f cf 77 e0 d3 23 da
> > }'.,R/.w..#.
> > 0010: 62 d4 42 3e 03 20 3a c2 51 aa 51 15 73 be 9e 21b.B>. 
> > :.Q.Q.s..!
> > 0020: 03 ac 78 a9 e3 4f cd 4d 6d ba 93 fe 83 dc fe 82
> > ..x..O.Mm... 
> > 0030: bb f8 24 29 6e 6f 53 1c 91 52 4b 77 1b 72 ff a0
> > ..$)noS..RKw.r.. 
> > 0040: 5b 98 1c 20 28 09 0f 4c 93 3c 22 08[.. (..L.<".   
> >   
> > 
> > bad:
> > tftp_handler: len:76 blocksize:1432 to fifo:
> >   
> > : 06 08 ba de 7d 27 e1 2c 52 2f cf 77 e0 d3 23 da
> > }'.,R/.w..#. 
> > 0010: 62 d4 6b 73 69 7a 65 00 31 34 33 32 00 b0 1b d1
> > b.ksize.1432 
> > 0020: 5b d4 78 a9 e3 4f cd 4d 6d ba 93 fe 83 dc fe 82
> > [.x..O.Mm...
> > 0030: bb f8 24 29 6e 6f 53 1c 91 52 4b 77 1b 72 ff a0
> > ..$)noS..RKw.r..
> > 0040: 5b 98 1c 20 28 09 0f 4c 93 3c 22 08[.. (..L.<".
> > 
> > 
> > The ethernet package has 122 Bytes and the error in the received file is on
> > offset 18. The data "b.ksize.1432" comes also from tftp packets.
> > 
> This doesn't look like a problem to invalidate the cache, but more like
> writeback of old cachelines while the hardware owns the buffer. Can you
> try the series "Phasing out direct usage of asm/mmu.h on ARM" and see if
> this still happens there? If I'm correct this series should fix this
> problem.
> 
> I'll send an updated version of this series in the evening, but you
> should be able to correct the typo in cpsw.c yourself for testing. :)

Or try this patch, which should do the same as the new cache handling,
but may be acceptable for master.

>8
>From f96aec8bd87ac29247617bdcfab41048b942e899 Mon Sep 17 00:00:00 2001
From: Lucas Stach 
Date: Fri, 27 Feb 2015 14:41:46 +0100
Subject: [PATCH] net: cpsw: prevent stray cache writeback

The cache should be invalidated when transfering ownership of a buffer
to the device. Otherwise the writeback of dirty cache lines can
corrupt the hardware written data.

Signed-off-by: Lucas Stach 
---
 drivers/net/cpsw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 799fac89a2f3..301b8a9dfde5 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -888,6 +888,7 @@ static int cpsw_recv(struct eth_device *edev)
while (cpdma_process(priv, &priv->rx_chan, &buffer, &len) >= 0) {
dma_inv_range((ulong)buffer, (ulong)buffer + len);
net_receive(edev, buffer, len);
+   dma_inv_range((ulong)buffer, (ulong)buffer + len);
cpdma_submit(priv, &priv->rx_chan, buffer, PKTSIZE);
}
 
-- 
2.1.4
-- 
Pengutronix e.K. | Lucas Stach |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


A little bit fixing and extending the existing documentation

2015-02-27 Thread Juergen Borleis
This time I changed two older platforms to the new default environment and
added some more documentation snippets.

The result of the change to the new default environment was tested on real
targets.

Regards,
Juergen


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 5/5] Docs: add some info about the Phytec's phyCORE-MPC5200-Tiny

2015-02-27 Thread Juergen Borleis
Signed-off-by: Juergen Borleis 
---
 Documentation/boards/powerpc.rst | 11 +++
 Documentation/boards/powerpc/Phytec-phyCORE-MPC5200-Tiny |  6 ++
 2 files changed, 17 insertions(+)
 create mode 100644 Documentation/boards/powerpc.rst
 create mode 100644 Documentation/boards/powerpc/Phytec-phyCORE-MPC5200-Tiny

diff --git a/Documentation/boards/powerpc.rst b/Documentation/boards/powerpc.rst
new file mode 100644
index 000..94b272c
--- /dev/null
+++ b/Documentation/boards/powerpc.rst
@@ -0,0 +1,11 @@
+PowerPC boards
+--
+
+Not all supported boards have a description here.
+
+.. toctree::
+  :glob:
+  :numbered:
+  :maxdepth: 1
+
+  powerpc/*
diff --git a/Documentation/boards/powerpc/Phytec-phyCORE-MPC5200-Tiny 
b/Documentation/boards/powerpc/Phytec-phyCORE-MPC5200-Tiny
new file mode 100644
index 000..6970027
--- /dev/null
+++ b/Documentation/boards/powerpc/Phytec-phyCORE-MPC5200-Tiny
@@ -0,0 +1,6 @@
+Phytec phyCORE-MPC5200-Tiny
+===
+
+Building the bootloader image for this target is covered by the 
``pcm030_defconfig``.
+
+Use the corresponding ``barebox.bin`` file for this target.
-- 
2.1.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 4/5] phyCORE-MPC5200-Tiny: switch to the new environment template

2015-02-27 Thread Juergen Borleis
Signed-off-by: Juergen Borleis 
---
 arch/ppc/boards/pcm030/env/init/mtdparts-nor  | 11 ++
 arch/ppc/boards/pcm030/env/nv/linux.bootargs.base |  1 +
 arch/ppc/configs/pcm030_defconfig | 42 +++
 3 files changed, 33 insertions(+), 21 deletions(-)
 create mode 100644 arch/ppc/boards/pcm030/env/init/mtdparts-nor
 create mode 100644 arch/ppc/boards/pcm030/env/nv/linux.bootargs.base

diff --git a/arch/ppc/boards/pcm030/env/init/mtdparts-nor 
b/arch/ppc/boards/pcm030/env/init/mtdparts-nor
new file mode 100644
index 000..e900a3b
--- /dev/null
+++ b/arch/ppc/boards/pcm030/env/init/mtdparts-nor
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+init-menu-add-entry "$0" "NOR partitions"
+exit
+fi
+
+mtdparts="512k(nor0.bareboxlow),4M(nor0.kernel),512k(nor0.oftree),26M(nor0.root),512k(nor0.barebox),512k(nor0.bareboxenv)"
+kernelname="physmap-flash.0"
+
+mtdparts-add -d nor0 -k ${kernelname} -p ${mtdparts}
diff --git a/arch/ppc/boards/pcm030/env/nv/linux.bootargs.base 
b/arch/ppc/boards/pcm030/env/nv/linux.bootargs.base
new file mode 100644
index 000..31ce0e7
--- /dev/null
+++ b/arch/ppc/boards/pcm030/env/nv/linux.bootargs.base
@@ -0,0 +1 @@
+console=ttyPSC0,115200
diff --git a/arch/ppc/configs/pcm030_defconfig 
b/arch/ppc/configs/pcm030_defconfig
index 204f946..7b84e2f 100644
--- a/arch/ppc/configs/pcm030_defconfig
+++ b/arch/ppc/configs/pcm030_defconfig
@@ -1,42 +1,42 @@
 CONFIG_TEXT_BASE=0x3e0
 CONFIG_MALLOC_SIZE=0x100
-CONFIG_LONGHELP=y
-CONFIG_GLOB=y
 CONFIG_HUSH_FANCY_PROMPT=y
 CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_PARTITION=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_LOADENV=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TIME=y
-CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_MEMINFO=y
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
+CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/ppc/boards/pcm030/env"
+CONFIG_LONGHELP=y
 CONFIG_CMD_IOMEM=y
-CONFIG_CMD_FLASH=y
+CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_BOOTM_SHOW_TYPE=y
-CONFIG_CMD_UIMAGE=y
-CONFIG_CMD_RESET=y
 CONFIG_CMD_GO=y
-CONFIG_CMD_OFTREE=y
-CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_RESET=y
+CONFIG_CMD_UIMAGE=y
 CONFIG_CMD_PARTITION=y
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_LOADENV=y
 CONFIG_CMD_MAGICVAR=y
 CONFIG_CMD_MAGICVAR_HELP=y
+CONFIG_CMD_SAVEENV=y
 CONFIG_CMD_UNCOMPRESS=y
-CONFIG_NET=y
+CONFIG_CMD_SLEEP=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_TFTP=y
-CONFIG_FS_TFTP=y
-CONFIG_ARCH_MPC5XXX=y
-CONFIG_MACH_PHYCORE_MPC5200B_TINY=y
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_READLINE=y
+CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_CRC=y
+CONFIG_CMD_CRC_CMP=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_OFTREE=y
+CONFIG_CMD_TIME=y
+CONFIG_NET=y
 CONFIG_DRIVER_NET_MPC5200=y
 CONFIG_MTD=y
 CONFIG_DRIVER_CFI=y
 CONFIG_CFI_BUFFER_WRITE=y
+CONFIG_FS_TFTP=y
 CONFIG_ZLIB=y
-- 
2.1.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 2/5] phyCORE-PXA270: switch to the new environment template

2015-02-27 Thread Juergen Borleis
Signed-off-by: Juergen Borleis 
---
 arch/arm/boards/phytec-phycore-pxa270/env/config   | 45 --
 .../phytec-phycore-pxa270/env/init/mtdparts-nor| 11 ++
 .../env/nv/linux.bootargs.base |  1 +
 arch/arm/configs/phytec-phycore-pxa270_defconfig   | 45 +++---
 4 files changed, 34 insertions(+), 68 deletions(-)
 delete mode 100644 arch/arm/boards/phytec-phycore-pxa270/env/config
 create mode 100644 arch/arm/boards/phytec-phycore-pxa270/env/init/mtdparts-nor
 create mode 100644 
arch/arm/boards/phytec-phycore-pxa270/env/nv/linux.bootargs.base

diff --git a/arch/arm/boards/phytec-phycore-pxa270/env/config 
b/arch/arm/boards/phytec-phycore-pxa270/env/config
deleted file mode 100644
index d427800..000
--- a/arch/arm/boards/phytec-phycore-pxa270/env/config
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-eth0.serverip=
-user=
-
-# use 'dhcp' to do dhcp in barebox and in kernel
-# use 'none' if you want to skip kernel ip autoconfiguration
-ip=dhcp
-
-# or set your networking parameters here
-#eth0.ipaddr=a.b.c.d
-#eth0.netmask=a.b.c.d
-#eth0.gateway=a.b.c.d
-#eth0.serverip=a.b.c.d
-
-# can be either 'nfs', 'tftp', 'nor' or 'nand'
-kernel_loc=tftp
-# can be either 'net', 'nor', 'nand' or 'initrd'
-rootfs_loc=net
-
-# can be either 'jffs2' or 'ubifs'
-rootfs_type=ubifs
-rootfsimage=root-${global.hostname}.$rootfs_type
-
-kernelimage=zImage-${global.hostname}
-#kernelimage=uImage-${global.hostname}
-#kernelimage=Image-${global.hostname}
-#kernelimage=Image-${global.hostname}.lzo
-
-if [ -n $user ]; then
-   kernelimage="$user"-"$kernelimage"
-   nfsroot="$eth0.serverip:/home/$user/nfsroot/${global.hostname}"
-   rootfsimage="$user"-"$rootfsimage"
-else
-   nfsroot="$eth0.serverip:/path/to/nfs/root"
-fi
-
-autoboot_timeout=3
-
-bootargs="console=ttyS0,115200"
-
-nor_parts="512k(barebox)ro,256k(bareboxenv),4M(kernel),-(root)"
-rootfs_mtdblock_nor=3
-
-PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m "
diff --git a/arch/arm/boards/phytec-phycore-pxa270/env/init/mtdparts-nor 
b/arch/arm/boards/phytec-phycore-pxa270/env/init/mtdparts-nor
new file mode 100644
index 000..e617cba
--- /dev/null
+++ b/arch/arm/boards/phytec-phycore-pxa270/env/init/mtdparts-nor
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+init-menu-add-entry "$0" "NOR partitions"
+exit
+fi
+
+mtdparts="512k(nor0.barebox),256k(nor0.bareboxenv),4M(nor0.kernel),-(nor0.root)"
+kernelname="physmap-flash.0"
+
+mtdparts-add -d nor0 -k ${kernelname} -p ${mtdparts}
diff --git a/arch/arm/boards/phytec-phycore-pxa270/env/nv/linux.bootargs.base 
b/arch/arm/boards/phytec-phycore-pxa270/env/nv/linux.bootargs.base
new file mode 100644
index 000..476b1fb
--- /dev/null
+++ b/arch/arm/boards/phytec-phycore-pxa270/env/nv/linux.bootargs.base
@@ -0,0 +1 @@
+console=ttyS0,115200
diff --git a/arch/arm/configs/phytec-phycore-pxa270_defconfig 
b/arch/arm/configs/phytec-phycore-pxa270_defconfig
index 57eaff0..304624b 100644
--- a/arch/arm/configs/phytec-phycore-pxa270_defconfig
+++ b/arch/arm/configs/phytec-phycore-pxa270_defconfig
@@ -8,50 +8,48 @@ CONFIG_MMU=y
 CONFIG_MALLOC_SIZE=0x100
 CONFIG_MALLOC_TLSF=y
 CONFIG_KALLSYMS=y
-CONFIG_LONGHELP=y
-CONFIG_GLOB=y
 CONFIG_HUSH_FANCY_PROMPT=y
 CONFIG_CMDLINE_EDITING=y
 CONFIG_AUTO_COMPLETE=y
 CONFIG_PARTITION=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
 CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/phytec-phycore-pxa270/env"
 CONFIG_DEBUG_INFO=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_PRINTENV=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TIME=y
-CONFIG_CMD_AUTOMOUNT=y
-CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_MEMINFO=y
+CONFIG_LONGHELP=y
 CONFIG_CMD_IOMEM=y
-CONFIG_CMD_FLASH=y
+CONFIG_CMD_MEMINFO=y
 CONFIG_CMD_BOOTM_SHOW_TYPE=y
 CONFIG_CMD_BOOTM_VERBOSE=y
 CONFIG_CMD_BOOTM_INITRD=y
 CONFIG_CMD_BOOTM_OFTREE=y
 CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y
-CONFIG_CMD_UIMAGE=y
-# CONFIG_CMD_BOOTZ is not set
 # CONFIG_CMD_BOOTU is not set
-CONFIG_CMD_RESET=y
 CONFIG_CMD_GO=y
-CONFIG_CMD_OFTREE=y
-CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_RESET=y
+CONFIG_CMD_UIMAGE=y
 CONFIG_CMD_PARTITION=y
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_PRINTENV=y
 CONFIG_CMD_MAGICVAR=y
 CONFIG_CMD_MAGICVAR_HELP=y
-CONFIG_CMD_SPLASH=y
-CONFIG_CMD_GPIO=y
+CONFIG_CMD_SAVEENV=y
 CONFIG_CMD_UNCOMPRESS=y
-CONFIG_NET=y
+CONFIG_CMD_SLEEP=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_TFTP=y
-CONFIG_FS_TFTP=y
+CONFIG_CMD_ECHO_E=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_SPLASH=y
+CONFIG_CMD_READLINE=y
+CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_CRC=y
+CONFIG_CMD_CRC_CMP=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_OFTREE=y
+CONFIG_CMD_TIME=y
+CONFIG_NET=y
 CONFIG_DRIVER_SERIAL_PXA=y
 CONFIG_DRIVER_NET_SMC9=y
 # CONFIG_SPI is not set
@@ -59,4 +57,5 @@ CONFIG_MTD=y
 CONFIG_DRIVER_CFI=y
 CONFIG_VIDEO=y
 CONFIG_DRIVER_VIDEO_PXA=y
+CONFIG_FS_TFTP=y
 CONFIG_LZO_DECOMPRESS=y
-- 
2.1.4


__

[PATCH 1/5] Docs: add some info about the Phytec's phyCORE-i.MX35

2015-02-27 Thread Juergen Borleis
Signed-off-by: Juergen Borleis 
---
 Documentation/boards/imx/Phytec-phyCORE-i.MX35.rst | 7 +++
 1 file changed, 7 insertions(+)
 create mode 100644 Documentation/boards/imx/Phytec-phyCORE-i.MX35.rst

diff --git a/Documentation/boards/imx/Phytec-phyCORE-i.MX35.rst 
b/Documentation/boards/imx/Phytec-phyCORE-i.MX35.rst
new file mode 100644
index 000..adf5d26
--- /dev/null
+++ b/Documentation/boards/imx/Phytec-phyCORE-i.MX35.rst
@@ -0,0 +1,7 @@
+Phytec phyCORE-i.MX35
+=
+
+Building the bootloader image for this target is covered by the 
``phytec-phycore-imx35_defconfig``.
+
+Use the corresponding ``barebox.bin`` file for this target. This image can be
+used for booting in ``internal mode`` from NAND or NOR memory.
-- 
2.1.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 3/5] Docs: add some info about the Phytec's phyCORE-PXA270

2015-02-27 Thread Juergen Borleis
Signed-off-by: Juergen Borleis 
---
 Documentation/boards/pxa.rst   | 11 +++
 Documentation/boards/pxa/Phytec-phyCORE-PXA270.rst |  6 ++
 2 files changed, 17 insertions(+)
 create mode 100644 Documentation/boards/pxa.rst
 create mode 100644 Documentation/boards/pxa/Phytec-phyCORE-PXA270.rst

diff --git a/Documentation/boards/pxa.rst b/Documentation/boards/pxa.rst
new file mode 100644
index 000..da848a0
--- /dev/null
+++ b/Documentation/boards/pxa.rst
@@ -0,0 +1,11 @@
+PXA boards
+--
+
+Not all supported boards have a description here.
+
+.. toctree::
+  :glob:
+  :numbered:
+  :maxdepth: 1
+
+  pxa/*
diff --git a/Documentation/boards/pxa/Phytec-phyCORE-PXA270.rst 
b/Documentation/boards/pxa/Phytec-phyCORE-PXA270.rst
new file mode 100644
index 000..23b2829
--- /dev/null
+++ b/Documentation/boards/pxa/Phytec-phyCORE-PXA270.rst
@@ -0,0 +1,6 @@
+Phytec phyCORE-PXA270
+=
+
+Building the bootloader image for this target is covered by the 
``phytec-phycore-pxa270_defconfig``.
+
+Use the corresponding ``barebox.bin`` file for this target.
-- 
2.1.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 5/5] ARM: tegra: add barebox update handler to Jetson board

2015-02-27 Thread Lucas Stach
Signed-off-by: Lucas Stach 
---
 arch/arm/boards/nvidia-jetson-tk1/board.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boards/nvidia-jetson-tk1/board.c 
b/arch/arm/boards/nvidia-jetson-tk1/board.c
index 564e6a0..8d8dddf 100644
--- a/arch/arm/boards/nvidia-jetson-tk1/board.c
+++ b/arch/arm/boards/nvidia-jetson-tk1/board.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define AS3722_SD_VOLTAGE(n)   (0x00 + (n))
 #define AS3722_GPIO_CONTROL(n) (0x08 + (n))
@@ -56,6 +57,9 @@ static int nvidia_jetson_tk1_device_init(void)
 
barebox_set_hostname("jetson-tk1");
 
+   tegra_bbu_register_emmc_handler("eMMC", "/dev/disk0.boot0",
+   BBU_HANDLER_FLAG_DEFAULT);
+
return 0;
 }
 device_initcall(nvidia_jetson_tk1_device_init);
-- 
2.1.0


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 1/5] bbu: include necessary headers

2015-02-27 Thread Lucas Stach
Fixes compile errors due to undefined symbols.

Signed-off-by: Lucas Stach 
---
 include/bbu.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/bbu.h b/include/bbu.h
index adb52b0..4a3d35e 100644
--- a/include/bbu.h
+++ b/include/bbu.h
@@ -2,6 +2,8 @@
 #define __INCLUDE_BBU_H
 
 #include 
+#include 
+#include 
 
 struct bbu_data {
 #define BBU_FLAG_FORCE (1 << 0)
-- 
2.1.0


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 2/5] bbu: make bbu confirm a bit more verbose

2015-02-27 Thread Lucas Stach
It is a lot more user friendly if we give a bit more feedback.

Signed-off-by: Lucas Stach 
---
 common/bbu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/bbu.c b/common/bbu.c
index e31f645..7fb154a 100644
--- a/common/bbu.c
+++ b/common/bbu.c
@@ -65,8 +65,10 @@ int bbu_confirm(struct bbu_data *data)
 
key = read_key();
 
-   if (key == 'y')
+   if (key == 'y') {
+   printf("updating barebox...\n");
return 0;
+   }
 
return -EINTR;
 }
-- 
2.1.0


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 3/5] ARM: tegra: add eMMC barebox update handler

2015-02-27 Thread Lucas Stach
Signed-off-by: Lucas Stach 
---
 arch/arm/mach-tegra/Makefile |  1 +
 arch/arm/mach-tegra/include/mach/tegra-bbu.h | 28 +++
 arch/arm/mach-tegra/tegra-bbu.c  | 74 
 3 files changed, 103 insertions(+)
 create mode 100644 arch/arm/mach-tegra/include/mach/tegra-bbu.h
 create mode 100644 arch/arm/mach-tegra/tegra-bbu.c

diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index e68156a..7c4c1fd 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -13,3 +13,4 @@ lwl-y += tegra_maincomplex_init.o
 obj-y += tegra20.o
 obj-y += tegra20-pmc.o
 obj-y += tegra20-timer.o
+obj-$(CONFIG_BAREBOX_UPDATE) += tegra-bbu.o
diff --git a/arch/arm/mach-tegra/include/mach/tegra-bbu.h 
b/arch/arm/mach-tegra/include/mach/tegra-bbu.h
new file mode 100644
index 000..32e2861
--- /dev/null
+++ b/arch/arm/mach-tegra/include/mach/tegra-bbu.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2015 Lucas Stach 
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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, see .
+ */
+
+#include 
+
+#ifdef CONFIG_BAREBOX_UPDATE
+int tegra_bbu_register_emmc_handler(const char *name, char *devicefile,
+   unsigned long flags);
+#else
+static int tegra_bbu_register_emmc_handler(const char *name, char *devicefile,
+   unsigned long flags)
+{
+   return 0;
+};
+#endif
diff --git a/arch/arm/mach-tegra/tegra-bbu.c b/arch/arm/mach-tegra/tegra-bbu.c
new file mode 100644
index 000..089e6c7
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra-bbu.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2015 Lucas Stach 
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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, see .
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int tegra_bbu_emmc_handler(struct bbu_handler *handler,
+ struct bbu_data *data)
+{
+
+   int fd, ret;
+
+   if (file_detect_type(data->image + 0x4000, data->len) !=
+   filetype_arm_barebox &&
+   !bbu_force(data, "Not an ARM barebox image"))
+   return -EINVAL;
+
+   ret = bbu_confirm(data);
+   if (ret)
+   return ret;
+
+   fd = open(data->devicefile, O_WRONLY);
+   if (fd < 0)
+   return fd;
+
+   ret = write(fd, data->image, data->len);
+   if (ret < 0) {
+   pr_err("writing update to %s failed with %s\n",
+   data->devicefile, strerror(-ret));
+   goto err_close;
+   }
+
+   ret = 0;
+
+err_close:
+   close(fd);
+
+   return ret;
+}
+
+int tegra_bbu_register_emmc_handler(const char *name, char *devicefile,
+   unsigned long flags)
+{
+   struct bbu_handler *handler;
+   int ret = 0;
+
+   handler = xzalloc(sizeof(*handler));
+   handler->name = name;
+   handler->devicefile = devicefile;
+   handler->flags = flags;
+   handler->handler = tegra_bbu_emmc_handler;
+
+   ret = bbu_register_handler(handler);
+   if (ret)
+   free(handler);
+
+   return ret;
+}
-- 
2.1.0


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 4/5] ARM: tegra: add barebox update handler to Beaver board

2015-02-27 Thread Lucas Stach
Signed-off-by: Lucas Stach 
---
 arch/arm/boards/nvidia-beaver/board.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boards/nvidia-beaver/board.c 
b/arch/arm/boards/nvidia-beaver/board.c
index d270301..b4d856e 100644
--- a/arch/arm/boards/nvidia-beaver/board.c
+++ b/arch/arm/boards/nvidia-beaver/board.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static int nvidia_beaver_fs_init(void)
 {
@@ -53,6 +54,9 @@ static int nvidia_beaver_device_init(void)
 
barebox_set_hostname("beaver");
 
+   tegra_bbu_register_emmc_handler("eMMC", "/dev/disk0.boot0",
+   BBU_HANDLER_FLAG_DEFAULT);
+
return 0;
 }
 device_initcall(nvidia_beaver_device_init);
-- 
2.1.0


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox