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

Unmappable memory generator #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Dec 6, 2023

  1. Non-memory addressable regmap generator

    Moves the existing codegen into a mmio and makes it the default.
    The existing mmio generator is for mappable register maps where a
    simple pointer with offsets and infallible access is expected.
    
    Adds a new iface based generator for non-memory mappable register maps
    where access is expected to be fallible and require a simple read/write
    interface.
    
    The read/write register interface then provides all of the same kinds of
    functions that a typical regmap block generated by chiptool would have,
    with all functions being fallible.
    
    This enables generating regmaps from yaml files for peripheral chips on
    buses such as i2c or spi. No builtin notion of *how* th register map is
    accessible other than a simple read function given a register address
    and write function given an address and value are implementable by a
    driver.
    
    A driver using this for the WM8960 codec which requires some peculiar
    attributes was used to ensure the generated code was usable.
    
    This device in particular has some interesting quirks. The address size
    is 7 bits, the value size is 9 bits, and no reads are available over i2c
    for the device. Everything works as expected and the value/address
    container sizes are u8 and u16 as might be expected.
    
    Initial code was derived from the i2c branch Dario Nieuwenhuis had
    created for chiptool likely for the same goal.
    
    Co-authored-by: Dario Nieuwenhuis <[email protected]>
    SpinFast and Dirbaio committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    3a644f6 View commit details
    Browse the repository at this point in the history