From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] Consolidate bootcount code into drivers/bootcount
Date: Mon, 13 Aug 2012 15:11:54 +0200 [thread overview]
Message-ID: <5028FD1A.5010608@gmail.com> (raw)
In-Reply-To: <1338878275-1918-1-git-send-email-sr@denx.de>
Dear Stefan Roese,
On 05.06.2012 08:37, Stefan Roese wrote:
> This patch moves all bootcount implementations into a common
> directory: drivers/bootcount. The generic bootcount driver
> is now usable not only by powerpc platforms, but others as well.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
> Cc: Christian Riesch <christian.riesch@omicron.at>
> Cc: Manfred Rudigier <manfred.rudigier@omicron.at>
> Cc: Mike Frysinger <vapier@gentoo.org>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Reinhard Meyer <reinhard.meyer@emk-elektronik.de>
> Tested-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> Tested-by: Christian Riesch <christian.riesch@omicron.at>
> ---
> v3:
> - Moved le-/be-accessors into header so that they now can be
> used by all bootcount drivers.
> - Changed CONFIG_BOOTCOUNT_LE to CONFIG_SYS_BOOTCOUNT_LE
> - Enabled CONFIG_SYS_BOOTCOUNT_LE in highbank
> - Enabled CONFIG_SYS_BOOTCOUNT_SINGLEWORD in highbank
>
> v2:
> - Added CONFIG_BOOTCOUNT_LE to bootcount_davinci.c and enabled it
> in calimain.h to select little-endian accessors.
>
> Makefile | 3 +
> arch/arm/cpu/arm926ejs/at91/cpu.c | 26 -------
> arch/arm/cpu/armv7/highbank/Makefile | 2 +-
> arch/arm/cpu/armv7/highbank/bootcount.c | 36 ----------
> arch/arm/cpu/ixp/cpu.c | 22 ------
> arch/powerpc/lib/Makefile | 1 -
> board/enbw/enbw_cmc/enbw_cmc.c | 29 --------
> board/keymile/km_arm/km_arm.c | 51 --------------
> board/omicron/calimain/calimain.c | 29 --------
> drivers/bootcount/Makefile | 47 +++++++++++++
> .../powerpc/lib => drivers/bootcount}/bootcount.c | 25 ++++---
> drivers/bootcount/bootcount_at91.c | 43 ++++++++++++
> .../bootcount/bootcount_blackfin.c | 0
> drivers/bootcount/bootcount_davinci.c | 49 +++++++++++++
> drivers/bootcount/bootcount_ram.c | 72 ++++++++++++++++++++
> include/bootcount.h | 42 ++++++++++++
> include/configs/calimain.h | 1 +
> include/configs/highbank.h | 2 +
> include/configs/km/km_arm.h | 2 +
> 19 files changed, 276 insertions(+), 206 deletions(-)
> delete mode 100644 arch/arm/cpu/armv7/highbank/bootcount.c
> create mode 100644 drivers/bootcount/Makefile
> rename {arch/powerpc/lib => drivers/bootcount}/bootcount.c (84%)
> create mode 100644 drivers/bootcount/bootcount_at91.c
> rename arch/blackfin/cpu/bootcount.c => drivers/bootcount/bootcount_blackfin.c (100%)
> create mode 100644 drivers/bootcount/bootcount_davinci.c
> create mode 100644 drivers/bootcount/bootcount_ram.c
> create mode 100644 include/bootcount.h
>
> diff --git a/Makefile b/Makefile
> index 659e8f2..8fd51b8 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -249,6 +249,9 @@ LIBS += net/libnet.o
> LIBS += disk/libdisk.o
> LIBS += drivers/bios_emulator/libatibiosemu.o
> LIBS += drivers/block/libblock.o
> +ifeq ($(CONFIG_BOOTCOUNT_LIMIT),y)
> +LIBS += drivers/bootcount/libbootcount.o
> +endif
> LIBS += drivers/dma/libdma.o
> LIBS += drivers/fpga/libfpga.o
> LIBS += drivers/gpio/libgpio.o
> diff --git a/arch/arm/cpu/arm926ejs/at91/cpu.c b/arch/arm/cpu/arm926ejs/at91/cpu.c
> index c47fb31..5cf4fad 100644
> --- a/arch/arm/cpu/arm926ejs/at91/cpu.c
> +++ b/arch/arm/cpu/arm926ejs/at91/cpu.c
> @@ -71,29 +71,3 @@ int print_cpuinfo(void)
> return 0;
> }
> #endif
> -
> -#ifdef CONFIG_BOOTCOUNT_LIMIT
> -/*
> - * We combine the BOOTCOUNT_MAGIC and bootcount in one 32-bit register.
> - * This is done so we need to use only one of the four GPBR registers.
> - */
> -void bootcount_store (ulong a)
> -{
> - at91_gpbr_t *gpbr = (at91_gpbr_t *) ATMEL_BASE_GPBR;
> -
> - writel((BOOTCOUNT_MAGIC & 0xffff0000) | (a & 0x0000ffff),
> - &gpbr->reg[AT91_GPBR_INDEX_BOOTCOUNT]);
> -}
> -
> -ulong bootcount_load (void)
> -{
> - at91_gpbr_t *gpbr = (at91_gpbr_t *) ATMEL_BASE_GPBR;
> -
> - ulong val = readl(&gpbr->reg[AT91_GPBR_INDEX_BOOTCOUNT]);
> - if ((val & 0xffff0000) != (BOOTCOUNT_MAGIC & 0xffff0000))
> - return 0;
> - else
> - return val & 0x0000ffff;
> -}
> -
> -#endif /* CONFIG_BOOTCOUNT_LIMIT */
<snip>
> diff --git a/drivers/bootcount/Makefile b/drivers/bootcount/Makefile
> new file mode 100644
> index 0000000..3d5ec13
> --- /dev/null
> +++ b/drivers/bootcount/Makefile
> @@ -0,0 +1,47 @@
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> +# MA 02111-1307 USA
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB := $(obj)libbootcount.o
> +
> +COBJS-y += bootcount.o
> +COBJS-$(CONFIG_AT91SAM9XE) += bootcount_at91.o
I tend to NAK this. Before it was available to all at91 processors (keep
in mind nearly all at91 have this gpbr register). Now it is only
available to AT91SAM9XE processor series which is the only user for
bootcount in mainline. I fear we may break some not mainline boards
here. I would prefer something that includes all different at91 SoC by
default (except rm9200).
I have no solution yet but send this to prevent a v4. Will send a
proposal for at91 later this day.
Best regards
Andreas Bie?mann
next prev parent reply other threads:[~2012-08-13 13:11 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
2012-08-13 13:11 ` Andreas Bießmann [this message]
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=5028FD1A.5010608@gmail.com \
--to=andreas.devel@googlemail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox