2007-04-06 18:17:14 +00:00
|
|
|
/*
|
|
|
|
* libfdt - Flat Device Tree manipulation (build/run environment adaptation)
|
|
|
|
* Copyright (C) 2007 Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com
|
|
|
|
* Original version written by David Gibson, IBM Corporation.
|
|
|
|
*
|
2013-07-08 09:48:07 +00:00
|
|
|
* SPDX-License-Identifier: LGPL-2.1+
|
2007-04-06 18:17:14 +00:00
|
|
|
*/
|
|
|
|
|
2007-03-31 15:59:59 +00:00
|
|
|
#ifndef _LIBFDT_ENV_H
|
|
|
|
#define _LIBFDT_ENV_H
|
|
|
|
|
2009-07-02 23:23:25 +00:00
|
|
|
#include "compiler.h"
|
2013-01-16 13:59:34 +00:00
|
|
|
#include "linux/types.h"
|
2007-03-31 15:59:59 +00:00
|
|
|
|
2008-06-10 16:06:17 +00:00
|
|
|
extern struct fdt_header *working_fdt; /* Pointer to the working fdt */
|
2007-03-31 16:05:39 +00:00
|
|
|
|
2013-01-16 13:59:34 +00:00
|
|
|
typedef __be16 fdt16_t;
|
|
|
|
typedef __be32 fdt32_t;
|
|
|
|
typedef __be64 fdt64_t;
|
|
|
|
|
2009-07-02 23:23:25 +00:00
|
|
|
#define fdt32_to_cpu(x) be32_to_cpu(x)
|
|
|
|
#define cpu_to_fdt32(x) cpu_to_be32(x)
|
|
|
|
#define fdt64_to_cpu(x) be64_to_cpu(x)
|
|
|
|
#define cpu_to_fdt64(x) cpu_to_be64(x)
|
2008-07-07 00:10:48 +00:00
|
|
|
|
2016-07-05 08:26:37 +00:00
|
|
|
#ifdef __UBOOT__
|
|
|
|
#include <vsprintf.h>
|
|
|
|
|
|
|
|
#define strtoul(cp, endp, base) simple_strtoul(cp, endp, base)
|
|
|
|
#endif
|
|
|
|
|
2013-05-05 02:17:49 +00:00
|
|
|
/* adding a ramdisk needs 0x44 bytes in version 2008.10 */
|
|
|
|
#define FDT_RAMDISK_OVERHEAD 0x80
|
|
|
|
|
2007-03-31 15:59:59 +00:00
|
|
|
#endif /* _LIBFDT_ENV_H */
|