As of today, git revision 39a36707bd33b86a115651678028baeb616c8365, using 'kldload miibus' is not equivalent to using 'device miibus' in kernel config. Newly introduced PHY drivers are missing (DP83822, DP83867, VSCPHY) and source files/PHY driver for FDT enabled kernels only are missing. Without including them, kernel modules using any function from dev/mii/mii_fdt.c refuse load (searching in sources, this should be if_dws.ko and if_ffec.ko, driver for genet device has no kernel module Makefile in main repository, also locally used module for cgem driver modified to use connection type is the same case).
PolarFire SoC hardware sponsored by Conclusive Engineering
Details
Checked locally on Zybo Z7 board (arm architecture) with if_cgem.ko module, also on PolarFire SoC based RCHD-PF board from Conclusive Engineering (riscv architecture) with the same module, module loads and works
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
I think it might be better to keep the file sorted the way it was before this change.
This will make this patch much easier to read.
In order to test the changes I'd recommend to do the following:
- Set MAKEOBJDIRPREFIX, TARGET, etc.
- make buildenv
- cd sys/modules/mii
- make
This way you'll check if the standalone build works.
sys/modules/mii/Makefile | ||
---|---|---|
16 | I think you've missed ofw_bus_if.h, it's needed to build mii_fdt.c. |
I partially disagree, but accept. Next try comes without this. I feel, however, some logical grouping could be usefull. How to achieve this?
In order to test the changes I'd recommend to do the following:
- Set MAKEOBJDIRPREFIX, TARGET, etc.
- make buildenv
- cd sys/modules/mii
- make
This way you'll check if the standalone build works.
... but only without options. I found with plain make module is build without FDT dependent sources. I can use 'env OPT_FDT=yes make' but I am not sure it does what I need...
sys/modules/mii/Makefile | ||
---|---|---|
16 | I think so as well, testing... |
Testing with 'make buildenv' revealed opt_platform.h is necessary as well. As part of normal buildkernel, this file is already created.
New revision is just being created, https://reviews.freebsd.org/D34687, for building if_cgem.ko kernel module, used to test changes proposed here for miibus.ko kernel module
Tested on my HiFive Unmatched with the if_cgem driver.
@mindal_semihalf.com are you happy with the changes?
sys/modules/mii/Makefile | ||
---|---|---|
15 | The source files are listed alphabetically, so these should be added in the same manner. I can take care of this before committing. |
sys/modules/mii/Makefile | ||
---|---|---|
15 | Original patch was sorted alphabetically, maybe you could check it. Just FYI. |