source: trunk/package/ifxmips-dsl-api/patches/200-mei_compat.patch @ 20463

Last change on this file since 20463 was 20463, checked in by juhosg, 7 years ago

package/ifxmips-dsl-api: refresh patches

File size: 3.2 KB
  • src/mei/ifxmips_mei.c

    a b  
    4141#include <linux/init.h> 
    4242#include <linux/ioport.h> 
    4343#include <linux/delay.h> 
     44#include <linux/device.h> 
     45#include <linux/sched.h> 
    4446#include <asm/uaccess.h> 
    4547#include <asm/hardirq.h> 
    46 #include <asm/ifx/ifx_regs.h> 
    47 #include <asm/ifx/irq.h> 
    48 #include <asm/ifx/ifx_gpio.h> 
    49 //#include <asm/ifx/ifx_led.h> 
    50 #include <asm/ifx/ifx_pmu.h> 
    51 #include <asm/ifx/ifx_atm.h> 
     48 
     49#include <ifxmips.h> 
     50#include <ifxmips_irq.h> 
     51#include <ifxmips_gpio.h> 
     52#include <ifxmips_pmu.h> 
     53#include "ifxmips_atm.h" 
    5254#define IFX_MEI_BSP 
    5355#include "ifxmips_mei_interface.h" 
    5456 
    55 #define IFXMIPS_RCU_RST                   IFX_RCU_RST_REQ 
     57/*#define IFXMIPS_RCU_RST                   IFX_RCU_RST_REQ 
    5658#define IFXMIPS_RCU_RST_REQ_ARC_JTAG      IFX_RCU_RST_REQ_ARC_JTAG 
    5759#define IFXMIPS_RCU_RST_REQ_DFE           IFX_RCU_RST_REQ_DFE 
    5860#define IFXMIPS_RCU_RST_REQ_AFE           IFX_RCU_RST_REQ_AFE 
     
    7678#define ifxmips_r32(reg)                        __raw_readl(reg) 
    7779#define ifxmips_w32(val, reg)                   __raw_writel(val, reg) 
    7880#define ifxmips_w32_mask(clear, set, reg)       ifxmips_w32((ifxmips_r32(reg) & ~clear) | set, reg) 
    79  
     81*/ 
    8082#define IFX_MEI_EMSG(fmt, args...) printk(KERN_ERR  "[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args) 
    8183#define IFX_MEI_DMSG(fmt, args...) printk(KERN_INFO "[%s %d]: " fmt,__FUNCTION__, __LINE__, ## args) 
    8284 
    static u32 *mei_arc_swap_buff = NULL; // 
    173175extern void ifxmips_mask_and_ack_irq(unsigned int irq_nr); 
    174176#define MEI_MASK_AND_ACK_IRQ ifxmips_mask_and_ack_irq 
    175177 
    176 static int dev_major = 105; 
     178#define MEI_MAJOR       105 
     179static int dev_major = MEI_MAJOR; 
    177180 
    178181static struct file_operations bsp_mei_operations = { 
    179182      owner:THIS_MODULE, 
    IFX_MEI_InitDevice (int num) 
    22942297                IFX_MEI_EMSG ("request_irq %d failed!\n", pDev->nIrq[IFX_DFEIR]); 
    22952298                return -1; 
    22962299        } 
    2297         if (request_irq (pDev->nIrq[IFX_DYING_GASP], IFX_MEI_Dying_Gasp_IrqHandle, 0, "DYING_GASP", pDev) != 0) { 
     2300        /*if (request_irq (pDev->nIrq[IFX_DYING_GASP], IFX_MEI_Dying_Gasp_IrqHandle, 0, "DYING_GASP", pDev) != 0) { 
    22982301                IFX_MEI_EMSG ("request_irq %d failed!\n", pDev->nIrq[IFX_DYING_GASP]); 
    22992302                return -1; 
    2300         } 
     2303        }*/ 
    23012304//      IFX_MEI_DMSG("Device %d initialized. IER %#x\n", num, bsp_get_irq_ier(pDev->nIrq[IFX_DYING_GASP])); 
    23022305        return 0; 
    23032306} 
    int __init 
    29222925IFX_MEI_ModuleInit (void) 
    29232926{ 
    29242927        int i = 0; 
     2928        static struct class *dsl_class; 
    29252929 
    29262930        printk ("IFX MEI Version %ld.%02ld.%02ld", bsp_mei_version.major, bsp_mei_version.minor, bsp_mei_version.revision); 
    29272931 
    IFX_MEI_ModuleInit (void) 
    29352939                IFX_MEI_InitProcFS (i); 
    29362940#endif 
    29372941        } 
    2938         for (i = 0; i <= DSL_BSP_CB_LAST ; i++) 
     2942                for (i = 0; i <= DSL_BSP_CB_LAST ; i++) 
    29392943                dsl_bsp_event_callback[i].function = NULL; 
    29402944 
    29412945#ifdef CONFIG_IFXMIPS_MEI_FW_LOOPBACK 
    29422946        printk(KERN_INFO "[%s %s %d]: Start loopback test...\n", __FILE__, __func__, __LINE__); 
    29432947        DFE_Loopback_Test (); 
    29442948#endif 
    2945  
     2949        dsl_class = class_create(THIS_MODULE, "ifx_mei"); 
     2950        device_create(dsl_class, NULL, MKDEV(MEI_MAJOR, 0), NULL, "ifx_mei"); 
    29462951        return 0; 
    29472952} 
    29482953 
    EXPORT_SYMBOL (DSL_BSP_EventCBUnregister 
    29963001 
    29973002module_init (IFX_MEI_ModuleInit); 
    29983003module_exit (IFX_MEI_ModuleExit); 
     3004 
     3005MODULE_LICENSE("Dual BSD/GPL"); 
Note: See TracBrowser for help on using the repository browser.