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 <liaoao@xiaomi.com>
This commit is contained in:
liaoao 2023-08-21 11:15:07 +08:00 committed by Xiang Xiao
parent 5dd4af19f2
commit 3da7775543
7 changed files with 49 additions and 22 deletions

View file

@ -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

View file

@ -1,4 +1,2 @@
/exec_symtab.c
/modlib_symtab.c
/dtc
/dtc.zip

2
libs/libc/fdt/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
dtc.zip
dtc/

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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 */