sbbrz_bus_mem.c revision 1.2
11.2Smatt/*	$NetBSD: sbbrz_bus_mem.c,v 1.2 2011/02/17 14:24:12 matt Exp $	*/
21.2Smatt
31.2Smatt/*-
41.2Smatt * Copyright (c) 2001 The NetBSD Foundation, Inc.
51.2Smatt * All rights reserved.
61.2Smatt *
71.2Smatt * This code is derived from software contributed to The NetBSD Foundation
81.2Smatt * by Jason R. Thorpe.
91.2Smatt *
101.2Smatt * Redistribution and use in source and binary forms, with or without
111.2Smatt * modification, are permitted provided that the following conditions
121.2Smatt * are met:
131.2Smatt * 1. Redistributions of source code must retain the above copyright
141.2Smatt *    notice, this list of conditions and the following disclaimer.
151.2Smatt * 2. Redistributions in binary form must reproduce the above copyright
161.2Smatt *    notice, this list of conditions and the following disclaimer in the
171.2Smatt *    documentation and/or other materials provided with the distribution.
181.2Smatt *
191.2Smatt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
201.2Smatt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
211.2Smatt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
221.2Smatt * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
231.2Smatt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
241.2Smatt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
251.2Smatt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
261.2Smatt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
271.2Smatt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
281.2Smatt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
291.2Smatt * POSSIBILITY OF SUCH DAMAGE.
301.2Smatt */
311.2Smatt
321.2Smatt/*
331.2Smatt * Platform-specific PCI bus memory support for the BCM1250/1125.
341.2Smatt */
351.2Smatt
361.2Smatt#include <sys/cdefs.h>
371.2Smatt__KERNEL_RCSID(0, "$NetBSD: sbbrz_bus_mem.c,v 1.2 2011/02/17 14:24:12 matt Exp $");
381.2Smatt
391.2Smatt#include <sys/param.h>
401.2Smatt
411.2Smatt#include <mips/sibyte/include/sb1250_regs.h>
421.2Smatt#include <mips/sibyte/pci/sbbrzvar.h>
431.2Smatt
441.2Smatt#define	CHIP			sbbrz
451.2Smatt#define	CHIP_MEM		/* defined */
461.2Smatt#define	CHIP_LITTLE_ENDIAN
471.2Smatt
481.2Smatt#define	CHIP_EX_MALLOC_SAFE(v)	true
491.2Smatt#define	CHIP_EXTENT(v)		(((struct sbbrz_softc *)(v))->sc_mem_ex)
501.2Smatt
511.2Smatt/* MEM region 1 */
521.2Smatt#define	CHIP_W1_BUS_START(v)	(A_PHYS_LDTPCI_IO_MATCH_BYTES_32 + 0x01000000)
531.2Smatt#define	CHIP_W1_BUS_END(v)	(A_PHYS_LDTPCI_IO_MATCH_BYTES_32 + 0x20000000)
541.2Smatt#define	CHIP_W1_SYS_START(v)	CHIP_W1_BUS_START(v)
551.2Smatt#define	CHIP_W1_SYS_END(v)	CHIP_W1_BUS_END(v)
561.2Smatt
571.2Smatt#include <mips/mips/bus_space_alignstride_chipdep.c>
58