mirror of
https://xff.cz/git/u-boot/
synced 2025-11-02 19:36:22 +01:00
dtoc: Support ACPI paths in of-platdata
The start of an ACPI path typically has backslashes in it. These are not preserved during the translation from device tree to C code, since dtc (correctly) uses the first backslash as an escape character, and dtoc therefore leaves it out of the C string. Fix this with special-case handling. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -104,7 +104,9 @@ def get_value(ftype, value):
|
||||
elif ftype == fdt.TYPE_BYTE:
|
||||
return '%#x' % tools.ToByte(value[0])
|
||||
elif ftype == fdt.TYPE_STRING:
|
||||
return '"%s"' % value
|
||||
# Handle evil ACPI backslashes by adding another backslash before them.
|
||||
# So "\\_SB.GPO0" in the device tree effectively stays like that in C
|
||||
return '"%s"' % value.replace('\\', '\\\\')
|
||||
elif ftype == fdt.TYPE_BOOL:
|
||||
return 'true'
|
||||
elif ftype == fdt.TYPE_INT64:
|
||||
|
||||
Reference in New Issue
Block a user