From patchwork Wed Jan 9 02:25:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Grussling X-Patchwork-Id: 210606 X-Patchwork-Delegate: kim.phillips@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 DB6D22C0100 for ; Wed, 9 Jan 2013 13:53:09 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DA17A4A0FD; Wed, 9 Jan 2013 03:53:07 +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 F1uaau1r5Tpk; Wed, 9 Jan 2013 03:53:07 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DF61E4A107; Wed, 9 Jan 2013 03:53:05 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D62724A107 for ; Wed, 9 Jan 2013 03:53: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 0vodQghkZoND for ; Wed, 9 Jan 2013 03:53:03 +0100 (CET) X-Greylist: delayed 1577 seconds by postgrey-1.27 at theia; Wed, 09 Jan 2013 03:53:01 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-da0-f43.google.com (mail-da0-f43.google.com [209.85.210.43]) by theia.denx.de (Postfix) with ESMTPS id CFDF64A0FD for ; Wed, 9 Jan 2013 03:53:01 +0100 (CET) Received: by mail-da0-f43.google.com with SMTP id u36so500907dak.2 for ; Tue, 08 Jan 2013 18:52:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=6bwAj+iQsz5AeeQxR/eVsDhURnhMlWwQWRK6MSC51jM=; b=WM7rJyapyCvAJC2zf/rJUFsIKJnn+kBybVQZwlnaf550q9oeeRv9VPh4O+gMiYmxWO 2IYKiLpeUiLjDycvc2TJcykfZDs4ReZqi7OoBaKqSEZ4FImUqNC9a+ryZFMlrSMHd8cA w10BIXYTIKa2QaGEyoOA2/d8jgc+iX0oZmMO3/cnkxlnP03I21p7ocX4WsssoKTMGIu5 8KkCygoLGzCYmubeH40Q5omaUuogYTZXF3QPqmSA07Hal49YcENzpzVK9MjEO1lSGAO1 x5y4C1wfT/j0dh6fOuSMUKAs2vMsnZ13ZpHn5mbJPW7zCYGDh8QlhTMH0U/Ykj1eqK+U qSqg== X-Received: by 10.68.227.73 with SMTP id ry9mr202544515pbc.73.1357698401092; Tue, 08 Jan 2013 18:26:41 -0800 (PST) Received: from trixie.pullman ([76.178.144.65]) by mx.google.com with ESMTPS id oz9sm40646804pbb.68.2013.01.08.18.26.39 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Jan 2013 18:26:40 -0800 (PST) From: Barry Grussling To: u-boot@lists.denx.de Date: Tue, 8 Jan 2013 18:25:11 -0800 Message-Id: <1357698311-7392-1-git-send-email-barry@grussling.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <20130108191803.b40ffe0f6b36ac870218be56@freescale.com> References: <20130108191803.b40ffe0f6b36ac870218be56@freescale.com> X-Gm-Message-State: ALoCoQkMi+RC0WL9gSPwQusOtyddIJUhqFJRyim5xw4DEEeSUZGliNZbh/CJIpEE7efwu+i2YIv8 Cc: kim.phillips@freescale.com, yanok@emcraft.com Subject: [U-Boot] [PATCH V2] MPC8308: Fixup clocks in PCI Host configuration 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de While trying to bring up a custom MPC8308 based board I found that the clocking was wrong. The comment in include/configs/mpc8308_p1m.h led me to believe setting HRCWH_PCI_HOST and HRCWH_PCI1_ARBITER_ENABLE in the CONFIG_SYS_HRCW_HIGH should allow the system to work, but on my newer version of the 8308 this is not working. Setting the HRCWH_PCI_HOST bit (which doesn't exist according to the manual) doesn't latch, and as such the im->reset.rcwh & HRCWH_PCI_HOST test in speed.c fails. Since this board is running off the CONFIG_83XX_CLKIN and is not a PCI client, I end up with 0xdeadbeef and hosed clock values. This patch allows for proper clocks on the 8308 as a workaround for the lack of HRCWH_PCI_HOST support. Signed-off-by: Barry Grussling --- Changes since V1: * Fix multi-line comment style * Remove trailing whitespace * Align comment - All per Kim Phillips recommendation * Verified output of checkpatch.pl clean now that I know about checkpatch.pl :-) --- arch/powerpc/cpu/mpc83xx/speed.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c index b8c05d1..8816d71 100644 --- a/arch/powerpc/cpu/mpc83xx/speed.c +++ b/arch/powerpc/cpu/mpc83xx/speed.c @@ -160,6 +160,12 @@ int get_clocks(void) } else { #if defined(CONFIG_83XX_PCICLK) pci_sync_in = CONFIG_83XX_PCICLK; +#elif defined(CONFIG_83XX_CLKIN) && defined(CONFIG_MPC8308) + /* + * 8308 doesn't have the HRCWH_PCI_HOST, but should + * run off the CONFIG_83XX_CLKIN + */ + pci_sync_in = CONFIG_83XX_CLKIN / (1 + clkin_div); #else pci_sync_in = 0xDEADBEEF; #endif