From: Andre Przywara Date: Tue, 23 Feb 2021 13:30:38 +0000 Subject: [PATCH 08/10] sun5i: add support for DIP detection to CHIP board In-Reply-To: <20210222152308.5c7ccc0b@kmaincent-XPS-13-7390> References: <20210218132938.2168-1-kory.maincent@bootlin.com> <20210218132938.2168-9-kory.maincent@bootlin.com> <20210219165454.GM10169@bill-the-cat> <20210219172926.7feae4ac@slackpad.fritz.box> <20210222152308.5c7ccc0b@kmaincent-XPS-13-7390> Message-ID: <20210223133038.77d52859@slackpad.fritz.box> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, 22 Feb 2021 15:23:08 +0100 K?ry Maincent wrote: Hi K?ry, > Thanks for your reviews. > > On Fri, 19 Feb 2021 17:29:26 +0000 > Andre Przywara wrote: > > > > > > > And then based on my comment in the previous patch, similar to > > > PINEPHONE_DT_SELECTION and other board-specific options, add a > > > CHIP_DIP_SCAN option or similar. > > > > Yes, indeed, thanks Tom. > > > > The idea of making this extension scheme generic is great, it's just > > that sunxi is using a different approach to board specific code here. > > Normally we expect U-Boot-proper board specific code to be DT driven, > > and where this does not really work, use those symbols that Tom pointed > > to. > > For my extension_board_scan board specific function, would you prefer if I move > to callback like below instead of Kconfig? > > if (of_machine_is_compatible("nextthing,chip")) > extension_board_register_callback(chip_extension_board_scan); Well, the CHIP Pro uses a different compatible string, so you would need to check for that too. I am not fully decided if checking for the machine compatible is the right approach. The more traditional U-Boot way would be to define a config symbol (as Tom already pointed out), that would also keep the code out of other board builds. We do this already with CONFIG_PINE64_DT_SELECTION and CONFIG_PINEPHONE_DT_SELECTION. Cheers, Andre