From 43cc739fd98b8c517ad45756d869f866e746ba04 Mon Sep 17 00:00:00 2001 From: Sergey Ryazanov Date: Wed, 29 Oct 2014 03:18:38 +0400 Subject: MIPS: ath25: add common parts Add common code for Atheros AR5312 and Atheros AR2315 SoCs families. Signed-off-by: Sergey Ryazanov Cc: Linux MIPS Patchwork: https://patchwork.linux-mips.org/patch/8237 Signed-off-by: Ralf Baechle --- arch/mips/ath25/Makefile | 11 ++++++++++ arch/mips/ath25/Platform | 6 ++++++ arch/mips/ath25/board.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++ arch/mips/ath25/devices.c | 10 ++++++++++ arch/mips/ath25/devices.h | 18 +++++++++++++++++ arch/mips/ath25/prom.c | 26 ++++++++++++++++++++++++ 6 files changed, 122 insertions(+) create mode 100644 arch/mips/ath25/Makefile create mode 100644 arch/mips/ath25/Platform create mode 100644 arch/mips/ath25/board.c create mode 100644 arch/mips/ath25/devices.c create mode 100644 arch/mips/ath25/devices.h create mode 100644 arch/mips/ath25/prom.c (limited to 'arch/mips/ath25') 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 @@ +# +# 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. +# +# Copyright (C) 2006 FON Technology, SL. +# Copyright (C) 2006 Imre Kaloz +# Copyright (C) 2006-2009 Felix Fietkau +# + +obj-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 @@ +# +# Atheros AR531X/AR231X WiSoC +# +platform-$(CONFIG_ATH25) += ath25/ +cflags-$(CONFIG_ATH25) += -I$(srctree)/arch/mips/include/asm/mach-ath25 +load-$(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 @@ +/* + * 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. + * + * Copyright (C) 2003 Atheros Communications, Inc., All Rights Reserved. + * Copyright (C) 2006 FON Technology, SL. + * Copyright (C) 2006 Imre Kaloz + * Copyright (C) 2006-2009 Felix Fietkau + */ + +#include +#include +#include +#include +#include +#include + +static void ath25_halt(void) +{ + local_irq_disable(); + unreachable(); +} + +void __init plat_mem_setup(void) +{ + _machine_halt = ath25_halt; + pm_power_off = ath25_halt; + + /* Disable data watchpoints */ + write_c0_watchlo0(0); +} + +asmlinkage void plat_irq_dispatch(void) +{ +} + +void __init plat_time_init(void) +{ +} + +unsigned int __cpuinit get_c0_compare_int(void) +{ + return CP0_LEGACY_COMPARE_IRQ; +} + +void __init arch_init_irq(void) +{ + clear_c0_status(ST0_IM); + mips_cpu_irq_init(); +} 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 @@ +#include +#include +#include + +#include "devices.h" + +const char *get_system_type(void) +{ + return "Atheros (unknown)"; +} 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 @@ +#ifndef __ATH25_DEVICES_H +#define __ATH25_DEVICES_H + +#include + +#define ATH25_REG_MS(_val, _field) (((_val) & _field##_M) >> _field##_S) + +static inline bool is_ar2315(void) +{ + return (current_cpu_data.cputype == CPU_4KEC); +} + +static inline bool is_ar5312(void) +{ + return !is_ar2315(); +} + +#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 @@ +/* + * 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. + * + * Copyright MontaVista Software Inc + * Copyright (C) 2003 Atheros Communications, Inc., All Rights Reserved. + * Copyright (C) 2006 FON Technology, SL. + * Copyright (C) 2006 Imre Kaloz + * Copyright (C) 2006 Felix Fietkau + */ + +/* + * Prom setup file for AR5312/AR231x SoCs + */ + +#include +#include + +void __init prom_init(void) +{ +} + +void __init prom_free_prom_memory(void) +{ +} -- cgit v1.2.3