From 1b9c748184622a8d902ca3d48b4b1ebfee8f3fc0 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Wed, 1 Oct 2025 17:25:54 +0200 Subject: [PATCH] kboot: atc: Order atc-phy compatibles reverse chronologically Reverse chronologically order ensures that later devices with multiple compatibles matches their compatible first. This is applicable on t602x devices were the atc-phy nodes have '"atc-phy,t6020", "atc-phy,t8112"' as compatible. Suggested-by: Mark Kettenis Signed-off-by: Janne Grunau --- src/kboot_atc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/kboot_atc.c b/src/kboot_atc.c index 497c17870..c2c636092 100644 --- a/src/kboot_atc.c +++ b/src/kboot_atc.c @@ -231,9 +231,12 @@ static const struct atc_fuse_info atc_fuses_t8112_port1[] = { {0x23d2c8488, 8, 5, AUS_COMMON_SHIM_BLK_VREG, AUS_VREG_TRIM}, }; +// Order "atc-phy" compatibles in reverse chronologically order to deal with mutliple compatible +// strings in ADT atc-phy nodes. static const struct atc_fuse_hw atc_fuses[] = { - {"atc-phy,t8103", 0, atc_fuses_t8103_port0, ARRAY_SIZE(atc_fuses_t8103_port0)}, - {"atc-phy,t8103", 1, atc_fuses_t8103_port1, ARRAY_SIZE(atc_fuses_t8103_port1)}, + {"atc-phy,t6020", -1, NULL, 0}, + {"atc-phy,t8112", 0, atc_fuses_t8112_port0, ARRAY_SIZE(atc_fuses_t8112_port0)}, + {"atc-phy,t8112", 1, atc_fuses_t8112_port1, ARRAY_SIZE(atc_fuses_t8112_port1)}, /* t6002 uses the same fuses and the same atc-phy,t6000 compatible */ {"atc-phy,t6000", 0, atc_fuses_t6000_port0, ARRAY_SIZE(atc_fuses_t6000_port0)}, {"atc-phy,t6000", 1, atc_fuses_t6000_port1, ARRAY_SIZE(atc_fuses_t6000_port1)}, @@ -241,9 +244,8 @@ static const struct atc_fuse_hw atc_fuses[] = { {"atc-phy,t6000", 3, atc_fuses_t6000_port3, ARRAY_SIZE(atc_fuses_t6000_port3)}, {"atc-phy,t6000", 4, atc_fuses_t6000_port4, ARRAY_SIZE(atc_fuses_t6000_port4)}, {"atc-phy,t6000", 5, atc_fuses_t6000_port5, ARRAY_SIZE(atc_fuses_t6000_port5)}, - {"atc-phy,t8112", 0, atc_fuses_t8112_port0, ARRAY_SIZE(atc_fuses_t8112_port0)}, - {"atc-phy,t8112", 1, atc_fuses_t8112_port1, ARRAY_SIZE(atc_fuses_t8112_port1)}, - {"atc-phy,t6020", -1, NULL, 0}, + {"atc-phy,t8103", 0, atc_fuses_t8103_port0, ARRAY_SIZE(atc_fuses_t8103_port0)}, + {"atc-phy,t8103", 1, atc_fuses_t8103_port1, ARRAY_SIZE(atc_fuses_t8103_port1)}, }; static u32 read_fuse(const struct atc_fuse_info *fuse)