From patchwork Fri Sep 20 09:52:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 20474 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E60F825DFC for ; Fri, 20 Sep 2013 09:53:15 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id u18sf143810qcx.10 for ; Fri, 20 Sep 2013 02:53:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=XCKtfBDXvtyZ9e5HWEe1ZckmkrRN5AbqJi+xt6edGH0=; b=hZeG9LTbNXzfegIs/Y/eMss/BucnccEnNIbpaVcS4t57/ggtMdSwAotFUzVL7Y4MPb 2Ltwykr3aJM8t7v7X2ONfE7tkVfWo8hHhBnOKUwPGzCDxN1JxQyROIQIQsN53QvBGeWa vDFrOKml1W8gQ7kKjONcEg0oh41ppNkjFooHy2WyFVtj7BVQGJZuwjPqrwLkpXSwkvIB lXLuvbEwsGkCfni584bGxh4Is6WN5kXHoZ3QQaFMcCEsTfUUGWf74B9Ux3OYrcA1Vn5l XeJ1H1O5ju6ElLAbZWHnt4/7gBQ3MBEidurQKdtCbJ4MpiQXKpSYkoCKFknnqyd4zowc 6Ymg== X-Gm-Message-State: ALoCoQkk1v59KKZpGsqHRA4Xcvx+AC2Q3bzHl6i8Y5gdSFc2RHq7EZ4RuRjzcEcliETKFhn/9IxA X-Received: by 10.224.137.67 with SMTP id v3mr1988064qat.0.1379670795495; Fri, 20 Sep 2013 02:53:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.134.74 with SMTP id pi10ls188215qeb.35.gmail; Fri, 20 Sep 2013 02:53:15 -0700 (PDT) X-Received: by 10.59.11.69 with SMTP id eg5mr5573505ved.17.1379670795405; Fri, 20 Sep 2013 02:53:15 -0700 (PDT) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id tm8si2882574vdc.20.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Sep 2013 02:53:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.43; Received: by mail-vb0-f43.google.com with SMTP id h11so107333vbh.2 for ; Fri, 20 Sep 2013 02:53:15 -0700 (PDT) X-Received: by 10.58.208.130 with SMTP id me2mr5571566vec.13.1379670795300; Fri, 20 Sep 2013 02:53:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp7687vcz; Fri, 20 Sep 2013 02:53:14 -0700 (PDT) X-Received: by 10.68.254.166 with SMTP id aj6mr2199733pbd.193.1379670794275; Fri, 20 Sep 2013 02:53:14 -0700 (PDT) Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com [209.85.160.53]) by mx.google.com with ESMTPS id yk3si11772063pac.157.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Sep 2013 02:53:14 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.53 is neither permitted nor denied by best guess record for domain of pranavkumar@linaro.org) client-ip=209.85.160.53; Received: by mail-pb0-f53.google.com with SMTP id up15so189072pbc.12 for ; Fri, 20 Sep 2013 02:53:13 -0700 (PDT) X-Received: by 10.68.224.199 with SMTP id re7mr2243641pbc.183.1379670793855; Fri, 20 Sep 2013 02:53:13 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id oh2sm14744663pbb.3.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Sep 2013 02:53:13 -0700 (PDT) From: Pranavkumar Sawargaonkar To: xen-devel@lists.xen.org Cc: julien.grall@citrix.com, ian.campbell@citrix.com, stefano.stabellini@citrix.com, patches@linaro.org, Pranavkumar Sawargaonkar , Anup Patel Subject: [PATCH 1/4] xen: arm64: Add Basic Platform support for APM X-Gene Storm. Date: Fri, 20 Sep 2013 15:22:40 +0530 Message-Id: <1379670763-14895-2-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1379670763-14895-1-git-send-email-pranavkumar@linaro.org> References: <1379670763-14895-1-git-send-email-pranavkumar@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pranavkumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch adds following things: Early printk support for APM X-Gene platform. Initial platform stubs for APM X-Gene. Signed-off-by: Anup Patel Signed-off-by: Pranavkumar Sawargaonkar --- xen/arch/arm/Rules.mk | 5 +++ xen/arch/arm/arm64/debug-xgene-storm.inc | 55 ++++++++++++++++++++++++++++++ xen/arch/arm/platforms/Makefile | 1 + xen/arch/arm/platforms/xgene-storm.c | 57 ++++++++++++++++++++++++++++++++ 4 files changed, 118 insertions(+) create mode 100644 xen/arch/arm/arm64/debug-xgene-storm.inc create mode 100644 xen/arch/arm/platforms/xgene-storm.c diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk index bd79b26..b36120e 100644 --- a/xen/arch/arm/Rules.mk +++ b/xen/arch/arm/Rules.mk @@ -77,6 +77,11 @@ EARLY_PRINTK_INC := 8250 EARLY_UART_BASE_ADDRESS := 0x01c28000 EARLY_UART_REG_SHIFT := 2 endif +ifeq ($(CONFIG_EARLY_PRINTK), xgene-storm) +EARLY_PRINTK_INC := xgene-storm +EARLY_PRINTK_BAUD := 115200 +EARLY_UART_BASE_ADDRESS := 0x1c020000 +endif ifneq ($(EARLY_PRINTK_INC),) EARLY_PRINTK := y diff --git a/xen/arch/arm/arm64/debug-xgene-storm.inc b/xen/arch/arm/arm64/debug-xgene-storm.inc new file mode 100644 index 0000000..ebbb8d2 --- /dev/null +++ b/xen/arch/arm/arm64/debug-xgene-storm.inc @@ -0,0 +1,55 @@ +/* + * xen/arch/arm/arm64/debug-xgene-storm.inc + * + * X-Gene Storm specific debug code + * + * Copyright (c) 2013 Applied Micro. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include + +#define XGENE_STORM_UART_LSR 0x14 +#define XGENE_STORM_UART_THR 0x00 + +/* UART initialization + * rb: register which contains the UART base address + * rc: scratch register 1 + * rd: scratch register 2 */ +.macro early_uart_init rb rc rd +.endm + +/* UART wait UART to be ready to transmit + * xb: register which contains the UART base address + * c: scratch register */ +.macro early_uart_ready xb c +1: + ldrb w\c, [\xb, #XGENE_STORM_UART_LSR] + and w\c, w\c, #UART_LSR_THRE + cmp w\c, #UART_LSR_THRE + b.ne 1b +.endm + +/* UART transmit character + * xb: register which contains the UART base address + * wt: register which contains the character to transmit */ +.macro early_uart_transmit xb wt + /* UART_THR transmit holding */ + strb \wt, [\xb, #XGENE_STORM_UART_THR] +.endm + +/* + * Local variables: + * mode: ASM + * indent-tabs-mode: nil + * End: + */ diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile index 4aa82e8..8a6709f 100644 --- a/xen/arch/arm/platforms/Makefile +++ b/xen/arch/arm/platforms/Makefile @@ -2,3 +2,4 @@ obj-y += vexpress.o obj-y += exynos5.o obj-y += midway.o obj-y += omap5.o +obj-y += xgene-storm.o diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c new file mode 100644 index 0000000..8e2b3b6 --- /dev/null +++ b/xen/arch/arm/platforms/xgene-storm.c @@ -0,0 +1,57 @@ +/* + * xen/arch/arm/platforms/xgene-storm.c + * + * Applied Micro's X-Gene specific settings + * + * Pranavkumar Sawargaonkar + * Anup Patel + * Copyright (c) 2013 Applied Micro. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include + +static void xgene_storm_reset(void) +{ +} + +static int xgene_storm_init(void) +{ + return 0; +} + +static const char const *xgene_storm_dt_compat[] __initdata = +{ + "apm,xgene-storm", + NULL +}; + +PLATFORM_START(xgene_storm, "APM X-GENE STORM") + .compatible = xgene_storm_dt_compat, + .init = xgene_storm_init, + .reset = xgene_storm_reset, +PLATFORM_END + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */