From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tor Krill Date: Mon, 31 Mar 2008 09:10:43 +0000 (UTC) Subject: [U-Boot-Users] [PATCH] Merge code duplication in ata.h and libata.h In-Reply-To: <1206949069.3662.8.camel@localhost.localdomain> Message-ID: <0JEB3vTG.1206954643.2020790.tor@localhost> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 3/31/2008, "Dave Liu" wrote: >> >Don't do this. >> > >> >I don't think the ATA_SECT_BYTESIZE is better than >> >the ATA_SECT_SIZE. >> >> The big problem here is that ata.h defines ATA_SECT_SIZE as 256 Words >> where libata defines it as 512 Bytes. >> >> I did not want to change the old define since it would possibly break >> more than the fsl driver. > >When I grep 'ATA_SECT_SIZE', I can *not* find any files including the >ATA_SECT_SIZE before the fsl_sata.c. Well, the ata_piix driver for one uses it, but only includes ata.h. But that is the only one in the tree right now. >> But the problem still remains, it is currently impossible to use both >> libata.h and ata.h. > >Why need use both them? >I believe the libata.h is enough. Since my driver for the sil3114 uses "legacy mode" it uses a lot of the ata commands directly in PIO mode. These are defined in ata.h (Both in u-boot and Linux) >If the libata.h is not enough for you, I suggest you update it from the >latest linux kernel. Still, the kernel has both a ata.h and a libata.h, where libata.h includes ata.h. And where ATA_SECT_SIZE, and the other defines i use, actually is defined in ata.h albeit as 512 bytes :). >I think it is correct way to handle it. >It will be more easy to to maintain the header. I have no problem with either solution. If its ok to add the defines to libata.h instead i will do that? /Tor