* [PATCH 1/6] fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc
@ 2015-05-06 12:51 Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 2/6] state: documentation: add anchor so that state can be referenced later Marc Kleine-Budde
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2015-05-06 12:51 UTC (permalink / raw)
To: barebox
In commit
d384b5639fc1 of: Drop devicetree merge support
the signature of of_unflatten_dtb() was changed, but the inline documentation
was forgotten to adjust. This patch removes the left over "root" argument from
the doc.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/of/fdt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index dfa95c38c801..88f0523260ed 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -48,7 +48,6 @@ static inline char *dt_string(struct fdt_header *f, char *strstart, uint32_t ofs
/**
* of_unflatten_dtb - unflatten a dtb binary blob
- * @root - node in which the fdt blob should be merged into or NULL
* @infdt - the fdt blob to unflatten
*
* Parse a flat device tree binary blob and return a pointer to the
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/6] state: documentation: add anchor so that state can be referenced later
2015-05-06 12:51 [PATCH 1/6] fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc Marc Kleine-Budde
@ 2015-05-06 12:51 ` Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 3/6] state: state_uint32_create: use %u to print unsigned variable Marc Kleine-Budde
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2015-05-06 12:51 UTC (permalink / raw)
To: barebox
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Documentation/devicetree/bindings/barebox/barebox,state.rst | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/barebox/barebox,state.rst b/Documentation/devicetree/bindings/barebox/barebox,state.rst
index 42b2a34d3ab0..7156084c9364 100644
--- a/Documentation/devicetree/bindings/barebox/barebox,state.rst
+++ b/Documentation/devicetree/bindings/barebox/barebox,state.rst
@@ -1,4 +1,6 @@
-barebox,state
+.. _barebox,state:
+
+barebox state
=============
Overview
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/6] state: state_uint32_create: use %u to print unsigned variable
2015-05-06 12:51 [PATCH 1/6] fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 2/6] state: documentation: add anchor so that state can be referenced later Marc Kleine-Budde
@ 2015-05-06 12:51 ` Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 4/6] state: state_new_from_fdt(): remove unused function Marc Kleine-Budde
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2015-05-06 12:51 UTC (permalink / raw)
To: barebox
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
common/state.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/state.c b/common/state.c
index b677a9f01d25..7f12341bd578 100644
--- a/common/state.c
+++ b/common/state.c
@@ -162,7 +162,7 @@ static struct state_variable *state_uint32_create(struct state *state,
su32 = xzalloc(sizeof(*su32));
param = dev_add_param_int(&state->dev, name, state_set_dirty,
- NULL, &su32->value, "%d", state);
+ NULL, &su32->value, "%u", state);
if (IS_ERR(param)) {
free(su32);
return ERR_CAST(param);
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/6] state: state_new_from_fdt(): remove unused function
2015-05-06 12:51 [PATCH 1/6] fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 2/6] state: documentation: add anchor so that state can be referenced later Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 3/6] state: state_uint32_create: use %u to print unsigned variable Marc Kleine-Budde
@ 2015-05-06 12:51 ` Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 5/6] watchdog: add static inline no-ops if WD is disabled Marc Kleine-Budde
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2015-05-06 12:51 UTC (permalink / raw)
To: barebox
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
common/state.c | 21 ---------------------
include/state.h | 1 -
2 files changed, 22 deletions(-)
diff --git a/common/state.c b/common/state.c
index 7f12341bd578..cc44cecb484f 100644
--- a/common/state.c
+++ b/common/state.c
@@ -678,27 +678,6 @@ struct state *state_new_from_node(const char *name, struct device_node *node)
return ERR_PTR(ret);
}
- return state;
-}
-
-/*
- * state_new_from_fdt - create a new state instance from a fdt binary blob
- *
- * @name The name of the new state instance
- * @fdt The fdt binary blob describing the new state instance
- */
-struct state *state_new_from_fdt(const char *name, void *fdt)
-{
- struct state *state;
- struct device_node *root;
-
- root = of_unflatten_dtb(fdt);
- if (!root)
- return ERR_PTR(-EINVAL);
-
- state = state_new_from_node(name, root);
-
- of_delete_node(root);
return state;
}
diff --git a/include/state.h b/include/state.h
index e96d3bfb2e4f..d321451e1490 100644
--- a/include/state.h
+++ b/include/state.h
@@ -9,7 +9,6 @@ int state_backend_dtb_file(struct state *state, const char *path);
int state_backend_raw_file(struct state *state, const char *path,
off_t offset, size_t size);
-struct state *state_new_from_fdt(const char *name, void *fdt);
struct state *state_new_from_node(const char *name, struct device_node *node);
struct state *state_by_name(const char *name);
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 5/6] watchdog: add static inline no-ops if WD is disabled
2015-05-06 12:51 [PATCH 1/6] fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc Marc Kleine-Budde
` (2 preceding siblings ...)
2015-05-06 12:51 ` [PATCH 4/6] state: state_new_from_fdt(): remove unused function Marc Kleine-Budde
@ 2015-05-06 12:51 ` Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 6/6] startup: introduce postenvironment_initcall Marc Kleine-Budde
2015-05-07 7:15 ` [PATCH 1/6] fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2015-05-06 12:51 UTC (permalink / raw)
To: barebox
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
include/watchdog.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/include/watchdog.h b/include/watchdog.h
index 3e2d08e87645..7e37b7c22a8d 100644
--- a/include/watchdog.h
+++ b/include/watchdog.h
@@ -17,8 +17,25 @@ struct watchdog {
int (*set_timeout)(struct watchdog *, unsigned);
};
+#ifdef CONFIG_WATCHDOG
int watchdog_register(struct watchdog *);
int watchdog_deregister(struct watchdog *);
int watchdog_set_timeout(unsigned);
+#else
+static inline int watchdog_register(struct watchdog *w)
+{
+ return 0;
+}
+
+int watchdog_deregister(struct watchdog *w)
+{
+ return 0;
+}
+
+int watchdog_set_timeout(unsigned t)
+{
+ return 0;
+}
+#endif
#endif /* INCLUDE_WATCHDOG_H */
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 6/6] startup: introduce postenvironment_initcall
2015-05-06 12:51 [PATCH 1/6] fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc Marc Kleine-Budde
` (3 preceding siblings ...)
2015-05-06 12:51 ` [PATCH 5/6] watchdog: add static inline no-ops if WD is disabled Marc Kleine-Budde
@ 2015-05-06 12:51 ` Marc Kleine-Budde
2015-05-07 7:15 ` [PATCH 1/6] fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2015-05-06 12:51 UTC (permalink / raw)
To: barebox
From: Sascha Hauer <s.hauer@pengutronix.de>
To allow init code that depends on the environment being loaded.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
common/startup.c | 28 ++++++++++++++++++----------
include/asm-generic/barebox.lds.h | 4 +++-
include/init.h | 2 ++
3 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/common/startup.c b/common/startup.c
index e59b06d533e6..6178fc53531b 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -62,6 +62,24 @@ static int mount_root(void)
fs_initcall(mount_root);
#endif
+#ifdef CONFIG_ENV_HANDLING
+static int load_environment(void)
+{
+ const char *default_environment_path;
+
+ default_environment_path = default_environment_path_get();
+
+ if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT))
+ defaultenv_load("/env", 0);
+
+ envfs_load(default_environment_path, "/env", 0);
+ nvvar_load();
+
+ return 0;
+}
+environment_initcall(load_environment);
+#endif
+
int (*barebox_main)(void);
void __noreturn start_barebox(void)
@@ -84,16 +102,6 @@ void __noreturn start_barebox(void)
pr_debug("initcalls done\n");
- if (IS_ENABLED(CONFIG_ENV_HANDLING)) {
- char *default_environment_path = default_environment_path_get();
-
- if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT))
- defaultenv_load("/env", 0);
-
- envfs_load(default_environment_path, "/env", 0);
- nvvar_load();
- }
-
if (IS_ENABLED(CONFIG_COMMAND_SUPPORT)) {
pr_info("running /env/bin/init...\n");
diff --git a/include/asm-generic/barebox.lds.h b/include/asm-generic/barebox.lds.h
index e359187d7f85..254397ee97b3 100644
--- a/include/asm-generic/barebox.lds.h
+++ b/include/asm-generic/barebox.lds.h
@@ -34,7 +34,9 @@
KEEP(*(.initcall.9)) \
KEEP(*(.initcall.10)) \
KEEP(*(.initcall.11)) \
- KEEP(*(.initcall.12))
+ KEEP(*(.initcall.12)) \
+ KEEP(*(.initcall.13)) \
+ KEEP(*(.initcall.14))
#define BAREBOX_CMDS KEEP(*(SORT_BY_NAME(.barebox_cmd*)))
diff --git a/include/init.h b/include/init.h
index 37c7eedf6747..f619c951d377 100644
--- a/include/init.h
+++ b/include/init.h
@@ -39,6 +39,8 @@ typedef int (*initcall_t)(void);
#define device_initcall(fn) __define_initcall("10",fn,10)
#define crypto_initcall(fn) __define_initcall("11",fn,11)
#define late_initcall(fn) __define_initcall("12",fn,12)
+#define environment_initcall(fn) __define_initcall("13",fn,13)
+#define postenvironment_initcall(fn) __define_initcall("14",fn,14)
/* section for code used very early when
* - we're not running from where we linked at
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/6] fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc
2015-05-06 12:51 [PATCH 1/6] fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc Marc Kleine-Budde
` (4 preceding siblings ...)
2015-05-06 12:51 ` [PATCH 6/6] startup: introduce postenvironment_initcall Marc Kleine-Budde
@ 2015-05-07 7:15 ` Sascha Hauer
5 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2015-05-07 7:15 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: barebox
On Wed, May 06, 2015 at 02:51:26PM +0200, Marc Kleine-Budde wrote:
> In commit
>
> d384b5639fc1 of: Drop devicetree merge support
>
> the signature of of_unflatten_dtb() was changed, but the inline documentation
> was forgotten to adjust. This patch removes the left over "root" argument from
> the doc.
>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
> drivers/of/fdt.c | 1 -
> 1 file changed, 1 deletion(-)
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] 7+ messages in thread
end of thread, other threads:[~2015-05-07 7:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-06 12:51 [PATCH 1/6] fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 2/6] state: documentation: add anchor so that state can be referenced later Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 3/6] state: state_uint32_create: use %u to print unsigned variable Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 4/6] state: state_new_from_fdt(): remove unused function Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 5/6] watchdog: add static inline no-ops if WD is disabled Marc Kleine-Budde
2015-05-06 12:51 ` [PATCH 6/6] startup: introduce postenvironment_initcall Marc Kleine-Budde
2015-05-07 7:15 ` [PATCH 1/6] fdt: of_unflatten_dtb(): remove left over "root" argument from inline doc Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox