1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * arch/arm/mach-netx/include/mach/pfifo.h
5 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
9 #ifndef ASM_ARCH_PFIFO_H
10 #define ASM_ARCH_PFIFO_H
12 static inline int pfifo_push(int no, unsigned int pointer)
14 writel(pointer, NETX_PFIFO_BASE(no));
18 static inline unsigned int pfifo_pop(int no)
20 return readl(NETX_PFIFO_BASE(no));
23 static inline int pfifo_fill_level(int no)
26 return readl(NETX_PFIFO_FILL_LEVEL(no));
29 static inline int pfifo_full(int no)
31 return readl(NETX_PFIFO_FULL) & (1<<no) ? 1 : 0;
34 static inline int pfifo_empty(int no)
36 return readl(NETX_PFIFO_EMPTY) & (1<<no) ? 1 : 0;
39 int pfifo_request(unsigned int pfifo_mask);
40 void pfifo_free(unsigned int pfifo_mask);
42 #endif /* ASM_ARCH_PFIFO_H */