Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
2bcd866b
Commit
2bcd866b
authored
May 28, 2007
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[libata] ahci: Factor out SATA port init into a separate function
Signed-off-by:
Jeff Garzik
<
jeff@garzik.org
>
parent
79b0bde1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
20 deletions
+30
-20
drivers/ata/ahci.c
drivers/ata/ahci.c
+30
-20
No files found.
drivers/ata/ahci.c
View file @
2bcd866b
...
@@ -814,39 +814,49 @@ static int ahci_reset_controller(struct ata_host *host)
...
@@ -814,39 +814,49 @@ static int ahci_reset_controller(struct ata_host *host)
return
0
;
return
0
;
}
}
static
void
ahci_port_init
(
struct
pci_dev
*
pdev
,
struct
ata_port
*
ap
,
int
port_no
,
void
__iomem
*
mmio
,
void
__iomem
*
port_mmio
)
{
const
char
*
emsg
=
NULL
;
int
rc
;
u32
tmp
;
/* make sure port is not active */
rc
=
ahci_deinit_port
(
ap
,
&
emsg
);
if
(
rc
)
dev_printk
(
KERN_WARNING
,
&
pdev
->
dev
,
"%s (%d)
\n
"
,
emsg
,
rc
);
/* clear SError */
tmp
=
readl
(
port_mmio
+
PORT_SCR_ERR
);
VPRINTK
(
"PORT_SCR_ERR 0x%x
\n
"
,
tmp
);
writel
(
tmp
,
port_mmio
+
PORT_SCR_ERR
);
/* clear port IRQ */
tmp
=
readl
(
port_mmio
+
PORT_IRQ_STAT
);
VPRINTK
(
"PORT_IRQ_STAT 0x%x
\n
"
,
tmp
);
if
(
tmp
)
writel
(
tmp
,
port_mmio
+
PORT_IRQ_STAT
);
writel
(
1
<<
port_no
,
mmio
+
HOST_IRQ_STAT
);
}
static
void
ahci_init_controller
(
struct
ata_host
*
host
)
static
void
ahci_init_controller
(
struct
ata_host
*
host
)
{
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
host
->
dev
);
struct
pci_dev
*
pdev
=
to_pci_dev
(
host
->
dev
);
void
__iomem
*
mmio
=
host
->
iomap
[
AHCI_PCI_BAR
];
void
__iomem
*
mmio
=
host
->
iomap
[
AHCI_PCI_BAR
];
int
i
,
rc
;
int
i
;
u32
tmp
;
u32
tmp
;
for
(
i
=
0
;
i
<
host
->
n_ports
;
i
++
)
{
for
(
i
=
0
;
i
<
host
->
n_ports
;
i
++
)
{
struct
ata_port
*
ap
=
host
->
ports
[
i
];
struct
ata_port
*
ap
=
host
->
ports
[
i
];
void
__iomem
*
port_mmio
=
ahci_port_base
(
ap
);
void
__iomem
*
port_mmio
=
ahci_port_base
(
ap
);
const
char
*
emsg
=
NULL
;
if
(
ata_port_is_dummy
(
ap
))
if
(
ata_port_is_dummy
(
ap
))
continue
;
continue
;
/* make sure port is not active */
ahci_port_init
(
pdev
,
ap
,
i
,
mmio
,
port_mmio
);
rc
=
ahci_deinit_port
(
ap
,
&
emsg
);
if
(
rc
)
dev_printk
(
KERN_WARNING
,
&
pdev
->
dev
,
"%s (%d)
\n
"
,
emsg
,
rc
);
/* clear SError */
tmp
=
readl
(
port_mmio
+
PORT_SCR_ERR
);
VPRINTK
(
"PORT_SCR_ERR 0x%x
\n
"
,
tmp
);
writel
(
tmp
,
port_mmio
+
PORT_SCR_ERR
);
/* clear port IRQ */
tmp
=
readl
(
port_mmio
+
PORT_IRQ_STAT
);
VPRINTK
(
"PORT_IRQ_STAT 0x%x
\n
"
,
tmp
);
if
(
tmp
)
writel
(
tmp
,
port_mmio
+
PORT_IRQ_STAT
);
writel
(
1
<<
i
,
mmio
+
HOST_IRQ_STAT
);
}
}
tmp
=
readl
(
mmio
+
HOST_CTL
);
tmp
=
readl
(
mmio
+
HOST_CTL
);
...
...
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