forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
of/lib: Allow scripts/dtc/libfdt to be used from kernel code
libfdt is part of the device tree support in scripts/dtc/libfdt. For some platforms that use the Device Tree, we want to be able to edit the flattened device tree form. We don't want to burden kernel builds that do not require it, so we gate compilation of libfdt files with CONFIG_LIBFDT. So if it is needed, you need to do this in your Kconfig: select LIBFDT And in the Makefile of the code using libfdt something like: ccflags-y := -I$(src)/../../../scripts/dtc/libfdt Signed-off-by: David Daney <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Grant Likely <[email protected]> Cc: [email protected] Acked-by: Rob Herring <[email protected]> Signed-off-by: Ralf Baechle <[email protected]>
- Loading branch information
1 parent
a339aef
commit ab25383
Showing
10 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef _INCLUDE_LIBFDT_H_ | ||
#define _INCLUDE_LIBFDT_H_ | ||
|
||
#include <linux/libfdt_env.h> | ||
#include "../../scripts/dtc/libfdt/fdt.h" | ||
#include "../../scripts/dtc/libfdt/libfdt.h" | ||
|
||
#endif /* _INCLUDE_LIBFDT_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef _LIBFDT_ENV_H | ||
#define _LIBFDT_ENV_H | ||
|
||
#include <linux/string.h> | ||
|
||
#include <asm/byteorder.h> | ||
|
||
#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) | ||
|
||
#endif /* _LIBFDT_ENV_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include <linux/libfdt_env.h> | ||
#include "../scripts/dtc/libfdt/fdt.c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include <linux/libfdt_env.h> | ||
#include "../scripts/dtc/libfdt/fdt_ro.c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include <linux/libfdt_env.h> | ||
#include "../scripts/dtc/libfdt/fdt_rw.c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include <linux/libfdt_env.h> | ||
#include "../scripts/dtc/libfdt/fdt_strerror.c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include <linux/libfdt_env.h> | ||
#include "../scripts/dtc/libfdt/fdt_sw.c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include <linux/libfdt_env.h> | ||
#include "../scripts/dtc/libfdt/fdt_wip.c" |