tech-kern archive

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

Re: Early console attach vs PCI_NETBSD_CONFIGURE

Michael wrote:
On Aug 1, 2009, at 4:10 PM, Gavan Fantom wrote:
NetBSD reconfigures the PCI bus early on during boot, so the base addresses of the devices can and do move around from the way RISC OS chose to lay out the bus.

Why do you reconfigure the bus? Any chance to leave the graphics card alone?

Way back when, RISC OS had configured the bus into an address space that wasn't going to work with NetBSD.

Having said that, we've switched the address space around a bit since then so I shall have to have another look at where RISC OS has ended up configuring the bus.

I'd like to attach the console early so that we can get early boot messages appearing on the screen, but the problem is that if I do that then the base address of the graphics card will move during autoconfiguration and genfb will be left writing kernel messages to memory which may not be backed by an actual framebuffer.

As I said - any way to avoid that? Otherwise you'd have to shut up the console during PCI reconfiguration and hand it the new fb address somehow.

As above, there might be a way to avoid it. But it still seems useful in general to be able to shut up the console and give it a new address.

I can't see an obvious hook where I can reattach genfb with the new address, and setup_memwins (in pci/pciconf.c) is peppered with calls to printf guarded by pci_conf_debug. Given that after changing the base address of the framebuffer and before reattaching the console a printf could be fatal, I don't think simply reattaching after pciconf has done its thing is enough.

When genfb at pci attaches the reconfiguration dance should be long done. You want something that works much earlier ;)

Exactly. :)

I'm reluctant to add a hook that will be called immediately after changing every single base address register, but that's the only way I can think of right now.

Is there a better way to do this?

If there is no output during PCI reconfiguration just add hooks right before and right after.
Why is it even necessary?

There is output, if you have debugging turned on. The very fact that there are calls in the code, even if they are conditionalised, makes me reluctant to write code that would make those calls dangerous.

Home | Main Index | Thread Index | Old Index