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.
Tags
None
Referenced Files
Unknown Object (File)
Feb 16 2024, 10:55 AM
Unknown Object (File)
Feb 16 2024, 10:55 AM
Unknown Object (File)
Feb 16 2024, 10:54 AM
Unknown Object (File)
Feb 16 2024, 10:54 AM
Unknown Object (File)
Feb 16 2024, 10:54 AM
Unknown Object (File)
Feb 16 2024, 4:27 AM
Unknown Object (File)
Feb 9 2024, 10:27 PM
Unknown Object (File)
Jan 28 2024, 10:23 PM

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
rG FreeBSD src repository
Lint
Lint Not Applicable
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.

484

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

501–502

No need to reorder the assignments.

503

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.

623

No need to change order of this method.

sys/dev/sdhci/sdhci_xenon.h
122

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
75

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).

81

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
81

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.Sep 29 2021, 1:20 PM