Skip to content

Commit 3373306

Browse files
committed
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 <kettenis@openbsd.org> Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 8779d38 commit 3373306

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/kboot_atc.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,19 +231,21 @@ static const struct atc_fuse_info atc_fuses_t8112_port1[] = {
231231
{0x23d2c8488, 8, 5, AUS_COMMON_SHIM_BLK_VREG, AUS_VREG_TRIM},
232232
};
233233

234+
// Order "atc-phy" compatibles in reverse chronologically order to deal with mutliple compatible
235+
// strings in ADT atc-phy nodes.
234236
static const struct atc_fuse_hw atc_fuses[] = {
235-
{"atc-phy,t8103", 0, atc_fuses_t8103_port0, ARRAY_SIZE(atc_fuses_t8103_port0)},
236-
{"atc-phy,t8103", 1, atc_fuses_t8103_port1, ARRAY_SIZE(atc_fuses_t8103_port1)},
237+
{"atc-phy,t6020", -1, NULL, 0},
238+
{"atc-phy,t8112", 0, atc_fuses_t8112_port0, ARRAY_SIZE(atc_fuses_t8112_port0)},
239+
{"atc-phy,t8112", 1, atc_fuses_t8112_port1, ARRAY_SIZE(atc_fuses_t8112_port1)},
237240
/* t6002 uses the same fuses and the same atc-phy,t6000 compatible */
238241
{"atc-phy,t6000", 0, atc_fuses_t6000_port0, ARRAY_SIZE(atc_fuses_t6000_port0)},
239242
{"atc-phy,t6000", 1, atc_fuses_t6000_port1, ARRAY_SIZE(atc_fuses_t6000_port1)},
240243
{"atc-phy,t6000", 2, atc_fuses_t6000_port2, ARRAY_SIZE(atc_fuses_t6000_port2)},
241244
{"atc-phy,t6000", 3, atc_fuses_t6000_port3, ARRAY_SIZE(atc_fuses_t6000_port3)},
242245
{"atc-phy,t6000", 4, atc_fuses_t6000_port4, ARRAY_SIZE(atc_fuses_t6000_port4)},
243246
{"atc-phy,t6000", 5, atc_fuses_t6000_port5, ARRAY_SIZE(atc_fuses_t6000_port5)},
244-
{"atc-phy,t8112", 0, atc_fuses_t8112_port0, ARRAY_SIZE(atc_fuses_t8112_port0)},
245-
{"atc-phy,t8112", 1, atc_fuses_t8112_port1, ARRAY_SIZE(atc_fuses_t8112_port1)},
246-
{"atc-phy,t6020", -1, NULL, 0},
247+
{"atc-phy,t8103", 0, atc_fuses_t8103_port0, ARRAY_SIZE(atc_fuses_t8103_port0)},
248+
{"atc-phy,t8103", 1, atc_fuses_t8103_port1, ARRAY_SIZE(atc_fuses_t8103_port1)},
247249
};
248250

249251
static u32 read_fuse(const struct atc_fuse_info *fuse)

0 commit comments

Comments
 (0)