Signed-off-by: Joe Perches <joe@xxxxxxxxxxx> --- drivers/staging/sep/sep_driver.c | 401 +++++++++++++++++-------------- drivers/staging/sep/sep_driver_config.h | 24 +- 2 files changed, 233 insertions(+), 192 deletions(-) diff --git a/drivers/staging/sep/sep_driver.c b/drivers/staging/sep/sep_driver.c index 87f8a11..e6ccc95 100644 --- a/drivers/staging/sep/sep_driver.c +++ b/drivers/staging/sep/sep_driver.c @@ -29,6 +29,8 @@ * */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/init.h> #include <linux/module.h> #include <linux/fs.h> @@ -79,11 +81,12 @@ static void sep_load_rom_code(struct sep_device *sep) /* Loading ROM from SEP_ROM_image.h file */ k = sizeof(CRYS_SEP_ROM); - edbg("SEP Driver: DX_CC_TST_SepRomLoader start\n"); + edbg("DX_CC_TST_SepRomLoader start\n"); - edbg("SEP Driver: k is %lu\n", k); - edbg("SEP Driver: sep->reg_addr is %p\n", sep->reg_addr); - edbg("SEP Driver: CRYS_SEP_ROM_start_address_offset is %p\n", CRYS_SEP_ROM_start_address_offset); + edbg("k is %lu\n", k); + edbg("sep->reg_addr is %p\n", sep->reg_addr); + edbg("CRYS_SEP_ROM_start_address_offset is %p\n", + CRYS_SEP_ROM_start_address_offset); for (i = 0; i < 4; i++) { /* write bank */ @@ -109,13 +112,13 @@ static void sep_load_rom_code(struct sep_device *sep) reg = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR3_REG_ADDR); while (!reg); - edbg("SEP Driver: ROM polling ended\n"); + edbg("ROM polling ended\n"); switch (reg) { case 0x1: /* fatal error - read erro status from GPRO */ error = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR0_REG_ADDR); - edbg("SEP Driver: ROM polling case 1\n"); + edbg("ROM polling case 1\n"); break; case 0x4: /* Cold boot ended successfully */ @@ -128,7 +131,7 @@ static void sep_load_rom_code(struct sep_device *sep) /* Boot First Phase ended */ warning = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR0_REG_ADDR); case 0x20: - edbg("SEP Driver: ROM polling case %d\n", reg); + edbg("ROM polling case %d\n", reg); break; } @@ -185,16 +188,16 @@ static int sep_load_firmware(struct sep_device *sep) char *res_name = "resident.image.bin"; int error; - edbg("SEP Driver:rar_virtual is %p\n", sep->rar_addr); - edbg("SEP Driver:rar_bus is %08llx\n", (unsigned long long)sep->rar_bus); + edbg("rar_virtual is %p\n", sep->rar_addr); + edbg("rar_bus is %08llx\n", (unsigned long long)sep->rar_bus); /* load cache */ error = request_firmware(&fw, cache_name, &sep->pdev->dev); if (error) { - edbg("SEP Driver:cant request cache fw\n"); + edbg("cant request cache fw\n"); return error; } - edbg("SEP Driver:cache %08Zx@%p\n", fw->size, (void *) fw->data); + edbg("cache %08Zx@%p\n", fw->size, (void *)fw->data); memcpy(sep->rar_addr, (void *)fw->data, fw->size); sep->cache_size = fw->size; @@ -206,16 +209,16 @@ static int sep_load_firmware(struct sep_device *sep) /* load resident */ error = request_firmware(&fw, res_name, &sep->pdev->dev); if (error) { - edbg("SEP Driver:cant request res fw\n"); + edbg("cant request res fw\n"); return error; } - edbg("sep: res %08Zx@%p\n", fw->size, (void *)fw->data); + edbg("res %08Zx@%p\n", fw->size, (void *)fw->data); memcpy(sep->resident_addr, (void *) fw->data, fw->size); sep->resident_size = fw->size; release_firmware(fw); - edbg("sep: resident v %p b %08llx cache v %p b %08llx\n", + edbg("resident v %p b %08llx cache v %p b %08llx\n", sep->resident_addr, (unsigned long long)sep->resident_bus, sep->rar_addr, (unsigned long long)sep->rar_bus); return 0; @@ -238,12 +241,12 @@ static int sep_map_and_alloc_shared_area(struct sep_device *sep, &sep->shared_bus, GFP_KERNEL); if (!sep->shared_addr) { - edbg("sep_driver :shared memory dma_alloc_coherent failed\n"); + edbg("shared memory dma_alloc_coherent failed\n"); return -ENOMEM; } /* set the bus address of the shared area */ - edbg("sep: shared_addr %ld bytes @%p (bus %08llx)\n", - size, sep->shared_addr, (unsigned long long)sep->shared_bus); + edbg("shared_addr %ld bytes @%p (bus %08llx)\n", + size, sep->shared_addr, (unsigned long long)sep->shared_bus); return 0; } @@ -272,7 +275,7 @@ static dma_addr_t sep_shared_virt_to_bus(struct sep_device *sep, void *virt_address) { dma_addr_t pa = sep->shared_bus + (virt_address - sep->shared_addr); - edbg("sep: virt to bus b %08llx v %p\n", pa, virt_address); + edbg("virt to bus b %08llx v %p\n", pa, virt_address); return pa; } @@ -377,28 +380,27 @@ static int sep_mmap(struct file *filp, struct vm_area_struct *vma) /* check that the size of the mapped range is as the size of the message shared area */ if ((vma->vm_end - vma->vm_start) > SEP_DRIVER_MMMAP_AREA_SIZE) { - edbg("SEP Driver mmap requested size is more than allowed\n"); - printk(KERN_WARNING "SEP Driver mmap requested size is more \ - than allowed\n"); - printk(KERN_WARNING "SEP Driver vma->vm_end is %08lx\n", vma->vm_end); - printk(KERN_WARNING "SEP Driver vma->vm_end is %08lx\n", vma->vm_start); + edbg("mmap requested size is more than allowed\n"); + pr_warning("mmap requested size is more than allowed\n"); + pr_warning("vma->vm_end is %08lx\n", vma->vm_end); + pr_warning("vma->vm_end is %08lx\n", vma->vm_start); return -EAGAIN; } - edbg("SEP Driver:sep->shared_addr is %p\n", sep->shared_addr); + edbg("sep->shared_addr is %p\n", sep->shared_addr); /* get bus address */ bus_addr = sep->shared_bus; - edbg("SEP Driver: phys_addr is %08llx\n", (unsigned long long)bus_addr); + edbg("phys_addr is %08llx\n", (unsigned long long)bus_addr); if (remap_pfn_range(vma, vma->vm_start, bus_addr >> PAGE_SHIFT, vma->vm_end - vma->vm_start, vma->vm_page_prot)) { - edbg("SEP Driver remap_page_range failed\n"); - printk(KERN_WARNING "SEP Driver remap_page_range failed\n"); + edbg("remap_page_range failed\n"); + pr_warning("remap_page_range failed\n"); return -EAGAIN; } - dbg("SEP Driver:<-------- mmap end\n"); + dbg("<-------- mmap end\n"); return 0; } @@ -423,7 +425,11 @@ static unsigned int sep_poll(struct file *filp, poll_table * wait) retval = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR2_REG_ADDR); for (count = 0; count < 10 * 4; count += 4) - edbg("Poll Debug Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_addr + SEP_DRIVER_MESSAGE_SHARED_AREA_SIZE_IN_BYTES + count))); + edbg("Poll Debug Word %lu of the message is %lu\n", + count, + *((unsigned long *)(sep->shared_addr + + SEP_DRIVER_MESSAGE_SHARED_AREA_SIZE_IN_BYTES + + count))); } sep->reply_ct++; @@ -439,24 +445,28 @@ static unsigned int sep_poll(struct file *filp, poll_table * wait) /* check if the data is ready */ if (sep->send_ct == sep->reply_ct) { for (count = 0; count < 12 * 4; count += 4) - edbg("Sep Mesg Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_addr + count))); + edbg("Sep Mesg Word %lu of the message is %lu\n", + count, + *((unsigned long *)(sep->shared_addr + count))); for (count = 0; count < 10 * 4; count += 4) - edbg("Debug Data Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_addr + 0x1800 + count))); + edbg("Debug Data Word %lu of the message is %lu\n", + count, + *((unsigned long *)(sep->shared_addr + 0x1800 + count))); retval = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR2_REG_ADDR); edbg("retval is %lu\n", retval); /* check if the this is sep reply or request */ if (retval >> 31) { - edbg("SEP Driver: sep request in\n"); + edbg("sep request in\n"); /* request */ mask |= POLLOUT | POLLWRNORM; } else { - edbg("SEP Driver: sep reply in\n"); + edbg("sep reply in\n"); mask |= POLLIN | POLLRDNORM; } } - dbg("SEP Driver:<-------- poll exit\n"); + dbg("<-------- poll exit\n"); return mask; } @@ -496,9 +506,9 @@ static unsigned long sep_set_time(struct sep_device *sep) time_addr[0] = SEP_TIME_VAL_TOKEN; time_addr[1] = time.tv_sec; - edbg("SEP Driver:time.tv_sec is %lu\n", time.tv_sec); - edbg("SEP Driver:time_addr is %p\n", time_addr); - edbg("SEP Driver:sep->shared_addr is %p\n", sep->shared_addr); + edbg("time.tv_sec is %lu\n", time.tv_sec); + edbg("time_addr is %p\n", time_addr); + edbg("sep->shared_addr is %p\n", sep->shared_addr); return time.tv_sec; } @@ -514,7 +524,8 @@ static void sep_dump_message(struct sep_device *sep) { int count; for (count = 0; count < 12 * 4; count += 4) - edbg("Word %d of the message is %u\n", count, *((u32 *) (sep->shared_addr + count))); + edbg("Word %d of the message is %u\n", + count, *((u32 *)(sep->shared_addr + count))); } /** @@ -540,7 +551,7 @@ static void sep_send_command_handler(struct sep_device *sep) sep->send_ct++; /* send interrupt to SEP */ sep_write_reg(sep, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x2); - dbg("SEP Driver:<-------- sep_send_command_handler end\n"); + dbg("<-------- sep_send_command_handler end\n"); mutex_unlock(&sep_mutex); return; } @@ -570,7 +581,7 @@ static void sep_send_reply_command_handler(struct sep_device *sep) sep->send_ct++; sep->reply_ct++; mutex_unlock(&sep_mutex); - dbg("sep: sep_send_reply_command_handler end\n"); + dbg("sep_send_reply_command_handler end\n"); } /* @@ -586,7 +597,7 @@ static int sep_allocate_data_pool_memory_handler(struct sep_device *sep, int error; struct sep_driver_alloc_t command_args; - dbg("SEP Driver:--------> sep_allocate_data_pool_memory_handler start\n"); + dbg("--------> sep_allocate_data_pool_memory_handler start\n"); error = copy_from_user(&command_args, (void *) arg, sizeof(struct sep_driver_alloc_t)); if (error) @@ -611,7 +622,7 @@ static int sep_allocate_data_pool_memory_handler(struct sep_device *sep, sep->data_pool_bytes_allocated += command_args.num_bytes; end_function: - dbg("SEP Driver:<-------- sep_allocate_data_pool_memory_handler end\n"); + dbg("<-------- sep_allocate_data_pool_memory_handler end\n"); return error; } @@ -627,7 +638,7 @@ static int sep_write_into_data_pool_handler(struct sep_device *sep, unsigned lon unsigned long num_bytes; void *data_pool_area_addr; - dbg("SEP Driver:--------> sep_write_into_data_pool_handler start\n"); + dbg("--------> sep_write_into_data_pool_handler start\n"); /* get the application address */ error = get_user(app_in_address, &(((struct sep_driver_write_t *) arg)->app_address)); @@ -657,7 +668,7 @@ static int sep_write_into_data_pool_handler(struct sep_device *sep, unsigned lon /* copy the application data */ error = copy_from_user(virt_address, (void *) app_in_address, num_bytes); end_function: - dbg("SEP Driver:<-------- sep_write_into_data_pool_handler end\n"); + dbg("<-------- sep_write_into_data_pool_handler end\n"); return error; } @@ -675,7 +686,7 @@ static int sep_read_from_data_pool_handler(struct sep_device *sep, unsigned long unsigned long num_bytes; void *data_pool_area_addr; - dbg("SEP Driver:--------> sep_read_from_data_pool_handler start\n"); + dbg("--------> sep_read_from_data_pool_handler start\n"); /* get the application address */ error = get_user(app_out_address, &(((struct sep_driver_write_t *) arg)->app_address)); @@ -707,7 +718,7 @@ static int sep_read_from_data_pool_handler(struct sep_device *sep, unsigned long /* copy the application data */ error = copy_to_user((void *) app_out_address, virt_address, num_bytes); end_function: - dbg("SEP Driver:<-------- sep_read_from_data_pool_handler end\n"); + dbg("<-------- sep_read_from_data_pool_handler end\n"); return error; } @@ -764,22 +775,22 @@ static int sep_lock_kernel_pages(struct sep_device *sep, unsigned long next_kernel_address; unsigned long count; - dbg("SEP Driver:--------> sep_lock_kernel_pages start\n"); + dbg("--------> sep_lock_kernel_pages start\n"); /* set start and end pages and num pages */ end_page = (kernel_virt_addr + data_size - 1) >> PAGE_SHIFT; start_page = kernel_virt_addr >> PAGE_SHIFT; num_pages = end_page - start_page + 1; - edbg("SEP Driver: kernel_virt_addr is %08lx\n", kernel_virt_addr); - edbg("SEP Driver: data_size is %lu\n", data_size); - edbg("SEP Driver: start_page is %lx\n", start_page); - edbg("SEP Driver: end_page is %lx\n", end_page); - edbg("SEP Driver: num_pages is %lu\n", num_pages); + edbg("kernel_virt_addr is %08lx\n", kernel_virt_addr); + edbg("data_size is %lu\n", data_size); + edbg("start_page is %lx\n", start_page); + edbg("end_page is %lx\n", end_page); + edbg("num_pages is %lu\n", num_pages); lli_array = kmalloc(sizeof(struct sep_lli_entry_t) * num_pages, GFP_ATOMIC); if (!lli_array) { - edbg("SEP Driver: kmalloc for lli_array failed\n"); + edbg("kmalloc for lli_array failed\n"); error = -ENOMEM; goto end_function; } @@ -805,7 +816,9 @@ static int sep_lock_kernel_pages(struct sep_device *sep, lli_array[count].physical_address = (unsigned long) virt_to_phys((unsigned long *) next_kernel_address); lli_array[count].block_size = PAGE_SIZE; - edbg("lli_array[%lu].physical_address is %08lx, lli_array[%lu].block_size is %lu\n", count, lli_array[count].physical_address, count, lli_array[count].block_size); + edbg("lli_array[%lu].physical_address is %08lx, lli_array[%lu].block_size is %lu\n", + count, lli_array[count].physical_address, + count, lli_array[count].block_size); next_kernel_address += PAGE_SIZE; } @@ -823,14 +836,16 @@ static int sep_lock_kernel_pages(struct sep_device *sep, while (1); } - edbg("lli_array[%lu].physical_address is %08lx, lli_array[%lu].block_size is %lu\n", count, lli_array[count].physical_address, count, lli_array[count].block_size); + edbg("lli_array[%lu].physical_address is %08lx, lli_array[%lu].block_size is %lu\n", + count, lli_array[count].physical_address, + count, lli_array[count].block_size); } /* set output params */ *lli_array_ptr = lli_array; *num_pages_ptr = num_pages; *page_array_ptr = 0; end_function: - dbg("SEP Driver:<-------- sep_lock_kernel_pages end\n"); + dbg("<-------- sep_lock_kernel_pages end\n"); return 0; } @@ -858,23 +873,23 @@ static int sep_lock_user_pages(struct sep_device *sep, unsigned long count; int result; - dbg("SEP Driver:--------> sep_lock_user_pages start\n"); + dbg("--------> sep_lock_user_pages start\n"); /* set start and end pages and num pages */ end_page = (app_virt_addr + data_size - 1) >> PAGE_SHIFT; start_page = app_virt_addr >> PAGE_SHIFT; num_pages = end_page - start_page + 1; - edbg("SEP Driver: app_virt_addr is %08lx\n", app_virt_addr); - edbg("SEP Driver: data_size is %lu\n", data_size); - edbg("SEP Driver: start_page is %lu\n", start_page); - edbg("SEP Driver: end_page is %lu\n", end_page); - edbg("SEP Driver: num_pages is %lu\n", num_pages); + edbg("app_virt_addr is %08lx\n", app_virt_addr); + edbg("data_size is %lu\n", data_size); + edbg("start_page is %lu\n", start_page); + edbg("end_page is %lu\n", end_page); + edbg("num_pages is %lu\n", num_pages); /* allocate array of pages structure pointers */ page_array = kmalloc(sizeof(struct page *) * num_pages, GFP_ATOMIC); if (!page_array) { - edbg("SEP Driver: kmalloc for page_array failed\n"); + edbg("kmalloc for page_array failed\n"); error = -ENOMEM; goto end_function; @@ -882,7 +897,7 @@ static int sep_lock_user_pages(struct sep_device *sep, lli_array = kmalloc(sizeof(struct sep_lli_entry_t) * num_pages, GFP_ATOMIC); if (!lli_array) { - edbg("SEP Driver: kmalloc for lli_array failed\n"); + edbg("kmalloc for lli_array failed\n"); error = -ENOMEM; goto end_function_with_error1; @@ -895,7 +910,7 @@ static int sep_lock_user_pages(struct sep_device *sep, /* check the number of pages locked - if not all then exit with error */ if (result != num_pages) { - dbg("SEP Driver: not all pages locked by get_user_pages\n"); + dbg("not all pages locked by get_user_pages\n"); error = -ENOMEM; goto end_function_with_error2; @@ -923,7 +938,9 @@ static int sep_lock_user_pages(struct sep_device *sep, lli_array[count].physical_address = (unsigned long) page_to_phys(page_array[count]); lli_array[count].block_size = PAGE_SIZE; - edbg("lli_array[%lu].physical_address is %08lx, lli_array[%lu].block_size is %lu\n", count, lli_array[count].physical_address, count, lli_array[count].block_size); + edbg("lli_array[%lu].physical_address is %08lx, lli_array[%lu].block_size is %lu\n", + count, lli_array[count].physical_address, + count, lli_array[count].block_size); } /* if more then 1 pages locked - then update for the last page size needed */ @@ -939,8 +956,9 @@ static int sep_lock_user_pages(struct sep_device *sep, dbg("data_size is %lu\n", data_size); while (1); } - edbg("lli_array[%lu].physical_address is %08lx, \ - lli_array[%lu].block_size is %lu\n", count, lli_array[count].physical_address, count, lli_array[count].block_size); + edbg("lli_array[%lu].physical_address is %08lx, lli_array[%lu].block_size is %lu\n", + count, lli_array[count].physical_address, + count, lli_array[count].block_size); } /* set output params */ @@ -957,7 +975,7 @@ end_function_with_error2: end_function_with_error1: kfree(page_array); end_function: - dbg("SEP Driver:<-------- sep_lock_user_pages end\n"); + dbg("<-------- sep_lock_user_pages end\n"); return 0; } @@ -989,14 +1007,14 @@ static void sep_build_lli_table(struct sep_lli_entry_t *lli_array_ptr, struct se /* counter of lli array entry */ unsigned long array_counter; - dbg("SEP Driver:--------> sep_build_lli_table start\n"); + dbg("--------> sep_build_lli_table start\n"); /* init currrent table data size and lli array entry counter */ curr_table_data_size = 0; array_counter = 0; *num_table_entries_ptr = 1; - edbg("SEP Driver:table_data_size is %lu\n", table_data_size); + edbg("table_data_size is %lu\n", table_data_size); /* fill the table till table size reaches the needed amount */ while (curr_table_data_size < table_data_size) { @@ -1007,13 +1025,15 @@ static void sep_build_lli_table(struct sep_lli_entry_t *lli_array_ptr, struct se lli_table_ptr->block_size = lli_array_ptr[array_counter].block_size; curr_table_data_size += lli_table_ptr->block_size; - edbg("SEP Driver:lli_table_ptr is %08lx\n", (unsigned long) lli_table_ptr); - edbg("SEP Driver:lli_table_ptr->physical_address is %08lx\n", lli_table_ptr->physical_address); - edbg("SEP Driver:lli_table_ptr->block_size is %lu\n", lli_table_ptr->block_size); + edbg("lli_table_ptr is %08lx\n", (unsigned long)lli_table_ptr); + edbg("lli_table_ptr->physical_address is %08lx\n", + lli_table_ptr->physical_address); + edbg("lli_table_ptr->block_size is %lu\n", + lli_table_ptr->block_size); /* check for overflow of the table data */ if (curr_table_data_size > table_data_size) { - edbg("SEP Driver:curr_table_data_size > table_data_size\n"); + edbg("curr_table_data_size > table_data_size\n"); /* update the size of block in the table */ lli_table_ptr->block_size -= (curr_table_data_size - table_data_size); @@ -1027,8 +1047,10 @@ static void sep_build_lli_table(struct sep_lli_entry_t *lli_array_ptr, struct se /* advance to the next entry in the lli_array */ array_counter++; - edbg("SEP Driver:lli_table_ptr->physical_address is %08lx\n", lli_table_ptr->physical_address); - edbg("SEP Driver:lli_table_ptr->block_size is %lu\n", lli_table_ptr->block_size); + edbg("lli_table_ptr->physical_address is %08lx\n", + lli_table_ptr->physical_address); + edbg("lli_table_ptr->block_size is %lu\n", + lli_table_ptr->block_size); /* move to the next entry in table */ lli_table_ptr++; @@ -1038,15 +1060,16 @@ static void sep_build_lli_table(struct sep_lli_entry_t *lli_array_ptr, struct se lli_table_ptr->physical_address = 0xffffffff; lli_table_ptr->block_size = 0; - edbg("SEP Driver:lli_table_ptr is %08lx\n", (unsigned long) lli_table_ptr); - edbg("SEP Driver:lli_table_ptr->physical_address is %08lx\n", lli_table_ptr->physical_address); - edbg("SEP Driver:lli_table_ptr->block_size is %lu\n", lli_table_ptr->block_size); + edbg("lli_table_ptr is %08lx\n", (unsigned long) lli_table_ptr); + edbg("lli_table_ptr->physical_address is %08lx\n", + lli_table_ptr->physical_address); + edbg("lli_table_ptr->block_size is %lu\n", lli_table_ptr->block_size); /* set the output parameter */ *num_processed_entries_ptr += array_counter; - edbg("SEP Driver:*num_processed_entries_ptr is %lu\n", *num_processed_entries_ptr); - dbg("SEP Driver:<-------- sep_build_lli_table end\n"); + edbg("*num_processed_entries_ptr is %lu\n", *num_processed_entries_ptr); + dbg("<-------- sep_build_lli_table end\n"); return; } @@ -1059,39 +1082,46 @@ static void sep_debug_print_lli_tables(struct sep_device *sep, struct sep_lli_en unsigned long table_count; unsigned long entries_count; - dbg("SEP Driver:--------> sep_debug_print_lli_tables start\n"); + dbg("--------> sep_debug_print_lli_tables start\n"); table_count = 1; while ((unsigned long) lli_table_ptr != 0xffffffff) { - edbg("SEP Driver: lli table %08lx, table_data_size is %lu\n", table_count, table_data_size); - edbg("SEP Driver: num_table_entries is %lu\n", num_table_entries); + edbg("lli table %08lx, table_data_size is %lu\n", + table_count, table_data_size); + edbg("num_table_entries is %lu\n", num_table_entries); /* print entries of the table (without info entry) */ for (entries_count = 0; entries_count < num_table_entries; entries_count++, lli_table_ptr++) { - edbg("SEP Driver:lli_table_ptr address is %08lx\n", (unsigned long) lli_table_ptr); - edbg("SEP Driver:phys address is %08lx block size is %lu\n", lli_table_ptr->physical_address, lli_table_ptr->block_size); + edbg("lli_table_ptr address is %08lx\n", + (unsigned long) lli_table_ptr); + edbg("phys address is %08lx block size is %lu\n", + lli_table_ptr->physical_address, + lli_table_ptr->block_size); } /* point to the info entry */ lli_table_ptr--; - edbg("SEP Driver:phys lli_table_ptr->block_size is %lu\n", lli_table_ptr->block_size); - edbg("SEP Driver:phys lli_table_ptr->physical_address is %08lx\n", lli_table_ptr->physical_address); - + edbg("phys lli_table_ptr->block_size is %lu\n", + lli_table_ptr->block_size); + edbg("phys lli_table_ptr->physical_address is %08lx\n", + lli_table_ptr->physical_address); table_data_size = lli_table_ptr->block_size & 0xffffff; num_table_entries = (lli_table_ptr->block_size >> 24) & 0xff; lli_table_ptr = (struct sep_lli_entry_t *) (lli_table_ptr->physical_address); - edbg("SEP Driver:phys table_data_size is %lu num_table_entries is %lu lli_table_ptr is%lu\n", table_data_size, num_table_entries, (unsigned long) lli_table_ptr); + edbg("phys table_data_size is %lu num_table_entries is %lu lli_table_ptr is%lu\n", + table_data_size, num_table_entries, + (unsigned long)lli_table_ptr); if ((unsigned long) lli_table_ptr != 0xffffffff) lli_table_ptr = (struct sep_lli_entry_t *) sep_shared_bus_to_virt(sep, (unsigned long) lli_table_ptr); table_count++; } - dbg("SEP Driver:<-------- sep_debug_print_lli_tables end\n"); + dbg("<-------- sep_debug_print_lli_tables end\n"); } @@ -1126,10 +1156,10 @@ static int sep_prepare_input_dma_table(struct sep_device *sep, void *lli_table_alloc_addr; unsigned long result; - dbg("SEP Driver:--------> sep_prepare_input_dma_table start\n"); + dbg("--------> sep_prepare_input_dma_table start\n"); - edbg("SEP Driver:data_size is %lu\n", data_size); - edbg("SEP Driver:block_size is %lu\n", block_size); + edbg("data_size is %lu\n", data_size); + edbg("block_size is %lu\n", block_size); /* initialize the pages pointers */ sep->in_page_array = 0; @@ -1164,7 +1194,7 @@ static int sep_prepare_input_dma_table(struct sep_device *sep, if (result) return result; - edbg("SEP Driver:output sep->in_num_pages is %lu\n", sep->in_num_pages); + edbg("output sep->in_num_pages is %lu\n", sep->in_num_pages); current_entry = 0; info_entry_ptr = 0; @@ -1186,7 +1216,7 @@ static int sep_prepare_input_dma_table(struct sep_device *sep, /* now calculate the table size so that it will be module block size */ table_data_size = (table_data_size / block_size) * block_size; - edbg("SEP Driver:output table_data_size is %lu\n", table_data_size); + edbg("output table_data_size is %lu\n", table_data_size); /* construct input lli table */ sep_build_lli_table(&lli_array_ptr[current_entry], in_lli_table_ptr, ¤t_entry, &num_entries_in_table, table_data_size); @@ -1197,7 +1227,8 @@ static int sep_prepare_input_dma_table(struct sep_device *sep, *num_entries_ptr = num_entries_in_table; *table_data_size_ptr = table_data_size; - edbg("SEP Driver:output lli_table_in_ptr is %08lx\n", *lli_table_ptr); + edbg("output lli_table_in_ptr is %08lx\n", + *lli_table_ptr); } else { /* update the info entry of the previous in table */ info_entry_ptr->physical_address = sep_shared_virt_to_bus(sep, in_lli_table_ptr); @@ -1215,7 +1246,7 @@ static int sep_prepare_input_dma_table(struct sep_device *sep, /* the array of the pages */ kfree(lli_array_ptr); end_function: - dbg("SEP Driver:<-------- sep_prepare_input_dma_table end\n"); + dbg("<-------- sep_prepare_input_dma_table end\n"); return 0; } @@ -1259,7 +1290,7 @@ static int sep_construct_dma_tables_from_lli(struct sep_device *sep, /* number of etnries in the output table */ unsigned long num_entries_out_table; - dbg("SEP Driver:--------> sep_construct_dma_tables_from_lli start\n"); + dbg("--------> sep_construct_dma_tables_from_lli start\n"); /* initiate to pint after the message area */ lli_table_alloc_addr = sep->shared_addr + SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES; @@ -1288,8 +1319,8 @@ static int sep_construct_dma_tables_from_lli(struct sep_device *sep, /* calculate the maximum size of data for output table */ out_table_data_size = sep_calculate_lli_table_max_size(&lli_out_array[current_out_entry], (sep_out_lli_entries - current_out_entry)); - edbg("SEP Driver:in_table_data_size is %lu\n", in_table_data_size); - edbg("SEP Driver:out_table_data_size is %lu\n", out_table_data_size); + edbg("in_table_data_size is %lu\n", in_table_data_size); + edbg("out_table_data_size is %lu\n", out_table_data_size); /* check where the data is smallest */ table_data_size = in_table_data_size; @@ -1299,7 +1330,7 @@ static int sep_construct_dma_tables_from_lli(struct sep_device *sep, /* now calculate the table size so that it will be module block size */ table_data_size = (table_data_size / block_size) * block_size; - dbg("SEP Driver:table_data_size is %lu\n", table_data_size); + dbg("table_data_size is %lu\n", table_data_size); /* construct input lli table */ sep_build_lli_table(&lli_in_array[current_in_entry], in_lli_table_ptr, ¤t_in_entry, &num_entries_in_table, table_data_size); @@ -1316,8 +1347,10 @@ static int sep_construct_dma_tables_from_lli(struct sep_device *sep, *out_num_entries_ptr = num_entries_out_table; *table_data_size_ptr = table_data_size; - edbg("SEP Driver:output lli_table_in_ptr is %08lx\n", *lli_table_in_ptr); - edbg("SEP Driver:output lli_table_out_ptr is %08lx\n", *lli_table_out_ptr); + edbg("output lli_table_in_ptr is %08lx\n", + *lli_table_in_ptr); + edbg("output lli_table_out_ptr is %08lx\n", + *lli_table_out_ptr); } else { /* update the info entry of the previous in table */ info_in_entry_ptr->physical_address = sep_shared_virt_to_bus(sep, in_lli_table_ptr); @@ -1332,9 +1365,12 @@ static int sep_construct_dma_tables_from_lli(struct sep_device *sep, info_in_entry_ptr = in_lli_table_ptr + num_entries_in_table - 1; info_out_entry_ptr = out_lli_table_ptr + num_entries_out_table - 1; - edbg("SEP Driver:output num_entries_out_table is %lu\n", (unsigned long) num_entries_out_table); - edbg("SEP Driver:output info_in_entry_ptr is %lu\n", (unsigned long) info_in_entry_ptr); - edbg("SEP Driver:output info_out_entry_ptr is %lu\n", (unsigned long) info_out_entry_ptr); + edbg("output num_entries_out_table is %lu\n", + (unsigned long)num_entries_out_table); + edbg("output info_in_entry_ptr is %lu\n", + (unsigned long)info_in_entry_ptr); + edbg("output info_out_entry_ptr is %lu\n", + (unsigned long)info_out_entry_ptr); } /* print input tables */ @@ -1343,7 +1379,7 @@ static int sep_construct_dma_tables_from_lli(struct sep_device *sep, /* print output tables */ sep_debug_print_lli_tables(sep, (struct sep_lli_entry_t *) sep_shared_bus_to_virt(sep, *lli_table_out_ptr), *out_num_entries_ptr, *table_data_size_ptr); - dbg("SEP Driver:<-------- sep_construct_dma_tables_from_lli end\n"); + dbg("<-------- sep_construct_dma_tables_from_lli end\n"); return 0; } @@ -1366,7 +1402,7 @@ static int sep_prepare_input_output_dma_table(struct sep_device *sep, struct sep_lli_entry_t *lli_out_array; int result = 0; - dbg("SEP Driver:--------> sep_prepare_input_output_dma_table start\n"); + dbg("--------> sep_prepare_input_output_dma_table start\n"); /* initialize the pages pointers */ sep->in_page_array = 0; @@ -1377,14 +1413,14 @@ static int sep_prepare_input_output_dma_table(struct sep_device *sep, /* lock the pages of the kernel buffer and translate them to pages */ result = sep_lock_kernel_pages(sep, app_virt_in_addr, data_size, &sep->in_num_pages, &lli_in_array, &sep->in_page_array); if (result) { - edbg("SEP Driver: sep_lock_kernel_pages for input virtual buffer failed\n"); + edbg("sep_lock_kernel_pages for input virtual buffer failed\n"); goto end_function; } } else { /* lock the pages of the user buffer and translate them to pages */ result = sep_lock_user_pages(sep, app_virt_in_addr, data_size, &sep->in_num_pages, &lli_in_array, &sep->in_page_array); if (result) { - edbg("SEP Driver: sep_lock_user_pages for input virtual buffer failed\n"); + edbg("sep_lock_user_pages for input virtual buffer failed\n"); goto end_function; } } @@ -1392,13 +1428,13 @@ static int sep_prepare_input_output_dma_table(struct sep_device *sep, if (isKernelVirtualAddress == true) { result = sep_lock_kernel_pages(sep, app_virt_out_addr, data_size, &sep->out_num_pages, &lli_out_array, &sep->out_page_array); if (result) { - edbg("SEP Driver: sep_lock_kernel_pages for output virtual buffer failed\n"); + edbg("sep_lock_kernel_pages for output virtual buffer failed\n"); goto end_function_with_error1; } } else { result = sep_lock_user_pages(sep, app_virt_out_addr, data_size, &sep->out_num_pages, &lli_out_array, &sep->out_page_array); if (result) { - edbg("SEP Driver: sep_lock_user_pages for output virtual buffer failed\n"); + edbg("sep_lock_user_pages for output virtual buffer failed\n"); goto end_function_with_error1; } } @@ -1410,7 +1446,7 @@ static int sep_prepare_input_output_dma_table(struct sep_device *sep, /* call the fucntion that creates table from the lli arrays */ result = sep_construct_dma_tables_from_lli(sep, lli_in_array, sep->in_num_pages, lli_out_array, sep->out_num_pages, block_size, lli_table_in_ptr, lli_table_out_ptr, in_num_entries_ptr, out_num_entries_ptr, table_data_size_ptr); if (result) { - edbg("SEP Driver: sep_construct_dma_tables_from_lli failed\n"); + edbg("sep_construct_dma_tables_from_lli failed\n"); goto end_function_with_error2; } @@ -1423,7 +1459,7 @@ end_function_with_error2: end_function_with_error1: kfree(lli_in_array); end_function: - dbg("SEP Driver:<-------- sep_prepare_input_output_dma_table end result = %d\n", (int) result); + dbg("<-------- sep_prepare_input_output_dma_table end result = %d\n", (int) result); return result; } @@ -1439,7 +1475,7 @@ static int sep_create_sync_dma_tables_handler(struct sep_device *sep, /* command arguments */ struct sep_driver_build_sync_table_t command_args; - dbg("SEP Driver:--------> sep_create_sync_dma_tables_handler start\n"); + dbg("--------> sep_create_sync_dma_tables_handler start\n"); error = copy_from_user(&command_args, (void *) arg, sizeof(struct sep_driver_build_sync_table_t)); if (error) @@ -1472,7 +1508,7 @@ static int sep_create_sync_dma_tables_handler(struct sep_device *sep, if (copy_to_user((void *) arg, (void *) &command_args, sizeof(struct sep_driver_build_sync_table_t))) error = -EFAULT; end_function: - dbg("SEP Driver:<-------- sep_create_sync_dma_tables_handler end\n"); + dbg("<-------- sep_create_sync_dma_tables_handler end\n"); return error; } @@ -1481,7 +1517,7 @@ end_function: */ static int sep_free_dma_table_data_handler(struct sep_device *sep) { - dbg("SEP Driver:--------> sep_free_dma_table_data_handler start\n"); + dbg("--------> sep_free_dma_table_data_handler start\n"); /* free input pages array */ sep_free_dma_pages(sep->in_page_array, sep->in_num_pages, 0); @@ -1495,7 +1531,7 @@ static int sep_free_dma_table_data_handler(struct sep_device *sep) sep->out_page_array = 0; sep->in_num_pages = 0; sep->out_num_pages = 0; - dbg("SEP Driver:<-------- sep_free_dma_table_data_handler end\n"); + dbg("<-------- sep_free_dma_table_data_handler end\n"); return 0; } @@ -1780,7 +1816,7 @@ static int sep_create_flow_dma_tables_handler(struct sep_device *sep, /* pointer to the flow data strucutre */ struct sep_flow_context_t *flow_context_ptr; - dbg("SEP Driver:--------> sep_create_flow_dma_tables_handler start\n"); + dbg("--------> sep_create_flow_dma_tables_handler start\n"); /* init variables */ prev_info_entry_ptr = 0; @@ -1830,7 +1866,7 @@ end_function_with_error: /* free the allocated tables */ sep_deallocated_flow_tables(&first_table_data); end_function: - dbg("SEP Driver:<-------- sep_create_flow_dma_tables_handler end\n"); + dbg("<-------- sep_create_flow_dma_tables_handler end\n"); return error; } @@ -1850,7 +1886,7 @@ static int sep_add_flow_tables_handler(struct sep_device *sep, unsigned long arg /* pointer to the info entry of the current DMA table */ struct sep_lli_entry_t *info_entry_ptr; - dbg("SEP Driver:--------> sep_add_flow_tables_handler start\n"); + dbg("--------> sep_add_flow_tables_handler start\n"); /* get input parameters */ error = copy_from_user(&command_args, (void *) arg, sizeof(struct sep_driver_add_flow_table_t)); @@ -1930,7 +1966,7 @@ end_function_with_error: /* free the allocated tables */ sep_deallocated_flow_tables(&first_table_data); end_function: - dbg("SEP Driver:<-------- sep_add_flow_tables_handler end\n"); + dbg("<-------- sep_add_flow_tables_handler end\n"); return error; } @@ -1943,7 +1979,7 @@ static int sep_add_flow_tables_message_handler(struct sep_device *sep, unsigned struct sep_driver_add_message_t command_args; struct sep_flow_context_t *flow_context_ptr; - dbg("SEP Driver:--------> sep_add_flow_tables_message_handler start\n"); + dbg("--------> sep_add_flow_tables_message_handler start\n"); error = copy_from_user(&command_args, (void *) arg, sizeof(struct sep_driver_add_message_t)); if (error) @@ -1964,7 +2000,7 @@ static int sep_add_flow_tables_message_handler(struct sep_device *sep, unsigned flow_context_ptr->message_size_in_bytes = command_args.message_size_in_bytes; error = copy_from_user(flow_context_ptr->message, (void *) command_args.message_address, command_args.message_size_in_bytes); end_function: - dbg("SEP Driver:<-------- sep_add_flow_tables_message_handler end\n"); + dbg("<-------- sep_add_flow_tables_message_handler end\n"); return error; } @@ -1977,17 +2013,19 @@ static int sep_get_static_pool_addr_handler(struct sep_device *sep, unsigned lon int error; struct sep_driver_static_pool_addr_t command_args; - dbg("SEP Driver:--------> sep_get_static_pool_addr_handler start\n"); + dbg("--------> sep_get_static_pool_addr_handler start\n"); /*prepare the output parameters in the struct */ command_args.physical_static_address = sep->shared_bus + SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES; command_args.virtual_static_address = (unsigned long)sep->shared_addr + SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES; - edbg("SEP Driver:bus_static_address is %08lx, virtual_static_address %08lx\n", command_args.physical_static_address, command_args.virtual_static_address); + edbg("bus_static_address is %08lx, virtual_static_address %08lx\n", + command_args.physical_static_address, + command_args.virtual_static_address); /* send the parameters to user application */ error = copy_to_user((void *) arg, &command_args, sizeof(struct sep_driver_static_pool_addr_t)); - dbg("SEP Driver:<-------- sep_get_static_pool_addr_handler end\n"); + dbg("<-------- sep_get_static_pool_addr_handler end\n"); return error; } @@ -2000,7 +2038,7 @@ static int sep_get_physical_mapped_offset_handler(struct sep_device *sep, unsign int error; struct sep_driver_get_mapped_offset_t command_args; - dbg("SEP Driver:--------> sep_get_physical_mapped_offset_handler start\n"); + dbg("--------> sep_get_physical_mapped_offset_handler start\n"); error = copy_from_user(&command_args, (void *) arg, sizeof(struct sep_driver_get_mapped_offset_t)); if (error) @@ -2014,12 +2052,13 @@ static int sep_get_physical_mapped_offset_handler(struct sep_device *sep, unsign /*prepare the output parameters in the struct */ command_args.offset = command_args.physical_address - sep->shared_bus; - edbg("SEP Driver:bus_address is %08lx, offset is %lu\n", command_args.physical_address, command_args.offset); + edbg("bus_address is %08lx, offset is %lu\n", + command_args.physical_address, command_args.offset); /* send the parameters to user application */ error = copy_to_user((void *) arg, &command_args, sizeof(struct sep_driver_get_mapped_offset_t)); end_function: - dbg("SEP Driver:<-------- sep_get_physical_mapped_offset_handler end\n"); + dbg("<-------- sep_get_physical_mapped_offset_handler end\n"); return error; } @@ -2032,7 +2071,7 @@ static int sep_start_handler(struct sep_device *sep) unsigned long reg_val; unsigned long error = 0; - dbg("SEP Driver:--------> sep_start_handler start\n"); + dbg("--------> sep_start_handler start\n"); /* wait in polling for message from SEP */ do @@ -2043,7 +2082,7 @@ static int sep_start_handler(struct sep_device *sep) if (reg_val == 0x1) /* fatal error - read error status from GPRO */ error = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR0_REG_ADDR); - dbg("SEP Driver:<-------- sep_start_handler end\n"); + dbg("<-------- sep_start_handler end\n"); return error; } @@ -2059,12 +2098,12 @@ static int sep_init_handler(struct sep_device *sep, unsigned long arg) unsigned long error; unsigned long reg_val; - dbg("SEP Driver:--------> sep_init_handler start\n"); + dbg("--------> sep_init_handler start\n"); error = 0; error = copy_from_user(&command_args, (void *) arg, sizeof(struct sep_driver_init_t)); - dbg("SEP Driver:--------> sep_init_handler - finished copy_from_user \n"); + dbg("--------> sep_init_handler - finished copy_from_user\n"); if (error) goto end_function; @@ -2072,7 +2111,7 @@ static int sep_init_handler(struct sep_device *sep, unsigned long arg) /* PATCH - configure the DMA to single -burst instead of multi-burst */ /*sep_configure_dma_burst(); */ - dbg("SEP Driver:--------> sep_init_handler - finished sep_configure_dma_burst \n"); + dbg("--------> sep_init_handler - finished sep_configure_dma_burst\n"); message_ptr = (unsigned long *) command_args.message_addr; @@ -2083,11 +2122,11 @@ static int sep_init_handler(struct sep_device *sep, unsigned long arg) get_user(message_word, message_ptr); /* write data to SRAM */ sep_write_reg(sep, HW_SRAM_DATA_REG_ADDR, message_word); - edbg("SEP Driver:message_word is %lu\n", message_word); + edbg("message_word is %lu\n", message_word); /* wait for write complete */ sep_wait_sram_write(sep); } - dbg("SEP Driver:--------> sep_init_handler - finished getting messages from user space\n"); + dbg("--------> sep_init_handler - finished getting messages from user space\n"); /* signal SEP */ sep_write_reg(sep, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x1); @@ -2095,21 +2134,21 @@ static int sep_init_handler(struct sep_device *sep, unsigned long arg) reg_val = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR3_REG_ADDR); while (!(reg_val & 0xFFFFFFFD)); - dbg("SEP Driver:--------> sep_init_handler - finished waiting for reg_val & 0xFFFFFFFD \n"); + dbg("--------> sep_init_handler - finished waiting for reg_val & 0xFFFFFFFD\n"); /* check the value */ if (reg_val == 0x1) { - edbg("SEP Driver:init failed\n"); + edbg("init failed\n"); error = sep_read_reg(sep, 0x8060); - edbg("SEP Driver:sw monitor is %lu\n", error); + edbg("sw monitor is %lu\n", error); /* fatal error - read erro status from GPRO */ error = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR0_REG_ADDR); - edbg("SEP Driver:error is %lu\n", error); + edbg("error is %lu\n", error); } end_function: - dbg("SEP Driver:<-------- sep_init_handler end\n"); + dbg("<-------- sep_init_handler end\n"); return error; } @@ -2144,10 +2183,14 @@ static int sep_realloc_cache_resident_handler(struct sep_device *sep, /* set the new shared area */ command_args.new_shared_area_addr = sep->shared_bus; - edbg("SEP Driver:command_args.new_shared_addr is %08llx\n", command_args.new_shared_area_addr); - edbg("SEP Driver:command_args.new_base_addr is %08llx\n", command_args.new_base_addr); - edbg("SEP Driver:command_args.new_resident_addr is %08llx\n", command_args.new_resident_addr); - edbg("SEP Driver:command_args.new_rar_addr is %08llx\n", command_args.new_cache_addr); + edbg("command_args.new_shared_addr is %08llx\n", + command_args.new_shared_area_addr); + edbg("command_args.new_base_addr is %08llx\n", + command_args.new_base_addr); + edbg("command_args.new_resident_addr is %08llx\n", + command_args.new_resident_addr); + edbg("command_args.new_rar_addr is %08llx\n", + command_args.new_cache_addr); /* return to user */ if (copy_to_user((void *) arg, &command_args, sizeof(struct sep_driver_realloc_cache_resident_t))) @@ -2184,7 +2227,7 @@ static int sep_get_time_handler(struct sep_device *sep, unsigned long arg) */ static int sep_end_transaction_handler(struct sep_device *sep, unsigned long arg) { - dbg("SEP Driver:--------> sep_end_transaction_handler start\n"); + dbg("--------> sep_end_transaction_handler start\n"); #if 0 /*!SEP_DRIVER_POLLING_MODE */ /* close IMR */ @@ -2197,7 +2240,7 @@ static int sep_end_transaction_handler(struct sep_device *sep, unsigned long arg mutex_unlock(&sep_mutex); #endif - dbg("SEP Driver:<-------- sep_end_transaction_handler end\n"); + dbg("<-------- sep_end_transaction_handler end\n"); return 0; } @@ -2236,13 +2279,13 @@ static int sep_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, u dbg("------------>SEP Driver: ioctl start\n"); - edbg("SEP Driver: cmd is %x\n", cmd); + edbg("cmd is %x\n", cmd); switch (cmd) { case SEP_IOCSENDSEPCOMMAND: /* send command to SEP */ sep_send_command_handler(sep); - edbg("SEP Driver: after sep_send_command_handler\n"); + edbg("after sep_send_command_handler\n"); break; case SEP_IOCSENDSEPRPLYCOMMAND: /* send reply command to SEP */ @@ -2312,7 +2355,7 @@ static int sep_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, u error = -ENOTTY; break; } - dbg("SEP Driver:<-------- ioctl end\n"); + dbg("<-------- ioctl end\n"); return error; } @@ -2421,16 +2464,16 @@ static void sep_configure_dma_burst(struct sep_device *sep) { #define HW_AHB_RD_WR_BURSTS_REG_ADDR 0x0E10UL - dbg("SEP Driver:<-------- sep_configure_dma_burst start \n"); + dbg("<-------- sep_configure_dma_burst start\n"); /* request access to registers from SEP */ sep_write_reg(sep, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x2); - dbg("SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (write reg) \n"); + dbg("<-------- sep_configure_dma_burst finished request access to registers from SEP (write reg)\n"); sep_wait_busy(sep); - dbg("SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (while(revVal) wait loop) \n"); + dbg("<-------- sep_configure_dma_burst finished request access to registers from SEP (while(revVal) wait loop)\n"); /* set the DMA burst register to single burst */ sep_write_reg(sep, HW_AHB_RD_WR_BURSTS_REG_ADDR, 0x0UL); @@ -2439,7 +2482,7 @@ static void sep_configure_dma_burst(struct sep_device *sep) sep_write_reg(sep, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x0UL); sep_wait_busy(sep); - dbg("SEP Driver:<-------- sep_configure_dma_burst done \n"); + dbg("<-------- sep_configure_dma_burst done\n"); } @@ -2455,7 +2498,7 @@ static int __devinit sep_probe(struct pci_dev *pdev, const struct pci_device_id int counter; int size; /* size of memory for allocation */ - edbg("Sep pci probe starting\n"); + edbg("pci probe starting\n"); if (sep_dev != NULL) { dev_warn(&pdev->dev, "only one SEP supported.\n"); return -EBUSY; @@ -2517,18 +2560,18 @@ static int __devinit sep_probe(struct pci_dev *pdev, const struct pci_device_id sep->flow_wq = create_singlethread_workqueue("sepflowwq"); if (sep->flow_wq == NULL) { error = -ENOMEM; - edbg("sep_driver:flow queue creation failed\n"); + edbg("flow queue creation failed\n"); goto end_function_deallocate_sep_shared_area; } - edbg("SEP Driver: create flow workqueue \n"); + edbg("create flow workqueue\n"); sep->pdev = pci_dev_get(pdev); sep->reg_addr = pci_ioremap_bar(pdev, 0); if (!sep->reg_addr) { - edbg("sep: ioremap of registers failed.\n"); + edbg("ioremap of registers failed.\n"); goto end_function_deallocate_sep_shared_area; } - edbg("SEP Driver:reg_addr is %p\n", sep->reg_addr); + edbg("reg_addr is %p\n", sep->reg_addr); /* load the rom code */ sep_load_rom_code(sep); @@ -2539,17 +2582,17 @@ static int __devinit sep_probe(struct pci_dev *pdev, const struct pci_device_id &sep->rar_bus, GFP_KERNEL); if (!sep->rar_addr) { - edbg("SEP Driver:can't allocate rar\n"); + edbg("can't allocate rar\n"); goto end_function_uniomap; } - edbg("SEP Driver:rar_bus is %08llx\n", (unsigned long long)sep->rar_bus); - edbg("SEP Driver:rar_virtual is %p\n", sep->rar_addr); + edbg("rar_bus is %08llx\n", (unsigned long long)sep->rar_bus); + edbg("rar_virtual is %p\n", sep->rar_addr); #if !SEP_DRIVER_POLLING_MODE - edbg("SEP Driver: about to write IMR and ICR REG_ADDR\n"); + edbg("about to write IMR and ICR REG_ADDR\n"); /* clear ICR register */ sep_write_reg(sep, HW_HOST_ICR_REG_ADDR, 0xFFFFFFFF); @@ -2557,13 +2600,13 @@ static int __devinit sep_probe(struct pci_dev *pdev, const struct pci_device_id /* set the IMR register - open only GPR 2 */ sep_write_reg(sep, HW_HOST_IMR_REG_ADDR, (~(0x1 << 13))); - edbg("SEP Driver: about to call request_irq\n"); + edbg("about to call request_irq\n"); /* get the interrupt line */ error = request_irq(pdev->irq, sep_inthandler, IRQF_SHARED, "sep_driver", sep); if (error) goto end_function_free_res; return 0; - edbg("SEP Driver: about to write IMR REG_ADDR"); + edbg("about to write IMR REG_ADDR\n"); /* set the IMR register - open only GPR 2 */ sep_write_reg(sep, HW_HOST_IMR_REG_ADDR, (~(0x1 << 13))); @@ -2622,8 +2665,8 @@ static int sep_register_driver_to_fs(void) { int ret_val = alloc_chrdev_region(&sep_devno, 0, 1, "sep_sec_driver"); if (ret_val) { - edbg("sep: major number allocation failed, retval is %d\n", - ret_val); + edbg("major number allocation failed, retval is %d\n", + ret_val); return ret_val; } /* init cdev */ @@ -2633,7 +2676,7 @@ static int sep_register_driver_to_fs(void) /* register the driver with the kernel */ ret_val = cdev_add(&sep_cdev, sep_devno, 1); if (ret_val) { - edbg("sep_driver:cdev_add failed, retval is %d\n", ret_val); + edbg("cdev_add failed, retval is %d\n", ret_val); /* unregister dev numbers */ unregister_chrdev_region(sep_devno, 1); } @@ -2647,11 +2690,11 @@ static int sep_register_driver_to_fs(void) static int __init sep_init(void) { int ret_val = 0; - dbg("SEP Driver:-------->Init start\n"); + dbg("-------->Init start\n"); /* FIXME: Probe can occur before we are ready to survive a probe */ ret_val = pci_register_driver(&sep_pci_driver); if (ret_val) { - edbg("sep_driver:sep_driver_to_device failed, ret_val is %d\n", ret_val); + edbg("sep_driver_to_device failed, ret_val is %d\n", ret_val); goto end_function_unregister_from_fs; } /* register driver to fs */ @@ -2667,7 +2710,7 @@ end_function_unregister_from_fs: /* unregister dev numbers */ unregister_chrdev_region(sep_devno, 1); end_function: - dbg("SEP Driver:<-------- Init end\n"); + dbg("<-------- Init end\n"); return ret_val; } @@ -2679,7 +2722,7 @@ static void __exit sep_exit(void) { int size; - dbg("SEP Driver:--------> Exit start\n"); + dbg("--------> Exit start\n"); /* unregister from fs */ cdev_del(&sep_cdev); @@ -2692,12 +2735,12 @@ static void __exit sep_exit(void) /* free shared area */ if (sep_dev) { sep_unmap_and_free_shared_area(sep_dev, size); - edbg("SEP Driver: free pages SEP SHARED AREA \n"); + edbg("free pages SEP SHARED AREA\n"); iounmap((void *) sep_dev->reg_addr); - edbg("SEP Driver: iounmap \n"); + edbg("iounmap\n"); } - edbg("SEP Driver: release_mem_region \n"); - dbg("SEP Driver:<-------- Exit end\n"); + edbg("release_mem_region\n"); + dbg("<-------- Exit end\n"); } diff --git a/drivers/staging/sep/sep_driver_config.h b/drivers/staging/sep/sep_driver_config.h index 6008fe5..aaabf42 100644 --- a/drivers/staging/sep/sep_driver_config.h +++ b/drivers/staging/sep/sep_driver_config.h @@ -208,18 +208,16 @@ /* Debug helpers */ -#define dbg(fmt, args...) \ -do {\ - if (debug & SEP_DEBUG_LEVEL_BASIC) \ - printk(KERN_DEBUG fmt, ##args); \ -} while(0); - -#define edbg(fmt, args...) \ -do { \ - if (debug & SEP_DEBUG_LEVEL_EXTENDED) \ - printk(KERN_DEBUG fmt, ##args); \ -} while(0); - - +#define dbg(fmt, args...) \ + do { \ + if (debug & SEP_DEBUG_LEVEL_BASIC) \ + printk(KERN_DEBUG pr_fmt(fmt), ##args); \ + } while(0); + +#define edbg(fmt, args...) \ + do { \ + if (debug & SEP_DEBUG_LEVEL_EXTENDED) \ + printk(KERN_DEBUG pr_fmt(fmt), ##args); \ + } while (0); #endif -- 1.6.5.rc3.dirty _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel