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

cryp_irq.c (1251B)


      1// SPDX-License-Identifier: GPL-2.0-only
      2/*
      3 * Copyright (C) ST-Ericsson SA 2010
      4 * Author: Shujuan Chen <shujuan.chen@stericsson.com> for ST-Ericsson.
      5 * Author: Jonas Linde <jonas.linde@stericsson.com> for ST-Ericsson.
      6 * Author: Joakim Bech <joakim.xx.bech@stericsson.com> for ST-Ericsson.
      7 * Author: Berne Hebark <berne.herbark@stericsson.com> for ST-Ericsson.
      8 * Author: Niklas Hernaeus <niklas.hernaeus@stericsson.com> for ST-Ericsson.
      9 */
     10
     11#include <linux/kernel.h>
     12#include <linux/bitmap.h>
     13#include <linux/device.h>
     14
     15#include "cryp.h"
     16#include "cryp_p.h"
     17#include "cryp_irq.h"
     18#include "cryp_irqp.h"
     19
     20void cryp_enable_irq_src(struct cryp_device_data *device_data, u32 irq_src)
     21{
     22	u32 i;
     23
     24	dev_dbg(device_data->dev, "[%s]", __func__);
     25
     26	i = readl_relaxed(&device_data->base->imsc);
     27	i = i | irq_src;
     28	writel_relaxed(i, &device_data->base->imsc);
     29}
     30
     31void cryp_disable_irq_src(struct cryp_device_data *device_data, u32 irq_src)
     32{
     33	u32 i;
     34
     35	dev_dbg(device_data->dev, "[%s]", __func__);
     36
     37	i = readl_relaxed(&device_data->base->imsc);
     38	i = i & ~irq_src;
     39	writel_relaxed(i, &device_data->base->imsc);
     40}
     41
     42bool cryp_pending_irq_src(struct cryp_device_data *device_data, u32 irq_src)
     43{
     44	return (readl_relaxed(&device_data->base->mis) & irq_src) > 0;
     45}