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