diff options
author | Magnus Damm <damm@igel.co.jp> | 2008-01-15 12:47:53 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-01-28 13:19:03 +0900 |
commit | 29ec6778a49d30c47345afdfaf1d03acff3cf656 (patch) | |
tree | 55ca74a5876ea93f77abdc42411a9f63101c7231 /arch/sh/cchips | |
parent | cbd10dfb82d6b0b169a42fe52223259f0b1a2cab (diff) | |
download | linux-stable-29ec6778a49d30c47345afdfaf1d03acff3cf656.tar.gz linux-stable-29ec6778a49d30c47345afdfaf1d03acff3cf656.tar.bz2 linux-stable-29ec6778a49d30c47345afdfaf1d03acff3cf656.zip |
sh: remove voyagergx
This patch removes redundant irq handling code together with unused
consistent alloc code. R2D uart setup code is changed to use
sm501-regs.h and unused header files are removed.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/cchips')
-rw-r--r-- | arch/sh/cchips/voyagergx/Makefile | 9 | ||||
-rw-r--r-- | arch/sh/cchips/voyagergx/consistent.c | 121 | ||||
-rw-r--r-- | arch/sh/cchips/voyagergx/irq.c | 101 | ||||
-rw-r--r-- | arch/sh/cchips/voyagergx/setup.c | 37 |
4 files changed, 0 insertions, 268 deletions
diff --git a/arch/sh/cchips/voyagergx/Makefile b/arch/sh/cchips/voyagergx/Makefile deleted file mode 100644 index f73963cb3744..000000000000 --- a/arch/sh/cchips/voyagergx/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# -# Makefile for VoyagerGX -# - -obj-y := irq.o setup.o - -obj-$(CONFIG_USB_OHCI_HCD) += consistent.o - -EXTRA_CFLAGS += -Werror diff --git a/arch/sh/cchips/voyagergx/consistent.c b/arch/sh/cchips/voyagergx/consistent.c deleted file mode 100644 index 07e8b9c5a531..000000000000 --- a/arch/sh/cchips/voyagergx/consistent.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * arch/sh/cchips/voyagergx/consistent.c - * - * Copyright (C) 2004 Paul Mundt - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - */ -#include <linux/mm.h> -#include <linux/dma-mapping.h> -#include <linux/slab.h> -#include <linux/list.h> -#include <linux/types.h> -#include <linux/module.h> -#include <linux/device.h> -#include <asm/io.h> - - -struct voya_alloc_entry { - struct list_head list; - unsigned long ofs; - unsigned long len; -}; - -static DEFINE_SPINLOCK(voya_list_lock); -static LIST_HEAD(voya_alloc_list); - -#define OHCI_SRAM_START 0xb0000000 -#define OHCI_HCCA_SIZE 0x100 -#define OHCI_SRAM_SIZE 0x10000 - -#define VOYAGER_OHCI_NAME "voyager-ohci" - -void *voyagergx_consistent_alloc(struct device *dev, size_t size, - dma_addr_t *handle, gfp_t flag) -{ - struct list_head *list = &voya_alloc_list; - struct voya_alloc_entry *entry; - unsigned long start, end; - unsigned long flags; - - /* - * The SM501 contains an integrated 8051 with its own SRAM. - * Devices within the cchip can all hook into the 8051 SRAM. - * We presently use this for the OHCI. - * - * Everything else goes through consistent_alloc(). - */ - if (!dev || strcmp(dev->driver->name, VOYAGER_OHCI_NAME)) - return NULL; - - start = OHCI_SRAM_START + OHCI_HCCA_SIZE; - - entry = kmalloc(sizeof(struct voya_alloc_entry), GFP_ATOMIC); - if (!entry) - return ERR_PTR(-ENOMEM); - - entry->len = (size + 15) & ~15; - - /* - * The basis for this allocator is dwmw2's malloc.. the - * Matrox allocator :-) - */ - spin_lock_irqsave(&voya_list_lock, flags); - list_for_each(list, &voya_alloc_list) { - struct voya_alloc_entry *p; - - p = list_entry(list, struct voya_alloc_entry, list); - - if (p->ofs - start >= size) - goto out; - - start = p->ofs + p->len; - } - - end = start + (OHCI_SRAM_SIZE - OHCI_HCCA_SIZE); - list = &voya_alloc_list; - - if (end - start >= size) { -out: - entry->ofs = start; - list_add_tail(&entry->list, list); - spin_unlock_irqrestore(&voya_list_lock, flags); - - *handle = start; - return (void *)start; - } - - kfree(entry); - spin_unlock_irqrestore(&voya_list_lock, flags); - - return ERR_PTR(-EINVAL); -} - -int voyagergx_consistent_free(struct device *dev, size_t size, - void *vaddr, dma_addr_t handle) -{ - struct voya_alloc_entry *entry; - unsigned long flags; - - if (!dev || strcmp(dev->driver->name, VOYAGER_OHCI_NAME)) - return -EINVAL; - - spin_lock_irqsave(&voya_list_lock, flags); - list_for_each_entry(entry, &voya_alloc_list, list) { - if (entry->ofs != handle) - continue; - - list_del(&entry->list); - kfree(entry); - - break; - } - spin_unlock_irqrestore(&voya_list_lock, flags); - - return 0; -} - -EXPORT_SYMBOL(voyagergx_consistent_alloc); -EXPORT_SYMBOL(voyagergx_consistent_free); diff --git a/arch/sh/cchips/voyagergx/irq.c b/arch/sh/cchips/voyagergx/irq.c deleted file mode 100644 index e7e78c612fad..000000000000 --- a/arch/sh/cchips/voyagergx/irq.c +++ /dev/null @@ -1,101 +0,0 @@ -/* -------------------------------------------------------------------- */ -/* setup_voyagergx.c: */ -/* -------------------------------------------------------------------- */ -/* 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 program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - Copyright 2003 (c) Lineo uSolutions,Inc. -*/ -#include <linux/interrupt.h> -#include <linux/init.h> -#include <linux/io.h> -#include <asm/voyagergx.h> -#include <asm/rts7751r2d.h> - -enum { - UNUSED = 0, - - /* voyager specific interrupt sources */ - UP, G54, G53, G52, G51, G50, G49, G48, - I2C, PW, DMA, PCI, I2S, AC, US, - U1, U0, CV, MC, S1, S0, - UH, TWOD, ZD, PV, CI, -}; - -static struct intc_vect vectors[] __initdata = { - INTC_IRQ(UP, IRQ_SM501_UP), INTC_IRQ(G54, IRQ_SM501_G54), - INTC_IRQ(G53, IRQ_SM501_G53), INTC_IRQ(G52, IRQ_SM501_G52), - INTC_IRQ(G51, IRQ_SM501_G51), INTC_IRQ(G50, IRQ_SM501_G50), - INTC_IRQ(G49, IRQ_SM501_G49), INTC_IRQ(G48, IRQ_SM501_G48), - INTC_IRQ(I2C, IRQ_SM501_I2C), INTC_IRQ(PW, IRQ_SM501_PW), - INTC_IRQ(DMA, IRQ_SM501_DMA), INTC_IRQ(PCI, IRQ_SM501_PCI), - INTC_IRQ(I2S, IRQ_SM501_I2S), INTC_IRQ(AC, IRQ_SM501_AC), - INTC_IRQ(US, IRQ_SM501_US), INTC_IRQ(U1, IRQ_SM501_U1), - INTC_IRQ(U0, IRQ_SM501_U0), INTC_IRQ(CV, IRQ_SM501_CV), - INTC_IRQ(MC, IRQ_SM501_MC), INTC_IRQ(S1, IRQ_SM501_S1), - INTC_IRQ(S0, IRQ_SM501_S0), INTC_IRQ(UH, IRQ_SM501_UH), - INTC_IRQ(TWOD, IRQ_SM501_2D), INTC_IRQ(ZD, IRQ_SM501_ZD), - INTC_IRQ(PV, IRQ_SM501_PV), INTC_IRQ(CI, IRQ_SM501_CI), -}; - -static struct intc_mask_reg mask_registers[] __initdata = { - { VOYAGER_INT_MASK, 0, 32, /* "Interrupt Mask", MMIO_base + 0x30 */ - { UP, G54, G53, G52, G51, G50, G49, G48, - I2C, PW, 0, DMA, PCI, I2S, AC, US, - 0, 0, U1, U0, CV, MC, S1, S0, - 0, UH, 0, 0, TWOD, ZD, PV, CI } }, -}; - -static DECLARE_INTC_DESC(intc_desc, "voyagergx", vectors, - NULL, mask_registers, NULL, NULL); - -static unsigned int voyagergx_stat2irq[32] = { - IRQ_SM501_CI, IRQ_SM501_PV, IRQ_SM501_ZD, IRQ_SM501_2D, - 0, 0, IRQ_SM501_UH, 0, - IRQ_SM501_S0, IRQ_SM501_S1, IRQ_SM501_MC, IRQ_SM501_CV, - IRQ_SM501_U0, IRQ_SM501_U1, 0, 0, - IRQ_SM501_US, IRQ_SM501_AC, IRQ_SM501_I2S, IRQ_SM501_PCI, - IRQ_SM501_DMA, 0, IRQ_SM501_PW, IRQ_SM501_I2C, - IRQ_SM501_G48, IRQ_SM501_G49, IRQ_SM501_G50, IRQ_SM501_G51, - IRQ_SM501_G52, IRQ_SM501_G53, IRQ_SM501_G54, IRQ_SM501_UP -}; - -static void voyagergx_irq_demux(unsigned int irq, struct irq_desc *desc) -{ - unsigned long intv = ctrl_inl(INT_STATUS); - struct irq_desc *ext_desc; - unsigned int ext_irq; - unsigned int k = 0; - - while (intv) { - ext_irq = voyagergx_stat2irq[k]; - if (ext_irq && (intv & 1)) { - ext_desc = irq_desc + ext_irq; - handle_level_irq(ext_irq, ext_desc); - } - intv >>= 1; - k++; - } -} - -void __init setup_voyagergx_irq(void) -{ - printk(KERN_INFO "VoyagerGX on irq %d (mapped into %d to %d)\n", - IRQ_VOYAGER, - VOYAGER_IRQ_BASE, - VOYAGER_IRQ_BASE + VOYAGER_IRQ_NUM - 1); - - register_intc_controller(&intc_desc); - set_irq_chained_handler(IRQ_VOYAGER, voyagergx_irq_demux); -} diff --git a/arch/sh/cchips/voyagergx/setup.c b/arch/sh/cchips/voyagergx/setup.c deleted file mode 100644 index 33f03027c193..000000000000 --- a/arch/sh/cchips/voyagergx/setup.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * arch/sh/cchips/voyagergx/setup.c - * - * Setup routines for VoyagerGX cchip. - * - * Copyright (C) 2003 Lineo uSolutions, Inc. - * - * 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. - */ -#include <linux/init.h> -#include <linux/module.h> -#include <asm/io.h> -#include <asm/voyagergx.h> - -static int __init setup_voyagergx(void) -{ - unsigned long val; - - val = readl((void __iomem *)DRAM_CTRL); - val |= (DRAM_CTRL_CPU_COLUMN_SIZE_256 | - DRAM_CTRL_CPU_ACTIVE_PRECHARGE | - DRAM_CTRL_CPU_RESET | - DRAM_CTRL_REFRESH_COMMAND | - DRAM_CTRL_BLOCK_WRITE_TIME | - DRAM_CTRL_BLOCK_WRITE_PRECHARGE | - DRAM_CTRL_ACTIVE_PRECHARGE | - DRAM_CTRL_RESET | - DRAM_CTRL_REMAIN_ACTIVE); - writel(val, (void __iomem *)DRAM_CTRL); - - return 0; -} - -module_init(setup_voyagergx); |