Updates for drivers/parisc. Mostly conversion to generic device model.
New hppb driver from Ryan Bradetich.
are not found in B1000, C3000, J5000, A500, L1000, N4000 and upwards.
If in doubt, say "Y".
+config HPPB
+ bool "HP-PB bus support"
+ depends on GSC
+ help
+ The HP-PB bus was used in the Nova class and K-class servers.
+ If in doubt, say "Y"
+
config IOMMU_CCIO
bool "U2/Uturn I/O MMU"
depends on GSC
Beware that some GSC cards have a Dino onboard and PCI inside them,
so it may be safest to say "Y" anyway.
+source "drivers/pci/Kconfig"
+
config GSC_DINO
bool "GSCtoPCI/Dino PCI support"
depends on PCI && GSC
config IOSAPIC
bool
depends on PCI_LBA
- default y
+ default PCI_LBA
config IOMMU_SBA
bool
depends on PCI_LBA
- default y
-
-source "drivers/pci/Kconfig"
+ default PCI_LBA
#config PCI_EPIC
# bool "EPIC/SAGA PCI support"
# depends on PCI
config SUPERIO
- bool
+ bool "SuperIO (SuckyIO) support"
depends on PCI
+ default y
help
Say Y here to support the SuperIO chip found in Bxxxx, C3xxx and
J5xxx+ machines. This enables IDE, Floppy, Parallel Port, and
config CHASSIS_LCD_LED
bool "Chassis LCD and LED support"
+ default y
help
Say Y here if you want to enable support for the Heartbeat,
Disk/Network activities LEDs on some PA-RISC machines,
# Makefile for most of the non-PCI devices in PA-RISC machines
#
-export-objs := gsc.o superio.o
+export-objs := gsc.o superio.o
-obj-y := gsc.o power.o
+obj-y :=
obj-m :=
obj-n :=
obj- :=
-obj-$(CONFIG_GSC_DINO) += dino.o
-obj-$(CONFIG_GSC_LASI) += lasi.o asp.o
-obj-$(CONFIG_GSC_WAX) += wax.o
-obj-$(CONFIG_EISA) += eisa.o eisa_enumerator.o eisa_eeprom.o
-obj-$(CONFIG_SUPERIO) += superio.o
-obj-$(CONFIG_PCI_LBA) += lba_pci.o
# I/O SAPIC is also on IA64 platforms.
# The two could be merged into a common source some day.
-obj-$(CONFIG_IOSAPIC) += iosapic.o
-obj-$(CONFIG_IOMMU_SBA) += sba_iommu.o
+obj-$(CONFIG_IOSAPIC) += iosapic.o
+obj-$(CONFIG_IOMMU_SBA) += sba_iommu.o
+obj-$(CONFIG_PCI_LBA) += lba_pci.o
+
# Only use one of them: ccio-rm-dma is for PCX-W systems *only*
-# obj-$(CONFIG_IOMMU_CCIO) += ccio-rm-dma.o
-obj-$(CONFIG_IOMMU_CCIO) += ccio-dma.o
-obj-$(CONFIG_CHASSIS_LCD_LED) += led.o
+# obj-$(CONFIG_IOMMU_CCIO) += ccio-rm-dma.o
+obj-$(CONFIG_IOMMU_CCIO) += ccio-dma.o
+
+obj-y += gsc.o
+
+obj-$(CONFIG_HPPB) += hppb.o
+obj-$(CONFIG_GSC_DINO) += dino.o
+obj-$(CONFIG_GSC_LASI) += lasi.o asp.o
+obj-$(CONFIG_GSC_WAX) += wax.o
+obj-$(CONFIG_EISA) += eisa.o eisa_enumerator.o eisa_eeprom.o
+
+obj-$(CONFIG_SUPERIO) += superio.o
+obj-$(CONFIG_CHASSIS_LCD_LED) += led.o
+obj-y += power.o
+
printk(KERN_INFO "%s version %d at 0x%lx found.\n",
asp->name, asp->version, dev->hpa);
+ snprintf(dev->dev.name, sizeof(dev->dev.name), "%s version %d",
+ asp->name, asp->version);
/* the IRQ ASP should use */
ret = -EBUSY;
#include <asm/dma.h>
#include <asm/io.h>
#include <asm/hardware.h> /* for register_module() */
+#include <asm/parisc-device.h>
/*
** Choose "ccio" since that's what HP-UX calls it.
* This function implements the pci_dma_supported function.
*/
static int
-ccio_dma_supported(struct pci_dev *dev, u64 mask)
+ccio_dma_supported(struct device *dev, u64 mask)
{
if(dev == NULL) {
printk(KERN_ERR MODULE_NAME ": EISA/ISA/et al not supported\n");
return 0;
}
- dev->dma_mask = mask; /* save it */
-
/* only support 32-bit devices (ie PCI/GSC) */
return (int)(mask == 0xffffffffUL);
}
* This function implements the pci_map_single function.
*/
static dma_addr_t
-ccio_map_single(struct pci_dev *dev, void *addr, size_t size, int direction)
+ccio_map_single(struct device *dev, void *addr, size_t size,
+ enum dma_data_direction direction)
{
int idx;
struct ioc *ioc;
dma_addr_t iovp;
dma_addr_t offset;
u64 *pdir_start;
- unsigned long hint = hint_lookup[direction];
+ unsigned long hint = hint_lookup[(int)direction];
- ASSERT(dev);
- ASSERT(dev->sysdata);
- ASSERT(HBA_DATA(dev->sysdata)->iommu);
+ BUG_ON(!dev);
ioc = GET_IOC(dev);
ASSERT(size > 0);
* This function implements the pci_unmap_single function.
*/
static void
-ccio_unmap_single(struct pci_dev *dev, dma_addr_t iova, size_t size,
- int direction)
+ccio_unmap_single(struct device *dev, dma_addr_t iova, size_t size,
+ enum dma_data_direction direction)
{
struct ioc *ioc;
unsigned long flags;
dma_addr_t offset = iova & ~IOVP_MASK;
- ASSERT(dev);
- ASSERT(dev->sysdata);
- ASSERT(HBA_DATA(dev->sysdata)->iommu);
+ BUG_ON(!dev);
ioc = GET_IOC(dev);
DBG_RUN("%s() iovp 0x%lx/%x\n",
* This function implements the pci_alloc_consistent function.
*/
static void *
-ccio_alloc_consistent(struct pci_dev *dev, size_t size, dma_addr_t *dma_handle)
+ccio_alloc_consistent(struct device *dev, size_t size, dma_addr_t *dma_handle)
{
void *ret;
#if 0
* This function implements the pci_free_consistent function.
*/
static void
-ccio_free_consistent(struct pci_dev *dev, size_t size, void *cpu_addr,
+ccio_free_consistent(struct device *dev, size_t size, void *cpu_addr,
dma_addr_t dma_handle)
{
ccio_unmap_single(dev, dma_handle, size, 0);
* This function implements the pci_map_sg function.
*/
static int
-ccio_map_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents,
- int direction)
+ccio_map_sg(struct device *dev, struct scatterlist *sglist, int nents,
+ enum dma_data_direction direction)
{
struct ioc *ioc;
int coalesced, filled = 0;
unsigned long flags;
- unsigned long hint = hint_lookup[direction];
+ unsigned long hint = hint_lookup[(int)direction];
- ASSERT(dev);
- ASSERT(dev->sysdata);
- ASSERT(HBA_DATA(dev->sysdata)->iommu);
+ BUG_ON(!dev);
ioc = GET_IOC(dev);
DBG_RUN_SG("%s() START %d entries\n", __FUNCTION__, nents);
* This function implements the pci_unmap_sg function.
*/
static void
-ccio_unmap_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents,
- int direction)
+ccio_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents,
+ enum dma_data_direction direction)
{
struct ioc *ioc;
- ASSERT(dev);
- ASSERT(dev->sysdata);
- ASSERT(HBA_DATA(dev->sysdata)->iommu);
+ BUG_ON(!dev);
ioc = GET_IOC(dev);
DBG_RUN_SG("%s() START %d entries, %08lx,%x\n",
DBG_RUN_SG("%s() DONE (nents %d)\n", __FUNCTION__, nents);
}
-static struct pci_dma_ops ccio_ops = {
- ccio_dma_supported,
- ccio_alloc_consistent,
- ccio_free_consistent,
- ccio_map_single,
- ccio_unmap_single,
- ccio_map_sg,
- ccio_unmap_sg,
- NULL, /* dma_sync_single : NOP for U2/Uturn */
- NULL, /* dma_sync_sg : ditto */
+static struct hppa_dma_ops ccio_ops = {
+ .dma_supported = ccio_dma_supported,
+ .alloc_consistent = ccio_alloc_consistent,
+ .alloc_noncoherent = ccio_alloc_consistent,
+ .free_consistent = ccio_free_consistent,
+ .map_single = ccio_map_single,
+ .unmap_single = ccio_unmap_single,
+ .map_sg = ccio_map_sg,
+ .unmap_sg = ccio_unmap_sg,
+ .dma_sync_single = NULL, /* NOP for U2/Uturn */
+ .dma_sync_sg = NULL, /* ditto */
};
#ifdef CONFIG_PROC_FS
memset(ioc, 0, sizeof(struct ioc));
ioc->name = dev->id.hversion == U2_IOA_RUNWAY ? "U2" : "UTurn";
+ strncpy(dev->dev.name, ioc->name, sizeof(dev->dev.name));
printk(KERN_INFO "Found %s at 0x%lx\n", ioc->name, dev->hpa);
ccio_ioc_init(ioc);
ccio_init_resources(ioc);
hppa_dma_ops = &ccio_ops;
+ dev->dev.platform_data = kmalloc(sizeof(struct pci_hba_data), GFP_KERNEL);
+
+ /* if this fails, no I/O cards will work, so may as well bug */
+ BUG_ON(dev->dev.platform_data == NULL);
+ HBA_DATA(dev->dev.platform_data)->iommu = ioc;
+
if (ioc_count == 0) {
/* XXX: Create separate entries for each ioc */
}
memset(ioc->fake_pci_dev, 0, sizeof(struct pci_dev));
- ioc->fake_pci_dev->sysdata = kmalloc(sizeof(struct pci_hba_data), GFP_KERNEL);
- if(ioc->fake_pci_dev->sysdata == NULL) {
+ ioc->fake_pci_dev->dev.platform_data = kmalloc(sizeof(struct pci_hba_data), GFP_KERNEL);
+ if(ioc->fake_pci_dev->dev.platform_data == NULL) {
printk(KERN_ERR MODULE_NAME ": memory allocation failure\n");
return NULL;
}
- HBA_DATA(ioc->fake_pci_dev->sysdata)->iommu = ioc;
+ HBA_DATA(ioc->fake_pci_dev->dev.platform_data)->iommu = ioc;
return ioc->fake_pci_dev;
}
};
static struct parisc_driver ccio_driver = {
- .name = "U2/Uturn",
+ .name = "U2:Uturn",
.id_table = ccio_tbl,
.probe = ccio_probe,
};
return(0);
}
- dev->dma_mask = mask; /* save it */
-
/* only support 32-bit devices (ie PCI/GSC) */
return((int) (mask >= 0xffffffffUL));
}
static int dino_cfg_read(struct pci_bus *bus, unsigned int devfn, int where,
int size, u32 *val)
{
- struct dino_device *d = DINO_DEV(bus->sysdata);
+ struct dino_device *d = DINO_DEV(parisc_walk_tree(bus->dev));
u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3);
unsigned long base_addr = d->hba.base_addr;
static int dino_cfg_write(struct pci_bus *bus, unsigned int devfn, int where,
int size, u32 val)
{
- struct dino_device *d = DINO_DEV(bus->sysdata);
+ struct dino_device *d = DINO_DEV(parisc_walk_tree(bus->dev));
u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3);
unsigned long base_addr = d->hba.base_addr;
unsigned long flags; \
spin_lock_irqsave(&(DINO_DEV(d)->dinosaur_pen), flags); \
/* tell HW which IO Port address */ \
- gsc_writel((u32) addr & ~3, d->base_addr + DINO_PCI_ADDR); \
+ gsc_writel((u32) addr, d->base_addr + DINO_PCI_ADDR); \
/* generate I/O PORT read cycle */ \
v = gsc_read##type(d->base_addr+DINO_IO_DATA+(addr&mask)); \
spin_unlock_irqrestore(&(DINO_DEV(d)->dinosaur_pen), flags); \
{ \
unsigned long flags; \
spin_lock_irqsave(&(DINO_DEV(d)->dinosaur_pen), flags); \
- /* tell HW which CFG address */ \
+ /* tell HW which IO port address */ \
gsc_writel((u32) addr, d->base_addr + DINO_PCI_ADDR); \
/* generate cfg write cycle */ \
gsc_write##type(cpu_to_le##size(val), d->base_addr+DINO_IO_DATA+(addr&mask)); \
dino_card_setup(struct pci_bus *bus, unsigned long base_addr)
{
int i;
- struct dino_device *dino_dev = DINO_DEV(bus->sysdata);
+ struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->dev));
struct resource *res;
res = &dino_dev->hba.lmmio_space;
}
gsc_writel(1 << i, base_addr + DINO_IO_ADDR_EN);
- pcibios_assign_unassigned_resources(bus);
+ pci_bus_assign_resources(bus);
}
static void __init
{
struct list_head *ln;
struct pci_dev *dev;
- struct dino_device *dino_dev = DINO_DEV(bus->sysdata);
+ struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->dev));
int port_base = HBA_PORT_BASE(dino_dev->hba.hba_num);
DBG(KERN_WARNING "%s(0x%p) bus %d sysdata 0x%p\n",
- __FUNCTION__, bus, bus->secondary, bus->sysdata);
+ __FUNCTION__, bus, bus->secondary, bus->dev->platform_data);
/* Firmware doesn't set up card-mode dino, so we have to */
if (is_card_dino(&dino_dev->hba.dev->id))
}
printk("%s version %s found at 0x%lx\n", name, version, dev->hpa);
+ snprintf(dev->dev.name, sizeof(dev->dev.name),
+ "%s version %s", name, version);
if (!request_mem_region(dev->hpa, PAGE_SIZE, name)) {
printk(KERN_ERR "DINO: Hey! Someone took my MMIO space (0x%ld)!\n",
if (dino_common_init(dev, dino_dev, name))
return 1;
+ dev->dev.platform_data = dino_dev;
+
/*
** It's not used to avoid chicken/egg problems
** with configuration accessor functions.
*/
- dino_dev->hba.hba_bus = pci_scan_bus(dino_dev->hba.hba_num,
- &dino_cfg_ops, dino_dev);
-
+ dino_dev->hba.hba_bus =
+ pci_scan_bus_parented(&dev->dev, dino_dev->hba.hba_num,
+ &dino_cfg_ops, NULL);
return 0;
}
#include <asm/io.h>
#include <asm/hardware.h>
#include <asm/processor.h>
+#include <asm/parisc-device.h>
#include <asm/delay.h>
#include <asm/eisa_bus.h>
printk(KERN_INFO "%s EISA Adapter found at 0x%08lx\n",
name, dev->hpa);
+ snprintf(dev->dev.name, sizeof(dev->dev.name), "%s EISA", name);
eisa_dev.hba.dev = dev;
eisa_dev.hba.iommu = ccio_get_iommu(dev);
#include <linux/interrupt.h>
#include <asm/hardware.h>
+#include <asm/parisc-device.h>
#define OFFSET_IRR 0x0000 /* Interrupt request register */
#define OFFSET_IMR 0x0004 /* Interrupt mask register */
--- /dev/null
+/*
+** hppb.c:
+** HP-PB bus driver for the NOVA and K-Class systems.
+**
+** (c) Copyright 2002 Ryan Bradetich
+** (c) Copyright 2002 Hewlett-Packard Company
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This Driver currently only supports the console (port 0) on the MUX.
+** Additional work will be needed on this driver to enable the full
+** functionality of the MUX.
+**
+*/
+
+#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/mm.h>
+#include <linux/slab.h>
+#include <linux/ioport.h>
+
+#include <asm/io.h>
+#include <asm/hardware.h>
+#include <asm/parisc-device.h>
+
+#include <linux/pci.h>
+
+struct hppb_card {
+ unsigned long hpa;
+ struct resource mmio_region;
+ struct hppb_card *next;
+};
+
+struct hppb_card hppb_card_head = {
+ .hpa = 0,
+ .next = NULL,
+};
+
+#define IO_IO_LOW offsetof(struct bc_module, io_io_low)
+#define IO_IO_HIGH offsetof(struct bc_module, io_io_high)
+
+/**
+ * hppb_probe - Determine if the hppb driver should claim this device.
+ * @dev: The device which has been found
+ *
+ * Determine if hppb driver should claim this chip (return 0) or not
+ * (return 1). If so, initialize the chip and tell other partners in crime
+ * they have work to do.
+ */
+static int hppb_probe(struct parisc_device *dev)
+{
+ int status;
+ struct hppb_card *card = &hppb_card_head;
+
+ while(card->next) {
+ card = card->next;
+ }
+
+ if(card->hpa) {
+ card->next = kmalloc(sizeof(struct hppb_card), GFP_KERNEL);
+ if(!card->next) {
+ printk(KERN_ERR "HP-PB: Unable to allocate memory.\n");
+ return 1;
+ }
+ memset(card->next, '\0', sizeof(struct hppb_card));
+ card = card->next;
+ }
+ printk(KERN_INFO "Found GeckoBoa at 0x%lx\n", dev->hpa);
+ snprintf(dev->dev.name, sizeof(dev->dev.name), "GeckoBoa");
+
+ card->hpa = dev->hpa;
+ card->mmio_region.name = "HP-PB Bus";
+ card->mmio_region.flags = IORESOURCE_MEM;
+
+ card->mmio_region.start = __raw_readl(dev->hpa + IO_IO_LOW);
+ card->mmio_region.end = __raw_readl(dev->hpa + IO_IO_HIGH) - 1;
+
+ status = ccio_request_resource(dev, &card->mmio_region);
+ if(status < 0) {
+ printk(KERN_ERR "%s: failed to claim HP-PB bus space (%08lx, %08lx)\n",
+ __FILE__, card->mmio_region.start, card->mmio_region.end);
+ }
+
+ return 0;
+}
+
+
+static struct parisc_device_id hppb_tbl[] = {
+ { HPHW_BCPORT, HVERSION_REV_ANY_ID, 0x500, 0xc },
+ { 0, }
+};
+
+static struct parisc_driver hppb_driver = {
+ .name = "Gecko Boa",
+ .id_table = hppb_tbl,
+ .probe = hppb_probe,
+};
+
+/**
+ * hppb_init - HP-PB bus initalization procedure.
+ *
+ * Register this driver.
+ */
+void __init hppb_init(void)
+{
+ register_parisc_driver(&hppb_driver);
+}
if (NULL == isi) {
printk(KERN_WARNING MODULE_NAME ": hpa not registered for %s\n",
- pcidev->name);
+ pcidev->dev.name);
return(-1);
}
/* Resets */
/* gsc_writel(0xFFFFFFFF, lasi_base+0x2000);*/ /* Parallel */
- gsc_writel(0xFFFFFFFF, lasi_base+0x4004); /* Audio */
+ if(pdc_add_valid(lasi_base+0x4004) == PDC_OK)
+ gsc_writel(0xFFFFFFFF, lasi_base+0x4004); /* Audio */
/* gsc_writel(0xFFFFFFFF, lasi_base+0x5000);*/ /* Serial */
/* gsc_writel(0xFFFFFFFF, lasi_base+0x6000);*/ /* SCSI */
gsc_writel(0xFFFFFFFF, lasi_base+0x7000); /* LAN */
lasi->version = gsc_readl(lasi->hpa + LASI_VER) & 0xf;
printk(KERN_INFO "%s version %d at 0x%lx found.\n",
lasi->name, lasi->version, lasi->hpa);
+ snprintf(dev->dev.name, sizeof(dev->dev.name), "%s version %d",
+ lasi->name, lasi->version);
/* initialize the chassis LEDs really early */
lasi_led_init(lasi->hpa);
#include <asm/system.h>
#include <asm/hardware.h> /* for register_parisc_driver() stuff */
+#include <asm/parisc-device.h>
#include <asm/iosapic.h> /* for iosapic_register() */
#include <asm/io.h> /* read/write stuff */
static int lba_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data)
{
- struct lba_device *d = LBA_DEV(bus->sysdata);
+ struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->dev));
u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
u32 tok = LBA_CFG_TOK(local_bus, devfn);
static int lba_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 data)
{
- struct lba_device *d = LBA_DEV(bus->sysdata);
+ struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->dev));
u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
u32 tok = LBA_CFG_TOK(local_bus,devfn);
u16 fbb_enable = PCI_STATUS_FAST_BACK;
u16 status;
#endif
- struct lba_device *ldev = LBA_DEV(bus->sysdata);
+ struct lba_device *ldev = LBA_DEV(parisc_walk_tree(bus->dev));
int lba_portbase = HBA_PORT_BASE(ldev->hba.hba_num);
DBG("lba_fixup_bus(0x%p) bus %d sysdata 0x%p\n",
- bus, bus->secondary, bus->sysdata);
+ bus, bus->secondary, bus->dev->platform_data);
/*
** Properly Setup MMIO resources for this bus.
printk(KERN_INFO "%s version %s (0x%x) found at 0x%lx\n",
MODULE_NAME, version, func_class & 0xf, dev->hpa);
+ snprintf(dev->dev.name, sizeof(dev->dev.name), "%s version %s",
+ MODULE_NAME, version);
/* Just in case we find some prototypes... */
if (func_class < 2) {
** Tell PCI support another PCI bus was found.
** Walks PCI bus for us too.
*/
+ dev->dev.platform_data = lba_dev;
lba_bus = lba_dev->hba.hba_bus =
- pci_scan_bus(lba_dev->hba.bus_num.start, &lba_cfg_ops, (void *) lba_dev);
+ pci_scan_bus_parented(&dev->dev, lba_dev->hba.bus_num.start,
+ &lba_cfg_ops, NULL);
#ifdef __LP64__
if (is_pdc_pat()) {
/* assign resources to un-initialized devices */
- DBG_PAT("LBA pcibios_assign_unassigned_resources()\n");
- pcibios_assign_unassigned_resources(lba_bus);
+ DBG_PAT("LBA pci_bus_assign_resources()\n");
+ pci_bus_assign_resources(lba_bus);
#ifdef DEBUG_LBA_PAT
DBG_PAT("\nLBA PIOP resource tree\n");
static struct parisc_driver lba_driver = {
.name = MODULE_NAME,
.id_table = lba_tbl,
- .probe = lba_driver_callback
+ .probe = lba_driver_callback,
};
/*
int major, disk, total;
total = 0;
-#ifdef 0
+#if 0
/*
* this section will no longer work in 2.5, as we no longer
* have either kstat.dk_drive nor DK_MAX_*. It can probably
#include <linux/reboot.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
-#include <linux/proc_fs.h>
-#include <linux/ctype.h>
#include <linux/workqueue.h>
#include <asm/pdc.h>
DECLARE_TASKLET_DISABLED(power_tasklet, NULL, 0);
/* soft power switch enabled/disabled */
-#ifdef CONFIG_PROC_FS
-static int pwrsw_enabled = 1;
-#else
-#define pwrsw_enabled (1)
-#endif
+int pwrsw_enabled = 1;
/*
* On gecko style machines (e.g. 712/xx and 715/xx)
-/*
- * /proc filesystem support
- */
-
-#ifdef CONFIG_SYSCTL
-static int power_proc_read(char *page, char **start, off_t off, int count,
- int *eof, void *data)
-{
- char *out = page;
- int len;
-
- out += sprintf(out, "Software power switch support: ");
- out += sprintf(out, pwrsw_enabled ? "enabled (1)" : "disabled (0)" );
- out += sprintf(out, "\n");
-
- len = out - page - off;
- if (len < count) {
- *eof = 1;
- if (len <= 0) return 0;
- } else {
- len = count;
- }
- *start = page + off;
- return len;
-}
-
-static int power_proc_write(struct file *file, const char *buf,
- unsigned long count, void *data)
-{
- char *cur, lbuf[count];
-
- if (!capable(CAP_SYS_ADMIN))
- return -EACCES;
-
- memset(lbuf, 0, count);
-
- copy_from_user(lbuf, buf, count);
- cur = lbuf;
-
- /* skip initial spaces */
- while (*cur && isspace(*cur))
- cur++;
-
- switch (*cur) {
- case '0': pwrsw_enabled = 0;
- break;
- case '1': pwrsw_enabled = 1;
- break;
- default: printk(KERN_CRIT "/proc/" SYSCTL_FILENAME
- ": Parse error: only '0' or '1' allowed!\n");
- return -EINVAL;
- } /* switch() */
-
- return count;
-}
-
-static struct proc_dir_entry *ent;
-
-static void __init power_create_procfs(void)
-{
- if (!power_tasklet.func)
- return;
-
- ent = create_proc_entry(SYSCTL_FILENAME, S_IFREG|S_IRUGO|S_IWUSR, 0);
- if (!ent) return;
-
- ent->nlink = 1;
- ent->read_proc = power_proc_read;
- ent->write_proc = power_proc_write;
- ent->owner = THIS_MODULE;
-}
-
-static void __exit power_remove_procfs(void)
-{
- remove_proc_entry(SYSCTL_FILENAME, NULL);
-}
-
-#else
-#define power_create_procfs() do { } while (0)
-#define power_remove_procfs() do { } while (0)
-#endif /* CONFIG_SYSCTL */
-
-
-
/* parisc_panic_event() is called by the panic handler.
* As soon as a panic occurs, our tasklets above will not be
* executed any longer. This function then re-enables the
/* Register a call for panic conditions. */
notifier_chain_register(&panic_notifier_list, &parisc_panic_block);
- power_create_procfs();
tasklet_enable(&power_tasklet);
return 0;
tasklet_disable(&power_tasklet);
notifier_chain_unregister(&panic_notifier_list, &parisc_panic_block);
- power_remove_procfs();
power_tasklet.func = NULL;
pdc_soft_power_button(0);
}
#include <linux/proc_fs.h>
#include <asm/runway.h> /* for proc_runway_root */
#include <asm/pdc.h> /* for PDC_MODEL_* */
+#include <asm/parisc-device.h>
#define MODULE_NAME "SBA"
* See Documentation/DMA-mapping.txt
*/
static int
-sba_dma_supported( struct pci_dev *dev, u64 mask)
+sba_dma_supported( struct device *dev, u64 mask)
{
if (dev == NULL) {
printk(KERN_ERR MODULE_NAME ": EISA/ISA/et al not supported\n");
return(0);
}
- dev->dma_mask = mask; /* save it */
-
/* only support 32-bit PCI devices - no DAC support (yet) */
- return((int) (mask == 0xffffffff));
+ return((int) (mask == 0xffffffffUL));
}
* See Documentation/DMA-mapping.txt
*/
static dma_addr_t
-sba_map_single(struct pci_dev *dev, void *addr, size_t size, int direction)
+sba_map_single(struct device *dev, void *addr, size_t size,
+ enum dma_data_direction direction)
{
struct ioc *ioc;
unsigned long flags;
ASSERT(size > 0);
ASSERT(size <= DMA_CHUNK_SIZE);
- ASSERT(dev->sysdata);
ioc = GET_IOC(dev);
ASSERT(ioc);
* See Documentation/DMA-mapping.txt
*/
static void
-sba_unmap_single(struct pci_dev *dev, dma_addr_t iova, size_t size, int direction)
+sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size,
+ enum dma_data_direction direction)
{
struct ioc *ioc;
#if DELAYED_RESOURCE_CNT > 0
unsigned long flags;
dma_addr_t offset;
- ASSERT(dev->sysdata);
ioc = GET_IOC(dev);
ASSERT(ioc);
* See Documentation/DMA-mapping.txt
*/
static void *
-sba_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle)
+sba_alloc_consistent(struct device *hwdev, size_t size, dma_addr_t *dma_handle)
{
void *ret;
* See Documentation/DMA-mapping.txt
*/
static void
-sba_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle)
+sba_free_consistent(struct device *hwdev, size_t size, void *vaddr,
+ dma_addr_t dma_handle)
{
sba_unmap_single(hwdev, dma_handle, size, 0);
free_pages((unsigned long) vaddr, get_order(size));
* See Documentation/DMA-mapping.txt
*/
static int
-sba_map_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents, int direction)
+sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents,
+ enum dma_data_direction direction)
{
struct ioc *ioc;
int coalesced, filled = 0;
DBG_RUN_SG("%s() START %d entries\n", __FUNCTION__, nents);
- ASSERT(dev->sysdata);
ioc = GET_IOC(dev);
ASSERT(ioc);
* See Documentation/DMA-mapping.txt
*/
static void
-sba_unmap_sg(struct pci_dev *dev, struct scatterlist *sglist, int nents, int direction)
+sba_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents,
+ enum dma_data_direction direction)
{
struct ioc *ioc;
#ifdef ASSERT_PDIR_SANITY
DBG_RUN_SG("%s() START %d entries, %p,%x\n",
__FUNCTION__, nents, sg_virt_addr(sglist), sglist->length);
- ASSERT(dev->sysdata);
ioc = GET_IOC(dev);
ASSERT(ioc);
}
-static struct pci_dma_ops sba_ops = {
- sba_dma_supported,
- sba_alloc_consistent, /* allocate cacheable host mem */
- sba_free_consistent, /* release cacheable host mem */
- sba_map_single,
- sba_unmap_single,
- sba_map_sg,
- sba_unmap_sg,
- NULL, /* dma_sync_single */
- NULL /* dma_sync_sg */
+static struct hppa_dma_ops sba_ops = {
+ .dma_supported = sba_dma_supported,
+ .alloc_consistent = sba_alloc_consistent,
+ .alloc_noncoherent = sba_alloc_consistent,
+ .free_consistent = sba_free_consistent,
+ .map_single = sba_map_single,
+ .unmap_single = sba_unmap_single,
+ .map_sg = sba_map_sg,
+ .unmap_sg = sba_unmap_sg,
+ .dma_sync_single = NULL,
+ .dma_sync_sg = NULL,
};
printk(KERN_INFO "%s found %s at 0x%lx\n",
MODULE_NAME, version, dev->hpa);
+ snprintf(dev->dev.name, sizeof(dev->dev.name), "%s version %s",
+ MODULE_NAME, version);
#ifdef DEBUG_SBA_INIT
sba_dump_tlb(dev->hpa);
void __devinit
superio_serial_init(void)
{
-#ifdef CONFIG_SERIAL
+#ifdef CONFIG_SERIAL_8250
struct serial_struct *serial;
int retval;
retval = register_serial(serial);
if (retval < 0)
printk(KERN_WARNING "SuperIO: Register Serial #1 failed.\n");
-#endif /* CONFIG_SERIAL */
+#endif /* CONFIG_SERIAL_8250 */
}
EXPORT_SYMBOL(superio_serial_init);
#ifdef CONFIG_PARPORT_PC
superio_parport_init();
#endif
-#ifdef CONFIG_SERIAL
+#ifdef CONFIG_SERIAL_8250
superio_serial_init();
#endif
/* REVISIT : superio_fdc_init() ? */
static int __init superio_modinit(void)
{
+#ifdef CONFIG_SERIAL_8250
+ extern int serial8250_init(void);
+ serial8250_init();
+#endif
+
return pci_module_init(&superio_driver);
}
wax->version = 0; /* gsc_readb(wax->hpa+WAX_VER); */
printk(KERN_INFO "%s at 0x%lx found.\n", wax->name, wax->hpa);
+ snprintf(dev->dev.name, sizeof(dev->dev.name), "%s version %d",
+ wax->name, wax->version);
/* Stop wax hissing for a bit */
wax_init_irq(wax);