Lines Matching +full:firmware +full:- +full:phandle

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * OLPC-specific OFW device tree support code.
6 * Copyright (C) 1996-2005 Paul Mackerras.
22 static phandle __init olpc_dt_getsibling(phandle node) in olpc_dt_getsibling()
27 if ((s32)node == -1) in olpc_dt_getsibling()
30 if (olpc_ofw("peer", args, res) || (s32)node == -1) in olpc_dt_getsibling()
36 static phandle __init olpc_dt_getchild(phandle node) in olpc_dt_getchild()
41 if ((s32)node == -1) in olpc_dt_getchild()
44 if (olpc_ofw("child", args, res) || (s32)node == -1) { in olpc_dt_getchild()
52 static int __init olpc_dt_getproplen(phandle node, const char *prop) in olpc_dt_getproplen()
58 if ((s32)node == -1) in olpc_dt_getproplen()
59 return -1; in olpc_dt_getproplen()
63 return -1; in olpc_dt_getproplen()
69 static int __init olpc_dt_getproperty(phandle node, const char *prop, in olpc_dt_getproperty()
76 return -1; in olpc_dt_getproperty()
83 return -1; in olpc_dt_getproperty()
90 static int __init olpc_dt_nextprop(phandle node, char *prev, char *buf) in olpc_dt_nextprop()
98 if ((s32)node == -1) in olpc_dt_nextprop()
99 return -1; in olpc_dt_nextprop()
102 return -1; in olpc_dt_nextprop()
107 static int __init olpc_dt_pkg2path(phandle node, char *buf, in olpc_dt_pkg2path()
113 if ((s32)node == -1) in olpc_dt_pkg2path()
114 return -1; in olpc_dt_pkg2path()
116 if (olpc_ofw("package-to-path", args, res) || *len < 1) in olpc_dt_pkg2path()
117 return -1; in olpc_dt_pkg2path()
151 free_mem -= size; in prom_early_alloc()
166 static phandle __init olpc_dt_finddevice(const char *path) in olpc_dt_finddevice()
168 phandle node; in olpc_dt_finddevice()
177 if ((s32) node == -1) in olpc_dt_finddevice()
191 return -1; in olpc_dt_interpret()
203 phandle node; in olpc_dt_get_board_revision()
211 r = olpc_dt_getproperty(node, "board-revision-int", in olpc_dt_get_board_revision()
219 static int __init olpc_dt_compatible_match(phandle node, const char *compat) in olpc_dt_compatible_match()
239 phandle node; in olpc_dt_fixup()
251 /* XO-1.5 */ in olpc_dt_fixup()
253 if (olpc_dt_compatible_match(node, "olpc,xo1.5-battery")) in olpc_dt_fixup()
256 /* Add olpc,xo1.5-battery compatible marker to battery node */ in olpc_dt_fixup()
257 olpc_dt_interpret("\" /battery@0\" find-device"); in olpc_dt_fixup()
258 olpc_dt_interpret(" \" olpc,xo1.5-battery\" +compatible"); in olpc_dt_fixup()
259 olpc_dt_interpret("device-end"); in olpc_dt_fixup()
261 if (olpc_dt_compatible_match(node, "olpc,xo1-battery")) { in olpc_dt_fixup()
263 * If we have a olpc,xo1-battery compatible, then we're in olpc_dt_fixup()
264 * running a new enough firmware that already has in olpc_dt_fixup()
271 olpc_dt_interpret("\" /pci/display@1\" find-device"); in olpc_dt_fixup()
272 olpc_dt_interpret(" new-device"); in olpc_dt_fixup()
273 olpc_dt_interpret(" \" dcon\" device-name"); in olpc_dt_fixup()
274 olpc_dt_interpret(" \" olpc,xo1-dcon\" +compatible"); in olpc_dt_fixup()
275 olpc_dt_interpret(" finish-device"); in olpc_dt_fixup()
276 olpc_dt_interpret("device-end"); in olpc_dt_fixup()
278 /* XO-1 */ in olpc_dt_fixup()
280 if (olpc_dt_compatible_match(node, "olpc,xo1-battery")) { in olpc_dt_fixup()
282 * If we have a olpc,xo1-battery compatible, then we're in olpc_dt_fixup()
283 * running a new enough firmware that already has in olpc_dt_fixup()
289 /* Add dcon device, mark RTC as olpc,xo1-rtc */ in olpc_dt_fixup()
290 olpc_dt_interpret("\" /pci/display@1,1\" find-device"); in olpc_dt_fixup()
291 olpc_dt_interpret(" new-device"); in olpc_dt_fixup()
292 olpc_dt_interpret(" \" dcon\" device-name"); in olpc_dt_fixup()
293 olpc_dt_interpret(" \" olpc,xo1-dcon\" +compatible"); in olpc_dt_fixup()
294 olpc_dt_interpret(" finish-device"); in olpc_dt_fixup()
295 olpc_dt_interpret("device-end"); in olpc_dt_fixup()
297 olpc_dt_interpret("\" /rtc\" find-device"); in olpc_dt_fixup()
298 olpc_dt_interpret(" \" olpc,xo1-rtc\" +compatible"); in olpc_dt_fixup()
299 olpc_dt_interpret("device-end"); in olpc_dt_fixup()
302 /* Add olpc,xo1-battery compatible marker to battery node */ in olpc_dt_fixup()
303 olpc_dt_interpret("\" /battery@0\" find-device"); in olpc_dt_fixup()
304 olpc_dt_interpret(" \" olpc,xo1-battery\" +compatible"); in olpc_dt_fixup()
305 olpc_dt_interpret("device-end"); in olpc_dt_fixup()
310 phandle root; in olpc_dt_build_devicetree()