aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/ath25
diff options
context:
space:
mode:
authorSergey Ryazanov <ryazanov.s.a@gmail.com>2014-10-28 19:18:38 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-11-24 01:45:26 -0500
commit43cc739fd98b8c517ad45756d869f866e746ba04 (patch)
treec358c406d9e102d83da4e7f1951b09b8ecb0ac91 /arch/mips/ath25
parent484c344985ddf8e9ed12b8cf540eba0b1d869236 (diff)
MIPS: ath25: add common parts
Add common code for Atheros AR5312 and Atheros AR2315 SoCs families. Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> Cc: Linux MIPS <linux-mips@linux-mips.org> Patchwork: https://patchwork.linux-mips.org/patch/8237 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/ath25')
-rw-r--r--arch/mips/ath25/Makefile11
-rw-r--r--arch/mips/ath25/Platform6
-rw-r--r--arch/mips/ath25/board.c51
-rw-r--r--arch/mips/ath25/devices.c10
-rw-r--r--arch/mips/ath25/devices.h18
-rw-r--r--arch/mips/ath25/prom.c26
6 files changed, 122 insertions, 0 deletions
diff --git a/arch/mips/ath25/Makefile b/arch/mips/ath25/Makefile
new file mode 100644
index 000000000000..9199fa1508d2
--- /dev/null
+++ b/arch/mips/ath25/Makefile
@@ -0,0 +1,11 @@
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 FON Technology, SL.
7# Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org>
8# Copyright (C) 2006-2009 Felix Fietkau <nbd@openwrt.org>
9#
10
11obj-y += board.o prom.o devices.o
diff --git a/arch/mips/ath25/Platform b/arch/mips/ath25/Platform
new file mode 100644
index 000000000000..ef3f81fa080b
--- /dev/null
+++ b/arch/mips/ath25/Platform
@@ -0,0 +1,6 @@
1#
2# Atheros AR531X/AR231X WiSoC
3#
4platform-$(CONFIG_ATH25) += ath25/
5cflags-$(CONFIG_ATH25) += -I$(srctree)/arch/mips/include/asm/mach-ath25
6load-$(CONFIG_ATH25) += 0xffffffff80041000
diff --git a/arch/mips/ath25/board.c b/arch/mips/ath25/board.c
new file mode 100644
index 000000000000..dd70327fd801
--- /dev/null
+++ b/arch/mips/ath25/board.c
@@ -0,0 +1,51 @@
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) 2003 Atheros Communications, Inc., All Rights Reserved.
7 * Copyright (C) 2006 FON Technology, SL.
8 * Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org>
9 * Copyright (C) 2006-2009 Felix Fietkau <nbd@openwrt.org>
10 */
11
12#include <linux/init.h>
13#include <linux/interrupt.h>
14#include <asm/irq_cpu.h>
15#include <asm/reboot.h>
16#include <asm/bootinfo.h>
17#include <asm/time.h>
18
19static void ath25_halt(void)
20{
21 local_irq_disable();
22 unreachable();
23}
24
25void __init plat_mem_setup(void)
26{
27 _machine_halt = ath25_halt;
28 pm_power_off = ath25_halt;
29
30 /* Disable data watchpoints */
31 write_c0_watchlo0(0);
32}
33
34asmlinkage void plat_irq_dispatch(void)
35{
36}
37
38void __init plat_time_init(void)
39{
40}
41
42unsigned int __cpuinit get_c0_compare_int(void)
43{
44 return CP0_LEGACY_COMPARE_IRQ;
45}
46
47void __init arch_init_irq(void)
48{
49 clear_c0_status(ST0_IM);
50 mips_cpu_irq_init();
51}
diff --git a/arch/mips/ath25/devices.c b/arch/mips/ath25/devices.c
new file mode 100644
index 000000000000..049ab4477954
--- /dev/null
+++ b/arch/mips/ath25/devices.c
@@ -0,0 +1,10 @@
1#include <linux/kernel.h>
2#include <linux/init.h>
3#include <asm/bootinfo.h>
4
5#include "devices.h"
6
7const char *get_system_type(void)
8{
9 return "Atheros (unknown)";
10}
diff --git a/arch/mips/ath25/devices.h b/arch/mips/ath25/devices.h
new file mode 100644
index 000000000000..e25a3262256d
--- /dev/null
+++ b/arch/mips/ath25/devices.h
@@ -0,0 +1,18 @@
1#ifndef __ATH25_DEVICES_H
2#define __ATH25_DEVICES_H
3
4#include <linux/cpu.h>
5
6#define ATH25_REG_MS(_val, _field) (((_val) & _field##_M) >> _field##_S)
7
8static inline bool is_ar2315(void)
9{
10 return (current_cpu_data.cputype == CPU_4KEC);
11}
12
13static inline bool is_ar5312(void)
14{
15 return !is_ar2315();
16}
17
18#endif
diff --git a/arch/mips/ath25/prom.c b/arch/mips/ath25/prom.c
new file mode 100644
index 000000000000..edf82be8870d
--- /dev/null
+++ b/arch/mips/ath25/prom.c
@@ -0,0 +1,26 @@
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 MontaVista Software Inc
7 * Copyright (C) 2003 Atheros Communications, Inc., All Rights Reserved.
8 * Copyright (C) 2006 FON Technology, SL.
9 * Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org>
10 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
11 */
12
13/*
14 * Prom setup file for AR5312/AR231x SoCs
15 */
16
17#include <linux/init.h>
18#include <asm/bootinfo.h>
19
20void __init prom_init(void)
21{
22}
23
24void __init prom_free_prom_memory(void)
25{
26}