Support aupcmcia on OMSAL400.

This commit is contained in:
kiyohara 2006-04-02 17:32:57 +00:00
parent fb009d1ad3
commit 38e42c3d76
2 changed files with 98 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: omsal400.c,v 1.3 2006/03/01 20:21:41 shige Exp $ */
/* $NetBSD: omsal400.c,v 1.4 2006/04/02 17:32:57 kiyohara Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@ -36,11 +36,13 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: omsal400.c,v 1.3 2006/03/01 20:21:41 shige Exp $");
__KERNEL_RCSID(0, "$NetBSD: omsal400.c,v 1.4 2006/04/02 17:32:57 kiyohara Exp $");
#include <sys/param.h>
#include <machine/bus.h>
#include <machine/locore.h>
#include <mips/alchemy/dev/augpiovar.h>
#include <mips/alchemy/dev/aupcmciavar.h>
#include <evbmips/alchemy/obiovar.h>
#include <evbmips/alchemy/board.h>
#include <evbmips/alchemy/omsal400reg.h>
@ -55,11 +57,27 @@ static int omsal400_pci_intr_map(struct pci_attach_args *,
pci_intr_handle_t *);
static void omsal400_poweroff(void);
static void omsal400_reboot(void);
static bus_addr_t omsal400_slot_offset(int);
static int omsal400_slot_irq(int, int);
static void omsal400_slot_enable(int);
static void omsal400_slot_disable(int);
static int omsal400_slot_status(int);
static const char *omsal400_slot_name(int);
static const struct obiodev omsal400_devices[] = {
{ NULL },
};
static struct aupcmcia_machdep omsal400_pcmcia = {
1, /* nslots */
omsal400_slot_offset,
omsal400_slot_irq,
omsal400_slot_enable,
omsal400_slot_disable,
omsal400_slot_status,
omsal400_slot_name,
};
static struct alchemy_board omsal400_info = {
"Plathome Open Micro Sever AL400/AMD Alchemy Au1550",
omsal400_devices,
@ -67,6 +85,7 @@ static struct alchemy_board omsal400_info = {
omsal400_pci_intr_map,
omsal400_reboot,
omsal400_poweroff,
&omsal400_pcmcia,
};
const struct alchemy_board *
@ -162,3 +181,67 @@ omsal400_poweroff(void)
printf("\n- poweroff -\n");
/* XXX */
}
int
omsal400_slot_irq(int slot, int which)
{
static const int irqmap[1/*slot*/][2/*which*/] = {
{ 35, 37 }, /* Slot 0: CF connector Type2 */
};
if ((slot >= 1) || (which >= 2))
return -1;
return irqmap[slot][which];
}
bus_addr_t
omsal400_slot_offset(int slot)
{
switch (slot) {
case 0:
return (0); /* offset 0 */
}
return (bus_addr_t)-1;
}
void
omsal400_slot_enable(int slot)
{
/* nothing todo */
}
void
omsal400_slot_disable(int slot)
{
/* nothing todo */
}
int
omsal400_slot_status(int slot)
{
uint16_t inserted = 0;
switch (slot) {
case 0:
inserted = !AUGPIO_READ(5); /* pin 5 */
break;
}
return inserted;
}
const char *
omsal400_slot_name(int slot)
{
switch (slot) {
case 0:
return "CF connector Type2 on Static BUS#3";
default:
return "???";
}
}

View File

@ -1,4 +1,4 @@
# $NetBSD: OMSAL400,v 1.4 2006/03/28 16:56:50 shige Exp $
# $NetBSD: OMSAL400,v 1.5 2006/04/02 17:32:57 kiyohara Exp $
#
# Kernel config for the Open Micro Server AL400.
@ -44,3 +44,15 @@ igphy* at mii? phy ? # Intel IGP01E1000
# USB
usb* at ohci?
usb* at ehci?
# Alchemy On-chip PCMCIA
aupcmcia* at aubus? addr ?
pcmcia* at aupcmcia?
# PCMCIA IDE controllers
wdc* at pcmcia? function ?
# ATA (IDE) bus support
atabus* at ata?
wd* at atabus? drive ? flags 0x0000