mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 3/4] ARM: omap: barebox update nand xloadslots handler
@ 2014-05-15  9:41 Wadim Egorov
  2014-05-15  9:41 ` [PATCH v2 4/4] phycore-am335x: Added bbu " Wadim Egorov
  2014-05-15 12:58 ` [PATCH v2 3/4] ARM: omap: barebox update " Sascha Hauer
  0 siblings, 2 replies; 6+ messages in thread
From: Wadim Egorov @ 2014-05-15  9:41 UTC (permalink / raw)
  To: barebox

- Added barebox nand xloadslots update handler
- This handler updates all given xload slots in nand

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
---
v2:
  - fixed xloadslots updater description in mach-omap/Kconfig
  - changed method to pass device files
  - added nand_bbu_handler struct
  - added write_image()
---
 arch/arm/mach-omap/Kconfig                      |   10 ++
 arch/arm/mach-omap/Makefile                     |    1 +
 arch/arm/mach-omap/am33xx_bbu_nand_xloadslots.c |  122 +++++++++++++++++++++++
 arch/arm/mach-omap/include/mach/bbu.h           |   13 +++
 4 files changed, 146 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap/am33xx_bbu_nand_xloadslots.c

diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index 12b9c1f..ee6d548 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -93,6 +93,16 @@ config BAREBOX_UPDATE_AM33XX_SPI_NOR_MLO
 	  Say Y for barebox update SPI NOR MLO handler.
 	  AM35xx, AM33xx chips use big endian MLO for SPI NOR flash.
 
+config BAREBOX_UPDATE_AM33XX_NAND_XLOADSLOTS
+	prompt "barebox update nand xload slots handler"
+	bool
+	depends on BAREBOX_UPDATE
+	help
+	  Say Y for barebox update nand xload slots handler.
+	  This update handler updates 4 default nand xload slots
+	  with a single command.
+	  The Handler also checks if the given image has a valid CH header.
+
 config ARCH_TEXT_BASE
 	hex
 	default 0x80e80000 if MACH_OMAP343xSDP
diff --git a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile
index 81a771e..c9b6f4b 100644
--- a/arch/arm/mach-omap/Makefile
+++ b/arch/arm/mach-omap/Makefile
@@ -32,3 +32,4 @@ obj-$(CONFIG_MFD_TWL6030) += omap4_twl6030_mmc.o
 obj-$(CONFIG_OMAP4_USBBOOT) += omap4_rom_usb.o
 obj-$(CONFIG_CMD_BOOT_ORDER) += boot_order.o
 obj-$(CONFIG_BAREBOX_UPDATE_AM33XX_SPI_NOR_MLO) += am33xx_bbu_spi_mlo.o
+obj-$(CONFIG_BAREBOX_UPDATE_AM33XX_NAND_XLOADSLOTS) += am33xx_bbu_nand_xloadslots.o
diff --git a/arch/arm/mach-omap/am33xx_bbu_nand_xloadslots.c b/arch/arm/mach-omap/am33xx_bbu_nand_xloadslots.c
new file mode 100644
index 0000000..0b4f1cc
--- /dev/null
+++ b/arch/arm/mach-omap/am33xx_bbu_nand_xloadslots.c
@@ -0,0 +1,122 @@
+/*
+ * am33xx_bbu_nand_xloadslots.c - barebox update handler for
+ * the nand xload slots.
+ *
+ * Copyright (c) 2014 Wadim Egorov <w.egorov@phytec.de>, Phytec
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <errno.h>
+#include <bbu.h>
+#include <fs.h>
+#include <fcntl.h>
+#include <filetype.h>
+
+struct nand_bbu_handler {
+	struct bbu_handler bbu_handler;
+	char **devicefile;
+	int num_devicefiles;
+};
+
+static int write_image(const char *devfile, const void *image, size_t size)
+{
+	int fd = 0;
+	int ret = 0;
+
+	fd = open(devfile, O_WRONLY);
+	if (fd < 0) {
+		pr_err("could not open %s: %s\n", devfile,
+			errno_str());
+		return fd;
+	}
+
+	ret = erase(fd, ~0, 0);
+	if (ret < 0) {
+		pr_err("could not erase %s: %s\n", devfile,
+			errno_str());
+		close(fd);
+		return ret;
+	}
+
+	ret = write(fd, image, size);
+	if (ret < 0) {
+		pr_err("could not write to fd %s: %s\n", devfile,
+			errno_str());
+		close(fd);
+		return ret;
+	}
+
+	close(fd);
+
+	return 0;
+}
+
+/*
+ * This handler updates all given xload slots in nand with an image.
+ */
+static int nand_xloadslots_update_handler(struct bbu_handler *handler,
+					struct bbu_data *data)
+{
+	int ret = 0;
+	const void *image = data->image;
+	size_t size = data->len;
+	struct nand_bbu_handler *nh;
+	int i = 0;
+
+	if (file_detect_type(image, size) != filetype_ch_image) {
+		pr_err("%s is not a valid ch-image\n", data->imagefile);
+		return -EINVAL;
+	}
+
+	nh = container_of(handler, struct nand_bbu_handler, bbu_handler);
+
+	/* check if the devicefile has been overwritten */
+	if (strcmp(data->devicefile, nh->devicefile[0]) != 0) {
+		ret = bbu_confirm(data);
+		if (ret != 0)
+			return ret;
+
+		ret = write_image(data->devicefile, image, size);
+		if (ret != 0)
+			return ret;
+	} else {
+		for (i = 0; i < nh->num_devicefiles; i++) {
+			ret =  write_image(nh->devicefile[i], image, size);
+			if (ret != 0)
+				return ret;
+		}
+	}
+
+	return 0;
+}
+
+int am33xx_bbu_nand_xloadslots_register_handler(const char *name,
+						char **devicefile,
+						int num_devicefiles)
+{
+	struct nand_bbu_handler *handler;
+	int ret;
+
+	handler = xzalloc(sizeof(*handler));
+	handler->devicefile = devicefile;
+	handler->num_devicefiles = num_devicefiles;
+	handler->bbu_handler.devicefile = devicefile[0];
+	handler->bbu_handler.handler = nand_xloadslots_update_handler;
+	handler->bbu_handler.name = name;
+
+	ret = bbu_register_handler(&handler->bbu_handler);
+	if (ret)
+		free(handler);
+
+	return ret;
+}
diff --git a/arch/arm/mach-omap/include/mach/bbu.h b/arch/arm/mach-omap/include/mach/bbu.h
index 6d4b70f..74eae15 100644
--- a/arch/arm/mach-omap/include/mach/bbu.h
+++ b/arch/arm/mach-omap/include/mach/bbu.h
@@ -12,4 +12,17 @@ int am33xx_bbu_spi_nor_mlo_register_handler(const char *name, char *devicefile)
 }
 #endif
 
+#ifdef CONFIG_BAREBOX_UPDATE_AM33XX_NAND_XLOADSLOTS
+int am33xx_bbu_nand_xloadslots_register_handler(const char *name,
+						char **devicefile,
+						int num_devicefiles);
+#else
+int am33xx_bbu_nand_xloadslots_register_handler(const char *name,
+						char **devicefile,
+						int num_devicefiles)
+{
+	return 0;
+}
+#endif
+
 #endif
-- 
1.7.0.4


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

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

* [PATCH v2 4/4] phycore-am335x: Added bbu nand xloadslots handler
  2014-05-15  9:41 [PATCH v2 3/4] ARM: omap: barebox update nand xloadslots handler Wadim Egorov
@ 2014-05-15  9:41 ` Wadim Egorov
  2014-05-15  9:48   ` Alexander Aring
  2014-05-15 12:59   ` Sascha Hauer
  2014-05-15 12:58 ` [PATCH v2 3/4] ARM: omap: barebox update " Sascha Hauer
  1 sibling, 2 replies; 6+ messages in thread
From: Wadim Egorov @ 2014-05-15  9:41 UTC (permalink / raw)
  To: barebox

Added bbu nand xloadslots handler to phycore-am335x.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
---
v2:
  - changed method to pass device files
---
 arch/arm/boards/phytec-phycore-am335x/board.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/phytec-phycore-am335x/board.c b/arch/arm/boards/phytec-phycore-am335x/board.c
index 59de42b..76782d4 100644
--- a/arch/arm/boards/phytec-phycore-am335x/board.c
+++ b/arch/arm/boards/phytec-phycore-am335x/board.c
@@ -48,6 +48,13 @@ static struct omap_barebox_part pcm051_barebox_part = {
 	.nor_size = SZ_512K,
 };
 
+char *xloadslots[] = {
+	"/dev/nand0.xload.bb",
+	"/dev/nand0.xload_backup1.bb",
+	"/dev/nand0.xload_backup2.bb",
+	"/dev/nand0.xload_backup3.bb"
+};
+
 static int pcm051_devices_init(void)
 {
 	if (!of_machine_is_compatible("phytec,pcm051"))
@@ -69,6 +76,8 @@ static int pcm051_devices_init(void)
 	armlinux_set_architecture(MACH_TYPE_PCM051);
 
 	am33xx_bbu_spi_nor_mlo_register_handler("MLO.spi", "/dev/m25p0.xload");
+	am33xx_bbu_nand_xloadslots_register_handler("xloadslots",
+		xloadslots, ARRAY_SIZE(xloadslots));
 
 	return 0;
 }
-- 
1.7.0.4


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

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

* Re: [PATCH v2 4/4] phycore-am335x: Added bbu nand xloadslots handler
  2014-05-15  9:41 ` [PATCH v2 4/4] phycore-am335x: Added bbu " Wadim Egorov
@ 2014-05-15  9:48   ` Alexander Aring
  2014-05-15  9:55     ` Alexander Aring
  2014-05-15 12:59   ` Sascha Hauer
  1 sibling, 1 reply; 6+ messages in thread
From: Alexander Aring @ 2014-05-15  9:48 UTC (permalink / raw)
  To: Wadim Egorov; +Cc: barebox

On Thu, May 15, 2014 at 11:41:08AM +0200, Wadim Egorov wrote:
> Added bbu nand xloadslots handler to phycore-am335x.
> 
> Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
> ---
> v2:
>   - changed method to pass device files
> ---
>  arch/arm/boards/phytec-phycore-am335x/board.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boards/phytec-phycore-am335x/board.c b/arch/arm/boards/phytec-phycore-am335x/board.c
> index 59de42b..76782d4 100644
> --- a/arch/arm/boards/phytec-phycore-am335x/board.c
> +++ b/arch/arm/boards/phytec-phycore-am335x/board.c
> @@ -48,6 +48,13 @@ static struct omap_barebox_part pcm051_barebox_part = {
>  	.nor_size = SZ_512K,
>  };
>  
> +char *xloadslots[] = {
maybe change this to const?

> +	"/dev/nand0.xload.bb",
> +	"/dev/nand0.xload_backup1.bb",
> +	"/dev/nand0.xload_backup2.bb",
> +	"/dev/nand0.xload_backup3.bb"
> +};
> +
>  static int pcm051_devices_init(void)
>  {
>  	if (!of_machine_is_compatible("phytec,pcm051"))
> @@ -69,6 +76,8 @@ static int pcm051_devices_init(void)
>  	armlinux_set_architecture(MACH_TYPE_PCM051);
>  
>  	am33xx_bbu_spi_nor_mlo_register_handler("MLO.spi", "/dev/m25p0.xload");
> +	am33xx_bbu_nand_xloadslots_register_handler("xloadslots",
> +		xloadslots, ARRAY_SIZE(xloadslots));
>  

- Alex

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

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

* Re: [PATCH v2 4/4] phycore-am335x: Added bbu nand xloadslots handler
  2014-05-15  9:48   ` Alexander Aring
@ 2014-05-15  9:55     ` Alexander Aring
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Aring @ 2014-05-15  9:55 UTC (permalink / raw)
  To: Wadim Egorov; +Cc: barebox

On Thu, May 15, 2014 at 11:48:11AM +0200, Alexander Aring wrote:
> On Thu, May 15, 2014 at 11:41:08AM +0200, Wadim Egorov wrote:
> > Added bbu nand xloadslots handler to phycore-am335x.
> > 
> > Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
> > ---
> > v2:
> >   - changed method to pass device files
> > ---
> >  arch/arm/boards/phytec-phycore-am335x/board.c |    9 +++++++++
> >  1 files changed, 9 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/boards/phytec-phycore-am335x/board.c b/arch/arm/boards/phytec-phycore-am335x/board.c
> > index 59de42b..76782d4 100644
> > --- a/arch/arm/boards/phytec-phycore-am335x/board.c
> > +++ b/arch/arm/boards/phytec-phycore-am335x/board.c
> > @@ -48,6 +48,13 @@ static struct omap_barebox_part pcm051_barebox_part = {
> >  	.nor_size = SZ_512K,
> >  };
> >  
> > +char *xloadslots[] = {
> maybe change this to const?
> 
meant static here. :-)

- Alex

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

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

* Re: [PATCH v2 3/4] ARM: omap: barebox update nand xloadslots handler
  2014-05-15  9:41 [PATCH v2 3/4] ARM: omap: barebox update nand xloadslots handler Wadim Egorov
  2014-05-15  9:41 ` [PATCH v2 4/4] phycore-am335x: Added bbu " Wadim Egorov
@ 2014-05-15 12:58 ` Sascha Hauer
  1 sibling, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2014-05-15 12:58 UTC (permalink / raw)
  To: Wadim Egorov; +Cc: barebox

On Thu, May 15, 2014 at 11:41:07AM +0200, Wadim Egorov wrote:
> - Added barebox nand xloadslots update handler
> - This handler updates all given xload slots in nand
> 
> Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
> ---
> v2:
>   - fixed xloadslots updater description in mach-omap/Kconfig
>   - changed method to pass device files
>   - added nand_bbu_handler struct
>   - added write_image()
> ---
>  arch/arm/mach-omap/Kconfig                      |   10 ++
>  arch/arm/mach-omap/Makefile                     |    1 +
>  arch/arm/mach-omap/am33xx_bbu_nand_xloadslots.c |  122 +++++++++++++++++++++++
>  arch/arm/mach-omap/include/mach/bbu.h           |   13 +++
>  4 files changed, 146 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-omap/am33xx_bbu_nand_xloadslots.c
> 
> diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
> index 12b9c1f..ee6d548 100644
> --- a/arch/arm/mach-omap/Kconfig
> +++ b/arch/arm/mach-omap/Kconfig
> @@ -93,6 +93,16 @@ config BAREBOX_UPDATE_AM33XX_SPI_NOR_MLO
>  	  Say Y for barebox update SPI NOR MLO handler.
>  	  AM35xx, AM33xx chips use big endian MLO for SPI NOR flash.
>  
> +config BAREBOX_UPDATE_AM33XX_NAND_XLOADSLOTS
> +	prompt "barebox update nand xload slots handler"
> +	bool
> +	depends on BAREBOX_UPDATE
> +	help
> +	  Say Y for barebox update nand xload slots handler.
> +	  This update handler updates 4 default nand xload slots
> +	  with a single command.
> +	  The Handler also checks if the given image has a valid CH header.
> +
>  config ARCH_TEXT_BASE
>  	hex
>  	default 0x80e80000 if MACH_OMAP343xSDP
> diff --git a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile
> index 81a771e..c9b6f4b 100644
> --- a/arch/arm/mach-omap/Makefile
> +++ b/arch/arm/mach-omap/Makefile
> @@ -32,3 +32,4 @@ obj-$(CONFIG_MFD_TWL6030) += omap4_twl6030_mmc.o
>  obj-$(CONFIG_OMAP4_USBBOOT) += omap4_rom_usb.o
>  obj-$(CONFIG_CMD_BOOT_ORDER) += boot_order.o
>  obj-$(CONFIG_BAREBOX_UPDATE_AM33XX_SPI_NOR_MLO) += am33xx_bbu_spi_mlo.o
> +obj-$(CONFIG_BAREBOX_UPDATE_AM33XX_NAND_XLOADSLOTS) += am33xx_bbu_nand_xloadslots.o
> diff --git a/arch/arm/mach-omap/am33xx_bbu_nand_xloadslots.c b/arch/arm/mach-omap/am33xx_bbu_nand_xloadslots.c
> new file mode 100644
> index 0000000..0b4f1cc
> --- /dev/null
> +++ b/arch/arm/mach-omap/am33xx_bbu_nand_xloadslots.c
> @@ -0,0 +1,122 @@
> +/*
> + * am33xx_bbu_nand_xloadslots.c - barebox update handler for
> + * the nand xload slots.
> + *
> + * Copyright (c) 2014 Wadim Egorov <w.egorov@phytec.de>, Phytec
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2
> + * as published by the Free Software Foundation.
> + *
> + * 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.
> + */
> +
> +#include <common.h>
> +#include <malloc.h>
> +#include <errno.h>
> +#include <bbu.h>
> +#include <fs.h>
> +#include <fcntl.h>
> +#include <filetype.h>
> +
> +struct nand_bbu_handler {
> +	struct bbu_handler bbu_handler;
> +	char **devicefile;
> +	int num_devicefiles;
> +};
> +
> +static int write_image(const char *devfile, const void *image, size_t size)
> +{
> +	int fd = 0;
> +	int ret = 0;
> +
> +	fd = open(devfile, O_WRONLY);
> +	if (fd < 0) {
> +		pr_err("could not open %s: %s\n", devfile,
> +			errno_str());
> +		return fd;
> +	}
> +
> +	ret = erase(fd, ~0, 0);
> +	if (ret < 0) {
> +		pr_err("could not erase %s: %s\n", devfile,
> +			errno_str());
> +		close(fd);
> +		return ret;
> +	}
> +
> +	ret = write(fd, image, size);
> +	if (ret < 0) {
> +		pr_err("could not write to fd %s: %s\n", devfile,
> +			errno_str());
> +		close(fd);
> +		return ret;
> +	}
> +
> +	close(fd);
> +
> +	return 0;
> +}
> +
> +/*
> + * This handler updates all given xload slots in nand with an image.
> + */
> +static int nand_xloadslots_update_handler(struct bbu_handler *handler,
> +					struct bbu_data *data)
> +{
> +	int ret = 0;
> +	const void *image = data->image;
> +	size_t size = data->len;
> +	struct nand_bbu_handler *nh;
> +	int i = 0;
> +
> +	if (file_detect_type(image, size) != filetype_ch_image) {
> +		pr_err("%s is not a valid ch-image\n", data->imagefile);
> +		return -EINVAL;
> +	}
> +
> +	nh = container_of(handler, struct nand_bbu_handler, bbu_handler);
> +
> +	/* check if the devicefile has been overwritten */
> +	if (strcmp(data->devicefile, nh->devicefile[0]) != 0) {
> +		ret = bbu_confirm(data);
> +		if (ret != 0)
> +			return ret;
> +
> +		ret = write_image(data->devicefile, image, size);
> +		if (ret != 0)
> +			return ret;
> +	} else {
> +		for (i = 0; i < nh->num_devicefiles; i++) {
> +			ret =  write_image(nh->devicefile[i], image, size);
> +			if (ret != 0)
> +				return ret;
> +		}
> +	}
> +
> +	return 0;
> +}
> +
> +int am33xx_bbu_nand_xloadslots_register_handler(const char *name,
> +						char **devicefile,
> +						int num_devicefiles)
> +{
> +	struct nand_bbu_handler *handler;
> +	int ret;
> +
> +	handler = xzalloc(sizeof(*handler));
> +	handler->devicefile = devicefile;
> +	handler->num_devicefiles = num_devicefiles;
> +	handler->bbu_handler.devicefile = devicefile[0];
> +	handler->bbu_handler.handler = nand_xloadslots_update_handler;
> +	handler->bbu_handler.name = name;
> +
> +	ret = bbu_register_handler(&handler->bbu_handler);
> +	if (ret)
> +		free(handler);
> +
> +	return ret;
> +}
> diff --git a/arch/arm/mach-omap/include/mach/bbu.h b/arch/arm/mach-omap/include/mach/bbu.h
> index 6d4b70f..74eae15 100644
> --- a/arch/arm/mach-omap/include/mach/bbu.h
> +++ b/arch/arm/mach-omap/include/mach/bbu.h
> @@ -12,4 +12,17 @@ int am33xx_bbu_spi_nor_mlo_register_handler(const char *name, char *devicefile)
>  }
>  #endif
>  
> +#ifdef CONFIG_BAREBOX_UPDATE_AM33XX_NAND_XLOADSLOTS
> +int am33xx_bbu_nand_xloadslots_register_handler(const char *name,
> +						char **devicefile,
> +						int num_devicefiles);
> +#else
> +int am33xx_bbu_nand_xloadslots_register_handler(const char *name,
> +						char **devicefile,
> +						int num_devicefiles)

static inline missing here.

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

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

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

* Re: [PATCH v2 4/4] phycore-am335x: Added bbu nand xloadslots handler
  2014-05-15  9:41 ` [PATCH v2 4/4] phycore-am335x: Added bbu " Wadim Egorov
  2014-05-15  9:48   ` Alexander Aring
@ 2014-05-15 12:59   ` Sascha Hauer
  1 sibling, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2014-05-15 12:59 UTC (permalink / raw)
  To: Wadim Egorov; +Cc: barebox

On Thu, May 15, 2014 at 11:41:08AM +0200, Wadim Egorov wrote:
> Added bbu nand xloadslots handler to phycore-am335x.
> 
> Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
> ---
> v2:
>   - changed method to pass device files
> ---
>  arch/arm/boards/phytec-phycore-am335x/board.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boards/phytec-phycore-am335x/board.c b/arch/arm/boards/phytec-phycore-am335x/board.c
> index 59de42b..76782d4 100644
> --- a/arch/arm/boards/phytec-phycore-am335x/board.c
> +++ b/arch/arm/boards/phytec-phycore-am335x/board.c
> @@ -48,6 +48,13 @@ static struct omap_barebox_part pcm051_barebox_part = {
>  	.nor_size = SZ_512K,
>  };
>  
> +char *xloadslots[] = {
> +	"/dev/nand0.xload.bb",
> +	"/dev/nand0.xload_backup1.bb",
> +	"/dev/nand0.xload_backup2.bb",
> +	"/dev/nand0.xload_backup3.bb"
> +};
> +
>  static int pcm051_devices_init(void)
>  {
>  	if (!of_machine_is_compatible("phytec,pcm051"))
> @@ -69,6 +76,8 @@ static int pcm051_devices_init(void)
>  	armlinux_set_architecture(MACH_TYPE_PCM051);
>  
>  	am33xx_bbu_spi_nor_mlo_register_handler("MLO.spi", "/dev/m25p0.xload");
> +	am33xx_bbu_nand_xloadslots_register_handler("xloadslots",
> +		xloadslots, ARRAY_SIZE(xloadslots));

Can you use a name with containing 'nand' in it? When one reads
'xloadslots' he probably hasn't got a clue which image is updated.

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

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

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

end of thread, other threads:[~2014-05-15 13:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-15  9:41 [PATCH v2 3/4] ARM: omap: barebox update nand xloadslots handler Wadim Egorov
2014-05-15  9:41 ` [PATCH v2 4/4] phycore-am335x: Added bbu " Wadim Egorov
2014-05-15  9:48   ` Alexander Aring
2014-05-15  9:55     ` Alexander Aring
2014-05-15 12:59   ` Sascha Hauer
2014-05-15 12:58 ` [PATCH v2 3/4] ARM: omap: barebox update " Sascha Hauer

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