All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH 30/36] bdinfo: arm: Move ARM-specific info into its own file
Date: Wed, 6 May 2020 18:10:23 +0200	[thread overview]
Message-ID: <18f3a5fd-fee2-ea20-5873-4458cade228d@gmail.com> (raw)
In-Reply-To: <20200504231732.98778-22-sjg@chromium.org>



Am 05.05.20 um 01:17 schrieb Simon Glass:
> We don't really want to have ARM-specific code in a generic file. Create
> a new arch-specific function to hold it, and move it into that.
> 
> Make the function weak so that any arch can implement it.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  arch/arm/lib/Makefile |  1 +
>  arch/arm/lib/bdinfo.c | 51 +++++++++++++++++++++++++++++++++++++++++++
>  cmd/bdinfo.c          | 44 +++++--------------------------------
>  include/init.h        |  3 +++
>  4 files changed, 61 insertions(+), 38 deletions(-)
>  create mode 100644 arch/arm/lib/bdinfo.c
> 
> diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
> index b839aa7a50..27b12e7f2b 100644
> --- a/arch/arm/lib/Makefile
> +++ b/arch/arm/lib/Makefile
> @@ -43,6 +43,7 @@ obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMSET) += memset.o
>  obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMCPY) += memcpy.o
>  obj-$(CONFIG_SEMIHOSTING) += semihosting.o
>  
> +obj-y	+= bdinfo.o
>  obj-y	+= sections.o
>  obj-y	+= stack.o
>  ifdef CONFIG_CPU_V7M
> diff --git a/arch/arm/lib/bdinfo.c b/arch/arm/lib/bdinfo.c
> new file mode 100644
> index 0000000000..ce8edd0313
> --- /dev/null
> +++ b/arch/arm/lib/bdinfo.c
> @@ -0,0 +1,51 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * ARM-specific information for the 'bd' command
> + *
> + * (C) Copyright 2003
> + * Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> + */
> +
> +#include <common.h>
> +#include <init.h>
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +void arch_print_bdinfo(void)
> +{
> +#ifdef CONFIG_SYS_MEM_RESERVE_SECURE
> +	if (gd->arch.secure_ram & MEM_RESERVE_SECURE_SECURED) {
> +		bdinfo_print_num("Secure ram",
> +				 gd->arch.secure_ram &
> +				 MEM_RESERVE_SECURE_ADDR_MASK);
> +	}
> +#endif
> +#ifdef CONFIG_RESV_RAM
> +	if (gd->arch.resv_ram)
> +		bdinfo_print_num("Reserved ram", gd->arch.resv_ram);
> +#endif
> +#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
> +	bdinfo_print_num("TLB addr", gd->arch.tlb_addr);
> +#endif
> +	bdinfo_print_num("irq_sp", gd->irq_sp);	/* irq stack pointer */
> +	bdinfo_print_num("sp start ", gd->start_addr_sp);
> +	/*
> +	 * TODO: Currently only support for davinci SOC's is added.
> +	 * Remove this check once all the board implement this.
> +	 */
> +#ifdef CONFIG_CLOCKS
> +	printf("ARM frequency = %ld MHz\n", gd->bd->bi_arm_freq);
> +	printf("DSP frequency = %ld MHz\n", gd->bd->bi_dsp_freq);
> +	printf("DDR frequency = %ld MHz\n", gd->bd->bi_ddr_freq);
> +#endif
> +#ifdef CONFIG_BOARD_TYPES
> +	printf("Board Type  = %ld\n", gd->board_type);
> +#endif



> +#if CONFIG_VAL(SYS_MALLOC_F_LEN)
> +	printf("Early malloc usage: %lx / %x\n", gd->malloc_ptr,
> +	       CONFIG_VAL(SYS_MALLOC_F_LEN));
> +#endif
> +#if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
> +	bdinfo_print_num("multi_dtb_fit", (ulong)gd->multi_dtb_fit);
> +#endif
> +}

that part is not really ARM specific. Maybe it's useful in the generic
function?

-- 
- Daniel

  parent reply	other threads:[~2020-05-06 16:10 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 23:16 [PATCH 00/36] Tidy up the 'bd' command Simon Glass
2020-05-04 23:16 ` [PATCH 01/36] bdinfo: nds32: Use generic bd_info Simon Glass
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA4704736@ATCPCS16.andestech.com>
2020-05-05  1:16     ` Rick Chen
2020-05-06  8:06   ` Bin Meng
2020-05-04 23:16 ` [PATCH 02/36] bdinfo: riscv: " Simon Glass
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA4704741@ATCPCS16.andestech.com>
2020-05-05  1:19     ` Rick Chen
2020-05-06  8:06   ` Bin Meng
2020-05-04 23:16 ` [PATCH 03/36] bdinfo: m68k: Drop bd_info->bi_ipbfreq Simon Glass
2020-05-06  8:06   ` Bin Meng
2020-05-04 23:17 ` [PATCH 04/36] bdinfo: xtensa: Create a generic do_bdinfo for xtensa Simon Glass
2020-05-06  8:07   ` Bin Meng
2020-05-04 23:17 ` [PATCH 05/36] bdinfo: mips: Use the generic bd command Simon Glass
2020-05-06  8:07   ` Bin Meng
2020-05-06 15:29   ` Daniel Schwierzeck
2020-05-04 23:17 ` [PATCH 06/36] bdinfo: nios2: " Simon Glass
2020-05-06  8:07   ` Bin Meng
2020-05-04 23:17 ` [PATCH 07/36] bdinfo: microblaze: " Simon Glass
2020-05-06  8:07   ` Bin Meng
2020-05-06 15:56   ` Daniel Schwierzeck
2020-05-10 20:36     ` Simon Glass
2020-05-04 23:17 ` [PATCH 08/36] bdinfo: sh: " Simon Glass
2020-05-06  8:07   ` Bin Meng
2020-05-04 23:17 ` [PATCH 09/36] bdinfo: x86: " Simon Glass
2020-05-06  8:07   ` Bin Meng
2020-05-04 23:17 ` [PATCH 10/36] bdinfo: sandbox: " Simon Glass
2020-05-06  8:07   ` Bin Meng
2020-05-04 23:17 ` [PATCH 11/36] bdinfo: nds32: " Simon Glass
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA470474E@ATCPCS16.andestech.com>
2020-05-05  1:22     ` Rick Chen
2020-05-06  8:07   ` Bin Meng
2020-05-04 23:17 ` [PATCH 12/36] bdinfo: riscv: " Simon Glass
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA4704755@ATCPCS16.andestech.com>
2020-05-05  1:24     ` Rick Chen
2020-05-06  8:07   ` Bin Meng
2020-05-04 23:17 ` [PATCH 13/36] bdinfo: arm: " Simon Glass
2020-05-06  8:07   ` Bin Meng
2020-05-04 23:17 ` [PATCH 14/36] bdinfo: Drop the option to not use the generic 'bd' command Simon Glass
2020-05-06  8:07   ` Bin Meng
2020-05-04 23:17 ` [PATCH 15/36] bdinfo: Drop unused __maybe_unused Simon Glass
2020-05-06  8:07   ` Bin Meng
2020-05-04 23:17 ` [PATCH 16/36] bdinfo: microblaze: sh: nios2: Drop arch-specific flash info Simon Glass
2020-05-06  8:09   ` Bin Meng
2020-05-04 23:17 ` [PATCH 17/36] bdinfo: Drop unnecessary inline on functions Simon Glass
2020-05-06  8:09   ` Bin Meng
2020-05-04 23:17 ` [PATCH 18/36] bdinfo: Drop print_std_bdinfo() Simon Glass
2020-05-06  8:09   ` Bin Meng
2020-05-04 23:17 ` [PATCH 19/36] bdinfo: ppc: Drop arch-specific print_baudrate() Simon Glass
2020-05-06  8:09   ` Bin Meng
2020-05-06 15:09   ` Stefan Roese
2020-05-04 23:17 ` [PATCH 20/36] bdinfo: sh: arc: Drop arch-specific print_bi_mem() Simon Glass
2020-05-06  8:09   ` Bin Meng
2020-05-06  9:04     ` Alexey Brodkin
2020-05-04 23:17 ` [PATCH 21/36] bdinfo: Drop print_bi_boot_params() Simon Glass
2020-05-06  8:09   ` Bin Meng
2020-05-04 23:17 ` [PATCH 22/36] bdinfo: Drop print_bi_flash() Simon Glass
2020-05-06  8:09   ` Bin Meng
2020-05-06 14:10     ` Tom Rini
2020-05-06 14:47     ` Simon Glass
2020-05-04 23:17 ` [PATCH 23/36] bdinfo: Drop print_cpu_word_size() Simon Glass
2020-05-06  8:09   ` Bin Meng
2020-05-04 23:17 ` [PATCH 24/36] bdinfo: net: ppc: Drop bi_enet1addr and other similar info Simon Glass
2020-05-06  8:09   ` Bin Meng
2020-05-06 15:09   ` Stefan Roese
2020-05-04 23:17 ` [PATCH 25/36] bdinfo: net: ppc: Drop prints for CONFIG_HAS_ETHn Simon Glass
2020-05-06  8:09   ` Bin Meng
2020-05-06 15:10   ` Stefan Roese
2020-05-04 23:17 ` [PATCH 26/36] bdinfo: net: Drop legacy ethernet bdinfo Simon Glass
2020-05-06  8:09   ` Bin Meng
2020-05-06 14:47     ` Simon Glass
2020-05-04 23:17 ` [PATCH 27/36] bdinfo: net: Inline print_eths() Simon Glass
2020-05-06  8:10   ` Bin Meng
2020-05-04 23:17 ` [PATCH 28/36] bdinfo: net: Inline print_eth_ip_addr() Simon Glass
2020-05-06  8:10   ` Bin Meng
2020-05-04 23:17 ` [PATCH 29/36] bdinfo: Export some basic printing functions Simon Glass
2020-05-06  8:10   ` Bin Meng
2020-05-04 23:17 ` [PATCH 30/36] bdinfo: arm: Move ARM-specific info into its own file Simon Glass
2020-05-06  8:10   ` Bin Meng
2020-05-06 16:10   ` Daniel Schwierzeck [this message]
2020-05-04 23:17 ` [PATCH 31/36] bdinfo: ppc: Move PPC-specific " Simon Glass
2020-05-06  8:10   ` Bin Meng
2020-05-06 15:10   ` Stefan Roese
2020-05-04 23:17 ` [PATCH 32/36] bdinfo: m68k: Move m68k-specific " Simon Glass
2020-05-06  8:10   ` Bin Meng
2020-05-06 20:11   ` Angelo Dureghello
2020-05-04 23:17 ` [PATCH 33/36] bdinfo: m68k: ppc: Move arch-specific code from bdinfo Simon Glass
2020-05-06  8:10   ` Bin Meng
2020-05-06 15:10   ` Stefan Roese
2020-05-04 23:17 ` [PATCH 34/36] bdinfo: Update the file comments Simon Glass
2020-05-06  8:10   ` Bin Meng
2020-05-04 23:17 ` [PATCH 35/36] bdinfo: dm: Update fb_base when using driver model Simon Glass
2020-05-06  8:10   ` Bin Meng
2020-05-04 23:17 ` [PATCH 36/36] bdinfo: x86: vesa: Update fb_base to the correct value Simon Glass
2020-05-06  8:10   ` Bin Meng
2020-05-06  9:28 ` [PATCH 00/36] Tidy up the 'bd' command Alexey Brodkin
2020-05-06 14:47   ` Simon Glass

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=18f3a5fd-fee2-ea20-5873-4458cade228d@gmail.com \
    --to=daniel.schwierzeck@gmail.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 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.