ramips: add preliminary support for the Asus RT-N56U board
[openwrt.git] / target / linux / ramips / files / arch / mips / include / asm / mach-ralink / rt3883.h
1 /*
2 * Ralink RT3662/RT3883 SoC specific definitions
3 *
4 * Copyright (C) 2011-2012 Gabor Juhos <juhosg@openwrt.org>
5 *
6 * Parts of this file are based on Ralink's 2.6.21 BSP
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
11 */
12
13 #ifndef _RT3883_H_
14 #define _RT3883_H_
15
16 #include <linux/init.h>
17 #include <linux/io.h>
18
19 void rt3883_detect_sys_type(void);
20
21 #define RT3883_MEM_SIZE_MIN (2 * 1024 * 1024)
22 #define RT3883_MEM_SIZE_MAX (256 * 1024 * 1024)
23
24 #define RT3883_CPU_IRQ_BASE 0
25 #define RT3883_CPU_IRQ_COUNT 8
26 #define RT3883_INTC_IRQ_BASE (RT3883_CPU_IRQ_BASE + RT3883_CPU_IRQ_COUNT)
27 #define RT3883_INTC_IRQ_COUNT 32
28 #define RT3883_GPIO_IRQ_BASE (RT3883_INTC_IRQ_BASE + RT3883_INTC_IRQ_COUNT)
29
30 #define RT3883_CPU_IRQ_INTC (RT3883_CPU_IRQ_BASE + 2)
31 #define RT3883_CPU_IRQ_PCI (RT3883_CPU_IRQ_BASE + 4)
32 #define RT3883_CPU_IRQ_FE (RT3883_CPU_IRQ_BASE + 5)
33 #define RT3883_CPU_IRQ_WLAN (RT3883_CPU_IRQ_BASE + 6)
34 #define RT3883_CPU_IRQ_COUNTER (RT3883_CPU_IRQ_BASE + 7)
35
36 #define RT3883_INTC_IRQ_SYSCTL (RT3883_INTC_IRQ_BASE + 0)
37 #define RT3883_INTC_IRQ_TIMER0 (RT3883_INTC_IRQ_BASE + 1)
38 #define RT3883_INTC_IRQ_TIMER1 (RT3883_INTC_IRQ_BASE + 2)
39 #define RT3883_INTC_IRQ_IA (RT3883_INTC_IRQ_BASE + 3)
40 #define RT3883_INTC_IRQ_PCM (RT3883_INTC_IRQ_BASE + 4)
41 #define RT3883_INTC_IRQ_UART0 (RT3883_INTC_IRQ_BASE + 5)
42 #define RT3883_INTC_IRQ_PIO (RT3883_INTC_IRQ_BASE + 6)
43 #define RT3883_INTC_IRQ_DMA (RT3883_INTC_IRQ_BASE + 7)
44 #define RT3883_INTC_IRQ_NAND (RT3883_INTC_IRQ_BASE + 8)
45 #define RT3883_INTC_IRQ_PERFC (RT3883_INTC_IRQ_BASE + 9)
46 #define RT3883_INTC_IRQ_I2S (RT3883_INTC_IRQ_BASE + 10)
47 #define RT3883_INTC_IRQ_UART1 (RT3883_INTC_IRQ_BASE + 12)
48 #define RT3883_INTC_IRQ_UHST (RT3883_INTC_IRQ_BASE + 18)
49 #define RT3883_INTC_IRQ_UDEV (RT3883_INTC_IRQ_BASE + 19)
50
51 extern void __iomem *rt3883_sysc_base;
52 extern void __iomem *rt3883_memc_base;
53
54 static inline void rt3883_sysc_wr(u32 val, unsigned reg)
55 {
56 __raw_writel(val, rt3883_sysc_base + reg);
57 }
58
59 static inline u32 rt3883_sysc_rr(unsigned reg)
60 {
61 return __raw_readl(rt3883_sysc_base + reg);
62 }
63
64 static inline void rt3883_memc_wr(u32 val, unsigned reg)
65 {
66 __raw_writel(val, rt3883_memc_base + reg);
67 }
68
69 static inline u32 rt3883_memc_rr(unsigned reg)
70 {
71 return __raw_readl(rt3883_memc_base + reg);
72 }
73
74 #define RT3883_GPIO_I2C_SD 1
75 #define RT3883_GPIO_I2C_SCLK 2
76 #define RT3883_GPIO_SPI_CS0 3
77 #define RT3883_GPIO_SPI_CLK 4
78 #define RT3883_GPIO_SPI_MOSI 5
79 #define RT3883_GPIO_SPI_MISO 6
80 /* GPIO 7-14 is shared between UART0, PCM and I2S interfaces */
81 #define RT3883_GPIO_7 7
82 #define RT3883_GPIO_8 8
83 #define RT3883_GPIO_9 9
84 #define RT3883_GPIO_10 10
85 #define RT3883_GPIO_11 11
86 #define RT3883_GPIO_12 12
87 #define RT3883_GPIO_13 13
88 #define RT3883_GPIO_14 14
89 #define RT3883_GPIO_UART1_TXD 15
90 #define RT3883_GPIO_UART1_RXD 16
91 #define RT3883_GPIO_JTAG_TDO 17
92 #define RT3883_GPIO_JTAG_TDI 18
93 #define RT3883_GPIO_JTAG_TMS 19
94 #define RT3883_GPIO_JTAG_TCLK 20
95 #define RT3883_GPIO_JTAG_TRST_N 21
96 #define RT3883_GPIO_MDIO_MDC 22
97 #define RT3883_GPIO_MDIO_MDIO 23
98 #define RT3883_GPIO_LNA_PE_A0 32
99 #define RT3883_GPIO_LNA_PE_A1 33
100 #define RT3883_GPIO_LNA_PE_A2 34
101 #define RT3883_GPIO_LNA_PE_G0 35
102 #define RT3883_GPIO_LNA_PE_G1 36
103 #define RT3883_GPIO_LNA_PE_G2 37
104 #define RT3883_GPIO_PCI_AD0 40
105 #define RT3883_GPIO_PCI_AD31 71
106 #define RT3883_GPIO_GE2_TXD0 72
107 #define RT3883_GPIO_GE2_TXD1 73
108 #define RT3883_GPIO_GE2_TXD2 74
109 #define RT3883_GPIO_GE2_TXD3 75
110 #define RT3883_GPIO_GE2_TXEN 76
111 #define RT3883_GPIO_GE2_TXCLK 77
112 #define RT3883_GPIO_GE2_RXD0 78
113 #define RT3883_GPIO_GE2_RXD1 79
114 #define RT3883_GPIO_GE2_RXD2 80
115 #define RT3883_GPIO_GE2_RXD3 81
116 #define RT3883_GPIO_GE2_RXDV 82
117 #define RT3883_GPIO_GE2_RXCLK 83
118 #define RT3883_GPIO_GE1_TXD0 84
119 #define RT3883_GPIO_GE1_TXD1 85
120 #define RT3883_GPIO_GE1_TXD2 86
121 #define RT3883_GPIO_GE1_TXD3 87
122 #define RT3883_GPIO_GE1_TXEN 88
123 #define RT3883_GPIO_GE1_TXCLK 89
124 #define RT3883_GPIO_GE1_RXD0 90
125 #define RT3883_GPIO_GE1_RXD1 91
126 #define RT3883_GPIO_GE1_RXD2 92
127 #define RT3883_GPIO_GE1_RXD3 93
128 #define RT3883_GPIO_GE1_RXDV 94
129 #define RT3883_GPIO_GE1_RXCLK 95
130
131 void rt3883_gpio_init(u32 mode);
132
133 #endif /* _RT3883_H_ */
This page took 0.061606 seconds and 5 git commands to generate.