]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/fdt_support.h
driver/mtd/IFC:Wait tWB time, poll R/B before command execution
[karo-tx-uboot.git] / include / fdt_support.h
index 4826eee1ba0f3a72be29bfa458af7f3afbfd352f..4b9f84a24a3dc496fff0dddbcf3bf95fe3549312 100644 (file)
@@ -28,8 +28,8 @@
 
 #include <fdt.h>
 
-u32 fdt_getprop_u32_default(void *fdt, const char *path, const char *prop,
-                               const u32 dflt);
+u32 fdt_getprop_u32_default(const void *fdt, const char *path,
+                               const char *prop, const u32 dflt);
 int fdt_chosen(void *fdt, int force);
 int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force);
 void do_fixup_by_path(void *fdt, const char *path, const char *prop,
@@ -61,11 +61,11 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
                         const void *val, int len, int create);
 void fdt_fixup_qe_firmware(void *fdt);
 
-#ifdef CONFIG_HAS_FSL_DR_USB
+#if defined(CONFIG_HAS_FSL_DR_USB) || defined(CONFIG_HAS_FSL_MPH_USB)
 void fdt_fixup_dr_usb(void *blob, bd_t *bd);
 #else
 static inline void fdt_fixup_dr_usb(void *blob, bd_t *bd) {}
-#endif /* CONFIG_HAS_FSL_DR_USB */
+#endif /* defined(CONFIG_HAS_FSL_DR_USB) || defined(CONFIG_HAS_FSL_MPH_USB) */
 
 #if defined(CONFIG_SYS_FSL_SEC_COMPAT)
 void fdt_fixup_crypto_node(void *blob, int sec_rev);
@@ -104,5 +104,33 @@ int fdt_verify_alias_address(void *fdt, int anode, const char *alias,
                              u64 addr);
 u64 fdt_get_base_address(void *fdt, int node);
 
+enum fdt_status {
+       FDT_STATUS_OKAY,
+       FDT_STATUS_DISABLED,
+       FDT_STATUS_FAIL,
+       FDT_STATUS_FAIL_ERROR_CODE,
+};
+int fdt_set_node_status(void *fdt, int nodeoffset,
+                       enum fdt_status status, unsigned int error_code);
+static inline int fdt_status_okay(void *fdt, int nodeoffset)
+{
+       return fdt_set_node_status(fdt, nodeoffset, FDT_STATUS_OKAY, 0);
+}
+static inline int fdt_status_disabled(void *fdt, int nodeoffset)
+{
+       return fdt_set_node_status(fdt, nodeoffset, FDT_STATUS_DISABLED, 0);
+}
+
+int fdt_set_status_by_alias(void *fdt, const char* alias,
+                           enum fdt_status status, unsigned int error_code);
+static inline int fdt_status_okay_by_alias(void *fdt, const char* alias)
+{
+       return fdt_set_status_by_alias(fdt, alias, FDT_STATUS_OKAY, 0);
+}
+static inline int fdt_status_disabled_by_alias(void *fdt, const char* alias)
+{
+       return fdt_set_status_by_alias(fdt, alias, FDT_STATUS_DISABLED, 0);
+}
+
 #endif /* ifdef CONFIG_OF_LIBFDT */
 #endif /* ifndef __FDT_SUPPORT_H */