Centos-kernel-stream-9/scripts/dtc/libfdt/fdt.h

67 lines
1.7 KiB
C
Raw Normal View History

/* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */
scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987 This adds the following commits from upstream: aadd0b65c987 checks: centralize printing of property names in failure messages 88960e398907 checks: centralize printing of node path in check_msg f1879e1a50eb Add limited read-only support for older (V2 and V3) device tree to libfdt. 37dea76e9700 srcpos: drop special handling of tab 65893da4aee0 libfdt: overlay: Add missing license 962a45ca034d Avoid installing pylibfdt when dependencies are missing cd6ea1b2bea6 Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT} 51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake 333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper invocation e54388015af1 dtc: Bump version to v1.4.6 a1fe86f380cb fdtoverlay: Switch from using alloca to malloc c8d5472de3ff tests: Improve compatibility with other platforms c81d389a10cc checks: add chosen node checks e671852042a7 checks: add aliases node checks d0c44ebe3f42 checks: check for #{size,address}-cells without child nodes 18a3d84bb802 checks: add string list check for *-names properties 8fe94fd6f19f checks: add string list check 6c5730819604 checks: add a string check for 'label' property a384191eba09 checks: fix sound-dai phandle with arg property check b260c4f610c0 Fix ambiguous grammar for devicetree rule fe667e382bac tests: Add some basic tests for the pci_bridge checks 7975f6422260 Fix widespread incorrect use of strneq(), replace with new strprefixeq() fca296445eab Add strstarts() helper function cc392f089007 tests: Check non-matching cases for fdt_node_check_compatible() bba26a5291c8 livetree: avoid assertion of orphan phandles with overlays c8f8194d76cc implement strnlen for systems that need it c8b38f65fdec libfdt: Remove leading underscores from identifiers 3b62fdaebfe5 Remove leading underscores from identifiers 2d45d1c5c65e Replace FDT_VERSION() with stringify() 2e6fe5a107b5 Fix some errors in comments b0ae9e4b0ceb tests: Correct warning in sw_tree1.c Commit c8b38f65fdec upstream ("libfdt: Remove leading underscores from identifiers") changed the multiple inclusion define protection, so the kernel's libfdt_env.h needs the corresponding update. Signed-off-by: Rob Herring <robh@kernel.org>
2018-02-27 23:40:38 +00:00
#ifndef FDT_H
#define FDT_H
/*
* libfdt - Flat Device Tree manipulation
* Copyright (C) 2006 David Gibson, IBM Corporation.
* Copyright 2012 Kim Phillips, Freescale Semiconductor.
*/
#ifndef __ASSEMBLY__
struct fdt_header {
fdt32_t magic; /* magic word FDT_MAGIC */
fdt32_t totalsize; /* total size of DT block */
fdt32_t off_dt_struct; /* offset to structure */
fdt32_t off_dt_strings; /* offset to strings */
fdt32_t off_mem_rsvmap; /* offset to memory reserve map */
fdt32_t version; /* format version */
fdt32_t last_comp_version; /* last compatible version */
/* version 2 fields below */
fdt32_t boot_cpuid_phys; /* Which physical CPU id we're
booting on */
/* version 3 fields below */
fdt32_t size_dt_strings; /* size of the strings block */
/* version 17 fields below */
fdt32_t size_dt_struct; /* size of the structure block */
};
struct fdt_reserve_entry {
fdt64_t address;
fdt64_t size;
};
struct fdt_node_header {
fdt32_t tag;
treewide: Replace zero-length arrays with flexible-array members Conflicts: drop changes to arch/alpha/include/asm/hwrpb.h arch/ia64/include/asm/sal.h arch/sh/include/asm/thread_info.h arch/sparc/include/asm/vio.h arch/um/include/shared/net_kern.h arch/xtensa/include/asm/bootparam.h - unsupported arches drop drivers/misc/habanalabs/include/common/cpucp_if.h - unsupported config drop drivers/staging/r8188eu/include/rtw_cmd.h fs/ksmbd/ksmbd_netlink.h fs/ksmbd/ntlmssp.h fs/ksmbd/smb2pdu.h fs/ksmbd/transport_rdma.c drivers/scsi/qla2xxx/qla_edif_bsg.h fs/ksmbd/xattr.h include/net/ioam6.h - files not in CS9 fs/xfs/scrub/attr.h arch/x86/include/asm/microcode_amd.h arch/x86/include/asm/microcode_intel.h drivers/net/ethernet/marvell/octeontx2/af/npc.h include/sound/sof/channel_map.h sound/soc/intel/atom/sst-mfld-dsp.h sound/soc/intel/skylake/skl-topology.h drivers/scsi/qla2xxx/qla_edif.c drivers/scsi/qla2xxx/qla_edif_bsg.h drivers/scsi/mpi3mr/mpi3mr.h - This patch already applied. drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c drivers/gpu/drm/nouveau/include/nvfw/hs.h change done under RHEL-only commit 99fc716fc479 ("Merge DRM changes from upstream v5.17..v5.18") JIRA: https://issues.redhat.com/browse/RHEL-1848 commit 5224f79096170bf7b92cc8fe42a12f44b91e5f62 Author: Gustavo A. R. Silva <gustavoars@kernel.org> Date: Mon Feb 14 19:11:44 2022 -0600 treewide: Replace zero-length arrays with flexible-array members There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. This code was transformed with the help of Coccinelle: (next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script. cocci --include-headers --dir . > output.patch) @@ identifier S, member, array; type T1, T2; @@ struct S { ... T1 member; T2 array[ - 0 ]; }; UAPI and wireless changes were intentionally excluded from this patch and will be sent out separately. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-lengt h-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/78 Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Chris von Recklinghausen <crecklin@redhat.com>
2023-10-20 10:12:35 +00:00
char name[];
};
struct fdt_property {
fdt32_t tag;
fdt32_t len;
fdt32_t nameoff;
treewide: Replace zero-length arrays with flexible-array members Conflicts: drop changes to arch/alpha/include/asm/hwrpb.h arch/ia64/include/asm/sal.h arch/sh/include/asm/thread_info.h arch/sparc/include/asm/vio.h arch/um/include/shared/net_kern.h arch/xtensa/include/asm/bootparam.h - unsupported arches drop drivers/misc/habanalabs/include/common/cpucp_if.h - unsupported config drop drivers/staging/r8188eu/include/rtw_cmd.h fs/ksmbd/ksmbd_netlink.h fs/ksmbd/ntlmssp.h fs/ksmbd/smb2pdu.h fs/ksmbd/transport_rdma.c drivers/scsi/qla2xxx/qla_edif_bsg.h fs/ksmbd/xattr.h include/net/ioam6.h - files not in CS9 fs/xfs/scrub/attr.h arch/x86/include/asm/microcode_amd.h arch/x86/include/asm/microcode_intel.h drivers/net/ethernet/marvell/octeontx2/af/npc.h include/sound/sof/channel_map.h sound/soc/intel/atom/sst-mfld-dsp.h sound/soc/intel/skylake/skl-topology.h drivers/scsi/qla2xxx/qla_edif.c drivers/scsi/qla2xxx/qla_edif_bsg.h drivers/scsi/mpi3mr/mpi3mr.h - This patch already applied. drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c drivers/gpu/drm/nouveau/include/nvfw/hs.h change done under RHEL-only commit 99fc716fc479 ("Merge DRM changes from upstream v5.17..v5.18") JIRA: https://issues.redhat.com/browse/RHEL-1848 commit 5224f79096170bf7b92cc8fe42a12f44b91e5f62 Author: Gustavo A. R. Silva <gustavoars@kernel.org> Date: Mon Feb 14 19:11:44 2022 -0600 treewide: Replace zero-length arrays with flexible-array members There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. This code was transformed with the help of Coccinelle: (next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script. cocci --include-headers --dir . > output.patch) @@ identifier S, member, array; type T1, T2; @@ struct S { ... T1 member; T2 array[ - 0 ]; }; UAPI and wireless changes were intentionally excluded from this patch and will be sent out separately. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-lengt h-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/78 Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Chris von Recklinghausen <crecklin@redhat.com>
2023-10-20 10:12:35 +00:00
char data[];
};
#endif /* !__ASSEMBLY */
#define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */
#define FDT_TAGSIZE sizeof(fdt32_t)
#define FDT_BEGIN_NODE 0x1 /* Start node: full name */
#define FDT_END_NODE 0x2 /* End node */
#define FDT_PROP 0x3 /* Property: name off,
size, content */
#define FDT_NOP 0x4 /* nop */
#define FDT_END 0x9
#define FDT_V1_SIZE (7*sizeof(fdt32_t))
#define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(fdt32_t))
#define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(fdt32_t))
#define FDT_V16_SIZE FDT_V3_SIZE
#define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(fdt32_t))
scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987 This adds the following commits from upstream: aadd0b65c987 checks: centralize printing of property names in failure messages 88960e398907 checks: centralize printing of node path in check_msg f1879e1a50eb Add limited read-only support for older (V2 and V3) device tree to libfdt. 37dea76e9700 srcpos: drop special handling of tab 65893da4aee0 libfdt: overlay: Add missing license 962a45ca034d Avoid installing pylibfdt when dependencies are missing cd6ea1b2bea6 Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT} 51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake 333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper invocation e54388015af1 dtc: Bump version to v1.4.6 a1fe86f380cb fdtoverlay: Switch from using alloca to malloc c8d5472de3ff tests: Improve compatibility with other platforms c81d389a10cc checks: add chosen node checks e671852042a7 checks: add aliases node checks d0c44ebe3f42 checks: check for #{size,address}-cells without child nodes 18a3d84bb802 checks: add string list check for *-names properties 8fe94fd6f19f checks: add string list check 6c5730819604 checks: add a string check for 'label' property a384191eba09 checks: fix sound-dai phandle with arg property check b260c4f610c0 Fix ambiguous grammar for devicetree rule fe667e382bac tests: Add some basic tests for the pci_bridge checks 7975f6422260 Fix widespread incorrect use of strneq(), replace with new strprefixeq() fca296445eab Add strstarts() helper function cc392f089007 tests: Check non-matching cases for fdt_node_check_compatible() bba26a5291c8 livetree: avoid assertion of orphan phandles with overlays c8f8194d76cc implement strnlen for systems that need it c8b38f65fdec libfdt: Remove leading underscores from identifiers 3b62fdaebfe5 Remove leading underscores from identifiers 2d45d1c5c65e Replace FDT_VERSION() with stringify() 2e6fe5a107b5 Fix some errors in comments b0ae9e4b0ceb tests: Correct warning in sw_tree1.c Commit c8b38f65fdec upstream ("libfdt: Remove leading underscores from identifiers") changed the multiple inclusion define protection, so the kernel's libfdt_env.h needs the corresponding update. Signed-off-by: Rob Herring <robh@kernel.org>
2018-02-27 23:40:38 +00:00
#endif /* FDT_H */