From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCHv2 3/5] xen/arm: Add the new OMAP UART driver. Date: Wed, 07 Aug 2013 14:45:26 +0100 Message-ID: <52024F76.2030503@linaro.org> References: <1375881245-25601-1-git-send-email-baozich@gmail.com> <1375881245-25601-4-git-send-email-baozich@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1375881245-25601-4-git-send-email-baozich@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Chen Baozi Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 08/07/2013 02:14 PM, Chen Baozi wrote: > TI OMAP UART introduces some features such as register access modes, which > makes its configuration and interrupt handling differs from 8250 compatible > UART. Thus, we seperate this driver from ns16550's implementation. > > Signed-off-by: Chen Baozi > --- > config/arm32.mk | 1 + > xen/common/device_tree.c | 15 ++ > xen/drivers/char/Makefile | 1 + > xen/drivers/char/omap-uart.c | 352 ++++++++++++++++++++++++++++++++++++++++++ > xen/include/xen/8250-uart.h | 59 ++++++- > xen/include/xen/device_tree.h | 6 + > 6 files changed, 431 insertions(+), 3 deletions(-) > create mode 100644 xen/drivers/char/omap-uart.c > > diff --git a/config/arm32.mk b/config/arm32.mk > index 8e21158..76e229d 100644 > --- a/config/arm32.mk > +++ b/config/arm32.mk > @@ -11,6 +11,7 @@ CFLAGS += -marm > > HAS_PL011 := y > HAS_EXYNOS4210 := y > +HAS_OMAP := y > > # Use only if calling $(LD) directly. > LDFLAGS_DIRECT += -EL > diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c > index 84d704d..b392c60 100644 > --- a/xen/common/device_tree.c > +++ b/xen/common/device_tree.c > @@ -574,6 +574,21 @@ const void *dt_get_property(const struct dt_device_node *np, > return pp ? pp->value : NULL; > } > > +int dt_property_read_u32(const struct dt_device_node *np, > + const char *name, u32 *out_value) > +{ > + u32 len; > + const __be32 *val; > + > + val = dt_get_property(np, name, &len); > + if ( !val || len > 4 ) > + return 1; > + > + *out_value = be32_to_cpup(val); > + > + return 0; > +} > + This function only returns two values (0 or 1). Can you use bool_t and return true (ie 1) if it succeeded. Cheers, -- Julien