On Fri Mar 6, 2026 at 5:49 AM JST, Timur Tabi wrote:
> On Sun, 2026-03-01 at 23:03 +0900, Alexandre Courbot wrote:
>> ) -> Result {
>> match self.hal.load_method() {
>> LoadMethod::Dma => self.dma_load(dev, bar, fw),
>> - LoadMethod::Pio => Err(ENOTSUPP),
>> + LoadMethod::Pio => self.pio_load(bar,
>> &fw.try_as_pio_loadable()?),
>
> Wouldn't it be simpler to have pio_load() just extract the IMEM/DMEM values
> it needs from &fw,
> instead of creating an adapter? The adapter just seems like overkill for
> something that's used only
> once.
pio_load's job is to load a firmware, period. If we start doing
something else we distract it from its purpose and end up with a messy
soup doing many different things.
The differences between PIO and DMA are minimal but subtle enough (tag
for IMEM sections, smaller `dst_start`, ...) that we need to have
different parameter types for both and a fallible conversion step. Of
course I'd prefer to do without an adapter but it's not as simple as
that (or please show me with code how to do it).
Actually I'm thinking that we should maybe move all the PIO-related
stuff into its own `pio` submodule so we don't clutter `falcon.rs` with
this.