From c654b5172a65faba2b541ee1fda1738534d47241 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 23 Oct 2014 18:58:54 -0600 Subject: fdt: Add ft_system_setup() function for system device tree additions Add an additional function for adding information to the device tree before booting. This permits additions which are not board-specific. Signed-off-by: Simon Glass Acked-by: Anatolij Gustschin Reviewed-by: Tom Rini --- include/fdt_support.h | 12 ++++++++++++ include/image.h | 6 ++++++ 2 files changed, 18 insertions(+) (limited to 'include') diff --git a/include/fdt_support.h b/include/fdt_support.h index a101306..0fbc9bd 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -88,6 +88,18 @@ void ft_board_setup_ex(void *blob, bd_t *bd); void ft_cpu_setup(void *blob, bd_t *bd); void ft_pci_setup(void *blob, bd_t *bd); +/** + * Add system-specific data to the FDT before booting the OS. + * + * Use CONFIG_SYS_FDT_PAD to ensure there is sufficient space. + * This function is called if CONFIG_OF_SYSTEM_SETUP is defined + * + * @param blob FDT blob to update + * @param bd_t Pointer to board data + * @return 0 if ok, or -FDT_ERR_... on error + */ +int ft_system_setup(void *blob, bd_t *bd); + void set_working_fdt_addr(void *addr); int fdt_shrink_to_minimum(void *blob); int fdt_increase_size(void *fdt, int add_len); diff --git a/include/image.h b/include/image.h index 07e9aed..af30d60 100644 --- a/include/image.h +++ b/include/image.h @@ -119,6 +119,12 @@ struct lmb; # define IMAGE_OF_BOARD_SETUP 0 #endif +#ifdef CONFIG_OF_SYSTEM_SETUP +# define IMAGE_OF_SYSTEM_SETUP 1 +#else +# define IMAGE_OF_SYSTEM_SETUP 0 +#endif + /* * Operating System Codes */ -- cgit v1.1