From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Tue, 18 Aug 2015 12:01:00 -0700 Subject: [U-Boot] [PATCH v2] arm/ls2085a: Add sata support on qds and rdb board In-Reply-To: <1439804538-47552-2-git-send-email-Yuantian.Tang@freescale.com> References: <1439804538-47552-1-git-send-email-Yuantian.Tang@freescale.com> <1439804538-47552-2-git-send-email-Yuantian.Tang@freescale.com> Message-ID: <55D380EC.8020409@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 08/17/2015 02:42 AM, Yuantian.Tang at freescale.com wrote: > From: Tang Yuantian > > Freescale ARM-based Layerscape LS2085A contain a SATA controller > which comply with the serial ATA 3.0 specification and the > AHCI 1.3 specification. > This patch adds SATA feature on ls2085aqds and ls2085ardb boards. > > Signed-off-by: Tang Yuantian > --- > v2: > - rebase to the latest git tree > > arch/arm/cpu/armv8/fsl-lsch3/soc.c | 41 +++++++++++++++++++++++ > arch/arm/include/asm/arch-fsl-lsch3/config.h | 20 +++++++++++ > arch/arm/include/asm/arch-fsl-lsch3/immap_lsch3.h | 25 ++++++++++++++ > arch/arm/include/asm/arch-fsl-lsch3/soc.h | 2 +- > board/freescale/ls2085aqds/ls2085aqds.c | 11 ++++++ > board/freescale/ls2085ardb/ls2085ardb.c | 11 ++++++ > 6 files changed, 109 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/cpu/armv8/fsl-lsch3/soc.c b/arch/arm/cpu/armv8/fsl-lsch3/soc.c > index 2538001..0e6f07b 100644 > --- a/arch/arm/cpu/armv8/fsl-lsch3/soc.c > +++ b/arch/arm/cpu/armv8/fsl-lsch3/soc.c > @@ -11,6 +11,9 @@ > #include > #include > #include > +#include > +#include > +#include > > DECLARE_GLOBAL_DATA_PTR; > > @@ -70,12 +73,50 @@ static void erratum_a009203(void) > #endif > } > > +void ls2085a_sata_init(void) > +{ > + struct ccsr_ahci __iomem *ahci_base; > + > + ahci_base = (void __iomem *)CONFIG_SYS_SATA2; > + out_le32(&ahci_base->ppcfg, 0xa003fffe); Please put a comment to explain what this does and avoid using magic numbers. > + > + ahci_base = (void __iomem *)CONFIG_SYS_SATA1; > + out_le32(&ahci_base->ppcfg, 0xa003fffe); Same here. York