From owner-freebsd-current@FreeBSD.ORG Sat Aug 13 00:54:58 2005 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 145C916A41F for ; Sat, 13 Aug 2005 00:54:58 +0000 (GMT) (envelope-from vchekan@cox.net) Received: from fed1rmmtao04.cox.net (fed1rmmtao04.cox.net [68.230.241.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFBD543D46 for ; Sat, 13 Aug 2005 00:54:57 +0000 (GMT) (envelope-from vchekan@cox.net) Received: from [192.168.0.10] (really [68.111.218.37]) by fed1rmmtao04.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050813005457.TNJB15197.fed1rmmtao04.cox.net@[192.168.0.10]> for ; Fri, 12 Aug 2005 20:54:57 -0400 Message-ID: <42FCE289.4070901@cox.net> Date: Fri, 12 Aug 2005 17:55:21 +0000 From: Vadim Chekan User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050808) X-Accept-Language: en-us, en MIME-Version: 1.0 To: current@FreeBSD.org References: <42FBEA3A.5090809@cox.net> <22CD48F3-747D-48EB-A5CF-633FB78BCA8D@FreeBSD.org> In-Reply-To: <22CD48F3-747D-48EB-A5CF-633FB78BCA8D@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: Subject: Re: [Patch] Serial ATAPI is not recognized X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2005 00:54:58 -0000 Søren Schmidt wrote: > > On 12/08/2005, at 2:15, Vadim Chekan wrote: > >> Hi all! >> >> I've bought a SATA dvd burner, Plextor PX-712-SA and found that >> FreeBSD 6 does not recognize it. But freebsd-5 does. After some time >> spent on investigation I found that it needs reset commad be issued >> before get ATAPI_MAGIC_LSB and ATAPI_MAGIC_MSB. >> >> In ata-chipset.c:ata_sata_connect() I put >> ATA_IDX_OUTB(ch, ATA_ALTSTAT, ATA_A_IDS | ATA_A_RESET); >> ata_udelay(10000); >> before >> if ((ATA_IDX_INB(ch, ATA_CYL_LSB) == ATAPI_MAGIC_LSB) && >> >> and it works now. At least I checked burncd in CDRW mode. It hungs >> or gives error at the end but produces valid CD. > > > SATA/ATAPI is not supported yet, and the above patch is by far not > enough for all systems to work. > In fact you are just lucky on your system, for the heck of it I tried > it here and my test system lost all its SATA disks :) > Support is in the works and will hit -current when its stable enough > for general usage.... > > - Søren > Then I'll be one of the first who check this support. Thanks for your job! BTW, I was a little bit puzzled by the code in ata-chipset.c:ata_achi_allocate() /* XXX SOS this is a hack to satisfy various legacy cruft */ ch->r_io[ATA_CYL_LSB].res = ctlr->r_res2; ch->r_io[ATA_CYL_LSB].offset = ATA_AHCI_P_SIG + 1 + offset; ch->r_io[ATA_CYL_LSB].res = ctlr->r_res2; ch->r_io[ATA_CYL_MSB].offset = ATA_AHCI_P_SIG + 3 + offset; If I understand the logic of the code correct, in the line before last should be ATA_CYL_MSB, not ATA_CYL_LSB. Looks like it's typo and ch->r_io[ATA_CYL_MSB].res is never initialized by this code. Neither I can find where it is initialized at all. But somehow it works !? Vadim.