Changes in / [84eb4edd:81b9d3e] in mainline


Ignore:
Files:
6 added
4 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/ppc32/Makefile.inc

    r84eb4edd r81b9d3e  
    4444RD_DRVS_ESSENTIAL += \
    4545        platform/mac \
     46        bus/adb/cuda_adb \
    4647        bus/pci/pciintel \
    4748        bus/usb/ohci \
  • uspace/Makefile

    r84eb4edd r81b9d3e  
    134134        srv/hid/output \
    135135        srv/hid/remcons \
    136         srv/hw/bus/cuda_adb \
    137136        srv/hw/char/s3c24xx_uart \
    138137        srv/hw/irc/apic \
     
    148147        drv/block/ata_bd \
    149148        drv/block/ddisk \
     149        drv/bus/adb/cuda_adb \
    150150        drv/bus/isa \
    151151        drv/bus/pci/pciintel \
  • uspace/app/init/init.c

    r84eb4edd r81b9d3e  
    342342        srv_start("/srv/icp-ic");
    343343        srv_start("/srv/obio");
    344         srv_start("/srv/cuda_adb");
    345344        srv_start("/srv/s3c24xx_uart");
    346345        srv_start("/srv/s3c24xx_ts");
  • uspace/drv/platform/mac/mac.c

    r84eb4edd r81b9d3e  
    11/*
    22 * Copyright (c) 2011 Martin Decky
     3 * Copyright (c) 2017 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    4041#include <errno.h>
    4142#include <ops/hw_res.h>
     43#include <ops/pio_window.h>
    4244#include <stdio.h>
     45#include <sysinfo.h>
    4346
    4447#define NAME  "mac"
     
    4649typedef struct {
    4750        hw_resource_list_t hw_resources;
     51        pio_window_t pio_window;
    4852} mac_fun_t;
     53
     54static hw_resource_t adb_res[] = {
     55        {
     56                .type = IO_RANGE,
     57                .res.io_range = {
     58                        .address = 0,
     59                        .size = 0x2000,
     60                        .relative = true,
     61                        .endianness = BIG_ENDIAN
     62                }
     63        },
     64        {
     65                .type = INTERRUPT,
     66                .res.interrupt = {
     67                        .irq = 0 /* patched at run time */
     68                }
     69        },
     70};
     71
     72static mac_fun_t adb_data = {
     73        .hw_resources = {
     74                sizeof(adb_res) / sizeof(adb_res[0]),
     75                adb_res
     76        },
     77        .pio_window = {
     78                .io = {
     79                        .base = 0, /* patched at run time */
     80                        .size = 0x2000
     81                }
     82        }
     83};
    4984
    5085static hw_resource_t pci_conf_regs[] = {
     
    79114
    80115/** Obtain function soft-state from DDF function node */
    81 static mac_fun_t *mac_fun(ddf_fun_t *fnode)
    82 {
    83         return ddf_fun_data_get(fnode);
     116static mac_fun_t *mac_fun(ddf_fun_t *ddf_fun)
     117{
     118        return ddf_fun_data_get(ddf_fun);
     119}
     120
     121static pio_window_t *mac_get_pio_window(ddf_fun_t *ddf_fun)
     122{
     123        mac_fun_t *fun = mac_fun(ddf_fun);
     124        return &fun->pio_window;
    84125}
    85126
     
    88129{
    89130        ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name);
     131        printf("mac: Adding new function '%s'.\n", name);
    90132       
    91133        ddf_fun_t *fnode = NULL;
     
    114156        }
    115157       
     158        printf("mac: Added new function '%s' (str=%s).\n", name, str_match_id);
    116159        return true;
    117160       
     
    135178static int mac_dev_add(ddf_dev_t *dev)
    136179{
     180        int rc;
     181        uintptr_t cuda_physical;
     182        sysarg_t cuda_inr;
    137183#if 0
    138184        /* Register functions */
    139         if (!mac_add_fun(dev, "pci0", "intel_pci", &pci_data))
    140                 ddf_msg(LVL_ERROR, "Failed to add functions for Mac platform.");
     185        if (!mac_add_fun(dev, "pci0", "intel_pci", &pci_data)) {
     186                ddf_msg(LVL_ERROR, "Failed to add PCI function for Mac platform.");
     187                return EIO;
     188        }
    141189#else
    142190        (void)pci_data;
    143         (void)mac_add_fun;
    144191#endif
    145        
     192        rc = sysinfo_get_value("cuda.address.physical", &cuda_physical);
     193        if (rc != EOK)
     194                return EIO;
     195        rc = sysinfo_get_value("cuda.inr", &cuda_inr);
     196        if (rc != EOK)
     197                return EIO;
     198
     199        adb_data.pio_window.io.base = cuda_physical;
     200        adb_res[1].res.interrupt.irq = cuda_inr;
     201
     202        if (!mac_add_fun(dev, "adb", "cuda_adb", &adb_data)) {
     203                ddf_msg(LVL_ERROR, "Failed to add ADB function for Mac platform.");
     204                return EIO;
     205        }
     206
    146207        return EOK;
    147208}
     
    173234}
    174235
     236static pio_window_ops_t fun_pio_window_ops = {
     237        .get_pio_window = &mac_get_pio_window
     238};
     239
    175240static hw_res_ops_t fun_hw_res_ops = {
    176241        .get_resource_list = &mac_get_resources,
     
    183248        ddf_log_init(NAME);
    184249        mac_fun_ops.interfaces[HW_RES_DEV_IFACE] = &fun_hw_res_ops;
     250        mac_fun_ops.interfaces[PIO_WINDOW_DEV_IFACE] = &fun_pio_window_ops;
    185251        return ddf_driver_main(&mac_driver);
    186252}
  • uspace/srv/hid/input/port/adb.c

    r84eb4edd r81b9d3e  
    6262        kbd_dev = kdev;
    6363       
    64         const char *dev = "adb/kbd";
     64        const char *dev = "devices/\\hw\\adb\\kbd";
    6565        service_id_t service_id;
    66         int rc = loc_service_get_id(dev, &service_id, 0);
     66        int rc = loc_service_get_id(dev, &service_id, IPC_FLAG_BLOCKING);
    6767        if (rc != EOK)
    6868                return rc;
  • uspace/srv/hid/input/port/adb_mouse.c

    r84eb4edd r81b9d3e  
    7575static int adb_port_init(mouse_dev_t *mdev)
    7676{
    77         const char *dev = "adb/mouse";
     77        const char *dev = "devices/\\hw\\adb\\mouse";
    7878       
    7979        mouse_dev = mdev;
    8080       
    8181        service_id_t service_id;
    82         int rc = loc_service_get_id(dev, &service_id, 0);
     82        int rc = loc_service_get_id(dev, &service_id, IPC_FLAG_BLOCKING);
    8383        if (rc != EOK)
    8484                return rc;
Note: See TracChangeset for help on using the changeset viewer.