Page MenuHomeFreeBSD

Add the SDHCI Address Decoder registers and routines for ARMADA 38X.
ClosedPublic

Authored by loos on May 4 2017, 7:27 PM.

Details

Summary

Add the SDHCI Address Decoder registers and routines for ARMADA 38X.

Sponsored by: Rubicon Communications, LLC (Netgate)

Test Plan

Tested on ClearFog Pro.

Diff Detail

Repository
rS 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

loos created this revision.May 4 2017, 7:27 PM
loos retitled this revision from Add the SDHCI Address Decoder registers and routines for ARMADA 38X. Sponsored by: Rubicon Communications, LLC (Netgate) to Add the SDHCI Address Decoder registers and routines for ARMADA 38X.Sponsored by: Rubicon Communications, LLC (Netgate).May 4 2017, 7:30 PM
loos added reviewers: mw_semihalf.com, zbb.
loos retitled this revision from Add the SDHCI Address Decoder registers and routines for ARMADA 38X.Sponsored by: Rubicon Communications, LLC (Netgate) to Add the SDHCI Address Decoder registers and routines for ARMADA 38X..May 4 2017, 7:44 PM
loos edited the summary of this revision. (Show Details)
mw_semihalf.com added inline comments.May 5 2017, 7:21 AM
sys/arm/mv/mv_common.c
2090 ↗(On Diff #28035)

Hi,

I know e.g. usb3 is done exactly same, but I think the only place we should use the ifdef is here:

static int
decode_win_sdhci_valid(void)
{
#ifdef SOC_MV_ARMADA38X

return (decode_win_can_cover_ddr(MV_WIN_SDHCI_MAX));

#endif

/* Satisfy platforms not equipped with this controller */
return (1);

}

The registers definition are not under ifdef, so e.g. kirkwood should compile easily. _setup and _dump functions execution is depending on the compatible string, so it can be safe as well. In further perspective, I think also _valid check should depend on the compatible, so that we don't have to add dummy stuff. What do you think?

loos updated this revision to Diff 28162.May 9 2017, 6:09 AM
loos marked an inline comment as done.

Remove the #ifdef for decode_win_sdhci_valid() as requested by Marcin at Semihalf.

sys/arm/mv/mv_common.c
2090 ↗(On Diff #28035)

Fixed in the latest update. Thanks!

mw_semihalf.com added inline comments.May 9 2017, 8:04 AM
sys/arm/mv/mv_common.c
669 ↗(On Diff #28162)

Thanks for the update. However, if you move WIN_REG_BASE_IDX_ macros out of #if defined(SOC_MV_ARMADA38X)...

2128 ↗(On Diff #28162)

... you will be able to remove ifdef around decode_win_sdhci_setup/dump and the dummy functions below. We won't break Kirkwood or ArmadaXP compilation, and because the routines won't execute on those platforms, because they require compatible string match.

loos marked an inline comment as done.May 9 2017, 6:02 PM
loos updated this revision to Diff 28180.May 9 2017, 6:04 PM

Move the MACROs definition outside the #ifdefs and remove the now unnecessary #ifdefs.

Spotted by: mw@semihalf.com

mw_semihalf.com accepted this revision.May 9 2017, 8:46 PM
This revision is now accepted and ready to land.May 9 2017, 8:46 PM
This revision was automatically updated to reflect the committed changes.