Changes in uspace/drv/ohci/hc.c [c8eddf4:3e4f2e0] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/hc.c

    rc8eddf4 r3e4f2e0  
    4040#include <usb/usb.h>
    4141#include <usb/ddfiface.h>
    42 #include <usb/usbdevice.h>
    4342
    4443#include "hc.h"
     
    4948static int interrupt_emulator(hc_t *instance);
    5049static void hc_gain_control(hc_t *instance);
    51 static void hc_init_hw(hc_t *instance);
    5250static int hc_init_transfer_lists(hc_t *instance);
    5351static int hc_init_memory(hc_t *instance);
     
    9290                usb_log_error("Failed add root hub match-id.\n");
    9391        }
     92        ret = ddf_fun_bind(hub_fun);
    9493        return ret;
    9594}
    9695/*----------------------------------------------------------------------------*/
    97 int hc_init(hc_t *instance, ddf_fun_t *fun, ddf_dev_t *dev,
    98     uintptr_t regs, size_t reg_size, bool interrupts)
     96int hc_init(hc_t *instance, uintptr_t regs, size_t reg_size, bool interrupts)
    9997{
    10098        assert(instance);
     
    111109            ret, str_error(ret));
    112110
     111        list_initialize(&instance->pending_batches);
    113112        usb_device_keeper_init(&instance->manager);
    114113        ret = usb_endpoint_manager_init(&instance->ep_manager,
     
    117116            str_error(ret));
    118117
    119         hc_gain_control(instance);
    120118        ret = hc_init_memory(instance);
    121119        CHECK_RET_RETURN(ret, "Failed to create OHCI memory structures: %s.\n",
    122120            str_error(ret));
    123         hc_init_hw(instance);
     121#undef CHECK_RET_RETURN
     122
     123
     124//      hc_init_hw(instance);
     125        hc_gain_control(instance);
    124126        fibril_mutex_initialize(&instance->guard);
    125127
     
    132134        }
    133135
    134         list_initialize(&instance->pending_batches);
    135 #undef CHECK_RET_RETURN
    136136        return EOK;
    137137}
     
    287287{
    288288        assert(instance);
    289         usb_log_debug("OHCI interrupt: %x.\n", status);
     289        usb_log_debug("OHCI(%p) interrupt: %x.\n", instance, status);
    290290        if ((status & ~I_SF) == 0) /* ignore sof status */
    291291                return;
     
    339339            (uint32_t*)((char*)instance->registers + 0x100);
    340340        usb_log_debug("OHCI legacy register %p: %x.\n",
    341                 ohci_emulation_reg, *ohci_emulation_reg);
    342         *ohci_emulation_reg &= ~0x1;
     341            ohci_emulation_reg, *ohci_emulation_reg);
     342        /* Do not change A20 state */
     343        *ohci_emulation_reg &= 0x100;
     344        usb_log_debug("OHCI legacy register %p: %x.\n",
     345            ohci_emulation_reg, *ohci_emulation_reg);
    343346
    344347        /* Interrupt routing enabled => smm driver is active */
     
    350353                }
    351354                usb_log_info("SMM driver: Ownership taken.\n");
     355                instance->registers->control &= (C_HCFS_RESET << C_HCFS_SHIFT);
     356                async_usleep(50000);
    352357                return;
    353358        }
     
    375380}
    376381/*----------------------------------------------------------------------------*/
    377 void hc_init_hw(hc_t *instance)
     382void hc_start_hw(hc_t *instance)
    378383{
    379384        /* OHCI guide page 42 */
     
    474479{
    475480        assert(instance);
     481
     482        bzero(&instance->rh, sizeof(instance->rh));
    476483        /* Init queues */
    477484        hc_init_transfer_lists(instance);
Note: See TracChangeset for help on using the changeset viewer.