From patchwork Tue Apr 17 13:41:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?S=C3=A9bastien_Szymanski?= X-Patchwork-Id: 899282 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=armadeus.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40QR3F2Nfbz9s0x for ; Tue, 17 Apr 2018 23:31:05 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id F17EAC21DFA; Tue, 17 Apr 2018 13:31:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B39EEC21D56; Tue, 17 Apr 2018 13:30:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B4FD6C21D4A; Tue, 17 Apr 2018 13:30:57 +0000 (UTC) Received: from 1.mo173.mail-out.ovh.net (1.mo173.mail-out.ovh.net [178.33.111.180]) by lists.denx.de (Postfix) with ESMTPS id 5A166C21BE5 for ; Tue, 17 Apr 2018 13:30:57 +0000 (UTC) Received: from player756.ha.ovh.net (unknown [10.109.120.81]) by mo173.mail-out.ovh.net (Postfix) with ESMTP id E83CEBB2E6 for ; Tue, 17 Apr 2018 15:30:56 +0200 (CEST) Received: from localhost.localdomain (22.220.201.77.rev.sfr.net [77.201.220.22]) (Authenticated sender: sebastien.szymanski@armadeus.com) by player756.ha.ovh.net (Postfix) with ESMTPSA id 68D761200C9; Tue, 17 Apr 2018 15:30:52 +0200 (CEST) From: =?utf-8?q?S=C3=A9bastien_Szymanski?= To: u-boot@lists.denx.de Date: Tue, 17 Apr 2018 15:41:11 +0200 Message-Id: <20180417134112.13545-1-sebastien.szymanski@armadeus.com> X-Mailer: git-send-email 2.16.1 MIME-Version: 1.0 X-Ovh-Tracer-Id: 17802729330270622745 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtgedrjedtgdeivdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Cc: Fabio Estevam Subject: [U-Boot] [PATCH 1/2] imx6ul: opos6ul: add SPL_DM support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Since commit commit 152038ea1886 ("i.MX6UL: icore: Add SPL_OF_CONTROL support") the OPOS6UL board doesn't boot anymore. Adding SPL_DM support makes the board boot again. Fixes: commit 152038ea1886 ("i.MX6UL: icore: Add SPL_OF_CONTROL support") Signed-off-by: Sébastien Szymanski --- arch/arm/dts/imx6ul-opos6ul.dtsi | 4 ++- arch/arm/dts/imx6ul-opos6uldev.dts | 2 ++ arch/arm/dts/imx6ul.dtsi | 1 + arch/arm/include/asm/arch-mx6/opos6ul.h | 4 --- arch/arm/mach-imx/mx6/Kconfig | 4 +++ arch/arm/mach-imx/mx6/opos6ul.c | 50 ++++----------------------------- board/armadeus/opos6uldev/board.c | 20 +------------ configs/opos6uldev_defconfig | 5 ++++ include/configs/opos6uldev.h | 9 ++---- 9 files changed, 25 insertions(+), 74 deletions(-) diff --git a/arch/arm/dts/imx6ul-opos6ul.dtsi b/arch/arm/dts/imx6ul-opos6ul.dtsi index 51095df33a..d51ad4de20 100644 --- a/arch/arm/dts/imx6ul-opos6ul.dtsi +++ b/arch/arm/dts/imx6ul-opos6ul.dtsi @@ -1,5 +1,5 @@ /* - * Copyright 2017 Armadeus Systems + * Copyright 2018 Armadeus Systems * * This file is dual-licensed: you can use it either under the terms * of the GPL or the X11 license, at your option. Note that this dual @@ -99,6 +99,7 @@ /* eMMC */ &usdhc1 { + u-boot,dm-spl; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usdhc1>; bus-width = <8>; @@ -161,6 +162,7 @@ }; pinctrl_usdhc1: usdhc1grp { + u-boot,dm-spl; fsl,pins = < MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x17059 MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x10059 diff --git a/arch/arm/dts/imx6ul-opos6uldev.dts b/arch/arm/dts/imx6ul-opos6uldev.dts index 0e59ee57fd..9a51d1e54f 100644 --- a/arch/arm/dts/imx6ul-opos6uldev.dts +++ b/arch/arm/dts/imx6ul-opos6uldev.dts @@ -228,6 +228,7 @@ }; &uart1 { + u-boot,dm-spl; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>; status = "okay"; @@ -373,6 +374,7 @@ }; pinctrl_uart1: uart1grp { + u-boot,dm-spl; fsl,pins = < MX6UL_PAD_UART1_TX_DATA__UART1_DCE_TX 0x1b0b1 MX6UL_PAD_UART1_RX_DATA__UART1_DCE_RX 0x1b0b1 diff --git a/arch/arm/dts/imx6ul.dtsi b/arch/arm/dts/imx6ul.dtsi index b63f5a53ac..d5ce3f13c2 100644 --- a/arch/arm/dts/imx6ul.dtsi +++ b/arch/arm/dts/imx6ul.dtsi @@ -194,6 +194,7 @@ #size-cells = <1>; reg = <0x02000000 0x40000>; ranges; + u-boot,dm-spl; ecspi1: ecspi@02008000 { #address-cells = <1>; diff --git a/arch/arm/include/asm/arch-mx6/opos6ul.h b/arch/arm/include/asm/arch-mx6/opos6ul.h index b5363850d2..8adff67cea 100644 --- a/arch/arm/include/asm/arch-mx6/opos6ul.h +++ b/arch/arm/include/asm/arch-mx6/opos6ul.h @@ -9,8 +9,4 @@ int opos6ul_board_late_init(void); -#ifdef CONFIG_SPL_BUILD -void opos6ul_setup_uart_debug(void); -#endif - #endif diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig index aa6f5facbf..98ea1f566c 100644 --- a/arch/arm/mach-imx/mx6/Kconfig +++ b/arch/arm/mach-imx/mx6/Kconfig @@ -73,6 +73,10 @@ config MX6UL_OPOS6UL select DM_MMC select DM_THERMAL select SUPPORT_SPL + select SPL_DM if SPL + select SPL_OF_CONTROL if SPL + select SPL_SEPARATE_BSS if SPL + select SPL_PINCTRL if SPL config MX6ULL select SYS_L2CACHE_OFF diff --git a/arch/arm/mach-imx/mx6/opos6ul.c b/arch/arm/mach-imx/mx6/opos6ul.c index 2de1321b56..ef70a7d323 100644 --- a/arch/arm/mach-imx/mx6/opos6ul.c +++ b/arch/arm/mach-imx/mx6/opos6ul.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Armadeus Systems + * Copyright (C) 2018 Armadeus Systems * * SPDX-License-Identifier: GPL-2.0+ */ @@ -9,15 +9,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include -#include DECLARE_GLOBAL_DATA_PTR; @@ -138,12 +135,6 @@ int board_late_init(void) return opos6ul_board_late_init(); } -int board_mmc_getcd(struct mmc *mmc) -{ - struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; - return cfg->esdhc_base == USDHC1_BASE_ADDR; -} - int dram_init(void) { gd->ram_size = imx_ddr_size(); @@ -153,32 +144,9 @@ int dram_init(void) #ifdef CONFIG_SPL_BUILD #include -#include #include #include -#define USDHC_PAD_CTRL ( \ - PAD_CTL_HYS | PAD_CTL_PUS_47K_UP | PAD_CTL_SPEED_MED | \ - PAD_CTL_DSE_80ohm | PAD_CTL_SRE_FAST \ -) - -struct fsl_esdhc_cfg usdhc_cfg[1] = { - {USDHC1_BASE_ADDR, 0, 8}, -}; - -static iomux_v3_cfg_t const usdhc1_pads[] = { - MX6_PAD_SD1_CLK__USDHC1_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), - MX6_PAD_SD1_CMD__USDHC1_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), - MX6_PAD_SD1_DATA0__USDHC1_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), - MX6_PAD_SD1_DATA1__USDHC1_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), - MX6_PAD_SD1_DATA2__USDHC1_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), - MX6_PAD_SD1_DATA3__USDHC1_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), - MX6_PAD_NAND_READY_B__USDHC1_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL), - MX6_PAD_NAND_CE0_B__USDHC1_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL), - MX6_PAD_NAND_CE1_B__USDHC1_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL), - MX6_PAD_NAND_CLE__USDHC1_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL), -}; - static struct mx6ul_iomux_grp_regs mx6_grp_ioregs = { .grp_addds = 0x00000030, .grp_ddrmode_ctl = 0x00020000, @@ -240,13 +208,6 @@ static struct mx6_ddr3_cfg mem_ddr = { .trasmin = 3750, }; -int board_mmc_init(bd_t *bis) -{ - imx_iomux_v3_setup_multiple_pads(usdhc1_pads, ARRAY_SIZE(usdhc1_pads)); - usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK); - return fsl_esdhc_initialize(bis, &usdhc_cfg[0]); -} - static void ccgr_init(void) { struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; @@ -282,6 +243,11 @@ static void spl_dram_init(void) mx6_dram_cfg(&ddr_sysinfo, &mx6_mmcd_calib, &mem_ddr); } +void spl_board_init(void) +{ + preloader_console_init(); +} + void board_init_f(ulong dummy) { ccgr_init(); @@ -292,10 +258,6 @@ void board_init_f(ulong dummy) /* setup GP timer */ timer_init(); - /* UART clocks enabled and gd valid - init serial console */ - opos6ul_setup_uart_debug(); - preloader_console_init(); - /* DDR initialization */ spl_dram_init(); } diff --git a/board/armadeus/opos6uldev/board.c b/board/armadeus/opos6uldev/board.c index 646094aef4..a830dc326d 100644 --- a/board/armadeus/opos6uldev/board.c +++ b/board/armadeus/opos6uldev/board.c @@ -1,12 +1,11 @@ /* - * Copyright (C) 2017 Armadeus Systems + * Copyright (C) 2018 Armadeus Systems * * SPDX-License-Identifier: GPL-2.0+ */ #include #include -#include #include #include #include @@ -106,20 +105,3 @@ int opos6ul_board_late_init(void) return 0; } - -#ifdef CONFIG_SPL_BUILD -#define UART_PAD_CTRL ( \ - PAD_CTL_HYS | PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED | \ - PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST \ -) - -static iomux_v3_cfg_t const uart1_pads[] = { - MX6_PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL), - MX6_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL), -}; - -void opos6ul_setup_uart_debug(void) -{ - imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads)); -} -#endif /* CONFIG_SPL_BUILD */ diff --git a/configs/opos6uldev_defconfig b/configs/opos6uldev_defconfig index cff15a95cf..e3c056b9c9 100644 --- a/configs/opos6uldev_defconfig +++ b/configs/opos6uldev_defconfig @@ -1,8 +1,10 @@ CONFIG_ARM=y CONFIG_ARCH_MX6=y CONFIG_SYS_TEXT_BASE=0x87800000 +CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SPL_LIBCOMMON_SUPPORT=y CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_TARGET_OPOS6ULDEV=y CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y @@ -11,6 +13,8 @@ CONFIG_SPL_WATCHDOG_SUPPORT=y CONFIG_SPL=y # CONFIG_CMD_BMODE is not set CONFIG_DEFAULT_DEVICE_TREE="imx6ul-opos6uldev" +CONFIG_SPL_SYS_MALLOC_F_LEN=0x400 +CONFIG_TPL_SYS_MALLOC_F_LEN=0x400 CONFIG_BOOTDELAY=5 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttymxc0,115200" @@ -19,6 +23,7 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SUPPORT_RAW_INITRD=y CONFIG_DEFAULT_FDT_FILE="imx6ul-opos6uldev.dtb" CONFIG_VERSION_VARIABLE=y +CONFIG_SPL_BOARD_INIT=y CONFIG_SPL_ENV_SUPPORT=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_HUSH_PARSER=y diff --git a/include/configs/opos6uldev.h b/include/configs/opos6uldev.h index 24e1f80474..9e853f3d84 100644 --- a/include/configs/opos6uldev.h +++ b/include/configs/opos6uldev.h @@ -15,11 +15,7 @@ #include "imx6_spl.h" #ifdef CONFIG_SPL_BUILD -#undef CONFIG_DM_GPIO -#undef CONFIG_DM_MMC -#undef CONFIG_BLK - -#define CONFIG_MXC_UART_BASE UART1_BASE +#undef CONFIG_DM_REGULATOR #endif #endif @@ -40,7 +36,6 @@ (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) /* MMC */ -#define CONFIG_SYS_FSL_ESDHC_ADDR 0 #define CONFIG_SUPPORT_EMMC_BOOT /* USB */ @@ -61,6 +56,7 @@ #endif /* LCD */ +#ifndef CONFIG_SPL_BUILD #ifdef CONFIG_VIDEO #define CONFIG_VIDEO_LOGO #define CONFIG_SPLASH_SCREEN @@ -72,6 +68,7 @@ #define CONFIG_VIDEO_MXS #define MXS_LCDIF_BASE MX6UL_LCDIF1_BASE_ADDR #endif +#endif /* Environment is stored in the eMMC boot partition */ #define CONFIG_SYS_MMC_ENV_DEV 0 From patchwork Tue Apr 17 13:41:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?S=C3=A9bastien_Szymanski?= X-Patchwork-Id: 899283 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=armadeus.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40QR4Y2tbQz9s0W for ; Tue, 17 Apr 2018 23:32:13 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D16CEC21E0D; Tue, 17 Apr 2018 13:31:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9A66BC21E15; Tue, 17 Apr 2018 13:31:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5487CC21DA1; Tue, 17 Apr 2018 13:31:11 +0000 (UTC) Received: from 19.mo4.mail-out.ovh.net (19.mo4.mail-out.ovh.net [87.98.179.66]) by lists.denx.de (Postfix) with ESMTPS id 58EB4C21E08 for ; Tue, 17 Apr 2018 13:31:06 +0000 (UTC) Received: from player756.ha.ovh.net (unknown [10.109.122.29]) by mo4.mail-out.ovh.net (Postfix) with ESMTP id C0BF7160C9A for ; Tue, 17 Apr 2018 15:31:05 +0200 (CEST) Received: from localhost.localdomain (22.220.201.77.rev.sfr.net [77.201.220.22]) (Authenticated sender: sebastien.szymanski@armadeus.com) by player756.ha.ovh.net (Postfix) with ESMTPSA id 603DD1200C1; Tue, 17 Apr 2018 15:31:01 +0200 (CEST) From: =?utf-8?q?S=C3=A9bastien_Szymanski?= To: u-boot@lists.denx.de Date: Tue, 17 Apr 2018 15:41:12 +0200 Message-Id: <20180417134112.13545-2-sebastien.szymanski@armadeus.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180417134112.13545-1-sebastien.szymanski@armadeus.com> References: <20180417134112.13545-1-sebastien.szymanski@armadeus.com> MIME-Version: 1.0 X-Ovh-Tracer-Id: 17805262604791862297 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtgedrjedtgdeivdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Cc: Fabio Estevam Subject: [U-Boot] [PATCH 2/2] imx6ul: opos6ul: in Serial Downloader boot mode use ymodem X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Signed-off-by: Sébastien Szymanski --- arch/arm/mach-imx/mx6/opos6ul.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/mach-imx/mx6/opos6ul.c b/arch/arm/mach-imx/mx6/opos6ul.c index ef70a7d323..5d39c0bc1b 100644 --- a/arch/arm/mach-imx/mx6/opos6ul.c +++ b/arch/arm/mach-imx/mx6/opos6ul.c @@ -208,6 +208,16 @@ static struct mx6_ddr3_cfg mem_ddr = { .trasmin = 3750, }; +void board_boot_order(u32 *spl_boot_list) +{ + unsigned int bmode = readl(&src_base->sbmr2); + + if (((bmode >> 24) & 0x03) == 0x01) /* Serial Downloader */ + spl_boot_list[0] = BOOT_DEVICE_UART; + else + spl_boot_list[0] = spl_boot_device(); +} + static void ccgr_init(void) { struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;