cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

ipmi_si_parisc.c (1363B)


      1// SPDX-License-Identifier: GPL-2.0+
      2
      3#include <linux/module.h>
      4#include <asm/hardware.h>	/* for register_parisc_driver() stuff */
      5#include <asm/parisc-device.h>
      6#include "ipmi_si.h"
      7
      8static bool parisc_registered;
      9
     10static int __init ipmi_parisc_probe(struct parisc_device *dev)
     11{
     12	struct si_sm_io io;
     13
     14	memset(&io, 0, sizeof(io));
     15
     16	io.si_type	= SI_KCS;
     17	io.addr_source	= SI_DEVICETREE;
     18	io.addr_space	= IPMI_MEM_ADDR_SPACE;
     19	io.addr_data	= dev->hpa.start;
     20	io.regsize	= 1;
     21	io.regspacing	= 1;
     22	io.regshift	= 0;
     23	io.irq		= 0; /* no interrupt */
     24	io.irq_setup	= NULL;
     25	io.dev		= &dev->dev;
     26
     27	dev_dbg(&dev->dev, "addr 0x%lx\n", io.addr_data);
     28
     29	return ipmi_si_add_smi(&io);
     30}
     31
     32static void __exit ipmi_parisc_remove(struct parisc_device *dev)
     33{
     34	ipmi_si_remove_by_dev(&dev->dev);
     35}
     36
     37static const struct parisc_device_id ipmi_parisc_tbl[] __initconst = {
     38	{ HPHW_MC, HVERSION_REV_ANY_ID, 0x004, 0xC0 },
     39	{ 0, }
     40};
     41
     42MODULE_DEVICE_TABLE(parisc, ipmi_parisc_tbl);
     43
     44static struct parisc_driver ipmi_parisc_driver __refdata = {
     45	.name =		"ipmi",
     46	.id_table =	ipmi_parisc_tbl,
     47	.probe =	ipmi_parisc_probe,
     48	.remove =	__exit_p(ipmi_parisc_remove),
     49};
     50
     51void ipmi_si_parisc_init(void)
     52{
     53	register_parisc_driver(&ipmi_parisc_driver);
     54	parisc_registered = true;
     55}
     56
     57void ipmi_si_parisc_shutdown(void)
     58{
     59	if (parisc_registered)
     60		unregister_parisc_driver(&ipmi_parisc_driver);
     61}