aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/qemu
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2008-01-29 05:15:02 -0500
committerRalf Baechle <ralf@linux-mips.org>2008-01-29 05:15:02 -0500
commit302922e5f6901eb6f29c58539631f71b3d9746b8 (patch)
treeb7e41f0da3bc8710363ab6cd020ace21d35a9ac6 /arch/mips/qemu
parent9900485893c004245cbaeef050fe6ba5453a5925 (diff)
[MIPS] Qemu: Remove platform.
The Qemu platform was originally implemented to have an easily supportable platform until Qemu reaches a state where it emulates a real world system. Since the latest release Qemu is capable of emulating the MIPSsim and Malta platforms, so this goal has been reached. The Qemu plaform is also rather underfeatured so less useful than a Malta emulation. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/qemu')
-rw-r--r--arch/mips/qemu/Makefile10
-rw-r--r--arch/mips/qemu/q-console.c26
-rw-r--r--arch/mips/qemu/q-firmware.c24
-rw-r--r--arch/mips/qemu/q-irq.c37
-rw-r--r--arch/mips/qemu/q-mem.c5
-rw-r--r--arch/mips/qemu/q-reset.c33
-rw-r--r--arch/mips/qemu/q-setup.c37
-rw-r--r--arch/mips/qemu/q-smp.c67
8 files changed, 0 insertions, 239 deletions
diff --git a/arch/mips/qemu/Makefile b/arch/mips/qemu/Makefile
deleted file mode 100644
index 2ba4ef34b4a7..000000000000
--- a/arch/mips/qemu/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
1#
2# Makefile for Qemu specific kernel interface routines under Linux.
3#
4
5obj-y = q-firmware.o q-irq.o q-mem.o q-setup.o q-reset.o
6
7obj-$(CONFIG_EARLY_PRINTK) += q-console.o
8obj-$(CONFIG_SMP) += q-smp.o
9
10EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/qemu/q-console.c b/arch/mips/qemu/q-console.c
deleted file mode 100644
index 81101ae5017a..000000000000
--- a/arch/mips/qemu/q-console.c
+++ /dev/null
@@ -1,26 +0,0 @@
1#include <linux/console.h>
2#include <linux/init.h>
3#include <linux/serial_reg.h>
4#include <asm/io.h>
5
6#define PORT(offset) (0x3f8 + (offset))
7
8static inline unsigned int serial_in(int offset)
9{
10 return inb(PORT(offset));
11}
12
13static inline void serial_out(int offset, int value)
14{
15 outb(value, PORT(offset));
16}
17
18int prom_putchar(char c)
19{
20 while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0)
21 ;
22
23 serial_out(UART_TX, c);
24
25 return 1;
26}
diff --git a/arch/mips/qemu/q-firmware.c b/arch/mips/qemu/q-firmware.c
deleted file mode 100644
index 3ed43f416cd1..000000000000
--- a/arch/mips/qemu/q-firmware.c
+++ /dev/null
@@ -1,24 +0,0 @@
1#include <linux/init.h>
2#include <linux/string.h>
3#include <asm/addrspace.h>
4#include <asm/bootinfo.h>
5#include <asm/io.h>
6
7#define QEMU_PORT_BASE 0xb4000000
8
9void __init prom_init(void)
10{
11 int *cmdline;
12
13 cmdline = (int *) (CKSEG0 + (0x10 << 20) - 260);
14 if (*cmdline == 0x12345678) {
15 if (*(char *)(cmdline + 1))
16 strcpy(arcs_cmdline, (char *)(cmdline + 1));
17 add_memory_region(0x0<<20, cmdline[-1], BOOT_MEM_RAM);
18 } else {
19 add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM);
20 }
21
22
23 set_io_port_base(QEMU_PORT_BASE);
24}
diff --git a/arch/mips/qemu/q-irq.c b/arch/mips/qemu/q-irq.c
deleted file mode 100644
index 7df36dbe65c7..000000000000
--- a/arch/mips/qemu/q-irq.c
+++ /dev/null
@@ -1,37 +0,0 @@
1#include <linux/init.h>
2#include <linux/interrupt.h>
3#include <linux/linkage.h>
4
5#include <asm/i8259.h>
6#include <asm/irq_cpu.h>
7#include <asm/mipsregs.h>
8#include <asm/qemu.h>
9#include <asm/system.h>
10#include <asm/time.h>
11
12asmlinkage void plat_irq_dispatch(void)
13{
14 unsigned int pending = read_c0_status() & read_c0_cause();
15
16 if (pending & 0x8000) {
17 do_IRQ(Q_COUNT_COMPARE_IRQ);
18 return;
19 }
20 if (pending & 0x0400) {
21 int irq = i8259_irq();
22
23 if (likely(irq >= 0))
24 do_IRQ(irq);
25
26 return;
27 }
28}
29
30void __init arch_init_irq(void)
31{
32 mips_hpt_frequency = QEMU_C0_COUNTER_CLOCK; /* 100MHz */
33
34 mips_cpu_irq_init();
35 init_i8259_irqs();
36 set_c0_status(0x400);
37}
diff --git a/arch/mips/qemu/q-mem.c b/arch/mips/qemu/q-mem.c
deleted file mode 100644
index dae39b59de15..000000000000
--- a/arch/mips/qemu/q-mem.c
+++ /dev/null
@@ -1,5 +0,0 @@
1#include <linux/init.h>
2
3void __init prom_free_prom_memory(void)
4{
5}
diff --git a/arch/mips/qemu/q-reset.c b/arch/mips/qemu/q-reset.c
deleted file mode 100644
index dbbe44ad7e89..000000000000
--- a/arch/mips/qemu/q-reset.c
+++ /dev/null
@@ -1,33 +0,0 @@
1
2#include <asm/io.h>
3#include <asm/reboot.h>
4#include <asm/cacheflush.h>
5#include <asm/qemu.h>
6
7static void qemu_machine_restart(char *command)
8{
9 volatile unsigned int *reg = (unsigned int *)QEMU_RESTART_REG;
10
11 set_c0_status(ST0_BEV | ST0_ERL);
12 change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
13 flush_cache_all();
14 write_c0_wired(0);
15 *reg = 42;
16 while (1)
17 cpu_wait();
18}
19
20static void qemu_machine_halt(void)
21{
22 volatile unsigned int *reg = (unsigned int *)QEMU_HALT_REG;
23
24 *reg = 42;
25 while (1)
26 cpu_wait();
27}
28
29void qemu_reboot_setup(void)
30{
31 _machine_restart = qemu_machine_restart;
32 _machine_halt = qemu_machine_halt;
33}
diff --git a/arch/mips/qemu/q-setup.c b/arch/mips/qemu/q-setup.c
deleted file mode 100644
index 9f0c2d3c67ea..000000000000
--- a/arch/mips/qemu/q-setup.c
+++ /dev/null
@@ -1,37 +0,0 @@
1#include <linux/init.h>
2#include <linux/platform_device.h>
3
4#include <asm/i8253.h>
5#include <asm/io.h>
6#include <asm/time.h>
7
8extern void qemu_reboot_setup(void);
9
10const char *get_system_type(void)
11{
12 return "Qemu";
13}
14
15void __init plat_time_init(void)
16{
17 setup_pit_timer();
18}
19
20void __init plat_mem_setup(void)
21{
22 qemu_reboot_setup();
23}
24
25static struct platform_device pcspeaker_pdev = {
26 .name = "pcspkr",
27 .id = -1,
28};
29
30static int __init qemu_platform_devinit(void)
31{
32 platform_device_register(&pcspeaker_pdev);
33
34 return 0;
35}
36
37device_initcall(qemu_platform_devinit);
diff --git a/arch/mips/qemu/q-smp.c b/arch/mips/qemu/q-smp.c
deleted file mode 100644
index ead6c30eeb14..000000000000
--- a/arch/mips/qemu/q-smp.c
+++ /dev/null
@@ -1,67 +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) 2006, 07 by Ralf Baechle (ralf@linux-mips.org)
7 *
8 * Symmetric Uniprocessor (TM) Support
9 */
10#include <linux/kernel.h>
11#include <linux/sched.h>
12
13/*
14 * Send inter-processor interrupt
15 */
16void up_send_ipi_single(int cpu, unsigned int action)
17{
18 panic(KERN_ERR "%s called", __func__);
19}
20
21static inline void up_send_ipi_mask(cpumask_t mask, unsigned int action)
22{
23 panic(KERN_ERR "%s called", __func__);
24}
25
26/*
27 * After we've done initial boot, this function is called to allow the
28 * board code to clean up state, if needed
29 */
30void __cpuinit up_init_secondary(void)
31{
32}
33
34void __cpuinit up_smp_finish(void)
35{
36}
37
38/* Hook for after all CPUs are online */
39void up_cpus_done(void)
40{
41}
42
43/*
44 * Firmware CPU startup hook
45 */
46void __cpuinit up_boot_secondary(int cpu, struct task_struct *idle)
47{
48}
49
50void __init up_smp_setup(void)
51{
52}
53
54void __init up_prepare_cpus(unsigned int max_cpus)
55{
56}
57
58struct plat_smp_ops up_smp_ops = {
59 .send_ipi_single = up_send_ipi_single,
60 .send_ipi_mask = up_send_ipi_mask,
61 .init_secondary = up_init_secondary,
62 .smp_finish = up_smp_finish,
63 .cpus_done = up_cpus_done,
64 .boot_secondary = up_boot_secondary,
65 .smp_setup = up_smp_setup,
66 .prepare_cpus = up_prepare_cpus,
67};