From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suneel Garapati Date: Tue, 29 Oct 2019 14:08:08 -0700 Subject: [U-Boot] [RFC PATCH 16/29] drivers: ata: ahci: fill upper 32bit buffer address in sg descriptor In-Reply-To: <20191029210821.1954-1-suneelglinux@gmail.com> References: <20191029210821.1954-1-suneelglinux@gmail.com> Message-ID: <20191029210821.1954-17-suneelglinux@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Suneel Garapati For platforms that support 64bit physical address, fill upper 32bit of buffer address in scatter-gather descriptor. This is needed for platforms with more than 4GB DRAM. Signed-off-by: Suneel Garapati --- drivers/ata/ahci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index ca075b58bc..5f929700c0 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -506,6 +506,11 @@ static int ahci_fill_sg(struct ahci_uc_priv *uc_priv, u8 port, ahci_sg->addr = cpu_to_le32((unsigned long) buf + i * MAX_DATA_BYTE_COUNT); ahci_sg->addr_hi = 0; +#ifdef CONFIG_PHYS_64BIT + ahci_sg->addr_hi = + cpu_to_le32((u32)(((u64)(buf + i * MAX_DATA_BYTE_COUNT) + >> 16) >> 16)); +#endif ahci_sg->flags_size = cpu_to_le32(0x3fffff & (buf_len < MAX_DATA_BYTE_COUNT ? (buf_len - 1) -- 2.23.0