Hi
I am developing a device driver for BeagleBone Black that uses EDMA from AM335x. I need to trigger the EDMA channel manually ( by software ).
After all settings, if I try to start EDMA with edma_start(), nothing happens. Looking into code of edma_start(), apparently there is hardware event assotiation already programmed in the channel that I am using, so, it doesn't activate bit in ESR register ( manual triggering ).
How can I read EER register ( or relevant registers that programs hardware event ) in a kernel module to see its contents?
Is it possible that Device Tree set EER at boot cycle, if I defined GPIO0_7 as XDMA_EVENT_INTR2?
Thanks
Sergio
/** 1278 * edma_start - start dma on a channel 1279 * @channel: channel being activated 1280 * 1281 * Channels with event associations will be triggered by their hardware 1282 * events, and channels without such associations will be triggered by 1283 * software. (At this writing there is no interface for using software 1284 * triggers except with channels that don't support hardware triggers.) 1285 * 1286 * Returns zero on success, else negative errno. 1287 */ 1288 int edma_start(unsigned channel) 1289 { 1290 unsigned ctlr; 1291 1292 ctlr = EDMA_CTLR(channel); 1293 channel = EDMA_CHAN_SLOT(channel); 1294 1295 if (channel < edma_cc[ctlr]->num_channels) { 1296 int j = channel >> 5; 1297 unsigned int mask = BIT(channel & 0x1f); 1298 1299 /* EDMA channels without event association */ 1300 if (test_bit(channel, edma_cc[ctlr]->edma_unused)) { 1301 pr_debug("EDMA: ESR%d %08x\n", j, 1302 edma_shadow0_read_array(ctlr, SH_ESR, j)); 1303 edma_shadow0_write_array(ctlr, SH_ESR, j, mask); 1304 return 0; 1305 } 1306 1307 /* EDMA channel with event association */ 1308 pr_debug("EDMA: ER%d %08x\n", j, 1309 edma_shadow0_read_array(ctlr, SH_ER, j)); 1310 /* Clear any pending event or error */ 1311 edma_write_array(ctlr, EDMA_ECR, j, mask); 1312 edma_write_array(ctlr, EDMA_EMCR, j, mask); 1313 /* Clear any SER */ 1314 edma_shadow0_write_array(ctlr, SH_SECR, j, mask); 1315 edma_shadow0_write_array(ctlr, SH_EESR, j, mask); 1316 pr_debug("EDMA: EER%d %08x\n", j, 1317 edma_shadow0_read_array(ctlr, SH_EER, j)); 1318 return 0; 1319 } 1320 1321 return -EINVAL; 1322 } 1323 EXPORT_SYMBOL(edma_start);
