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