Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
e01891ea
Commit
e01891ea
authored
Mar 12, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove debug code from AHCI driver
parent
0a055f61
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
6 additions
and
17046 deletions
+6
-17046
Makefile
src/drivers/ata/Makefile
+3
-3
ahci.c
src/drivers/ata/ahci.c
+0
-1476
ahci_elphel.c
src/drivers/ata/ahci_elphel.c
+3
-27
libahci.c
src/drivers/ata/libahci.c
+0
-3271
libahci_debug.c
src/drivers/ata/libahci_debug.c
+0
-1006
libahci_debug.h
src/drivers/ata/libahci_debug.h
+0
-137
libata-core.c
src/drivers/ata/libata-core.c
+0
-6959
libata-eh.c
src/drivers/ata/libata-eh.c
+0
-4167
No files found.
src/drivers/ata/Makefile
View file @
e01891ea
...
...
@@ -2,10 +2,10 @@
obj-$(CONFIG_ATA)
+=
libata.o
# non-SFF interface
obj-$(CONFIG_SATA_AHCI)
+=
ahci.o
libahci.o
libahci_debug.o
obj-$(CONFIG_SATA_AHCI)
+=
ahci.o
libahci.o
obj-$(CONFIG_SATA_ACARD_AHCI)
+=
acard-ahci.o
libahci.o
obj-$(CONFIG_SATA_AHCI_PLATFORM)
+=
ahci_platform.o
libahci.o
libahci_platform.o
libahci_debug.o
obj-$(CONFIG_AHCI_ELPHEL)
+=
ahci_elphel.o
libahci.o
libahci_platform.o
libahci_debug.o
obj-$(CONFIG_SATA_AHCI_PLATFORM)
+=
ahci_platform.o
libahci.o
libahci_platform.o
obj-$(CONFIG_AHCI_ELPHEL)
+=
ahci_elphel.o
libahci.o
libahci_platform.o
obj-$(CONFIG_SATA_FSL)
+=
sata_fsl.o
obj-$(CONFIG_SATA_INIC162X)
+=
sata_inic162x.o
obj-$(CONFIG_SATA_SIL24)
+=
sata_sil24.o
...
...
src/drivers/ata/ahci.c
deleted
100644 → 0
View file @
0a055f61
This diff is collapsed.
Click to expand it.
src/drivers/ata/ahci_elphel.c
View file @
e01891ea
...
...
@@ -24,7 +24,6 @@
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include "ahci.h"
#include "libahci_debug.h"
#define DRV_NAME "elphel-ahci"
...
...
@@ -32,10 +31,6 @@
#define PROP_NAME_CLB_OFFS "clb_offs"
#define PROP_NAME_FB_OFFS "fb_offs"
bool
crash_drv
=
false
;
module_param
(
crash_drv
,
bool
,
S_IRUGO
|
S_IWUSR
);
MODULE_PARM_DESC
(
sh_drv
,
"Set or reset crash driver flag"
);
static
struct
ata_port_operations
ahci_elphel_ops
;
static
const
struct
ata_port_info
ahci_elphel_port_info
;
static
struct
scsi_host_template
ahci_platform_sht
;
...
...
@@ -58,13 +53,7 @@ static int elphel_port_start(struct ata_port *ap)
struct
ahci_host_priv
*
hpriv
=
ap
->
host
->
private_data
;
const
struct
elphel_ahci_priv
*
dpriv
=
hpriv
->
plat_data
;
libahci_debug_init
(
ap
->
host
);
libahci_debug_crash_set
(
crash_drv
);
dev_dbg
(
dev
,
"starting port %d"
,
ap
->
port_no
);
#ifdef DEBUG_EVENT_ELPHEL
libahci_debug_wait_flag
();
#endif
pp
=
devm_kzalloc
(
dev
,
sizeof
(
struct
ahci_port_priv
),
GFP_KERNEL
);
if
(
!
pp
)
return
-
ENOMEM
;
...
...
@@ -94,10 +83,6 @@ static int elphel_port_start(struct ata_port *ap)
ap
->
private_data
=
pp
;
dev_dbg
(
dev
,
"flags (ATA_FLAG_xxx): %lu"
,
ap
->
flags
);
dev_dbg
(
dev
,
"pflags (ATA_PFLAG_xxx): %u"
,
ap
->
pflags
);
dev_dbg
(
dev
,
"ahci_elphel.c: Calling ahci_port_resume()"
);
return
ahci_port_resume
(
ap
);
}
...
...
@@ -167,17 +152,6 @@ static int elphel_drv_probe(struct platform_device *pdev)
hpriv
->
plat_data
=
dpriv
;
reg_val
=
readl
(
hpriv
->
mmio
+
HOST_CAP
);
dev_dbg
(
dev
,
"HOST CAP register: 0x%08x"
,
reg_val
);
reg_val
=
readl
(
hpriv
->
mmio
+
HOST_CTL
);
dev_dbg
(
dev
,
"HOST GHC register: 0x%08x"
,
reg_val
);
reg_val
=
readl
(
hpriv
->
mmio
+
HOST_IRQ_STAT
);
dev_dbg
(
dev
,
"HOST IS register: 0x%08x"
,
reg_val
);
reg_val
=
readl
(
hpriv
->
mmio
+
HOST_PORTS_IMPL
);
dev_dbg
(
dev
,
"HOST PI register: 0x%08x"
,
reg_val
);
reg_val
=
readl
(
hpriv
->
mmio
+
HOST_VERSION
);
dev_dbg
(
dev
,
"HOST VS register: 0x%08x"
,
reg_val
);
ret
=
ahci_platform_init_host
(
pdev
,
hpriv
,
&
ahci_elphel_port_info
,
&
ahci_platform_sht
);
if
(
ret
)
{
...
...
@@ -193,7 +167,6 @@ static int elphel_drv_remove(struct platform_device *pdev)
{
dev_info
(
&
pdev
->
dev
,
"removing Elphel AHCI driver"
);
ata_platform_remove_one
(
pdev
);
libahci_debug_exit
();
return
0
;
}
...
...
@@ -210,6 +183,9 @@ static void elphel_qc_prep(struct ata_queued_cmd *qc)
struct
scatterlist
*
sg
;
struct
ahci_sg
*
ahci_sg
;
/* There is only one slot in controller thus we need to change tag*/
qc
->
tag
=
0
;
/*
* Fill in command table information. First, the header,
* a SATA Register - Host to Device command FIS.
...
...
src/drivers/ata/libahci.c
deleted
100644 → 0
View file @
0a055f61
This diff is collapsed.
Click to expand it.
src/drivers/ata/libahci_debug.c
deleted
100644 → 0
View file @
0a055f61
This diff is collapsed.
Click to expand it.
src/drivers/ata/libahci_debug.h
deleted
100644 → 0
View file @
0a055f61
/*
* libahci_debug.h
*
* Created on: Jan 20, 2016
* Author: mk
*/
#include "ahci.h"
#ifndef _LIBAHCI_DEBUG_H_
#define _LIBAHCI_DEBUG_H_
#define ROOT_DIR_NAME "ahci_exp"
#define FILE_NAME_CFIS "cfis"
#define FILE_NAME_CHDR "chdr"
#define MARKER "++"
#define EVT_MARKER ">"
#define CMD_FIS_SZ 20
#define CMD_HDR_SZ 16
#define CMD_DMA_BUFSZ 512
#define PORT_RESERVED_2 40
#define PORT_VENDOR_BYTES 16
#define LIBAHCI_DEBUG_BUFSZ 16384
/* Total size of dump buffer in bytes*/
#define SEGMENT_SIZE 0x10000
/* The sizes below are in DWORDs*/
#define GHC_SZ 0x0B
#define PORT_REG_SZ 0x20
#define CLB_SZ 0x08
#define FIS_SZ 0x40
#define DUMP_LEN 0x240
/* The length of delimiter line in memory */
#define MARKER_LEN 0x10
/* Offset to the end of nearest 16 DWORD string */
#define ALIGN_OFFSET 0x0d
struct
libahci_debug_list
{
unsigned
int
debug
;
unsigned
int
port_n
;
char
*
libahci_debug_buf
;
int
head
;
int
tail
;
struct
list_head
node
;
struct
mutex
read_mutex
;
wait_queue_head_t
debug_wait
;
spinlock_t
debug_list_lock
;
};
struct
ahci_cmd_fis
{
__le32
dw0
;
__le32
dw1
;
__le32
dw2
;
__le32
dw3
;
__le32
dw4
;
};
struct
ahci_cmd
{
struct
ahci_cmd_hdr
hdr
;
struct
ahci_cmd_fis
fis
;
struct
scatterlist
sg
;
char
*
sg_buff
;
int
cmd_sent
;
};
struct
mem_buffer
{
volatile
u32
*
vaddr
;
dma_addr_t
paddr
;
ssize_t
size
;
};
struct
dump_record
{
u32
reg_ghc
[
GHC_SZ
];
u32
reg_port
[
PORT_REG_SZ
];
u32
reg_clb
[
CLB_SZ
];
u32
reg_fis
[
FIS_SZ
];
u32
cntr
;
};
// AHCI Port registers
struct
port_regs
{
// Port command list base address
u32
PxCLB
;
// Port command list based address upper 32-bits
u32
PxCLBU
;
// Port FIS base address
u32
PxFB
;
// Port FIS base address upper 32-bits
u32
PxFBU
;
u32
PxIS
;
u32
PxIE
;
u32
PxCMD
;
u32
reserved_1
;
u32
PxTFD
;
u32
PxSIG
;
u32
PxSSTS
;
u32
PxSCTL
;
u32
PxSERR
;
u32
PxSACT
;
u32
PxCI
;
u32
PxSNTF
;
u32
PxFBS
;
u32
PxDEVSLP
;
char
reserved_2
[
PORT_RESERVED_2
];
char
PxVS
[
PORT_VENDOR_BYTES
];
};
struct
host_regs
{
u32
CAP
;
u32
GHC
;
u32
IS
;
u32
PI
;
u32
VS
;
u32
CCC_CTL
;
u32
CCC_PORTS
;
u32
EM_LOC
;
u32
EM_CTL
;
u32
CAP2
;
u32
BOHC
;
};
int
libahci_debug_init
(
struct
ata_host
*
host
);
void
libahci_debug_exit
(
void
);
void
libahci_debug_event
(
const
struct
ata_port
*
port
,
char
*
msg
,
size_t
msg_sz
);
void
libahci_debug_dump_region
(
const
struct
ata_port
*
ap
,
const
u32
*
buf
,
size_t
buff_sz
,
const
char
*
prefix
);
void
libahci_debug_dump_irq
(
u32
status
);
void
libahci_debug_dump_sg
(
const
struct
ata_queued_cmd
*
qc
,
const
char
*
prefix
);
void
libahci_debug_irq_notify
(
const
struct
ata_port
*
ap
);
void
libahci_debug_exec_cmd
(
struct
ata_port
*
ap
);
void
libahci_debug_wait_flag
(
void
);
unsigned
int
libahci_debug_state_dump
(
struct
ata_port
*
ap
);
unsigned
int
libahci_debug_saxigp1_save
(
struct
ata_port
*
ap
,
size_t
dump_size
);
void
libahci_debug_crash_here
(
void
);
void
libahci_debug_crash_set
(
bool
val
);
void
libahci_debug_timestamp
(
cycles_t
start_c
,
cycles_t
end_c
,
unsigned
long
start_j
,
unsigned
long
end_j
,
u32
id
);
#endif
/* _LIBAHCI_DEBUG_H_ */
src/drivers/ata/libata-core.c
deleted
100644 → 0
View file @
0a055f61
This diff is collapsed.
Click to expand it.
src/drivers/ata/libata-eh.c
deleted
100644 → 0
View file @
0a055f61
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment