Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building dtc from source and removing binary blob #70

Merged
merged 2 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ hdl_timing: $(TIMING_BUILD_DIRS)
# The following phony targets are passed straight to the FPGA sub-make programme
FPGA_TARGETS = fpga-all fpga-bit carrier_fpga carrier_ip ps_core \
fsbl devicetree boot u-boot dts xsct sw_clean u-boot-src \
atf ip_clean ps_clean
dtc atf ip_clean ps_clean

$(FPGA_TARGETS): $(TOP)/common/fpga.make $(AUTOGEN_BUILD_DIR) | update_VER
mkdir -p $(FPGA_BUILD_DIR)
Expand Down
Binary file removed common/configs/linux-xlnx/scripts/dtc
Binary file not shown.
14 changes: 11 additions & 3 deletions common/fpga.make
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
MD5_SUM_device-tree-xlnx-xilinx-v2020.2 = c30a25d475c21fe4d9913b2df6aab692
MD5_SUM_u-boot-xlnx-xilinx-v2020.2 = 6881a6b9f465f714e64c1398630287db
MD5_SUM_arm-trusted-firmware-xilinx-v2020.2 = 0fd3ddbd76c27040e6ce848c9ef9c1f3
# The dtc source is obtained from https://git.kernel.org/pub/scm/utils/dtc/dtc.git
MD5_SUM_dtc-1.6.1 = 19eef37196e99b659c402a29aac5ba59

# By default use the same tagged version of the sources as the build tools.
# To use a different version edit the variable below, and include MD5_SUM above.
DEVTREE_TAG = xilinx-v$(VIVADO_VER)
U_BOOT_TAG = xilinx-v$(VIVADO_VER)
ATF_TAG = xilinx-v$(VIVADO_VER)
DTC_TAG = 1.6.1

# Need bash for the source command in Xilinx settings64.sh
SHELL = /bin/bash
Expand Down Expand Up @@ -57,7 +60,7 @@ SRC_ROOT = $(TGT_BUILD_DIR)/../../src

DEVTREE_NAME = device-tree-xlnx-$(DEVTREE_TAG)
DEVTREE_SRC = $(SRC_ROOT)/$(DEVTREE_NAME)
DEVTREE_DTC = $(TOP)/common/configs/linux-xlnx/scripts/dtc
DEVTREE_DTC = $(SRC_ROOT)/dtc-$(DTC_TAG)/dtc
TARGET_DTS = $(TARGET_DIR)/target-top.dts
DEVTREE_DTB = $(IMAGE_DIR)/devicetree.dtb
DEVTREE_DTS = $(SDK_EXPORT)/dts
Expand Down Expand Up @@ -96,7 +99,8 @@ fsbl : $(FSBL)
boot : $(IMAGE_DIR)/boot.bin $(DEVTREE_DTB)
u-boot: $(U_BOOT_ELF)
atf: $(ATF_ELF)
.PHONY: fpga-all fpga-bit carrier_ip ps_core boot devicetree fsbl u-boot atf
dtc: $(DEVTREE_DTC)
.PHONY: fpga-all fpga-bit carrier_ip ps_core boot devicetree fsbl u-boot atf dtc

#####################################################################
# Compiler variables needed for u-boot build and other complitation
Expand Down Expand Up @@ -228,14 +232,18 @@ u-boot-src: $(U_BOOT_SRC)
.PHONY: u-boot-src
# -----------------------------------------------------------------------------------

$(DEVTREE_DTB): $(SDK_EXPORT) $(TARGET_DTS)
$(DEVTREE_DTB): $(SDK_EXPORT) $(TARGET_DTS) | $(DEVTREE_DTC)
coretl marked this conversation as resolved.
Show resolved Hide resolved
cp $(TARGET_DTS) $(DEVTREE_DTS)/
sed -i '/dts-v1/d' $(DEVTREE_DTS)/system-top.dts
gcc -I dts -E -nostdinc -undef -D__DTS__ -x assembler-with-cpp \
-o $(DEVTREE_DTS)/system-top.dts.tmp $(DEVTREE_DTS)/system-top.dts
@echo "Building DEVICE TREE blob ..."
$(DEVTREE_DTC) -f -I dts -O dtb -o $@ $(DEVTREE_DTS)/$(notdir $(TARGET_DTS))

$(DEVTREE_DTC): | $(SRC_ROOT)
glennchid marked this conversation as resolved.
Show resolved Hide resolved
$(call EXTRACT_FILE,dtc-$(DTC_TAG).tar.gz,$(MD5_SUM_dtc-$(DTC_TAG)))
$(MAKE) -C $(SRC_ROOT)/dtc-$(DTC_TAG) NO_PYTHON=1

$(FSBL): $(SDK_EXPORT)

$(PMUFW): $(SDK_EXPORT)
Expand Down