From patchwork Thu Nov 22 09:07:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10693729 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 C41A15A4 for ; Thu, 22 Nov 2018 09:08:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6D732C0A2 for ; Thu, 22 Nov 2018 09:08:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AAA8F2C09D; Thu, 22 Nov 2018 09:08:42 +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 4303F2C09D for ; Thu, 22 Nov 2018 09:08:42 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=e78tH9Rq6E+F3jeslHIE1YCkJ0TsrzDZuWsf/wV4ac4=; b=F2Qrh8C8jiN20A eCyxQwQtqt4rGjj15J+F/dgAsqfC3zYDV7wgBXAbKIaMr7K8qraNm5kHaQ/lHA/ANPpp2M+Loz6xT 2Xt6CTRPws8gz9YPic/PpbqRqwXUr9+KbDWj96AtL3rfr6RwZgi6FD9JLs3l1xFWt3mHHTBwF3Tgl dsKYM2sfodVqezL9b361E8kmKvrLYAJRDfimwtUPb7ryFuqvIgxaLlj8sFgr3RGayzbwUD01YtrQ9 MOT7OlI20EXoXzZMDAOLXoS4+Lg3pQr6WEAeK3mzNfQlp0kMYpi8sK1lnuenwU7iRa9mcLRG2HiZE QybfMwPzr8oPl66dvHQQ==; 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 1gPkyX-0000So-6Z; Thu, 22 Nov 2018 09:08:41 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPky6-000848-5h for linux-amlogic@lists.infradead.org; Thu, 22 Nov 2018 09:08:17 +0000 Received: by mail-wm1-x343.google.com with SMTP id c126so8283441wmh.0 for ; Thu, 22 Nov 2018 01:08:04 -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 :mime-version:content-transfer-encoding; bh=d9vpINDJQenQvezN/So+zRTZM+XePHq1IqgUHTXr3rY=; b=TTQYImQcSNbJExH/Ms0YlOHRuf3S83DFNLtG/oqWGSj0AWE9IgOqssIDlmXFZAXChG 0FG2L14somcTYtCLMjeTk37tAK4KvHxqyNfcL7ziQOupWrLZz4nc+ZU1lNS+XOuPsk5f H1mTzeJdTwR3ueCrvSkbWPLgg4znRfl3mvCXk2hPpJhiZKXAWzMl5KttQCLSoMMqsgyi 4zgYCAhcKC5PzLShBOPcqjPZ9IAnHfSnT5nXazN0eU48WDthYpackArLssLhJLHXPwqe cXVGL+4BHKC/B9JEL2QXI8KGnN1c5H1vSwt6NrsINsJOGoISGHhWksfW+IFyXjTCZ/au TpQw== 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:mime-version:content-transfer-encoding; bh=d9vpINDJQenQvezN/So+zRTZM+XePHq1IqgUHTXr3rY=; b=mEDKsI02ivLS68y3n1S81GfnUQwWngPE25P0K9XATvKf++dFYaSCk0lhA3fdmOkjV4 OIyeHB7gzh6DYeuXGx2lKZ175zkY5aLW2JSwA9KBLBv6NE5knJKT1vWYXA7Bgp4xinF+ GgxFsD2Ygx1wxCOflutgiONS63Jh8DrahqMX0CSRJITACCDgR0nV7l8XVdIph73qqSt8 qPrgOwsqy4UZOmDu1TpbljE/mRKX5Wfw+ANSCWqgIXyzs3fGtUUQI2UavIQEOfEqURXS KIur1khlp+PLhLQ11dDhFNHNc16K0rA0CvJ6BdJxH1O4fPDhc7+WHaQynXXSIO0p878z VYvA== X-Gm-Message-State: AGRZ1gKANKyC+Zg1QZaO3L6ZZflAIQPJtpjm4mztjNpbRsbVF/jdyWii jdPUn8Y9H03DcQE0vZb8cP1ocAu0ATiSGA== X-Google-Smtp-Source: AFSGD/UE/ALCnI4Co8TAJHXD7OQmHmksKtIS1pslfgQMSpRtVN+AhJyUeSfh+qAmpo0/YSNL5YWSgA== X-Received: by 2002:a1c:9183:: with SMTP id t125mr8562999wmd.79.1542877682596; Thu, 22 Nov 2018 01:08:02 -0800 (PST) Received: from bender.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id y9sm13856434wrq.55.2018.11.22.01.08.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Nov 2018 01:08:02 -0800 (PST) From: Neil Armstrong To: u-boot@lists.denx.de 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 Message-Id: <20181122090740.29739-19-narmstrong@baylibre.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181122090740.29739-1-narmstrong@baylibre.com> References: <20181122090740.29739-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181122_010814_390341_F8C0B388 X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. 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 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 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 #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; -}