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:
parent
46eb5a13b7
commit
d19cf32fdd
|
@ -126,4 +126,3 @@ static inline void sep_wait_sram_write(struct sep_device *dev)
|
|||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -478,26 +478,18 @@ void sep_send_msg_rdy_cmd(void);
|
|||
This function releases all the application virtual
|
||||
buffer physical pages, that were previously locked
|
||||
*/
|
||||
int sep_free_dma_pages(struct page **page_array_ptr,
|
||||
unsigned long num_pages,
|
||||
unsigned long dirtyFlag);
|
||||
int sep_free_dma_pages(struct page **page_array_ptr, unsigned long num_pages, unsigned long dirtyFlag);
|
||||
|
||||
/*
|
||||
This function creates the input and output dma tables for
|
||||
symmetric operations (AES/DES) according to the block size
|
||||
from LLI arays
|
||||
*/
|
||||
int sep_construct_dma_tables_from_lli(
|
||||
struct sep_lli_entry_t *lli_in_array,
|
||||
int sep_construct_dma_tables_from_lli(struct sep_lli_entry_t *lli_in_array,
|
||||
unsigned long sep_in_lli_entries,
|
||||
struct sep_lli_entry_t *lli_out_array,
|
||||
unsigned long sep_out_lli_entries,
|
||||
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 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);
|
||||
|
||||
/*
|
||||
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 data_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,
|
||||
bool isKernelVirtualAddress);
|
||||
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);
|
||||
|
||||
/*
|
||||
This function prepares only input DMA table for synhronic symmetric
|
||||
operations (HASH)
|
||||
*/
|
||||
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);
|
||||
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);
|
||||
|
||||
/* this functions frees all the resources that were allocated for the building
|
||||
of the LLI DMA tables */
|
||||
|
|
|
@ -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
|
||||
address
|
||||
*/
|
||||
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);
|
||||
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);
|
||||
|
||||
/*
|
||||
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
|
||||
phys_shared_area_addr_ptr - the physical address of the shared area
|
||||
*/
|
||||
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);
|
||||
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);
|
||||
|
||||
/*
|
||||
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
|
||||
address of the shared area
|
||||
*/
|
||||
void sep_unmap_and_free_shared_area(unsigned long shared_area_size,
|
||||
unsigned long kernel_shared_area_addr,
|
||||
unsigned long phys_shared_area_addr);
|
||||
void sep_unmap_and_free_shared_area(unsigned long shared_area_size, unsigned long kernel_shared_area_addr, unsigned long phys_shared_area_addr);
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -107,8 +107,7 @@ unsigned long jiffies_future;
|
|||
/*
|
||||
function that is activated on the succesfull probe of the SEP device
|
||||
*/
|
||||
static int __devinit sep_probe(struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent);
|
||||
static int __devinit sep_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
|
||||
|
||||
static struct pci_device_id sep_pci_id_tbl[] = {
|
||||
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x080c)},
|
||||
|
@ -141,12 +140,7 @@ void sep_lock_cache_resident_area(void)
|
|||
destination memory, which is external to Linux VM and is given as
|
||||
physical address
|
||||
*/
|
||||
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)
|
||||
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)
|
||||
{
|
||||
/* resident address in user space */
|
||||
unsigned long resident_addr;
|
||||
|
@ -167,12 +161,8 @@ int sep_copy_cache_resident_to_area(unsigned long src_cache_addr,
|
|||
-------------------------------------*/
|
||||
error = 0;
|
||||
|
||||
edbg(
|
||||
"SEP Driver:rar_virtual is %p\n",
|
||||
sep_dev->rar_virtual_address);
|
||||
edbg(
|
||||
"SEP Driver:rar_physical is %08lx\n",
|
||||
sep_dev->rar_physical_address);
|
||||
edbg("SEP Driver:rar_virtual is %p\n", 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;
|
||||
|
||||
|
@ -182,17 +172,12 @@ int sep_copy_cache_resident_to_area(unsigned long src_cache_addr,
|
|||
/* load cache */
|
||||
error = request_firmware(&fw, cache_name, &sep_dev->sep_pci_dev_ptr->dev);
|
||||
if (error) {
|
||||
edbg(
|
||||
"SEP Driver:cant request cache fw\n");
|
||||
edbg("SEP Driver:cant request cache fw\n");
|
||||
goto end_function;
|
||||
}
|
||||
|
||||
edbg(
|
||||
"SEP Driver:cache data loc is %p\n",
|
||||
(void *)fw->data);
|
||||
edbg(
|
||||
"SEP Driver:cache data size is %08Zx\n",
|
||||
fw->size);
|
||||
edbg("SEP Driver:cache data loc is %p\n", (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);
|
||||
|
||||
|
@ -202,25 +187,18 @@ int sep_copy_cache_resident_to_area(unsigned long src_cache_addr,
|
|||
|
||||
release_firmware(fw);
|
||||
|
||||
sep_dev->resident_physical_address = sep_dev->cache_physical_address
|
||||
+ sep_dev->cache_size;
|
||||
sep_dev->resident_virtual_address = sep_dev->cache_virtual_address
|
||||
+ sep_dev->cache_size;
|
||||
sep_dev->resident_physical_address = sep_dev->cache_physical_address + sep_dev->cache_size;
|
||||
sep_dev->resident_virtual_address = sep_dev->cache_virtual_address + sep_dev->cache_size;
|
||||
|
||||
/* load resident */
|
||||
error = request_firmware(&fw, res_name, &sep_dev->sep_pci_dev_ptr->dev);
|
||||
if (error) {
|
||||
edbg(
|
||||
"SEP Driver:cant request res fw\n");
|
||||
edbg("SEP Driver:cant request res fw\n");
|
||||
goto end_function;
|
||||
}
|
||||
|
||||
edbg(
|
||||
"SEP Driver:res data loc is %p\n",
|
||||
(void *)fw->data);
|
||||
edbg(
|
||||
"SEP Driver:res data size is %08Zx\n",
|
||||
fw->size);
|
||||
edbg("SEP Driver:res data loc is %p\n", (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);
|
||||
|
||||
|
@ -230,24 +208,14 @@ int sep_copy_cache_resident_to_area(unsigned long src_cache_addr,
|
|||
|
||||
resident_addr = (unsigned long) sep_dev->resident_virtual_address;
|
||||
|
||||
edbg(
|
||||
"SEP Driver:resident_addr (physical )is %08lx\n",
|
||||
sep_dev->resident_physical_address);
|
||||
edbg(
|
||||
"SEP Driver:cache_addr (physical) is %08lx\n",
|
||||
sep_dev->cache_physical_address);
|
||||
edbg("SEP Driver:resident_addr (physical )is %08lx\n", sep_dev->resident_physical_address);
|
||||
edbg("SEP Driver:cache_addr (physical) is %08lx\n", sep_dev->cache_physical_address);
|
||||
|
||||
edbg(
|
||||
"SEP Driver:resident_addr (logical )is %08lx\n",
|
||||
resident_addr);
|
||||
edbg(
|
||||
"SEP Driver:cache_addr (logical) is %08lx\n",
|
||||
cache_addr);
|
||||
edbg("SEP Driver:resident_addr (logical )is %08lx\n", resident_addr);
|
||||
edbg("SEP Driver:cache_addr (logical) is %08lx\n", cache_addr);
|
||||
|
||||
edbg(
|
||||
"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:resident_size is %08lx\n", sep_dev->resident_size);
|
||||
edbg("SEP Driver:cache_size is %08lx\n", sep_dev->cache_size);
|
||||
|
||||
|
||||
|
||||
|
@ -270,15 +238,12 @@ end_function:
|
|||
shared area, and phys_shared_area_addr_ptr
|
||||
- the physical address of the shared area
|
||||
*/
|
||||
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)
|
||||
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)
|
||||
{
|
||||
// shared_virtual_address = ioremap_nocache(0xda00000,shared_area_size);
|
||||
sep_dev->shared_virtual_address = kmalloc(shared_area_size, GFP_KERNEL);
|
||||
if (!sep_dev->shared_virtual_address) {
|
||||
edbg(
|
||||
"sep_driver:shared memory kmalloc failed\n");
|
||||
edbg("sep_driver:shared memory kmalloc failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -290,15 +255,9 @@ int sep_map_and_alloc_shared_area(unsigned long shared_area_size,
|
|||
/* set the physical address of the shared area */
|
||||
*phys_shared_area_addr_ptr = sep_dev->shared_physical_address;
|
||||
|
||||
edbg(
|
||||
"SEP Driver:shared_virtual_address is %p\n",
|
||||
sep_dev->shared_virtual_address);
|
||||
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);
|
||||
edbg("SEP Driver:shared_virtual_address is %p\n", sep_dev->shared_virtual_address);
|
||||
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;
|
||||
}
|
||||
|
@ -311,9 +270,7 @@ int sep_map_and_alloc_shared_area(unsigned long shared_area_size,
|
|||
shared area,phys_shared_area_addr_ptr - the physical address of
|
||||
the shared area
|
||||
*/
|
||||
void sep_unmap_and_free_shared_area(unsigned long shared_area_size,
|
||||
unsigned long kernel_shared_area_addr,
|
||||
unsigned long phys_shared_area_addr)
|
||||
void sep_unmap_and_free_shared_area(unsigned long shared_area_size, unsigned long kernel_shared_area_addr, unsigned long phys_shared_area_addr)
|
||||
{
|
||||
kfree((void *) kernel_shared_area_addr);
|
||||
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)
|
||||
{
|
||||
edbg(
|
||||
"SEP Driver:sh virt to phys v %08lx\n",
|
||||
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));
|
||||
edbg("SEP Driver:sh virt to phys v %08lx\n", 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 +
|
||||
(virt_address - (unsigned long)sep_dev->shared_virtual_address);
|
||||
return (unsigned long) sep_dev->shared_physical_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)
|
||||
{
|
||||
return (unsigned long)sep_dev->shared_virtual_address
|
||||
+ (phys_address - sep_dev->shared_physical_address);
|
||||
return (unsigned long) sep_dev->shared_virtual_address + (phys_address - sep_dev->shared_physical_address);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
function that is activaed on the succesfull probe of the SEP device
|
||||
*/
|
||||
static int __devinit sep_probe(struct pci_dev *pdev,
|
||||
const struct pci_device_id *ent)
|
||||
static int __devinit sep_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
{
|
||||
/* error */
|
||||
int error;
|
||||
|
@ -365,15 +314,13 @@ static int __devinit sep_probe(struct pci_dev *pdev,
|
|||
CODE
|
||||
---------------------------*/
|
||||
|
||||
edbg(
|
||||
"Sep pci probe starting\n");
|
||||
edbg("Sep pci probe starting\n");
|
||||
error = 0;
|
||||
|
||||
/* enable the device */
|
||||
error = pci_enable_device(pdev);
|
||||
if (error) {
|
||||
edbg(
|
||||
"error enabling pci device\n");
|
||||
edbg("error enabling pci device\n");
|
||||
goto end_function;
|
||||
}
|
||||
|
||||
|
@ -383,107 +330,79 @@ static int __devinit sep_probe(struct pci_dev *pdev,
|
|||
/* get the io memory start address */
|
||||
sep_dev->io_memory_start_physical_address = pci_resource_start(pdev, 0);
|
||||
if (!sep_dev->io_memory_start_physical_address) {
|
||||
edbg(
|
||||
"SEP Driver error pci resource start\n");
|
||||
edbg("SEP Driver error pci resource start\n");
|
||||
goto end_function;
|
||||
}
|
||||
|
||||
/* get the io memory end address */
|
||||
sep_dev->io_memory_end_physical_address = pci_resource_end(pdev, 0);
|
||||
if (!sep_dev->io_memory_end_physical_address) {
|
||||
edbg(
|
||||
"SEP Driver error pci resource end\n");
|
||||
edbg("SEP Driver error pci resource end\n");
|
||||
goto end_function;
|
||||
}
|
||||
|
||||
sep_dev->io_memory_size = sep_dev->io_memory_end_physical_address -
|
||||
sep_dev->io_memory_start_physical_address + 1;
|
||||
sep_dev->io_memory_size = sep_dev->io_memory_end_physical_address - sep_dev->io_memory_start_physical_address + 1;
|
||||
|
||||
edbg(
|
||||
"SEP Driver:io_memory_start_physical_address is %08lx\n",
|
||||
sep_dev->io_memory_start_physical_address);
|
||||
edbg("SEP Driver:io_memory_start_physical_address is %08lx\n", sep_dev->io_memory_start_physical_address);
|
||||
|
||||
edbg(
|
||||
"SEP Driver:io_memory_end_phyaical_address is %08lx\n",
|
||||
sep_dev->io_memory_end_physical_address);
|
||||
edbg("SEP Driver:io_memory_end_phyaical_address is %08lx\n", sep_dev->io_memory_end_physical_address);
|
||||
|
||||
edbg(
|
||||
"SEP Driver:io_memory_size is %08lx\n",
|
||||
sep_dev->io_memory_size);
|
||||
edbg("SEP Driver:io_memory_size is %08lx\n", sep_dev->io_memory_size);
|
||||
|
||||
sep_dev->io_memory_start_virtual_address =
|
||||
ioremap_nocache(sep_dev->io_memory_start_physical_address,
|
||||
sep_dev->io_memory_size);
|
||||
sep_dev->io_memory_start_virtual_address = ioremap_nocache(sep_dev->io_memory_start_physical_address, sep_dev->io_memory_size);
|
||||
if (!sep_dev->io_memory_start_virtual_address) {
|
||||
edbg(
|
||||
"SEP Driver error ioremap of io memory\n");
|
||||
edbg("SEP Driver error ioremap of io memory\n");
|
||||
goto end_function;
|
||||
}
|
||||
|
||||
edbg(
|
||||
"SEP Driver:io_memory_start_virtual_address is %p\n",
|
||||
sep_dev->io_memory_start_virtual_address);
|
||||
edbg("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;
|
||||
|
||||
|
||||
/* set up system base address and shared memory location */
|
||||
|
||||
sep_dev->rar_virtual_address = kmalloc(2 * SEP_RAR_IO_MEM_REGION_SIZE,
|
||||
GFP_KERNEL);
|
||||
sep_dev->rar_virtual_address = kmalloc(2 * SEP_RAR_IO_MEM_REGION_SIZE, GFP_KERNEL);
|
||||
|
||||
if (!sep_dev->rar_virtual_address) {
|
||||
edbg(
|
||||
"SEP Driver:cant kmalloc rar\n");
|
||||
edbg("SEP Driver:cant kmalloc rar\n");
|
||||
goto end_function;
|
||||
}
|
||||
/* FIXME */
|
||||
sep_dev->rar_physical_address = __pa(sep_dev->rar_virtual_address);
|
||||
|
||||
edbg(
|
||||
"SEP Driver:rar_physical is %08lx\n",
|
||||
sep_dev->rar_physical_address);
|
||||
edbg("SEP Driver:rar_physical is %08lx\n", sep_dev->rar_physical_address);
|
||||
|
||||
edbg(
|
||||
"SEP Driver:rar_virtual is %p\n",
|
||||
sep_dev->rar_virtual_address);
|
||||
edbg("SEP Driver:rar_virtual is %p\n", sep_dev->rar_virtual_address);
|
||||
|
||||
|
||||
#if !SEP_DRIVER_POLLING_MODE
|
||||
|
||||
edbg(
|
||||
"SEP Driver: about to write IMR and ICR REG_ADDR\n");
|
||||
edbg("SEP Driver: about to write IMR and ICR REG_ADDR\n");
|
||||
|
||||
/* clear ICR register */
|
||||
sep_write_reg(sep_dev, HW_HOST_ICR_REG_ADDR,
|
||||
0xFFFFFFFF);
|
||||
sep_write_reg(sep_dev, HW_HOST_ICR_REG_ADDR, 0xFFFFFFFF);
|
||||
|
||||
/* set the IMR register - open only GPR 2 */
|
||||
sep_write_reg(sep_dev, HW_HOST_IMR_REG_ADDR,
|
||||
(~(0x1 << 13)));
|
||||
sep_write_reg(sep_dev, HW_HOST_IMR_REG_ADDR, (~(0x1 << 13)));
|
||||
|
||||
/* figure out our irq */
|
||||
/* FIXME: */
|
||||
error = pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, (u8 *) & sep_dev->sep_irq);
|
||||
|
||||
edbg(
|
||||
"SEP Driver: my irq is %d\n", sep_irq);
|
||||
edbg("SEP Driver: my irq is %d\n", sep_irq);
|
||||
|
||||
edbg(
|
||||
"SEP Driver: about to call request_irq\n");
|
||||
edbg("SEP Driver: about to call request_irq\n");
|
||||
/* get the interrupt line */
|
||||
error = request_irq(sep_irq, sep_inthandler, IRQF_SHARED,
|
||||
"sep_driver", &sep_dev->reg_base_address);
|
||||
error = request_irq(sep_irq, sep_inthandler, IRQF_SHARED, "sep_driver", &sep_dev->reg_base_address);
|
||||
if (error)
|
||||
goto end_function;
|
||||
|
||||
goto end_function;
|
||||
edbg(
|
||||
"SEP Driver: about to write IMR REG_ADDR");
|
||||
edbg("SEP Driver: about to write IMR REG_ADDR");
|
||||
|
||||
/* set the IMR register - open only GPR 2 */
|
||||
sep_write_reg(sep_dev, HW_HOST_IMR_REG_ADDR,
|
||||
(~(0x1 << 13)));
|
||||
sep_write_reg(sep_dev, HW_HOST_IMR_REG_ADDR, (~(0x1 << 13)));
|
||||
|
||||
#endif /* SEP_DRIVER_POLLING_MODE */
|
||||
|
||||
|
@ -515,26 +434,18 @@ void sep_load_rom_code(void)
|
|||
/* Loading ROM from SEP_ROM_image.h file */
|
||||
k = sizeof(CRYS_SEP_ROM);
|
||||
|
||||
edbg(
|
||||
"SEP Driver: DX_CC_TST_SepRomLoader start\n");
|
||||
edbg("SEP Driver: DX_CC_TST_SepRomLoader start\n");
|
||||
|
||||
edbg(
|
||||
"SEP Driver: k is %lu\n", k);
|
||||
edbg(
|
||||
"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);
|
||||
edbg("SEP Driver: k is %lu\n", k);
|
||||
edbg("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++) {
|
||||
/* write bank */
|
||||
sep_write_reg(sep_dev, SEP_ROM_BANK_register_offset, i);
|
||||
|
||||
for (j = 0; j < CRYS_SEP_ROM_length / 4; j++) {
|
||||
sep_write_reg(sep_dev,
|
||||
CRYS_SEP_ROM_start_address_offset + 4*j,
|
||||
CRYS_SEP_ROM[i * 0x1000 + j]);
|
||||
sep_write_reg(sep_dev, CRYS_SEP_ROM_start_address_offset + 4 * j, CRYS_SEP_ROM[i * 0x1000 + j]);
|
||||
|
||||
k = k - 4;
|
||||
|
||||
|
@ -553,49 +464,41 @@ void sep_load_rom_code(void)
|
|||
retVal = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR3_REG_ADDR);
|
||||
} while (!regVal);
|
||||
|
||||
edbg(
|
||||
"SEP Driver: ROM polling ended\n");
|
||||
edbg("SEP Driver: ROM polling ended\n");
|
||||
|
||||
switch (regVal) {
|
||||
case 0x1:
|
||||
/* fatal error - read erro status from GPRO */
|
||||
Error = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR);
|
||||
edbg(
|
||||
"SEP Driver: ROM polling case 1\n");
|
||||
edbg("SEP Driver: ROM polling case 1\n");
|
||||
break;
|
||||
case 0x2:
|
||||
/* Boot First Phase ended */
|
||||
warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR);
|
||||
edbg(
|
||||
"SEP Driver: ROM polling case 2\n");
|
||||
edbg("SEP Driver: ROM polling case 2\n");
|
||||
break;
|
||||
case 0x4:
|
||||
/* Cold boot ended successfully */
|
||||
warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR);
|
||||
edbg(
|
||||
"SEP Driver: ROM polling case 4\n");
|
||||
edbg("SEP Driver: ROM polling case 4\n");
|
||||
Error = 0;
|
||||
break;
|
||||
case 0x8:
|
||||
/* Warmboot ended successfully */
|
||||
warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR);
|
||||
edbg(
|
||||
"SEP Driver: ROM polling case 8\n");
|
||||
edbg("SEP Driver: ROM polling case 8\n");
|
||||
Error = 0;
|
||||
break;
|
||||
case 0x10:
|
||||
/* ColdWarm boot ended successfully */
|
||||
warning = sep_read_reg(sep_dev, HW_HOST_SEP_HOST_GPR0_REG_ADDR);
|
||||
edbg(
|
||||
"SEP Driver: ROM polling case 16\n");
|
||||
edbg("SEP Driver: ROM polling case 16\n");
|
||||
Error = 0;
|
||||
break;
|
||||
case 0x20:
|
||||
edbg(
|
||||
"SEP Driver: ROM polling case 32\n");
|
||||
edbg("SEP Driver: ROM polling case 32\n");
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue