All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] Consolidate bootcount code into drivers/bootcount
Date: Sat, 11 Aug 2012 12:20:38 -0400	[thread overview]
Message-ID: <201208111220.40656.vapier@gentoo.org> (raw)
In-Reply-To: <1338878275-1918-1-git-send-email-sr@denx.de>

On Tuesday 05 June 2012 02:37:55 Stefan Roese wrote:
> --- /dev/null
> +++ b/drivers/bootcount/Makefile
>
> +COBJS-$(CONFIG_BFIN_CPU)	+= bootcount_blackfin.o

needs to be CONFIG_BLACKFIN

> +all:	$(LIB)

unused rule -> delete

> --- /dev/null
> +++ b/include/bootcount.h
>
> +#ifdef CONFIG_SYS_BOOTCOUNT_LE
> +static inline void bc_out32(volatile u32 *addr, u32 data)

the bc_xxx names are a little confusing since they overlap so much with the 
existing io.h api.  how about "raw_bootcount_store" ?

> +{
> +	out_le32(addr, data);
> +}
> +
> +static inline u32 bc_in32(volatile u32 *addr)
> +{
> +	return in_le32(addr);
> +}
> +#else
> +static inline void bc_out32(volatile u32 *addr, u32 data)
> +{
> +	out_be32(addr, data);
> +}
> +
> +static inline u32 bc_in32(volatile u32 *addr)
> +{
> +	return in_be32(addr);
> +}
> +#endif

i'm not a big fan of defaulting to an endian regardless of the host.  in this 
case, it appears to benefit ppc only.

what about:
#include <asm/byteorder.h>
#if !defined(CONFIG_SYS_BOOTCOUNT_LE) && !defined(CONFIG_SYS_BOOTCOUNT_BE)
# if __BYTE_ORDER == __LITTLE_ENDIAN
#  define CONFIG_SYS_BOOTCOUNT_LE
# else
#  define CONFIG_SYS_BOOTCOUNT_BE
# endif
#endif

or if you're not a fan of that, then:
#if defined(CONFIG_SYS_BOOTCOUNT_LE)
... current in_le logic ...
#elif defined(CONFIG_SYS_BOOTCOUNT_BE)
... current in_be logic ...
#else
# error "please select one of CONFIG_SYS_BOOTCOUNT_{L,B}E"
#endif

and then add a default to arch/powerpc/include/asm/config.h
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120811/97d73248/attachment.pgp>

  parent reply	other threads:[~2012-08-11 16:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05  6:37 [U-Boot] [PATCH v3] Consolidate bootcount code into drivers/bootcount Stefan Roese
2012-06-05 12:19 ` Rob Herring
2012-08-10 20:32 ` Wolfgang Denk
2012-08-11 16:20 ` Mike Frysinger [this message]
2012-08-13  9:46   ` Stefan Roese
2012-08-13 13:11 ` Andreas Bießmann
2012-08-13 13:37   ` Stefan Roese
2012-08-13 13:48     ` Andreas Bießmann
2012-08-13 14:51       ` Stefan Roese
2012-08-13 15:04         ` Andreas Bießmann
  -- strict thread matches above, loose matches on Subject: below --
2012-08-13 11:56 [U-Boot] [PATCH v4] " Stefan Roese
2012-08-13 16:05 ` [U-Boot] [PATCH v3] " Christian Riesch

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=201208111220.40656.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.