Skip to content

Commit

Permalink
Build system updates for merged nvidia tree.
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Madison <matt@madison.systems>
  • Loading branch information
madisongh committed Jun 29, 2024
1 parent ea48537 commit 89b0448
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 25 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
ifeq ($(KERNEL_OVERLAYS),)
KERNEL_OVERLAYS :=
KERNEL_OVERLAYS += $(CURDIR)/../nvidia
KERNEL_OVERLAYS += $(CURDIR)/../nvgpu
KERNEL_OVERLAYS += $(CURDIR)/../nvgpu-next
KERNEL_OVERLAYS += $(CURDIR)/../nvidia-t23x
KERNEL_OVERLAYS += $(CURDIR)/nvidia
KERNEL_OVERLAYS += $(CURDIR)/nvidia/nvgpu
else
override KERNEL_OVERLAYS := $(subst :, ,$(KERNEL_OVERLAYS))
endif
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/boot/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ dts_mfiles = $(call dts_makefile, $(tegra-dtstree)/platform/, Makefile)
ifneq ($(dts_mfiles),)
dts-include :=
include $(dts_mfiles)
dtb-y := $(addprefix $(tegra-rel-dtstree)/hardware/nvidia/,$(dtb-y))
dtbo-y := $(addprefix $(tegra-rel-dtstree)/hardware/nvidia/,$(dtbo-y))
dtb-y := $(addprefix $(tegra-rel-dtstree)/nvidia/,$(dtb-y))
dtbo-y := $(addprefix $(tegra-rel-dtstree)/nvidia/,$(dtbo-y))
ifneq ($(dts-include),)
DTC_FLAGS += $(addprefix -i $(tegra-dtstree)/,$(dts-include))
DTCCPP_FLAGS += $(addprefix -I$(tegra-dtstree)/,$(dts-include))
Expand Down
6 changes: 3 additions & 3 deletions nvidia/drivers/video/tegra/dc/bridge/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
GCOV_PROFILE := y
subdir-ccflags-y := -Werror
ccflags-y += -I$(overlay)/drivers/video/tegra/host
ccflags-y += -I$(overlay)/drivers/video/tegra/dc
ccflags-y += -I$(overlay)/drivers/platform/tegra
ccflags-y += -I$(srctree.nvidia)/drivers/video/tegra/host
ccflags-y += -I$(srctree.nvidia)/drivers/video/tegra/dc
ccflags-y += -I$(srctree.nvidia)/drivers/platform/tegra
ccflags-y += -I$(srctree)/arch/arm/mach-tegra

obj-$(CONFIG_TEGRA_HDMI2FPD_DS90UH949) += hdmi2fpd_ds90uh949.o
Expand Down
20 changes: 6 additions & 14 deletions scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -464,27 +464,19 @@ endef
the-space :=
the-space +=
# TEGRA_ROOT_PATH is the relative path to the directory one level upper than $srctree
_TEGRA_ROOT_PATH = $(subst ^$(realpath $(srctree)/..)/,,^$(realpath $(kbuild-dir)))
# _TEGRA_REL_PATH is path like "../../../" that points to directory one level
# upper that $(srctree)
_TEGRA_ROOT_PATH = $(subst ^$(realpath $(srctree))/,,^$(realpath $(kbuild-dir)))
# _TEGRA_REL_PATH is path like "../../../" that points to $(srctree)
_TEGRA_REL_PATH = $(subst $(the-space),/,$(patsubst %,..,$(subst /, ,$(_TEGRA_ROOT_PATH))))
# _KERNEL_LAST is the last directory name in $(srctree)
_KERNEL_LAST = $(lastword $(subst /, ,$(realpath $(srctree))))
# obj-y += $(call tegra-path,nv-hidden-repo,drivers/foo/bar.o)
# will evaluate to either:
# obj-y += ../../../nv-hidden-repo/drivers/foo/bar.o
# or:
# obj-y += bar.o
tegra-base-kernel-path = $(call _TEGRA_REL_PATH)/$(call _KERNEL_LAST)
tegra-path = $(if $(wildcard $(srctree)/../$(1)),$(call _TEGRA_REL_PATH)/$(1)/$(2),$(call tegra-base-kernel-path)/$(2))
tegra-base-kernel-path = $(call _TEGRA_REL_PATH)
tegra-path = $(if $(wildcard $(srctree)/nvidia/$(1)),$(call _TEGRA_REL_PATH)/nvidia/$(1)/$(2),$(call tegra-base-kernel-path)/$(2))
tegra-dtstree = $(srctree)/nvidia

ifneq ($(NV_BUILD_KERNEL_DTS_ROOT),)
tegra-dtstree = $(NV_BUILD_KERNEL_DTS_ROOT)
else
tegra-dtstree = $(srctree)/../../hardware/nvidia
endif

tegra-root-dtstree = $(subst ^$(realpath $(tegra-dtstree)/../..)/,,^$(realpath $(srctree)/arch/arm64/boot/dts))
tegra-root-dtstree = $(subst ^$(realpath $(tegra-dtstree)/..)/,,^$(realpath $(srctree)/arch/arm64/boot/dts))
tegra-rel-dtstree = $(subst $(the-space),/,$(patsubst %,..,$(subst /, ,$(tegra-root-dtstree))))
# delete partially updated (i.e. corrupted) files on error
.DELETE_ON_ERROR:
4 changes: 2 additions & 2 deletions scripts/tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ if [ "${KBUILD_SRC}" = "" ]; then
tree_nvidia=
else
tree=${srctree}/
tree_nvgpu=${srctree}/../nvgpu/
tree_nvidia=${srctree}/../nvidia/
tree_nvgpu=
tree_nvidia=
fi

# ignore userspace tools
Expand Down

0 comments on commit 89b0448

Please sign in to comment.