Lines Matching +full:syscon +full:- +full:dev

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
39 #include <dev/syscon/syscon.h>
40 #include <dev/hwreset/hwreset.h>
42 #include <dev/ofw/ofw_bus.h>
43 #include <dev/ofw/ofw_bus_subr.h>
44 #include <dev/ofw/openfirm.h>
50 device_t dev; member
52 struct syscon *syscon; member
58 #define ERST_LOCK(sc) mtx_lock(&(sc)->mtx)
59 #define ERST_UNLOCK(sc) mtx_unlock(&(sc)->mtx)
60 #define ERST_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED);
61 #define ERST_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED);
64 SYSCON_READ_4(sc->syscon, (_reg))
66 SYSCON_WRITE_4(sc->syscon, (_reg), (_val))
69 { "eswin,eic7700-reset", 1 },
74 eswin_rst_probe(device_t dev) in eswin_rst_probe() argument
77 if (!ofw_bus_status_okay(dev)) in eswin_rst_probe()
80 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in eswin_rst_probe()
83 device_set_desc(dev, "Eswin Reset"); in eswin_rst_probe()
89 eswin_rst_attach(device_t dev) in eswin_rst_attach() argument
94 sc = device_get_softc(dev); in eswin_rst_attach()
95 sc->dev = dev; in eswin_rst_attach()
97 error = syscon_get_by_ofw_node(dev, OF_parent(ofw_bus_get_node(dev)), in eswin_rst_attach()
98 &sc->syscon); in eswin_rst_attach()
100 device_printf(dev, "Couldn't get syscon handle of parent\n"); in eswin_rst_attach()
104 mtx_init(&sc->mtx, device_get_nameunit(sc->dev), NULL, MTX_DEF); in eswin_rst_attach()
106 hwreset_register_ofw_provider(dev); in eswin_rst_attach()
112 eswin_rst_reset_assert(device_t dev, intptr_t id, bool reset) in eswin_rst_reset_assert() argument
119 sc = device_get_softc(dev); in eswin_rst_reset_assert()
137 eswin_rst_reset_is_asserted(device_t dev, intptr_t id, bool *reset) in eswin_rst_reset_is_asserted() argument
144 sc = device_get_softc(dev); in eswin_rst_reset_is_asserted()