mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v3 00/13] sandbox OF integration
@ 2015-03-03 12:14 Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 01/13] sandbox: add support to pass dtb to barebox Marc Kleine-Budde
                   ` (13 more replies)
  0 siblings, 14 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

Hello Sascha,

these are the remaining patches that bring OF support to the sandbox so that
enables testing of framworks which need the device tree.

changes since v2:
- build sandbox with oftree support always, select CONFIG_OFTREE
- the hostfile nodes in the device tree are now generated on the fly,
  no need for stubs.
- hostfile: switch to oftree only, remove platform data
- hostfile: add possibility to specify name of device via:
  --image <DEV>=<FILE>


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

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

* [PATCH v3 01/13] sandbox: add support to pass dtb to barebox
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-03 20:43   ` Sascha Hauer
  2015-03-03 12:14 ` [PATCH v3 02/13] sandbox: add sample dts Marc Kleine-Budde
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/Kconfig                           |  1 +
 arch/sandbox/board/Makefile                    |  1 +
 arch/sandbox/board/dtb.c                       | 57 ++++++++++++++++++++++++++
 arch/sandbox/mach-sandbox/include/mach/linux.h |  2 +
 arch/sandbox/os/common.c                       | 47 ++++++++++++++++++++-
 5 files changed, 107 insertions(+), 1 deletion(-)
 create mode 100644 arch/sandbox/board/dtb.c

diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
index 707fca3dc391..c21e517adf9b 100644
--- a/arch/sandbox/Kconfig
+++ b/arch/sandbox/Kconfig
@@ -1,5 +1,6 @@
 config SANDBOX
 	bool
+	select CONFIG_OFTREE
 	default y
 
 config ARCH_TEXT_BASE
diff --git a/arch/sandbox/board/Makefile b/arch/sandbox/board/Makefile
index 5104f5cb2679..460116332df9 100644
--- a/arch/sandbox/board/Makefile
+++ b/arch/sandbox/board/Makefile
@@ -3,5 +3,6 @@ obj-y += clock.o
 obj-y += hostfile.o
 obj-y += console.o
 obj-y += devices.o
+obj-y += dtb.o
 
 extra-y += barebox.lds
diff --git a/arch/sandbox/board/dtb.c b/arch/sandbox/board/dtb.c
new file mode 100644
index 000000000000..9d4210164e01
--- /dev/null
+++ b/arch/sandbox/board/dtb.c
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2013 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
+ * Copyright (c) 2015 Marc Kleine-Budde <mkl@pengutronix.de>, Pengutronix
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 <init.h>
+#include <of.h>
+
+#include <mach/linux.h>
+#include <linux/err.h>
+
+static const void *dtb;
+
+int barebox_register_dtb(const void *new_dtb)
+{
+	if (dtb)
+		return -EBUSY;
+
+	dtb = new_dtb;
+
+	return 0;
+}
+
+static int of_sandbox_init(void)
+{
+	struct device_node *root;
+
+	if (!dtb)
+		return 0;
+
+	root = of_unflatten_dtb(dtb);
+	if (IS_ERR(root)) {
+		return PTR_ERR(root);
+	}
+
+	of_set_root_node(root);
+	of_fix_tree(root);
+	if (IS_ENABLED(CONFIG_OFDEVICE))
+		of_probe();
+
+	return 0;
+}
+core_initcall(of_sandbox_init);
diff --git a/arch/sandbox/mach-sandbox/include/mach/linux.h b/arch/sandbox/mach-sandbox/include/mach/linux.h
index 98f9067046c3..990173e10b04 100644
--- a/arch/sandbox/mach-sandbox/include/mach/linux.h
+++ b/arch/sandbox/mach-sandbox/include/mach/linux.h
@@ -20,6 +20,8 @@ int linux_execve(const char * filename, char *const argv[], char *const envp[]);
 
 int barebox_register_console(char *name_template, int stdinfd, int stdoutfd);
 
+int barebox_register_dtb(const void *dtb);
+
 struct linux_console_data {
 	int stdinfd;
 	int stdoutfd;
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index 65dc4a1ab75c..cfb261acf2b5 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -265,6 +265,42 @@ err_out:
 	return -1;
 }
 
+static int add_dtb(const char *file)
+{
+	struct stat s;
+	void *dtb = NULL;
+	int fd;
+
+	fd = open(file, O_RDONLY);
+	if (fd < 0) {
+		perror("open");
+		goto err_out;
+	}
+
+	if (fstat(fd, &s)) {
+		perror("fstat");
+		goto err_out;
+	}
+
+	dtb = mmap(NULL, s.st_size, PROT_READ, MAP_SHARED, fd, 0);
+	if (dtb == MAP_FAILED) {
+		perror("mmap");
+		goto err_out;
+	}
+
+	if (barebox_register_dtb(dtb))
+		goto err_out;
+
+	return 0;
+
+ err_out:
+	if (dtb)
+		munmap(dtb, s.st_size);
+	if (fd > 0)
+		close(fd);
+	return -1;
+}
+
 static void print_usage(const char*);
 
 static struct option long_options[] = {
@@ -272,6 +308,7 @@ static struct option long_options[] = {
 	{"malloc", 1, 0, 'm'},
 	{"image",  1, 0, 'i'},
 	{"env",    1, 0, 'e'},
+	{"dtb",    1, 0, 'd'},
 	{"stdout", 1, 0, 'O'},
 	{"stdin",  1, 0, 'I'},
 	{"xres",  1, 0, 'x'},
@@ -279,7 +316,7 @@ static struct option long_options[] = {
 	{0, 0, 0, 0},
 };
 
-static const char optstring[] = "hm:i:e:O:I:x:y:";
+static const char optstring[] = "hm:i:e:d:O:I:x:y:";
 
 int main(int argc, char *argv[])
 {
@@ -308,6 +345,13 @@ int main(int argc, char *argv[])
 			break;
 		case 'e':
 			break;
+		case 'd':
+			ret = add_dtb(optarg);
+			if (ret) {
+				printf("Failed to load dtb: '%s'\n", optarg);
+				exit(1);
+			}
+			break;
 		case 'O':
 			fd = open(optarg, O_WRONLY);
 			if (fd < 0) {
@@ -408,6 +452,7 @@ static void print_usage(const char *prgname)
 "                       and thus are used as the default environment.\n"
 "                       An empty file generated with dd will do to get started\n"
 "                       with an empty environment.\n"
+"  -d, --dtb=<file>     Map a device tree binary blob (dtb) into barebox.\n"
 "  -O, --stdout=<file>  Register a file as a console capable of doing stdout.\n"
 "                       <file> can be a regular file or a FIFO.\n"
 "  -I, --stdin=<file>   Register a file as a console capable of doing stdin.\n"
-- 
2.1.4


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

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

* [PATCH v3 02/13] sandbox: add sample dts
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 01/13] sandbox: add support to pass dtb to barebox Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 03/13] sandbox: activate OF support in defconfig Marc Kleine-Budde
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/Makefile          |  2 ++
 arch/sandbox/dts/.gitignore    |  1 +
 arch/sandbox/dts/Makefile      | 11 +++++++++++
 arch/sandbox/dts/sandbox.dts   |  7 +++++++
 arch/sandbox/dts/skeleton.dtsi | 13 +++++++++++++
 5 files changed, 34 insertions(+)
 create mode 100644 arch/sandbox/dts/.gitignore
 create mode 100644 arch/sandbox/dts/Makefile
 create mode 100644 arch/sandbox/dts/sandbox.dts
 create mode 100644 arch/sandbox/dts/skeleton.dtsi

diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index e3fb03955407..a539a901fc8d 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -50,4 +50,6 @@ cmd_barebox__ = $(CC) -o $@ -Wl,-T,$(barebox-lds) \
 
 common-y += $(BOARD) arch/sandbox/os/
 
+common-$(CONFIG_OFTREE) += arch/sandbox/dts/
+
 CLEAN_FILES += $(BOARD)/barebox.lds
diff --git a/arch/sandbox/dts/.gitignore b/arch/sandbox/dts/.gitignore
new file mode 100644
index 000000000000..077903c50a26
--- /dev/null
+++ b/arch/sandbox/dts/.gitignore
@@ -0,0 +1 @@
+*dtb*
diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile
new file mode 100644
index 000000000000..6f6838857849
--- /dev/null
+++ b/arch/sandbox/dts/Makefile
@@ -0,0 +1,11 @@
+ifeq ($(CONFIG_OFTREE),y)
+dtb-y += \
+	sandbox.dtb
+endif
+
+# just to build a built-in.o. Otherwise compilation fails when no devicetree is
+# created.
+obj- += dummy.o
+
+always := $(dtb-y)
+clean-files := *.dtb *.dtb.S .*.dtc .*.pre .*.dts
diff --git a/arch/sandbox/dts/sandbox.dts b/arch/sandbox/dts/sandbox.dts
new file mode 100644
index 000000000000..2595aa13fa62
--- /dev/null
+++ b/arch/sandbox/dts/sandbox.dts
@@ -0,0 +1,7 @@
+/dts-v1/;
+
+#include "skeleton.dtsi"
+
+/ {
+
+};
diff --git a/arch/sandbox/dts/skeleton.dtsi b/arch/sandbox/dts/skeleton.dtsi
new file mode 100644
index 000000000000..38ead821bb42
--- /dev/null
+++ b/arch/sandbox/dts/skeleton.dtsi
@@ -0,0 +1,13 @@
+/*
+ * Skeleton device tree; the bare minimum needed to boot; just include and
+ * add a compatible value.  The bootloader will typically populate the memory
+ * node.
+ */
+
+/ {
+	#address-cells = <2>;
+	#size-cells = <1>;
+	chosen { };
+	aliases { };
+	memory { device_type = "memory"; reg = <0 0 0>; };
+};
-- 
2.1.4


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

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

* [PATCH v3 03/13] sandbox: activate OF support in defconfig
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 01/13] sandbox: add support to pass dtb to barebox Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 02/13] sandbox: add sample dts Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 04/13] sandbox: hostfile: clarify variable names Marc Kleine-Budde
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/configs/sandbox_defconfig | 35 ++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/arch/sandbox/configs/sandbox_defconfig b/arch/sandbox/configs/sandbox_defconfig
index 7ce256950192..ec045f7c0b51 100644
--- a/arch/sandbox/configs/sandbox_defconfig
+++ b/arch/sandbox/configs/sandbox_defconfig
@@ -5,25 +5,36 @@ CONFIG_PARTITION=y
 CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
 CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/sandbox/board/env"
 CONFIG_DEBUG_INFO=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_PRINTENV=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TFTP=y
+CONFIG_LONGHELP=y
 CONFIG_CMD_MEMINFO=y
-CONFIG_CMD_CRC=y
-CONFIG_CMD_FLASH=y
 # CONFIG_CMD_BOOTM is not set
-CONFIG_CMD_RESET=y
 CONFIG_CMD_GO=y
-CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_RESET=y
 CONFIG_CMD_PARTITION=y
-CONFIG_NET=y
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_PRINTENV=y
+CONFIG_CMD_MAGICVAR=y
+CONFIG_CMD_MAGICVAR_HELP=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_SLEEP=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
+CONFIG_CMD_TFTP=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_READLINE=y
+CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_CRC=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_2048=y
+CONFIG_CMD_OF_NODE=y
+CONFIG_CMD_OF_PROPERTY=y
+CONFIG_CMD_OF_DISPLAY_TIMINGS=y
+CONFIG_CMD_OFTREE=y
+CONFIG_NET=y
+CONFIG_OFDEVICE=y
+CONFIG_OF_BAREBOX_DRIVERS=y
 CONFIG_DRIVER_NET_TAP=y
 # CONFIG_SPI is not set
+# CONFIG_PINCTRL is not set
 CONFIG_FS_CRAMFS=y
 CONFIG_FS_TFTP=y
-- 
2.1.4


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

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

* [PATCH v3 04/13] sandbox: hostfile: clarify variable names
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
                   ` (2 preceding siblings ...)
  2015-03-03 12:14 ` [PATCH v3 03/13] sandbox: activate OF support in defconfig Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 05/13] sandbox: hostfile: probe(): add missing pointer from cdev.dev to dev Marc Kleine-Budde
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

Use "filename" for the name of the file in the host system, while "devname" for
the device in the sandbox.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/board/hostfile.c                     |  2 +-
 arch/sandbox/mach-sandbox/include/mach/hostfile.h |  2 +-
 arch/sandbox/os/common.c                          | 16 ++++++++--------
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index ac29cfa47a7d..5324da6f4802 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -73,7 +73,7 @@ static int hf_probe(struct device_d *dev)
 
 	priv->pdata = hf;
 
-	priv->cdev.name = hf->name;
+	priv->cdev.name = hf->devname;
 	priv->cdev.size = hf->size;
 	priv->cdev.ops = &hf_fops;
 	priv->cdev.priv = hf;
diff --git a/arch/sandbox/mach-sandbox/include/mach/hostfile.h b/arch/sandbox/mach-sandbox/include/mach/hostfile.h
index 7c4e67cf6847..747063182cf3 100644
--- a/arch/sandbox/mach-sandbox/include/mach/hostfile.h
+++ b/arch/sandbox/mach-sandbox/include/mach/hostfile.h
@@ -6,7 +6,7 @@ struct hf_platform_data {
 	size_t size;
 	unsigned long base;
 	char *filename;
-	char *name;
+	char *devname;
 };
 
 int barebox_register_filedev(struct hf_platform_data *hf);
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index cfb261acf2b5..e2023165d542 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -206,9 +206,9 @@ int linux_execve(const char * filename, char *const argv[], char *const envp[])
 extern void start_barebox(void);
 extern void mem_malloc_init(void *start, void *end);
 
-static int add_image(char *str, char *name)
+static int add_image(char *str, char *devname)
 {
-	char *file;
+	char *filename;
 	int readonly = 0, map = 1;
 	struct stat s;
 	char *opt;
@@ -218,7 +218,7 @@ static int add_image(char *str, char *name)
 	if (!hf)
 		return -1;
 
-	file = strtok(str, ",");
+	filename = strtok(str, ",");
 	while ((opt = strtok(NULL, ","))) {
 		if (!strcmp(opt, "ro"))
 			readonly = 1;
@@ -226,11 +226,11 @@ static int add_image(char *str, char *name)
 			map = 1;
 	}
 
-	printf("add file %s(%s)\n", file, readonly ? "ro" : "");
+	printf("add file %s(%s)\n", filename, readonly ? "ro" : "");
 
-	fd = open(file, readonly ? O_RDONLY : O_RDWR);
+	fd = open(filename, readonly ? O_RDONLY : O_RDWR);
 	hf->fd = fd;
-	hf->filename = file;
+	hf->filename = filename;
 
 	if (fd < 0) {
 		perror("open");
@@ -243,14 +243,14 @@ static int add_image(char *str, char *name)
 	}
 
 	hf->size = s.st_size;
-	hf->name = strdup(name);
+	hf->devname = strdup(devname);
 
 	if (map) {
 		hf->base = (unsigned long)mmap(NULL, hf->size,
 				PROT_READ | (readonly ? 0 : PROT_WRITE),
 				MAP_SHARED, fd, 0);
 		if ((void *)hf->base == MAP_FAILED)
-			printf("warning: mmapping %s failed\n", file);
+			printf("warning: mmapping %s failed\n", filename);
 	}
 
 	ret = barebox_register_filedev(hf);
-- 
2.1.4


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

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

* [PATCH v3 05/13] sandbox: hostfile: probe(): add missing pointer from cdev.dev to dev
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
                   ` (3 preceding siblings ...)
  2015-03-03 12:14 ` [PATCH v3 04/13] sandbox: hostfile: clarify variable names Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 06/13] sandbox: hostfile: remove struct hf_platform_data from hf_priv Marc Kleine-Budde
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

Without this pointer the cdev will not be associated with the dev,
of_find_path() relies on this.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/board/hostfile.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index 5324da6f4802..6ec3b87efa86 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -75,6 +75,7 @@ static int hf_probe(struct device_d *dev)
 
 	priv->cdev.name = hf->devname;
 	priv->cdev.size = hf->size;
+	priv->cdev.dev = dev;
 	priv->cdev.ops = &hf_fops;
 	priv->cdev.priv = hf;
 
-- 
2.1.4


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

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

* [PATCH v3 06/13] sandbox: hostfile: remove struct hf_platform_data from hf_priv
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
                   ` (4 preceding siblings ...)
  2015-03-03 12:14 ` [PATCH v3 05/13] sandbox: hostfile: probe(): add missing pointer from cdev.dev to dev Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 07/13] sandbox: hostfile: move fd from platform data to priv Marc Kleine-Budde
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/board/hostfile.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index 6ec3b87efa86..fef9f5cffa89 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -28,7 +28,6 @@
 
 struct hf_priv {
 	struct cdev cdev;
-	struct hf_platform_data *pdata;
 };
 
 static ssize_t hf_read(struct cdev *cdev, void *buf, size_t count, loff_t offset, ulong flags)
@@ -71,8 +70,6 @@ static int hf_probe(struct device_d *dev)
 	struct hf_platform_data *hf = dev->platform_data;
 	struct hf_priv *priv = xzalloc(sizeof(*priv));
 
-	priv->pdata = hf;
-
 	priv->cdev.name = hf->devname;
 	priv->cdev.size = hf->size;
 	priv->cdev.dev = dev;
-- 
2.1.4


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

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

* [PATCH v3 07/13] sandbox: hostfile: move fd from platform data to priv
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
                   ` (5 preceding siblings ...)
  2015-03-03 12:14 ` [PATCH v3 06/13] sandbox: hostfile: remove struct hf_platform_data from hf_priv Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 08/13] sandbox: hostfile: probe driver earlier Marc Kleine-Budde
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/board/hostfile.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index fef9f5cffa89..103bcd9badc7 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -28,12 +28,13 @@
 
 struct hf_priv {
 	struct cdev cdev;
+	int fd;
 };
 
 static ssize_t hf_read(struct cdev *cdev, void *buf, size_t count, loff_t offset, ulong flags)
 {
-	struct hf_platform_data *hf = cdev->priv;
-	int fd = hf->fd;
+	struct hf_priv *priv= cdev->priv;
+	int fd = priv->fd;
 
 	if (linux_lseek(fd, offset) != offset)
 		return -EINVAL;
@@ -43,8 +44,8 @@ static ssize_t hf_read(struct cdev *cdev, void *buf, size_t count, loff_t offset
 
 static ssize_t hf_write(struct cdev *cdev, const void *buf, size_t count, loff_t offset, ulong flags)
 {
-	struct hf_platform_data *hf = cdev->priv;
-	int fd = hf->fd;
+	struct hf_priv *priv = cdev->priv;
+	int fd = priv->fd;
 
 	if (linux_lseek(fd, offset) != offset)
 		return -EINVAL;
@@ -70,11 +71,12 @@ static int hf_probe(struct device_d *dev)
 	struct hf_platform_data *hf = dev->platform_data;
 	struct hf_priv *priv = xzalloc(sizeof(*priv));
 
+	priv->fd = hf->fd;
 	priv->cdev.name = hf->devname;
 	priv->cdev.size = hf->size;
 	priv->cdev.dev = dev;
 	priv->cdev.ops = &hf_fops;
-	priv->cdev.priv = hf;
+	priv->cdev.priv = priv;
 
 	dev->info = hf_info;
 
-- 
2.1.4


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

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

* [PATCH v3 08/13] sandbox: hostfile: probe driver earlier
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
                   ` (6 preceding siblings ...)
  2015-03-03 12:14 ` [PATCH v3 07/13] sandbox: hostfile: move fd from platform data to priv Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 09/13] sandbox: hostfile: use the memory resource to determine the size not the platform_data Marc Kleine-Budde
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

This patch convert from device_platform_driver to coredevice_platform_driver,
so that the driver is initialzied before the state framework is probed.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/board/hostfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index 103bcd9badc7..42ade6bec8a4 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -91,7 +91,7 @@ static struct driver_d hf_drv = {
 	.name  = "hostfile",
 	.probe = hf_probe,
 };
-device_platform_driver(hf_drv);
+coredevice_platform_driver(hf_drv);
 
 int barebox_register_filedev(struct hf_platform_data *hf)
 {
-- 
2.1.4


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

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

* [PATCH v3 09/13] sandbox: hostfile: use the memory resource to determine the size not the platform_data
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
                   ` (7 preceding siblings ...)
  2015-03-03 12:14 ` [PATCH v3 08/13] sandbox: hostfile: probe driver earlier Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 10/13] sandbox: hostfile: is always mmpad'ed Marc Kleine-Budde
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/board/hostfile.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index 42ade6bec8a4..3e6435983b56 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -23,6 +23,7 @@
 #include <mach/linux.h>
 #include <init.h>
 #include <errno.h>
+#include <linux/err.h>
 #include <mach/hostfile.h>
 #include <xfuncs.h>
 
@@ -70,10 +71,15 @@ static int hf_probe(struct device_d *dev)
 {
 	struct hf_platform_data *hf = dev->platform_data;
 	struct hf_priv *priv = xzalloc(sizeof(*priv));
+	struct resource *res;
+
+	res = dev_get_resource(dev, IORESOURCE_MEM, 0);
+	if (IS_ERR(res))
+		return PTR_ERR(res);
 
 	priv->fd = hf->fd;
 	priv->cdev.name = hf->devname;
-	priv->cdev.size = hf->size;
+	priv->cdev.size = resource_size(res);
 	priv->cdev.dev = dev;
 	priv->cdev.ops = &hf_fops;
 	priv->cdev.priv = priv;
-- 
2.1.4


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

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

* [PATCH v3 10/13] sandbox: hostfile: is always mmpad'ed
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
                   ` (8 preceding siblings ...)
  2015-03-03 12:14 ` [PATCH v3 09/13] sandbox: hostfile: use the memory resource to determine the size not the platform_data Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 11/13] sandbox: move device name generation for image/env into add_image() Marc Kleine-Budde
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

...so remove conditional code.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/os/common.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index e2023165d542..3fa0370dfba3 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -209,7 +209,7 @@ extern void mem_malloc_init(void *start, void *end);
 static int add_image(char *str, char *devname)
 {
 	char *filename;
-	int readonly = 0, map = 1;
+	int readonly = 0;
 	struct stat s;
 	char *opt;
 	int fd, ret;
@@ -222,8 +222,6 @@ static int add_image(char *str, char *devname)
 	while ((opt = strtok(NULL, ","))) {
 		if (!strcmp(opt, "ro"))
 			readonly = 1;
-		if (!strcmp(opt, "map"))
-			map = 1;
 	}
 
 	printf("add file %s(%s)\n", filename, readonly ? "ro" : "");
@@ -245,13 +243,11 @@ static int add_image(char *str, char *devname)
 	hf->size = s.st_size;
 	hf->devname = strdup(devname);
 
-	if (map) {
-		hf->base = (unsigned long)mmap(NULL, hf->size,
-				PROT_READ | (readonly ? 0 : PROT_WRITE),
-				MAP_SHARED, fd, 0);
-		if ((void *)hf->base == MAP_FAILED)
-			printf("warning: mmapping %s failed\n", filename);
-	}
+	hf->base = (unsigned long)mmap(NULL, hf->size,
+			PROT_READ | (readonly ? 0 : PROT_WRITE),
+			MAP_SHARED, fd, 0);
+	if ((void *)hf->base == MAP_FAILED)
+		printf("warning: mmapping %s failed\n", filename);
 
 	ret = barebox_register_filedev(hf);
 	if (ret)
-- 
2.1.4


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

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

* [PATCH v3 11/13] sandbox: move device name generation for image/env into add_image()
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
                   ` (9 preceding siblings ...)
  2015-03-03 12:14 ` [PATCH v3 10/13] sandbox: hostfile: is always mmpad'ed Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 12/13] sandbox: hostfile: improve --image parameter to support "dev=file" Marc Kleine-Budde
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/os/common.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index 3fa0370dfba3..64a4b26ea6fd 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -206,9 +206,10 @@ int linux_execve(const char * filename, char *const argv[], char *const envp[])
 extern void start_barebox(void);
 extern void mem_malloc_init(void *start, void *end);
 
-static int add_image(char *str, char *devname)
+static int add_image(char *str, char *devname_template, int *devname_number)
 {
-	char *filename;
+	char *filename, *devname;
+	char tmp[16];
 	int readonly = 0;
 	struct stat s;
 	char *opt;
@@ -224,7 +225,12 @@ static int add_image(char *str, char *devname)
 			readonly = 1;
 	}
 
-	printf("add file %s(%s)\n", filename, readonly ? "ro" : "");
+	snprintf(tmp, sizeof(tmp),
+		 devname_template, (*devname_number)++);
+	devname = strdup(tmp);
+
+	printf("add %s backed by file %s%s\n", devname,
+	       filename, readonly ? "(ro)" : "");
 
 	fd = open(filename, readonly ? O_RDONLY : O_RDWR);
 	hf->fd = fd;
@@ -319,7 +325,6 @@ int main(int argc, char *argv[])
 	void *ram;
 	int opt, ret, fd;
 	int malloc_size = CONFIG_MALLOC_SIZE;
-	char str[6];
 	int fdno = 0, envno = 0, option_index = 0;
 
 	while (1) {
@@ -401,18 +406,14 @@ int main(int argc, char *argv[])
 
 		switch (opt) {
 		case 'i':
-			sprintf(str, "fd%d", fdno);
-			ret = add_image(optarg, str);
+			ret = add_image(optarg, "fd%d", &fdno);
 			if (ret)
 				exit(1);
-			fdno++;
 			break;
 		case 'e':
-			sprintf(str, "env%d", envno);
-			ret = add_image(optarg, str);
+			ret = add_image(optarg, "env%d", &envno);
 			if (ret)
 				exit(1);
-			envno++;
 			break;
 		default:
 			break;
-- 
2.1.4


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

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

* [PATCH v3 12/13] sandbox: hostfile: improve --image parameter to support "dev=file"
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
                   ` (10 preceding siblings ...)
  2015-03-03 12:14 ` [PATCH v3 11/13] sandbox: move device name generation for image/env into add_image() Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-03 12:14 ` [PATCH v3 13/13] sandbox: hostfile: completely switch to OF based probing Marc Kleine-Budde
  2015-03-04 10:35 ` [PATCH v3 00/13] sandbox OF integration Sascha Hauer
  13 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

This patch makes it possible to specify the device name of a file added to the
sandbox via the --image paramter, e.g.:

    barebox --image foo=bar.image

This means the file "bar.image" is added as "/dev/foo" to the sandbox.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/os/common.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index 64a4b26ea6fd..7aa0f5d3f2e0 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -225,9 +225,15 @@ static int add_image(char *str, char *devname_template, int *devname_number)
 			readonly = 1;
 	}
 
-	snprintf(tmp, sizeof(tmp),
-		 devname_template, (*devname_number)++);
-	devname = strdup(tmp);
+	/* parses: "devname=filename" */
+	devname = strtok(filename, "=");
+	filename = strtok(NULL, "=");
+	if (!filename) {
+		filename = devname;
+		snprintf(tmp, sizeof(tmp),
+			 devname_template, (*devname_number)++);
+		devname = strdup(tmp);
+	}
 
 	printf("add %s backed by file %s%s\n", devname,
 	       filename, readonly ? "(ro)" : "");
@@ -444,6 +450,9 @@ static void print_usage(const char *prgname)
 "  -i, --image=<file>   Map an image file to barebox. This option can be given\n"
 "                       multiple times. The files will show up as\n"
 "                       /dev/fd0 ... /dev/fdx under barebox.\n"
+"  -i, --image=<dev>=<file>\n"
+"                       Same as above, the files will show up as\n"
+"                       /dev/<dev>\n"
 "  -e, --env=<file>     Map a file with an environment to barebox. With this \n"
 "                       option, files are mapped as /dev/env0 ... /dev/envx\n"
 "                       and thus are used as the default environment.\n"
-- 
2.1.4


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

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

* [PATCH v3 13/13] sandbox: hostfile: completely switch to OF based probing
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
                   ` (11 preceding siblings ...)
  2015-03-03 12:14 ` [PATCH v3 12/13] sandbox: hostfile: improve --image parameter to support "dev=file" Marc Kleine-Budde
@ 2015-03-03 12:14 ` Marc Kleine-Budde
  2015-03-04 10:35 ` [PATCH v3 00/13] sandbox OF integration Sascha Hauer
  13 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 12:14 UTC (permalink / raw)
  To: barebox

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/sandbox/board/hostfile.c                     | 98 ++++++++++++++++-------
 arch/sandbox/mach-sandbox/include/mach/hostfile.h | 11 ++-
 arch/sandbox/os/common.c                          |  2 +-
 3 files changed, 77 insertions(+), 34 deletions(-)

diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index 3e6435983b56..c6fd80fd8761 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -27,8 +27,11 @@
 #include <mach/hostfile.h>
 #include <xfuncs.h>
 
+#include <linux/err.h>
+
 struct hf_priv {
 	struct cdev cdev;
+	const char *filename;
 	int fd;
 };
 
@@ -56,9 +59,9 @@ static ssize_t hf_write(struct cdev *cdev, const void *buf, size_t count, loff_t
 
 static void hf_info(struct device_d *dev)
 {
-	struct hf_platform_data *hf = dev->platform_data;
+	struct hf_priv *priv = dev->priv;
 
-	printf("file: %s\n", hf->filename);
+	printf("file: %s\n", priv->filename);
 }
 
 static struct file_operations hf_fops = {
@@ -69,53 +72,94 @@ static struct file_operations hf_fops = {
 
 static int hf_probe(struct device_d *dev)
 {
-	struct hf_platform_data *hf = dev->platform_data;
 	struct hf_priv *priv = xzalloc(sizeof(*priv));
 	struct resource *res;
+	int err;
 
 	res = dev_get_resource(dev, IORESOURCE_MEM, 0);
 	if (IS_ERR(res))
 		return PTR_ERR(res);
 
-	priv->fd = hf->fd;
-	priv->cdev.name = hf->devname;
 	priv->cdev.size = resource_size(res);
+
+	if (!dev->device_node)
+		return -ENODEV;
+
+	err = of_property_read_u32(dev->device_node, "fd", &priv->fd);
+	if (err)
+		return err;
+
+	err = of_property_read_string(dev->device_node, "filename", &priv->filename);
+	if (err)
+		return err;
+
+	priv->cdev.name = dev->device_node->name;
 	priv->cdev.dev = dev;
 	priv->cdev.ops = &hf_fops;
 	priv->cdev.priv = priv;
 
 	dev->info = hf_info;
+	dev->priv = priv;
 
-#ifdef CONFIG_FS_DEVFS
-	devfs_create(&priv->cdev);
-#endif
-
-	return 0;
+	return devfs_create(&priv->cdev);
 }
 
+static __maybe_unused struct of_device_id hostfile_dt_ids[] = {
+	{
+		.compatible = "barebox,hostfile",
+	}, {
+		/* sentinel */
+	}
+};
+
 static struct driver_d hf_drv = {
 	.name  = "hostfile",
+	.of_compatible = DRV_OF_COMPAT(hostfile_dt_ids),
 	.probe = hf_probe,
 };
 coredevice_platform_driver(hf_drv);
 
-int barebox_register_filedev(struct hf_platform_data *hf)
+static int of_hostfile_fixup(struct device_node *root, void *ctx)
 {
-	struct device_d *dev;
-	struct resource *res;
-
-	dev = xzalloc(sizeof(*dev));
-	strcpy(dev->name, "hostfile");
-	dev->id = DEVICE_ID_DYNAMIC;
-	dev->platform_data = hf;
-
-	res = xzalloc(sizeof(struct resource));
-	res[0].start = hf->base;
-	res[0].end = hf->base + hf->size - 1;
-	res[0].flags = IORESOURCE_MEM;
-
-	dev->resource = res;
-	dev->num_resources = 1;
+	struct hf_info *hf = ctx;
+	struct device_node *node;
+	uint32_t reg[] = {
+		hf->base >> 32,
+		hf->base,
+		hf->size
+	};
+	int ret;
+
+	node = of_new_node(root, hf->devname);
+
+	ret = of_property_write_u32(node, "fd", hf->fd);
+	if (ret)
+		return ret;
+
+	ret = of_property_write_u32_array(node, "reg", reg, ARRAY_SIZE(reg));
+	if (ret)
+		return ret;
+
+	ret = of_property_write_u32(node, "#address-cells", 2);
+	if (ret)
+		return ret;
+
+	ret = of_property_write_u32(node, "#size-cells", 1);
+	if (ret)
+		return ret;
+
+	ret = of_set_property(node, "compatible", hostfile_dt_ids->compatible,
+			      strlen(hostfile_dt_ids->compatible) + 1, 1);
+	if (ret)
+		return ret;
+
+	ret = of_set_property(node, "filename", hf->filename,
+			      strlen(hf->filename) + 1, 1);
+
+	return ret;
+}
 
-	return sandbox_add_device(dev);
+int barebox_register_filedev(struct hf_info *hf)
+{
+	return of_register_fixup(of_hostfile_fixup, hf);
 }
diff --git a/arch/sandbox/mach-sandbox/include/mach/hostfile.h b/arch/sandbox/mach-sandbox/include/mach/hostfile.h
index 747063182cf3..627fe28e765b 100644
--- a/arch/sandbox/mach-sandbox/include/mach/hostfile.h
+++ b/arch/sandbox/mach-sandbox/include/mach/hostfile.h
@@ -1,15 +1,14 @@
 #ifndef __ASM_ARCH_HOSTFILE_H
 #define __ASM_ARCH_HOSTFILE_H
 
-struct hf_platform_data {
+struct hf_info {
 	int fd;
-	size_t size;
 	unsigned long base;
-	char *filename;
-	char *devname;
+	size_t size;
+	const char *devname;
+	const char *filename;
 };
 
-int barebox_register_filedev(struct hf_platform_data *hf);
+int barebox_register_filedev(struct hf_info *hf);
 
 #endif /* __ASM_ARCH_HOSTFILE_H */
-
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index 7aa0f5d3f2e0..d6273918906b 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -208,13 +208,13 @@ extern void mem_malloc_init(void *start, void *end);
 
 static int add_image(char *str, char *devname_template, int *devname_number)
 {
+	struct hf_info *hf = malloc(sizeof(struct hf_info));
 	char *filename, *devname;
 	char tmp[16];
 	int readonly = 0;
 	struct stat s;
 	char *opt;
 	int fd, ret;
-	struct hf_platform_data *hf = malloc(sizeof(struct hf_platform_data));
 
 	if (!hf)
 		return -1;
-- 
2.1.4


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

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

* Re: [PATCH v3 01/13] sandbox: add support to pass dtb to barebox
  2015-03-03 12:14 ` [PATCH v3 01/13] sandbox: add support to pass dtb to barebox Marc Kleine-Budde
@ 2015-03-03 20:43   ` Sascha Hauer
  2015-03-03 21:41     ` Marc Kleine-Budde
  0 siblings, 1 reply; 17+ messages in thread
From: Sascha Hauer @ 2015-03-03 20:43 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: barebox

On Tue, Mar 03, 2015 at 01:14:47PM +0100, Marc Kleine-Budde wrote:
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
>  arch/sandbox/Kconfig                           |  1 +
>  arch/sandbox/board/Makefile                    |  1 +
>  arch/sandbox/board/dtb.c                       | 57 ++++++++++++++++++++++++++
>  arch/sandbox/mach-sandbox/include/mach/linux.h |  2 +
>  arch/sandbox/os/common.c                       | 47 ++++++++++++++++++++-
>  5 files changed, 107 insertions(+), 1 deletion(-)
>  create mode 100644 arch/sandbox/board/dtb.c
> 
> diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
> index 707fca3dc391..c21e517adf9b 100644
> --- a/arch/sandbox/Kconfig
> +++ b/arch/sandbox/Kconfig
> @@ -1,5 +1,6 @@
>  config SANDBOX
>  	bool
> +	select CONFIG_OFTREE

Must be OFTREE. Fixed.

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] 17+ messages in thread

* Re: [PATCH v3 01/13] sandbox: add support to pass dtb to barebox
  2015-03-03 20:43   ` Sascha Hauer
@ 2015-03-03 21:41     ` Marc Kleine-Budde
  0 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2015-03-03 21:41 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox


[-- Attachment #1.1: Type: text/plain, Size: 1201 bytes --]

On 03/03/2015 09:43 PM, Sascha Hauer wrote:
> On Tue, Mar 03, 2015 at 01:14:47PM +0100, Marc Kleine-Budde wrote:
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>> ---
>>  arch/sandbox/Kconfig                           |  1 +
>>  arch/sandbox/board/Makefile                    |  1 +
>>  arch/sandbox/board/dtb.c                       | 57 ++++++++++++++++++++++++++
>>  arch/sandbox/mach-sandbox/include/mach/linux.h |  2 +
>>  arch/sandbox/os/common.c                       | 47 ++++++++++++++++++++-
>>  5 files changed, 107 insertions(+), 1 deletion(-)
>>  create mode 100644 arch/sandbox/board/dtb.c
>>
>> diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
>> index 707fca3dc391..c21e517adf9b 100644
>> --- a/arch/sandbox/Kconfig
>> +++ b/arch/sandbox/Kconfig
>> @@ -1,5 +1,6 @@
>>  config SANDBOX
>>  	bool
>> +	select CONFIG_OFTREE
> 
> Must be OFTREE. Fixed.

Doh!

Tnx,
Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

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

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

* Re: [PATCH v3 00/13] sandbox OF integration
  2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
                   ` (12 preceding siblings ...)
  2015-03-03 12:14 ` [PATCH v3 13/13] sandbox: hostfile: completely switch to OF based probing Marc Kleine-Budde
@ 2015-03-04 10:35 ` Sascha Hauer
  13 siblings, 0 replies; 17+ messages in thread
From: Sascha Hauer @ 2015-03-04 10:35 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: barebox

On Tue, Mar 03, 2015 at 01:14:46PM +0100, Marc Kleine-Budde wrote:
> Hello Sascha,
> 
> these are the remaining patches that bring OF support to the sandbox so that
> enables testing of framworks which need the device tree.
> 
> changes since v2:
> - build sandbox with oftree support always, select CONFIG_OFTREE
> - the hostfile nodes in the device tree are now generated on the fly,
>   no need for stubs.
> - hostfile: switch to oftree only, remove platform data
> - hostfile: add possibility to specify name of device via:
>   --image <DEV>=<FILE>

Applied, thanks

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] 17+ messages in thread

end of thread, other threads:[~2015-03-04 10:35 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-03 12:14 [PATCH v3 00/13] sandbox OF integration Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 01/13] sandbox: add support to pass dtb to barebox Marc Kleine-Budde
2015-03-03 20:43   ` Sascha Hauer
2015-03-03 21:41     ` Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 02/13] sandbox: add sample dts Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 03/13] sandbox: activate OF support in defconfig Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 04/13] sandbox: hostfile: clarify variable names Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 05/13] sandbox: hostfile: probe(): add missing pointer from cdev.dev to dev Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 06/13] sandbox: hostfile: remove struct hf_platform_data from hf_priv Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 07/13] sandbox: hostfile: move fd from platform data to priv Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 08/13] sandbox: hostfile: probe driver earlier Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 09/13] sandbox: hostfile: use the memory resource to determine the size not the platform_data Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 10/13] sandbox: hostfile: is always mmpad'ed Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 11/13] sandbox: move device name generation for image/env into add_image() Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 12/13] sandbox: hostfile: improve --image parameter to support "dev=file" Marc Kleine-Budde
2015-03-03 12:14 ` [PATCH v3 13/13] sandbox: hostfile: completely switch to OF based probing Marc Kleine-Budde
2015-03-04 10:35 ` [PATCH v3 00/13] sandbox OF integration Sascha Hauer

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