Lines Matching +full:resource +full:- +full:attachments
1 /*-
2 * Copyright (c) 2015-2016 Landon Fuller <landon@landonf.org>
38 * Abstract driver for memory-mapped SPROM devices.
51 #include <machine/resource.h>
69 /* Refuse wildcard attachments */ in bhnd_sprom_probe()
87 * Assumes SPROM is mapped via SYS_RES_MEMORY resource with RID 0.
103 sc->dev = dev; in bhnd_sprom_attach()
104 sc->store = NULL; in bhnd_sprom_attach()
109 /* Allocate SPROM resource */ in bhnd_sprom_attach()
118 r_size = rman_get_size(r->res); in bhnd_sprom_attach()
119 if (r_size <= offset || (r_size - offset) > BUS_SPACE_MAXSIZE) { in bhnd_sprom_attach()
125 sprom_size = r_size - offset; in bhnd_sprom_attach()
128 * must be 16-bit aligned */ in bhnd_sprom_attach()
136 error = bhnd_nvram_store_parse_new(&sc->store, io, in bhnd_sprom_attach()
141 /* Clean up our temporary I/O context and its backing resource */ in bhnd_sprom_attach()
158 /* Clean up I/O context before releasing its backing resource */ in bhnd_sprom_attach()
165 if (sc->store != NULL) in bhnd_sprom_attach()
166 bhnd_nvram_store_free(sc->store); in bhnd_sprom_attach()
203 bhnd_nvram_store_free(sc->store); in bhnd_sprom_detach()
217 return (bhnd_nvram_store_getvar(sc->store, name, buf, len, type)); in bhnd_sprom_getvar_method()
229 return (bhnd_nvram_store_setvar(sc->store, name, buf, len, type)); in bhnd_sprom_setvar_method()