Port-amiga archive

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

Re: Work on PCI support :-)



On May 31, 2011, at 7:50 PM, Frank Wille wrote:

> Radoslaw Kujawa wrote:
> 
>> Ok, I've created workaround, by implementing another absm with special
>> bus_space_map, that operates on absolute PA address.
> 
> Sounds like a good idea. Can you give more details?
> 
> You are mapping the absolute address to a KVA, when bus_space_map() is
> called?

It's not (that) clean solution. I'm actually using the mapping done earlier 
with zbusmap. For example:

        sc->pci_mem_area.base = (bus_addr_t) zbusmap(
                (void *) 0xe0000000, 0x02000000);
        sc->pci_mem_area.absm = &amiga_bus_stride_1abs_swap;

This is mapped somewhere into KVA, let's say 0x26ba000. Just as earlier PCI MI 
code calls bus_space_map:

        bus_space_map(pci_mem_area, 0xe1000000, 20000 0);

However, this time bus_space_map is redirected to my new implementation, 
defined in amiga_bus_stride_1abs_swap:

int
oabs(bsm_absolute_)(tag, address, size, flags, handlep)
        bus_space_tag_t tag;
        bus_addr_t address;
        bus_size_t size;
        int flags;
        bus_space_handle_t *handlep;
{
       uint32_t pa = kvtop((void*) tag->base);
        *handlep = tag->base + (address - pa) * AMIGA_SIMPLE_BUS_STRIDE;
        return 0;
} 

Which works, because *handlep = 0x26ba000 + (0xe1000000 - 0xe0000000). So the 
accesses hit VA 0x36ba000 - exaclty where I want :-P. Personally, I think that 
is a workaround, not a real solution. See the attached bus.diff for the details.

> 
>> Still, it does not work as a console, the kernel just dies without a
>> word, somewhere in wsdisplay_cnattach. Probably during/just after
>> setting wsdisplay's cn_tab.
> 
> Nothing in the message buffer, after a reboot?

The case is a bit complicated:
- I don't have any free SCSI disk I could use now with the A3000. FastATA 4000 
driver still isn't completed. I've asked Elbox about some details needed to 
finish the driver, but they never answered my emails. Now I'm coding this PCI 
stuff without ever booting into the userland.
- I own the A1200 + BPPC, which I could use here, but my BVPPC has stopped 
working few weeks ago. No idea what's wrong with it, the machine won't even 
boot with BVPPC attached. It's probably dead :(. Or maybe my A1200 acting up 
again.
- I could access the chipmem from AmigaOS after a reboot and read the message 
buffer this way... But I've never done it before, don't know where to start. I 
guess I must look into it, as it seems the least complicated way now...

I've attached the two diffs, one contains changes to the amiga bus code, the 
other adds PCI support. These are not final, this code needs some serious 
polishing, sanitizing, error checking, etc (which will take a few weeks...).

Attachment: bus.diff
Description: Binary data

Attachment: pci.diff
Description: Binary data

--
Best regards,
Radosław Kujawa



Home | Main Index | Thread Index | Old Index