<feed xmlns='http://www.w3.org/2005/Atom'>
<title>opensbi.git/lib/utils, branch v1.4</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/opensbi.git/atom/lib/utils?h=v1.4</id>
<link rel='self' href='http://cgit.235523.xyz/opensbi.git/atom/lib/utils?h=v1.4'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/'/>
<updated>2023-12-27T06:27:33Z</updated>
<entry>
<title>lib: utils/timer: mtimer: only use regname for aclint</title>
<updated>2023-12-27T06:27:33Z</updated>
<author>
<name>Inochi Amaoto</name>
<email>inochiama@outlook.com</email>
</author>
<published>2023-12-27T00:46:11Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=ba29293dc947e13fa2e63de7ed289d7bb9b540f4'/>
<id>urn:sha1:ba29293dc947e13fa2e63de7ed289d7bb9b540f4</id>
<content type='text'>
The parser will fail if the timer is clint timer and has regname
property. As the regname is only meaningful for aclint, it is more
robust to only check regname for aclint timer.

Fixes: 6112d58 ("lib: utils/fdt: Allow to use reg-names when parsing ACLINT")
Signed-off-by: Inochi Amaoto &lt;inochiama@outlook.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: utils/irqchip: Add shared MMIO region for PLIC in root domain</title>
<updated>2023-12-19T10:26:37Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-12-11T08:37:56Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=cdebae2cc9539e2e0553b9c68eab22997c734cbb'/>
<id>urn:sha1:cdebae2cc9539e2e0553b9c68eab22997c734cbb</id>
<content type='text'>
On platforms with Smepmp, the MMIO regions accessed by M-mode need
to be explicitly marked with M-mode only read/write or shared (both
(M-mode and S-mode) read/write permission.

If the above is not done then runtime PLIC access from M-mode on
platforms with Smepmp will result in access fault when further
results in CPU hotplug not working.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Using one array to define the name of extensions</title>
<updated>2023-12-19T08:44:22Z</updated>
<author>
<name>Yong-Xuan Wang</name>
<email>yongxuan.wang@sifive.com</email>
</author>
<published>2023-12-12T08:58:34Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=776770d2adbf3ae7d9d3b97f0756c7589003835f'/>
<id>urn:sha1:776770d2adbf3ae7d9d3b97f0756c7589003835f</id>
<content type='text'>
Define an array sbi_hart_ext to map extension ID and name , and use it
for ISA parsing and printing out the supported extensions.

Signed-off-by: Yong-Xuan Wang &lt;yongxuan.wang@sifive.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: utils/fdt: Allow to use reg-names when parsing ACLINT</title>
<updated>2023-12-11T05:05:32Z</updated>
<author>
<name>Inochi Amaoto</name>
<email>inochiama@outlook.com</email>
</author>
<published>2023-11-17T12:13:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=6112d584d435d2d2f2685cfcd8321c389056636b'/>
<id>urn:sha1:6112d584d435d2d2f2685cfcd8321c389056636b</id>
<content type='text'>
Currently, the fdt_parse_aclint_node() follows a fixed order to parse
ACLINT timer. This may cause the undesirable result when the ACLINT
device does not support mtime without adding an empty entry for it in
the DT.

To be robust, make fdt_parse_aclint_node() support "reg-names" property,
so it can parse the DT in an order independent way. For compatibility,
fdt_parse_aclint_node() only use "reg-names" when parsing ACLINT timer,
and will fallback to the old way if "reg-names" property is not found.

Link: https://lore.kernel.org/all/20231114-skedaddle-precinct-66c8897227bb@squawk/
Signed-off-by: Inochi Amaoto &lt;inochiama@outlook.com&gt;
Reviewed-by: Anup patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: utils: fdt_pmu: Do not iterate over the fdt_pmu_evt_select table</title>
<updated>2023-12-06T12:47:08Z</updated>
<author>
<name>Yu Chien Peter Lin</name>
<email>peterlin@andestech.com</email>
</author>
<published>2023-11-30T12:42:11Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=e19d419f155fc956902e8333fc4420db4b9a07df'/>
<id>urn:sha1:e19d419f155fc956902e8333fc4420db4b9a07df</id>
<content type='text'>
The valid entry count is tracking by hw_event_count so there
is no need to check the whole table.

Signed-off-by: Yu Chien Peter Lin &lt;peterlin@andestech.com&gt;
Reviewed-by: Atish Patra &lt;atishp@rivosinc.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: utils: fdt_pmu: Make the fdt_pmu_evt_select table global variable</title>
<updated>2023-12-06T12:45:41Z</updated>
<author>
<name>Yu Chien Peter Lin</name>
<email>peterlin@andestech.com</email>
</author>
<published>2023-11-30T12:42:10Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=0308f93dc44a21f11d5b54d449170b4142d9e473'/>
<id>urn:sha1:0308f93dc44a21f11d5b54d449170b4142d9e473</id>
<content type='text'>
To allow platform override pmu_init() filling the translation table
fdt_pmu_evt_select[] when PMU node doesn't provide such information,
we need to share the table and its entry counter with other .c file.

We also define the structures of PMU property in fdt_helper.h, so we
can initialize the mappings in arrays.

Signed-off-by: Yu Chien Peter Lin &lt;peterlin@andestech.com&gt;
Reviewed-by: Atish Patra &lt;atishp@rivosinc.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: utils: fdt_fixup: Allow preserving PMU properties</title>
<updated>2023-12-06T12:29:44Z</updated>
<author>
<name>Yu Chien Peter Lin</name>
<email>peterlin@andestech.com</email>
</author>
<published>2023-11-30T12:42:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=0b3262efc6bcde391da84e49ec978804cc6eac37'/>
<id>urn:sha1:0b3262efc6bcde391da84e49ec978804cc6eac37</id>
<content type='text'>
Add a Kconfig option to control PMU fixup, so the next
stage software can dump the PMU node including event
mapping information for debugging purposes.

Signed-off-by: Yu Chien Peter Lin &lt;peterlin@andestech.com&gt;
Reviewed-by: Atish Patra &lt;atishp@rivosinc.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>sbi: sbi_pmu: Improve sbi_pmu_init() error handling</title>
<updated>2023-12-06T11:54:38Z</updated>
<author>
<name>Yu Chien Peter Lin</name>
<email>peterlin@andestech.com</email>
</author>
<published>2023-11-30T12:42:00Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=291403f6f29dd119d94ac99303c94dadcb5496c3'/>
<id>urn:sha1:291403f6f29dd119d94ac99303c94dadcb5496c3</id>
<content type='text'>
This patch makes the following changes:

- As sbi_platform_pmu_init() returns a negative error code on
  failure, let sbi_pmu_init() print out the error code with
  sbi_dprintf().

- In order to distinguish the SBI_EFAIL error returned by
  sbi_pmu_add_*_counter_map(), return SBI_ENOENT to indicate
  that fdt_pmu_setup() failed to locate "riscv,pmu" node, and
  generic_pmu_init() ignores such case.

Signed-off-by: Yu Chien Peter Lin &lt;peterlin@andestech.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Reviewed-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Reviewed-by: Atish Patra &lt;atishp@rivosinc.com&gt;
</content>
</entry>
<entry>
<title>lib: ipi: Adjust Andes PLICSW to single-bit-per-hart scheme</title>
<updated>2023-12-06T11:53:27Z</updated>
<author>
<name>Leo Yu-Chi Liang</name>
<email>ycliang@andestech.com</email>
</author>
<published>2023-11-30T12:41:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=bd74931d79e1b81494a22b1ce368c935abbc0d2c'/>
<id>urn:sha1:bd74931d79e1b81494a22b1ce368c935abbc0d2c</id>
<content type='text'>
The old scheme doesn't allow sending hart0 self-IPI as the
corresponding bit on pending register is hardwired to 0, this
could lead to unhandle IPIs on SMP systems, esp. on single-core.

Furthermore, the limitation of old scheme is 8-core, instead of
reserving source hart information, we assign bit (x + 1) as the
enable and pending bit of hartx, this also expands the bootable
hart number.

The following diagram shows the enable bits of the new scheme
on 32-core Andes platform.

   Pending regs: 0x1000  x---0---0---0---0------0---0
Pending hart ID:             0   1   2   3 ... 30  31
   Interrupt ID:         0   1   2   3   4 ... 31  32
                         |   |   |   |   |      |   |
    Enable regs: 0x2000  x---1---0---0---0-...--0---0---&gt; hart0
                         |   |   |   |   |      |   |
                 0x2080  x---0---1---0---0-...--0---0---&gt; hart1
                         |   |   |   |   |      |   |
                 0x2100  x---0---0---1---0-...--0---0---&gt; hart2
                         |   |   |   |   |      |   |
                 0x2180  x---0---0---0---1-...--0---0---&gt; hart3
                         .   .   .   .   .      .   .
                         .   .   .   .   .      .   .
                         .   .   .   .   .      .   .
                 0x2f00  x---0---0---0---0-...--1---0---&gt; hart30
                         |   |   |   |   |      |   |
                 0x2f80  x---0---0---0---0-...--0---1---&gt; hart31
                         &lt;-------- word 0 -------&gt;&lt;--- word 1 ---&gt;

To send IPI to hart0, for example, another hart (including hart0
itself) will set bit 1 of first word on the pending register.

We also fix indentation in andes_plicsw.h along with this patch.

Fixes: ce7c490719ed ("lib: utils/ipi: Add Andes fdt ipi driver support")
Signed-off-by: Leo Yu-Chi Liang &lt;ycliang@andestech.com&gt;
Reviewed-by: Yu Chien Peter Lin &lt;peterlin@andestech.com&gt;
Reviewed-by: Randolph &lt;randolph@andestech.com&gt;
Reported-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Link: https://lists.infradead.org/pipermail/opensbi/2023-October/005665.html
Reviewed-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Tested-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: sbi: Allow relaxed MMIO writes in device ipi_clear() callback</title>
<updated>2023-11-26T13:15:08Z</updated>
<author>
<name>Anup Patel</name>
<email>apatel@ventanamicro.com</email>
</author>
<published>2023-11-21T10:22:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=b70d6285f0f7cbb84619ba1758bb0c6d7620eaef'/>
<id>urn:sha1:b70d6285f0f7cbb84619ba1758bb0c6d7620eaef</id>
<content type='text'>
Currently, there are no barriers before or after the ipi_clear()
device callback which forces ipi_clear() device callback to always
use non-relaxed MMIO writes.

Instead of above, we use wmb() in after the ipi_clear() device
callback which pairs with the wmb() done before the ipi_send()
device callback. This also allows device ipi_clear() callback
to use relaxed MMIO writes.

Signed-off-by: Anup Patel &lt;apatel@ventanamicro.com&gt;
Reported-by: Bo Gan &lt;ganboing@gmail.com&gt;
</content>
</entry>
</feed>
