From patchwork Wed Jul 4 06:02:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajeshwari Shinde X-Patchwork-Id: 9801 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C9B2623E47 for ; Wed, 4 Jul 2012 05:58:55 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 92A40A18793 for ; Wed, 4 Jul 2012 05:58:55 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so6627938ggn.11 for ; Tue, 03 Jul 2012 22:58:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-tm-as-mml:x-gm-message-state; bh=E2skJCk2ZI8sz7COIJWm4dv5jrPKknBzlZwDcd/4kuc=; b=byEuzF3RME70YQdXMV53aOVYhdAYHHUhnMhHKYEOcKAbC0fuQt/wCOG4BOUZoSm1SF ItRa2EvBpba3/+M/plfFla6hMESLXfMW96fFAlBTHfAjhOv7RC/2Nymn07TU06HY20D8 mOLoiaSM6iDY//za0aSNw0c3LYN9Bf2zlPxNUbxjmFGeggCPFhqHRlRQ3hLW856bF8/N snd60NO6A3J/21qNkmm7qRX0FQ1gSHVan2aBIoNyIWdFJ7Y6ZcqyZo3KbPPKUzjM/l44 QKr9fvYE6M+3UgyXN2mP2klnGMQQRiEbyeIK88qcVE6t3DkEqXHLTDuPetOPdasGtT7Z Wdkg== Received: by 10.50.203.39 with SMTP id kn7mr12288679igc.53.1341381534946; Tue, 03 Jul 2012 22:58:54 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp49606ibb; Tue, 3 Jul 2012 22:58:54 -0700 (PDT) Received: by 10.68.232.232 with SMTP id tr8mr14810578pbc.73.1341381534029; Tue, 03 Jul 2012 22:58:54 -0700 (PDT) Received: from mailout2.samsung.com (mailout2.samsung.com. [203.254.224.25]) by mx.google.com with ESMTP id go9si2663885pbc.187.2012.07.03.22.58.53; Tue, 03 Jul 2012 22:58:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.25 as permitted sender) client-ip=203.254.224.25; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.25 as permitted sender) smtp.mail=rajeshwari.s@samsung.com Received: from epcpsbgm1.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M6M00ATXGM4MO60@mailout2.samsung.com>; Wed, 04 Jul 2012 14:58:52 +0900 (KST) X-AuditID: cbfee61a-b7f086d000000e64-d3-4ff3db9cb964 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id C1.13.03684.C9BD3FF4; Wed, 04 Jul 2012 14:58:52 +0900 (KST) Received: from rajeshwari-linux.sisodomain.com ([107.108.215.115]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M6M00GQYGLOH980@mmp1.samsung.com>; Wed, 04 Jul 2012 14:58:52 +0900 (KST) From: Rajeshwari Shinde To: u-boot@lists.denx.de Cc: patches@linaro.org, alim.akhtar@samsung.com, sjg@chromium.org, mk7.kang@samsung.com, chander.kashyap@linaro.org, jy0922.shim@samsung.com, jh80.chung@samsung.com Subject: [PATCH 01/10 V6] ARCH: SPL: Add parametric board initializer Date: Wed, 04 Jul 2012 11:32:51 +0530 Message-id: <1341381780-2725-2-git-send-email-rajeshwari.s@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1341381780-2725-1-git-send-email-rajeshwari.s@samsung.com> References: <1341381780-2725-1-git-send-email-rajeshwari.s@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBJMWRmVeSWpSXmKPExsVy+t9jAd05tz/7G7zfIGzxcP1NFosph7+w ODB53Lm2hy2AMYrLJiU1J7MstUjfLoEr43XLJdaCZpWKBXffsjUw7pPpYuTgkBAwkZh0KbOL kRPIFJO4cG89WxcjF4eQwCJGiQVbV7FAOBOZJJ40nWMHqWITMJLYenIaI4gtIiAh8av/KiNI EbPACkaJOT3bWEASwgKuEvvP3wJrYBFQlVhzbAMziM0r4C6x4Pg1Voh1ChLHpn4FszkFPCSa t3wBs4WAajq2tDFOYORdwMiwilE0tSC5oDgpPddQrzgxt7g0L10vOT93EyPY/8+kdjCubLA4 xCjAwajEw2t95bO/EGtiWXFl7iFGCQ5mJRHem7uBQrwpiZVVqUX58UWlOanFhxilOViUxHmb rC/4CwmkJ5akZqemFqQWwWSZODilGhj31mpy7DJf9kCz9IVWf8Hcl+3hX5wMtF5e4EmLKaku E3/x6ueLxwGyWaZn73x4ekhso3GZ8Gyz6RYNal/dX2bP+7lxaXLQ1+4tfGtz9h9m95v3xHa/ 3irD/L3xGXESqV4LvmWuv7eEY2NWwn+xxT8XJjpYy2zas+uZ01fm5bc3xuTelnwx/W+uEktx RqKhFnNRcSIA3ZS32vsBAAA= X-TM-AS-MML: No X-Gm-Message-State: ALoCoQm5j9wzNZDghixrihhp5NxZTfzHz0xtSt3P+9ZcOC/iJwTUtM0OPQ89ZwOzy7SMOq5TwCvI Add a structure for table-driven configuration mechanism such that no recompilation is needed to update the configuration parameters, rather than hard-coding board initialization parameters. Signed-off-by: Che-Liang Chiou Signed-off-by: Abhilash Kesavan Signed-off-by: Tom Wai-Hong Tam Signed-off-by: Simon Glass Signed-off-by: Rajeshwari Shinde --- Changes in V2: - Included Paramateric structure with in #ifndef __ASSEMBLY__. Changes in V3: - None Changes in V4: - None Changes in V5: - None Changes in V6: - None arch/arm/include/asm/arch-exynos/spl.h | 97 ++++++++++++++++++++++++++++++++ 1 files changed, 97 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/arch-exynos/spl.h diff --git a/arch/arm/include/asm/arch-exynos/spl.h b/arch/arm/include/asm/arch-exynos/spl.h new file mode 100644 index 0000000..306b41d --- /dev/null +++ b/arch/arm/include/asm/arch-exynos/spl.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2012 The Chromium OS Authors. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +#ifndef __ASM_ARCH_EXYNOS_SPL_H__ +#define __ASM_ARCH_EXYNOS_SPL_H__ + +#include + +enum boot_mode { + /* + * Assign the OM pin values for respective boot modes. + * Exynos4 does not support spi boot and the mmc boot OM + * pin values are the same across Exynos4 and Exynos5. + */ + BOOT_MODE_MMC = 4, + BOOT_MODE_SERIAL = 20, + /* Boot based on Operating Mode pin settings */ + BOOT_MODE_OM = 32, + BOOT_MODE_USB, /* Boot using USB download */ +}; + +#ifndef __ASSEMBLY__ +/* Parameters of early board initialization in SPL */ +struct spl_machine_param { + /* Add fields as and when required */ + u32 signature; + u32 version; /* Version number */ + u32 size; /* Size of block */ + /** + * Parameters we expect, in order, terminated with \0. Each parameter + * is a single character representing one 32-bit word in this + * structure. + * + * Valid characters in this string are: + * + * Code Name + * v mem_iv_size + * m mem_type + * u uboot_size + * b boot_source + * f frequency_mhz (memory frequency in MHz) + * a ARM clock frequency in MHz + * s serial base address + * i i2c base address for early access (meant for PMIC) + * r board rev GPIO numbers used to read board revision + * (lower halfword=bit 0, upper=bit 1) + * M Memory Manufacturer name + * \0 termination + */ + char params[12]; /* Length must be word-aligned */ + u32 mem_iv_size; /* Memory channel interleaving size */ + enum ddr_mode mem_type; /* Type of on-board memory */ + /* + * U-boot size - The iROM mmc copy function used by the SPL takes a + * block count paramter to describe the u-boot size unlike the spi + * boot copy function which just uses the u-boot size directly. Align + * the u-boot size to block size (512 bytes) when populating the SPL + * table only for mmc boot. + */ + u32 uboot_size; + enum boot_mode boot_source; /* Boot device */ + enum mem_manuf mem_manuf; /* Memory Manufacturer */ + unsigned frequency_mhz; /* Frequency of memory in MHz */ + unsigned arm_freq_mhz; /* ARM Frequency in MHz */ + u32 serial_base; /* Serial base address */ + u32 i2c_base; /* i2c base address */ +} __attribute__((__packed__)); +#endif + +/** + * Validate signature and return a pointer to the parameter table. If the + * signature is invalid, call panic() and never return. + * + * @return pointer to the parameter table if signature matched or never return. + */ +struct spl_machine_param *spl_get_machine_params(void); + +#endif /* __ASM_ARCH_EXYNOS_SPL_H__ */