From 2ff412930ea8c77406cdb45f79cbe4a0609b7398 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Tue, 11 Apr 2023 20:08:11 +0900 Subject: [PATCH] dart: Detect locked t8110 DARTs Signed-off-by: Hector Martin --- src/dart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dart.c b/src/dart.c index 96c42615..ff4819ea 100644 --- a/src/dart.c +++ b/src/dart.c @@ -231,7 +231,8 @@ dart_dev_t *dart_init(uintptr_t base, u8 device, bool keep_pts, enum dart_type_t set32(dart->regs + DART_T8020_ENABLED_STREAMS, BIT(device & 0x1f)); break; case DART_T8110: - // TODO locked dart + if (read32(dart->regs + DART_T8110_PROTECT) & DART_T8110_PROTECT_TTBR_TCR) + dart->locked = true; write32(dart->regs + DART_T8110_ENABLE_STREAMS + 4 * (device >> 5), BIT(device & 0x1f)); break; }