1 /* Copyright 2013-2014 IBM Corp.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * 	http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12  * implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __HDATA_H
18 #define __HDATA_H
19 
20 #include <processor.h>
21 
22 struct dt_node;
23 
24 extern void memory_parse(void);
25 extern int paca_parse(void);
26 extern bool pcia_parse(void);
27 extern void fsp_parse(void);
28 extern void bmc_parse(void);
29 extern void io_parse(void);
30 extern void dt_init_vpd_node(void);
31 extern struct dt_node *dt_add_vpd_node(const struct HDIF_common_hdr *hdr,
32 				       int indx_fru, int indx_vpd);
33 extern void vpd_parse(void);
34 extern void vpd_data_parse(struct dt_node *node,
35 			   const void *fruvpd, u32 fruvpd_sz);
36 
37 extern struct dt_node *find_xscom_for_chip(uint32_t chip_id);
38 extern uint32_t pcid_to_chip_id(uint32_t proc_chip_id);
39 
40 extern struct dt_node *add_core_common(struct dt_node *cpus,
41 				       const struct sppaca_cpu_cache *cache,
42 				       const struct sppaca_cpu_timebase *tb,
43 				       uint32_t int_server, bool okay);
44 extern void add_core_attr(struct dt_node *cpu, uint32_t attr);
45 extern uint32_t add_core_cache_info(struct dt_node *cpus,
46 				    const struct sppcia_cpu_cache *cache,
47 				    uint32_t int_server, int okay);
48 extern const struct slca_entry *slca_get_entry(uint16_t slca_index);
49 extern const char *slca_get_vpd_name(uint16_t slca_index);
50 extern const char *slca_get_loc_code_index(uint16_t slca_index);
51 extern void slca_vpd_add_loc_code(struct dt_node *node, uint16_t slca_index);
52 extern void slca_dt_add_sai_node(void);
53 extern void dt_add_proc_vendor(struct dt_node *proc_node,
54 			       const void *mvpd, unsigned int mvpd_sz);
55 
56 extern bool hservices_from_hdat(const void *fdt, size_t size);
57 int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
58 	struct dt_node *xscom);
59 extern void node_stb_parse(void);
60 
61 /* used to look up the device-tree node representing a slot */
62 struct dt_node *find_slot_entry_node(struct dt_node *root, u32 entry_id);
63 
64 #endif /* __HDATA_H */
65 
66