From patchwork Thu Feb 28 11:01:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 2197031 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id A6D3B3FCF6 for ; Thu, 28 Feb 2013 11:07:20 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UB1F5-00024E-Vd; Thu, 28 Feb 2013 11:01:40 +0000 Received: from exprod5og105.obsmtp.com ([64.18.0.180]) by merlin.infradead.org with smtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UB1Ex-0001xV-DO for linux-arm-kernel@lists.infradead.org; Thu, 28 Feb 2013 11:01:32 +0000 Received: from mail-pa0-f72.google.com ([209.85.220.72]) (using TLSv1) by exprod5ob105.postini.com ([64.18.4.12]) with SMTP ID DSNKUS85ASZT9p9uVeTAsDa2DUH4y0mQHeTQ@postini.com; Thu, 28 Feb 2013 03:01:31 PST Received: by mail-pa0-f72.google.com with SMTP id bh2so2434400pad.7 for ; Thu, 28 Feb 2013 03:01:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=eoF0zcQuRqLkPsevZVZrbCRKnESmotmySIUCSLGBvp0=; b=KAWLCSFr9Z+fjWqfWSFSh+RRUx6LTTHnA2sYdn0u1hWrfHdzSlMeIcxcvWXDL88CEv ExyPqQXUs2tPCeA9pPD9pgIdNeKzDCpBnUnOcnzX2woJlXhU+rk4vzePaxCvLwftOld9 Bxf+MHaCL7zTmLxRHVp29DhDw7uyP4/f3AWrd0yItue/TGmA5XR5q9ABUhhPcFT88TbS BypK20FNBOCVqrf3DoIBUB402XggaWI+DxA4QX23O4st1WiABNCPScSkLozNspfXMCrd fiEmMkaycbGfI/VcKiHBsmsSEcRPCIPPbsdEwxg8ZH5KWfNhFztqfp2wSVOHk3ZMxxbh 1VNg== X-Received: by 10.66.75.136 with SMTP id c8mr12662120paw.25.1362049280790; Thu, 28 Feb 2013 03:01:20 -0800 (PST) X-Received: by 10.66.75.136 with SMTP id c8mr12662108paw.25.1362049280712; Thu, 28 Feb 2013 03:01:20 -0800 (PST) Received: from pnqlab006.amcc.com ([122.170.124.90]) by mx.google.com with ESMTPS id hs8sm8023574pbc.27.2013.02.28.03.01.17 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 03:01:19 -0800 (PST) From: Anup Patel To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] arm64: add support for uart earlyprintk Date: Thu, 28 Feb 2013 16:31:08 +0530 Message-Id: <1362049268-26822-1-git-send-email-apatel@apm.com> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQkAVBsGnCw/Z6bdE4o8tWgO6HG5p3Ng8EQmjhvPVqQqJS0u0b6375m9ayrJLG75VSXHaqPTSS36Qhh3x+E3OpQn/X+LaiGPM0PZ5iwu4WjCAyIeYZKojirdF/zPnwiyhnEzn3fwu91jpMai8GeI3jy2vq259XBOFNwT35Gqt5bivCkC+xCwyV302xh2hrPZm6GSNquJ X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130228_060131_624562_718E414D X-CRM114-Status: GOOD ( 14.24 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [64.18.0.180 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Anup Patel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Signed-off-by: Anup Patel --- arch/arm64/kernel/early_printk.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm64/kernel/early_printk.c b/arch/arm64/kernel/early_printk.c index 7e320a2..62953ed 100644 --- a/arch/arm64/kernel/early_printk.c +++ b/arch/arm64/kernel/early_printk.c @@ -29,6 +29,21 @@ static void __iomem *early_base; static void (*printch)(char ch); /* + * UART (8250/16550) single character TX. + */ +static void uart_printch(char ch) +{ +#define UART_LSR 0x14 +#define UART_TX 0x0 + + while (!(readl_relaxed(early_base + UART_LSR) & 0x20)) + ; + writeb_relaxed(ch, early_base + UART_TX); + while (!(readl_relaxed(early_base + UART_LSR) & 0x20)) + ; +} + +/* * PL011 single character TX. */ static void pl011_printch(char ch) @@ -47,6 +62,7 @@ struct earlycon_match { static const struct earlycon_match earlycon_match[] __initconst = { { .name = "pl011", .printch = pl011_printch, }, + { .name = "uart", .printch = uart_printch, }, {} };