Ignore:
Timestamp:
2014-04-16T17:14:06Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f857e8b
Parents:
dba3e2c (diff), 70b570c (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 mainline changes

File:
1 edited

Legend:

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

    rdba3e2c r8b863a62  
    5050#include <ipc/dev_iface.h>
    5151#include <ops/hw_res.h>
    52 #include <device/hw_res.h>
     52#include <ops/pio_window.h>
    5353
    5454#define NAME "rootpc"
     
    5656typedef struct rootpc_fun {
    5757        hw_resource_list_t hw_resources;
     58        pio_window_t pio_window;
    5859} rootpc_fun_t;
    5960
     
    7879                        .address = 0xCF8,
    7980                        .size = 4,
     81                        .relative = false,
    8082                        .endianness = LITTLE_ENDIAN
    8183                }
     
    8688                        .address = 0xCFC,
    8789                        .size = 4,
     90                        .relative = false,
    8891                        .endianness = LITTLE_ENDIAN
    8992                }
     
    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.