Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB29DC433F5 for ; Mon, 20 Dec 2021 07:23:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 07E6F830D9; Mon, 20 Dec 2021 08:23:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1639985001; bh=wV19Ot+W6oMfAhK+kby6xN0k398t8mZyS0J6d0FWIcA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=zIzX7VAHUECGLTZgdnhCKPkfT94rYpcmEFtLLe+Ndvjh8GjkVh8WLLHcaW6fXy1dT sYyyYIgGam5dATsZeXuGnSo3TtRmb1tlzhcOUJFnVaUFcyLp5/quITAf+ZcoJn0Fe3 /bOFoq9ozoEWdNeBKvZzi47kk/yG+a8u0pVPXi4eAdXyRMClJQzBUTCf9yDVVAzUYI 6lCoq7vTby7JjfxJPBioGb5rXMZUOqNT/YlMSICv5RpUf4QExER7Q+ABItcA528hzM JbWa3f3GmqDpzDNqDZkDlkJbjpD/7HZofTbr+FE72NMbmC/C1tWD0QLAPy+pGPKbFV RPXmLWjfKeyIg== Received: by phobos.denx.de (Postfix, from userid 109) id 1341A83176; Mon, 20 Dec 2021 08:23:18 +0100 (CET) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 12F408329E for ; Mon, 20 Dec 2021 08:23:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (unknown [91.198.250.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4JHWJw4xbfzQl4N; Mon, 20 Dec 2021 08:23:12 +0100 (CET) Message-ID: Date: Mon, 20 Dec 2021 08:23:08 +0100 MIME-Version: 1.0 Subject: Re: [PATCH 6/8] arm: kirkwood: Pogoplug-V4 : Add board implementation header Content-Language: en-US To: Tony Dinh , =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: U-Boot Mailing List , David Purdy , Tom Rini , =?UTF-8?Q?Marek_Beh=ef=bf=bdn?= References: <20211218042335.5865-1-mibodhi@gmail.com> <20211218042335.5865-7-mibodhi@gmail.com> <20211218130948.tj5q6iyea36aijdo@pali> From: Stefan Roese In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.103.2 at phobos.denx.de X-Virus-Status: Clean Hi Tony, On 12/18/21 22:47, Tony Dinh wrote: > Hi Pali, > > On Sat, Dec 18, 2021 at 5:09 AM Pali Rohár wrote: >> >> On Friday 17 December 2021 20:23:32 Tony Dinh wrote: >>> Add board implementation header and Makefile for Pogoplug V4 >>> >>> Signed-off-by: Tony Dinh >>> --- >>> >>> board/cloudengines/pogo_v4/Makefile | 10 ++++++++ >>> board/cloudengines/pogo_v4/pogo_v4.h | 36 ++++++++++++++++++++++++++++ >>> 2 files changed, 46 insertions(+) >>> create mode 100644 board/cloudengines/pogo_v4/Makefile >>> create mode 100644 board/cloudengines/pogo_v4/pogo_v4.h >>> >>> diff --git a/board/cloudengines/pogo_v4/Makefile b/board/cloudengines/pogo_v4/Makefile >>> new file mode 100644 >>> index 0000000000..511bf5ff7e >>> --- /dev/null >>> +++ b/board/cloudengines/pogo_v4/Makefile >>> @@ -0,0 +1,10 @@ >>> +# SPDX-License-Identifier: GPL-2.0+ >>> +# >>> +# (C) Copyright 2014-2021 Tony Dinh >>> +# >>> +# Based on >>> +# Marvell Semiconductor >>> +# Written-by: Prafulla Wadaskar >>> +# >>> + >>> +obj-y := pogo_v4.o >>> diff --git a/board/cloudengines/pogo_v4/pogo_v4.h b/board/cloudengines/pogo_v4/pogo_v4.h >>> new file mode 100644 >>> index 0000000000..bf3060de60 >>> --- /dev/null >>> +++ b/board/cloudengines/pogo_v4/pogo_v4.h >>> @@ -0,0 +1,36 @@ >>> +/* SPDX-License-Identifier: GPL-2.0+ */ >>> +/* >>> + * Copyright (C) 2014-2021 Tony Dinh >>> + * >>> + * Based on >>> + * Copyright (C) 2012 David Purdy >>> + * >>> + * Based on Kirkwood support: >>> + * (C) Copyright 2009 >>> + * Marvell Semiconductor >>> + * Written-by: Prafulla Wadaskar >>> + */ >>> + >>> +#ifndef __POGO_V4_H >>> +#define __POGO_V4_H >>> + >>> +#include >>> + >>> +/* GPIO configuration */ >>> +#define POGO_V4_OE_LOW (~(0)) >>> +#define POGO_V4_OE_HIGH (~(0)) >>> +#define POGO_V4_OE_VAL_LOW BIT(29) >>> +#define POGO_V4_OE_VAL_HIGH 0 >>> + >>> +/* PHY related */ >>> +#define MV88E1116_LED_FCTRL_REG 10 >>> +#define MV88E1116_CPRSP_CR3_REG 21 >>> +#define MV88E1116_MAC_CTRL_REG 21 >>> +#define MV88E1116_PGADR_REG 22 >>> +#define MV88E1116_RGMII_TXTM_CTRL BIT(4) >>> +#define MV88E1116_RGMII_RXTM_CTRL BIT(5) >>> + >>> +/* button */ >>> +#define BTN_EJECT 29 >>> + >>> +#endif /* __POGO_V4_H */ >> >> Hello! As this pogo_v4.h include file is used only in pogo_v4.c source >> file and contains only few defines, you can move all these defines >> directly into pogo_v4.c source file. There is no need to export these >> constants if they are not used by other files or modules. > > Sure, but that'll make the .c file harder to read? We've been using > the .h file since the old days, I think mostly for readability. This > is a small header file, but for some other boards, the header file is > quite large. I fail to see why moving these few lines from the header to the .c file makes the code harder to read. Especially if the macros / defines are only used in one specific file, it makes sense to place them in this file IMHO. Thanks, Stefan