Lines Matching +full:board +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * eisa_enumerator.c - provide support for EISA adapters in PA-RISC machines
36 * little-endian on the big-endian PAROSC */
54 static void print_eisa_id(char *s, u_int32_t id) in print_eisa_id() argument
60 rev = id & 0xff; in print_eisa_id()
61 id >>= 8; in print_eisa_id()
62 device = id & 0xff; in print_eisa_id()
63 id >>= 8; in print_eisa_id()
65 vendor[2] = '@' + (id & 0x1f); in print_eisa_id()
66 id >>= 5; in print_eisa_id()
67 vendor[1] = '@' + (id & 0x1f); in print_eisa_id()
68 id >>= 5; in print_eisa_id()
69 vendor[0] = '@' + (id & 0x1f); in print_eisa_id()
70 id >>= 5; in print_eisa_id()
92 res->name = name; in configure_memory()
93 res->start = mem_parent->start + get_24(buf+len+2); in configure_memory()
94 res->end = res->start + get_16(buf+len+5)*1024; in configure_memory()
95 res->flags = IORESOURCE_MEM; in configure_memory()
168 char *board) in configure_port() argument
182 res->name = board; in configure_port()
183 res->start = get_16(buf+len+1); in configure_port()
184 res->end = get_16(buf+len+1)+(c&HPEE_PORT_SIZE_MASK)+1; in configure_port()
185 res->flags = IORESOURCE_IO; in configure_port()
206 * I assume that there are and- and or- masks
303 /* the init field seems to be a two-byte field in configure_function()
304 * which is non-zero if there are an other function following in configure_function()
326 char *board; in parse_slot_config() local
329 if (NULL == (board = kmalloc(8, GFP_KERNEL))) { in parse_slot_config()
330 return -1; in parse_slot_config()
332 print_eisa_id(board, es->eisa_slot_id); in parse_slot_config()
334 slot, board, es->flags&HPEE_FLAG_BOARD_IS_ISA ? "ISA" : "EISA"); in parse_slot_config()
336 maxlen = es->config_data_length < HPEE_MAX_LENGTH ? in parse_slot_config()
337 es->config_data_length : HPEE_MAX_LENGTH; in parse_slot_config()
338 while ((pos < maxlen) && (num_func <= es->num_functions)) { in parse_slot_config()
355 printk("function %d have free-form configuration, skipping ", in parse_slot_config()
375 pos += configure_memory(buf+pos, mem_parent, board); in parse_slot_config()
388 pos += configure_port(buf+pos, io_parent, board); in parse_slot_config()
398 num_func, pos-p0, function_len); in parse_slot_config()
399 res=-1; in parse_slot_config()
406 kfree(board); in parse_slot_config()
409 if (pos != es->config_data_length) { in parse_slot_config()
411 pos, es->config_data_length); in parse_slot_config()
412 res=-1; in parse_slot_config()
415 if (num_func != es->num_functions) { in parse_slot_config()
417 num_func, es->num_functions); in parse_slot_config()
418 res=-2; in parse_slot_config()
427 unsigned int id; in init_slot() local
431 if (!(es->slot_info&HPEE_SLOT_INFO_NO_READID)) { in init_slot()
432 /* try to read the id of the board in the slot */ in init_slot()
433 id = le32_to_cpu(inl(SLOT2PORT(slot)+EPI)); in init_slot()
435 if (0xffffffff == id) { in init_slot()
437 if (es->eisa_slot_id == 0xffffffff) in init_slot()
438 return -1; in init_slot()
440 /* this board is not here or it does not in init_slot()
443 printk(KERN_ERR "EISA slot %d a configured board was not detected (", in init_slot()
446 print_eisa_id(id_string, es->eisa_slot_id); in init_slot()
449 return -1; in init_slot()
452 if (es->eisa_slot_id != id) { in init_slot()
453 print_eisa_id(id_string, id); in init_slot()
454 printk(KERN_ERR "EISA slot %d id mismatch: got %s", in init_slot()
457 print_eisa_id(id_string, es->eisa_slot_id); in init_slot()
460 return -1; in init_slot()
465 /* now: we need to enable the board if in init_slot()
470 if (es->slot_features & HPEE_SLOT_FEATURES_ENABLE) { in init_slot()
471 /* enable board */ in init_slot()
494 for (i=0;i<eh->num_slots;i++) { in eisa_enumerator()
500 if (-1==init_slot(i+1, es)) { in eisa_enumerator()
504 if (es->config_data_offset < HPEE_MAX_LENGTH) { in eisa_enumerator()
505 if (parse_slot_config(i+1, &eeprom_buf[es->config_data_offset], in eisa_enumerator()
507 return -1; in eisa_enumerator()
510 printk (KERN_WARNING "EISA EEPROM offset 0x%x out of range\n",es->config_data_offset); in eisa_enumerator()
511 return -1; in eisa_enumerator()
514 return eh->num_slots; in eisa_enumerator()