1
2
3
4
5
6#ifndef FT_BUILD_H
7#define FT_BUILD_H
8
9#include <linux/types.h>
10#include <asm/u-boot.h>
11
12
13#define OF_DT_HEADER 0xd00dfeed
14#define OF_DT_BEGIN_NODE 0x1
15#define OF_DT_END_NODE 0x2
16#define OF_DT_PROP 0x3
17
18#define OF_DT_NOP 0x4
19#define OF_DT_END 0x9
20
21#define OF_DT_VERSION 0x10
22
23struct boot_param_header {
24 u32 magic;
25 u32 totalsize;
26 u32 off_dt_struct;
27 u32 off_dt_strings;
28 u32 off_mem_rsvmap;
29 u32 version;
30 u32 last_comp_version;
31
32 u32 boot_cpuid_phys;
33
34 u32 dt_strings_size;
35};
36
37struct ft_cxt {
38 struct boot_param_header *bph;
39 u8 *p_rsvmap;
40 u8 *p_start;
41 u8 *p_end;
42 u8 *p;
43};
44
45void ft_begin_node(struct ft_cxt *cxt, const char *name);
46void ft_init_cxt(struct ft_cxt *cxt, void *blob);
47void ft_end_node(struct ft_cxt *cxt);
48
49void ft_end_tree(struct ft_cxt *cxt);
50void ft_finalize_tree(struct ft_cxt *cxt);
51
52void ft_nop(struct ft_cxt *cxt);
53void ft_prop(struct ft_cxt *cxt, const char *name, const void *data, int sz);
54void ft_prop_str(struct ft_cxt *cxt, const char *name, const char *str);
55void ft_prop_int(struct ft_cxt *cxt, const char *name, int val);
56void ft_begin(struct ft_cxt *cxt, void *blob, int max_size);
57void ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
58
59void ft_setup(void *blob, bd_t * bd, ulong initrd_start, ulong initrd_end);
60
61void ft_dump_blob(const void *bphp);
62void ft_merge_blob(struct ft_cxt *cxt, void *blob);
63void *ft_get_prop(void *bphp, const char *propname, int *szp);
64
65#ifdef CONFIG_OF_BOARD_SETUP
66void ft_board_setup(void *blob, bd_t *bd);
67void ft_cpu_setup(void *blob, bd_t *bd);
68void ft_pci_setup(void *blob, bd_t *bd);
69#endif
70
71#endif
72