From patchwork Thu Aug 1 16:09:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 18723 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 92095246CC for ; Thu, 1 Aug 2013 16:09:47 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id 15sf2830636vea.1 for ; Thu, 01 Aug 2013 09:09:47 -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=dIj0/HSzPh1Mip40tCCJa+gysepcn1iyI2KTfnrR43E=; b=BZxhzHSxjwkuer2lWSgJHbUisUhayEf6LjfJOT+jU0QSZaokiYizkSLlcsFmJwiZCY +W7pPZHzSZ1UvctIQ8I/Bid9V+YyLgN7JqFwz0Pa2ncSh0+8umKZgxQS2s75BZZKhKsC 80v7BcFujxO3smKMTBX5Frj+u8esYuc3XJoP8DkP/Am1lw048kD+oGO8d/XO3J0tz+Ga RCZv4h4BiDv4aiDITQq8e5AQahZB7aGLK0gdSrFzgRn2M7tStELD530B3NXF09vqMA6W mdOXhq6X4iDg1ZClkSy2O3R14z5Z2Ppu83sCDyz8xoQgHAm0RdEbpTihkGPrJ7tQ1yZA btag== X-Received: by 10.236.111.40 with SMTP id v28mr859468yhg.27.1375373387349; Thu, 01 Aug 2013 09:09:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.73.234 with SMTP id o10ls1172592qev.24.gmail; Thu, 01 Aug 2013 09:09:47 -0700 (PDT) X-Received: by 10.58.237.105 with SMTP id vb9mr734732vec.2.1375373387180; Thu, 01 Aug 2013 09:09:47 -0700 (PDT) Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by mx.google.com with ESMTPS id f8si770868vec.123.2013.08.01.09.09.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Aug 2013 09:09:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.53 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.53; Received: by mail-vb0-f53.google.com with SMTP id i3so2300845vbh.12 for ; Thu, 01 Aug 2013 09:09:46 -0700 (PDT) X-Received: by 10.58.154.34 with SMTP id vl2mr714578veb.35.1375373386845; Thu, 01 Aug 2013 09:09:46 -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 pc8csp307252vcb; Thu, 1 Aug 2013 09:09:46 -0700 (PDT) X-Received: by 10.180.188.202 with SMTP id gc10mr1838204wic.3.1375373385076; Thu, 01 Aug 2013 09:09:45 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id lm2si1802591wic.68.2013.08.01.09.09.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Aug 2013 09:09:45 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.50; Received: by mail-wg0-f50.google.com with SMTP id m15so1865059wgh.29 for ; Thu, 01 Aug 2013 09:09:44 -0700 (PDT) X-Received: by 10.194.243.129 with SMTP id wy1mr1844145wjc.47.1375373384511; Thu, 01 Aug 2013 09:09:44 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id a8sm4594556wie.6.2013.08.01.09.09.43 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Aug 2013 09:09:43 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, tim@xen.org, Julien Grall Subject: [PATCH v3 1/7] pl011: Move registers' definition in a separate file Date: Thu, 1 Aug 2013 17:09:26 +0100 Message-Id: <1375373372-15009-2-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1375373372-15009-1-git-send-email-julien.grall@linaro.org> References: <1375373372-15009-1-git-send-email-julien.grall@linaro.org> X-Gm-Message-State: ALoCoQl6gNWs3SmdGDXngxgGqZ32Zxf4T/QCoKtPBgNeKAL2UC4ywYPGFAVLBErAVF+32GwE1aC1 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.212.53 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 Reviewed-by: Tim Deegan --- Changes in v3: - Add missing s-o-b --- xen/drivers/char/pl011.c | 48 +---------------------- xen/include/asm-arm/pl011-uart.h | 80 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 47 deletions(-) create mode 100644 xen/include/asm-arm/pl011-uart.h diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c index 9456f20..fd87e68 100644 --- a/xen/drivers/char/pl011.c +++ b/xen/drivers/char/pl011.c @@ -28,6 +28,7 @@ #include #include #include +#include static struct pl011 { unsigned int baud, clock_hz, data_bits, parity, stop_bits; @@ -41,53 +42,6 @@ static struct pl011 { /* bool_t probing, intr_works; */ } pl011_com = {0}; -/* PL011 register addresses */ -#define DR (0x00) -#define RSR (0x04) -#define FR (0x18) -#define ILPR (0x20) -#define IBRD (0x24) -#define FBRD (0x28) -#define LCR_H (0x2c) -#define CR (0x30) -#define IFLS (0x34) -#define IMSC (0x38) -#define RIS (0x3c) -#define MIS (0x40) -#define ICR (0x44) -#define DMACR (0x48) - -/* CR bits */ -#define RXE (1<<9) /* Receive enable */ -#define TXE (1<<8) /* Transmit enable */ -#define UARTEN (1<<0) /* UART enable */ - -/* FR bits */ -#define TXFE (1<<7) /* TX FIFO empty */ -#define RXFE (1<<4) /* RX FIFO empty */ - -/* LCR_H bits */ -#define SPS (1<<7) /* Stick parity select */ -#define FEN (1<<4) /* FIFO enable */ -#define STP2 (1<<3) /* Two stop bits select */ -#define EPS (1<<2) /* Even parity select */ -#define PEN (1<<1) /* Parity enable */ -#define BRK (1<<0) /* Send break */ - -/* Interrupt bits (IMSC, MIS, ICR) */ -#define OEI (1<<10) /* Overrun Error interrupt mask */ -#define BEI (1<<9) /* Break Error interrupt mask */ -#define PEI (1<<8) /* Parity Error interrupt mask */ -#define FEI (1<<7) /* Framing Error interrupt mask */ -#define RTI (1<<6) /* Receive Timeout interrupt mask */ -#define TXI (1<<5) /* Transmit interrupt mask */ -#define RXI (1<<4) /* Receive interrupt mask */ -#define DSRMI (1<<3) /* nUARTDSR Modem interrupt mask */ -#define DCDMI (1<<2) /* nUARTDCD Modem interrupt mask */ -#define CTSMI (1<<1) /* nUARTCTS Modem interrupt mask */ -#define RIMI (1<<0) /* nUARTRI Modem interrupt mask */ -#define ALLI OEI|BEI|PEI|FEI|RTI|TXI|RXI|DSRMI|DCDMI|CTSMI|RIMI - /* These parity settings can be ORed directly into the LCR. */ #define PARITY_NONE (0) #define PARITY_ODD (PEN) diff --git a/xen/include/asm-arm/pl011-uart.h b/xen/include/asm-arm/pl011-uart.h new file mode 100644 index 0000000..8c4edd4 --- /dev/null +++ b/xen/include/asm-arm/pl011-uart.h @@ -0,0 +1,80 @@ +/* + * xen/include/asm-arm/pl011-uart.h + * + * Common constant definition between early printk and the UART driver + * for the pl011 UART + * + * Tim Deegan + * Copyright (c) 2011 Citrix Systems. + * + * 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. + */ + +#ifndef __ASM_ARM_PL011_H +#define __ASM_ARM_PL011_H + +/* PL011 register addresses */ +#define DR (0x00) +#define RSR (0x04) +#define FR (0x18) +#define ILPR (0x20) +#define IBRD (0x24) +#define FBRD (0x28) +#define LCR_H (0x2c) +#define CR (0x30) +#define IFLS (0x34) +#define IMSC (0x38) +#define RIS (0x3c) +#define MIS (0x40) +#define ICR (0x44) +#define DMACR (0x48) + +/* CR bits */ +#define RXE (1<<9) /* Receive enable */ +#define TXE (1<<8) /* Transmit enable */ +#define UARTEN (1<<0) /* UART enable */ + +/* FR bits */ +#define TXFE (1<<7) /* TX FIFO empty */ +#define RXFE (1<<4) /* RX FIFO empty */ + +/* LCR_H bits */ +#define SPS (1<<7) /* Stick parity select */ +#define FEN (1<<4) /* FIFO enable */ +#define STP2 (1<<3) /* Two stop bits select */ +#define EPS (1<<2) /* Even parity select */ +#define PEN (1<<1) /* Parity enable */ +#define BRK (1<<0) /* Send break */ + +/* Interrupt bits (IMSC, MIS, ICR) */ +#define OEI (1<<10) /* Overrun Error interrupt mask */ +#define BEI (1<<9) /* Break Error interrupt mask */ +#define PEI (1<<8) /* Parity Error interrupt mask */ +#define FEI (1<<7) /* Framing Error interrupt mask */ +#define RTI (1<<6) /* Receive Timeout interrupt mask */ +#define TXI (1<<5) /* Transmit interrupt mask */ +#define RXI (1<<4) /* Receive interrupt mask */ +#define DSRMI (1<<3) /* nUARTDSR Modem interrupt mask */ +#define DCDMI (1<<2) /* nUARTDCD Modem interrupt mask */ +#define CTSMI (1<<1) /* nUARTCTS Modem interrupt mask */ +#define RIMI (1<<0) /* nUARTRI Modem interrupt mask */ +#define ALLI OEI|BEI|PEI|FEI|RTI|TXI|RXI|DSRMI|DCDMI|CTSMI|RIMI + +#endif /* __ASM_ARM_PL011_H */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */