mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCHv2 0/2] ARM: cfa10036: Store the barebox environment on the MMC
@ 2013-02-26 16:50 Maxime Ripard
  2013-02-26 16:50 ` [PATCH 1/2] cfa-10036: Use the second MMC partition to store the environment Maxime Ripard
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Maxime Ripard @ 2013-02-26 16:50 UTC (permalink / raw)
  To: barebox

Hi,

The cfa-10036 comes only with a SD slot, so there was previously no way to
store in a persistent way the environment we could have modified other than
by modifying the code source itself.

These two patches register a new partition on the SD card to store that
environment, and update the default environment to reflect these changes.

Thanks,
Maxime

Changes from v1:
  - Make use of the new common envfs_register_partition function

Maxime Ripard (2):
  cfa-10036: Use the second MMC partition to store the environment
  cfa10036: Update the environment

 arch/arm/boards/crystalfontz-cfa10036/cfa10036.c         |    8 +++++++-
 arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3  |    6 +++---
 arch/arm/boards/crystalfontz-cfa10036/env/init/automount |    4 ++--
 3 files changed, 12 insertions(+), 6 deletions(-)

-- 
1.7.10.4


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] cfa-10036: Use the second MMC partition to store the environment
  2013-02-26 16:50 [PATCHv2 0/2] ARM: cfa10036: Store the barebox environment on the MMC Maxime Ripard
@ 2013-02-26 16:50 ` Maxime Ripard
  2013-02-26 16:50 ` [PATCH 2/2] cfa10036: Update " Maxime Ripard
  2013-02-27  7:58 ` [PATCHv2 0/2] ARM: cfa10036: Store the barebox environment on the MMC Sascha Hauer
  2 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2013-02-26 16:50 UTC (permalink / raw)
  To: barebox

Since the only storage medium on the cfa-10036 is the MMC card, we need
to have a registered environment partition on it if we want to be able
to modify at runtime.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/boards/crystalfontz-cfa10036/cfa10036.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
index b59dbab..1bc20cf 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
+++ b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
@@ -17,6 +17,7 @@
 
 #include <common.h>
 #include <environment.h>
+#include <envfs.h>
 #include <errno.h>
 #include <fec.h>
 #include <gpio.h>
@@ -99,7 +100,7 @@ mem_initcall(cfa10036_mem_init);
 
 static int cfa10036_devices_init(void)
 {
-	int i;
+	int i, ret;
 
 	/* initizalize muxing */
 	for (i = 0; i < ARRAY_SIZE(cfa10036_pads); i++)
@@ -124,6 +125,11 @@ static int cfa10036_devices_init(void)
 
 	cfa10036_detect_hw();
 
+	ret = envfs_register_partition("disk0", 1);
+	if (ret != 0)
+		printf("Cannot create the 'env0' persistent "
+			 "environment storage (%d)\n", ret);
+
 	return 0;
 }
 device_initcall(cfa10036_devices_init);
-- 
1.7.10.4


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] cfa10036: Update the environment
  2013-02-26 16:50 [PATCHv2 0/2] ARM: cfa10036: Store the barebox environment on the MMC Maxime Ripard
  2013-02-26 16:50 ` [PATCH 1/2] cfa-10036: Use the second MMC partition to store the environment Maxime Ripard
@ 2013-02-26 16:50 ` Maxime Ripard
  2013-02-27  7:58 ` [PATCHv2 0/2] ARM: cfa10036: Store the barebox environment on the MMC Sascha Hauer
  2 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2013-02-26 16:50 UTC (permalink / raw)
  To: barebox

Since we added a new partition in the board, the partitions number of
the boot and rootfs partition have changed as well.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3  |    6 +++---
 arch/arm/boards/crystalfontz-cfa10036/env/init/automount |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
index 5e508f9..439d174 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
+++ b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
@@ -5,6 +5,6 @@ if [ "$1" = menu ]; then
 	exit
 fi
 
-global.bootm.image="/mnt/disk0.1/zImage-${global.hostname}"
-global.bootm.oftree="/mnt/disk0.1/oftree-${global.board.variant}"
-global.linux.bootargs.dyn.root="root=/dev/mmcblk0p3 rootfstype=ext3 rootwait"
+global.bootm.image="/mnt/disk0.2/zImage-${global.hostname}"
+global.bootm.oftree="/mnt/disk0.2/oftree-${global.board.variant}"
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p4 rootfstype=ext3 rootwait"
diff --git a/arch/arm/boards/crystalfontz-cfa10036/env/init/automount b/arch/arm/boards/crystalfontz-cfa10036/env/init/automount
index 668775d..8fdca7c 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/env/init/automount
+++ b/arch/arm/boards/crystalfontz-cfa10036/env/init/automount
@@ -5,5 +5,5 @@ if [ "$1" = menu ]; then
 	exit
 fi
 
-mkdir -p /mnt/disk0.1
-automount -d /mnt/disk0.1 '[ -e /dev/disk0.1 ] && mount /dev/disk0.1 /mnt/disk0.1'
+mkdir -p /mnt/disk0.2
+automount -d /mnt/disk0.2 '[ -e /dev/disk0.2 ] && mount /dev/disk0.2 /mnt/disk0.2'
-- 
1.7.10.4


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCHv2 0/2] ARM: cfa10036: Store the barebox environment on the MMC
  2013-02-26 16:50 [PATCHv2 0/2] ARM: cfa10036: Store the barebox environment on the MMC Maxime Ripard
  2013-02-26 16:50 ` [PATCH 1/2] cfa-10036: Use the second MMC partition to store the environment Maxime Ripard
  2013-02-26 16:50 ` [PATCH 2/2] cfa10036: Update " Maxime Ripard
@ 2013-02-27  7:58 ` Sascha Hauer
  2 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2013-02-27  7:58 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: barebox

On Tue, Feb 26, 2013 at 05:50:19PM +0100, Maxime Ripard wrote:
> Hi,
> 
> The cfa-10036 comes only with a SD slot, so there was previously no way to
> store in a persistent way the environment we could have modified other than
> by modifying the code source itself.
> 
> These two patches register a new partition on the SD card to store that
> environment, and update the default environment to reflect these changes.
> 
> Thanks,
> Maxime

Applied, thanks

Sascha

> 
> Changes from v1:
>   - Make use of the new common envfs_register_partition function
> 
> Maxime Ripard (2):
>   cfa-10036: Use the second MMC partition to store the environment
>   cfa10036: Update the environment
> 
>  arch/arm/boards/crystalfontz-cfa10036/cfa10036.c         |    8 +++++++-
>  arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3  |    6 +++---
>  arch/arm/boards/crystalfontz-cfa10036/env/init/automount |    4 ++--
>  3 files changed, 12 insertions(+), 6 deletions(-)
> 
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] cfa10036: Update the environment
  2013-02-13 16:45 [PATCH " Maxime Ripard
@ 2013-02-13 16:45 ` Maxime Ripard
  0 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2013-02-13 16:45 UTC (permalink / raw)
  To: barebox; +Cc: Brian Lilly

Since we added a new partition in the board, the partitions number of
the boot and rootfs partition have changed as well.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3  |    6 +++---
 arch/arm/boards/crystalfontz-cfa10036/env/init/automount |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3 b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
index 5e508f9..439d174 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
+++ b/arch/arm/boards/crystalfontz-cfa10036/env/boot/mmc-ext3
@@ -5,6 +5,6 @@ if [ "$1" = menu ]; then
 	exit
 fi
 
-global.bootm.image="/mnt/disk0.1/zImage-${global.hostname}"
-global.bootm.oftree="/mnt/disk0.1/oftree-${global.board.variant}"
-global.linux.bootargs.dyn.root="root=/dev/mmcblk0p3 rootfstype=ext3 rootwait"
+global.bootm.image="/mnt/disk0.2/zImage-${global.hostname}"
+global.bootm.oftree="/mnt/disk0.2/oftree-${global.board.variant}"
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p4 rootfstype=ext3 rootwait"
diff --git a/arch/arm/boards/crystalfontz-cfa10036/env/init/automount b/arch/arm/boards/crystalfontz-cfa10036/env/init/automount
index 668775d..8fdca7c 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/env/init/automount
+++ b/arch/arm/boards/crystalfontz-cfa10036/env/init/automount
@@ -5,5 +5,5 @@ if [ "$1" = menu ]; then
 	exit
 fi
 
-mkdir -p /mnt/disk0.1
-automount -d /mnt/disk0.1 '[ -e /dev/disk0.1 ] && mount /dev/disk0.1 /mnt/disk0.1'
+mkdir -p /mnt/disk0.2
+automount -d /mnt/disk0.2 '[ -e /dev/disk0.2 ] && mount /dev/disk0.2 /mnt/disk0.2'
-- 
1.7.10.4


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-27  7:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-26 16:50 [PATCHv2 0/2] ARM: cfa10036: Store the barebox environment on the MMC Maxime Ripard
2013-02-26 16:50 ` [PATCH 1/2] cfa-10036: Use the second MMC partition to store the environment Maxime Ripard
2013-02-26 16:50 ` [PATCH 2/2] cfa10036: Update " Maxime Ripard
2013-02-27  7:58 ` [PATCHv2 0/2] ARM: cfa10036: Store the barebox environment on the MMC Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2013-02-13 16:45 [PATCH " Maxime Ripard
2013-02-13 16:45 ` [PATCH 2/2] cfa10036: Update the environment Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox