Home | History | Annotate | Line # | Download | only in nxp
imx6var.h revision 1.1
      1  1.1  skrll /*	$NetBSD: imx6var.h,v 1.1 2020/12/23 14:42:38 skrll Exp $	*/
      2  1.1  skrll 
      3  1.1  skrll /*
      4  1.1  skrll  * Copyright (c) 2014 Ryo Shimizu <ryo (at) nerv.org>
      5  1.1  skrll  * All rights reserved.
      6  1.1  skrll  *
      7  1.1  skrll  * Redistribution and use in source and binary forms, with or without
      8  1.1  skrll  * modification, are permitted provided that the following conditions
      9  1.1  skrll  * are met:
     10  1.1  skrll  * 1. Redistributions of source code must retain the above copyright
     11  1.1  skrll  *    notice, this list of conditions and the following disclaimer.
     12  1.1  skrll  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  skrll  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  skrll  *    documentation and/or other materials provided with the distribution.
     15  1.1  skrll  *
     16  1.1  skrll  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     17  1.1  skrll  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     18  1.1  skrll  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     19  1.1  skrll  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
     20  1.1  skrll  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     21  1.1  skrll  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     22  1.1  skrll  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     23  1.1  skrll  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     24  1.1  skrll  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     25  1.1  skrll  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     26  1.1  skrll  * POSSIBILITY OF SUCH DAMAGE.
     27  1.1  skrll  */
     28  1.1  skrll 
     29  1.1  skrll #ifndef _ARM_NXP_IMX6VAR_H
     30  1.1  skrll #define _ARM_NXP_IMX6VAR_H
     31  1.1  skrll 
     32  1.1  skrll #include <sys/cdefs.h>
     33  1.1  skrll 
     34  1.1  skrll struct axi_attach_args {
     35  1.1  skrll 	const char *aa_name;
     36  1.1  skrll 	bus_space_tag_t aa_iot;
     37  1.1  skrll 	bus_dma_tag_t aa_dmat;
     38  1.1  skrll 	bus_addr_t aa_addr;
     39  1.1  skrll 	bus_size_t aa_size;
     40  1.1  skrll 	int aa_irq;
     41  1.1  skrll 	int aa_irqbase;
     42  1.1  skrll };
     43  1.1  skrll 
     44  1.1  skrll extern struct bus_space armv7_generic_bs_tag;
     45  1.1  skrll extern struct arm32_bus_dma_tag arm_generic_dma_tag;
     46  1.1  skrll extern bus_space_tag_t imx6_armcore_bst;
     47  1.1  skrll extern bus_space_handle_t imx6_armcore_bsh;
     48  1.1  skrll extern bus_space_tag_t imx6_ioreg_bst;
     49  1.1  skrll extern bus_space_handle_t imx6_ioreg_bsh;
     50  1.1  skrll 
     51  1.1  skrll /* iomux utility functions in imx6_iomux.c */
     52  1.1  skrll struct iomux_conf {
     53  1.1  skrll 	uint32_t pin;	/* ((MUXADDR<<16)|PADADDR) */
     54  1.1  skrll #define IOMUX_CONF_EOT	((uint32_t)(-1))
     55  1.1  skrll 	uint32_t mux;
     56  1.1  skrll 	uint32_t pad;
     57  1.1  skrll };
     58  1.1  skrll 
     59  1.1  skrll uint32_t iomux_read(uint32_t);
     60  1.1  skrll void iomux_write(uint32_t, uint32_t);
     61  1.1  skrll void iomux_set_function(u_int, u_int);
     62  1.1  skrll void iomux_set_pad(u_int, u_int);
     63  1.1  skrll void iomux_set_input(u_int, u_int);
     64  1.1  skrll void iomux_mux_config(const struct iomux_conf *);
     65  1.1  skrll 
     66  1.1  skrll /* imx6_board.c */
     67  1.1  skrll void imx6_bootstrap(vaddr_t);
     68  1.1  skrll psize_t imx6_memprobe(void);
     69  1.1  skrll uint32_t imx6_armrootclk(void);
     70  1.1  skrll void imx6_reset(void) __dead;
     71  1.1  skrll void imx6_device_register(device_t, void *);
     72  1.1  skrll void imx6_set_gpio(device_t, const char *, int32_t *, int32_t *, u_int);
     73  1.1  skrll uint32_t imx6_chip_id(void);
     74  1.1  skrll #define CHIPID_MINOR_MASK		0x000000ff
     75  1.1  skrll #define CHIPID_MAJOR_MASK		0x00ffff00
     76  1.1  skrll #define CHIPID_MAJOR_IMX6SL		0x00600000
     77  1.1  skrll #define CHIPID_MAJOR_IMX6DL		0x00610000
     78  1.1  skrll #define CHIPID_MAJOR_IMX6SOLO		0x00620000
     79  1.1  skrll #define CHIPID_MAJOR_IMX6Q		0x00630000
     80  1.1  skrll #define CHIPID_MAJOR_IMX6UL		0x00640000
     81  1.1  skrll #define IMX6_CHIPID_MAJOR(v)		((v) & CHIPID_MAJOR_MASK)
     82  1.1  skrll #define IMX6_CHIPID_MINOR(v)		((v) & CHIPID_MINOR_MASK)
     83  1.1  skrll 
     84  1.1  skrll #endif /* _ARM_NXP_IMX6VAR_H */
     85