Ignore:
Timestamp:
2013-09-11T17:55:18Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f18d01b6
Parents:
4c9b28a (diff), 26bc0fd1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge PIO_WINDOW_DEV_IFACE support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/infrastructure/rootpc/rootpc.c

    r4c9b28a r5759975a  
    5151#include <ops/hw_res.h>
    5252#include <device/hw_res.h>
     53#include <ops/pio_window.h>
     54#include <device/pio_window.h>
    5355
    5456#define NAME "rootpc"
     
    5658typedef struct rootpc_fun {
    5759        hw_resource_list_t hw_resources;
     60        pio_window_t pio_window;
    5861} rootpc_fun_t;
    5962
     
    9396static rootpc_fun_t pci_data = {
    9497        .hw_resources = {
    95                 sizeof(pci_conf_regs)/sizeof(pci_conf_regs[0]),
     98                sizeof(pci_conf_regs) / sizeof(pci_conf_regs[0]),
    9699                pci_conf_regs
     100        },
     101        .pio_window = {
     102                .mem = {
     103                        .base = UINT32_C(0),
     104                        .size = UINT32_C(0xffffffff) /* practical maximum */
     105                },
     106                .io = {
     107                        .base = UINT32_C(0),
     108                        .size = UINT32_C(0x10000)
     109                }
    97110        }
    98111};
     
    117130       
    118131        return false;
     132}
     133
     134static pio_window_t *rootpc_get_pio_window(ddf_fun_t *fnode)
     135{
     136        rootpc_fun_t *fun = rootpc_fun(fnode);
     137       
     138        assert(fun != NULL);
     139        return &fun->pio_window;
    119140}
    120141
     
    122143        .get_resource_list = &rootpc_get_resources,
    123144        .enable_interrupt = &rootpc_enable_interrupt,
     145};
     146
     147static pio_window_ops_t fun_pio_window_ops = {
     148        .get_pio_window = &rootpc_get_pio_window
    124149};
    125150
     
    197222        ddf_log_init(NAME);
    198223        rootpc_fun_ops.interfaces[HW_RES_DEV_IFACE] = &fun_hw_res_ops;
     224        rootpc_fun_ops.interfaces[PIO_WINDOW_DEV_IFACE] = &fun_pio_window_ops;
    199225}
    200226
Note: See TracChangeset for help on using the changeset viewer.