From mboxrd@z Thu Jan 1 00:00:00 1970 From: greg@kroah.com (Greg KH) Date: Mon, 3 Jan 2011 13:29:11 -0800 Subject: FPGA registers userspace interface? In-Reply-To: References: <4D21C86E.6060503@pjd.me.uk> Message-ID: <20110103212911.GA4776@kroah.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Mon, Jan 03, 2011 at 10:52:34PM +0200, Daniel Baluta wrote: > > I thought about using 3 files in sysfs. > > 1. address of the register > > 2. data to write to the register > > 3. trigger that do the write > > The most effective solution would be to > have one file per register. > > Writing register: > # echo value > /sys/path/to/file > > Reading register: > # cat /sys/path/to/file > > Also, since your FPGA is in development phase I assume that > the registers base address is changing (or am I wrong?). You can > solve this with an additional writable sysfs entry which will > hold the current base address. Also remember that debugfs would also be good for something like this, being much easier to use than sysfs. Note the rule when using debugfs: There is are no rules when using debugfs. Which works much better when doing development :) thanks, greg k-h