Skip to content

Draft: Add new proprieties and wrappers functions#61

Open
tmarcero wants to merge 8 commits into
qualcomm:mainfrom
tmarcero:sail-platform
Open

Draft: Add new proprieties and wrappers functions#61
tmarcero wants to merge 8 commits into
qualcomm:mainfrom
tmarcero:sail-platform

Conversation

@tmarcero
Copy link
Copy Markdown
Contributor

  • Update cortex-r52
  • arm_gicv3: Add first-cpu-index property
  • Add new wrappers functions
  • Add new power ON/OFF callback for ARM CPU
  • Add new write GPIO model
  • Add new wrapper function to set IMP_BUILDOPTR register
  • hexagon_qtimer: Add ticker_ctrl CCI param and make p_cnttid a vector

This PR follows this one:
qualcomm/qemu#142

@tmarcero tmarcero self-assigned this May 20, 2026
@tmarcero tmarcero changed the title SAIL Qbox Updates Draft: SAIL Qbox Updates May 20, 2026
@tmarcero tmarcero changed the title Draft: SAIL Qbox Updates Draft: Add new proprieties and wrappers functions May 20, 2026

switch (ret) {
case 0: // SUCCESS
break;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems a little excessive to do the, is there a 'perror' equivalent? Or should we just print the number, Also, is this ARM specific (as the error messages suggest)? this is in CPU.h so it should work for hexagon, riscv, ...?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ARM specific I guess, the functions calls will be arm_set_cpu_on_and_reset and arm_set_cpu_off from qemu, and those functions are returning the values coming from : https://github.com/qualcomm/qemu/blob/d5220094f479931acdc35656b0d35801bb8913a7/target/arm/arm-powerctl.h#L16

Not sure those wrappers functions will work for hexagon or riscv, maybe there is an equivalent in qemu to turn ON/OFF them.

So maybe move this code in more appropriate ARM file ?

tmarcero and others added 4 commits May 20, 2026 12:57
- libqemu-v11.0-v0.6: - qct-qtimer: add support for frame_stride property
- CortexR52: Add new pmsav8r_hdregion property
- Update set_cp15_cbar wrapper function
- Add new wrappers functions and export them with getter functions
- Add new wrapper function to set IMP_BUILDOPTR register
- qct-qtimer: add ticker-ctrl property and remove the start-ticking one (OnOffAuto)

Signed-off-by: Marceron Thomas <tmarcero@qti.qualcomm.com>
- Add EL2 property
- Add Multi-processor affinity property
- Add PMSAv7 and PMSAv8 properties to set the MPU number of supported regions
- Add CBAR property

Signed-off-by: tmarcero <tmarcero@quicinc.com>
- In the case of some SoC is using multiples GICs, we will need to
set this, otherwise we will have this kind of errors : `Assertion `oldreg->type & ARM_CP_OVERRIDE' failed`
which means that same GIC registers will be configured multiples times.
It's because the same CPU index will be return by `qemu_get_cpu` function except if we use this property.

Signed-off-by: tmarcero <tmarcero@quicinc.com>
- Add new getter functions to fetch QEMU properties
- Add ARM power control function to power on and unhalt CPUs

Signed-off-by: tmarcero <tmarcero@quicinc.com>
bool value = m_int->exports().object_property_get_bool(m_obj, name, &e);

if (e != nullptr) {
throw GetPropertyException("bool", name, m_int->exports().error_get_pretty(e));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure throwing is a very good idea here, I think you should SC_REPORT_FATAL.....
Unless you really ARE try/catching these functions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly no clue, I just took the logic in get_prop_link which already exist here:
https://github.com/qualcomm/qbox/blob/main/qemu-components/common/src/libqemu-cxx/object.cc#L114

And put the same logic for the other getter

Copy link
Copy Markdown
Contributor

@markfoodyburton markfoodyburton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where are the 'getters' used?

@tmarcero
Copy link
Copy Markdown
Contributor Author

tmarcero commented May 20, 2026

where are the 'getters' used?

This is not used for the moment, it's in case of someone later want to use it, or for debug purpose :-)

@tmarcero tmarcero closed this May 20, 2026
@tmarcero tmarcero reopened this May 20, 2026
void write_gpio::set_gpio_method()
{
// Let's set GPIOs/FUSES bind with multi_init_socket to 1
gpio_sig_socket.async_write_vector({ 1 });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we expose 1 here to be a CCI parameter ? may be in future this needs to be written as 0 not 1 !

class write_gpio : public sc_core::sc_module
{
SCP_LOGGER();
cci::cci_broker_handle m_broker; // Should be a private broker for efficiency, but requires fixes to cci utils to
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dot think we need to keep this comment here!

cci::cci_broker_handle m_broker; // Should be a private broker for efficiency, but requires fixes to cci utils to
// prevent use of cci_get_broker()

sc_core::sc_event set_gpio_event;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from where is this event notified ?


void post_init();
void register_reset();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the commit is a bit misleading I guess ? add new wrapper functions for what ?!

cpu.set_prop_int("mp-affinity", p_mp_affinity);
}

cpu.set_prop_bool("has_el2", true);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "has_el2" should be a CCI parameter ?!

tmarcero and others added 4 commits May 21, 2026 18:05
- Add new callback to power ON ARM cpus

Signed-off-by: tmarcero <tmarcero@quicinc.com>
- This model allows connecting multiple Target Signal Sockets using a multi Initiator socket.
It will set all targets connected to the multi initiator socket to '1' by default.
This allows defining GPIOs/fuses, for example.

Signed-off-by: tmarcero <tmarcero@quicinc.com>
- This register is specific to Cortex-R52, it need to be configured in some
specific chips which expect to have Bus protection bit set.

Signed-off-by: tmarcero <tmarcero@quicinc.com>
- p_cnttid is now a vector because some SoC can have more than 8 frames, so
we will have more than one CNTTID register.

- Add ticker_ctrl CCI param to handle if we want always running Qtimers or not.
ON: Qtimers will always tick
OFF: Qtimers will never tick
AUTO: Qtimers will be controlled entirely by SW

Signed-off-by: Marceron Thomas <tmarcero@qti.qualcomm.com>
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

Successfully merging this pull request may close these issues.

3 participants