Skip to contentSkip to conversation

ARM: am33xx: Add barebox_update eMMC option

PATCH Superseded Daniel Schultz 2 participants 3 messages Sep 2, 2015 – Sep 4, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: am33xx: Add barebox_update eMMC option

With this patch the barebox_update command will be extended by the possibility to flash the MLO to eMMC devices.

The MLO will be flashed to the following addresses:
0x20000
0x40000
0x60000

The MBR at addr. 0x0 won't be overwritten.
Therefore it's necessary to remove the MLO in the boot partition.

---
 arch/arm/configs/am335x_defconfig     |  1 +
 arch/arm/mach-omap/Kconfig            |  7 ++++
 arch/arm/mach-omap/Makefile           |  1 +
 arch/arm/mach-omap/am33xx_bbu_emmc.c  | 78 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap/include/mach/bbu.h | 18 ++++++++
 5 files changed, 105 insertions(+)
 create mode 100644 arch/arm/mach-omap/am33xx_bbu_emmc.c
arch/arm/configs/am335x_defconfig +1 -0
index 559f56a..c5ab3c9 100644
@@ -1,6 +1,7 @@
 CONFIG_ARCH_OMAP=y
 CONFIG_BAREBOX_UPDATE_AM33XX_SPI_NOR_MLO=y
 CONFIG_BAREBOX_UPDATE_AM33XX_NAND=y
+CONFIG_BAREBOX_UPDATE_AM33XX_EMMC=y
 CONFIG_OMAP_MULTI_BOARDS=y
 CONFIG_MACH_AFI_GF=y
 CONFIG_MACH_BEAGLEBONE=y
arch/arm/mach-omap/Kconfig +7 -0
index fb17df0..0df38e1 100644
@@ -105,6 +105,13 @@ config BAREBOX_UPDATE_AM33XX_NAND
 	  This also includes a handler for updating the regular barebox binary
 	  in NAND.
 
+config BAREBOX_UPDATE_AM33XX_EMMC
+	prompt "barebox update eMMC handler"
+	bool
+	depends on BAREBOX_UPDATE
+	help
+	  Say Y for barebox update eMMC handler.
+
 config ARCH_TEXT_BASE
 	hex
 	default 0x80e80000 if MACH_OMAP343xSDP
arch/arm/mach-omap/Makefile +1 -0
index bef1d05..82f1a9e 100644
@@ -34,3 +34,4 @@ 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) += am33xx_bbu_nand.o
+obj-$(CONFIG_BAREBOX_UPDATE_AM33XX_EMMC) += am33xx_bbu_emmc.o
arch/arm/mach-omap/am33xx_bbu_emmc.c new file +78 -0

78 lines not on this page · raw message

arch/arm/mach-omap/include/mach/bbu.h +18 -0
index 36d87e1..4d1b4fa 100644
@@ -37,4 +37,22 @@ static inline int am33xx_bbu_nand_register_handler(const char *name, char *devic
 }
 #endif
 
+#ifdef CONFIG_BAREBOX_UPDATE_AM33XX_EMMC
+int am33xx_bbu_emmc_mlo_register_handler(const char *name, char *devicefile);
+int am33xx_bbu_emmc_register_handler(const char *name, char *devicefile);
+#else
+static inline int am33xx_bbu_emmc_mlo_register_handler(const char *name,
+							char *devicefile)
+{
+	return 0;
+}
+
+static inline int am33xx_bbu_emmc_register_handler(const char *name,
+							char *devicefile)
+{
+	return 0;
+}
+#endif
+
+
 #endif
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/2 ARM: am335x: Register eMMC MLO handler

Register the eMMC MLO handler to the barebox_update command.

---
 arch/arm/boards/beaglebone/board.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boards/beaglebone/board.c +4 -0
index 4e0e374..5717c45 100644
@@ -38,6 +38,7 @@
 #include <mach/syslib.h>
 #include <mach/gpmc.h>
 #include <linux/err.h>
+#include <mach/bbu.h>
 
 #include "beaglebone.h"
 
@@ -92,6 +93,9 @@ static int beaglebone_devices_init(void)
 
 	armlinux_set_architecture(MACH_TYPE_BEAGLEBONE);
 
+	/* Register update handler */
+	am33xx_bbu_emmc_mlo_register_handler("MLO.emmc", "/dev/mmc1");
+
 	if (IS_ENABLED(CONFIG_SHELL_NONE))
 		return am33xx_of_register_bootdevice();
 
Signature · 7 lines
1.9.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw
In reply to Daniel Schultz
Quoted 10 lines · Daniel Schultz

With this patch the barebox_update command will be extended by the possibility to flash the MLO to eMMC devices.

The MLO will be flashed to the following addresses:
0x20000
0x40000
0x60000

The MBR at addr. 0x0 won't be overwritten.
Therefore it's necessary to remove the MLO in the boot partition.

Couldn't you instead write the MLO to 0x0 but keep the partition table? It seems the first 512 bytes from the MLO are unused execpt for the CHSETTINGS header which does not conflict with the partition table.

Sascha

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox