All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/14] fdt: Tidy up a few fdtdec problems
@ 2011-11-24  3:54 ` Simon Glass
  0 siblings, 0 replies; 79+ messages in thread
From: Simon Glass @ 2011-11-24  3:54 UTC (permalink / raw)
  To: U-Boot Mailing List; +Cc: Devicetree Discuss, Albert ARIBAUD, Tom Warren

This fixes three trivial issues in fdtdec.c:
1. fdtdec_get_is_enabled() doesn't really need a default value
2. The fdt must be word-aligned, since otherwise it will fail on ARM
3. The compat_names[] array is missing its first element

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 include/fdtdec.h |    8 ++++----
 lib/fdtdec.c     |    7 ++++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index d871cdd..9018181 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -112,14 +112,14 @@ s32 fdtdec_get_int(const void *blob, int node, const char *prop_name,
  * Checks whether a node is enabled.
  * This looks for a 'status' property. If this exists, then returns 1 if
  * the status is 'ok' and 0 otherwise. If there is no status property,
- * it returns the default value.
+ * it returns 1 on the assumption that anything mentioned should be enabled
+ * by default.
  *
  * @param blob	FDT blob
  * @param node	node to examine
- * @param default_val	default value to return if no 'status' property exists
- * @return integer value 0/1, if found, or default_val if not
+ * @return integer value 0 (not enabled) or 1 (enabled)
  */
-int fdtdec_get_is_enabled(const void *blob, int node, int default_val);
+int fdtdec_get_is_enabled(const void *blob, int node);
 
 /**
  * Checks whether we have a valid fdt available to control U-Boot, and panic
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 0f87163..d1321a8 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -33,6 +33,7 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 #define COMPAT(id, name) name
 static const char * const compat_names[COMPAT_COUNT] = {
+	COMPAT(UNKNOWN, "<none>"),
 };
 
 /**
@@ -84,14 +85,14 @@ s32 fdtdec_get_int(const void *blob, int node, const char *prop_name,
 	return default_val;
 }
 
-int fdtdec_get_is_enabled(const void *blob, int node, int default_val)
+int fdtdec_get_is_enabled(const void *blob, int node)
 {
 	const char *cell;
 
 	cell = fdt_getprop(blob, node, "status", NULL);
 	if (cell)
 		return 0 == strcmp(cell, "ok");
-	return default_val;
+	return 1;
 }
 
 enum fdt_compat_id fd_dec_lookup(const void *blob, int node)
@@ -140,7 +141,7 @@ int fdtdec_next_alias(const void *blob, const char *name,
 int fdtdec_check_fdt(void)
 {
 	/* We must have an fdt */
-	if (fdt_check_header(gd->fdt_blob))
+	if (((uintptr_t)gd->fdt_blob & 3) || fdt_check_header(gd->fdt_blob))
 		panic("No valid fdt found - please append one to U-Boot\n"
 			"binary or define CONFIG_OF_EMBED\n");
 	return 0;
-- 
1.7.3.1

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

end of thread, other threads:[~2011-12-12 18:42 UTC | newest]

Thread overview: 79+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-24  3:54 [PATCH 01/14] fdt: Tidy up a few fdtdec problems Simon Glass
2011-11-24  3:54 ` [U-Boot] " Simon Glass
2011-11-24  3:54 ` [PATCH 03/14] arm: fdt: Ensure that an embedded fdt is word-aligned Simon Glass
2011-11-24  3:54   ` [U-Boot] " Simon Glass
2011-11-24  3:54 ` [PATCH 06/14] tegra: fdt: Add device tree file for Tegra2 Seaboard Simon Glass
2011-11-24  3:54   ` [U-Boot] " Simon Glass
     [not found] ` <1322106896-23054-2-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-11-24  3:54   ` [PATCH 02/14] fdt: Add functions to access phandles, arrays and bools Simon Glass
2011-11-24  3:54     ` [U-Boot] " Simon Glass
     [not found]     ` <1322106896-23054-3-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-11-28 18:41       ` Stephen Warren
2011-11-28 18:41         ` [U-Boot] " Stephen Warren
     [not found]         ` <4ED3D5DC.10502-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-29  5:12           ` David Gibson
2011-11-29  5:12             ` [U-Boot] " David Gibson
2011-12-02  1:01         ` Simon Glass
2011-12-02  1:01           ` [U-Boot] " Simon Glass
     [not found]           ` <CAPnjgZ29tsNXd1+1eXdTHRjgh_MQJrXoc23_oqO9UPJ73mu7ZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-02 15:55             ` Stephen Warren
2011-12-02 15:55               ` [U-Boot] " Stephen Warren
2011-12-02 16:38               ` Simon Glass
2011-12-02 16:38                 ` [U-Boot] " Simon Glass
2011-12-02  3:33         ` Jerry Van Baren
2011-12-02  3:33           ` [U-Boot] " Jerry Van Baren
2011-12-02  4:58           ` Simon Glass
2011-12-02  4:58             ` [U-Boot] " Simon Glass
2011-12-02 17:22             ` Jerry Van Baren
2011-12-02 17:22               ` [U-Boot] " Jerry Van Baren
2011-12-02 18:12               ` Simon Glass
2011-12-02 18:12                 ` [U-Boot] " Simon Glass
2011-11-24  3:54   ` [PATCH 04/14] arm: fdt: Add skeleton device tree file Simon Glass
2011-11-24  3:54     ` [U-Boot] " Simon Glass
2011-11-24  3:54   ` [PATCH 05/14] tegra: fdt: Add Tegra2x " Simon Glass
2011-11-24  3:54     ` [U-Boot] " Simon Glass
     [not found]     ` <1322106896-23054-6-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2011-11-28 18:56       ` Stephen Warren
2011-11-28 18:56         ` [U-Boot] " Stephen Warren
2011-12-02  1:24         ` Simon Glass
2011-12-02  1:24           ` [U-Boot] " Simon Glass
     [not found]           ` <CAPnjgZ11cFm15E9MHXno_YGp0NxdOHhGBavYbQBP5Nu_TOtx7A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-02 15:58             ` Stephen Warren
2011-12-02 15:58               ` [U-Boot] " Stephen Warren
2011-12-02 16:47               ` Simon Glass
2011-12-02 16:47                 ` [U-Boot] " Simon Glass
2011-11-24  3:54   ` [PATCH 07/14] tegra: fdt: Add initial device tree definitions for USB ports Simon Glass
2011-11-24  3:54     ` [U-Boot] " Simon Glass
2011-11-24  3:54   ` [PATCH 14/14] tegra: fdt: Enable FDT support for Seaboard Simon Glass
2011-11-24  3:54     ` [U-Boot] " Simon Glass
2011-11-28 18:33   ` [PATCH 01/14] fdt: Tidy up a few fdtdec problems Stephen Warren
2011-11-28 18:33     ` [U-Boot] " Stephen Warren
     [not found]     ` <4ED3D3F2.8070302-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-11-29  1:10       ` David Gibson
2011-11-29  1:10         ` [U-Boot] " David Gibson
2011-12-01 20:59     ` Simon Glass
2011-12-01 20:59       ` [U-Boot] " Simon Glass
2011-11-24  3:54 ` [U-Boot] [PATCH 08/14] tegra: usb: Add USB definitions for Tegra2 Seaboard Simon Glass
2011-11-24  3:54 ` [U-Boot] [PATCH 09/14] tegra: usb: Add support for data alignment and txfifo threshold Simon Glass
2011-11-28 19:05   ` Stephen Warren
2011-12-02  1:42     ` Simon Glass
2011-11-24  3:54 ` [U-Boot] [PATCH 10/14] tegra: usb: Add support for USB peripheral Simon Glass
2011-11-28 19:21   ` Stephen Warren
2011-12-02  1:51     ` Simon Glass
2011-12-02 16:10       ` Stephen Warren
2011-12-02 17:00         ` Simon Glass
2011-12-02 20:40           ` Stephen Warren
2011-12-02 23:07             ` Simon Glass
2011-12-03  0:59     ` Simon Glass
2011-12-05 21:33       ` Stephen Warren
2011-12-05 21:46         ` Simon Glass
2011-12-05 22:15           ` Stephen Warren
2011-12-05 23:35             ` Simon Glass
2011-12-06  0:17               ` Stephen Warren
2011-12-06  1:14                 ` Simon Glass
2011-12-06 20:42                   ` Stephen Warren
2011-12-06 21:23                     ` Simon Glass
     [not found]                       ` <CAPnjgZ1G+mv6uv8SrdMm7DoqFjeeyVHYv6nbQxn9qixfbQMGvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-07 23:46                         ` Stephen Warren
2011-12-07 23:46                           ` [U-Boot] " Stephen Warren
2011-12-08 21:24                           ` Simon Glass
2011-12-08 21:24                             ` [U-Boot] " Simon Glass
     [not found]                             ` <CAPnjgZ0AuBNkYKN0JHQyc7DdzwUSZivR+Dv2BkiFsKQBNMeP8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-12-12 18:18                               ` Stephen Warren
2011-12-12 18:18                                 ` [U-Boot] " Stephen Warren
2011-12-12 18:42                                 ` Simon Glass
2011-12-12 18:42                                   ` [U-Boot] " Simon Glass
2011-11-24  3:54 ` [U-Boot] [PATCH 11/14] tegra: usb: Add USB support to nvidia boards Simon Glass
2011-11-24  3:54 ` [U-Boot] [PATCH 12/14] tegra: usb: Add common USB defines for tegra2 boards Simon Glass
2011-11-24  3:54 ` [U-Boot] [PATCH 13/14] tegra: usb: Enable USB on Seaboard Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.