aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/wrppmc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/wrppmc')
-rw-r--r--arch/mips/wrppmc/Makefile12
-rw-r--r--arch/mips/wrppmc/Platform7
-rw-r--r--arch/mips/wrppmc/irq.c56
-rw-r--r--arch/mips/wrppmc/pci.c52
-rw-r--r--arch/mips/wrppmc/reset.c41
-rw-r--r--arch/mips/wrppmc/serial.c80
-rw-r--r--arch/mips/wrppmc/setup.c128
-rw-r--r--arch/mips/wrppmc/time.c39
8 files changed, 0 insertions, 415 deletions
diff --git a/arch/mips/wrppmc/Makefile b/arch/mips/wrppmc/Makefile
deleted file mode 100644
index 307cc6920ce6..000000000000
--- a/arch/mips/wrppmc/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
1#
2# This file is subject to the terms and conditions of the GNU General Public
3# License. See the file "COPYING" in the main directory of this archive
4# for more details.
5#
6# Copyright 2006 Wind River System, Inc.
7# Author: Rongkai.Zhan <rongkai.zhan@windriver.com>
8#
9# Makefile for the Wind River MIPS 4Kc PPMC Eval Board
10#
11
12obj-y += irq.o pci.o reset.o serial.o setup.o time.o
diff --git a/arch/mips/wrppmc/Platform b/arch/mips/wrppmc/Platform
deleted file mode 100644
index dc78b25b95fe..000000000000
--- a/arch/mips/wrppmc/Platform
+++ /dev/null
@@ -1,7 +0,0 @@
1#
2# Wind River PPMC Board (4KC + GT64120)
3#
4platform-$(CONFIG_WR_PPMC) += wrppmc/
5cflags-$(CONFIG_WR_PPMC) += \
6 -I$(srctree)/arch/mips/include/asm/mach-wrppmc
7load-$(CONFIG_WR_PPMC) += 0xffffffff80100000
diff --git a/arch/mips/wrppmc/irq.c b/arch/mips/wrppmc/irq.c
deleted file mode 100644
index f237bf4d5c3a..000000000000
--- a/arch/mips/wrppmc/irq.c
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * irq.c: GT64120 Interrupt Controller
3 *
4 * Copyright (C) 2006, Wind River System Inc.
5 * Author: Rongkai.Zhan, <rongkai.zhan@windriver.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12#include <linux/hardirq.h>
13#include <linux/init.h>
14#include <linux/irq.h>
15
16#include <asm/gt64120.h>
17#include <asm/irq_cpu.h>
18#include <asm/mipsregs.h>
19
20asmlinkage void plat_irq_dispatch(void)
21{
22 unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
23
24 if (pending & STATUSF_IP7)
25 do_IRQ(WRPPMC_MIPS_TIMER_IRQ); /* CPU Compare/Count internal timer */
26 else if (pending & STATUSF_IP6)
27 do_IRQ(WRPPMC_UART16550_IRQ); /* UART 16550 port */
28 else if (pending & STATUSF_IP3)
29 do_IRQ(WRPPMC_PCI_INTA_IRQ); /* PCI INT_A */
30 else
31 spurious_interrupt();
32}
33
34/**
35 * Initialize GT64120 Interrupt Controller
36 */
37void gt64120_init_pic(void)
38{
39 /* clear CPU Interrupt Cause Registers */
40 GT_WRITE(GT_INTRCAUSE_OFS, (0x1F << 21));
41 GT_WRITE(GT_HINTRCAUSE_OFS, 0x00);
42
43 /* Disable all interrupts from GT64120 bridge chip */
44 GT_WRITE(GT_INTRMASK_OFS, 0x00);
45 GT_WRITE(GT_HINTRMASK_OFS, 0x00);
46 GT_WRITE(GT_PCI0_ICMASK_OFS, 0x00);
47 GT_WRITE(GT_PCI0_HICMASK_OFS, 0x00);
48}
49
50void __init arch_init_irq(void)
51{
52 /* IRQ 0 - 7 are for MIPS common irq_cpu controller */
53 mips_cpu_irq_init();
54
55 gt64120_init_pic();
56}
diff --git a/arch/mips/wrppmc/pci.c b/arch/mips/wrppmc/pci.c
deleted file mode 100644
index 8b8a0e1a40ca..000000000000
--- a/arch/mips/wrppmc/pci.c
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * pci.c: GT64120 PCI support.
3 *
4 * Copyright (C) 2006, Wind River System Inc. Rongkai.Zhan <rongkai.zhan@windriver.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#include <linux/init.h>
11#include <linux/ioport.h>
12#include <linux/types.h>
13#include <linux/pci.h>
14
15#include <asm/gt64120.h>
16
17extern struct pci_ops gt64xxx_pci0_ops;
18
19static struct resource pci0_io_resource = {
20 .name = "pci_0 io",
21 .start = GT_PCI_IO_BASE,
22 .end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1,
23 .flags = IORESOURCE_IO,
24};
25
26static struct resource pci0_mem_resource = {
27 .name = "pci_0 memory",
28 .start = GT_PCI_MEM_BASE,
29 .end = GT_PCI_MEM_BASE + GT_PCI_MEM_SIZE - 1,
30 .flags = IORESOURCE_MEM,
31};
32
33static struct pci_controller hose_0 = {
34 .pci_ops = &gt64xxx_pci0_ops,
35 .io_resource = &pci0_io_resource,
36 .mem_resource = &pci0_mem_resource,
37};
38
39static int __init gt64120_pci_init(void)
40{
41 (void) GT_READ(GT_PCI0_CMD_OFS); /* Huh??? -- Ralf */
42 (void) GT_READ(GT_PCI0_BARE_OFS);
43
44 /* reset the whole PCI I/O space range */
45 ioport_resource.start = GT_PCI_IO_BASE;
46 ioport_resource.end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1;
47
48 register_pci_controller(&hose_0);
49 return 0;
50}
51
52arch_initcall(gt64120_pci_init);
diff --git a/arch/mips/wrppmc/reset.c b/arch/mips/wrppmc/reset.c
deleted file mode 100644
index 80beb188ed47..000000000000
--- a/arch/mips/wrppmc/reset.c
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1997 Ralf Baechle
7 */
8#include <linux/irqflags.h>
9#include <linux/kernel.h>
10
11#include <asm/cacheflush.h>
12#include <asm/idle.h>
13#include <asm/mipsregs.h>
14#include <asm/processor.h>
15
16void wrppmc_machine_restart(char *command)
17{
18 /*
19 * Ouch, we're still alive ... This time we take the silver bullet ...
20 * ... and find that we leave the hardware in a state in which the
21 * kernel in the flush locks up somewhen during of after the PCI
22 * detection stuff.
23 */
24 local_irq_disable();
25 set_c0_status(ST0_BEV | ST0_ERL);
26 change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
27 flush_cache_all();
28 write_c0_wired(0);
29 __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
30}
31
32void wrppmc_machine_halt(void)
33{
34 local_irq_disable();
35
36 printk(KERN_NOTICE "You can safely turn off the power\n");
37 while (1) {
38 if (cpu_wait)
39 cpu_wait();
40 }
41}
diff --git a/arch/mips/wrppmc/serial.c b/arch/mips/wrppmc/serial.c
deleted file mode 100644
index 83f0f7d05187..000000000000
--- a/arch/mips/wrppmc/serial.c
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * Registration of WRPPMC UART platform device.
3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/errno.h>
21#include <linux/init.h>
22#include <linux/ioport.h>
23#include <linux/platform_device.h>
24#include <linux/serial_8250.h>
25
26#include <asm/gt64120.h>
27
28static struct resource wrppmc_uart_resource[] __initdata = {
29 {
30 .start = WRPPMC_UART16550_BASE,
31 .end = WRPPMC_UART16550_BASE + 7,
32 .flags = IORESOURCE_MEM,
33 },
34 {
35 .start = WRPPMC_UART16550_IRQ,
36 .end = WRPPMC_UART16550_IRQ,
37 .flags = IORESOURCE_IRQ,
38 },
39};
40
41static struct plat_serial8250_port wrppmc_serial8250_port[] = {
42 {
43 .irq = WRPPMC_UART16550_IRQ,
44 .uartclk = WRPPMC_UART16550_CLOCK,
45 .iotype = UPIO_MEM,
46 .flags = UPF_IOREMAP | UPF_SKIP_TEST,
47 .mapbase = WRPPMC_UART16550_BASE,
48 },
49 {},
50};
51
52static __init int wrppmc_uart_add(void)
53{
54 struct platform_device *pdev;
55 int retval;
56
57 pdev = platform_device_alloc("serial8250", -1);
58 if (!pdev)
59 return -ENOMEM;
60
61 pdev->id = PLAT8250_DEV_PLATFORM;
62 pdev->dev.platform_data = wrppmc_serial8250_port;
63
64 retval = platform_device_add_resources(pdev, wrppmc_uart_resource,
65 ARRAY_SIZE(wrppmc_uart_resource));
66 if (retval)
67 goto err_free_device;
68
69 retval = platform_device_add(pdev);
70 if (retval)
71 goto err_free_device;
72
73 return 0;
74
75err_free_device:
76 platform_device_put(pdev);
77
78 return retval;
79}
80device_initcall(wrppmc_uart_add);
diff --git a/arch/mips/wrppmc/setup.c b/arch/mips/wrppmc/setup.c
deleted file mode 100644
index ca65c84031a7..000000000000
--- a/arch/mips/wrppmc/setup.c
+++ /dev/null
@@ -1,128 +0,0 @@
1/*
2 * setup.c: Setup pointers to hardware dependent routines.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1996, 1997, 2004 by Ralf Baechle (ralf@linux-mips.org)
9 * Copyright (C) 2006, Wind River System Inc. Rongkai.zhan <rongkai.zhan@windriver.com>
10 */
11#include <linux/init.h>
12#include <linux/string.h>
13#include <linux/kernel.h>
14#include <linux/pm.h>
15
16#include <asm/io.h>
17#include <asm/bootinfo.h>
18#include <asm/reboot.h>
19#include <asm/time.h>
20#include <asm/gt64120.h>
21
22unsigned long gt64120_base = KSEG1ADDR(0x14000000);
23
24#ifdef WRPPMC_EARLY_DEBUG
25
26static volatile unsigned char * wrppmc_led = \
27 (volatile unsigned char *)KSEG1ADDR(WRPPMC_LED_BASE);
28
29/*
30 * PPMC LED control register:
31 * -) bit[0] controls DS1 LED (1 - OFF, 0 - ON)
32 * -) bit[1] controls DS2 LED (1 - OFF, 0 - ON)
33 * -) bit[2] controls DS4 LED (1 - OFF, 0 - ON)
34 */
35void wrppmc_led_on(int mask)
36{
37 unsigned char value = *wrppmc_led;
38
39 value &= (0xF8 | mask);
40 *wrppmc_led = value;
41}
42
43/* If mask = 0, turn off all LEDs */
44void wrppmc_led_off(int mask)
45{
46 unsigned char value = *wrppmc_led;
47
48 value |= (0x7 & mask);
49 *wrppmc_led = value;
50}
51
52/*
53 * We assume that bootloader has initialized UART16550 correctly
54 */
55void __init wrppmc_early_putc(char ch)
56{
57 static volatile unsigned char *wrppmc_uart = \
58 (volatile unsigned char *)KSEG1ADDR(WRPPMC_UART16550_BASE);
59 unsigned char value;
60
61 /* Wait until Transmit-Holding-Register is empty */
62 while (1) {
63 value = *(wrppmc_uart + 5);
64 if (value & 0x20)
65 break;
66 }
67
68 *wrppmc_uart = ch;
69}
70
71void __init wrppmc_early_printk(const char *fmt, ...)
72{
73 static char pbuf[256] = {'\0', };
74 char *ch = pbuf;
75 va_list args;
76 unsigned int i;
77
78 memset(pbuf, 0, 256);
79 va_start(args, fmt);
80 i = vsprintf(pbuf, fmt, args);
81 va_end(args);
82
83 /* Print the string */
84 while (*ch != '\0') {
85 wrppmc_early_putc(*ch);
86 /* if print '\n', also print '\r' */
87 if (*ch++ == '\n')
88 wrppmc_early_putc('\r');
89 }
90}
91#endif /* WRPPMC_EARLY_DEBUG */
92
93void __init prom_free_prom_memory(void)
94{
95}
96
97void __init plat_mem_setup(void)
98{
99 extern void wrppmc_machine_restart(char *command);
100 extern void wrppmc_machine_halt(void);
101
102 _machine_restart = wrppmc_machine_restart;
103 _machine_halt = wrppmc_machine_halt;
104 pm_power_off = wrppmc_machine_halt;
105
106 /* This makes the operations of 'in/out[bwl]' to the
107 * physical address ( < KSEG0) can work via KSEG1
108 */
109 set_io_port_base(KSEG1);
110}
111
112const char *get_system_type(void)
113{
114 return "Wind River PPMC (GT64120)";
115}
116
117/*
118 * Initializes basic routines and structures pointers, memory size (as
119 * given by the bios and saves the command line.
120 */
121void __init prom_init(void)
122{
123 add_memory_region(WRPPMC_SDRAM_SCS0_BASE, WRPPMC_SDRAM_SCS0_SIZE, BOOT_MEM_RAM);
124 add_memory_region(WRPPMC_BOOTROM_BASE, WRPPMC_BOOTROM_SIZE, BOOT_MEM_ROM_DATA);
125
126 wrppmc_early_printk("prom_init: GT64120 SDRAM Bank 0: 0x%x - 0x%08lx\n",
127 WRPPMC_SDRAM_SCS0_BASE, (WRPPMC_SDRAM_SCS0_BASE + WRPPMC_SDRAM_SCS0_SIZE));
128}
diff --git a/arch/mips/wrppmc/time.c b/arch/mips/wrppmc/time.c
deleted file mode 100644
index 668dbd5f12c5..000000000000
--- a/arch/mips/wrppmc/time.c
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * time.c: MIPS CPU Count/Compare timer hookup
3 *
4 * Author: Mark.Zhan, <rongkai.zhan@windriver.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 1996, 1997, 2004 by Ralf Baechle (ralf@linux-mips.org)
11 * Copyright (C) 2006, Wind River System Inc.
12 */
13#include <linux/init.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16
17#include <asm/gt64120.h>
18#include <asm/time.h>
19
20#define WRPPMC_CPU_CLK_FREQ 40000000 /* 40MHZ */
21
22/*
23 * Estimate CPU frequency. Sets mips_hpt_frequency as a side-effect
24 *
25 * NOTE: We disable all GT64120 timers, and use MIPS processor internal
26 * timer as the source of kernel clock tick.
27 */
28void __init plat_time_init(void)
29{
30 /* Disable GT64120 timers */
31 GT_WRITE(GT_TC_CONTROL_OFS, 0x00);
32 GT_WRITE(GT_TC0_OFS, 0x00);
33 GT_WRITE(GT_TC1_OFS, 0x00);
34 GT_WRITE(GT_TC2_OFS, 0x00);
35 GT_WRITE(GT_TC3_OFS, 0x00);
36
37 /* Use MIPS compare/count internal timer */
38 mips_hpt_frequency = WRPPMC_CPU_CLK_FREQ;
39}