#asahi · 2021-11-18 13:26
marcanwhat machine is this?#asahi · 2021-11-18 13:26
marcanradnic: dammit#asahi · 2021-11-18 13:26
marcanand *that* breaks the I2C bus/read/whatever#asahi · 2021-11-18 13:25
marcanand the chip resets#asahi · 2021-11-18 13:25
marcanand then after ~1 second or so, a watchdog fires#asahi · 2021-11-18 13:25
marcanso I think what actually happens is that when we DoS it, it never executes the commandc#asahi · 2021-11-18 13:25
marcanheh, yeah#asahi · 2021-11-18 13:24
marcanthe curse spreads#asahi · 2021-11-18 13:24
marcanbut since it's USB-related, well, it makes sense#asahi · 2021-11-18 13:24
marcanthere is no way a stupid I2C device should've caused us so much grief#asahi · 2021-11-18 13:24
marcanthis thing has the curse of USB#asahi · 2021-11-18 13:23
marcanI think the repeat-start thing made it happen more often (after I patched it to always send the command, which was my way of reproing with chainload) because that gets rid of the wait for the stop condition, so it makes the timing of the polling even tighter#asahi · 2021-11-18 13:21
marcandepends on whether firmware is involved in that path, which it probably is (at least time to first byte)#asahi · 2021-11-18 13:19
marcanlet me know if that finally fixes things :)#asahi · 2021-11-18 13:19
marcanjust pushed a bunch of changes#asahi · 2021-11-18 13:19
marcanyup#asahi · 2021-11-18 13:17
marcanthe timeout thing is also broken but unrelated#asahi · 2021-11-18 13:16
marcanno, I mean the TPS#asahi · 2021-11-18 13:16
marcanthe datasheet tells you all about that too#asahi · 2021-11-18 13:16
marcanboth a ROM and a pile of patches/app code loaded from SPI#asahi · 2021-11-18 13:16
marcanit has a huge blob of firmware#asahi · 2021-11-18 13:16
marcanit's a USB-PD controller#asahi · 2021-11-18 13:16
marcanof course there is#asahi · 2021-11-18 13:14
marcanit needs a delay in the command poll loop#asahi · 2021-11-18 13:14
marcanwe poll for command completion so fast it never actually completes#asahi · 2021-11-18 13:14
marcanthe whole thing is firmware, right?#asahi · 2021-11-18 13:14
marcanwe're DoSing the damn chip#asahi · 2021-11-18 13:14
marcanoh god I think I figured it out#asahi · 2021-11-18 12:46
marcan(thankfully there is a magic USB-PD command to put those on the type C pins...)#asahi · 2021-11-18 12:46
marcanradnic: okay, that delay makes it work and I don't know why. time to stick a scope on the i2c pins#asahi · 2021-11-18 12:43
marcanthat's a bit of a problem when you're reading from a FIFO#asahi · 2021-11-18 12:43
marcanthe kernel helper is a macro, the m1n1 helper is a function that does *not* return the register value#asahi · 2021-11-18 12:43
marcanit's different#asahi · 2021-11-18 12:43
marcanit isn't#asahi · 2021-11-18 12:42
marcandaniels: this isn't the kernel, it's m1n1#asahi · 2021-11-18 12:38
marcanwell, not just that, there's more than one problem here :p#asahi · 2021-11-18 12:35
marcanit's just timing out early#asahi · 2021-11-18 12:35
marcanguess what, it doesn't take the CPU long to poll that register 10000 times...#asahi · 2021-11-18 12:35
marcan10000 iteration timeout with no delay#asahi · 2021-11-18 12:35
marcanthis is completely broken#asahi · 2021-11-18 12:35
marcan val = read32(dev->base + PASEMI_FIFO_RX);#asahi · 2021-11-18 12:35
marcan while (val & PASEMI_RX_FLAG_EMPTY && --timeout)#asahi · 2021-11-18 12:35
marcanehhh I bet I know what the problem is#asahi · 2021-11-18 12:31
marcaner sorry, work again#asahi · 2021-11-18 12:31
marcanyaaay timing issues#asahi · 2021-11-18 12:31
marcanI just added some debug prints and that makes it fail again#asahi · 2021-11-18 12:21
marcanok, I think I see what you mean#asahi · 2021-11-18 12:20
marcanok#asahi · 2021-11-18 12:20
marcanchainloading#asahi · 2021-11-18 12:19
marcanwell, that's weird because it definitely doesn't break for me on chainload...