Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: sep: kick out various fields we can prove are not needed

#1: sep->cache_addr is assigned to sep->rar_addr and never changed
sep->rar_addr is never assigned after this point

#2: sep->cache_bus ditto for sep->rar_bus

#3 sep->rar_region_addr is assigned but necer used

#4 sep->io_addr is in fact private to the probe function and
the same as the reg_addr

#5 The remainig sep->io fields are in fact function locals

#6 sep->message_shared_area is assigned once from sep->shared_area
sep->shared_area does not then change

#7 sep->shared_addr and sep->shared_area_addr are the same thing, ditto
for the bus addresses.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Alan Cox and committed by
Greg Kroah-Hartman
70ae04e6 4c29e979

+77 -101
+8 -22
drivers/staging/sep/sep_dev.h
··· 34 34 35 35 unsigned long in_use; 36 36 37 - unsigned long io_bus; 38 - unsigned long io_end_bus; 39 - unsigned long io_memory_size; 40 - void __iomem *io_addr; 37 + /* address of the shared memory allocated during init for SEP driver 38 + (coherent alloc) */ 39 + void *shared_addr; 40 + /* the physical address of the shared area */ 41 + dma_addr_t shared_bus; 41 42 42 - /* restricted access region */ 43 + /* restricted access region (coherent alloc) */ 43 44 dma_addr_t rar_bus; 44 45 void *rar_addr; 45 - 46 - /* shared memory region */ 47 - dma_addr_t shared_bus; 48 - void *shared_addr; 49 - 50 - /* firmware regions */ 51 - dma_addr_t cache_bus; 46 + /* firmware regions: cache is at rar_addr */ 52 47 unsigned long cache_size; 53 - void *cache_addr; 54 48 49 + /* follows the cache */ 55 50 dma_addr_t resident_bus; 56 51 unsigned long resident_size; 57 52 void *resident_addr; 58 - 59 - void *rar_region_addr; 60 53 61 54 /* start address of the access to the SEP registers from driver */ 62 55 void __iomem *reg_addr; ··· 81 88 /* pointer to the workqueue that handles the flow done interrupts */ 82 89 struct workqueue_struct *flow_wq; 83 90 84 - /* address of the shared memory allocated during init for SEP driver */ 85 - void *shared_area; 86 - /* the physical address of the shared area */ 87 - dma_addr_t shared_area_bus; 88 - 89 - /* Message Shared Area start address - will be allocated during init */ 90 - void *message_shared_area_addr; 91 91 }; 92 92 93 93 static struct sep_device *sep_dev;
+69 -79
drivers/staging/sep/sep_driver.c
··· 188 188 edbg("SEP Driver:rar_virtual is %p\n", sep->rar_addr); 189 189 edbg("SEP Driver:rar_bus is %08llx\n", (unsigned long long)sep->rar_bus); 190 190 191 - sep->rar_region_addr = sep->rar_addr; 192 - sep->cache_bus = sep->rar_bus; 193 - sep->cache_addr = sep->rar_addr; 194 - 195 191 /* load cache */ 196 192 error = request_firmware(&fw, cache_name, &sep->pdev->dev); 197 193 if (error) { ··· 196 200 } 197 201 edbg("SEP Driver:cache %08Zx@%p\n", fw->size, (void *) fw->data); 198 202 199 - memcpy(sep->cache_addr, (void *)fw->data, fw->size); 203 + memcpy(sep->rar_addr, (void *)fw->data, fw->size); 200 204 sep->cache_size = fw->size; 201 205 release_firmware(fw); 202 206 203 - sep->resident_bus = sep->cache_bus + sep->cache_size; 204 - sep->resident_addr = sep->cache_addr + sep->cache_size; 207 + sep->resident_bus = sep->rar_bus + sep->cache_size; 208 + sep->resident_addr = sep->rar_addr + sep->cache_size; 205 209 206 210 /* load resident */ 207 211 error = request_firmware(&fw, res_name, &sep->pdev->dev); ··· 217 221 218 222 edbg("sep: resident v %p b %08llx cache v %p b %08llx\n", 219 223 sep->resident_addr, (unsigned long long)sep->resident_bus, 220 - sep->cache_addr, (unsigned long long)sep->cache_bus); 224 + sep->rar_addr, (unsigned long long)sep->rar_bus); 221 225 return 0; 222 226 } 223 227 ··· 241 245 edbg("sep_driver :shared memory dma_alloc_coherent failed\n"); 242 246 return -ENOMEM; 243 247 } 244 - sep->shared_area = sep->shared_addr; 245 248 /* set the bus address of the shared area */ 246 - sep->shared_area_bus = sep->shared_bus; 247 - edbg("sep: shared_area %ld bytes @%p (bus %08llx)\n", 249 + edbg("sep: shared_addr %ld bytes @%p (bus %08llx)\n", 248 250 size, sep->shared_addr, (unsigned long long)sep->shared_bus); 249 251 return 0; 250 252 } ··· 258 264 static void sep_unmap_and_free_shared_area(struct sep_device *sep, int size) 259 265 { 260 266 dma_free_coherent(&sep->pdev->dev, size, 261 - sep->shared_area, sep->shared_area_bus); 267 + sep->shared_addr, sep->shared_bus); 262 268 } 263 269 264 270 /** 265 - * sep_shared_area_virt_to_bus - convert bus/virt addresses 271 + * sep_shared_virt_to_bus - convert bus/virt addresses 266 272 * 267 273 * Returns the bus address inside the shared area according 268 274 * to the virtual address. 269 275 */ 270 276 271 - static dma_addr_t sep_shared_area_virt_to_bus(struct sep_device *sep, 277 + static dma_addr_t sep_shared_virt_to_bus(struct sep_device *sep, 272 278 void *virt_address) 273 279 { 274 280 dma_addr_t pa = sep->shared_bus + (virt_address - sep->shared_addr); ··· 277 283 } 278 284 279 285 /** 280 - * sep_shared_area_bus_to_virt - convert bus/virt addresses 286 + * sep_shared_bus_to_virt - convert bus/virt addresses 281 287 * 282 288 * Returns virtual address inside the shared area according 283 289 * to the bus address. 284 290 */ 285 291 286 - static void *sep_shared_area_bus_to_virt(struct sep_device *sep, 292 + static void *sep_shared_bus_to_virt(struct sep_device *sep, 287 293 dma_addr_t bus_address) 288 294 { 289 295 return sep->shared_addr + (bus_address - sep->shared_bus); ··· 385 391 return -EAGAIN; 386 392 } 387 393 388 - edbg("SEP Driver:sep->message_shared_area_addr is %p\n", sep->message_shared_area_addr); 394 + edbg("SEP Driver:sep->shared_addr is %p\n", sep->shared_addr); 389 395 390 396 /* get bus address */ 391 - bus_addr = sep->shared_area_bus; 397 + bus_addr = sep->shared_bus; 392 398 393 399 edbg("SEP Driver: phys_addr is %08llx\n", (unsigned long long)bus_addr); 394 400 ··· 423 429 retval = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR2_REG_ADDR); 424 430 425 431 for (count = 0; count < 10 * 4; count += 4) 426 - edbg("Poll Debug Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_area + SEP_DRIVER_MESSAGE_SHARED_AREA_SIZE_IN_BYTES + count))); 432 + 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))); 427 433 } 428 434 429 435 sep->reply_ct++; ··· 439 445 /* check if the data is ready */ 440 446 if (sep->send_ct == sep->reply_ct) { 441 447 for (count = 0; count < 12 * 4; count += 4) 442 - edbg("Sep Mesg Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_area + count))); 448 + edbg("Sep Mesg Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_addr + count))); 443 449 444 450 for (count = 0; count < 10 * 4; count += 4) 445 - edbg("Debug Data Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_area + 0x1800 + count))); 451 + edbg("Debug Data Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_addr + 0x1800 + count))); 446 452 447 453 retval = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR2_REG_ADDR); 448 454 edbg("retval is %lu\n", retval); ··· 475 481 do_gettimeofday(&time); 476 482 477 483 /* set value in the SYSTEM MEMORY offset */ 478 - time_addr = sep->message_shared_area_addr + SEP_DRIVER_SYSTEM_TIME_MEMORY_OFFSET_IN_BYTES; 484 + time_addr = sep->shared_addr + SEP_DRIVER_SYSTEM_TIME_MEMORY_OFFSET_IN_BYTES; 479 485 480 486 time_addr[0] = SEP_TIME_VAL_TOKEN; 481 487 time_addr[1] = time.tv_sec; 482 488 483 489 edbg("SEP Driver:time.tv_sec is %lu\n", time.tv_sec); 484 490 edbg("SEP Driver:time_addr is %p\n", time_addr); 485 - edbg("SEP Driver:sep->message_shared_area_addr is %p\n", sep->message_shared_area_addr); 491 + edbg("SEP Driver:sep->shared_addr is %p\n", sep->shared_addr); 486 492 487 493 /* set the output parameters if needed */ 488 494 if (address_ptr) 489 - *address_ptr = sep_shared_area_virt_to_bus(sep, time_addr); 495 + *address_ptr = sep_shared_virt_to_bus(sep, time_addr); 490 496 491 497 if (time_in_sec_ptr) 492 498 *time_in_sec_ptr = time.tv_sec; ··· 511 517 flush_cache_all(); 512 518 513 519 for (count = 0; count < 12 * 4; count += 4) 514 - edbg("Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_area + count))); 520 + edbg("Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_addr + count))); 515 521 516 522 /* update counter */ 517 523 sep->send_ct++; ··· 534 540 /* flash cache */ 535 541 flush_cache_all(); 536 542 for (count = 0; count < 12 * 4; count += 4) 537 - edbg("Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_area + count))); 543 + edbg("Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_addr + count))); 538 544 /* update counter */ 539 545 sep->send_ct++; 540 546 /* send the interrupt to SEP */ ··· 572 578 573 579 /* set the virtual and bus address */ 574 580 command_args.offset = SEP_DRIVER_DATA_POOL_AREA_OFFSET_IN_BYTES + sep->data_pool_bytes_allocated; 575 - command_args.phys_address = sep->shared_area_bus + SEP_DRIVER_DATA_POOL_AREA_OFFSET_IN_BYTES + sep->data_pool_bytes_allocated; 581 + command_args.phys_address = sep->shared_bus + SEP_DRIVER_DATA_POOL_AREA_OFFSET_IN_BYTES + sep->data_pool_bytes_allocated; 576 582 577 583 /* write the memory back to the user space */ 578 584 error = copy_to_user((void *) arg, (void *) &command_args, sizeof(struct sep_driver_alloc_t)); ··· 618 624 goto end_function; 619 625 620 626 /* calculate the start of the data pool */ 621 - data_pool_area_addr = sep->shared_area + SEP_DRIVER_DATA_POOL_AREA_OFFSET_IN_BYTES; 627 + data_pool_area_addr = sep->shared_addr + SEP_DRIVER_DATA_POOL_AREA_OFFSET_IN_BYTES; 622 628 623 629 624 630 /* check that the range of the virtual kernel address is correct */ ··· 666 672 goto end_function; 667 673 668 674 /* calculate the start of the data pool */ 669 - data_pool_area_addr = sep->shared_area + SEP_DRIVER_DATA_POOL_AREA_OFFSET_IN_BYTES; 675 + data_pool_area_addr = sep->shared_addr + SEP_DRIVER_DATA_POOL_AREA_OFFSET_IN_BYTES; 670 676 671 677 /* FIXME: These are incomplete all over the driver: what about + len 672 678 and when doing that also overflows */ ··· 1059 1065 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); 1060 1066 1061 1067 if ((unsigned long) lli_table_ptr != 0xffffffff) 1062 - lli_table_ptr = (struct sep_lli_entry_t *) sep_shared_area_bus_to_virt(sep, (unsigned long) lli_table_ptr); 1068 + lli_table_ptr = (struct sep_lli_entry_t *) sep_shared_bus_to_virt(sep, (unsigned long) lli_table_ptr); 1063 1069 1064 1070 table_count++; 1065 1071 } ··· 1109 1115 1110 1116 if (data_size == 0) { 1111 1117 /* special case - created 2 entries table with zero data */ 1112 - in_lli_table_ptr = (struct sep_lli_entry_t *) (sep->shared_area + SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES); 1118 + in_lli_table_ptr = (struct sep_lli_entry_t *) (sep->shared_addr + SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES); 1113 1119 /* FIXME: Should the entry below not be for _bus */ 1114 - in_lli_table_ptr->physical_address = (unsigned long)sep->shared_area + SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES; 1120 + in_lli_table_ptr->physical_address = (unsigned long)sep->shared_addr + SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES; 1115 1121 in_lli_table_ptr->block_size = 0; 1116 1122 1117 1123 in_lli_table_ptr++; 1118 1124 in_lli_table_ptr->physical_address = 0xFFFFFFFF; 1119 1125 in_lli_table_ptr->block_size = 0; 1120 1126 1121 - *lli_table_ptr = sep->shared_area_bus + SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES; 1127 + *lli_table_ptr = sep->shared_bus + SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES; 1122 1128 *num_entries_ptr = 2; 1123 1129 *table_data_size_ptr = 0; 1124 1130 ··· 1143 1149 sep_lli_entries = sep->in_num_pages; 1144 1150 1145 1151 /* initiate to point after the message area */ 1146 - lli_table_alloc_addr = sep->shared_area + SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES; 1152 + lli_table_alloc_addr = sep->shared_addr + SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES; 1147 1153 1148 1154 /* loop till all the entries in in array are not processed */ 1149 1155 while (current_entry < sep_lli_entries) { ··· 1165 1171 1166 1172 if (info_entry_ptr == 0) { 1167 1173 /* set the output parameters to physical addresses */ 1168 - *lli_table_ptr = sep_shared_area_virt_to_bus(sep, in_lli_table_ptr); 1174 + *lli_table_ptr = sep_shared_virt_to_bus(sep, in_lli_table_ptr); 1169 1175 *num_entries_ptr = num_entries_in_table; 1170 1176 *table_data_size_ptr = table_data_size; 1171 1177 1172 1178 edbg("SEP Driver:output lli_table_in_ptr is %08lx\n", *lli_table_ptr); 1173 1179 } else { 1174 1180 /* update the info entry of the previous in table */ 1175 - info_entry_ptr->physical_address = sep_shared_area_virt_to_bus(sep, in_lli_table_ptr); 1181 + info_entry_ptr->physical_address = sep_shared_virt_to_bus(sep, in_lli_table_ptr); 1176 1182 info_entry_ptr->block_size = ((num_entries_in_table) << 24) | (table_data_size); 1177 1183 } 1178 1184 ··· 1182 1188 1183 1189 /* print input tables */ 1184 1190 sep_debug_print_lli_tables(sep, (struct sep_lli_entry_t *) 1185 - sep_shared_area_bus_to_virt(sep, *lli_table_ptr), *num_entries_ptr, *table_data_size_ptr); 1191 + sep_shared_bus_to_virt(sep, *lli_table_ptr), *num_entries_ptr, *table_data_size_ptr); 1186 1192 1187 1193 /* the array of the pages */ 1188 1194 kfree(lli_array_ptr); ··· 1234 1240 dbg("SEP Driver:--------> sep_construct_dma_tables_from_lli start\n"); 1235 1241 1236 1242 /* initiate to pint after the message area */ 1237 - lli_table_alloc_addr = sep->shared_area + SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES; 1243 + lli_table_alloc_addr = sep->shared_addr + SEP_DRIVER_SYNCHRONIC_DMA_TABLES_AREA_OFFSET_IN_BYTES; 1238 1244 1239 1245 current_in_entry = 0; 1240 1246 current_out_entry = 0; ··· 1282 1288 /* if info entry is null - this is the first table built */ 1283 1289 if (info_in_entry_ptr == 0) { 1284 1290 /* set the output parameters to physical addresses */ 1285 - *lli_table_in_ptr = sep_shared_area_virt_to_bus(sep, in_lli_table_ptr); 1291 + *lli_table_in_ptr = sep_shared_virt_to_bus(sep, in_lli_table_ptr); 1286 1292 *in_num_entries_ptr = num_entries_in_table; 1287 - *lli_table_out_ptr = sep_shared_area_virt_to_bus(sep, out_lli_table_ptr); 1293 + *lli_table_out_ptr = sep_shared_virt_to_bus(sep, out_lli_table_ptr); 1288 1294 *out_num_entries_ptr = num_entries_out_table; 1289 1295 *table_data_size_ptr = table_data_size; 1290 1296 ··· 1292 1298 edbg("SEP Driver:output lli_table_out_ptr is %08lx\n", *lli_table_out_ptr); 1293 1299 } else { 1294 1300 /* update the info entry of the previous in table */ 1295 - info_in_entry_ptr->physical_address = sep_shared_area_virt_to_bus(sep, in_lli_table_ptr); 1301 + info_in_entry_ptr->physical_address = sep_shared_virt_to_bus(sep, in_lli_table_ptr); 1296 1302 info_in_entry_ptr->block_size = ((num_entries_in_table) << 24) | (table_data_size); 1297 1303 1298 1304 /* update the info entry of the previous in table */ 1299 - info_out_entry_ptr->physical_address = sep_shared_area_virt_to_bus(sep, out_lli_table_ptr); 1305 + info_out_entry_ptr->physical_address = sep_shared_virt_to_bus(sep, out_lli_table_ptr); 1300 1306 info_out_entry_ptr->block_size = ((num_entries_out_table) << 24) | (table_data_size); 1301 1307 } 1302 1308 ··· 1311 1317 1312 1318 /* print input tables */ 1313 1319 sep_debug_print_lli_tables(sep, (struct sep_lli_entry_t *) 1314 - sep_shared_area_bus_to_virt(sep, *lli_table_in_ptr), *in_num_entries_ptr, *table_data_size_ptr); 1320 + sep_shared_bus_to_virt(sep, *lli_table_in_ptr), *in_num_entries_ptr, *table_data_size_ptr); 1315 1321 /* print output tables */ 1316 1322 sep_debug_print_lli_tables(sep, (struct sep_lli_entry_t *) 1317 - sep_shared_area_bus_to_virt(sep, *lli_table_out_ptr), *out_num_entries_ptr, *table_data_size_ptr); 1323 + sep_shared_bus_to_virt(sep, *lli_table_out_ptr), *out_num_entries_ptr, *table_data_size_ptr); 1318 1324 dbg("SEP Driver:<-------- sep_construct_dma_tables_from_lli end\n"); 1319 1325 return 0; 1320 1326 } ··· 1488 1494 unsigned long table_size_in_words; 1489 1495 1490 1496 /* find the start address of the flow DMA table area */ 1491 - flow_dma_area_start_addr = sep->shared_area + SEP_DRIVER_FLOW_DMA_TABLES_AREA_OFFSET_IN_BYTES; 1497 + flow_dma_area_start_addr = sep->shared_addr + SEP_DRIVER_FLOW_DMA_TABLES_AREA_OFFSET_IN_BYTES; 1492 1498 1493 1499 /* set end address of the flow table area */ 1494 1500 flow_dma_area_end_addr = flow_dma_area_start_addr + SEP_DRIVER_FLOW_DMA_TABLES_AREA_SIZE_IN_BYTES; ··· 1952 1958 dbg("SEP Driver:--------> sep_get_static_pool_addr_handler start\n"); 1953 1959 1954 1960 /*prepare the output parameters in the struct */ 1955 - command_args.physical_static_address = sep->shared_area_bus + SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES; 1956 - command_args.virtual_static_address = (unsigned long)sep->shared_area + SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES; 1961 + command_args.physical_static_address = sep->shared_bus + SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES; 1962 + command_args.virtual_static_address = (unsigned long)sep->shared_addr + SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES; 1957 1963 1958 1964 edbg("SEP Driver:bus_static_address is %08lx, virtual_static_address %08lx\n", command_args.physical_static_address, command_args.virtual_static_address); 1959 1965 ··· 1978 1984 if (error) 1979 1985 goto end_function; 1980 1986 1981 - if (command_args.physical_address < sep->shared_area_bus) { 1987 + if (command_args.physical_address < sep->shared_bus) { 1982 1988 error = -EINVAL; 1983 1989 goto end_function; 1984 1990 } 1985 1991 1986 1992 /*prepare the output parameters in the struct */ 1987 - command_args.offset = command_args.physical_address - sep->shared_area_bus; 1993 + command_args.offset = command_args.physical_address - sep->shared_bus; 1988 1994 1989 1995 edbg("SEP Driver:bus_address is %08lx, offset is %lu\n", command_args.physical_address, command_args.offset); 1990 1996 ··· 2100 2106 if (error) 2101 2107 return error; 2102 2108 2103 - command_args.new_base_addr = sep->shared_area_bus; 2109 + command_args.new_base_addr = sep->shared_bus; 2104 2110 2105 2111 /* find the new base address according to the lowest address between 2106 2112 cache, resident and shared area */ 2107 2113 if (sep->resident_bus < command_args.new_base_addr) 2108 2114 command_args.new_base_addr = sep->resident_bus; 2109 - if (sep->cache_bus < command_args.new_base_addr) 2110 - command_args.new_base_addr = sep->cache_bus; 2115 + if (sep->rar_bus < command_args.new_base_addr) 2116 + command_args.new_base_addr = sep->rar_bus; 2111 2117 2112 2118 /* set the return parameters */ 2113 - command_args.new_cache_addr = sep->cache_bus; 2119 + command_args.new_cache_addr = sep->rar_bus; 2114 2120 command_args.new_resident_addr = sep->resident_bus; 2115 2121 2116 2122 /* set the new shared area */ 2117 - command_args.new_shared_area_addr = sep->shared_area_bus; 2123 + command_args.new_shared_area_addr = sep->shared_bus; 2118 2124 2119 - edbg("SEP Driver:command_args.new_shared_area is %08llx\n", command_args.new_shared_area_addr); 2125 + edbg("SEP Driver:command_args.new_shared_addr is %08llx\n", command_args.new_shared_area_addr); 2120 2126 edbg("SEP Driver:command_args.new_base_addr is %08llx\n", command_args.new_base_addr); 2121 2127 edbg("SEP Driver:command_args.new_resident_addr is %08llx\n", command_args.new_resident_addr); 2122 - edbg("SEP Driver:command_args.new_cache_addr is %08llx\n", command_args.new_cache_addr); 2128 + edbg("SEP Driver:command_args.new_rar_addr is %08llx\n", command_args.new_cache_addr); 2123 2129 2124 2130 /* return to user */ 2125 2131 if (copy_to_user((void *) arg, &command_args, sizeof(struct sep_driver_realloc_cache_resident_t))) ··· 2314 2320 flag may be checked */ 2315 2321 if (flow_data_ptr->input_tables_flag) { 2316 2322 /* copy the message to the shared RAM and signal SEP */ 2317 - memcpy((void *) flow_data_ptr->message, (void *) sep->shared_area, flow_data_ptr->message_size_in_bytes); 2323 + memcpy((void *) flow_data_ptr->message, (void *) sep->shared_addr, flow_data_ptr->message_size_in_bytes); 2318 2324 2319 2325 sep_write_reg(sep, HW_HOST_HOST_SEP_GPR2_REG_ADDR, 0x2); 2320 2326 } ··· 2425 2431 struct sep_device *sep; 2426 2432 int counter; 2427 2433 int size; /* size of memory for allocation */ 2434 + unsigned long iosize; 2435 + unsigned long bar0, end0; 2428 2436 2429 2437 edbg("Sep pci probe starting\n"); 2430 2438 if (sep_dev != NULL) { ··· 2445 2449 sep_dev = &sep_instance; 2446 2450 sep = &sep_instance; 2447 2451 2448 - edbg("sep->shared_area = %lx\n", (unsigned long) &sep->shared_area); 2452 + edbg("sep->shared_addr = %p\n", sep->shared_addr); 2449 2453 /* transaction counter that coordinates the transactions between SEP 2450 2454 and HOST */ 2451 2455 sep->send_ct = 0; ··· 2466 2470 goto end_function_error; 2467 2471 } 2468 2472 /* now set the memory regions */ 2469 - sep->message_shared_area_addr = sep->shared_area; 2470 - 2471 - edbg("SEP Driver: sep->message_shared_area_addr is %p\n", sep->message_shared_area_addr); 2472 - 2473 2473 #if (SEP_DRIVER_RECONFIG_MESSAGE_AREA == 1) 2474 2474 /* send the new SHARED MESSAGE AREA to the SEP */ 2475 - sep_write_reg(sep, HW_HOST_HOST_SEP_GPR1_REG_ADDR, sep->shared_area_bus); 2475 + sep_write_reg(sep, HW_HOST_HOST_SEP_GPR1_REG_ADDR, sep->shared_bus); 2476 2476 2477 2477 /* poll for SEP response */ 2478 2478 retval = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR1_REG_ADDR); 2479 - while (retval != 0xffffffff && retval != sep->shared_area_bus) 2479 + while (retval != 0xffffffff && retval != sep->shared_bus) 2480 2480 retval = sep_read_reg(sep, HW_HOST_SEP_HOST_GPR1_REG_ADDR); 2481 2481 2482 2482 /* check the return value (register) */ 2483 - if (retval != sep->shared_area_bus) { 2483 + if (retval != sep->shared_bus) { 2484 2484 error = -ENOMEM; 2485 2485 goto end_function_deallocate_sep_shared_area; 2486 2486 } ··· 2498 2506 sep->pdev = pci_dev_get(pdev); 2499 2507 2500 2508 /* get the io memory start address */ 2501 - sep->io_bus = pci_resource_start(pdev, 0); 2502 - if (!sep->io_bus) { 2509 + bar0 = pci_resource_start(pdev, 0); 2510 + if (!bar0) { 2503 2511 edbg("SEP Driver error pci resource start\n"); 2504 2512 goto end_function_deallocate_sep_shared_area; 2505 2513 } 2506 2514 2507 2515 /* get the io memory end address */ 2508 - sep->io_end_bus = pci_resource_end(pdev, 0); 2509 - if (!sep->io_end_bus) { 2516 + end0 = pci_resource_end(pdev, 0); 2517 + if (!end0) { 2510 2518 edbg("SEP Driver error pci resource end\n"); 2511 2519 goto end_function_deallocate_sep_shared_area; 2512 2520 } 2513 2521 2514 - sep->io_memory_size = sep->io_end_bus - sep->io_bus + 1; 2522 + iosize = end0 - bar0 + 1; 2515 2523 2516 - edbg("SEP Driver:io_bus is %08lx\n", sep->io_bus); 2524 + edbg("SEP Driver:io_bus is %08lx\n", bar0); 2517 2525 2518 - edbg("SEP Driver:io_memory_end_phyaical_address is %08lx\n", sep->io_end_bus); 2526 + edbg("SEP Driver:io_memory_end_phyaical_address is %08lx\n", end0); 2519 2527 2520 - edbg("SEP Driver:io_memory_size is %08lx\n", sep->io_memory_size); 2528 + edbg("SEP Driver:io_memory_size is %08lx\n", iosize); 2521 2529 2522 - sep->io_addr = ioremap_nocache(sep->io_bus, sep->io_memory_size); 2523 - if (!sep->io_addr) { 2530 + sep->reg_addr = ioremap_nocache(bar0, iosize); 2531 + if (!sep->reg_addr) { 2524 2532 edbg("SEP Driver error ioremap of io memory\n"); 2525 2533 goto end_function_deallocate_sep_shared_area; 2526 2534 } 2527 2535 2528 - edbg("SEP Driver:io_addr is %p\n", sep->io_addr); 2529 - 2530 - sep->reg_addr = (void __iomem *) sep->io_addr; 2536 + edbg("SEP Driver:io_addr is %p\n", sep->reg_addr); 2531 2537 2532 2538 /* set up system base address and shared memory location */ 2533 2539 ··· 2568 2578 sep->rar_addr, sep->rar_bus); 2569 2579 #endif /* SEP_DRIVER_POLLING_MODE */ 2570 2580 end_function_uniomap: 2571 - iounmap(sep->io_addr); 2581 + iounmap(sep->reg_addr); 2572 2582 end_function_deallocate_sep_shared_area: 2573 2583 /* de-allocate shared area */ 2574 2584 sep_unmap_and_free_shared_area(sep, size);