/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2015-2016 Landon Fuller <[email protected]>4* Copyright (c) 2017 The FreeBSD Foundation5* All rights reserved.6*7* Portions of this software were developed by Landon Fuller8* under sponsorship from the FreeBSD Foundation.9*10* Redistribution and use in source and binary forms, with or without11* modification, are permitted provided that the following conditions12* are met:13* 1. Redistributions of source code must retain the above copyright14* notice, this list of conditions and the following disclaimer,15* without modification.16* 2. Redistributions in binary form must reproduce at minimum a disclaimer17* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any18* redistribution must be conditioned upon including a substantially19* similar Disclaimer requirement for further binary redistribution.20*21* NO WARRANTY22* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS23* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT24* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY25* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL26* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,27* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF28* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS29* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER30* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)31* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF32* THE POSSIBILITY OF SUCH DAMAGES.33*34*/3536#ifndef _BHND_BHNDVAR_H_37#define _BHND_BHNDVAR_H_3839#include <sys/param.h>40#include <sys/bus.h>41#include <sys/malloc.h>4243#include "bhnd.h"4445/*46* Definitions shared by bhnd(4) bus and bhndb(4) bridge driver implementations.47*/4849MALLOC_DECLARE(M_BHND);50DECLARE_CLASS(bhnd_driver);5152struct bhnd_core_clkctl;5354struct bhnd_core_clkctl *bhnd_alloc_core_clkctl(device_t dev,55device_t pmu_dev, struct bhnd_resource *r,56bus_size_t offset, u_int max_latency);57void bhnd_free_core_clkctl(58struct bhnd_core_clkctl *clkctl);59int bhnd_core_clkctl_wait(60struct bhnd_core_clkctl *clkctl,61uint32_t value, uint32_t mask);6263int bhnd_generic_attach(device_t dev);64int bhnd_generic_detach(device_t dev);65int bhnd_generic_shutdown(device_t dev);66int bhnd_generic_resume(device_t dev);67int bhnd_generic_suspend(device_t dev);6869int bhnd_generic_get_probe_order(device_t dev,70device_t child);7172int bhnd_generic_alloc_pmu(device_t dev,73device_t child);74int bhnd_generic_release_pmu(device_t dev,75device_t child);76int bhnd_generic_get_clock_latency(device_t dev,77device_t child, bhnd_clock clock,78u_int *latency);79int bhnd_generic_get_clock_freq(device_t dev,80device_t child, bhnd_clock clock,81u_int *freq);82int bhnd_generic_request_clock(device_t dev,83device_t child, bhnd_clock clock);84int bhnd_generic_enable_clocks(device_t dev,85device_t child, uint32_t clocks);86int bhnd_generic_request_ext_rsrc(device_t dev,87device_t child, u_int rsrc);88int bhnd_generic_release_ext_rsrc(device_t dev,89device_t child, u_int rsrc);9091int bhnd_generic_print_child(device_t dev,92device_t child);93void bhnd_generic_probe_nomatch(device_t dev,94device_t child);9596void bhnd_generic_child_deleted(device_t dev,97device_t child);98int bhnd_generic_suspend_child(device_t dev,99device_t child);100int bhnd_generic_resume_child(device_t dev,101device_t child);102103int bhnd_generic_setup_intr(device_t dev,104device_t child, struct resource *irq,105int flags, driver_filter_t *filter,106driver_intr_t *intr, void *arg,107void **cookiep);108109int bhnd_generic_get_nvram_var(device_t dev,110device_t child, const char *name,111void *buf, size_t *size,112bhnd_nvram_type type);113114/**115* bhnd driver instance state. Must be first member of all subclass116* softc structures.117*/118struct bhnd_softc {119device_t dev; /**< bus device */120};121122#endif /* _BHND_BHNDVAR_H_ */123124125