From patchwork Mon Apr 27 06:16:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 464799 X-Patchwork-Delegate: sjg@chromium.org 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 76F2C140318 for ; Mon, 27 Apr 2015 16:16:37 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=ml2PE4MM; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4165F4BB1E; Mon, 27 Apr 2015 08:16:30 +0200 (CEST) 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 JPvniwFtLe4s; Mon, 27 Apr 2015 08:16:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0F1E84BB1D; Mon, 27 Apr 2015 08:16:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 682D84BAF5 for ; Mon, 27 Apr 2015 08:16:24 +0200 (CEST) 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 seAqWaOLREHm for ; Mon, 27 Apr 2015 08:16:24 +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 mail-vn0-f42.google.com (mail-vn0-f42.google.com [209.85.216.42]) by theia.denx.de (Postfix) with ESMTPS id 6AD5B4BB05 for ; Mon, 27 Apr 2015 08:16:19 +0200 (CEST) Received: by vnbg1 with SMTP id g1so10729758vnb.2 for ; Sun, 26 Apr 2015 23:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:subject:date:in-reply-to:references:mime-version :content-type; bh=fxuEmL0Cnl1e1VxZZYhEdAMgWiQyq7ObJ3netNOdkgk=; b=ml2PE4MMGNwcDKqQttj5TveY1O3x6wr33x7tLzr69nb4VokCFOjLY0X7p0To3XNbCA bNVXEQ/OnZNTxCu00ipk9DgKc6HD+r4MuQpaJETZoMVefegYnihXKEVDkKdZyaaZk3OY /lyX254WPoy1TtRJBINTOlqb5+yddi0v50z6/H1YvfIPwQOMlek/rq9Wmh+XT2jVfu/E YOausxJPOVZpSC1Yh5kjl9os1Kdv01B6b38k6GoV0EwNVPGlHM2b9Rh7OY3QRaIWLd5G qC3wBNNR8eWlI/okfpKxiqENsxszEwrJNH6Q4PJLEa69Vd3YIqKlJU/M8PZlR7F++ZNQ LGSA== X-Received: by 10.52.3.42 with SMTP id 10mr24101740vdz.10.1430115378732; Sun, 26 Apr 2015 23:16:18 -0700 (PDT) Received: from mail.hotmail.com (blu004-wss1s2.hotmail.com. [134.170.2.217]) by mx.google.com with ESMTPSA id cc10sm23403816vdc.3.2015.04.26.23.16.18 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 Apr 2015 23:16:18 -0700 (PDT) Received: from BLU436-SMTP85 ([134.170.2.215]) by BLU004-WSS1S2.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Sun, 26 Apr 2015 23:16:17 -0700 X-TMN: [s3nkA5HNu+5QXCkV5JiJYs6PjL5rqF0Z] Message-ID: From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Mon, 27 Apr 2015 14:16:02 +0800 X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1430115363-31116-1-git-send-email-bmeng.cn@gmail.com> References: <1430115363-31116-1-git-send-email-bmeng.cn@gmail.com> X-OriginalArrivalTime: 27 Apr 2015 06:16:16.0639 (UTC) FILETIME=[AB5E38F0:01D080B1] MIME-Version: 1.0 Subject: [U-Boot] [PATCH 2/3] x86: quark: Turn on legacy segments decode X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" By default the legacy segments (A0000h-B0000h, E0000h-F0000h) do not decode to system RAM. Turn on the decode so that we can write configuration tables in the F segment. Signed-off-by: Bin Meng Acked-by: Simon Glass --- arch/x86/cpu/quark/quark.c | 12 ++++++++++++ arch/x86/include/asm/arch-quark/quark.h | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/arch/x86/cpu/quark/quark.c b/arch/x86/cpu/quark/quark.c index e4b19c2..4ffa437 100644 --- a/arch/x86/cpu/quark/quark.c +++ b/arch/x86/cpu/quark/quark.c @@ -72,6 +72,15 @@ static void quark_setup_bars(void) CONFIG_PCIE_ECAM_BASE | MEM_BAR_EN); } +static void quark_enable_legacy_seg(void) +{ + u32 hmisc2; + + hmisc2 = msg_port_read(MSG_PORT_HOST_BRIDGE, HMISC2); + hmisc2 |= (HMISC2_SEGE | HMISC2_SEGF | HMISC2_SEGAB); + msg_port_write(MSG_PORT_HOST_BRIDGE, HMISC2, hmisc2); +} + int arch_cpu_init(void) { struct pci_controller *hose; @@ -96,6 +105,9 @@ int arch_cpu_init(void) */ quark_setup_bars(); + /* Turn on legacy segments (A/B/E/F) decode to system RAM */ + quark_enable_legacy_seg(); + unprotect_spi_flash(); return 0; diff --git a/arch/x86/include/asm/arch-quark/quark.h b/arch/x86/include/asm/arch-quark/quark.h index ceb583e..6dd02fd 100644 --- a/arch/x86/include/asm/arch-quark/quark.h +++ b/arch/x86/include/asm/arch-quark/quark.h @@ -21,6 +21,13 @@ /* Port 0x03: Host Bridge Message Port Registers */ +/* Host Miscellaneous Controls 2 */ +#define HMISC2 0x03 + +#define HMISC2_SEGE 0x00000002 +#define HMISC2_SEGF 0x00000004 +#define HMISC2_SEGAB 0x00000010 + /* Host Memory I/O Boundary */ #define HM_BOUND 0x08