Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Apr 2015 13:46:59 +0300
From:      Daniel Braniss <danny@cs.huji.ac.il>
To:        Tom Jones <jones@sdf.org>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: help with coding a loadable kernel module
Message-ID:  <32D7EBD3-813E-4062-8A06-ED8E82BA50DA@cs.huji.ac.il>
In-Reply-To: <20150417095536.GA38091@gmail.com>
References:  <EDB591F5-E056-4E53-9ED2-2A2E571F319C@cs.huji.ac.il> <20150417080839.GO2743@home.opsec.eu> <9B835088-661C-456E-84A7-47BC1835C0CB@cs.huji.ac.il> <20150417095536.GA38091@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Apr 17, 2015, at 12:55 PM, Tom Jones <jones@sdf.org> wrote:
>=20
> On Fri, Apr 17, 2015 at 12:15:33PM +0300, Daniel Braniss wrote:
>>=20
>>> On Apr 17, 2015, at 11:08 AM, Kurt Jaeger <lists@opsec.eu> wrote:
>>>=20
>>> Hi!
>>>=20
>>>> I know I'm embarking on a dangerous trip, but I want to use a =
Raspberry Pi
>>>> and or a BeagleBone to read (and write) RFID cards.
>>>> Since a driver is needed to use the spibus, I have 2 options while
>>>> developing:
>>> [...]
>>>> So before I give up on option 2, is there some examples/help?
>>>=20
>>> Are you aware of this book ?
>>>=20
>>> http://www.nostarch.com/bsddrivers.htm =
<http://www.nostarch.com/bsddrivers.htm>;
>>=20
>> no, but before I spend more money (this is getting expensive :-),
>> does it explain how to write a loadable module that needs to to talk
>> to a spibus?=20
>=20
> I don't think it does.
>=20
> spibus is very simple, there is one interface call
>=20
> SPIBUS_TRANSFER(device_t, device_t, strcut spi_command);
>=20

chicken and egg issue :-), what device_t dev should I use?
it must point to the spibus =E2=80=A6


> struct spi_command {
> 	void	*tx_cmd;
> 	uint32_t tx_cmd_sz;
> 	void	*rx_cmd;
> 	uint32_t rx_cmd_sz;
> 	void	*tx_data;
> 	uint32_t tx_data_sz;
> 	void	*rx_data;
> 	uint32_t rx_data_sz;
> };
>=20
> The rx and tx buffers need to be the same size.
>=20
> I there isn't an interface for configuring spibuses, the bcm2835_spi =
driver
> uses sysctl's directly to set clock speed and other configuration. I =
imagine
> the other drivers are similar or don't offer config.
>=20
> I can also assume you have hardware for the rfid. If not you might be =
able to
> find a reader that is supported by libnfc[1] which supports the rfid =
tags you
> need to use.

I have 2 different RFIds, both are configured to talk via spi.

thanks,
	danny
>=20
> [0]: svnweb.freebsd.org/base/head/sys/dev/spibus
> [1]: nfc-tools.org
>=20
> --=20
> Tom
> @adventureloop
> adventurist.me
>=20
> #pragma summon cthulhu
> :wq
> _______________________________________________
> freebsd-arm@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32D7EBD3-813E-4062-8A06-ED8E82BA50DA>