From patchwork Wed Mar 8 08:28:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Raghavendra, Vignesh" X-Patchwork-Id: 736498 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3vdRWT0D9Rz9sDG for ; Wed, 8 Mar 2017 19:28:52 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="g1j2MmvJ"; dkim-atps=neutral Received: by lists.denx.de (Postfix, from userid 105) id 753A9C21C56; Wed, 8 Mar 2017 08:28:46 +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=T_DKIM_INVALID 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 2A027C21C41; Wed, 8 Mar 2017 08:28:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5D60EC21C41; Wed, 8 Mar 2017 08:28:42 +0000 (UTC) Received: from fllnx209.ext.ti.com (fllnx209.ext.ti.com [198.47.19.16]) by lists.denx.de (Postfix) with ESMTPS id B0E0CC21C33 for ; Wed, 8 Mar 2017 08:28:41 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v288SEBQ011184; Wed, 8 Mar 2017 02:28:14 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1488961694; bh=7J/Es005T6MeL1h/zimrU+nXyN+EpN/kNq57vwAqtnk=; h=From:To:CC:Subject:Date; b=g1j2MmvJcSQTIzfJ9PTqcY9UIidc6uPXgdZjpg4eSAZ46p8f6Ac13NC6tlu+7TFZl nxKM/oN89BUJm2TYwCZFO3edW5dBFQTVCyxRw192zrf9nZFG1VrdnLcNTJrSWdqmkD 8NEFEVhINZq1Mk0DBuxXwDeHWd7DJL24hxHTXXSY= Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v288S9V1030073; Wed, 8 Mar 2017 02:28:09 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Wed, 8 Mar 2017 02:28:08 -0600 Received: from a0132425.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v288S6fj032078; Wed, 8 Mar 2017 02:28:07 -0600 From: Vignesh R To: Lokesh Vutla , Tom Rini Date: Wed, 8 Mar 2017 13:58:17 +0530 Message-ID: <20170308082817.8796-1-vigneshr@ti.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2] ARM: keystone: Pass SPI MTD partition table via kernel command line 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" SPI U-Boot image for K2 boards have now exceeded 512K partition allocated to it and no longer fit the partitions defined in kernel DTS file. Therefore, pass an updated MTD partition table from U-Boot as kernel command line arguments to avoid kernel from accidentally modifying boot loader image that has overflowed to next user partition. To do is, introduce a common environment file for declaring SPI partition so that each individual boards need not repeat the same. Choose appropriate SPI bus from board config file and pass it as command line argument to kernel. Signed-off-by: Vignesh R --- v2: prefix KEYSTONE for definitions in include/environment/ti/spi.h include/configs/k2e_evm.h | 5 +++++ include/configs/k2g_evm.h | 3 +++ include/configs/k2hk_evm.h | 4 ++++ include/configs/k2l_evm.h | 4 ++++ include/configs/ti_armv7_keystone2.h | 7 ++++++- include/environment/ti/spi.h | 15 +++++++++++++++ 6 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 include/environment/ti/spi.h diff --git a/include/configs/k2e_evm.h b/include/configs/k2e_evm.h index 777f22540afb..3a7993e8290c 100644 --- a/include/configs/k2e_evm.h +++ b/include/configs/k2e_evm.h @@ -10,6 +10,8 @@ #ifndef __CONFIG_K2E_EVM_H #define __CONFIG_K2E_EVM_H +#include + /* Platform type */ #define CONFIG_SOC_K2E @@ -30,6 +32,9 @@ /* SPL SPI Loader Configuration */ #define CONFIG_SPL_TEXT_BASE 0x0c100000 + +#define SPI_MTD_PARTS KEYSTONE_SPI0_MTD_PARTS + /* NAND Configuration */ #define CONFIG_SYS_NAND_PAGE_2K diff --git a/include/configs/k2g_evm.h b/include/configs/k2g_evm.h index bd252312a20b..9e5949e3706b 100644 --- a/include/configs/k2g_evm.h +++ b/include/configs/k2g_evm.h @@ -10,6 +10,8 @@ #ifndef __CONFIG_K2G_EVM_H #define __CONFIG_K2G_EVM_H +#include + /* Platform type */ #define CONFIG_SOC_K2G @@ -76,4 +78,5 @@ #define CONFIG_BOUNCE_BUFFER #endif +#define SPI_MTD_PARTS KEYSTONE_SPI1_MTD_PARTS #endif /* __CONFIG_K2G_EVM_H */ diff --git a/include/configs/k2hk_evm.h b/include/configs/k2hk_evm.h index 4adb119b3066..202167bdef79 100644 --- a/include/configs/k2hk_evm.h +++ b/include/configs/k2hk_evm.h @@ -10,6 +10,8 @@ #ifndef __CONFIG_K2HK_EVM_H #define __CONFIG_K2HK_EVM_H +#include + /* Platform type */ #define CONFIG_SOC_K2HK @@ -30,6 +32,8 @@ /* SPL SPI Loader Configuration */ #define CONFIG_SPL_TEXT_BASE 0x0c200000 +#define SPI_MTD_PARTS KEYSTONE_SPI0_MTD_PARTS + /* NAND Configuration */ #define CONFIG_SYS_NAND_PAGE_2K diff --git a/include/configs/k2l_evm.h b/include/configs/k2l_evm.h index 9bdd56570be7..a7ccdd117cd2 100644 --- a/include/configs/k2l_evm.h +++ b/include/configs/k2l_evm.h @@ -10,6 +10,8 @@ #ifndef __CONFIG_K2L_EVM_H #define __CONFIG_K2L_EVM_H +#include + /* Platform type */ #define CONFIG_SOC_K2L @@ -30,6 +32,8 @@ /* SPL SPI Loader Configuration */ #define CONFIG_SPL_TEXT_BASE 0x0c100000 +#define SPI_MTD_PARTS KEYSTONE_SPI0_MTD_PARTS + /* NAND Configuration */ #define CONFIG_SYS_NAND_PAGE_4K diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h index 5d4ef58e5f1a..c48d7ba17a2d 100644 --- a/include/configs/ti_armv7_keystone2.h +++ b/include/configs/ti_armv7_keystone2.h @@ -213,6 +213,10 @@ /* EDMA3 */ #define CONFIG_TI_EDMA3 +#define KERNEL_MTD_PARTS \ + "mtdparts=" \ + SPI_MTD_PARTS + #define DEFAULT_FW_INITRAMFS_BOOT_ENV \ "name_fw_rd=k2-fw-initrd.cpio.gz\0" \ "set_rd_spec=setenv rd_spec ${rdaddr}:${filesize}\0" \ @@ -269,7 +273,8 @@ "sf write ${loadaddr} 0 ${filesize}\0" \ "burn_uboot_nand=nand erase 0 0x100000; " \ "nand write ${loadaddr} 0 ${filesize}\0" \ - "args_all=setenv bootargs console=ttyS0,115200n8 rootwait=1\0" \ + "args_all=setenv bootargs console=ttyS0,115200n8 rootwait=1 " \ + KERNEL_MTD_PARTS \ "args_net=setenv bootargs ${bootargs} rootfstype=nfs " \ "root=/dev/nfs rw nfsroot=${serverip}:${nfs_root}," \ "${nfs_options} ip=dhcp\0" \ diff --git a/include/environment/ti/spi.h b/include/environment/ti/spi.h new file mode 100644 index 000000000000..18c857c47dc9 --- /dev/null +++ b/include/environment/ti/spi.h @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com + * + * Environment variable definitions for SPI on TI boards. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef __TI_SPI_H +#define __TI_SPI_H + +#define KEYSTONE_SPI0_MTD_PARTS "spi0.0:1m(u-boot-spl)ro,-(misc);\0" +#define KEYSTONE_SPI1_MTD_PARTS "spi1.0:1m(u-boot-spl)ro,-(misc);\0" + +#endif