Re: [PATCH v4 3/4] rockchip: rk3399: Add ROC-PC-PLUS board detection

Fabio Estevam <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <CAOMZO5DULY0wE_U-4aX9sfrnum++J9iJ02_H8L+g3qdY156KCA@mail.gmail.com>
Hi Quentin,

On Tue, Aug 11, 2026 at 8:55 AM Quentin Schulz <[email protected]> wrote:

> Ideally, we should be able to automatically detect whether it's a
> roc-pc-mezzanine-rk3399, but I couldn't find schematics for it and from
> the Device Tree, there doesn't seem to be something we could use to
> detect it like we do for ROC-PC-PLUS/ROC-PC. So instead I recommend to
> check for CONFIG_IS_ENABLED(DM_I2C). If it ever gets enabled for
> roc-pc-mezzanine-rk3399_defconfig, the logic will return that it's NOT a
> ROC-PC-PLUS and thus use CONFIG_DEFAULT_FDT_FILE which is
> rockchip/rk3399-roc-pc-mezzanine.dtb which is correct.

DM_I2C is also selected by roc-pc-mezzanine-rk3399_defconfig.

We can use SPL_I2C to distinguish, like this:

--- a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
+++ b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
@@ -68,6 +68,9 @@ static bool is_roc_pc_plus(void)
 {
        struct udevice *bus, *dev;

+       /* roc-pc-mezzanine-rk3399_defconfig does not select SPL_I2C */
+       if (!CONFIG_IS_ENABLED(SPL_I2C))
+               return false;
        if (uclass_get_device_by_name(UCLASS_I2C, ROC_PC_MP8859_BUS, &bus))
                return false;

If you agree, I'll send a v5 with the change above included.

Thanks
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.