Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Nov 2007 20:42:39 +0100 (CET)
From:      Ed Schouten <ed@fxq.nl>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/118135: [Patch] ATA: Detect ATA controllers in MacBook3,1
Message-ID:  <20071119194239.27A3F1CCC6@palm.hoeg.nl>
Resent-Message-ID: <200711191950.lAJJo1XT065949@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         118135
>Category:       kern
>Synopsis:       [Patch] ATA: Detect ATA controllers in MacBook3,1
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 19 19:50:01 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Ed Schouten
>Release:        FreeBSD 6.3-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD mekker.fxq.nl 8.0-CURRENT FreeBSD 8.0-CURRENT #1: Mon Nov 19 20:18:07 CET 2007 root@mekker.fxq.nl:/usr/obj/usr/src/sys/MEKKER  amd64
>Description:
Yesterday I made a dual-boot install from my new Apple MacBook3,1 (the
ones that have been released last month).

Because the FreeBSD ATA code doesn't yet know the device ID's from the
ATA chipsets, it shows that the devices are using UDMA33, while they can
do better.

According to various sources (Linux kernel mailing list, etc), I
discovered that only one of them is using SATA (the one used by the
harddisk) and that one doesn't use AHCI. My guess is that the ATA
controller uses UDMA5 or 6. Just to be safe, I selected 5, but someone
else can probably solve this question better.
>How-To-Repeat:
>Fix:
This patch:

--- src/sys/dev/ata/ata-chipset.c	2007-11-19 20:10:24.000000000 +0100
+++ src/sys/dev/ata/ata-chipset.c	2007-11-19 20:34:51.000000000 +0100
@@ -1788,8 +1788,10 @@
      { ATA_I82801HB_R1,  0, AHCI, 0x00, ATA_SA300, "ICH8" },
      { ATA_I82801HB_AH4, 0, AHCI, 0x00, ATA_SA300, "ICH8" },
      { ATA_I82801HB_AH6, 0, AHCI, 0x00, ATA_SA300, "ICH8" },
-     { ATA_I82801HBM_S1, 0, AHCI, 0x00, ATA_SA300, "ICH8M" },
+     { ATA_I82801HBM_S1, 0,    0, 0x00, ATA_SA150, "ICH8M" },
      { ATA_I82801HBM_S2, 0, AHCI, 0x00, ATA_SA300, "ICH8M" },
+     { ATA_I82801HBM_S3, 0, AHCI, 0x00, ATA_SA300, "ICH8M" },
+     { ATA_I82801HBM,    0,    0, 0x00, ATA_UDMA5, "ICH8M" },
      { ATA_I82801IB_S1,  0, AHCI, 0x00, ATA_SA300, "ICH9" },
      { ATA_I82801IB_S2,  0, AHCI, 0x00, ATA_SA300, "ICH9" },
      { ATA_I82801IB_AH2, 0, AHCI, 0x00, ATA_SA300, "ICH9" },
--- src/sys/dev/ata/ata-pci.h	2007-11-19 20:10:24.000000000 +0100
+++ src/sys/dev/ata/ata-pci.h	2007-11-19 20:34:51.000000000 +0100
@@ -168,8 +168,10 @@
 #define ATA_I82801HB_R1         0x28228086
 #define ATA_I82801HB_AH4        0x28248086
 #define ATA_I82801HB_S2         0x28258086
-#define ATA_I82801HBM_S1        0x28298086
-#define ATA_I82801HBM_S2        0x282a8086
+#define ATA_I82801HBM_S1        0x28288086
+#define ATA_I82801HBM_S2        0x28298086
+#define ATA_I82801HBM_S3        0x282a8086
+#define ATA_I82801HBM           0x28508086
 #define ATA_I82801IB_S1         0x29208086
 #define ATA_I82801IB_AH2        0x29218086
 #define ATA_I82801IB_AH6        0x29228086

makes my ATA devices show up like this:

atapci0: <Intel ICH8M UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x30e0-0x30ef irq 21 at device 31.1 on pci0
ata0: <ATA channel 0> on atapci0
ata1: <ATA channel 1> on atapci0
atapci1: <Intel ICH8M SATA150 controller> port 0x30f8-0x30ff,0x311c-0x311f,0x30f0-0x30f7,0x3118-0x311b,0x3020-0x302f,0x4000-0x400f irq 18 at device 31.2 on pci0
ata2: <ATA channel 0> on atapci1
ata3: <ATA channel 1> on atapci1
acd0: DVDR <MATSHITADVD-R UJ-857E/ZF1E> at ata0-master UDMA66
ad0: 238475MB <FUJITSU MHY2250BH 0081000D> at ata2-master SATA150

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071119194239.27A3F1CCC6>