Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 50362c6 in mainline


Ignore:
Timestamp:
2015-06-29T03:14:27Z (6 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
a996402e
Parents:
f6f2a5f7
Message:

ehci, ep list: stop using list_head_pa.

Location:
uspace/drv/bus/usb/ehci
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/endpoint_list.c

    rf6f2a5f7 r50362c6  
    6060                return ENOMEM;
    6161        }
    62         /* Make sure the address translation exists by initializing first */
    6362        qh_init(instance->list_head, NULL);
    6463
    65         instance->list_head_pa = addr_to_phys(instance->list_head);
    6664        list_initialize(&instance->endpoint_list);
    67         usb_log_debug2("Transfer list %s setup with ED: %p(0x%0" PRIx32 ")).\n",
    68             name, instance->list_head, instance->list_head_pa);
     65        usb_log_debug2("Transfer list %s setup with ED: %p(%x).\n",
     66            name, instance->list_head, addr_to_phys(instance->list_head));
    6967
    7068        fibril_mutex_initialize(&instance->guard);
     
    7977        assert(next->list_head);
    8078
    81         instance->list_head->horizontal = LINK_POINTER_QH(next->list_head_pa);
     79        qh_append_qh(instance->list_head, next->list_head);
    8280}
    8381
     
    127125                ep, instance->name, first, first->qh);
    128126        if (last_qh == instance->list_head) {
    129                 usb_log_debug2("%s head ED(%p-0x%0" PRIx32 "): %x:%x.\n",
    130                     instance->name, last_qh, instance->list_head_pa,
     127                usb_log_debug2("%s head ED(%p-%x): %x:%x.\n",
     128                    instance->name, last_qh, addr_to_phys(instance->list_head),
    131129                    last_qh->status, last_qh->horizontal);
    132130        }
  • uspace/drv/bus/usb/ehci/endpoint_list.h

    rf6f2a5f7 r50362c6  
    5050        /** EHCI hw structure at the beginning of the queue */
    5151        qh_t *list_head;
    52         /** Physical address of the first(dummy) ED */
    53         uint32_t list_head_pa;
    5452        /** Assigned name, provides nicer debug output */
    5553        const char *name;
     
    6967        free32(instance->list_head);
    7068        instance->list_head = NULL;
    71         instance->list_head_pa = 0;
    7269}
    7370
  • uspace/drv/bus/usb/ehci/hc.c

    rf6f2a5f7 r50362c6  
    392392        /* Enable periodic list */
    393393        assert(instance->periodic_list_base);
    394         const uintptr_t phys_base =
     394        uintptr_t phys_base =
    395395            addr_to_phys((void*)instance->periodic_list_base);
    396396        assert((phys_base & USB_PERIODIC_LIST_BASE_MASK) == phys_base);
     
    400400
    401401        /* Enable Async schedule */
    402         assert((instance->async_list.list_head_pa & USB_ASYNCLIST_MASK) ==
    403             instance->async_list.list_head_pa);
    404         EHCI_WR(instance->registers->asynclistaddr,
    405             instance->async_list.list_head_pa);
     402        phys_base = addr_to_phys((void*)instance->async_list.list_head);
     403        assert((phys_base & USB_ASYNCLIST_MASK) == phys_base);
     404        EHCI_WR(instance->registers->asynclistaddr, phys_base);
    406405        EHCI_SET(instance->registers->usbcmd, USB_CMD_ASYNC_SCHEDULE_FLAG);
    407406
     
    434433                return ret;
    435434        }
     435        /* Specs say "Software must set queue head horizontal pointer T-bits to
     436         * a zero for queue heads in the asynchronous schedule" (4.4.0).
     437         * So we must maintain circular buffer (all horizontal pointers
     438         * have to be valid */
     439        endpoint_list_chain(&instance->async_list, &instance->async_list);
    436440
    437441        ret = endpoint_list_init(&instance->int_list, "INT");
     
    441445                return ret;
    442446        }
    443         /* Loop async list */
    444         endpoint_list_chain(&instance->async_list, &instance->async_list);
    445447
    446448        /* Take 1024 periodic list heads, we ignore low mem options */
     
    457459                /* Disable everything for now */
    458460                instance->periodic_list_base[i] =
    459                     LINK_POINTER_QH(instance->int_list.list_head_pa);
     461                    LINK_POINTER_QH(addr_to_phys(instance->int_list.list_head));
    460462        }
    461463        return EOK;
Note: See TracChangeset for help on using the changeset viewer.