Changeset 7de5f12 in mainline for uspace/drv/platform/msim/msim.c
- Timestamp:
- 2017-11-15T20:23:50Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6ac1243d, 7f4937e
- Parents:
- e7a8bd2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/platform/msim/msim.c
re7a8bd2 r7de5f12 38 38 39 39 #include <assert.h> 40 #include <stdio.h>41 #include <errno.h>42 #include <stdbool.h>43 #include <stdlib.h>44 #include <ctype.h>45 #include <macros.h>46 47 #include <ddi.h>48 40 #include <ddf/driver.h> 49 41 #include <ddf/log.h> 42 #include <errno.h> 50 43 #include <ipc/dev_iface.h> 51 44 #include <ops/hw_res.h> 52 45 #include <ops/pio_window.h> 46 #include <stdbool.h> 47 #include <stdio.h> 53 48 54 49 #define NAME "msim" 55 50 56 #define MSIM_DISK_BASE UINT32_C(0x10000200) 57 #define MSIM_DISK_SIZE UINT32_C(0x00000010) 51 #define MSIM_DDISK_BASE UINT32_C(0x10000200) 52 #define MSIM_DDISK_SIZE UINT32_C(0x00000010) 53 #define MSIM_DDISK_IRQ 6 54 55 #define MSIM_KBD_ADDRESS UINT32_C(0x10000000) 56 #define MSIM_KBD_SIZE 1 57 #define MSIM_KBD_IRQ 2 58 58 59 59 typedef struct msim_fun { … … 89 89 .type = INTERRUPT, 90 90 .res.interrupt = { 91 .irq = 691 .irq = MSIM_DDISK_IRQ 92 92 } 93 93 } … … 101 101 .pio_window = { 102 102 .mem = { 103 .base = MSIM_DISK_BASE, 104 .size = MSIM_DISK_SIZE 103 .base = MSIM_DDISK_BASE, 104 .size = MSIM_DDISK_SIZE 105 } 106 } 107 }; 108 109 static hw_resource_t console_regs[] = { 110 { 111 .type = MEM_RANGE, 112 .res.mem_range = { 113 .address = 0, 114 .size = 1, 115 .relative = true, 116 .endianness = LITTLE_ENDIAN 117 } 118 }, 119 { 120 .type = INTERRUPT, 121 .res.interrupt = { 122 .irq = MSIM_KBD_IRQ 123 } 124 } 125 }; 126 127 static msim_fun_t console_data = { 128 .hw_resources = { 129 sizeof(console_regs) / sizeof(console_regs[0]), 130 console_regs 131 }, 132 .pio_window = { 133 .mem = { 134 .base = MSIM_KBD_ADDRESS, 135 .size = MSIM_KBD_SIZE 105 136 } 106 137 } … … 194 225 if (!msim_add_fun(dev, "disk0", "msim/ddisk", &disk_data)) 195 226 return false; 196 if (!msim_add_fun(dev, "console", "msim/console", & disk_data))227 if (!msim_add_fun(dev, "console", "msim/console", &console_data)) 197 228 return false; 198 229 return true;
Note:
See TracChangeset
for help on using the changeset viewer.