Lines Matching +full:0 +full:x01010000

52 #define WRONG_BUS_FREQUENCY 0x07
56 u8 rc = 0; in handle_switch_change()
62 return 0; in handle_switch_change()
67 for (hp_slot = 0; hp_slot < 6; hp_slot++) { in handle_switch_change()
68 if (change & (0x1L << hp_slot)) { in handle_switch_change()
73 (hp_slot + ctrl->slot_device_offset), 0); in handle_switch_change()
85 func->presence_save = (temp_word >> hp_slot) & 0x01; in handle_switch_change()
86 func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; in handle_switch_change()
88 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in handle_switch_change()
93 func->switch_save = 0; in handle_switch_change()
101 func->switch_save = 0x10; in handle_switch_change()
130 u8 rc = 0; in handle_presence_change()
138 return 0; in handle_presence_change()
144 dbg(" Changed bits are 0x%4.4x\n", change); in handle_presence_change()
146 for (hp_slot = 0; hp_slot < 6; hp_slot++) { in handle_presence_change()
147 if (change & (0x0101 << hp_slot)) { in handle_presence_change()
152 (hp_slot + ctrl->slot_device_offset), 0); in handle_presence_change()
162 return 0; in handle_presence_change()
169 temp_byte = (temp_word >> hp_slot) & 0x01; in handle_presence_change()
170 temp_byte |= (temp_word >> (hp_slot + 7)) & 0x02; in handle_presence_change()
202 func->presence_save = (temp_word >> hp_slot) & 0x01; in handle_presence_change()
203 func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; in handle_presence_change()
205 if ((!(ctrl->ctrl_int_comp & (0x010000 << hp_slot))) || in handle_presence_change()
206 (!(ctrl->ctrl_int_comp & (0x01000000 << hp_slot)))) { in handle_presence_change()
224 u8 rc = 0; in handle_power_fault()
229 return 0; in handle_power_fault()
237 for (hp_slot = 0; hp_slot < 6; hp_slot++) { in handle_power_fault()
238 if (change & (0x01 << hp_slot)) { in handle_power_fault()
243 (hp_slot + ctrl->slot_device_offset), 0); in handle_power_fault()
251 if (ctrl->ctrl_int_comp & (0x00000100 << hp_slot)) { in handle_power_fault()
255 func->status = 0x00; in handle_power_fault()
283 func->status = 0xFF; in handle_power_fault()
308 return 0; in sort_by_size()
311 out_of_order = 0; in sort_by_size()
338 return 0; in sort_by_size()
356 return 0; in sort_by_max_size()
359 out_of_order = 0; in sort_by_max_size()
386 return 0; in sort_by_max_size()
591 if (node->base & 0x300L) in get_io_resource()
811 * Returns %0 if success.
827 return 0; /* only one item on the list, already sorted! */ in cpqhp_resource_sort_and_combine()
829 dbg("*head->base = 0x%x\n", (*head)->base); in cpqhp_resource_sort_and_combine()
830 dbg("*head->next->base = 0x%x\n", (*head)->next->base); in cpqhp_resource_sort_and_combine()
832 out_of_order = 0; in cpqhp_resource_sort_and_combine()
873 return 0; in cpqhp_resource_sort_and_combine()
880 u8 schedule_flag = 0; in cpqhp_ctrl_intr()
890 if (!(misc & 0x000C)) in cpqhp_ctrl_intr()
893 if (misc & 0x0004) { in cpqhp_ctrl_intr()
899 misc |= 0x0004; in cpqhp_ctrl_intr()
909 if (misc & 0x0008) { in cpqhp_ctrl_intr()
923 writel(0xFFFFFFFF, ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
925 schedule_flag += handle_switch_change((u8)(Diff & 0xFFL), ctrl); in cpqhp_ctrl_intr()
926 schedule_flag += handle_presence_change((u16)((Diff & 0xFFFF0000L) >> 16), ctrl); in cpqhp_ctrl_intr()
927 schedule_flag += handle_power_fault((u8)((Diff & 0xFF00L) >> 8), ctrl); in cpqhp_ctrl_intr()
931 if (reset & 0x40) { in cpqhp_ctrl_intr()
933 reset &= 0xCF; in cpqhp_ctrl_intr()
981 * Returns %0 if successful, !0 otherwise.
998 return 0; in slot_remove()
1008 return 0; in slot_remove()
1018 * Returns %0 if successful, !0 otherwise.
1026 secondaryBus = (bridge->config_space[0x06] >> 8) & 0xFF; in bridge_slot_remove()
1027 subordinateBus = (bridge->config_space[0x06] >> 16) & 0xFF; in bridge_slot_remove()
1054 return 0; in bridge_slot_remove()
1062 * @index: is %0 for first function found, %1 for the second...
1073 if ((func == NULL) || ((func->device == device) && (index == 0))) in cpqhp_slot_find()
1098 if (((func->config_space[0x03] >> 16) & 0xFF) == 0x01) in is_bridge()
1101 return 0; in is_bridge()
1111 * Returns %0 if we successfully change frequency and/or mode to match the
1124 return 0; in set_controller_speed()
1132 if (get_presence_status(ctrl, slot) == 0) in set_controller_speed()
1139 return 0; in set_controller_speed()
1152 return 0; in set_controller_speed()
1159 return 0; in set_controller_speed()
1163 writel(0x0L, ctrl->hpc_reg + LED_CONTROL); in set_controller_speed()
1164 writeb(0x00, ctrl->hpc_reg + SLOT_ENABLE); in set_controller_speed()
1170 reg = 0xF5; in set_controller_speed()
1172 reg = 0xF4; in set_controller_speed()
1173 pci_write_config_byte(ctrl->pci_dev, 0x41, reg); in set_controller_speed()
1176 reg16 &= ~0x000F; in set_controller_speed()
1179 reg = 0x75; in set_controller_speed()
1180 reg16 |= 0xB; in set_controller_speed()
1183 reg = 0x74; in set_controller_speed()
1184 reg16 |= 0xA; in set_controller_speed()
1187 reg = 0x73; in set_controller_speed()
1188 reg16 |= 0x9; in set_controller_speed()
1191 reg = 0x73; in set_controller_speed()
1192 reg16 |= 0x1; in set_controller_speed()
1195 reg = 0x71; in set_controller_speed()
1199 reg16 |= 0xB << 12; in set_controller_speed()
1205 writel(0, ctrl->hpc_reg + INT_MASK); in set_controller_speed()
1207 pci_write_config_byte(ctrl->pci_dev, 0x41, reg); in set_controller_speed()
1210 reg = ~0xF; in set_controller_speed()
1211 pci_read_config_byte(ctrl->pci_dev, 0x43, &reg); in set_controller_speed()
1212 pci_write_config_byte(ctrl->pci_dev, 0x43, reg); in set_controller_speed()
1234 return 0; in set_controller_speed()
1259 u32 rc = 0; in board_replaced()
1266 if (readl(ctrl->hpc_reg + INT_INPUT_CLEAR) & (0x01L << hp_slot)) in board_replaced()
1287 writeb(0x00, ctrl->hpc_reg + SLOT_POWER); in board_replaced()
1331 if (func->status == 0xFF) { in board_replaced()
1334 func->status = 0; in board_replaced()
1410 u32 temp_register = 0xFFFFFFFF; in board_added()
1411 u32 rc = 0; in board_added()
1434 writeb(0x00, ctrl->hpc_reg + SLOT_POWER); in board_added()
1496 if (func->status == 0xFF) { in board_added()
1498 temp_register = 0xFFFFFFFF; in board_added()
1501 func->status = 0; in board_added()
1509 if (rc != 0) { in board_added()
1511 temp_register = 0xFFFFFFFF; in board_added()
1519 if (temp_register != 0xFFFFFFFF) { in board_added()
1526 rc = configure_new_device(ctrl, func, 0, &res_lists); in board_added()
1558 func->status = 0; in board_added()
1559 func->switch_save = 0x10; in board_added()
1560 func->is_a_board = 0x01; in board_added()
1565 index = 0; in board_added()
1598 return 0; in board_added()
1611 u8 skip = 0; in remove_board()
1635 index = 0; in remove_board()
1651 func->status = 0x01; in remove_board()
1652 func->configured = 0; in remove_board()
1663 temp_byte &= ~(0x01 << hp_slot); in remove_board()
1695 func = cpqhp_slot_find(ctrl->bus, device, 0); in remove_board()
1706 func->function = 0; in remove_board()
1707 func->configured = 0; in remove_board()
1708 func->switch_save = 0x10; in remove_board()
1709 func->is_a_board = 0; in remove_board()
1713 return 0; in remove_board()
1744 return 0; in event_thread()
1755 return 0; in cpqhp_event_start_thread()
1774 change = 0; in interrupt_event_handler()
1776 for (loop = 0; loop < 10; loop++) { in interrupt_event_handler()
1778 if (ctrl->event_queue[loop].event_type != 0) { in interrupt_event_handler()
1781 func = cpqhp_slot_find(ctrl->bus, (hp_slot + ctrl->slot_device_offset), 0); in interrupt_event_handler()
1852 0); in interrupt_event_handler()
1866 ctrl->event_queue[loop].event_type = 0; in interrupt_event_handler()
1895 func = cpqhp_slot_find(p_slot->bus, p_slot->device, 0); in cpqhp_pushbutton_thread()
1902 if (cpqhp_process_SS(ctrl, func) != 0) { in cpqhp_pushbutton_thread()
1917 func = cpqhp_slot_find(p_slot->bus, p_slot->device, 0); in cpqhp_pushbutton_thread()
1925 if (cpqhp_process_SI(ctrl, func) != 0) { in cpqhp_pushbutton_thread()
1949 tempdword = 0; in cpqhp_process_SI()
1958 if (tempdword & (0x01 << hp_slot)) in cpqhp_process_SI()
1973 func->function = 0; in cpqhp_process_SI()
1974 func->configured = 0; in cpqhp_process_SI()
1979 func->presence_save = (temp_word >> hp_slot) & 0x01; in cpqhp_process_SI()
1980 func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; in cpqhp_process_SI()
1982 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in cpqhp_process_SI()
1983 func->switch_save = 0; in cpqhp_process_SI()
1985 func->switch_save = 0x10; in cpqhp_process_SI()
2003 func->function = 0; in cpqhp_process_SI()
2004 func->configured = 0; in cpqhp_process_SI()
2005 func->is_a_board = 0; in cpqhp_process_SI()
2009 func->presence_save = (temp_word >> hp_slot) & 0x01; in cpqhp_process_SI()
2011 (temp_word >> (hp_slot + 7)) & 0x02; in cpqhp_process_SI()
2013 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in cpqhp_process_SI()
2014 func->switch_save = 0; in cpqhp_process_SI()
2016 func->switch_save = 0x10; in cpqhp_process_SI()
2031 u8 index = 0; in cpqhp_process_SS()
2033 u32 rc = 0; in cpqhp_process_SS()
2048 rc = pci_bus_read_config_byte(pci_bus, devfn, 0x0B, &class_code); in cpqhp_process_SS()
2077 func = cpqhp_slot_find(ctrl->bus, device, 0); in cpqhp_process_SS()
2094 * @direction: 1 to start from the left side, 0 to start right.
2101 for (loop = 0; loop < num_of_slots; loop++) { in switch_leds()
2132 num_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0f; in cpqhp_hardware_test()
2141 work_LED = 0x01010101; in cpqhp_hardware_test()
2142 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2144 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2147 work_LED = 0x01010000; in cpqhp_hardware_test()
2149 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2151 work_LED = 0x00000101; in cpqhp_hardware_test()
2153 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2156 work_LED = 0x01010000; in cpqhp_hardware_test()
2158 for (loop = 0; loop < num_of_slots; loop++) { in cpqhp_hardware_test()
2197 return 0; in cpqhp_hardware_test()
2205 * @behind_bridge: 1 if this is a recursive call, 0 if not
2208 * Returns 0 if success.
2224 …rc = pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(func->device, func->function), 0x0E, &temp_… in configure_new_device()
2230 if (temp_byte & 0x80) /* Multi-function device */ in configure_new_device()
2235 function = 0; in configure_new_device()
2242 index = 0; in configure_new_device()
2256 stop_it = 0; in configure_new_device()
2262 pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(func->device, function), 0x00, &ID); in configure_new_device()
2277 new_slot->status = 0; in configure_new_device()
2286 return 0; in configure_new_device()
2300 * @behind_bridge: 1 if this is a recursive call, 0 if not
2304 * Returns 0 if success.
2311 u8 IRQ = 0; in configure_new_function()
2375 temp_byte = 0x40; in configure_new_function()
2384 temp_byte = 0x08; in configure_new_function()
2390 io_node = get_max_resource(&(resources->io_head), 0x1000); in configure_new_function()
2393 mem_node = get_max_resource(&(resources->mem_head), 0x100000); in configure_new_function()
2396 p_mem_node = get_max_resource(&(resources->p_mem_head), 0x100000); in configure_new_function()
2412 irqs.barber_pole = 0; in configure_new_function()
2413 irqs.interrupt[0] = 0; in configure_new_function()
2414 irqs.interrupt[1] = 0; in configure_new_function()
2415 irqs.interrupt[2] = 0; in configure_new_function()
2416 irqs.interrupt[3] = 0; in configure_new_function()
2417 irqs.valid_INT = 0; in configure_new_function()
2420 irqs.interrupt[0] = resources->irqs->interrupt[0]; in configure_new_function()
2497 rc = 0; in configure_new_function()
2500 for (device = 0; (device <= 0x1F) && !rc; device++) { in configure_new_function()
2501 irqs.barber_pole = (irqs.barber_pole + 1) & 0x03; in configure_new_function()
2503 ID = 0xFFFFFFFF; in configure_new_function()
2505 pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, 0), 0x00, &ID); in configure_new_function()
2519 new_slot->function = 0; in configure_new_function()
2521 new_slot->status = 0; in configure_new_function()
2524 dbg("configure_new_device rc=0x%x\n", rc); in configure_new_function()
2532 resources->irqs->interrupt[0] = irqs.interrupt[0]; in configure_new_function()
2539 for (cloop = 0; cloop < 4; cloop++) { in configure_new_function()
2540 if (irqs.valid_INT & (0x01 << cloop)) { in configure_new_function()
2562 if (temp_resources.bus_head->length == 0) { in configure_new_function()
2574 &hold_IO_node, 0x1000); in configure_new_function()
2586 io_node = do_bridge_resource_split(&(temp_resources.io_head), 0x1000); in configure_new_function()
2605 temp_word = 0x0000; in configure_new_function()
2625 &hold_mem_node, 0x100000); in configure_new_function()
2637 mem_node = do_bridge_resource_split(&(temp_resources.mem_head), 0x100000); in configure_new_function()
2657 temp_word = 0x0000; in configure_new_function()
2677 &hold_p_mem_node, 0x100000); in configure_new_function()
2689 p_mem_node = do_bridge_resource_split(&(temp_resources.p_mem_head), 0x100000); in configure_new_function()
2708 temp_word = 0x0000; in configure_new_function()
2729 command = 0x0157; /* = PCI_COMMAND_IO | in configure_new_function()
2738 command = 0x07; /* = PCI_BRIDGE_CTL_PARITY | in configure_new_function()
2744 rc = pci_bus_read_config_byte(pci_bus, devfn, 0x0B, &class_code); in configure_new_function()
2751 for (cloop = 0x10; cloop <= 0x24; cloop += 4) { in configure_new_function()
2752 temp_register = 0xFFFFFFFF; in configure_new_function()
2758 dbg("CND: base = 0x%x\n", temp_register); in configure_new_function()
2761 if ((temp_register & 0x03L) == 0x01) { in configure_new_function()
2765 base = temp_register & 0xFFFFFFFC; in configure_new_function()
2768 dbg("CND: length = 0x%x\n", base); in configure_new_function()
2780 } else if ((temp_register & 0x0BL) == 0x08) { in configure_new_function()
2782 base = temp_register & 0xFFFFFFF0; in configure_new_function()
2785 dbg("CND: length = 0x%x\n", base); in configure_new_function()
2796 } else if ((temp_register & 0x0BL) == 0x00) { in configure_new_function()
2798 base = temp_register & 0xFFFFFFF0; in configure_new_function()
2801 dbg("CND: length = 0x%x\n", base); in configure_new_function()
2820 if ((temp_register & 0x07L) == 0x04) { in configure_new_function()
2827 base = 0; in configure_new_function()
2842 (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) { in configure_new_function()
2845 resources->irqs->barber_pole - 1) & 0x03]; in configure_new_function()
2848 rc = pci_bus_read_config_byte(pci_bus, devfn, 0x0B, &class_code); in configure_new_function()
2867 resources->irqs->interrupt[(temp_byte + resources->irqs->barber_pole - 1) & 0x03] = IRQ; in configure_new_function()
2868 resources->irqs->valid_INT |= 0x01 << (temp_byte + resources->irqs->barber_pole - 1) & 0x03; in configure_new_function()
2872 temp_byte = 0x40; in configure_new_function()
2877 temp_byte = 0x08; in configure_new_function()
2882 temp_dword = 0x00L; in configure_new_function()
2887 temp_word = 0x0157; /* = PCI_COMMAND_IO | in configure_new_function()
2902 return 0; in configure_new_function()