summaryrefslogtreecommitdiff
path: root/target/linux/lantiq/patches-3.0/180-falcon-linux3.0.patch
blob: 3dd79640e7bd80ed64db47281d0ea82e9d4188eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
--- a/arch/mips/lantiq/irq.c
+++ b/arch/mips/lantiq/irq.c
@@ -52,6 +52,7 @@
 #define ltq_eiu_w32(x, y)	ltq_w32((x), ltq_eiu_membase + (y))
 #define ltq_eiu_r32(x)		ltq_r32(ltq_eiu_membase + (x))
 
+#ifdef CONFIG_SOC_XWAY
 static unsigned short ltq_eiu_irq[MAX_EIU] = {
 	LTQ_EIU_IR0,
 	LTQ_EIU_IR1,
@@ -60,6 +61,7 @@ static unsigned short ltq_eiu_irq[MAX_EI
 	LTQ_EIU_IR4,
 	LTQ_EIU_IR5,
 };
+#endif
 
 static struct resource ltq_icu_resource = {
 	.name	= "icu",
@@ -68,15 +70,19 @@ static struct resource ltq_icu_resource
 	.flags	= IORESOURCE_MEM,
 };
 
+#ifdef CONFIG_SOC_XWAY
 static struct resource ltq_eiu_resource = {
 	.name	= "eiu",
 	.start	= LTQ_EIU_BASE_ADDR,
 	.end	= LTQ_EIU_BASE_ADDR + LTQ_ICU_SIZE - 1,
 	.flags	= IORESOURCE_MEM,
 };
+#endif
 
 static void __iomem *ltq_icu_membase;
+#ifdef CONFIG_SOC_XWAY
 static void __iomem *ltq_eiu_membase;
+#endif
 
 void ltq_disable_irq(struct irq_data *d)
 {
@@ -122,6 +128,7 @@ void ltq_enable_irq(struct irq_data *d)
 	ltq_icu_w32(ltq_icu_r32(ier) | (1 << irq_nr), ier);
 }
 
+#ifdef CONFIG_SOC_XWAY
 static unsigned int ltq_startup_eiu_irq(struct irq_data *d)
 {
 	int i;
@@ -161,6 +168,7 @@ static void ltq_shutdown_eiu_irq(struct
 		}
 	}
 }
+#endif
 
 static struct irq_chip ltq_irq_type = {
 	"icu",
@@ -172,6 +180,7 @@ static struct irq_chip ltq_irq_type = {
 	.irq_mask_ack = ltq_mask_and_ack_irq,
 };
 
+#ifdef CONFIG_SOC_XWAY
 static struct irq_chip ltq_eiu_type = {
 	"eiu",
 	.irq_startup = ltq_startup_eiu_irq,
@@ -183,6 +192,7 @@ static struct irq_chip ltq_eiu_type = {
 	.irq_mask = ltq_disable_irq,
 	.irq_mask_ack = ltq_mask_and_ack_irq,
 };
+#endif
 
 static void ltq_hw_irqdispatch(int module)
 {
@@ -198,10 +208,12 @@ static void ltq_hw_irqdispatch(int modul
 	irq = __fls(irq);
 	do_IRQ((int)irq + INT_NUM_IM0_IRL0 + (INT_NUM_IM_OFFSET * module));
 
+#ifdef CONFIG_SOC_XWAY
 	/* if this is a EBU irq, we need to ack it or get a deadlock */
 	if ((irq == LTQ_ICU_EBU_IRQ) && (module == 0))
 		ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_PCC_ISTAT) | 0x10,
 			LTQ_EBU_PCC_ISTAT);
+#endif
 }
 
 #define DEFINE_HWx_IRQDISPATCH(x)					\
@@ -264,6 +276,7 @@ void __init arch_init_irq(void)
 	if (!ltq_icu_membase)
 		panic("Failed to remap icu memory\n");
 
+#ifdef CONFIG_SOC_XWAY
 	if (insert_resource(&iomem_resource, &ltq_eiu_resource) < 0)
 		panic("Failed to insert eiu memory\n");
 
@@ -275,6 +288,7 @@ void __init arch_init_irq(void)
 				resource_size(&ltq_eiu_resource));
 	if (!ltq_eiu_membase)
 		panic("Failed to remap eiu memory\n");
+#endif
 
 	/* make sure all irqs are turned off by default */
 	for (i = 0; i < 5; i++)
@@ -300,6 +314,7 @@ void __init arch_init_irq(void)
 
 	for (i = INT_NUM_IRQ0;
 		i <= (INT_NUM_IRQ0 + (5 * INT_NUM_IM_OFFSET)); i++)
+#ifdef CONFIG_SOC_XWAY
 		if ((i == LTQ_EIU_IR0) || (i == LTQ_EIU_IR1) ||
 			(i == LTQ_EIU_IR2))
 			irq_set_chip_and_handler(i, &ltq_eiu_type,
@@ -310,6 +325,7 @@ void __init arch_init_irq(void)
 			irq_set_chip_and_handler(i, &ltq_eiu_type,
 				handle_level_irq);
 		else
+#endif
 			irq_set_chip_and_handler(i, &ltq_irq_type,
 				handle_level_irq);
 
--- a/arch/mips/lantiq/clk.c
+++ b/arch/mips/lantiq/clk.c
@@ -46,6 +46,7 @@ static struct clk cpu_clk_generic[] = {
 	},
 };
 
+#ifdef CONFIG_SOC_XWAY
 static struct resource ltq_cgu_resource = {
 	.name	= "cgu",
 	.start	= LTQ_CGU_BASE_ADDR,
@@ -55,6 +56,7 @@ static struct resource ltq_cgu_resource
 
 /* remapped clock register range */
 void __iomem *ltq_cgu_membase;
+#endif
 
 void clk_init(void)
 {
@@ -131,6 +133,7 @@ void __init plat_time_init(void)
 {
 	struct clk *clk;
 
+#ifdef CONFIG_SOC_XWAY
 	if (insert_resource(&iomem_resource, &ltq_cgu_resource) < 0)
 		panic("Failed to insert cgu memory\n");
 
@@ -144,6 +147,7 @@ void __init plat_time_init(void)
 		pr_err("Failed to remap cgu memory\n");
 		unreachable();
 	}
+#endif
 	clk = clk_get(0, "cpu");
 	mips_hpt_frequency = clk_get_rate(clk) / ltq_get_counter_resolution();
 	write_c0_compare(read_c0_count());
--- a/arch/mips/lantiq/early_printk.c
+++ b/arch/mips/lantiq/early_printk.c
@@ -13,7 +13,11 @@
 #include <lantiq_soc.h>
 
 /* no ioremap possible at this early stage, lets use KSEG1 instead  */
+#ifdef CONFIG_SOC_FALCON
+#define LTQ_ASC_BASE	KSEG1ADDR(LTQ_ASC0_BASE_ADDR)
+#else
 #define LTQ_ASC_BASE	KSEG1ADDR(LTQ_ASC1_BASE_ADDR)
+#endif
 #define ASC_BUF		1024
 #define LTQ_ASC_FSTAT	((u32 *)(LTQ_ASC_BASE + 0x0048))
 #define LTQ_ASC_TBUF	((u32 *)(LTQ_ASC_BASE + 0x0020))