Print this page
Customize reset for HPE iLO

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/usb/hcd/ehci/ehci_util.c
          +++ new/usr/src/uts/common/io/usb/hcd/ehci/ehci_util.c
↓ open down ↓ 979 lines elided ↑ open up ↑
 980  980                      ehcip->ehci_intr_cnt);
 981  981          } else {
 982  982                  /* Call ddi_intr_enable for MSI or FIXED interrupts */
 983  983                  for (i = 0; i < ehcip->ehci_intr_cnt; i++)
 984  984                          (void) ddi_intr_enable(ehcip->ehci_htable[i]);
 985  985          }
 986  986  
 987  987          return (DDI_SUCCESS);
 988  988  }
 989  989  
      990 +/*
      991 + * ehci_wait_reset
      992 + *
      993 + * wait specified time for chip to reset
      994 + * with workaround of 250us for HPE iLO chip
      995 + */
      996 +static void
      997 +ehci_wait_reset(ehci_state_t *ehcip, clock_t microsecs)
      998 +{
      999 +        /* Wait specified times for reset to complete */
     1000 +        drv_usecwait(microsecs);
 990 1001  
     1002 +        if (ehcip->ehci_vendor_id == PCI_VENDOR_HP) {
     1003 +                for (int i = 10; i < 250; i += 10) {
     1004 +                        /* Wait 10ms for reset to complete */
     1005 +                        drv_usecwait(EHCI_RESET_TIMEWAIT);
     1006 +                }
     1007 +        }
     1008 +}
     1009 +
 991 1010  /*
 992 1011   * ehci_init_hardware
 993 1012   *
 994 1013   * take control from BIOS, reset EHCI host controller, and check version, etc.
 995 1014   */
 996 1015  int
 997 1016  ehci_init_hardware(ehci_state_t *ehcip)
 998 1017  {
 999 1018          int                     revision;
1000 1019          uint16_t                cmd_reg;
↓ open down ↓ 23 lines elided ↑ open up ↑
1024 1043          /* set Memory Master Enable */
1025 1044          cmd_reg = pci_config_get16(ehcip->ehci_config_handle, PCI_CONF_COMM);
1026 1045          cmd_reg |= (PCI_COMM_MAE | PCI_COMM_ME);
1027 1046          pci_config_put16(ehcip->ehci_config_handle, PCI_CONF_COMM, cmd_reg);
1028 1047  
1029 1048          /* Reset the EHCI host controller */
1030 1049          Set_OpReg(ehci_command,
1031 1050              Get_OpReg(ehci_command) | EHCI_CMD_HOST_CTRL_RESET);
1032 1051  
1033 1052          /* Wait 10ms for reset to complete */
1034      -        drv_usecwait(EHCI_RESET_TIMEWAIT);
     1053 +        ehci_wait_reset(ehcip, EHCI_RESET_TIMEWAIT);
1035 1054  
1036 1055          ASSERT(Get_OpReg(ehci_status) & EHCI_STS_HOST_CTRL_HALTED);
1037 1056  
1038 1057          /* Verify the version number */
1039 1058          revision = Get_16Cap(ehci_version);
1040 1059  
1041 1060          USB_DPRINTF_L3(PRINT_MASK_ATTA, ehcip->ehci_log_hdl,
1042 1061              "ehci_init_hardware: Revision 0x%x", revision);
1043 1062  
1044 1063          /*
↓ open down ↓ 2764 lines elided ↑ open up ↑
3809 3828  
3810 3829          /*
3811 3830           * Set the desired interrupt threshold, frame list size (if
3812 3831           * applicable) and turn EHCI host controller.
3813 3832           */
3814 3833          Set_OpReg(ehci_command, ((Get_OpReg(ehci_command) &
3815 3834              ~EHCI_CMD_INTR_THRESHOLD) |
3816 3835              (EHCI_CMD_01_INTR | EHCI_CMD_HOST_CTRL_RUN)));
3817 3836  
3818 3837          /* Wait 10ms for EHCI to start sending SOF */
3819      -        drv_usecwait(EHCI_RESET_TIMEWAIT);
     3838 +        ehci_wait_reset(ehcip, EHCI_RESET_TIMEWAIT);
3820 3839  
3821 3840          /*
3822 3841           * Get the current usb frame number before waiting for
3823 3842           * few milliseconds.
3824 3843           */
3825 3844          before_frame_number = ehci_get_current_frame_number(ehcip);
3826 3845  
3827 3846          /* Wait for few milliseconds */
3828 3847          drv_usecwait(EHCI_SOF_TIMEWAIT);
3829 3848  
↓ open down ↓ 875 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX