Lines Matching refs:glue
32 glue - glue to interconnect and test hardware ports
38 The glue device provides two functions. Firstly, it provides a
43 Glue devices have a variable number of big endian <<output>>
58 <<glue>>: In addition to driving its output interrupt port with any
63 <<glue-and>>: The bit-wise AND of the interrupt inputs is computed
98 | -t glue-device \
101 Create source, bitwize-and, and sink glue devices. Since the
105 | -o '/iobus@0xf0000000/glue@0x10000/reg 0x10000 8' \
106 | -o '/iobus@0xf0000000/glue-and@0x20000/reg 0x20000 4' \
107 | -o '/iobus@0xf0000000/glue-and/interrupt-ranges 0 2' \
108 | -o '/iobus@0xf0000000/glue@0x30000/reg 0x30000 4' \
113 | -o '/iobus@0xf0000000/glue@0x10000 > 0 0 /iobus/glue-and' \
114 | -o '/iobus@0xf0000000/glue@0x10000 > 1 1 /iobus/glue-and' \
120 | -o '/iobus@0xf0000000/glue-and > 0 0 /iobus/glue@0x30000' \
193 struct hw_glue *glue = HW_ZALLOC (me, struct hw_glue);
197 set_hw_data (me, glue);
217 &glue->sizeof_output,
222 if (glue->sizeof_output == 0)
224 if (glue->sizeof_output % sizeof (unsigned_word) != 0)
231 &glue->space,
232 &glue->address,
234 if (glue->address % (sizeof (unsigned_word) * max_nr_ports) != 0)
238 glue->nr_outputs = glue->sizeof_output / sizeof (unsigned_word);
242 /* Allow bitwise glue devices to declare only ports. */
243 if (!strcmp (name, "glue"))
246 glue->nr_outputs = 1;
247 glue->sizeof_output = sizeof (unsigned_word);
249 glue->output = hw_zalloc (me, glue->sizeof_output);
258 glue->int_number = 0;
259 glue->nr_inputs = glue->nr_outputs;
269 glue->int_number = BE2H_cell (int_range[0]);
270 glue->nr_inputs = BE2H_cell (int_range[1]);
272 glue->sizeof_input = glue->nr_inputs * sizeof (unsigned);
273 glue->input = hw_zalloc (me, glue->sizeof_input);
277 if (strcmp (name, "glue") == 0)
278 glue->type = glue_io;
279 else if (strcmp (name, "glue-and") == 0)
280 glue->type = glue_and;
281 else if (strcmp (name, "glue-or") == 0)
282 glue->type = glue_or;
283 else if (strcmp (name, "glue-xor") == 0)
284 glue->type = glue_xor;
286 hw_abort (me, "unimplemented glue type");
289 glue->int_number, glue->nr_inputs, glue->nr_outputs));
299 struct hw_glue *glue = (struct hw_glue *) hw_data (me);
300 int reg = ((addr - glue->address) / sizeof (unsigned_word)) % glue->nr_outputs;
307 *(unsigned_word *)dest = H2BE_4 (glue->output[reg]);
310 reg, (unsigned long) addr, glue->output[reg]));
323 struct hw_glue *glue = (struct hw_glue *) hw_data (me);
324 int reg = ((addr - glue->address) / sizeof (unsigned_word)) % max_nr_ports;
331 glue->output[reg] = H2BE_4 (*(unsigned_word *)source);
334 reg, (unsigned long) addr, glue->output[reg]));
336 hw_port_event (me, reg, glue->output[reg]);
348 struct hw_glue *glue = (struct hw_glue *) hw_data (me);
351 if (my_port < glue->int_number
352 || my_port >= glue->int_number + glue->nr_inputs)
355 glue->input[my_port - glue->int_number] = level;
356 switch (glue->type)
360 int port = my_port % glue->nr_outputs;
362 glue->output[port] = level;
366 (unsigned long) glue->address + port * sizeof (unsigned_word),
372 glue->output[0] = glue->input[0];
373 for (i = 1; i < glue->nr_inputs; i++)
374 glue->output[0] &= glue->input[i];
379 glue->output[0] = glue->input[0];
380 for (i = 1; i < glue->nr_inputs; i++)
381 glue->output[0] |= glue->input[i];
386 glue->output[0] = glue->input[0];
387 for (i = 1; i < glue->nr_inputs; i++)
388 glue->output[0] ^= glue->input[i];
400 my_port, level, glue->output[0]));
402 hw_port_event (me, 0, glue->output[0]);
415 { "glue", hw_glue_finish, },
416 { "glue-and", hw_glue_finish, },
417 { "glue-nand", hw_glue_finish, },
418 { "glue-or", hw_glue_finish, },
419 { "glue-xor", hw_glue_finish, },
420 { "glue-nor", hw_glue_finish, },
421 { "glue-not", hw_glue_finish, },