]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - include/fdtdec.h
fdt: Export fdtdec_get_number() for general use
[karo-tx-uboot.git] / include / fdtdec.h
index 231eed789273800fb3daf14913ae84b07d65a6c9..967fa88f9ec1d53352c7eb940c43ad26ad941baa 100644 (file)
@@ -167,6 +167,8 @@ enum fdt_compat_id {
        COMPAT_INTEL_GMA,               /* Intel Graphics Media Accelerator */
        COMPAT_AMS_AS3722,              /* AMS AS3722 PMIC */
        COMPAT_INTEL_ICH_SPI,           /* Intel ICH7/9 SPI controller */
+       COMPAT_INTEL_QRK_MRC,           /* Intel Quark MRC */
+       COMPAT_SOCIONEXT_XHCI,          /* Socionext UniPhier xHCI */
 
        COMPAT_COUNT,
 };
@@ -345,7 +347,10 @@ int fdtdec_get_pci_vendev(const void *blob, int node,
 
 /**
  * Look at the pci address of a device node that represents a PCI device
- * and parse the bus, device and function number from it.
+ * and parse the bus, device and function number from it. For some cases
+ * like the bus number encoded in reg property is not correct after pci
+ * enumeration, this function looks through the node's compatible strings
+ * to get these numbers extracted instead.
  *
  * @param blob         FDT blob
  * @param node         node to examine
@@ -383,6 +388,17 @@ int fdtdec_get_pci_bar32(const void *blob, int node,
 s32 fdtdec_get_int(const void *blob, int node, const char *prop_name,
                s32 default_val);
 
+/**
+ * Get a variable-sized number from a property
+ *
+ * This reads a number from one or more cells.
+ *
+ * @param ptr  Pointer to property
+ * @param cells        Number of cells containing the number
+ * @return the value in the cells
+ */
+u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells);
+
 /**
  * Look up a 64-bit integer property in a node and return it. The property
  * must have at least 8 bytes of data (2 cells). The first two cells are