From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:49978 "EHLO mho-01-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750720Ab0JGV1R (ORCPT ); Thu, 7 Oct 2010 17:27:17 -0400 Date: Thu, 7 Oct 2010 14:27:07 -0700 From: Tony Lindgren Subject: Re: [PATCH] serial: DCC(JTAG) serial and console emulation support Message-ID: <20101007212707.GI7558@atomide.com> References: <1286305668-19987-1-git-send-email-dwalker@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1286305668-19987-1-git-send-email-dwalker@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-ID: To: Daniel Walker Cc: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, "Hyok S. Choi" , Jeff Ohlstein Hi, * Daniel Walker [101005 11:59]: > +#if !defined(CONFIG_CPU_V7) > +static inline char > +__dcc_getchar(void) > +{ > + char __c; > + > + asm("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg" > + : "=r" (__c) : : "cc"); > + > + return __c; > +} > +#else > +static inline char > +__dcc_getchar(void) > +{ > + char __c; > + > + asm( > + "get_wait: mrc p14, 0, pc, c0, c1, 0 \n\ > + bne get_wait \n\ > + mrc p14, 0, %0, c0, c5, 0 @ read comms data reg" > + : "=r" (__c) : : "cc"); > + > + return __c; > +} > +#endif > + > +#if !defined(CONFIG_CPU_V7) > +static inline void > +__dcc_putchar(char c) > +{ > + asm("mcr p14, 0, %0, c0, c5, 0 @ write a char" > + : /* no output register */ > + : "r" (c) : "cc"); > +} > +#else > +static inline void > +__dcc_putchar(char c) > +{ > + asm( > + "put_wait: mrc p14, 0, pc, c0, c1, 0 \n\ > + bcs put_wait \n\ > + mcr p14, 0, %0, c0, c5, 0 " > + : : "r" (c) : "cc"); > +} > +#endif Can you please pass the read and write functions to the driver in platform_data? We are already booting kernels with both ARMv6 and 7 compiled in. Also, as it's a driver, other architectures may want to use it too. Regards, Tony From mboxrd@z Thu Jan 1 00:00:00 1970 From: tony@atomide.com (Tony Lindgren) Date: Thu, 7 Oct 2010 14:27:07 -0700 Subject: [PATCH] serial: DCC(JTAG) serial and console emulation support In-Reply-To: <1286305668-19987-1-git-send-email-dwalker@codeaurora.org> References: <1286305668-19987-1-git-send-email-dwalker@codeaurora.org> Message-ID: <20101007212707.GI7558@atomide.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, * Daniel Walker [101005 11:59]: > +#if !defined(CONFIG_CPU_V7) > +static inline char > +__dcc_getchar(void) > +{ > + char __c; > + > + asm("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg" > + : "=r" (__c) : : "cc"); > + > + return __c; > +} > +#else > +static inline char > +__dcc_getchar(void) > +{ > + char __c; > + > + asm( > + "get_wait: mrc p14, 0, pc, c0, c1, 0 \n\ > + bne get_wait \n\ > + mrc p14, 0, %0, c0, c5, 0 @ read comms data reg" > + : "=r" (__c) : : "cc"); > + > + return __c; > +} > +#endif > + > +#if !defined(CONFIG_CPU_V7) > +static inline void > +__dcc_putchar(char c) > +{ > + asm("mcr p14, 0, %0, c0, c5, 0 @ write a char" > + : /* no output register */ > + : "r" (c) : "cc"); > +} > +#else > +static inline void > +__dcc_putchar(char c) > +{ > + asm( > + "put_wait: mrc p14, 0, pc, c0, c1, 0 \n\ > + bcs put_wait \n\ > + mcr p14, 0, %0, c0, c5, 0 " > + : : "r" (c) : "cc"); > +} > +#endif Can you please pass the read and write functions to the driver in platform_data? We are already booting kernels with both ARMv6 and 7 compiled in. Also, as it's a driver, other architectures may want to use it too. Regards, Tony