mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/5] device: introduce resource structure to simplify resource delaration
Date: Sun, 21 Nov 2010 05:28:54 +0100	[thread overview]
Message-ID: <20101121042854.GI4216@game.jcrosoft.org> (raw)
In-Reply-To: <20101120135824.GE4216@game.jcrosoft.org>

On 14:58 Sat 20 Nov     , Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 14:40 Sat 20 Nov     , Sascha Hauer wrote:
> > On Fri, Nov 19, 2010 at 12:30:09PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > On 09:00 Fri 19 Nov     , Sascha Hauer wrote:
> > > > Hi J,
> > > > 
> > > > On Fri, Nov 12, 2010 at 07:18:54PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > > > introdude also some helper to manager them
> > > > > 
> > > > > and add multi resource per device support
> > > > > 
> > > > > ram device: use resource structure instead of memory_platform_data
> > > > > 
> > > > > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > > > 
> > > > 
> > > > You shouldn't use a resource_size_t type to access registers. This will
> > > > lead to problems when we start to support 64bit resource sizes
> > > no as resource_size_t is 64 bit aware
> > 
> > And exactly this is the problem. void * is usually only 32bit on arm.
> > This will lead to compiler warnings and sparse isn't happy about
> > unsigned long in readl/writel anyway.
> IIRC on arm resource_size_t is never 64bit at least on the current ARMvx
> 
> > 
> > > >. Instead we should introduce a
> > > > 
> > > > #define resource_size_to_iomem(size) (void __force __iomem *)(size)
> > > > 
> > > > macro which does the conversion to a void __iomem * type. In a more
> > > > advanced version this could also spit a warning when the resource start
> > > > is bigger than a pointer type. As an additional plus we'll get rid of
> > > > some sparse warnings where map_base is used for readl/writel.
> > > we do not do in the kernel and do see the advantage here for the ressource
> > > in mind it's in the drivers we need to do it
> > > if necessary
> > 
> > resource_size_t is never passed to readl/writel in the kernel.
> yeah but the resources are cast in the drivers
I check on x86 and void is 4 byte on 32bit and 8bytes on 64bit

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2010-11-21  4:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12 18:02 [To test] [PATCH 0/5] device: introduce resource structure Jean-Christophe PLAGNIOL-VILLARD
2010-11-12 18:18 ` [PATCH 1/5] device: introduce resource structure to simplify resource delaration Jean-Christophe PLAGNIOL-VILLARD
2010-11-19  8:00   ` Sascha Hauer
2010-11-19 11:30     ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-20 13:40       ` Sascha Hauer
2010-11-20 13:58         ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-21  4:28           ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2010-11-21  6:46             ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-23  7:36             ` Sascha Hauer
2010-11-23  8:25               ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-23 11:34                 ` Sascha Hauer
2011-01-27  8:20   ` Sascha Hauer
2010-11-12 18:18 ` [PATCH 2/5] mem: add multiple resource support Jean-Christophe PLAGNIOL-VILLARD
2010-11-12 18:18 ` [PATCH 3/5] arm/setup_memory_tags: " Jean-Christophe PLAGNIOL-VILLARD
2010-11-12 18:18 ` [PATCH 4/5] edb93xx: convert to multiple mem resources Jean-Christophe PLAGNIOL-VILLARD
2010-11-12 18:18 ` [PATCH 5/5] pcm037: " Jean-Christophe PLAGNIOL-VILLARD
2010-11-17 13:59 ` [PATCH 1/2] mem: multiple resource support allow exclude a resource Jean-Christophe PLAGNIOL-VILLARD
2010-11-19  8:24   ` Sascha Hauer
2010-11-19 11:31     ` Jean-Christophe PLAGNIOL-VILLARD
2010-11-17 13:59 ` [PATCH 2/2] mem: convert to DEVFS_MEM_BAREBOX_ONLY for freescale-mx25-3-stack/pcm037/pvm038 Jean-Christophe PLAGNIOL-VILLARD
2010-11-17 14:09   ` Baruch Siach
2010-11-17 14:02 ` [To test] [PATCH 0/5] device: introduce resource structure Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101121042854.GI4216@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox