Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205854
b: refs/heads/master
c: b301c85
h: refs/heads/master
v: v3
  • Loading branch information
Rene Sapiens authored and Greg Kroah-Hartman committed Jul 22, 2010
1 parent 40c96bf commit 409c163
Show file tree
Hide file tree
Showing 26 changed files with 167 additions and 164 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d9073abb7735dc7005a76835af055f4b6851586
refs/heads/master: b301c85803376ef997bd7802cd5f0e3e88d10ae8
28 changes: 14 additions & 14 deletions trunk/drivers/staging/tidspbridge/core/chnl_sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ int bridge_chnl_destroy(struct chnl_mgr *hchnl_mgr)
* purpose:
* Flushes all the outstanding data requests on a channel.
*/
int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 dwTimeOut)
int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 timeout)
{
int status = 0;
struct chnl_object *pchnl = (struct chnl_object *)chnl_obj;
Expand All @@ -488,7 +488,7 @@ int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 dwTimeOut)
struct chnl_ioc chnl_ioc_obj;
/* Check args: */
if (pchnl) {
if ((dwTimeOut == CHNL_IOCNOWAIT)
if ((timeout == CHNL_IOCNOWAIT)
&& CHNL_IS_OUTPUT(pchnl->chnl_mode)) {
status = -EINVAL;
} else {
Expand All @@ -509,7 +509,7 @@ int bridge_chnl_flush_io(struct chnl_object *chnl_obj, u32 dwTimeOut)
while (!LST_IS_EMPTY(pchnl->pio_requests) &&
DSP_SUCCEEDED(status)) {
status = bridge_chnl_get_ioc(chnl_obj,
dwTimeOut, &chnl_ioc_obj);
timeout, &chnl_ioc_obj);
if (DSP_FAILED(status))
continue;

Expand Down Expand Up @@ -566,7 +566,7 @@ int bridge_chnl_get_info(struct chnl_object *chnl_obj,
* I/O request.
* Note: Ensures Channel Invariant (see notes above).
*/
int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 dwTimeOut,
int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 timeout,
OUT struct chnl_ioc *pIOC)
{
int status = 0;
Expand All @@ -582,7 +582,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 dwTimeOut,
/* Check args: */
if (!pIOC || !pchnl) {
status = -EFAULT;
} else if (dwTimeOut == CHNL_IOCNOWAIT) {
} else if (timeout == CHNL_IOCNOWAIT) {
if (LST_IS_EMPTY(pchnl->pio_completions))
status = -EREMOTEIO;

Expand All @@ -597,12 +597,12 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 dwTimeOut,
goto func_end;

ioc.status = CHNL_IOCSTATCOMPLETE;
if (dwTimeOut !=
if (timeout !=
CHNL_IOCNOWAIT && LST_IS_EMPTY(pchnl->pio_completions)) {
if (dwTimeOut == CHNL_IOCINFINITE)
dwTimeOut = SYNC_INFINITE;
if (timeout == CHNL_IOCINFINITE)
timeout = SYNC_INFINITE;

stat_sync = sync_wait_on_event(pchnl->sync_event, dwTimeOut);
stat_sync = sync_wait_on_event(pchnl->sync_event, timeout);
if (stat_sync == -ETIME) {
/* No response from DSP */
ioc.status |= CHNL_IOCSTATTIMEOUT;
Expand Down Expand Up @@ -663,7 +663,7 @@ int bridge_chnl_get_ioc(struct chnl_object *chnl_obj, u32 dwTimeOut,
* value may be non-zero, we still have to set the event.
* Therefore, this optimization is taken out.
*
* if (dwTimeOut == CHNL_IOCNOWAIT) {
* if (timeout == CHNL_IOCNOWAIT) {
* ... ensure event is set..
* sync_set_event(pchnl->sync_event);
* } */
Expand Down Expand Up @@ -744,8 +744,8 @@ int bridge_chnl_get_mgr_info(struct chnl_mgr *hchnl_mgr, u32 uChnlID,
* ======== bridge_chnl_idle ========
* Idles a particular channel.
*/
int bridge_chnl_idle(struct chnl_object *chnl_obj, u32 dwTimeOut,
bool fFlush)
int bridge_chnl_idle(struct chnl_object *chnl_obj, u32 timeout,
bool flush_data)
{
s8 chnl_mode;
struct chnl_mgr *chnl_mgr_obj;
Expand All @@ -756,9 +756,9 @@ int bridge_chnl_idle(struct chnl_object *chnl_obj, u32 dwTimeOut,
chnl_mode = chnl_obj->chnl_mode;
chnl_mgr_obj = chnl_obj->chnl_mgr_obj;

if (CHNL_IS_OUTPUT(chnl_mode) && !fFlush) {
if (CHNL_IS_OUTPUT(chnl_mode) && !flush_data) {
/* Wait for IO completions, up to the specified timeout: */
status = bridge_chnl_flush_io(chnl_obj, dwTimeOut);
status = bridge_chnl_flush_io(chnl_obj, timeout);
} else {
status = bridge_chnl_cancel_io(chnl_obj);

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/staging/tidspbridge/core/io_sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void output_chnl(struct io_mgr *pio_mgr, struct chnl_object *pchnl,
static void input_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr);
static void output_msg(struct io_mgr *pio_mgr, struct msg_mgr *hmsg_mgr);
static u32 find_ready_output(struct chnl_mgr *chnl_mgr_obj,
struct chnl_object *pchnl, u32 dwMask);
struct chnl_object *pchnl, u32 mask);
static u32 read_data(struct bridge_dev_context *hDevContext, void *dest,
void *pSrc, u32 usize);
static u32 write_data(struct bridge_dev_context *hDevContext, void *dest,
Expand Down Expand Up @@ -1081,7 +1081,7 @@ void iosm_schedule(struct io_mgr *pio_mgr)
* IO_Dispatch()), so just start searching from the current channel id.
*/
static u32 find_ready_output(struct chnl_mgr *chnl_mgr_obj,
struct chnl_object *pchnl, u32 dwMask)
struct chnl_object *pchnl, u32 mask)
{
u32 ret = OUTPUTNOTREADY;
u32 id, start_id;
Expand All @@ -1092,11 +1092,11 @@ static u32 find_ready_output(struct chnl_mgr *chnl_mgr_obj,
id = ((id == CHNL_MAXCHANNELS) ? 0 : id);
if (id >= CHNL_MAXCHANNELS)
goto func_end;
if (dwMask) {
if (mask) {
shift = (1 << id);
start_id = id;
do {
if (dwMask & shift) {
if (mask & shift) {
ret = id;
if (pchnl == NULL)
chnl_mgr_obj->dw_last_output = id;
Expand Down
44 changes: 22 additions & 22 deletions trunk/drivers/staging/tidspbridge/core/tiomap3430.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,24 @@
static int bridge_brd_monitor(struct bridge_dev_context *dev_context);
static int bridge_brd_read(struct bridge_dev_context *dev_context,
OUT u8 *pbHostBuf,
u32 dwDSPAddr, u32 ul_num_bytes,
u32 dsp_addr, u32 ul_num_bytes,
u32 ulMemType);
static int bridge_brd_start(struct bridge_dev_context *dev_context,
u32 dwDSPAddr);
u32 dsp_addr);
static int bridge_brd_status(struct bridge_dev_context *dev_context,
int *pdwState);
static int bridge_brd_stop(struct bridge_dev_context *dev_context);
static int bridge_brd_write(struct bridge_dev_context *dev_context,
IN u8 *pbHostBuf,
u32 dwDSPAddr, u32 ul_num_bytes,
u32 dsp_addr, u32 ul_num_bytes,
u32 ulMemType);
static int bridge_brd_set_state(struct bridge_dev_context *hDevContext,
u32 ulBrdState);
static int bridge_brd_mem_copy(struct bridge_dev_context *hDevContext,
u32 ulDspDestAddr, u32 ulDspSrcAddr,
u32 ul_num_bytes, u32 ulMemType);
static int bridge_brd_mem_write(struct bridge_dev_context *dev_context,
IN u8 *pbHostBuf, u32 dwDSPAddr,
IN u8 *pbHostBuf, u32 dsp_addr,
u32 ul_num_bytes, u32 ulMemType);
static int bridge_brd_mem_map(struct bridge_dev_context *hDevContext,
u32 ul_mpu_addr, u32 ulVirtAddr,
Expand Down Expand Up @@ -304,24 +304,24 @@ static int bridge_brd_monitor(struct bridge_dev_context *hDevContext)
* Reads buffers for DSP memory.
*/
static int bridge_brd_read(struct bridge_dev_context *hDevContext,
OUT u8 *pbHostBuf, u32 dwDSPAddr,
OUT u8 *pbHostBuf, u32 dsp_addr,
u32 ul_num_bytes, u32 ulMemType)
{
int status = 0;
struct bridge_dev_context *dev_context = hDevContext;
u32 offset;
u32 dsp_base_addr = hDevContext->dw_dsp_base_addr;

if (dwDSPAddr < dev_context->dw_dsp_start_add) {
if (dsp_addr < dev_context->dw_dsp_start_add) {
status = -EPERM;
return status;
}
/* change here to account for the 3 bands of the DSP internal memory */
if ((dwDSPAddr - dev_context->dw_dsp_start_add) <
if ((dsp_addr - dev_context->dw_dsp_start_add) <
dev_context->dw_internal_size) {
offset = dwDSPAddr - dev_context->dw_dsp_start_add;
offset = dsp_addr - dev_context->dw_dsp_start_add;
} else {
status = read_ext_dsp_data(dev_context, pbHostBuf, dwDSPAddr,
status = read_ext_dsp_data(dev_context, pbHostBuf, dsp_addr,
ul_num_bytes, ulMemType);
return status;
}
Expand Down Expand Up @@ -356,7 +356,7 @@ static int bridge_brd_set_state(struct bridge_dev_context *hDevContext,
* b) DSP_RST2 is released.
*/
static int bridge_brd_start(struct bridge_dev_context *hDevContext,
u32 dwDSPAddr)
u32 dsp_addr)
{
int status = 0;
struct bridge_dev_context *dev_context = hDevContext;
Expand Down Expand Up @@ -417,7 +417,7 @@ static int bridge_brd_start(struct bridge_dev_context *hDevContext,
OMAP3430_RST1_IVA2_MASK, OMAP3430_IVA2_MOD,
OMAP2_RM_RSTCTRL);
/* Mask address with 1K for compatibility */
__raw_writel(dwDSPAddr & OMAP3_IVA2_BOOTADDR_MASK,
__raw_writel(dsp_addr & OMAP3_IVA2_BOOTADDR_MASK,
OMAP343X_CTRL_REGADDR(
OMAP343X_CONTROL_IVA2_BOOTADDR));
/*
Expand Down Expand Up @@ -588,7 +588,7 @@ static int bridge_brd_start(struct bridge_dev_context *hDevContext,
OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);

dev_dbg(bridge, "Waiting for Sync @ 0x%x\n", dw_sync_addr);
dev_dbg(bridge, "DSP c_int00 Address = 0x%x\n", dwDSPAddr);
dev_dbg(bridge, "DSP c_int00 Address = 0x%x\n", dsp_addr);
if (dsp_debug)
while (*((volatile u16 *)dw_sync_addr))
;;
Expand Down Expand Up @@ -765,22 +765,22 @@ static int bridge_brd_status(struct bridge_dev_context *hDevContext,
* Copies the buffers to DSP internal or external memory.
*/
static int bridge_brd_write(struct bridge_dev_context *hDevContext,
IN u8 *pbHostBuf, u32 dwDSPAddr,
IN u8 *pbHostBuf, u32 dsp_addr,
u32 ul_num_bytes, u32 ulMemType)
{
int status = 0;
struct bridge_dev_context *dev_context = hDevContext;

if (dwDSPAddr < dev_context->dw_dsp_start_add) {
if (dsp_addr < dev_context->dw_dsp_start_add) {
status = -EPERM;
return status;
}
if ((dwDSPAddr - dev_context->dw_dsp_start_add) <
if ((dsp_addr - dev_context->dw_dsp_start_add) <
dev_context->dw_internal_size) {
status = write_dsp_data(hDevContext, pbHostBuf, dwDSPAddr,
status = write_dsp_data(hDevContext, pbHostBuf, dsp_addr,
ul_num_bytes, ulMemType);
} else {
status = write_ext_dsp_data(dev_context, pbHostBuf, dwDSPAddr,
status = write_ext_dsp_data(dev_context, pbHostBuf, dsp_addr,
ul_num_bytes, ulMemType, false);
}

Expand Down Expand Up @@ -1147,7 +1147,7 @@ static int bridge_brd_mem_copy(struct bridge_dev_context *hDevContext,

/* Mem Write does not halt the DSP to write unlike bridge_brd_write */
static int bridge_brd_mem_write(struct bridge_dev_context *hDevContext,
IN u8 *pbHostBuf, u32 dwDSPAddr,
IN u8 *pbHostBuf, u32 dsp_addr,
u32 ul_num_bytes, u32 ulMemType)
{
int status = 0;
Expand All @@ -1158,18 +1158,18 @@ static int bridge_brd_mem_write(struct bridge_dev_context *hDevContext,
while (ul_remain_bytes > 0 && DSP_SUCCEEDED(status)) {
ul_bytes =
ul_remain_bytes > BUFFERSIZE ? BUFFERSIZE : ul_remain_bytes;
if (dwDSPAddr < (dev_context->dw_dsp_start_add +
if (dsp_addr < (dev_context->dw_dsp_start_add +
dev_context->dw_internal_size)) {
status =
write_dsp_data(hDevContext, pbHostBuf, dwDSPAddr,
write_dsp_data(hDevContext, pbHostBuf, dsp_addr,
ul_bytes, ulMemType);
} else {
status = write_ext_dsp_data(hDevContext, pbHostBuf,
dwDSPAddr, ul_bytes,
dsp_addr, ul_bytes,
ulMemType, true);
}
ul_remain_bytes -= ul_bytes;
dwDSPAddr += ul_bytes;
dsp_addr += ul_bytes;
pbHostBuf = pbHostBuf + ul_bytes;
}
return status;
Expand Down
24 changes: 12 additions & 12 deletions trunk/drivers/staging/tidspbridge/core/tiomap_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bool symbols_reloaded = true;
* Copies DSP external memory buffers to the host side buffers.
*/
int read_ext_dsp_data(struct bridge_dev_context *hDevContext,
OUT u8 *pbHostBuf, u32 dwDSPAddr,
OUT u8 *pbHostBuf, u32 dsp_addr,
u32 ul_num_bytes, u32 ulMemType)
{
int status = 0;
Expand Down Expand Up @@ -83,8 +83,8 @@ int read_ext_dsp_data(struct bridge_dev_context *hDevContext,
DBC_ASSERT(ul_trace_sec_end != 0);

if (DSP_SUCCEEDED(status)) {
if ((dwDSPAddr <= ul_trace_sec_end) &&
(dwDSPAddr >= ul_trace_sec_beg))
if ((dsp_addr <= ul_trace_sec_end) &&
(dsp_addr >= ul_trace_sec_beg))
trace_read = true;
}

Expand Down Expand Up @@ -165,7 +165,7 @@ int read_ext_dsp_data(struct bridge_dev_context *hDevContext,
if (!dw_base_addr || !ul_ext_base || !ul_ext_end)
status = -EPERM;

offset = dwDSPAddr - ul_ext_base;
offset = dsp_addr - ul_ext_base;

if (DSP_SUCCEEDED(status))
memcpy(pbHostBuf, (u8 *) dw_base_addr + offset, ul_num_bytes);
Expand All @@ -179,7 +179,7 @@ int read_ext_dsp_data(struct bridge_dev_context *hDevContext,
* Copies buffers to the DSP internal/external memory.
*/
int write_dsp_data(struct bridge_dev_context *hDevContext,
IN u8 *pbHostBuf, u32 dwDSPAddr, u32 ul_num_bytes,
IN u8 *pbHostBuf, u32 dsp_addr, u32 ul_num_bytes,
u32 ulMemType)
{
u32 offset;
Expand All @@ -194,7 +194,7 @@ int write_dsp_data(struct bridge_dev_context *hDevContext,
if (!resources)
return -EPERM;

offset = dwDSPAddr - hDevContext->dw_dsp_start_add;
offset = dsp_addr - hDevContext->dw_dsp_start_add;
if (offset < base1) {
dw_base_addr = MEM_LINEAR_ADDRESS(resources->dw_mem_base[2],
resources->dw_mem_length[2]);
Expand Down Expand Up @@ -225,7 +225,7 @@ int write_dsp_data(struct bridge_dev_context *hDevContext,
*
*/
int write_ext_dsp_data(struct bridge_dev_context *dev_context,
IN u8 *pbHostBuf, u32 dwDSPAddr,
IN u8 *pbHostBuf, u32 dsp_addr,
u32 ul_num_bytes, u32 ulMemType,
bool dynamic_load)
{
Expand Down Expand Up @@ -253,8 +253,8 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context,
&ul_trace_sec_end);
}
if (DSP_SUCCEEDED(ret)) {
if ((dwDSPAddr <= ul_trace_sec_end) &&
(dwDSPAddr >= ul_trace_sec_beg))
if ((dsp_addr <= ul_trace_sec_end) &&
(dsp_addr >= ul_trace_sec_beg))
trace_load = true;
}

Expand Down Expand Up @@ -364,9 +364,9 @@ int write_ext_dsp_data(struct bridge_dev_context *dev_context,
for (i = 0; i < 4; i++)
remain_byte[i] = 0x0;

dw_offset = dwDSPAddr - ul_ext_base;
/* Also make sure the dwDSPAddr is < ul_ext_end */
if (dwDSPAddr > ul_ext_end || dw_offset > dwDSPAddr)
dw_offset = dsp_addr - ul_ext_base;
/* Also make sure the dsp_addr is < ul_ext_end */
if (dsp_addr > ul_ext_end || dw_offset > dsp_addr)
ret = -EPERM;
}
if (DSP_SUCCEEDED(ret)) {
Expand Down
Loading

0 comments on commit 409c163

Please sign in to comment.