[PATCH 00/10] drm/ast: Split POST code per hardware gen

Thomas Zimmermann tzimmermann at suse.de
Wed Jul 2 13:12:48 UTC 2025


Move the POST code for each hardware generation into a separate source
file. Split some functions per gen, as necessary. Makes the code more
maintainable. Support for future hardware generations can now be added
easily in a new source file without interfering with existing code.

Gen3 and Gen5 share their POST code with earlier hardware generations.
The other generations have individual POST. Patch 1 makes the few
shared cross-gen helpers available.

Patches 2 to 5 move individual POST functionality into separate files,
split by hardware generation and addresses some coding-style issues.

Patches 6 and 7 fix the use of struct ast_dramstruct to be less of a
blackbox. It's used for DRAM initialization in Gen1 and Gen2 hardware.

Patch 8 splits up default settings for various registers. This brings
up an issue with Gen7, which likely uses outdated values from Gen1.

Patches 9 and 10 attempt to fix the default settings for Gen7. It's
done separately from the rest, so it can be bisected and reverted
easily, if necessary.

Tested on AST2600 (Gen7) and AST2500 (Gen6).

Thomas Zimmermann (10):
  drm/ast: Declare helpers for POST in header
  drm/ast: Move Gen7+ POST code to separate source file
  drm/ast: Move Gen6+ POST code to separate source file
  drm/ast: Move Gen4+ POST code to separate source file
  drm/ast: Move Gen2+ and Gen1 POST code to separate source files
  drm/ast: Move struct ast_dramstruct to ast_post.h
  drm/ast: Handle known struct ast_dramstruct with helpers
  drm/ast: Split ast_set_def_ext_reg() by chip generation
  drm/ast: Gen7: Disable VGASR0[1] as on Gen4+
  drm/ast: Gen7: Switch default registers to gen4+ state

 drivers/gpu/drm/ast/Makefile          |    5 +
 drivers/gpu/drm/ast/ast_2000.c        |  149 ++
 drivers/gpu/drm/ast/ast_2100.c        |  348 +++++
 drivers/gpu/drm/ast/ast_2300.c        | 1328 ++++++++++++++++
 drivers/gpu/drm/ast/ast_2500.c        |  569 +++++++
 drivers/gpu/drm/ast/ast_2600.c        |   49 +
 drivers/gpu/drm/ast/ast_dram_tables.h |  207 ---
 drivers/gpu/drm/ast/ast_drv.c         |    2 +-
 drivers/gpu/drm/ast/ast_drv.h         |   17 +-
 drivers/gpu/drm/ast/ast_post.c        | 2027 +------------------------
 drivers/gpu/drm/ast/ast_post.h        |   50 +
 11 files changed, 2536 insertions(+), 2215 deletions(-)
 create mode 100644 drivers/gpu/drm/ast/ast_2000.c
 create mode 100644 drivers/gpu/drm/ast/ast_2100.c
 create mode 100644 drivers/gpu/drm/ast/ast_2300.c
 create mode 100644 drivers/gpu/drm/ast/ast_2500.c
 create mode 100644 drivers/gpu/drm/ast/ast_2600.c
 delete mode 100644 drivers/gpu/drm/ast/ast_dram_tables.h
 create mode 100644 drivers/gpu/drm/ast/ast_post.h

-- 
2.50.0



More information about the dri-devel mailing list