On 19/03/11 12:11, Mark Cave-Ayland wrote:
At the moment I'm really struggling to find out why the IOMMU mapping isn't being setup, and since this is being managed by the Solaris kernel it's hard to see how OpenBIOS is having an effect on this (unless of course it is influenced indirectly by various OBP properties). Anyone have any more ideas?
Arrrgh - okay I've finally managed to figure this one out after a *lot* of hours. It seems that the romvec memory allocation routines have a physical alignment requirement. What was happening was that the value being written to the IOMMU base register was incorrectly aligned, and hence the value was being altered due to QEMU's hw/sun4m_iommu.c's IOMMU_BASE_MASK. Thus the mapping was happening but because the IOMMU page table base address was wrong, the mapping was being made at the wrong physical address in the IOMMU page table.
I currently have a "hack" fix to OpenBIOS which involves changes to both arch/sparc32/lib.c and OFMEM, but I think I can rework it so that I can get away with just changing lib.c. I'll try and post a patch later this evening.