Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Aug 2005 17:55:21 +0000
From:      Vadim Chekan <vchekan@cox.net>
To:        current@FreeBSD.org
Subject:   Re: [Patch] Serial ATAPI is not recognized
Message-ID:  <42FCE289.4070901@cox.net>
In-Reply-To: <22CD48F3-747D-48EB-A5CF-633FB78BCA8D@FreeBSD.org>
References:  <42FBEA3A.5090809@cox.net> <22CD48F3-747D-48EB-A5CF-633FB78BCA8D@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



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