From patchwork Wed Jan 6 15:31:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gireesh Hiremath X-Patchwork-Id: 1422978 X-Patchwork-Delegate: lokeshvutla@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=in.bosch.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=in.bosch.com header.i=@in.bosch.com header.a=rsa-sha256 header.s=key2-intmail header.b=E7w+dmjF; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D9vbW1MdGz9sVw for ; Thu, 7 Jan 2021 03:15:19 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 49733826F8; Wed, 6 Jan 2021 17:14:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=reject dis=none) header.from=in.bosch.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=in.bosch.com header.i=@in.bosch.com header.b="E7w+dmjF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7F15F826CA; Wed, 6 Jan 2021 16:31:32 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from de-out1.bosch-org.com (de-out1.bosch-org.com [139.15.230.186]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E8F4B825C4 for ; Wed, 6 Jan 2021 16:31:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=in.bosch.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Gireesh.Hiremath@in.bosch.com Received: from fe0vm1650.rbesz01.com (lb41g3-ha-dmz-psi-sl1-mailout.fe.ssn.bosch.com [139.15.230.188]) by si0vms0216.rbdmz01.com (Postfix) with ESMTPS id 4D9tcx59BJz1XLGSf; Wed, 6 Jan 2021 16:31:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=in.bosch.com; s=key2-intmail; t=1609947089; bh=gq2Ck270obJGl6y6d8N7JYzJ2PqZVIFLUNaW+cYJTfU=; l=10; h=From:Subject:From:Reply-To:Sender; b=E7w+dmjFM0GYbB+XNmL0VCoeSvjjUIUBv9xsiJNt1nmdxpbNKqT3p9CP7fSHDNUkz qtOdgmBOrEwgBgtS/Jm2pxcDVxGikugwTjjgEcnQBD+4HVXnHSingjHzerfbmMwRZf oUGOWEJYhgb50oF8GehJLM1069Dv6s5hBRLELnLQ= Received: from fe0vm7918.rbesz01.com (unknown [10.58.172.176]) by fe0vm1650.rbesz01.com (Postfix) with ESMTPS id 4D9tcx4j1hz1y9; Wed, 6 Jan 2021 16:31:29 +0100 (CET) X-AuditID: 0a3aad10-b0bff70000002230-fd-5ff5d7d19122 Received: from si0vm1949.rbesz01.com ( [10.58.173.29]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by fe0vm7918.rbesz01.com (SMG Outbound) with SMTP id 12.06.08752.1D7D5FF5; Wed, 6 Jan 2021 16:31:29 +0100 (CET) Received: from FE-HUB2000.de.bosch.com (fe-hub2000.de.bosch.com [10.4.103.109]) by si0vm1949.rbesz01.com (Postfix) with ESMTPS id 4D9tcx3sfDz6CjZNx; Wed, 6 Jan 2021 16:31:29 +0100 (CET) Received: from localhost.localdomain (10.142.201.46) by FE-HUB2000.de.bosch.com (10.4.103.109) with Microsoft SMTP Server id 15.1.2106.2; Wed, 6 Jan 2021 16:31:27 +0100 From: To: , , CC: , , Subject: [PATCH] am335x, guardian: mem: Add board dependent mem values Date: Wed, 6 Jan 2021 15:31:15 +0000 Message-ID: <20210106153115.2680-1-Gireesh.Hiremath@in.bosch.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.142.201.46] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKLMWRmVeSWpSXmKPExsXCZbVWVvfi9a/xBr87VC2mH3/LajF10mZ2 i7d7O9kdmD3+Pr/O4vHqwCp2j7N3djAGMEdx2aSk5mSWpRbp2yVwZbz5epet4Ihixes7n9ka GCfIdDFyckgImEi8vvCUtYuRi0NIYDqTxKV/K1kgnH2MEjOf7IJy1jBKPOzZz9zFyMHBJqAq sXphDYgpIhAssfqIGsggZoECiX1XTzGD2MICbhL3D34Cs1kEVCTuv+xhBbF5BRwlFv67xg6x WF7ifO86doi4oMTJmU9YIObISzRvnc0MYUtIHHzxghmiXlHiz/GVjBMY+WchaZmFpGUWkpYF jMyrGEXTUg3Kcs0tDS30ipJSi6sMDPWS83M3MUJCUmAH4+3uD3qHGJk4GA8xSnAwK4nwWhz7 Ei/Em5JYWZValB9fVJqTWnyIUZqDRUmcV4VnY5yQQHpiSWp2ampBahFMlomDU6qBSUfT6MWO 409+vj8qG1r+yzpYTPC92FexC1IqvN9OiXqd+H7uTJtio7yppUK/SkU/U+GWrTVaV31/9Cg9 KtYS5kzgO/zsBFd0y2LGq3PcQs/u+3Lpm3DF64SC1pWV1czuyW8cFEv7uzTyvI6u0ov+yc0Q LP3arMNz3alE+4kJp4S+yASpq/2JvnV4/dKu9Vq3/669sZPRNYe7bNFfmbbCLMVI+b8PXl14 M6n94IvO2XLRKbVpuyQt567t3fmK06ojzZRTkMuL7Z7P4/Q1BuufV2tESx9f9rlryd0vvpUT J7YFvFsdn1O6a95mI57vbuUvPiXdefeBfYHMpqgdfycv+VQVNP8bi8h0u6CpOzeGKLEUZyQa ajEXFScCAEBqVqG4AgAA X-Mailman-Approved-At: Wed, 06 Jan 2021 17:14:49 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean From: Moses Christopher - Add mem-guardian.h derived from am33xx/mem.h * Add GPMC config values optimized for Bosch Guardian Board * NAND Chip used by Bosch Guardian Board is Micron MT29F4G08ABBFA Signed-off-by: Moses Christopher --- .../include/asm/arch-am33xx/mem-guardian.h | 63 +++++++++++++++++++ arch/arm/mach-omap2/am33xx/board.c | 4 ++ arch/arm/mach-omap2/mem-common.c | 4 ++ board/bosch/guardian/board.c | 2 +- 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 arch/arm/include/asm/arch-am33xx/mem-guardian.h diff --git a/arch/arm/include/asm/arch-am33xx/mem-guardian.h b/arch/arm/include/asm/arch-am33xx/mem-guardian.h new file mode 100644 index 0000000000..e864a0fd36 --- /dev/null +++ b/arch/arm/include/asm/arch-am33xx/mem-guardian.h @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * (C) Copyright 2006-2008 + * Texas Instruments, + * + * (C) Copyright 2020 + * Robert Bosch Power Tools GmbH + * + * Author + * Moses Christopher + * + * Copied from: + * arch/arm/include/asm/arch-am33xx/mem.h + * + * Initial Code from: + * Mansoor Ahamed + * Richard Woodruff + */ + +#ifndef _MEM_GUARDIAN_H_ +#define _MEM_GUARDIAN_H_ + +/* + * GPMC settings - + * Definitions is as per the following format + * #define _GPMC_CONFIG + * Where: + * PART is the part name e.g. M_NAND - Micron Nand Flash + * x is GPMC config registers from 1 to 7 (there will be 7 macros) + * Value is corresponding value + * + * For every valid PRCM configuration there should be only one definition of + * the same. + * + * The following values are optimized for improving the NAND Read speed + * They are applicable and tested for Bosch Guardian Board. + * Read Speeds rose from 1.5MiBs to over 7.6MiBs + * + * Currently valid part Names are (PART): + * M_NAND - Micron NAND + */ +#define GPMC_SIZE_256M 0x0 +#define GPMC_SIZE_128M 0x8 +#define GPMC_SIZE_64M 0xC +#define GPMC_SIZE_32M 0xE +#define GPMC_SIZE_16M 0xF + +#define M_NAND_GPMC_CONFIG1 0x00000800 +#define M_NAND_GPMC_CONFIG2 0x00030300 +#define M_NAND_GPMC_CONFIG3 0x00030300 +#define M_NAND_GPMC_CONFIG4 0x02000201 +#define M_NAND_GPMC_CONFIG5 0x00030303 +#define M_NAND_GPMC_CONFIG6 0x000000C0 +#define M_NAND_GPMC_CONFIG7 0x00000008 + +/* max number of GPMC Chip Selects */ +#define GPMC_MAX_CS 8 +/* max number of GPMC regs */ +#define GPMC_MAX_REG 7 + +#define DBG_MPDB 6 + +#endif /* endif _MEM_GUARDIAN_H_ */ diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c index 2888390d24..a87ecaf12a 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++ b/arch/arm/mach-omap2/am33xx/board.c @@ -23,7 +23,11 @@ #include #include #include +#if IS_ENABLED(CONFIG_TARGET_AM335X_GUARDIAN) +#include +#else #include +#endif #include #include #include diff --git a/arch/arm/mach-omap2/mem-common.c b/arch/arm/mach-omap2/mem-common.c index 50d5f3e9eb..2dcf0cf9c3 100644 --- a/arch/arm/mach-omap2/mem-common.c +++ b/arch/arm/mach-omap2/mem-common.c @@ -15,7 +15,11 @@ #include #include #include +#if IS_ENABLED(CONFIG_TARGET_AM335X_GUARDIAN) +#include +#else #include +#endif #include #include #include diff --git a/board/bosch/guardian/board.c b/board/bosch/guardian/board.c index 1d8fa78154..8b3c82cafd 100644 --- a/board/bosch/guardian/board.c +++ b/board/bosch/guardian/board.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include