11.4Sdyoung/* $NetBSD: adm5120_extio_space.c,v 1.4 2011/07/01 18:38:48 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 *
161.1Sdyoung * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY
171.1Sdyoung * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
181.1Sdyoung * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
191.1Sdyoung * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR
201.1Sdyoung * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
211.1Sdyoung * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
221.1Sdyoung * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
231.1Sdyoung * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241.1Sdyoung * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
251.1Sdyoung * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
261.1Sdyoung * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
271.1Sdyoung * OF SUCH DAMAGE.
281.1Sdyoung */
291.1Sdyoung/*-
301.1Sdyoung * Copyright (c) 2001 The NetBSD Foundation, Inc.
311.1Sdyoung * All rights reserved.
321.1Sdyoung *
331.1Sdyoung * This code is derived from software contributed to The NetBSD Foundation
341.1Sdyoung * by Jason R. Thorpe.
351.1Sdyoung *
361.1Sdyoung * Redistribution and use in source and binary forms, with or without
371.1Sdyoung * modification, are permitted provided that the following conditions
381.1Sdyoung * are met:
391.1Sdyoung * 1. Redistributions of source code must retain the above copyright
401.1Sdyoung *    notice, this list of conditions and the following disclaimer.
411.1Sdyoung * 2. Redistributions in binary form must reproduce the above copyright
421.1Sdyoung *    notice, this list of conditions and the following disclaimer in the
431.1Sdyoung *    documentation and/or other materials provided with the distribution.
441.1Sdyoung *
451.1Sdyoung * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
461.1Sdyoung * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
471.1Sdyoung * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
481.1Sdyoung * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
491.1Sdyoung * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
501.1Sdyoung * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
511.1Sdyoung * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
521.1Sdyoung * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
531.1Sdyoung * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
541.1Sdyoung * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
551.1Sdyoung * POSSIBILITY OF SUCH DAMAGE.
561.1Sdyoung */
571.1Sdyoung
581.1Sdyoung/*
591.1Sdyoung * Platform-specific SOC register support for the Infineon ADM5120.
601.1Sdyoung */
611.1Sdyoung
621.1Sdyoung#include <sys/cdefs.h>
631.4Sdyoung__KERNEL_RCSID(0, "$NetBSD: adm5120_extio_space.c,v 1.4 2011/07/01 18:38:48 dyoung Exp $");
641.1Sdyoung
651.1Sdyoung#include <sys/param.h>
661.1Sdyoung
671.4Sdyoung#include <sys/bus.h>
681.1Sdyoung#include <mips/adm5120/include/adm5120reg.h>
691.1Sdyoung#include <mips/adm5120/include/adm5120_extiovar.h>
701.1Sdyoung
711.1Sdyoung#define	CHIP			extio
721.1Sdyoung#define	CHIP_MEM		/* defined */
731.1Sdyoung#define	CHIP_ACCESS_SIZE	1
741.1Sdyoung
751.1Sdyoung/* MEM region 1 */
761.1Sdyoung#define	CHIP_W1_BUS_START(v)	ADM5120_BASE_EXTIO0
771.1Sdyoung#define	CHIP_W1_BUS_END(v)	ADM5120_BASE_EXTIO1
781.1Sdyoung#define	CHIP_W1_SYS_START(v)	CHIP_W1_BUS_START(v)
791.1Sdyoung#define	CHIP_W1_SYS_END(v)	CHIP_W1_BUS_END(v)
801.1Sdyoung
811.1Sdyoung/* MEM region 2 */
821.1Sdyoung#define	CHIP_W2_BUS_START(v)	ADM5120_BASE_EXTIO1
831.1Sdyoung#define	CHIP_W2_BUS_END(v)	ADM5120_BASE_MPMC
841.1Sdyoung#define	CHIP_W2_SYS_START(v)	CHIP_W2_BUS_START(v)
851.1Sdyoung#define	CHIP_W2_SYS_END(v)	CHIP_W2_BUS_END(v)
861.1Sdyoung
871.1Sdyoung#include <mips/mips/bus_space_alignstride_chipdep.c>
88