* AHCI driver with ASUS P5B
@ 2006-08-31 19:32 Mathias Jeschke
0 siblings, 0 replies; only message in thread
From: Mathias Jeschke @ 2006-08-31 19:32 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-ide
[-- Attachment #1.1: Type: text/plain, Size: 907 bytes --]
Hello Jeff,
first thank you for your great job on the AHCI linux kernel driver.
I have a problem with the detection of 2 of my 4 SATA ports on the
mainboard (a P5B one), since ASUS implemented the last two as port 4 and 5
(started by zero) - so port 2 and 3 are physically unused.
Your driver reads a value of "4" and initializes only the first 4 ports
and so ports 4 and 5 become unusable.
So I have a suggestion to support some boards with "incorrect" ports value
in the controller register:
Add an extra kernel parameter (e.g. "ahci=<nr_of_ports>") and override
these "autodetection" if such a kernel paramter is given.
I added a patch file, which implements this feature.
Regards,
Mathias
--
Mathias Jeschke
home: http://www.informatik.hu-berlin.de/~jeschke/
mail: jeschke@informatik.hu-berlin.de
gpg fingerprint: CF50 E22C 50F4 AF70 9628 7AB9 7E10 3A60 EAE5 4729
[-- Attachment #1.2: ahci-ports.patch --]
[-- Type: text/plain, Size: 1289 bytes --]
--- linux-2.6.17.11.orig/drivers/scsi/ahci.c 2006-08-31 12:54:06.000000000 +0200
+++ linux-2.6.17.11/drivers/scsi/ahci.c 2006-08-31 21:12:40.000000000 +0200
@@ -201,6 +201,7 @@
static u8 ahci_check_status(struct ata_port *ap);
static inline int ahci_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
static void ahci_remove_one (struct pci_dev *pdev);
+static u8 sata_phy_ports;
static struct scsi_host_template ahci_sht = {
.module = THIS_MODULE,
@@ -1015,7 +1016,8 @@
hpriv->cap = readl(mmio + HOST_CAP);
hpriv->port_map = readl(mmio + HOST_PORTS_IMPL);
- probe_ent->n_ports = (hpriv->cap & 0x1f) + 3;
+ probe_ent->n_ports = sata_phy_ports ? sata_phy_ports : (hpriv->cap & 0x1f) + 1;
+ dev_printk(KERN_INFO, &pdev->dev, "override autodetection, use kernel paramter: ports=%u\n", sata_phy_ports);
VPRINTK("cap 0x%x port_map 0x%x n_ports %d\n",
hpriv->cap, hpriv->port_map, probe_ent->n_ports);
@@ -1347,3 +1349,19 @@
module_init(ahci_init);
module_exit(ahci_exit);
+
+#if !defined(MODULE)
+static int __init ahci_setup(char *str)
+{
+ int ints[2];
+
+ get_options(str, ARRAY_SIZE(ints), ints);
+ if (ints[0] == 1)
+ sata_phy_ports = ints[1];
+
+ return 0;
+}
+
+__setup("ahci=", ahci_setup);
+#endif
+
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-08-31 19:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-31 19:32 AHCI driver with ASUS P5B Mathias Jeschke
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).