X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Ffdtdec.h;h=e30adbdefaefe6b31c8f96fde78de1667e081d85;hb=672055e20b78c2de1f1309b883d9718cdf5ba5f9;hp=1233dfb280b10efff3d2c395a728e50bef69a7a2;hpb=a1b341989b241be6e308ec9328d2fbb08049c8f9;p=oweals%2Fu-boot.git diff --git a/include/fdtdec.h b/include/fdtdec.h index 1233dfb280..e30adbdefa 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -134,7 +134,6 @@ enum fdt_compat_id { COMPAT_SAMSUNG_S3C2440_I2C, /* Exynos I2C Controller */ COMPAT_SAMSUNG_EXYNOS5_SOUND, /* Exynos Sound */ COMPAT_WOLFSON_WM8994_CODEC, /* Wolfson WM8994 Sound Codec */ - COMPAT_GOOGLE_CROS_EC, /* Google CROS_EC Protocol */ COMPAT_GOOGLE_CROS_EC_KEYB, /* Google CROS_EC Keyboard */ COMPAT_SAMSUNG_EXYNOS_EHCI, /* Exynos EHCI controller */ COMPAT_SAMSUNG_EXYNOS5_XHCI, /* Exynos5 XHCI controller */ @@ -168,7 +167,8 @@ enum fdt_compat_id { COMPAT_AMS_AS3722, /* AMS AS3722 PMIC */ COMPAT_INTEL_ICH_SPI, /* Intel ICH7/9 SPI controller */ COMPAT_INTEL_QRK_MRC, /* Intel Quark MRC */ - COMPAT_PANASONIC_XHCI, /* Panasonic UniPhier xHCI */ + COMPAT_SOCIONEXT_XHCI, /* Socionext UniPhier xHCI */ + COMPAT_INTEL_PCH, /* Intel PCH */ COMPAT_COUNT, }; @@ -327,7 +327,9 @@ fdt_addr_t fdtdec_get_addr_size(const void *blob, int node, * @param type pci address type (FDT_PCI_SPACE_xxx) * @param prop_name name of property to find * @param addr returns pci address in the form of fdt_pci_addr - * @return 0 if ok, negative on error + * @return 0 if ok, -ENOENT if the property did not exist, -EINVAL if the + * format of the property was invalid, -ENXIO if the requested + * address type was not found */ int fdtdec_get_pci_addr(const void *blob, int node, enum fdt_pci_space type, const char *prop_name, struct fdt_pci_addr *addr); @@ -347,7 +349,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 @@ -385,6 +390,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