kobo_reg.h revision 1.1 1 1.1 hkenken /* $NetBSD: kobo_reg.h,v 1.1 2014/07/25 11:22:50 hkenken Exp $ */
2 1.1 hkenken
3 1.1 hkenken /*
4 1.1 hkenken * Copyright (c) 2012 Genetec Corporation. All rights reserved.
5 1.1 hkenken * Written by Hiroyuki Bessho for Genetec Corporation.
6 1.1 hkenken *
7 1.1 hkenken * Redistribution and use in source and binary forms, with or without
8 1.1 hkenken * modification, are permitted provided that the following conditions
9 1.1 hkenken * are met:
10 1.1 hkenken * 1. Redistributions of source code must retain the above copyright
11 1.1 hkenken * notice, this list of conditions and the following disclaimer.
12 1.1 hkenken * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 hkenken * notice, this list of conditions and the following disclaimer in the
14 1.1 hkenken * documentation and/or other materials provided with the distribution.
15 1.1 hkenken *
16 1.1 hkenken * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
17 1.1 hkenken * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 1.1 hkenken * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 1.1 hkenken * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
20 1.1 hkenken * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 1.1 hkenken * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 1.1 hkenken * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 1.1 hkenken * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 1.1 hkenken * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 1.1 hkenken * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 1.1 hkenken * POSSIBILITY OF SUCH DAMAGE.
27 1.1 hkenken *
28 1.1 hkenken */
29 1.1 hkenken
30 1.1 hkenken #ifndef _EVBARM_KOBO_REG_H
31 1.1 hkenken #define _EVBARM_KOBO_REG_H
32 1.1 hkenken
33 1.1 hkenken #include "opt_imx.h"
34 1.1 hkenken
35 1.1 hkenken #include <arm/imx/imx51reg.h>
36 1.1 hkenken
37 1.1 hkenken #define DDRSDRAM_BASE CSD0DDR_BASE
38 1.1 hkenken
39 1.1 hkenken /* map UART2 and IOMUXC for bootstrap */
40 1.1 hkenken #define KOBO_PRIVATE_VBASE 0xf0000000
41 1.1 hkenken #define KOBO_IO_VBASE0 0xfd000000
42 1.1 hkenken #define KOBO_IO_PBASE0 0x53f00000 /* GPIO, IOMUXC, UART */
43 1.1 hkenken
44 1.1 hkenken #define KOBO_UART2_VBASE \
45 1.1 hkenken (IMX51_UART2_BASE-KOBO_IO_PBASE0+KOBO_IO_VBASE0)
46 1.1 hkenken #define KOBO_IOMUXC_VBASE \
47 1.1 hkenken (IOMUXC_BASE-KOBO_IO_PBASE0+KOBO_IO_VBASE0)
48 1.1 hkenken
49 1.1 hkenken /* GPIO[1..4] */
50 1.1 hkenken #define KOBO_GPIO1_VBASE \
51 1.1 hkenken (GPIO1_BASE-KOBO_IO_PBASE0+KOBO_IO_VBASE0)
52 1.1 hkenken #define KOBO_GPIO_VBASE(n) \
53 1.1 hkenken (KOBO_GPIO1_VBASE+((n)-1)*0x4000)
54 1.1 hkenken #define KOBO_WDOG_VBASE \
55 1.1 hkenken (WDOG1_BASE-KOBO_IO_PBASE0+KOBO_IO_VBASE0)
56 1.1 hkenken
57 1.1 hkenken #define ioreg_read(a) (*(volatile uint32_t *)(a))
58 1.1 hkenken #define ioreg_write(a,v) (*(volatile uint32_t *)(a)=(v))
59 1.1 hkenken
60 1.1 hkenken #define ioreg32_read ioreg_read
61 1.1 hkenken #define ioreg32_write ioreg_write
62 1.1 hkenken
63 1.1 hkenken #define ioreg16_read(a) (*(volatile uint16_t *)(a))
64 1.1 hkenken #define ioreg16_write(a,v) (*(volatile uint16_t *)(a) = (v))
65 1.1 hkenken
66 1.1 hkenken #define ioreg8_read(a) (*(volatile uint8_t *)(a))
67 1.1 hkenken #define ioreg8_write(a,v) (*(volatile uint8_t *)(a) = (v))
68 1.1 hkenken
69 1.1 hkenken #endif /* _EVBARM_KOBO_REG_H */
70