164dbbd40SGerald Van Baren /* 264dbbd40SGerald Van Baren * (C) Copyright 2007 364dbbd40SGerald Van Baren * Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com 464dbbd40SGerald Van Baren * 564dbbd40SGerald Van Baren * See file CREDITS for list of people who contributed to this 664dbbd40SGerald Van Baren * project. 764dbbd40SGerald Van Baren * 864dbbd40SGerald Van Baren * This program is free software; you can redistribute it and/or 964dbbd40SGerald Van Baren * modify it under the terms of the GNU General Public License as 1064dbbd40SGerald Van Baren * published by the Free Software Foundation; either version 2 of 1164dbbd40SGerald Van Baren * the License, or (at your option) any later version. 1264dbbd40SGerald Van Baren * 1364dbbd40SGerald Van Baren * This program is distributed in the hope that it will be useful, 1464dbbd40SGerald Van Baren * but WITHOUT ANY WARRANTY; without even the implied warranty of 1564dbbd40SGerald Van Baren * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1664dbbd40SGerald Van Baren * GNU General Public License for more details. 1764dbbd40SGerald Van Baren * 1864dbbd40SGerald Van Baren * You should have received a copy of the GNU General Public License 1964dbbd40SGerald Van Baren * along with this program; if not, write to the Free Software 2064dbbd40SGerald Van Baren * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 2164dbbd40SGerald Van Baren * MA 02111-1307 USA 2264dbbd40SGerald Van Baren */ 2364dbbd40SGerald Van Baren 2464dbbd40SGerald Van Baren #ifndef __FDT_SUPPORT_H 2564dbbd40SGerald Van Baren #define __FDT_SUPPORT_H 2664dbbd40SGerald Van Baren 2764dbbd40SGerald Van Baren #ifdef CONFIG_OF_LIBFDT 2864dbbd40SGerald Van Baren 2964dbbd40SGerald Van Baren #include <fdt.h> 3064dbbd40SGerald Van Baren 3164dbbd40SGerald Van Baren int fdt_chosen(void *fdt, ulong initrd_start, ulong initrd_end, int force); 32*2a1a2cb6SKumar Gala int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force); 33e93becf8SKumar Gala void do_fixup_by_path(void *fdt, const char *path, const char *prop, 34e93becf8SKumar Gala const void *val, int len, int create); 35e93becf8SKumar Gala void do_fixup_by_path_u32(void *fdt, const char *path, const char *prop, 36e93becf8SKumar Gala u32 val, int create); 379eb77ceaSKumar Gala void do_fixup_by_prop(void *fdt, 389eb77ceaSKumar Gala const char *pname, const void *pval, int plen, 399eb77ceaSKumar Gala const char *prop, const void *val, int len, 409eb77ceaSKumar Gala int create); 419eb77ceaSKumar Gala void do_fixup_by_prop_u32(void *fdt, 429eb77ceaSKumar Gala const char *pname, const void *pval, int plen, 439eb77ceaSKumar Gala const char *prop, u32 val, int create); 449eb77ceaSKumar Gala void do_fixup_by_compat(void *fdt, const char *compat, 459eb77ceaSKumar Gala const char *prop, const void *val, int len, int create); 469eb77ceaSKumar Gala void do_fixup_by_compat_u32(void *fdt, const char *compat, 479eb77ceaSKumar Gala const char *prop, u32 val, int create); 483c927281SKumar Gala int fdt_fixup_memory(void *blob, u64 start, u64 size); 49ba37aa03SKumar Gala void fdt_fixup_ethernet(void *fdt); 5022fb2246SMatthias Fuchs int fdt_find_and_setprop(void *fdt, const char *node, const char *prop, 5122fb2246SMatthias Fuchs const void *val, int len, int create); 52b8ec2385STimur Tabi void fdt_fixup_qe_firmware(void *fdt); 5364dbbd40SGerald Van Baren 5418e69a35SAnton Vorontsov #ifdef CONFIG_HAS_FSL_DR_USB 5518e69a35SAnton Vorontsov void fdt_fixup_dr_usb(void *blob, bd_t *bd); 5618e69a35SAnton Vorontsov #else 5718e69a35SAnton Vorontsov static inline void fdt_fixup_dr_usb(void *blob, bd_t *bd) {} 5818e69a35SAnton Vorontsov #endif /* CONFIG_HAS_FSL_DR_USB */ 5918e69a35SAnton Vorontsov 606b70ffb9SKim Phillips #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC83XX) 616b70ffb9SKim Phillips void fdt_fixup_crypto_node(void *blob, int sec_rev); 626b70ffb9SKim Phillips #else 636b70ffb9SKim Phillips static inline void fdt_fixup_crypto_node(void *blob, int sec_rev) {} 646b70ffb9SKim Phillips #endif 656b70ffb9SKim Phillips 66e125a2ffSGerald Van Baren #ifdef CONFIG_OF_BOARD_SETUP 67e125a2ffSGerald Van Baren void ft_board_setup(void *blob, bd_t *bd); 68e125a2ffSGerald Van Baren void ft_cpu_setup(void *blob, bd_t *bd); 69e125a2ffSGerald Van Baren void ft_pci_setup(void *blob, bd_t *bd); 70e125a2ffSGerald Van Baren #endif 71e125a2ffSGerald Van Baren 7254f9c866SKumar Gala void set_working_fdt_addr(void *addr); 733082d234SKumar Gala int fdt_resize(void *blob); 7454f9c866SKumar Gala 7564dbbd40SGerald Van Baren #endif /* ifdef CONFIG_OF_LIBFDT */ 7664dbbd40SGerald Van Baren #endif /* ifndef __FDT_SUPPORT_H */ 77