Staging: sep: indent pass

Ok time to indent and get the code in vague shape. No other changes in this
patch.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Alan Cox
2009-08-06 20:45:57 +01:00
committed by Greg Kroah-Hartman
parent 46eb5a13b7
commit d19cf32fdd
6 changed files with 1987 additions and 2612 deletions

View File

@@ -121,9 +121,8 @@ static inline void sep_wait_sram_write(struct sep_device *dev)
u32 reg_val; u32 reg_val;
do do
reg_val = sep_read_reg(dev, HW_SRAM_DATA_READY_REG_ADDR); reg_val = sep_read_reg(dev, HW_SRAM_DATA_READY_REG_ADDR);
while(!(reg_val & 1)); while (!(reg_val & 1));
} }
#endif #endif

View File

@@ -125,13 +125,13 @@ struct sep_driver_realloc_cache_resident_t {
/* current cache address */ /* current cache address */
unsigned long cache_addr; unsigned long cache_addr;
/* cache size in bytes*/ /* cache size in bytes */
unsigned long cache_size_in_bytes; unsigned long cache_size_in_bytes;
/* current resident address */ /* current resident address */
unsigned long resident_addr; unsigned long resident_addr;
/* resident size in bytes*/ /* resident size in bytes */
unsigned long resident_size_in_bytes; unsigned long resident_size_in_bytes;
/* new cache address */ /* new cache address */
@@ -374,7 +374,7 @@ struct sep_lli_prepare_table_data_t {
*/ */
struct sep_lli_table_t { struct sep_lli_table_t {
/* number of pages mapped in this tables. If 0 - means that the table /* number of pages mapped in this tables. If 0 - means that the table
is not defined (used as a valid flag)*/ is not defined (used as a valid flag) */
unsigned long num_pages; unsigned long num_pages;
/* /*
pointer to array of page pointers that represent the mapping of the pointer to array of page pointers that represent the mapping of the
@@ -478,26 +478,18 @@ void sep_send_msg_rdy_cmd(void);
This function releases all the application virtual This function releases all the application virtual
buffer physical pages, that were previously locked buffer physical pages, that were previously locked
*/ */
int sep_free_dma_pages(struct page **page_array_ptr, int sep_free_dma_pages(struct page **page_array_ptr, unsigned long num_pages, unsigned long dirtyFlag);
unsigned long num_pages,
unsigned long dirtyFlag);
/* /*
This function creates the input and output dma tables for This function creates the input and output dma tables for
symmetric operations (AES/DES) according to the block size symmetric operations (AES/DES) according to the block size
from LLI arays from LLI arays
*/ */
int sep_construct_dma_tables_from_lli( int sep_construct_dma_tables_from_lli(struct sep_lli_entry_t *lli_in_array,
struct sep_lli_entry_t *lli_in_array,
unsigned long sep_in_lli_entries, unsigned long sep_in_lli_entries,
struct sep_lli_entry_t *lli_out_array, struct sep_lli_entry_t *lli_out_array,
unsigned long sep_out_lli_entries, unsigned long sep_out_lli_entries,
unsigned long block_size, unsigned long block_size, unsigned long *lli_table_in_ptr, unsigned long *lli_table_out_ptr, unsigned long *in_num_entries_ptr, unsigned long *out_num_entries_ptr, unsigned long *table_data_size_ptr);
unsigned long *lli_table_in_ptr,
unsigned long *lli_table_out_ptr,
unsigned long *in_num_entries_ptr,
unsigned long *out_num_entries_ptr,
unsigned long *table_data_size_ptr);
/* /*
This function builds input and output DMA tables for synhronic symmetric This function builds input and output DMA tables for synhronic symmetric
@@ -508,24 +500,13 @@ int sep_prepare_input_output_dma_table(unsigned long app_virt_in_addr,
unsigned long app_virt_out_addr, unsigned long app_virt_out_addr,
unsigned long data_size, unsigned long data_size,
unsigned long block_size, unsigned long block_size,
unsigned long *lli_table_in_ptr, unsigned long *lli_table_in_ptr, unsigned long *lli_table_out_ptr, unsigned long *in_num_entries_ptr, unsigned long *out_num_entries_ptr, unsigned long *table_data_size_ptr, bool isKernelVirtualAddress);
unsigned long *lli_table_out_ptr,
unsigned long *in_num_entries_ptr,
unsigned long *out_num_entries_ptr,
unsigned long *table_data_size_ptr,
bool isKernelVirtualAddress);
/* /*
This function prepares only input DMA table for synhronic symmetric This function prepares only input DMA table for synhronic symmetric
operations (HASH) operations (HASH)
*/ */
int sep_prepare_input_dma_table(unsigned long app_virt_addr, int sep_prepare_input_dma_table(unsigned long app_virt_addr, unsigned long data_size, unsigned long block_size, unsigned long *lli_table_ptr, unsigned long *num_entries_ptr, unsigned long *table_data_size_ptr, bool isKernelVirtualAddress);
unsigned long data_size,
unsigned long block_size,
unsigned long *lli_table_ptr,
unsigned long *num_entries_ptr,
unsigned long *table_data_size_ptr,
bool isKernelVirtualAddress);
/* this functions frees all the resources that were allocated for the building /* this functions frees all the resources that were allocated for the building
of the LLI DMA tables */ of the LLI DMA tables */

View File

@@ -51,12 +51,7 @@ This functions copies the cache and resident from their source location into
destination memory, which is external to Linux VM and is given as physical destination memory, which is external to Linux VM and is given as physical
address address
*/ */
int sep_copy_cache_resident_to_area(unsigned long src_cache_addr, int sep_copy_cache_resident_to_area(unsigned long src_cache_addr, unsigned long cache_size_in_bytes, unsigned long src_resident_addr, unsigned long resident_size_in_bytes, unsigned long *dst_new_cache_addr_ptr, unsigned long *dst_new_resident_addr_ptr);
unsigned long cache_size_in_bytes,
unsigned long src_resident_addr,
unsigned long resident_size_in_bytes,
unsigned long *dst_new_cache_addr_ptr,
unsigned long *dst_new_resident_addr_ptr);
/* /*
This functions maps and allocates the shared area on the external This functions maps and allocates the shared area on the external
@@ -65,9 +60,7 @@ to allocate. The outputs are kernel_shared_area_addr_ptr - the kerenl
address of the mapped and allocated shared area, and address of the mapped and allocated shared area, and
phys_shared_area_addr_ptr - the physical address of the shared area phys_shared_area_addr_ptr - the physical address of the shared area
*/ */
int sep_map_and_alloc_shared_area(unsigned long shared_area_size, int sep_map_and_alloc_shared_area(unsigned long shared_area_size, unsigned long *kernel_shared_area_addr_ptr, unsigned long *phys_shared_area_addr_ptr);
unsigned long *kernel_shared_area_addr_ptr,
unsigned long *phys_shared_area_addr_ptr);
/* /*
This functions unmaps and deallocates the shared area on the external This functions unmaps and deallocates the shared area on the external
@@ -76,9 +69,7 @@ deallocate,kernel_shared_area_addr_ptr - the kernel address of the
mapped and allocated shared area,phys_shared_area_addr_ptr - the physical mapped and allocated shared area,phys_shared_area_addr_ptr - the physical
address of the shared area address of the shared area
*/ */
void sep_unmap_and_free_shared_area(unsigned long shared_area_size, void sep_unmap_and_free_shared_area(unsigned long shared_area_size, unsigned long kernel_shared_area_addr, unsigned long phys_shared_area_addr);
unsigned long kernel_shared_area_addr,
unsigned long phys_shared_area_addr);
/* /*

View File

@@ -90,7 +90,7 @@ static unsigned long CRYS_SEP_ROM[] = {
#define BASE_ADDRESS_FOR_SYSTEM 0xfffc0000 #define BASE_ADDRESS_FOR_SYSTEM 0xfffc0000
#define SEP_RAR_IO_MEM_REGION_SIZE 0x40000 #define SEP_RAR_IO_MEM_REGION_SIZE 0x40000
irqreturn_t sep_inthandler(int irq , void* dev_id); irqreturn_t sep_inthandler(int irq, void *dev_id);
/* Keep this a single static object for now to keep the conversion easy */ /* Keep this a single static object for now to keep the conversion easy */
@@ -107,12 +107,11 @@ unsigned long jiffies_future;
/* /*
function that is activated on the succesfull probe of the SEP device function that is activated on the succesfull probe of the SEP device
*/ */
static int __devinit sep_probe(struct pci_dev *pdev, static int __devinit sep_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
const struct pci_device_id *ent);
static struct pci_device_id sep_pci_id_tbl[] = { static struct pci_device_id sep_pci_id_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x080c) }, {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x080c)},
{ 0 } {0}
}; };
MODULE_DEVICE_TABLE(pci, sep_pci_id_tbl); MODULE_DEVICE_TABLE(pci, sep_pci_id_tbl);
@@ -141,12 +140,7 @@ void sep_lock_cache_resident_area(void)
destination memory, which is external to Linux VM and is given as destination memory, which is external to Linux VM and is given as
physical address physical address
*/ */
int sep_copy_cache_resident_to_area(unsigned long src_cache_addr, int sep_copy_cache_resident_to_area(unsigned long src_cache_addr, unsigned long cache_size_in_bytes, unsigned long src_resident_addr, unsigned long resident_size_in_bytes, unsigned long *dst_new_cache_addr_ptr, unsigned long *dst_new_resident_addr_ptr)
unsigned long cache_size_in_bytes,
unsigned long src_resident_addr,
unsigned long resident_size_in_bytes,
unsigned long *dst_new_cache_addr_ptr,
unsigned long *dst_new_resident_addr_ptr)
{ {
/* resident address in user space */ /* resident address in user space */
unsigned long resident_addr; unsigned long resident_addr;
@@ -167,14 +161,10 @@ int sep_copy_cache_resident_to_area(unsigned long src_cache_addr,
-------------------------------------*/ -------------------------------------*/
error = 0; error = 0;
edbg( edbg("SEP Driver:rar_virtual is %p\n", sep_dev->rar_virtual_address);
"SEP Driver:rar_virtual is %p\n", edbg("SEP Driver:rar_physical is %08lx\n", sep_dev->rar_physical_address);
sep_dev->rar_virtual_address);
edbg(
"SEP Driver:rar_physical is %08lx\n",
sep_dev->rar_physical_address);
sep_dev->rar_region_addr = (unsigned long)sep_dev->rar_virtual_address; sep_dev->rar_region_addr = (unsigned long) sep_dev->rar_virtual_address;
sep_dev->cache_physical_address = sep_dev->rar_physical_address; sep_dev->cache_physical_address = sep_dev->rar_physical_address;
sep_dev->cache_virtual_address = sep_dev->rar_virtual_address; sep_dev->cache_virtual_address = sep_dev->rar_virtual_address;
@@ -182,72 +172,50 @@ int sep_copy_cache_resident_to_area(unsigned long src_cache_addr,
/* load cache */ /* load cache */
error = request_firmware(&fw, cache_name, &sep_dev->sep_pci_dev_ptr->dev); error = request_firmware(&fw, cache_name, &sep_dev->sep_pci_dev_ptr->dev);
if (error) { if (error) {
edbg( edbg("SEP Driver:cant request cache fw\n");
"SEP Driver:cant request cache fw\n");
goto end_function; goto end_function;
} }
edbg( edbg("SEP Driver:cache data loc is %p\n", (void *) fw->data);
"SEP Driver:cache data loc is %p\n", edbg("SEP Driver:cache data size is %08Zx\n", fw->size);
(void *)fw->data);
edbg(
"SEP Driver:cache data size is %08Zx\n",
fw->size);
memcpy((void *)sep_dev->cache_virtual_address, (void *)fw->data, fw->size); memcpy((void *) sep_dev->cache_virtual_address, (void *) fw->data, fw->size);
sep_dev->cache_size = fw->size; sep_dev->cache_size = fw->size;
cache_addr = (unsigned long)sep_dev->cache_virtual_address; cache_addr = (unsigned long) sep_dev->cache_virtual_address;
release_firmware(fw); release_firmware(fw);
sep_dev->resident_physical_address = sep_dev->cache_physical_address sep_dev->resident_physical_address = sep_dev->cache_physical_address + sep_dev->cache_size;
+ sep_dev->cache_size; sep_dev->resident_virtual_address = sep_dev->cache_virtual_address + sep_dev->cache_size;
sep_dev->resident_virtual_address = sep_dev->cache_virtual_address
+ sep_dev->cache_size;
/* load resident */ /* load resident */
error = request_firmware(&fw, res_name, &sep_dev->sep_pci_dev_ptr->dev); error = request_firmware(&fw, res_name, &sep_dev->sep_pci_dev_ptr->dev);
if (error) { if (error) {
edbg( edbg("SEP Driver:cant request res fw\n");
"SEP Driver:cant request res fw\n");
goto end_function; goto end_function;
} }
edbg( edbg("SEP Driver:res data loc is %p\n", (void *) fw->data);
"SEP Driver:res data loc is %p\n", edbg("SEP Driver:res data size is %08Zx\n", fw->size);
(void *)fw->data);
edbg(
"SEP Driver:res data size is %08Zx\n",
fw->size);
memcpy((void *)sep_dev->resident_virtual_address, (void *)fw->data, fw->size); memcpy((void *) sep_dev->resident_virtual_address, (void *) fw->data, fw->size);
sep_dev->resident_size = fw->size; sep_dev->resident_size = fw->size;
release_firmware(fw); release_firmware(fw);
resident_addr = (unsigned long)sep_dev->resident_virtual_address; resident_addr = (unsigned long) sep_dev->resident_virtual_address;
edbg( edbg("SEP Driver:resident_addr (physical )is %08lx\n", sep_dev->resident_physical_address);
"SEP Driver:resident_addr (physical )is %08lx\n", edbg("SEP Driver:cache_addr (physical) is %08lx\n", sep_dev->cache_physical_address);
sep_dev->resident_physical_address);
edbg(
"SEP Driver:cache_addr (physical) is %08lx\n",
sep_dev->cache_physical_address);
edbg( edbg("SEP Driver:resident_addr (logical )is %08lx\n", resident_addr);
"SEP Driver:resident_addr (logical )is %08lx\n", edbg("SEP Driver:cache_addr (logical) is %08lx\n", cache_addr);
resident_addr);
edbg(
"SEP Driver:cache_addr (logical) is %08lx\n",
cache_addr);
edbg( edbg("SEP Driver:resident_size is %08lx\n", sep_dev->resident_size);
"SEP Driver:resident_size is %08lx\n", sep_dev->resident_size); edbg("SEP Driver:cache_size is %08lx\n", sep_dev->cache_size);
edbg(
"SEP Driver:cache_size is %08lx\n", sep_dev->cache_size);
@@ -255,7 +223,7 @@ int sep_copy_cache_resident_to_area(unsigned long src_cache_addr,
*dst_new_cache_addr_ptr = sep_dev->cache_physical_address; *dst_new_cache_addr_ptr = sep_dev->cache_physical_address;
*dst_new_resident_addr_ptr = sep_dev->resident_physical_address; *dst_new_resident_addr_ptr = sep_dev->resident_physical_address;
end_function: end_function:
return error; return error;
} }
@@ -270,15 +238,12 @@ end_function:
shared area, and phys_shared_area_addr_ptr shared area, and phys_shared_area_addr_ptr
- the physical address of the shared area - the physical address of the shared area
*/ */
int sep_map_and_alloc_shared_area(unsigned long shared_area_size, int sep_map_and_alloc_shared_area(unsigned long shared_area_size, unsigned long *kernel_shared_area_addr_ptr, unsigned long *phys_shared_area_addr_ptr)
unsigned long *kernel_shared_area_addr_ptr,
unsigned long *phys_shared_area_addr_ptr)
{ {
// shared_virtual_address = ioremap_nocache(0xda00000,shared_area_size); // shared_virtual_address = ioremap_nocache(0xda00000,shared_area_size);
sep_dev->shared_virtual_address = kmalloc(shared_area_size, GFP_KERNEL); sep_dev->shared_virtual_address = kmalloc(shared_area_size, GFP_KERNEL);
if (!sep_dev->shared_virtual_address) { if (!sep_dev->shared_virtual_address) {
edbg( edbg("sep_driver:shared memory kmalloc failed\n");
"sep_driver:shared memory kmalloc failed\n");
return -1; return -1;
} }
@@ -286,19 +251,13 @@ int sep_map_and_alloc_shared_area(unsigned long shared_area_size,
sep_dev->shared_physical_address = __pa(sep_dev->shared_virtual_address); sep_dev->shared_physical_address = __pa(sep_dev->shared_virtual_address);
// shared_physical_address = 0xda00000; // shared_physical_address = 0xda00000;
*kernel_shared_area_addr_ptr = (unsigned long)sep_dev->shared_virtual_address; *kernel_shared_area_addr_ptr = (unsigned long) sep_dev->shared_virtual_address;
/* set the physical address of the shared area */ /* set the physical address of the shared area */
*phys_shared_area_addr_ptr = sep_dev->shared_physical_address; *phys_shared_area_addr_ptr = sep_dev->shared_physical_address;
edbg( edbg("SEP Driver:shared_virtual_address is %p\n", sep_dev->shared_virtual_address);
"SEP Driver:shared_virtual_address is %p\n", edbg("SEP Driver:shared_region_size is %08lx\n", shared_area_size);
sep_dev->shared_virtual_address); edbg("SEP Driver:shared_physical_addr is %08lx\n", *phys_shared_area_addr_ptr);
edbg(
"SEP Driver:shared_region_size is %08lx\n",
shared_area_size);
edbg(
"SEP Driver:shared_physical_addr is %08lx\n",
*phys_shared_area_addr_ptr);
return 0; return 0;
} }
@@ -311,11 +270,9 @@ int sep_map_and_alloc_shared_area(unsigned long shared_area_size,
shared area,phys_shared_area_addr_ptr - the physical address of shared area,phys_shared_area_addr_ptr - the physical address of
the shared area the shared area
*/ */
void sep_unmap_and_free_shared_area(unsigned long shared_area_size, void sep_unmap_and_free_shared_area(unsigned long shared_area_size, unsigned long kernel_shared_area_addr, unsigned long phys_shared_area_addr)
unsigned long kernel_shared_area_addr,
unsigned long phys_shared_area_addr)
{ {
kfree((void *)kernel_shared_area_addr); kfree((void *) kernel_shared_area_addr);
return; return;
} }
@@ -327,16 +284,10 @@ void sep_unmap_and_free_shared_area(unsigned long shared_area_size,
*/ */
unsigned long sep_shared_area_virt_to_phys(unsigned long virt_address) unsigned long sep_shared_area_virt_to_phys(unsigned long virt_address)
{ {
edbg( edbg("SEP Driver:sh virt to phys v %08lx\n", virt_address);
"SEP Driver:sh virt to phys v %08lx\n", edbg("SEP Driver:sh virt to phys p %08lx\n", sep_dev->shared_physical_address + (virt_address - (unsigned long) sep_dev->shared_virtual_address));
virt_address);
edbg(
"SEP Driver:sh virt to phys p %08lx\n",
sep_dev->shared_physical_address
+ (virt_address - (unsigned long)sep_dev->shared_virtual_address));
return (unsigned long)sep_dev->shared_physical_address + return (unsigned long) sep_dev->shared_physical_address + (virt_address - (unsigned long) sep_dev->shared_virtual_address);
(virt_address - (unsigned long)sep_dev->shared_virtual_address);
} }
/* /*
@@ -347,16 +298,14 @@ unsigned long sep_shared_area_virt_to_phys(unsigned long virt_address)
*/ */
unsigned long sep_shared_area_phys_to_virt(unsigned long phys_address) unsigned long sep_shared_area_phys_to_virt(unsigned long phys_address)
{ {
return (unsigned long)sep_dev->shared_virtual_address return (unsigned long) sep_dev->shared_virtual_address + (phys_address - sep_dev->shared_physical_address);
+ (phys_address - sep_dev->shared_physical_address);
} }
/* /*
function that is activaed on the succesfull probe of the SEP device function that is activaed on the succesfull probe of the SEP device
*/ */
static int __devinit sep_probe(struct pci_dev *pdev, static int __devinit sep_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
const struct pci_device_id *ent)
{ {
/* error */ /* error */
int error; int error;
@@ -365,15 +314,13 @@ static int __devinit sep_probe(struct pci_dev *pdev,
CODE CODE
---------------------------*/ ---------------------------*/
edbg( edbg("Sep pci probe starting\n");
"Sep pci probe starting\n");
error = 0; error = 0;
/* enable the device */ /* enable the device */
error = pci_enable_device(pdev); error = pci_enable_device(pdev);
if (error) { if (error) {
edbg( edbg("error enabling pci device\n");
"error enabling pci device\n");
goto end_function; goto end_function;
} }
@@ -383,111 +330,83 @@ static int __devinit sep_probe(struct pci_dev *pdev,
/* get the io memory start address */ /* get the io memory start address */
sep_dev->io_memory_start_physical_address = pci_resource_start(pdev, 0); sep_dev->io_memory_start_physical_address = pci_resource_start(pdev, 0);
if (!sep_dev->io_memory_start_physical_address) { if (!sep_dev->io_memory_start_physical_address) {
edbg( edbg("SEP Driver error pci resource start\n");
"SEP Driver error pci resource start\n");
goto end_function; goto end_function;
} }
/* get the io memory end address */ /* get the io memory end address */
sep_dev->io_memory_end_physical_address = pci_resource_end(pdev, 0); sep_dev->io_memory_end_physical_address = pci_resource_end(pdev, 0);
if (!sep_dev->io_memory_end_physical_address) { if (!sep_dev->io_memory_end_physical_address) {
edbg( edbg("SEP Driver error pci resource end\n");
"SEP Driver error pci resource end\n");
goto end_function; goto end_function;
} }
sep_dev->io_memory_size = sep_dev->io_memory_end_physical_address - sep_dev->io_memory_size = sep_dev->io_memory_end_physical_address - sep_dev->io_memory_start_physical_address + 1;
sep_dev->io_memory_start_physical_address + 1;
edbg( edbg("SEP Driver:io_memory_start_physical_address is %08lx\n", sep_dev->io_memory_start_physical_address);
"SEP Driver:io_memory_start_physical_address is %08lx\n",
sep_dev->io_memory_start_physical_address);
edbg( edbg("SEP Driver:io_memory_end_phyaical_address is %08lx\n", sep_dev->io_memory_end_physical_address);
"SEP Driver:io_memory_end_phyaical_address is %08lx\n",
sep_dev->io_memory_end_physical_address);
edbg( edbg("SEP Driver:io_memory_size is %08lx\n", sep_dev->io_memory_size);
"SEP Driver:io_memory_size is %08lx\n",
sep_dev->io_memory_size);
sep_dev->io_memory_start_virtual_address = sep_dev->io_memory_start_virtual_address = ioremap_nocache(sep_dev->io_memory_start_physical_address, sep_dev->io_memory_size);
ioremap_nocache(sep_dev->io_memory_start_physical_address,
sep_dev->io_memory_size);
if (!sep_dev->io_memory_start_virtual_address) { if (!sep_dev->io_memory_start_virtual_address) {
edbg( edbg("SEP Driver error ioremap of io memory\n");
"SEP Driver error ioremap of io memory\n");
goto end_function; goto end_function;
} }
edbg( edbg("SEP Driver:io_memory_start_virtual_address is %p\n", sep_dev->io_memory_start_virtual_address);
"SEP Driver:io_memory_start_virtual_address is %p\n",
sep_dev->io_memory_start_virtual_address);
sep_dev->reg_base_address = (void __iomem *)sep_dev->io_memory_start_virtual_address; sep_dev->reg_base_address = (void __iomem *) sep_dev->io_memory_start_virtual_address;
/* set up system base address and shared memory location */ /* set up system base address and shared memory location */
sep_dev->rar_virtual_address = kmalloc(2 * SEP_RAR_IO_MEM_REGION_SIZE, sep_dev->rar_virtual_address = kmalloc(2 * SEP_RAR_IO_MEM_REGION_SIZE, GFP_KERNEL);
GFP_KERNEL);
if (!sep_dev->rar_virtual_address) { if (!sep_dev->rar_virtual_address) {
edbg( edbg("SEP Driver:cant kmalloc rar\n");
"SEP Driver:cant kmalloc rar\n");
goto end_function; goto end_function;
} }
/* FIXME */ /* FIXME */
sep_dev->rar_physical_address = __pa(sep_dev->rar_virtual_address); sep_dev->rar_physical_address = __pa(sep_dev->rar_virtual_address);
edbg( edbg("SEP Driver:rar_physical is %08lx\n", sep_dev->rar_physical_address);
"SEP Driver:rar_physical is %08lx\n",
sep_dev->rar_physical_address);
edbg( edbg("SEP Driver:rar_virtual is %p\n", sep_dev->rar_virtual_address);
"SEP Driver:rar_virtual is %p\n",
sep_dev->rar_virtual_address);
#if !SEP_DRIVER_POLLING_MODE #if !SEP_DRIVER_POLLING_MODE
edbg( edbg("SEP Driver: about to write IMR and ICR REG_ADDR\n");
"SEP Driver: about to write IMR and ICR REG_ADDR\n");
/* clear ICR register */ /* clear ICR register */
sep_write_reg(sep_dev, HW_HOST_ICR_REG_ADDR, sep_write_reg(sep_dev, HW_HOST_ICR_REG_ADDR, 0xFFFFFFFF);
0xFFFFFFFF);
/* set the IMR register - open only GPR 2 */ /* set the IMR register - open only GPR 2 */
sep_write_reg(sep_dev, HW_HOST_IMR_REG_ADDR, sep_write_reg(sep_dev, HW_HOST_IMR_REG_ADDR, (~(0x1 << 13)));
(~(0x1 << 13)));
/* figure out our irq */ /* figure out our irq */
/* FIXME: */ /* FIXME: */
error = pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, (u8 *)&sep_dev->sep_irq); error = pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, (u8 *) & sep_dev->sep_irq);
edbg( edbg("SEP Driver: my irq is %d\n", sep_irq);
"SEP Driver: my irq is %d\n", sep_irq);
edbg( edbg("SEP Driver: about to call request_irq\n");
"SEP Driver: about to call request_irq\n");
/* get the interrupt line */ /* get the interrupt line */
error = request_irq(sep_irq, sep_inthandler, IRQF_SHARED, error = request_irq(sep_irq, sep_inthandler, IRQF_SHARED, "sep_driver", &sep_dev->reg_base_address);
"sep_driver", &sep_dev->reg_base_address);
if (error) if (error)
goto end_function; goto end_function;
goto end_function; goto end_function;
edbg( edbg("SEP Driver: about to write IMR REG_ADDR");
"SEP Driver: about to write IMR REG_ADDR");
/* set the IMR register - open only GPR 2 */ /* set the IMR register - open only GPR 2 */
sep_write_reg(sep_dev, HW_HOST_IMR_REG_ADDR, sep_write_reg(sep_dev, HW_HOST_IMR_REG_ADDR, (~(0x1 << 13)));
(~(0x1 << 13)));
#endif /* SEP_DRIVER_POLLING_MODE */ #endif /* SEP_DRIVER_POLLING_MODE */
end_function: end_function:
return error; return error;
} }
@@ -515,26 +434,18 @@ void sep_load_rom_code(void)
/* Loading ROM from SEP_ROM_image.h file */ /* Loading ROM from SEP_ROM_image.h file */
k = sizeof(CRYS_SEP_ROM); k = sizeof(CRYS_SEP_ROM);
edbg( edbg("SEP Driver: DX_CC_TST_SepRomLoader start\n");
"SEP Driver: DX_CC_TST_SepRomLoader start\n");
edbg( edbg("SEP Driver: k is %lu\n", k);
"SEP Driver: k is %lu\n", k); edbg("SEP Driver: sep_dev->reg_base_address is %p\n", sep_dev->reg_base_address);
edbg( edbg("SEP Driver: CRYS_SEP_ROM_start_address_offset is %p\n", CRYS_SEP_ROM_start_address_offset);
"SEP Driver: sep_dev->reg_base_address is %p\n",
sep_dev->reg_base_address);
edbg(
"SEP Driver: CRYS_SEP_ROM_start_address_offset is %p\n",
CRYS_SEP_ROM_start_address_offset);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
/* write bank */ /* write bank */
sep_write_reg(sep_dev, SEP_ROM_BANK_register_offset, i); sep_write_reg(sep_dev, SEP_ROM_BANK_register_offset, i);
for (j = 0; j < CRYS_SEP_ROM_length / 4; j++) { for (j = 0; j < CRYS_SEP_ROM_length / 4; j++) {
sep_write_reg(sep_dev, sep_write_reg(sep_dev, CRYS_SEP_ROM_start_address_offset + 4 * j, CRYS_SEP_ROM[i * 0x1000 + j]);
CRYS_SEP_ROM_start_address_offset + 4*j,
CRYS_SEP_ROM[i * 0x1000 + j]);
k = k - 4; k = k - 4;
@@ -545,7 +456,7 @@ void sep_load_rom_code(void)
} }
} }
/* reset the SEP*/ /* reset the SEP */
sep_write_reg(sep_dev, HW_HOST_SEP_SW_RST_REG_ADDR, 0x1); sep_write_reg(sep_dev, HW_HOST_SEP_SW_RST_REG_ADDR, 0x1);
/* poll for SEP ROM boot finish */ /* poll for SEP ROM boot finish */
@@ -553,49 +464,41 @@ void sep_load_rom_code(void)
retVal = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR3_REG_ADDR); retVal = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR3_REG_ADDR);
} while (!regVal); } while (!regVal);
edbg( edbg("SEP Driver: ROM polling ended\n");
"SEP Driver: ROM polling ended\n");
switch (regVal) { switch (regVal) {
case 0x1: case 0x1:
/* fatal error - read erro status from GPRO */ /* fatal error - read erro status from GPRO */
Error = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); Error = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR);
edbg( edbg("SEP Driver: ROM polling case 1\n");
"SEP Driver: ROM polling case 1\n");
break; break;
case 0x2: case 0x2:
/* Boot First Phase ended */ /* Boot First Phase ended */
warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR);
edbg( edbg("SEP Driver: ROM polling case 2\n");
"SEP Driver: ROM polling case 2\n");
break; break;
case 0x4: case 0x4:
/* Cold boot ended successfully */ /* Cold boot ended successfully */
warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR);
edbg( edbg("SEP Driver: ROM polling case 4\n");
"SEP Driver: ROM polling case 4\n");
Error = 0; Error = 0;
break; break;
case 0x8: case 0x8:
/* Warmboot ended successfully */ /* Warmboot ended successfully */
warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR);
edbg( edbg("SEP Driver: ROM polling case 8\n");
"SEP Driver: ROM polling case 8\n");
Error = 0; Error = 0;
break; break;
case 0x10: case 0x10:
/* ColdWarm boot ended successfully */ /* ColdWarm boot ended successfully */
warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR); warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR);
edbg( edbg("SEP Driver: ROM polling case 16\n");
"SEP Driver: ROM polling case 16\n");
Error = 0; Error = 0;
break; break;
case 0x20: case 0x20:
edbg( edbg("SEP Driver: ROM polling case 32\n");
"SEP Driver: ROM polling case 32\n");
break; break;
} }
#endif #endif
} }

File diff suppressed because it is too large Load Diff