Skip to content

Commit

Permalink
common: Move device-tree setup functions to fdt_support.h
Browse files Browse the repository at this point in the history
These functions relate to setting up the device tree for booting the OS.
The fdt_support.h header file supports similar functions, so move these
there.

Signed-off-by: Simon Glass <[email protected]>
  • Loading branch information
sjg20 authored and trini committed Jan 17, 2020
1 parent 4cf7f12 commit 807765b
Show file tree
Hide file tree
Showing 38 changed files with 50 additions and 12 deletions.
1 change: 1 addition & 0 deletions arch/riscv/lib/bootm.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <common.h>
#include <command.h>
#include <dm.h>
#include <fdt_support.h>
#include <dm/root.h>
#include <image.h>
#include <asm/byteorder.h>
Expand Down
1 change: 1 addition & 0 deletions board/esd/vme8349/vme8349.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <ioports.h>
#include <mpc83xx.h>
#include <asm/mpc8349_pci.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/b4860qds/b4860qds.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
#include <irq_func.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/corenet_ds/corenet_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <init.h>
#include <netdev.h>
#include <linux/compiler.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/ls1012afrdm/ls1012afrdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <i2c.h>
#include <asm/io.h>
#include <asm/arch/clock.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/ls1012ardb/ls1012ardb.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <i2c.h>
#include <asm/io.h>
#include <asm/arch/clock.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/ls1021aiot/ls1021aiot.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <init.h>
#include <asm/arch/immap_ls102xa.h>
#include <asm/arch/clock.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/ls1021aqds/ls1021aqds.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
#include <asm/io.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/ls1021atsn/ls1021atsn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright 2016-2019 NXP Semiconductors
*/
#include <common.h>
#include <fdt_support.h>
#include <init.h>
#include <asm/arch-ls102xa/ls102xa_soc.h>
#include <asm/arch/ls102xa_devdis.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/ls1021atwr/ls1021atwr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
#include <asm/io.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/mpc8313erdb/mpc8313erdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <init.h>
#if defined(CONFIG_OF_LIBFDT)
#include <linux/libfdt.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/mpc8323erdb/mpc8323erdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <common.h>
#include <eeprom.h>
#include <env.h>
#include <fdt_support.h>
#include <init.h>
#include <ioports.h>
#include <mpc83xx.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/mpc832xemds/mpc832xemds.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <init.h>
#include <ioports.h>
#include <mpc83xx.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/mpc8349emds/mpc8349emds.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <ioports.h>
#include <mpc83xx.h>
#include <asm/mpc8349_pci.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/mpc8349itx/mpc8349itx.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <ioports.h>
#include <mpc83xx.h>
#include <i2c.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/p2041rdb/p2041rdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <init.h>
#include <netdev.h>
#include <linux/compiler.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/t102xqds/t102xqds.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
#include <netdev.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/t102xrdb/t102xrdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
#include <netdev.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/t1040qds/t1040qds.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
#include <netdev.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/t104xrdb/t104xrdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <hwconfig.h>
#include <init.h>
#include <netdev.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/t208xqds/t208xqds.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
#include <netdev.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/t208xrdb/t208xrdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
#include <netdev.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/t4qds/t4240emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
#include <netdev.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/t4qds/t4240qds.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
#include <irq_func.h>
Expand Down
1 change: 1 addition & 0 deletions board/freescale/t4rdb/t4240rdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
#include <netdev.h>
Expand Down
1 change: 1 addition & 0 deletions board/hisilicon/hikey/hikey.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
#include <common.h>
#include <dm.h>
#include <fdt_support.h>
#include <dm/platform_data/serial_pl01x.h>
#include <errno.h>
#include <malloc.h>
Expand Down
1 change: 1 addition & 0 deletions board/ids/ids8313/ids8313.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <mpc83xx.h>
#include <spi.h>
#include <linux/libfdt.h>
Expand Down
1 change: 1 addition & 0 deletions board/keymile/km83xx/km83xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <common.h>
#include <env.h>
#include <fdt_support.h>
#include <init.h>
#include <ioports.h>
#include <mpc83xx.h>
Expand Down
1 change: 1 addition & 0 deletions board/keymile/kmp204x/kmp204x.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <init.h>
#include <netdev.h>
#include <linux/compiler.h>
Expand Down
1 change: 1 addition & 0 deletions board/sbc8349/sbc8349.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <ioports.h>
#include <mpc83xx.h>
#include <asm/mpc8349_pci.h>
Expand Down
1 change: 1 addition & 0 deletions board/ti/am43xx/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <common.h>
#include <eeprom.h>
#include <env.h>
#include <fdt_support.h>
#include <i2c.h>
#include <init.h>
#include <linux/errno.h>
Expand Down
1 change: 1 addition & 0 deletions board/ti/am57xx/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <common.h>
#include <env.h>
#include <fdt_support.h>
#include <init.h>
#include <palmas.h>
#include <sata.h>
Expand Down
1 change: 1 addition & 0 deletions board/ti/dra7xx/evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/
#include <common.h>
#include <env.h>
#include <fdt_support.h>
#include <init.h>
#include <palmas.h>
#include <sata.h>
Expand Down
1 change: 1 addition & 0 deletions board/tqc/tqm834x/tqm834x.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <ioports.h>
#include <mpc83xx.h>
#include <asm/mpc8349_pci.h>
Expand Down
1 change: 1 addition & 0 deletions board/varisys/cyrus/cyrus.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <env.h>
#include <fdt_support.h>
#include <init.h>
#include <netdev.h>
#include <linux/compiler.h>
Expand Down
1 change: 1 addition & 0 deletions board/ve8313/ve8313.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

#include <common.h>
#include <fdt_support.h>
#include <init.h>
#include <linux/libfdt.h>
#include <pci.h>
Expand Down
12 changes: 0 additions & 12 deletions include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ void hang (void) __attribute__ ((noreturn));

#include <display_options.h>

/**
* arch_fixup_fdt() - Write arch-specific information to fdt
*
* Defined in arch/$(ARCH)/lib/bootm-fdt.c
*
* @blob: FDT blob to write to
* @return 0 if ok, or -ve FDT_ERR_... on failure
*/
int arch_fixup_fdt(void *blob);

/* common/cmd_source.c */
int source (ulong addr, const char *fit_uname);

Expand All @@ -90,8 +80,6 @@ void upmconfig (unsigned int, unsigned int *, unsigned int);
ulong get_tbclk (void);
void reset_misc (void);
void reset_cpu (ulong addr);
void ft_cpu_setup(void *blob, bd_t *bd);
void ft_pci_setup(void *blob, bd_t *bd);

/* $(CPU)/speed.c */
int get_clocks (void);
Expand Down
14 changes: 14 additions & 0 deletions include/fdt_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@
#include <asm/u-boot.h>
#include <linux/libfdt.h>

/**
* arch_fixup_fdt() - Write arch-specific information to fdt
*
* Defined in arch/$(ARCH)/lib/bootm-fdt.c
*
* @blob: FDT blob to write to
* @return 0 if ok, or -ve FDT_ERR_... on failure
*/
int arch_fixup_fdt(void *blob);

void ft_cpu_setup(void *blob, bd_t *bd);

void ft_pci_setup(void *blob, bd_t *bd);

u32 fdt_getprop_u32_default_node(const void *fdt, int off, int cell,
const char *prop, const u32 dflt);
u32 fdt_getprop_u32_default(const void *fdt, const char *path,
Expand Down

0 comments on commit 807765b

Please sign in to comment.