From patchwork Thu May 28 12:08:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1321 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B01A63F077 for ; Thu, 28 May 2020 14:08:27 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id k21sf21906956pgn.14 for ; Thu, 28 May 2020 05:08:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1590667706; cv=pass; d=google.com; s=arc-20160816; b=kXeX+GH8xmCRX1v4iWpGn4ziE9VedADWy4leKdCluX6E0Cj3Zft8/o7BdhcjIWqpbi VG7hOsyodsF11q6ReJ9v5lnYuE2iw1xL+5rLOKhq69cJ2KLExQs3wQv8+0BTGzcNu+Xb qIP9lvbNZdov8tnbMEWbWKW0DehPhRKK9apUnE5s9LCliwqm9HIYlDsbwKUmgLT/USKE fW0fsLTrE4KgltVvJZhc28yACqbODpP5FqYgLIRu1xQtbSbcka1XoFLw+QilUCqoR7OK H8BXC/UYlyIE03P21TgBQBoTzvjWz4xmWVYDXT5GMbXunKzw/FkNhjXbS6RcsDmsGDcA OGgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=19g14p9EAnbJwKdnGX8Kh1eMmubYdIETBXZSrD60HxU=; b=zJ2NdwkoGHMx5WMN7AQrdialaxbz5bbclx8NcD/oS5DhaeQfpsgjFmLJPfvz4ffljQ UH/9+u5Dd5uE3MmtexZtp3/635JJ2WU2WOMtuc28Z696myqls9+6gYinaWtN7jT7H1z0 9wWHUykPwv6PtYWnRLK5s81adKZWYcloebdDb9V9togiIkIM+qZ4I2732X6yWLSWNR0W a+LgLbOjVk5FM8kx9/xODkgHAD9Hkmfe7YwQ/2Vj59QvkOEZf3YdPlqjjIs8s69UA//o pOJLjRahI2yNUJvMR9eh2hPEBcnLgc5HAoUyXuL9PJkfK0KFkoynRnug2z75FENrPUI7 fZbg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=dHTTA+1X; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=19g14p9EAnbJwKdnGX8Kh1eMmubYdIETBXZSrD60HxU=; b=BTqpxcV+ALoa/0zQR1WzdHibTYbbJeSBpmprydaSVl+m03VoUZZXoxdvPG7Ma+eM8H Zb/DAQdyf7C+cSbvyM4gCf2IuaDhZVzafqmYqeUuIqeOEwJD2NdbnJnBIEAzjNtuOsoz qb1yThXqaOJDQfxFmPB65JhOWQWVeE0LL9Eyw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=19g14p9EAnbJwKdnGX8Kh1eMmubYdIETBXZSrD60HxU=; b=c3/1o2VGy7I79BoojkGQSgrO6ttAMsAeN6LeiDLWtbt9fVHAbYHJstnWqynRs7nrKg 8U1PQuO3kegMuTfi31FjoiICh8ZLaTIsjpNiK6kZ7mVp4+YapkOKPkJqF5MeQoSW5/R0 K2yopFsHRPUC3rM79qIYJJkqiFOzU7XGWuvG/N/GM9YMw7KJSGUdxHOpxtYwWBCbzV8v 27M8n1YSrvTLpD5moL/hbSdVAl11F6vqVqi0M3MN3ymDKOy/Q2yA/3WjTl96QHsjmEbe ULwLdSumGyRfV/kMEc0oe5DCrVd2/+JSSvckSb60aAoPsPcv5eUnKtlDCDB3ncqnRmLm nvOw== X-Gm-Message-State: AOAM530pHqEPJy54Hy22x9BRppTkt3631hJttO3hYcNONOHInSxAOyFR z6y8L057hWaJxKfMZOdrI3BZkqp6 X-Google-Smtp-Source: ABdhPJzLlCxiov1j2y6ub5d8MZ+tIIeNQFtDbbqlDscq9A2pyPdrk6E9eCpnxD9dNwy2w6OViy4k7w== X-Received: by 2002:a63:fc1b:: with SMTP id j27mr2745668pgi.251.1590667705619; Thu, 28 May 2020 05:08:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:c086:: with SMTP id o6ls1032978pjs.0.canary-gmail; Thu, 28 May 2020 05:08:25 -0700 (PDT) X-Received: by 2002:a17:90a:5d06:: with SMTP id s6mr3633800pji.88.1590667705007; Thu, 28 May 2020 05:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590667705; cv=none; d=google.com; s=arc-20160816; b=L0pp/bn/yoC1/RgAzl3/9lYZr+a5Qv7f6/uhc2AmQaRrsWQMlPeLUbBBo7uESi39zb /j/FV48ok0iwHP78YdILH1dvl/Q6fvVqc17sH83QefKSpj2tvz+BcgPhIH+GmUP2AfqE R2QRdao94N+/mF6xdVZ9qGlLaU3ujF/HxKRgpJG/tGovdVkju0ZtrHZ+SGd+7ZgcqRmi k3wP00QtC+0xfAJoi5K8h8xmH1fvc9btvCCWCSmrYj7SyHC6/gV224KOQuOUgnyhYxOS 7FNuMhDXjPsMxykGSt6duL98/JIDhutPOMkdoACeeAExK3AI9ljcRc/NtKEb6UF2uB+s GmSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=eNKibGdeT//5d1shOztkC7D+cIU47UjWXE/kBzPy424=; b=TZDC8923Rhuvu1jFSLUFFtpTnBzw6+1ScPcKPlxestZ4vFXsl0jj13KMwWXpJpITRJ fPJ9NqmJdOJfZIkfaEvgSh3BJhQ2C/K8BNi3KjGfC6IqRzeyXcR9fiYi14BwSGpJVnPu yHWJCkkkoDGztR+Xfnrk4zuL3H1RD/AzQXPg/95QZSoA94msDeMyYyAtbKipFtfI8CsA 5Muy0uyFZi15adyDw0/zyyZNmF/CMlq8TPJmf2pKf2sEZ91kAH97FnVYoYI+dkLBZmm3 FCan3JEy2neoL9ZarqmeqYUzSyqvvrkdFKZf08jXYhug+hvdwlTHRHV3bWe63Zs5bKGJ IjNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=dHTTA+1X; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 1sor8262922ple.0.2020.05.28.05.08.24 for (Google Transport Security); Thu, 28 May 2020 05:08:24 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:7c03:: with SMTP id x3mr3264478pll.254.1590667703163; Thu, 28 May 2020 05:08:23 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:cddd:4147:aaf8:268a]) by smtp.gmail.com with ESMTPSA id l11sm5892839pjj.33.2020.05.28.05.08.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 05:08:22 -0700 (PDT) From: Jagan Teki To: linux-amarula@amarulasolutions.com Cc: Jagan Teki Subject: [PATCH] engicam: Add GEA-L i.MX6ULL Date: Thu, 28 May 2020 17:38:13 +0530 Message-Id: <20200528120813.22750-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=dHTTA+1X; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Signed-off-by: Jagan Teki --- arch/arm/mach-imx/mx6/Kconfig | 18 ++++++++++ board/engicam/common/board.c | 4 +++ board/engicam/common/spl.c | 23 ++++++++++--- board/engicam/imx6ull/Kconfig | 12 +++++++ board/engicam/imx6ull/MAINTAINERS | 19 +++++++++++ board/engicam/imx6ull/Makefile | 4 +++ board/engicam/imx6ull/README | 33 ++++++++++++++++++ board/engicam/imx6ull/imx6ull.c | 6 ++++ configs/imx6ull_geal_mmc_defconfig | 55 ++++++++++++++++++++++++++++++ 9 files changed, 170 insertions(+), 4 deletions(-) create mode 100644 board/engicam/imx6ull/Kconfig create mode 100644 board/engicam/imx6ull/MAINTAINERS create mode 100644 board/engicam/imx6ull/Makefile create mode 100644 board/engicam/imx6ull/README create mode 100644 board/engicam/imx6ull/imx6ull.c create mode 100644 configs/imx6ull_geal_mmc_defconfig diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig index fa6e1112e6..87a1255da2 100644 --- a/arch/arm/mach-imx/mx6/Kconfig +++ b/arch/arm/mach-imx/mx6/Kconfig @@ -452,6 +452,24 @@ config TARGET_MX6UL_ENGICAM select SUPPORT_SPL imply CMD_DM +config TARGET_MX6ULL_ENGICAM + bool "Support Engicam GEA-L MX6ULL" + select BOARD_LATE_INIT + select DM + select DM_GPIO + select DM_I2C + select DM_MMC + select DM_THERMAL + select MX6ULL + select MX6_DDRCAL + select OF_CONTROL + select SPL_DM if SPL + select SPL_OF_CONTROL if SPL + select SPL_PINCTRL if SPL + select SPL_SEPARATE_BSS if SPL + select SUPPORT_SPL + imply CMD_DM + config TARGET_MX6ULL_14X14_EVK bool "Support mx6ull_14x14_evk" select BOARD_LATE_INIT diff --git a/board/engicam/common/board.c b/board/engicam/common/board.c index 2907e2a8e5..c28d172542 100644 --- a/board/engicam/common/board.c +++ b/board/engicam/common/board.c @@ -62,6 +62,7 @@ static const char * const board_fdt_file[ENGICAM_BOARDS] = { [IMX6UL_GEAM] = "imx6ul-geam.dtb", [IMX6UL_ISIOT_EMMC] = "imx6ul-isiot-emmc.dtb", [IMX6UL_ISIOT_NAND] = "imx6ul-isiot-nand.dtb", + [IMX6UL_GEAL] = "imx6ull-geal.dtb", }; static int setenv_fdt_file(int board_detected) @@ -110,6 +111,9 @@ static enum engicam_boards engicam_board_detect(void) if (!strcmp(cmp_dtb, "imx6ul-isiot-nand")) return IMX6UL_ISIOT_NAND; + if (!strcmp(cmp_dtb, "imx6ull-geal")) + return IMX6ULL_GEAL; + return -EINVAL; } diff --git a/board/engicam/common/spl.c b/board/engicam/common/spl.c index 6a0612481a..f3ae1ebc4a 100644 --- a/board/engicam/common/spl.c +++ b/board/engicam/common/spl.c @@ -34,7 +34,7 @@ static iomux_v3_cfg_t const uart_pads[] = { #ifdef CONFIG_MX6QDL IOMUX_PADS(PAD_KEY_COL0__UART4_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)), IOMUX_PADS(PAD_KEY_ROW0__UART4_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)), -#elif CONFIG_MX6UL +#elif defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL) IOMUX_PADS(PAD_UART1_TX_DATA__UART1_DCE_TX | MUX_PAD_CTRL(UART_PAD_CTRL)), IOMUX_PADS(PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL)), #endif @@ -300,7 +300,7 @@ static struct mx6_ddr_sysinfo mem_s = { }; #endif /* CONFIG_MX6QDL */ -#ifdef CONFIG_MX6UL +#if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL) static struct mx6ul_iomux_grp_regs mx6_grp_ioregs = { .grp_addds = 0x00000030, .grp_ddrmode_ctl = 0x00020000, @@ -387,6 +387,14 @@ static void ccgr_init(void) writel(0xff00fffc, &ccm->CCGR4); writel(0x033f30ff, &ccm->CCGR5); writel(0x00c00fff, &ccm->CCGR6); +#elif defined(CONFIG_MX6ULL) + writel(0xffffffff, &ccm->CCGR0); + writel(0xffffffff, &ccm->CCGR1); + writel(0xffffffff, &ccm->CCGR2); + writel(0xffffffff, &ccm->CCGR3); + writel(0xffffffff, &ccm->CCGR4); + writel(0xffffffff, &ccm->CCGR5); + writel(0xffffffff, &ccm->CCGR6); #endif } @@ -403,9 +411,16 @@ static void spl_dram_init(void) mx6dq_dram_iocfg(64, &mx6dq_ddr_ioregs, &mx6dq_grp_ioregs); mx6_dram_cfg(&mem_q, &mx6dq_mmdc_calib, &mt41j256); } -#elif CONFIG_MX6UL +#elif CONFIG_MX6UL || CONFIG_MX6ULL mx6ul_dram_iocfg(mem_ddr.width, &mx6_ddr_ioregs, &mx6_grp_ioregs); mx6_dram_cfg(&ddr_sysinfo, &mx6_mmcd_calib, &mem_ddr); + +#ifdef CONFIG_MX6_DDRCAL: + /* Perform DDR DRAM calibration */ + udelay(100); + mmdc_do_write_level_calibration(&ddr_sysinfo); + mmdc_do_dqs_calibration(&ddr_sysinfo); +#endif #endif udelay(100); @@ -418,7 +433,7 @@ void board_init_f(ulong dummy) /* setup AIPS and disable watchdog */ arch_cpu_init(); - if (!(is_mx6ul())) + if (!(is_mx6ul() || is_mx6ull())) gpr_init(); /* iomux */ diff --git a/board/engicam/imx6ull/Kconfig b/board/engicam/imx6ull/Kconfig new file mode 100644 index 0000000000..af79ea225b --- /dev/null +++ b/board/engicam/imx6ull/Kconfig @@ -0,0 +1,12 @@ +if TARGET_MX6ULL_ENGICAM + +config SYS_BOARD + default "imx6ull" + +config SYS_VENDOR + default "engicam" + +config SYS_CONFIG_NAME + default "imx6-engicam" + +endif diff --git a/board/engicam/imx6ull/MAINTAINERS b/board/engicam/imx6ull/MAINTAINERS new file mode 100644 index 0000000000..915a595e97 --- /dev/null +++ b/board/engicam/imx6ull/MAINTAINERS @@ -0,0 +1,19 @@ +MX6ULL_ENGICAM BOARD +M: Jagan Teki +S: Maintained +F: board/engicam/imx6ul +F: include/configs/imx6-engicam.h +F: configs/imx6ul_geam_mmc_defconfig +F: configs/imx6ul_geam_nand_defconfig +F: configs/imx6ul_isiot_emmc_defconfig +F: configs/imx6ul_isiot_mmc_defconfig +F: configs/imx6ul_isiot_nand_defconfig +F: arch/arm/dts/imx6ul.dtsi +F: arch/arm/dts/imx6ul-u-boot.dtsi +F: arch/arm/dts/imx6ul-geam-kit.dts +F: arch/arm/dts/imx6ul-geam-kit-u-boot.dtsi +F: arch/arm/dts/imx6ul-isiot.dtsi +F: arch/arm/dts/imx6ul-isiot-u-boot.dtsi +F: arch/arm/dts/imx6ul-isiot-emmc.dts +F: arch/arm/dts/imx6ul-isiot-emmc-u-boot.dtsi +F: arch/arm/dts/imx6ul-isiot-nand.dts diff --git a/board/engicam/imx6ull/Makefile b/board/engicam/imx6ull/Makefile new file mode 100644 index 0000000000..da4c33773b --- /dev/null +++ b/board/engicam/imx6ull/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (C) 2016 Amarula Solutions B.V. + +obj-y := imx6ull.o diff --git a/board/engicam/imx6ull/README b/board/engicam/imx6ull/README new file mode 100644 index 0000000000..1e85f618f1 --- /dev/null +++ b/board/engicam/imx6ull/README @@ -0,0 +1,33 @@ +Hsow to use U-Boot on Engicam GEAM6UL and Is.IoT MX6UL Starter Kit: +------------------------------------------------------------------- + +$ make mrproper + +- Configure U-Boot for Engicam GEAM6UL: +$ make imx6ul_geam_mmc_defconfig + +- Configure U-Boot for Engicam Is.IoT MX6UL: +$ make imx6ul_isiot_mmc_defconfig + +- Build U-Boot +$ make + +This will generate the SPL image called SPL and the u-boot-dtb.img. + +- Flash the SPL image into the micro SD card: + +sudo dd if=SPL of=/dev/mmcblk0 bs=1k seek=1; sync + +- Flash the u-boot-dtb.img image into the micro SD card: + +sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 bs=1k seek=69; sync + +- Jumper settings: + +MMC Boot: JM3 Closed + +- Connect the Serial cable between the Starter Kit and the PC for the console. +(J28 is the Linux Serial console connector) + +- Insert the micro SD card in the board, power it up and U-Boot messages should +come up. diff --git a/board/engicam/imx6ull/imx6ull.c b/board/engicam/imx6ull/imx6ull.c new file mode 100644 index 0000000000..8a2e629dbe --- /dev/null +++ b/board/engicam/imx6ull/imx6ull.c @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2016 Amarula Solutions B.V. + * Copyright (C) 2016 Engicam S.r.l. + * Author: Jagan Teki + */ diff --git a/configs/imx6ull_geal_mmc_defconfig b/configs/imx6ull_geal_mmc_defconfig new file mode 100644 index 0000000000..144c3aa656 --- /dev/null +++ b/configs/imx6ull_geal_mmc_defconfig @@ -0,0 +1,55 @@ +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_ENV_SIZE=0x20000 +CONFIG_ENV_OFFSET=0x100000 +CONFIG_TARGET_MX6ULL_ENGICAM=y +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_NR_DRAM_BANKS=1 +CONFIG_SPL=y +CONFIG_SPL_LIBDISK_SUPPORT=y +# CONFIG_CMD_BMODE is not set +CONFIG_SPL_TEXT_BASE=0x00908000 +CONFIG_FIT=y +CONFIG_FIT_SIGNATURE=y +CONFIG_FIT_VERBOSE=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg" +CONFIG_BOOTDELAY=3 +CONFIG_SUPPORT_RAW_INITRD=y +CONFIG_BOUNCE_BUFFER=y +CONFIG_SPL_WATCHDOG_SUPPORT=y +CONFIG_HUSH_PARSER=y +CONFIG_SYS_PROMPT="geal6ull> " +CONFIG_CRC32_VERIFY=y +CONFIG_CMD_MEMTEST=y +CONFIG_SYS_MEMTEST_START=0x80000000 +CONFIG_SYS_MEMTEST_END=0x88000000 +CONFIG_CMD_GPIO=y +CONFIG_CMD_I2C=y +CONFIG_CMD_MMC=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_CACHE=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_DEFAULT_DEVICE_TREE="imx6ull-geal" +CONFIG_ENV_IS_IN_MMC=y +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SYS_I2C_MXC=y +CONFIG_FSL_USDHC=y +CONFIG_MTD=y +CONFIG_PHYLIB=y +CONFIG_PHY_SMSC=y +CONFIG_FEC_MXC=y +CONFIG_MII=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX6=y +CONFIG_MXC_UART=y +CONFIG_IMX_THERMAL=y