diff options
author | Terry Lv <r65388@freescale.com> | 2013-06-24 20:02:34 +0800 |
---|---|---|
committer | Terry Lv <r65388@freescale.com> | 2013-06-24 20:10:19 +0800 |
commit | 2abb216179317e23550dbb4d31725381ec8fc1c7 (patch) | |
tree | fef3d916a242fc67c05f3499bbe4f2108bcc213a /drivers | |
parent | ab87ade3dbfa38b6abc003a9409cda10f58ccb94 (diff) |
ENGR00258998: mlb unit test should exit after click stop on mitb
This patch will do the following:
1. For mlb will not be able to know whether the final package is
completely sent, add a delay for final package to be sent.
2. Adjust MLB's iram buffer usage. Old code will add addtional
usage of iram buffer.
3. Code format change.
4. In resume function, calling init function after clock is enabled.
Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'drivers')
-rwxr-xr-x | drivers/mxc/mlb/mxc_mlb150.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/mxc/mlb/mxc_mlb150.c b/drivers/mxc/mlb/mxc_mlb150.c index 6b07d0f0a428..3cc0289c57b8 100755 --- a/drivers/mxc/mlb/mxc_mlb150.c +++ b/drivers/mxc/mlb/mxc_mlb150.c @@ -288,8 +288,8 @@ enum CLK_SPEED { }; struct mlb_ringbuf { - s8 *virt_bufs[TRANS_RING_NODES + 1]; - u32 phy_addrs[TRANS_RING_NODES + 1]; + s8 *virt_bufs[TRANS_RING_NODES]; + u32 phy_addrs[TRANS_RING_NODES]; s32 head; s32 tail; s32 unit_size; @@ -1538,6 +1538,11 @@ static s32 mlb150_trans_complete_check(struct mlb_dev_info *pdevinfo) return -ETIME; } + /* Interrupt from TX can only inform that the data is sent + * to AHB bus, not mean that it is sent to MITB. Thus we add + * a delay here for data to be completed sent. */ + udelay(1000); + return 0; } @@ -1902,24 +1907,27 @@ static int mxc_mlb150_open(struct inode *inode, struct file *filp) pr_err("can not alloc rx/tx buffers: %d\n", buf_size); return ret; } + pr_debug("IRAM Range: Virt 0x%x - 0x%x, Phys 0x%x - 0x%x, size: 0x%x\n", + buf_addr, (buf_addr + buf_size - 1), phy_addr, + (phy_addr + buf_size - 1), buf_size); pdevinfo->rbuf_base_virt = buf_addr; pdevinfo->rbuf_base_phy = phy_addr; memset(buf_addr, 0, buf_size); - for (j = 0; j < (TRANS_RING_NODES + 1); + for (j = 0; j < (TRANS_RING_NODES); ++j, buf_addr += ring_buf_size, phy_addr += ring_buf_size) { pdevinfo->rx_rbuf.virt_bufs[j] = buf_addr; pdevinfo->rx_rbuf.phy_addrs[j] = phy_addr; + pr_debug("RX Ringbuf[%d]: 0x%x 0x%x\n", j, buf_addr, phy_addr); } pdevinfo->rx_rbuf.unit_size = ring_buf_size; pdevinfo->rx_rbuf.total_size = buf_size; - buf_addr += ring_buf_size; - phy_addr += ring_buf_size; for (j = 0; j < (TRANS_RING_NODES); ++j, buf_addr += ring_buf_size, phy_addr += ring_buf_size) { pdevinfo->tx_rbuf.virt_bufs[j] = buf_addr; pdevinfo->tx_rbuf.phy_addrs[j] = phy_addr; + pr_debug("TX Ringbuf[%d]: 0x%x 0x%x\n", j, buf_addr, phy_addr); } pdevinfo->tx_rbuf.unit_size = ring_buf_size; @@ -2347,9 +2355,8 @@ static ssize_t mxc_mlb150_write(struct file *filp, const char __user *buf, /* Set ADT for TX */ mlb150_dev_pipo_next(ahb_ch, ctype, adt_sts, tx_buf_ptr); - } else { + } else read_unlock_irqrestore(&tx_rbuf->rb_lock, flags); - } ret = count; out: @@ -2670,10 +2677,10 @@ static int mxc_mlb150_resume(struct platform_device *pdev) { struct mlb_data *drvdata = platform_get_drvdata(pdev); - mlb150_dev_init(); - clk_enable(drvdata->clk_mlb6p); + mlb150_dev_init(); + return 0; } #else |