1. 26 Mar, 2021 7 commits
    • Simon Glass's avatar
      dm: core: Include dt-decl.h automatically · 36ac0d36
      Simon Glass authored
      When dt-structs.h is used, include the dt-decl.h header as well, so that
      these declarations are available.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      Makefile: Remove old of-platdata files before regenerating · b6e5c06b
      Simon Glass authored
      Which files we generate depends on the setting of OF_PLATDATA_INST in the
      build. This might change between builds, but the build directory may be
      Leaving old files around is confusing and switching the OF_PLATDATA_INST
      setting does not necessarily regenerate the files, e.g. if the devicetree
      has not changed.
      Remove all the files before regenerating new ones.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      Makefile: Use a variable for generated of-platdata headers · aaaea4dd
      Simon Glass authored
      There are actually two generated files but only one is currently mentioned
      in the Makefile as a dependency. Put them both in a Makefile variable and
      use that instead, to avoid inconsistency.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      dtoc: Only generate the required files · 6dad3bc8
      Simon Glass authored
      At present all possible files are generated, even if some of them just
      have a header and an empty body. It is better to generate only the files
      that are needed, so that the two types of build (based on the setting of
      OF_PLATDATA_INST) can be mutually exclusive.
      This is intended to fix a strange problem sometimes found with CI:
         Building current source for 1 boards (1 thread, 40 jobs per thread)
            sandbox:  +   sandbox_spl
         +drivers/built-in.o: In function `dm_setup_inst':
         +drivers/core/root.c:135: undefined reference to
         +dts/dt-uclass.o:(.u_boot_list_2_uclass_2_serial+0x10): undefined
         reference to `_u_boot_list_2_udevice_2_serial'
      This likely happens when switching from !OF_PLATDATA_INST to
      OF_PLATDATA_INST since running 'make xxx_defconfig" does not currently
      cause any change in which files are generated. With !OF_PLATDATA_INST
      the dt-device.c file has no declarations and this is assumed to be the
      starting state. The error above seems to indicate that, after changing
      to OF_PLATDATA_INST, the dt-uclass.c file is regenerated but the
      dt-device.c files is not. This does not seem possible from the relevant
      Makefile.spl rule:
         u-boot-spl-platdata := $(obj)/dts/dt-plat.o $(obj)/dts/dt-uclass.o
         cmd_dtoc = $(DTOC_ARGS) -c $(obj)/dts -C include/generated all
         include/generated/dt-structs-gen.h $(u-boot-spl-platdata_c) &: \
      	@[ -d $(obj)/dts ] || mkdir -p $(obj)/dts
      	$(call if_changed,dtoc)
      It seems that this cannot regenerate dt-uclass.c without dt-device.c since
      'dtoc all' is used. So here the trail ends for now.
      In any case it seems better to generate files that are uses and not bother
      with those that serve no purpose. So update dtoc to do this automatically.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      Makefile: Depend only on required of-platdata files · 0d870b4c
      Simon Glass authored
      When OF_PLATDATA_INST is enabled, we need dt-uclass.c and dt-device.c for
      the build to work. When OF_PLATDATA_INST is not enabled, we only need
      Update the Makefile rules to indicate this.
      At present all files are generated and compiled regardless of which are
      actually needed.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      Makefile: Avoid running dtoc every time · d2bb6760
      Simon Glass authored
      Since the dst_dir rule always runs, it causes a rebuild of the of-platdata
      files even if not needed.
      Create the directory inside the rule instead.
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
    • Simon Glass's avatar
      libfdt: Tidy up pylibfdt build rule · cf7af3c7
      Simon Glass authored
      At present the build rule for pylibfdt depends on _libfdt.so but modern
      Python versions add a different suffix to the output file, resulting in
      something like _libfdt.cpython-38-x86_64-linux-gnu.so
      The result is that pylibfdt is rebuilt every time.
      Rename the file the standard name so that the rule works correctly. Also
      add libfdt.py to the dependencies, so that file is always created if
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      (updated to add || true after seeing an unexplained test failure)
  2. 22 Mar, 2021 33 commits