Home | History | Annotate | Line # | Download | only in fdt
fdtvar.h revision 1.70.12.2
      1  1.70.12.2   thorpej /* $NetBSD: fdtvar.h,v 1.70.12.2 2022/01/18 00:14:20 thorpej Exp $ */
      2        1.1  jmcneill 
      3        1.1  jmcneill /*-
      4        1.1  jmcneill  * Copyright (c) 2015 Jared D. McNeill <jmcneill (at) invisible.ca>
      5        1.1  jmcneill  * All rights reserved.
      6        1.1  jmcneill  *
      7        1.1  jmcneill  * Redistribution and use in source and binary forms, with or without
      8        1.1  jmcneill  * modification, are permitted provided that the following conditions
      9        1.1  jmcneill  * are met:
     10        1.1  jmcneill  * 1. Redistributions of source code must retain the above copyright
     11        1.1  jmcneill  *    notice, this list of conditions and the following disclaimer.
     12        1.1  jmcneill  * 2. Redistributions in binary form must reproduce the above copyright
     13        1.1  jmcneill  *    notice, this list of conditions and the following disclaimer in the
     14        1.1  jmcneill  *    documentation and/or other materials provided with the distribution.
     15        1.1  jmcneill  *
     16        1.1  jmcneill  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     17        1.1  jmcneill  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     18        1.1  jmcneill  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     19        1.1  jmcneill  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     20        1.1  jmcneill  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     21        1.1  jmcneill  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     22        1.1  jmcneill  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     23        1.1  jmcneill  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     24        1.1  jmcneill  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     25        1.1  jmcneill  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     26        1.1  jmcneill  * SUCH DAMAGE.
     27        1.1  jmcneill  */
     28        1.1  jmcneill 
     29       1.62     skrll #ifndef _DEV_FDT_FDTVAR_H_
     30       1.62     skrll #define _DEV_FDT_FDTVAR_H_
     31        1.1  jmcneill 
     32        1.1  jmcneill #include <sys/types.h>
     33        1.1  jmcneill #include <sys/bus.h>
     34       1.46   thorpej #include <sys/gpio.h>
     35       1.19  jmcneill #include <sys/termios.h>
     36        1.1  jmcneill 
     37        1.1  jmcneill #include <dev/i2c/i2cvar.h>
     38       1.30  jmcneill #include <dev/pwm/pwmvar.h>
     39        1.3  jmcneill #include <dev/clk/clk.h>
     40       1.32  jmcneill 
     41       1.42  jakllsch #ifdef _KERNEL_OPT
     42       1.32  jmcneill #include "audio.h"
     43       1.42  jakllsch #endif
     44       1.32  jmcneill #if NAUDIO > 0
     45       1.51     isaki #include <dev/audio/audio_dai.h>
     46       1.32  jmcneill #else
     47       1.32  jmcneill typedef void *audio_dai_tag_t;
     48       1.32  jmcneill #endif
     49        1.1  jmcneill 
     50       1.11  jmcneill #include <dev/clock_subr.h>
     51       1.11  jmcneill 
     52        1.1  jmcneill #include <dev/ofw/openfirm.h>
     53        1.1  jmcneill 
     54        1.1  jmcneill struct fdt_attach_args {
     55        1.1  jmcneill 	const char *faa_name;
     56        1.1  jmcneill 	bus_space_tag_t faa_bst;
     57        1.1  jmcneill 	bus_dma_tag_t faa_dmat;
     58        1.1  jmcneill 	int faa_phandle;
     59       1.13  jmcneill 	int faa_quiet;
     60        1.1  jmcneill };
     61        1.1  jmcneill 
     62        1.1  jmcneill /* flags for fdtbus_intr_establish */
     63        1.1  jmcneill #define FDT_INTR_MPSAFE	__BIT(0)
     64        1.1  jmcneill 
     65       1.47   thorpej /* Interrupt trigger types defined by the FDT "interrupts" bindings. */
     66       1.47   thorpej #define	FDT_INTR_TYPE_POS_EDGE		__BIT(0)
     67       1.47   thorpej #define	FDT_INTR_TYPE_NEG_EDGE		__BIT(1)
     68       1.47   thorpej #define	FDT_INTR_TYPE_DOUBLE_EDGE	(FDT_INTR_TYPE_POS_EDGE | \
     69       1.47   thorpej 					 FDT_INTR_TYPE_NEG_EDGE)
     70       1.47   thorpej #define	FDT_INTR_TYPE_HIGH_LEVEL	__BIT(2)
     71       1.47   thorpej #define	FDT_INTR_TYPE_LOW_LEVEL		__BIT(3)
     72       1.47   thorpej 
     73        1.1  jmcneill struct fdtbus_interrupt_controller_func {
     74        1.7     marty 	void *	(*establish)(device_t, u_int *, int, int,
     75       1.65  jmcneill 			     int (*)(void *), void *, const char *);
     76        1.1  jmcneill 	void	(*disestablish)(device_t, void *);
     77        1.7     marty 	bool	(*intrstr)(device_t, u_int *, char *, size_t);
     78       1.59   thorpej 	void	(*mask)(device_t, void *);
     79       1.59   thorpej 	void	(*unmask)(device_t, void *);
     80        1.1  jmcneill };
     81        1.1  jmcneill 
     82        1.1  jmcneill struct fdtbus_gpio_controller;
     83        1.1  jmcneill 
     84        1.1  jmcneill struct fdtbus_gpio_pin {
     85        1.1  jmcneill 	struct fdtbus_gpio_controller *gp_gc;
     86        1.1  jmcneill 	void *gp_priv;
     87        1.1  jmcneill };
     88        1.1  jmcneill 
     89        1.1  jmcneill struct fdtbus_gpio_controller_func {
     90        1.1  jmcneill 	void *	(*acquire)(device_t, const void *, size_t, int);
     91        1.1  jmcneill 	void	(*release)(device_t, void *);
     92        1.4  jmcneill 	int	(*read)(device_t, void *, bool);
     93        1.4  jmcneill 	void	(*write)(device_t, void *, int, bool);
     94        1.1  jmcneill };
     95        1.1  jmcneill 
     96        1.5     marty struct fdtbus_pinctrl_controller;
     97        1.5     marty 
     98        1.5     marty struct fdtbus_pinctrl_pin {
     99        1.5     marty 	struct fdtbus_pinctrl_controller *pp_pc;
    100        1.5     marty 	void *pp_priv;
    101        1.5     marty };
    102        1.5     marty 
    103        1.5     marty struct fdtbus_pinctrl_controller_func {
    104       1.23  jmcneill 	int (*set_config)(device_t, const void *, size_t);
    105        1.5     marty };
    106        1.5     marty 
    107        1.1  jmcneill struct fdtbus_regulator_controller;
    108        1.1  jmcneill 
    109        1.1  jmcneill struct fdtbus_regulator {
    110        1.1  jmcneill 	struct fdtbus_regulator_controller *reg_rc;
    111        1.1  jmcneill };
    112        1.1  jmcneill 
    113        1.1  jmcneill struct fdtbus_regulator_controller_func {
    114        1.1  jmcneill 	int	(*acquire)(device_t);
    115        1.1  jmcneill 	void	(*release)(device_t);
    116        1.1  jmcneill 	int	(*enable)(device_t, bool);
    117       1.12  jmcneill 	int	(*set_voltage)(device_t, u_int, u_int);
    118       1.12  jmcneill 	int	(*get_voltage)(device_t, u_int *);
    119        1.1  jmcneill };
    120        1.1  jmcneill 
    121        1.3  jmcneill struct fdtbus_clock_controller_func {
    122       1.40   aymeric 	struct clk *	(*decode)(device_t, int, const void *, size_t);
    123        1.3  jmcneill };
    124        1.3  jmcneill 
    125        1.3  jmcneill struct fdtbus_reset_controller;
    126        1.3  jmcneill 
    127        1.3  jmcneill struct fdtbus_reset {
    128        1.3  jmcneill 	struct fdtbus_reset_controller *rst_rc;
    129        1.3  jmcneill 	void *rst_priv;
    130        1.3  jmcneill };
    131        1.3  jmcneill 
    132        1.3  jmcneill struct fdtbus_reset_controller_func {
    133        1.3  jmcneill 	void *	(*acquire)(device_t, const void *, size_t);
    134        1.3  jmcneill 	void	(*release)(device_t, void *);
    135        1.3  jmcneill 	int	(*reset_assert)(device_t, void *);
    136        1.3  jmcneill 	int	(*reset_deassert)(device_t, void *);
    137        1.3  jmcneill };
    138        1.3  jmcneill 
    139       1.31  jmcneill struct fdtbus_dai_controller_func {
    140       1.31  jmcneill 	audio_dai_tag_t (*get_tag)(device_t, const void *, size_t);
    141       1.31  jmcneill };
    142       1.31  jmcneill 
    143       1.14  jmcneill struct fdtbus_dma_controller;
    144       1.14  jmcneill 
    145       1.14  jmcneill struct fdtbus_dma {
    146       1.14  jmcneill 	struct fdtbus_dma_controller *dma_dc;
    147       1.14  jmcneill 	void *dma_priv;
    148       1.14  jmcneill };
    149       1.14  jmcneill 
    150       1.14  jmcneill enum fdtbus_dma_dir {
    151       1.14  jmcneill 	FDT_DMA_READ,		/* device -> memory */
    152       1.14  jmcneill 	FDT_DMA_WRITE		/* memory -> device */
    153       1.14  jmcneill };
    154       1.14  jmcneill 
    155       1.14  jmcneill struct fdtbus_dma_opt {
    156       1.14  jmcneill 	int opt_bus_width;		/* Bus width */
    157       1.14  jmcneill 	int opt_burst_len;		/* Burst length */
    158       1.14  jmcneill 	int opt_swap;			/* Enable data swapping */
    159       1.14  jmcneill 	int opt_dblbuf;			/* Enable double buffering */
    160       1.14  jmcneill 	int opt_wrap_len;		/* Address wrap-around window */
    161       1.14  jmcneill };
    162       1.14  jmcneill 
    163       1.14  jmcneill struct fdtbus_dma_req {
    164       1.14  jmcneill 	bus_dma_segment_t *dreq_segs;	/* Memory */
    165       1.14  jmcneill 	int dreq_nsegs;
    166       1.14  jmcneill 
    167       1.14  jmcneill 	bus_addr_t dreq_dev_phys;	/* Device */
    168       1.14  jmcneill 	int dreq_sel;			/* Device selector */
    169       1.14  jmcneill 
    170       1.14  jmcneill 	enum fdtbus_dma_dir dreq_dir;	/* Transfer direction */
    171       1.14  jmcneill 
    172       1.14  jmcneill 	int dreq_block_irq;		/* Enable IRQ at end of block */
    173       1.14  jmcneill 	int dreq_block_multi;		/* Enable multiple block transfers */
    174       1.14  jmcneill 	int dreq_flow;			/* Enable flow control */
    175       1.14  jmcneill 
    176       1.14  jmcneill 	struct fdtbus_dma_opt dreq_mem_opt;	/* Memory options */
    177       1.14  jmcneill 	struct fdtbus_dma_opt dreq_dev_opt;	/* Device options */
    178       1.14  jmcneill };
    179       1.14  jmcneill 
    180       1.14  jmcneill struct fdtbus_dma_controller_func {
    181       1.14  jmcneill 	void *	(*acquire)(device_t, const void *, size_t,
    182       1.14  jmcneill 			   void (*)(void *), void *);
    183       1.14  jmcneill 	void	(*release)(device_t, void *);
    184       1.14  jmcneill 	int	(*transfer)(device_t, void *, struct fdtbus_dma_req *);
    185       1.14  jmcneill 	void	(*halt)(device_t, void *);
    186       1.14  jmcneill };
    187       1.14  jmcneill 
    188       1.18  jmcneill struct fdtbus_power_controller;
    189       1.18  jmcneill 
    190       1.18  jmcneill struct fdtbus_power_controller_func {
    191       1.18  jmcneill 	void 	(*reset)(device_t);
    192       1.18  jmcneill 	void	(*poweroff)(device_t);
    193       1.18  jmcneill };
    194       1.18  jmcneill 
    195       1.21  jmcneill struct fdtbus_phy_controller;
    196       1.21  jmcneill 
    197       1.21  jmcneill struct fdtbus_phy {
    198       1.21  jmcneill 	struct fdtbus_phy_controller *phy_pc;
    199       1.21  jmcneill 	void *phy_priv;
    200       1.21  jmcneill };
    201       1.21  jmcneill 
    202       1.21  jmcneill struct fdtbus_phy_controller_func {
    203       1.21  jmcneill 	void *	(*acquire)(device_t, const void *, size_t);
    204       1.21  jmcneill 	void	(*release)(device_t, void *);
    205       1.21  jmcneill 	int	(*enable)(device_t, void *, bool);
    206       1.21  jmcneill };
    207       1.21  jmcneill 
    208       1.30  jmcneill struct fdtbus_pwm_controller_func {
    209       1.30  jmcneill 	pwm_tag_t (*get_tag)(device_t, const void *, size_t);
    210       1.30  jmcneill };
    211       1.30  jmcneill 
    212       1.27  jmcneill struct fdtbus_mmc_pwrseq;
    213       1.27  jmcneill 
    214       1.27  jmcneill struct fdtbus_mmc_pwrseq_func {
    215       1.27  jmcneill 	void	(*pre_power_on)(device_t);
    216       1.27  jmcneill 	void	(*post_power_on)(device_t);
    217       1.27  jmcneill 	void	(*power_off)(device_t);
    218       1.27  jmcneill 	void	(*reset)(device_t);
    219       1.27  jmcneill };
    220       1.27  jmcneill 
    221       1.35  jmcneill struct syscon;
    222       1.35  jmcneill 
    223       1.19  jmcneill struct fdt_console {
    224       1.19  jmcneill 	int	(*match)(int);
    225       1.20  jmcneill 	void	(*consinit)(struct fdt_attach_args *, u_int);
    226       1.19  jmcneill };
    227       1.19  jmcneill 
    228       1.19  jmcneill struct fdt_console_info {
    229       1.19  jmcneill 	const struct fdt_console *ops;
    230       1.19  jmcneill };
    231       1.19  jmcneill 
    232       1.52   hkenken struct fdt_phandle_data {
    233       1.52   hkenken 	int phandle;
    234       1.52   hkenken 	int count;
    235       1.52   hkenken 	const u_int *values;
    236       1.52   hkenken };
    237       1.52   hkenken 
    238       1.19  jmcneill #define	_FDT_CONSOLE_REGISTER(name)	\
    239       1.19  jmcneill 	__link_set_add_rodata(fdt_consoles, __CONCAT(name,_consinfo));
    240       1.19  jmcneill 
    241       1.19  jmcneill #define	FDT_CONSOLE(_name, _ops)					\
    242       1.19  jmcneill static const struct fdt_console_info __CONCAT(_name,_consinfo) = {	\
    243       1.19  jmcneill 	.ops = (_ops)							\
    244       1.19  jmcneill };									\
    245       1.19  jmcneill _FDT_CONSOLE_REGISTER(_name)
    246       1.19  jmcneill 
    247       1.55  jmcneill struct fdt_opp_info {
    248       1.55  jmcneill 	const char *	opp_compat;
    249       1.55  jmcneill 	bool		(*opp_supported)(const int, const int);
    250       1.55  jmcneill };
    251       1.55  jmcneill 
    252       1.55  jmcneill #define	_FDT_OPP_REGISTER(name)		\
    253       1.55  jmcneill 	__link_set_add_rodata(fdt_opps, __CONCAT(name,_oppinfo));
    254       1.55  jmcneill 
    255       1.55  jmcneill #define	FDT_OPP(_name, _compat, _suppfn)				\
    256       1.55  jmcneill static const struct fdt_opp_info __CONCAT(_name,_oppinfo) = {		\
    257       1.55  jmcneill 	.opp_compat = (_compat),					\
    258       1.55  jmcneill 	.opp_supported = (_suppfn)					\
    259       1.55  jmcneill };									\
    260       1.55  jmcneill _FDT_OPP_REGISTER(_name)
    261       1.55  jmcneill 
    262       1.19  jmcneill TAILQ_HEAD(fdt_conslist, fdt_console_info);
    263       1.19  jmcneill 
    264       1.60  jmcneill struct fdt_dma_range {
    265       1.60  jmcneill 	paddr_t		dr_sysbase;
    266       1.60  jmcneill 	bus_addr_t	dr_busbase;
    267       1.60  jmcneill 	bus_size_t	dr_len;
    268       1.60  jmcneill };
    269       1.60  jmcneill 
    270        1.2  jmcneill int		fdtbus_register_interrupt_controller(device_t, int,
    271        1.2  jmcneill 		    const struct fdtbus_interrupt_controller_func *);
    272       1.64   thorpej int		fdtbus_register_i2c_controller(i2c_tag_t, int);
    273        1.2  jmcneill int		fdtbus_register_gpio_controller(device_t, int,
    274        1.2  jmcneill 		    const struct fdtbus_gpio_controller_func *);
    275       1.23  jmcneill int		fdtbus_register_pinctrl_config(device_t, int,
    276        1.5     marty 		    const struct fdtbus_pinctrl_controller_func *);
    277        1.2  jmcneill int		fdtbus_register_regulator_controller(device_t, int,
    278        1.2  jmcneill 		    const struct fdtbus_regulator_controller_func *);
    279        1.3  jmcneill int		fdtbus_register_clock_controller(device_t, int,
    280        1.3  jmcneill 		    const struct fdtbus_clock_controller_func *);
    281        1.3  jmcneill int		fdtbus_register_reset_controller(device_t, int,
    282        1.3  jmcneill 		    const struct fdtbus_reset_controller_func *);
    283       1.31  jmcneill int		fdtbus_register_dai_controller(device_t, int,
    284       1.31  jmcneill 		    const struct fdtbus_dai_controller_func *);
    285       1.14  jmcneill int		fdtbus_register_dma_controller(device_t, int,
    286       1.14  jmcneill 		    const struct fdtbus_dma_controller_func *);
    287       1.18  jmcneill int		fdtbus_register_power_controller(device_t, int,
    288       1.18  jmcneill 		    const struct fdtbus_power_controller_func *);
    289       1.21  jmcneill int		fdtbus_register_phy_controller(device_t, int,
    290       1.21  jmcneill 		    const struct fdtbus_phy_controller_func *);
    291       1.30  jmcneill int		fdtbus_register_pwm_controller(device_t, int,
    292       1.30  jmcneill 		    const struct fdtbus_pwm_controller_func *);
    293       1.27  jmcneill int		fdtbus_register_mmc_pwrseq(device_t, int,
    294       1.27  jmcneill 		    const struct fdtbus_mmc_pwrseq_func *);
    295       1.35  jmcneill int		fdtbus_register_syscon(device_t, int, struct syscon *);
    296        1.1  jmcneill 
    297       1.28     skrll void		fdtbus_set_decoderegprop(bool);
    298       1.28     skrll 
    299        1.2  jmcneill int		fdtbus_get_reg(int, u_int, bus_addr_t *, bus_size_t *);
    300       1.26  jmcneill int		fdtbus_get_reg_byname(int, const char *, bus_addr_t *,
    301       1.26  jmcneill 		    bus_size_t *);
    302       1.17  jmcneill int		fdtbus_get_reg64(int, u_int, uint64_t *, uint64_t *);
    303       1.60  jmcneill int		fdtbus_get_addr_cells(int);
    304       1.60  jmcneill int		fdtbus_get_size_cells(int);
    305       1.60  jmcneill uint64_t	fdtbus_get_cells(const uint8_t *, int);
    306        1.2  jmcneill int		fdtbus_get_phandle(int, const char *);
    307       1.52   hkenken int		fdtbus_get_phandle_with_data(int, const char *, const char *,
    308       1.52   hkenken 		    int, struct fdt_phandle_data *);
    309        1.3  jmcneill int		fdtbus_get_phandle_from_native(int);
    310        1.2  jmcneill i2c_tag_t	fdtbus_get_i2c_tag(int);
    311       1.48  jmcneill i2c_tag_t	fdtbus_i2c_acquire(int, const char *);
    312        1.2  jmcneill void *		fdtbus_intr_establish(int, u_int, int, int,
    313        1.2  jmcneill 		    int (*func)(void *), void *arg);
    314       1.66       ryo void *		fdtbus_intr_establish_xname(int, u_int, int, int,
    315       1.66       ryo 		    int (*func)(void *), void *arg, const char *);
    316       1.50  jakllsch void *		fdtbus_intr_establish_byname(int, const char *, int, int,
    317       1.67  jmcneill 		    int (*func)(void *), void *arg, const char *);
    318       1.39  jmcneill void *		fdtbus_intr_establish_raw(int, const u_int *, int, int,
    319       1.66       ryo 		    int (*func)(void *), void *arg, const char *);
    320       1.59   thorpej void		fdtbus_intr_mask(int, void *);
    321       1.59   thorpej void		fdtbus_intr_unmask(int, void *);
    322        1.2  jmcneill void		fdtbus_intr_disestablish(int, void *);
    323        1.2  jmcneill bool		fdtbus_intr_str(int, u_int, char *, size_t);
    324       1.39  jmcneill bool		fdtbus_intr_str_raw(int, const u_int *, char *, size_t);
    325       1.63   thorpej int		fdtbus_gpio_count(int, const char *);
    326        1.1  jmcneill struct fdtbus_gpio_pin *fdtbus_gpio_acquire(int, const char *, int);
    327       1.25  jmcneill struct fdtbus_gpio_pin *fdtbus_gpio_acquire_index(int, const char *, int, int);
    328        1.2  jmcneill void		fdtbus_gpio_release(struct fdtbus_gpio_pin *);
    329        1.2  jmcneill int		fdtbus_gpio_read(struct fdtbus_gpio_pin *);
    330        1.2  jmcneill void		fdtbus_gpio_write(struct fdtbus_gpio_pin *, int);
    331        1.4  jmcneill int		fdtbus_gpio_read_raw(struct fdtbus_gpio_pin *);
    332        1.4  jmcneill void		fdtbus_gpio_write_raw(struct fdtbus_gpio_pin *, int);
    333       1.31  jmcneill audio_dai_tag_t	fdtbus_dai_acquire(int, const char *);
    334       1.31  jmcneill audio_dai_tag_t	fdtbus_dai_acquire_index(int, const char *, int);
    335       1.30  jmcneill pwm_tag_t	fdtbus_pwm_acquire(int, const char *);
    336       1.30  jmcneill pwm_tag_t	fdtbus_pwm_acquire_index(int, const char *, int);
    337        1.6     marty int		fdtbus_pinctrl_set_config_index(int, u_int);
    338        1.6     marty int		fdtbus_pinctrl_set_config(int, const char *);
    339       1.54  jmcneill bool		fdtbus_pinctrl_has_config(int, const char *);
    340       1.46   thorpej const char *	fdtbus_pinctrl_parse_function(int);
    341       1.46   thorpej const void *	fdtbus_pinctrl_parse_pins(int, int *);
    342       1.46   thorpej const char *	fdtbus_pinctrl_parse_groups(int, int *);
    343       1.46   thorpej const u_int *	fdtbus_pinctrl_parse_pinmux(int, int *);
    344       1.46   thorpej int		fdtbus_pinctrl_parse_bias(int, int *);
    345       1.46   thorpej int		fdtbus_pinctrl_parse_drive(int);
    346       1.46   thorpej int		fdtbus_pinctrl_parse_drive_strength(int);
    347       1.46   thorpej int		fdtbus_pinctrl_parse_input_output(int, int *);
    348        1.1  jmcneill struct fdtbus_regulator *fdtbus_regulator_acquire(int, const char *);
    349        1.2  jmcneill void		fdtbus_regulator_release(struct fdtbus_regulator *);
    350        1.2  jmcneill int		fdtbus_regulator_enable(struct fdtbus_regulator *);
    351        1.2  jmcneill int		fdtbus_regulator_disable(struct fdtbus_regulator *);
    352       1.12  jmcneill int		fdtbus_regulator_set_voltage(struct fdtbus_regulator *,
    353       1.12  jmcneill 		    u_int, u_int);
    354       1.12  jmcneill int		fdtbus_regulator_get_voltage(struct fdtbus_regulator *,
    355       1.12  jmcneill 		    u_int *);
    356       1.44  jmcneill int		fdtbus_regulator_supports_voltage(struct fdtbus_regulator *,
    357       1.44  jmcneill 		    u_int, u_int);
    358       1.35  jmcneill struct syscon *	fdtbus_syscon_acquire(int, const char *);
    359       1.37  jmcneill struct syscon *	fdtbus_syscon_lookup(int);
    360        1.2  jmcneill 
    361       1.14  jmcneill struct fdtbus_dma *fdtbus_dma_get(int, const char *, void (*)(void *), void *);
    362       1.14  jmcneill struct fdtbus_dma *fdtbus_dma_get_index(int, u_int, void (*)(void *),
    363       1.14  jmcneill 		    void *);
    364       1.14  jmcneill void		fdtbus_dma_put(struct fdtbus_dma *);
    365       1.14  jmcneill int		fdtbus_dma_transfer(struct fdtbus_dma *,
    366       1.14  jmcneill 		    struct fdtbus_dma_req *);
    367       1.14  jmcneill void		fdtbus_dma_halt(struct fdtbus_dma *);
    368       1.14  jmcneill 
    369        1.3  jmcneill struct clk *	fdtbus_clock_get(int, const char *);
    370        1.3  jmcneill struct clk *	fdtbus_clock_get_index(int, u_int);
    371       1.33  jmcneill struct clk *	fdtbus_clock_byname(const char *);
    372       1.34  jmcneill void		fdtbus_clock_assign(int);
    373       1.56  jmcneill u_int		fdtbus_clock_count(int, const char *);
    374       1.57  jmcneill int		fdtbus_clock_enable(int, const char *, bool);
    375       1.57  jmcneill int		fdtbus_clock_enable_index(int, u_int, bool);
    376        1.3  jmcneill 
    377        1.3  jmcneill struct fdtbus_reset *fdtbus_reset_get(int, const char *);
    378        1.3  jmcneill struct fdtbus_reset *fdtbus_reset_get_index(int, u_int);
    379        1.3  jmcneill void		fdtbus_reset_put(struct fdtbus_reset *);
    380        1.3  jmcneill int		fdtbus_reset_assert(struct fdtbus_reset *);
    381        1.3  jmcneill int		fdtbus_reset_deassert(struct fdtbus_reset *);
    382        1.3  jmcneill 
    383       1.21  jmcneill struct fdtbus_phy *fdtbus_phy_get(int, const char *);
    384       1.21  jmcneill struct fdtbus_phy *fdtbus_phy_get_index(int, u_int);
    385       1.21  jmcneill void		fdtbus_phy_put(struct fdtbus_phy *);
    386       1.48  jmcneill device_t	fdtbus_phy_device(struct fdtbus_phy *);
    387       1.21  jmcneill int		fdtbus_phy_enable(struct fdtbus_phy *, bool);
    388       1.21  jmcneill 
    389       1.27  jmcneill struct fdtbus_mmc_pwrseq *fdtbus_mmc_pwrseq_get(int);
    390       1.27  jmcneill void		fdtbus_mmc_pwrseq_pre_power_on(struct fdtbus_mmc_pwrseq *);
    391       1.27  jmcneill void		fdtbus_mmc_pwrseq_post_power_on(struct fdtbus_mmc_pwrseq *);
    392       1.27  jmcneill void		fdtbus_mmc_pwrseq_power_off(struct fdtbus_mmc_pwrseq *);
    393       1.27  jmcneill void		fdtbus_mmc_pwrseq_reset(struct fdtbus_mmc_pwrseq *);
    394       1.27  jmcneill 
    395       1.11  jmcneill int		fdtbus_todr_attach(device_t, int, todr_chip_handle_t);
    396       1.11  jmcneill 
    397       1.18  jmcneill void		fdtbus_power_reset(void);
    398       1.18  jmcneill void		fdtbus_power_poweroff(void);
    399       1.18  jmcneill 
    400       1.58   thorpej bool		fdtbus_init(const void *);
    401        1.2  jmcneill const void *	fdtbus_get_data(void);
    402        1.2  jmcneill int		fdtbus_phandle2offset(int);
    403        1.2  jmcneill int		fdtbus_offset2phandle(int);
    404        1.8  jmcneill bool		fdtbus_get_path(int, char *, size_t);
    405        1.1  jmcneill 
    406       1.19  jmcneill const struct fdt_console *fdtbus_get_console(void);
    407       1.19  jmcneill 
    408       1.10  jmcneill const char *	fdtbus_get_stdout_path(void);
    409       1.10  jmcneill int		fdtbus_get_stdout_phandle(void);
    410       1.10  jmcneill int		fdtbus_get_stdout_speed(void);
    411       1.19  jmcneill tcflag_t	fdtbus_get_stdout_flags(void);
    412       1.10  jmcneill 
    413       1.15  jmcneill bool		fdtbus_status_okay(int);
    414       1.15  jmcneill 
    415       1.23  jmcneill const void *	fdtbus_get_prop(int, const char *, int *);
    416       1.22  jmcneill const char *	fdtbus_get_string(int, const char *);
    417       1.24  jmcneill const char *	fdtbus_get_string_index(int, const char *, u_int);
    418       1.49  jakllsch int		fdtbus_get_index(int, const char *, const char *, u_int *);
    419       1.22  jmcneill 
    420       1.36  jmcneill void		fdt_add_bus(device_t, int, struct fdt_attach_args *);
    421       1.41  jmcneill void		fdt_add_bus_match(device_t, int, struct fdt_attach_args *,
    422       1.41  jmcneill 				  bool (*)(void *, int), void *);
    423       1.43  jmcneill void		fdt_add_child(device_t, int, struct fdt_attach_args *, u_int);
    424       1.36  jmcneill 
    425       1.29    bouyer void		fdt_remove_byhandle(int);
    426       1.29    bouyer void		fdt_remove_bycompat(const char *[]);
    427       1.45  jmcneill int		fdt_find_with_property(const char *, int *);
    428       1.69   thorpej 
    429       1.16  jmcneill int		fdtbus_print(void *, const char *);
    430       1.16  jmcneill 
    431       1.60  jmcneill bus_dma_tag_t	fdtbus_dma_tag_create(int, const struct fdt_dma_range *,
    432       1.60  jmcneill 		    u_int);
    433       1.60  jmcneill 
    434       1.62     skrll #endif /* _DEV_FDT_FDTVAR_H_ */
    435