Skip to content

[Accton] modules: extract accton_ipmi_intf into common kernel-module … - #212

Open
eric271110 wants to merge 2 commits into
accton:support_linux_6.1from
eric271110:move_ipmi_to_common_linux_6.1
Open

[Accton] modules: extract accton_ipmi_intf into common kernel-module …#212
eric271110 wants to merge 2 commits into
accton:support_linux_6.1from
eric271110:move_ipmi_to_common_linux_6.1

Conversation

@eric271110

Copy link
Copy Markdown

…source tree

Platforms: as7535-28xb, as7926-40xfb, as7946-30xb, as7946-74xkb, as9737-32db, as9817-64, as9926-24db.

  • Move the accton_ipmi_intf.c / accton_ipmi_intf.h kernel-module source that was duplicated in every platform's src/modules tree into a shared source directory under packages/platforms/accton/x86-64/common/modules/src, so all Accton x86-64 platforms build from one copy instead of per-platform duplicates.
  • Add a shared build helper kmodule-stage.mk under packages/platforms/accton/x86-64/common/modules. It stages the platform's own src/modules contents plus a caller-supplied list of shared basenames (ACCTON_COMMON_KMOD_SRCS) into a temporary .stage directory and hands that merged tree to kmodbuild.sh via the standard KMODULES variable. Add a README.md next to the helper describing the layout and how a platform opts in.
  • Update each platform's modules/builds/Makefile to include kmodule-stage.mk instead of make/kmodule.mk, set ACCTON_COMMON_KMOD_SRCS := accton_ipmi_intf, and change KMODULES to $(CURDIR)/src so the stager can locate the platform-local sources from any working directory. Add .stage to each platform's modules/builds/.gitignore so the staging directory is not tracked.
  • Remove the per-platform copies of accton_ipmi_intf.c / accton_ipmi_intf.h under each platform's modules/builds/src (and as9817-64/src/modules) now that the shared source is used.

Move accton_ipmi_intf.{c,h} into a single shared location under
packages/platforms/accton/x86-64/common/modules/src/ and reference it
from each platform's kmodule Makefile via KINCLUDES / KMODULES, so each
platform no longer maintains its own copy of the IPMI interface source.

The two prototypes in accton_ipmi_intf.h (init_ipmi_data,
ipmi_send_message) are marked __attribute__((weak)) so modpost does not
report them as undefined during the per-.c isolated build pass. The
symbols are still exported by accton_ipmi_intf.ko and resolved at
insmod time. The same weak-extern pattern is applied to the cross-.ko
symbols referenced by x86-64-accton-as9817-64-fpga.c
(cpld_access_lock, wait_spi, spi_post_write_guard_delay_us,
spi_busy_reg), which are exported by x86-64-accton-as9817-64-i2c-ocores.ko.

Per-platform accton_ipmi_intf.{c,h} copies and their src/Makefile
wrappers are removed.

Affected platforms:
- as7535-28xb
- as7926-40xfb
- as7946-30xb
- as7946-74xkb
- as9737-32db
- as9817-64d
- as9817-64o
- as9926-24db

Signed-off-by: Eric Yang <eric_yang@accton.com>
@eric271110
eric271110 force-pushed the move_ipmi_to_common_linux_6.1 branch from 7670da1 to b8bca21 Compare September 1, 2026 08:42
Place the shared IPMI interface helper under
packages/platforms/accton/x86-64/modules/builds/ipmi/ to match the
existing shared-module layout used elsewhere in this tree (for
example, the ptp helper). The previous common/ subtree is no longer
needed and is removed.

Update KINCLUDES / KMODULES in each affected platform's kmodule
Makefile to reference the new path.

Affected platforms:
- as7535-28xb
- as7926-40xfb
- as7946-30xb
- as7946-74xkb
- as9737-32db
- as9817-64d
- as9817-64o
- as9926-24db

Signed-off-by: Eric Yang <eric_yang@accton.com>
@eric271110
eric271110 force-pushed the move_ipmi_to_common_linux_6.1 branch from 811bec2 to 5889c98 Compare September 2, 2026 03:02
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