blob: 6063bdf9066e0e9e8e87b696b37cfb7c36eb3d80 [file] [log] [blame]
Sergey Ryazanov43cc7392014-10-29 03:18:38 +04001/*
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
Sergey Ryazanov3b12308f2014-10-29 03:18:39 +040019#include "devices.h"
20#include "ar5312.h"
Sergey Ryazanovba910342014-10-29 03:18:40 +040021#include "ar2315.h"
Sergey Ryazanov3b12308f2014-10-29 03:18:39 +040022
Sergey Ryazanov43cc7392014-10-29 03:18:38 +040023static void ath25_halt(void)
24{
25 local_irq_disable();
26 unreachable();
27}
28
29void __init plat_mem_setup(void)
30{
31 _machine_halt = ath25_halt;
32 pm_power_off = ath25_halt;
33
Sergey Ryazanov3b12308f2014-10-29 03:18:39 +040034 if (is_ar5312())
35 ar5312_plat_mem_setup();
Sergey Ryazanovba910342014-10-29 03:18:40 +040036 else
37 ar2315_plat_mem_setup();
Sergey Ryazanov3b12308f2014-10-29 03:18:39 +040038
Sergey Ryazanov43cc7392014-10-29 03:18:38 +040039 /* Disable data watchpoints */
40 write_c0_watchlo0(0);
41}
42
43asmlinkage void plat_irq_dispatch(void)
44{
45}
46
47void __init plat_time_init(void)
48{
Sergey Ryazanov3b12308f2014-10-29 03:18:39 +040049 if (is_ar5312())
50 ar5312_plat_time_init();
Sergey Ryazanovba910342014-10-29 03:18:40 +040051 else
52 ar2315_plat_time_init();
Sergey Ryazanov43cc7392014-10-29 03:18:38 +040053}
54
55unsigned int __cpuinit get_c0_compare_int(void)
56{
57 return CP0_LEGACY_COMPARE_IRQ;
58}
59
60void __init arch_init_irq(void)
61{
62 clear_c0_status(ST0_IM);
63 mips_cpu_irq_init();
64}