Skip to content

Commit 8e5423e

Browse files
committed
Merge tag 'parisc-for-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc architecture fixes from Helge Deller: "This mostly handles oddities with the serial port 8250_gsc.c driver. Although the name suggests it's just for serial ports on the GSC bus (e.g. in older PA-RISC machines), it handles serial ports on PA-RISC PCI devices (e.g. on the SuperIO chip) as well. Thus this renames the driver to 8250_parisc and fixes the config dependencies. The other change is a cleanup on how the device IDs of devices in a PA-RISC machine are shown at startup" * tag 'parisc-for-6.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Avoid printing the hardware path twice parisc: Export iosapic_serial_irq() symbol for serial port driver MAINTAINERS: adjust entry after renaming parisc serial driver parisc: Use signed char for hardware path in pdc.h parisc/serial: Rename 8250_gsc.c to 8250_parisc.c parisc: Make 8250_gsc driver dependend on CONFIG_PARISC
2 parents 31fc92f + 2b6ae09 commit 8e5423e

File tree

9 files changed

+47
-58
lines changed

9 files changed

+47
-58
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15630,7 +15630,7 @@ F: drivers/input/serio/gscps2.c
1563015630
F: drivers/input/serio/hp_sdc*
1563115631
F: drivers/parisc/
1563215632
F: drivers/parport/parport_gsc.*
15633-
F: drivers/tty/serial/8250/8250_gsc.c
15633+
F: drivers/tty/serial/8250/8250_parisc.c
1563415634
F: drivers/video/console/sti*
1563515635
F: drivers/video/fbdev/sti*
1563615636
F: drivers/video/logo/logo_parisc*

arch/parisc/include/asm/hardware.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
#define SVERSION_ANY_ID PA_SVERSION_ANY_ID
1111

1212
struct hp_hardware {
13-
unsigned short hw_type:5; /* HPHW_xxx */
14-
unsigned short hversion;
15-
unsigned long sversion:28;
16-
unsigned short opt;
17-
const char name[80]; /* The hardware description */
18-
};
13+
unsigned int hw_type:8; /* HPHW_xxx */
14+
unsigned int hversion:12;
15+
unsigned int sversion:12;
16+
unsigned char opt;
17+
unsigned char name[59]; /* The hardware description */
18+
} __packed;
1919

2020
struct parisc_device;
2121

arch/parisc/include/uapi/asm/pdc.h

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -363,20 +363,25 @@
363363

364364
#if !defined(__ASSEMBLY__)
365365

366-
/* flags of the device_path */
366+
/* flags for hardware_path */
367367
#define PF_AUTOBOOT 0x80
368368
#define PF_AUTOSEARCH 0x40
369369
#define PF_TIMER 0x0F
370370

371-
struct device_path { /* page 1-69 */
372-
unsigned char flags; /* flags see above! */
373-
unsigned char bc[6]; /* bus converter routing info */
374-
unsigned char mod;
375-
unsigned int layers[6];/* device-specific layer-info */
376-
} __attribute__((aligned(8))) ;
371+
struct hardware_path {
372+
unsigned char flags; /* see bit definitions below */
373+
signed char bc[6]; /* Bus Converter routing info to a specific */
374+
/* I/O adaptor (< 0 means none, > 63 resvd) */
375+
signed char mod; /* fixed field of specified module */
376+
};
377+
378+
struct pdc_module_path { /* page 1-69 */
379+
struct hardware_path path;
380+
unsigned int layers[6]; /* device-specific info (ctlr #, unit # ...) */
381+
} __attribute__((aligned(8)));
377382

378383
struct pz_device {
379-
struct device_path dp; /* see above */
384+
struct pdc_module_path dp; /* see above */
380385
/* struct iomod *hpa; */
381386
unsigned int hpa; /* HPA base address */
382387
/* char *spa; */
@@ -611,21 +616,6 @@ struct pdc_initiator { /* PDC_INITIATOR */
611616
int mode;
612617
};
613618

614-
struct hardware_path {
615-
char flags; /* see bit definitions below */
616-
char bc[6]; /* Bus Converter routing info to a specific */
617-
/* I/O adaptor (< 0 means none, > 63 resvd) */
618-
char mod; /* fixed field of specified module */
619-
};
620-
621-
/*
622-
* Device path specifications used by PDC.
623-
*/
624-
struct pdc_module_path {
625-
struct hardware_path path;
626-
unsigned int layers[6]; /* device-specific info (ctlr #, unit # ...) */
627-
};
628-
629619
/* Only used on some pre-PA2.0 boxes */
630620
struct pdc_memory_map { /* PDC_MEMORY_MAP */
631621
unsigned long hpa; /* mod's register set address */

arch/parisc/kernel/drivers.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -882,15 +882,13 @@ void __init walk_central_bus(void)
882882
&root);
883883
}
884884

885-
static void print_parisc_device(struct parisc_device *dev)
885+
static __init void print_parisc_device(struct parisc_device *dev)
886886
{
887-
char hw_path[64];
888-
static int count;
887+
static int count __initdata;
889888

890-
print_pa_hwpath(dev, hw_path);
891-
pr_info("%d. %s at %pap [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
892-
++count, dev->name, &(dev->hpa.start), hw_path, dev->id.hw_type,
893-
dev->id.hversion_rev, dev->id.hversion, dev->id.sversion);
889+
pr_info("%d. %s at %pap { type:%d, hv:%#x, sv:%#x, rev:%#x }",
890+
++count, dev->name, &(dev->hpa.start), dev->id.hw_type,
891+
dev->id.hversion, dev->id.sversion, dev->id.hversion_rev);
894892

895893
if (dev->num_addrs) {
896894
int k;
@@ -1079,7 +1077,7 @@ static __init int qemu_print_iodc_data(struct device *lin_dev, void *data)
10791077

10801078

10811079

1082-
static int print_one_device(struct device * dev, void * data)
1080+
static __init int print_one_device(struct device * dev, void * data)
10831081
{
10841082
struct parisc_device * pdev = to_parisc_device(dev);
10851083

drivers/parisc/iosapic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,7 @@ int iosapic_serial_irq(struct parisc_device *dev)
866866

867867
return vi->txn_irq;
868868
}
869+
EXPORT_SYMBOL(iosapic_serial_irq);
869870
#endif
870871

871872

drivers/parisc/pdc_stable.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* all) PA-RISC machines should have them. Anyway, for safety reasons, the
1515
* following code can deal with just 96 bytes of Stable Storage, and all
1616
* sizes between 96 and 192 bytes (provided they are multiple of struct
17-
* device_path size, eg: 128, 160 and 192) to provide full information.
17+
* pdc_module_path size, eg: 128, 160 and 192) to provide full information.
1818
* One last word: there's one path we can always count on: the primary path.
1919
* Anything above 224 bytes is used for 'osdep2' OS-dependent storage area.
2020
*
@@ -88,7 +88,7 @@ struct pdcspath_entry {
8888
short ready; /* entry record is valid if != 0 */
8989
unsigned long addr; /* entry address in stable storage */
9090
char *name; /* entry name */
91-
struct device_path devpath; /* device path in parisc representation */
91+
struct pdc_module_path devpath; /* device path in parisc representation */
9292
struct device *dev; /* corresponding device */
9393
struct kobject kobj;
9494
};
@@ -138,7 +138,7 @@ struct pdcspath_attribute paths_attr_##_name = { \
138138
static int
139139
pdcspath_fetch(struct pdcspath_entry *entry)
140140
{
141-
struct device_path *devpath;
141+
struct pdc_module_path *devpath;
142142

143143
if (!entry)
144144
return -EINVAL;
@@ -153,7 +153,7 @@ pdcspath_fetch(struct pdcspath_entry *entry)
153153
return -EIO;
154154

155155
/* Find the matching device.
156-
NOTE: hardware_path overlays with device_path, so the nice cast can
156+
NOTE: hardware_path overlays with pdc_module_path, so the nice cast can
157157
be used */
158158
entry->dev = hwpath_to_device((struct hardware_path *)devpath);
159159

@@ -179,7 +179,7 @@ pdcspath_fetch(struct pdcspath_entry *entry)
179179
static void
180180
pdcspath_store(struct pdcspath_entry *entry)
181181
{
182-
struct device_path *devpath;
182+
struct pdc_module_path *devpath;
183183

184184
BUG_ON(!entry);
185185

@@ -221,7 +221,7 @@ static ssize_t
221221
pdcspath_hwpath_read(struct pdcspath_entry *entry, char *buf)
222222
{
223223
char *out = buf;
224-
struct device_path *devpath;
224+
struct pdc_module_path *devpath;
225225
short i;
226226

227227
if (!entry || !buf)
@@ -236,11 +236,11 @@ pdcspath_hwpath_read(struct pdcspath_entry *entry, char *buf)
236236
return -ENODATA;
237237

238238
for (i = 0; i < 6; i++) {
239-
if (devpath->bc[i] >= 128)
239+
if (devpath->path.bc[i] < 0)
240240
continue;
241-
out += sprintf(out, "%u/", (unsigned char)devpath->bc[i]);
241+
out += sprintf(out, "%d/", devpath->path.bc[i]);
242242
}
243-
out += sprintf(out, "%u\n", (unsigned char)devpath->mod);
243+
out += sprintf(out, "%u\n", (unsigned char)devpath->path.mod);
244244

245245
return out - buf;
246246
}
@@ -296,12 +296,12 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun
296296
for (i=5; ((temp = strrchr(in, '/'))) && (temp-in > 0) && (likely(i)); i--) {
297297
hwpath.bc[i] = simple_strtoul(temp+1, NULL, 10);
298298
in[temp-in] = '\0';
299-
DPRINTK("%s: bc[%d]: %d\n", __func__, i, hwpath.bc[i]);
299+
DPRINTK("%s: bc[%d]: %d\n", __func__, i, hwpath.path.bc[i]);
300300
}
301301

302302
/* Store the final field */
303303
hwpath.bc[i] = simple_strtoul(in, NULL, 10);
304-
DPRINTK("%s: bc[%d]: %d\n", __func__, i, hwpath.bc[i]);
304+
DPRINTK("%s: bc[%d]: %d\n", __func__, i, hwpath.path.bc[i]);
305305

306306
/* Now we check that the user isn't trying to lure us */
307307
if (!(dev = hwpath_to_device((struct hardware_path *)&hwpath))) {
@@ -342,7 +342,7 @@ static ssize_t
342342
pdcspath_layer_read(struct pdcspath_entry *entry, char *buf)
343343
{
344344
char *out = buf;
345-
struct device_path *devpath;
345+
struct pdc_module_path *devpath;
346346
short i;
347347

348348
if (!entry || !buf)
@@ -547,7 +547,7 @@ static ssize_t pdcs_auto_read(struct kobject *kobj,
547547
pathentry = &pdcspath_entry_primary;
548548

549549
read_lock(&pathentry->rw_lock);
550-
out += sprintf(out, "%s\n", (pathentry->devpath.flags & knob) ?
550+
out += sprintf(out, "%s\n", (pathentry->devpath.path.flags & knob) ?
551551
"On" : "Off");
552552
read_unlock(&pathentry->rw_lock);
553553

@@ -594,8 +594,8 @@ static ssize_t pdcs_timer_read(struct kobject *kobj,
594594

595595
/* print the timer value in seconds */
596596
read_lock(&pathentry->rw_lock);
597-
out += sprintf(out, "%u\n", (pathentry->devpath.flags & PF_TIMER) ?
598-
(1 << (pathentry->devpath.flags & PF_TIMER)) : 0);
597+
out += sprintf(out, "%u\n", (pathentry->devpath.path.flags & PF_TIMER) ?
598+
(1 << (pathentry->devpath.path.flags & PF_TIMER)) : 0);
599599
read_unlock(&pathentry->rw_lock);
600600

601601
return out - buf;
@@ -764,7 +764,7 @@ static ssize_t pdcs_auto_write(struct kobject *kobj,
764764

765765
/* Be nice to the existing flag record */
766766
read_lock(&pathentry->rw_lock);
767-
flags = pathentry->devpath.flags;
767+
flags = pathentry->devpath.path.flags;
768768
read_unlock(&pathentry->rw_lock);
769769

770770
DPRINTK("%s: flags before: 0x%X\n", __func__, flags);
@@ -785,7 +785,7 @@ static ssize_t pdcs_auto_write(struct kobject *kobj,
785785
write_lock(&pathentry->rw_lock);
786786

787787
/* Change the path entry flags first */
788-
pathentry->devpath.flags = flags;
788+
pathentry->devpath.path.flags = flags;
789789

790790
/* Now, dive in. Write back to the hardware */
791791
pdcspath_store(pathentry);

drivers/tty/serial/8250/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ config SERIAL_8250_CONSOLE
116116

117117
If unsure, say N.
118118

119-
config SERIAL_8250_GSC
119+
config SERIAL_8250_PARISC
120120
tristate
121-
depends on SERIAL_8250 && GSC
121+
depends on SERIAL_8250 && PARISC
122122
default SERIAL_8250
123123

124124
config SERIAL_8250_DMA

drivers/tty/serial/8250/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ obj-$(CONFIG_SERIAL_8250) += 8250.o 8250_base.o
1212
8250_base-$(CONFIG_SERIAL_8250_DMA) += 8250_dma.o
1313
8250_base-$(CONFIG_SERIAL_8250_DWLIB) += 8250_dwlib.o
1414
8250_base-$(CONFIG_SERIAL_8250_FINTEK) += 8250_fintek.o
15-
obj-$(CONFIG_SERIAL_8250_GSC) += 8250_gsc.o
15+
obj-$(CONFIG_SERIAL_8250_PARISC) += 8250_parisc.o
1616
obj-$(CONFIG_SERIAL_8250_PCI) += 8250_pci.o
1717
obj-$(CONFIG_SERIAL_8250_EXAR) += 8250_exar.o
1818
obj-$(CONFIG_SERIAL_8250_HP300) += 8250_hp300.o

0 commit comments

Comments
 (0)