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
5757 u32 sram[2048]; /* 0x2000 - 0x3FFF - config and buffer */
5858 };
5959
60+void qmgr_put_entry(unsigned int queue, u32 val);
61+u32 qmgr_get_entry(unsigned int queue);
62+int qmgr_stat_empty(unsigned int queue);
63+int qmgr_stat_below_low_watermark(unsigned int queue);
64+int qmgr_stat_full(unsigned int queue);
65+int qmgr_stat_overflow(unsigned int queue);
66+void qmgr_release_queue(unsigned int queue);
6067 void qmgr_set_irq(unsigned int queue, int src,
6168 void (*handler)(void *pdev), void *pdev);
6269 void qmgr_enable_irq(unsigned int queue);
@@ -81,124 +88,4 @@ int __qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */, · 18 unmodified lines
8188 nearly_full_watermark)
8289 #endif
8390
84−void qmgr_release_queue(unsigned int queue);
85−
86−
87−static 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−
99−static 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−
113−static 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−
120−static 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− */
134−static 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− */
146−static 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− */
161−static 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− */
173−static 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− */
188−static 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− */
199−static inline int qmgr_stat_overflow(unsigned int queue)
200−{
201− return __qmgr_get_stat2(queue) & QUEUE_STAT2_OVERFLOW;
202−}
203−
20491 #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