diff options
author | Alan Cox <alan@linux.intel.com> | 2009-08-06 15:45:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 15:02:12 -0400 |
commit | 46eb5a13b7f397b37bac14fbfa240cffa463783c (patch) | |
tree | 098f86e1e2206e2427ae4737fb019362f1068b48 /drivers/staging/sep | |
parent | 794f1d789520d423ef6d90d5390edea5c1b687c2 (diff) |
Staging: sep: do something about all the printk macros
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/sep')
-rw-r--r-- | drivers/staging/sep/sep_driver_config.h | 46 | ||||
-rw-r--r-- | drivers/staging/sep/sep_ext_with_pci_driver.c | 94 | ||||
-rw-r--r-- | drivers/staging/sep/sep_main_mod.c | 477 |
3 files changed, 249 insertions, 368 deletions
diff --git a/drivers/staging/sep/sep_driver_config.h b/drivers/staging/sep/sep_driver_config.h index 8a4d27a435e..f6d7ab6b881 100644 --- a/drivers/staging/sep/sep_driver_config.h +++ b/drivers/staging/sep/sep_driver_config.h | |||
@@ -199,50 +199,26 @@ | |||
199 | 199 | ||
200 | /* the token that defines the start of time address */ | 200 | /* the token that defines the start of time address */ |
201 | #define SEP_TIME_VAL_TOKEN 0x12345678 | 201 | #define SEP_TIME_VAL_TOKEN 0x12345678 |
202 | |||
202 | /* DEBUG LEVEL MASKS */ | 203 | /* DEBUG LEVEL MASKS */ |
203 | #define SEP_DEBUG_LEVEL_BASIC 0x1 | 204 | #define SEP_DEBUG_LEVEL_BASIC 0x1 |
204 | 205 | ||
205 | #define SEP_DEBUG_LEVEL_REGISTERS 0x2 | ||
206 | |||
207 | #define SEP_DEBUG_LEVEL_EXTENDED 0x4 | 206 | #define SEP_DEBUG_LEVEL_EXTENDED 0x4 |
208 | 207 | ||
209 | 208 | ||
210 | /* FUNCTIONAL MACROS */ | 209 | /* Debug helpers */ |
211 | 210 | ||
212 | /* debug macro without paramaters */ | 211 | #define dbg(fmt, args...) \ |
213 | #define DEBUG_PRINT_0(DEBUG_LEVEL , info) \ | 212 | do {\ |
214 | do { \ | 213 | if (sepDebug & SEP_DEBUG_LEVEL_BASIC) \ |
215 | if (DEBUG_LEVEL & sepDebug) \ | 214 | printk(KERN_DEBUG fmt, ##args); \ |
216 | printk(KERN_WARNING info); \ | 215 | } while(0); |
217 | } while (0) | ||
218 | |||
219 | /* debug macro with 1 paramater */ | ||
220 | #define DEBUG_PRINT_1(DEBUG_LEVEL , info , param1) \ | ||
221 | do { \ | ||
222 | if (DEBUG_LEVEL & sepDebug) \ | ||
223 | printk(KERN_WARNING info, param1); \ | ||
224 | } while (0) | ||
225 | |||
226 | /* debug macro with 2 paramaters */ | ||
227 | #define DEBUG_PRINT_2(DEBUG_LEVEL, info, param1, param2) \ | ||
228 | do { \ | ||
229 | if (DEBUG_LEVEL & sepDebug) \ | ||
230 | printk(KERN_WARNING info , param1, param2); \ | ||
231 | } while (0) | ||
232 | |||
233 | /* debug macro with 3 paramaters */ | ||
234 | #define DEBUG_PRINT_3(DEBUG_LEVEL, info, param1, param2, param3) \ | ||
235 | do { \ | ||
236 | if (DEBUG_LEVEL & sepDebug) \ | ||
237 | printk(KERN_WARNING info , param1, param2 , param3); \ | ||
238 | } while (0) | ||
239 | 216 | ||
240 | /* debug macro with 4 paramaters */ | 217 | #define edbg(fmt, args...) \ |
241 | #define DEBUG_PRINT_4(DEBUG_LEVEL, info, param1, param2, param3, param4) \ | ||
242 | do { \ | 218 | do { \ |
243 | if (DEBUG_LEVEL & sepDebug) \ | 219 | if (sepDebug & SEP_DEBUG_LEVEL_EXTENDED) \ |
244 | printk(KERN_WARNING info, param1, param2, param3, param4); \ | 220 | printk(KERN_DEBUG fmt, ##args); \ |
245 | } while (0) | 221 | } while(0); |
246 | 222 | ||
247 | 223 | ||
248 | 224 | ||
diff --git a/drivers/staging/sep/sep_ext_with_pci_driver.c b/drivers/staging/sep/sep_ext_with_pci_driver.c index 26246b3ae82..1bebc940aa3 100644 --- a/drivers/staging/sep/sep_ext_with_pci_driver.c +++ b/drivers/staging/sep/sep_ext_with_pci_driver.c | |||
@@ -167,10 +167,10 @@ int sep_copy_cache_resident_to_area(unsigned long src_cache_addr, | |||
167 | -------------------------------------*/ | 167 | -------------------------------------*/ |
168 | error = 0; | 168 | error = 0; |
169 | 169 | ||
170 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 170 | edbg( |
171 | "SEP Driver:rar_virtual is %p\n", | 171 | "SEP Driver:rar_virtual is %p\n", |
172 | sep_dev->rar_virtual_address); | 172 | sep_dev->rar_virtual_address); |
173 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 173 | edbg( |
174 | "SEP Driver:rar_physical is %08lx\n", | 174 | "SEP Driver:rar_physical is %08lx\n", |
175 | sep_dev->rar_physical_address); | 175 | sep_dev->rar_physical_address); |
176 | 176 | ||
@@ -182,15 +182,15 @@ int sep_copy_cache_resident_to_area(unsigned long src_cache_addr, | |||
182 | /* load cache */ | 182 | /* load cache */ |
183 | error = request_firmware(&fw, cache_name, &sep_dev->sep_pci_dev_ptr->dev); | 183 | error = request_firmware(&fw, cache_name, &sep_dev->sep_pci_dev_ptr->dev); |
184 | if (error) { | 184 | if (error) { |
185 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 185 | edbg( |
186 | "SEP Driver:cant request cache fw\n"); | 186 | "SEP Driver:cant request cache fw\n"); |
187 | goto end_function; | 187 | goto end_function; |
188 | } | 188 | } |
189 | 189 | ||
190 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 190 | edbg( |
191 | "SEP Driver:cache data loc is %p\n", | 191 | "SEP Driver:cache data loc is %p\n", |
192 | (void *)fw->data); | 192 | (void *)fw->data); |
193 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 193 | edbg( |
194 | "SEP Driver:cache data size is %08Zx\n", | 194 | "SEP Driver:cache data size is %08Zx\n", |
195 | fw->size); | 195 | fw->size); |
196 | 196 | ||
@@ -210,15 +210,15 @@ int sep_copy_cache_resident_to_area(unsigned long src_cache_addr, | |||
210 | /* load resident */ | 210 | /* load resident */ |
211 | error = request_firmware(&fw, res_name, &sep_dev->sep_pci_dev_ptr->dev); | 211 | error = request_firmware(&fw, res_name, &sep_dev->sep_pci_dev_ptr->dev); |
212 | if (error) { | 212 | if (error) { |
213 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 213 | edbg( |
214 | "SEP Driver:cant request res fw\n"); | 214 | "SEP Driver:cant request res fw\n"); |
215 | goto end_function; | 215 | goto end_function; |
216 | } | 216 | } |
217 | 217 | ||
218 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 218 | edbg( |
219 | "SEP Driver:res data loc is %p\n", | 219 | "SEP Driver:res data loc is %p\n", |
220 | (void *)fw->data); | 220 | (void *)fw->data); |
221 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 221 | edbg( |
222 | "SEP Driver:res data size is %08Zx\n", | 222 | "SEP Driver:res data size is %08Zx\n", |
223 | fw->size); | 223 | fw->size); |
224 | 224 | ||
@@ -230,23 +230,23 @@ int sep_copy_cache_resident_to_area(unsigned long src_cache_addr, | |||
230 | 230 | ||
231 | resident_addr = (unsigned long)sep_dev->resident_virtual_address; | 231 | resident_addr = (unsigned long)sep_dev->resident_virtual_address; |
232 | 232 | ||
233 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 233 | edbg( |
234 | "SEP Driver:resident_addr (physical )is %08lx\n", | 234 | "SEP Driver:resident_addr (physical )is %08lx\n", |
235 | sep_dev->resident_physical_address); | 235 | sep_dev->resident_physical_address); |
236 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 236 | edbg( |
237 | "SEP Driver:cache_addr (physical) is %08lx\n", | 237 | "SEP Driver:cache_addr (physical) is %08lx\n", |
238 | sep_dev->cache_physical_address); | 238 | sep_dev->cache_physical_address); |
239 | 239 | ||
240 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 240 | edbg( |
241 | "SEP Driver:resident_addr (logical )is %08lx\n", | 241 | "SEP Driver:resident_addr (logical )is %08lx\n", |
242 | resident_addr); | 242 | resident_addr); |
243 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 243 | edbg( |
244 | "SEP Driver:cache_addr (logical) is %08lx\n", | 244 | "SEP Driver:cache_addr (logical) is %08lx\n", |
245 | cache_addr); | 245 | cache_addr); |
246 | 246 | ||
247 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 247 | edbg( |
248 | "SEP Driver:resident_size is %08lx\n", sep_dev->resident_size); | 248 | "SEP Driver:resident_size is %08lx\n", sep_dev->resident_size); |
249 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 249 | edbg( |
250 | "SEP Driver:cache_size is %08lx\n", sep_dev->cache_size); | 250 | "SEP Driver:cache_size is %08lx\n", sep_dev->cache_size); |
251 | 251 | ||
252 | 252 | ||
@@ -277,7 +277,7 @@ int sep_map_and_alloc_shared_area(unsigned long shared_area_size, | |||
277 | // shared_virtual_address = ioremap_nocache(0xda00000,shared_area_size); | 277 | // shared_virtual_address = ioremap_nocache(0xda00000,shared_area_size); |
278 | sep_dev->shared_virtual_address = kmalloc(shared_area_size, GFP_KERNEL); | 278 | sep_dev->shared_virtual_address = kmalloc(shared_area_size, GFP_KERNEL); |
279 | if (!sep_dev->shared_virtual_address) { | 279 | if (!sep_dev->shared_virtual_address) { |
280 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 280 | edbg( |
281 | "sep_driver:shared memory kmalloc failed\n"); | 281 | "sep_driver:shared memory kmalloc failed\n"); |
282 | return -1; | 282 | return -1; |
283 | } | 283 | } |
@@ -290,13 +290,13 @@ int sep_map_and_alloc_shared_area(unsigned long shared_area_size, | |||
290 | /* set the physical address of the shared area */ | 290 | /* set the physical address of the shared area */ |
291 | *phys_shared_area_addr_ptr = sep_dev->shared_physical_address; | 291 | *phys_shared_area_addr_ptr = sep_dev->shared_physical_address; |
292 | 292 | ||
293 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 293 | edbg( |
294 | "SEP Driver:shared_virtual_address is %p\n", | 294 | "SEP Driver:shared_virtual_address is %p\n", |
295 | sep_dev->shared_virtual_address); | 295 | sep_dev->shared_virtual_address); |
296 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 296 | edbg( |
297 | "SEP Driver:shared_region_size is %08lx\n", | 297 | "SEP Driver:shared_region_size is %08lx\n", |
298 | shared_area_size); | 298 | shared_area_size); |
299 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 299 | edbg( |
300 | "SEP Driver:shared_physical_addr is %08lx\n", | 300 | "SEP Driver:shared_physical_addr is %08lx\n", |
301 | *phys_shared_area_addr_ptr); | 301 | *phys_shared_area_addr_ptr); |
302 | 302 | ||
@@ -327,10 +327,10 @@ void sep_unmap_and_free_shared_area(unsigned long shared_area_size, | |||
327 | */ | 327 | */ |
328 | unsigned long sep_shared_area_virt_to_phys(unsigned long virt_address) | 328 | unsigned long sep_shared_area_virt_to_phys(unsigned long virt_address) |
329 | { | 329 | { |
330 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 330 | edbg( |
331 | "SEP Driver:sh virt to phys v %08lx\n", | 331 | "SEP Driver:sh virt to phys v %08lx\n", |
332 | virt_address); | 332 | virt_address); |
333 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 333 | edbg( |
334 | "SEP Driver:sh virt to phys p %08lx\n", | 334 | "SEP Driver:sh virt to phys p %08lx\n", |
335 | sep_dev->shared_physical_address | 335 | sep_dev->shared_physical_address |
336 | + (virt_address - (unsigned long)sep_dev->shared_virtual_address)); | 336 | + (virt_address - (unsigned long)sep_dev->shared_virtual_address)); |
@@ -365,14 +365,14 @@ static int __devinit sep_probe(struct pci_dev *pdev, | |||
365 | CODE | 365 | CODE |
366 | ---------------------------*/ | 366 | ---------------------------*/ |
367 | 367 | ||
368 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 368 | edbg( |
369 | "Sep pci probe starting\n"); | 369 | "Sep pci probe starting\n"); |
370 | error = 0; | 370 | error = 0; |
371 | 371 | ||
372 | /* enable the device */ | 372 | /* enable the device */ |
373 | error = pci_enable_device(pdev); | 373 | error = pci_enable_device(pdev); |
374 | if (error) { | 374 | if (error) { |
375 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 375 | edbg( |
376 | "error enabling pci device\n"); | 376 | "error enabling pci device\n"); |
377 | goto end_function; | 377 | goto end_function; |
378 | } | 378 | } |
@@ -383,7 +383,7 @@ static int __devinit sep_probe(struct pci_dev *pdev, | |||
383 | /* get the io memory start address */ | 383 | /* get the io memory start address */ |
384 | sep_dev->io_memory_start_physical_address = pci_resource_start(pdev, 0); | 384 | sep_dev->io_memory_start_physical_address = pci_resource_start(pdev, 0); |
385 | if (!sep_dev->io_memory_start_physical_address) { | 385 | if (!sep_dev->io_memory_start_physical_address) { |
386 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 386 | edbg( |
387 | "SEP Driver error pci resource start\n"); | 387 | "SEP Driver error pci resource start\n"); |
388 | goto end_function; | 388 | goto end_function; |
389 | } | 389 | } |
@@ -391,7 +391,7 @@ static int __devinit sep_probe(struct pci_dev *pdev, | |||
391 | /* get the io memory end address */ | 391 | /* get the io memory end address */ |
392 | sep_dev->io_memory_end_physical_address = pci_resource_end(pdev, 0); | 392 | sep_dev->io_memory_end_physical_address = pci_resource_end(pdev, 0); |
393 | if (!sep_dev->io_memory_end_physical_address) { | 393 | if (!sep_dev->io_memory_end_physical_address) { |
394 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 394 | edbg( |
395 | "SEP Driver error pci resource end\n"); | 395 | "SEP Driver error pci resource end\n"); |
396 | goto end_function; | 396 | goto end_function; |
397 | } | 397 | } |
@@ -399,15 +399,15 @@ static int __devinit sep_probe(struct pci_dev *pdev, | |||
399 | sep_dev->io_memory_size = sep_dev->io_memory_end_physical_address - | 399 | sep_dev->io_memory_size = sep_dev->io_memory_end_physical_address - |
400 | sep_dev->io_memory_start_physical_address + 1; | 400 | sep_dev->io_memory_start_physical_address + 1; |
401 | 401 | ||
402 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 402 | edbg( |
403 | "SEP Driver:io_memory_start_physical_address is %08lx\n", | 403 | "SEP Driver:io_memory_start_physical_address is %08lx\n", |
404 | sep_dev->io_memory_start_physical_address); | 404 | sep_dev->io_memory_start_physical_address); |
405 | 405 | ||
406 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 406 | edbg( |
407 | "SEP Driver:io_memory_end_phyaical_address is %08lx\n", | 407 | "SEP Driver:io_memory_end_phyaical_address is %08lx\n", |
408 | sep_dev->io_memory_end_physical_address); | 408 | sep_dev->io_memory_end_physical_address); |
409 | 409 | ||
410 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 410 | edbg( |
411 | "SEP Driver:io_memory_size is %08lx\n", | 411 | "SEP Driver:io_memory_size is %08lx\n", |
412 | sep_dev->io_memory_size); | 412 | sep_dev->io_memory_size); |
413 | 413 | ||
@@ -415,12 +415,12 @@ static int __devinit sep_probe(struct pci_dev *pdev, | |||
415 | ioremap_nocache(sep_dev->io_memory_start_physical_address, | 415 | ioremap_nocache(sep_dev->io_memory_start_physical_address, |
416 | sep_dev->io_memory_size); | 416 | sep_dev->io_memory_size); |
417 | if (!sep_dev->io_memory_start_virtual_address) { | 417 | if (!sep_dev->io_memory_start_virtual_address) { |
418 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 418 | edbg( |
419 | "SEP Driver error ioremap of io memory\n"); | 419 | "SEP Driver error ioremap of io memory\n"); |
420 | goto end_function; | 420 | goto end_function; |
421 | } | 421 | } |
422 | 422 | ||
423 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 423 | edbg( |
424 | "SEP Driver:io_memory_start_virtual_address is %p\n", | 424 | "SEP Driver:io_memory_start_virtual_address is %p\n", |
425 | sep_dev->io_memory_start_virtual_address); | 425 | sep_dev->io_memory_start_virtual_address); |
426 | 426 | ||
@@ -433,25 +433,25 @@ static int __devinit sep_probe(struct pci_dev *pdev, | |||
433 | GFP_KERNEL); | 433 | GFP_KERNEL); |
434 | 434 | ||
435 | if (!sep_dev->rar_virtual_address) { | 435 | if (!sep_dev->rar_virtual_address) { |
436 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 436 | edbg( |
437 | "SEP Driver:cant kmalloc rar\n"); | 437 | "SEP Driver:cant kmalloc rar\n"); |
438 | goto end_function; | 438 | goto end_function; |
439 | } | 439 | } |
440 | /* FIXME */ | 440 | /* FIXME */ |
441 | sep_dev->rar_physical_address = __pa(sep_dev->rar_virtual_address); | 441 | sep_dev->rar_physical_address = __pa(sep_dev->rar_virtual_address); |
442 | 442 | ||
443 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 443 | edbg( |
444 | "SEP Driver:rar_physical is %08lx\n", | 444 | "SEP Driver:rar_physical is %08lx\n", |
445 | sep_dev->rar_physical_address); | 445 | sep_dev->rar_physical_address); |
446 | 446 | ||
447 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 447 | edbg( |
448 | "SEP Driver:rar_virtual is %p\n", | 448 | "SEP Driver:rar_virtual is %p\n", |
449 | sep_dev->rar_virtual_address); | 449 | sep_dev->rar_virtual_address); |
450 | 450 | ||
451 | 451 | ||
452 | #if !SEP_DRIVER_POLLING_MODE | 452 | #if !SEP_DRIVER_POLLING_MODE |
453 | 453 | ||
454 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 454 | edbg( |
455 | "SEP Driver: about to write IMR and ICR REG_ADDR\n"); | 455 | "SEP Driver: about to write IMR and ICR REG_ADDR\n"); |
456 | 456 | ||
457 | /* clear ICR register */ | 457 | /* clear ICR register */ |
@@ -466,10 +466,10 @@ static int __devinit sep_probe(struct pci_dev *pdev, | |||
466 | /* FIXME: */ | 466 | /* FIXME: */ |
467 | error = pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, (u8 *)&sep_dev->sep_irq); | 467 | error = pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, (u8 *)&sep_dev->sep_irq); |
468 | 468 | ||
469 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 469 | edbg( |
470 | "SEP Driver: my irq is %d\n", sep_irq); | 470 | "SEP Driver: my irq is %d\n", sep_irq); |
471 | 471 | ||
472 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 472 | edbg( |
473 | "SEP Driver: about to call request_irq\n"); | 473 | "SEP Driver: about to call request_irq\n"); |
474 | /* get the interrupt line */ | 474 | /* get the interrupt line */ |
475 | error = request_irq(sep_irq, sep_inthandler, IRQF_SHARED, | 475 | error = request_irq(sep_irq, sep_inthandler, IRQF_SHARED, |
@@ -478,7 +478,7 @@ static int __devinit sep_probe(struct pci_dev *pdev, | |||
478 | goto end_function; | 478 | goto end_function; |
479 | 479 | ||
480 | goto end_function; | 480 | goto end_function; |
481 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 481 | edbg( |
482 | "SEP Driver: about to write IMR REG_ADDR"); | 482 | "SEP Driver: about to write IMR REG_ADDR"); |
483 | 483 | ||
484 | /* set the IMR register - open only GPR 2 */ | 484 | /* set the IMR register - open only GPR 2 */ |
@@ -515,15 +515,15 @@ void sep_load_rom_code(void) | |||
515 | /* Loading ROM from SEP_ROM_image.h file */ | 515 | /* Loading ROM from SEP_ROM_image.h file */ |
516 | k = sizeof(CRYS_SEP_ROM); | 516 | k = sizeof(CRYS_SEP_ROM); |
517 | 517 | ||
518 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 518 | edbg( |
519 | "SEP Driver: DX_CC_TST_SepRomLoader start\n"); | 519 | "SEP Driver: DX_CC_TST_SepRomLoader start\n"); |
520 | 520 | ||
521 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 521 | edbg( |
522 | "SEP Driver: k is %lu\n", k); | 522 | "SEP Driver: k is %lu\n", k); |
523 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 523 | edbg( |
524 | "SEP Driver: sep_dev->reg_base_address is %p\n", | 524 | "SEP Driver: sep_dev->reg_base_address is %p\n", |
525 | sep_dev->reg_base_address); | 525 | sep_dev->reg_base_address); |
526 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 526 | edbg( |
527 | "SEP Driver: CRYS_SEP_ROM_start_address_offset is %p\n", | 527 | "SEP Driver: CRYS_SEP_ROM_start_address_offset is %p\n", |
528 | CRYS_SEP_ROM_start_address_offset); | 528 | CRYS_SEP_ROM_start_address_offset); |
529 | 529 | ||
@@ -553,45 +553,45 @@ void sep_load_rom_code(void) | |||
553 | retVal = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR3_REG_ADDR); | 553 | retVal = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR3_REG_ADDR); |
554 | } while (!regVal); | 554 | } while (!regVal); |
555 | 555 | ||
556 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 556 | edbg( |
557 | "SEP Driver: ROM polling ended\n"); | 557 | "SEP Driver: ROM polling ended\n"); |
558 | 558 | ||
559 | switch (regVal) { | 559 | switch (regVal) { |
560 | case 0x1: | 560 | case 0x1: |
561 | /* fatal error - read erro status from GPRO */ | 561 | /* fatal error - read erro status from GPRO */ |
562 | Error = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); | 562 | Error = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); |
563 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 563 | edbg( |
564 | "SEP Driver: ROM polling case 1\n"); | 564 | "SEP Driver: ROM polling case 1\n"); |
565 | break; | 565 | break; |
566 | case 0x2: | 566 | case 0x2: |
567 | /* Boot First Phase ended */ | 567 | /* Boot First Phase ended */ |
568 | warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); | 568 | warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); |
569 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 569 | edbg( |
570 | "SEP Driver: ROM polling case 2\n"); | 570 | "SEP Driver: ROM polling case 2\n"); |
571 | break; | 571 | break; |
572 | case 0x4: | 572 | case 0x4: |
573 | /* Cold boot ended successfully */ | 573 | /* Cold boot ended successfully */ |
574 | warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); | 574 | warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); |
575 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 575 | edbg( |
576 | "SEP Driver: ROM polling case 4\n"); | 576 | "SEP Driver: ROM polling case 4\n"); |
577 | Error = 0; | 577 | Error = 0; |
578 | break; | 578 | break; |
579 | case 0x8: | 579 | case 0x8: |
580 | /* Warmboot ended successfully */ | 580 | /* Warmboot ended successfully */ |
581 | warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); | 581 | warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); |
582 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 582 | edbg( |
583 | "SEP Driver: ROM polling case 8\n"); | 583 | "SEP Driver: ROM polling case 8\n"); |
584 | Error = 0; | 584 | Error = 0; |
585 | break; | 585 | break; |
586 | case 0x10: | 586 | case 0x10: |
587 | /* ColdWarm boot ended successfully */ | 587 | /* ColdWarm boot ended successfully */ |
588 | warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); | 588 | warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); |
589 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 589 | edbg( |
590 | "SEP Driver: ROM polling case 16\n"); | 590 | "SEP Driver: ROM polling case 16\n"); |
591 | Error = 0; | 591 | Error = 0; |
592 | break; | 592 | break; |
593 | case 0x20: | 593 | case 0x20: |
594 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 594 | edbg( |
595 | "SEP Driver: ROM polling case 32\n"); | 595 | "SEP Driver: ROM polling case 32\n"); |
596 | break; | 596 | break; |
597 | } | 597 | } |
diff --git a/drivers/staging/sep/sep_main_mod.c b/drivers/staging/sep/sep_main_mod.c index b739f7d4629..1822df8b9d2 100644 --- a/drivers/staging/sep/sep_main_mod.c +++ b/drivers/staging/sep/sep_main_mod.c | |||
@@ -398,7 +398,7 @@ static int sep_open(struct inode *inode_ptr, struct file *file_ptr) | |||
398 | CODE | 398 | CODE |
399 | ---------------------*/ | 399 | ---------------------*/ |
400 | 400 | ||
401 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:--------> open start\n"); | 401 | dbg("SEP Driver:--------> open start\n"); |
402 | 402 | ||
403 | error = 0; | 403 | error = 0; |
404 | 404 | ||
@@ -411,7 +411,7 @@ static int sep_open(struct inode *inode_ptr, struct file *file_ptr) | |||
411 | 411 | ||
412 | /* check the error */ | 412 | /* check the error */ |
413 | if (error) { | 413 | if (error) { |
414 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 414 | edbg( |
415 | "SEP Driver: down_interruptible failed\n"); | 415 | "SEP Driver: down_interruptible failed\n"); |
416 | 416 | ||
417 | goto end_function; | 417 | goto end_function; |
@@ -422,7 +422,7 @@ static int sep_open(struct inode *inode_ptr, struct file *file_ptr) | |||
422 | 422 | ||
423 | end_function: | 423 | end_function: |
424 | 424 | ||
425 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- open end\n"); | 425 | dbg("SEP Driver:<-------- open end\n"); |
426 | 426 | ||
427 | return error; | 427 | return error; |
428 | } | 428 | } |
@@ -439,8 +439,7 @@ static int sep_release(struct inode *inode_ptr, struct file *file_ptr) | |||
439 | CODE | 439 | CODE |
440 | ---------------------*/ | 440 | ---------------------*/ |
441 | 441 | ||
442 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 442 | dbg("----------->SEP Driver: sep_release start\n"); |
443 | "----------->SEP Driver: sep_release start\n"); | ||
444 | 443 | ||
445 | #if 0/*!SEP_DRIVER_POLLING_MODE*/ | 444 | #if 0/*!SEP_DRIVER_POLLING_MODE*/ |
446 | /* close IMR */ | 445 | /* close IMR */ |
@@ -454,8 +453,7 @@ static int sep_release(struct inode *inode_ptr, struct file *file_ptr) | |||
454 | /* unlock the sep mutex */ | 453 | /* unlock the sep mutex */ |
455 | mutex_unlock(&sep_mutex); | 454 | mutex_unlock(&sep_mutex); |
456 | 455 | ||
457 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 456 | dbg("SEP Driver:<-------- sep_release end\n"); |
458 | "SEP Driver:<-------- sep_release end\n"); | ||
459 | 457 | ||
460 | return 0; | 458 | return 0; |
461 | } | 459 | } |
@@ -475,12 +473,12 @@ static int sep_mmap(struct file *filp, struct vm_area_struct *vma) | |||
475 | CODE | 473 | CODE |
476 | -------------------------*/ | 474 | -------------------------*/ |
477 | 475 | ||
478 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "-------->SEP Driver: mmap start\n"); | 476 | dbg("-------->SEP Driver: mmap start\n"); |
479 | 477 | ||
480 | /* check that the size of the mapped range is as the size of the message | 478 | /* check that the size of the mapped range is as the size of the message |
481 | shared area */ | 479 | shared area */ |
482 | if ((vma->vm_end - vma->vm_start) > SEP_DRIVER_MMMAP_AREA_SIZE) { | 480 | if ((vma->vm_end - vma->vm_start) > SEP_DRIVER_MMMAP_AREA_SIZE) { |
483 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 481 | edbg( |
484 | "SEP Driver mmap requested size is more than allowed\n"); | 482 | "SEP Driver mmap requested size is more than allowed\n"); |
485 | printk(KERN_WARNING "SEP Driver mmap requested size is more \ | 483 | printk(KERN_WARNING "SEP Driver mmap requested size is more \ |
486 | than allowed\n"); | 484 | than allowed\n"); |
@@ -491,14 +489,14 @@ static int sep_mmap(struct file *filp, struct vm_area_struct *vma) | |||
491 | return -EAGAIN; | 489 | return -EAGAIN; |
492 | } | 490 | } |
493 | 491 | ||
494 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 492 | edbg( |
495 | "SEP Driver:g_message_shared_area_addr is %08lx\n", | 493 | "SEP Driver:g_message_shared_area_addr is %08lx\n", |
496 | sep_dev->message_shared_area_addr); | 494 | sep_dev->message_shared_area_addr); |
497 | 495 | ||
498 | /* get physical address */ | 496 | /* get physical address */ |
499 | phys_addr = sep_dev->phys_shared_area_addr; | 497 | phys_addr = sep_dev->phys_shared_area_addr; |
500 | 498 | ||
501 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver: phys_addr is %08lx\n", | 499 | edbg( "SEP Driver: phys_addr is %08lx\n", |
502 | phys_addr); | 500 | phys_addr); |
503 | 501 | ||
504 | if (remap_pfn_range(vma, | 502 | if (remap_pfn_range(vma, |
@@ -506,13 +504,13 @@ phys_addr); | |||
506 | phys_addr >> PAGE_SHIFT, | 504 | phys_addr >> PAGE_SHIFT, |
507 | vma->vm_end - vma->vm_start, | 505 | vma->vm_end - vma->vm_start, |
508 | vma->vm_page_prot)) { | 506 | vma->vm_page_prot)) { |
509 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 507 | edbg( |
510 | "SEP Driver remap_page_range failed\n"); | 508 | "SEP Driver remap_page_range failed\n"); |
511 | printk(KERN_WARNING "SEP Driver remap_page_range failed\n"); | 509 | printk(KERN_WARNING "SEP Driver remap_page_range failed\n"); |
512 | return -EAGAIN; | 510 | return -EAGAIN; |
513 | } | 511 | } |
514 | 512 | ||
515 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- mmap end\n"); | 513 | dbg("SEP Driver:<-------- mmap end\n"); |
516 | 514 | ||
517 | return 0; | 515 | return 0; |
518 | } | 516 | } |
@@ -534,7 +532,7 @@ static unsigned int sep_poll(struct file *filp, poll_table *wait) | |||
534 | CODE | 532 | CODE |
535 | -------------------------------------------------*/ | 533 | -------------------------------------------------*/ |
536 | 534 | ||
537 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "---------->SEP Driver poll: start\n"); | 535 | dbg("---------->SEP Driver poll: start\n"); |
538 | 536 | ||
539 | 537 | ||
540 | #if SEP_DRIVER_POLLING_MODE | 538 | #if SEP_DRIVER_POLLING_MODE |
@@ -543,11 +541,9 @@ static unsigned int sep_poll(struct file *filp, poll_table *wait) | |||
543 | retVal = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR2_REG_ADDR); | 541 | retVal = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR2_REG_ADDR); |
544 | 542 | ||
545 | for (count = 0; count < 10 * 4; count += 4) | 543 | for (count = 0; count < 10 * 4; count += 4) |
546 | DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, | 544 | edbg("Poll Debug Word %lu of the message is %lu\n", count, |
547 | "Poll Debug Word %lu of the message is %lu\n", | 545 | *((unsigned long *)(sep_dev->shared_area_addr + |
548 | count, | 546 | SEP_DRIVER_MESSAGE_SHARED_AREA_SIZE_IN_BYTES + count))); |
549 | *((unsigned long *)(sep_dev->shared_area_addr + | ||
550 | SEP_DRIVER_MESSAGE_SHARED_AREA_SIZE_IN_BYTES + count))); | ||
551 | } | 547 | } |
552 | 548 | ||
553 | sep_dev->sep_to_host_reply_counter++; | 549 | sep_dev->sep_to_host_reply_counter++; |
@@ -557,41 +553,38 @@ static unsigned int sep_poll(struct file *filp, poll_table *wait) | |||
557 | 553 | ||
558 | #endif | 554 | #endif |
559 | 555 | ||
560 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 556 | edbg( |
561 | "sep_dev->host_to_sep_send_counter is %lu\n", | 557 | "sep_dev->host_to_sep_send_counter is %lu\n", |
562 | sep_dev->host_to_sep_send_counter); | 558 | sep_dev->host_to_sep_send_counter); |
563 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 559 | edbg( |
564 | "sep_dev->sep_to_host_reply_counter is %lu\n", | 560 | "sep_dev->sep_to_host_reply_counter is %lu\n", |
565 | sep_dev->sep_to_host_reply_counter); | 561 | sep_dev->sep_to_host_reply_counter); |
566 | 562 | ||
567 | /* check if the data is ready */ | 563 | /* check if the data is ready */ |
568 | if (sep_dev->host_to_sep_send_counter == sep_dev->sep_to_host_reply_counter) { | 564 | if (sep_dev->host_to_sep_send_counter == sep_dev->sep_to_host_reply_counter) { |
569 | for (count = 0; count < 12 * 4; count += 4) | 565 | for (count = 0; count < 12 * 4; count += 4) |
570 | DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, | 566 | edbg("Sep Mesg Word %lu of the message is %lu\n", count, |
571 | "Sep Mesg Word %lu of the message is %lu\n", | 567 | *((unsigned long *)(sep_dev->shared_area_addr + count))); |
572 | count, *((unsigned long *)(sep_dev->shared_area_addr + count))); | ||
573 | 568 | ||
574 | for (count = 0; count < 10 * 4; count += 4) | 569 | for (count = 0; count < 10 * 4; count += 4) |
575 | DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, | 570 | edbg("Debug Data Word %lu of the message is %lu\n", count, |
576 | "Debug Data Word %lu of the message is %lu\n", | ||
577 | count, | ||
578 | *((unsigned long *)(sep_dev->shared_area_addr + 0x1800 + count))); | 571 | *((unsigned long *)(sep_dev->shared_area_addr + 0x1800 + count))); |
579 | 572 | ||
580 | retVal = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR2_REG_ADDR); | 573 | retVal = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR2_REG_ADDR); |
581 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, "retVal is %lu\n", retVal); | 574 | edbg( "retVal is %lu\n", retVal); |
582 | /* check if the this is sep reply or request */ | 575 | /* check if the this is sep reply or request */ |
583 | if (retVal >> 31) { | 576 | if (retVal >> 31) { |
584 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 577 | edbg( |
585 | "SEP Driver: sep request in\n"); | 578 | "SEP Driver: sep request in\n"); |
586 | /* request */ | 579 | /* request */ |
587 | mask |= POLLOUT | POLLWRNORM; | 580 | mask |= POLLOUT | POLLWRNORM; |
588 | } else { | 581 | } else { |
589 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver: sep reply in\n"); | 582 | edbg( "SEP Driver: sep reply in\n"); |
590 | mask |= POLLIN | POLLRDNORM; | 583 | mask |= POLLIN | POLLRDNORM; |
591 | } | 584 | } |
592 | } | 585 | } |
593 | 586 | ||
594 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- poll exit\n"); | 587 | dbg("SEP Driver:<-------- poll exit\n"); |
595 | return mask; | 588 | return mask; |
596 | } | 589 | } |
597 | 590 | ||
@@ -610,10 +603,9 @@ static int sep_ioctl(struct inode *inode, | |||
610 | ------------------------*/ | 603 | ------------------------*/ |
611 | error = 0; | 604 | error = 0; |
612 | 605 | ||
613 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 606 | dbg("------------>SEP Driver: ioctl start\n"); |
614 | "------------>SEP Driver: ioctl start\n"); | ||
615 | 607 | ||
616 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver: cmd is %x\n", cmd); | 608 | edbg("SEP Driver: cmd is %x\n", cmd); |
617 | 609 | ||
618 | /* check that the command is for sep device */ | 610 | /* check that the command is for sep device */ |
619 | if (_IOC_TYPE(cmd) != SEP_IOC_MAGIC_NUMBER) | 611 | if (_IOC_TYPE(cmd) != SEP_IOC_MAGIC_NUMBER) |
@@ -625,7 +617,7 @@ static int sep_ioctl(struct inode *inode, | |||
625 | /* send command to SEP */ | 617 | /* send command to SEP */ |
626 | sep_send_command_handler(); | 618 | sep_send_command_handler(); |
627 | 619 | ||
628 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 620 | edbg( |
629 | "SEP Driver: after sep_send_command_handler\n"); | 621 | "SEP Driver: after sep_send_command_handler\n"); |
630 | 622 | ||
631 | break; | 623 | break; |
@@ -754,8 +746,7 @@ static int sep_ioctl(struct inode *inode, | |||
754 | break; | 746 | break; |
755 | } | 747 | } |
756 | 748 | ||
757 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 749 | dbg("SEP Driver:<-------- ioctl end\n"); |
758 | "SEP Driver:<-------- ioctl end\n"); | ||
759 | 750 | ||
760 | return error; | 751 | return error; |
761 | } | 752 | } |
@@ -775,7 +766,7 @@ static int sep_register_driver_to_fs(void) | |||
775 | 766 | ||
776 | ret_val = alloc_chrdev_region(&g_sep_device_number, 0, 1, "sep_sec_driver"); | 767 | ret_val = alloc_chrdev_region(&g_sep_device_number, 0, 1, "sep_sec_driver"); |
777 | if (ret_val) { | 768 | if (ret_val) { |
778 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 769 | edbg( |
779 | "sep_driver:major number allocation failed, retval is %d\n", ret_val); | 770 | "sep_driver:major number allocation failed, retval is %d\n", ret_val); |
780 | goto end_function; | 771 | goto end_function; |
781 | } | 772 | } |
@@ -796,7 +787,7 @@ static int sep_register_driver_to_fs(void) | |||
796 | ret_val = cdev_add(&g_sep_cdev, g_sep_device_number, 1); | 787 | ret_val = cdev_add(&g_sep_cdev, g_sep_device_number, 1); |
797 | 788 | ||
798 | if (ret_val) { | 789 | if (ret_val) { |
799 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 790 | edbg( |
800 | "sep_driver:cdev_add failed, retval is %d\n", | 791 | "sep_driver:cdev_add failed, retval is %d\n", |
801 | ret_val); | 792 | ret_val); |
802 | goto end_function_unregister_devnum; | 793 | goto end_function_unregister_devnum; |
@@ -847,10 +838,8 @@ static int __init sep_init(void) | |||
847 | CODE | 838 | CODE |
848 | ------------------------*/ | 839 | ------------------------*/ |
849 | 840 | ||
850 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 841 | dbg("SEP Driver:-------->Init start\n"); |
851 | "SEP Driver:-------->Init start\n"); | 842 | edbg("sep->shared_area_addr = %lx\n", |
852 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, | ||
853 | "g_sep_shared_area_addr = %lx\n", | ||
854 | (unsigned long)&sep_dev->shared_area_addr); | 843 | (unsigned long)&sep_dev->shared_area_addr); |
855 | 844 | ||
856 | ret_val = 0; | 845 | ret_val = 0; |
@@ -872,7 +861,7 @@ for the current transaction */ | |||
872 | 861 | ||
873 | ret_val = sep_register_driver_to_device(); | 862 | ret_val = sep_register_driver_to_device(); |
874 | if (ret_val) { | 863 | if (ret_val) { |
875 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 864 | edbg( |
876 | "sep_driver:sep_driver_to_device failed, ret_val is %d\n", | 865 | "sep_driver:sep_driver_to_device failed, ret_val is %d\n", |
877 | ret_val); | 866 | ret_val); |
878 | goto end_function_unregister_from_fs; | 867 | goto end_function_unregister_from_fs; |
@@ -900,7 +889,7 @@ for the current transaction */ | |||
900 | /* now set the memory regions */ | 889 | /* now set the memory regions */ |
901 | sep_dev->message_shared_area_addr = sep_dev->shared_area_addr; | 890 | sep_dev->message_shared_area_addr = sep_dev->shared_area_addr; |
902 | 891 | ||
903 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 892 | edbg( |
904 | "SEP Driver: g_message_shared_area_addr is %08lx\n", | 893 | "SEP Driver: g_message_shared_area_addr is %08lx\n", |
905 | sep_dev->message_shared_area_addr); | 894 | sep_dev->message_shared_area_addr); |
906 | 895 | ||
@@ -930,12 +919,12 @@ for the current transaction */ | |||
930 | sep_dev->flow_wq_ptr = create_singlethread_workqueue("sepflowwq"); | 919 | sep_dev->flow_wq_ptr = create_singlethread_workqueue("sepflowwq"); |
931 | if (sep_dev->flow_wq_ptr == 0) { | 920 | if (sep_dev->flow_wq_ptr == 0) { |
932 | ret_val = -ENOMEM; | 921 | ret_val = -ENOMEM; |
933 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 922 | edbg( |
934 | "sep_driver:flow queue creation failed\n"); | 923 | "sep_driver:flow queue creation failed\n"); |
935 | goto end_function_deallocate_sep_shared_area; | 924 | goto end_function_deallocate_sep_shared_area; |
936 | } | 925 | } |
937 | 926 | ||
938 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 927 | edbg( |
939 | "SEP Driver: create flow workqueue \n"); | 928 | "SEP Driver: create flow workqueue \n"); |
940 | 929 | ||
941 | /* register driver to fs */ | 930 | /* register driver to fs */ |
@@ -969,7 +958,7 @@ end_function_unmap_io_memory: | |||
969 | 958 | ||
970 | end_function: | 959 | end_function: |
971 | 960 | ||
972 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- Init end\n"); | 961 | dbg("SEP Driver:<-------- Init end\n"); |
973 | 962 | ||
974 | return ret_val; | 963 | return ret_val; |
975 | } | 964 | } |
@@ -989,7 +978,7 @@ static void __exit sep_exit(void) | |||
989 | CODE | 978 | CODE |
990 | --------------------------------*/ | 979 | --------------------------------*/ |
991 | 980 | ||
992 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:--------> Exit start\n"); | 981 | dbg("SEP Driver:--------> Exit start\n"); |
993 | 982 | ||
994 | /* unregister from fs */ | 983 | /* unregister from fs */ |
995 | sep_unregister_driver_from_fs(); | 984 | sep_unregister_driver_from_fs(); |
@@ -1008,19 +997,19 @@ static void __exit sep_exit(void) | |||
1008 | sep_dev->shared_area_addr, | 997 | sep_dev->shared_area_addr, |
1009 | sep_dev->phys_shared_area_addr); | 998 | sep_dev->phys_shared_area_addr); |
1010 | 999 | ||
1011 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 1000 | edbg( |
1012 | "SEP Driver: free pages SEP SHARED AREA \n"); | 1001 | "SEP Driver: free pages SEP SHARED AREA \n"); |
1013 | 1002 | ||
1014 | iounmap((void *)sep_dev->reg_base_address); | 1003 | iounmap((void *)sep_dev->reg_base_address); |
1015 | 1004 | ||
1016 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver: iounmap \n"); | 1005 | edbg( "SEP Driver: iounmap \n"); |
1017 | 1006 | ||
1018 | /* release io memory region */ | 1007 | /* release io memory region */ |
1019 | release_mem_region(SEP_IO_MEM_REGION_START_ADDRESS, SEP_IO_MEM_REGION_SIZE); | 1008 | release_mem_region(SEP_IO_MEM_REGION_START_ADDRESS, SEP_IO_MEM_REGION_SIZE); |
1020 | 1009 | ||
1021 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver: release_mem_region \n"); | 1010 | edbg( "SEP Driver: release_mem_region \n"); |
1022 | 1011 | ||
1023 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- Exit end\n"); | 1012 | dbg("SEP Driver:<-------- Exit end\n"); |
1024 | } | 1013 | } |
1025 | 1014 | ||
1026 | 1015 | ||
@@ -1052,7 +1041,7 @@ irqreturn_t sep_inthandler(int irq, void *dev_id) | |||
1052 | 1041 | ||
1053 | /* read the IRR register to check if this is SEP interrupt */ | 1042 | /* read the IRR register to check if this is SEP interrupt */ |
1054 | reg_val = sep_read_reg(sep_dev, HW_HOST_IRR_REG_ADDR); | 1043 | reg_val = sep_read_reg(sep_dev, HW_HOST_IRR_REG_ADDR); |
1055 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, "SEP Interrupt - reg is %08lx\n", | 1044 | edbg( "SEP Interrupt - reg is %08lx\n", |
1056 | reg_val); | 1045 | reg_val); |
1057 | 1046 | ||
1058 | /* check if this is the flow interrupt */ | 1047 | /* check if this is the flow interrupt */ |
@@ -1139,13 +1128,10 @@ int sep_prepare_input_dma_table(unsigned long app_virt_addr, | |||
1139 | CODE | 1128 | CODE |
1140 | --------------------------*/ | 1129 | --------------------------*/ |
1141 | 1130 | ||
1142 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 1131 | dbg("SEP Driver:--------> sep_prepare_input_dma_table start\n"); |
1143 | "SEP Driver:--------> sep_prepare_input_dma_table start\n"); | ||
1144 | 1132 | ||
1145 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver:data_size is %lu\n", | 1133 | edbg( "SEP Driver:data_size is %lu\n", data_size); |
1146 | data_size); | 1134 | edbg( "SEP Driver:block_size is %lu\n", block_size); |
1147 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, "SEP Driver:block_size is %lu\n", | ||
1148 | block_size); | ||
1149 | 1135 | ||
1150 | /* initialize the pages pointers */ | 1136 | /* initialize the pages pointers */ |
1151 | sep_dev->in_page_array = 0; | 1137 | sep_dev->in_page_array = 0; |
@@ -1190,7 +1176,7 @@ int sep_prepare_input_dma_table(unsigned long app_virt_addr, | |||
1190 | if (result) | 1176 | if (result) |
1191 | return result; | 1177 | return result; |
1192 | 1178 | ||
1193 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1179 | edbg( |
1194 | "SEP Driver:output sep_dev->in_num_pages is %lu\n", | 1180 | "SEP Driver:output sep_dev->in_num_pages is %lu\n", |
1195 | sep_dev->in_num_pages); | 1181 | sep_dev->in_num_pages); |
1196 | 1182 | ||
@@ -1218,7 +1204,7 @@ int sep_prepare_input_dma_table(unsigned long app_virt_addr, | |||
1218 | /* now calculate the table size so that it will be module block size */ | 1204 | /* now calculate the table size so that it will be module block size */ |
1219 | table_data_size = (table_data_size / block_size) * block_size; | 1205 | table_data_size = (table_data_size / block_size) * block_size; |
1220 | 1206 | ||
1221 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1207 | edbg( |
1222 | "SEP Driver:output table_data_size is %lu\n", | 1208 | "SEP Driver:output table_data_size is %lu\n", |
1223 | table_data_size); | 1209 | table_data_size); |
1224 | 1210 | ||
@@ -1236,7 +1222,7 @@ int sep_prepare_input_dma_table(unsigned long app_virt_addr, | |||
1236 | *num_entries_ptr = num_entries_in_table; | 1222 | *num_entries_ptr = num_entries_in_table; |
1237 | *table_data_size_ptr = table_data_size; | 1223 | *table_data_size_ptr = table_data_size; |
1238 | 1224 | ||
1239 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1225 | edbg( |
1240 | "SEP Driver:output lli_table_in_ptr is %08lx\n", | 1226 | "SEP Driver:output lli_table_in_ptr is %08lx\n", |
1241 | *lli_table_ptr); | 1227 | *lli_table_ptr); |
1242 | } else { | 1228 | } else { |
@@ -1262,8 +1248,7 @@ int sep_prepare_input_dma_table(unsigned long app_virt_addr, | |||
1262 | 1248 | ||
1263 | end_function: | 1249 | end_function: |
1264 | 1250 | ||
1265 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 1251 | dbg("SEP Driver:<-------- sep_prepare_input_dma_table end\n"); |
1266 | "SEP Driver:<-------- sep_prepare_input_dma_table end\n"); | ||
1267 | 1252 | ||
1268 | return 0; | 1253 | return 0; |
1269 | 1254 | ||
@@ -1300,8 +1285,7 @@ int sep_prepare_input_output_dma_table(unsigned long app_virt_in_addr, | |||
1300 | CODE | 1285 | CODE |
1301 | --------------------------*/ | 1286 | --------------------------*/ |
1302 | 1287 | ||
1303 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 1288 | dbg("SEP Driver:--------> sep_prepare_input_output_dma_table start\n"); |
1304 | "SEP Driver:--------> sep_prepare_input_output_dma_table start\n"); | ||
1305 | 1289 | ||
1306 | result = 0; | 1290 | result = 0; |
1307 | 1291 | ||
@@ -1318,7 +1302,7 @@ int sep_prepare_input_output_dma_table(unsigned long app_virt_in_addr, | |||
1318 | &lli_in_array, | 1302 | &lli_in_array, |
1319 | &sep_dev->in_page_array); | 1303 | &sep_dev->in_page_array); |
1320 | if (result) { | 1304 | if (result) { |
1321 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 1305 | edbg( |
1322 | "SEP Driver: sep_lock_kernel_pages for input virtual buffer failed\n"); | 1306 | "SEP Driver: sep_lock_kernel_pages for input virtual buffer failed\n"); |
1323 | goto end_function; | 1307 | goto end_function; |
1324 | } | 1308 | } |
@@ -1330,7 +1314,7 @@ int sep_prepare_input_output_dma_table(unsigned long app_virt_in_addr, | |||
1330 | &lli_in_array, | 1314 | &lli_in_array, |
1331 | &sep_dev->in_page_array); | 1315 | &sep_dev->in_page_array); |
1332 | if (result) { | 1316 | if (result) { |
1333 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 1317 | edbg( |
1334 | "SEP Driver: sep_lock_user_pages for input virtual buffer failed\n"); | 1318 | "SEP Driver: sep_lock_user_pages for input virtual buffer failed\n"); |
1335 | goto end_function; | 1319 | goto end_function; |
1336 | } | 1320 | } |
@@ -1343,7 +1327,7 @@ int sep_prepare_input_output_dma_table(unsigned long app_virt_in_addr, | |||
1343 | &lli_out_array, | 1327 | &lli_out_array, |
1344 | &sep_dev->out_page_array); | 1328 | &sep_dev->out_page_array); |
1345 | if (result) { | 1329 | if (result) { |
1346 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 1330 | edbg( |
1347 | "SEP Driver: sep_lock_kernel_pages for output virtual buffer failed\n"); | 1331 | "SEP Driver: sep_lock_kernel_pages for output virtual buffer failed\n"); |
1348 | goto end_function_with_error1; | 1332 | goto end_function_with_error1; |
1349 | } | 1333 | } |
@@ -1354,18 +1338,18 @@ int sep_prepare_input_output_dma_table(unsigned long app_virt_in_addr, | |||
1354 | &lli_out_array, | 1338 | &lli_out_array, |
1355 | &sep_dev->out_page_array); | 1339 | &sep_dev->out_page_array); |
1356 | if (result) { | 1340 | if (result) { |
1357 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 1341 | edbg( |
1358 | "SEP Driver: sep_lock_user_pages for output virtual buffer failed\n"); | 1342 | "SEP Driver: sep_lock_user_pages for output virtual buffer failed\n"); |
1359 | goto end_function_with_error1; | 1343 | goto end_function_with_error1; |
1360 | } | 1344 | } |
1361 | } | 1345 | } |
1362 | 1346 | ||
1363 | 1347 | ||
1364 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1348 | edbg( |
1365 | "sep_dev->in_num_pages is %lu\n", sep_dev->in_num_pages); | 1349 | "sep_dev->in_num_pages is %lu\n", sep_dev->in_num_pages); |
1366 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1350 | edbg( |
1367 | "sep_dev->out_num_pages is %lu\n", sep_dev->out_num_pages); | 1351 | "sep_dev->out_num_pages is %lu\n", sep_dev->out_num_pages); |
1368 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1352 | edbg( |
1369 | "SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP is %x\n", | 1353 | "SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP is %x\n", |
1370 | SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP); | 1354 | SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP); |
1371 | 1355 | ||
@@ -1382,18 +1366,18 @@ int sep_prepare_input_output_dma_table(unsigned long app_virt_in_addr, | |||
1382 | out_num_entries_ptr, | 1366 | out_num_entries_ptr, |
1383 | table_data_size_ptr); | 1367 | table_data_size_ptr); |
1384 | if (result) { | 1368 | if (result) { |
1385 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 1369 | edbg( |
1386 | "SEP Driver: sep_construct_dma_tables_from_lli failed\n"); | 1370 | "SEP Driver: sep_construct_dma_tables_from_lli failed\n"); |
1387 | goto end_function_with_error2; | 1371 | goto end_function_with_error2; |
1388 | } | 1372 | } |
1389 | 1373 | ||
1390 | /* fall through - free the lli entry arrays */ | 1374 | /* fall through - free the lli entry arrays */ |
1391 | 1375 | ||
1392 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, "in_num_entries_ptr is %08lx\n", | 1376 | dbg("in_num_entries_ptr is %08lx\n", |
1393 | *in_num_entries_ptr); | 1377 | *in_num_entries_ptr); |
1394 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, "out_num_entries_ptr is %08lx\n", | 1378 | dbg("out_num_entries_ptr is %08lx\n", |
1395 | *out_num_entries_ptr); | 1379 | *out_num_entries_ptr); |
1396 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, "table_data_size_ptr is %08lx\n", | 1380 | dbg("table_data_size_ptr is %08lx\n", |
1397 | *table_data_size_ptr); | 1381 | *table_data_size_ptr); |
1398 | 1382 | ||
1399 | 1383 | ||
@@ -1407,9 +1391,7 @@ end_function_with_error1: | |||
1407 | 1391 | ||
1408 | end_function: | 1392 | end_function: |
1409 | 1393 | ||
1410 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, | 1394 | dbg("SEP Driver:<-------- sep_prepare_input_output_dma_table end result = %d\n", (int)result); |
1411 | "SEP Driver:<-------- sep_prepare_input_output_dma_table end result = %d\n", | ||
1412 | (int)result); | ||
1413 | 1395 | ||
1414 | return result; | 1396 | return result; |
1415 | 1397 | ||
@@ -1474,8 +1456,7 @@ int sep_construct_dma_tables_from_lli(struct sep_lli_entry_t *lli_in_array, | |||
1474 | CODE | 1456 | CODE |
1475 | ------------------------*/ | 1457 | ------------------------*/ |
1476 | 1458 | ||
1477 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 1459 | dbg("SEP Driver:--------> sep_construct_dma_tables_from_lli start\n"); |
1478 | "SEP Driver:--------> sep_construct_dma_tables_from_lli start\n"); | ||
1479 | 1460 | ||
1480 | /* initiate to pint after the message area */ | 1461 | /* initiate to pint after the message area */ |
1481 | lli_table_alloc_addr = sep_dev->shared_area_addr + | 1462 | lli_table_alloc_addr = sep_dev->shared_area_addr + |
@@ -1513,9 +1494,9 @@ int sep_construct_dma_tables_from_lli(struct sep_lli_entry_t *lli_in_array, | |||
1513 | &lli_out_array[current_out_entry], | 1494 | &lli_out_array[current_out_entry], |
1514 | (sep_out_lli_entries - current_out_entry)); | 1495 | (sep_out_lli_entries - current_out_entry)); |
1515 | 1496 | ||
1516 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1497 | edbg( |
1517 | "SEP Driver:in_table_data_size is %lu\n", in_table_data_size); | 1498 | "SEP Driver:in_table_data_size is %lu\n", in_table_data_size); |
1518 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1499 | edbg( |
1519 | "SEP Driver:out_table_data_size is %lu\n", out_table_data_size); | 1500 | "SEP Driver:out_table_data_size is %lu\n", out_table_data_size); |
1520 | 1501 | ||
1521 | /* check where the data is smallest */ | 1502 | /* check where the data is smallest */ |
@@ -1526,9 +1507,7 @@ int sep_construct_dma_tables_from_lli(struct sep_lli_entry_t *lli_in_array, | |||
1526 | /* now calculate the table size so that it will be module block size */ | 1507 | /* now calculate the table size so that it will be module block size */ |
1527 | table_data_size = (table_data_size / block_size) * block_size; | 1508 | table_data_size = (table_data_size / block_size) * block_size; |
1528 | 1509 | ||
1529 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, | 1510 | dbg("SEP Driver:table_data_size is %lu\n", table_data_size); |
1530 | "SEP Driver:table_data_size is %lu\n", | ||
1531 | table_data_size); | ||
1532 | 1511 | ||
1533 | /* construct input lli table */ | 1512 | /* construct input lli table */ |
1534 | sep_build_lli_table(&lli_in_array[current_in_entry], | 1513 | sep_build_lli_table(&lli_in_array[current_in_entry], |
@@ -1555,9 +1534,9 @@ int sep_construct_dma_tables_from_lli(struct sep_lli_entry_t *lli_in_array, | |||
1555 | *out_num_entries_ptr = num_entries_out_table; | 1534 | *out_num_entries_ptr = num_entries_out_table; |
1556 | *table_data_size_ptr = table_data_size; | 1535 | *table_data_size_ptr = table_data_size; |
1557 | 1536 | ||
1558 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1537 | edbg( |
1559 | "SEP Driver:output lli_table_in_ptr is %08lx\n", *lli_table_in_ptr); | 1538 | "SEP Driver:output lli_table_in_ptr is %08lx\n", *lli_table_in_ptr); |
1560 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1539 | edbg( |
1561 | "SEP Driver:output lli_table_out_ptr is %08lx\n", *lli_table_out_ptr); | 1540 | "SEP Driver:output lli_table_out_ptr is %08lx\n", *lli_table_out_ptr); |
1562 | } else { | 1541 | } else { |
1563 | /* update the info entry of the previous in table */ | 1542 | /* update the info entry of the previous in table */ |
@@ -1577,13 +1556,13 @@ int sep_construct_dma_tables_from_lli(struct sep_lli_entry_t *lli_in_array, | |||
1577 | info_in_entry_ptr = in_lli_table_ptr + num_entries_in_table - 1; | 1556 | info_in_entry_ptr = in_lli_table_ptr + num_entries_in_table - 1; |
1578 | info_out_entry_ptr = out_lli_table_ptr + num_entries_out_table - 1; | 1557 | info_out_entry_ptr = out_lli_table_ptr + num_entries_out_table - 1; |
1579 | 1558 | ||
1580 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1559 | edbg( |
1581 | "SEP Driver:output num_entries_out_table is %lu\n", | 1560 | "SEP Driver:output num_entries_out_table is %lu\n", |
1582 | (unsigned long)num_entries_out_table); | 1561 | (unsigned long)num_entries_out_table); |
1583 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1562 | edbg( |
1584 | "SEP Driver:output info_in_entry_ptr is %lu\n", | 1563 | "SEP Driver:output info_in_entry_ptr is %lu\n", |
1585 | (unsigned long)info_in_entry_ptr); | 1564 | (unsigned long)info_in_entry_ptr); |
1586 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1565 | edbg( |
1587 | "SEP Driver:output info_out_entry_ptr is %lu\n", | 1566 | "SEP Driver:output info_out_entry_ptr is %lu\n", |
1588 | (unsigned long)info_out_entry_ptr); | 1567 | (unsigned long)info_out_entry_ptr); |
1589 | } | 1568 | } |
@@ -1602,8 +1581,7 @@ int sep_construct_dma_tables_from_lli(struct sep_lli_entry_t *lli_in_array, | |||
1602 | *out_num_entries_ptr, | 1581 | *out_num_entries_ptr, |
1603 | *table_data_size_ptr); | 1582 | *table_data_size_ptr); |
1604 | 1583 | ||
1605 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 1584 | dbg("SEP Driver:<-------- sep_construct_dma_tables_from_lli end\n"); |
1606 | "SEP Driver:<-------- sep_construct_dma_tables_from_lli end\n"); | ||
1607 | 1585 | ||
1608 | return 0; | 1586 | return 0; |
1609 | } | 1587 | } |
@@ -1659,15 +1637,14 @@ static void sep_build_lli_table(struct sep_lli_entry_t *lli_array_ptr, | |||
1659 | CODE | 1637 | CODE |
1660 | ---------------------------*/ | 1638 | ---------------------------*/ |
1661 | 1639 | ||
1662 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 1640 | dbg("SEP Driver:--------> sep_build_lli_table start\n"); |
1663 | "SEP Driver:--------> sep_build_lli_table start\n"); | ||
1664 | 1641 | ||
1665 | /* init currrent table data size and lli array entry counter */ | 1642 | /* init currrent table data size and lli array entry counter */ |
1666 | curr_table_data_size = 0; | 1643 | curr_table_data_size = 0; |
1667 | array_counter = 0; | 1644 | array_counter = 0; |
1668 | *num_table_entries_ptr = 1; | 1645 | *num_table_entries_ptr = 1; |
1669 | 1646 | ||
1670 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1647 | edbg( |
1671 | "SEP Driver:table_data_size is %lu\n", | 1648 | "SEP Driver:table_data_size is %lu\n", |
1672 | table_data_size); | 1649 | table_data_size); |
1673 | 1650 | ||
@@ -1681,19 +1658,19 @@ static void sep_build_lli_table(struct sep_lli_entry_t *lli_array_ptr, | |||
1681 | lli_table_ptr->block_size = lli_array_ptr[array_counter].block_size; | 1658 | lli_table_ptr->block_size = lli_array_ptr[array_counter].block_size; |
1682 | curr_table_data_size += lli_table_ptr->block_size; | 1659 | curr_table_data_size += lli_table_ptr->block_size; |
1683 | 1660 | ||
1684 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1661 | edbg( |
1685 | "SEP Driver:lli_table_ptr is %08lx\n", | 1662 | "SEP Driver:lli_table_ptr is %08lx\n", |
1686 | (unsigned long)lli_table_ptr); | 1663 | (unsigned long)lli_table_ptr); |
1687 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1664 | edbg( |
1688 | "SEP Driver:lli_table_ptr->physical_address is %08lx\n", | 1665 | "SEP Driver:lli_table_ptr->physical_address is %08lx\n", |
1689 | lli_table_ptr->physical_address); | 1666 | lli_table_ptr->physical_address); |
1690 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1667 | edbg( |
1691 | "SEP Driver:lli_table_ptr->block_size is %lu\n", | 1668 | "SEP Driver:lli_table_ptr->block_size is %lu\n", |
1692 | lli_table_ptr->block_size); | 1669 | lli_table_ptr->block_size); |
1693 | 1670 | ||
1694 | /* check for overflow of the table data */ | 1671 | /* check for overflow of the table data */ |
1695 | if (curr_table_data_size > table_data_size) { | 1672 | if (curr_table_data_size > table_data_size) { |
1696 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 1673 | edbg( |
1697 | "SEP Driver:curr_table_data_size > table_data_size\n"); | 1674 | "SEP Driver:curr_table_data_size > table_data_size\n"); |
1698 | 1675 | ||
1699 | /* update the size of block in the table */ | 1676 | /* update the size of block in the table */ |
@@ -1710,10 +1687,10 @@ static void sep_build_lli_table(struct sep_lli_entry_t *lli_array_ptr, | |||
1710 | /* advance to the next entry in the lli_array */ | 1687 | /* advance to the next entry in the lli_array */ |
1711 | array_counter++; | 1688 | array_counter++; |
1712 | 1689 | ||
1713 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1690 | edbg( |
1714 | "SEP Driver:lli_table_ptr->physical_address is %08lx\n", | 1691 | "SEP Driver:lli_table_ptr->physical_address is %08lx\n", |
1715 | lli_table_ptr->physical_address); | 1692 | lli_table_ptr->physical_address); |
1716 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1693 | edbg( |
1717 | "SEP Driver:lli_table_ptr->block_size is %lu\n", | 1694 | "SEP Driver:lli_table_ptr->block_size is %lu\n", |
1718 | lli_table_ptr->block_size); | 1695 | lli_table_ptr->block_size); |
1719 | 1696 | ||
@@ -1725,13 +1702,13 @@ static void sep_build_lli_table(struct sep_lli_entry_t *lli_array_ptr, | |||
1725 | lli_table_ptr->physical_address = 0xffffffff; | 1702 | lli_table_ptr->physical_address = 0xffffffff; |
1726 | lli_table_ptr->block_size = 0; | 1703 | lli_table_ptr->block_size = 0; |
1727 | 1704 | ||
1728 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1705 | edbg( |
1729 | "SEP Driver:lli_table_ptr is %08lx\n", | 1706 | "SEP Driver:lli_table_ptr is %08lx\n", |
1730 | (unsigned long)lli_table_ptr); | 1707 | (unsigned long)lli_table_ptr); |
1731 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1708 | edbg( |
1732 | "SEP Driver:lli_table_ptr->physical_address is %08lx\n", | 1709 | "SEP Driver:lli_table_ptr->physical_address is %08lx\n", |
1733 | lli_table_ptr->physical_address); | 1710 | lli_table_ptr->physical_address); |
1734 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1711 | edbg( |
1735 | "SEP Driver:lli_table_ptr->block_size is %lu\n", | 1712 | "SEP Driver:lli_table_ptr->block_size is %lu\n", |
1736 | lli_table_ptr->block_size); | 1713 | lli_table_ptr->block_size); |
1737 | 1714 | ||
@@ -1739,13 +1716,12 @@ static void sep_build_lli_table(struct sep_lli_entry_t *lli_array_ptr, | |||
1739 | /* set the output parameter */ | 1716 | /* set the output parameter */ |
1740 | *num_processed_entries_ptr += array_counter; | 1717 | *num_processed_entries_ptr += array_counter; |
1741 | 1718 | ||
1742 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1719 | edbg( |
1743 | "SEP Driver:*num_processed_entries_ptr is %lu\n", | 1720 | "SEP Driver:*num_processed_entries_ptr is %lu\n", |
1744 | *num_processed_entries_ptr); | 1721 | *num_processed_entries_ptr); |
1745 | 1722 | ||
1746 | 1723 | ||
1747 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 1724 | dbg("SEP Driver:<-------- sep_build_lli_table end\n"); |
1748 | "SEP Driver:<-------- sep_build_lli_table end\n"); | ||
1749 | 1725 | ||
1750 | return; | 1726 | return; |
1751 | } | 1727 | } |
@@ -1765,37 +1741,31 @@ static void sep_debug_print_lli_tables(struct sep_lli_entry_t *lli_table_ptr, | |||
1765 | CODE | 1741 | CODE |
1766 | -------------------------------*/ | 1742 | -------------------------------*/ |
1767 | 1743 | ||
1768 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 1744 | dbg("SEP Driver:--------> sep_debug_print_lli_tables start\n"); |
1769 | "SEP Driver:--------> sep_debug_print_lli_tables start\n"); | ||
1770 | 1745 | ||
1771 | table_count = 1; | 1746 | table_count = 1; |
1772 | while ((unsigned long)lli_table_ptr != 0xffffffff) { | 1747 | while ((unsigned long)lli_table_ptr != 0xffffffff) { |
1773 | DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, | 1748 | edbg("SEP Driver: lli table %08lx, table_data_size is %lu\n", |
1774 | "SEP Driver: lli table %08lx, table_data_size is %lu\n", | 1749 | table_count, table_data_size); |
1775 | table_count, | 1750 | edbg("SEP Driver: num_table_entries is %lu\n", num_table_entries); |
1776 | table_data_size); | ||
1777 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | ||
1778 | "SEP Driver: num_table_entries is %lu\n", num_table_entries); | ||
1779 | 1751 | ||
1780 | /* print entries of the table (without info entry) */ | 1752 | /* print entries of the table (without info entry) */ |
1781 | for (entries_count = 0; | 1753 | for (entries_count = 0; |
1782 | entries_count < num_table_entries; | 1754 | entries_count < num_table_entries; |
1783 | entries_count++, lli_table_ptr++) { | 1755 | entries_count++, lli_table_ptr++) { |
1784 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1756 | edbg("SEP Driver:lli_table_ptr address is %08lx\n", |
1785 | "SEP Driver:lli_table_ptr address is %08lx\n", | 1757 | (unsigned long)lli_table_ptr); |
1786 | (unsigned long)lli_table_ptr); | 1758 | edbg("SEP Driver:phys address is %08lx block size is %lu\n", |
1787 | DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, | ||
1788 | "SEP Driver:phys address is %08lx block size is %lu\n", | ||
1789 | lli_table_ptr->physical_address, lli_table_ptr->block_size); | 1759 | lli_table_ptr->physical_address, lli_table_ptr->block_size); |
1790 | } | 1760 | } |
1791 | 1761 | ||
1792 | /* point to the info entry */ | 1762 | /* point to the info entry */ |
1793 | lli_table_ptr--; | 1763 | lli_table_ptr--; |
1794 | 1764 | ||
1795 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1765 | edbg( |
1796 | "SEP Driver:phys lli_table_ptr->block_size is %lu\n", | 1766 | "SEP Driver:phys lli_table_ptr->block_size is %lu\n", |
1797 | lli_table_ptr->block_size); | 1767 | lli_table_ptr->block_size); |
1798 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1768 | edbg( |
1799 | "SEP Driver:phys lli_table_ptr->physical_address is %08lx\n", | 1769 | "SEP Driver:phys lli_table_ptr->physical_address is %08lx\n", |
1800 | lli_table_ptr->physical_address); | 1770 | lli_table_ptr->physical_address); |
1801 | 1771 | ||
@@ -1805,10 +1775,8 @@ static void sep_debug_print_lli_tables(struct sep_lli_entry_t *lli_table_ptr, | |||
1805 | lli_table_ptr = (struct sep_lli_entry_t *) | 1775 | lli_table_ptr = (struct sep_lli_entry_t *) |
1806 | (lli_table_ptr->physical_address); | 1776 | (lli_table_ptr->physical_address); |
1807 | 1777 | ||
1808 | DEBUG_PRINT_3(SEP_DEBUG_LEVEL_EXTENDED, | 1778 | edbg("SEP Driver:phys table_data_size is %lu num_table_entries is %lu lli_table_ptr is%lu\n", |
1809 | "SEP Driver:phys table_data_size is %lu num_table_entries is \ | 1779 | table_data_size, num_table_entries, (unsigned long)lli_table_ptr); |
1810 | %lu lli_table_ptr is%lu\n", | ||
1811 | table_data_size, num_table_entries, (unsigned long)lli_table_ptr); | ||
1812 | 1780 | ||
1813 | if ((unsigned long)lli_table_ptr != 0xffffffff) | 1781 | if ((unsigned long)lli_table_ptr != 0xffffffff) |
1814 | lli_table_ptr = (struct sep_lli_entry_t *)sep_shared_area_phys_to_virt( | 1782 | lli_table_ptr = (struct sep_lli_entry_t *)sep_shared_area_phys_to_virt( |
@@ -1817,8 +1785,7 @@ static void sep_debug_print_lli_tables(struct sep_lli_entry_t *lli_table_ptr, | |||
1817 | table_count++; | 1785 | table_count++; |
1818 | } | 1786 | } |
1819 | 1787 | ||
1820 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 1788 | dbg("SEP Driver:<-------- sep_debug_print_lli_tables end\n"); |
1821 | "SEP Driver:<-------- sep_debug_print_lli_tables end\n"); | ||
1822 | } | 1789 | } |
1823 | 1790 | ||
1824 | 1791 | ||
@@ -1862,8 +1829,7 @@ int sep_lock_user_pages(unsigned long app_virt_addr, | |||
1862 | CODE | 1829 | CODE |
1863 | --------------------------*/ | 1830 | --------------------------*/ |
1864 | 1831 | ||
1865 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 1832 | dbg("SEP Driver:--------> sep_lock_user_pages start\n"); |
1866 | "SEP Driver:--------> sep_lock_user_pages start\n"); | ||
1867 | 1833 | ||
1868 | error = 0; | 1834 | error = 0; |
1869 | 1835 | ||
@@ -1872,26 +1838,26 @@ int sep_lock_user_pages(unsigned long app_virt_addr, | |||
1872 | start_page = app_virt_addr >> PAGE_SHIFT; | 1838 | start_page = app_virt_addr >> PAGE_SHIFT; |
1873 | num_pages = end_page - start_page + 1; | 1839 | num_pages = end_page - start_page + 1; |
1874 | 1840 | ||
1875 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1841 | edbg( |
1876 | "SEP Driver: app_virt_addr is %08lx\n", | 1842 | "SEP Driver: app_virt_addr is %08lx\n", |
1877 | app_virt_addr); | 1843 | app_virt_addr); |
1878 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1844 | edbg( |
1879 | "SEP Driver: data_size is %lu\n", | 1845 | "SEP Driver: data_size is %lu\n", |
1880 | data_size); | 1846 | data_size); |
1881 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1847 | edbg( |
1882 | "SEP Driver: start_page is %lu\n", | 1848 | "SEP Driver: start_page is %lu\n", |
1883 | start_page); | 1849 | start_page); |
1884 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1850 | edbg( |
1885 | "SEP Driver: end_page is %lu\n", | 1851 | "SEP Driver: end_page is %lu\n", |
1886 | end_page); | 1852 | end_page); |
1887 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 1853 | edbg( |
1888 | "SEP Driver: num_pages is %lu\n", | 1854 | "SEP Driver: num_pages is %lu\n", |
1889 | num_pages); | 1855 | num_pages); |
1890 | 1856 | ||
1891 | /* allocate array of pages structure pointers */ | 1857 | /* allocate array of pages structure pointers */ |
1892 | page_array = kmalloc(sizeof(struct page *) * num_pages, GFP_ATOMIC); | 1858 | page_array = kmalloc(sizeof(struct page *) * num_pages, GFP_ATOMIC); |
1893 | if (!page_array) { | 1859 | if (!page_array) { |
1894 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 1860 | edbg( |
1895 | "SEP Driver: kmalloc for page_array failed\n"); | 1861 | "SEP Driver: kmalloc for page_array failed\n"); |
1896 | 1862 | ||
1897 | error = -ENOMEM; | 1863 | error = -ENOMEM; |
@@ -1900,7 +1866,7 @@ int sep_lock_user_pages(unsigned long app_virt_addr, | |||
1900 | 1866 | ||
1901 | lli_array = kmalloc(sizeof(struct sep_lli_entry_t) * num_pages, GFP_ATOMIC); | 1867 | lli_array = kmalloc(sizeof(struct sep_lli_entry_t) * num_pages, GFP_ATOMIC); |
1902 | if (!lli_array) { | 1868 | if (!lli_array) { |
1903 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 1869 | edbg( |
1904 | "SEP Driver: kmalloc for lli_array failed\n"); | 1870 | "SEP Driver: kmalloc for lli_array failed\n"); |
1905 | 1871 | ||
1906 | error = -ENOMEM; | 1872 | error = -ENOMEM; |
@@ -1916,8 +1882,7 @@ int sep_lock_user_pages(unsigned long app_virt_addr, | |||
1916 | 1882 | ||
1917 | /* check the number of pages locked - if not all then exit with error */ | 1883 | /* check the number of pages locked - if not all then exit with error */ |
1918 | if (result != num_pages) { | 1884 | if (result != num_pages) { |
1919 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 1885 | dbg("SEP Driver: not all pages locked by get_user_pages\n"); |
1920 | "SEP Driver: not all pages locked by get_user_pages\n"); | ||
1921 | 1886 | ||
1922 | error = -ENOMEM; | 1887 | error = -ENOMEM; |
1923 | goto end_function_with_error2; | 1888 | goto end_function_with_error2; |
@@ -1940,8 +1905,7 @@ int sep_lock_user_pages(unsigned long app_virt_addr, | |||
1940 | lli_array[0].block_size = PAGE_SIZE - (app_virt_addr & (~PAGE_MASK)); | 1905 | lli_array[0].block_size = PAGE_SIZE - (app_virt_addr & (~PAGE_MASK)); |
1941 | 1906 | ||
1942 | /* debug print */ | 1907 | /* debug print */ |
1943 | DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, | 1908 | dbg("lli_array[0].physical_address is %08lx, lli_array[0].block_size is %lu\n", |
1944 | "lli_array[0].physical_address is %08lx, lli_array[0].block_size is %lu\n", | ||
1945 | lli_array[0].physical_address, | 1909 | lli_array[0].physical_address, |
1946 | lli_array[0].block_size); | 1910 | lli_array[0].block_size); |
1947 | 1911 | ||
@@ -1951,7 +1915,7 @@ int sep_lock_user_pages(unsigned long app_virt_addr, | |||
1951 | (unsigned long)page_to_phys(page_array[count]); | 1915 | (unsigned long)page_to_phys(page_array[count]); |
1952 | lli_array[count].block_size = PAGE_SIZE; | 1916 | lli_array[count].block_size = PAGE_SIZE; |
1953 | 1917 | ||
1954 | DEBUG_PRINT_4(SEP_DEBUG_LEVEL_EXTENDED, | 1918 | edbg( |
1955 | "lli_array[%lu].physical_address is %08lx, \ | 1919 | "lli_array[%lu].physical_address is %08lx, \ |
1956 | lli_array[%lu].block_size is %lu\n", | 1920 | lli_array[%lu].block_size is %lu\n", |
1957 | count, lli_array[count].physical_address, | 1921 | count, lli_array[count].physical_address, |
@@ -1970,13 +1934,11 @@ int sep_lock_user_pages(unsigned long app_virt_addr, | |||
1970 | (~PAGE_MASK); | 1934 | (~PAGE_MASK); |
1971 | 1935 | ||
1972 | if (lli_array[count].block_size == 0) { | 1936 | if (lli_array[count].block_size == 0) { |
1973 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, | 1937 | dbg("app_virt_addr is %08lx\n", app_virt_addr); |
1974 | "app_virt_addr is %08lx\n", | 1938 | dbg("data_size is %lu\n", data_size); |
1975 | app_virt_addr); | ||
1976 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, "data_size is %lu\n", data_size); | ||
1977 | while (1); | 1939 | while (1); |
1978 | } | 1940 | } |
1979 | DEBUG_PRINT_4(SEP_DEBUG_LEVEL_EXTENDED, | 1941 | edbg( |
1980 | "lli_array[%lu].physical_address is %08lx, \ | 1942 | "lli_array[%lu].physical_address is %08lx, \ |
1981 | lli_array[%lu].block_size is %lu\n", | 1943 | lli_array[%lu].block_size is %lu\n", |
1982 | count, lli_array[count].physical_address, | 1944 | count, lli_array[count].physical_address, |
@@ -2007,8 +1969,7 @@ end_function_with_error1: | |||
2007 | 1969 | ||
2008 | end_function: | 1970 | end_function: |
2009 | 1971 | ||
2010 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 1972 | dbg("SEP Driver:<-------- sep_lock_user_pages end\n"); |
2011 | "SEP Driver:<-------- sep_lock_user_pages end\n"); | ||
2012 | 1973 | ||
2013 | return 0; | 1974 | return 0; |
2014 | } | 1975 | } |
@@ -2051,8 +2012,7 @@ int sep_lock_kernel_pages(unsigned long kernel_virt_addr, | |||
2051 | CODE | 2012 | CODE |
2052 | --------------------------*/ | 2013 | --------------------------*/ |
2053 | 2014 | ||
2054 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2015 | dbg("SEP Driver:--------> sep_lock_kernel_pages start\n"); |
2055 | "SEP Driver:--------> sep_lock_kernel_pages start\n"); | ||
2056 | 2016 | ||
2057 | error = 0; | 2017 | error = 0; |
2058 | 2018 | ||
@@ -2061,25 +2021,25 @@ int sep_lock_kernel_pages(unsigned long kernel_virt_addr, | |||
2061 | start_page = kernel_virt_addr >> PAGE_SHIFT; | 2021 | start_page = kernel_virt_addr >> PAGE_SHIFT; |
2062 | num_pages = end_page - start_page + 1; | 2022 | num_pages = end_page - start_page + 1; |
2063 | 2023 | ||
2064 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 2024 | edbg( |
2065 | "SEP Driver: kernel_virt_addr is %08lx\n", | 2025 | "SEP Driver: kernel_virt_addr is %08lx\n", |
2066 | kernel_virt_addr); | 2026 | kernel_virt_addr); |
2067 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 2027 | edbg( |
2068 | "SEP Driver: data_size is %lu\n", | 2028 | "SEP Driver: data_size is %lu\n", |
2069 | data_size); | 2029 | data_size); |
2070 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 2030 | edbg( |
2071 | "SEP Driver: start_page is %lx\n", | 2031 | "SEP Driver: start_page is %lx\n", |
2072 | start_page); | 2032 | start_page); |
2073 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 2033 | edbg( |
2074 | "SEP Driver: end_page is %lx\n", | 2034 | "SEP Driver: end_page is %lx\n", |
2075 | end_page); | 2035 | end_page); |
2076 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 2036 | edbg( |
2077 | "SEP Driver: num_pages is %lu\n", | 2037 | "SEP Driver: num_pages is %lu\n", |
2078 | num_pages); | 2038 | num_pages); |
2079 | 2039 | ||
2080 | lli_array = kmalloc(sizeof(struct sep_lli_entry_t) * num_pages, GFP_ATOMIC); | 2040 | lli_array = kmalloc(sizeof(struct sep_lli_entry_t) * num_pages, GFP_ATOMIC); |
2081 | if (!lli_array) { | 2041 | if (!lli_array) { |
2082 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 2042 | edbg( |
2083 | "SEP Driver: kmalloc for lli_array failed\n"); | 2043 | "SEP Driver: kmalloc for lli_array failed\n"); |
2084 | 2044 | ||
2085 | error = -ENOMEM; | 2045 | error = -ENOMEM; |
@@ -2099,8 +2059,7 @@ int sep_lock_kernel_pages(unsigned long kernel_virt_addr, | |||
2099 | PAGE_SIZE - (kernel_virt_addr & (~PAGE_MASK)); | 2059 | PAGE_SIZE - (kernel_virt_addr & (~PAGE_MASK)); |
2100 | 2060 | ||
2101 | /* debug print */ | 2061 | /* debug print */ |
2102 | DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, | 2062 | dbg("lli_array[0].physical_address is %08lx, lli_array[0].block_size is %lu\n", |
2103 | "lli_array[0].physical_address is %08lx, lli_array[0].block_size is %lu\n", | ||
2104 | lli_array[0].physical_address, | 2063 | lli_array[0].physical_address, |
2105 | lli_array[0].block_size); | 2064 | lli_array[0].block_size); |
2106 | 2065 | ||
@@ -2113,7 +2072,7 @@ int sep_lock_kernel_pages(unsigned long kernel_virt_addr, | |||
2113 | (unsigned long)virt_to_phys((unsigned long *)next_kernel_address); | 2072 | (unsigned long)virt_to_phys((unsigned long *)next_kernel_address); |
2114 | lli_array[count].block_size = PAGE_SIZE; | 2073 | lli_array[count].block_size = PAGE_SIZE; |
2115 | 2074 | ||
2116 | DEBUG_PRINT_4(SEP_DEBUG_LEVEL_EXTENDED, | 2075 | edbg( |
2117 | "lli_array[%lu].physical_address is %08lx, \ | 2076 | "lli_array[%lu].physical_address is %08lx, \ |
2118 | lli_array[%lu].block_size is %lu\n", | 2077 | lli_array[%lu].block_size is %lu\n", |
2119 | count, lli_array[count].physical_address, count, | 2078 | count, lli_array[count].physical_address, count, |
@@ -2133,14 +2092,13 @@ int sep_lock_kernel_pages(unsigned long kernel_virt_addr, | |||
2133 | (kernel_virt_addr + data_size) & (~PAGE_MASK); | 2092 | (kernel_virt_addr + data_size) & (~PAGE_MASK); |
2134 | 2093 | ||
2135 | if (lli_array[count].block_size == 0) { | 2094 | if (lli_array[count].block_size == 0) { |
2136 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, | 2095 | dbg("app_virt_addr is %08lx\n", |
2137 | "app_virt_addr is %08lx\n", | ||
2138 | kernel_virt_addr); | 2096 | kernel_virt_addr); |
2139 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_BASIC, "data_size is %lu\n", data_size); | 2097 | dbg("data_size is %lu\n", data_size); |
2140 | while (1); | 2098 | while (1); |
2141 | } | 2099 | } |
2142 | 2100 | ||
2143 | DEBUG_PRINT_4(SEP_DEBUG_LEVEL_EXTENDED, | 2101 | edbg( |
2144 | "lli_array[%lu].physical_address is %08lx, \ | 2102 | "lli_array[%lu].physical_address is %08lx, \ |
2145 | lli_array[%lu].block_size is %lu\n", | 2103 | lli_array[%lu].block_size is %lu\n", |
2146 | count, lli_array[count].physical_address, | 2104 | count, lli_array[count].physical_address, |
@@ -2156,8 +2114,7 @@ int sep_lock_kernel_pages(unsigned long kernel_virt_addr, | |||
2156 | 2114 | ||
2157 | end_function: | 2115 | end_function: |
2158 | 2116 | ||
2159 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2117 | dbg("SEP Driver:<-------- sep_lock_kernel_pages end\n"); |
2160 | "SEP Driver:<-------- sep_lock_kernel_pages end\n"); | ||
2161 | 2118 | ||
2162 | return 0; | 2119 | return 0; |
2163 | } | 2120 | } |
@@ -2207,8 +2164,7 @@ static void sep_send_command_handler() | |||
2207 | 2164 | ||
2208 | unsigned long count; | 2165 | unsigned long count; |
2209 | 2166 | ||
2210 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2167 | dbg("SEP Driver:--------> sep_send_command_handler start\n"); |
2211 | "SEP Driver:--------> sep_send_command_handler start\n"); | ||
2212 | 2168 | ||
2213 | sep_set_time(0, 0); | 2169 | sep_set_time(0, 0); |
2214 | 2170 | ||
@@ -2216,10 +2172,8 @@ static void sep_send_command_handler() | |||
2216 | flush_cache_all(); | 2172 | flush_cache_all(); |
2217 | 2173 | ||
2218 | for (count = 0; count < 12 * 4; count += 4) | 2174 | for (count = 0; count < 12 * 4; count += 4) |
2219 | DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, | 2175 | edbg("Word %lu of the message is %lu\n", count, |
2220 | "Word %lu of the message is %lu\n", | 2176 | *((unsigned long *)(sep_dev->shared_area_addr + count))); |
2221 | count, | ||
2222 | *((unsigned long *)(sep_dev->shared_area_addr + count))); | ||
2223 | 2177 | ||
2224 | /* update counter */ | 2178 | /* update counter */ |
2225 | sep_dev->host_to_sep_send_counter++; | 2179 | sep_dev->host_to_sep_send_counter++; |
@@ -2227,8 +2181,7 @@ static void sep_send_command_handler() | |||
2227 | /* send interrupt to SEP */ | 2181 | /* send interrupt to SEP */ |
2228 | sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x2); | 2182 | sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x2); |
2229 | 2183 | ||
2230 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2184 | dbg("SEP Driver:<-------- sep_send_command_handler end\n"); |
2231 | "SEP Driver:<-------- sep_send_command_handler end\n"); | ||
2232 | 2185 | ||
2233 | return; | 2186 | return; |
2234 | } | 2187 | } |
@@ -2241,17 +2194,14 @@ static void sep_send_reply_command_handler() | |||
2241 | { | 2194 | { |
2242 | unsigned long count; | 2195 | unsigned long count; |
2243 | 2196 | ||
2244 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2197 | dbg("SEP Driver:--------> sep_send_reply_command_handler start\n"); |
2245 | "SEP Driver:--------> sep_send_reply_command_handler start\n"); | ||
2246 | 2198 | ||
2247 | /* flash cache */ | 2199 | /* flash cache */ |
2248 | flush_cache_all(); | 2200 | flush_cache_all(); |
2249 | 2201 | ||
2250 | for (count = 0; count < 12 * 4; count += 4) | 2202 | for (count = 0; count < 12 * 4; count += 4) |
2251 | DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, | 2203 | edbg("Word %lu of the message is %lu\n", count, |
2252 | "Word %lu of the message is %lu\n", | 2204 | *((unsigned long *)(sep_dev->shared_area_addr + count))); |
2253 | count, | ||
2254 | *((unsigned long *)(sep_dev->shared_area_addr + count))); | ||
2255 | 2205 | ||
2256 | 2206 | ||
2257 | /* update counter */ | 2207 | /* update counter */ |
@@ -2266,8 +2216,7 @@ static void sep_send_reply_command_handler() | |||
2266 | 2216 | ||
2267 | sep_dev->sep_to_host_reply_counter++; | 2217 | sep_dev->sep_to_host_reply_counter++; |
2268 | 2218 | ||
2269 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2219 | dbg("SEP Driver:<-------- sep_send_reply_command_handler end\n"); |
2270 | "SEP Driver:<-------- sep_send_reply_command_handler end\n"); | ||
2271 | 2220 | ||
2272 | return; | 2221 | return; |
2273 | } | 2222 | } |
@@ -2293,8 +2242,7 @@ static int sep_allocate_data_pool_memory_handler(unsigned long arg) | |||
2293 | CODE | 2242 | CODE |
2294 | ----------------------------*/ | 2243 | ----------------------------*/ |
2295 | 2244 | ||
2296 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2245 | dbg("SEP Driver:--------> sep_allocate_data_pool_memory_handler start\n"); |
2297 | "SEP Driver:--------> sep_allocate_data_pool_memory_handler start\n"); | ||
2298 | 2246 | ||
2299 | 2247 | ||
2300 | error = copy_from_user(&command_args, | 2248 | error = copy_from_user(&command_args, |
@@ -2330,8 +2278,7 @@ static int sep_allocate_data_pool_memory_handler(unsigned long arg) | |||
2330 | 2278 | ||
2331 | end_function: | 2279 | end_function: |
2332 | 2280 | ||
2333 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2281 | dbg("SEP Driver:<-------- sep_allocate_data_pool_memory_handler end\n"); |
2334 | "SEP Driver:<-------- sep_allocate_data_pool_memory_handler end\n"); | ||
2335 | 2282 | ||
2336 | return error; | 2283 | return error; |
2337 | } | 2284 | } |
@@ -2360,8 +2307,7 @@ static int sep_write_into_data_pool_handler(unsigned long arg) | |||
2360 | CODE | 2307 | CODE |
2361 | -----------------------------*/ | 2308 | -----------------------------*/ |
2362 | 2309 | ||
2363 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2310 | dbg("SEP Driver:--------> sep_write_into_data_pool_handler start\n"); |
2364 | "SEP Driver:--------> sep_write_into_data_pool_handler start\n"); | ||
2365 | 2311 | ||
2366 | /* get the application address */ | 2312 | /* get the application address */ |
2367 | error = get_user(app_in_address, | 2313 | error = get_user(app_in_address, |
@@ -2400,8 +2346,7 @@ static int sep_write_into_data_pool_handler(unsigned long arg) | |||
2400 | 2346 | ||
2401 | end_function: | 2347 | end_function: |
2402 | 2348 | ||
2403 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2349 | dbg("SEP Driver:<-------- sep_write_into_data_pool_handler end\n"); |
2404 | "SEP Driver:<-------- sep_write_into_data_pool_handler end\n"); | ||
2405 | 2350 | ||
2406 | return error; | 2351 | return error; |
2407 | } | 2352 | } |
@@ -2430,8 +2375,7 @@ static int sep_read_from_data_pool_handler(unsigned long arg) | |||
2430 | CODE | 2375 | CODE |
2431 | -----------------------------*/ | 2376 | -----------------------------*/ |
2432 | 2377 | ||
2433 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2378 | dbg("SEP Driver:--------> sep_read_from_data_pool_handler start\n"); |
2434 | "SEP Driver:--------> sep_read_from_data_pool_handler start\n"); | ||
2435 | 2379 | ||
2436 | /* get the application address */ | 2380 | /* get the application address */ |
2437 | error = get_user(app_out_address, | 2381 | error = get_user(app_out_address, |
@@ -2468,8 +2412,7 @@ static int sep_read_from_data_pool_handler(unsigned long arg) | |||
2468 | 2412 | ||
2469 | end_function: | 2413 | end_function: |
2470 | 2414 | ||
2471 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2415 | dbg("SEP Driver:<-------- sep_read_from_data_pool_handler end\n"); |
2472 | "SEP Driver:<-------- sep_read_from_data_pool_handler end\n"); | ||
2473 | 2416 | ||
2474 | return error; | 2417 | return error; |
2475 | } | 2418 | } |
@@ -2491,8 +2434,7 @@ static int sep_create_sync_dma_tables_handler(unsigned long arg) | |||
2491 | CODE | 2434 | CODE |
2492 | --------------------------*/ | 2435 | --------------------------*/ |
2493 | 2436 | ||
2494 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2437 | dbg("SEP Driver:--------> sep_create_sync_dma_tables_handler start\n"); |
2495 | "SEP Driver:--------> sep_create_sync_dma_tables_handler start\n"); | ||
2496 | 2438 | ||
2497 | error = copy_from_user(&command_args, | 2439 | error = copy_from_user(&command_args, |
2498 | (void *)arg, | 2440 | (void *)arg, |
@@ -2500,16 +2442,16 @@ static int sep_create_sync_dma_tables_handler(unsigned long arg) | |||
2500 | if (error) | 2442 | if (error) |
2501 | goto end_function; | 2443 | goto end_function; |
2502 | 2444 | ||
2503 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 2445 | edbg( |
2504 | "app_in_address is %08lx\n", | 2446 | "app_in_address is %08lx\n", |
2505 | command_args.app_in_address); | 2447 | command_args.app_in_address); |
2506 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 2448 | edbg( |
2507 | "app_out_address is %08lx\n", | 2449 | "app_out_address is %08lx\n", |
2508 | command_args.app_out_address); | 2450 | command_args.app_out_address); |
2509 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 2451 | edbg( |
2510 | "data_size is %lu\n", | 2452 | "data_size is %lu\n", |
2511 | command_args.data_in_size); | 2453 | command_args.data_in_size); |
2512 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 2454 | edbg( |
2513 | "block_size is %lu\n", | 2455 | "block_size is %lu\n", |
2514 | command_args.block_size); | 2456 | command_args.block_size); |
2515 | 2457 | ||
@@ -2547,8 +2489,7 @@ static int sep_create_sync_dma_tables_handler(unsigned long arg) | |||
2547 | 2489 | ||
2548 | end_function: | 2490 | end_function: |
2549 | 2491 | ||
2550 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2492 | dbg("SEP Driver:<-------- sep_create_sync_dma_tables_handler end\n"); |
2551 | "SEP Driver:<-------- sep_create_sync_dma_tables_handler end\n"); | ||
2552 | 2493 | ||
2553 | return error; | 2494 | return error; |
2554 | } | 2495 | } |
@@ -2562,8 +2503,7 @@ int sep_free_dma_table_data_handler() | |||
2562 | CODE | 2503 | CODE |
2563 | -----------------------------*/ | 2504 | -----------------------------*/ |
2564 | 2505 | ||
2565 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2506 | dbg("SEP Driver:--------> sep_free_dma_table_data_handler start\n"); |
2566 | "SEP Driver:--------> sep_free_dma_table_data_handler start\n"); | ||
2567 | 2507 | ||
2568 | /* free input pages array */ | 2508 | /* free input pages array */ |
2569 | sep_free_dma_pages(sep_dev->in_page_array, | 2509 | sep_free_dma_pages(sep_dev->in_page_array, |
@@ -2583,8 +2523,7 @@ int sep_free_dma_table_data_handler() | |||
2583 | sep_dev->out_num_pages = 0; | 2523 | sep_dev->out_num_pages = 0; |
2584 | 2524 | ||
2585 | 2525 | ||
2586 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2526 | dbg("SEP Driver:<-------- sep_free_dma_table_data_handler end\n"); |
2587 | "SEP Driver:<-------- sep_free_dma_table_data_handler end\n"); | ||
2588 | 2527 | ||
2589 | return 0; | 2528 | return 0; |
2590 | } | 2529 | } |
@@ -2616,8 +2555,7 @@ static int sep_create_flow_dma_tables_handler(unsigned long arg) | |||
2616 | CODE | 2555 | CODE |
2617 | --------------------------*/ | 2556 | --------------------------*/ |
2618 | 2557 | ||
2619 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2558 | dbg("SEP Driver:--------> sep_create_flow_dma_tables_handler start\n"); |
2620 | "SEP Driver:--------> sep_create_flow_dma_tables_handler start\n"); | ||
2621 | 2559 | ||
2622 | /* init variables */ | 2560 | /* init variables */ |
2623 | prev_info_entry_ptr = 0; | 2561 | prev_info_entry_ptr = 0; |
@@ -2682,8 +2620,7 @@ end_function_with_error: | |||
2682 | 2620 | ||
2683 | end_function: | 2621 | end_function: |
2684 | 2622 | ||
2685 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2623 | dbg("SEP Driver:<-------- sep_create_flow_dma_tables_handler end\n"); |
2686 | "SEP Driver:<-------- sep_create_flow_dma_tables_handler end\n"); | ||
2687 | 2624 | ||
2688 | return error; | 2625 | return error; |
2689 | 2626 | ||
@@ -2719,8 +2656,7 @@ static int sep_add_flow_tables_handler(unsigned long arg) | |||
2719 | CODE | 2656 | CODE |
2720 | ----------------------------*/ | 2657 | ----------------------------*/ |
2721 | 2658 | ||
2722 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2659 | dbg("SEP Driver:--------> sep_add_flow_tables_handler start\n"); |
2723 | "SEP Driver:--------> sep_add_flow_tables_handler start\n"); | ||
2724 | 2660 | ||
2725 | /* get input parameters */ | 2661 | /* get input parameters */ |
2726 | error = copy_from_user(&command_args, | 2662 | error = copy_from_user(&command_args, |
@@ -2822,8 +2758,7 @@ end_function_with_error: | |||
2822 | 2758 | ||
2823 | end_function: | 2759 | end_function: |
2824 | 2760 | ||
2825 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2761 | dbg("SEP Driver:<-------- sep_add_flow_tables_handler end\n"); |
2826 | "SEP Driver:<-------- sep_add_flow_tables_handler end\n"); | ||
2827 | 2762 | ||
2828 | return error; | 2763 | return error; |
2829 | } | 2764 | } |
@@ -2846,8 +2781,7 @@ static int sep_add_flow_tables_message_handler(unsigned long arg) | |||
2846 | CODE | 2781 | CODE |
2847 | ------------------------------*/ | 2782 | ------------------------------*/ |
2848 | 2783 | ||
2849 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2784 | dbg("SEP Driver:--------> sep_add_flow_tables_message_handler start\n"); |
2850 | "SEP Driver:--------> sep_add_flow_tables_message_handler start\n"); | ||
2851 | 2785 | ||
2852 | error = copy_from_user(&command_args, | 2786 | error = copy_from_user(&command_args, |
2853 | (void *)arg, | 2787 | (void *)arg, |
@@ -2877,8 +2811,7 @@ static int sep_add_flow_tables_message_handler(unsigned long arg) | |||
2877 | 2811 | ||
2878 | end_function: | 2812 | end_function: |
2879 | 2813 | ||
2880 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2814 | dbg("SEP Driver:<-------- sep_add_flow_tables_message_handler end\n"); |
2881 | "SEP Driver:<-------- sep_add_flow_tables_message_handler end\n"); | ||
2882 | 2815 | ||
2883 | return error; | 2816 | return error; |
2884 | } | 2817 | } |
@@ -2899,8 +2832,7 @@ static int sep_get_static_pool_addr_handler(unsigned long arg) | |||
2899 | CODE | 2832 | CODE |
2900 | ------------------------------*/ | 2833 | ------------------------------*/ |
2901 | 2834 | ||
2902 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2835 | dbg("SEP Driver:--------> sep_get_static_pool_addr_handler start\n"); |
2903 | "SEP Driver:--------> sep_get_static_pool_addr_handler start\n"); | ||
2904 | 2836 | ||
2905 | /*prepare the output parameters in the struct */ | 2837 | /*prepare the output parameters in the struct */ |
2906 | command_args.physical_static_address = sep_dev->phys_shared_area_addr + | 2838 | command_args.physical_static_address = sep_dev->phys_shared_area_addr + |
@@ -2908,8 +2840,7 @@ static int sep_get_static_pool_addr_handler(unsigned long arg) | |||
2908 | command_args.virtual_static_address = sep_dev->shared_area_addr + | 2840 | command_args.virtual_static_address = sep_dev->shared_area_addr + |
2909 | SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES; | 2841 | SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES; |
2910 | 2842 | ||
2911 | DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, | 2843 | edbg("SEP Driver:physical_static_address is %08lx, virtual_static_address %08lx\n", |
2912 | "SEP Driver:physical_static_address is %08lx, virtual_static_address %08lx\n", | ||
2913 | command_args.physical_static_address, | 2844 | command_args.physical_static_address, |
2914 | command_args.virtual_static_address); | 2845 | command_args.virtual_static_address); |
2915 | 2846 | ||
@@ -2922,8 +2853,7 @@ static int sep_get_static_pool_addr_handler(unsigned long arg) | |||
2922 | 2853 | ||
2923 | end_function: | 2854 | end_function: |
2924 | 2855 | ||
2925 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2856 | dbg("SEP Driver:<-------- sep_get_static_pool_addr_handler end\n"); |
2926 | "SEP Driver:<-------- sep_get_static_pool_addr_handler end\n"); | ||
2927 | 2857 | ||
2928 | return error; | 2858 | return error; |
2929 | } | 2859 | } |
@@ -2944,8 +2874,7 @@ static int sep_get_physical_mapped_offset_handler(unsigned long arg) | |||
2944 | CODE | 2874 | CODE |
2945 | ------------------------------*/ | 2875 | ------------------------------*/ |
2946 | 2876 | ||
2947 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2877 | dbg("SEP Driver:--------> sep_get_physical_mapped_offset_handler start\n"); |
2948 | "SEP Driver:--------> sep_get_physical_mapped_offset_handler start\n"); | ||
2949 | 2878 | ||
2950 | error = copy_from_user(&command_args, | 2879 | error = copy_from_user(&command_args, |
2951 | (void *)arg, | 2880 | (void *)arg, |
@@ -2962,8 +2891,7 @@ static int sep_get_physical_mapped_offset_handler(unsigned long arg) | |||
2962 | command_args.offset = command_args.physical_address - | 2891 | command_args.offset = command_args.physical_address - |
2963 | sep_dev->phys_shared_area_addr; | 2892 | sep_dev->phys_shared_area_addr; |
2964 | 2893 | ||
2965 | DEBUG_PRINT_2(SEP_DEBUG_LEVEL_EXTENDED, | 2894 | edbg("SEP Driver:physical_address is %08lx, offset is %lu\n", |
2966 | "SEP Driver:physical_address is %08lx, offset is %lu\n", | ||
2967 | command_args.physical_address, | 2895 | command_args.physical_address, |
2968 | command_args.offset); | 2896 | command_args.offset); |
2969 | 2897 | ||
@@ -2976,8 +2904,7 @@ static int sep_get_physical_mapped_offset_handler(unsigned long arg) | |||
2976 | 2904 | ||
2977 | end_function: | 2905 | end_function: |
2978 | 2906 | ||
2979 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2907 | dbg("SEP Driver:<-------- sep_get_physical_mapped_offset_handler end\n"); |
2980 | "SEP Driver:<-------- sep_get_physical_mapped_offset_handler end\n"); | ||
2981 | 2908 | ||
2982 | return error; | 2909 | return error; |
2983 | } | 2910 | } |
@@ -2998,8 +2925,7 @@ static int sep_start_handler(void) | |||
2998 | CODE | 2925 | CODE |
2999 | ------------------------------*/ | 2926 | ------------------------------*/ |
3000 | 2927 | ||
3001 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2928 | dbg("SEP Driver:--------> sep_start_handler start\n"); |
3002 | "SEP Driver:--------> sep_start_handler start\n"); | ||
3003 | 2929 | ||
3004 | error = 0; | 2930 | error = 0; |
3005 | 2931 | ||
@@ -3017,8 +2943,7 @@ static int sep_start_handler(void) | |||
3017 | 2943 | ||
3018 | end_function: | 2944 | end_function: |
3019 | 2945 | ||
3020 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2946 | dbg("SEP Driver:<-------- sep_start_handler end\n"); |
3021 | "SEP Driver:<-------- sep_start_handler end\n"); | ||
3022 | 2947 | ||
3023 | return error; | 2948 | return error; |
3024 | } | 2949 | } |
@@ -3050,16 +2975,14 @@ static int sep_init_handler(unsigned long arg) | |||
3050 | CODE | 2975 | CODE |
3051 | ---------------------*/ | 2976 | ---------------------*/ |
3052 | 2977 | ||
3053 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2978 | dbg("SEP Driver:--------> sep_init_handler start\n"); |
3054 | "SEP Driver:--------> sep_init_handler start\n"); | ||
3055 | 2979 | ||
3056 | error = 0; | 2980 | error = 0; |
3057 | 2981 | ||
3058 | error = copy_from_user(&command_args, (void *)arg, | 2982 | error = copy_from_user(&command_args, (void *)arg, |
3059 | sizeof(struct sep_driver_init_t)); | 2983 | sizeof(struct sep_driver_init_t)); |
3060 | 2984 | ||
3061 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2985 | dbg("SEP Driver:--------> sep_init_handler - finished copy_from_user \n"); |
3062 | "SEP Driver:--------> sep_init_handler - finished copy_from_user \n"); | ||
3063 | 2986 | ||
3064 | if (error) | 2987 | if (error) |
3065 | goto end_function; | 2988 | goto end_function; |
@@ -3067,8 +2990,7 @@ static int sep_init_handler(unsigned long arg) | |||
3067 | /* PATCH - configure the DMA to single -burst instead of multi-burst */ | 2990 | /* PATCH - configure the DMA to single -burst instead of multi-burst */ |
3068 | /*sep_configure_dma_burst();*/ | 2991 | /*sep_configure_dma_burst();*/ |
3069 | 2992 | ||
3070 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 2993 | dbg("SEP Driver:--------> sep_init_handler - finished sep_configure_dma_burst \n"); |
3071 | "SEP Driver:--------> sep_init_handler - finished sep_configure_dma_burst \n"); | ||
3072 | 2994 | ||
3073 | message_ptr = (unsigned long *)command_args.message_addr; | 2995 | message_ptr = (unsigned long *)command_args.message_addr; |
3074 | 2996 | ||
@@ -3084,7 +3006,7 @@ static int sep_init_handler(unsigned long arg) | |||
3084 | sep_write_reg(sep_dev, HW_SRAM_DATA_REG_ADDR, | 3006 | sep_write_reg(sep_dev, HW_SRAM_DATA_REG_ADDR, |
3085 | message_word); | 3007 | message_word); |
3086 | 3008 | ||
3087 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 3009 | edbg( |
3088 | "SEP Driver:message_word is %lu\n", | 3010 | "SEP Driver:message_word is %lu\n", |
3089 | message_word); | 3011 | message_word); |
3090 | 3012 | ||
@@ -3092,8 +3014,7 @@ static int sep_init_handler(unsigned long arg) | |||
3092 | sep_wait_sram_write(sep_dev); | 3014 | sep_wait_sram_write(sep_dev); |
3093 | } | 3015 | } |
3094 | 3016 | ||
3095 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3017 | dbg("SEP Driver:--------> sep_init_handler - finished getting messages from user space\n"); |
3096 | "SEP Driver:--------> sep_init_handler - finished getting messages from user space\n"); | ||
3097 | 3018 | ||
3098 | /* signal SEP */ | 3019 | /* signal SEP */ |
3099 | sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, | 3020 | sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, |
@@ -3103,30 +3024,28 @@ static int sep_init_handler(unsigned long arg) | |||
3103 | reg_val = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR3_REG_ADDR); | 3024 | reg_val = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR3_REG_ADDR); |
3104 | } while (!(reg_val & 0xFFFFFFFD)); | 3025 | } while (!(reg_val & 0xFFFFFFFD)); |
3105 | 3026 | ||
3106 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3027 | dbg("SEP Driver:--------> sep_init_handler - finished waiting for reg_val & 0xFFFFFFFD \n"); |
3107 | "SEP Driver:--------> sep_init_handler - finished waiting for reg_val & 0xFFFFFFFD \n"); | ||
3108 | 3028 | ||
3109 | /* check the value */ | 3029 | /* check the value */ |
3110 | if (reg_val == 0x1) { | 3030 | if (reg_val == 0x1) { |
3111 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_EXTENDED, | 3031 | edbg( |
3112 | "SEP Driver:init failed\n"); | 3032 | "SEP Driver:init failed\n"); |
3113 | 3033 | ||
3114 | error = sep_read_reg(sep_dev, 0x8060); | 3034 | error = sep_read_reg(sep_dev, 0x8060); |
3115 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 3035 | edbg( |
3116 | "SEP Driver:sw monitor is %lu\n", | 3036 | "SEP Driver:sw monitor is %lu\n", |
3117 | error); | 3037 | error); |
3118 | 3038 | ||
3119 | /* fatal error - read erro status from GPRO */ | 3039 | /* fatal error - read erro status from GPRO */ |
3120 | error = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); | 3040 | error = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); |
3121 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 3041 | edbg( |
3122 | "SEP Driver:error is %lu\n", error); | 3042 | "SEP Driver:error is %lu\n", error); |
3123 | goto end_function; | 3043 | goto end_function; |
3124 | } | 3044 | } |
3125 | 3045 | ||
3126 | end_function: | 3046 | end_function: |
3127 | 3047 | ||
3128 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3048 | dbg("SEP Driver:<-------- sep_init_handler end\n"); |
3129 | "SEP Driver:<-------- sep_init_handler end\n"); | ||
3130 | 3049 | ||
3131 | return error; | 3050 | return error; |
3132 | 3051 | ||
@@ -3190,16 +3109,16 @@ static int sep_realloc_cache_resident_handler(unsigned long arg) | |||
3190 | /* set the new shared area */ | 3109 | /* set the new shared area */ |
3191 | command_args.new_shared_area_addr = sep_dev->phys_shared_area_addr; | 3110 | command_args.new_shared_area_addr = sep_dev->phys_shared_area_addr; |
3192 | 3111 | ||
3193 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 3112 | edbg( |
3194 | "SEP Driver:command_args.new_shared_area_addr is %08lx\n", | 3113 | "SEP Driver:command_args.new_shared_area_addr is %08lx\n", |
3195 | command_args.new_shared_area_addr); | 3114 | command_args.new_shared_area_addr); |
3196 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 3115 | edbg( |
3197 | "SEP Driver:command_args.new_base_addr is %08lx\n", | 3116 | "SEP Driver:command_args.new_base_addr is %08lx\n", |
3198 | command_args.new_base_addr); | 3117 | command_args.new_base_addr); |
3199 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 3118 | edbg( |
3200 | "SEP Driver:command_args.new_resident_addr is %08lx\n", | 3119 | "SEP Driver:command_args.new_resident_addr is %08lx\n", |
3201 | command_args.new_resident_addr); | 3120 | command_args.new_resident_addr); |
3202 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 3121 | edbg( |
3203 | "SEP Driver:command_args.new_cache_addr is %08lx\n", | 3122 | "SEP Driver:command_args.new_cache_addr is %08lx\n", |
3204 | command_args.new_cache_addr); | 3123 | command_args.new_cache_addr); |
3205 | 3124 | ||
@@ -3255,8 +3174,7 @@ static int sep_set_api_mode_handler(unsigned long arg) | |||
3255 | CODE | 3174 | CODE |
3256 | -----------------------------*/ | 3175 | -----------------------------*/ |
3257 | 3176 | ||
3258 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3177 | dbg("SEP Driver:--------> sep_set_api_mode_handler start\n"); |
3259 | "SEP Driver:--------> sep_set_api_mode_handler start\n"); | ||
3260 | 3178 | ||
3261 | error = get_user( | 3179 | error = get_user( |
3262 | mode_flag, &(((struct sep_driver_set_api_mode_t *)arg)->mode)); | 3180 | mode_flag, &(((struct sep_driver_set_api_mode_t *)arg)->mode)); |
@@ -3269,8 +3187,7 @@ static int sep_set_api_mode_handler(unsigned long arg) | |||
3269 | 3187 | ||
3270 | end_function: | 3188 | end_function: |
3271 | 3189 | ||
3272 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3190 | dbg("SEP Driver:<-------- sep_set_api_mode_handler end\n"); |
3273 | "SEP Driver:<-------- sep_set_api_mode_handler end\n"); | ||
3274 | 3191 | ||
3275 | return error; | 3192 | return error; |
3276 | } | 3193 | } |
@@ -3284,8 +3201,7 @@ static int sep_end_transaction_handler(unsigned long arg) | |||
3284 | CODE | 3201 | CODE |
3285 | -----------------------------*/ | 3202 | -----------------------------*/ |
3286 | 3203 | ||
3287 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3204 | dbg("SEP Driver:--------> sep_end_transaction_handler start\n"); |
3288 | "SEP Driver:--------> sep_end_transaction_handler start\n"); | ||
3289 | 3205 | ||
3290 | #if 0/*!SEP_DRIVER_POLLING_MODE*/ | 3206 | #if 0/*!SEP_DRIVER_POLLING_MODE*/ |
3291 | /* close IMR */ | 3207 | /* close IMR */ |
@@ -3298,8 +3214,7 @@ static int sep_end_transaction_handler(unsigned long arg) | |||
3298 | mutex_unlock(&sep_mutex); | 3214 | mutex_unlock(&sep_mutex); |
3299 | #endif | 3215 | #endif |
3300 | 3216 | ||
3301 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3217 | dbg("SEP Driver:<-------- sep_end_transaction_handler end\n"); |
3302 | "SEP Driver:<-------- sep_end_transaction_handler end\n"); | ||
3303 | 3218 | ||
3304 | return 0; | 3219 | return 0; |
3305 | } | 3220 | } |
@@ -3723,8 +3638,7 @@ static int sep_set_flow_id_handler(unsigned long arg) | |||
3723 | CODE | 3638 | CODE |
3724 | -----------------------*/ | 3639 | -----------------------*/ |
3725 | 3640 | ||
3726 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3641 | dbg("------------>SEP Driver: sep_set_flow_id_handler start\n"); |
3727 | "------------>SEP Driver: sep_set_flow_id_handler start\n"); | ||
3728 | 3642 | ||
3729 | error = get_user(flow_id, | 3643 | error = get_user(flow_id, |
3730 | &(((struct sep_driver_set_flow_id_t *)arg)->flow_id)); | 3644 | &(((struct sep_driver_set_flow_id_t *)arg)->flow_id)); |
@@ -3742,8 +3656,7 @@ static int sep_set_flow_id_handler(unsigned long arg) | |||
3742 | 3656 | ||
3743 | end_function: | 3657 | end_function: |
3744 | 3658 | ||
3745 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3659 | dbg("SEP Driver:<-------- sep_set_flow_id_handler end\n"); |
3746 | "SEP Driver:<-------- sep_set_flow_id_handler end\n"); | ||
3747 | 3660 | ||
3748 | 3661 | ||
3749 | return error; | 3662 | return error; |
@@ -3767,8 +3680,7 @@ static int sep_set_time(unsigned long *address_ptr, | |||
3767 | CODE | 3680 | CODE |
3768 | --------------------------*/ | 3681 | --------------------------*/ |
3769 | 3682 | ||
3770 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3683 | dbg("SEP Driver:--------> sep_set_time start\n"); |
3771 | "SEP Driver:--------> sep_set_time start\n"); | ||
3772 | 3684 | ||
3773 | 3685 | ||
3774 | do_gettimeofday(&time); | 3686 | do_gettimeofday(&time); |
@@ -3780,13 +3692,13 @@ static int sep_set_time(unsigned long *address_ptr, | |||
3780 | *(unsigned long *)time_addr = SEP_TIME_VAL_TOKEN; | 3692 | *(unsigned long *)time_addr = SEP_TIME_VAL_TOKEN; |
3781 | *(unsigned long *)(time_addr + 4) = time.tv_sec; | 3693 | *(unsigned long *)(time_addr + 4) = time.tv_sec; |
3782 | 3694 | ||
3783 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 3695 | edbg( |
3784 | "SEP Driver:time.tv_sec is %lu\n", | 3696 | "SEP Driver:time.tv_sec is %lu\n", |
3785 | time.tv_sec); | 3697 | time.tv_sec); |
3786 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 3698 | edbg( |
3787 | "SEP Driver:time_addr is %lu\n", | 3699 | "SEP Driver:time_addr is %lu\n", |
3788 | time_addr); | 3700 | time_addr); |
3789 | DEBUG_PRINT_1(SEP_DEBUG_LEVEL_EXTENDED, | 3701 | edbg( |
3790 | "SEP Driver:g_message_shared_area_addr is %lu\n", | 3702 | "SEP Driver:g_message_shared_area_addr is %lu\n", |
3791 | sep_dev->message_shared_area_addr); | 3703 | sep_dev->message_shared_area_addr); |
3792 | 3704 | ||
@@ -3797,8 +3709,7 @@ static int sep_set_time(unsigned long *address_ptr, | |||
3797 | if (time_in_sec_ptr) | 3709 | if (time_in_sec_ptr) |
3798 | *time_in_sec_ptr = time.tv_sec; | 3710 | *time_in_sec_ptr = time.tv_sec; |
3799 | 3711 | ||
3800 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3712 | dbg("SEP Driver:<-------- sep_set_time end\n"); |
3801 | "SEP Driver:<-------- sep_set_time end\n"); | ||
3802 | 3713 | ||
3803 | return 0; | 3714 | return 0; |
3804 | } | 3715 | } |
@@ -3820,21 +3731,16 @@ static void sep_configure_dma_burst(void) | |||
3820 | 3731 | ||
3821 | #define HW_AHB_RD_WR_BURSTS_REG_ADDR 0x0E10UL | 3732 | #define HW_AHB_RD_WR_BURSTS_REG_ADDR 0x0E10UL |
3822 | 3733 | ||
3823 | unsigned long regVal; | 3734 | dbg("SEP Driver:<-------- sep_configure_dma_burst start \n"); |
3824 | |||
3825 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | ||
3826 | "SEP Driver:<-------- sep_configure_dma_burst start \n"); | ||
3827 | 3735 | ||
3828 | /* request access to registers from SEP */ | 3736 | /* request access to registers from SEP */ |
3829 | sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x2); | 3737 | sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x2); |
3830 | 3738 | ||
3831 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3739 | dbg("SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (write reg) \n"); |
3832 | "SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (write reg) \n"); | ||
3833 | 3740 | ||
3834 | sep_wait_busy(sep_dev); | 3741 | sep_wait_busy(sep_dev); |
3835 | 3742 | ||
3836 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3743 | dbg("SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (while(revVal) wait loop) \n"); |
3837 | "SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (while(revVal) wait loop) \n"); | ||
3838 | 3744 | ||
3839 | /* set the DMA burst register to single burst*/ | 3745 | /* set the DMA burst register to single burst*/ |
3840 | sep_write_reg(sep_dev, HW_AHB_RD_WR_BURSTS_REG_ADDR, 0x0UL); | 3746 | sep_write_reg(sep_dev, HW_AHB_RD_WR_BURSTS_REG_ADDR, 0x0UL); |
@@ -3843,8 +3749,7 @@ static void sep_configure_dma_burst(void) | |||
3843 | sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x0UL); | 3749 | sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x0UL); |
3844 | sep_wait_busy(sep_dev); | 3750 | sep_wait_busy(sep_dev); |
3845 | 3751 | ||
3846 | DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, | 3752 | dbg("SEP Driver:<-------- sep_configure_dma_burst done \n"); |
3847 | "SEP Driver:<-------- sep_configure_dma_burst done \n"); | ||
3848 | 3753 | ||
3849 | } | 3754 | } |
3850 | 3755 | ||