From patchwork Mon Nov 29 12:38:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Baidu Boy X-Patchwork-Id: 73419 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 CA2E81007D1 for ; Mon, 29 Nov 2010 23:39:07 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DB089281AE; Mon, 29 Nov 2010 13:39:03 +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 nNfBfcsjmgmY; Mon, 29 Nov 2010 13:39:03 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BA6B728146; Mon, 29 Nov 2010 13:39:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1716A28146 for ; Mon, 29 Nov 2010 13:39: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 A+TWpmgrBgRj for ; Mon, 29 Nov 2010 13:38:59 +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 mail-qw0-f44.google.com (mail-qw0-f44.google.com [209.85.216.44]) by theia.denx.de (Postfix) with ESMTP id 052C128145 for ; Mon, 29 Nov 2010 13:38:57 +0100 (CET) Received: by qwg5 with SMTP id 5so3069625qwg.3 for ; Mon, 29 Nov 2010 04:38:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.89.208 with SMTP id f16mr4815112qcm.168.1291034336429; Mon, 29 Nov 2010 04:38:56 -0800 (PST) Received: by 10.229.225.12 with HTTP; Mon, 29 Nov 2010 04:38:56 -0800 (PST) Date: Mon, 29 Nov 2010 20:38:56 +0800 Message-ID: From: Baidu Boy To: u-boot@lists.denx.de Subject: [U-Boot] [PATCH V3] mpc83xx:pcie:bugfix for mpc83xx pcie enumeration 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 This patch fix a problem for the pcie enumeration for mpc83xx cpus.Without this we will not  get correct value in hose->regions[...]. The pointer *reg in function mpc83xx_pcie_init_bus() shall not be changed. Because we will use this pointer as a parameter to call function mpc83xx_pcie_register_hose(). Signed-off-by: Baidu Boy --- Changes for v2:      - Add some description for the patch Changes for V3: - Avoid line wrap in the patch arch/powerpc/cpu/mpc83xx/pcie.c |   12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) -- 1.7.3.1.msysgit.0 diff --git a/arch/powerpc/cpu/mpc83xx/pcie.c b/arch/powerpc/cpu/mpc83xx/pcie.c index 1771c48..46a706d 100644 --- a/arch/powerpc/cpu/mpc83xx/pcie.c +++ b/arch/powerpc/cpu/mpc83xx/pcie.c @@ -201,18 +201,18 @@ static void mpc83xx_pcie_init_bus(int bus,       out_le32(&out_win->tarl, 0);       out_le32(&out_win->tarh, 0); -       for (i = 0; i < 2; i++, reg++) { +       for (i = 0; i < 2; i++) {               u32 ar; -               if (reg->size == 0) +               if (reg[i].size == 0)                       break;               out_win = &pex->bridge.pex_outbound_win[i + 1]; -               out_le32(&out_win->bar, reg->phys_start); -               out_le32(&out_win->tarl, reg->bus_start); +               out_le32(&out_win->bar, reg[i].phys_start); +               out_le32(&out_win->tarl, reg[i].bus_start);               out_le32(&out_win->tarh, 0); -               ar = PEX_OWAR_EN | (reg->size & PEX_OWAR_SIZE); -               if (reg->flags & PCI_REGION_IO) +               ar = PEX_OWAR_EN | (reg[i].size & PEX_OWAR_SIZE); +               if (reg[i].flags & PCI_REGION_IO)                       ar |= PEX_OWAR_TYPE_IO;               else                       ar |= PEX_OWAR_TYPE_MEM;