Page MenuHomeFreeBSD

Introduce INTRNG support for MIPS

Authored by on Feb 4 2016, 7:14 AM.


Group Reviewers
rS295498: Begin the MIPS_INTRNG support.

This introduces INTRNG support for the MIPS platforms. It is taken from ARM and the work has been done by Alexander Kabaev as part of his CI20 port.

I have tried to extract the INTRNG-related changes only and am also relying on this as part of the Ralink/Mediatek support.

To follow:

  1. proper MIPS timer attachment when using INTRNG
  2. suggestion to remove bus_space_fdt on MIPS and have bus_space_generic do the right things when mapping/unmapping bus space.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline retitled this revision from to Introduce INTRNG support for MIPS. updated this object. edited the test plan for this revision. (Show Details) added reviewers: MIPS, adrian, kan. set the repository for this revision to rS FreeBSD src repository - subversion. added a project: MIPS.
skra added inline comments.
95 ↗(On Diff #12991)

IMO, almost all things here should be in some common header in sys/sys. I wonder why such header was not created when INTRNG was moved in sys/kern.

kan requested changes to this revision.Feb 4 2016, 3:59 PM
kan edited edge metadata.

I do not see mips_pic.c in this patch, which is supposed to the the generic MIPS32 intr controller and is the place where cpu_establish_hard_intr for INTRNG is implemented. If you do not need rest of the mips_pic.c, consider moving these into an independent implementation file (mips/mips/intr.c?). You will need to export the root PIC pointer from MI intr code for that and that is the reason why I kept function in the file that implements root PIC on my SOC.

95 ↗(On Diff #12991)

Because unifying .h files as declared as TODO by adrian and he is still on the hook to do it some day, I hope.

424 ↗(On Diff #12991)

This bit is unrelated to INTRNG really, is it not? We should be able to avoid dragging it into -current only to be replaced later by fdtbus_bs_tag removal patch.

454 ↗(On Diff #12991)

Same here.

605 ↗(On Diff #12991)

This bit is also not an INTRNG piece, but rather a separate change than has an implication of enabling bus passes on the whole MIPS platform and as such probably deserves a separate commit.

This revision now requires changes to proceed.Feb 4 2016, 3:59 PM
47 ↗(On Diff #12991)

This comment is not true, there is no dependency on exception.S anymore as corresponding block was #ifdef-ed out in exception.S in favor of code implemented by common intr.c. edited edge metadata.

I've updated the patch, addressing kan's comments. I'll send out a separate review for enabling bus pass on MIPS (together with enabling it for the mips_pic (intr.c) tomorrow. I'll also update the bus_space_fdt removal patch tomorrow.

I wasn't quite clear, my apologies. I still want to have mips_pic.c, not intr.c in the source. I only wanted intr.c IFF you were to decide to move cpu_establish_hard_intr and friends into a separate file and make them with arbitrary root PICm only then I called for the intr.c file. In other words, rename your intr.c to mips_pic.c for now. edited edge metadata.

Renamed sys/mips/mips/intr.c to sys/mips/mips/mips_pic.c per Alexander Kabaev's request (sorry, I must have misunderstood what you meant originally).

ok, so how about we (read: me) split out the arm intrng definitions into sys/sys/ and then you can update your patch.

I just was worried that we'd need "more" and/or "different" fields between arm intrng and mips intrng.

Let me go do that soon. Thanks!

96 ↗(On Diff #13018)

Yeah, I was waiting for some people to use it in the MIPS world before I decided to unify this stuff. If you think this is all generic enough to use in your MIPS_INTRNG world then let's do that as a first pass. Then we can commit this stuff, minus all of the duplicate code.

How's that sound? edited edge metadata.

Patch updated to use sys/sys/intr.h for the common parts between ARM and MIPS.
Also, FDT-related headers are now conditionally included in order to allow MIPS systems that do not support FDT to move to INTRNG should they wish to.

kan edited edge metadata.
This revision is now accepted and ready to land.Feb 10 2016, 7:18 PM
This revision was automatically updated to reflect the committed changes.
mizhka added inline comments.


The variable "tf" seems to be undefined, and I suppose it's "struct trapframe*"? Does MIPS_INTRNG support "device hwpmc"?