Skip to contentSkip to conversation

bbu: include necessary headers

PATCH In review Lucas Stach 2 participants 7 messages Feb 27, 2015 – Mar 1, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 bbu: include necessary headers

Fixes compile errors due to undefined symbols.

---
 include/bbu.h | 2 ++
 1 file changed, 2 insertions(+)
include/bbu.h +2 -0
index adb52b0..4a3d35e 100644
@@ -2,6 +2,8 @@
 #define __INCLUDE_BBU_H
 
 #include <asm-generic/errno.h>
+#include <linux/list.h>
+#include <linux/types.h>
 
 struct bbu_data {
 #define BBU_FLAG_FORCE	(1 << 0)
Signature · 7 lines
2.1.0


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

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

It is a lot more user friendly if we give a bit more feedback.

---
 common/bbu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
common/bbu.c +3 -1
index e31f645..7fb154a 100644
@@ -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;
 }
Signature · 7 lines
2.1.0


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

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

In reply to 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
arch/arm/mach-tegra/Makefile +1 -0
index e68156a..7c4c1fd 100644
@@ -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
arch/arm/mach-tegra/include/mach/tegra-bbu.h new file +28 -0
new file mode 100644
index 0000000..32e2861
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2015 Lucas Stach <[email protected]>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include <bbu.h>
+
+#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
arch/arm/mach-tegra/tegra-bbu.c new file +74 -0

74 lines not on this page · raw message

Signature · 7 lines
2.1.0


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

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

In reply to Lucas Stach
---
 arch/arm/boards/nvidia-beaver/board.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boards/nvidia-beaver/board.c +4 -0
index d270301..b4d856e 100644
@@ -19,6 +19,7 @@
 #include <gpio.h>
 #include <i2c/i2c.h>
 #include <init.h>
+#include <mach/tegra-bbu.h>
 
 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);
Signature · 7 lines
2.1.0


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

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

Quoted 18 lines · Lucas Stach
---
 arch/arm/boards/nvidia-beaver/board.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boards/nvidia-beaver/board.c +1 -0
index d270301..b4d856e 100644
@@ -19,6 +19,7 @@
 #include <gpio.h>
 #include <i2c/i2c.h>
 #include <init.h>
+#include <mach/tegra-bbu.h>
 
 static int nvidia_beaver_fs_init(void)
 {

arch/arm/boards/nvidia-beaver/board.c static int nvidia_beaver_device_init(void) · line 58

Quoted 5 lines
arch/arm/boards/nvidia-beaver/board.c +2 -0
@@ -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);

'disk0' is not a persistent name and will change when your SD slots are probed in a different order. You should add aliases to the device nodes and use of_alias_get() to obtain them, see for example imx-esdhc.c

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
#5 lore raw

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

Am Sonntag, den 01.03.2015, 08:23 +0100 schrieb Sascha Hauer:

Quoted 20 lines · Lucas Stach
Quoted 19 lines
---
 arch/arm/boards/nvidia-beaver/board.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boards/nvidia-beaver/board.c +1 -0
index d270301..b4d856e 100644
@@ -19,6 +19,7 @@
 #include <gpio.h>
 #include <i2c/i2c.h>
 #include <init.h>
+#include <mach/tegra-bbu.h>
 
 static int nvidia_beaver_fs_init(void)
 {
@@ -53,6 +54,9 @@ static int nvidia_beaver_device_init(void)
 
Quoted 9 lines

arch/arm/boards/nvidia-beaver/board.c static int nvidia_beaver_device_init(void) · line 58

Quoted 4 lines
arch/arm/boards/nvidia-beaver/board.c +2 -0
 	barebox_set_hostname("beaver");
 
+	tegra_bbu_register_emmc_handler("eMMC", "/dev/disk0.boot0",
+					BBU_HANDLER_FLAG_DEFAULT);

'disk0' is not a persistent name and will change when your SD slots are probed in a different order. You should add aliases to the device nodes and use of_alias_get() to obtain them, see for example imx-esdhc.c

It's not a problem for these patches, as both boards have their environment on disk0.boot1, so the eMMC will always be the first SDMMC device to be detected and consequently always get number 0 assigned.

But in general I agree with you and will add the alias handling in a follow on series.

Regards,
Lucas

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

#6 lore raw

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

In reply to Lucas Stach
---
 arch/arm/boards/nvidia-jetson-tk1/board.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boards/nvidia-jetson-tk1/board.c +4 -0
index 564e6a0..8d8dddf 100644
@@ -19,6 +19,7 @@
 #include <gpio.h>
 #include <i2c/i2c.h>
 #include <init.h>
+#include <mach/tegra-bbu.h>
 
 #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);
Signature · 7 lines
2.1.0


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