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 2145CC001DE for ; Thu, 13 Jul 2023 18:44:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2511F86C28; Thu, 13 Jul 2023 20:44:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.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=ti.com header.i=@ti.com header.b="u6Wqi2w2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9105C86CB1; Thu, 13 Jul 2023 20:44:49 +0200 (CEST) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 3542386C1D for ; Thu, 13 Jul 2023 20:44:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=nm@ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 36DIidfh093575; Thu, 13 Jul 2023 13:44:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1689273879; bh=Wc+A4f6xPjlpPslAkn5elsnPY4MMHYsZiNyKda33kRA=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=u6Wqi2w2uIiodUxv5c7kplG6bItu5wcc9HTEDESTEz/UZkTjeDUBGfIx1OGiYZBE5 oQsaqNBOcppsEPfOuMK9Rimq8vz6+nmNPSIUCHE2uQCmpayRhRDU6NmSIE8VNQk0gG 0VEMdqTDJj72cgYOTdWFzHJ8NWcETDBDxgVhFcDo= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 36DIidF1105278 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 13 Jul 2023 13:44:39 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 13 Jul 2023 13:44:38 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 13 Jul 2023 13:44:38 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 36DIicwE073945; Thu, 13 Jul 2023 13:44:38 -0500 Date: Thu, 13 Jul 2023 13:44:38 -0500 From: Nishanth Menon To: Roger Quadros CC: Simon Glass , , , , , , "Francis, Neha" Subject: Re: [RFC PATCH 2/2] board: ti: am65x: Move to using Extension framework Message-ID: <20230713184438.y3ac7c425fwu575b@radiantly> References: <20230710145026.128481-1-rogerq@kernel.org> <20230710145026.128481-3-rogerq@kernel.org> <574c8eb0-4c19-72ef-5920-e506e4be6203@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <574c8eb0-4c19-72ef-5920-e506e4be6203@kernel.org> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean On 15:29-20230711, Roger Quadros wrote: > Hi Simon, > > On 10/07/2023 22:45, Simon Glass wrote: > > Hi Roger, > > > > On Mon, 10 Jul 2023 at 08:51, Roger Quadros wrote: > >> > >> Support the Expansion cards via Extension framework. > >> This should make 'expansion' command work to scan > >> for expansion cards and apply DT overlays. > >> > >> Card detection code is moved to a library so > >> other boards can benefit from it. > >> > >> Signed-off-by: Roger Quadros > >> --- > >> board/ti/am65x/evm.c | 264 ++++++++--------------------- > >> board/ti/common/Kconfig | 8 + > >> board/ti/common/Makefile | 1 + > >> board/ti/common/ti_card_detect.c | 155 +++++++++++++++++ > >> board/ti/common/ti_card_detect.h | 43 +++++ > >> configs/am65x_evm_a53_defconfig | 2 + > >> configs/am65x_hs_evm_a53_defconfig | 2 + > >> 7 files changed, 280 insertions(+), 195 deletions(-) > >> create mode 100644 board/ti/common/ti_card_detect.c > >> create mode 100644 board/ti/common/ti_card_detect.h > > > > Before this goes too far I think this should move to using a linker > > list to declare the driver (or a driver-model driver if you prefer, > > but that might be overkill). > > ti_card_detect.c This is not a device driver but just a helper library > which is ultimately going to be used directly by the board files. > > e.g. > see board/ti/am65x/evm.c > > > > > What do people think? I think the linker list idea is better that library approach. One of the whack-a-mole we have been dealing with is with i2c eeprom detection board/ti/common/board_detect.c The linker list idea could potentially allows us to have a common detect schemes with appropriate fall backs as pertinent to the platform (e.g. mid production update from 2byte to 1 byte eeprom etc) maybe the order indicated by defconfig? And adds capability to have fall through down to board type detection (thinking cape_detect / ti_card_detect etc..).. Also boards that dont care for this can disable the configuration and use the rest of the codebase (simplify evm.c) Just my 2 cents.. -- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D