History

soc: ixp4xx: Uninline several functions

These inline functions immediately exploit the static ioremaps for the queue manager memory region. This does not work with multiplatform where everything need to be dynamically remapped, so get rid of these inlines and create new exports for those used by other drivers.

Linus Walleij committed 7 years ago

Commit d08502f1 parent 0b458d72 files · +124 −120Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/soc/ixp4xx/qmgr.h+7−120
@@ -57,6 +57,13 @@ struct qmgr_regs { · 56 unmodified lines
57 u32 sram[2048]; /* 0x2000 - 0x3FFF - config and buffer */57 u32 sram[2048]; /* 0x2000 - 0x3FFF - config and buffer */
58};58};
59 59
60void qmgr_put_entry(unsigned int queue, u32 val);
61u32 qmgr_get_entry(unsigned int queue);
62int qmgr_stat_empty(unsigned int queue);
63int qmgr_stat_below_low_watermark(unsigned int queue);
64int qmgr_stat_full(unsigned int queue);
65int qmgr_stat_overflow(unsigned int queue);
66void qmgr_release_queue(unsigned int queue);
60void qmgr_set_irq(unsigned int queue, int src,67void qmgr_set_irq(unsigned int queue, int src,
61 void (*handler)(void *pdev), void *pdev);68 void (*handler)(void *pdev), void *pdev);
62void qmgr_enable_irq(unsigned int queue);69void qmgr_enable_irq(unsigned int queue);
@@ -81,124 +88,4 @@ int __qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */, · 18 unmodified lines
81 nearly_full_watermark)88 nearly_full_watermark)
82#endif89#endif
83 90
84void qmgr_release_queue(unsigned int queue);
85
86
87static inline void qmgr_put_entry(unsigned int queue, u32 val)
88{
89 struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
90#if DEBUG_QMGR
91 BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */
92
93 printk(KERN_DEBUG "Queue %s(%i) put %X\n",
94 qmgr_queue_descs[queue], queue, val);
95#endif
96 __raw_writel(val, &qmgr_regs->acc[queue][0]);
97}
98
99static inline u32 qmgr_get_entry(unsigned int queue)
100{
101 u32 val;
102 const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
103 val = __raw_readl(&qmgr_regs->acc[queue][0]);
104#if DEBUG_QMGR
105 BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */
106
107 printk(KERN_DEBUG "Queue %s(%i) get %X\n",
108 qmgr_queue_descs[queue], queue, val);
109#endif
110 return val;
111}
112
113static inline int __qmgr_get_stat1(unsigned int queue)
114{
115 const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
116 return (__raw_readl(&qmgr_regs->stat1[queue >> 3])
117 >> ((queue & 7) << 2)) & 0xF;
118}
119
120static inline int __qmgr_get_stat2(unsigned int queue)
121{
122 const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
123 BUG_ON(queue >= HALF_QUEUES);
124 return (__raw_readl(&qmgr_regs->stat2[queue >> 4])
125 >> ((queue & 0xF) << 1)) & 0x3;
126}
127
128/**
129 * qmgr_stat_empty() - checks if a hardware queue is empty
130 * @queue: queue number
131 *
132 * Returns non-zero value if the queue is empty.
133 */
134static inline int qmgr_stat_empty(unsigned int queue)
135{
136 BUG_ON(queue >= HALF_QUEUES);
137 return __qmgr_get_stat1(queue) & QUEUE_STAT1_EMPTY;
138}
139
140/**
141 * qmgr_stat_below_low_watermark() - checks if a queue is below low watermark
142 * @queue: queue number
143 *
144 * Returns non-zero value if the queue is below low watermark.
145 */
146static inline int qmgr_stat_below_low_watermark(unsigned int queue)
147{
148 const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
149 if (queue >= HALF_QUEUES)
150 return (__raw_readl(&qmgr_regs->statne_h) >>
151 (queue - HALF_QUEUES)) & 0x01;
152 return __qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_EMPTY;
153}
154
155/**
156 * qmgr_stat_above_high_watermark() - checks if a queue is above high watermark
157 * @queue: queue number
158 *
159 * Returns non-zero value if the queue is above high watermark
160 */
161static inline int qmgr_stat_above_high_watermark(unsigned int queue)
162{
163 BUG_ON(queue >= HALF_QUEUES);
164 return __qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_FULL;
165}
166
167/**
168 * qmgr_stat_full() - checks if a hardware queue is full
169 * @queue: queue number
170 *
171 * Returns non-zero value if the queue is full.
172 */
173static inline int qmgr_stat_full(unsigned int queue)
174{
175 const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
176 if (queue >= HALF_QUEUES)
177 return (__raw_readl(&qmgr_regs->statf_h) >>
178 (queue - HALF_QUEUES)) & 0x01;
179 return __qmgr_get_stat1(queue) & QUEUE_STAT1_FULL;
180}
181
182/**
183 * qmgr_stat_underflow() - checks if a hardware queue experienced underflow
184 * @queue: queue number
185 *
186 * Returns non-zero value if the queue experienced underflow.
187 */
188static inline int qmgr_stat_underflow(unsigned int queue)
189{
190 return __qmgr_get_stat2(queue) & QUEUE_STAT2_UNDERFLOW;
191}
192
193/**
194 * qmgr_stat_overflow() - checks if a hardware queue experienced overflow
195 * @queue: queue number
196 *
197 * Returns non-zero value if the queue experienced overflow.
198 */
199static inline int qmgr_stat_overflow(unsigned int queue)
200{
201 return __qmgr_get_stat2(queue) & QUEUE_STAT2_OVERFLOW;
202}
203
204#endif91#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t