-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARCv3: Add CDMA support driver #138
base: arc64
Are you sure you want to change the base?
Conversation
a = handle >> 5; | ||
o = 1 << (handle & 0x1f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not use these magic numbers and have proper defines instead (bits mask / bits shift)
a = handle >> 5; | ||
x = 1 << (handle & 0x1f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
u32 len, /* DMA length in bytes */ | ||
struct cdma_c_attr_t a) /* Attributes */ | ||
{ | ||
/* Write will block iff busy i.e. DMA_C_STATUS_AUX.B bit is set */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* Write will block iff busy i.e. DMA_C_STATUS_AUX.B bit is set */ | |
/* Write will block if busy i.e. DMA_C_STATUS_AUX.B bit is set */ |
struct cdma_hw_desc *hw_desc; | ||
unsigned long flags; | ||
int done_flg; | ||
int entry_notfound = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have it as bool var.
*/ | ||
for (ii = 0; ii < dw->nr_channels; ii++) { | ||
chan = &dw->channels[ii]; | ||
dev_warn(chan2dev(chan), "WARN. Channel is overflowed.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably we can remove 'WARN' from comment - this info is provided by dev_warn. Same for dev_err
u32 tmp; | ||
|
||
bcr.val = read_aux_reg(DMA_BUILD); | ||
if (bcr.ver < 0x10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magic number. Probably we can name it as DW_CDMA_MIN_VERSION or something like that.
/* vv = (u32)(src >> 32ULL); */ | ||
/* WRITE_AUX(DMA_C_SRC_HI_AUX, vv); */ | ||
/* vv = (u32)(dst >> 32ULL); */ | ||
/* WRITE_AUX(DMA_C_DST_HI_AUX, vv); */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is suspicious as we set DMA_BIT_MASK(64)
drivers/dma/dw-cdma/dw-cdma.h
Outdated
struct dw_cluster_dma { | ||
struct dma_device dma; | ||
struct device_dma_parameters dma_parms; | ||
int nr_channels; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra tab. I'd expect that it should be detected by checkpatch.
drivers/dma/dw-cdma/dw-cdma.h
Outdated
struct cdma_chip { | ||
struct device *dev; | ||
struct dw_cluster_dma *dw; | ||
int irq; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
a = handle >> 5; | ||
o = 1 << (handle & 0x1f); | ||
READ_BCR(DMA_S_DONESTATD_AUX(a), x); | ||
x = x & o; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x = x & o; | |
x &= o; |
dd2a71f
to
5cc2b79
Compare
Driver to support Cluster DMA(CDMA) controller for ARCv3. For HS58 tested on nSIM and HAPS using 'dmatest' driver. For HS68 tested on nSIM using 'dmatest' driver. Known limitations: Don't specify 'test_buf_size' 'dmatest' parameter more then 750000 when L2$ is enabled. Looks like L2$ operations in cache-arcv3.c:scm_op_rgn() fails when sz > 750000. Probably it is restriction in HW. Otherwise the kernel will crash.
5cc2b79
to
0caba66
Compare
Driver to support Cluster DMA(CDMA) controller for ARCv3. For HS58 tested on nSIM and HAPS using 'dmatest' driver. For HS68 tested on nSIM using 'dmatest' driver.
Known limitations:
Don't specify 'test_buf_size' 'dmatest' parameter more then 750000 when L2$ is enabled. Looks like L2$ operations in cache-arcv3.c:scm_op_rgn() fails when sz > 750000. Probably it is restriction in HW. Otherwise the kernel will crash.