1. 26 Mar, 2021 9 commits
    • Simon Glass's avatar
      clk: sandbox: Move priv/plat data to a header file · 2c129382
      Simon Glass authored
      
      
      At present the structs used by this driver are not accessible outside it,
      so cannot be used with OF_PLATDATA_INST. Move them to a header file to
      fix this.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      2c129382
    • Simon Glass's avatar
      dm: test: Avoid destroying uclasses with of-platdata-inst · 208485f4
      Simon Glass authored
      
      
      It is not possible to destroy the uclasses when they are created at
      build time. Skip this step so that SPL test can complete successfully.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      208485f4
    • 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>
      36ac0d36
    • 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
      reused.
      
      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>
      b6e5c06b
    • 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>
      aaaea4dd
    • 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
         `_u_boot_list_2_udevice_2_root'
         +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
      	$(obj)/dts/dt-device.o
      
         cmd_dtoc = $(DTOC_ARGS) -c $(obj)/dts -C include/generated all
      
         include/generated/dt-structs-gen.h $(u-boot-spl-platdata_c) &: \
      		$(obj)/$(SPL_BIN).dtb
      	@[ -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>
      6dad3bc8
    • 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
      dt-plat.c
      
      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>
      0d870b4c
    • 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>
      d2bb6760
    • 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
      missing.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      (updated to add || true after seeing an unexplained test failure)
      cf7af3c7
  2. 22 Mar, 2021 31 commits