Changeset 3c5b86c in mainline


Ignore:
Timestamp:
2016-12-16T22:24:49Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7e9e652
Parents:
7f766f4
Message:

Allow ISA driver to use different .dev configs based on vendor/device ID

Add .dev config for EBUS. At this point it consist only of entries for
com1.

Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile

    r7f766f4 r3c5b86c  
    113113                file_dir="`dirname "$$file"`" ; \
    114114                file_name="`basename "$$file"`" ; \
    115                 cp "$(USPACE_PATH)/$(DRVS_PATH)/$$file_dir/$$file_name/$$file_name.dev" "$(DIST_PATH)/$(DRVS_PATH)/$$file_name/" ; \
     115                cp "$(USPACE_PATH)/$(DRVS_PATH)/$$file_dir/$$file_name/"*".dev" "$(DIST_PATH)/$(DRVS_PATH)/$$file_name/" ; \
    116116        done
    117117        for file in $(RD_DRVS_FW) ; do \
  • uspace/drv/bus/isa/isa.c

    r7f766f4 r3c5b86c  
    6666#include <device/pio_window.h>
    6767
     68#include <pci_dev_iface.h>
     69
    6870#include "i8237.h"
    6971
    7072#define NAME "isa"
    71 #define CHILD_FUN_CONF_PATH "/drv/isa/isa.dev"
     73#define ISA_CHILD_FUN_CONF_PATH "/drv/isa/isa.dev"
     74#define EBUS_CHILD_FUN_CONF_PATH "/drv/isa/ebus.dev"
    7275
    7376#define ISA_MAX_HW_RES 5
     
    7578typedef struct {
    7679        fibril_mutex_t mutex;
     80        uint16_t vendor_id;
     81        uint16_t device_id;
    7782        ddf_dev_t *dev;
    7883        ddf_fun_t *fctl;
     
    593598static void isa_functions_add(isa_bus_t *isa)
    594599{
    595         char *conf = fun_conf_read(CHILD_FUN_CONF_PATH);
     600#define VENDOR_ID_SUN   0x108e
     601#define DEVICE_ID_EBUS  0x1000
     602        bool ebus = ((isa->vendor_id == VENDOR_ID_SUN) &&
     603            (isa->device_id == DEVICE_ID_EBUS));
     604
     605        const char *conf_path;
     606        if (ebus)
     607                conf_path = EBUS_CHILD_FUN_CONF_PATH;
     608        else
     609                conf_path = ISA_CHILD_FUN_CONF_PATH;
     610
     611        char *conf = fun_conf_read(conf_path);
    596612        while (conf != NULL && *conf != '\0') {
    597613                conf = isa_fun_read_info(conf, isa);
     
    623639        }
    624640
     641        rc = pci_config_space_read_16(sess, PCI_VENDOR_ID, &isa->vendor_id);
     642        if (rc != EOK)
     643                return rc;
     644        rc = pci_config_space_read_16(sess, PCI_DEVICE_ID, &isa->device_id);
     645        if (rc != EOK)
     646                return rc;
     647       
    625648        rc = pio_window_get(sess, &isa->pio_win);
    626649        if (rc != EOK) {
Note: See TracChangeset for help on using the changeset viewer.