From 38e42c3d7645b5497854ed0e39447ee1345978c6 Mon Sep 17 00:00:00 2001 From: kiyohara Date: Sun, 2 Apr 2006 17:32:57 +0000 Subject: [PATCH] Support aupcmcia on OMSAL400. --- sys/arch/evbmips/alchemy/omsal400.c | 87 ++++++++++++++++++++++++++++- sys/arch/evbmips/conf/OMSAL400 | 14 ++++- 2 files changed, 98 insertions(+), 3 deletions(-) diff --git a/sys/arch/evbmips/alchemy/omsal400.c b/sys/arch/evbmips/alchemy/omsal400.c index 9958c0e67f78..121c08edc51a 100644 --- a/sys/arch/evbmips/alchemy/omsal400.c +++ b/sys/arch/evbmips/alchemy/omsal400.c @@ -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 -__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 #include #include +#include +#include #include #include #include @@ -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 "???"; + } +} diff --git a/sys/arch/evbmips/conf/OMSAL400 b/sys/arch/evbmips/conf/OMSAL400 index 231519139ace..16ff6f95d1f8 100644 --- a/sys/arch/evbmips/conf/OMSAL400 +++ b/sys/arch/evbmips/conf/OMSAL400 @@ -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