AHBPROT and its consequences

113 views
Skip to first unread message

lewurm

unread,
Aug 29, 2009, 7:21:47 PM8/29/09
to bootmii-devel
heyho,

after I read the great write-up from bushing on hackmii about AHBPROT,
several thoughts came up:

First, MINI isn't as important as I always thought; in fact it is an
indirect route for many things (e.g. controller, AES, ...), so the
proper way to use AHB devices would be to implement it directly on PPC-
side, right?
Looking for example at the MINI implementation of AES (in crypto.c):
AES is an AHB device, so you have to deal with cache issues (and the
mysterious ahb_flush_to function :O). How to deal with that on PPC-
side?
Make further IPC calls and let MINI do this? Or someone figured out
how this is directly done with Broadway?


Second, how to handle interrupts on PPC-side? (for my particular case
{O,E}HCI interrupts)
On wiibrew I found this: http://wiibrew.org/wiki/Hardware/Hollywood_IRQs
Great, Hollywood provides the interrupts for PPC too. But wait; sadly
in ppcskel is no IRQ handler (like it is in MINI).
Polling would be an option, but... heh. According to wiibrew you have
to catch IRQ #14 of the "Processor Interface" (the unused one here?
http://hitmen.c02.at/files/yagcd/yagcd/chap5.html#sec5.4 )
So I thought may I'm feeling lucky inspecting the libogc and find some
appropriate code for that. However, my hunt failed. May I overlooked
it, but more likely it just doesn't exist in libogc (otherwise it
would be documented on wiibrew?)

Well, anyone else spend some time on that? Or is there a better way to
implement that?
And, unfortunately, I'm a PPC noob (erm, no. I'm a noob at all :/),
may someone (=segher?) could provide some cool documentation about
PPC&Co?


thanks in advance :)
lewurm


PS: an common ppcskel git repository would be nice :)

theStack

unread,
Sep 4, 2009, 11:36:15 AM9/4/09
to bootmii-devel
Hey lewurm,

to make a long story short:
* according to isobel (mike developer), ahb-flushing is not needed
from the ppc, so you don't have to care with that
* regarding interrupts: there is in fact already a handler, see
exception.c, exception_handler(), all you have to do is to check
whether the exception is in fact an external interrupt (exception ==
0x500)
* of course you have to enable interrupts, you can e.g. use the
_CPU_ISR_Enable() macro from libogc for this purpose which sets the
right bit in the ppcs machine state register

However, in my experiments I found out that you have to enable the
interrupts every time again at the end of the interrupt handling
routine - is this some ppc specific stuff or does anyone know more
about this?

Greetings,
theStack
Reply all
Reply to author
Forward
0 new messages