This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 3da7775543 libfdt: modify makefile
3da7775543 is described below
commit 3da77755431b65ea20bbdb9647fae26c8838aea6
Author: liaoao <[email protected]>
AuthorDate: Mon Aug 21 11:15:07 2023 +0800
libfdt: modify makefile
update LIBFDT to LIBC_FDT
update CONFIG_LIBFDT_DTC_VERSION to CONFIG_LIBC_FDT_DTC_VERSION
move dtc source code to fdt/dtc
move version_gen.h from apps/system/fdt to current dir
Signed-off-by: liaoao <[email protected]>
---
.../arm64/qemu/qemu-armv8a/configs/nsh/defconfig | 2 +-
libs/libc/.gitignore | 2 --
libs/libc/fdt/.gitignore | 2 ++
libs/libc/fdt/CMakeLists.txt | 4 ++--
libs/libc/fdt/Kconfig | 10 ++++-----
libs/libc/fdt/Make.defs | 25 +++++++++++----------
libs/libc/fdt/version_gen.h | 26 ++++++++++++++++++++++
7 files changed, 49 insertions(+), 22 deletions(-)
diff --git a/boards/arm64/qemu/qemu-armv8a/configs/nsh/defconfig
b/boards/arm64/qemu/qemu-armv8a/configs/nsh/defconfig
index a867661cfe..70be687a26 100644
--- a/boards/arm64/qemu/qemu-armv8a/configs/nsh/defconfig
+++ b/boards/arm64/qemu/qemu-armv8a/configs/nsh/defconfig
@@ -43,7 +43,7 @@ CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_IDLETHREAD_STACKSIZE=8192
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_INTELHEX_BINARY=y
-CONFIG_LIBFDT=y
+CONFIG_LIBC_FDT=y
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
diff --git a/libs/libc/.gitignore b/libs/libc/.gitignore
index 355c8b8ed6..2f99ba5919 100644
--- a/libs/libc/.gitignore
+++ b/libs/libc/.gitignore
@@ -1,4 +1,2 @@
/exec_symtab.c
/modlib_symtab.c
-/dtc
-/dtc.zip
diff --git a/libs/libc/fdt/.gitignore b/libs/libc/fdt/.gitignore
new file mode 100644
index 0000000000..71de7ad085
--- /dev/null
+++ b/libs/libc/fdt/.gitignore
@@ -0,0 +1,2 @@
+dtc.zip
+dtc/
diff --git a/libs/libc/fdt/CMakeLists.txt b/libs/libc/fdt/CMakeLists.txt
index 1a2d39d068..1a470a432e 100644
--- a/libs/libc/fdt/CMakeLists.txt
+++ b/libs/libc/fdt/CMakeLists.txt
@@ -17,9 +17,9 @@
# the License.
#
#
##############################################################################
-if(CONFIG_LIBFDT)
+if(CONFIG_LIBC_FDT)
- set(VERSION CONFIG_LIBFDT_DTC_VERSION)
+ set(VERSION CONFIG_LIBC_FDT_DTC_VERSION)
FetchContent_Declare(
dtc URL https://github.com/dgibson/dtc/archive/v$(VERSION).zip)
diff --git a/libs/libc/fdt/Kconfig b/libs/libc/fdt/Kconfig
index e0a62e2881..2074cc9799 100644
--- a/libs/libc/fdt/Kconfig
+++ b/libs/libc/fdt/Kconfig
@@ -3,18 +3,18 @@
# see the file kconfig-language.txt in the NuttX tools repository.
#
-config LIBFDT
+config LIBC_FDT
bool "Flattened Device Tree Library"
default n
---help---
Enable or disable Flattened Device Tree Library features.
-if LIBFDT
+if LIBC_FDT
-config LIBFDT_DTC_VERSION
- string "LIBFDT DTC Version"
+config LIBC_FDT_DTC_VERSION
+ string "LIBC FDT DTC Version"
default "1.7.0"
---help---
Version of DTC source code to download from github.
-endif # LIBFDT
+endif # LIBC_FDT
diff --git a/libs/libc/fdt/Make.defs b/libs/libc/fdt/Make.defs
index 78502c741b..d84801c6d5 100644
--- a/libs/libc/fdt/Make.defs
+++ b/libs/libc/fdt/Make.defs
@@ -18,16 +18,17 @@
#
############################################################################
-ifeq ($(CONFIG_LIBFDT),y)
+ifeq ($(CONFIG_LIBC_FDT),y)
-VERSION=$(CONFIG_LIBFDT_DTC_VERSION)
+VERSION=$(CONFIG_LIBC_FDT_DTC_VERSION)
# Download and unpack tarball if no git repo found
-ifeq ($(wildcard dtc/.git),)
+ifeq ($(wildcard fdt/dtc/.git),)
dtc:
$(call
DOWNLOAD,https://github.com/dgibson/dtc/archive,v$(VERSION).zip,dtc.zip)
- $(Q) unzip -o dtc.zip
- $(Q) mv dtc-$(VERSION) dtc
+ $(Q) mv dtc.zip fdt/dtc.zip
+ $(Q) unzip -o fdt/dtc.zip -d fdt
+ $(Q) mv fdt/dtc-$(VERSION) fdt/dtc
else
dtc:
endif
@@ -45,16 +46,16 @@ CSRCS += fdt_addresses.c
CSRCS += fdt_overlay.c
CSRCS += fdt_check.c
-CFLAGS +=
${INCDIR_PREFIX}$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)dtc$(DELIM)libfdt$(DELIM)
+CFLAGS +=
${INCDIR_PREFIX}$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)fdt$(DELIM)dtc$(DELIM)libfdt
-VPATH += dtc/libfdt
-SUBDIRS += dtc/libfdt
-DEPPATH += --dep-path dtc/libfdt
+VPATH += fdt/dtc/libfdt
+SUBDIRS += fdt/dtc/libfdt
+DEPPATH += --dep-path fdt/dtc/libfdt
distclean::
-ifeq ($(wildcard dtc/.git),)
- $(call DELDIR, dtc)
- $(call DELFILE, dtc.zip)
+ifeq ($(wildcard fdt/dtc/.git),)
+ $(call DELDIR, fdt/dtc)
+ $(call DELFILE, fdt/dtc.zip)
endif
endif
diff --git a/libs/libc/fdt/version_gen.h b/libs/libc/fdt/version_gen.h
new file mode 100644
index 0000000000..116b02573b
--- /dev/null
+++ b/libs/libc/fdt/version_gen.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+ * libs/libc/fdt/version_gen.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __LIBS_LIBC_FDT_VERSION_GEN_H
+#define __LIBS_LIBC_FDT_VERSION_GEN_H
+
+#define DTC_VERSION ("DTC "CONFIG_LIBC_FDT_DTC_VERSION)
+
+#endif /* __LIBS_LIBC_FDT_VERSION_GEN_H */