1 From 8563991026ee98bb5e477167236972a45dfea0e3 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Mon, 21 Jan 2013 18:25:59 +0100
4 Subject: [PATCH 01/14] MIPS: ralink: adds include files
6 Before we start adding the platform code we add the common include files.
8 Signed-off-by: John Crispin <blogic@openwrt.org>
9 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
10 Patchwork: http://patchwork.linux-mips.org/patch/4893/
12 arch/mips/include/asm/mach-ralink/ralink_regs.h | 39 ++++++++++++++++++++
13 arch/mips/include/asm/mach-ralink/war.h | 25 +++++++++++++
14 arch/mips/ralink/common.h | 44 +++++++++++++++++++++++
15 3 files changed, 108 insertions(+)
16 create mode 100644 arch/mips/include/asm/mach-ralink/ralink_regs.h
17 create mode 100644 arch/mips/include/asm/mach-ralink/war.h
18 create mode 100644 arch/mips/ralink/common.h
20 diff --git a/arch/mips/include/asm/mach-ralink/ralink_regs.h b/arch/mips/include/asm/mach-ralink/ralink_regs.h
22 index 0000000..5a508f9
24 +++ b/arch/mips/include/asm/mach-ralink/ralink_regs.h
27 + * Ralink SoC register definitions
29 + * Copyright (C) 2013 John Crispin <blogic@openwrt.org>
30 + * Copyright (C) 2008-2010 Gabor Juhos <juhosg@openwrt.org>
31 + * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
33 + * This program is free software; you can redistribute it and/or modify it
34 + * under the terms of the GNU General Public License version 2 as published
35 + * by the Free Software Foundation.
38 +#ifndef _RALINK_REGS_H_
39 +#define _RALINK_REGS_H_
41 +extern __iomem void *rt_sysc_membase;
42 +extern __iomem void *rt_memc_membase;
44 +static inline void rt_sysc_w32(u32 val, unsigned reg)
46 + __raw_writel(val, rt_sysc_membase + reg);
49 +static inline u32 rt_sysc_r32(unsigned reg)
51 + return __raw_readl(rt_sysc_membase + reg);
54 +static inline void rt_memc_w32(u32 val, unsigned reg)
56 + __raw_writel(val, rt_memc_membase + reg);
59 +static inline u32 rt_memc_r32(unsigned reg)
61 + return __raw_readl(rt_memc_membase + reg);
64 +#endif /* _RALINK_REGS_H_ */
65 diff --git a/arch/mips/include/asm/mach-ralink/war.h b/arch/mips/include/asm/mach-ralink/war.h
67 index 0000000..a7b712c
69 +++ b/arch/mips/include/asm/mach-ralink/war.h
72 + * This file is subject to the terms and conditions of the GNU General Public
73 + * License. See the file "COPYING" in the main directory of this archive
76 + * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
78 +#ifndef __ASM_MACH_RALINK_WAR_H
79 +#define __ASM_MACH_RALINK_WAR_H
81 +#define R4600_V1_INDEX_ICACHEOP_WAR 0
82 +#define R4600_V1_HIT_CACHEOP_WAR 0
83 +#define R4600_V2_HIT_CACHEOP_WAR 0
84 +#define R5432_CP0_INTERRUPT_WAR 0
85 +#define BCM1250_M3_WAR 0
86 +#define SIBYTE_1956_WAR 0
87 +#define MIPS4K_ICACHE_REFILL_WAR 0
88 +#define MIPS_CACHE_SYNC_WAR 0
89 +#define TX49XX_ICACHE_INDEX_INV_WAR 0
90 +#define RM9000_CDEX_SMP_WAR 0
91 +#define ICACHE_REFILLS_WORKAROUND_WAR 0
92 +#define R10000_LLSC_WAR 0
93 +#define MIPS34K_MISSED_ITLB_WAR 0
95 +#endif /* __ASM_MACH_RALINK_WAR_H */
96 diff --git a/arch/mips/ralink/common.h b/arch/mips/ralink/common.h
98 index 0000000..3009903
100 +++ b/arch/mips/ralink/common.h
103 + * This program is free software; you can redistribute it and/or modify it
104 + * under the terms of the GNU General Public License version 2 as published
105 + * by the Free Software Foundation.
107 + * Copyright (C) 2013 John Crispin <blogic@openwrt.org>
110 +#ifndef _RALINK_COMMON_H__
111 +#define _RALINK_COMMON_H__
113 +#define RAMIPS_SYS_TYPE_LEN 32
115 +struct ralink_pinmux_grp {
122 +struct ralink_pinmux {
123 + struct ralink_pinmux_grp *mode;
124 + struct ralink_pinmux_grp *uart;
126 + void (*wdt_reset)(void);
128 +extern struct ralink_pinmux gpio_pinmux;
130 +struct ralink_soc_info {
131 + unsigned char sys_type[RAMIPS_SYS_TYPE_LEN];
132 + unsigned char *compatible;
134 +extern struct ralink_soc_info soc_info;
136 +extern void ralink_of_remap(void);
138 +extern void ralink_clk_init(void);
139 +extern void ralink_clk_add(const char *dev, unsigned long rate);
141 +extern void prom_soc_init(struct ralink_soc_info *soc_info);
143 +__iomem void *plat_of_remap_node(const char *node);
145 +#endif /* _RALINK_COMMON_H__ */