-/** @file\r
-*\r
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
-*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-*\r
-**/\r
-\r
#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
- uint32_t magic; /* magic word FDT_MAGIC */\r
- uint32_t totalsize; /* total size of DT block */\r
- uint32_t off_dt_struct; /* offset to structure */\r
- uint32_t off_dt_strings; /* offset to strings */\r
- uint32_t off_mem_rsvmap; /* offset to memory reserve map */\r
- uint32_t version; /* format version */\r
- uint32_t last_comp_version; /* last compatible version */\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
- uint32_t boot_cpuid_phys; /* Which physical CPU id we're\r
+ fdt32_t boot_cpuid_phys; /* Which physical CPU id we're\r
booting on */\r
/* version 3 fields below */\r
- uint32_t size_dt_strings; /* size of the strings block */\r
+ fdt32_t size_dt_strings; /* size of the strings block */\r
\r
/* version 17 fields below */\r
- uint32_t size_dt_struct; /* size of the structure block */\r
+ fdt32_t size_dt_struct; /* size of the structure block */\r
};\r
\r
struct fdt_reserve_entry {\r
- uint64_t address;\r
- uint64_t size;\r
+ fdt64_t address;\r
+ fdt64_t size;\r
};\r
\r
struct fdt_node_header {\r
- uint32_t tag;\r
+ fdt32_t tag;\r
char name[0];\r
};\r
\r
struct fdt_property {\r
- uint32_t tag;\r
- uint32_t len;\r
- uint32_t nameoff;\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(uint32_t)\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_NOP 0x4 /* nop */\r
#define FDT_END 0x9\r
\r
-#define FDT_V1_SIZE (7*sizeof(uint32_t))\r
-#define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(uint32_t))\r
-#define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(uint32_t))\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(uint32_t))\r
+#define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(fdt32_t))\r
\r
#endif /* _FDT_H */\r