From: TOMARI Hisanobu <posco.grubb@gmail.com>
To: linuxppc-dev@ozlabs.org
Subject: IDE cable detection on Apple PowerBook
Date: Wed, 18 Mar 2009 14:06:38 +0900 [thread overview]
Message-ID: <20090318140638.e6b61eaa.posco.grubb@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1287 bytes --]
Hello,
I'm using an OCZ PATA SSD on Apple PowerBook5,4 computer.
The IDE drive fails to recognize 80-conductor cable that
connects the drive to motherboard to fall back to UDMA33.
This patch fixes this behavior by assuming that the cable is
short-40pin when the model string matches "PowerBook5" and
the motherboard detects 80c cable.
This patch is against drivers/ide/pmac.c in linux 2.6.28.8.
(before applying the patch) hdparm -i /dev/hda
/dev/hda:
Timing buffered disk reads: 90 MB in 3.03 seconds = 29.73 MB/sec
(dmesg 2.6.26)
ide0: Found Apple UniNorth ATA-6 controller, bus ID 3, irq 39
Probing IDE interface ide0...
hda: CORE_PATA, ATA DISK drive
hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
hda: drive side 80-wire cable detection failed, limiting max speed to UDMA33
hda: UDMA/33 mode selected
(after applying the patch) hdparm -i /dev/hda
/dev/hda:
Timing buffered disk reads: 240 MB in 3.02 seconds = 79.42 MB/sec
(dmesg 2.6.28.8)
ide-pmac: Found Apple UniNorth ATA-6 controller (PCI), bus ID 3, irq 39
Probing IDE interface ide0...
hda: CORE_PATA, ATA DISK drive
hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
hda: UDMA/100 mode selected
ide0 at 0xf102a000-0xf102a070,0xf102a160 on irq 39
--
TOMARI Hisanobu <posco.grubb@gmail.com>
[-- Attachment #2: ide-pmac-pbookcable.patch --]
[-- Type: text/x-diff, Size: 1254 bytes --]
*** linux-2.6.28.8/drivers/ide/pmac.c.orig 2009-03-18 13:59:39.645805773 +0900
--- linux-2.6.28.8/drivers/ide/pmac.c 2009-03-18 13:57:38.935818468 +0900
***************
*** 916,926 ****
pmac_ide_hwif_t *pmif =
(pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
struct device_node *np = pmif->node;
const char *cable = of_get_property(np, "cable-type", NULL);
/* Get cable type from device-tree. */
if (cable && !strncmp(cable, "80-", 3))
! return ATA_CBL_PATA80;
/*
* G5's seem to have incorrect cable type in device-tree.
--- 916,934 ----
pmac_ide_hwif_t *pmif =
(pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent);
struct device_node *np = pmif->node;
+ struct device_node *root = of_find_node_by_path("/");
const char *cable = of_get_property(np, "cable-type", NULL);
+ const char *model = of_get_property(root, "model", NULL);
/* Get cable type from device-tree. */
if (cable && !strncmp(cable, "80-", 3))
! {
! if(strncmp(model,"PowerBook5",10)==0)
! /* Some drives fail to detect 80c cable in PowerBook */
! return ATA_CBL_PATA40_SHORT;
! else
! return ATA_CBL_PATA80;
! }
/*
* G5's seem to have incorrect cable type in device-tree.
next reply other threads:[~2009-03-18 5:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-18 5:06 TOMARI Hisanobu [this message]
2009-03-18 7:58 ` IDE cable detection on Apple PowerBook Benjamin Herrenschmidt
2009-03-18 13:47 ` TOMARI Hisanobu
2009-03-19 6:07 ` Benjamin Herrenschmidt
2009-03-19 6:08 ` Benjamin Herrenschmidt
2009-03-19 13:30 ` TOMARI Hisanobu
2009-03-19 13:41 ` Anton Vorontsov
2009-03-19 21:14 ` Benjamin Herrenschmidt
2009-03-20 6:27 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090318140638.e6b61eaa.posco.grubb@gmail.com \
--to=posco.grubb@gmail.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).