deleted file mode 100644
@@ -1,248 +0,0 @@
-/*
- * hw_mbox.c
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Mailbox messaging & configuration API definitions
- *
- * Copyright (C) 2007 Texas Instruments, Inc.
- *
- * This package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#include <GlobalTypes.h>
-#include "MLBRegAcM.h"
-#include <hw_defs.h>
-#include <hw_mbox.h>
-
-/* width in bits of MBOX Id */
-#define HW_MBOX_ID_WIDTH 2
-
-/* SYSCONFIG: register bit definition */
-#define AUTOIDLE (1 << 0)
-#define SMARTIDLE (2 << 3)
-
-struct MAILBOX_CONTEXT mboxsetting = {
- .sysconfig = SMARTIDLE | AUTOIDLE,
-};
-
-HW_STATUS HW_MBOX_initSettings(void __iomem *baseAddress)
-{
- MLBMAILBOX_SYSCONFIGWriteRegister32(baseAddress, SMARTIDLE | AUTOIDLE);
- return RET_OK;
-}
-
-/* Saves the mailbox context */
-HW_STATUS HW_MBOX_saveSettings(void __iomem *baseAddress)
-{
- HW_STATUS status = RET_OK;
-
- mboxsetting.sysconfig = MLBMAILBOX_SYSCONFIGReadRegister32(baseAddress);
- /* Get current enable status */
- mboxsetting.irqEnable0 = MLBMAILBOX_IRQENABLE___0_3ReadRegister32
- (baseAddress, HW_MBOX_U0_ARM);
- mboxsetting.irqEnable1 = MLBMAILBOX_IRQENABLE___0_3ReadRegister32
- (baseAddress, HW_MBOX_U1_DSP1);
- return status;
-}
-
-/* Restores the mailbox context */
-HW_STATUS HW_MBOX_restoreSettings(void __iomem *baseAddress)
-{
- HW_STATUS status = RET_OK;
- /* Restor IRQ enable status */
- MLBMAILBOX_IRQENABLE___0_3WriteRegister32(baseAddress, HW_MBOX_U0_ARM,
- mboxsetting.irqEnable0);
- MLBMAILBOX_IRQENABLE___0_3WriteRegister32(baseAddress, HW_MBOX_U1_DSP1,
- mboxsetting.irqEnable1);
- /* Restore Sysconfig register */
- MLBMAILBOX_SYSCONFIGWriteRegister32(baseAddress, mboxsetting.sysconfig);
- return status;
-}
-
-/* Reads a u32 from the sub module message box Specified. if there are no
- * messages in the mailbox then and error is returned. */
-HW_STATUS HW_MBOX_MsgRead(const void __iomem *baseAddress,
- const HW_MBOX_Id_t mailBoxId, u32 *const pReadValue)
-{
- HW_STATUS status = RET_OK;
-
- /* Check input parameters */
- CHECK_INPUT_PARAM(baseAddress, 0, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
- RES_INVALID_INPUT_PARAM);
- CHECK_INPUT_PARAM(pReadValue, NULL, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
- RES_INVALID_INPUT_PARAM);
- CHECK_INPUT_RANGE_MIN0(mailBoxId, HW_MBOX_ID_MAX, RET_INVALID_ID,
- RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
-
- /* Read 32-bit message in mail box */
- *pReadValue = MLBMAILBOX_MESSAGE___0_15ReadRegister32(baseAddress,
- (u32)mailBoxId);
-
- return status;
-}
-
-/* Writes a u32 from the sub module message box Specified. */
-HW_STATUS HW_MBOX_MsgWrite(const void __iomem *baseAddress,
- const HW_MBOX_Id_t mailBoxId, const u32 writeValue)
-{
- HW_STATUS status = RET_OK;
-
- /* Check input parameters */
- CHECK_INPUT_PARAM(baseAddress, 0, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
- RES_INVALID_INPUT_PARAM);
- CHECK_INPUT_RANGE_MIN0(mailBoxId, HW_MBOX_ID_MAX, RET_INVALID_ID,
- RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
-
- /* Write 32-bit value to mailbox */
- MLBMAILBOX_MESSAGE___0_15WriteRegister32(baseAddress, (u32)mailBoxId,
- (u32)writeValue);
-
- return status;
-}
-
-/* Gets number of messages in a specified mailbox. */
-HW_STATUS HW_MBOX_NumMsgGet(const void __iomem *baseAddress,
- const HW_MBOX_Id_t mailBoxId, u32 *const pNumMsg)
-{
- HW_STATUS status = RET_OK;
-
- /* Check input parameters */
- CHECK_INPUT_PARAM(baseAddress, 0, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
- RES_INVALID_INPUT_PARAM);
- CHECK_INPUT_PARAM(pNumMsg, NULL, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
- RES_INVALID_INPUT_PARAM);
-
- CHECK_INPUT_RANGE_MIN0(mailBoxId, HW_MBOX_ID_MAX, RET_INVALID_ID,
- RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
-
- /* Get number of messages available for MailBox */
- *pNumMsg = MLBMAILBOX_MSGSTATUS___0_15NbOfMsgMBmRead32(baseAddress,
- (u32)mailBoxId);
-
- return status;
-}
-
-/* Enables the specified IRQ. */
-HW_STATUS HW_MBOX_EventEnable(const void __iomem *baseAddress,
- const HW_MBOX_Id_t mailBoxId,
- const HW_MBOX_UserId_t userId,
- const u32 events)
-{
- HW_STATUS status = RET_OK;
- u32 irqEnableReg;
-
- /* Check input parameters */
- CHECK_INPUT_PARAM(baseAddress, 0, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
- RES_INVALID_INPUT_PARAM);
- CHECK_INPUT_RANGE_MIN0(mailBoxId, HW_MBOX_ID_MAX, RET_INVALID_ID,
- RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
- CHECK_INPUT_RANGE_MIN0(enableIrq, HW_MBOX_INT_MAX, RET_INVALID_ID,
- RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
- CHECK_INPUT_RANGE_MIN0(userId, HW_MBOX_USER_MAX, RET_INVALID_ID,
- RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
-
- /* Get current enable status */
- irqEnableReg = MLBMAILBOX_IRQENABLE___0_3ReadRegister32(baseAddress,
- (u32)userId);
-
- /* update enable value */
- irqEnableReg |= ((u32)(events)) << (((u32)(mailBoxId)) *
- HW_MBOX_ID_WIDTH);
-
- /* write new enable status */
- MLBMAILBOX_IRQENABLE___0_3WriteRegister32(baseAddress, (u32)userId,
- (u32)irqEnableReg);
-
- mboxsetting.sysconfig = MLBMAILBOX_SYSCONFIGReadRegister32(baseAddress);
- /* Get current enable status */
- mboxsetting.irqEnable0 = MLBMAILBOX_IRQENABLE___0_3ReadRegister32
- (baseAddress, HW_MBOX_U0_ARM);
- mboxsetting.irqEnable1 = MLBMAILBOX_IRQENABLE___0_3ReadRegister32
- (baseAddress, HW_MBOX_U1_DSP1);
- return status;
-}
-
-/* Disables the specified IRQ. */
-HW_STATUS HW_MBOX_EventDisable(const void __iomem *baseAddress,
- const HW_MBOX_Id_t mailBoxId,
- const HW_MBOX_UserId_t userId,
- const u32 events)
-{
- HW_STATUS status = RET_OK;
- u32 irqDisableReg;
-
- /* Check input parameters */
- CHECK_INPUT_PARAM(baseAddress, 0, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
- RES_INVALID_INPUT_PARAM);
- CHECK_INPUT_RANGE_MIN0(mailBoxId, HW_MBOX_ID_MAX, RET_INVALID_ID,
- RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
- CHECK_INPUT_RANGE_MIN0(disableIrq, HW_MBOX_INT_MAX, RET_INVALID_ID,
- RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
- CHECK_INPUT_RANGE_MIN0(userId, HW_MBOX_USER_MAX, RET_INVALID_ID,
- RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
-
- /* Get current enable status */
- irqDisableReg = MLBMAILBOX_IRQENABLE___0_3ReadRegister32(baseAddress,
- (u32)userId);
-
- /* update enable value */
- irqDisableReg &= ~(((u32)(events)) << (((u32)(mailBoxId)) *
- HW_MBOX_ID_WIDTH));
-
- /* write new enable status */
- MLBMAILBOX_IRQENABLE___0_3WriteRegister32(baseAddress, (u32)userId,
- (u32)irqDisableReg);
-
- return status;
-}
-
-/* Sets the status of the specified IRQ. */
-HW_STATUS HW_MBOX_EventAck(const void __iomem *baseAddress,
- const HW_MBOX_Id_t mailBoxId, const HW_MBOX_UserId_t userId,
- const u32 event)
-{
- HW_STATUS status = RET_OK;
- u32 irqStatusReg;
-
- /* Check input parameters */
- CHECK_INPUT_PARAM(baseAddress, 0, RET_BAD_NULL_PARAM, RES_MBOX_BASE +
- RES_INVALID_INPUT_PARAM);
-
- CHECK_INPUT_RANGE_MIN0(irqStatus, HW_MBOX_INT_MAX, RET_INVALID_ID,
- RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
- CHECK_INPUT_RANGE_MIN0(mailBoxId, HW_MBOX_ID_MAX, RET_INVALID_ID,
- RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
- CHECK_INPUT_RANGE_MIN0(userId, HW_MBOX_USER_MAX, RET_INVALID_ID,
- RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
-
- /* calculate status to write */
- irqStatusReg = ((u32)event) << (((u32)(mailBoxId)) *
- HW_MBOX_ID_WIDTH);
-
- /* clear Irq Status for specified mailbox/User Id */
- MLBMAILBOX_IRQSTATUS___0_3WriteRegister32(baseAddress, (u32)userId,
- (u32)irqStatusReg);
-
- /*
- * FIXME: Replace all this custom register access with standard
- * __raw_read/write().
- *
- * FIXME: Replace all interrupt handlers with standard linux style
- * interrupt handlers.
- *
- * FIXME: Replace direct access to PRCM registers with omap standard
- * PRCM register access.
- *
- * Flush posted write for the irq status to avoid spurious interrupts.
- */
- MLBMAILBOX_IRQSTATUS___0_3ReadRegister32(baseAddress, (u32)userId);
-
- return status;
-}
deleted file mode 100644
@@ -1,326 +0,0 @@
-/*
- * hw_mbox.h
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * HW Mailbox API and types definitions
- *
- * Copyright (C) 2007 Texas Instruments, Inc.
- *
- * This package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#ifndef __MBOX_H
-#define __MBOX_H
-
-/* Bitmasks for Mailbox interrupt sources */
-#define HW_MBOX_INT_NEW_MSG 0x1
-#define HW_MBOX_INT_NOT_FULL 0x2
-#define HW_MBOX_INT_ALL 0x3
-
-/* Maximum number of messages that mailbox can hald at a time. */
-#define HW_MBOX_MAX_NUM_MESSAGES 4
-
-/* HW_MBOX_Id_t: Enumerated Type used to specify Mailbox Sub Module Id Number */
-typedef enum HW_MBOX_Id_label {
- HW_MBOX_ID_0,
- HW_MBOX_ID_1,
- HW_MBOX_ID_2,
- HW_MBOX_ID_3,
- HW_MBOX_ID_4,
- HW_MBOX_ID_5
-
-} HW_MBOX_Id_t, *pHW_MBOX_Id_t;
-
-/* HW_MBOX_UserId_t: Enumerated Type used to specify Mail box User Id */
-typedef enum HW_MBOX_UserId_label {
- HW_MBOX_U0_ARM,
- HW_MBOX_U1_DSP1,
- HW_MBOX_U2_DSP2,
- HW_MBOX_U3_ARM
-
-} HW_MBOX_UserId_t, *pHW_MBOX_UserId_t;
-
-/* Mailbox context settings */
-struct MAILBOX_CONTEXT {
- u32 sysconfig;
- u32 irqEnable0;
- u32 irqEnable1;
-};
-
-/*
-* FUNCTION : HW_MBOX_MsgRead
-*
-* INPUTS:
-*
-* Identifier : baseAddress
-* Type : const u32
-* Description : Base Address of instance of Mailbox module
-*
-* Identifier : mailBoxId
-* Type : const HW_MBOX_Id_t
-* Description : Mail Box Sub module Id to read
-*
-* OUTPUTS:
-*
-* Identifier : pReadValue
-* Type : u32 *const
-* Description : Value read from MailBox
-*
-* RETURNS:
-*
-* Type : ReturnCode_t
-* Description : RET_OK No errors occured
-* RET_BAD_NULL_PARAM Address/ptr Paramater was set to 0/NULL
-* RET_INVALID_ID Invalid Id used
-* RET_EMPTY Mailbox empty
-*
-* PURPOSE: : this function reads a u32 from the sub module message
-* box Specified. if there are no messages in the mailbox
-* then and error is returned.
-*/
-extern HW_STATUS HW_MBOX_MsgRead(const void __iomem *baseAddress,
- const HW_MBOX_Id_t mailBoxId,
- u32 *const pReadValue);
-
-/*
-* FUNCTION : HW_MBOX_MsgWrite
-*
-* INPUTS:
-*
-* Identifier : baseAddress
-* Type : const u32
-* Description : Base Address of instance of Mailbox module
-*
-* Identifier : mailBoxId
-* Type : const HW_MBOX_Id_t
-* Description : Mail Box Sub module Id to write
-*
-* Identifier : writeValue
-* Type : const u32
-* Description : Value to write to MailBox
-*
-* RETURNS:
-*
-* Type : ReturnCode_t
-* Description : RET_OK No errors occured
-* RET_BAD_NULL_PARAM Address/pointer Paramater was set to 0/NULL
-* RET_INVALID_ID Invalid Id used
-*
-* PURPOSE: : this function writes a u32 from the sub module message
-* box Specified.
-*/
-extern HW_STATUS HW_MBOX_MsgWrite(const void __iomem *baseAddress,
- const HW_MBOX_Id_t mailBoxId, const u32 writeValue);
-
-/*
-* FUNCTION : HW_MBOX_NumMsgGet
-*
-* INPUTS:
-*
-* Identifier : baseAddress
-* Type : const u32
-* Description : Base Address of instance of Mailbox module
-*
-* Identifier : mailBoxId
-* Type : const HW_MBOX_Id_t
-* Description : Mail Box Sub module Id to get num messages
-*
-* OUTPUTS:
-*
-* Identifier : pNumMsg
-* Type : u32 *const
-* Description : Number of messages in mailbox
-*
-* RETURNS:
-*
-* Type : ReturnCode_t
-* Description : RET_OK No errors occured
-* RET_BAD_NULL_PARAM Address/pointer Paramater was set to 0/NULL
-* RET_INVALID_ID Inavlid ID input at parameter
-*
-* PURPOSE: : this function gets number of messages in a specified mailbox.
-*/
-extern HW_STATUS HW_MBOX_NumMsgGet(const void __iomem *baseAddress,
- const HW_MBOX_Id_t mailBoxId, u32 *const pNumMsg);
-
-/*
-* FUNCTION : HW_MBOX_EventEnable
-*
-* INPUTS:
-*
-* Identifier : baseAddress
-* Type : const u32
-* RET_BAD_NULL_PARAM Address/pointer Paramater was set to 0/NULL
-*
-* Identifier : mailBoxId
-* Type : const HW_MBOX_Id_t
-* Description : Mail Box Sub module Id to enable
-*
-* Identifier : userId
-* Type : const HW_MBOX_UserId_t
-* Description : Mail box User Id to enable
-*
-* Identifier : enableIrq
-* Type : const u32
-* Description : Irq value to enable
-*
-* RETURNS:
-*
-* Type : ReturnCode_t
-* Description : RET_OK No errors occured
-* RET_BAD_NULL_PARAM A Pointer Paramater was set to NULL
-* RET_INVALID_ID Invalid Id used
-*
-* PURPOSE: : this function enables the specified IRQ.
-*/
-extern HW_STATUS HW_MBOX_EventEnable(const void __iomem *baseAddress,
- const HW_MBOX_Id_t mailBoxId,
- const HW_MBOX_UserId_t userId,
- const u32 events);
-
-/*
-* FUNCTION : HW_MBOX_EventDisable
-*
-* INPUTS:
-*
-* Identifier : baseAddress
-* Type : const u32
-* RET_BAD_NULL_PARAM Address/pointer Paramater was set to 0/NULL
-*
-* Identifier : mailBoxId
-* Type : const HW_MBOX_Id_t
-* Description : Mail Box Sub module Id to disable
-*
-* Identifier : userId
-* Type : const HW_MBOX_UserId_t
-* Description : Mail box User Id to disable
-*
-* Identifier : enableIrq
-* Type : const u32
-* Description : Irq value to disable
-*
-* RETURNS:
-*
-* Type : ReturnCode_t
-* Description : RET_OK No errors occured
-* RET_BAD_NULL_PARAM A Pointer Paramater was set to NULL
-* RET_INVALID_ID Invalid Id used
-*
-* PURPOSE: : this function disables the specified IRQ.
-*/
-extern HW_STATUS HW_MBOX_EventDisable(const void __iomem *baseAddress,
- const HW_MBOX_Id_t mailBoxId,
- const HW_MBOX_UserId_t userId,
- const u32 events);
-
-/*
-* FUNCTION : HW_MBOX_EventAck
-*
-* INPUTS:
-*
-* Identifier : baseAddress
-* Type : const u32
-* Description : Base Address of instance of Mailbox module
-*
-* Identifier : mailBoxId
-* Type : const HW_MBOX_Id_t
-* Description : Mail Box Sub module Id to set
-*
-* Identifier : userId
-* Type : const HW_MBOX_UserId_t
-* Description : Mail box User Id to set
-*
-* Identifier : irqStatus
-* Type : const u32
-* Description : The value to write IRQ status
-*
-* OUTPUTS:
-*
-* RETURNS:
-*
-* Type : ReturnCode_t
-* Description : RET_OK No errors occured
-* RET_BAD_NULL_PARAM Address Paramater was set to 0
-* RET_INVALID_ID Invalid Id used
-*
-* PURPOSE: : this function sets the status of the specified IRQ.
-*/
-extern HW_STATUS HW_MBOX_EventAck(const void __iomem *baseAddress,
- const HW_MBOX_Id_t mailBoxId,
- const HW_MBOX_UserId_t userId,
- const u32 event);
-
-/*
-* FUNCTION : HW_MBOX_initSettings
-*
-* INPUTS:
-*
-* Identifier : baseAddress
-* Type : const u32
-* Description : Base Address of instance of Mailbox module
-*
-*
-* RETURNS:
-*
-* Type : ReturnCode_t
-* Description : RET_OK No errors occured
-* RET_BAD_NULL_PARAM Address/pointer Paramater was set to 0/NULL
-* RET_INVALID_ID Invalid Id used
-* RET_EMPTY Mailbox empty
-*
-* PURPOSE: : This function initialize the mailbox configuration.
-*/
-extern HW_STATUS HW_MBOX_initSettings(void __iomem *baseAddres);
-
-/*
-* FUNCTION : HW_MBOX_saveSettings
-*
-* INPUTS:
-*
-* Identifier : baseAddress
-* Type : const u32
-* Description : Base Address of instance of Mailbox module
-*
-*
-* RETURNS:
-*
-* Type : ReturnCode_t
-* Description : RET_OK No errors occured
-* RET_BAD_NULL_PARAM Address/pointer Paramater was set to 0/NULL
-* RET_INVALID_ID Invalid Id used
-* RET_EMPTY Mailbox empty
-*
-* PURPOSE: : this function saves the context of mailbox
-*/
-extern HW_STATUS HW_MBOX_saveSettings(void __iomem *baseAddres);
-
-/*
-* FUNCTION : HW_MBOX_restoreSettings
-*
-* INPUTS:
-*
-* Identifier : baseAddress
-* Type : const u32
-* Description : Base Address of instance of Mailbox module
-*
-*
-* RETURNS:
-*
-* Type : ReturnCode_t
-* Description : RET_OK No errors occured
-* RET_BAD_NULL_PARAM Address/pointer Paramater was set to 0/NULL
-* RET_INVALID_ID Invalid Id used
-* RET_EMPTY Mailbox empty
-*
-* PURPOSE: : this function restores the context of mailbox
-*/
-extern HW_STATUS HW_MBOX_restoreSettings(void __iomem *baseAddres);
-
-#endif /* __MBOX_H */