Index: kernel/genarch/Makefile.inc
===================================================================
--- kernel/genarch/Makefile.inc	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
+++ kernel/genarch/Makefile.inc	(revision 699f3bcdc98661bd594c7b8a7ce07aa2ccc02155)
@@ -100,9 +100,4 @@
 endif
 
-ifeq ($(CONFIG_Z8530),y)
-	GENARCH_SOURCES += \
-		genarch/src/drivers/z8530/z8530.c
-endif
-
 ifeq ($(CONFIG_VIA_CUDA),y)
 	GENARCH_SOURCES += \
@@ -141,5 +136,4 @@
 	GENARCH_SOURCES += \
 		genarch/src/ofw/ebus.c \
-		genarch/src/ofw/fhc.c \
 		genarch/src/ofw/pci.c  \
 		genarch/src/ofw/sbus.c \
Index: kernel/genarch/include/drivers/z8530/z8530.h
===================================================================
--- kernel/genarch/include/drivers/z8530/z8530.h	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
+++ 	(revision )
@@ -1,128 +1,0 @@
-/*
- * Copyright (c) 2009 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
- */
-
-/** @addtogroup genarch
- * @{
- */
-/**
- * @file
- * @brief Headers for Zilog 8530 serial controller.
- */
-
-#ifndef KERN_Z8530_H_
-#define KERN_Z8530_H_
-
-#include <ddi/irq.h>
-#include <typedefs.h>
-#include <console/chardev.h>
-
-#define WR0   0
-#define WR1   1
-#define WR2   2
-#define WR3   3
-#define WR4   4
-#define WR5   5
-#define WR6   6
-#define WR7   7
-#define WR8   8
-#define WR9   9
-#define WR10  10
-#define WR11  11
-#define WR12  12
-#define WR13  13
-#define WR14  14
-#define WR15  15
-
-#define RR0   0
-#define RR1   1
-#define RR2   2
-#define RR3   3
-#define RR8   8
-#define RR10  10
-#define RR12  12
-#define RR13  13
-#define RR14  14
-#define RR15  15
-
-/** Reset pending TX interrupt. */
-#define WR0_TX_IP_RST  (0x5 << 3)
-#define WR0_ERR_RST    (0x6 << 3)
-
-/** Receive Interrupts Disabled. */
-#define WR1_RID     (0x0 << 3)
-/** Receive Interrupt on First Character or Special Condition. */
-#define WR1_RIFCSC  (0x1 << 3)
-/** Interrupt on All Receive Characters or Special Conditions. */
-#define WR1_IARCSC  (0x2 << 3)
-/** Receive Interrupt on Special Condition. */
-#define WR1_RISC    (0x3 << 3)
-/** Parity Is Special Condition. */
-#define WR1_PISC    (0x1 << 2)
-
-/** Rx Enable. */
-#define WR3_RX_ENABLE  (0x1 << 0)
-/** 8-bits per character. */
-#define WR3_RX8BITSCH  (0x3 << 6)
-
-/** Master Interrupt Enable. */
-#define WR9_MIE  (0x1 << 3)
-
-/** Receive Character Available. */
-#define RR0_RCA  (0x1 << 0)
-
-/** z8530's registers. */
-typedef struct {
-	union {
-		ioport8_t ctl_b;
-		ioport8_t status_b;
-	} __attribute__ ((packed));
-	uint8_t pad1;
-	ioport8_t data_b;
-	uint8_t pad2;
-	union {
-		ioport8_t ctl_a;
-		ioport8_t status_a;
-	} __attribute__ ((packed));
-	uint8_t pad3;
-	ioport8_t data_a;
-} __attribute__ ((packed)) z8530_t;
-
-/** Structure representing the z8530 device. */
-typedef struct {
-	irq_t irq;
-	z8530_t *z8530;
-	indev_t *kbrdin;
-} z8530_instance_t;
-
-extern z8530_instance_t *z8530_init(z8530_t *, inr_t, cir_t, void *);
-extern void z8530_wire(z8530_instance_t *, indev_t *);
-
-#endif
-
-/** @}
- */
Index: kernel/genarch/include/ofw/fhc.h
===================================================================
--- kernel/genarch/include/ofw/fhc.h	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
+++ 	(revision )
@@ -1,67 +1,0 @@
-/*
- * Copyright (c) 2006 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
- */
-
-#ifndef KERN_FHC_H_
-#define KERN_FHC_H_
-
-#include <genarch/ofw/ofw_tree.h>
-#include <typedefs.h>
-#include <ddi/irq.h>
-#include <typedefs.h>
-
-typedef struct {
-	uint64_t addr;
-	uint32_t size;
-} __attribute__ ((packed)) ofw_fhc_reg_t;
-
-typedef struct {
-	uint64_t child_base;
-	uint64_t parent_base;
-	uint32_t size;
-} __attribute__ ((packed)) ofw_fhc_range_t;
-
-typedef struct {
-	uint64_t addr;
-	uint32_t size;
-} __attribute__ ((packed)) ofw_central_reg_t;
-
-typedef struct {
-	uint64_t child_base;
-	uint64_t parent_base;
-	uint32_t size;
-} __attribute__ ((packed)) ofw_central_range_t;
-
-extern bool ofw_fhc_apply_ranges(ofw_tree_node_t *, ofw_fhc_reg_t *,
-    uintptr_t *);
-extern bool ofw_central_apply_ranges(ofw_tree_node_t *, ofw_central_reg_t *,
-    uintptr_t *);
-
-extern bool ofw_fhc_map_interrupt(ofw_tree_node_t *, ofw_fhc_reg_t *,
-    uint32_t, int *, cir_t *, void **);
-
-#endif
Index: kernel/genarch/src/drivers/z8530/z8530.c
===================================================================
--- kernel/genarch/src/drivers/z8530/z8530.c	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
+++ 	(revision )
@@ -1,136 +1,0 @@
-/*
- * Copyright (c) 2009 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
- */
-
-/** @addtogroup genarch
- * @{
- */
-/**
- * @file
- * @brief Zilog 8530 serial controller driver.
- */
-
-#include <genarch/drivers/z8530/z8530.h>
-#include <console/chardev.h>
-#include <ddi/irq.h>
-#include <arch/asm.h>
-#include <mm/slab.h>
-#include <ddi/device.h>
-
-static inline void z8530_write(ioport8_t *ctl, uint8_t reg, uint8_t val)
-{
-	/*
-	 * Registers 8-15 will automatically issue the Point High
-	 * command as their bit 3 is 1.
-	 */
-	pio_write_8(ctl, reg);  /* Select register */
-	pio_write_8(ctl, val);  /* Write value */
-}
-
-static inline uint8_t z8530_read(ioport8_t *ctl, uint8_t reg) 
-{
-	/*
-	 * Registers 8-15 will automatically issue the Point High
-	 * command as their bit 3 is 1.
-	 */
-	pio_write_8(ctl, reg);   /* Select register */
-	return pio_read_8(ctl);
-}
-
-static irq_ownership_t z8530_claim(irq_t *irq)
-{
-	z8530_instance_t *instance = irq->instance;
-	z8530_t *dev = instance->z8530;
-	
-	if (z8530_read(&dev->ctl_a, RR0) & RR0_RCA)
-		return IRQ_ACCEPT;
-	else
-		return IRQ_DECLINE;
-}
-
-static void z8530_irq_handler(irq_t *irq)
-{
-	z8530_instance_t *instance = irq->instance;
-	z8530_t *dev = instance->z8530;
-	
-	if (z8530_read(&dev->ctl_a, RR0) & RR0_RCA) {
-		uint8_t data = z8530_read(&dev->ctl_a, RR8);
-		indev_push_character(instance->kbrdin, data);
-	}
-}
-
-/** Initialize z8530. */
-z8530_instance_t *z8530_init(z8530_t *dev, inr_t inr, cir_t cir, void *cir_arg)
-{
-	z8530_instance_t *instance
-	    = malloc(sizeof(z8530_instance_t), FRAME_ATOMIC);
-	if (instance) {
-		instance->z8530 = dev;
-		instance->kbrdin = NULL;
-		
-		irq_initialize(&instance->irq);
-		instance->irq.devno = device_assign_devno();
-		instance->irq.inr = inr;
-		instance->irq.claim = z8530_claim;
-		instance->irq.handler = z8530_irq_handler;
-		instance->irq.instance = instance;
-		instance->irq.cir = cir;
-		instance->irq.cir_arg = cir_arg;
-	}
-	
-	return instance;
-}
-
-void z8530_wire(z8530_instance_t *instance, indev_t *kbrdin)
-{
-	ASSERT(instance);
-	ASSERT(kbrdin);
-	
-	instance->kbrdin = kbrdin;
-	
-	irq_register(&instance->irq);
-	
-	(void) z8530_read(&instance->z8530->ctl_a, RR8);
-	
-	/*
-	 * Clear any pending TX interrupts or we never manage
-	 * to set FHC UART interrupt state to idle.
-	 */
-	z8530_write(&instance->z8530->ctl_a, WR0, WR0_TX_IP_RST);
-	
-	/* interrupt on all characters */
-	z8530_write(&instance->z8530->ctl_a, WR1, WR1_IARCSC);
-	
-	/* 8 bits per character and enable receiver */
-	z8530_write(&instance->z8530->ctl_a, WR3, WR3_RX8BITSCH | WR3_RX_ENABLE);
-	
-	/* Master Interrupt Enable. */
-	z8530_write(&instance->z8530->ctl_a, WR9, WR9_MIE);
-}
-
-/** @}
- */
Index: kernel/genarch/src/ofw/fhc.c
===================================================================
--- kernel/genarch/src/ofw/fhc.c	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
+++ 	(revision )
@@ -1,137 +1,0 @@
-/*
- * Copyright (c) 2006 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - 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.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
- */
-
-/** @addtogroup ofw
- * @{
- */
-/**
- * @file
- * @brief	FHC 'reg' and 'ranges' properties handling.
- *
- */
-
-#include <genarch/ofw/ofw_tree.h>
-#include <genarch/ofw/fhc.h>
-#include <arch/drivers/fhc.h>
-#include <str.h>
-#include <panic.h>
-#include <macros.h>
-
-bool ofw_fhc_apply_ranges(ofw_tree_node_t *node, ofw_fhc_reg_t *reg, uintptr_t *pa)
-{
-	ofw_tree_property_t *prop;
-	ofw_fhc_range_t *range;
-	size_t ranges;
-
-	prop = ofw_tree_getprop(node, "ranges");
-	if (!prop)
-		return false;
-		
-	ranges = prop->size / sizeof(ofw_fhc_range_t);
-	range = prop->value;
-	
-	unsigned int i;
-	
-	for (i = 0; i < ranges; i++) {
-		if (overlaps(reg->addr, reg->size, range[i].child_base, range[i].size)) {
-			uintptr_t addr;
-			
-			addr = range[i].parent_base + (reg->addr - range[i].child_base);
-			if (!node->parent->parent) {
-				*pa = addr;
-				return true;
-			}
-			if (str_cmp(ofw_tree_node_name(node->parent), "central") != 0)
-				panic("Unexpected parent node: %s.", ofw_tree_node_name(node->parent));
-			
-			ofw_central_reg_t central_reg;
-			
-			central_reg.addr = addr;
-			central_reg.size = reg->size;
-			
-			return ofw_central_apply_ranges(node->parent, &central_reg, pa);
-		}
-	}
-
-	return false;
-}
-
-bool ofw_central_apply_ranges(ofw_tree_node_t *node, ofw_central_reg_t *reg, uintptr_t *pa)
-{
-	if (node->parent->parent)
-		panic("Unexpected parent node: %s.", ofw_tree_node_name(node->parent));
-	
-	ofw_tree_property_t *prop;
-	ofw_central_range_t *range;
-	size_t ranges;
-	
-	prop = ofw_tree_getprop(node, "ranges");
-	if (!prop)
-		return false;
-		
-	ranges = prop->size / sizeof(ofw_central_range_t);
-	range = prop->value;
-	
-	unsigned int i;
-	
-	for (i = 0; i < ranges; i++) {
-		if (overlaps(reg->addr, reg->size, range[i].child_base, range[i].size)) {
-			*pa = range[i].parent_base + (reg->addr - range[i].child_base);
-			return true;
-		}
-	}
-	
-	return false;
-}
-
-bool
-ofw_fhc_map_interrupt(ofw_tree_node_t *node, ofw_fhc_reg_t *reg,
-    uint32_t interrupt, int *inr, cir_t *cir, void **cir_arg)
-{
-	fhc_t *fhc = NULL;
-	if (!node->device) {
-		fhc = fhc_init(node);
-		if (!fhc)
-			return false;
-		node->device = fhc;
-		central_fhc = fhc;
-	}
-	
-	/*
-	 * The interrupt controller for the interrupt is the FHC itself.
-	 */
-	fhc_enable_interrupt(fhc, interrupt);
-	
-	*inr = interrupt;
-	*cir = fhc_clear_interrupt;
-	*cir_arg = fhc;
-	return true;
-}
-
-/** @}
- */
