From patchwork Wed Oct 30 06:34:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priyanka Jain X-Patchwork-Id: 287139 X-Patchwork-Delegate: yorksun@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 49BC22C0357 for ; Wed, 30 Oct 2013 17:50:12 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8EFB04A12C; Wed, 30 Oct 2013 07:50:10 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6sF8qrKFK4Zz; Wed, 30 Oct 2013 07:50:08 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 770AC4A126; Wed, 30 Oct 2013 07:50:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E57BA4A126 for ; Wed, 30 Oct 2013 07:50:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6dDj0sCSuAKZ for ; Wed, 30 Oct 2013 07:49:56 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from tx2outboundpool.messaging.microsoft.com (tx2ehsobe002.messaging.microsoft.com [65.55.88.12]) by theia.denx.de (Postfix) with ESMTPS id 396A34A120 for ; Wed, 30 Oct 2013 07:49:50 +0100 (CET) Received: from mail64-tx2-R.bigfish.com (10.9.14.244) by TX2EHSOBE009.bigfish.com (10.9.40.29) with Microsoft SMTP Server id 14.1.225.22; Wed, 30 Oct 2013 06:34:37 +0000 Received: from mail64-tx2 (localhost [127.0.0.1]) by mail64-tx2-R.bigfish.com (Postfix) with ESMTP id 8AC5910009B for ; Wed, 30 Oct 2013 06:34:37 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h208ch1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz1de098h17326ah8275bh8275dh1de097h186068hz2dh2a8h839he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh1fb3h1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1e23h1fe8h1ff5h2218h2216h1155h) Received: from mail64-tx2 (localhost.localdomain [127.0.0.1]) by mail64-tx2 (MessageSwitch) id 1383114875823631_2762; Wed, 30 Oct 2013 06:34:35 +0000 (UTC) Received: from TX2EHSMHS014.bigfish.com (unknown [10.9.14.242]) by mail64-tx2.bigfish.com (Postfix) with ESMTP id C32B3FE0063 for ; Wed, 30 Oct 2013 06:34:35 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS014.bigfish.com (10.9.99.114) with Microsoft SMTP Server (TLS) id 14.16.227.3; Wed, 30 Oct 2013 06:34:29 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-005.039d.mgd.msft.net (10.84.1.17) with Microsoft SMTP Server (TLS) id 14.3.158.2; Wed, 30 Oct 2013 06:34:29 +0000 Received: from b32167-VirtualBox.ap.freescale.net (B32167-02-010232014050.ap.freescale.net [10.232.14.50]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r9U6YJUi022885; Tue, 29 Oct 2013 23:34:27 -0700 From: Priyanka Jain To: Date: Wed, 30 Oct 2013 12:04:08 +0530 Message-ID: <1383114848-18855-1-git-send-email-Priyanka.Jain@freescale.com> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Cc: Priyanka Jain , yorksun@freescale.com Subject: [U-Boot] [PATCH 2/2] T1040QDS: Add support of 2 stage SPI bootloader X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Add support of 2-stage T1040QDS SPI bootloader using SPL framework. In this, PBL (hardware) initializes SRAM (256K) and copy SPL (192K) from SPI flash to SRAM and transfer control to SPL. This SPL bootloader furthur initializes DDR using SPD and environment and copy final u-boot image (512K) from SPI flash to DDR and transfer control to final u-boot. Signed-off-by: Priyanka Jain --- Based on u-boot-mpc85xx/next branch. This patch depends upon following patches: 1)[U-Boot] powerpc/t1040: enable PBL tool for T1040 http://patchwork.ozlabs.org/patch/279366/ 2)[U-Boot,1/6,v2] powerpc:Add support of SPL non-relocation http://patchwork.ozlabs.org/patch/286074/ 3)[U-Boot,2/6,v2] powerpc/SPL:Allow Parsing of LAW table in both SPL & non SPL http://patchwork.ozlabs.org/patch/286075/ 4)[U-Boot,3/6,v2] common/env: Point default envirenoment for GD http://patchwork.ozlabs.org/patch/286076/ 5)[U-Boot,4/6,v2] Makefile:Add u-boot-with-spl-pbl.bin target for SPL http://patchwork.ozlabs.org/patch/286077/ 6)[U-Boot,5/6,v2] SPL:Defines function required to env read for IFC & env_nand http://patchwork.ozlabs.org/patch/286078/ 7)[U-Boot,6/6,v2] T1040QDS: Add support of 2 stage NAND boot loader http://patchwork.ozlabs.org/patch/286079/ board/freescale/t1040qds/README | 9 +++++++++ board/freescale/t1040qds/spl.c | 2 ++ boards.cfg | 1 + include/configs/T1040QDS.h | 23 +++++++++++++++++++---- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/board/freescale/t1040qds/README b/board/freescale/t1040qds/README index 0e4d32e..6235246 100644 --- a/board/freescale/t1040qds/README +++ b/board/freescale/t1040qds/README @@ -195,8 +195,17 @@ SPL has following features: ----------------------------------------------- Command to build 2 stage NAND boot loader +-------------------------------------------- - modify RCW at board/freescale/t1040qds/t1040_rcw.cfg for nand boot -66000002 00000000 fc027000 01000000 +66000002 00000000 ec106000 01000000 - make T1040QDS_NAND_config - make u-boot-with-spl-pbl.bin + +Command to build 2 stage SPI boot loader +------------------------------------------- + - modify RCW at board/freescale/t1040qds/t1040_rcw.cfg for spi boot + -66000002 00000000 fc027000 01000000 + +66000002 00000000 58027000 01000000 + - make T1040QDS_SPIFLASH_config + - make u-boot-with-spl-pbl.bin diff --git a/board/freescale/t1040qds/spl.c b/board/freescale/t1040qds/spl.c index 5f39466..60770f0 100644 --- a/board/freescale/t1040qds/spl.c +++ b/board/freescale/t1040qds/spl.c @@ -118,5 +118,7 @@ void board_init_r(gd_t *gd, ulong dest_addr) #ifdef CONFIG_SPL_NAND_BOOT nand_boot(); +#elif defined(CONFIG_SPL_SPI_BOOT) + spi_boot(); #endif } diff --git a/boards.cfg b/boards.cfg index 295d952..56f522e 100644 --- a/boards.cfg +++ b/boards.cfg @@ -964,6 +964,7 @@ Active powerpc mpc85xx - freescale t4qds Active powerpc mpc85xx - freescale t4qds T4240QDS_SRIO_PCIE_BOOT T4240QDS:PPC_T4240,SRIO_PCIE_BOOT_SLAVE,SYS_TEXT_BASE=0xFFF80000 - Active powerpc mpc85xx - freescale t1040qds T1040QDS T1040QDS:PPC_T1040 Naveen Burmi Active powerpc mpc85xx - freescale t1040qds T1040QDS_NAND T1040QDS:PPC_T1040,RAMBOOT_PBL,NAND Poonam Aggrwal +Active powerpc mpc85xx - freescale t1040qds T1040QDS_SPIFLASH T1040QDS:PPC_T1040,RAMBOOT_PBL,SPIFLASH Poonam Aggrwal Active powerpc mpc85xx - gdsys p1022 controlcenterd_36BIT_SDCARD controlcenterd:36BIT,SDCARD Dirk Eibach Active powerpc mpc85xx - gdsys p1022 controlcenterd_36BIT_SDCARD_DEVELOP controlcenterd:36BIT,SDCARD,DEVELOP Dirk Eibach Active powerpc mpc85xx - gdsys p1022 controlcenterd_TRAILBLAZER controlcenterd:TRAILBLAZER,SPIFLASH Dirk Eibach diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h index 6269ce5..27b812d 100644 --- a/include/configs/T1040QDS.h +++ b/include/configs/T1040QDS.h @@ -43,7 +43,6 @@ #define CONFIG_SPL_I2C_SUPPORT #define CONFIG_FSL_LAW /* Use common FSL init code */ #define CONFIG_SKIP_RELOCATE_SPL -#define CONFIG_SYS_TEXT_BASE 0x00201000 #define CONFIG_SPL_TEXT_BASE 0xFFFD0000 #define CONFIG_SPL_PAD_TO 0x80000 #define CONFIG_SPL_MAX_SIZE 0x30000 @@ -55,9 +54,22 @@ #define CONFIG_SYS_NAND_U_BOOT_DST 0x00200000 #define CONFIG_SYS_NAND_U_BOOT_START 0x00200000 #define CONFIG_SYS_NAND_U_BOOT_OFFS (512 << 10) +#define CONFIG_SYS_TEXT_BASE 0x00201000 #define CONFIG_SYS_LDSCRIPT "arch/powerpc/cpu/mpc85xx/u-boot-nand.lds" #define CONFIG_SPL_NAND_BOOT #endif +#ifdef CONFIG_SPIFLASH +#define CONFIG_SPL_SPI_SUPPORT +#define CONFIG_SPL_SPI_FLASH_SUPPORT +#define CONFIG_SYS_SPI_FLASH_U_BOOT_SIZE (512 << 10) +#define CONFIG_SYS_SPI_FLASH_U_BOOT_DST (0x280000) +#define CONFIG_SYS_SPI_FLASH_U_BOOT_START (0x2ff000) +#define CONFIG_SYS_SPI_FLASH_U_BOOT_OFFS (512 << 10) +#define CONFIG_SYS_TEXT_BASE 0x280000 +#define CONFIG_RESET_VECTOR_ADDRESS 0x2ffffc +#define CONFIG_SYS_LDSCRIPT "arch/powerpc/cpu/mpc85xx/u-boot.lds" +#define CONFIG_SPL_SPI_BOOT +#endif #ifdef CONFIG_SPL_BUILD #define CONFIG_SPL_COMMON_INIT_DDR #define CONFIG_SYS_CCSR_DO_NOT_RELOCATE @@ -107,14 +119,17 @@ #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE #endif -#ifndef CONFIG_SYS_NO_FLASH #if defined(CONFIG_SPIFLASH) -#define CONFIG_SYS_EXTRA_ENV_RELOC -#define CONFIG_ENV_IS_IN_SPI_FLASH #define CONFIG_ENV_SPI_BUS 0 #define CONFIG_ENV_SPI_CS 0 #define CONFIG_ENV_SPI_MAX_HZ 10000000 #define CONFIG_ENV_SPI_MODE 0 +#endif + +#ifndef CONFIG_SYS_NO_FLASH +#if defined(CONFIG_SPIFLASH) +#define CONFIG_SYS_EXTRA_ENV_RELOC +#define CONFIG_ENV_IS_IN_SPI_FLASH #define CONFIG_ENV_SIZE 0x2000 /* 8KB */ #define CONFIG_ENV_OFFSET 0x100000 /* 1MB */ #define CONFIG_ENV_SECT_SIZE 0x10000