Changeset 5759975a in mainline for uspace/drv/infrastructure
- Timestamp:
- 2013-09-11T17:55:18Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f18d01b6
- Parents:
- 4c9b28a (diff), 26bc0fd1 (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. - Location:
- uspace/drv/infrastructure
- Files:
-
- 2 edited
-
rootmalta/rootmalta.c (modified) (6 diffs)
-
rootpc/rootpc.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/infrastructure/rootmalta/rootmalta.c
r4c9b28a r5759975a 53 53 #include <ops/hw_res.h> 54 54 #include <device/hw_res.h> 55 #include <ops/pio_window.h> 56 #include <device/pio_window.h> 55 57 #include <byteorder.h> 56 58 … … 66 68 #define GT_PCI_CMD_MBYTESWAP 0x1 67 69 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 68 76 typedef struct rootmalta_fun { 69 77 hw_resource_list_t hw_resources; 78 pio_window_t pio_window; 70 79 } rootmalta_fun_t; 71 80 … … 107 116 sizeof(pci_conf_regs) / sizeof(pci_conf_regs[0]), 108 117 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 } 109 128 } 110 129 }; … … 129 148 130 149 return false; 150 } 151 152 static 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; 131 158 } 132 159 … … 134 161 .get_resource_list = &rootmalta_get_resources, 135 162 .enable_interrupt = &rootmalta_enable_interrupt, 163 }; 164 165 static pio_window_ops_t fun_pio_window_ops = { 166 .get_pio_window = &rootmalta_get_pio_window 136 167 }; 137 168 … … 228 259 ddf_log_init(NAME); 229 260 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; 230 262 } 231 263 -
uspace/drv/infrastructure/rootpc/rootpc.c
r4c9b28a r5759975a 51 51 #include <ops/hw_res.h> 52 52 #include <device/hw_res.h> 53 #include <ops/pio_window.h> 54 #include <device/pio_window.h> 53 55 54 56 #define NAME "rootpc" … … 56 58 typedef struct rootpc_fun { 57 59 hw_resource_list_t hw_resources; 60 pio_window_t pio_window; 58 61 } rootpc_fun_t; 59 62 … … 93 96 static rootpc_fun_t pci_data = { 94 97 .hw_resources = { 95 sizeof(pci_conf_regs) /sizeof(pci_conf_regs[0]),98 sizeof(pci_conf_regs) / sizeof(pci_conf_regs[0]), 96 99 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 } 97 110 } 98 111 }; … … 117 130 118 131 return false; 132 } 133 134 static 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; 119 140 } 120 141 … … 122 143 .get_resource_list = &rootpc_get_resources, 123 144 .enable_interrupt = &rootpc_enable_interrupt, 145 }; 146 147 static pio_window_ops_t fun_pio_window_ops = { 148 .get_pio_window = &rootpc_get_pio_window 124 149 }; 125 150 … … 197 222 ddf_log_init(NAME); 198 223 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; 199 225 } 200 226
Note:
See TracChangeset
for help on using the changeset viewer.
