adm5120_extio_space.c revision 1.1
11.1Sdyoung/* $NetBSD: adm5120_extio_space.c,v 1.1 2007/03/20 08:52:03 dyoung Exp $ */
21.1Sdyoung
31.1Sdyoung/*-
41.1Sdyoung * Copyright (c) 2007 David Young.  All rights reserved.
51.1Sdyoung *
61.1Sdyoung * Redistribution and use in source and binary forms, with or
71.1Sdyoung * without modification, are permitted provided that the following
81.1Sdyoung * conditions are met:
91.1Sdyoung * 1. Redistributions of source code must retain the above copyright
101.1Sdyoung *    notice, this list of conditions and the following disclaimer.
111.1Sdyoung * 2. Redistributions in binary form must reproduce the above
121.1Sdyoung *    copyright notice, this list of conditions and the following
131.1Sdyoung *    disclaimer in the documentation and/or other materials provided
141.1Sdyoung *    with the distribution.
151.1Sdyoung * 3. The name of the author may not be used to endorse or promote
161.1Sdyoung *    products derived from this software without specific prior
171.1Sdyoung *    written permission.
181.1Sdyoung *
191.1Sdyoung * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
201.1Sdyoung * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
211.1Sdyoung * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
221.1Sdyoung * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR
231.1Sdyoung * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
241.1Sdyoung * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
251.1Sdyoung * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
261.1Sdyoung * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
271.1Sdyoung * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
281.1Sdyoung * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
291.1Sdyoung * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
301.1Sdyoung * OF SUCH DAMAGE.
311.1Sdyoung */
321.1Sdyoung/*-
331.1Sdyoung * Copyright (c) 2001 The NetBSD Foundation, Inc.
341.1Sdyoung * All rights reserved.
351.1Sdyoung *
361.1Sdyoung * This code is derived from software contributed to The NetBSD Foundation
371.1Sdyoung * by Jason R. Thorpe.
381.1Sdyoung *
391.1Sdyoung * Redistribution and use in source and binary forms, with or without
401.1Sdyoung * modification, are permitted provided that the following conditions
411.1Sdyoung * are met:
421.1Sdyoung * 1. Redistributions of source code must retain the above copyright
431.1Sdyoung *    notice, this list of conditions and the following disclaimer.
441.1Sdyoung * 2. Redistributions in binary form must reproduce the above copyright
451.1Sdyoung *    notice, this list of conditions and the following disclaimer in the
461.1Sdyoung *    documentation and/or other materials provided with the distribution.
471.1Sdyoung * 3. All advertising materials mentioning features or use of this software
481.1Sdyoung *    must display the following acknowledgement:
491.1Sdyoung *	This product includes software developed by the NetBSD
501.1Sdyoung *	Foundation, Inc. and its contributors.
511.1Sdyoung * 4. Neither the name of The NetBSD Foundation nor the names of its
521.1Sdyoung *    contributors may be used to endorse or promote products derived
531.1Sdyoung *    from this software without specific prior written permission.
541.1Sdyoung *
551.1Sdyoung * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
561.1Sdyoung * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
571.1Sdyoung * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
581.1Sdyoung * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
591.1Sdyoung * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
601.1Sdyoung * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
611.1Sdyoung * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
621.1Sdyoung * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
631.1Sdyoung * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
641.1Sdyoung * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
651.1Sdyoung * POSSIBILITY OF SUCH DAMAGE.
661.1Sdyoung */
671.1Sdyoung
681.1Sdyoung/*
691.1Sdyoung * Platform-specific SOC register support for the Infineon ADM5120.
701.1Sdyoung */
711.1Sdyoung
721.1Sdyoung#include <sys/cdefs.h>
731.1Sdyoung__KERNEL_RCSID(0, "$NetBSD: adm5120_extio_space.c,v 1.1 2007/03/20 08:52:03 dyoung Exp $");
741.1Sdyoung
751.1Sdyoung#include <sys/param.h>
761.1Sdyoung
771.1Sdyoung#include <machine/bus.h>
781.1Sdyoung#include <mips/adm5120/include/adm5120reg.h>
791.1Sdyoung#include <mips/adm5120/include/adm5120_extiovar.h>
801.1Sdyoung
811.1Sdyoung#define	CHIP			extio
821.1Sdyoung#define	CHIP_MEM		/* defined */
831.1Sdyoung#define	CHIP_ACCESS_SIZE	1
841.1Sdyoung
851.1Sdyoung/* MEM region 1 */
861.1Sdyoung#define	CHIP_W1_BUS_START(v)	ADM5120_BASE_EXTIO0
871.1Sdyoung#define	CHIP_W1_BUS_END(v)	ADM5120_BASE_EXTIO1
881.1Sdyoung#define	CHIP_W1_SYS_START(v)	CHIP_W1_BUS_START(v)
891.1Sdyoung#define	CHIP_W1_SYS_END(v)	CHIP_W1_BUS_END(v)
901.1Sdyoung
911.1Sdyoung/* MEM region 2 */
921.1Sdyoung#define	CHIP_W2_BUS_START(v)	ADM5120_BASE_EXTIO1
931.1Sdyoung#define	CHIP_W2_BUS_END(v)	ADM5120_BASE_MPMC
941.1Sdyoung#define	CHIP_W2_SYS_START(v)	CHIP_W2_BUS_START(v)
951.1Sdyoung#define	CHIP_W2_SYS_END(v)	CHIP_W2_BUS_END(v)
961.1Sdyoung
971.1Sdyoung#include <mips/mips/bus_space_alignstride_chipdep.c>
98