aboutsummaryrefslogtreecommitdiffstats
path: root/packages/ixp4xx/ixp4xx-csr-1.5/2.6.patch
blob: 58c3cbded5a4f5a5098f479cce26911647102292 (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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
diff -Naur ixp400_xscale_sw.orig/Makefile ixp400_xscale_sw/Makefile
--- ixp400_xscale_sw.orig/Makefile	2005-08-24 00:16:35.000000000 +0200
+++ ixp400_xscale_sw/Makefile	2005-08-30 19:01:47.000000000 +0200
@@ -93,15 +93,16 @@
 # platforms. Components that work only for a subset of platforms
 # should be added to the relevant *_COMPONENTS lists.
 #
-BI_ENDIAN_COMPONENTS := atmdAcc atmm atmsch qmgr npeMh npeDl ethAcc ethDB ethMii hssAcc usb uartAcc featureCtrl ossl osServices
 
+# Intel default value: atmdAcc atmm atmsch qmgr npeMh npeDl ethAcc ethDB ethMii hssAcc usb uartAcc featureCtrl ossl osServices
+BI_ENDIAN_COMPONENTS := qmgr npeMh npeDl ethAcc ethDB ethMii ossl osServices featureCtrl
 
 # The lists below contain the set of components available for each target platform
 vxbe_COMPONENTS := $(BI_ENDIAN_COMPONENTS) perfProfAcc dmaAcc
 vxle_COMPONENTS := $(BI_ENDIAN_COMPONENTS) perfProfAcc
 vxsim_COMPONENTS := $(BI_ENDIAN_COMPONENTS) dmaAcc
-linuxbe_COMPONENTS := $(BI_ENDIAN_COMPONENTS) perfProfAcc dmaAcc 
-linuxle_COMPONENTS := $(BI_ENDIAN_COMPONENTS) perfProfAcc
+linuxbe_COMPONENTS := $(BI_ENDIAN_COMPONENTS) # perfProfAcc dmaAcc 
+linuxle_COMPONENTS := $(BI_ENDIAN_COMPONENTS) # perfProfAcc
 
 # To facilitate automated builds, do not modify the value of COMPONENTS directly - 
 # just change the per-platform component lists above.
@@ -222,10 +223,12 @@
 else # IX_TARGET_OS == vxworks
 
 # Linux tool names
-ifeq ($(IX_TARGET), linuxbe)
-LINUX_CROSS_COMPILE := $(HARDHAT_BASE)/devkit/arm/xscale_be/bin/xscale_be-
-else
-LINUX_CROSS_COMPILE := $(HARDHAT_BASE)/devkit/arm/xscale_le/bin/xscale_le-
+ifeq "$(LINUX_CROSS_COMPILE)" "" 
+ ifeq ($(IX_TARGET), linuxbe)
+  LINUX_CROSS_COMPILE := $(HARDHAT_BASE)/devkit/arm/xscale_be/bin/xscale_be-
+ else
+  LINUX_CROSS_COMPILE := $(HARDHAT_BASE)/devkit/arm/xscale_le/bin/xscale_le-
+ endif
 endif
 
 LD := $(LINUX_CROSS_COMPILE)ld
@@ -253,7 +256,9 @@
 
 LINUX_MACH_CFLAGS := -D__LINUX_ARM_ARCH__=5 -mcpu=xscale -mtune=xscale
 
-CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -Wall -Wno-trigraphs -fno-common -pipe -mapcs-32 -mshort-load-bytes -msoft-float -DMODULE -Isrc/include -I$(NPE_OUTPUT_DIR) -D__linux -DCPU=33 -DXSCALE=33 $(LINUX_MACH_CFLAGS)
+CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -Wall -Wno-trigraphs -fno-common -pipe -mapcs-32 -msoft-float -DMODULE -Isrc/include -I$(NPE_OUTPUT_DIR) -D__linux -DCPU=33 -DXSCALE=33 $(LINUX_MACH_CFLAGS)
+
+# -mshort-load-bytes removed by Marc Singer's patch TODO(hannes) why?
 
 # Linux linker flags
 LDFLAGS := -r
@@ -1139,9 +1144,14 @@
 
 ixp400.o : $(OBJ_DIR)/ixp400.o
 
+ixp400.ko : $(OBJ_DIR)/ixp400.o
 
-$(OBJ_DIR)/ixp400.o: $(COMPONENTS:%=$(OBJ_DIR)/ixp400_%.o) $(NPE_PRODUCTION_HEADER_OBJ) $(OSAL_MODULE)
+$(OBJ_DIR)/ixp400.o: $(COMPONENTS:%=$(OBJ_DIR)/ixp400_%.o) $(NPE_PRODUCTION_HEADER_OBJ) $(OSAL_MODULE) # add this to hack in the ethAcc codelet: $(OBJ_DIR)/ixp400_codelets_ethAcc.o
+	touch $(OBJ_DIR)/ixp400.c
+	cp Makefile.kmod26 $(OBJ_DIR)/Makefile
+	make -C $(OBJ_DIR)
 	$(LD) $(LDFLAGS) $^ -o $@
+	make -C $(OBJ_DIR)
 
 
 
diff -Naur ixp400_xscale_sw.orig/Makefile.kmod26 ixp400_xscale_sw/Makefile.kmod26
--- ixp400_xscale_sw.orig/Makefile.kmod26	1970-01-01 01:00:00.000000000 +0100
+++ ixp400_xscale_sw/Makefile.kmod26	2005-08-24 22:33:12.000000000 +0200
@@ -0,0 +1,11 @@
+obj-m := ixp400.o
+
+PWD         := $(shell pwd)
+
+LINUX_SRC := $($(IX_TARGET)_KERNEL_DIR)
+
+default:
+	$(MAKE) ARCH=arm CROSS_COMPILE=$(LINUX_CROSS_COMPILE) V=1 -C $(LINUX_SRC) SUBDIRS=$(PWD) modules
+
+clean:
+	rm -f ixp400.ko
diff -Naur ixp400_xscale_sw.orig/Readme-Kernel-2_6-Patch.txt ixp400_xscale_sw/Readme-Kernel-2_6-Patch.txt
--- ixp400_xscale_sw.orig/Readme-Kernel-2_6-Patch.txt	1970-01-01 01:00:00.000000000 +0100
+++ ixp400_xscale_sw/Readme-Kernel-2_6-Patch.txt	2005-09-28 19:50:30.000000000 +0200
@@ -0,0 +1,49 @@
+This file describes a patch to use version 1.5 of the Intel Ixp4XX
+Access Library with Linux 2.6 kernels.
+
+Authors/History
+---------------
+
+This patch consists of the changes made by Marc Singer for use of
+version 1.5 of the library with the APEX bootloader, and a patch made
+by Robin Farine and Tom Winkler for use of version 1.4 of the library
+with Linux-2.6 kernels. These changes were merged together by Hannes
+Reich.
+
+Both patches are incorporated in their entirety, with the exception of
+some tweaks to sleep times in the ethAcc code and modifications to
+the code in src/codelets/usb/ from the Robin Farine / Tom Winkler
+patch.
+
+Status
+------
+
+This code has been tested on a Linksys NSLU2. It works in big-endian
+mode, performance seems around 10% faster than 1.4.
+
+The code does not work in little-endian mode. It appears as though the
+hardware is initialised correctly, but packet receive / transmit done
+callbacks are never called.
+
+Licence Information
+-------------------
+
+The patch is licenced under the same conditions as the original Access
+Library 1.5 (INTEL SOFTWARE LICENSE AGREEMENT). The full text of the
+licence can be downloaded from:
+http://www.intel.com/design/network/swsup/np_sla/ixp400.htm
+
+The patch is free, unsupported and the authors make no warranties.
+Use it at your own risk, do with it as you see fit so long as you do
+not violate the original licence agreement.
+
+The authors permit derivative works based upon the patch.
+
+References
+----------
+
+The version 1.4 patch by Robin Farine and Tom Winkler is available from
+http://www.wnk.at/ixp400_accesslib_kernel26/data/patch_accesslib_kernel26_20040811.diff
+
+The version 1.5 patch by Marc Singer is at
+http://wiki.buici.com/bin/view/Main/IXPAccessLibrary
diff -Naur ixp400_xscale_sw.orig/src/codelets/dmaAcc/IxDmaAccCodelet_p.h ixp400_xscale_sw/src/codelets/dmaAcc/IxDmaAccCodelet_p.h
--- ixp400_xscale_sw.orig/src/codelets/dmaAcc/IxDmaAccCodelet_p.h	2005-08-24 00:16:36.000000000 +0200
+++ ixp400_xscale_sw/src/codelets/dmaAcc/IxDmaAccCodelet_p.h	2005-08-24 00:18:02.000000000 +0200
@@ -113,7 +113,7 @@
  * @return IX_FAIL - Error initialising codelet
  */
 IX_STATUS
-ixDmaAccCodeletInit(IxDmaNpeId npeId);
+ixDmaAccCodeletInit(IxNpeDlNpeId npeId);
 
 /**
  * @fn ixDmaAccCodeletTestPerform( UINT16 transferLength, 
diff -Naur ixp400_xscale_sw.orig/src/ethDB/include/IxEthDB_p.h ixp400_xscale_sw/src/ethDB/include/IxEthDB_p.h
--- ixp400_xscale_sw.orig/src/ethDB/include/IxEthDB_p.h	2005-08-24 00:16:36.000000000 +0200
+++ ixp400_xscale_sw/src/ethDB/include/IxEthDB_p.h	2005-08-24 00:18:02.000000000 +0200
@@ -633,7 +633,7 @@
 IX_ETH_DB_PUBLIC UINT32 ixEthDBKeyXORHash(void *macAddress);
 
 /* Port updates */
-IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBNPEUpdateHandler(IxEthDBPortId portID, IxEthDBFeature type);
+IX_ETH_DB_PUBLIC IxEthDBStatus ixEthDBNPEUpdateHandler(IxEthDBPortId portID, IxEthDBRecordType type);
 IX_ETH_DB_PUBLIC void ixEthDBUpdatePortLearningTrees(IxEthDBPortMap triggerPorts);
 IX_ETH_DB_PUBLIC void ixEthDBNPEAccessRequest(IxEthDBPortId portID);
 IX_ETH_DB_PUBLIC void ixEthDBUpdateLock(void);
diff -Naur ixp400_xscale_sw.orig/src/include/IxTypes.h ixp400_xscale_sw/src/include/IxTypes.h
--- ixp400_xscale_sw.orig/src/include/IxTypes.h	2005-08-24 00:16:36.000000000 +0200
+++ ixp400_xscale_sw/src/include/IxTypes.h	2005-08-26 01:19:15.000000000 +0200
@@ -79,6 +79,10 @@
 #endif
 #endif
 
+#ifndef BIT
+#define BIT(x)  ((1)<<(x))
+#endif
+
 #include "IxOsalBackward.h"
 
 #endif /* IxTypes_H */
diff -Naur ixp400_xscale_sw.orig/src/usb/include/usbprivatetypes.h ixp400_xscale_sw/src/usb/include/usbprivatetypes.h
--- ixp400_xscale_sw.orig/src/usb/include/usbprivatetypes.h	2005-08-24 00:16:36.000000000 +0200
+++ ixp400_xscale_sw/src/usb/include/usbprivatetypes.h	2005-08-24 00:18:02.000000000 +0200
@@ -164,6 +164,53 @@
 } USBEventProcessor;
 
 /*  UDC Registers */
+
+#undef UDCCR
+#undef UDCCS0
+#undef UDCCS1
+#undef UDCCS2
+#undef UDCCS3
+#undef UDCCS4
+#undef UDCCS5
+#undef UDCCS6
+#undef UDCCS7
+#undef UDCCS8
+#undef UDCCS9
+#undef UDCCS10
+#undef UDCCS11
+#undef UDCCS12
+#undef UDCCS13
+#undef UDCCS14
+#undef UDCCS15
+#undef UICR0
+#undef UICR1
+#undef USIR0
+#undef USIR1
+#undef UFNHR
+#undef UFNLR
+#undef UBCR2
+#undef UBCR4
+#undef UBCR7
+#undef UBCR9
+#undef UBCR12
+#undef UBCR14
+#undef UDDR0
+#undef UDDR5
+#undef UDDR10
+#undef UDDR15
+#undef UDDR1
+#undef UDDR2
+#undef UDDR3
+#undef UDDR4
+#undef UDDR6
+#undef UDDR7
+#undef UDDR8
+#undef UDDR9
+#undef UDDR11
+#undef UDDR12
+#undef UDDR13
+#undef UDDR14
+
 typedef struct  /* UDCRegisters */
 {
     volatile UINT32 UDCCR;
@@ -229,6 +276,7 @@
     volatile UINT32	UDDR14;			
 } UDCRegisters;
 
+
 typedef struct /* USBDeviceContext */
 {
     UINT32 checkPattern;                      /* Check pattern for verifying the context */