Olivier Houchard wrote:
Hi Olivier,

I have tried the patch and here are the boot results:

<SNIP>

I fail to see how it happens.
Could you printf the value of sc->sc_mem once set in i80321_pci_attach(),
and if it appears to be 0, the value of i80321_softc->sc_owin[0].owin_xlate_lo at the different points it can be set ?

Thanks a lot,

Olivier

Hi Olivier,

I have been working though this with Mark Tinguely and we came up with this patch that makes it work. Not sure on its correctness but it works.

Tom


Index: i80321_pci.c
===================================================================
--- i80321_pci.c        (revision 197735)
+++ i80321_pci.c        (working copy)
@@ -92,8 +92,7 @@
        sc->sc_busno = busno;
        sc->sc_pciio = &i80321_softc->sc_pci_iot;
        sc->sc_pcimem = &i80321_softc->sc_pci_memt;
-       sc->sc_mem = i80321_softc->sc_owin[0].owin_xlate_lo +
-           VERDE_OUT_XLATE_MEM_WIN_SIZE;
+       sc->sc_mem = i80321_softc->sc_owin[0].owin_xlate_lo;
        
        sc->sc_io = i80321_softc->sc_iow_vaddr;
        /* Initialize memory and i/o rmans. */
@@ -110,7 +109,8 @@
        sc->sc_mem_rman.rm_descr = "I80321 PCI Memory";
        if (rman_init(&sc->sc_mem_rman) != 0 ||
            rman_manage_region(&sc->sc_mem_rman, 
-           0, VERDE_OUT_XLATE_MEM_WIN_SIZE) != 0) {
+           VERDE_OUT_XLATE_MEM_WIN0_BASE,
+               VERDE_OUT_XLATE_MEM_WIN0_BASE + VERDE_OUT_XLATE_MEM_WIN_SIZE) 
!= 0) {
                panic("i80321_pci_probe: failed to set up memory rman");
        }
        sc->sc_irq_rman.rm_type = RMAN_ARRAY;
@@ -297,6 +297,9 @@
                    sc->sc_mem;
                start &= (0x1000000 - 1);
                end &= (0x1000000 - 1);
+               start += 0x80000000;
+               end += 0x80000000;
+               device_printf(child, "SYS_RES_MEMORY: start: 0x%08lX end: 
0x%08lX\n",start,end); 
                break;
        case SYS_RES_IOPORT:
                rm = &sc->sc_io_rman;
@@ -312,12 +315,15 @@
        }
 
        rv = rman_reserve_resource(rm, start, end, count, flags, child);
+       device_printf(child, "RMAN_RESERVE_RESOURCE: start: 0x%08lX end: 
0x%08lX\n",
+               rman_get_start(rv),
+               rman_get_end(rv)); 
        if (rv == NULL)
                return (NULL);
        rman_set_rid(rv, *rid);
        if (type != SYS_RES_IRQ) {
                if (type == SYS_RES_MEMORY)
-                       bh += (rman_get_start(rv));
+                       bh = (rman_get_start(rv));
                rman_set_bustag(rv, bt);
                rman_set_bushandle(rv, bh);
                if (flags & RF_ACTIVE) {
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to