From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Brodkin Date: Thu, 22 Feb 2018 16:07:39 +0000 Subject: [U-Boot] [RFC] ns16550: Add support for AUX regs usage on some ARC SoCs In-Reply-To: <20180222154331.GT4311@bill-the-cat> References: <20180221122605.8128-1-abrodkin@synopsys.com> <20180222154331.GT4311@bill-the-cat> Message-ID: <1519315659.19466.12.camel@synopsys.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Tom, On Thu, 2018-02-22 at 10:43 -0500, Tom Rini wrote: > On Wed, Feb 21, 2018 at 03:26:05PM +0300, Alexey Brodkin wrote: [snip] > > static inline void serial_out_shift(void *addr, int shift, int value) > > { > > -#ifdef CONFIG_SYS_NS16550_PORT_MAPPED > > +#ifdef CONFIG_ARCH_DFSS > > + write_aux_reg((int)addr, value); > > +#elif defined(CONFIG_SYS_NS16550_PORT_MAPPED) > > outb(value, (ulong)addr); > > #elif defined(CONFIG_SYS_NS16550_MEM32) && !defined(CONFIG_SYS_BIG_ENDIAN) > > out_le32(addr, value); > > @@ -70,7 +75,9 @@ static inline void serial_out_shift(void *addr, int shift, int value) > > > > static inline int serial_in_shift(void *addr, int shift) > > { > > -#ifdef CONFIG_SYS_NS16550_PORT_MAPPED > > +#ifdef CONFIG_ARCH_DFSS > > + return read_aux_reg((int)addr); > > +#elif defined(CONFIG_SYS_NS16550_PORT_MAPPED) > > return inb((ulong)addr); > > #elif defined(CONFIG_SYS_NS16550_MEM32) && !defined(CONFIG_SYS_BIG_ENDIAN) > > return in_le32(addr); > > As always, thanks for the detailed explanation. Yes, I think that of > the options, putting the details in read/write_aux_reg (and please make > sure read/write_aux_reg have a good function comment too) is the best > choice. Thanks! Frankly I didn't understand your comment well enough :) Do you suggest to keep proposed implementation (i.e. modification of serial_{in|out}_shift()) but add comments on what do we do and why or you really meant something completely different? -Alexey