Page MenuHomeFreeBSD

[BHND] (fix) set of corrections
ClosedPublic

Authored by mizhka on May 26 2016, 10:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 2:59 AM
Unknown Object (File)
Sep 28 2024, 8:32 AM
Unknown Object (File)
Sep 25 2024, 9:07 AM
Unknown Object (File)
Sep 24 2024, 10:12 PM
Unknown Object (File)
Sep 20 2024, 1:06 PM
Unknown Object (File)
Sep 20 2024, 11:23 AM
Unknown Object (File)
Sep 17 2024, 10:35 AM
Unknown Object (File)
Aug 18 2024, 10:08 PM
Subscribers

Details

Summary

Hi,

This patch contains following fixes:

  • [bus] default implementation of get_attach_type should iterate over device tree before panic. May be it worth to implement it only for BHND(4) bus (bcma / siba).
  • [chipc] correct IRQ lines for UART (to fix IRQ lookup in future)
  • [chipc] check device unit in resource assignment during chipc_add_child
  • [chipc] if hint->size is RM_MAX_END, resource end should be same as window end
  • [chipc] clear reference from resource list entry to resource in case of resource release
  • [chipc] add get_caps implementation
  • [chipc] correct flash constants (to be unshifted)
  • [chipc] def implementation for BHND_CHIPC_GET_CAPS inside bhnd_chipc_if.m
Test Plan

Tested on ASUS RT-N53, ASUS RT-N16

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mizhka retitled this revision from to [BHND] (fix) set of corrections.
mizhka updated this object.
mizhka edited the test plan for this revision. (Show Details)
mizhka added reviewers: landon_landonf.org, adrian.
mizhka set the repository for this revision to rS FreeBSD src repository - subversion.
  • fixed merge issue to head
landon_landonf.org edited edge metadata.

Looks good, just some minor comments inlined.

sys/dev/bhnd/bhnd_bus_if.m
59 ↗(On Diff #16947)

For consistency with the other bhnd_bus_generic_ methods (and symbol accessibility), this should be lifted out into bhnd.h and bhnd_subr.c.

sys/dev/bhnd/cores/chipc/chipc.c
491 ↗(On Diff #16947)

To avoid any confusion between unit and dunit, I suggest overwriting unit with the assigned value.

492 ↗(On Diff #16947)

The returned unit should never be -1 here, but this highlights an issue on non-SoC bhnd(4) devices; since unit numbers aren't local to a bus, they may already be claimed elsewhere.

To still support the use of 0-relative unit numbers in the hints table, I think something like this should work (just before hint matching):

busrel_unit = 0;
for (int i = 0; i < unit; i++) {
      if (device_find_child(dev, name, i) != NULL)
                busrel_unit++;
}
This revision now requires changes to proceed.May 27 2016, 2:10 AM
mizhka updated this object.
mizhka edited the test plan for this revision. (Show Details)
mizhka edited edge metadata.
  • fixed review remarks
  • added default implementation for get_caps method to allow all devices in hierarchy under CC to access ChipCommon capabilities
  • additional testing (RT-N16)
landon_landonf.org edited edge metadata.

Other than some minor style(9) issues to be fixed, looks good to me. Thanks for fixing these!

sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m
42 ↗(On Diff #16990)

Minor style(9) issue, the * should be adjoining the function name.

sys/dev/bhnd/cores/chipc/chipc.c
1282 ↗(On Diff #16990)

style(9), should be space between chipc_caps and *

This revision is now accepted and ready to land.May 27 2016, 3:27 PM
mizhka edited edge metadata.
  • fixed style(9) issues
This revision now requires review to proceed.May 27 2016, 5:58 PM
This revision is now accepted and ready to land.May 27 2016, 6:11 PM
mizhka updated this object.
mizhka edited edge metadata.
  • move def implementation for BHND_CHIPC_GET_CAPS into bhnd_chipc_if.m
This revision now requires review to proceed.May 30 2016, 3:47 PM
This revision is now accepted and ready to land.May 31 2016, 5:41 PM
This revision now requires review to proceed.Jun 4 2016, 7:01 PM
landonf edited edge metadata.
This revision is now accepted and ready to land.Jun 4 2016, 7:01 PM
adrian edited edge metadata.
This revision was automatically updated to reflect the committed changes.