From patchwork Wed Jul 31 15:38:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 18712 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 04485246CC for ; Wed, 31 Jul 2013 15:38:43 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id bq6sf1175020qab.2 for ; Wed, 31 Jul 2013 08:38:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-removed-original-auth :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe; bh=q7d4AS20O/BpkBKaf/OrDRBNnnX39pj3MUFajq0sKHQ=; b=lqC2n1Bv4ZU2W++PzAGG5piBa4BVXpvzqpy8ltiWxSzVSvUfxXtvWiShRl8LyorWMH dITDlXdBxAI9liq7ZMsP3tnTgtMIJzBJ1EFsaHQDIT8ylywTh/IqGhXTYZ1mgBmD/UYj VktdWSfJ7Kz1Hni3QzRZoHuESrmRcTxteruP5WU656Vu73jtC5AoFG7A92K/ohIVFz/T HWlKRNRJJSAej2bFoQehT9OWy3jgJJ/y1JXIMVU5vGjyAXY/1QT2NdEXstclfXYSF1rh onJ3ILm+lnkoyCm5zg70Yw8JaQx9t8ayEw6lWMYepCqskXz6UFhp1w925i1lpcRbvAmq GG5w== X-Received: by 10.236.113.77 with SMTP id z53mr29213158yhg.47.1375285122768; Wed, 31 Jul 2013 08:38:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.132.197 with SMTP id ow5ls771310qeb.97.gmail; Wed, 31 Jul 2013 08:38:42 -0700 (PDT) X-Received: by 10.220.98.68 with SMTP id p4mr11676844vcn.28.1375285122609; Wed, 31 Jul 2013 08:38:42 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id n6si420581ven.41.2013.07.31.08.38.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 31 Jul 2013 08:38:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id d10so963918vea.33 for ; Wed, 31 Jul 2013 08:38:42 -0700 (PDT) X-Received: by 10.52.160.197 with SMTP id xm5mr7025825vdb.48.1375285122465; Wed, 31 Jul 2013 08:38:42 -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.221.11.8 with SMTP id pc8csp243365vcb; Wed, 31 Jul 2013 08:38:41 -0700 (PDT) X-Received: by 10.180.160.162 with SMTP id xl2mr4807763wib.2.1375285121296; Wed, 31 Jul 2013 08:38:41 -0700 (PDT) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx.google.com with ESMTPS id df10si1059526wjb.125.2013.07.31.08.38.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 31 Jul 2013 08:38:41 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.212.172; Received: by mail-wi0-f172.google.com with SMTP id hj13so3538239wib.5 for ; Wed, 31 Jul 2013 08:38:40 -0700 (PDT) X-Received: by 10.194.248.130 with SMTP id ym2mr719053wjc.61.1375285120858; Wed, 31 Jul 2013 08:38:40 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id u9sm3135483wif.6.2013.07.31.08.38.38 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 31 Jul 2013 08:38:39 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org, ian.campbell@citrix.com Cc: stefano.stabellini@eu.citrix.com, patches@linaro.org, Julien Grall Subject: [PATCH v2 3/8] xen/arm: Use define instead of hardcoded value in debug-pl011 Date: Wed, 31 Jul 2013 16:38:23 +0100 Message-Id: <1375285109-3053-4-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1375285109-3053-1-git-send-email-julien.grall@linaro.org> References: <1375285109-3053-1-git-send-email-julien.grall@linaro.org> X-Gm-Message-State: ALoCoQmFTFV+Jl9aeuyZdiYMSWLgA7NGOe9ZU51jLd/gBzGlLZhE5edN+8F3FSbTgDzO13DBM2F4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 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: , Signed-off-by: Julien Grall --- xen/arch/arm/arm32/debug-pl011.inc | 18 ++++++++++-------- xen/include/asm-arm/pl011-uart.h | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/arm32/debug-pl011.inc b/xen/arch/arm/arm32/debug-pl011.inc index 8b085b8..6a64dbf 100644 --- a/xen/arch/arm/arm32/debug-pl011.inc +++ b/xen/arch/arm/arm32/debug-pl011.inc @@ -16,19 +16,21 @@ * GNU General Public License for more details. */ +#include + /* PL011 UART initialization * rb: register which contains the UART base address * rc: scratch register 1 * rd: scratch register 2 (unused here) */ .macro early_uart_init rb, rc, rd mov \rc, #(7372800 / EARLY_PRINTK_BAUD % 16) - str \rc, [\rb, #0x28] /* -> UARTFBRD (Baud divisor fraction) */ + str \rc, [\rb, #FBRD] /* -> UARTFBRD (Baud divisor fraction) */ mov \rc, #(7372800 / EARLY_PRINTK_BAUD / 16) - str \rc, [\rb, #0x24] /* -> UARTIBRD (Baud divisor integer) */ + str \rc, [\rb, #IBRD] /* -> UARTIBRD (Baud divisor integer) */ mov \rc, #0x60 /* 8n1 */ - str \rc, [\rb, #0x2C] /* -> UARTLCR_H (Line control) */ - ldr \rc, =0x00000301 /* RXE | TXE | UARTEN */ - str \rc, [\rb, #0x30] /* -> UARTCR (Control Register) */ + str \rc, [\rb, #LCR_H] /* -> UARTLCR_H (Line control) */ + ldr \rc, =(RXE | TXE | UARTEN) /* RXE | TXE | UARTEN */ + str \rc, [\rb, #CR] /* -> UARTCR (Control Register) */ .endm /* PL011 UART wait UART to be ready to transmit @@ -36,8 +38,8 @@ * rc: scratch register */ .macro early_uart_ready rb, rc 1: - ldr \rc, [\rb, #0x18] /* <- UARTFR (Flag register) */ - tst \rc, #0x8 /* Check BUSY bit */ + ldr \rc, [\rb, #FR] /* <- UARTFR (Flag register) */ + tst \rc, #BUSY /* Check BUSY bit */ bne 1b /* Wait for the UART to be ready */ .endm @@ -45,7 +47,7 @@ * rb: register which contains the UART base address * rt: register which contains the character to transmit */ .macro early_uart_transmit rb, rt - str \rt, [\rb] /* -> UARTDR (Data Register) */ + str \rt, [\rb, #DR] /* -> UARTDR (Data Register) */ .endm /* diff --git a/xen/include/asm-arm/pl011-uart.h b/xen/include/asm-arm/pl011-uart.h index 8c4edd4..3332c51 100644 --- a/xen/include/asm-arm/pl011-uart.h +++ b/xen/include/asm-arm/pl011-uart.h @@ -45,6 +45,7 @@ /* FR bits */ #define TXFE (1<<7) /* TX FIFO empty */ #define RXFE (1<<4) /* RX FIFO empty */ +#define BUSY (1<<3) /* Transmit is not complete */ /* LCR_H bits */ #define SPS (1<<7) /* Stick parity select */