Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with host installed libfdt headers #2

Open
wants to merge 5 commits into
base: v2018.01-solidrun-a38x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/mvebu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ config CMD_MVEBU_BUBT

config MVEBU_UBOOT_DFLT_NAME
string "Default image name for bubt command"
depends on ENV_IS_ON_SELECTED_BOOT_DEVICE
default "u-boot-spl-mmc.kwb" if MVEBU_SPL_BOOT_DEVICE_MMC
default "u-boot-spl-nand.kwb" if MVEBU_SPL_BOOT_DEVICE_NAND
default "u-boot-spl-sata.kwb" if MVEBU_SPL_BOOT_DEVICE_SATA
Expand Down
13 changes: 13 additions & 0 deletions include/libfdt.h
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
#ifndef UBOOT_LIBFDT_H
#define UBOOT_LIBFDT_H
/*
* SPDX-License-Identifier: GPL-2.0+ BSD-2-Clause
*/

#include "../lib/libfdt/libfdt.h"

extern struct fdt_header *working_fdt; /* Pointer to the working fdt */

/* adding a ramdisk needs 0x44 bytes in version 2008.10 */
#define FDT_RAMDISK_OVERHEAD 0x80

#endif /* UBOOT_LIBFDT_H */
34 changes: 5 additions & 29 deletions include/libfdt_env.h
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
/*
* 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.
*
* SPDX-License-Identifier: LGPL-2.1+
*/

#ifndef _LIBFDT_ENV_H
#define _LIBFDT_ENV_H

#include "compiler.h"
#include "linux/types.h"

extern struct fdt_header *working_fdt; /* Pointer to the working fdt */

typedef __be16 fdt16_t;
typedef __be32 fdt32_t;
typedef __be64 fdt64_t;

#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)

/* adding a ramdisk needs 0x44 bytes in version 2008.10 */
#define FDT_RAMDISK_OVERHEAD 0x80

#endif /* _LIBFDT_ENV_H */
#ifdef USE_HOSTCC
#include "../scripts/dtc/libfdt/libfdt_env.h"
#else
#include <linux/libfdt_env.h>
#endif
4 changes: 2 additions & 2 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ endif # !LOGO_BMP
# Define __KERNEL_STRICT_NAMES to prevent typedef overlaps
# Define _GNU_SOURCE to obtain the getline prototype from stdio.h
#
HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \
HOST_EXTRACFLAGS += -include $(srctree)/include/compiler.h \
$(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
-I$(srctree)/lib/libfdt \
-I$(srctree)/scripts/dtc/libfdt \
-I$(srctree)/tools \
-DUSE_HOSTCC \
-D__KERNEL_STRICT_NAMES \
Expand Down
3 changes: 3 additions & 0 deletions tools/fdtgrep.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@

#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <getopt.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
1 change: 1 addition & 0 deletions tools/gen_ethaddr_crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include <ctype.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
1 change: 1 addition & 0 deletions tools/ifdtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <assert.h>
#include <fcntl.h>
#include <getopt.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Expand Down
1 change: 1 addition & 0 deletions tools/imagetool.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "os_support.h"
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
1 change: 1 addition & 0 deletions tools/mips-relocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
Expand Down