Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
0b46ff2e
Commit
0b46ff2e
authored
Oct 13, 2007
by
Benjamin Herrenschmidt
Committed by
Bartlomiej Zolnierkiewicz
Oct 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ide-pmac: fix PIO setup and enable autotune
Signed-off-by:
Bartlomiej Zolnierkiewicz
<
bzolnier@gmail.com
>
parent
254bb550
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
drivers/ide/ppc/pmac.c
drivers/ide/ppc/pmac.c
+12
-8
No files found.
drivers/ide/ppc/pmac.c
View file @
0b46ff2e
...
@@ -535,7 +535,7 @@ pmac_outbsync(ide_drive_t *drive, u8 value, unsigned long port)
...
@@ -535,7 +535,7 @@ pmac_outbsync(ide_drive_t *drive, u8 value, unsigned long port)
static
void
static
void
pmac_ide_set_pio_mode
(
ide_drive_t
*
drive
,
const
u8
pio
)
pmac_ide_set_pio_mode
(
ide_drive_t
*
drive
,
const
u8
pio
)
{
{
u32
*
timings
;
u32
*
timings
,
t
;
unsigned
accessTicks
,
recTicks
;
unsigned
accessTicks
,
recTicks
;
unsigned
accessTime
,
recTime
;
unsigned
accessTime
,
recTime
;
pmac_ide_hwif_t
*
pmif
=
(
pmac_ide_hwif_t
*
)
HWIF
(
drive
)
->
hwif_data
;
pmac_ide_hwif_t
*
pmif
=
(
pmac_ide_hwif_t
*
)
HWIF
(
drive
)
->
hwif_data
;
...
@@ -546,6 +546,7 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
...
@@ -546,6 +546,7 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
/* which drive is it ? */
/* which drive is it ? */
timings
=
&
pmif
->
timings
[
drive
->
select
.
b
.
unit
&
0x01
];
timings
=
&
pmif
->
timings
[
drive
->
select
.
b
.
unit
&
0x01
];
t
=
*
timings
;
cycle_time
=
ide_pio_cycle_time
(
drive
,
pio
);
cycle_time
=
ide_pio_cycle_time
(
drive
,
pio
);
...
@@ -553,14 +554,14 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
...
@@ -553,14 +554,14 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
case
controller_sh_ata6
:
{
case
controller_sh_ata6
:
{
/* 133Mhz cell */
/* 133Mhz cell */
u32
tr
=
kauai_lookup_timing
(
shasta_pio_timings
,
cycle_time
);
u32
tr
=
kauai_lookup_timing
(
shasta_pio_timings
,
cycle_time
);
*
timings
=
((
*
timings
)
&
~
TR_133_PIOREG_PIO_MASK
)
|
tr
;
t
=
(
t
&
~
TR_133_PIOREG_PIO_MASK
)
|
tr
;
break
;
break
;
}
}
case
controller_un_ata6
:
case
controller_un_ata6
:
case
controller_k2_ata6
:
{
case
controller_k2_ata6
:
{
/* 100Mhz cell */
/* 100Mhz cell */
u32
tr
=
kauai_lookup_timing
(
kauai_pio_timings
,
cycle_time
);
u32
tr
=
kauai_lookup_timing
(
kauai_pio_timings
,
cycle_time
);
*
timings
=
((
*
timings
)
&
~
TR_100_PIOREG_PIO_MASK
)
|
tr
;
t
=
(
t
&
~
TR_100_PIOREG_PIO_MASK
)
|
tr
;
break
;
break
;
}
}
case
controller_kl_ata4
:
case
controller_kl_ata4
:
...
@@ -574,9 +575,9 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
...
@@ -574,9 +575,9 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
accessTicks
=
min
(
accessTicks
,
0x1fU
);
accessTicks
=
min
(
accessTicks
,
0x1fU
);
recTicks
=
SYSCLK_TICKS_66
(
recTime
);
recTicks
=
SYSCLK_TICKS_66
(
recTime
);
recTicks
=
min
(
recTicks
,
0x1fU
);
recTicks
=
min
(
recTicks
,
0x1fU
);
*
timings
=
((
*
timings
)
&
~
TR_66_PIO_MASK
)
|
t
=
(
t
&
~
TR_66_PIO_MASK
)
|
(
accessTicks
<<
TR_66_PIO_ACCESS_SHIFT
)
|
(
accessTicks
<<
TR_66_PIO_ACCESS_SHIFT
)
|
(
recTicks
<<
TR_66_PIO_RECOVERY_SHIFT
);
(
recTicks
<<
TR_66_PIO_RECOVERY_SHIFT
);
break
;
break
;
default:
{
default:
{
/* 33Mhz cell */
/* 33Mhz cell */
...
@@ -596,11 +597,11 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
...
@@ -596,11 +597,11 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
recTicks
--
;
/* guess, but it's only for PIO0, so... */
recTicks
--
;
/* guess, but it's only for PIO0, so... */
ebit
=
1
;
ebit
=
1
;
}
}
*
timings
=
((
*
timings
)
&
~
TR_33_PIO_MASK
)
|
t
=
(
t
&
~
TR_33_PIO_MASK
)
|
(
accessTicks
<<
TR_33_PIO_ACCESS_SHIFT
)
|
(
accessTicks
<<
TR_33_PIO_ACCESS_SHIFT
)
|
(
recTicks
<<
TR_33_PIO_RECOVERY_SHIFT
);
(
recTicks
<<
TR_33_PIO_RECOVERY_SHIFT
);
if
(
ebit
)
if
(
ebit
)
*
timings
|=
TR_33_PIO_E
;
t
|=
TR_33_PIO_E
;
break
;
break
;
}
}
}
}
...
@@ -613,6 +614,7 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
...
@@ -613,6 +614,7 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
if
(
ide_config_drive_speed
(
drive
,
XFER_PIO_0
+
pio
))
if
(
ide_config_drive_speed
(
drive
,
XFER_PIO_0
+
pio
))
return
;
return
;
*
timings
=
t
;
pmac_ide_do_update_timings
(
drive
);
pmac_ide_do_update_timings
(
drive
);
}
}
...
@@ -1143,6 +1145,8 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
...
@@ -1143,6 +1145,8 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
hwif
->
cbl
=
pmif
->
cable_80
?
ATA_CBL_PATA80
:
ATA_CBL_PATA40
;
hwif
->
cbl
=
pmif
->
cable_80
?
ATA_CBL_PATA80
:
ATA_CBL_PATA40
;
hwif
->
drives
[
0
].
unmask
=
1
;
hwif
->
drives
[
0
].
unmask
=
1
;
hwif
->
drives
[
1
].
unmask
=
1
;
hwif
->
drives
[
1
].
unmask
=
1
;
hwif
->
drives
[
0
].
autotune
=
IDE_TUNE_AUTO
;
hwif
->
drives
[
1
].
autotune
=
IDE_TUNE_AUTO
;
hwif
->
host_flags
=
IDE_HFLAG_SET_PIO_MODE_KEEP_DMA
;
hwif
->
host_flags
=
IDE_HFLAG_SET_PIO_MODE_KEEP_DMA
;
hwif
->
pio_mask
=
ATA_PIO4
;
hwif
->
pio_mask
=
ATA_PIO4
;
hwif
->
set_pio_mode
=
pmac_ide_set_pio_mode
;
hwif
->
set_pio_mode
=
pmac_ide_set_pio_mode
;
...
...
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