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: 150675 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5522ljp; Fri, 9 Nov 2018 07:40:43 -0800 (PST) X-Google-Smtp-Source: AJdET5fk1MUeAW+3zaFTWAGsKloP6lnKk0dL9ERFUcOevN7/Y5J5BPQHp08qzExANTNMzrWTx/QD X-Received: by 2002:a17:906:7308:: with SMTP id d8-v6mr2238118ejl.162.1541778043264; Fri, 09 Nov 2018 07:40:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541778043; cv=none; d=google.com; s=arc-20160816; b=hVvKxf/f8ZmY8hj/JmmlaP4p6RhFLntaX+UQUzrMp1cKdLpSLwJ/Nbs4kM9627YKr6 mIzcW/PBGB93PeVFjbzhYoId5hhhu1wD5+QBoNP8GLL3mfmLdRQU4lmI+lVW8f9XCDtz i8KCAWOuCfYb1Z1rMMJISpH3KVqxyhEgtn/QEYzrKdVHWJpe22SFrSULyMeFRnzFUvBr vQucF5B+nt3T9gHPM85mdKnSY8SWO1zSAZm+qo02qmAyWqIw24TMA0TbvGO1DQCUf21+ WzN+IvuUGnJJGVSs+/nJo/MqiKQkvctA06dS9wdDu1RCxLOSwWceA+/5/S/H5EIsPpKK 9vKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature; bh=8qEfHjYqYxeJcD1by2HWwSp8Cfhz/pkSNeJCSr8q7bU=; b=zqSrCZ/6U8jZi7GF2JKuOgxx5YVfY7smsNJlYDEvvGdFcrp5Byx6ux24qYmUcDRVQJ x3wlqmN6zFqe4O+845RasYzq7+HE/br6eE7DCWX68CcqrzDkFulGHWWKUcNVWtPIPnqs 0etCxAHfQf0DOiezntmfeP/4prijZxJXGPYTcCqUVBm81qvNpWoAYKTyO8wmAqrtx1M2 9ybvwttlrBFg5L7sUXdcBrtqyotRI5XAd8wijfoJjfX2dg2J8lhYs17MfZbRszwzjF1E DjaFw3aaFJs/tPfX29jsQsuMisiX/jTgyArx1rUfCmQ+DFp7ImmR76xjJ47bkVq//ZPD Rj/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="OSh/ARh8"; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id n10-v6si1447027ejh.45.2018.11.09.07.40.42; Fri, 09 Nov 2018 07:40:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="OSh/ARh8"; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 7BFB6C225AF; Fri, 9 Nov 2018 15:39:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A62B4C225F4; Fri, 9 Nov 2018 15:27:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1BC37C225CB; Fri, 9 Nov 2018 15:27:24 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by lists.denx.de (Postfix) with ESMTPS id 24A1FC2257D for ; Fri, 9 Nov 2018 15:27:19 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id j17-v6so2289382wrq.11 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=cMyucyBURnyr1T6vRezJDQWpdE1sjWxgh+8HYOuaUvD/j69u3iy0mn07r78ZsfNnxm EHDK9+J3nlvlsMEARVMlob8HWYzBp26grqMVtTJ4ZN+7APuVuo6QxN07HMlsUkfLMNb7 ZnwEEe4KByEnwnLXD+GSI+pPS2TWJX70NTMJoDypKw06MPs3IZQKtUZ30lzoR+x5aM4h yH6hwAYsBBWbx6E+khK6YXouq0CsUJcWj81AkgDcr1wY3OBD8IzQfdbMTUEVIsDsAd+/ prRYbP8GULQNLb3dRRYBx9u+khOXaU5szu0jVtUd1NHuMfi/bpqcQ03OfUXWM6xP/u/s jouw== X-Gm-Message-State: AGRZ1gLDWAHwG1fGOgROobsA8/7kC/OiPjwlwpji9WoWqsRbH/VFSqr0 EzKCM6Z5+fRo75xOv3ySM8sGk1qeRu8= 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 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> Cc: linux-amlogic@lists.infradead.org, trini@konsulko.com, Jerome Brunet Subject: [U-Boot] [PATCH u-boot 18/19] ARM: meson: factorize common code out amlogic's boards X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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; -}