Port-amiga archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Having trouble with two active wscons drivers, wskbd stops working on console
Alain Runa wrote:
> Thank you very much for your feedback, it was very helpful. I was
> missing the kbd_cnattach() call in my zzfb_cninit() function.
Great! (I didn't expect that.) :)
> that the driver is working in various different setups and
> configurations, with the exception when there is no ZZ9000 card present
> in the Amiga, then the kernel will just lock up. I tracked down the
> issue to my zzfb_cnprobe() function:
>
> void zzfb_cnprobe(struct consdev *cd) {
> #ifdef ZZFB_CONSOLE
> cd->cn_pri = CN_INTERNAL;
> cd->cn_dev = NODEV;
> #endif /* ZZFB_CONSOLE */
> }
That's certainly wrong. You can do so in amidisplaycc, because the custom
chipset is always there, but otherwise a device's console probe should only
be successful when the device exists and is alive. Otherwise return
CN_DEAD.
> This function is called during kernel startup to prioritize the early
> console way before the Zorro bus and its cards get probed and
> initialized. zzfb_cnprobe() will be always called, independently if
> there is a ZZ9000 installed in the system or not and claim the early
> console for the zz9k_fb. But if the zzfb_match() fails to find the
> Zorro card later, there will be no zz9k_fb console available, and the
> kernel locks up.
Note that, because of the problem of early console initialization, the auto
configuration of devices will be performed twice on the Amiga. First with
amiga_realconfig=0, for potential console devices only, and then for real
with amiga_realconfig=1.
dev/zbus.c only considers those devices in the amiga_realconfig=0 pass,
which have been entered in the prefconftab[].
This means your zzfb_match() and zzfb_attach() functions should be called
twice. In zzfb_match() you can differentiate using amiga_realconfig and in
zzfb_attach() you can check if the second argument (device_t self) is NULL,
so you don't initialize the card twice.
The preconfiguration pass runs before calling cnprobe, so you should know
whether your board has been initialized correctly.
> I think this is the very same reason why the MNTVA (MNT VA2000) driver
> has not set the option MNTVA_CONSOLE as default in the WSCONS kernel
> config file.
That should be fixed similarly then.
--
Frank Wille
Home |
Main Index |
Thread Index |
Old Index