Skip to content

Commit 8a2fbff

Browse files
committed
Merge tag 'sparc-for-6.9-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/alarsson/linux-sparc
Pull sparc updates from Andreas Larsson: - Fix missing prototype warnings in various places, including switching to using generic cmpdi2/ucmpdi2 and parport.h and stop selecting unneeded GENERIC_ISA_DMA. - Reduce duplicate code by using shared font data, with dependency fixup in separate commit touching lib/fonts. - Convert sbus drives to use remove callbacks returning void - Fix return values of __setup handlers - Section mismatch fix for grpci pci drivers - Make the vio bus type constant - Kconfig cleanups and fixes - Typo fixes * tag 'sparc-for-6.9-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/alarsson/linux-sparc: lib/fonts: Allow Sparc console 8x16 font for sparc64 early boot text console sbus: uctrl: Convert to platform remove callback returning void sbus: flash: Convert to platform remove callback returning void sbus: envctrl: Convert to platform remove callback returning void sbus: display7seg: Convert to platform remove callback returning void sbus: bbc_i2c: Convert to platform remove callback returning void sbus: Add prototype for bbc_envctrl_init and bbc_envctrl_cleanup to header sparc32: Fix section mismatch in leon_pci_grpci sparc32: Fix parport build with sparc32 sparc32: Do not select GENERIC_ISA_DMA mtd: maps: sun_uflash: Declare uflash_devinit static sparc32: Fix build with trapbase sparc32: Use generic cmpdi2/ucmpdi2 variants sparc: select FRAME_POINTER instead of redefining it sparc: vDSO: fix return value of __setup handler sparc64: NMI watchdog: fix return value of __setup handler sparc: vio: make vio_bus_type const sparc: Fix typos sparc: Use shared font data sparc: remove obsolete config ARCH_ATU
2 parents 54f42d2 + 84b76d0 commit 8a2fbff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+344
-744
lines changed

arch/sparc/Kconfig

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ config SPARC32
5858
select CLZ_TAB
5959
select DMA_DIRECT_REMAP
6060
select GENERIC_ATOMIC64
61+
select GENERIC_LIB_CMPDI2
62+
select GENERIC_LIB_UCMPDI2
6163
select HAVE_UID16
6264
select HAVE_PAGE_SIZE_4KB
6365
select LOCK_MM_AND_FIND_VMA
@@ -115,10 +117,6 @@ config ARCH_PROC_KCORE_TEXT
115117
config CPU_BIG_ENDIAN
116118
def_bool y
117119

118-
config ARCH_ATU
119-
bool
120-
default y if SPARC64
121-
122120
config STACKTRACE_SUPPORT
123121
bool
124122
default y if SPARC64
@@ -143,10 +141,6 @@ config HIGHMEM
143141
default y if SPARC32
144142
select KMAP_LOCAL
145143

146-
config GENERIC_ISA_DMA
147-
bool
148-
default y if SPARC32
149-
150144
config PGTABLE_LEVELS
151145
default 4 if 64BIT
152146
default 3
@@ -222,6 +216,8 @@ config EARLYFB
222216
bool "Support for early boot text console"
223217
default y
224218
depends on SPARC64
219+
select FONT_SUN8x16
220+
select FONT_SUPPORT
225221
help
226222
Say Y here to enable a faster early framebuffer boot console.
227223

arch/sparc/Kconfig.debug

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ config MCOUNT
88
bool
99
depends on SPARC64
1010
depends on FUNCTION_TRACER
11-
default y
12-
13-
config FRAME_POINTER
14-
bool
15-
depends on MCOUNT
11+
select ARCH_WANT_FRAME_POINTERS
12+
select FRAME_POINTER
1613
default y
1714

1815
config HAVE_HARDLOCKUP_DETECTOR_SPARC64

arch/sparc/include/asm/hypervisor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ unsigned long sun4v_cpu_mondo_send(unsigned long cpu_count,
430430
* ERRORS: No errors defined.
431431
*
432432
* Return the hypervisor ID handle for the current CPU. Use by a
433-
* virtual CPU to discover it's own identity.
433+
* virtual CPU to discover its own identity.
434434
*/
435435
#define HV_FAST_CPU_MYID 0x16
436436

@@ -1221,7 +1221,7 @@ unsigned long sun4v_con_write(unsigned long buffer,
12211221
* EBADALIGNED software state description is not correctly
12221222
* aligned
12231223
*
1224-
* This allows the guest to report it's soft state to the hypervisor. There
1224+
* This allows the guest to report its soft state to the hypervisor. There
12251225
* are two primary components to this state. The first part states whether
12261226
* the guest software is running or not. The second containts optional
12271227
* details specific to the software.
@@ -1502,7 +1502,7 @@ struct hv_trap_trace_entry {
15021502
* configuration error of some sort.
15031503
*
15041504
* The dump services provide an opaque buffer into which the
1505-
* hypervisor can place it's internal state in order to assist in
1505+
* hypervisor can place its internal state in order to assist in
15061506
* debugging such situations. The contents are opaque and extremely
15071507
* platform and hypervisor implementation specific. The guest, during
15081508
* a core dump, requests that the hypervisor update any information in

arch/sparc/include/asm/ldc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void ldom_power_off(void);
1313
* or data becomes available on the receive side.
1414
*
1515
* For non-RAW links, if the LDC_EVENT_RESET event arrives the
16-
* driver should reset all of it's internal state and reinvoke
16+
* driver should reset all of its internal state and reinvoke
1717
* ldc_connect() to try and bring the link up again.
1818
*
1919
* For RAW links, ldc_connect() is not used. Instead the driver

arch/sparc/include/asm/mmu_context_64.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str
9393

9494
/* We have to be extremely careful here or else we will miss
9595
* a TSB grow if we switch back and forth between a kernel
96-
* thread and an address space which has it's TSB size increased
96+
* thread and an address space which has its TSB size increased
9797
* on another processor.
9898
*
9999
* It is possible to play some games in order to optimize the
@@ -118,7 +118,7 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str
118118
*
119119
* At that point cpu0 continues to use a stale TSB, the one from
120120
* before the TSB grow performed on cpu1. cpu1 did not cross-call
121-
* cpu0 to update it's TSB because at that point the cpu_vm_mask
121+
* cpu0 to update its TSB because at that point the cpu_vm_mask
122122
* only had cpu1 set in it.
123123
*/
124124
tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context));

arch/sparc/include/asm/parport.h

Lines changed: 7 additions & 252 deletions
Original file line numberDiff line numberDiff line change
@@ -1,256 +1,11 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
/* parport.h: sparc64 specific parport initialization and dma.
3-
*
4-
* Copyright (C) 1999 Eddie C. Dost (ecd@skynet.be)
5-
*/
2+
#ifndef ___ASM_SPARC_PARPORT_H
3+
#define ___ASM_SPARC_PARPORT_H
64

7-
#ifndef _ASM_SPARC64_PARPORT_H
8-
#define _ASM_SPARC64_PARPORT_H 1
9-
10-
#include <linux/of.h>
11-
#include <linux/platform_device.h>
12-
13-
#include <asm/ebus_dma.h>
14-
#include <asm/ns87303.h>
15-
#include <asm/prom.h>
16-
17-
#define PARPORT_PC_MAX_PORTS PARPORT_MAX
18-
19-
/*
20-
* While sparc64 doesn't have an ISA DMA API, we provide something that looks
21-
* close enough to make parport_pc happy
22-
*/
23-
#define HAS_DMA
24-
25-
#ifdef CONFIG_PARPORT_PC_FIFO
26-
static DEFINE_SPINLOCK(dma_spin_lock);
27-
28-
#define claim_dma_lock() \
29-
({ unsigned long flags; \
30-
spin_lock_irqsave(&dma_spin_lock, flags); \
31-
flags; \
32-
})
33-
34-
#define release_dma_lock(__flags) \
35-
spin_unlock_irqrestore(&dma_spin_lock, __flags);
5+
#if defined(__sparc__) && defined(__arch64__)
6+
#include <asm/parport_64.h>
7+
#else
8+
#include <asm-generic/parport.h>
9+
#endif
3610
#endif
3711

38-
static struct sparc_ebus_info {
39-
struct ebus_dma_info info;
40-
unsigned int addr;
41-
unsigned int count;
42-
int lock;
43-
44-
struct parport *port;
45-
} sparc_ebus_dmas[PARPORT_PC_MAX_PORTS];
46-
47-
static DECLARE_BITMAP(dma_slot_map, PARPORT_PC_MAX_PORTS);
48-
49-
static inline int request_dma(unsigned int dmanr, const char *device_id)
50-
{
51-
if (dmanr >= PARPORT_PC_MAX_PORTS)
52-
return -EINVAL;
53-
if (xchg(&sparc_ebus_dmas[dmanr].lock, 1) != 0)
54-
return -EBUSY;
55-
return 0;
56-
}
57-
58-
static inline void free_dma(unsigned int dmanr)
59-
{
60-
if (dmanr >= PARPORT_PC_MAX_PORTS) {
61-
printk(KERN_WARNING "Trying to free DMA%d\n", dmanr);
62-
return;
63-
}
64-
if (xchg(&sparc_ebus_dmas[dmanr].lock, 0) == 0) {
65-
printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr);
66-
return;
67-
}
68-
}
69-
70-
static inline void enable_dma(unsigned int dmanr)
71-
{
72-
ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1);
73-
74-
if (ebus_dma_request(&sparc_ebus_dmas[dmanr].info,
75-
sparc_ebus_dmas[dmanr].addr,
76-
sparc_ebus_dmas[dmanr].count))
77-
BUG();
78-
}
79-
80-
static inline void disable_dma(unsigned int dmanr)
81-
{
82-
ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 0);
83-
}
84-
85-
static inline void clear_dma_ff(unsigned int dmanr)
86-
{
87-
/* nothing */
88-
}
89-
90-
static inline void set_dma_mode(unsigned int dmanr, char mode)
91-
{
92-
ebus_dma_prepare(&sparc_ebus_dmas[dmanr].info, (mode != DMA_MODE_WRITE));
93-
}
94-
95-
static inline void set_dma_addr(unsigned int dmanr, unsigned int addr)
96-
{
97-
sparc_ebus_dmas[dmanr].addr = addr;
98-
}
99-
100-
static inline void set_dma_count(unsigned int dmanr, unsigned int count)
101-
{
102-
sparc_ebus_dmas[dmanr].count = count;
103-
}
104-
105-
static inline unsigned int get_dma_residue(unsigned int dmanr)
106-
{
107-
return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info);
108-
}
109-
110-
static int ecpp_probe(struct platform_device *op)
111-
{
112-
unsigned long base = op->resource[0].start;
113-
unsigned long config = op->resource[1].start;
114-
unsigned long d_base = op->resource[2].start;
115-
unsigned long d_len;
116-
struct device_node *parent;
117-
struct parport *p;
118-
int slot, err;
119-
120-
parent = op->dev.of_node->parent;
121-
if (of_node_name_eq(parent, "dma")) {
122-
p = parport_pc_probe_port(base, base + 0x400,
123-
op->archdata.irqs[0], PARPORT_DMA_NOFIFO,
124-
op->dev.parent->parent, 0);
125-
if (!p)
126-
return -ENOMEM;
127-
dev_set_drvdata(&op->dev, p);
128-
return 0;
129-
}
130-
131-
for (slot = 0; slot < PARPORT_PC_MAX_PORTS; slot++) {
132-
if (!test_and_set_bit(slot, dma_slot_map))
133-
break;
134-
}
135-
err = -ENODEV;
136-
if (slot >= PARPORT_PC_MAX_PORTS)
137-
goto out_err;
138-
139-
spin_lock_init(&sparc_ebus_dmas[slot].info.lock);
140-
141-
d_len = (op->resource[2].end - d_base) + 1UL;
142-
sparc_ebus_dmas[slot].info.regs =
143-
of_ioremap(&op->resource[2], 0, d_len, "ECPP DMA");
144-
145-
if (!sparc_ebus_dmas[slot].info.regs)
146-
goto out_clear_map;
147-
148-
sparc_ebus_dmas[slot].info.flags = 0;
149-
sparc_ebus_dmas[slot].info.callback = NULL;
150-
sparc_ebus_dmas[slot].info.client_cookie = NULL;
151-
sparc_ebus_dmas[slot].info.irq = 0xdeadbeef;
152-
strcpy(sparc_ebus_dmas[slot].info.name, "parport");
153-
if (ebus_dma_register(&sparc_ebus_dmas[slot].info))
154-
goto out_unmap_regs;
155-
156-
ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 1);
157-
158-
/* Configure IRQ to Push Pull, Level Low */
159-
/* Enable ECP, set bit 2 of the CTR first */
160-
outb(0x04, base + 0x02);
161-
ns87303_modify(config, PCR,
162-
PCR_EPP_ENABLE |
163-
PCR_IRQ_ODRAIN,
164-
PCR_ECP_ENABLE |
165-
PCR_ECP_CLK_ENA |
166-
PCR_IRQ_POLAR);
167-
168-
/* CTR bit 5 controls direction of port */
169-
ns87303_modify(config, PTR,
170-
0, PTR_LPT_REG_DIR);
171-
172-
p = parport_pc_probe_port(base, base + 0x400,
173-
op->archdata.irqs[0],
174-
slot,
175-
op->dev.parent,
176-
0);
177-
err = -ENOMEM;
178-
if (!p)
179-
goto out_disable_irq;
180-
181-
dev_set_drvdata(&op->dev, p);
182-
183-
return 0;
184-
185-
out_disable_irq:
186-
ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 0);
187-
ebus_dma_unregister(&sparc_ebus_dmas[slot].info);
188-
189-
out_unmap_regs:
190-
of_iounmap(&op->resource[2], sparc_ebus_dmas[slot].info.regs, d_len);
191-
192-
out_clear_map:
193-
clear_bit(slot, dma_slot_map);
194-
195-
out_err:
196-
return err;
197-
}
198-
199-
static int ecpp_remove(struct platform_device *op)
200-
{
201-
struct parport *p = dev_get_drvdata(&op->dev);
202-
int slot = p->dma;
203-
204-
parport_pc_unregister_port(p);
205-
206-
if (slot != PARPORT_DMA_NOFIFO) {
207-
unsigned long d_base = op->resource[2].start;
208-
unsigned long d_len;
209-
210-
d_len = (op->resource[2].end - d_base) + 1UL;
211-
212-
ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 0);
213-
ebus_dma_unregister(&sparc_ebus_dmas[slot].info);
214-
of_iounmap(&op->resource[2],
215-
sparc_ebus_dmas[slot].info.regs,
216-
d_len);
217-
clear_bit(slot, dma_slot_map);
218-
}
219-
220-
return 0;
221-
}
222-
223-
static const struct of_device_id ecpp_match[] = {
224-
{
225-
.name = "ecpp",
226-
},
227-
{
228-
.name = "parallel",
229-
.compatible = "ecpp",
230-
},
231-
{
232-
.name = "parallel",
233-
.compatible = "ns87317-ecpp",
234-
},
235-
{
236-
.name = "parallel",
237-
.compatible = "pnpALI,1533,3",
238-
},
239-
{},
240-
};
241-
242-
static struct platform_driver ecpp_driver = {
243-
.driver = {
244-
.name = "ecpp",
245-
.of_match_table = ecpp_match,
246-
},
247-
.probe = ecpp_probe,
248-
.remove = ecpp_remove,
249-
};
250-
251-
static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
252-
{
253-
return platform_driver_register(&ecpp_driver);
254-
}
255-
256-
#endif /* !(_ASM_SPARC64_PARPORT_H */

0 commit comments

Comments
 (0)