Page MenuHomeFreeBSD

sdhci_xenon: split driver file into generic file and fdt parts
ClosedPublic

Authored by bag_semihalf.com on Aug 18 2021, 8:51 AM.

Details

Summary

This patch splits driver code into two seperate files sdhci_xenon.c
and sdhci_xenon_fdt.c. This will allow future implementation of ACPI
discovery of sdhci on Xenon chips.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mw requested changes to this revision.Sep 23 2021, 11:02 AM
mw added inline comments.
sys/dev/sdhci/sdhci_xenon.c
381

Don't mix declarations with assignements.

439

Leave above assignments intact (of course apart from extending the if).

482–484

Check device_get_property consistently and compare explicitly to 0, as in the first if.

483

A single assignment of val in this function will be sufficient.

501–502

No need to reorder the assignments.

502

Call this function after resources allocation.

589

Leave above 3 lines in a common sdhci_xenon_attach(). There is no need to duplicate it for OF_ and ACPI_ cases.

597

Please retain an original name - this is a cosmetic change, not related to this patch.

622

No need to change order of this method.

sys/dev/sdhci/sdhci_xenon.h
121

Drop the ifdef - those fields are checked unconditionally and the driver will not compile for !EXT_RESOURCES case.

sys/dev/sdhci/sdhci_xenon_fdt.c
74

IMO there is no need to do the nested sc magic. However current one works fine, please use single sdhci_xenon_softc and move struct sdhci_fdt_gpio *gpio; there (with #ifdef FDT).

80

Don't mix assignments with declarations - please revisit entire file.

This revision now requires changes to proceed.Sep 23 2021, 11:02 AM

Thanks for the review. I've address all comments.

mw requested changes to this revision.Sep 24 2021, 10:48 AM
mw added inline comments.
sys/dev/sdhci/sdhci_xenon_fdt.c
80

This is still present in sdhci_xenon_fdt_detach and sdhci_xenon_fdt_get_card_present

This revision now requires changes to proceed.Sep 24 2021, 10:48 AM
bag_semihalf.com marked an inline comment as done.

LGTM + tested on (with DT and ACPI) on: MacchiatoBin, CN913x-DB and CN913x-CEx7 Evaluation Board

This revision is now accepted and ready to land.Wed, Sep 29, 1:20 PM