Skip to content

Maaxboard dvfs#667

Draft
omeh-a wants to merge 10 commits intomainfrom
maaxboard_dvfs
Draft

Maaxboard dvfs#667
omeh-a wants to merge 10 commits intomainfrom
maaxboard_dvfs

Conversation

@omeh-a
Copy link
Copy Markdown
Member

@omeh-a omeh-a commented Mar 12, 2026

This PR adds the DVFS driver class and an implementation for the Maaxboard. There are some deviations from the protocol introduced by Cheng's PR (#567)

  • The protocol now only exchanges operating point indices. The other protocol used frequency, which wasn't ideal as operating points may technically have overlapping frequencies and it also means we need to needlessly perform a lookup/error checking on every op.
  • Entire implementation is in C.
  • Driver style changed drastically. Original DVFS driver expects that the clock speed / temperature can be adjusted with a single register write by the DVFS driver itself, when in reality it should be calling out to dedicated power and clock control drivers.
  • Driver operating point table and core list style changed to contain parameters to call out to clock/pmic drivers, designed to support a future update to load operating points and core info directly from DTS.
  • Example works a bit differently.

To do before merge:

  • sdfgen support
  • zig build support
  • upstream pmic driver
  • upstream clk driver
  • ci support

This PR depends on these PRs:

mt-fns and others added 10 commits March 6, 2026 15:17
add returh of data handler to imx i2c

update i2c imx registers to align with data sheet memory map

update i2c imx init step to use fast-mode divider

add notes on i2c clock calculation

update i2c imx driver to send start when await start

update imx i2c address cycle handling

add transmit successful check

update boards.py to contain i2c region for imx

add read handling in state_cmd_ret for i2c imx

update i2c imx to set TXAK register when reading second to last byte
Signed-off-by: Lesley Rossouw <lesley.rossouw@unsw.edu.au>
…r why.

Signed-off-by: Lesley Rossouw <lesley.rossouw@unsw.edu.au>
Signed-off-by: Lesley Rossouw <lesley.rossouw@unsw.edu.au>
Signed-off-by: Lesley Rossouw <lesley.rossouw@unsw.edu.au>
…orts only the subset of features needed for contract deliverable (DVFS)

Signed-off-by: Lesley Rossouw <lesley.rossouw@unsw.edu.au>
This implementation includes all clock definitions, basic operations
of clock compoents, as well as interfaces to interact with clicnets
via PPC. Client should be able to enable/disable a specific gate
clock or query the current clock rate by passing the corresponding
clock identifier, which is listed in g12a-bindings.h.

set_rate() assumes that the rate requst is valid and compatible with
the current configurations. Complete implementation that considers
more incompatible requests will come in the future when dynamic
clock configuration is necessary in lionsos

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>

add Makefile

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>

Clock driver for maaxboard

Add clock driver for maaxboard. This commit includes all clock component
definitions, basic operations, and a simple test on maaxboard. Scripts are
added in build systems. A few files are reorganised for reuse

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>

Clk: fix style

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>

clk: modify interfaces and fix issues during initialisation

This commit includes modifiation to the interfaces, primarily for set/get rate, which
return error state as well as final rate.

More tests are conducted to verify the basic operations of types of clock components.
A few bugs are fixed as well.

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>

clk: fix style and add licenses

This commit fixed style and license issues

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>

clk: fix style and data types

This commit replaces all platform-dependent data types with fix-sized
types, and unifies the return values of interfaces as signed integers.
The return value 0 indicates the success on the request to clock driver,
and negative values indicate the failure reasons.

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>

clk: combine regmap_* and regmap_mux_* operations

Abstract a set of regmap_* operations by combining mux-specific ones and ordinary ones

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>

clk: add get/set parent interfaces

Add clk_get_parent() and clk_set_parent() interfaces for the clients.
Fixed several logic issues in related implementations. More clock
component definition checkings and fixup.

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>

clk: set_rate for maaxboard clocks

This commit adds set_rate() implementations for maaxboard. Now clocks can
be set to target rate at initialisation time and configured dynamically.

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>

clk: reorganise files

This commit reorgnises source files to allow more code to be shared
for multiple boards.

Refactor makefiles:
- move objectives to clk_driver directory
- use built-in CFLAGS in rules

Temporary fixup for a zig build issue: create_clk_config.py cannot find
the lazypath `zig-out/bin` when executing. The current solution is to
create an install directory in advance, but it would be a bit of trouble
to find the generated header file if someone want to read or modify it.

Moved clock specifier binding files to `include/sddf/clk`, so the clients
will be able to configure clocks with macro constants

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>

Update clock driver to current sddf build style, added meta.py

Signed-off-by: Lesley Rossouw <lesley.rossouw@unsw.edu.au>

Replace setvar constants, move all memory region setup to meta.py

Signed-off-by: Lesley Rossouw <lesley.rossouw@unsw.edu.au>

Clock driver for maaxboard

Add clock driver for maaxboard. This commit includes all clock component
definitions, basic operations, and a simple test on maaxboard. Scripts are
added in build systems. A few files are reorganised for reuse

Signed-off-by: Terry Bai <terry.z.bai@gmail.com>

examples/clk: remove timer for client

Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>

examples/clk: remove dts dir

Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>

drivers/clk: add sddf_clk_set_cpu_freq() interface

Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>

drivers/clk: add ARM_CLK and remove sddf_clk_set_cpu_freq()

Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>

clock driver hotfixes

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>

clk driver flake dep

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
Signed-off-by: Terry Bai <tianyi.bai@unsw.edu.au>
Signed-off-by: Lesley Rossouw <lesley.rossouw@unsw.edu.au>
… and pmic drivers

Signed-off-by: Lesley Rossouw <lesley.rossouw@unsw.edu.au>
@omeh-a omeh-a mentioned this pull request Mar 13, 2026
10 tasks
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.

3 participants