Commit d2b63918 authored by Ramesh Gupta's avatar Ramesh Gupta Committed by Hari Kanigeri

OMAP4 Syslink dispatcher code format fix

This patch fixes coding style issues and compile
time warnings.
Signed-off-by: default avatarRamesh Gupta G <grgupta@ti.com>
parent 2a1e2f6f
......@@ -154,9 +154,9 @@ extern long hw_mbox_msg_read(
*
*/
extern long hw_mbox_msg_write(
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const unsigned long write_value
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const unsigned long write_value
);
/*
......
......@@ -53,7 +53,7 @@ irqreturn_t notify_mailbx0_user0_isr(int temp, void *anArg, struct pt_regs *p);
/*
*func ntfy_disp_bind_interrupt
*
*
* desc Bind an ISR to the HW interrupt line coming into the processor
*/
int ntfy_disp_bind_interrupt(int interrupt_no,
......@@ -63,7 +63,7 @@ int ntfy_disp_bind_interrupt(int interrupt_no,
/*
* desc Print the mailbox registers and other useful debug information
*
*
*/
void ntfy_disp_debug(void);
......@@ -148,7 +148,7 @@ int ntfy_disp_unregister(unsigned long int mbox_module_no,
/*
* func notify_mailbx0_user0_isr
* desc mail ISR
* desc mail ISR
*
*/
......
/* ===========================================================================
File hw_mbox.c
Path $ (PROJROOT)\driver\mailbox
Desc HAL Mailbox messaging & configuration API definitions
Rev 0.1.0
This computer program is copyright to Texas Instruments Incorporated.
The program may not be used without the written permission of
Texas Instruments Incorporated or against the terms and conditions
stipulated in the agreement under which this program has been supplied.
(c) Texas Instruments Incorporated 2008
===========================================================================
*/
/* ============================================================================
* STANDARD INCLUDE FILES
* =============================================================================
/*
* hw_mbox.c
*
* Syslink dispatcher driver support for OMAP Processors.
*
* Copyright (C) 2008-2009 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.
*/
/* ============================================================================
* PROJECT SPECIFIC INCLUDE FILES
* =============================================================================
*/
#include <syslink/GlobalTypes.h>
#include <syslink/MBXRegAcM.h>
#include <syslink/MBXAccInt.h>
#include <syslink/hw_defs.h>
#include <syslink/hw_mbox.h>
#include<linux/module.h>
MODULE_LICENSE("GPL");
/* ============================================================================
* GLOBAL VARIABLES DECLARATIONS
* =============================================================================
*/
/* ============================================================================
* LOCAL TYPES AND DEFINITIONS
* =============================================================================
*/
/* ============================================================================
* LOCAL VARIABLES DECLARATIONS
* =============================================================================
*/
/* ============================================================================
* LOCAL FUNCTIONS PROTOTYPES
* =============================================================================
*/
/* ============================================================================
* FUNCTIONS
* =============================================================================
*/
#if defined(OMAP3430)
struct mailbox_context mboxsetting = {0, 0, 0};
/*
* ======== HAL_MBOX_saveSettings ========
* purpose:
* Saves the mailbox context
* func: HAL_MBOX_saveSettings
* purpose:
* Saves the mailbox context
*/
long hw_mbox_save_settings(unsigned long base_address)
{
......@@ -81,12 +46,10 @@ long hw_mbox_save_settings(unsigned long base_address)
return status;
}
/* ==================== Function Separator =============================*/
/*
* ======== HAL_MBOX_restoreSettings ========
* purpose:
* Restores the mailbox context
* func:HAL_MBOX_restoreSettings
* purpose:
* Restores the mailbox context
*/
long hw_mbox_restore_settings(unsigned long base_address)
{
......@@ -108,8 +71,8 @@ EXPORT_SYMBOL(hw_mbox_restore_settings);
#endif
long hw_mbox_msg_read(
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
unsigned long *const p_read_value
)
{
......@@ -133,24 +96,21 @@ long hw_mbox_msg_read(
return status;
}
EXPORT_SYMBOL(hw_mbox_msg_read);
/* ==================== Function Separator =============================*/
long hw_mbox_msg_write(const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const unsigned long write_value)
const unsigned long write_value)
{
long status = RET_OK;
/* Check input parameters */
CHECK_INPUT_PARAM(base_address, 0, RET_BAD_NULL_PARAM,
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
CHECK_INPUT_RANGE_MIN0(mail_box_id,
HAL_MBOX_ID_MAX,
RET_INVALID_ID,
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
/* Write 32-bit value to mailbox */
MLBMAILBOX_MESSAGE___0_15WriteRegister32(base_address,
(unsigned long)mail_box_id, (unsigned long)write_value);
......@@ -158,8 +118,6 @@ long hw_mbox_msg_write(const unsigned long base_address,
return status;
}
/* ==================== Function Separator =============================*/
long hw_mbox_is_full(
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
......@@ -190,11 +148,9 @@ long hw_mbox_is_full(
return status;
}
/* ==================== Function Separator =============================*/
long hw_mbox_nomsg_get(
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
unsigned long *const p_num_msg
)
{
......@@ -218,13 +174,12 @@ long hw_mbox_nomsg_get(
return status;
}
EXPORT_SYMBOL(hw_mbox_nomsg_get);
/* ==================== Function Separator =============================*/
long hw_mbox_event_enable(
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const enum hw_mbox_userid_t user_id,
const unsigned long events
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const enum hw_mbox_userid_t user_id,
const unsigned long events
)
{
long status = RET_OK;
......@@ -249,12 +204,12 @@ long hw_mbox_event_enable(
RET_INVALID_ID,
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
#if defined(OMAP44XX) || defined(VPOM4430_1_06)
/* update enable value */
irqEnableReg = (((unsigned long)(events)) <<
/* update enable value */
irqEnableReg = (((unsigned long)(events)) <<
(((unsigned long)(mail_box_id))*HW_MBOX_ID_WIDTH));
/* write new enable status */
MLBMAILBOX_IRQENABLE_SET___0_3WriteRegister32(base_address,
/* write new enable status */
MLBMAILBOX_IRQENABLE_SET___0_3WriteRegister32(base_address,
(unsigned long)user_id, (unsigned long)irqEnableReg);
......@@ -275,17 +230,15 @@ long hw_mbox_event_enable(
}
EXPORT_SYMBOL(hw_mbox_event_enable);
/* ==================== Function Separator =============================*/
long hw_mbox_event_disable(
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const enum hw_mbox_userid_t user_id,
const unsigned long events
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const enum hw_mbox_userid_t user_id,
const unsigned long events
)
{
long status = RET_OK;
unsigned long irqDisableReg;
unsigned long irqDisableReg;
/* Check input parameters */
CHECK_INPUT_PARAM(base_address, 0, RET_BAD_NULL_PARAM,
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
......@@ -307,11 +260,11 @@ long hw_mbox_event_disable(
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
#if defined(OMAP44XX) || defined(VPOM4430_1_06)
irqDisableReg = (((unsigned long)(events)) <<
irqDisableReg = (((unsigned long)(events)) <<
(((unsigned long)(mail_box_id))*HW_MBOX_ID_WIDTH));
/* write new enable status */
MLBMAILBOX_IRQENABLE_CLR___0_3WriteRegister32(base_address,
/* write new enable status */
MLBMAILBOX_IRQENABLE_CLR___0_3WriteRegister32(base_address,
(unsigned long)user_id, (unsigned long)irqDisableReg);
#else
......@@ -331,12 +284,10 @@ long hw_mbox_event_disable(
}
EXPORT_SYMBOL(hw_mbox_event_disable);
/* ==================== Function Separator =============================*/
long hw_mbox_event_status(
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const enum hw_mbox_userid_t user_id,
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const enum hw_mbox_userid_t user_id,
unsigned long *const p_eventStatus)
{
long status = RET_OK;
......@@ -360,8 +311,8 @@ long hw_mbox_event_status(
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
#if defined(OMAP44XX) || defined(VPOM4430_1_06)
irq_status_reg = MLBMAILBOX_IRQSTATUS_CLR___0_3ReadRegister32(base_address,
(unsigned long)user_id);
irq_status_reg = MLBMAILBOX_IRQSTATUS_CLR___0_3ReadRegister32(
base_address, (unsigned long)user_id);
#else
/* Get Irq Status for specified mailbox/User Id */
irq_status_reg = MLBMAILBOX_IRQSTATUS___0_3ReadRegister32
......@@ -376,21 +327,18 @@ long hw_mbox_event_status(
return status;
}
/* ==================== Function Separator =============================*/
long hw_mbox_event_ack(
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id,
const enum hw_mbox_userid_t user_id,
const unsigned long event
const unsigned long event
)
{
long status = RET_OK;
unsigned long irq_status_reg;
unsigned long irq_status_reg;
/* Check input parameters */
CHECK_INPUT_PARAM(base_address, 0, RET_BAD_NULL_PARAM,
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
CHECK_INPUT_RANGE_MIN0(
irqStatus,
HAL_MBOX_INT_MAX,
......@@ -406,15 +354,13 @@ long hw_mbox_event_ack(
HAL_MBOX_USER_MAX,
RET_INVALID_ID,
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
/* calculate status to write */
irq_status_reg = ((unsigned long)event) <<
(((unsigned long)(mail_box_id))*HW_MBOX_ID_WIDTH);
#if defined(OMAP44XX) || defined(VPOM4430_1_06)
/* clear Irq Status for specified mailbox/User Id */
MLBMAILBOX_IRQSTATUS_CLR___0_3WriteRegister32(base_address,
/* clear Irq Status for specified mailbox/User Id */
MLBMAILBOX_IRQSTATUS_CLR___0_3WriteRegister32(base_address,
(unsigned long)user_id, (unsigned long)irq_status_reg);
#else
......
/*===========================================================================
File hal_ocp.c
/*
* hw_ocp.c
*
* Syslink dispatcher driver support for OMAP Processors.
*
* Copyright (C) 2008-2009 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.
*/
Path $(PROJROOT)\driver\mailbox
Desc API definitions to setup OCP Socket system registers
Rev 0.1.0
This computer program is copyright to Texas Instruments Incorporated.
The program may not be used without the written permission of
Texas Instruments Incorporated or against the terms and conditions
stipulated in the agreement under which this program has been supplied.
(c) Texas Instruments Incorporated 2008
===========================================================================
*/
/*============================================================================
*STANDARD INCLUDE FILES
*=============================================================================
*/
/*============================================================================
*PROJECT SPECIFIC INCLUDE FILES
*=============================================================================
*/
#include <syslink/GlobalTypes.h>
#include <syslink/hw_ocp.h>
#include <syslink/hw_defs.h>
#include <syslink/MBXRegAcM.h>
#include <syslink/MBXAccInt.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");
/*============================================================================
*GLOBAL VARIABLES DECLARATIONS
*=============================================================================
*/
/*============================================================================
*LOCAL TYPES AND DEFINITIONS
*=============================================================================
*/
/*============================================================================
*LOCAL VARIABLES DECLARATIONS
*=============================================================================
*/
/*============================================================================
*LOCAL FUNCTIONS PROTOTYPES
*=============================================================================
*/
/*============================================================================
*EXPORTED FUNCTIONS
*=============================================================================
*/
long hw_ocp_soft_reset(const unsigned long base_address)
{
long status = RET_OK;
MLBMAILBOX_SYSCONFIGSoftResetWrite32(base_address, HW_SET);
return status;
long status = RET_OK;
MLBMAILBOX_SYSCONFIGSoftResetWrite32(base_address, HW_SET);
return status;
}
long hw_ocp_soft_reset_isdone(const unsigned long base_address,
unsigned long *reset_is_done)
{
long status = RET_OK;
long status = RET_OK;
*reset_is_done = MLBMAILBOX_SYSSTATUSResetDoneRead32(base_address);
*reset_is_done = MLBMAILBOX_SYSSTATUSResetDoneRead32(base_address);
return status;
return status;
}
long hw_ocp_idle_modeset(const unsigned long base_address,
enum hal_ocp_idlemode_t idle_mode)
{
long status = RET_OK;
long status = RET_OK;
MLBMAILBOX_SYSCONFIGSIdleModeWrite32(base_address, idle_mode);
MLBMAILBOX_SYSCONFIGSIdleModeWrite32(base_address, idle_mode);
return status;
return status;
}
long hw_ocp_idlemode_get(const unsigned long base_address,
enum hal_ocp_idlemode_t *idle_mode)
{
long status = RET_OK;
long status = RET_OK;
*idle_mode = (enum hal_ocp_idlemode_t)
*idle_mode = (enum hal_ocp_idlemode_t)
MLBMAILBOX_SYSCONFIGSIdleModeRead32(base_address);
return status;
return status;
}
long hw_ocp_autoidle_set(const unsigned long base_address,
enum hw_set_clear_t auto_idle)
{
long status = RET_OK;
long status = RET_OK;
MLBMAILBOX_SYSCONFIGAutoIdleWrite32(base_address, auto_idle);
MLBMAILBOX_SYSCONFIGAutoIdleWrite32(base_address, auto_idle);
return status;
return status;
}
long hw_ocp_autoidle_get(const unsigned long base_address,
enum hw_set_clear_t *auto_idle)
{
long status = RET_OK;
long status = RET_OK;
*auto_idle = (enum hw_set_clear_t)
*auto_idle = (enum hw_set_clear_t)
MLBMAILBOX_SYSCONFIGAutoIdleRead32(base_address);
return status;
return status;
}
/*============================================================================
*LOCAL FUNCTIONS
*=============================================================================
*/
......@@ -289,10 +289,10 @@ int ntfy_disp_read(unsigned long int mbox_module_no,
}
/*Read a single message */
hw_mbox_nomsg_get(mailbx_hw_config.mbox_linear_addr ,
(enum hw_mbox_id_t)a_mbox_no, num_messages);
(enum hw_mbox_id_t)a_mbox_no, (unsigned long *const)num_messages);
if (*num_messages > 0) {
hw_mbox_msg_read(mailbx_hw_config.mbox_linear_addr,
(enum hw_mbox_id_t)a_mbox_no, messages);
(enum hw_mbox_id_t)a_mbox_no, (unsigned long *const)messages);
} else
status = -EBUSY;
func_end:
......@@ -314,8 +314,7 @@ int ntfy_disp_register(unsigned long int mbox_module_no,
i_mbox_module_no = mbox_module_no;
i_a_irq_bit = a_irq_bit;
/*Validate the parameters */
/*Validate the parameters */
if (mbox_module_no > mailbx_hw_config.mbox_modules) {
status = -EINVAL;
goto func_end;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment