All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 10/16] Move dram_init_banksize() to a common header
Date: Fri, 31 Mar 2017 08:40:33 -0600	[thread overview]
Message-ID: <20170331144039.14587-11-sjg@chromium.org> (raw)
In-Reply-To: <20170331144039.14587-1-sjg@chromium.org>

This is an weak function present on all archs so we should have it in the
common header file. Remove it from arch-specific headers and add a
function comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/arm/include/asm/u-boot-arm.h |  1 -
 arch/x86/include/asm/u-boot-x86.h |  1 -
 include/common.h                  | 17 +++++++++++++++++
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h
index 2129f37c8f..b931c22060 100644
--- a/arch/arm/include/asm/u-boot-arm.h
+++ b/arch/arm/include/asm/u-boot-arm.h
@@ -36,7 +36,6 @@ int	arch_early_init_r(void);
 
 /* board/.../... */
 int	board_init(void);
-int dram_init_banksize(void);
 void	board_quiesce_devices(void);
 
 /* cpu/.../interrupt.c */
diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h
index 33c6e2bb68..d2d603967e 100644
--- a/arch/x86/include/asm/u-boot-x86.h
+++ b/arch/x86/include/asm/u-boot-x86.h
@@ -41,7 +41,6 @@ void x86_disable_caches(void);
 int x86_init_cache(void);
 void reset_cpu(ulong addr);
 ulong board_get_usable_ram_top(ulong total_size);
-int dram_init_banksize(void);
 int default_print_cpuinfo(void);
 
 /* Set up a UART which can be used with printch(), printhex8(), etc. */
diff --git a/include/common.h b/include/common.h
index 844f012297..1441581c40 100644
--- a/include/common.h
+++ b/include/common.h
@@ -206,6 +206,23 @@ typedef void (interrupt_handler_t)(void *);
  */
 int dram_init(void);
 
+/**
+ * dram_init_banksize() - Set up DRAM bank sizes
+ *
+ * This can be implemented by boards to set up the DRAM bank information in
+ * gd->bd->bi_dram(). It is called just before relocation, after dram_init()
+ * is called.
+ *
+ * If this is not provided, a default implementation will try to set up a
+ * single bank. It will do this if CONFIG_NR_DRAM_BANKS and
+ * CONFIG_SYS_SDRAM_BASE are set. The bank will have a start address of
+ * CONFIG_SYS_SDRAM_BASE and the size will be determined by a call to
+ * get_effective_memsize().
+ *
+ * @return 0 if OK, -ve on error
+ */
+int dram_init_banksize(void);
+
 void	hang		(void) __attribute__ ((noreturn));
 
 int	timer_init(void);
-- 
2.12.2.564.g063fe858b8-goog

  parent reply	other threads:[~2017-03-31 14:40 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 14:40 [U-Boot] [PATCH 00/16] Clean up board_f sequence a little more Simon Glass
2017-03-31 14:40 ` [U-Boot] [PATCH 01/16] board_f: Drop board_type parameter from initdram() Simon Glass
2017-04-03  6:19   ` Stefan Roese
2017-04-03 15:56   ` york sun
2017-04-06 16:25   ` [U-Boot] [U-Boot, " Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 02/16] board_f: Drop return value " Simon Glass
2017-04-03  6:25   ` Stefan Roese
2017-04-03 15:56   ` york sun
2017-04-06 16:25   ` [U-Boot] [U-Boot, " Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 03/16] board_f: Rename initdram() to dram_init() Simon Glass
2017-04-03  6:25   ` Stefan Roese
2017-04-03 15:56   ` york sun
2017-04-05 20:36   ` [U-Boot] [U-Boot, " Tom Rini
2017-04-05 21:11     ` Simon Glass
2017-03-31 14:40 ` [U-Boot] [PATCH 04/16] xtensa: Place relocated U-Boot in the normal place Simon Glass
2017-04-06 16:25   ` [U-Boot] [U-Boot, " Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 05/16] board_f: Use a single condition for reserve_logbuffer() Simon Glass
2017-04-06 16:25   ` [U-Boot] [U-Boot, " Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 06/16] board_f: Move the extra #ifdef condition into reserve_mmu() Simon Glass
2017-04-03 15:55   ` york sun
2017-04-06 16:25   ` [U-Boot] [U-Boot, " Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 07/16] board_f: Put video memory reservation in one function Simon Glass
2017-04-06 16:25   ` [U-Boot] [U-Boot, " Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 08/16] board_f: Drop CONFIG_SPL_BUILD check Simon Glass
2017-04-03 15:55   ` york sun
2017-04-06 16:25   ` [U-Boot] [U-Boot,08/16] " Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 09/16] board_f: Drop setup_dram_config() wrapper Simon Glass
2017-04-03  6:25   ` Stefan Roese
2017-04-06 16:25   ` [U-Boot] [U-Boot, " Tom Rini
2017-03-31 14:40 ` Simon Glass [this message]
2017-04-06 16:25   ` [U-Boot] [U-Boot, 10/16] Move dram_init_banksize() to a common header Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 11/16] board_f: Drop unused headers Simon Glass
2017-04-03 15:55   ` york sun
2017-04-06 16:25   ` [U-Boot] [U-Boot,11/16] " Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 12/16] board_f: Move errno.h down to the bottom Simon Glass
2017-04-03 15:55   ` york sun
2017-04-06 16:26   ` [U-Boot] [U-Boot, " Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 13/16] powerpc: Move setup_board_extra() into a PPC file Simon Glass
2017-04-03  6:26   ` Stefan Roese
2017-04-06 16:26   ` [U-Boot] [U-Boot, " Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 14/16] board_f: Make init_helpers generic Simon Glass
2017-04-06 16:26   ` [U-Boot] [U-Boot,14/16] " Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 15/16] board_f: Make relocation functions generic Simon Glass
2017-04-06 16:26   ` [U-Boot] [U-Boot, " Tom Rini
2017-03-31 14:40 ` [U-Boot] [PATCH 16/16] board_f: powerpc: Drop unused headers Simon Glass
2017-04-03  6:26   ` Stefan Roese
2017-04-03 15:56   ` york sun
2017-04-06 16:26   ` [U-Boot] [U-Boot,16/16] " Tom Rini

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=20170331144039.14587-11-sjg@chromium.org \
    --to=sjg@chromium.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.