MIPS: convert CONFIG_SYS_MIPS_TIMER_FREQ to Kconfig
[platform/kernel/u-boot.git] / include / fdt_support.h
index e7cd4aa..5638bd4 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <asm/u-boot.h>
 #include <linux/libfdt.h>
+#include <abuf.h>
 
 /**
  * arch_fixup_fdt() - Write arch-specific information to fdt
@@ -187,6 +188,18 @@ int fdt_find_or_add_subnode(void *fdt, int parentoffset, const char *name);
 int ft_board_setup(void *blob, struct bd_info *bd);
 
 /**
+ * board_rng_seed() - Provide a seed to be passed via /chosen/rng-seed
+ *
+ * This function is called if CONFIG_BOARD_RNG_SEED is set, and must
+ * be provided by the board. It should return, via @buf, some suitable
+ * seed value to pass to the kernel.
+ *
+ * @param buf         A struct abuf for returning the seed and its size.
+ * @return            0 if ok, negative on error.
+ */
+int board_rng_seed(struct abuf *buf);
+
+/**
  * board_fdt_chosen_bootargs() - Arbitrarily amend fdt kernel command line
  *
  * This is used for late modification of kernel command line arguments just
@@ -230,8 +243,6 @@ int fdt_increase_size(void *fdt, int add_len);
 
 int fdt_delete_disabled_nodes(void *blob);
 
-int fdt_fixup_nor_flash_size(void *blob);
-
 struct node_info;
 #if defined(CONFIG_FDT_FIXUP_PARTITIONS)
 void fdt_fixup_mtdparts(void *fdt, const struct node_info *node_info,
@@ -289,6 +300,12 @@ int fdt_node_offset_by_compat_reg(void *blob, const char *compat,
                                        phys_addr_t compat_off);
 int fdt_node_offset_by_pathf(void *blob, const char *fmt, ...)
        __attribute__ ((format (printf, 2, 3)));
+
+#define fdt_for_each_node_by_compatible(node, fdt, start, compat)      \
+       for (node = fdt_node_offset_by_compatible(fdt, start, compat);  \
+            node >= 0;                                                 \
+            node = fdt_node_offset_by_compatible(fdt, node, compat))
+
 int fdt_set_phandle(void *fdt, int nodeoffset, uint32_t phandle);
 unsigned int fdt_create_phandle(void *fdt, int nodeoffset);
 unsigned int fdt_create_phandle_by_compatible(void *fdt, const char *compat);