From fd8ccf9c652556047dee58330dd8543dbf345d7b Mon Sep 17 00:00:00 2001 From: blogic Date: Sun, 29 May 2011 21:19:26 +0000 Subject: [lantiq] * backport 2.6.8 patches to .39 / .32.33 * remove lqtapi * bump tapi/dsl to .39 * migrate to new ltq_ style api * add amazon_se support git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27026 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/lqtapi/src/mps/mps-fifo.c | 102 -------------------------------------- 1 file changed, 102 deletions(-) delete mode 100644 package/lqtapi/src/mps/mps-fifo.c (limited to 'package/lqtapi/src/mps/mps-fifo.c') diff --git a/package/lqtapi/src/mps/mps-fifo.c b/package/lqtapi/src/mps/mps-fifo.c deleted file mode 100644 index 9d88a45474..0000000000 --- a/package/lqtapi/src/mps/mps-fifo.c +++ /dev/null @@ -1,102 +0,0 @@ -#include - -#include "mps.h" - -void mps_fifo_init(struct mps_fifo *fifo, void __iomem *base, - void __iomem *head_addr, void __iomem *tail_addr, uint32_t size) -{ - fifo->base = base; - fifo->head_addr = head_addr; - fifo->tail_addr = tail_addr; - fifo->size = size; - mps_fifo_reset(fifo); -} - -void mps_fifo_in(struct mps_fifo *fifo, const uint32_t *from, size_t len) -{ - uint32_t head = __raw_readl(fifo->head_addr); - void __iomem *base = fifo->base + head; - size_t i = 0; - size_t byte_len = len * 4; - - if (head < byte_len) { - for(; i <= head / 4; ++i) { - __raw_writel(from[i], base); - base -= 4; - } - - base += fifo->size; - head += fifo->size; - } - - for(; i < len; ++i) { - __raw_writel(from[i], base); - base -= 4; - } - - head -= byte_len; - __raw_writel(head, fifo->head_addr); - -} -EXPORT_SYMBOL_GPL(mps_fifo_in); - -void mps_fifo_out(struct mps_fifo *fifo, uint32_t *to, size_t len) -{ - uint32_t tail = __raw_readl(fifo->tail_addr); - void __iomem *base = fifo->base + tail; - size_t i = 0; - size_t byte_len = len * 4; - - if (tail < byte_len) { - for(; i <= tail / 4; ++i) { - to[i] = __raw_readl(base); - base -= 4; - } - - base += fifo->size; - tail += fifo->size; - } - - for(; i < len; ++i) { - to[i] = __raw_readl(base); - base -= 4; - } - - tail -= byte_len; - __raw_writel(tail, fifo->tail_addr); -} -EXPORT_SYMBOL_GPL(mps_fifo_out); - -uint32_t mps_fifo_peek(struct mps_fifo *fifo) -{ - uint32_t tail = __raw_readl(fifo->tail_addr); - void __iomem *base = fifo->base + tail; - return __raw_readl(base); -} - -void mps_fifo_reset(struct mps_fifo *fifo) -{ - void __iomem *base = fifo->base + fifo->size - 4; - size_t i; - - __raw_writel(fifo->size - 4, fifo->head_addr); - __raw_writel(fifo->size - 4, fifo->tail_addr); - - for(i = 0; i < 16; ++i) { - __raw_writel(0x0, base); - base -= 4; - } -} - -size_t mps_fifo_len(struct mps_fifo *fifo) -{ - uint32_t head = __raw_readl(fifo->head_addr); - uint32_t tail = __raw_readl(fifo->tail_addr); - - if (tail < head) - return head - tail; - else - return fifo->size - (tail - head); -} -EXPORT_SYMBOL_GPL(mps_fifo_len); - -- cgit v1.2.3