Page MenuHomeFreeBSD

ARM PrimeCell PL330 DMA engine driver
ClosedPublic

Authored by br on Mar 30 2017, 2:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 4, 1:10 PM
Unknown Object (File)
Feb 26 2024, 1:27 AM
Unknown Object (File)
Jan 13 2024, 7:21 PM
Unknown Object (File)
Jan 3 2024, 5:19 AM
Unknown Object (File)
Dec 20 2023, 2:19 AM
Unknown Object (File)
Nov 14 2023, 11:53 PM
Unknown Object (File)
Nov 14 2023, 3:09 PM
Unknown Object (File)
Oct 13 2023, 2:07 PM
Subscribers

Details

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

andrew added a subscriber: andrew.

Looks good, however I think a few comments would be useful, e.g. in pl330_channel_submit_sg, and it seems to be missing the build glue.

sys/dev/xdma/controller/pl330.c
91–92 ↗(On Diff #26824)

You could make these a single struct resource *, then use bus_read_4 and bus_write_4.

130 ↗(On Diff #26824)

I think we might need to think about a new bus_alloc_resources like function to handle this sort of thing.

181 ↗(On Diff #26824)

Why 0x10000?

197–199 ↗(On Diff #26824)

I wonder if there should be macros for these, e.g.

#define MOV_3(val) (((val) >> 8) & 0xff)
...
buf[3] = MOV_3(val)
496 ↗(On Diff #26824)

What will happen when len is not a multiple of 4?

498 ↗(On Diff #26824)

What is the meaning of 0 here, and 1 below?

512–514 ↗(On Diff #26824)

Could these be merged into a single call?

548–550 ↗(On Diff #26824)

Is this needed?

553 ↗(On Diff #26824)

Magic 0x10000 again

636 ↗(On Diff #26824)

We should probably add a DMA bus pass.

sys/dev/xdma/controller/pl330.h
32 ↗(On Diff #26824)

It might pay to add a guard against including this header twice.

43 ↗(On Diff #26824)

You should put n in parentheses, i.e. #define FTR(n) (0x040 + 0x04 * (n))

76 ↗(On Diff #26824)

Why #if 0 and not /* ... */?

108–111 ↗(On Diff #26824)

I would put these in the .c file, they don't seem to be needed anywhere else.

br marked 12 inline comments as done.

dehardcode src/dst port width

br marked an inline comment as done.Apr 3 2017, 2:01 PM
br added inline comments.
sys/dev/xdma/controller/pl330.c
496 ↗(On Diff #26824)

ok I dehardcoded port width.
port width is now specified by application.
Thanks!

498 ↗(On Diff #26824)

offs0 is the jump address for loop0, while offs1 is the jump addr for loop1

512–514 ↗(On Diff #26824)

Yes. I merged this to single call

548–550 ↗(On Diff #26824)

No. Thanks

636 ↗(On Diff #26824)

agree

br marked an inline comment as done.

add dprintf macro

This revision was not accepted when it landed; it landed in state Needs Review.Apr 13 2018, 12:44 PM
This revision was automatically updated to reflect the committed changes.