Changeset f4cfd271 in mainline
- Timestamp:
- 2017-11-26T10:22:30Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 474c68b
- Parents:
- 5f4c41b2
- Location:
- uspace/drv
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/char/sun4v-con/main.c
r5f4c41b2 rf4cfd271 74 74 return rc; 75 75 76 if (hw_res.mem_ranges.count != 1) {76 if (hw_res.mem_ranges.count != 2) { 77 77 rc = EINVAL; 78 78 goto error; 79 79 } 80 80 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]); 82 83 return EOK; 83 84 error: -
uspace/drv/char/sun4v-con/sun4v-con.c
r5f4c41b2 rf4cfd271 38 38 #include <io/chardev_srv.h> 39 39 #include <stdbool.h> 40 #include <sysinfo.h>41 40 42 41 #include "sun4v-con.h" … … 115 114 ddf_fun_set_conn_handler(fun, sun4v_con_connection); 116 115 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, 118 117 (void *) &input_buffer); 119 118 if (rc != EOK) { … … 122 121 } 123 122 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 131 123 output_fifo = (output_fifo_t *) AS_AREA_ANY; 132 124 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, 134 126 (void *) &output_fifo); 135 127 if (rc != EOK) { … … 150 142 if (input_buffer != (input_buffer_t) AS_AREA_ANY) 151 143 physmem_unmap((void *) input_buffer); 144 145 if (output_fifo != (output_fifo_t *) AS_AREA_ANY) 146 physmem_unmap((void *) output_fifo); 152 147 153 148 if (fun != NULL) -
uspace/drv/char/sun4v-con/sun4v-con.h
r5f4c41b2 rf4cfd271 44 44 /** Sun4v console resources */ 45 45 typedef struct { 46 uintptr_t base; 46 uintptr_t in_base; 47 uintptr_t out_base; 47 48 } sun4v_con_res_t; 48 49 -
uspace/drv/platform/sun4v/sun4v.c
r5f4c41b2 rf4cfd271 75 75 } 76 76 }, 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 }, 77 86 }; 78 87 … … 223 232 } 224 233 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; 226 243 return EOK; 227 244 }
Note:
See TracChangeset
for help on using the changeset viewer.