From patchwork Fri Nov 9 15:26:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10676189 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 09AF95A4 for ; Fri, 9 Nov 2018 15:27:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAE2B28305 for ; Fri, 9 Nov 2018 15:27:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF2752ED55; Fri, 9 Nov 2018 15:27:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6B67528305 for ; Fri, 9 Nov 2018 15:27:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=EGhseE2xUDNxQxs4/6vvP2P2h4Zy6m5YEVvYS03Okho=; b=H58xyYyCwwIkOYGJh87LTX2jWw F3Ekrg3nsJkd/Wjt5Z6cKC1up6mmZtXaxki/nYjfcBucMjOW271A/nUzeuntfrOMMBTXF7EavKvqE +v0LOZ5qilf+NiALSJnXcec0ET6/Hnc7tjZrkFfKIGQAE3+usL/2xjFXr9MSwpGqvLM2HtExKDkmV qazr9NOuiyO5GBgdQYhV9puz/HSG0rYCSPvp5p4JdLI0Md3JoB9nETWmYUk9G/ep491Of6/UNe/mg nrqj36mYk9utsPrjXpgrW1V2xU0XznVuv7VLC/RKR8IxIk2mMnMlvYU4kMq1oOflp+qhCty1awbnF Q1JsJ3ag==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gL8hD-000333-55; Fri, 09 Nov 2018 15:27:43 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gL8gs-0002aw-S5 for linux-amlogic@lists.infradead.org; Fri, 09 Nov 2018 15:27:24 +0000 Received: by mail-wr1-x442.google.com with SMTP id y15-v6so2303872wru.9 for ; Fri, 09 Nov 2018 07:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y+UJM3V6FGLyTbcr+bB0FiLM9q9P4woDvF4P6452wIo=; b=OSh/ARh8nW0F4uypMaJKIfXCIOCCLBkO/ahdFOxUk9RI+2oB56etNtu7wiCCc4+Blz s+VoIbwo/l+gAdjGmzmML6WwBlk8cm2oLCZcyBpzbLK7+CgMrN+0VHicv3J09jb1T3kq dGUyffknATHEL+SkoiqPFoAqvI0CfLIiiRwjYl4Kuwi57pxXY9zf4BKyBvAYdPtNeMl4 xgfSLs65WHK0ps+66TgBE6nOEhP0sw2Db8A9bm9CWsJQST08+NYIKZrWry6BP/d21QRG bHLk5/69t1h0cXq6SlqtNb9abKiolUamTBNUbsOpTaIQL34ZsoEvUhAXhD90smxX5zJ9 L4kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Y+UJM3V6FGLyTbcr+bB0FiLM9q9P4woDvF4P6452wIo=; b=MUTPHZwtSiIdykwQUg1Y+E9I1Q+HvTE7ZszuBe+n7Qo/qEwqPaJFAjN3ZyBmj82UcN 7TtVOzRLFmjDw8hCjHF/rW8DNYnddJVDWoYUMR7GndhDQx89D5OjcKUrBm0+8vP4TjwN h9AyUqamr2Hx4Q+bhGm8gmDnSxYpGX3dzwZbGdYgX59HY8/QpwEeBS20tMq83BMO7LjT q+YE4RKW0WRTKdc8PVuv3OoCZ7R3XGZf5yUBaPFjUKyIPX/zsMgQ9HV+u37AjLp+tMSx PrAoOJA/LMdYpyxDHyjqXzmni7yeRrYh4jLhe9NJ3c5QGigvj1X/n/qN5plcuswO9zBC Q0jw== X-Gm-Message-State: AGRZ1gLgtqU5XAbFGzS3zKBERp4uhMdbddq/KKYQL6oiBkD9TYLBM5kE D93N0IHMwq/qbAlVsLevk2+G6Q== X-Google-Smtp-Source: AJdET5eqNOD61HuJTLcUiCgsPjvd1ZF9E+GE9/4FCud6Vxl34g90mrIFxKOnpCDbxbjmwnaus9frMA== X-Received: by 2002:adf:bc0c:: with SMTP id s12-v6mr2645032wrg.255.1541777238434; Fri, 09 Nov 2018 07:27:18 -0800 (PST) Received: from bender.baylibre.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id a127-v6sm1748545wmh.24.2018.11.09.07.27.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Nov 2018 07:27:17 -0800 (PST) From: Neil Armstrong To: u-boot@lists.denx.de Subject: [PATCH u-boot 18/19] ARM: meson: factorize common code out amlogic's boards Date: Fri, 9 Nov 2018 16:26:57 +0100 Message-Id: <1541777218-472-19-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541777218-472-1-git-send-email-narmstrong@baylibre.com> References: <1541777218-472-1-git-send-email-narmstrong@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181109_072722_931270_45E2D77F X-CRM114-Status: GOOD ( 10.29 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, Neil Armstrong , trini@konsulko.com, Jerome Brunet MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jerome Brunet 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 Signed-off-by: Neil Armstrong --- 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 0446507..249e0d9 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 d784d6b..62f0f4c 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 33992a2..546c4d9 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 b59c11b..6db1b26 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 c2b50f6..02a0e92 100644 --- a/board/amlogic/s400/s400.c +++ b/board/amlogic/s400/s400.c @@ -13,21 +13,9 @@ #include #include -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; -}