Changeset b7fd2a0 in mainline for uspace/drv/platform
- Timestamp:
- 2018-01-13T03:10:29Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- Location:
- uspace/drv/platform
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/platform/amdm37x/amdm37x.c
r36f0738 rb7fd2a0 53 53 54 54 55 int amdm37x_init(amdm37x_t *device, bool trace)55 errno_t amdm37x_init(amdm37x_t *device, bool trace) 56 56 { 57 57 assert(device); 58 int ret = EOK;58 errno_t ret = EOK; 59 59 60 60 ret = pio_enable((void*)USBHOST_CM_BASE_ADDRESS, USBHOST_CM_SIZE, … … 358 358 * Select mode than can operate in FS/LS. 359 359 */ 360 int amdm37x_usb_tll_init(amdm37x_t *device)360 errno_t amdm37x_usb_tll_init(amdm37x_t *device) 361 361 { 362 362 /* Check access */ -
uspace/drv/platform/amdm37x/amdm37x.h
r36f0738 rb7fd2a0 66 66 } amdm37x_t; 67 67 68 int amdm37x_init(amdm37x_t *device, bool trace_io);69 int amdm37x_usb_tll_init(amdm37x_t *device);68 errno_t amdm37x_init(amdm37x_t *device, bool trace_io); 69 errno_t amdm37x_usb_tll_init(amdm37x_t *device); 70 70 void amdm37x_setup_dpll_on_autoidle(amdm37x_t *device); 71 71 void amdm37x_usb_clocks_set(amdm37x_t *device, bool enabled); -
uspace/drv/platform/amdm37x/main.c
r36f0738 rb7fd2a0 150 150 151 151 static hw_resource_list_t *amdm37x_get_resources(ddf_fun_t *fnode); 152 static int amdm37x_enable_interrupt(ddf_fun_t *fun, int);152 static errno_t amdm37x_enable_interrupt(ddf_fun_t *fun, int); 153 153 154 154 static hw_res_ops_t fun_hw_res_ops = { … … 161 161 }; 162 162 163 static int amdm37x_add_fun(ddf_dev_t *dev, const amdm37x_fun_t *fun)163 static errno_t amdm37x_add_fun(ddf_dev_t *dev, const amdm37x_fun_t *fun) 164 164 { 165 165 assert(dev); … … 174 174 175 175 /* Add match id */ 176 int ret = ddf_fun_add_match_id(fnode,176 errno_t ret = ddf_fun_add_match_id(fnode, 177 177 fun->match_id.id, fun->match_id.score); 178 178 if (ret != EOK) { … … 212 212 * 213 213 */ 214 static int amdm37x_dev_add(ddf_dev_t *dev)214 static errno_t amdm37x_dev_add(ddf_dev_t *dev) 215 215 { 216 216 assert(dev); … … 218 218 if (!device) 219 219 return ENOMEM; 220 int ret = amdm37x_init(device, DEBUG_CM);220 errno_t ret = amdm37x_init(device, DEBUG_CM); 221 221 if (ret != EOK) { 222 222 ddf_msg(LVL_FATAL, "Failed to setup hw access!.\n"); … … 265 265 } 266 266 267 static int amdm37x_enable_interrupt(ddf_fun_t *fun, int irq)267 static errno_t amdm37x_enable_interrupt(ddf_fun_t *fun, int irq) 268 268 { 269 269 //TODO: Implement -
uspace/drv/platform/icp/icp.c
r36f0738 rb7fd2a0 62 62 } icp_fun_t; 63 63 64 static int icp_dev_add(ddf_dev_t *dev);64 static errno_t icp_dev_add(ddf_dev_t *dev); 65 65 66 66 static driver_ops_t icp_ops = { … … 178 178 } 179 179 180 static int icp_fun_enable_interrupt(ddf_fun_t *fnode, int irq)180 static errno_t icp_fun_enable_interrupt(ddf_fun_t *fnode, int irq) 181 181 { 182 182 icp_fun_t *fun = icp_fun(fnode); … … 188 188 } 189 189 190 static int icp_fun_disable_interrupt(ddf_fun_t *fnode, int irq)190 static errno_t icp_fun_disable_interrupt(ddf_fun_t *fnode, int irq) 191 191 { 192 192 icp_fun_t *fun = icp_fun(fnode); … … 198 198 } 199 199 200 static int icp_fun_clear_interrupt(ddf_fun_t *fnode, int irq)200 static errno_t icp_fun_clear_interrupt(ddf_fun_t *fnode, int irq) 201 201 { 202 202 icp_fun_t *fun = icp_fun(fnode); … … 231 231 }; 232 232 233 static int icp_add_fun(ddf_dev_t *dev, const char *name, const char *str_match_id,233 static errno_t icp_add_fun(ddf_dev_t *dev, const char *name, const char *str_match_id, 234 234 icp_fun_t *fun_proto) 235 235 { … … 237 237 238 238 ddf_fun_t *fnode = NULL; 239 int rc;239 errno_t rc; 240 240 241 241 /* Create new device. */ … … 275 275 } 276 276 277 static int icp_add_functions(ddf_dev_t *dev)278 { 279 int rc;277 static errno_t icp_add_functions(ddf_dev_t *dev) 278 { 279 errno_t rc; 280 280 281 281 rc = icp_add_fun(dev, "intctl", "integratorcp/intctl", … … 296 296 297 297 /** Add device. */ 298 static int icp_dev_add(ddf_dev_t *dev)298 static errno_t icp_dev_add(ddf_dev_t *dev) 299 299 { 300 300 ddf_msg(LVL_NOTE, "icp_dev_add, device handle = %d", … … 311 311 int main(int argc, char *argv[]) 312 312 { 313 int rc;313 errno_t rc; 314 314 315 315 printf(NAME ": HelenOS IntegratorCP platform driver\n"); -
uspace/drv/platform/mac/mac.c
r36f0738 rb7fd2a0 132 132 133 133 ddf_fun_t *fnode = NULL; 134 int rc;134 errno_t rc; 135 135 136 136 /* Create new device. */ … … 176 176 * 177 177 */ 178 static int mac_dev_add(ddf_dev_t *dev)179 { 180 int rc;178 static errno_t mac_dev_add(ddf_dev_t *dev) 179 { 180 errno_t rc; 181 181 uintptr_t cuda_physical; 182 182 sysarg_t cuda_inr; … … 227 227 } 228 228 229 static int mac_enable_interrupt(ddf_fun_t *fun, int irq)229 static errno_t mac_enable_interrupt(ddf_fun_t *fun, int irq) 230 230 { 231 231 /* TODO */ -
uspace/drv/platform/malta/malta.c
r36f0738 rb7fd2a0 77 77 } malta_fun_t; 78 78 79 static int malta_dev_add(ddf_dev_t *dev);79 static errno_t malta_dev_add(ddf_dev_t *dev); 80 80 static void malta_init(void); 81 81 … … 143 143 } 144 144 145 static int malta_enable_interrupt(ddf_fun_t *fun, int irq)145 static errno_t malta_enable_interrupt(ddf_fun_t *fun, int irq) 146 146 { 147 147 /* TODO */ … … 177 177 178 178 ddf_fun_t *fnode = NULL; 179 int rc;179 errno_t rc; 180 180 181 181 /* Create new device. */ … … 223 223 * @return Zero on success, error number otherwise. 224 224 */ 225 static int malta_dev_add(ddf_dev_t *dev)225 static errno_t malta_dev_add(ddf_dev_t *dev) 226 226 { 227 227 ioport32_t *gt; 228 228 uint32_t val; 229 int ret;229 errno_t ret; 230 230 231 231 ddf_msg(LVL_DEBUG, "malta_dev_add, device handle = %d", -
uspace/drv/platform/msim/msim.c
r36f0738 rb7fd2a0 62 62 } msim_fun_t; 63 63 64 static int msim_dev_add(ddf_dev_t *dev);64 static errno_t msim_dev_add(ddf_dev_t *dev); 65 65 static void msim_init(void); 66 66 … … 152 152 } 153 153 154 static int msim_enable_interrupt(ddf_fun_t *fun, int irq)154 static errno_t msim_enable_interrupt(ddf_fun_t *fun, int irq) 155 155 { 156 156 /* Nothing to do. */ … … 186 186 187 187 ddf_fun_t *fnode = NULL; 188 int rc;188 errno_t rc; 189 189 190 190 /* Create new device. */ … … 238 238 * @return Zero on success or non-zero error code. 239 239 */ 240 static int msim_dev_add(ddf_dev_t *dev)240 static errno_t msim_dev_add(ddf_dev_t *dev) 241 241 { 242 242 ddf_msg(LVL_DEBUG, "msim_dev_add, device handle = %d", -
uspace/drv/platform/pc/pc.c
r36f0738 rb7fd2a0 59 59 } pc_fun_t; 60 60 61 static int pc_dev_add(ddf_dev_t *dev);61 static errno_t pc_dev_add(ddf_dev_t *dev); 62 62 static void pc_init(void); 63 63 … … 125 125 } 126 126 127 static int pc_enable_interrupt(ddf_fun_t *fun, int irq)127 static errno_t pc_enable_interrupt(ddf_fun_t *fun, int irq) 128 128 { 129 129 /* TODO */ … … 159 159 160 160 ddf_fun_t *fnode = NULL; 161 int rc;161 errno_t rc; 162 162 163 163 /* Create new device. */ … … 205 205 * @return Zero on success, error number otherwise. 206 206 */ 207 static int pc_dev_add(ddf_dev_t *dev)207 static errno_t pc_dev_add(ddf_dev_t *dev) 208 208 { 209 209 ddf_msg(LVL_DEBUG, "pc_dev_add, device handle = %d", -
uspace/drv/platform/ski/ski.c
r36f0738 rb7fd2a0 46 46 #define NAME "ski" 47 47 48 static int ski_dev_add(ddf_dev_t *dev);48 static errno_t ski_dev_add(ddf_dev_t *dev); 49 49 50 50 static driver_ops_t ski_ops = { … … 57 57 }; 58 58 59 static int ski_add_fun(ddf_dev_t *dev, const char *name, const char *str_match_id)59 static errno_t ski_add_fun(ddf_dev_t *dev, const char *name, const char *str_match_id) 60 60 { 61 61 ddf_msg(LVL_NOTE, "Adding function '%s'.", name); 62 62 63 63 ddf_fun_t *fnode = NULL; 64 int rc;64 errno_t rc; 65 65 66 66 /* Create new device. */ … … 94 94 } 95 95 96 static int ski_add_functions(ddf_dev_t *dev)96 static errno_t ski_add_functions(ddf_dev_t *dev) 97 97 { 98 int rc;98 errno_t rc; 99 99 100 100 rc = ski_add_fun(dev, "console", "ski/console"); … … 106 106 107 107 /** Add device. */ 108 static int ski_dev_add(ddf_dev_t *dev)108 static errno_t ski_dev_add(ddf_dev_t *dev) 109 109 { 110 110 ddf_msg(LVL_NOTE, "ski_dev_add, device handle = %d", … … 121 121 int main(int argc, char *argv[]) 122 122 { 123 int rc;123 errno_t rc; 124 124 125 125 printf(NAME ": Ski platform driver\n"); -
uspace/drv/platform/sun4u/sun4u.c
r36f0738 rb7fd2a0 77 77 } sun4u_fun_t; 78 78 79 static int sun4u_dev_add(ddf_dev_t *dev);79 static errno_t sun4u_dev_add(ddf_dev_t *dev); 80 80 static void sun4u_init(void); 81 81 … … 159 159 } 160 160 161 static int sun4u_enable_interrupt(ddf_fun_t *fun, int irq)161 static errno_t sun4u_enable_interrupt(ddf_fun_t *fun, int irq) 162 162 { 163 163 /* TODO */ … … 193 193 194 194 ddf_fun_t *fnode = NULL; 195 int rc;195 errno_t rc; 196 196 197 197 /* Create new device. */ … … 242 242 * @return Zero on success, error number otherwise. 243 243 */ 244 static int sun4u_dev_add(ddf_dev_t *dev)244 static errno_t sun4u_dev_add(ddf_dev_t *dev) 245 245 { 246 246 ddf_msg(LVL_DEBUG, "sun4u_dev_add, device handle = %d", -
uspace/drv/platform/sun4v/sun4v.c
r36f0738 rb7fd2a0 55 55 } sun4v_fun_t; 56 56 57 static int sun4v_dev_add(ddf_dev_t *dev);57 static errno_t sun4v_dev_add(ddf_dev_t *dev); 58 58 59 59 static driver_ops_t sun4v_ops = { … … 114 114 } 115 115 116 static int sun4v_enable_interrupt(ddf_fun_t *fun, int irq)116 static errno_t sun4v_enable_interrupt(ddf_fun_t *fun, int irq) 117 117 { 118 118 return EOK; … … 138 138 static ddf_dev_ops_t sun4v_fun_ops; 139 139 140 static int sun4v_add_fun(ddf_dev_t *dev, const char *name,140 static errno_t sun4v_add_fun(ddf_dev_t *dev, const char *name, 141 141 const char *str_match_id, sun4v_fun_t *fun_proto) 142 142 { … … 144 144 145 145 ddf_fun_t *fnode = NULL; 146 int rc;146 errno_t rc; 147 147 148 148 /* Create new device. */ … … 188 188 } 189 189 190 static int sun4v_add_functions(ddf_dev_t *dev)191 { 192 int rc;190 static errno_t sun4v_add_functions(ddf_dev_t *dev) 191 { 192 errno_t rc; 193 193 194 194 rc = sun4v_add_fun(dev, "console", "sun4v/console", &console_data); … … 200 200 201 201 /** Add device. */ 202 static int sun4v_dev_add(ddf_dev_t *dev)202 static errno_t sun4v_dev_add(ddf_dev_t *dev) 203 203 { 204 204 ddf_msg(LVL_DEBUG, "sun4v_dev_add, device handle = %d", … … 213 213 } 214 214 215 static int sun4v_init(void)216 { 217 int rc;215 static errno_t sun4v_init(void) 216 { 217 errno_t rc; 218 218 sysarg_t paddr; 219 219 … … 247 247 int main(int argc, char *argv[]) 248 248 { 249 int rc;249 errno_t rc; 250 250 251 251 printf(NAME ": Sun4v platform driver\n");
Note:
See TracChangeset
for help on using the changeset viewer.