From 5d235324ae7a5b04b37c63a3445020fbd89ac7b2 Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Mon, 22 Feb 2021 00:12:34 +0000 Subject: video: sunxi_display: Convert to DM_VIDEO DM_VIDEO migration deadline is already expired, but around 80 Allwinner boards are still using video in a legacy way: ===================== WARNING ====================== This board does not use CONFIG_DM_VIDEO Please update the board to use CONFIG_DM_VIDEO before the v2019.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/migration.rst for more info. ==================================================== Convert the legacy video driver over to the DM_VIDEO framework. This is a minimal conversion: it doesn't use the DT for finding its resources, nor does it use DM clocks or DM devices for the outputs (LCD, HDMI, CVBS). Tested in Bananapi M1+ Plus 1920x1200 HDMI out. (Jagan) Signed-off-by: Jagan Teki [Andre: rebase and smaller fixes] Signed-off-by: Andre Przywara Acked-by: Maxime Ripard Reviewed-by: Jernej Skrabec Reviewed-by: Simon Glass --- scripts/config_whitelist.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'scripts') diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index c8c87900ce..7340e95bd4 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1636,7 +1636,6 @@ CONFIG_STV0991 CONFIG_STV0991_HZ CONFIG_STV0991_HZ_CLOCK CONFIG_ST_SMI -CONFIG_SUNXI_MAX_FB_SIZE CONFIG_SXNI855T CONFIG_SYSFLAGS_ADDR CONFIG_SYSFS -- cgit From 67c053341ff65e1fa6386f633492c7fc9d03fe18 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 3 Feb 2021 06:01:03 -0700 Subject: Makefile: Pass the U-Boot phase to dtoc Pass the U-Boot phase as a parameter so dtoc can use it. At present it is ether "spl" or "tpl". Signed-off-by: Simon Glass --- scripts/Makefile.spl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 1fd63efdfd..bfae9a4fca 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -311,7 +311,7 @@ $(obj)/$(SPL_BIN).dtb: $(obj)/dts/dt-$(SPL_NAME).dtb FORCE pythonpath = PYTHONPATH=scripts/dtc/pylibfdt DTOC_ARGS := $(pythonpath) $(srctree)/tools/dtoc/dtoc \ - -d $(obj)/$(SPL_BIN).dtb + -d $(obj)/$(SPL_BIN).dtb -p $(SPL_NAME) quiet_cmd_dtoc = DTOC $@ cmd_dtoc = $(DTOC_ARGS) -c $(obj)/dts -C include/generated all -- cgit From 5a1b25c2011e88e44626202f3cde05e65209c1e4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 3 Feb 2021 06:01:13 -0700 Subject: dm: of-platadata: Add option for device instantiation Add Kconfig options to support build-time device instantiation. When fully implemented, this will allow dtoc to create U-Boot devices (i.e. struct udevice records) at build time, thus reducing code space in SPL. For now this defaults to off, but will be enabled when the rest of the implementation is in place. Signed-off-by: Simon Glass --- scripts/Makefile.spl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index bfae9a4fca..f3bb793681 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -313,6 +313,10 @@ pythonpath = PYTHONPATH=scripts/dtc/pylibfdt DTOC_ARGS := $(pythonpath) $(srctree)/tools/dtoc/dtoc \ -d $(obj)/$(SPL_BIN).dtb -p $(SPL_NAME) +ifneq ($(CONFIG_$(SPL_TPL_)OF_PLATDATA_INST),) +DTOC_ARGS += -i +endif + quiet_cmd_dtoc = DTOC $@ cmd_dtoc = $(DTOC_ARGS) -c $(obj)/dts -C include/generated all -- cgit From 4c6f65074e75fc9ddf5aa553f2f0738617fd00d5 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 15 Mar 2021 17:25:19 +1300 Subject: dm: Add the new dtoc-generated files to the build Now that dtoc generates some new C files, add these to the build so that the instantiated devices and uclasses can be used. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- scripts/Makefile.spl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index f3bb793681..849e9c7060 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -120,7 +120,8 @@ endif u-boot-spl-init := $(head-y) u-boot-spl-main := $(libs-y) ifdef CONFIG_$(SPL_TPL_)OF_PLATDATA -u-boot-spl-platdata := $(obj)/dts/dt-plat.o +u-boot-spl-platdata := $(obj)/dts/dt-plat.o $(obj)/dts/dt-uclass.o \ + $(obj)/dts/dt-device.o u-boot-spl-platdata_c := $(patsubst %.o,%.c,$(u-boot-spl-platdata)) endif -- cgit From 91f414b3a82e5e8419a0ad703b7055884c4be254 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 25 Mar 2021 06:40:48 +1300 Subject: libfdt: Tidy up pylibfdt build rule 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 --- scripts/dtc/pylibfdt/Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/dtc/pylibfdt/Makefile b/scripts/dtc/pylibfdt/Makefile index 80b6ad2ae7..4782dd45c6 100644 --- a/scripts/dtc/pylibfdt/Makefile +++ b/scripts/dtc/pylibfdt/Makefile @@ -23,12 +23,18 @@ quiet_cmd_pymod = PYMOD $@ SWIG_OPTS="-I$(LIBFDT_srcdir) -I$(LIBFDT_srcdir)/.." \ $(PYTHON3) $< --quiet build_ext --inplace -$(obj)/_libfdt.so: $(src)/setup.py $(PYLIBFDT_srcs) FORCE +rebuild: $(src)/setup.py $(PYLIBFDT_srcs) @# Remove the library since otherwise Python doesn't seem to regenerate @# the libfdt.py file if it is missing. - rm -f $(obj)/_libfdt*.so + @rm -f $(obj)/_libfdt*.so $(call if_changed,pymod) + @# Rename the file to _libfdt.so so this Makefile doesn't run every time + @if [ ! -e $(obj)/_libfdt.so ]; then \ + mv $(obj)/_libfdt*.so $(obj)/_libfdt.so; \ + fi -always += _libfdt.so +$(obj)/_libfdt.so $(obj)/libfdt.py &: rebuild + +always += _libfdt.so libfdt.py clean-files += libfdt.i _libfdt.so libfdt.py libfdt_wrap.c -- cgit From 6519da47411e90322c59e3fa4b41ff398ff0a688 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 25 Mar 2021 06:40:49 +1300 Subject: Makefile: Avoid running dtoc every time 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 --- scripts/Makefile.spl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 849e9c7060..4f5876dad9 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -330,12 +330,10 @@ $(obj)/dts/dt-%.o: $(obj)/dts/dt-%.c \ include/generated/dt-structs-gen.h prepare FORCE $(call if_changed,plat) -PHONY += dts_dir -dts_dir: - $(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts) - +# Don't use dts_dir here, since it forces running this expensive rule every time include/generated/dt-structs-gen.h $(u-boot-spl-platdata_c) &: \ - $(obj)/$(SPL_BIN).dtb dts_dir FORCE + $(obj)/$(SPL_BIN).dtb + @[ -d $(obj)/dts ] || mkdir -p $(obj)/dts $(call if_changed,dtoc) ifdef CONFIG_SAMSUNG @@ -476,6 +474,10 @@ FORCE: $(obj)/dts/dt-$(SPL_NAME).dtb: dts/dt.dtb $(Q)$(MAKE) $(build)=$(obj)/dts spl_dtbs +PHONY += dts_dir +dts_dir: + $(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts) + # Declare the contents of the .PHONY variable as phony. We keep that # information in a variable so we can use it in if_changed and friends. .PHONY: $(PHONY) -- cgit From 13d71152f1e1323e0a5caf3a78b7a457fff58257 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 25 Mar 2021 06:40:50 +1300 Subject: Makefile: Depend only on required of-platdata files 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 --- scripts/Makefile.spl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 4f5876dad9..5f37a82931 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -120,8 +120,11 @@ endif u-boot-spl-init := $(head-y) u-boot-spl-main := $(libs-y) ifdef CONFIG_$(SPL_TPL_)OF_PLATDATA -u-boot-spl-platdata := $(obj)/dts/dt-plat.o $(obj)/dts/dt-uclass.o \ - $(obj)/dts/dt-device.o +ifdef CONFIG_$(SPL_TPL_)OF_PLATDATA_INST +u-boot-spl-platdata := $(obj)/dts/dt-uclass.o $(obj)/dts/dt-device.o +else +u-boot-spl-platdata := $(obj)/dts/dt-plat.o +endif u-boot-spl-platdata_c := $(patsubst %.o,%.c,$(u-boot-spl-platdata)) endif -- cgit From 56b313d1b637815dd01463698cc722a27ae361e4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 25 Mar 2021 06:40:52 +1300 Subject: Makefile: Use a variable for generated of-platdata headers 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 --- scripts/Makefile.spl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 5f37a82931..11e9f6a17e 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -120,13 +120,14 @@ endif u-boot-spl-init := $(head-y) u-boot-spl-main := $(libs-y) ifdef CONFIG_$(SPL_TPL_)OF_PLATDATA +platdata-hdr := include/generated/dt-structs-gen.h include/generated/dt-decl.h ifdef CONFIG_$(SPL_TPL_)OF_PLATDATA_INST u-boot-spl-platdata := $(obj)/dts/dt-uclass.o $(obj)/dts/dt-device.o else u-boot-spl-platdata := $(obj)/dts/dt-plat.o endif u-boot-spl-platdata_c := $(patsubst %.o,%.c,$(u-boot-spl-platdata)) -endif +endif # OF_PLATDATA # Linker Script # First test whether there's a linker-script for the specific stage defined... @@ -327,15 +328,11 @@ cmd_dtoc = $(DTOC_ARGS) -c $(obj)/dts -C include/generated all quiet_cmd_plat = PLAT $@ cmd_plat = $(CC) $(c_flags) -c $< -o $(filter-out $(PHONY),$@) -targets += $(u-boot-spl-platdata) - -$(obj)/dts/dt-%.o: $(obj)/dts/dt-%.c \ - include/generated/dt-structs-gen.h prepare FORCE +$(obj)/dts/dt-%.o: $(obj)/dts/dt-%.c $(platdata-hdr) $(call if_changed,plat) # Don't use dts_dir here, since it forces running this expensive rule every time -include/generated/dt-structs-gen.h $(u-boot-spl-platdata_c) &: \ - $(obj)/$(SPL_BIN).dtb +$(platdata-hdr) $(u-boot-spl-platdata_c) &: $(obj)/$(SPL_BIN).dtb @[ -d $(obj)/dts ] || mkdir -p $(obj)/dts $(call if_changed,dtoc) -- cgit From 354d2324635cb77b7bf9a9ad80c4d48b7761c4f7 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 25 Mar 2021 06:40:53 +1300 Subject: Makefile: Remove old of-platdata files before regenerating 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 --- scripts/Makefile.spl | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 11e9f6a17e..ca988224da 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -121,12 +121,22 @@ u-boot-spl-init := $(head-y) u-boot-spl-main := $(libs-y) ifdef CONFIG_$(SPL_TPL_)OF_PLATDATA platdata-hdr := include/generated/dt-structs-gen.h include/generated/dt-decl.h +platdata-inst := $(obj)/dts/dt-uclass.o $(obj)/dts/dt-device.o +platdata-noinst := $(obj)/dts/dt-plat.o + ifdef CONFIG_$(SPL_TPL_)OF_PLATDATA_INST -u-boot-spl-platdata := $(obj)/dts/dt-uclass.o $(obj)/dts/dt-device.o +u-boot-spl-platdata := $(platdata-inst) +u-boot-spl-old-platdata := $(platdata-noinst) else -u-boot-spl-platdata := $(obj)/dts/dt-plat.o +u-boot-spl-platdata := $(platdata-noinst) +u-boot-spl-old-platdata := $(platdata-inst) endif + +# Files we need to generate u-boot-spl-platdata_c := $(patsubst %.o,%.c,$(u-boot-spl-platdata)) + +# Files we won't generate and should remove +u-boot-spl-old-platdata_c := $(patsubst %.o,%.c,$(u-boot-spl-old-platdata)) endif # OF_PLATDATA # Linker Script @@ -334,6 +344,11 @@ $(obj)/dts/dt-%.o: $(obj)/dts/dt-%.c $(platdata-hdr) # Don't use dts_dir here, since it forces running this expensive rule every time $(platdata-hdr) $(u-boot-spl-platdata_c) &: $(obj)/$(SPL_BIN).dtb @[ -d $(obj)/dts ] || mkdir -p $(obj)/dts + @# Remove old files since which ones we generate depends on the setting + @# of OF_PLATDATA_INST and this might change between builds. Leaving old + @# ones around is confusing and it is possible that switching the + @# setting again will use the old one instead of regenerating it. + @rm -f $(u-boot-spl-all-platdata_c) $(u-boot-spl-all-platdata) $(call if_changed,dtoc) ifdef CONFIG_SAMSUNG -- cgit