All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Gray <jsg@jsg.id.au>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] mx6cuboxi: Add support for sata
Date: Tue, 16 May 2017 15:50:38 +1000	[thread overview]
Message-ID: <20170516055038.GB28731@largo.jsg.id.au> (raw)
In-Reply-To: <20170515172446.1014-3-pbrobinson@gmail.com>

On Mon, May 15, 2017 at 06:24:46PM +0100, Peter Robinson wrote:
> The Cubox-i and Hummingboard series of devices have an option of
> SATA on board, and depending on how the fuses are blown even the
> option to boot SPL from SATA. So enable support for it so it can
> be used to boot the OS from if people desire.
> 
> Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
> ---
>  board/solidrun/mx6cuboxi/mx6cuboxi.c |  7 +++++++
>  configs/mx6cuboxi_defconfig          | 23 ++++++++++++-----------
>  include/configs/mx6cuboxi.h          | 11 +++++++++++
>  3 files changed, 30 insertions(+), 11 deletions(-)
> 
> diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
> index 285588d80a..59a78dfa6a 100644
> --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
> +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
> @@ -22,6 +22,7 @@
>  #include <linux/errno.h>
>  #include <asm/gpio.h>
>  #include <asm/imx-common/iomux-v3.h>
> +#include <asm/imx-common/sata.h>
>  #include <asm/imx-common/video.h>
>  #include <mmc.h>
>  #include <fsl_esdhc.h>
> @@ -314,6 +315,12 @@ int board_early_init_f(void)
>  	ret = setup_display();
>  #endif
>  
> +#ifdef CONFIG_CMD_SATA
> +	/* Only mx6q/mx6q has SATA */
> +	if (is_mx6dq())
> +		setup_sata();

Comment was intended to be mx6d/mx6q?

Though the test here may not be needed as setup_sata() returns early if
not available.  And mx6cuboxi.c wouldn't need to be updated here if a
i.MX 6DualPlus or i.MX 6QuadPlus board from SolidRun shows up at some
point in the future.

u-boot/arch/arm/imx-common/sata.c

int setup_sata(void)
{
	struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
	int ret;

	if (!is_mx6dq() && !is_mx6dqp())
		return 1;

> +#endif
> +
>  #ifdef CONFIG_USB_EHCI_MX6
>  	setup_usb();
>  #endif
> diff --git a/configs/mx6cuboxi_defconfig b/configs/mx6cuboxi_defconfig
> index c34beb74e2..ca5f5189f6 100644
> --- a/configs/mx6cuboxi_defconfig
> +++ b/configs/mx6cuboxi_defconfig
> @@ -1,30 +1,31 @@
>  CONFIG_ARM=y
>  CONFIG_ARCH_MX6=y
> +CONFIG_TARGET_MX6CUBOXI=y
> +CONFIG_SPL=y
> +CONFIG_SPL_EXT_SUPPORT=y
>  CONFIG_SPL_GPIO_SUPPORT=y
> +CONFIG_SPL_I2C_SUPPORT=y
>  CONFIG_SPL_LIBCOMMON_SUPPORT=y
> +CONFIG_SPL_LIBDISK_SUPPORT=y
>  CONFIG_SPL_LIBGENERIC_SUPPORT=y
> -CONFIG_TARGET_MX6CUBOXI=y
>  CONFIG_SPL_MMC_SUPPORT=y
> +# CONFIG_SPL_PARTITION_UUIDS is not set
>  CONFIG_SPL_SERIAL_SUPPORT=y
> -CONFIG_SPL_LIBDISK_SUPPORT=y
>  CONFIG_SPL_WATCHDOG_SUPPORT=y
> -# CONFIG_CMD_BMODE is not set
>  CONFIG_VIDEO=y
>  CONFIG_DISTRO_DEFAULTS=y
>  CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/imx-common/spl_sd.cfg,MX6QDL"
>  # CONFIG_SYS_STDIO_DEREGISTER is not set
>  CONFIG_BOARD_EARLY_INIT_F=y
> -CONFIG_SPL=y
> -CONFIG_SPL_EXT_SUPPORT=y
> -CONFIG_SPL_I2C_SUPPORT=y
> -# CONFIG_CMD_IMLS is not set
> +# CONFIG_CMD_BMODE is not set
> +CONFIG_CMD_CACHE=y
> +CONFIG_CMD_EXT4_WRITE=y
>  # CONFIG_CMD_FLASH is not set
> +CONFIG_CMD_GPIO=y
> +# CONFIG_CMD_IMLS is not set
>  CONFIG_CMD_MMC=y
> +CONFIG_CMD_SATA=y
>  CONFIG_CMD_USB=y
> -CONFIG_CMD_GPIO=y
> -CONFIG_CMD_CACHE=y
> -CONFIG_CMD_EXT4_WRITE=y
> -# CONFIG_SPL_PARTITION_UUIDS is not set
>  CONFIG_DM=y
>  CONFIG_DM_THERMAL=y
>  CONFIG_USB=y
> diff --git a/include/configs/mx6cuboxi.h b/include/configs/mx6cuboxi.h
> index 84fdf656cd..be071769fc 100644
> --- a/include/configs/mx6cuboxi.h
> +++ b/include/configs/mx6cuboxi.h
> @@ -21,6 +21,16 @@
>  /* MMC Configs */
>  #define CONFIG_SYS_FSL_ESDHC_ADDR	USDHC2_BASE_ADDR
>  
> +/* SATA Configuration */
> +#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
> +
>  /* Ethernet Configuration */
>  #define CONFIG_FEC_MXC
>  #define CONFIG_MII
> @@ -119,6 +129,7 @@
>  
>  #define BOOT_TARGET_DEVICES(func) \
>  	func(MMC, mmc, 0) \
> +	func(SATA, sata, 0) \
>  	func(USB, usb, 0) \
>  	func(PXE, pxe, na) \
>  	func(DHCP, dhcp, na)
> -- 
> 2.13.0
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

  reply	other threads:[~2017-05-16  5:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 17:24 [U-Boot] Cover CMD_SATA to Kconfig and add SATA support to CuBox-i Peter Robinson
2017-05-15 17:24 ` [U-Boot] [PATCH 1/2] Convert CONFIG_CMD_SATA to Kconfig Peter Robinson
2017-05-15 18:11   ` Tom Rini
2017-05-15 18:42     ` Peter Robinson
2017-05-15 17:24 ` [U-Boot] [PATCH 2/2] mx6cuboxi: Add support for sata Peter Robinson
2017-05-16  5:50   ` Jonathan Gray [this message]
2017-06-01 16:27     ` Fabio Estevam
     [not found]       ` <CALeDE9MkwXv0dy0beSQfUGywqoNTo30eRyeyRSMCWCdhYfHxaQ@mail.gmail.com>
2017-06-29 14:36         ` Fabio Estevam
2017-06-01 16:24   ` Fabio Estevam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170516055038.GB28731@largo.jsg.id.au \
    --to=jsg@jsg.id.au \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.