Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rp2xxx: Add support for assembling RP2350-specific PIO #320

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Grazfather
Copy link
Contributor

@Grazfather Grazfather commented Dec 19, 2024

RP2350 adds the following new instruction features:

  • Adds PINCTRL_JMP_PIN as a source for the WAIT instruction, plus an offset in the range 0-3.
    • This gives WAIT pin arguments a per-SM mapping that is independent of the IN-mapped pins.
  • Adds PINDIRS as a destination for MOV.
    • This allows changing the direction of all OUT-mapped pins with a single instruction: MOV PINDIRS, NULL or MOV
      PINDIRS, ~NULL
  • Adds SM IRQ flags as a source for MOV x, STATUS
    • This allows branching (as well as blocking) on the assertion of SM IRQ flags.
  • Extends IRQ instruction encoding to allow state machines to set, clear and observe IRQ flags from different PIO
    blocks.
    • There is no delay penalty for cross-PIO IRQ flags: an IRQ on one state machine is observable to all state
      machines on the next cycle.
  • Adds the FJOIN_RX_GET FIFO mode.
    • A new MOV encoding reads any of the four RX FIFO storage registers into OSR.
    • This instruction permits random reads of the four FIFO entries, indexed either by instruction bits or the Y
      scratch register.
  • Adds the FJOIN_RX_PUT FIFO mode.
    • A new MOV encoding writes the ISR into any of the four RX FIFO storage registers.
    • The registers are indexed either by instruction bits or the Y scratch register.
      RP2350 adds the following security features:
  • Limits Non-secure PIOs (set to via ACCESSCTRL) to observation of only Non-secure GPIOs. Attempting to read a
    Secure GPIO returns a 0.
  • Disables cross-PIO functionality (IRQs, CTRL_NEXTPREV operations) between Non-secure PIO blocks (those which
    permit Non-secure access according to ACCESSCTRL) and Secure-only blocks (those which do not).
    RP2350 includes the following general improvements:
  • Increased the number of PIO blocks from two to three (8 → 12 state machines).
  • Improved GPIO input/output delay and skew.
  • Reduced DMA request (DREQ) latency by one cycle vs RP2040

};
}

pub fn assemble(comptime format: Format, comptime source: []const u8, comptime options: AssembleOptions) Output {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to make the user provide the format

@Grazfather Grazfather force-pushed the rp2350_pio_assembler branch 2 times, most recently from 12680f8 to 6355e52 Compare December 19, 2024 21:21
@Grazfather Grazfather changed the title rp2xxx: Add support for rp2350 assembling rp2xxx: Add support for assembling RP2350-specific PIO Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant