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()
147 free_mem -= size; in prom_early_alloc()
162 static phandle __init olpc_dt_finddevice(const char *path) in olpc_dt_finddevice()
164 phandle node; in olpc_dt_finddevice()
173 if ((s32) node == -1) in olpc_dt_finddevice()
187 return -1; in olpc_dt_interpret()
199 phandle node; in olpc_dt_get_board_revision()
207 r = olpc_dt_getproperty(node, "board-revision-int", in olpc_dt_get_board_revision()
215 static int __init olpc_dt_compatible_match(phandle node, const char *compat) in olpc_dt_compatible_match()
235 phandle node; in olpc_dt_fixup()
247 /* XO-1.5 */ in olpc_dt_fixup()
249 if (olpc_dt_compatible_match(node, "olpc,xo1.5-battery")) in olpc_dt_fixup()
252 /* Add olpc,xo1.5-battery compatible marker to battery node */ in olpc_dt_fixup()
253 olpc_dt_interpret("\" /battery@0\" find-device"); in olpc_dt_fixup()
254 olpc_dt_interpret(" \" olpc,xo1.5-battery\" +compatible"); in olpc_dt_fixup()
255 olpc_dt_interpret("device-end"); in olpc_dt_fixup()
257 if (olpc_dt_compatible_match(node, "olpc,xo1-battery")) { in olpc_dt_fixup()
259 * If we have a olpc,xo1-battery compatible, then we're in olpc_dt_fixup()
260 * running a new enough firmware that already has in olpc_dt_fixup()
267 olpc_dt_interpret("\" /pci/display@1\" find-device"); in olpc_dt_fixup()
268 olpc_dt_interpret(" new-device"); in olpc_dt_fixup()
269 olpc_dt_interpret(" \" dcon\" device-name"); in olpc_dt_fixup()
270 olpc_dt_interpret(" \" olpc,xo1-dcon\" +compatible"); in olpc_dt_fixup()
271 olpc_dt_interpret(" finish-device"); in olpc_dt_fixup()
272 olpc_dt_interpret("device-end"); in olpc_dt_fixup()
274 /* XO-1 */ in olpc_dt_fixup()
276 if (olpc_dt_compatible_match(node, "olpc,xo1-battery")) { in olpc_dt_fixup()
278 * If we have a olpc,xo1-battery compatible, then we're in olpc_dt_fixup()
279 * running a new enough firmware that already has in olpc_dt_fixup()
285 /* Add dcon device, mark RTC as olpc,xo1-rtc */ in olpc_dt_fixup()
286 olpc_dt_interpret("\" /pci/display@1,1\" find-device"); in olpc_dt_fixup()
287 olpc_dt_interpret(" new-device"); in olpc_dt_fixup()
288 olpc_dt_interpret(" \" dcon\" device-name"); in olpc_dt_fixup()
289 olpc_dt_interpret(" \" olpc,xo1-dcon\" +compatible"); in olpc_dt_fixup()
290 olpc_dt_interpret(" finish-device"); in olpc_dt_fixup()
291 olpc_dt_interpret("device-end"); in olpc_dt_fixup()
293 olpc_dt_interpret("\" /rtc\" find-device"); in olpc_dt_fixup()
294 olpc_dt_interpret(" \" olpc,xo1-rtc\" +compatible"); in olpc_dt_fixup()
295 olpc_dt_interpret("device-end"); in olpc_dt_fixup()
298 /* Add olpc,xo1-battery compatible marker to battery node */ in olpc_dt_fixup()
299 olpc_dt_interpret("\" /battery@0\" find-device"); in olpc_dt_fixup()
300 olpc_dt_interpret(" \" olpc,xo1-battery\" +compatible"); in olpc_dt_fixup()
301 olpc_dt_interpret("device-end"); in olpc_dt_fixup()
306 phandle root; in olpc_dt_build_devicetree()