/*-
* Copyright (c) 2006 Itronix Inc.
* All rights reserved.
*
* Written by Garrett D'Amore for Itronix Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of Itronix Inc. may not be used to endorse
* or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY ITRONIX INC. ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ITRONIX INC. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/* The MTX-1 kernels only support little endian */
CTASSERT(_BYTE_ORDER == _LITTLE_ENDIAN);
const struct alchemy_board *
board_info(void)
{
return &mtx1_info;
}
void
mtx1_init(void)
{
if (MIPS_PRID_COPTS(mips_options.mips_cpu_id) != MIPS_AU1500)
panic("mtx-1: CPU not an AU1500!");
/*
* If we had any kind of identification registers, we could
* print them here. Apparently the MTX-1 doesn't have that
* kind of info.
*/
/* leave console and clocks alone -- YAMON should have got it right! */
}
int
mtx1_pci_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
/*
* The board has up to 4 adapters, each with two minipci slots,
* giving up to 8 devices. Each slot 0 is the top, and slot 1
* is the bottom.
*
* As these are mini PCI slots, only 2 interrupt pins can be
* used on each slot.
*/
static const int irqmap[8/*device*/][4/*pin*/] = {
{ 1, 2, -1, -1 }, /* IDSEL 0 - Adapter A - Slot 0 */
{ 1, 2, -1, -1 }, /* IDSEL 1 - Adapter A - Slot 1 */
{ 4, 5, -1, -1 }, /* IDSEL 2 - Adapter B - Slot 0 */
{ 5, 4, -1, -1 }, /* IDSEL 3 - Adapter B - Slot 1 */