All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] Consolidate bootcount code into drivers/bootcount
Date: Mon, 13 Aug 2012 11:46:35 +0200	[thread overview]
Message-ID: <5028CCFB.8010700@denx.de> (raw)
In-Reply-To: <201208111220.40656.vapier@gentoo.org>

On 08/11/2012 06:20 PM, Mike Frysinger wrote:
> 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

Okay.

>> +all:	$(LIB)
> 
> unused rule -> delete

Okay.

>> --- /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" ?

Okay.

>> +{
>> +	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, bdata);
>> +}
>> +
>> +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

Good idea. I'll send a new version with the 2nd approach later today.

Thanks,
Stefan

  reply	other threads:[~2012-08-13  9:46 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
2012-08-13  9:46   ` Stefan Roese [this message]
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=5028CCFB.8010700@denx.de \
    --to=sr@denx.de \
    --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.