Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont hard-code GIC_IRQ_PHANDLE, read it from device tree instead #49

Closed
axel-h opened this issue Oct 26, 2022 · 6 comments
Closed

Dont hard-code GIC_IRQ_PHANDLE, read it from device tree instead #49

axel-h opened this issue Oct 26, 2022 · 6 comments

Comments

@axel-h
Copy link
Member

axel-h commented Oct 26, 2022

Follow-up from #42 (comment)

Remove the hard coded GIC_IRQ_PHANDLE define and take the value from the device tree instead. Or add at least a sanity check that the hard-coded values machtes the device tree.

There have been cases, where the phande changes, and that causes strange errors then.
See also #27

@axel-h axel-h mentioned this issue Oct 26, 2022
@chrisguikema
Copy link
Contributor

Can we define an INTERRUPT_CONTROLLER macro instead? That way you can read that node from the device tree, and get the phandle?

@kent-mcleod
Copy link
Member

What about getting the phandle by looking up the interrupt parent of the primary boot core?

@chrisguikema
Copy link
Contributor

Is that something that is consistent on a per-platform basis?

Here is the boot core node on a zynqmp device tree:

		cpu@0 {
			compatible = "arm,cortex-a53";
			device_type = "cpu";
			enable-method = "psci";
			operating-points-v2 = <0x01>;
			reg = <0x00>;
			cpu-idle-states = <0x02>;
			clocks = <0x03 0x0a>;
			phandle = <0x3d>;
		};

On a tx2 device tree, I see <interrupt-parent> right on top.

@kent-mcleod
Copy link
Member

I see. I guess defining the path is good enough. It could also be used to setup the virtual gic without having to hardcode the addresses for each platform.

@chrisguikema
Copy link
Contributor

Created a PR for that here: seL4/seL4_projects_libs#83

@axel-h
Copy link
Member Author

axel-h commented Oct 27, 2022

Closing this, because #52 was merged and we use DTB paths now.

@axel-h axel-h closed this as completed Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants