From: narmstrong@baylibre.com (Neil Armstrong)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH u-boot v2 18/19] ARM: meson: factorize common code out amlogic's boards
Date: Thu, 22 Nov 2018 10:07:39 +0100 [thread overview]
Message-ID: <20181122090740.29739-19-narmstrong@baylibre.com> (raw)
In-Reply-To: <20181122090740.29739-1-narmstrong@baylibre.com>
From: Jerome Brunet <jbrunet@baylibre.com>
Now we have moved all the Amlogic board support to common generic board code,
we can move the identical board_init() and ft_board_setup() functions to
weak functions into the board-common mach-meson file.
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
arch/arm/mach-meson/board-common.c | 17 +++++++++++++++++
board/amlogic/odroid-c2/odroid-c2.c | 12 ------------
board/amlogic/p212/p212.c | 12 ------------
board/amlogic/q200/q200.c | 12 ------------
board/amlogic/s400/s400.c | 12 ------------
5 files changed, 17 insertions(+), 48 deletions(-)
diff --git a/arch/arm/mach-meson/board-common.c b/arch/arm/mach-meson/board-common.c
index 6340445053..8c4f3074fb 100644
--- a/arch/arm/mach-meson/board-common.c
+++ b/arch/arm/mach-meson/board-common.c
@@ -14,6 +14,11 @@
DECLARE_GLOBAL_DATA_PTR;
+__weak int board_init(void)
+{
+ return 0;
+}
+
int dram_init(void)
{
const fdt64_t *val;
@@ -34,6 +39,18 @@ int dram_init(void)
return 0;
}
+__weak int meson_ft_board_setup(void *blob, bd_t *bd)
+{
+ return 0;
+}
+
+int ft_board_setup(void *blob, bd_t *bd)
+{
+ meson_init_reserved_memory(blob);
+
+ return meson_ft_board_setup(blob, bd);
+}
+
void meson_board_add_reserved_memory(void *fdt, u64 start, u64 size)
{
int ret;
diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c
index d784d6bd09..62f0f4c871 100644
--- a/board/amlogic/odroid-c2/odroid-c2.c
+++ b/board/amlogic/odroid-c2/odroid-c2.c
@@ -17,11 +17,6 @@
#define EFUSE_MAC_OFFSET 52
#define EFUSE_MAC_SIZE 6
-int board_init(void)
-{
- return 0;
-}
-
int misc_init_r(void)
{
u8 mac_addr[EFUSE_MAC_SIZE];
@@ -46,10 +41,3 @@ int misc_init_r(void)
return 0;
}
-
-int ft_board_setup(void *blob, bd_t *bd)
-{
- meson_init_reserved_memory(blob);
-
- return 0;
-}
diff --git a/board/amlogic/p212/p212.c b/board/amlogic/p212/p212.c
index 33992a2279..546c4d9c86 100644
--- a/board/amlogic/p212/p212.c
+++ b/board/amlogic/p212/p212.c
@@ -18,11 +18,6 @@
#define EFUSE_MAC_OFFSET 52
#define EFUSE_MAC_SIZE 6
-int board_init(void)
-{
- return 0;
-}
-
int misc_init_r(void)
{
u8 mac_addr[EFUSE_MAC_SIZE];
@@ -48,10 +43,3 @@ int misc_init_r(void)
return 0;
}
-
-int ft_board_setup(void *blob, bd_t *bd)
-{
- meson_init_reserved_memory(blob);
-
- return 0;
-}
diff --git a/board/amlogic/q200/q200.c b/board/amlogic/q200/q200.c
index b59c11bd35..6db1b26e08 100644
--- a/board/amlogic/q200/q200.c
+++ b/board/amlogic/q200/q200.c
@@ -18,11 +18,6 @@
#define EFUSE_MAC_OFFSET 52
#define EFUSE_MAC_SIZE 6
-int board_init(void)
-{
- return 0;
-}
-
int misc_init_r(void)
{
u8 mac_addr[EFUSE_MAC_SIZE];
@@ -53,10 +48,3 @@ int misc_init_r(void)
return 0;
}
-
-int ft_board_setup(void *blob, bd_t *bd)
-{
- meson_init_reserved_memory(blob);
-
- return 0;
-}
diff --git a/board/amlogic/s400/s400.c b/board/amlogic/s400/s400.c
index c2b50f6c17..02a0e9286c 100644
--- a/board/amlogic/s400/s400.c
+++ b/board/amlogic/s400/s400.c
@@ -13,21 +13,9 @@
#include <asm/arch/eth.h>
#include <asm/arch/mem.h>
-int board_init(void)
-{
- return 0;
-}
-
int misc_init_r(void)
{
meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
return 0;
}
-
-int ft_board_setup(void *blob, bd_t *bd)
-{
- meson_init_reserved_memory(blob);
-
- return 0;
-}
--
2.19.1
next prev parent reply other threads:[~2018-11-22 9:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 9:07 [PATCH u-boot v2 00/19] Amlogic Meson cleanup for AXG SoC support Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 01/19] ARM: meson: clean-up platform selection Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 02/19] configs: meson: remove unnecessary MESON_FDTFILE_SETTING Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 03/19] board: amlogic: remove p212 derivatives Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 04/19] board: amlogic: move khadas-vim2 as q200 ref board Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 05/19] board: amlogic: factorise gxbb boards Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 06/19] ARM: rework amlogic configuration Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 07/19] configs: meson: change default load addresses Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 08/19] pinctrl: meson: rework gx pmx function Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 09/19] pinctrl: meson: select generic pinctrl Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 10/19] pinctrl: meson: add axg support Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 11/19] clk: meson: add static to meson_gates table Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 12/19] clk: meson: silence debug print Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 13/19] ARM: meson: rework soc arch file to prepare for new SoC Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 14/19] ARM: meson: Add support for AXG family Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 15/19] ARM: dts: Sync Amlogic Meson AXG DT from Linux 4.20-rc1 Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 16/19] clk: Add clock driver for AXG Neil Armstrong
2018-11-22 9:07 ` [PATCH u-boot v2 17/19] board: amlogic: add support for S400 board Neil Armstrong
2018-11-22 9:07 ` Neil Armstrong [this message]
2018-11-22 9:07 ` [PATCH u-boot v2 19/19] ARM: meson: Add boot device discovery Neil Armstrong
2018-11-26 8:59 ` [PATCH u-boot v2 00/19] Amlogic Meson cleanup for AXG SoC support Neil Armstrong
2018-11-26 12:58 ` Tom Rini
2018-11-26 13:34 ` Neil Armstrong
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=20181122090740.29739-19-narmstrong@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=linus-amlogic@lists.infradead.org \
/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
all inboxes | Powered by JetHome®