Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: BeagleBone Black and GPIO issues



On Sat, 2024-10-12 at 09:47 -0600, Brook Milligan wrote:
> 
> I started messing with this at one time, but was not at all sure how
> to relate the addresses in the TI reference manual to appropriate
> arguments to the bus_space functions so that I knew which control
> registers I was reading/writing.
> 
> If anyone can clue me in on that, I might have a go.
> 

Warning: It's been a while since I use the bus_space stuff and the
following might be (mis)guided by how I would implement it instead of
how it is actually implemented.

The numbers to use come from the FDT, although hard coding them during
initial prototyping works too. 

To read/write a 32 bit value you will use bus_space_read/write_4 with
an appropriate handle.

	bus_space_map(SPACE, ADDRESS, SIZE, 0, &HANDLE);
	...
	value = bus_space_read_4(SPACE, HANDLE, offset);
	value |= 0x80;
	bus_space_write_4(SPACE, HANDLE, offset, value);

The SPACE comes from your autoconf parent in the attach args. ADDRESS
and SIZE comes from the FDT, but as a filthy dirty hack that does not
belong in CVS you can set the ADDRESS to be 0x44e10000 and the size to
be 0x2000. The offsets are then the offsets docement on chapter 9 of
AM335x and AMIC110 Sitara™ Processors Technical Reference Manual (Rev.
Q). The offsets you care about are 0x800 - 0xa34.

Ngā mihi,
Lloyd



Home | Main Index | Thread Index | Old Index