1. 26 3月, 2021 7 次提交
    • S
      dm: core: Include dt-decl.h automatically · 910de109
      Simon Glass 提交于
      When dt-structs.h is used, include the dt-decl.h header as well, so that
      these declarations are available.
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      Signed-off-by: NSimon Glass <sjg@chromium.org>
      910de109
    • S
      Makefile: Remove old of-platdata files before regenerating · 354d2324
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      354d2324
    • S
      Makefile: Use a variable for generated of-platdata headers · 56b313d1
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      56b313d1
    • S
      dtoc: Only generate the required files · 8490c578
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      8490c578
    • S
      Makefile: Depend only on required of-platdata files · 13d71152
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      13d71152
    • S
      Makefile: Avoid running dtoc every time · 6519da47
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      6519da47
    • S
      libfdt: Tidy up pylibfdt build rule · 91f414b3
      Simon Glass 提交于
      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: NSimon Glass <sjg@chromium.org>
      91f414b3
  2. 22 3月, 2021 33 次提交