- Mar 01, 2023
-
-
minda.chen authored
Add gpio driver and gpio reset function in Starfive JH7110 SOC platform. Signed-off-by:
minda.chen <minda.chen@starfivetech.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
- Feb 27, 2023
-
-
Andrew Jones authored
When the system-suspend-test property is present in the domain config node as shown below, implement system suspend with a simple 5 second delay followed by a WFI. This allows testing system suspend when the low-level firmware doesn't support it. / { chosen { opensbi-domains { compatible = "opensbi,domain,config"; system-suspend-test; }; Signed-off-by:Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Andrew Jones authored
Replace the commas with dashes to correct the name. Signed-off-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Andrew Jones authored
Fill the implementation of the system suspend ecall. A platform implementation of the suspend callbacks is still required for this to do anything. Signed-off-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Andrew Jones authored
Only privileged domains should be allowed to suspend the entire system. Give the root domain this property by default and allow other domains to be given the property by specifying it in the DT. Signed-off-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Andrew Jones authored
Add the SUSP extension probe and ecall support, but for now the system suspend function is just a stub. Signed-off-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Andrew Jones authored
A coming patch can make use of a few internal hsm functions if we export them. Signed-off-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Andrew Jones authored
Also remove a superfluous semicolon and add a blank line. Signed-off-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Andrew Jones authored
While non-retentive suspend is not allowed for M-mode, the comment at the top of sbi_hsm_hart_suspend() implied suspend wasn't allowed for M-mode at all. Move the comment above the mode check which is inside a suspend type is non-retentive check. Signed-off-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Andrew Jones authored
HSM functions define when SBI_ERR_INVALID_PARAM should be returned. Ensure it's not used for reasons that don't meet the definitions by using the catch-all code, SBI_ERR_FAILED, for those reasons instead. Also, in one case sbi_hart_suspend() may have returned SBI_ERR_DENIED, which isn't defined for that function at all. Use SBI_ERR_FAILED for that case too. Signed-off-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Andrew Jones authored
When a state change fails there's no need to restore the original state as it remains the same. Signed-off-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Andrew Jones authored
Remove some redundant code by creating an invalid state detection macro. No functional change intended. Signed-off-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Bin Meng authored
commit 3e2f573e ("lib: utils: Disallow non-root domains from adding M-mode regions") added access permission check in __fdt_parse_region(). With the existing DT example in the doc OpenSBI won't boot anymore. Let's update the DT example so that it can work out of the box. Signed-off-by:
Bin Meng <bmeng@tinylab.org> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Bin Meng authored
The region access permission check in __fdt_parse_region() can be simplified as masking SBI_DOMAIN_MEMREGION_{M,SU}_ACCESS_MASK is enough. While we are here, update the confusing comments to match the codes. Signed-off-by:Bin Meng <bmeng@tinylab.org> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Bin Meng authored
Minor updates to the comments for language and style fixes. Signed-off-by:
Bin Meng <bmeng@tinylab.org> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Yu Chien Peter Lin authored
We should also check if the return error code is greater than 0 (SBI_SUCCESS), as this is an invalid error. Signed-off-by:
Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Lad Prabhakar authored
On the Renesas RZ/Five SoC by default we want to configure 128MiB of memory ranging from 0x58000000 as a non-cacheable + bufferable region in the PMA and populate this region as PMA reserve DT node with shared DMA pool and no-map flags set so that Linux drivers requesting any DMA'able memory go through this region. PMA node passed to the above stack: reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges; pma_resv0@58000000 { compatible = "shared-dma-pool"; reg = <0x0 0x58000000 0x0 0x08000000>; no-map; linux,dma-default; }; }; Signed-off-by:Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by:
Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Lad Prabhakar authored
I/O Coherence Port (IOCP) provides an AXI interface for connecting external non-caching masters, such as DMA controllers. The accesses from IOCP are coherent with D-Caches and L2 Cache. IOCP is a specification option and is disabled on the Renesas RZ/Five SoC due to this reason IP blocks using DMA will fail. The Andes AX45MP core has a Programmable Physical Memory Attributes (PMA) block that allows dynamic adjustment of memory attributes in the runtime. It contains a configurable amount of PMA entries implemented as CSR registers to control the attributes of memory locations in interest. Below are the memory attributes supported: * Device, Non-bufferable * Device, bufferable * Memory, Non-cacheable, Non-bufferable * Memory, Non-cacheable, Bufferable * Memory, Write-back, No-allocate * Memory, Write-back, Read-allocate * Memory, Write-back, Write-allocate * Memory, Write-back, Read and Write-allocate More info about PMA (section 10.3): Link: http://www.andestech.com/wp-content/uploads/AX45MP-1C-Rev.-5.0.0-Datasheet.pdf As a workaround for SoCs with IOCP disabled CMO needs to be handled by software. Firstly OpenSBI configures the memory region as "Memory, Non-cacheable, Bufferable" and passes this region as a global shared dma pool as a DT node. With DMA_GLOBAL_POOL enabled all DMA allocations happen from this region and synchronization callbacks are implemented to synchronize when doing DMA transactions. Example PMA region passed as a DT node from OpenSBI: reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges; pma_resv0@58000000 { compatible = "shared-dma-pool"; reg = <0x0 0x58000000 0x0 0x08000000>; no-map; linux,dma-default; }; }; Signed-off-by:
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by:
Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Anup Patel authored
The extid parameter of vendor_ext_provider() is redundant so let us remove it. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Anup Patel authored
As-per the SBI specification, the lower 24bits of the SBI vendor extension id is same as lower 24bits of the mvendorid CSR. We update the SBI vendor extension id checking based on above. Signed-off-by:Anup Patel <apatel@ventanamicro.com>
-
Nylon Chen authored
According to the description in "riscv-state-enable[0]", to access h/scontext in S-Mode, we need to enable the 57th bit. If it is not enabled, an "illegal instruction" error will occur. Link: https://github.com/riscv/riscv-state-enable/blob/a28bfae443f350d5b4c42874f428367d5b322ffe/content.adoc [0] Signed-off-by:
Nylon Chen <nylon.chen@sifive.com> Reviewed-by:
Zong Li <zong.li@sifive.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Shengyu Qu authored
In docs/firmware/fw.md, there's a configuration parameter called FW_TEXT_ADDR, which actually should be FW_TEXT_START, so fix it. Signed-off-by:
Shengyu Qu <wiagn233@outlook.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Xiang W authored
When building with GCC-10 or older versions, it throws the following error: CC-DEP platform/generic/lib/utils/fdt/fdt_fixup.dep CC platform/generic/lib/utils/fdt/fdt_fixup.o lib/utils/fdt/fdt_fixup.c: In function 'fdt_reserved_memory_fixup': lib/utils/fdt/fdt_fixup.c:376:2: error: label at end of compound statement 376 | next_entry: | ^~~~~~~~~~ Remove the goto statement. Resolves: https://github.com/riscv-software-src/opensbi/issues/288 Signed-off-by:Yu Chien Peter Lin <peterlin@andestech.com> Signed-off-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org> Reviewed-by:
Bin Meng <bmeng@tinylab.org>
-
Bin Meng authored
In sbi_domain_finalize(), when locating the coldboot hart's domain, the coldboot hart's scratch->arg1 will be overwritten by the domain configuration. However scratch->arg1 holds the FDT address of the coldboot hart, and is still being accessed by fdt_get_address() in later boot process. scratch->arg1 could then contain completely garbage and lead to a crash. To fix this, we change fdt_get_address() to return root domain's next_arg1 as the FDT pointer. Resolves: https://github.com/riscv-software-src/opensbi/issues/281 Fixes: b1678af2 ("lib: sbi: Add initial domain support") Reported-by:
Marouene Boubakri <marouene.boubakri@nxp.com> Signed-off-by:
Bin Meng <bmeng@tinylab.org> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Bin Meng authored
The code calls various macros from riscv_asm.h which is not directly included. Fix such dependency. Signed-off-by:
Bin Meng <bmeng@tinylab.org> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Bin Meng authored
The code calls various macros from riscv_asm.h and sbi_scratch.h which are not directly included. Fix such dependency. Signed-off-by:
Bin Meng <bmeng@tinylab.org> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Bin Meng authored
The code calls sbi_scratch_thishart_ptr() from sbi_scratch.h which is not directly included. Fix such dependency. Signed-off-by:
Bin Meng <bmeng@tinylab.org> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
- Feb 10, 2023
-
-
Anup Patel authored
The sbi_printf() is slow for semihosting because it prints one character at a time. To speed-up sbi_printf() for semihosting, we use a temporary buffer and nputs(). Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com>
-
Anup Patel authored
We implement console_puts() for semihosting serial driver to speed-up semihosting based prints. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Bin Meng <bmeng@tinylab.org> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com>
-
Anup Patel authored
We add console_puts() callback in the console device which allows console drivers (such as semihosting) to implement a specialized way to output character string. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Bin Meng <bmeng@tinylab.org> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com>
-
Anup Patel authored
We implement SBI debug console extension as one of the replacement SBI extensions. This extension is only available when OpenSBI platform provides a console device to generic library. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Bin Meng <bmeng@tinylab.org>
-
Anup Patel authored
We add sbi_domain_check_addr_range() helper function to check whether a given address range is accessible under a particular domain. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Bin Meng <bmeng@tinylab.org> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com>
-
Anup Patel authored
We add new sbi_ngets() which help us read characters into a physical memory location. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com>
-
Anup Patel authored
We add new sbi_nputs() which help us print a fixed number of characters from a physical memory location. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com> Reviewed-by:
Bin Meng <bmeng@tinylab.org> Reviewed-by:
Xiang W <wxjstz@126.com>
-
Anup Patel authored
We add SBI debug console extension related defines to the SBI ecall interface header. Signed-off-by:
Anup Patel <apatel@ventanamicro.com> Reviewed-by:
Andrew Jones <ajones@ventanamicro.com> Reviewed-by:
Atish Patra <atishp@rivosinc.com> Reviewed-by:
Bin Meng <bmeng@tinylab.org> Reviewed-by:
Xiang W <wxjstz@126.com>
-
- Feb 09, 2023
-
-
Anup Patel authored
The BSWAPx() macros won't do any swapping for big-endian host because the EXTRACT_BYTE() macro will pickup bytes in reverse order. Also, the EXTRACT_BYTE() will generate compile error for constants. To fix this, we get remove the EXTRACT_BYTE() macro and re-write BSWAPx() using simple mask and shift operations. Fixes: 09b34d8c ("include: Add support for byteorder/endianness conversion") Reported-by:
Samuel Holland <samuel@sholland.org> Signed-off-by:
Anup Patel <apatel@ventanamicro.com>
-
- Feb 08, 2023
-
-
Rahul Pathak authored
If any variable/memory-location follows certain endianness then its important to annotate it properly so that proper conversion can be done before read/write from that variable/memory. Also, use these new typedefs in libfdt_env.h for deriving its own custom fdtX_t types Signed-off-by:
Rahul Pathak <rpathak@ventanamicro.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Rahul Pathak authored
FDT follows big-endian and CPU can be little or big endian as per the implementation. libfdt_env.h defines function for conversion between fdt and cpu byteorder according to the endianness. Currently, libfdt_env.h defines custom byte swapping macros and then undefines them. Instead, use the generic endianness conversion functions Signed-off-by:
Rahul Pathak <rpathak@ventanamicro.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Rahul Pathak authored
Define macros general byteorder conversion Define functions for endianness conversion from general byteorder conversion macros Signed-off-by:
Rahul Pathak <rpathak@ventanamicro.com> Reviewed-by:
Xiang W <wxjstz@126.com> Reviewed-by:
Sergey Matyukevich <sergey.matyukevich@syntacore.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-
Jessica Clarke authored
Since we don't currently create these, changes to fw_base.ldS do not cause the preprocessed fw_*.elf.ld files to be rebuilt, and thus incremental builds can end up failing with missing symbols if crossing the recent commits that introduced _fw_rw_offset and then replaced it with _fw_rw_start. Reported-by:
Ben Dooks <ben.dooks@sifive.com> Signed-off-by:
Jessica Clarke <jrtc27@jrtc27.com> Reviewed-by:
Anup Patel <anup@brainfault.org>
-