Follow the Linux Kernel in building dtc as needed
Subsystems (2)
cover Follow the Linux Kernel in building dtc as needed
The following series has been applied. I am posting this for the record.
For the record, I do not believe that using git submodules is a good approach here. We have a small amount of code that we need here, and happily we can leverage infrastructur e from the Linux Kernel.
Speaking of, this is not the first time we have run into problems deviating from the workflow of the kernel. The problems of having large number of warnings, or not stemmed from not just leve raging all of the infrastructure from the kernel. So related, yes, fixes for these warnings should come in, and as always, if they're in the upstream kernel dts as well, they should be fixed there.
Thanks all.
Signature · 1 line
Tom
PATCH 1/5 scripts/dtc: Update to upstream version v1.4.3
Using the update-dtc-source.sh script from Linux v4.14-rc1 import the portions of dtc that we require. We bring in update-dtc-source.sh and scripts/dtc/Makefile from Linux v4.14-rc1. Rework DTC_FLAGS handling to not require a test.
--- scripts/Kbuild.include | 5 - scripts/Makefile.extrawarn | 16 +- scripts/dtc/Makefile | 31 + scripts/dtc/Makefile.dtc | 18 + scripts/dtc/checks.c | 849 +++++++++++++ scripts/dtc/data.c | 269 ++++ scripts/dtc/dtc-lexer.l | 311 +++++ scripts/dtc/dtc-lexer.lex.c_shipped | 2260 +++++++++++++++++++++++++++++++++ scripts/dtc/dtc-parser.tab.c_shipped | 2301 ++++++++++++++++++++++++++++++++++ scripts/dtc/dtc-parser.tab.h_shipped | 123 ++ scripts/dtc/dtc-parser.y | 519 ++++++++ scripts/dtc/dtc.c | 366 ++++++ scripts/dtc/dtc.h | 285 +++++ scripts/dtc/flattree.c | 946 ++++++++++++++ scripts/dtc/fstree.c | 90 ++ scripts/dtc/libfdt/Makefile.libfdt | 11 + scripts/dtc/libfdt/fdt.c | 251 ++++ scripts/dtc/libfdt/fdt.h | 111 ++ scripts/dtc/libfdt/fdt_empty_tree.c | 84 ++ scripts/dtc/libfdt/fdt_ro.c | 703 +++++++++++ scripts/dtc/libfdt/fdt_rw.c | 491 ++++++++ scripts/dtc/libfdt/fdt_strerror.c | 102 ++ scripts/dtc/libfdt/fdt_sw.c | 288 +++++ scripts/dtc/libfdt/fdt_wip.c | 139 ++ scripts/dtc/libfdt/libfdt.h | 1833 +++++++++++++++++++++++++++ scripts/dtc/libfdt/libfdt_env.h | 112 ++ scripts/dtc/libfdt/libfdt_internal.h | 95 ++ scripts/dtc/livetree.c | 980 +++++++++++++++ scripts/dtc/srcpos.c | 302 +++++ scripts/dtc/srcpos.h | 118 ++ scripts/dtc/treesource.c | 284 +++++ scripts/dtc/update-dtc-source.sh | 81 ++ scripts/dtc/util.c | 473 +++++++ scripts/dtc/util.h | 265 ++++ scripts/dtc/version_gen.h | 1 + 35 files changed, 15100 insertions(+), 13 deletions(-) create mode 100644 scripts/dtc/Makefile create mode 100644 scripts/dtc/Makefile.dtc create mode 100644 scripts/dtc/checks.c create mode 100644 scripts/dtc/data.c create mode 100644 scripts/dtc/dtc-lexer.l create mode 100644 scripts/dtc/dtc-lexer.lex.c_shipped create mode 100644 scripts/dtc/dtc-parser.tab.c_shipped create mode 100644 scripts/dtc/dtc-parser.tab.h_shipped create mode 100644 scripts/dtc/dtc-parser.y create mode 100644 scripts/dtc/dtc.c create mode 100644 scripts/dtc/dtc.h create mode 100644 scripts/dtc/flattree.c create mode 100644 scripts/dtc/fstree.c create mode 100644 scripts/dtc/libfdt/Makefile.libfdt create mode 100644 scripts/dtc/libfdt/fdt.c create mode 100644 scripts/dtc/libfdt/fdt.h create mode 100644 scripts/dtc/libfdt/fdt_empty_tree.c create mode 100644 scripts/dtc/libfdt/fdt_ro.c create mode 100644 scripts/dtc/libfdt/fdt_rw.c create mode 100644 scripts/dtc/libfdt/fdt_strerror.c create mode 100644 scripts/dtc/libfdt/fdt_sw.c create mode 100644 scripts/dtc/libfdt/fdt_wip.c create mode 100644 scripts/dtc/libfdt/libfdt.h create mode 100644 scripts/dtc/libfdt/libfdt_env.h create mode 100644 scripts/dtc/libfdt/libfdt_internal.h create mode 100644 scripts/dtc/livetree.c create mode 100644 scripts/dtc/srcpos.c create mode 100644 scripts/dtc/srcpos.h create mode 100644 scripts/dtc/treesource.c create mode 100755 scripts/dtc/update-dtc-source.sh create mode 100644 scripts/dtc/util.c create mode 100644 scripts/dtc/util.h create mode 100644 scripts/dtc/version_gen.h
scripts/Kbuild.include +0 -5
@@ -172,11 +172,6 @@ ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh) # Usage: $(call ld-ifversion, -ge, 22252, y) ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4)) -# dtc-option -# Usage: DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg) -dtc-option = $(call try-run,\ - echo '/dts-v1/; / {};' | $(DTC) $(1),$(1),$(2)) - ###### ###
scripts/Makefile.extrawarn +8 -8
@@ -58,8 +58,8 @@ endif KBUILD_CFLAGS += $(warning) -dtc-warning-2 += $(call dtc-option,-Wnode_name_chars_strict) -dtc-warning-2 += $(call dtc-option,-Wproperty_name_chars_strict) +dtc-warning-2 += -Wnode_name_chars_strict +dtc-warning-2 += -Wproperty_name_chars_strict dtc-warning := $(dtc-warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) dtc-warning += $(dtc-warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
@@ -70,11 +70,11 @@ DTC_FLAGS += $(dtc-warning) else # Disable noisy checks by default -DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg) -DTC_FLAGS += $(call dtc-option,-Wno-simple_bus_reg) -DTC_FLAGS += $(call dtc-option,-Wno-unit_address_format) -DTC_FLAGS += $(call dtc-option,-Wno-pci_bridge) -DTC_FLAGS += $(call dtc-option,-Wno-pci_device_bus_num) -DTC_FLAGS += $(call dtc-option,-Wno-pci_device_reg) +DTC_FLAGS += -Wno-unit_address_vs_reg +DTC_FLAGS += -Wno-simple_bus_reg +DTC_FLAGS += -Wno-unit_address_format +DTC_FLAGS += -Wno-pci_bridge +DTC_FLAGS += -Wno-pci_device_bus_num +DTC_FLAGS += -Wno-pci_device_reg endif
scripts/dtc/Makefile new file +31 -0
@@ -0,0 +1,31 @@ +# scripts/dtc makefile + +hostprogs-y := dtc +always := $(hostprogs-y) + +dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ + srcpos.o checks.o util.o +dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o + +# Source files need to get at the userspace version of libfdt_env.h to compile + +HOSTCFLAGS_DTC := -I$(src) -I$(src)/libfdt + +HOSTCFLAGS_checks.o := $(HOSTCFLAGS_DTC) +HOSTCFLAGS_data.o := $(HOSTCFLAGS_DTC) +HOSTCFLAGS_dtc.o := $(HOSTCFLAGS_DTC) +HOSTCFLAGS_flattree.o := $(HOSTCFLAGS_DTC) +HOSTCFLAGS_fstree.o := $(HOSTCFLAGS_DTC) +HOSTCFLAGS_livetree.o := $(HOSTCFLAGS_DTC) +HOSTCFLAGS_srcpos.o := $(HOSTCFLAGS_DTC) +HOSTCFLAGS_treesource.o := $(HOSTCFLAGS_DTC) +HOSTCFLAGS_util.o := $(HOSTCFLAGS_DTC) + +HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC) +HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC) + +# dependencies on generated files need to be listed explicitly +$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h + +# generated files need to be cleaned explicitly +clean-files := dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h
scripts/dtc/Makefile.dtc new file +18 -0
@@ -0,0 +1,18 @@ +# Makefile.dtc +# +# This is not a complete Makefile of itself. Instead, it is designed to +# be easily embeddable into other systems of Makefiles. +# +DTC_SRCS = \ + checks.c \ + data.c \ + dtc.c \ + flattree.c \ + fstree.c \ + livetree.c \ + srcpos.c \ + treesource.c \ + util.c + +DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c +DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)
scripts/dtc/checks.c new file +849 -0
849 lines not on this page · raw message
scripts/dtc/data.c new file +269 -0
269 lines not on this page · raw message
scripts/dtc/dtc-lexer.l new file +311 -0
311 lines not on this page · raw message
scripts/dtc/dtc-lexer.lex.c_shipped new file +2260 -0
1,484 lines not on this page · raw message
scripts/dtc/dtc-parser.tab.c_shipped new file +2301 -0
2,301 lines not on this page · raw message
scripts/dtc/dtc-parser.tab.h_shipped new file +123 -0
123 lines not on this page · raw message
scripts/dtc/dtc-parser.y new file +519 -0
519 lines not on this page · raw message
scripts/dtc/dtc.c new file +366 -0
366 lines not on this page · raw message
scripts/dtc/dtc.h new file +285 -0
285 lines not on this page · raw message
scripts/dtc/flattree.c new file +946 -0
946 lines not on this page · raw message
scripts/dtc/fstree.c new file +90 -0
90 lines not on this page · raw message
scripts/dtc/libfdt/Makefile.libfdt new file +11 -0
Lines of this file are not shown. View the raw message.
scripts/dtc/libfdt/fdt.c new file +251 -0
251 lines not on this page · raw message
scripts/dtc/libfdt/fdt.h new file +111 -0
111 lines not on this page · raw message
scripts/dtc/libfdt/fdt_empty_tree.c new file +84 -0
84 lines not on this page · raw message
scripts/dtc/libfdt/fdt_ro.c new file +703 -0
703 lines not on this page · raw message
scripts/dtc/libfdt/fdt_rw.c new file +491 -0
491 lines not on this page · raw message
scripts/dtc/libfdt/fdt_strerror.c new file +102 -0
102 lines not on this page · raw message
scripts/dtc/libfdt/fdt_sw.c new file +288 -0
288 lines not on this page · raw message
scripts/dtc/libfdt/fdt_wip.c new file +139 -0
139 lines not on this page · raw message
scripts/dtc/libfdt/libfdt.h new file +1833 -0
1,833 lines not on this page · raw message
scripts/dtc/libfdt/libfdt_env.h new file +112 -0
112 lines not on this page · raw message
scripts/dtc/libfdt/libfdt_internal.h new file +95 -0
95 lines not on this page · raw message
scripts/dtc/livetree.c new file +980 -0
980 lines not on this page · raw message
scripts/dtc/srcpos.c new file +302 -0
302 lines not on this page · raw message
scripts/dtc/srcpos.h new file +118 -0
118 lines not on this page · raw message
scripts/dtc/treesource.c new file +284 -0
284 lines not on this page · raw message
scripts/dtc/update-dtc-source.sh new file +81 -0
81 lines not on this page · raw message
scripts/dtc/util.c new file +473 -0
473 lines not on this page · raw message
scripts/dtc/util.h new file +265 -0
265 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.9.1
Part of the diff is not shown here. View the raw message.
Rob Herring
maintainerPATCH 1/5 scripts/dtc: Update to upstream version v1.4.3
Quoted 4 lines · Tom Rini
Using the
update-dtc-source.shscript from Linux v4.14-rc1 import the portions of dtc that we require. We bring inupdate-dtc-source.shandscripts/dtc/Makefilefrom Linux v4.14-rc1. ReworkDTC_FLAGShandling to not require a test.
You are missing fdt_addresses.c and fdt_overlay.c (which I thought u-boot was dependent on) as the script doesn't automatically add new files. I'm about to send out a script fix.
Rob
PATCH 1/5 scripts/dtc: Update to upstream version v1.4.3
Quoted 9 lines · Rob Herring
Quoted 4 lines · Tom Rini
Using the
update-dtc-source.shscript from Linux v4.14-rc1 import the portions of dtc that we require. We bring inupdate-dtc-source.shandscripts/dtc/Makefilefrom Linux v4.14-rc1. ReworkDTC_FLAGShandling to not require a test.You are missing
fdt_addresses.candfdt_overlay.c(which I thought u-boot was dependent on) as the script doesn't automatically add new files. I'm about to send out a script fix.
We only need 'dtc', and those aren't listed in DTC_OBJS in Makefile.dtc.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171003/a43cff59/attachment.sig>
Rob Herring
maintainerPATCH 1/5 scripts/dtc: Update to upstream version v1.4.3
Quoted 7 lines · Tom Rini
Quoted 6 lines · Rob Herring
Quoted 4 lines · Tom Rini
Using the
update-dtc-source.shscript from Linux v4.14-rc1 import the portions of dtc that we require. We bring inupdate-dtc-source.shandscripts/dtc/Makefilefrom Linux v4.14-rc1. ReworkDTC_FLAGShandling to not require a test.
Quoted 5 lines
Quoted 3 lines
You are missing
fdt_addresses.candfdt_overlay.c(which I thought u-boot was dependent on) as the script doesn't automatically add new files. I'm about to send out a script fix.We only need 'dtc', and those aren't listed in
DTC_OBJSin Makefile.dtc.
So now you have 2 copies of libfdt?
Rob
PATCH 1/5 scripts/dtc: Update to upstream version v1.4.3
Quoted 8 lines · Rob Herring
Quoted 7 lines · Tom Rini
Quoted 6 lines · Rob Herring
Quoted 4 lines · Tom Rini
Using the
update-dtc-source.shscript from Linux v4.14-rc1 import the portions of dtc that we require. We bring inupdate-dtc-source.shandscripts/dtc/Makefilefrom Linux v4.14-rc1. ReworkDTC_FLAGShandling to not require a test.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
You are missing
fdt_addresses.candfdt_overlay.c(which I thought u-boot was dependent on) as the script doesn't automatically add new files. I'm about to send out a script fix.We only need 'dtc', and those aren't listed in
DTC_OBJSin Makefile.dtc.So now you have 2 copies of libfdt?
For the moment. A follow-up is to make sure we can turn those second copies into just #include of the copy we really use.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171003/4ff798ef/attachment.sig>
PATCH 2/5 scripts/dtc: Update to upstream version v1.4.4
In reply to Tom RiniThis adds the following commits from upstream:
558cd81bdd43 dtc: Bump version to v1.4.4c17a811c62eb fdtput: Remove star from value_len documentation 194d5caaefcb fdtget: Use @return to document the return value d922ecdd017b tests: Make realloc_fdt() really allocate *fdt 921cc17fec29 libfdt: overlay: Check the value of the right variable 9ffdf60bf463 dtc: Simplify asm_emit_string() implementation 881012e44386 libfdt: Change names of sparse helper macros bad5b28049e5 Fix assorted sparse warnings672ac09ea04d Clean up gcc attributes49300f2ade6a dtc: Don't abuse struct fdt_reserve_entry
--- scripts/dtc/checks.c | 12 ++---- scripts/dtc/data.c | 16 ++++---- scripts/dtc/dtc-lexer.l | 7 +--- scripts/dtc/dtc-lexer.lex.c_shipped | 81 +++++++++++++++++-------------------- scripts/dtc/dtc.c | 5 +-- scripts/dtc/dtc.h | 5 +-- scripts/dtc/flattree.c | 58 ++++++++++++-------------- scripts/dtc/libfdt/libfdt_env.h | 26 ++++++------ scripts/dtc/livetree.c | 16 ++++---- scripts/dtc/srcpos.h | 11 +++-- scripts/dtc/treesource.c | 6 +-- scripts/dtc/util.c | 11 ++--- scripts/dtc/util.h | 30 +++++++------- scripts/dtc/version_gen.h | 2 +- 14 files changed, 131 insertions(+), 155 deletions(-)
scripts/dtc/checks.c +4 -8
@@ -72,12 +72,8 @@ struct check {#define CHECK (_nm, _fn, _d, ...) \ CHECK_ENTRY(_nm, _fn, _d, false, false, __VA_ARGS__) -#ifdef __GNUC__ -static inline void check_msg (struct check *c,struct dt_info *dti, -const char *fmt, ...) __attribute__((format (printf,3 ,4 ))); -#endif -static inline void check_msg (struct check *c,struct dt_info *dti, -const char *fmt, ...) +static inline void PRINTF(3, 4) check_msg(struct check *c, struct dt_info *dti, + const char *fmt, ...) { va_list ap; va_start(ap, fmt);
@@ -538,13 +534,13 @@ static void fixup_phandle_references(struct check *c, struct dt_info *dti,FAIL (c, dti,"Reference to non-existent node or " "label \"%s\"\n" , m->ref); else/* mark the entry as unresolved */ - *((cell_t *)(prop->val.val + m->offset)) = + *((fdt32_t *)(prop->val.val + m->offset)) =cpu_to_fdt32 (0xffffffff );continue ; } phandle =get_node_phandle (dt, refnode); - *((cell_t *)(prop->val.val + m->offset)) =cpu_to_fdt32 (phandle); + *((fdt32_t *)(prop->val.val + m->offset)) =cpu_to_fdt32 (phandle); } } }
scripts/dtc/data.c +8 -8
@@ -171,9 +171,9 @@ struct data data_merge(struct data d1, struct data d2)struct data data_append_integer (struct data d,uint64_t value,int bits) {uint8_t value_8; -uint16_t value_16; -uint32_t value_32; -uint64_t value_64; +fdt16_t value_16; +fdt32_t value_32; +fdt64_t value_64;switch (bits) {case 8 :
@@ -197,14 +197,14 @@ struct data data_append_integer(struct data d, uint64_t value, int bits) } } -struct data data_append_re (struct data d,const struct fdt_reserve_entry *re) +struct data data_append_re (struct data d,uint64_t address,uint64_t size) { -struct fdt_reserve_entry bere; +struct fdt_reserve_entry re; - bere.address =cpu_to_fdt64 (re->address); - bere.size =cpu_to_fdt64 (re->size); + re.address =cpu_to_fdt64 (address); + re.size =cpu_to_fdt64 (size); -return data_append_data (d, &bere,sizeof (bere)); +return data_append_data (d, &re,sizeof (re)); }struct data data_append_cell (struct data d,cell_t word)
scripts/dtc/dtc-lexer.l +1 -6
@@ -62,12 +62,7 @@ static int dts_version = 1; static void push_input_file(const char *filename); static bool pop_input_file(void); -#ifdef __GNUC__ -static void lexical_error(const char *fmt, ...) - __attribute__((format (printf, 1, 2))); -#else -static void lexical_error(const char *fmt, ...); -#endif +static void PRINTF(1, 2) lexical_error(const char *fmt, ...); %}
scripts/dtc/dtc-lexer.lex.c_shipped +38 -43
275 lines not on this page · raw message
scripts/dtc/dtc.c +2 -3
@@ -138,7 +138,7 @@ static const char *guess_type_by_name(const char *fname, const char *fallback)static const char *guess_input_format (const char *fname,const char *fallback) {struct stat statbuf; -uint32_t magic; +fdt32_t magic;FILE *f;if (stat (fname, &statbuf) !=0 )
@@ -159,8 +159,7 @@ static const char *guess_input_format(const char *fname, const char *fallback) }fclose (f); - magic =fdt32_to_cpu (magic); -if (magic ==FDT_MAGIC ) +if (fdt32_to_cpu (magic) ==FDT_MAGIC )return "dtb" ;return guess_type_by_name (fname, fallback);
scripts/dtc/dtc.h +2 -3
@@ -43,7 +43,6 @@#define debug (...)#endif -#define DEFAULT_FDT_VERSION 17/*
@@ -114,7 +113,7 @@ struct data data_insert_at_marker(struct data d, struct marker *m,struct data data_merge (struct data d1,struct data d2);struct data data_append_cell (struct data d,cell_t word);struct data data_append_integer (struct data d,uint64_t word,int bits); -struct data data_append_re (struct data d,const struct fdt_reserve_entry *re); +struct data data_append_re (struct data d,uint64_t address,uint64_t size);struct data data_append_addr (struct data d,uint64_t addr);struct data data_append_byte (struct data d,uint8_t byte);struct data data_append_zeroes (struct data d,int len);
@@ -227,7 +226,7 @@ uint32_t guess_boot_cpuid(struct node *tree);/* Boot info (tree plus memreserve information */ struct reserve_info { -struct fdt_reserve_entry re; +uint64_t address, size;struct reserve_info *next;
scripts/dtc/flattree.c +26 -32
148 lines not on this page · raw message
scripts/dtc/libfdt/libfdt_env.h +13 -13
@@ -58,16 +58,16 @@#include <string.h> #ifdef __CHECKER__ -#define __force __attribute__((force)) -#define __bitwise __attribute__((bitwise)) +#define FDT_FORCE __attribute__((force)) +#define FDT_BITWISE __attribute__((bitwise))#else -#define __force -#define __bitwise +#define FDT_FORCE +#define FDT_BITWISE #endif -typedef uint16_t __bitwise fdt16_t ; -typedef uint32_t __bitwise fdt32_t ; -typedef uint64_t __bitwise fdt64_t ; +typedef uint16_t FDT_BITWISE fdt16_t; +typedef uint32_t FDT_BITWISE fdt32_t; +typedef uint64_t FDT_BITWISE fdt64_t;#define EXTRACT_BYTE (x, n) ((unsigned long long)((uint8_t *)&x)[n])#define CPU_TO_FDT16 (x) ((EXTRACT_BYTE(x, 0) << 8) | EXTRACT_BYTE(x, 1))
@@ -80,29 +80,29 @@ typedef uint64_t __bitwise fdt64_t;static inline uint16_t fdt16_to_cpu (fdt16_t x) { -return (__force uint16_t )CPU_TO_FDT16 (x); + return (FDT_FORCE uint16_t)CPU_TO_FDT16(x); }static inline fdt16_t cpu_to_fdt16 (uint16_t x) { -return (__force fdt16_t )CPU_TO_FDT16 (x); + return (FDT_FORCE fdt16_t)CPU_TO_FDT16(x); }static inline uint32_t fdt32_to_cpu (fdt32_t x) { -return (__force uint32_t )CPU_TO_FDT32 (x); + return (FDT_FORCE uint32_t)CPU_TO_FDT32(x); }static inline fdt32_t cpu_to_fdt32 (uint32_t x) { -return (__force fdt32_t )CPU_TO_FDT32 (x); + return (FDT_FORCE fdt32_t)CPU_TO_FDT32(x); }static inline uint64_t fdt64_to_cpu (fdt64_t x) { -return (__force uint64_t )CPU_TO_FDT64 (x); + return (FDT_FORCE uint64_t)CPU_TO_FDT64(x); }static inline fdt64_t cpu_to_fdt64 (uint64_t x) { -return (__force fdt64_t )CPU_TO_FDT64 (x); + return (FDT_FORCE fdt64_t)CPU_TO_FDT64(x); }#undef CPU_TO_FDT64#undef CPU_TO_FDT32
scripts/dtc/livetree.c +8 -8
@@ -319,8 +319,8 @@ struct reserve_info *build_reserve_entry(uint64_t address, uint64_t size)memset (new,0 ,sizeof (*new)); - new->re.address = address; - new->re.size = size; + new->address = address; + new->size = size;return new; }
@@ -393,7 +393,7 @@ struct property *get_property(struct node *node, const char *propname)cell_t propval_cell (struct property *prop) {assert (prop->val.len ==sizeof (cell_t)); -return fdt32_to_cpu (*((cell_t *)prop->val.val)); +return fdt32_to_cpu (*((fdt32_t *)prop->val.val)); } struct property *get_property_by_label(struct node *tree, const char *label,
@@ -599,13 +599,13 @@ static int cmp_reserve_info(const void *ax, const void *bx) a = *((const struct reserve_info *const *)ax); b = *((const struct reserve_info *const *)bx); -if (a->re.address < b->re.address) +if (a->address < b->address)return -1 ; -else if (a->re.address > b->re.address) +else if (a->address > b->address)return 1 ; -else if (a->re.size < b->re.size) +else if (a->size < b->size)return -1 ; -else if (a->re.size > b->re.size) +else if (a->size > b->size)return 1 ;else return 0 ;
@@ -902,7 +902,7 @@ static void add_local_fixup_entry(struct dt_info *dti, struct node *refnode) {struct node *wn, *nwn;/* local fixup node, walk node, new */ -uint32_t value_32; +fdt32_t value_32;char **compp;int i, depth;
scripts/dtc/srcpos.h +5 -6
@@ -22,6 +22,7 @@#include <stdio.h> #include <stdbool.h> +#include "util.h" struct srcfile_state {FILE *f;
@@ -106,12 +107,10 @@ extern void srcpos_update(struct srcpos *pos, const char *text, int len);extern struct srcpos *srcpos_copy (struct srcpos *pos);extern char *srcpos_string (struct srcpos *pos); -extern void srcpos_verror (struct srcpos *pos,const char *prefix, -const char *fmt,va_list va) - __attribute__((format (printf,3 ,0 ))); -extern void srcpos_error (struct srcpos *pos,const char *prefix, -const char *fmt, ...) - __attribute__((format (printf,3 ,4 ))); +extern void PRINTF(3, 0) srcpos_verror(struct srcpos *pos, const char *prefix, + const char *fmt, va_list va); +extern void PRINTF(3, 4) srcpos_error(struct srcpos *pos, const char *prefix, + const char *fmt, ...); extern void srcpos_set_line(char *f, int l);
scripts/dtc/treesource.c +3 -3
@@ -137,7 +137,7 @@ static void write_propval_string(FILE *f, struct data val)static void write_propval_cells (FILE *f,struct data val) {void *propend = val.val + val.len; -cell_t *cp = (cell_t *)val.val; +fdt32_t *cp = (fdt32_t *)val.val;struct marker *m = val.markers;fprintf (f,"<" );
@@ -275,8 +275,8 @@ void dt_to_source(FILE *f, struct dt_info *dti)for_each_label (re->labels, l)fprintf (f,"%s: " , l->label);fprintf (f,"/memreserve/\t0x%016llx 0x%016llx;\n" , - (unsigned long long )re->re.address, - (unsigned long long )re->re.size); + (unsigned long long )re->address, + (unsigned long long )re->size); }write_tree_source_node (f, dti->dt,0 );
scripts/dtc/util.c +6 -5
@@ -396,7 +396,7 @@ void utilfdt_print_data(const char *data, int len) }while (s < data + len); }else if ((len %4 ) ==0 ) { -const uint32_t *cell = (const uint32_t *)data; +const fdt32_t *cell = (const fdt32_t *)data;printf (" = <" );for (i =0 , len /=4 ; i < len; i++)
@@ -412,15 +412,16 @@ void utilfdt_print_data(const char *data, int len) } } -void util_version (void ) +void NORETURN util_version(void) {printf ("Version: %s\n" ,DTC_VERSION );exit (0 ); } -void util_usage (const char *errmsg,const char *synopsis, -const char *short_opts,struct option const long_opts[], -const char *const opts_help[]) +void NORETURN util_usage(const char *errmsg, const char *synopsis, +const char *short_opts, +struct option const long_opts[], +const char *const opts_help[]) {FILE *fp = errmsg ? stderr : stdout;const char a_arg[] ="<arg>" ;
scripts/dtc/util.h +14 -16
@@ -25,15 +25,17 @@* USA */ -#define ARRAY_SIZE (x) (sizeof(x) / sizeof((x)[0])) -#ifdef __GNUC__ -static inline void -__attribute__((noreturn)) __attribute__((format (printf,1 ,2 ))) -die(const char *str, ...) +#define PRINTF (i, j) __attribute__((format (printf, i, j))) +#define NORETURN __attribute__((noreturn))#else -static inline void die(const char *str, ...) +#define PRINTF (i, j) +#define NORETURN #endif + +#define ARRAY_SIZE (x) (sizeof(x) / sizeof((x)[0])) + +static inline void NORETURN PRINTF(1, 2) die(const char *str, ...) {va_list ap;
@@ -66,12 +68,7 @@ static inline void *xrealloc(void *p, size_t len)extern char *xstrdup (const char *s); -#ifdef __GNUC__ -extern int __attribute__((format (printf,2 ,3 ))) -xasprintf (char **strp,const char *fmt, ...); -#else -extern int xasprintf (char **strp,const char *fmt, ...); -#endif +extern int PRINTF(2, 3) xasprintf(char **strp, const char *fmt, ...); extern char *join_path(const char *path, const char *name);/**
@@ -200,7 +197,7 @@ void utilfdt_print_data(const char *data, int len);/** * Show source version and exit */ -void util_version (void ) __attribute__((noreturn)); +void NORETURN util_version(void);/** * Show usage and exit
@@ -214,9 +211,10 @@ void util_version(void) __attribute__((noreturn));* @param long_opts The structure of long options * @param opts_help An array of help strings (should align with long_opts) */ -void util_usage (const char *errmsg,const char *synopsis, -const char *short_opts,struct option const long_opts[], -const char *const opts_help[]) __attribute__((noreturn)); +void NORETURN util_usage(const char *errmsg, const char *synopsis, +const char *short_opts, +struct option const long_opts[], +const char *const opts_help[]);/** * Show usage and exit
scripts/dtc/version_gen.h +1 -1
@@ -1 +1 @@ -#define DTC_VERSION "DTC 1.4.3" +#define DTC_VERSION "DTC 1.4.4"
Signature · 1 line
1.9.1
PATCH 3/5 scripts/dtc: Update to upstream version v1.4.4-50-gfe50bd1ecc1d
In reply to Tom RiniThis adds the following commits from upstream:
fe50bd1ecc1d fdtget: Split out cell list display into a new function 62d812308d11 README: Add a note about test_tree1.dts5bed86aee9e8 pylibfdt: Add support for fdt_subnode_offset() 46f31b65b3b3 pylibfdt: Add support for fdt_node_offset_by_phandle() a3ae43723687 pylibfdt: Add support for fdt_parent_offset() a198af80344c pylibfdt: Add support for fdt_get_phandle()b9eba92ea50f tests: Return a failure code when any tests fail 155faf6cc209 pylibfdt: Use local pylibfdt module50e5cd07f325 pylibfdt: Add a test for use of uint32_tab78860f09f5 pylibfdt: Add stdint include to fix uint32_t 36f511fb1113 tests: Add stacked overlay tests on fdtoverlay 1bb00655d3e5 fdt: Allow stacked overlays phandle references a33c2247ac8d Introduce fdt_setprop_placeholder() method0016f8c2aa32 dtc: change default phandles to ePAPR style instead of both e3b9a9588a35 tests: fdtoverlay unit test42409146f2db fdtoverlay: A tool that applies overlaysaae22722fc8d manual: Document missing options13ce6e1c2fc4 dtc: fix sprintf() format string error, again d990b8013889 Makefile: Fix build on MSYS2 and Cygwin51f56dedf8ea Clean up shared library compile/link options 21a2bc896e3d Suppress expected error message in fdtdump test 2a42b14d0d03 dtc: check.c fix compile errora10cb3c818d3 Fix get_node_by_path string equality check548aea2c436a fdtdump: Discourage use of fdtdumpc2258841a785 fdtdump: Fix over-zealous version check9067ee4be0e6 Fix a few whitespace and style nitse56f2b07be38 pylibfdt: Use setup.py to build the swig file 896f1c133265 pylibfdt: Use Makefile constructs to implement NO_PYTHON 90db6d9989ca pylibfdt: Allow setup.py to operate stand-alone e20d9658cd8f Add Coverity Scan supportb04a2cf08862 pylibfdt: Fix code style in setup.py1c5170d3a466 pylibfdt: Rename libfdt.swig to libfdt.i580a9f6c2880 Add a libfdt function to write a property placeholder ab15256d8d02 pylibfdt: Use the call function to simplify the Makefile 9f2e3a3a1f19 pylibfdt: Use the correct libfdt version in the module e91c652af215 pylibfdt: Enable installation of Python module 8a892fd85d94 pylibfdt: Allow building to be disabled741cdff85d3e .travis.yml: Add builds with and without Python library prerequisites 14c4171f4f9a pylibfdt: Use package_dir to set the package directory 89a5062ab231 pylibfdt: Use environment to pass C flags and files 4e0e0d049757 pylibfdt: Allow pkg-config to be supplied in the environment 6afd7d9688f5 Correct typo: s/pylibgfdt/pylibfdt/756ffc4f52f6 Build pylibfdt as part of the normal build process 8cb3896358e9 Adjust libfdt.h to work with swigb40aa8359aff Mention pylibfdt in the documentation12cfb740cc76 Add tests for pylibfdt50f250701631 Add an initial Python library for libfdtcdbb2b6c7a3a checks: Warn on node name unit-addresses with '0x' or leading 0s 4c15d5da17cc checks: Add bus checks for simple-bus buses33c3985226d3 checks: Add bus checks for PCI buses
--- scripts/dtc/checks.c | 231 ++++++++++++++++++++++++++++++++++++ scripts/dtc/dtc.c | 2 +- scripts/dtc/dtc.h | 6 + scripts/dtc/libfdt/fdt_empty_tree.c | 1 - scripts/dtc/libfdt/fdt_ro.c | 4 +- scripts/dtc/libfdt/fdt_rw.c | 24 +++- scripts/dtc/libfdt/fdt_sw.c | 16 ++- scripts/dtc/libfdt/fdt_wip.c | 4 +- scripts/dtc/libfdt/libfdt.h | 68 ++++++++++- scripts/dtc/livetree.c | 3 +- scripts/dtc/version_gen.h | 2 +- 11 files changed, 345 insertions(+), 16 deletions(-)
scripts/dtc/checks.c +231 -0
@@ -681,6 +681,229 @@ static void check_ranges_format(struct check *c, struct dt_info *dti, }WARNING (ranges_format, check_ranges_format,NULL , &addr_size_cells); +static const struct bus_type pci_bus = { + .name ="PCI" , +}; + +static void check_pci_bridge (struct check *c,struct dt_info *dti,struct node *node) +{ +struct property *prop; +cell_t *cells; + + prop =get_property (node,"device_type" ); +if (!prop || !streq (prop->val.val,"pci" )) +return ; + + node->bus = &pci_bus; + +if (!strneq (node->name,"pci" , node->basenamelen) && + !strneq (node->name,"pcie" , node->basenamelen)) +FAIL (c, dti,"Node %s node name is not \"pci\" or \"pcie\"" , + node->fullpath); + + prop =get_property (node,"ranges" ); +if (!prop) +FAIL (c, dti,"Node %s missing ranges for PCI bridge (or not a bridge)" , + node->fullpath); + +if (node_addr_cells (node) !=3 ) +FAIL (c, dti,"Node %s incorrect #address-cells for PCI bridge" , + node->fullpath); +if (node_size_cells (node) !=2 ) +FAIL (c, dti,"Node %s incorrect #size-cells for PCI bridge" , + node->fullpath); + + prop =get_property (node,"bus-range" ); +if (!prop) { +FAIL (c, dti,"Node %s missing bus-range for PCI bridge" , + node->fullpath); +return ; + } +if (prop->val.len != (sizeof (cell_t) *2 )) { +FAIL (c, dti,"Node %s bus-range must be 2 cells" , + node->fullpath); +return ; + } + cells = (cell_t *)prop->val.val; +if (fdt32_to_cpu (cells[0 ]) >fdt32_to_cpu (cells[1 ])) +FAIL (c, dti,"Node %s bus-range 1st cell must be less than or equal to 2nd cell" , + node->fullpath); +if (fdt32_to_cpu (cells[1 ]) >0xff ) +FAIL (c, dti,"Node %s bus-range maximum bus number must be less than 256" , + node->fullpath); +} +WARNING (pci_bridge, check_pci_bridge,NULL , + &device_type_is_string, &addr_size_cells); + +static void check_pci_device_bus_num (struct check *c,struct dt_info *dti,struct node *node) +{ +struct property *prop; +unsigned int bus_num, min_bus, max_bus; +cell_t *cells; + +if (!node->parent || (node->parent->bus != &pci_bus)) +return ; + + prop =get_property (node,"reg" ); +if (!prop) +return ; + + cells = (cell_t *)prop->val.val; + bus_num = (fdt32_to_cpu (cells[0 ]) &0x00ff0000 ) >>16 ; + + prop =get_property (node->parent,"bus-range" ); +if (!prop) { + min_bus = max_bus =0 ; + }else { + cells = (cell_t *)prop->val.val; + min_bus =fdt32_to_cpu (cells[0 ]); + max_bus =fdt32_to_cpu (cells[0 ]); + } +if ((bus_num < min_bus) || (bus_num > max_bus)) +FAIL (c, dti,"Node %s PCI bus number %d out of range, expected (%d - %d)" , + node->fullpath, bus_num, min_bus, max_bus); +} +WARNING (pci_device_bus_num, check_pci_device_bus_num,NULL , ®_format, &pci_bridge); + +static void check_pci_device_reg (struct check *c,struct dt_info *dti,struct node *node) +{ +struct property *prop; +const char *unitname =get_unitname (node); +char unit_addr[5 ]; +unsigned int dev, func, reg; +cell_t *cells; + +if (!node->parent || (node->parent->bus != &pci_bus)) +return ; + + prop =get_property (node,"reg" ); +if (!prop) { +FAIL (c, dti,"Node %s missing PCI reg property" , node->fullpath); +return ; + } + + cells = (cell_t *)prop->val.val; +if (cells[1 ] || cells[2 ]) +FAIL (c, dti,"Node %s PCI reg config space address cells 2 and 3 must be 0" , + node->fullpath); + + reg =fdt32_to_cpu (cells[0 ]); + dev = (reg &0xf800 ) >>11 ; + func = (reg &0x700 ) >>8 ; + +if (reg &0xff000000 ) +FAIL (c, dti,"Node %s PCI reg address is not configuration space" , + node->fullpath); +if (reg &0x000000ff ) +FAIL (c, dti,"Node %s PCI reg config space address register number must be 0" , + node->fullpath); + +if (func ==0 ) { +snprintf (unit_addr,sizeof (unit_addr),"%x" , dev); +if (streq (unitname, unit_addr)) +return ; + } + +snprintf (unit_addr,sizeof (unit_addr),"%x,%x" , dev, func); +if (streq (unitname, unit_addr)) +return ; + +FAIL (c, dti,"Node %s PCI unit address format error, expected \"%s\"" , + node->fullpath, unit_addr); +} +WARNING (pci_device_reg, check_pci_device_reg,NULL , ®_format, &pci_bridge); + +static const struct bus_type simple_bus = { + .name ="simple-bus" , +}; + +static bool node_is_compatible (struct node *node,const char *compat) +{ +struct property *prop; +const char *str, *end; + + prop =get_property (node,"compatible" ); +if (!prop) +return false; + +for (str = prop->val.val, end = str + prop->val.len; str < end; + str +=strnlen (str, end - str) +1 ) { +if (strneq (str, compat, end - str)) +return true; + } +return false; +} + +static void check_simple_bus_bridge (struct check *c,struct dt_info *dti,struct node *node) +{ +if (node_is_compatible (node,"simple-bus" )) + node->bus = &simple_bus; +} +WARNING (simple_bus_bridge, check_simple_bus_bridge,NULL , &addr_size_cells); + +static void check_simple_bus_reg (struct check *c,struct dt_info *dti,struct node *node) +{ +struct property *prop; +const char *unitname =get_unitname (node); +char unit_addr[17 ]; +unsigned int size; +uint64_t reg =0 ; +cell_t *cells =NULL ; + +if (!node->parent || (node->parent->bus != &simple_bus)) +return ; + + prop =get_property (node,"reg" ); +if (prop) + cells = (cell_t *)prop->val.val; +else { + prop =get_property (node,"ranges" ); +if (prop && prop->val.len) +/* skip of child address */ + cells = ((cell_t *)prop->val.val) +node_addr_cells (node); + } + +if (!cells) { +if (node->parent->parent && !(node->bus == &simple_bus)) +FAIL (c, dti,"Node %s missing or empty reg/ranges property" , node->fullpath); +return ; + } + + size =node_addr_cells (node->parent); +while (size--) + reg = (reg <<32 ) |fdt32_to_cpu (*(cells++)); + +snprintf (unit_addr,sizeof (unit_addr),"%" PRIx64, reg); +if (!streq (unitname, unit_addr)) +FAIL (c, dti,"Node %s simple-bus unit address format error, expected \"%s\"" , + node->fullpath, unit_addr); +} +WARNING (simple_bus_reg, check_simple_bus_reg,NULL , ®_format, &simple_bus_bridge); + +static void check_unit_address_format (struct check *c,struct dt_info *dti, +struct node *node) +{ +const char *unitname =get_unitname (node); + +if (node->parent && node->parent->bus) +return ; + +if (!unitname[0 ]) +return ; + +if (!strncmp (unitname,"0x" ,2 )) { +FAIL (c, dti,"Node %s unit name should not have leading \"0x\"" , + node->fullpath); +/* skip over 0x for next test */ + unitname +=2 ; + } +if (unitname[0 ] =='0' &&isxdigit (unitname[1 ])) +FAIL (c, dti,"Node %s unit name should not have leading 0s" , + node->fullpath); +} +WARNING (unit_address_format, check_unit_address_format,NULL , + &node_name_format, &pci_bridge, &simple_bus_bridge); +/* * Style checks */
@@ -752,6 +975,14 @@ static struct check *check_table[] = { &addr_size_cells, ®_format, &ranges_format, &unit_address_vs_reg, + &unit_address_format, + + &pci_bridge, + &pci_device_reg, + &pci_device_bus_num, + + &simple_bus_bridge, + &simple_bus_reg, &avoid_default_addr_size, &obsolete_chosen_interrupt_controller,
scripts/dtc/dtc.c +1 -1
@@ -31,7 +31,7 @@ int reservenum; /* Number of memory reservation slots */int minsize;/* Minimum blob size */ int padsize;/* Additional padding to blob */ int alignsize;/* Additional padding to blob accroding to the alignsize */ -int phandle_format =PHANDLE_BOTH ;/* Use linux,phandle or phandle properties */ +int phandle_format =PHANDLE_EPAPR ;/* Use linux,phandle or phandle properties */ int generate_symbols;/* enable symbols & fixup support */ int generate_fixups;/* suppress generation of fixups on symbol support */ int auto_label_aliases;/* auto generate labels -> aliases */
scripts/dtc/dtc.h +6 -0
@@ -31,6 +31,7 @@#include <ctype.h> #include <errno.h> #include <unistd.h> +#include <inttypes.h> #include <libfdt_env.h> #include <fdt.h>
@@ -135,6 +136,10 @@ struct label {struct label *next; }; +struct bus_type { +const char *name; +}; +struct property {bool deleted;char *name;
@@ -161,6 +166,7 @@ struct node {int addr_cells, size_cells;struct label *labels; +const struct bus_type *bus; };#define for_each_label_withdel (l0, l) \
scripts/dtc/libfdt/fdt_empty_tree.c +0 -1
@@ -81,4 +81,3 @@ int fdt_create_empty_tree(void *buf, int bufsize)return fdt_open_into (buf, buf, bufsize); } -
scripts/dtc/libfdt/fdt_ro.c +2 -2
@@ -60,7 +60,7 @@ static int _fdt_nodename_eq(const void *fdt, int offset, {const char *p =fdt_offset_ptr (fdt, offset +FDT_TAGSIZE , len+1 ); -if (! p) +if (!p)/* short match */ return 0 ;
@@ -327,7 +327,7 @@ const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,const struct fdt_property *prop; prop =fdt_get_property_namelen (fdt, nodeoffset, name, namelen, lenp); -if (! prop) +if (!prop)return NULL ;return prop->data;
scripts/dtc/libfdt/fdt_rw.c +19 -5
@@ -207,7 +207,7 @@ static int _fdt_resize_property(void *fdt, int nodeoffset, const char *name,int err; *prop =fdt_get_property_w (fdt, nodeoffset, name, &oldlen); -if (! (*prop)) +if (!*prop)return oldlen; if ((err = _fdt_splice_struct(fdt, (*prop)->data, FDT_TAGALIGN(oldlen),
@@ -269,8 +269,8 @@ int fdt_set_name(void *fdt, int nodeoffset, const char *name)return 0 ; } -int fdt_setprop (void *fdt,int nodeoffset,const char *name, -const void *val,int len) +int fdt_setprop_placeholder (void *fdt,int nodeoffset,const char *name, +int len,void **prop_data) {struct fdt_property *prop;int err;
@@ -283,8 +283,22 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,if (err)return err; + *prop_data = prop->data; +return 0 ; +} + +int fdt_setprop (void *fdt,int nodeoffset,const char *name, +const void *val,int len) +{ +void *prop_data; +int err; + + err =fdt_setprop_placeholder (fdt, nodeoffset, name, len, &prop_data); +if (err) +return err; +if (len) -memcpy (prop->data, val, len); +memcpy (prop_data, val, len);return 0 ; }
@@ -323,7 +337,7 @@ int fdt_delprop(void *fdt, int nodeoffset, const char *name)FDT_RW_CHECK_HEADER (fdt); prop =fdt_get_property_w (fdt, nodeoffset, name, &len); -if (! prop) +if (!prop)return len; proplen =sizeof (*prop) +FDT_TAGALIGN (len);
scripts/dtc/libfdt/fdt_sw.c +14 -2
@@ -220,7 +220,7 @@ static int _fdt_find_add_string(void *fdt, const char *s)return offset; } -int fdt_property (void *fdt,const char *name,const void *val,int len) +int fdt_property_placeholder (void *fdt,const char *name,int len,void **valp) {struct fdt_property *prop;int nameoff;
@@ -238,7 +238,19 @@ int fdt_property(void *fdt, const char *name, const void *val, int len) prop->tag =cpu_to_fdt32 (FDT_PROP ); prop->nameoff =cpu_to_fdt32 (nameoff); prop->len =cpu_to_fdt32 (len); -memcpy (prop->data, val, len); + *valp = prop->data; +return 0 ; +} + +int fdt_property (void *fdt,const char *name,const void *val,int len) +{ +void *ptr; +int ret; + + ret =fdt_property_placeholder (fdt, name, len, &ptr); +if (ret) +return ret; +memcpy (ptr, val, len);return 0 ; }
scripts/dtc/libfdt/fdt_wip.c +2 -2
@@ -82,7 +82,7 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,int proplen; propval =fdt_getprop (fdt, nodeoffset, name, &proplen); -if (! propval) +if (!propval)return proplen;if (proplen != len)
@@ -107,7 +107,7 @@ int fdt_nop_property(void *fdt, int nodeoffset, const char *name)int len; prop =fdt_get_property_w (fdt, nodeoffset, name, &len); -if (! prop) +if (!prop)return len;_fdt_nop_region (prop, len +sizeof (*prop));
scripts/dtc/libfdt/libfdt.h +67 -1
172 lines not on this page · raw message
scripts/dtc/livetree.c +2 -1
@@ -478,7 +478,8 @@ struct node *get_node_by_path(struct node *tree, const char *path) p =strchr (path,'/' );for_each_child (tree, child) { -if (p &&strneq (path, child->name, p-path)) +if (p && (strlen (child->name) == p-path) && +strneq (path, child->name, p-path))return get_node_by_path (child, p+1 );else if (!p &&streq (path, child->name))return child;
scripts/dtc/version_gen.h +1 -1
@@ -1 +1 @@ -#define DTC_VERSION "DTC 1.4.4" +#define DTC_VERSION "DTC 1.4.4-gfe50bd1e"
Signature · 1 line
1.9.1
PATCH 4/5 dtc: Switch to building and using our own dtc unless provided
In reply to Tom RiniThis makes us act like the Linux Kernel does and allow for dtc to be provided externally but otherwise we use the version of dtc that is included in the sources. This in turn means that we can drop the checkdtc logic. We select DTC in the cases where we will need the dtc tool provided.
--- .travis.yml | 6 ++---- Makefile | 10 ++-------- dts/Kconfig | 4 ++++ scripts/Makefile | 1 + 4 files changed, 9 insertions(+), 12 deletions(-)
.travis.yml +2 -4
@@ -26,11 +26,9 @@ addons: - grub-efi-ia32-bin - rpm2cpio - wget + - device-tree-compiler install: - # install latest device tree compiler - - git clone --depth=1 -b v1.4.3 git://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc - - make -j4 -C /tmp/dtc # Clone uboot-test-hooks - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
@@ -51,7 +49,7 @@ install: env: global: - - PATH=/tmp/dtc:/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin + - PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci - BUILD_DIR=build - HOSTCC="cc"
Makefile +2 -8
@@ -349,7 +349,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump AWK = awk PERL = perl PYTHON ?= python -DTC ?= dtc +DTC ?= $(objtree)/scripts/dtc/dtc CHECK = sparse CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
@@ -872,7 +872,7 @@ endif PHONY += dtbs dtbs: dts/dt.dtb @: -dts/dt.dtb: checkdtc u-boot +dts/dt.dtb: u-boot $(Q)$(MAKE) $(build)=dts dtbs quiet_cmd_copy = COPY $@
@@ -1447,12 +1447,6 @@ SYSTEM_MAP = \ System.map: u-boot @$(call SYSTEM_MAP,$<) > $@ -checkdtc: - @if test $(call dtc-version) -lt 010403; then \ - echo '*** Your dtc is too old, please upgrade to dtc 1.4.3 or newer'; \ - false; \ - fi - ######################################################################### # ARM relocations should all be R_ARM_RELATIVE (32-bit) or
dts/Kconfig +4 -0
@@ -5,11 +5,15 @@ config SUPPORT_OF_CONTROL bool +config DTC + bool + menu "Device Tree Control" depends on SUPPORT_OF_CONTROL config OF_CONTROL bool "Run-time configuration via Device Tree" + select DTC help This feature provides for run-time configuration of U-Boot via a flattened device tree.
scripts/Makefile +1 -0
@@ -21,3 +21,4 @@ build_docproc: $(obj)/docproc # Let clean descend into subdirs subdir- += basic kconfig +subdir-$(CONFIG_DTC) += dtc
Signature · 1 line
1.9.1
PATCH 5/5 tools/mkimage: Make the path to the dtc binary that mkimage calls configurable
In reply to Tom RiniIn some cases, such as FreeBSD, the path to an alternative dtc needs to be used. Rather than override the one given in the Makefile on the command line, make this part of the build configuration.
--- dts/Kconfig | 9 +++++++++ tools/Makefile | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-)
dts/Kconfig +9 -0
@@ -170,3 +170,12 @@ config TPL_OF_PLATDATA information. endmenu + +config MKIMAGE_DTC_PATH + string "Path to dtc binary for use within mkimage" + default "dtc" + help + The mkimage host tool will, in order to generate FIT images make + calls to the dtc application in order to create the output. In + some cases the system dtc may not support all required features + and the path to a different version should be given here.
tools/Makefile +1 -1
@@ -175,7 +175,7 @@ HOSTCFLAGS_rsa-sign.o += -Wno-deprecated-declarations endif endif -HOSTCFLAGS_fit_image.o += -DMKIMAGE_DTC=\"$(DTC)\" +HOSTCFLAGS_fit_image.o += -DMKIMAGE_DTC=\"$(CONFIG_MKIMAGE_DTC_PATH)\" HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage) HOSTLOADLIBES_fit_info := $(HOSTLOADLIBES_mkimage)
Signature · 1 line
1.9.1
cover Follow the Linux Kernel in building dtc as needed
In reply to Tom RiniQuoted 6 lines · Tom Rini
The following series has been applied. I am posting this for the record.
For the record, I do not believe that using git submodules is a good approach here. We have a small amount of code that we need here, and happily we can leverage infrastructur e from the Linux Kernel.
Quoted 6 lines
Speaking of, this is not the first time we have run into problems deviating from the workflow of the kernel. The problems of having large number of warnings, or not stemmed from not just leve raging all of the infrastructure from the kernel. So related, yes, fixes for these warnings should come in, and as always, if they're in the upstream kernel dts as well, they should be fixed there.
So any comments regarding bundling external tools were ignored, even though the discussion was not finished, great.
Furthermore, there was zero time to review this series, it was just applied and posted afterward ? What sort of practice is this ?
Quoted 2 lines
Thanks all.
Signature · 2 lines
Best regards, Marek Vasut
cover Follow the Linux Kernel in building dtc as needed
Quoted 14 lines · Marek Vasut
Quoted 6 lines · Tom Rini
The following series has been applied. I am posting this for the record.
For the record, I do not believe that using git submodules is a good approach here. We have a small amount of code that we need here, and happily we can leverage infrastructur e from the Linux Kernel.
Quoted 6 lines
Speaking of, this is not the first time we have run into problems deviating from the workflow of the kernel. The problems of having large number of warnings, or not stemmed from not just leve raging all of the infrastructure from the kernel. So related, yes, fixes for these warnings should come in, and as always, if they're in the upstream kernel dts as well, they should be fixed there.
Quoted 5 lines
So any comments regarding bundling external tools were ignored, even though the discussion was not finished, great.
Furthermore, there was zero time to review this series, it was just applied and posted afterward ? What sort of practice is this ?
Yes. I put on my slightly-less-than-benevolent dictator hat today, and explained my reasoning. I do feel bad that you're rather unhappy with the overall situation, but no, I believe this is the right answer.
Now, there's some follow up further re-syncing with the kernel that could be done (scripts/Makefile.lib/extrawarn can be further re-matched up with the kernel now, but that would have made a larger delta than "just migrate to providing the tool").
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170924/3a82e835/attachment.sig>
cover Follow the Linux Kernel in building dtc as needed
Hi Tom,
Quoted 15 lines · Marek Vasut
Quoted 14 lines · Tom Rini
Quoted 12 lines
The following series has been applied. I am posting this for the record.
For the record, I do not believe that using git submodules is a good approach here. We have a small amount of code that we need here, and happily we can leverage infrastructur e from the Linux Kernel.
Speaking of, this is not the first time we have run into problems deviating from the workflow of the kernel. The problems of having large number of warnings, or not stemmed from not just leve raging all of the infrastructure from the kernel. So related, yes, fixes for these warnings should come in, and as always, if they're in the upstream kernel dts as well, they should be fixed there.
Quoted 7 lines
Quoted 5 lines
So any comments regarding bundling external tools were ignored, even though the discussion was not finished, great.
Furthermore, there was zero time to review this series, it was just applied and posted afterward ? What sort of practice is this ?
Yes. I put on my slightly-less-than-benevolent dictator hat today, and
Linus style? :D Management
Quoted 8 lines
explained my reasoning. I do feel bad that you're rather unhappy with the overall situation, but no, I believe this is the right answer.
Now, there's some follow up further re-syncing with the kernel that could be done (
scripts/Makefile.lib/extrawarncan be further re-matched up with the kernel now, but that would have made a larger delta than "just migrate to providing the tool").
But seriously, do we have some kind of road map for this?
I mean if we have copied the dtc tool into u-boot temporarily (until distros catch up) or will it stay with us forever ?
Signature · 9 lines
Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
cover Follow the Linux Kernel in building dtc as needed
Quoted 20 lines · Å�ukasz Majewski
Hi Tom,
Quoted 18 lines · Marek Vasut
Quoted 17 lines · Tom Rini
Quoted 6 lines
The following series has been applied. I am posting this for the record.
For the record, I do not believe that using git submodules is a good approach here. We have a small amount of code that we need here, and happily we can leverage infrastructur e from the Linux Kernel.
Quoted 6 lines
Speaking of, this is not the first time we have run into problems deviating from the workflow of the kernel. The problems of having large number of warnings, or not stemmed from not just leve raging all of the infrastructure from the kernel. So related, yes, fixes for these warnings should come in, and as always, if they're in the upstream kernel dts as well, they should be fixed there.
So any comments regarding bundling external tools were ignored, even though the discussion was not finished, great.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Furthermore, there was zero time to review this series, it was just applied and posted afterward ? What sort of practice is this ?
Yes. I put on my slightly-less-than-benevolent dictator hat today, and
Linus style? :D Management
It is not my general preference, but yes.
Quoted 8 lines
Quoted 7 lines
explained my reasoning. I do feel bad that you're rather unhappy with the overall situation, but no, I believe this is the right answer.
Now, there's some follow up further re-syncing with the kernel that could be done (
scripts/Makefile.lib/extrawarncan be further re-matched up with the kernel now, but that would have made a larger delta than "just migrate to providing the tool").
Quoted 4 lines
But seriously, do we have some kind of road map for this?
I mean if we have copied the dtc tool into u-boot temporarily (until distros catch up) or will it stay with us forever ?
I think long term we'll match what the kernel does and keep synced with upstream, just what we need. I'm thinking I ought to see about pushing a re-sync in the kernel for the next -rc1 there as I know it has been lamented that it hasn't happened in a bit.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170924/d9b0cc08/attachment.sig>
cover Follow the Linux Kernel in building dtc as needed
In reply to Tom RiniQuoted 18 lines · Tom Rini
Quoted 17 lines · Marek Vasut
Quoted 6 lines · Tom Rini
The following series has been applied. I am posting this for the record.
For the record, I do not believe that using git submodules is a good approach here. We have a small amount of code that we need here, and happily we can leverage infrastructur e from the Linux Kernel.
Quoted 6 lines
Speaking of, this is not the first time we have run into problems deviating from the workflow of the kernel. The problems of having large number of warnings, or not stemmed from not just leve raging all of the infrastructure from the kernel. So related, yes, fixes for these warnings should come in, and as always, if they're in the upstream kernel dts as well, they should be fixed there.
So any comments regarding bundling external tools were ignored, even though the discussion was not finished, great.
Quoted 6 lines
Quoted 2 lines
Furthermore, there was zero time to review this series, it was just applied and posted afterward ? What sort of practice is this ?
Yes. I put on my slightly-less-than-benevolent dictator hat today, and explained my reasoning. I do feel bad that you're rather unhappy with the overall situation, but no, I believe this is the right answer.
I believe we have a well-established process of submitting patches, getting a review and then applying them. If the head maintainer doesn't follow the process, why should anyone else ?
I believe you should be an example of doing it right, but what you did here is the exact opposite.
The discussion how to solve this problem properly was also unfinished, yet a decision was taken without any community agreement. What is the point of discussing anything on the ML if the decision gets ignored ?
Quoted 5 lines
Now, there's some follow up further re-syncing with the kernel that could be done (
scripts/Makefile.lib/extrawarncan be further re-matched up with the kernel now, but that would have made a larger delta than "just migrate to providing the tool").
Signature · 2 lines
Best regards, Marek Vasut
cover Follow the Linux Kernel in building dtc as needed
In reply to Tom RiniDear Tom,
Quoted 2 lines · In message <[email protected]> you wrote:
The following series has been applied. I am posting this for the record.
Argghhh... This is not the way things should be done.
I am definitely unhappy here - not so much about the patches, but about the procedure.
Even as a maintainer you are supposed to post the patches first. And then _wait_ and give people a chance to review the patches. And then decide based on the review results.
Shortcutting an ongoing discussion with such a "management decision" does not match my understanding of how U-Boot development takes place. Accepting unreviewed patches because of the powers of a custodian/maintainer is IMO a strict no-go.
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de If I had to live my life again, I'd make the same mistakes, only sooner. -- Tallulah Bankhead
cover REVERT Follow the Linux Kernel in building dtc as needed
In reply to Tom RiniThis patch series reverts some patches that should never have been merged into mainline at all:
- They were applied in violation of the well established rule that ALL patches must be posted on the mailing list before, and given enough time for review by the community.
- Obviously, these patches have not been Acked-by: by anybody.
- They implement a solution that probably does not represent the majority of the developers who discussed this issue. They were applied cutting short the ongoing discussion, without giving a good, comprehensible reason. Alternative solutions were presented before, but this patch series ignores them.
U-Boot is a community project with an established and documented development process. No single person, not even a custodian or maintainer, shall have the power to push through any changes without or against the consent of the community. If we want to maintain these standards, we cannot accept this. We therefore have only one
choice: revert these patches now, and let them undergo the necessary review process on the mailing list, allowing for the usual grace period of two weeks. Sorry.
Wolfgang Denk (5):
Revert "tools/mkimage: Make the path to the dtc binary that mkimage
calls configurable"
Revert "dtc: Switch to building and using our own dtc unless provided" Revert "scripts/dtc: Update to upstream version
v1.4.4-50-gfe50bd1ecc1d"
Revert "scripts/dtc: Update to upstream version v1.4.4" Revert "scripts/dtc: Update to upstream version v1.4.3"
.travis.yml | 6 +- Makefile | 10 +- dts/Kconfig | 13 - scripts/Kbuild.include | 5 + scripts/Makefile | 1 - scripts/Makefile.extrawarn | 16 +- scripts/dtc/Makefile | 31 - scripts/dtc/Makefile.dtc | 18 - scripts/dtc/checks.c | 1076 ---------------- scripts/dtc/data.c | 269 ---- scripts/dtc/dtc-lexer.l | 306 ----- scripts/dtc/dtc-lexer.lex.c_shipped | 2255 --------------------------------- scripts/dtc/dtc-parser.tab.c_shipped | 2301 ---------------------------------- scripts/dtc/dtc-parser.tab.h_shipped | 123 -- scripts/dtc/dtc-parser.y | 519 -------- scripts/dtc/dtc.c | 365 ------ scripts/dtc/dtc.h | 290 ----- scripts/dtc/flattree.c | 940 -------------- scripts/dtc/fstree.c | 90 -- scripts/dtc/libfdt/Makefile.libfdt | 11 - scripts/dtc/libfdt/fdt.c | 251 ---- scripts/dtc/libfdt/fdt.h | 111 -- scripts/dtc/libfdt/fdt_empty_tree.c | 83 -- scripts/dtc/libfdt/fdt_ro.c | 703 ----------- scripts/dtc/libfdt/fdt_rw.c | 505 -------- scripts/dtc/libfdt/fdt_strerror.c | 102 -- scripts/dtc/libfdt/fdt_sw.c | 300 ----- scripts/dtc/libfdt/fdt_wip.c | 139 -- scripts/dtc/libfdt/libfdt.h | 1899 ---------------------------- scripts/dtc/libfdt/libfdt_env.h | 112 -- scripts/dtc/libfdt/libfdt_internal.h | 95 -- scripts/dtc/livetree.c | 981 --------------- scripts/dtc/srcpos.c | 302 ----- scripts/dtc/srcpos.h | 117 -- scripts/dtc/treesource.c | 284 ----- scripts/dtc/update-dtc-source.sh | 81 -- scripts/dtc/util.c | 474 ------- scripts/dtc/util.h | 263 ---- scripts/dtc/version_gen.h | 1 - tools/Makefile | 2 +- 40 files changed, 26 insertions(+), 15424 deletions(-) delete mode 100644 scripts/dtc/Makefile delete mode 100644 scripts/dtc/Makefile.dtc delete mode 100644 scripts/dtc/checks.c delete mode 100644 scripts/dtc/data.c delete mode 100644 scripts/dtc/dtc-lexer.l delete mode 100644 scripts/dtc/dtc-lexer.lex.c_shipped delete mode 100644 scripts/dtc/dtc-parser.tab.c_shipped delete mode 100644 scripts/dtc/dtc-parser.tab.h_shipped delete mode 100644 scripts/dtc/dtc-parser.y delete mode 100644 scripts/dtc/dtc.c delete mode 100644 scripts/dtc/dtc.h delete mode 100644 scripts/dtc/flattree.c delete mode 100644 scripts/dtc/fstree.c delete mode 100644 scripts/dtc/libfdt/Makefile.libfdt delete mode 100644 scripts/dtc/libfdt/fdt.c delete mode 100644 scripts/dtc/libfdt/fdt.h delete mode 100644 scripts/dtc/libfdt/fdt_empty_tree.c delete mode 100644 scripts/dtc/libfdt/fdt_ro.c delete mode 100644 scripts/dtc/libfdt/fdt_rw.c delete mode 100644 scripts/dtc/libfdt/fdt_strerror.c delete mode 100644 scripts/dtc/libfdt/fdt_sw.c delete mode 100644 scripts/dtc/libfdt/fdt_wip.c delete mode 100644 scripts/dtc/libfdt/libfdt.h delete mode 100644 scripts/dtc/libfdt/libfdt_env.h delete mode 100644 scripts/dtc/libfdt/libfdt_internal.h delete mode 100644 scripts/dtc/livetree.c delete mode 100644 scripts/dtc/srcpos.c delete mode 100644 scripts/dtc/srcpos.h delete mode 100644 scripts/dtc/treesource.c delete mode 100755 scripts/dtc/update-dtc-source.sh delete mode 100644 scripts/dtc/util.c delete mode 100644 scripts/dtc/util.h delete mode 100644 scripts/dtc/version_gen.h
Signature · 1 line
2.13.3
PATCH 1/5 Revert "tools/mkimage: Make the path to the dtc binary that mkimage calls configurable"
This reverts commit 1f6049e2501b5c35c61435dbc05ba96743202674.
This patch is part of a series which has never been reviewed and has not been generally accepted by the community.
--- dts/Kconfig | 9 --------- tools/Makefile | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-)
dts/Kconfig +0 -9
@@ -170,12 +170,3 @@ config TPL_OF_PLATDATA information. endmenu - -config MKIMAGE_DTC_PATH - string "Path to dtc binary for use within mkimage" - default "dtc" - help - The mkimage host tool will, in order to generate FIT images make - calls to the dtc application in order to create the output. In - some cases the system dtc may not support all required features - and the path to a different version should be given here.
tools/Makefile +1 -1
@@ -175,7 +175,7 @@ HOSTCFLAGS_rsa-sign.o += -Wno-deprecated-declarations endif endif -HOSTCFLAGS_fit_image.o += -DMKIMAGE_DTC=\"$(CONFIG_MKIMAGE_DTC_PATH)\" +HOSTCFLAGS_fit_image.o += -DMKIMAGE_DTC=\"$(DTC)\" HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage) HOSTLOADLIBES_fit_info := $(HOSTLOADLIBES_mkimage)
Signature · 1 line
2.13.3
PATCH 2/5 Revert "dtc: Switch to building and using our own dtc unless provided"
In reply to Wolfgang DenkThis reverts commit 36dd5f1b8abcd0aa5f8490b3ef1e4e7ecce2eb8c.
This patch is part of a series which has never been reviewed and has not been generally accepted by the community.
--- .travis.yml | 6 ++++-- Makefile | 10 ++++++++-- dts/Kconfig | 4 ---- scripts/Makefile | 1 - 4 files changed, 12 insertions(+), 9 deletions(-)
.travis.yml +4 -2
@@ -26,9 +26,11 @@ addons: - grub-efi-ia32-bin - rpm2cpio - wget - - device-tree-compiler install: + # install latest device tree compiler + - git clone --depth=1 -b v1.4.3 git://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc + - make -j4 -C /tmp/dtc # Clone uboot-test-hooks - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
@@ -49,7 +51,7 @@ install: env: global: - - PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin + - PATH=/tmp/dtc:/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci - BUILD_DIR=build - HOSTCC="cc"
Makefile +8 -2
@@ -349,7 +349,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump AWK = awk PERL = perl PYTHON ?= python -DTC ?= $(objtree)/scripts/dtc/dtc +DTC ?= dtc CHECK = sparse CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
@@ -872,7 +872,7 @@ endif PHONY += dtbs dtbs: dts/dt.dtb @: -dts/dt.dtb: u-boot +dts/dt.dtb: checkdtc u-boot $(Q)$(MAKE) $(build)=dts dtbs quiet_cmd_copy = COPY $@
@@ -1447,6 +1447,12 @@ SYSTEM_MAP = \ System.map: u-boot @$(call SYSTEM_MAP,$<) > $@ +checkdtc: + @if test $(call dtc-version) -lt 010403; then \ + echo '*** Your dtc is too old, please upgrade to dtc 1.4.3 or newer'; \ + false; \ + fi + ######################################################################### # ARM relocations should all be R_ARM_RELATIVE (32-bit) or
dts/Kconfig +0 -4
@@ -5,15 +5,11 @@ config SUPPORT_OF_CONTROL bool -config DTC - bool - menu "Device Tree Control" depends on SUPPORT_OF_CONTROL config OF_CONTROL bool "Run-time configuration via Device Tree" - select DTC help This feature provides for run-time configuration of U-Boot via a flattened device tree.
scripts/Makefile +0 -1
@@ -21,4 +21,3 @@ build_docproc: $(obj)/docproc # Let clean descend into subdirs subdir- += basic kconfig -subdir-$(CONFIG_DTC) += dtc
Signature · 1 line
2.13.3
PATCH 3/5 Revert "scripts/dtc: Update to upstream version v1.4.4-50-gfe50bd1ecc1d"
In reply to Wolfgang DenkThis reverts commit 2d4c2259930b91fe5e7a2f92db32c03fe640ed60.
This patch is part of a series which has never been reviewed and has not been generally accepted by the community.
--- scripts/dtc/checks.c | 231 ------------------------------------ scripts/dtc/dtc.c | 2 +- scripts/dtc/dtc.h | 6 - scripts/dtc/libfdt/fdt_empty_tree.c | 1 + scripts/dtc/libfdt/fdt_ro.c | 4 +- scripts/dtc/libfdt/fdt_rw.c | 24 +--- scripts/dtc/libfdt/fdt_sw.c | 16 +-- scripts/dtc/libfdt/fdt_wip.c | 4 +- scripts/dtc/libfdt/libfdt.h | 68 +---------- scripts/dtc/livetree.c | 3 +- scripts/dtc/version_gen.h | 2 +- 11 files changed, 16 insertions(+), 345 deletions(-)
scripts/dtc/checks.c +0 -231
@@ -681,229 +681,6 @@ static void check_ranges_format(struct check *c, struct dt_info *dti, }WARNING (ranges_format, check_ranges_format,NULL , &addr_size_cells); -static const struct bus_type pci_bus = { - .name ="PCI" , -}; - -static void check_pci_bridge (struct check *c,struct dt_info *dti,struct node *node) -{ -struct property *prop; -cell_t *cells; - - prop =get_property (node,"device_type" ); -if (!prop || !streq (prop->val.val,"pci" )) -return ; - - node->bus = &pci_bus; - -if (!strneq (node->name,"pci" , node->basenamelen) && - !strneq (node->name,"pcie" , node->basenamelen)) -FAIL (c, dti,"Node %s node name is not \"pci\" or \"pcie\"" , - node->fullpath); - - prop =get_property (node,"ranges" ); -if (!prop) -FAIL (c, dti,"Node %s missing ranges for PCI bridge (or not a bridge)" , - node->fullpath); - -if (node_addr_cells (node) !=3 ) -FAIL (c, dti,"Node %s incorrect #address-cells for PCI bridge" , - node->fullpath); -if (node_size_cells (node) !=2 ) -FAIL (c, dti,"Node %s incorrect #size-cells for PCI bridge" , - node->fullpath); - - prop =get_property (node,"bus-range" ); -if (!prop) { -FAIL (c, dti,"Node %s missing bus-range for PCI bridge" , - node->fullpath); -return ; - } -if (prop->val.len != (sizeof (cell_t) *2 )) { -FAIL (c, dti,"Node %s bus-range must be 2 cells" , - node->fullpath); -return ; - } - cells = (cell_t *)prop->val.val; -if (fdt32_to_cpu (cells[0 ]) >fdt32_to_cpu (cells[1 ])) -FAIL (c, dti,"Node %s bus-range 1st cell must be less than or equal to 2nd cell" , - node->fullpath); -if (fdt32_to_cpu (cells[1 ]) >0xff ) -FAIL (c, dti,"Node %s bus-range maximum bus number must be less than 256" , - node->fullpath); -} -WARNING (pci_bridge, check_pci_bridge,NULL , - &device_type_is_string, &addr_size_cells); - -static void check_pci_device_bus_num (struct check *c,struct dt_info *dti,struct node *node) -{ -struct property *prop; -unsigned int bus_num, min_bus, max_bus; -cell_t *cells; - -if (!node->parent || (node->parent->bus != &pci_bus)) -return ; - - prop =get_property (node,"reg" ); -if (!prop) -return ; - - cells = (cell_t *)prop->val.val; - bus_num = (fdt32_to_cpu (cells[0 ]) &0x00ff0000 ) >>16 ; - - prop =get_property (node->parent,"bus-range" ); -if (!prop) { - min_bus = max_bus =0 ; - }else { - cells = (cell_t *)prop->val.val; - min_bus =fdt32_to_cpu (cells[0 ]); - max_bus =fdt32_to_cpu (cells[0 ]); - } -if ((bus_num < min_bus) || (bus_num > max_bus)) -FAIL (c, dti,"Node %s PCI bus number %d out of range, expected (%d - %d)" , - node->fullpath, bus_num, min_bus, max_bus); -} -WARNING (pci_device_bus_num, check_pci_device_bus_num,NULL , ®_format, &pci_bridge); - -static void check_pci_device_reg (struct check *c,struct dt_info *dti,struct node *node) -{ -struct property *prop; -const char *unitname =get_unitname (node); -char unit_addr[5 ]; -unsigned int dev, func, reg; -cell_t *cells; - -if (!node->parent || (node->parent->bus != &pci_bus)) -return ; - - prop =get_property (node,"reg" ); -if (!prop) { -FAIL (c, dti,"Node %s missing PCI reg property" , node->fullpath); -return ; - } - - cells = (cell_t *)prop->val.val; -if (cells[1 ] || cells[2 ]) -FAIL (c, dti,"Node %s PCI reg config space address cells 2 and 3 must be 0" , - node->fullpath); - - reg =fdt32_to_cpu (cells[0 ]); - dev = (reg &0xf800 ) >>11 ; - func = (reg &0x700 ) >>8 ; - -if (reg &0xff000000 ) -FAIL (c, dti,"Node %s PCI reg address is not configuration space" , - node->fullpath); -if (reg &0x000000ff ) -FAIL (c, dti,"Node %s PCI reg config space address register number must be 0" , - node->fullpath); - -if (func ==0 ) { -snprintf (unit_addr,sizeof (unit_addr),"%x" , dev); -if (streq (unitname, unit_addr)) -return ; - } - -snprintf (unit_addr,sizeof (unit_addr),"%x,%x" , dev, func); -if (streq (unitname, unit_addr)) -return ; - -FAIL (c, dti,"Node %s PCI unit address format error, expected \"%s\"" , - node->fullpath, unit_addr); -} -WARNING (pci_device_reg, check_pci_device_reg,NULL , ®_format, &pci_bridge); - -static const struct bus_type simple_bus = { - .name ="simple-bus" , -}; - -static bool node_is_compatible (struct node *node,const char *compat) -{ -struct property *prop; -const char *str, *end; - - prop =get_property (node,"compatible" ); -if (!prop) -return false; - -for (str = prop->val.val, end = str + prop->val.len; str < end; - str +=strnlen (str, end - str) +1 ) { -if (strneq (str, compat, end - str)) -return true; - } -return false; -} - -static void check_simple_bus_bridge (struct check *c,struct dt_info *dti,struct node *node) -{ -if (node_is_compatible (node,"simple-bus" )) - node->bus = &simple_bus; -} -WARNING (simple_bus_bridge, check_simple_bus_bridge,NULL , &addr_size_cells); - -static void check_simple_bus_reg (struct check *c,struct dt_info *dti,struct node *node) -{ -struct property *prop; -const char *unitname =get_unitname (node); -char unit_addr[17 ]; -unsigned int size; -uint64_t reg =0 ; -cell_t *cells =NULL ; - -if (!node->parent || (node->parent->bus != &simple_bus)) -return ; - - prop =get_property (node,"reg" ); -if (prop) - cells = (cell_t *)prop->val.val; -else { - prop =get_property (node,"ranges" ); -if (prop && prop->val.len) -/* skip of child address */ - cells = ((cell_t *)prop->val.val) +node_addr_cells (node); - } - -if (!cells) { -if (node->parent->parent && !(node->bus == &simple_bus)) -FAIL (c, dti,"Node %s missing or empty reg/ranges property" , node->fullpath); -return ; - } - - size =node_addr_cells (node->parent); -while (size--) - reg = (reg <<32 ) |fdt32_to_cpu (*(cells++)); - -snprintf (unit_addr,sizeof (unit_addr),"%" PRIx64, reg); -if (!streq (unitname, unit_addr)) -FAIL (c, dti,"Node %s simple-bus unit address format error, expected \"%s\"" , - node->fullpath, unit_addr); -} -WARNING (simple_bus_reg, check_simple_bus_reg,NULL , ®_format, &simple_bus_bridge); - -static void check_unit_address_format (struct check *c,struct dt_info *dti, -struct node *node) -{ -const char *unitname =get_unitname (node); - -if (node->parent && node->parent->bus) -return ; - -if (!unitname[0 ]) -return ; - -if (!strncmp (unitname,"0x" ,2 )) { -FAIL (c, dti,"Node %s unit name should not have leading \"0x\"" , - node->fullpath); -/* skip over 0x for next test */ - unitname +=2 ; - } -if (unitname[0 ] =='0' &&isxdigit (unitname[1 ])) -FAIL (c, dti,"Node %s unit name should not have leading 0s" , - node->fullpath); -} -WARNING (unit_address_format, check_unit_address_format,NULL , - &node_name_format, &pci_bridge, &simple_bus_bridge); -/* * Style checks */
@@ -975,14 +752,6 @@ static struct check *check_table[] = { &addr_size_cells, ®_format, &ranges_format, &unit_address_vs_reg, - &unit_address_format, - - &pci_bridge, - &pci_device_reg, - &pci_device_bus_num, - - &simple_bus_bridge, - &simple_bus_reg, &avoid_default_addr_size, &obsolete_chosen_interrupt_controller,
scripts/dtc/dtc.c +1 -1
@@ -31,7 +31,7 @@ int reservenum; /* Number of memory reservation slots */int minsize;/* Minimum blob size */ int padsize;/* Additional padding to blob */ int alignsize;/* Additional padding to blob accroding to the alignsize */ -int phandle_format =PHANDLE_EPAPR ;/* Use linux,phandle or phandle properties */ +int phandle_format =PHANDLE_BOTH ;/* Use linux,phandle or phandle properties */ int generate_symbols;/* enable symbols & fixup support */ int generate_fixups;/* suppress generation of fixups on symbol support */ int auto_label_aliases;/* auto generate labels -> aliases */
scripts/dtc/dtc.h +0 -6
@@ -31,7 +31,6 @@#include <ctype.h> #include <errno.h> #include <unistd.h> -#include <inttypes.h> #include <libfdt_env.h> #include <fdt.h>
@@ -136,10 +135,6 @@ struct label {struct label *next; }; -struct bus_type { -const char *name; -}; -struct property {bool deleted;char *name;
@@ -166,7 +161,6 @@ struct node {int addr_cells, size_cells;struct label *labels; -const struct bus_type *bus; };#define for_each_label_withdel (l0, l) \
scripts/dtc/libfdt/fdt_empty_tree.c +1 -0
@@ -81,3 +81,4 @@ int fdt_create_empty_tree(void *buf, int bufsize)return fdt_open_into (buf, buf, bufsize); } +
scripts/dtc/libfdt/fdt_ro.c +2 -2
@@ -60,7 +60,7 @@ static int _fdt_nodename_eq(const void *fdt, int offset, {const char *p =fdt_offset_ptr (fdt, offset +FDT_TAGSIZE , len+1 ); -if (!p) +if (! p)/* short match */ return 0 ;
@@ -327,7 +327,7 @@ const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,const struct fdt_property *prop; prop =fdt_get_property_namelen (fdt, nodeoffset, name, namelen, lenp); -if (!prop) +if (! prop)return NULL ;return prop->data;
scripts/dtc/libfdt/fdt_rw.c +5 -19
@@ -207,7 +207,7 @@ static int _fdt_resize_property(void *fdt, int nodeoffset, const char *name,int err; *prop =fdt_get_property_w (fdt, nodeoffset, name, &oldlen); -if (!*prop) +if (! (*prop))return oldlen; if ((err = _fdt_splice_struct(fdt, (*prop)->data, FDT_TAGALIGN(oldlen),
@@ -269,8 +269,8 @@ int fdt_set_name(void *fdt, int nodeoffset, const char *name)return 0 ; } -int fdt_setprop_placeholder (void *fdt,int nodeoffset,const char *name, -int len,void **prop_data) +int fdt_setprop (void *fdt,int nodeoffset,const char *name, +const void *val,int len) {struct fdt_property *prop;int err;
@@ -283,22 +283,8 @@ int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,if (err)return err; - *prop_data = prop->data; -return 0 ; -} - -int fdt_setprop (void *fdt,int nodeoffset,const char *name, -const void *val,int len) -{ -void *prop_data; -int err; - - err =fdt_setprop_placeholder (fdt, nodeoffset, name, len, &prop_data); -if (err) -return err; -if (len) -memcpy (prop_data, val, len); +memcpy (prop->data, val, len);return 0 ; }
@@ -337,7 +323,7 @@ int fdt_delprop(void *fdt, int nodeoffset, const char *name)FDT_RW_CHECK_HEADER (fdt); prop =fdt_get_property_w (fdt, nodeoffset, name, &len); -if (!prop) +if (! prop)return len; proplen =sizeof (*prop) +FDT_TAGALIGN (len);
scripts/dtc/libfdt/fdt_sw.c +2 -14
@@ -220,7 +220,7 @@ static int _fdt_find_add_string(void *fdt, const char *s)return offset; } -int fdt_property_placeholder (void *fdt,const char *name,int len,void **valp) +int fdt_property (void *fdt,const char *name,const void *val,int len) {struct fdt_property *prop;int nameoff;
@@ -238,19 +238,7 @@ int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp) prop->tag =cpu_to_fdt32 (FDT_PROP ); prop->nameoff =cpu_to_fdt32 (nameoff); prop->len =cpu_to_fdt32 (len); - *valp = prop->data; -return 0 ; -} - -int fdt_property (void *fdt,const char *name,const void *val,int len) -{ -void *ptr; -int ret; - - ret =fdt_property_placeholder (fdt, name, len, &ptr); -if (ret) -return ret; -memcpy (ptr, val, len); +memcpy (prop->data, val, len);return 0 ; }
scripts/dtc/libfdt/fdt_wip.c +2 -2
@@ -82,7 +82,7 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,int proplen; propval =fdt_getprop (fdt, nodeoffset, name, &proplen); -if (!propval) +if (! propval)return proplen;if (proplen != len)
@@ -107,7 +107,7 @@ int fdt_nop_property(void *fdt, int nodeoffset, const char *name)int len; prop =fdt_get_property_w (fdt, nodeoffset, name, &len); -if (!prop) +if (! prop)return len;_fdt_nop_region (prop, len +sizeof (*prop));
scripts/dtc/libfdt/libfdt.h +1 -67
172 lines not on this page · raw message
scripts/dtc/livetree.c +1 -2
@@ -478,8 +478,7 @@ struct node *get_node_by_path(struct node *tree, const char *path) p =strchr (path,'/' );for_each_child (tree, child) { -if (p && (strlen (child->name) == p-path) && -strneq (path, child->name, p-path)) +if (p &&strneq (path, child->name, p-path))return get_node_by_path (child, p+1 );else if (!p &&streq (path, child->name))return child;
scripts/dtc/version_gen.h +1 -1
@@ -1 +1 @@ -#define DTC_VERSION "DTC 1.4.4-gfe50bd1e" +#define DTC_VERSION "DTC 1.4.4"
Signature · 1 line
2.13.3
PATCH 4/5 Revert "scripts/dtc: Update to upstream version v1.4.4"
In reply to Wolfgang DenkThis reverts commit d6fc90ced42e9fb77185cedfe45d0a2c7ac78508.
This patch is part of a series which has never been reviewed and has not been generally accepted by the community.
--- scripts/dtc/checks.c | 12 ++++-- scripts/dtc/data.c | 16 ++++---- scripts/dtc/dtc-lexer.l | 7 +++- scripts/dtc/dtc-lexer.lex.c_shipped | 81 ++++++++++++++++++++----------------- scripts/dtc/dtc.c | 5 ++- scripts/dtc/dtc.h | 5 ++- scripts/dtc/flattree.c | 58 ++++++++++++++------------ scripts/dtc/libfdt/libfdt_env.h | 26 ++++++------ scripts/dtc/livetree.c | 16 ++++---- scripts/dtc/srcpos.h | 11 ++--- scripts/dtc/treesource.c | 6 +-- scripts/dtc/util.c | 11 +++-- scripts/dtc/util.h | 30 +++++++------- scripts/dtc/version_gen.h | 2 +- 14 files changed, 155 insertions(+), 131 deletions(-)
scripts/dtc/checks.c +8 -4
@@ -72,8 +72,12 @@ struct check {#define CHECK (_nm, _fn, _d, ...) \ CHECK_ENTRY(_nm, _fn, _d, false, false, __VA_ARGS__) -static inline void PRINTF(3, 4) check_msg(struct check *c, struct dt_info *dti, - const char *fmt, ...) +#ifdef __GNUC__ +static inline void check_msg (struct check *c,struct dt_info *dti, +const char *fmt, ...) __attribute__((format (printf,3 ,4 ))); +#endif +static inline void check_msg (struct check *c,struct dt_info *dti, +const char *fmt, ...) {va_list ap;va_start (ap, fmt);
@@ -534,13 +538,13 @@ static void fixup_phandle_references(struct check *c, struct dt_info *dti,FAIL (c, dti,"Reference to non-existent node or " "label \"%s\"\n" , m->ref); else/* mark the entry as unresolved */ - *((fdt32_t *)(prop->val.val + m->offset)) = + *((cell_t *)(prop->val.val + m->offset)) =cpu_to_fdt32 (0xffffffff );continue ; } phandle =get_node_phandle (dt, refnode); - *((fdt32_t *)(prop->val.val + m->offset)) =cpu_to_fdt32 (phandle); + *((cell_t *)(prop->val.val + m->offset)) =cpu_to_fdt32 (phandle); } } }
scripts/dtc/data.c +8 -8
@@ -171,9 +171,9 @@ struct data data_merge(struct data d1, struct data d2)struct data data_append_integer (struct data d,uint64_t value,int bits) {uint8_t value_8; -fdt16_t value_16; -fdt32_t value_32; -fdt64_t value_64; +uint16_t value_16; +uint32_t value_32; +uint64_t value_64;switch (bits) {case 8 :
@@ -197,14 +197,14 @@ struct data data_append_integer(struct data d, uint64_t value, int bits) } } -struct data data_append_re (struct data d,uint64_t address,uint64_t size) +struct data data_append_re (struct data d,const struct fdt_reserve_entry *re) { -struct fdt_reserve_entry re; +struct fdt_reserve_entry bere; - re.address =cpu_to_fdt64 (address); - re.size =cpu_to_fdt64 (size); + bere.address =cpu_to_fdt64 (re->address); + bere.size =cpu_to_fdt64 (re->size); -return data_append_data (d, &re,sizeof (re)); +return data_append_data (d, &bere,sizeof (bere)); }struct data data_append_cell (struct data d,cell_t word)
scripts/dtc/dtc-lexer.l +6 -1
@@ -62,7 +62,12 @@ static int dts_version = 1; static void push_input_file(const char *filename); static bool pop_input_file(void); -static void PRINTF(1, 2) lexical_error(const char *fmt, ...); +#ifdef __GNUC__ +static void lexical_error(const char *fmt, ...) + __attribute__((format (printf, 1, 2))); +#else +static void lexical_error(const char *fmt, ...); +#endif %}
scripts/dtc/dtc-lexer.lex.c_shipped +43 -38
275 lines not on this page · raw message
scripts/dtc/dtc.c +3 -2
@@ -138,7 +138,7 @@ static const char *guess_type_by_name(const char *fname, const char *fallback)static const char *guess_input_format (const char *fname,const char *fallback) {struct stat statbuf; -fdt32_t magic; +uint32_t magic;FILE *f;if (stat (fname, &statbuf) !=0 )
@@ -159,7 +159,8 @@ static const char *guess_input_format(const char *fname, const char *fallback) }fclose (f); -if (fdt32_to_cpu (magic) ==FDT_MAGIC ) + magic =fdt32_to_cpu (magic); +if (magic ==FDT_MAGIC )return "dtb" ;return guess_type_by_name (fname, fallback);
scripts/dtc/dtc.h +3 -2
@@ -43,6 +43,7 @@#define debug (...)#endif +#define DEFAULT_FDT_VERSION 17/*
@@ -113,7 +114,7 @@ struct data data_insert_at_marker(struct data d, struct marker *m,struct data data_merge (struct data d1,struct data d2);struct data data_append_cell (struct data d,cell_t word);struct data data_append_integer (struct data d,uint64_t word,int bits); -struct data data_append_re (struct data d,uint64_t address,uint64_t size); +struct data data_append_re (struct data d,const struct fdt_reserve_entry *re);struct data data_append_addr (struct data d,uint64_t addr);struct data data_append_byte (struct data d,uint8_t byte);struct data data_append_zeroes (struct data d,int len);
@@ -226,7 +227,7 @@ uint32_t guess_boot_cpuid(struct node *tree);/* Boot info (tree plus memreserve information */ struct reserve_info { -uint64_t address, size; +struct fdt_reserve_entry re;struct reserve_info *next;
scripts/dtc/flattree.c +32 -26
148 lines not on this page · raw message
scripts/dtc/libfdt/libfdt_env.h +13 -13
@@ -58,16 +58,16 @@#include <string.h> #ifdef __CHECKER__ -#define FDT_FORCE __attribute__((force)) -#define FDT_BITWISE __attribute__((bitwise)) +#define __force __attribute__((force)) +#define __bitwise __attribute__((bitwise))#else -#define FDT_FORCE -#define FDT_BITWISE +#define __force +#define __bitwise#endif -typedef uint16_t FDT_BITWISE fdt16_t; -typedef uint32_t FDT_BITWISE fdt32_t; -typedef uint64_t FDT_BITWISE fdt64_t; +typedef uint16_t __bitwise fdt16_t ; +typedef uint32_t __bitwise fdt32_t ; +typedef uint64_t __bitwise fdt64_t ;#define EXTRACT_BYTE (x, n) ((unsigned long long)((uint8_t *)&x)[n])#define CPU_TO_FDT16 (x) ((EXTRACT_BYTE(x, 0) << 8) | EXTRACT_BYTE(x, 1))
@@ -80,29 +80,29 @@ typedef uint64_t FDT_BITWISE fdt64_t;static inline uint16_t fdt16_to_cpu (fdt16_t x) { - return (FDT_FORCE uint16_t)CPU_TO_FDT16(x); +return (__force uint16_t )CPU_TO_FDT16 (x); }static inline fdt16_t cpu_to_fdt16 (uint16_t x) { - return (FDT_FORCE fdt16_t)CPU_TO_FDT16(x); +return (__force fdt16_t )CPU_TO_FDT16 (x); }static inline uint32_t fdt32_to_cpu (fdt32_t x) { - return (FDT_FORCE uint32_t)CPU_TO_FDT32(x); +return (__force uint32_t )CPU_TO_FDT32 (x); }static inline fdt32_t cpu_to_fdt32 (uint32_t x) { - return (FDT_FORCE fdt32_t)CPU_TO_FDT32(x); +return (__force fdt32_t )CPU_TO_FDT32 (x); }static inline uint64_t fdt64_to_cpu (fdt64_t x) { - return (FDT_FORCE uint64_t)CPU_TO_FDT64(x); +return (__force uint64_t )CPU_TO_FDT64 (x); }static inline fdt64_t cpu_to_fdt64 (uint64_t x) { - return (FDT_FORCE fdt64_t)CPU_TO_FDT64(x); +return (__force fdt64_t )CPU_TO_FDT64 (x); }#undef CPU_TO_FDT64#undef CPU_TO_FDT32
scripts/dtc/livetree.c +8 -8
@@ -319,8 +319,8 @@ struct reserve_info *build_reserve_entry(uint64_t address, uint64_t size)memset (new,0 ,sizeof (*new)); - new->address = address; - new->size = size; + new->re.address = address; + new->re.size = size;return new; }
@@ -393,7 +393,7 @@ struct property *get_property(struct node *node, const char *propname)cell_t propval_cell (struct property *prop) {assert (prop->val.len ==sizeof (cell_t)); -return fdt32_to_cpu (*((fdt32_t *)prop->val.val)); +return fdt32_to_cpu (*((cell_t *)prop->val.val)); } struct property *get_property_by_label(struct node *tree, const char *label,
@@ -599,13 +599,13 @@ static int cmp_reserve_info(const void *ax, const void *bx) a = *((const struct reserve_info *const *)ax); b = *((const struct reserve_info *const *)bx); -if (a->address < b->address) +if (a->re.address < b->re.address)return -1 ; -else if (a->address > b->address) +else if (a->re.address > b->re.address)return 1 ; -else if (a->size < b->size) +else if (a->re.size < b->re.size)return -1 ; -else if (a->size > b->size) +else if (a->re.size > b->re.size)return 1 ;else return 0 ;
@@ -902,7 +902,7 @@ static void add_local_fixup_entry(struct dt_info *dti, struct node *refnode) {struct node *wn, *nwn;/* local fixup node, walk node, new */ -fdt32_t value_32; +uint32_t value_32;char **compp;int i, depth;
scripts/dtc/srcpos.h +6 -5
@@ -22,7 +22,6 @@#include <stdio.h> #include <stdbool.h> -#include "util.h" struct srcfile_state {FILE *f;
@@ -107,10 +106,12 @@ extern void srcpos_update(struct srcpos *pos, const char *text, int len);extern struct srcpos *srcpos_copy (struct srcpos *pos);extern char *srcpos_string (struct srcpos *pos); -extern void PRINTF(3, 0) srcpos_verror(struct srcpos *pos, const char *prefix, - const char *fmt, va_list va); -extern void PRINTF(3, 4) srcpos_error(struct srcpos *pos, const char *prefix, - const char *fmt, ...); +extern void srcpos_verror (struct srcpos *pos,const char *prefix, +const char *fmt,va_list va) + __attribute__((format (printf,3 ,0 ))); +extern void srcpos_error (struct srcpos *pos,const char *prefix, +const char *fmt, ...) + __attribute__((format (printf,3 ,4 )));extern void srcpos_set_line (char *f,int l);
scripts/dtc/treesource.c +3 -3
@@ -137,7 +137,7 @@ static void write_propval_string(FILE *f, struct data val)static void write_propval_cells (FILE *f,struct data val) {void *propend = val.val + val.len; -fdt32_t *cp = (fdt32_t *)val.val; +cell_t *cp = (cell_t *)val.val;struct marker *m = val.markers;fprintf (f,"<" );
@@ -275,8 +275,8 @@ void dt_to_source(FILE *f, struct dt_info *dti)for_each_label (re->labels, l)fprintf (f,"%s: " , l->label);fprintf (f,"/memreserve/\t0x%016llx 0x%016llx;\n" , - (unsigned long long )re->address, - (unsigned long long )re->size); + (unsigned long long )re->re.address, + (unsigned long long )re->re.size); }write_tree_source_node (f, dti->dt,0 );
scripts/dtc/util.c +5 -6
@@ -396,7 +396,7 @@ void utilfdt_print_data(const char *data, int len) }while (s < data + len); }else if ((len %4 ) ==0 ) { -const fdt32_t *cell = (const fdt32_t *)data; +const uint32_t *cell = (const uint32_t *)data;printf (" = <" );for (i =0 , len /=4 ; i < len; i++)
@@ -412,16 +412,15 @@ void utilfdt_print_data(const char *data, int len) } } -void NORETURN util_version(void) +void util_version (void ) {printf ("Version: %s\n" ,DTC_VERSION );exit (0 ); } -void NORETURN util_usage(const char *errmsg, const char *synopsis, -const char *short_opts, -struct option const long_opts[], -const char *const opts_help[]) +void util_usage (const char *errmsg,const char *synopsis, +const char *short_opts,struct option const long_opts[], +const char *const opts_help[]) {FILE *fp = errmsg ? stderr : stdout;const char a_arg[] ="<arg>" ;
scripts/dtc/util.h +16 -14
@@ -25,17 +25,15 @@* USA */ +#define ARRAY_SIZE (x) (sizeof(x) / sizeof((x)[0])) +#ifdef __GNUC__ -#define PRINTF (i, j) __attribute__((format (printf, i, j))) -#define NORETURN __attribute__((noreturn)) +static inline void +__attribute__((noreturn)) __attribute__((format (printf,1 ,2 ))) +die(const char *str, ...)#else -#define PRINTF (i, j) -#define NORETURN +static inline void die(const char *str, ...)#endif - -#define ARRAY_SIZE (x) (sizeof(x) / sizeof((x)[0])) - -static inline void NORETURN PRINTF(1, 2) die(const char *str, ...) {va_list ap;
@@ -68,7 +66,12 @@ static inline void *xrealloc(void *p, size_t len)extern char *xstrdup (const char *s); -extern int PRINTF(2, 3) xasprintf(char **strp, const char *fmt, ...); +#ifdef __GNUC__ +extern int __attribute__((format (printf,2 ,3 ))) +xasprintf (char **strp,const char *fmt, ...); +#else +extern int xasprintf (char **strp,const char *fmt, ...); +#endif extern char *join_path (const char *path,const char *name);/**
@@ -197,7 +200,7 @@ void utilfdt_print_data(const char *data, int len);/** * Show source version and exit */ -void NORETURN util_version(void); +void util_version (void ) __attribute__((noreturn));/** * Show usage and exit
@@ -211,10 +214,9 @@ void NORETURN util_version(void);* @param long_opts The structure of long options * @param opts_help An array of help strings (should align with long_opts) */ -void NORETURN util_usage(const char *errmsg, const char *synopsis, -const char *short_opts, -struct option const long_opts[], -const char *const opts_help[]); +void util_usage (const char *errmsg,const char *synopsis, +const char *short_opts,struct option const long_opts[], +const char *const opts_help[]) __attribute__((noreturn));/** * Show usage and exit
scripts/dtc/version_gen.h +1 -1
@@ -1 +1 @@ -#define DTC_VERSION "DTC 1.4.4" +#define DTC_VERSION "DTC 1.4.3"
Signature · 1 line
2.13.3
PATCH 5/5 Revert "scripts/dtc: Update to upstream version v1.4.3"
In reply to Wolfgang DenkThis reverts commit c0e032e0090d6541549b19cc47e06ccd1f302893.
This patch is part of a series which has never been reviewed and has not been generally accepted by the community.
--- scripts/Kbuild.include | 5 + scripts/Makefile.extrawarn | 16 +- scripts/dtc/Makefile | 31 - scripts/dtc/Makefile.dtc | 18 - scripts/dtc/checks.c | 849 ------------- scripts/dtc/data.c | 269 ---- scripts/dtc/dtc-lexer.l | 311 ----- scripts/dtc/dtc-lexer.lex.c_shipped | 2260 --------------------------------- scripts/dtc/dtc-parser.tab.c_shipped | 2301 ---------------------------------- scripts/dtc/dtc-parser.tab.h_shipped | 123 -- scripts/dtc/dtc-parser.y | 519 -------- scripts/dtc/dtc.c | 366 ------ scripts/dtc/dtc.h | 285 ----- scripts/dtc/flattree.c | 946 -------------- scripts/dtc/fstree.c | 90 -- scripts/dtc/libfdt/Makefile.libfdt | 11 - scripts/dtc/libfdt/fdt.c | 251 ---- scripts/dtc/libfdt/fdt.h | 111 -- scripts/dtc/libfdt/fdt_empty_tree.c | 84 -- scripts/dtc/libfdt/fdt_ro.c | 703 ----------- scripts/dtc/libfdt/fdt_rw.c | 491 -------- scripts/dtc/libfdt/fdt_strerror.c | 102 -- scripts/dtc/libfdt/fdt_sw.c | 288 ----- scripts/dtc/libfdt/fdt_wip.c | 139 -- scripts/dtc/libfdt/libfdt.h | 1833 --------------------------- scripts/dtc/libfdt/libfdt_env.h | 112 -- scripts/dtc/libfdt/libfdt_internal.h | 95 -- scripts/dtc/livetree.c | 980 --------------- scripts/dtc/srcpos.c | 302 ----- scripts/dtc/srcpos.h | 118 -- scripts/dtc/treesource.c | 284 ----- scripts/dtc/update-dtc-source.sh | 81 -- scripts/dtc/util.c | 473 ------- scripts/dtc/util.h | 265 ---- scripts/dtc/version_gen.h | 1 - 35 files changed, 13 insertions(+), 15100 deletions(-) delete mode 100644 scripts/dtc/Makefile delete mode 100644 scripts/dtc/Makefile.dtc delete mode 100644 scripts/dtc/checks.c delete mode 100644 scripts/dtc/data.c delete mode 100644 scripts/dtc/dtc-lexer.l delete mode 100644 scripts/dtc/dtc-lexer.lex.c_shipped delete mode 100644 scripts/dtc/dtc-parser.tab.c_shipped delete mode 100644 scripts/dtc/dtc-parser.tab.h_shipped delete mode 100644 scripts/dtc/dtc-parser.y delete mode 100644 scripts/dtc/dtc.c delete mode 100644 scripts/dtc/dtc.h delete mode 100644 scripts/dtc/flattree.c delete mode 100644 scripts/dtc/fstree.c delete mode 100644 scripts/dtc/libfdt/Makefile.libfdt delete mode 100644 scripts/dtc/libfdt/fdt.c delete mode 100644 scripts/dtc/libfdt/fdt.h delete mode 100644 scripts/dtc/libfdt/fdt_empty_tree.c delete mode 100644 scripts/dtc/libfdt/fdt_ro.c delete mode 100644 scripts/dtc/libfdt/fdt_rw.c delete mode 100644 scripts/dtc/libfdt/fdt_strerror.c delete mode 100644 scripts/dtc/libfdt/fdt_sw.c delete mode 100644 scripts/dtc/libfdt/fdt_wip.c delete mode 100644 scripts/dtc/libfdt/libfdt.h delete mode 100644 scripts/dtc/libfdt/libfdt_env.h delete mode 100644 scripts/dtc/libfdt/libfdt_internal.h delete mode 100644 scripts/dtc/livetree.c delete mode 100644 scripts/dtc/srcpos.c delete mode 100644 scripts/dtc/srcpos.h delete mode 100644 scripts/dtc/treesource.c delete mode 100755 scripts/dtc/update-dtc-source.sh delete mode 100644 scripts/dtc/util.c delete mode 100644 scripts/dtc/util.h delete mode 100644 scripts/dtc/version_gen.h
scripts/Kbuild.include +5 -0
@@ -172,6 +172,11 @@ ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh) # Usage: $(call ld-ifversion, -ge, 22252, y) ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4)) +# dtc-option +# Usage: DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg) +dtc-option = $(call try-run,\ + echo '/dts-v1/; / {};' | $(DTC) $(1),$(1),$(2)) + ###### ###
scripts/Makefile.extrawarn +8 -8
@@ -58,8 +58,8 @@ endif KBUILD_CFLAGS += $(warning) -dtc-warning-2 += -Wnode_name_chars_strict -dtc-warning-2 += -Wproperty_name_chars_strict +dtc-warning-2 += $(call dtc-option,-Wnode_name_chars_strict) +dtc-warning-2 += $(call dtc-option,-Wproperty_name_chars_strict) dtc-warning := $(dtc-warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) dtc-warning += $(dtc-warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
@@ -70,11 +70,11 @@ DTC_FLAGS += $(dtc-warning) else # Disable noisy checks by default -DTC_FLAGS += -Wno-unit_address_vs_reg -DTC_FLAGS += -Wno-simple_bus_reg -DTC_FLAGS += -Wno-unit_address_format -DTC_FLAGS += -Wno-pci_bridge -DTC_FLAGS += -Wno-pci_device_bus_num -DTC_FLAGS += -Wno-pci_device_reg +DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg) +DTC_FLAGS += $(call dtc-option,-Wno-simple_bus_reg) +DTC_FLAGS += $(call dtc-option,-Wno-unit_address_format) +DTC_FLAGS += $(call dtc-option,-Wno-pci_bridge) +DTC_FLAGS += $(call dtc-option,-Wno-pci_device_bus_num) +DTC_FLAGS += $(call dtc-option,-Wno-pci_device_reg) endif
scripts/dtc/Makefile deleted +0 -31
@@ -1,31 +0,0 @@ -# scripts/dtc makefile - -hostprogs-y := dtc -always := $(hostprogs-y) - -dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ - srcpos.o checks.o util.o -dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o - -# Source files need to get at the userspace version of libfdt_env.h to compile - -HOSTCFLAGS_DTC := -I$(src) -I$(src)/libfdt - -HOSTCFLAGS_checks.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_data.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_dtc.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_flattree.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_fstree.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_livetree.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_srcpos.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_treesource.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_util.o := $(HOSTCFLAGS_DTC) - -HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC) -HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC) - -# dependencies on generated files need to be listed explicitly -$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h - -# generated files need to be cleaned explicitly -clean-files := dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h
scripts/dtc/Makefile.dtc deleted +0 -18
@@ -1,18 +0,0 @@ -# Makefile.dtc -# -# This is not a complete Makefile of itself. Instead, it is designed to -# be easily embeddable into other systems of Makefiles. -# -DTC_SRCS = \ - checks.c \ - data.c \ - dtc.c \ - flattree.c \ - fstree.c \ - livetree.c \ - srcpos.c \ - treesource.c \ - util.c - -DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c -DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)
scripts/dtc/checks.c deleted +0 -849
849 lines not on this page · raw message
scripts/dtc/data.c deleted +0 -269
269 lines not on this page · raw message
scripts/dtc/dtc-lexer.l deleted +0 -311
311 lines not on this page · raw message
scripts/dtc/dtc-lexer.lex.c_shipped deleted +0 -2260
1,484 lines not on this page · raw message
scripts/dtc/dtc-parser.tab.c_shipped deleted +0 -2301
2,301 lines not on this page · raw message
scripts/dtc/dtc-parser.tab.h_shipped deleted +0 -123
123 lines not on this page · raw message
scripts/dtc/dtc-parser.y deleted +0 -519
519 lines not on this page · raw message
scripts/dtc/dtc.c deleted +0 -366
366 lines not on this page · raw message
scripts/dtc/dtc.h deleted +0 -285
285 lines not on this page · raw message
scripts/dtc/flattree.c deleted +0 -946
946 lines not on this page · raw message
scripts/dtc/fstree.c deleted +0 -90
90 lines not on this page · raw message
scripts/dtc/libfdt/Makefile.libfdt deleted +0 -11
Lines of this file are not shown. View the raw message.
scripts/dtc/libfdt/fdt.c deleted +0 -251
251 lines not on this page · raw message
scripts/dtc/libfdt/fdt.h deleted +0 -111
111 lines not on this page · raw message
scripts/dtc/libfdt/fdt_empty_tree.c deleted +0 -84
84 lines not on this page · raw message
scripts/dtc/libfdt/fdt_ro.c deleted +0 -703
703 lines not on this page · raw message
scripts/dtc/libfdt/fdt_rw.c deleted +0 -491
491 lines not on this page · raw message
scripts/dtc/libfdt/fdt_strerror.c deleted +0 -102
102 lines not on this page · raw message
scripts/dtc/libfdt/fdt_sw.c deleted +0 -288
288 lines not on this page · raw message
scripts/dtc/libfdt/fdt_wip.c deleted +0 -139
139 lines not on this page · raw message
scripts/dtc/libfdt/libfdt.h deleted +0 -1833
1,833 lines not on this page · raw message
scripts/dtc/libfdt/libfdt_env.h deleted +0 -112
112 lines not on this page · raw message
scripts/dtc/libfdt/libfdt_internal.h deleted +0 -95
95 lines not on this page · raw message
scripts/dtc/livetree.c deleted +0 -980
980 lines not on this page · raw message
scripts/dtc/srcpos.c deleted +0 -302
302 lines not on this page · raw message
scripts/dtc/srcpos.h deleted +0 -118
118 lines not on this page · raw message
scripts/dtc/treesource.c deleted +0 -284
284 lines not on this page · raw message
scripts/dtc/update-dtc-source.sh deleted +0 -81
81 lines not on this page · raw message
scripts/dtc/util.c deleted +0 -473
473 lines not on this page · raw message
scripts/dtc/util.h deleted +0 -265
265 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.13.3
Part of the diff is not shown here. View the raw message.
cover REVERT Follow the Linux Kernel in building dtc as needed
In reply to Wolfgang DenkQuoted 13 lines · Wolfgang Denk
This patch series reverts some patches that should never have been merged into mainline at all:
- They were applied in violation of the well established rule that ALL patches must be posted on the mailing list before, and given enough time for review by the community.
- Obviously, these patches have not been Acked-by: by anybody.
- They implement a solution that probably does not represent the majority of the developers who discussed this issue. They were applied cutting short the ongoing discussion, without giving a good, comprehensible reason. Alternative solutions were presented before, but this patch series ignores them.
Quoted 8 lines
U-Boot is a community project with an established and documented development process. No single person, not even a custodian or maintainer, shall have the power to push through any changes without or against the consent of the community. If we want to maintain these standards, we cannot accept this. We therefore have only one
choice: revert these patches now, and let them undergo the necessary review process on the mailing list, allowing for the usual grace period of two weeks. Sorry.
Well, NAK. When you passed the "benevolent dictator" hat over, you passed it over. I value your input, and I don't lightly over-rule feedback. So, lets summarize things:
- We need a modern device tree compiler.
- Everyone needs a modern device tree compiler, because everyone should be running 'make tests'.
- This is not the first, or second, or possibly even third time we've hit problems of people using different versions of dtc and seeing different results / problems.
- The Linux Kernel has avoided this problem for forever by just bundling the minimum required parts of dtc in order to build things.
So, I've imported the infrastructure to keep things in sync, and imported upstream dtc.
Now, the best argument I've heard against this is "bundling is bad". I don't disagree, and the best way to fix this problem would be for distributions to start shipping a new enough version here that the kernel can drop it out, just like they did for linux-firmware recently. A whole lot more people care about the kernel than they do about U-Boot, and that's a more viable path forward. It would even make some kernel folks happy.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170927/6031580e/attachment.sig>
cover REVERT Follow the Linux Kernel in building dtc as needed
Dear Tom,
Quoted 4 lines · In message <20170927143112.GT3112@bill-the-cat> you wrote:
Well, NAK. When you passed the "benevolent dictator" hat over, you passed it over. I value your input, and I don't lightly over-rule feedback. So, lets summarize things:
These are all technical arguments. You could have raised these in the ongoing discussion. If they are good, convincing arguments, you should have no problems to have them accepted.
What I'm complainiung about is not WHAT was commited, but HOW it was committed.
Marek wrote:
| I believe we have a well-established process of submitting patches, | getting a review and then applying them. If the head maintainer doesn't | follow the process, why should anyone else ?
You have a role model function. Please stick to the rules!
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de At the source of every error which is blamed on the computer you will find at least two human errors, including the error of blaming it on the computer.
cover REVERT Follow the Linux Kernel in building dtc as needed
Quoted 11 lines · Wolfgang Denk
Dear Tom,
Quoted 4 lines · In message <20170927143112.GT3112@bill-the-cat> you wrote:
Well, NAK. When you passed the "benevolent dictator" hat over, you passed it over. I value your input, and I don't lightly over-rule feedback. So, lets summarize things:
These are all technical arguments. You could have raised these in the ongoing discussion. If they are good, convincing arguments, you should have no problems to have them accepted.
To which I did for some of them, and others I was going to follow up with, but left aside rather than further the thread.
Quoted 10 lines
What I'm complainiung about is not WHAT was commited, but HOW it was committed.
Marek wrote:
| I believe we have a well-established process of submitting patches, | getting a review and then applying them. If the head maintainer doesn't | follow the process, why should anyone else ?You have a role model function. Please stick to the rules!
Right. And part of the job of the custodian is to, on occasion, put their foot down, on technical grounds, and say when we must do X. This happens from time to time anyways. It rarely happens between custodians, and I think this is occurrence number 2 in just over 5 years. And given the related issue of "everyone" being broken unless they have a new DTC installed, I didn't want to wait nearly so long try and convince Marek as I did with Albert and the unaligned access thing last time. Nor did I want to go with reverting the FDT changes so we can continue cycling around on what amounts to correcting the previous mistake of not just including dtc.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170927/2d51349b/attachment.sig>