Changeset f4cfd271 in mainline


Ignore:
Timestamp:
2017-11-26T10:22:30Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
474c68b
Parents:
5f4c41b2
Message:

Sun4v-con should get output buffer address via hw_res, too.

Location:
uspace/drv
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/char/sun4v-con/main.c

    r5f4c41b2 rf4cfd271  
    7474                return rc;
    7575
    76         if (hw_res.mem_ranges.count != 1) {
     76        if (hw_res.mem_ranges.count != 2) {
    7777                rc = EINVAL;
    7878                goto error;
    7979        }
    8080
    81         res->base = RNGABS(hw_res.mem_ranges.ranges[0]);
     81        res->in_base = RNGABS(hw_res.mem_ranges.ranges[0]);
     82        res->out_base = RNGABS(hw_res.mem_ranges.ranges[1]);
    8283        return EOK;
    8384error:
  • uspace/drv/char/sun4v-con/sun4v-con.c

    r5f4c41b2 rf4cfd271  
    3838#include <io/chardev_srv.h>
    3939#include <stdbool.h>
    40 #include <sysinfo.h>
    4140
    4241#include "sun4v-con.h"
     
    115114        ddf_fun_set_conn_handler(fun, sun4v_con_connection);
    116115
    117         rc = physmem_map(res->base, 1, AS_AREA_READ | AS_AREA_WRITE,
     116        rc = physmem_map(res->in_base, 1, AS_AREA_READ | AS_AREA_WRITE,
    118117            (void *) &input_buffer);
    119118        if (rc != EOK) {
     
    122121        }
    123122
    124         sysarg_t paddr;
    125         rc = sysinfo_get_value("niagara.outbuf.address", &paddr);
    126         if (rc != EOK) {
    127                 ddf_msg(LVL_ERROR, "Outbuf address information not found");
    128                 return rc;
    129         }
    130 
    131123        output_fifo = (output_fifo_t *) AS_AREA_ANY;
    132124
    133         rc = physmem_map(paddr, 1, AS_AREA_READ | AS_AREA_WRITE,
     125        rc = physmem_map(res->out_base, 1, AS_AREA_READ | AS_AREA_WRITE,
    134126            (void *) &output_fifo);
    135127        if (rc != EOK) {
     
    150142        if (input_buffer != (input_buffer_t) AS_AREA_ANY)
    151143                physmem_unmap((void *) input_buffer);
     144
     145        if (output_fifo != (output_fifo_t *) AS_AREA_ANY)
     146                physmem_unmap((void *) output_fifo);
    152147
    153148        if (fun != NULL)
  • uspace/drv/char/sun4v-con/sun4v-con.h

    r5f4c41b2 rf4cfd271  
    4444/** Sun4v console resources */
    4545typedef struct {
    46         uintptr_t base;
     46        uintptr_t in_base;
     47        uintptr_t out_base;
    4748} sun4v_con_res_t;
    4849
  • uspace/drv/platform/sun4v/sun4v.c

    r5f4c41b2 rf4cfd271  
    7575                }
    7676        },
     77        {
     78                .type = MEM_RANGE,
     79                .res.mem_range = {
     80                        .address = 0,
     81                        .size = PAGE_SIZE,
     82                        .relative = true,
     83                        .endianness = LITTLE_ENDIAN
     84                }
     85        },
    7786};
    7887
     
    223232        }
    224233
    225         console_data.pio_window.mem.base = paddr;
     234        console_res[0].res.mem_range.address = paddr;
     235
     236        rc = sysinfo_get_value("niagara.outbuf.address", &paddr);
     237        if (rc != EOK) {
     238                ddf_msg(LVL_ERROR, "niagara.outbuf.address not set (%d)", rc);
     239                return rc;
     240        }
     241
     242        console_res[1].res.mem_range.address = paddr;
    226243        return EOK;
    227244}
Note: See TracChangeset for help on using the changeset viewer.