Ignore:
Timestamp:
2006-10-02T21:07:23Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
233af8c5
Parents:
36db5ac
Message:

Extend the OFW device tree node with a void pointer. The boot loader is
supposed to reset all pointers in all nodes. The kernel uses the pointer
to recognize that a particular device has already been visited and initialized.

Read interrupt mapping from the OFW device tree for FHC devices (z8530) and
EBUS devices (ns16550). In case of FHC devices, remove hardwired values from
the code and use only values read from the tree. FHC initialization is started
when a FHC device wants to map its interrupt. In case of EBUS devices, map
the interrupt to INO. Interrupt enabling in the interrupt controller for that
specific interrupt is not implemented yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/drivers/kbd.c

    r36db5ac r0b414b5  
    6969        name = ofw_tree_node_name(node);
    7070       
     71        /*
     72         * Determine keyboard serial controller type.
     73         */
    7174        if (strcmp(name, "zs") == 0)
    7275                kbd_type = KBD_Z8530;
     
    7982        }
    8083       
     84        /*
     85         * Read 'interrupts' property.
     86         */
     87        uint32_t interrupts;
     88        prop = ofw_tree_getprop(node, "interrupts");
     89        if (!prop || !prop->value)
     90                panic("Can't find \"interrupts\" property.\n");
     91        interrupts = *((uint32_t *) prop->value);
     92
     93        /*
     94         * Read 'reg' property.
     95         */
    8196        prop = ofw_tree_getprop(node, "reg");
    82         if (!prop)
     97        if (!prop || !prop->value)
    8398                panic("Can't find \"reg\" property.\n");
    8499       
    85100        uintptr_t pa;
    86101        size_t size;
     102        int ino;
    87103       
    88104        switch (kbd_type) {
     
    93109                        return;
    94110                }
     111                if (!ofw_fhc_map_interrupts(node->parent, ((ofw_fhc_reg_t *) prop->value), interrupts, &ino)) {
     112                        printf("Failed to determine keyboard interrupts.\n");
     113                        return;
     114                }
    95115                break;
    96116        case KBD_NS16550:
     
    98118                if (!ofw_ebus_apply_ranges(node->parent, ((ofw_ebus_reg_t *) prop->value) , &pa)) {
    99119                        printf("Failed to determine keyboard address.\n");
     120                        return;
     121                }
     122                if (!ofw_ebus_map_interrupts(node->parent, ((ofw_ebus_reg_t *) prop->value), interrupts, &ino)) {
     123                        printf("Failed to determine keyboard interrupts.\n");
    100124                        return;
    101125                }
Note: See TracChangeset for help on using the changeset viewer.