From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH V2 09/33] xen/arm: Add helpers to retrieve an address from the device tree Date: Wed, 08 May 2013 16:32:03 +0100 Message-ID: <518A6FF3.90904@linaro.org> References: <7f3765b91a26e2fb0b07c123df8333c8308021d5.1367979526.git.julien.grall@linaro.org> <1368019424.26321.294.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1368019424.26321.294.camel@zakaz.uk.xensource.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: Ian Campbell Cc: Stefano Stabellini , "patches@linaro.org" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 05/08/2013 02:23 PM, Ian Campbell wrote: > On Wed, 2013-05-08 at 03:33 +0100, Julien Grall wrote: >> Signed-off-by: Julien Grall >> --- >> xen/common/device_tree.c | 343 +++++++++++++++++++++++++++++++++++++++++ >> xen/include/xen/device_tree.h | 22 +++ >> 2 files changed, 365 insertions(+) >> >> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c >> index 449c332..8d37018 100644 >> --- a/xen/common/device_tree.c >> +++ b/xen/common/device_tree.c >> @@ -62,10 +62,38 @@ static void (*dt_printk)(const char *fmt, ...) = early_printk; >> >> #ifdef DEBUG_DT >> # define dt_dprintk(fmt, args...) dt_printk(XENLOG_DEBUG fmt, ##args) >> +static void dt_dump_addr(const char *s, const __be32 *addr, int na) >> +{ >> + dt_dprintk("%s", s); >> + while ( na-- ) >> + dt_dprintk(" %08x", be32_to_cpu(*(addr++))); >> + dt_dprintk("\n"); >> +} >> #else >> # define dt_dprintk(fmt, args...) do {} while ( 0 ) >> +static void dt_dump_addr(const char *s, const __be32 *addr, int na) { } >> #endif >> >> +#define DT_BAD_ADDR ((u64)-1) >> + >> +/* Max address size we deal with */ >> +#define DT_MAX_ADDR_CELLS 4 >> +#define DT_CHECK_ADDR_COUNT(na) ((na) > 0 && (na) <= DT_MAX_ADDR_CELLS) >> +#define DT_CHECK_COUNTS(na, ns) (DT_CHECK_ADDR_COUNT(na) && (ns) > 0) >> + >> +/* Callbacks for bus specific translators */ >> +struct dt_bus >> +{ >> + const char *name; >> + const char *addresses; >> + int (*match)(const struct dt_device_node *parent); >> + void (*count_cells)(const struct dt_device_node *child, >> + int *addrc, int *sizec); >> + u64 (*map)(__be32 *addr, const __be32 *range, int na, int ns, int pna); >> + int (*translate)(__be32 *addr, u64 offset, int na); >> + unsigned int (*get_flags)(const __be32 *addr); > > Spacing is weird here. Hard tabs perhaps? Right. I will fix all the errors on the next patch series. -- Julien