Subject: Re: Broadband adapter again...
To: Marcus Comstedt <marcus@idonex.se>
From: None <itojun@iijlab.net>
List: port-dreamcast
Date: 01/29/2001 12:51:32
>Ok, I'm starting to have serious doubts about the splendour of
>bus_space_*.  In the RTK device driver, the chip registers are
>accessed through
>
>   bus_space_read_2(sc->rtk_btag, sc->rtk_bhandle, reg)
>
>This function is defined in <machine/bus.h> as
>
>   u_int16_t
>   bus_space_read_2(tag, bsh, offset)
>   	   bus_space_tag_t tag;
>   	   bus_space_handle_t bsh;
>   	   bus_size_t offset;
>   {
>   	   return bswap16(*(volatile u_int16_t *)(bsh + offset));
>   }
>
>Now, this is not appropriate for the BB adapter.  The byte swapping
>should _not_ be there, and there should also be some additional
>raindancing around the read.  There doesn't seem to be any way to add
>that in a way that is local to the G2 bus though, as the bus_space_tag
>is not used.  (Also, this is in the general sh3 code, where G2 bus
>peculiarities do not belong...)

	sorry if my memory is mixed up with something.  these bswap()s were
	leftover for mmeye isa bus workaround (mmeye = big endian,
	isa = little).  i believe it okay to remove those, and we'd need to
	fix mmeye later (if you could, please copy the current
	sys/arch/sh3/bus.h into sys/arch/mmeye/include/bus.h, then change
	sys/arch/sh3/bus.h, then we do not break anything).

	horiuchi@brains.co.jp should have better memory than me.

itojun