dtoc: make generated platdata structs const
authorSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Mon, 7 Jan 2019 19:29:26 +0000 (20:29 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 15 Jan 2019 20:28:45 +0000 (15:28 -0500)
The platdata initialization structs are currently generated into .rwdata.
Make sure the are put into .rodata by generating them as const.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/dtoc/dtb_platdata.py

index 6cb125944660ca090e224b35b94a4bbf9c4981bf..ca580b45d4a25f3da9390569b5f46d6a56846ecb 100644 (file)
@@ -461,7 +461,7 @@ class DtbPlatdata(object):
         """
         struct_name, _ = get_compat_name(node)
         var_name = conv_name_to_c(node.name)
-        self.buf('static struct %s%s %s%s = {\n' %
+        self.buf('static const struct %s%s %s%s = {\n' %
                  (STRUCT_PREFIX, struct_name, VAL_PREFIX, var_name))
         for pname, prop in node.props.items():
             if pname in PROP_IGNORE_LIST or pname[0] == '#':