1 /* Very basic bootstrap for Poseidon in AROS kernel for enabling of USB booting and HID devices.
2 * PsdStackloader should be started during startup-sequence nonetheless */
4 #include <aros/asmcall.h>
5 #include <aros/debug.h>
6 #include <aros/symbolsets.h>
7 #include <exec/resident.h>
8 #include <proto/poseidon.h>
9 #include <proto/exec.h>
11 int __startup
usbromstartup_entry(void)
16 static const char name
[];
17 static const char version
[];
18 static const UBYTE endptr
;
20 AROS_UFP3(static IPTR
, usbromstartup_init
,
21 AROS_UFHA(ULONG
, dummy
, D0
),
22 AROS_UFHA(BPTR
, seglist
, A0
),
23 AROS_UFHA(struct ExecBase
*, SysBase
, A6
));
25 const struct Resident usbHook
=
28 (struct Resident
*)&usbHook
,
36 (APTR
)usbromstartup_init
39 static const char name
[] = "Poseidon ROM starter";
40 static const char version
[] = "$VER:Poseidon ROM startup v41.1";
42 AROS_UFH3(static IPTR
, usbromstartup_init
,
43 AROS_UFHA(ULONG
, dummy
, D0
),
44 AROS_UFHA(BPTR
, seglist
, A0
),
45 AROS_UFHA(struct ExecBase
*, SysBase
, A6
))
50 struct PsdHardware
*phw
;
53 D(bug("[USBROMStartup] Loading poseidon...\n"));
55 if((ps
= OpenLibrary("poseidon.library", 4)))
61 D(bug("[USBROMStartup] Adding classes...\n"));
63 psdAddClass("hub.class", 0);
64 if(!(psdAddClass("hid.class", 0)))
66 psdAddClass("bootmouse.class", 0);
67 psdAddClass("bootkeyboard.class", 0);
69 msdclass
= psdAddClass("massstorage.class", 0);
71 /* now this finds all usb hardware pci cards */
72 while((phw
= psdAddHardware("pciusb.device", cnt
)))
74 D(bug("[USBROMStartup] Added pciusb.device unit %u\n", cnt
));
76 psdEnumerateHardware(phw
);
81 /* now this finds all other usb hardware pci cards */
82 while((phw
= psdAddHardware("ehci.device", cnt
)))
84 D(bug("[USBROMStartup] Added ehci.device unit %u\n", cnt
));
86 psdEnumerateHardware(phw
);
90 while((phw
= psdAddHardware("ohci.device", cnt
)))
92 D(bug("[USBROMStartup] Added ohci.device unit %u\n", cnt
));
94 psdEnumerateHardware(phw
);
98 while((phw
= psdAddHardware("uhci.device", cnt
)))
100 D(bug("[USBROMStartup] Added uhci.device unit %u\n", cnt
));
102 psdEnumerateHardware(phw
);
107 D(bug("[USBROMStartup] Scanning classes...\n"));
112 psdDelayMS(1000); // wait for hubs to settle
113 psdGetAttrs(PGA_USBCLASS
, msdclass
, UCA_UseCount
, &usecount
, TAG_END
);
116 psdAddErrorMsg(RETURN_OK
, (STRPTR
)name
,
117 "Delaying further execution by %ld second(s) (boot delay).",
121 psdDelayMS((bootdelay
-1)*1000);
124 psdAddErrorMsg(RETURN_OK
, (STRPTR
)name
, "Boot delay skipped, no mass storage devices found.");
135 static const UBYTE endptr
= 0;