Skip to content
Snippets Groups Projects
Select Git revision
  • a585d2b738bfa26326b3f1f40f0f1eda0c067ccf
  • add-v4l2-st-lt-ref-set-support-v3
  • add-vdpu381-and-383-to-rkvdec-v2
  • add-vdpu381-and-383-to-rkvdec
  • prepare-add-vdpu381-and-383-to-rkvdec
  • add-rkvdec2-driver-vdpu383-hevc
  • add-rkvdec2-driver-vdpu383
  • add-rkvdec2-driver-hevc
  • rkvdec-mov-to-structs
  • av1-fix-postproc-leak
  • add-rkvdec2-driver-iommu-422-10bits
  • patch-queue/jamba/trixie
  • hdmi-fix-1080p-rock4d-6.11
  • upstreaming/rk3576-rock4d-spi-v1
  • upstreaming/rk3576-rock4d-support-v5
  • upstreaming/rk3588-hdmi-audio-6
  • upstreaming/rk3576-rock4d-support-v3
  • upstreaming/rk3576-rock4d-support-v1
  • upstreaming/rk3576-rock4d-support
  • add-rkvdec2-driver-iommu
  • upstream/rk3576-rock-4d
  • v6.3
  • v6.3-rc1
  • v6.2-rc1
  • v6.0-rc1
  • v5.19-rc3
  • v5.19-rc2
  • v5.19-rc1
  • v5.18
  • v5.18-rc7
  • v5.18-rc6
  • v5.18-rc5
  • v5.18-rc4
  • v5.18-rc3
  • v5.18-rc2
  • v5.18-rc1
  • v5.17
  • v5.17-rc8
  • v5.17-rc7
  • v5.17-rc6
  • v5.17-rc5
41 results

intel_pmc_ipc.c

Blame
  • Forked from hardware-enablement / Rockchip upstream enablement efforts / linux
    Source project has a limited visibility.
    intel_pmc_ipc.c 17.71 KiB
    /*
     * intel_pmc_ipc.c: Driver for the Intel PMC IPC mechanism
     *
     * (C) Copyright 2014-2015 Intel Corporation
     *
     * This driver is based on Intel SCU IPC driver(intel_scu_opc.c) by
     *     Sreedhara DS <sreedhara.ds@intel.com>
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * as published by the Free Software Foundation; version 2
     * of the License.
     *
     * PMC running in ARC processor communicates with other entity running in IA
     * core through IPC mechanism which in turn messaging between IA core ad PMC.
     */
    
    #include <linux/module.h>
    #include <linux/delay.h>
    #include <linux/errno.h>
    #include <linux/init.h>
    #include <linux/device.h>
    #include <linux/pm.h>
    #include <linux/pci.h>
    #include <linux/platform_device.h>
    #include <linux/interrupt.h>
    #include <linux/pm_qos.h>
    #include <linux/kernel.h>
    #include <linux/bitops.h>
    #include <linux/sched.h>
    #include <linux/atomic.h>
    #include <linux/notifier.h>
    #include <linux/suspend.h>
    #include <linux/acpi.h>
    #include <asm/intel_pmc_ipc.h>
    #include <linux/mfd/lpc_ich.h>
    
    /*
     * IPC registers
     * The IA write to IPC_CMD command register triggers an interrupt to the ARC,
     * The ARC handles the interrupt and services it, writing optional data to
     * the IPC1 registers, updates the IPC_STS response register with the status.
     */
    #define IPC_CMD			0x0
    #define		IPC_CMD_MSI		0x100
    #define		IPC_CMD_SIZE		16
    #define		IPC_CMD_SUBCMD		12
    #define IPC_STATUS		0x04
    #define		IPC_STATUS_IRQ		0x4
    #define		IPC_STATUS_ERR		0x2
    #define		IPC_STATUS_BUSY		0x1
    #define IPC_SPTR		0x08
    #define IPC_DPTR		0x0C
    #define IPC_WRITE_BUFFER	0x80
    #define IPC_READ_BUFFER		0x90
    
    /*
     * 16-byte buffer for sending data associated with IPC command.
     */
    #define IPC_DATA_BUFFER_SIZE	16
    
    #define IPC_LOOP_CNT		3000000
    #define IPC_MAX_SEC		3
    
    #define IPC_TRIGGER_MODE_IRQ		true
    
    /* exported resources from IFWI */
    #define PLAT_RESOURCE_IPC_INDEX		0
    #define PLAT_RESOURCE_IPC_SIZE		0x1000
    #define PLAT_RESOURCE_GCR_SIZE		0x1000