summaryrefslogtreecommitdiff
path: root/packages/ixp4xx/ixp-osal-2.0/le.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/ixp4xx/ixp-osal-2.0/le.patch')
-rw-r--r--packages/ixp4xx/ixp-osal-2.0/le.patch340
1 files changed, 340 insertions, 0 deletions
diff --git a/packages/ixp4xx/ixp-osal-2.0/le.patch b/packages/ixp4xx/ixp-osal-2.0/le.patch
new file mode 100644
index 0000000000..c941bbc318
--- /dev/null
+++ b/packages/ixp4xx/ixp-osal-2.0/le.patch
@@ -0,0 +1,340 @@
+diff -bBdurN hannes/ixp_osal/include/IxOsalAssert.h merged/ixp_osal/include/IxOsalAssert.h
+--- ixp_osal/include/IxOsalAssert.h 2005-04-17 20:56:26.000000000 -0700
++++ ixp_osal/include/IxOsalAssert.h 2005-10-07 15:08:43.119207986 -0700
+@@ -70,6 +70,9 @@
+ * This will be conditionally compiled out and
+ * may be used for test purposes.
+ */
++#ifndef __ARMEB__
++#define IX_OSAL_ENSURE_ON
++#endif /* ! __ARMEB__ */
+ #ifdef IX_OSAL_ENSURE_ON
+ #define IX_OSAL_ENSURE(c, str) do { \
+ if (!(c)) ixOsalLog (IX_OSAL_LOG_LVL_MESSAGE, IX_OSAL_LOG_DEV_STDOUT, str, \
+@@ -79,5 +82,14 @@
+ #define IX_OSAL_ENSURE(c, str)
+ #endif
+
++#ifndef __ARMEB__
++#ifdef DEBUG_ACDC
++#define TRACE() printk("ixp400: %s(): line %d\n", __FUNCTION__, __LINE__)
++#define PRINTK(args...) printk(args...)
++#else
++#define TRACE() while (0) {}
++#define PRINTK(args...) while (0) {}
++#endif
++#endif /* ! __ARMEB__ */
+
+ #endif /* IX_OSAL_ASSERT_H */
+diff -bBdurN hannes/ixp_osal/include/modules/ioMem/IxOsalMemAccess.h merged/ixp_osal/include/modules/ioMem/IxOsalMemAccess.h
+--- ixp_osal/include/modules/ioMem/IxOsalMemAccess.h 2005-04-17 20:56:25.000000000 -0700
++++ ixp_osal/include/modules/ioMem/IxOsalMemAccess.h 2005-10-07 15:08:43.115207734 -0700
+@@ -84,7 +84,12 @@
+
+ #elif defined (IX_OSAL_LINUX_LE)
+
++#ifndef __ARMEB__
++//#define IX_SDRAM_LE_DATA_COHERENT
++#define IX_SDRAM_LE_ADDRESS_COHERENT
++#else /* __ARMEB__ */
+ #define IX_SDRAM_LE_DATA_COHERENT
++#endif /* __ARMEB__ */
+
+ #elif defined (IX_OSAL_WINCE_LE)
+
+@@ -232,7 +237,11 @@
+ Redefine per OS if dynamic memory maps are used
+ and I/O memory is accessed via functions instead of raw pointer access. */
+
++#ifndef __ARMEB__
++#define IX_OSAL_READ_LONG_COOKIE(wCookie) (BARF; readl((UINT32) (wCookie) ))
++#else /* __ARMEB__ */
+ #define IX_OSAL_READ_LONG_COOKIE(wCookie) (readl((UINT32) (wCookie) ))
++#endif /* __ARMEB__ */
+ #define IX_OSAL_READ_SHORT_COOKIE(sCookie) (readw((UINT32) (sCookie) ))
+ #define IX_OSAL_READ_BYTE_COOKIE(bCookie) (readb((UINT32) (bCookie) ))
+ #define IX_OSAL_WRITE_LONG_COOKIE(wCookie, wData) (writel(wData, (UINT32) (wCookie) ))
+@@ -343,7 +352,11 @@
+ #include <asm/io.h>
+ #endif /* ndef __wince */
+
++#ifndef __ARMEB__
++#define IX_OSAL_READ_LONG_IO(wAddr) IX_OSAL_READ_LONG_COOKIE(wAddr); BARF;
++#else /* __ARMEB__ */
+ #define IX_OSAL_READ_LONG_IO(wAddr) IX_OSAL_READ_LONG_COOKIE(wAddr)
++#endif /* __ARMEB__ */
+ #define IX_OSAL_READ_SHORT_IO(sAddr) IX_OSAL_READ_SHORT_COOKIE(sAddr)
+ #define IX_OSAL_READ_BYTE_IO(bAddr) IX_OSAL_READ_BYTE_COOKIE(bAddr)
+ #define IX_OSAL_WRITE_LONG_IO(wAddr, wData) IX_OSAL_WRITE_LONG_COOKIE(wAddr, wData)
+diff -bBdurN hannes/ixp_osal/os/linux/include/core/IxOsalOs.h merged/ixp_osal/os/linux/include/core/IxOsalOs.h
+--- ixp_osal/os/linux/include/core/IxOsalOs.h 2005-10-07 09:29:02.388729473 -0700
++++ ixp_osal/os/linux/include/core/IxOsalOs.h 2005-10-07 15:08:43.127208490 -0700
+@@ -53,10 +53,16 @@
+ #error "Uncached memory not supported in linux environment"
+ #endif
+
++#ifndef __ARMEB__
++#include <linux/config.h>
++#include <linux/version.h>
++#endif /* ! __ARMEB__ */
+ #include <linux/cache.h>
+ #include <linux/mm.h>
++#ifdef __ARMEB__
+ #include <linux/config.h>
+ #include <linux/version.h>
++#endif /* __ARMEB__ */
+ #include <asm/pgalloc.h>
+
+ /**
+@@ -67,21 +73,41 @@
+
+ #define IX_OSAL_OS_MMU_PHYS_TO_VIRT(addr) ((addr) ? phys_to_virt((unsigned int)(addr)) : 0)
+
++
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
++#ifndef __ARMEB__
++extern void ix_dcache_invalidate_range(unsigned long start, unsigned long size)
++;
++extern void ix_dcache_flush_range(unsigned long start, unsigned long size);
++
++#else /* __ARMEB__ */
+ /*
+ * 2.6 kernels do not export the required cache functions.
+ */
+ extern void ixOsalCacheInvalidateRange(unsigned long start, unsigned long size);
+ extern void ixOsalCacheFlushRange(unsigned long start, unsigned long size);
++#endif /* __ARMEB__ */
+
++#ifndef __ARMEB__
++#define IX_OSAL_OS_CACHE_INVALIDATE(addr, size) ( ix_dcache_invalidate_range((__u32)addr, (__u32)addr + size ))
++#else /* __ARMEB__ */
+ #define IX_OSAL_OS_CACHE_INVALIDATE(addr, size) \
+ ixOsalCacheInvalidateRange((unsigned long)addr, (unsigned long)addr + size)
+ #define IX_OSAL_OS_CACHE_FLUSH(addr, size) \
+ ixOsalCacheFlushRange((unsigned long)addr, (unsigned long)addr + size )
++#endif /* __ARMEB__ */
+
++#ifndef __ARMEB__
++#define IX_OSAL_OS_CACHE_FLUSH(addr, size) ( ix_dcache_flush_range((__u32)addr, (__u32)addr + size ))
++#endif /* ! __ARMEB__ */
+ #else
++#ifndef __ARMEB__
++#define IX_OSAL_OS_CACHE_INVALIDATE(addr, size) ( invalidate_dcache_range((__u32)addr, (__u32)addr + size ))
++#endif /* ! __ARMEB__ */
+
++#ifdef __ARMEB__
+ #define IX_OSAL_OS_CACHE_INVALIDATE(addr, size) ( invalidate_dcache_range((__u32)addr, (__u32)addr + size ))
++#endif /* __ARMEB__ */
+ #define IX_OSAL_OS_CACHE_FLUSH(addr, size) ( clean_dcache_range((__u32)addr, (__u32)addr + size ))
+ #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) */
+
+diff -bBdurN hannes/ixp_osal/os/linux/include/platforms/ixp400/IxOsalOsIxp400.h merged/ixp_osal/os/linux/include/platforms/ixp400/IxOsalOsIxp400.h
+--- ixp_osal/os/linux/include/platforms/ixp400/IxOsalOsIxp400.h 2005-10-07 09:29:02.392729725 -0700
++++ ixp_osal/os/linux/include/platforms/ixp400/IxOsalOsIxp400.h 2005-10-07 15:08:43.147209748 -0700
+@@ -110,6 +149,9 @@
+ #define IX_OSAL_IXP400_NPEB_VIRT_BASE IXP425_NPEB_BASE_VIRT
+ #define IX_OSAL_IXP400_NPEC_VIRT_BASE IXP425_NPEC_BASE_VIRT
+ #define IX_OSAL_IXP400_PERIPHERAL_VIRT_BASE IXP425_PERIPHERAL_BASE_VIRT
++#ifndef __ARMEB__
++#define IX_OSAL_IXP400_QMGR_VIRT_BASE IXP425_QMGR_BASE_VIRT
++#endif /* ! __ARMEB__ */
+ #define IX_OSAL_IXP400_OSTS_VIRT_BASE IXP425_TIMER_BASE_VIRT
+ #define IX_OSAL_IXP400_USB_VIRT_BASE IXP425_USB_BASE_VIRT
+ #define IX_OSAL_IXP400_EXP_CFG_VIRT_BASE IXP425_EXP_CFG_BASE_VIRT
+diff -bBdurN hannes/ixp_osal/os/linux/include/platforms/ixp400/IxOsalOsIxp400CustomizedMapping.h merged/ixp_osal/os/linux/include/platforms/ixp400/IxOsalOsIxp400CustomizedMapping.h
+--- ixp_osal/os/linux/include/platforms/ixp400/IxOsalOsIxp400CustomizedMapping.h 2005-04-17 20:56:27.000000000 -0700
++++ ixp_osal/os/linux/include/platforms/ixp400/IxOsalOsIxp400CustomizedMapping.h 2005-10-07 15:08:43.147209748 -0700
+@@ -171,7 +171,12 @@
+ ***************************/
+ #if (IX_COMPONENT_NAME == ix_qmgr)
+
++#ifndef __ARMEB__
++//#define IX_OSAL_LE_DC_MAPPING
++#define IX_OSAL_LE_AC_MAPPING
++#else /* __ARMEB__ */
+ #define IX_OSAL_LE_DC_MAPPING
++#endif /* __ARMEB__ */
+
+ #endif /* qmgr */
+
+diff -bBdurN hannes/ixp_osal/os/linux/include/platforms/ixp400/ixp425/IxOsalOsIxp425Sys.h merged/ixp_osal/os/linux/include/platforms/ixp400/ixp425/IxOsalOsIxp425Sys.h
+--- ixp_osal/os/linux/include/platforms/ixp400/ixp425/IxOsalOsIxp425Sys.h 2005-10-07 09:29:02.392729725 -0700
++++ ixp_osal/os/linux/include/platforms/ixp400/ixp425/IxOsalOsIxp425Sys.h 2005-10-07 15:08:43.143209496 -0700
+@@ -85,6 +85,17 @@
+ * Queue Manager
+ */
+ {
++#ifndef __ARMEB__
++ IX_OSAL_DYNAMIC_MAP, /* type */
++ IX_OSAL_IXP400_QMGR_PHYS_BASE, /* physicalAddress */
++ IX_OSAL_IXP400_QMGR_MAP_SIZE, /* size */
++ 0,
++ ixOsalLinuxMemMap, /* mapFunction */
++ ixOsalLinuxMemUnmap, /* unmapFunction */
++ 0,
++ IX_OSAL_BE | IX_OSAL_LE_AC, /* endianType */
++ "qMgr" /* name */
++#else /* __ARMEB__ */
+ #ifdef IXP425_QMGR_BASE_VIRT
+ IX_OSAL_STATIC_MAP, /* type */
+ IX_OSAL_IXP400_QMGR_PHYS_BASE, /* physicalAddress */
+@@ -103,6 +114,7 @@
+ 0, /* refCount */
+ IX_OSAL_BE | IX_OSAL_LE_DC, /* endianType */
+ "qMgr" /* name */
++#endif /* __ARMEB__ */
+ },
+
+ /*
+diff -bBdurN hannes/ixp_osal/os/linux/src/core/IxOsalOsCacheMMU.c merged/ixp_osal/os/linux/src/core/IxOsalOsCacheMMU.c
+--- ixp_osal/os/linux/src/core/IxOsalOsCacheMMU.c 2005-10-07 09:29:02.388729473 -0700
++++ ixp_osal/os/linux/src/core/IxOsalOsCacheMMU.c 2005-10-07 15:08:43.159210503 -0700
+@@ -210,6 +210,7 @@
+ free_pages ((unsigned int) memptr, order);
+ }
+ }
++#ifdef __ARMEB__
+
+
+ /*
+@@ -266,3 +267,4 @@
+ #undef IX_CLM
+
+ #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) */
++#endif /* __ARMEB__ */
+diff -bBdurN hannes/ixp_osal/os/linux/src/core/IxOsalOsMsgQ.c merged/ixp_osal/os/linux/src/core/IxOsalOsMsgQ.c
+--- ixp_osal/os/linux/src/core/IxOsalOsMsgQ.c 2005-10-07 09:29:02.388729473 -0700
++++ ixp_osal/os/linux/src/core/IxOsalOsMsgQ.c 2005-10-07 15:08:43.159210503 -0700
+@@ -48,6 +48,9 @@
+ #include <linux/spinlock.h>
+ #include <linux/ipc.h>
+ #include <linux/msg.h>
++#ifndef __ARMEB__
++#include <linux/spinlock.h>
++#endif /* ! __ARMEB__ */
+ #include <linux/interrupt.h>
+
+ #include "IxOsal.h"
+diff -bBdurN hannes/ixp_osal/os/linux/src/core/IxOsalOsSemaphore.c merged/ixp_osal/os/linux/src/core/IxOsalOsSemaphore.c
+--- ixp_osal/os/linux/src/core/IxOsalOsSemaphore.c 2005-10-07 09:29:02.388729473 -0700
++++ ixp_osal/os/linux/src/core/IxOsalOsSemaphore.c 2005-10-07 15:08:43.163210755 -0700
+@@ -46,6 +46,9 @@
+ */
+
+ #include <linux/slab.h>
++#ifndef __ARMEB__
++//#include <asm-arm/hardirq.h>
++#endif /* ! __ARMEB__ */
+ #include <linux/hardirq.h>
+ #include "IxOsal.h"
+
+@@ -93,7 +96,11 @@
+ {
+
+ IX_STATUS ixStatus = IX_SUCCESS;
++#ifndef __ARMEB__
++ UINT32 timeoutTime;
++#else /* __ARMEB__ */
+ unsigned long timeoutTime;
++#endif /* __ARMEB__ */
+
+ if (sid == NULL)
+ {
+diff -bBdurN hannes/ixp_osal/os/linux/src/core/IxOsalOsServices.c merged/ixp_osal/os/linux/src/core/IxOsalOsServices.c
+--- ixp_osal/os/linux/src/core/IxOsalOsServices.c 2005-10-07 09:29:02.392729725 -0700
++++ ixp_osal/os/linux/src/core/IxOsalOsServices.c 2005-10-07 15:08:43.163210755 -0700
+@@ -90,8 +89,12 @@
+ /*
+ * General interrupt handler
+ */
++#ifndef __ARMEB__
++static irqreturn_t ixOsalOsIsrProxy (int irq, void *dev_id, struct pt_regs *regs)
++#else /* __ARMEB__ */
+ static irqreturn_t
+ ixOsalOsIsrProxy (int irq, void *dev_id, struct pt_regs *regs)
++#endif /* __ARMEB__ */
+ {
+ IxOsalInfoType *isr_proxy_info = (IxOsalInfoType *) dev_id;
+
+@@ -197,12 +200,20 @@
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+ unsigned long flags;
+ local_irq_save(flags);
++#ifndef __ARMEB__
++ return (int)flags;
++#endif /* __ARMEB__ */
+ #else
+ UINT32 flags;
+ save_flags (flags);
+ cli ();
++#ifndef __ARMEB__
++ return flags;
++#endif /* ! __ARMEB__ */
+ #endif
++#ifdef __ARMEB__
+ return (UINT32)flags;
++#endif /* __ARMEB__ */
+ }
+
+ /* Enable interrupts and task scheduling,
+@@ -212,11 +223,15 @@
+ PUBLIC void
+ ixOsalIrqUnlock (UINT32 lockKey)
+ {
+-# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
++#ifndef __ARMEB__
++ local_irq_restore(lockKey);
++#else /* __ARMEB__ */
+ local_irq_restore((unsigned long)lockKey);
+-# else
++#endif /* __ARMEB__ */
++#else
+ restore_flags (lockKey);
+-# endif
++#endif
+ }
+
+ PUBLIC UINT32
+@@ -341,7 +356,11 @@
+ PUBLIC void
+ ixOsalSleep (UINT32 milliseconds)
+ {
++#ifndef __ARMEB__
++ if (milliseconds != 0)
++#else /* __ARMEB__ */
+ if (milliseconds*HZ >= 1000)
++#endif /* __ARMEB__ */
+ {
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout ((milliseconds * HZ) / 1000);
+diff -bBdurN hannes/ixp_osal/os/linux/src/core/IxOsalOsSymbols.c merged/ixp_osal/os/linux/src/core/IxOsalOsSymbols.c
+--- ixp_osal/os/linux/src/core/IxOsalOsSymbols.c 2005-10-07 09:29:02.388729473 -0700
++++ ixp_osal/os/linux/src/core/IxOsalOsSymbols.c 2005-10-07 15:08:43.167211007 -0700
+@@ -64,10 +64,12 @@
+
+ EXPORT_SYMBOL (ixOsalCacheDmaMalloc);
+ EXPORT_SYMBOL (ixOsalCacheDmaFree);
++#ifdef __ARMEB__
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+ EXPORT_SYMBOL (ixOsalCacheInvalidateRange);
+ EXPORT_SYMBOL (ixOsalCacheFlushRange);
+ #endif
++#endif /* __ARMEB__ */
+
+ EXPORT_SYMBOL (ixOsalThreadCreate);
+ EXPORT_SYMBOL (ixOsalThreadStart);
+diff -bBdurN hannes/ixp_osal/include/modules/ioMem/IxOsalIoMem.h merged/ixp_osal/include/modules/ioMem/IxOsalIoMem.h
+--- ixp_osal/include/modules/ioMem/IxOsalIoMem.h 2005-04-17 20:56:25.000000000 -0700
++++ ixp_osal/include/modules/ioMem/IxOsalIoMem.h 2005-10-07 16:20:27.786083595 -0700
+@@ -105,8 +105,8 @@
+ #endif /* ndef __wince */
+
+ #define IX_OSAL_SWAP_SHORT(sData) ((sData >> 8) | ((sData & 0xFF) << 8))
+-#define IX_OSAL_SWAP_SHORT_ADDRESS(sAddr) ((sAddr) ^ 0x2)
+-#define IX_OSAL_SWAP_BYTE_ADDRESS(bAddr) ((bAddr) ^ 0x3)
++#define IX_OSAL_SWAP_SHORT_ADDRESS(sAddr) ((UINT16*)((UINT32)(sAddr) ^ 0x2))
++#define IX_OSAL_SWAP_BYTE_ADDRESS(bAddr) ((UINT8*)((UINT32)(bAddr) ^ 0x3))
+
+ #define IX_OSAL_BE_XSTOBUSL(wData) (wData)
+ #define IX_OSAL_BE_XSTOBUSS(sData) (sData)