From patchwork Wed Nov 6 20:37:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuseppe Pagano X-Patchwork-Id: 289042 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 4B4C12C0141 for ; Thu, 7 Nov 2013 09:40:01 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D9B2F4A34D; Wed, 6 Nov 2013 23:39:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P9UmGZlcYs9S; Wed, 6 Nov 2013 23:39:52 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9B4394A2E7; Wed, 6 Nov 2013 23:39:52 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 30CFC4A2FC for ; Wed, 6 Nov 2013 21:37:55 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w8BdGPDDA1wu for ; Wed, 6 Nov 2013 21:37:42 +0100 (CET) X-Greylist: delayed 397 seconds by postgrey-1.27 at theia; Wed, 06 Nov 2013 21:37:24 CET X-policyd-weight: SBL_XBL_SPAMHAUS=ERR(-1.5) NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from mail.seco.com (mail.seco.it [83.147.100.2]) by theia.denx.de (Postfix) with ESMTP id 1F7CA4A2F6 for ; Wed, 6 Nov 2013 21:37:24 +0100 (CET) Received: by mail.seco.com (Postfix, from userid 333) id 9F6E73150095; Wed, 6 Nov 2013 21:37:24 +0100 (CET) Received: from [192.168.1.2] (2-230-177-168.ip203.fastwebnet.it [2.230.177.168]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: giuseppe.pagano) by mail.seco.com (Postfix) with ESMTP id 6157D3150091; Wed, 6 Nov 2013 21:37:24 +0100 (CET) Message-ID: <1383770243.3741.22.camel@localhost> From: Giuseppe Pagano To: u-boot@lists.denx.de Date: Wed, 06 Nov 2013 21:37:23 +0100 Organization: Seco X-Mailer: Evolution 3.4.4-1 Mime-Version: 1.0 X-Mailman-Approved-At: Wed, 06 Nov 2013 23:39:51 +0100 Subject: [U-Boot] [PATCH 2/4] udoo: Add SATA disk support. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list Reply-To: giuseppe.pagano@seco.com List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Add Sata support on uDoo Board. Signed-off-by: Giuseppe Pagano Cc: sbabic@denx.de diff -uNr a/board/udoo/udoo.c b/board/udoo/udoo.c --- a/board/udoo/udoo.c 2013-11-06 18:45:22.000000000 +0100 +++ b/board/udoo/udoo.c 2013-11-06 18:46:00.000000000 +0100 @@ -208,6 +208,32 @@ return 0; } +#ifdef CONFIG_CMD_SATA +int setup_sata(void) +{ + struct iomuxc_base_regs *const iomuxc_regs + = (struct iomuxc_base_regs *)IOMUXC_BASE_ADDR; + + int ret = enable_sata_clock(); + if (ret) + return ret; + + clrsetbits_le32(&iomuxc_regs->gpr[13], + IOMUXC_GPR13_SATA_MASK, + IOMUXC_GPR13_SATA_PHY_8_RXEQ_3P0DB + |IOMUXC_GPR13_SATA_PHY_7_SATA2M + |IOMUXC_GPR13_SATA_SPEED_3G + |(3<bd->bi_boot_params = PHYS_SDRAM + 0x100; +#ifdef CONFIG_CMD_SATA + setup_sata(); +#endif return 0; } diff -uNr a/include/configs/udoo.h b/include/configs/udoo.h --- a/include/configs/udoo.h 2013-11-06 18:45:22.000000000 +0100 +++ b/include/configs/udoo.h 2013-11-06 18:46:27.000000000 +0100 @@ -34,6 +34,19 @@ #define CONFIG_MXC_UART #define CONFIG_MXC_UART_BASE UART2_BASE +#define CONFIG_CMD_SATA +/* + * SATA Configs + */ +#ifdef CONFIG_CMD_SATA +#define CONFIG_DWC_AHSATA +#define CONFIG_SYS_SATA_MAX_DEVICE 1 +#define CONFIG_DWC_AHSATA_PORT_ID 0 +#define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR +#define CONFIG_LBA48 +#define CONFIG_LIBATA +#endif + /* Network support */ #define CONFIG_CMD_PING