1 // SPDX-License-Identifier: GPL-2.0-or-later
4 ** HP-PB bus driver for the NOVA and K-Class systems.
6 ** (c) Copyright 2002 Ryan Bradetich
7 ** (c) Copyright 2002 Hewlett-Packard Company
12 #include <linux/types.h>
13 #include <linux/init.h>
15 #include <linux/slab.h>
16 #include <linux/dma-mapping.h>
17 #include <linux/ioport.h>
20 #include <asm/hardware.h>
21 #include <asm/parisc-device.h>
27 struct resource mmio_region
;
28 struct hppb_card
*next
;
31 static struct hppb_card hppb_card_head
= {
36 #define IO_IO_LOW offsetof(struct bc_module, io_io_low)
37 #define IO_IO_HIGH offsetof(struct bc_module, io_io_high)
40 * hppb_probe - Determine if the hppb driver should claim this device.
41 * @dev: The device which has been found
43 * Determine if hppb driver should claim this chip (return 0) or not
44 * (return 1). If so, initialize the chip and tell other partners in crime
45 * they have work to do.
47 static int __init
hppb_probe(struct parisc_device
*dev
)
50 struct hppb_card
*card
= &hppb_card_head
;
57 card
->next
= kzalloc(sizeof(struct hppb_card
), GFP_KERNEL
);
59 printk(KERN_ERR
"HP-PB: Unable to allocate memory.\n");
65 card
->hpa
= dev
->hpa
.start
;
66 card
->mmio_region
.name
= "HP-PB Bus";
67 card
->mmio_region
.flags
= IORESOURCE_MEM
;
69 card
->mmio_region
.start
= gsc_readl(dev
->hpa
.start
+ IO_IO_LOW
);
70 card
->mmio_region
.end
= gsc_readl(dev
->hpa
.start
+ IO_IO_HIGH
) - 1;
72 status
= ccio_request_resource(dev
, &card
->mmio_region
);
74 pr_info("Found GeckoBoa at %pap, bus space %pR,%s claimed.\n",
77 (status
< 0) ? " not":"" );
82 static const struct parisc_device_id hppb_tbl
[] __initconst
= {
83 { HPHW_BCPORT
, HVERSION_REV_ANY_ID
, 0x500, 0xc }, /* E25 and K */
84 { HPHW_BCPORT
, 0x0, 0x501, 0xc }, /* E35 */
85 { HPHW_BCPORT
, 0x0, 0x502, 0xc }, /* E45 */
86 { HPHW_BCPORT
, 0x0, 0x503, 0xc }, /* E55 */
90 static struct parisc_driver hppb_driver __refdata
= {
97 * hppb_init - HP-PB bus initialization procedure.
99 * Register this driver.
101 void __init
hppb_init(void)
103 register_parisc_driver(&hppb_driver
);