diff options
-rw-r--r-- | host/arch/arm/lib/crossystem_arch.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/host/arch/arm/lib/crossystem_arch.c b/host/arch/arm/lib/crossystem_arch.c index 79fb152e..897036d2 100644 --- a/host/arch/arm/lib/crossystem_arch.c +++ b/host/arch/arm/lib/crossystem_arch.c @@ -29,7 +29,9 @@ #include "host_common.h" /* Base name for firmware FDT files */ -#define FDT_BASE_PATH "/proc/device-tree/firmware/chromeos" +#define FDT_BASE_PATH "/proc/device-tree" +/* The /firmware/chromeos path in FDT */ +#define FDT_CHROMEOS "firmware/chromeos/" /* Path to compatible FDT entry */ #define FDT_COMPATIBLE_PATH "/proc/device-tree/compatible" /* Path to the chromeos_arm platform device (deprecated) */ @@ -45,7 +47,7 @@ #define GPIO_BASE_PATH "/sys/class/gpio" #define GPIO_EXPORT_PATH GPIO_BASE_PATH "/export" /* Name of NvStorage type property */ -#define FDT_NVSTORAGE_TYPE_PROP "nonvolatile-context-storage" +#define FDT_NVSTORAGE_TYPE_PROP FDT_CHROMEOS "nonvolatile-context-storage" /* Errors */ #define E_FAIL -1 #define E_FILEOP -2 @@ -348,9 +350,9 @@ static int vb2_read_nv_storage_disk(struct vb2_context *ctx) int rv = -1; char nvctx_path[FNAME_SIZE]; int emmc_dev; - int lba = ReadFdtInt("nonvolatile-context-lba"); - int offset = ReadFdtInt("nonvolatile-context-offset"); - int size = ReadFdtInt("nonvolatile-context-size"); + int lba = ReadFdtInt(FDT_CHROMEOS "nonvolatile-context-lba"); + int offset = ReadFdtInt(FDT_CHROMEOS "nonvolatile-context-offset"); + int size = ReadFdtInt(FDT_CHROMEOS "nonvolatile-context-size"); emmc_dev = FindEmmcDev(); if (emmc_dev < 0) @@ -391,9 +393,9 @@ static int vb2_write_nv_storage_disk(struct vb2_context *ctx) int rv = -1; char nvctx_path[FNAME_SIZE]; int emmc_dev; - int lba = ReadFdtInt("nonvolatile-context-lba"); - int offset = ReadFdtInt("nonvolatile-context-offset"); - int size = ReadFdtInt("nonvolatile-context-size"); + int lba = ReadFdtInt(FDT_CHROMEOS "nonvolatile-context-lba"); + int offset = ReadFdtInt(FDT_CHROMEOS "nonvolatile-context-offset"); + int size = ReadFdtInt(FDT_CHROMEOS "nonvolatile-context-size"); emmc_dev = FindEmmcDev(); if (emmc_dev < 0) @@ -480,7 +482,7 @@ VbSharedDataHeader *VbSharedDataRead(void) { void *block = NULL; size_t size = 0; - if (ReadFdtBlock("vboot-shared-data", &block, &size)) + if (ReadFdtBlock(FDT_CHROMEOS "vboot-shared-data", &block, &size)) return NULL; VbSharedDataHeader *p = (VbSharedDataHeader *)block; if (p->magic != VB_SHARED_DATA_MAGIC) { @@ -540,16 +542,15 @@ const char* VbGetArchPropertyString(const char* name, char* dest, /* Properties from fdt */ if (!strcasecmp(name, "ro_fwid")) - prop = "readonly-firmware-version"; + prop = FDT_CHROMEOS "readonly-firmware-version"; else if (!strcasecmp(name, "hwid")) - prop = "hardware-id"; + prop = FDT_CHROMEOS "hardware-id"; else if (!strcasecmp(name, "fwid")) - prop = "firmware-version"; + prop = FDT_CHROMEOS "firmware-version"; else if (!strcasecmp(name, "mainfw_type")) - prop = "firmware-type"; + prop = FDT_CHROMEOS "firmware-type"; else if (!strcasecmp(name, "ecfw_act")) - prop = "active-ec-firmware"; - + prop = FDT_CHROMEOS "active-ec-firmware"; if (prop) str = ReadFdtString(prop); |