From patchwork Tue Aug 30 03:41:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunhe Lan X-Patchwork-Id: 112175 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 1ED1AB6F71 for ; Tue, 30 Aug 2011 13:40:28 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B4A4D2808D; Tue, 30 Aug 2011 05:40:26 +0200 (CEST) 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 fpGasAIh75nL; Tue, 30 Aug 2011 05:40:26 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 16DBC28091; Tue, 30 Aug 2011 05:40:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9554A28096 for ; Tue, 30 Aug 2011 05:40:23 +0200 (CEST) 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 xP9gKlSRXJwN for ; Tue, 30 Aug 2011 05:40:22 +0200 (CEST) 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 ch1outboundpool.messaging.microsoft.com (ch1ehsobe001.messaging.microsoft.com [216.32.181.181]) by theia.denx.de (Postfix) with ESMTPS id 8800328091 for ; Tue, 30 Aug 2011 05:40:20 +0200 (CEST) Received: from mail84-ch1-R.bigfish.com (216.32.181.170) by CH1EHSOBE018.bigfish.com (10.43.70.68) with Microsoft SMTP Server id 14.1.225.22; Tue, 30 Aug 2011 03:40:18 +0000 Received: from mail84-ch1 (localhost.localdomain [127.0.0.1]) by mail84-ch1-R.bigfish.com (Postfix) with ESMTP id 6E5A415509E5 for ; Tue, 30 Aug 2011 03:40:18 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail84-ch1 (localhost.localdomain [127.0.0.1]) by mail84-ch1 (MessageSwitch) id 1314675590631517_7987; Tue, 30 Aug 2011 03:39:50 +0000 (UTC) Received: from CH1EHSMHS005.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.252]) by mail84-ch1.bigfish.com (Postfix) with ESMTP id C0A191660072 for ; Tue, 30 Aug 2011 03:38:11 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS005.bigfish.com (10.43.70.5) with Microsoft SMTP Server (TLS) id 14.1.225.22; Tue, 30 Aug 2011 03:38:08 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.323.2; Mon, 29 Aug 2011 22:38:07 -0500 Received: from localhost.localdomain ([10.193.20.71]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p7U3c56i008122; Mon, 29 Aug 2011 22:38:05 -0500 (CDT) From: Chunhe Lan To: Date: Tue, 30 Aug 2011 11:41:38 +0800 Message-ID: <1314675698-9847-1-git-send-email-Chunhe.Lan@freescale.com> X-Mailer: git-send-email 1.5.6.5 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: scottwood@freescale.com, kumar.gala@freescale.com, Chunhe Lan Subject: [U-Boot] [PATCH 2/2 v5] powerpc/p1023rds: Disable nor flash node and enable nand flash node X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 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 In the p1023rds, when system boots from nor flash, kernel only accesses nor flash and can not access nand flash with BR0/OR0; when system boots from nand flash, kernel only accesses nand flash and can not access nor flash with BR0/OR0. Default device tree nor and nand node should have the following structure: Example: nor_flash: nor@0,0 { #address-cells = <1>; #size-cells = <1>; compatible = "cfi-flash"; reg = <0x0 0x0 0x02000000>; bank-width = <2>; device-width = <1>; status = "okay"; partition@0 { label = "ramdisk"; reg = <0x00000000 0x01c00000>; }; } nand_flash: nand@1,0 { #address-cells = <1>; #size-cells = <1>; compatible = "fsl,p1023-fcm-nand", "fsl,elbc-fcm-nand"; reg = <0x2 0x0 0x00040000>; status = "disabled"; u-boot-nand@0 { /* This location must not be altered */ /* 1MB for u-boot Bootloader Image */ reg = <0x0 0x00100000>; read-only; }; } When booting from nor flash, the status of nor node is null that means it is enabled and the status of nand node is disabled in the default dts file, so do not do anything. But, when booting from nand flash, need to do some operations: o the status of nor node should be disabled. o the status of nand node should be enabled. Signed-off-by: Chunhe Lan --- board/freescale/p1023rds/p1023rds.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/board/freescale/p1023rds/p1023rds.c b/board/freescale/p1023rds/p1023rds.c index 8cfd199..c99ccee 100644 --- a/board/freescale/p1023rds/p1023rds.c +++ b/board/freescale/p1023rds/p1023rds.c @@ -158,5 +158,10 @@ void ft_board_setup(void *blob, bd_t *bd) size = getenv_bootm_size(); fdt_fixup_memory(blob, (u64)base, (u64)size); + +#ifdef CONFIG_NAND_U_BOOT + do_fixup_by_path_string(fdt, "nor_flash", "status", "disabled"); + do_fixup_by_path_string(fdt, "nand_flash", "status", "okay"); +#endif } #endif