In some cases, (e.g., when running QEMU with TrustZone emulation), the
DT may contain memory nodes whose status is set to 'secure'. Similarly,
the status may be set to 'disabled' if the consumer of the DT image is
expected to treat it as if it weren't there.
So check whether a 'status' property is present, and if so, ignore the
node if the status is not 'okay'.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
{\r
INT32 Prev, Next;\r
CONST CHAR8 *DeviceType;\r
+ CONST CHAR8 *NodeStatus;\r
INT32 Len;\r
EFI_STATUS Status;\r
\r
break;\r
}\r
\r
+ NodeStatus = fdt_getprop (mDeviceTreeBase, Next, "status", &Len);\r
+ if (NodeStatus != NULL && AsciiStrCmp (NodeStatus, "okay") != 0) {\r
+ DEBUG ((DEBUG_WARN, "%a: ignoring memory node with status \"%a\"\n",\r
+ __FUNCTION__, NodeStatus));\r
+ continue;\r
+ }\r
+\r
DeviceType = fdt_getprop (mDeviceTreeBase, Next, "device_type", &Len);\r
if (DeviceType != NULL && AsciiStrCmp (DeviceType, "memory") == 0) {\r
//\r