From patchwork Mon Aug 29 07:15:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunhe Lan X-Patchwork-Id: 111959 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 8461AB6F71 for ; Mon, 29 Aug 2011 17:15:08 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ADA48280D0; Mon, 29 Aug 2011 09:15:05 +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 lnSOgi8BpnYe; Mon, 29 Aug 2011 09:15:05 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6B654280D1; Mon, 29 Aug 2011 09:15:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CDA81280D1 for ; Mon, 29 Aug 2011 09:15:00 +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 V3c4hu160-JH for ; Mon, 29 Aug 2011 09:15:00 +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 DB3EHSOBE006.bigfish.com (db3ehsobe006.messaging.microsoft.com [213.199.154.144]) by theia.denx.de (Postfix) with ESMTPS id D232E280D0 for ; Mon, 29 Aug 2011 09:14:58 +0200 (CEST) Received: from mail84-db3-R.bigfish.com (10.3.81.243) by DB3EHSOBE006.bigfish.com (10.3.84.26) with Microsoft SMTP Server id 14.1.225.22; Mon, 29 Aug 2011 07:14:57 +0000 Received: from mail84-db3 (localhost.localdomain [127.0.0.1]) by mail84-db3-R.bigfish.com (Postfix) with ESMTP id 95C065E846C for ; Mon, 29 Aug 2011 07:14:57 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h) 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-db3 (localhost.localdomain [127.0.0.1]) by mail84-db3 (MessageSwitch) id 1314602061519385_3085; Mon, 29 Aug 2011 07:14:21 +0000 (UTC) Received: from DB3EHSMHS004.bigfish.com (unknown [10.3.81.248]) by mail84-db3.bigfish.com (Postfix) with ESMTP id 2F499167005E for ; Mon, 29 Aug 2011 07:12:29 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS004.bigfish.com (10.3.87.104) with Microsoft SMTP Server (TLS) id 14.1.225.22; Mon, 29 Aug 2011 07:12:28 +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 02:12:26 -0500 Received: from localhost.localdomain ([10.193.20.71]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p7T7CNaQ004228; Mon, 29 Aug 2011 02:12:24 -0500 (CDT) From: Chunhe Lan To: Date: Mon, 29 Aug 2011 15:15:52 +0800 Message-ID: <1314602152-9114-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 v4] 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, accessing exclusively nor flash or nand flash device by 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>; 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