From patchwork Sun Nov 22 08:35:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1404454 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=windriversystems.onmicrosoft.com header.i=@windriversystems.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-windriversystems-onmicrosoft-com header.b=OfTXSHSr; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cf3jC1ghMz9sSf for ; Sun, 22 Nov 2020 19:43:43 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DB54B82618; Sun, 22 Nov 2020 09:39:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=windriversystems.onmicrosoft.com header.i=@windriversystems.onmicrosoft.com header.b="OfTXSHSr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 54769825AB; Sun, 22 Nov 2020 09:37:50 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-co1nam04on0623.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe4d::623]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2F1A282569 for ; Sun, 22 Nov 2020 09:37:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LhEtP1RU5qGH38iHMKeiK26Jlnt8squY2hNuqVRM8BVEoGCa6H/gWimIC2D/MjtAq0D0QsPSnUdkWZPPv0g6JDA9jQbbfmWtZG/HF2ds4WTvbGHNVdut2Roi0ziOiYVlIldfXz2ZNd/kJvzKL+3ksTT0rrT9lkkf0bltzsXfo+EcctHhMYIVtBG6efnP/iV3JL/0374dwSPcecOXl5PocFh6ptEBoxsHlB7Ym498wMgYJ/RQBnbLgGVTUNtpQQP1IsxipkUOl3pBuDkD9NL2Dtv/RgE7CBnqqXlf+BS3T9gBLL6UEW36vFhiwa5N8hxI5zf1ZAUVxWzDP/ZCWMivKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uQvI8JoeRIno9+5Fg0STj7O+MBcUbNDA4IIv8y194tw=; b=CMwwejsINbKkK0qVPeD5wi5NRWmAVtA0RIjIxyzQuwEmLfGZi6O4OuGI9R++Lh8QleeFFKXdYrEAZz+N1LV6itZ9Z87xP2kQSFuT4YsWchdjInEy6WHigqPH/DFeLvu1HpPCl4YjHDBQ42co/x8FHzg6GZ/6HiNY1vCJ2siBtkuvmOXs1BV50tj/pERwE+h8zOnE9wiiEDpNdri926PkZh0G8zahfreQgQlWgHQ7wYn5JXF05U8CsnskPtCJ2R5RbbBo4UTEm/mt+OUM6/OxLBij/1O/0tfii3rUgx9gaewkPCr7uNw20n8VRAsAkFW83uSIIe5/Xb2bGeHQkauEKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriversystems.onmicrosoft.com; s=selector2-windriversystems-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uQvI8JoeRIno9+5Fg0STj7O+MBcUbNDA4IIv8y194tw=; b=OfTXSHSr5ePswGV52jLRnx/6+EPjV/0zR95d6NFAeHbzDi4DKAEYveaK/dEgsxAzv6pQn5+uylDMGSMm2SFsRppXOCNzWjloZ5Br41SQBlcjimt1XRpFiU95MpEwJTZ3VAbkK4iSpUNHlsuJZ0O7+HvtyqNVNXVtzTAJBpo9BZ8= Authentication-Results: lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=none action=none header.from=windriver.com; Received: from BL0PR11MB3201.namprd11.prod.outlook.com (2603:10b6:208:6b::21) by MN2PR11MB4223.namprd11.prod.outlook.com (2603:10b6:208:18a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.22; Sun, 22 Nov 2020 08:37:14 +0000 Received: from BL0PR11MB3201.namprd11.prod.outlook.com ([fe80::650a:e5b9:d7:6cc0]) by BL0PR11MB3201.namprd11.prod.outlook.com ([fe80::650a:e5b9:d7:6cc0%5]) with mapi id 15.20.3589.025; Sun, 22 Nov 2020 08:37:13 +0000 From: Ovidiu Panait To: u-boot@lists.denx.de Cc: sjg@chromium.org Subject: [PATCH v2 15/18] common: board_r: Drop initr_bbmii wrapper Date: Sun, 22 Nov 2020 10:35:53 +0200 Message-Id: <20201122083556.6756-16-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201122083556.6756-1-ovidiu.panait@windriver.com> References: <20201122083556.6756-1-ovidiu.panait@windriver.com> X-Originating-IP: [46.97.150.20] X-ClientProxiedBy: VI1PR07CA0165.eurprd07.prod.outlook.com (2603:10a6:802:3e::13) To BL0PR11MB3201.namprd11.prod.outlook.com (2603:10b6:208:6b::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from otp-linux01.wrs.com (46.97.150.20) by VI1PR07CA0165.eurprd07.prod.outlook.com (2603:10a6:802:3e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.11 via Frontend Transport; Sun, 22 Nov 2020 08:37:13 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2b8d24c4-5320-4505-9e1d-08d88ec1cfa0 X-MS-TrafficTypeDiagnostic: MN2PR11MB4223: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KYtec+Q0lBHQJIdp7r9ntZZKLKXYJmLfsgB18VdI+ZXKNTOmqW7wzdCmYyzQgcknItSATaubsidFXSl+7yf1bgBXD5iLKHxgC8EWIrqIpY7RtZs5iRtWrktaFa9hcUAVfJ+w/6c+asskbdCmkkN/HlynOuygKZst/PHk/vcPDO99MGY4w02rzlO8p7KSepJyMcyhiFgu9YlCN+fQYC0Dgbxm2TAB1ZM/FhtiQpWT9j3vwwjeh7qNCQiYtJsih0oil1B5m5XggAgHO0JEJRaRT2Mzja9Pz1V6sA5rZvb9UdLLZuhgogtPQyqAzgOaJrP7B1bXwdvjucRvlmzZp8Ynjg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL0PR11MB3201.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39840400004)(136003)(366004)(376002)(346002)(36756003)(186003)(16526019)(316002)(26005)(4326008)(2616005)(6916009)(83380400001)(6512007)(478600001)(8676002)(2906002)(6486002)(8936002)(52116002)(44832011)(956004)(66946007)(6506007)(86362001)(6666004)(66556008)(1076003)(66476007)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: NNJN+aXjrT0ud4lx1H4NS6SNAWXNTMGOYHvN1rIuAcrXU50/8uqsfkHBvfzsvQ0ryrufQbp4yzas4Az97oubfuLP33kMsxb1zslrpxwHRQTglWTPnVUFd+C8Fy72AKfzO5Yz81pmFiVD0dkSngYuwdD7FSAgjxU5asih+YiAwBLt64ZGLKFifIsNUVUVqxsfybJgLYc5WOWqOlgNEXwxwQeR9jHYO2bQemq9PYaYPOdqkZPqPSWZF0BvB7wAbXGq07yyIAalcPtkbuLB80g6t1+qtBW2vSEFYy6xAAEutru7yCt8vq9ZhvIOJDRBTjBHGqu2tdDxfeoijlpU1CCoMhkCgQ7F4KmvecOi5asezpC47r+hsbYUZlWLBTyvSXKgnYh0clTdrZeidpP0m35Vmu74IxkTXCUUelEGGCh6r79PNVE0EC5WZPhWqbcWWZtDICHRFcaYQPBkxNRr+zwXm1r1ey/XNzsXhhmKnZqQQumYwNg8H7VxEvn1NGYx9HzmQUeV908JYtNCDYK9NgPjBLY07stHDkA+TbzKcltw1DH1uzMr9en/Lnf8b6gRtsyw6lYU3EZEnY6jilFwulVolfG1+bkOJx+OU5bV5GwEL4MKv40cWEEhiXAAkRrGpXyK2blU7xjvTp2tV3L1+Jo5870u9YiFMFGhci/2e9k4y5d8Yq22k+5s3P16J/DqVDhc8N8h7Z30yREB96+/BFMMLR6baG+vPBP2ct/PyENDON62KhyRrCauV7jW2wa+wuHFHuuEaDxtUcYzZIS5i5S3Bkxz843ctVkU1y9zI6uRouBp7o9jZKr+nzcmKnzpjLmQeur3DAFimqijx7/dZ0iIqpKKjMoNulLGCiRk3nEBhOxyR9bxlAhY+n773OSd6LqJ//KxFL6dwmKYOdwy93tkZg== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b8d24c4-5320-4505-9e1d-08d88ec1cfa0 X-MS-Exchange-CrossTenant-AuthSource: BL0PR11MB3201.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2020 08:37:13.9235 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IdZSoNzg6sNiuN2pFg2hMwHaYQCSskUxFOEDfERmUVSmHA3j4j0T9OE2x/UCdTBoDvV5+80DBon9fFeDucuBWZzDtg28TBauCQL/x17SwXQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4223 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add a return value to bb_miiphy_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Signed-off-by: Ovidiu Panait Reviewed-by: Simon Glass --- v2 updates: - add function comment common/board_r.c | 10 +--------- drivers/net/phy/miiphybb.c | 4 +++- include/miiphy.h | 10 +++++++++- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/common/board_r.c b/common/board_r.c index 500457b080..c083eb0a03 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -534,14 +534,6 @@ static int initr_scsi(void) } #endif -#ifdef CONFIG_BITBANGMII -static int initr_bbmii(void) -{ - bb_miiphy_init(); - return 0; -} -#endif - #ifdef CONFIG_CMD_NET static int initr_net(void) { @@ -783,7 +775,7 @@ static init_fnc_t init_sequence_r[] = { initr_scsi, #endif #ifdef CONFIG_BITBANGMII - initr_bbmii, + bb_miiphy_init, #endif #ifdef CONFIG_PCI_ENDPOINT pci_ep_init, diff --git a/drivers/net/phy/miiphybb.c b/drivers/net/phy/miiphybb.c index ba97a54c06..59a32c4913 100644 --- a/drivers/net/phy/miiphybb.c +++ b/drivers/net/phy/miiphybb.c @@ -105,7 +105,7 @@ int bb_miiphy_buses_num = sizeof(bb_miiphy_buses) / sizeof(bb_miiphy_buses[0]); #endif -void bb_miiphy_init(void) +int bb_miiphy_init(void) { int i; @@ -124,6 +124,8 @@ void bb_miiphy_init(void) bb_miiphy_buses[i].init(&bb_miiphy_buses[i]); } } + + return 0; } static inline struct bb_miiphy_bus *bb_miiphy_getbus(const char *devname) diff --git a/include/miiphy.h b/include/miiphy.h index 61c136b114..8b77bac01e 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -81,7 +81,15 @@ struct bb_miiphy_bus { extern struct bb_miiphy_bus bb_miiphy_buses[]; extern int bb_miiphy_buses_num; -void bb_miiphy_init(void); +/** + * bb_miiphy_init() - Initialize bit-banged MII bus driver + * + * It is called during the generic post-relocation init sequence. + * + * Return: 0 if OK + */ +int bb_miiphy_init(void); + int bb_miiphy_read(struct mii_dev *miidev, int addr, int devad, int reg); int bb_miiphy_write(struct mii_dev *miidev, int addr, int devad, int reg, u16 value);