summaryrefslogtreecommitdiff
path: root/packages/ixp4xx/ixp-osal-2.1.1/ixp4xx-header.patch
blob: a9d87d4b56edf98c2d2832bfdd2fe4e7ccad928d (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
 os/linux/include/platforms/ixp400/ixp425/IxOsalOsIxp425Base.h |   72 ++++++++++
 os/linux/include/platforms/ixp400/ixp425/IxOsalOsIxp425Sys.h  |   10 -
 2 files changed, 78 insertions(+), 4 deletions(-)

--- ixp_osal/os/linux/include/platforms/ixp400/ixp425/IxOsalOsIxp425Sys.h	1970-01-01 00:00:00.000000000 +0000
+++ ixp_osal/os/linux/include/platforms/ixp400/ixp425/IxOsalOsIxp425Sys.h	1970-01-01 00:00:00.000000000 +0000
@@ -53,6 +53,8 @@
 #error "Error: IxOsalOsIxp425Sys.h cannot be included directly before IxOsalOsIxp400.h"
 #endif
 
+#include "IxOsalOsIxp425Base.h"
+
 /* Memory Base Address */
 #define IX_OSAL_IXP400_EXP_BUS_PHYS_BASE       	IXP425_EXP_BUS_BASE2_PHYS
 #define IX_OSAL_IXP400_EXP_BUS_BOOT_PHYS_BASE  	IXP425_EXP_BUS_BASE1_PHYS
@@ -98,12 +100,12 @@ IxOsalMemoryMap ixOsalGlobalMemoryMap[] 
      * Queue Manager 
      */
     {
-     IX_OSAL_STATIC_MAP,	/* type            */
+     IX_OSAL_DYNAMIC_MAP,	/* type            */
      IX_OSAL_IXP400_QMGR_PHYS_BASE,	/* physicalAddress */
      IX_OSAL_IXP400_QMGR_MAP_SIZE,	/* size            */
-     IX_OSAL_IXP400_QMGR_VIRT_BASE,	/* virtualAddress  */
-     NULL,			/* mapFunction     */
-     NULL,			/* unmapFunction   */
+     0,				/* virtualAddress  */
+     ixOsalLinuxMemMap,		/* mapFunction     */
+     ixOsalLinuxMemUnmap,	/* unmapFunction   */
      0,				/* refCount        */
      IX_OSAL_BE | IX_OSAL_LE_DC,	/* endianType      */   
      "qMgr"			/* name            */
--- ixp_osal/os/linux/include/platforms/ixp400/ixp425/IxOsalOsIxp425Base.h	1970-01-01 00:00:00.000000000 +0000
+++ ixp_osal/os/linux/include/platforms/ixp400/ixp425/IxOsalOsIxp425Base.h	1970-01-01 00:00:00.000000000 +0000
@@ -0,0 +1,80 @@
+/*
+ * Glue for the current linux definitons of this stuff.
+ */
+#ifndef IxOsalOsIxp425Base_H
+#define IxOsalOsIxp425Base_H 1
+#include <asm-arm/arch-ixp4xx/ixp4xx-regs.h>
+#include <linux/version.h>
+
+/* Force Address Coherent (the default) mapping on LE - Linux 2.6
+ * does not have a way of changing it.
+ */
+#if defined IX_OSAL_LINUX_LE
+# if !defined IX_OSAL_ENFORCED_LE_AC_MAPPING
+#  define IX_OSAL_ENFORCED_LE_AC_MAPPING
+# endif
+# if defined IX_OSAL_LE_DC_MAPPING
+#  error Little Endian Data Coherent mapping not supported on this platform
+# endif
+
+/* This doesn't matter on a BE build because it will never be used,
+ * however it will be selected and will fail on an LE build.
+ */
+# undef IX_OSAL_LE_DC
+# define IX_OSAL_LE_DC IX_OSAL_LE_DC_IS_INVALID_ON_THIS_PLATFORM
+#endif
+
+/* Physical addresses. */
+#define IXP425_PERIPHERAL_BASE_PHYS	IXP4XX_PERIPHERAL_BASE_PHYS
+#define IXP425_EXP_CFG_BASE_PHYS	IXP4XX_EXP_CFG_BASE_PHYS
+#define IXP425_PCI_CFG_BASE_PHYS	IXP4XX_PCI_CFG_BASE_PHYS
+
+//#define IXP425_EXP_BUS_BASE1_PHYS
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
+#define IXP425_EXP_BUS_BASE2_PHYS	IXP4XX_EXP_BUS_CS2_BASE_PHYS
+#else
+/* The following definition should be IXP4XX_EXP_BUS_BASE(2), but that is not
+   static and causes compilation problems later.  So we need to hard-code it.
+   Note that this hard-coded value is only correct for IXP42X. */
+#define IXP425_EXP_BUS_BASE2_PHYS	(IXP4XX_EXP_BUS_BASE_PHYS + (2 * SZ_16M))
+#endif
+//#define IXP425_EXP_BUS_CS0_BASE_PHYS
+//#define IXP425_EXP_BUS_CS1_BASE_PHYS
+//#define IXP425_EXP_BUS_CS4_BASE_PHYS
+#define IXP425_EthA_BASE_PHYS		(IXP4XX_PERIPHERAL_BASE_PHYS + 0x9000)
+#define IXP425_EthB_BASE_PHYS		(IXP4XX_PERIPHERAL_BASE_PHYS + 0xA000)
+//#define IXP425_GPIO_BASE_PHYS
+#define IXP425_INTC_BASE_PHYS		IXP4XX_INTC_BASE_PHYS
+//#define IXP425_NPEA_BASE_PHYS
+//#define IXP425_NPEB_BASE_PHYS
+//#define IXP425_NPEC_BASE_PHYS
+//#define IXP425_PMU_BASE_PHYS
+#define IXP425_QMGR_BASE_PHYS		IXP4XX_QMGR_BASE_PHYS
+#define IXP425_TIMER_BASE_PHYS 		IXP4XX_TIMER_BASE_PHYS
+//#define IXP425_UART1_BASE_PHYS
+//#define IXP425_UART2_BASE_PHYS
+#define IXP425_USB_BASE_PHYS		IXP4XX_USB_BASE_PHYS
+
+/* Virtual addresses. */
+#define IXP425_PERIPHERAL_BASE_VIRT	IXP4XX_PERIPHERAL_BASE_VIRT
+#define IXP425_PERIPHERAL_REGION_SIZE	IXP4XX_PERIPHERAL_REGION_SIZE
+#define IXP425_EXP_CFG_BASE_VIRT	IXP4XX_EXP_CFG_BASE_VIRT
+#define IXP425_PCI_CFG_BASE_VIRT	IXP4XX_PCI_CFG_BASE_VIRT
+
+//#define IXP425_EthA_BASE_VIRT
+//#define IXP425_EthB_BASE_VIRT
+//#define IXP425_GPIO_BASE_VIRT
+//#define IXP425_NPEA_BASE_VIRT
+//#define IXP425_NPEB_BASE_VIRT
+//#define IXP425_NPEC_BASE_VIRT
+//#define IXP425_QMGR_BASE_VIRT	/* must be ioremapped on Linux 2.6 */
+//#define IXP425_TIMER_BASE_VIRT
+//#define IXP425_UART1_BASE_VIRT
+//#define IXP425_UART2_BASE_VIRT
+//#define IXP425_USB_BASE_VIRT
+
+/* Miscellaneous stuff. */
+#define IRQ_IXP425_XSCALE_PMU		IRQ_IXP4XX_XSCALE_PMU
+#define IXP425_ICMR			IXP4XX_ICMR
+#define IRQ_IXP425_USB			IRQ_IXP4XX_USB
+#endif