BruceNaylor
Posts: 13
Joined: Sat Nov 15, 2014 5:28 pm
Location: Swindon, UK

Parallel FIFO via SMI/DMA ?

Postby BruceNaylor » Sat Nov 15, 2014 5:36 pm

Hi All,

Looking into feasibility of using an A+ to chat to a 16bit wide FIFO via the 40 pin header.

The SMI interface with DMA appears the way forward for high speed/low CPU usage etc

Finding it tricky locating relevant documentation on the SMI registers / usage.

Could somebody point me in the right direction please.

Regards

Bruce.
Any landing you can walk away from is a good landing in my book.
User avatar
joan
Posts: 12702
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Parallel FIFO via SMI/DMA ?

Postby joan » Sat Nov 15, 2014 6:24 pm

BruceNaylor
Posts: 13
Joined: Sat Nov 15, 2014 5:28 pm
Location: Swindon, UK

Re: Parallel FIFO via SMI/DMA ?

Postby BruceNaylor » Sat Nov 15, 2014 6:59 pm



Sorry, SMI is the Secondary Memory Interface peripheral available to map via GPIO ALT functions. DMA documentation in above BCM2835 document suggests that it can be triggered by the SMI, but I can find no details on the SMI registers etc anywhere.

Since the A+/B+/CM pinout a sufficient no. of SMI signals, it would appear to be a great way of reading/writing large amounts of data to/from external hardware - ie my 16bit fifo requirement, if only documentation could be found.
Any landing you can walk away from is a good landing in my book.
User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 9311
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Parallel FIFO via SMI/DMA ?

Postby mahjongg » Sat Nov 15, 2014 10:45 pm

ask gert van loo, he uses this interface mode for his VGA adapter. (at least he redirected a video pipe to the parallel interface.

if anyone here knows this stuff its him, he also wrote the peripheral manual.

its possible this stuff isn't publicly available though.
User avatar
Burngate
Posts: 4828
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK
Contact:

Re: Parallel FIFO via SMI/DMA ?

Postby Burngate » Sun Nov 16, 2014 10:06 am

mahjongg wrote:ask gert van loo, he uses this interface mode for his VGA adapter. (at least he redirected a video pipe to the parallel interface).
I believe that uses Alt-2 (DPI interface) rather than Alt-1 (SMI), so a different chunk of hardware.

I've not come across any documentation for the SMI interface
screen2.png
screen2.png (54.83 KiB) Viewed 1974 times
User avatar
joan
Posts: 12702
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Parallel FIFO via SMI/DMA ?

Postby joan » Sun Nov 16, 2014 10:33 am

Does anyone know if the SMI is usable from ARM? The DPI sounds like it can only be usefully used from the GPU.
BruceNaylor
Posts: 13
Joined: Sat Nov 15, 2014 5:28 pm
Location: Swindon, UK

Re: Parallel FIFO via SMI/DMA ?

Postby BruceNaylor » Tue Nov 18, 2014 2:36 pm

Hi All,

Kinda disappointed that this thread hasn't been responded to by anyone with at least some knowledge on the state of SMI.

I understand enabling SMI can eat almost the entire 40 pin expansion port, so treads on the toes of HAT support etc, but the A+ (and CM) would have so much potential in embedded products were high speed, non-cpu intensive, parallel data transfer available.

Only fall-back solution I can see is to hijack the SD1 interface with a chunk of CPLD/FPGA glue, but that appears to make life more complex for what I can assume (since I have no spec. on the SMI) far less performance.

Bruce.
Any landing you can walk away from is a good landing in my book.
mabrecht
Posts: 3
Joined: Fri May 20, 2016 6:44 am

Re: Parallel FIFO via SMI/DMA ?

Postby mabrecht » Mon Oct 24, 2016 5:01 am

Hello,
i'm looking for the same information. Please, if anyone could point me in the right direction on how to use SMI for strobing in data from a parallel interface to memory without hogging the CPU? Would be highly appreciated.
Thank you,
Manuel
ralphnev
Posts: 14
Joined: Thu Mar 05, 2015 2:47 am
Location: Ottawa,Ontario Canada

Re: Parallel FIFO via SMI/DMA ?

Postby ralphnev » Tue Oct 25, 2016 9:36 pm

looks like some info was released last summer --
viewtopic.php?f=31&t=92233
i plan on going down this rabbit hole in a few weeks ...
User avatar
Gavinmc42
Posts: 1332
Joined: Wed Aug 28, 2013 3:31 am

Re: Parallel FIFO via SMI/DMA ?

Postby Gavinmc42 » Fri Feb 17, 2017 8:34 am

I know this is old thread but...
Came across the SMI DMEQ in the DMA section.
SMI secondary memory Interface?
Alt1 on the GPIO pins.

What I have done before is use DMA to suck data off a parallel output camera chip.
Normally this is done at 27MHz on most parallel image sensors, but I have done it at 26MHz.
Maybe it would work at 25MHz which is Gert VGA output speed?

If camera is setup right you can get 8 data, some might interlace 15/16 data.
The other pins you need are pixel clk and H/V syncs plus i2c, then we could use camera like these.
http://www.arducam.com/camera-modules/0-3mp-ov7670/

Alternatively
The BCM2722 had a programmable 8/16-bit CMOS/CCD camera input port.
Do the BCM2835/7 have the same camera ports? Undocumented?
As the 2722 was a VC chip, perhaps only accessible to the GPU ALT2?

How much more secret stuff is in these chips?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4204
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Parallel FIFO via SMI/DMA ?

Postby 6by9 » Fri Feb 17, 2017 10:10 am

Gavinmc42 wrote:What I have done before is use DMA to suck data off a parallel output camera chip.
Normally this is done at 27MHz on most parallel image sensors, but I have done it at 26MHz.
Maybe it would work at 25MHz which is Gert VGA output speed?
You want to receive the output from Gert's VGA board on another Pi? That sounds rather bizarre as use cases go.
Gavinmc42 wrote:If camera is setup right you can get 8 data, some might interlace 15/16 data.
The other pins you need are pixel clk and H/V syncs plus i2c, then we could use camera like these.
http://www.arducam.com/camera-modules/0-3mp-ov7670/

Alternatively
The BCM2722 had a programmable 8/16-bit CMOS/CCD camera input port.
Do the BCM2835/7 have the same camera ports? Undocumented?
As the 2722 was a VC chip, perhaps only accessible to the GPU ALT2?
2722 was VideoCore 2.
The majority of the chip was redesigned for VideoCore3 because it was such a jump in spec (SD to HD almost everywhere, and ~1MPix camera to 12MPix).
The firmware has code to program up the camera receiver block for CPI (Camera Parallel Interface), but is using registers that aren't in my documentation. I suspect there may have been an update between VC3 and VC4 and the code wasn't culled. I do remember a test platform using a parallel camera, but not the details on it.
You're probably as well off using a parallel to CCP2/CSI-1 conversion chip, eg TI SLLS881G, or Toshiba TC358746
Gavinmc42 wrote:How much more secret stuff is in these chips?
There's a few other interesting blocks on the chip, but much of it not broken out. CCP2 transmitter for anyone? That's a potential 500Mbit/s output if your data sink can handle it.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
User avatar
Gavinmc42
Posts: 1332
Joined: Wed Aug 28, 2013 3:31 am

Re: Parallel FIFO via SMI/DMA ?

Postby Gavinmc42 » Fri Feb 17, 2017 2:37 pm

You want to receive the output from Gert's VGA board on another Pi? That sounds rather bizarre as use cases go.
Nope, just pointing out if Gert can get 16bits VGA data out at that speed, it might be possible to get 8bit data in at that speed.

The camera parallel data would look like a single address memory register that you need to read at 27MHz or what ever speed you can clock it and the DMA can handle.
This only works if the DMA can auto increment the memory block it is writing to.

Basically use the DMA to read SMI off the GPIO pins which has an Arducam wired up to them.
With the DMA triggered by the pixelclock, Vsync outputs from the camera.

All this would be easier if there was a hardware parallel camera IO mode.
But if it is left over from the VC2/3 that might mean only VC4 GPU can do it.
Or they come out on the other GPIO pins and only the CM Pi's can do it
Digital video port (DVP)?

Hmm, anyway worth looking at the DMA stuff, just for using the Pi as a logic analyzer.
Which would come in handy to RE the i2c commands of old camera chips in old phones etc.
Before they get pulled apart for the sensor :lol:

A i2c/SPI bus analyzer, maybe even a CRO? 100Mhz 8bit parallel ADC.
Useful steps towards getting to grips with the DMA, before tackling something as crazy as a camera chip.
Most people have used DMA to output stuff, time to google inputing.

The basic docs on SMI looks as if it can write and read data, still on topic :D
The driver code looks like there is 8, 9, 16, 18bit data options, also NAND flash is possible.

Big clue?

Code: Select all

SMICS_PXLDAT	:  Pixel data:	write 1 to enable pixel transfer modes.
Er this is a bit confusing, 32bit pixel data? this could be pixel data out to parallel LCD?

Code: Select all

SMIDSW_WFORMAT	: Pixel format of input. 0 = 16bit RGB 565,
+ *			  1 = 32bit RGBA 8888
Useful for old 6800 chips, 6845? retro video stuff.

Code: Select all

SMIDSR_MODE68	: 1 for System 68 mode (i.e. enable + direction pins,
+ *			  rather than OE + WE pin)
You guys are deliberating not releasing full data sheets to drive us all crazy guessing :lol:
Is there a single person on the planet that knows everything that is in these chips?
Looking at holes in register maps, two thirds is missing documentation?

Hmm, did anyone document the Pi alpha's? Got some little headers on them.
Lucky I have so much still to do/learn I can wait for the next drip in the Chinese water torture method of data release.
This is what happen when you Brits drive that Wiki leaks guy inside, no more leaks, just tiny drips :(

Hmm, no host interface comes out even on Computes.
What speed is JTAG? add that to GPIO bitbanging logic probe.

That's enough for tonight, brain is hurting.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
BruceNaylor
Posts: 13
Joined: Sat Nov 15, 2014 5:28 pm
Location: Swindon, UK

Re: Parallel FIFO via SMI/DMA ?

Postby BruceNaylor » Fri Feb 17, 2017 3:24 pm

I too got quite excited by this a year or so ago. Data acquisition for camera sensors and logic analysis etc. I ended up going down a lattice ICE route which caused it's own set of issues, and finally ran out of time on the project. Would be interested to hear how far you get - please keep this thread active ;)

Best regards

Bruce.
Any landing you can walk away from is a good landing in my book.
User avatar
Gavinmc42
Posts: 1332
Joined: Wed Aug 28, 2013 3:31 am

Re: Parallel FIFO via SMI/DMA ?

Postby Gavinmc42 » Sat Feb 18, 2017 1:15 am

Would be interested to hear how far you get - please keep this thread active
Any progress I make will probably get posted on the Ultibo forums first.
Mainly because I won't be doing this in Linux but baremetal.
But even Ultibo DMA stuff is new to me.

I just think a logic analyzer made from a Zero might be a useful tool to debug future baremetal stuff.
Including camera stuff.

Joan's piscope would probably be enough for camera i2c RE but not fast enough for 27MHz data?
Not much of a stretch then to add high speed ADC, depends on lots of unknowns yet.
But learning is what the Pi is all about.
And if data can get in at that speed and we know it can got out due to Gert's VGA.

Possible to make an SDR?
http://osmocom.org/projects/sdr/wiki/rtl-sdr
RTL2832U outputs 8-bit I/Q-samples, and the highest theoretically possible sample-rate is 3.2 MS/s
3.2MS/s is quite slow, even bit banging I have got 4MHz.
This also get rid of the USB chip and the need for driver for that.
Again a SDR based on a Zero would be nice to have.

Don't have a license so transmitter is out for me but 18,000+km :o
http://radwav.com/making-waves.html
Long distance RF comms is of use in Australia especially for IoT stuff in the middle of the outback.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges