]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Include/fdt.h
EmbeddedPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / EmbeddedPkg / Include / fdt.h
index 6e7a8b39733298e6d46154fa8f56cdc543572ca7..0187749f19b6dd0ecfa01ff76cffd8fbf2021f2f 100644 (file)
-/** @file
-*
-*  Copyright (c) 2011-2012, ARM Limited. All rights reserved.
-*  
-*  This program and the accompanying materials                          
-*  are licensed and made available under the terms and conditions of the BSD License         
-*  which accompanies this distribution.  The full text of the license may be found at        
-*  http://opensource.org/licenses/bsd-license.php                                            
-*
-*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
-*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
-*
-**/
-
-#ifndef _FDT_H
-#define _FDT_H
-
-#ifndef __ASSEMBLY__
-
-struct fdt_header {
-       uint32_t magic;                  /* magic word FDT_MAGIC */
-       uint32_t totalsize;              /* total size of DT block */
-       uint32_t off_dt_struct;          /* offset to structure */
-       uint32_t off_dt_strings;         /* offset to strings */
-       uint32_t off_mem_rsvmap;         /* offset to memory reserve map */
-       uint32_t version;                /* format version */
-       uint32_t last_comp_version;      /* last compatible version */
-
-       /* version 2 fields below */
-       uint32_t boot_cpuid_phys;        /* Which physical CPU id we're
-                                           booting on */
-       /* version 3 fields below */
-       uint32_t size_dt_strings;        /* size of the strings block */
-
-       /* version 17 fields below */
-       uint32_t size_dt_struct;         /* size of the structure block */
-};
-
-struct fdt_reserve_entry {
-       uint64_t address;
-       uint64_t size;
-};
-
-struct fdt_node_header {
-       uint32_t tag;
-       char name[0];
-};
-
-struct fdt_property {
-       uint32_t tag;
-       uint32_t len;
-       uint32_t nameoff;
-       char data[0];
-};
-
-#endif /* !__ASSEMBLY */
-
-#define FDT_MAGIC      0xd00dfeed      /* 4: version, 4: total size */
-#define FDT_TAGSIZE    sizeof(uint32_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(uint32_t))
-#define FDT_V2_SIZE    (FDT_V1_SIZE + sizeof(uint32_t))
-#define FDT_V3_SIZE    (FDT_V2_SIZE + sizeof(uint32_t))
-#define FDT_V16_SIZE   FDT_V3_SIZE
-#define FDT_V17_SIZE   (FDT_V16_SIZE + sizeof(uint32_t))
-
-#endif /* _FDT_H */
+#ifndef _FDT_H\r
+#define _FDT_H\r
+/*\r
+ * libfdt - Flat Device Tree manipulation\r
+ * Copyright (C) 2006 David Gibson, IBM Corporation.\r
+ * Copyright 2012 Kim Phillips, Freescale Semiconductor.\r
+ *\r
+ * libfdt is dual licensed: you can use it either under the terms of\r
+ * the GPL, or the BSD license, at your option.\r
+ *\r
+ *  a) This library is free software; you can redistribute it and/or\r
+ *     modify it under the terms of the GNU General Public License as\r
+ *     published by the Free Software Foundation; either version 2 of the\r
+ *     License, or (at your option) any later version.\r
+ *\r
+ *     This library is distributed in the hope that it will be useful,\r
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ *     GNU General Public License for more details.\r
+ *\r
+ *     You should have received a copy of the GNU General Public\r
+ *     License along with this library; if not, write to the Free\r
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,\r
+ *     MA 02110-1301 USA\r
+ *\r
+ * Alternatively,\r
+ *\r
+ *  b) Redistribution and use in source and binary forms, with or\r
+ *     without modification, are permitted provided that the following\r
+ *     conditions are met:\r
+ *\r
+ *     1. Redistributions of source code must retain the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer.\r
+ *     2. Redistributions in binary form must reproduce the above\r
+ *        copyright notice, this list of conditions and the following\r
+ *        disclaimer in the documentation and/or other materials\r
+ *        provided with the distribution.\r
+ *\r
+ *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\r
+ *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,\r
+ *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
+ *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
+ *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
+ *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+ *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
+ *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
+ *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+ *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
+ *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
+ *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
+#ifndef __ASSEMBLY__\r
+\r
+struct fdt_header {\r
+       fdt32_t magic;                   /* magic word FDT_MAGIC */\r
+       fdt32_t totalsize;               /* total size of DT block */\r
+       fdt32_t off_dt_struct;           /* offset to structure */\r
+       fdt32_t off_dt_strings;          /* offset to strings */\r
+       fdt32_t off_mem_rsvmap;          /* offset to memory reserve map */\r
+       fdt32_t version;                 /* format version */\r
+       fdt32_t last_comp_version;       /* last compatible version */\r
+\r
+       /* version 2 fields below */\r
+       fdt32_t boot_cpuid_phys;         /* Which physical CPU id we're\r
+                                           booting on */\r
+       /* version 3 fields below */\r
+       fdt32_t size_dt_strings;         /* size of the strings block */\r
+\r
+       /* version 17 fields below */\r
+       fdt32_t size_dt_struct;          /* size of the structure block */\r
+};\r
+\r
+struct fdt_reserve_entry {\r
+       fdt64_t address;\r
+       fdt64_t size;\r
+};\r
+\r
+struct fdt_node_header {\r
+       fdt32_t tag;\r
+       char name[0];\r
+};\r
+\r
+struct fdt_property {\r
+       fdt32_t tag;\r
+       fdt32_t len;\r
+       fdt32_t nameoff;\r
+       char data[0];\r
+};\r
+\r
+#endif /* !__ASSEMBLY */\r
+\r
+#define FDT_MAGIC      0xd00dfeed      /* 4: version, 4: total size */\r
+#define FDT_TAGSIZE    sizeof(fdt32_t)\r
+\r
+#define FDT_BEGIN_NODE 0x1             /* Start node: full name */\r
+#define FDT_END_NODE   0x2             /* End node */\r
+#define FDT_PROP       0x3             /* Property: name off,\r
+                                          size, content */\r
+#define FDT_NOP                0x4             /* nop */\r
+#define FDT_END                0x9\r
+\r
+#define FDT_V1_SIZE    (7*sizeof(fdt32_t))\r
+#define FDT_V2_SIZE    (FDT_V1_SIZE + sizeof(fdt32_t))\r
+#define FDT_V3_SIZE    (FDT_V2_SIZE + sizeof(fdt32_t))\r
+#define FDT_V16_SIZE   FDT_V3_SIZE\r
+#define FDT_V17_SIZE   (FDT_V16_SIZE + sizeof(fdt32_t))\r
+\r
+#endif /* _FDT_H */\r