Changeset 65ac220 in mainline


Ignore:
Timestamp:
2013-09-11T17:34:31Z (11 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6dbc500
Parents:
48bd6f4
Message:

PIO_WINDOW_DEV_IFACE support for rootmalta.

File:
1 edited

Legend:

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

    r48bd6f4 r65ac220  
    5353#include <ops/hw_res.h>
    5454#include <device/hw_res.h>
     55#include <ops/pio_window.h>
     56#include <device/pio_window.h>
    5557#include <byteorder.h>
    5658
     
    6668#define GT_PCI_CMD_MBYTESWAP    0x1
    6769
     70#define GT_PCI_MEMBASE  UINT32_C(0x10000000)
     71#define GT_PCI_MEMSIZE  UINT32_C(0x08000000)
     72
     73#define GT_PCI_IOBASE   UINT32_C(0x18000000)
     74#define GT_PCI_IOSIZE   UINT32_C(0x00200000)
     75
    6876typedef struct rootmalta_fun {
    6977        hw_resource_list_t hw_resources;
     78        pio_window_t pio_window;
    7079} rootmalta_fun_t;
    7180
     
    107116                sizeof(pci_conf_regs) / sizeof(pci_conf_regs[0]),
    108117                pci_conf_regs
     118        },
     119        .pio_window = {
     120                .mem = {
     121                        .base = GT_PCI_MEMBASE,
     122                        .size = GT_PCI_MEMSIZE
     123                },
     124                .io = {
     125                        .base = GT_PCI_IOBASE,
     126                        .size = GT_PCI_IOSIZE
     127                }
    109128        }
    110129};
     
    129148       
    130149        return false;
     150}
     151
     152static pio_window_t *rootmalta_get_pio_window(ddf_fun_t *fnode)
     153{
     154        rootmalta_fun_t *fun = rootmalta_fun(fnode);
     155
     156        assert(fun != NULL);
     157        return &fun->pio_window;
    131158}
    132159
     
    134161        .get_resource_list = &rootmalta_get_resources,
    135162        .enable_interrupt = &rootmalta_enable_interrupt,
     163};
     164
     165static pio_window_ops_t fun_pio_window_ops = {
     166        .get_pio_window = &rootmalta_get_pio_window
    136167};
    137168
     
    228259        ddf_log_init(NAME);
    229260        rootmalta_fun_ops.interfaces[HW_RES_DEV_IFACE] = &fun_hw_res_ops;
     261        rootmalta_fun_ops.interfaces[PIO_WINDOW_DEV_IFACE] = &fun_pio_window_ops;
    230262}
    231263
Note: See TracChangeset for help on using the changeset viewer.