mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] bbu: imx-bbu-internal: add i.MX51 SPI/I2C flash handler
@ 2018-05-07 14:49 Lucas Stach
  2018-05-14  7:09 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas Stach @ 2018-05-07 14:49 UTC (permalink / raw)
  To: barebox

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/mach-imx/imx-bbu-internal.c | 14 ++++++++++++++
 arch/arm/mach-imx/include/mach/bbu.h |  9 +++++++++
 2 files changed, 23 insertions(+)

diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
index d03be7248742..c7375ff52aee 100644
--- a/arch/arm/mach-imx/imx-bbu-internal.c
+++ b/arch/arm/mach-imx/imx-bbu-internal.c
@@ -490,6 +490,20 @@ int imx51_bbu_internal_mmc_register_handler(const char *name, char *devicefile,
 	return __register_handler(imx_handler);
 }
 
+int imx51_bbu_internal_spi_i2c_register_handler(const char *name,
+		char *devicefile, unsigned long flags)
+{
+	struct imx_internal_bbu_handler *imx_handler;
+
+	imx_handler = __init_handler(name, devicefile, flags);
+	imx_handler->flash_header_offset = FLASH_HEADER_OFFSET_MMC;
+
+	imx_handler->flags = IMX_INTERNAL_FLAG_ERASE;
+	imx_handler->handler.handler = imx_bbu_internal_v1_update;
+
+	return __register_handler(imx_handler);
+}
+
 /*
  * Register an i.MX53 internal boot update handler for MMC/SD
  */
diff --git a/arch/arm/mach-imx/include/mach/bbu.h b/arch/arm/mach-imx/include/mach/bbu.h
index 15bdbe1bec0d..bde3e02d2790 100644
--- a/arch/arm/mach-imx/include/mach/bbu.h
+++ b/arch/arm/mach-imx/include/mach/bbu.h
@@ -12,6 +12,9 @@ struct imx_dcd_v2_entry;
 int imx51_bbu_internal_mmc_register_handler(const char *name, char *devicefile,
 		unsigned long flags);
 
+int imx51_bbu_internal_spi_i2c_register_handler(const char *name,
+		char *devicefile, unsigned long flags);
+
 int imx53_bbu_internal_mmc_register_handler(const char *name, char *devicefile,
 		unsigned long flags);
 
@@ -41,6 +44,12 @@ static inline int imx51_bbu_internal_mmc_register_handler(const char *name, char
 	return -ENOSYS;
 }
 
+static inline int imx51_bbu_internal_spi_i2c_register_handler(const char *name,
+		char *devicefile, unsigned long flags)
+{
+	return -ENOSYS;
+}
+
 static inline int imx53_bbu_internal_mmc_register_handler(const char *name, char *devicefile,
 		unsigned long flags)
 {
-- 
2.17.0


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

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

* Re: [PATCH] bbu: imx-bbu-internal: add i.MX51 SPI/I2C flash handler
  2018-05-07 14:49 [PATCH] bbu: imx-bbu-internal: add i.MX51 SPI/I2C flash handler Lucas Stach
@ 2018-05-14  7:09 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2018-05-14  7:09 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

On Mon, May 07, 2018 at 04:49:44PM +0200, Lucas Stach wrote:
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  arch/arm/mach-imx/imx-bbu-internal.c | 14 ++++++++++++++
>  arch/arm/mach-imx/include/mach/bbu.h |  9 +++++++++
>  2 files changed, 23 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c
> index d03be7248742..c7375ff52aee 100644
> --- a/arch/arm/mach-imx/imx-bbu-internal.c
> +++ b/arch/arm/mach-imx/imx-bbu-internal.c
> @@ -490,6 +490,20 @@ int imx51_bbu_internal_mmc_register_handler(const char *name, char *devicefile,
>  	return __register_handler(imx_handler);
>  }
>  
> +int imx51_bbu_internal_spi_i2c_register_handler(const char *name,
> +		char *devicefile, unsigned long flags)
> +{
> +	struct imx_internal_bbu_handler *imx_handler;
> +
> +	imx_handler = __init_handler(name, devicefile, flags);
> +	imx_handler->flash_header_offset = FLASH_HEADER_OFFSET_MMC;
> +
> +	imx_handler->flags = IMX_INTERNAL_FLAG_ERASE;
> +	imx_handler->handler.handler = imx_bbu_internal_v1_update;
> +
> +	return __register_handler(imx_handler);
> +}
> +
>  /*
>   * Register an i.MX53 internal boot update handler for MMC/SD
>   */
> diff --git a/arch/arm/mach-imx/include/mach/bbu.h b/arch/arm/mach-imx/include/mach/bbu.h
> index 15bdbe1bec0d..bde3e02d2790 100644
> --- a/arch/arm/mach-imx/include/mach/bbu.h
> +++ b/arch/arm/mach-imx/include/mach/bbu.h
> @@ -12,6 +12,9 @@ struct imx_dcd_v2_entry;
>  int imx51_bbu_internal_mmc_register_handler(const char *name, char *devicefile,
>  		unsigned long flags);
>  
> +int imx51_bbu_internal_spi_i2c_register_handler(const char *name,
> +		char *devicefile, unsigned long flags);
> +
>  int imx53_bbu_internal_mmc_register_handler(const char *name, char *devicefile,
>  		unsigned long flags);
>  
> @@ -41,6 +44,12 @@ static inline int imx51_bbu_internal_mmc_register_handler(const char *name, char
>  	return -ENOSYS;
>  }
>  
> +static inline int imx51_bbu_internal_spi_i2c_register_handler(const char *name,
> +		char *devicefile, unsigned long flags)
> +{
> +	return -ENOSYS;
> +}
> +
>  static inline int imx53_bbu_internal_mmc_register_handler(const char *name, char *devicefile,
>  		unsigned long flags)
>  {
> -- 
> 2.17.0
> 
> 
> _______________________________________________
> 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] 2+ messages in thread

end of thread, other threads:[~2018-05-14  7:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-07 14:49 [PATCH] bbu: imx-bbu-internal: add i.MX51 SPI/I2C flash handler Lucas Stach
2018-05-14  7:09 ` Sascha Hauer

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