xref: /freebsd/share/man/man9/ofw_bus_status_okay.9 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1f510c340SOleksandr Tymoshenko.\" -*- nroff -*-
2f510c340SOleksandr Tymoshenko.\"
3f510c340SOleksandr Tymoshenko.\" Copyright (c) 2018 Oleksandr Tymoshenko
4f510c340SOleksandr Tymoshenko.\"
5f510c340SOleksandr Tymoshenko.\" All rights reserved.
6f510c340SOleksandr Tymoshenko.\"
7f510c340SOleksandr Tymoshenko.\" This program is free software.
8f510c340SOleksandr Tymoshenko.\"
9f510c340SOleksandr Tymoshenko.\" Redistribution and use in source and binary forms, with or without
10f510c340SOleksandr Tymoshenko.\" modification, are permitted provided that the following conditions
11f510c340SOleksandr Tymoshenko.\" are met:
12f510c340SOleksandr Tymoshenko.\" 1. Redistributions of source code must retain the above copyright
13f510c340SOleksandr Tymoshenko.\"    notice, this list of conditions and the following disclaimer.
14f510c340SOleksandr Tymoshenko.\" 2. Redistributions in binary form must reproduce the above copyright
15f510c340SOleksandr Tymoshenko.\"    notice, this list of conditions and the following disclaimer in the
16f510c340SOleksandr Tymoshenko.\"    documentation and/or other materials provided with the distribution.
17f510c340SOleksandr Tymoshenko.\"
18f510c340SOleksandr Tymoshenko.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
19f510c340SOleksandr Tymoshenko.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20f510c340SOleksandr Tymoshenko.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21f510c340SOleksandr Tymoshenko.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
22f510c340SOleksandr Tymoshenko.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23f510c340SOleksandr Tymoshenko.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24f510c340SOleksandr Tymoshenko.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25f510c340SOleksandr Tymoshenko.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26f510c340SOleksandr Tymoshenko.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27f510c340SOleksandr Tymoshenko.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28f510c340SOleksandr Tymoshenko.\"
29f510c340SOleksandr Tymoshenko.Dd April 8, 2018
30f510c340SOleksandr Tymoshenko.Dt ofw_bus_status_okay 9
31f510c340SOleksandr Tymoshenko.Os
32f510c340SOleksandr Tymoshenko.Sh NAME
33*0492f403SGordon Bergling.Nm ofw_bus_get_status ,
34*0492f403SGordon Bergling.Nm ofw_bus_status_okay ,
35f510c340SOleksandr Tymoshenko.Nm ofw_bus_node_status_okay
36f510c340SOleksandr Tymoshenko.Nd check status of the device tree node
37f510c340SOleksandr Tymoshenko.Sh SYNOPSIS
38f510c340SOleksandr Tymoshenko.In dev/ofw/openfirm.h
39f510c340SOleksandr Tymoshenko.In dev/ofw/ofw_bus.h
40f510c340SOleksandr Tymoshenko.In dev/ofw/ofw_bus_subr.h
41f510c340SOleksandr Tymoshenko.Ft const char *
42f510c340SOleksandr Tymoshenko.Fn ofw_bus_get_status "device_t dev"
43f510c340SOleksandr Tymoshenko.Ft int
44f510c340SOleksandr Tymoshenko.Fn ofw_bus_status_okay "device_t dev"
45f510c340SOleksandr Tymoshenko.Ft int
46f510c340SOleksandr Tymoshenko.Fn ofw_bus_node_status_okay "phandle_t node"
47f510c340SOleksandr Tymoshenko.Sh DESCRIPTION
48f510c340SOleksandr TymoshenkoThe "status" property of the device tree node indicates whether the device is
49f510c340SOleksandr Tymoshenkoenabled or not.
50f510c340SOleksandr TymoshenkoMultiple hardware versions might be built using the same base System-on-Chip
51f510c340SOleksandr Tymoshenkobut with a different set of blocks enabled.
52f510c340SOleksandr TymoshenkoIt is common to use  SoC device tree and only enable/disable device nodes for
53f510c340SOleksandr Tymoshenkothe derivative boards.
54f510c340SOleksandr TymoshenkoThe device tree node is considered enabled only if it has "status" property
55f510c340SOleksandr Tymoshenkowith the value set to either "ok" or "okay".
56f510c340SOleksandr Tymoshenko.Pp
57f510c340SOleksandr Tymoshenko.Fn ofw_bus_get_status
58f510c340SOleksandr Tymoshenkoreturns the value of the "status" property of the device tree node associated with the device
59f510c340SOleksandr Tymoshenko.Fa dev .
60f510c340SOleksandr TymoshenkoIf the node does not have "status" property or there is no node associated with
61f510c340SOleksandr Tymoshenkothe device the function returns NULL.
62f510c340SOleksandr Tymoshenko.Pp
63f510c340SOleksandr Tymoshenko.Fn ofw_bus_status_okay
64f510c340SOleksandr Tymoshenkoreturns 1 if the device tree node associated with the device
65f510c340SOleksandr Tymoshenko.Fa dev
66f510c340SOleksandr Tymoshenkohas "status" property and its value is either "ok" or "okay".
67f510c340SOleksandr Tymoshenko.Pp
68f510c340SOleksandr Tymoshenko.Fn ofw_bus_node_status_okay
69f510c340SOleksandr Tymoshenkoreturns 1 if the device tree node
70f510c340SOleksandr Tymoshenko.Fa node
71f510c340SOleksandr Tymoshenkohas "status" property and its value is either "ok" or "okay".
72f510c340SOleksandr Tymoshenko.Sh AUTHORS
73f510c340SOleksandr TymoshenkoThis manual page was written by
74f510c340SOleksandr Tymoshenko.An Oleksandr Tymoshenko .
75