<feed xmlns='http://www.w3.org/2005/Atom'>
<title>opensbi.git/lib/utils, branch v1.2</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.2</id>
<link rel='self' href='http://cgit.235523.xyz/opensbi.git/atom/lib/utils?h=v1.2'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/'/>
<updated>2022-12-17T05:31:06Z</updated>
<entry>
<title>lib: utils/timer: mtimer: add T-Head C9xx CLINT compatible</title>
<updated>2022-12-17T05:31:06Z</updated>
<author>
<name>Icenowy Zheng</name>
<email>uwu@icenowy.me</email>
</author>
<published>2022-12-12T08:22:38Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=b848d8763a737de44b64bfc036c8f51200226440'/>
<id>urn:sha1:b848d8763a737de44b64bfc036c8f51200226440</id>
<content type='text'>
As we already added the quirk for lacking mtime register to MTIMER
driver, add T-Head C9xx CLINT compatible to it and wire the quirk.

Signed-off-by: Icenowy Zheng &lt;uwu@icenowy.me&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: utils/timer: mtimer: add a quirk for lacking mtime register</title>
<updated>2022-12-17T05:31:03Z</updated>
<author>
<name>Icenowy Zheng</name>
<email>uwu@icenowy.me</email>
</author>
<published>2022-12-12T08:22:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=ca7810aecdbae0630c506f05dbed641f3875ec5b'/>
<id>urn:sha1:ca7810aecdbae0630c506f05dbed641f3875ec5b</id>
<content type='text'>
T-Head developers surely have a different understanding of time CSR and
CLINT's mtime register with SiFive ones, that they did not implement
the mtime register at all -- as shown in openC906 source code, their
time CSR value is just exposed at the top of their processor IP block
and expects an external continous counter, which makes it not
overrideable, and thus mtime register is not implemented, even not for
reading. However, if CLINTEE is not enabled in T-Head's MXSTATUS
extended CSR, these systems still rely on the mtimecmp registers to
generate timer interrupts. This makes it necessary to implement T-Head
C9xx CLINT support in OpenSBI MTIMER driver, which skips implementing
reading mtime register and falls back to default code that reads time
CSR.

Add a quirk into MTIMER driver, which represents a mtime register is
lacking and time CSR value should be used instead.

Signed-off-by: Icenowy Zheng &lt;uwu@icenowy.me&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: utils/ipi: mswi: add T-Head C9xx CLINT compatible</title>
<updated>2022-12-17T05:31:00Z</updated>
<author>
<name>Icenowy Zheng</name>
<email>uwu@icenowy.me</email>
</author>
<published>2022-12-12T08:22:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=a8ee82cd8c008f09c91b5c307de4c9b37660ff71'/>
<id>urn:sha1:a8ee82cd8c008f09c91b5c307de4c9b37660ff71</id>
<content type='text'>
Althoug the MTIMER part of a C9xx CLINT differs from a SiFive one, the
MSWI part is compliant.

Add T-Head C9xx CLINT compatible string to fdt_ipi_mswi code, sharing
the same codepath with SiFive CLINT.

Signed-off-by: Icenowy Zheng &lt;uwu@icenowy.me&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: utils/irqchip: plic: Ensure no out-of-bound access in context save/restore helpers</title>
<updated>2022-12-17T03:33:30Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng@tinylab.org</email>
</author>
<published>2022-12-11T06:54:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=9a2eeb4aaeac9102a7db3676035d83394784c88b'/>
<id>urn:sha1:9a2eeb4aaeac9102a7db3676035d83394784c88b</id>
<content type='text'>
Currently the context save/restore helpers writes/reads the provided
array using an index whose maximum value is determined by PLIC, which
potentially may disagree with the caller to these helpers.

Add a parameter to ask the caller to provide the size limit of the
array to ensure no out-of-bound access happens.

Signed-off-by: Bin Meng &lt;bmeng@tinylab.org&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: utils/irqchip: plic: Fix the off-by-one error in context save/restore helpers</title>
<updated>2022-12-17T03:32:40Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng@tinylab.org</email>
</author>
<published>2022-12-11T06:54:23Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=fabbc006687a0fddeabb7a3effabb3a8e1c81c48'/>
<id>urn:sha1:fabbc006687a0fddeabb7a3effabb3a8e1c81c48</id>
<content type='text'>
plic-&gt;num_src holds the number of interrupt sources without interrupt
source 0 but the interrupt enable register includes a bit for the
interrupt source 0 in the first word.

Fixes: 415ecf28f7ad ("lib: irqchip/plic: Add context save/restore helpers")
Signed-off-by: Bin Meng &lt;bmeng@tinylab.org&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Reviewed-by: Samuel Holland &lt;samuel@sholland.org&gt;
</content>
</entry>
<entry>
<title>lib: utils/irqchip: plic: Fix the off-by-one error in plic_context_init()</title>
<updated>2022-12-17T03:30:35Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng@tinylab.org</email>
</author>
<published>2022-12-11T06:54:22Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=91c8a7d5cef1e9729c1c2bad549ebc69afeadb3b'/>
<id>urn:sha1:91c8a7d5cef1e9729c1c2bad549ebc69afeadb3b</id>
<content type='text'>
The number of interrupt enable register in words was once correct,
but was wrongly changed to have an off-by-one error since
commit 8c362e7d065e ("lib: irqchip/plic: Factor out a context init function").

Fixes: 8c362e7d065e ("lib: irqchip/plic: Factor out a context init function")
Signed-off-by: Bin Meng &lt;bmeng@tinylab.org&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Reviewed-by: Samuel Holland &lt;samuel@sholland.org&gt;
</content>
</entry>
<entry>
<title>lib: utils/irqchip: plic: Ensure no out-of-bound access in priority save/restore helpers</title>
<updated>2022-12-17T03:30:29Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng@tinylab.org</email>
</author>
<published>2022-12-11T06:54:21Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=8509e46ca63a4ed7dff2244cd7f288bf5591ab61'/>
<id>urn:sha1:8509e46ca63a4ed7dff2244cd7f288bf5591ab61</id>
<content type='text'>
Currently the priority save/restore helpers writes/reads the provided
array using an index whose maximum value is determined by PLIC, which
potentially may disagree with the caller to these helpers.

Add a parameter to ask the caller to provide the size limit of the
array to ensure no out-of-bound access happens.

Signed-off-by: Bin Meng &lt;bmeng@tinylab.org&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: utils/irqchip: plic: Fix the off-by-one error in priority save/restore helpers</title>
<updated>2022-12-17T03:12:21Z</updated>
<author>
<name>Bin Meng</name>
<email>bmeng@tinylab.org</email>
</author>
<published>2022-12-11T06:54:20Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=34da6638ad7b3d8c1834dffe5cd2629aa748efaf'/>
<id>urn:sha1:34da6638ad7b3d8c1834dffe5cd2629aa748efaf</id>
<content type='text'>
Interrupt source 0 is reserved. Hence the irq should start from 1.

Fixes: 2b79b694a805 ("lib: irqchip/plic: Add priority save/restore helpers")
Signed-off-by: Bin Meng &lt;bmeng@tinylab.org&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
<entry>
<title>lib: utils/irqchip: Add compatible string for Andestech NCEPLIC100</title>
<updated>2022-12-12T13:20:46Z</updated>
<author>
<name>Lad Prabhakar</name>
<email>prabhakar.mahadev-lad.rj@bp.renesas.com</email>
</author>
<published>2022-12-10T10:30:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=684090272af9ce84ff0768d8294bf7d42f14edeb'/>
<id>urn:sha1:684090272af9ce84ff0768d8294bf7d42f14edeb</id>
<content type='text'>
Add compatible string for Andestech NCEPLIC100 found on Renesas RZ/Five SoC
which is equipped with AX45MP AndesCore.

While at it drop the comma after the sentinel as it does not make sense to
have a comma after a sentinel, as any new elements must be added before the
sentinel.

dts example (Single-core AX45MP):

    soc: soc {
          ....
          plic: interrupt-controller@12c00000 {
              compatible = "renesas,r9a07g043-plic", "andestech,nceplic100";
              #interrupt-cells = &lt;2&gt;;
              #address-cells = &lt;0&gt;;
              riscv,ndev = &lt;511&gt;;
              interrupt-controller;
              reg = &lt;0x0 0x12c00000 0 0x400000&gt;;
              clocks = &lt;&amp;cpg CPG_MOD R9A07G043_NCEPLIC_ACLK&gt;;
              power-domains = &lt;&amp;cpg&gt;;
              resets = &lt;&amp;cpg R9A07G043_NCEPLIC_ARESETN&gt;;
              interrupts-extended = &lt;&amp;cpu0_intc 11 &amp;cpu0_intc 9&gt;;
          };
          ....
    };

Signed-off-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
Reviewed-by: Bin Meng &lt;bmeng@tinylab.org&gt;
</content>
</entry>
<entry>
<title>lib: utils: serial: Add FDT driver for Renesas SCIF</title>
<updated>2022-12-12T13:20:35Z</updated>
<author>
<name>Lad Prabhakar</name>
<email>prabhakar.mahadev-lad.rj@bp.renesas.com</email>
</author>
<published>2022-12-10T10:30:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/opensbi.git/commit/?id=0021b437377b4ea95f567f91fbf506c0b0b9e227'/>
<id>urn:sha1:0021b437377b4ea95f567f91fbf506c0b0b9e227</id>
<content type='text'>
Add FDT driver for Renesas SCIF.

    dts example:

    soc: soc {
          ....
            scif0: serial@1004b800 {
                    compatible = "renesas,scif-r9a07g043",
                                 "renesas,scif-r9a07g044";
                    reg = &lt;0 0x1004b800 0 0x400&gt;;
                    interrupts = &lt;412 IRQ_TYPE_LEVEL_HIGH&gt;,
                                 &lt;414 IRQ_TYPE_LEVEL_HIGH&gt;,
                                 &lt;415 IRQ_TYPE_LEVEL_HIGH&gt;,
                                 &lt;413 IRQ_TYPE_LEVEL_HIGH&gt;,
                                 &lt;416 IRQ_TYPE_LEVEL_HIGH&gt;,
                                 &lt;416 IRQ_TYPE_LEVEL_HIGH&gt;;
                    interrupt-names = "eri", "rxi", "txi",
                                      "bri", "dri", "tei";
                    clocks = &lt;&amp;cpg CPG_MOD R9A07G043_SCIF0_CLK_PCK&gt;;
                    clock-names = "fck";
                    power-domains = &lt;&amp;cpg&gt;;
                    resets = &lt;&amp;cpg R9A07G043_SCIF0_RST_SYSTEM_N&gt;;
                    status = "disabled";
            };
          ....
    };

Signed-off-by: Lad Prabhakar &lt;prabhakar.mahadev-lad.rj@bp.renesas.com&gt;
Reviewed-by: Anup Patel &lt;anup@brainfault.org&gt;
</content>
</entry>
</feed>
