blob: 273b5d30f867265dd364a2502946661b39e64359 [file] [log] [blame]
Gerald Van Baren6679f922007-04-06 14:17:14 -04001/*
2 * libfdt - Flat Device Tree manipulation (build/run environment adaptation)
3 * Copyright (C) 2007 Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com
4 * Original version written by David Gibson, IBM Corporation.
5 *
Wolfgang Denkeee479c2013-07-08 11:48:07 +02006 * SPDX-License-Identifier: LGPL-2.1+
Gerald Van Baren6679f922007-04-06 14:17:14 -04007 */
8
Gerald Van Baren7cd5da02007-03-31 11:59:59 -04009#ifndef _LIBFDT_ENV_H
10#define _LIBFDT_ENV_H
11
Mike Frysinger37566092009-07-02 19:23:25 -040012#include "compiler.h"
Kim Phillips25aca0f2013-01-16 13:59:34 +000013#include "linux/types.h"
Gerald Van Baren7cd5da02007-03-31 11:59:59 -040014
Kim Phillipse489b9c2008-06-10 11:06:17 -050015extern struct fdt_header *working_fdt; /* Pointer to the working fdt */
Gerald Van Barenfa3a74c2007-03-31 12:05:39 -040016
Kim Phillips25aca0f2013-01-16 13:59:34 +000017typedef __be16 fdt16_t;
18typedef __be32 fdt32_t;
19typedef __be64 fdt64_t;
20
Mike Frysinger37566092009-07-02 19:23:25 -040021#define fdt32_to_cpu(x) be32_to_cpu(x)
22#define cpu_to_fdt32(x) cpu_to_be32(x)
23#define fdt64_to_cpu(x) be64_to_cpu(x)
24#define cpu_to_fdt64(x) cpu_to_be64(x)
David Gibsonef4e8ce2008-07-07 10:10:48 +100025
Gerald Van Barenbbd0f7e2013-05-04 22:17:49 -040026/* adding a ramdisk needs 0x44 bytes in version 2008.10 */
27#define FDT_RAMDISK_OVERHEAD 0x80
28
Gerald Van Baren7cd5da02007-03-31 11:59:59 -040029#endif /* _LIBFDT_ENV_H */