Commit Graph

158 Commits

Author SHA1 Message Date
Sebastian Huber
bcef89f236 Update company name
The embedded brains GmbH & Co. KG is the legal successor of embedded
brains GmbH.
2023-05-20 11:05:26 +02:00
Alan Cudmore
26853a0624 bsps/riscv: add riscv/kendrytek210 BSP variant source changes
This patch adds support for the Kendryte K210 RISC-V BSP variant.
The SoC uses the existing Interrupt Controller, Timer, and console UART.
It only needs SoC specific initialization and an embedded device tree binary
similar to the polarfire SoC BSP.

Updates #4876
2023-03-28 14:04:04 -05:00
Alan Cudmore
ca1c4e70f5 bsps/riscv: add device tree source and device tree blob header for k210 bsp variant
This patch adds the k210 device tree source and the corresponding
device tree blob encoded in the header which is used for the
embedded device tree blob for the Kendryte K210 BSP variant.

Updates #4876
2023-03-28 14:04:04 -05:00
Sebastian Huber
11cc51ef27 bsps/riscv: Use per-CPU mtimecmp in clock driver
Use the mtimecmp from the PLIC/CLINT initialization in the clock driver.  This
register is defined by the device tree and does not assume a fixed mapping.
2023-03-17 07:25:34 +01:00
Sebastian Huber
cbddf5decd bsps/riscv: Fix riscv_get_hart_index_by_phandle()
Take a non-zero RISCV_BOOT_HARTID into account.
2023-03-17 07:25:34 +01:00
Sebastian Huber
e5233057be bsps/riscv: Make SMP start more robust
In SMP configurations, check that we run on a configured processor.  If not,
then there is not much that can be done since we do not have a stack available
for this processor.  Just loop forever in this case.  Do this in assemlby to
ensure that no stack memory is used.
2023-03-17 07:25:23 +01:00
Sebastian Huber
bb465c8548 doxygen: Add Doxygen files to a group
Update #3707.
2023-02-16 08:27:09 +01:00
Sebastian Huber
6136e28bf9 clockdrv: Add clock driver implementation group
Use standard wording in Clock Driver related files.

Update #3706.
2023-01-24 09:56:53 +01:00
Sebastian Huber
10ee41a8a3 tm27: Avoid function pointer casts
Add TM27_USE_VECTOR_HANDLER to select the interrupt handler type used by
the <tm27.h> implementation.

Close #4820.
2023-01-24 09:56:53 +01:00
Sebastian Huber
d46366a2e7 riscv: Resurrect RISCV_ENABLE_HTIF_SUPPORT
Low-end configurations may want to have the HTIF support removed.
Enable the option by default.  Fix formatting.  Fix node validity
checks.

Updates #4779.
2023-01-12 08:15:58 +01:00
Hesham Almatary
88b80a5fd0 RISC-V: Always probe for HTIF and remove RISCV_ENABLE_HTIF_SUPPORT
Updates #4779
2022-12-23 09:21:14 +00:00
Sebastian Huber
71d1acd41d bsps/irq: Rename handler in dispatch table
The name handler table was a bit misleading after the last rework.
Rename it to distach table.  Update the documentation accordingly.

Update #4769.
2022-12-02 10:25:39 +01:00
Sebastian Huber
d9c7db505c bsps/riscv: Simplify PLIC support
In uniprocessor configurations there is no need to take interrupt affinities
into account for the interrupt vector enable/disable.
2022-11-23 07:56:12 +01:00
Sebastian Huber
d448aa4d05 bsps/riscv: Fix PLIC enable register count 2022-11-23 07:56:12 +01:00
Sebastian Huber
733d9b750c bsps/riscv: Add riscv_plic_cpu_0_init()
Move boot processor initialization of PLIC to separate function.
2022-11-23 07:56:12 +01:00
Sebastian Huber
5756a6af10 bsps/riscv: Fix bsp_fdt_map_intr()
The interrupt numbers in the device tree are usually PLIC interrupts.  Map the
number to the vector number associated with an external interrupt.
2022-11-23 07:56:12 +01:00
Daniel Cederman
18a181c267 bsps/riscv: Change license to BSD-2 for files with Gaisler copyright
This patch changes the license to BSD-2 for all source files where the
copyright is held by Aeroflex Gaisler, Cobham Gaisler, or Gaisler Research.
Some files also includes copyright right statements from OAR and/or
embedded Brains in addition to Gaisler.

Updates #3053.
2022-11-14 11:00:14 +01:00
Sebastian Huber
77c8d822c3 bsps/riscv: Fix software interrupt dispatching
In SMP configurations, there may be no software interrupt handler
installed when the software interrupt is processed.  Add the new
interrupt handler dispatch variant
bsp_interrupt_handler_dispatch_unlikely() for this special case.
2022-11-11 16:38:25 +01:00
Sebastian Huber
908ffc7a93 bsps/noel: Fix interrupt support 2022-11-11 16:38:25 +01:00
Sebastian Huber
bfdfc979fd bsps/riscv: Fix PLIC enable register count
Each PLIC enable register has 32 bits, so we have to divide by 32.
2022-11-10 15:17:07 +01:00
Sebastian Huber
e4210d5a08 bsps/riscv: Skip init on not configured processors 2022-11-10 08:55:38 +01:00
Sebastian Huber
3e5ccdd34e bsps/riscv: Simplify riscv_plic_init() 2022-11-10 08:55:38 +01:00
Sebastian Huber
d2bac3d730 bsps/riscv: Simplify riscv_clint_init() 2022-11-10 08:55:38 +01:00
Sebastian Huber
ccf09a6e16 bsps/riscv: Add tm27 support 2022-11-10 08:55:38 +01:00
Sebastian Huber
ba53a177ab bsps/riscv: Always dispatch software interrupts
This helps to run the interrupt API validation tests.
2022-11-10 08:55:38 +01:00
Sebastian Huber
47d156d706 bsps/riscv: bsp_interrupt_get/set_affinity()
Provide bsp_interrupt_get_affinity() and bsp_interrupt_set_affinity() only if
RTEMS_SMP is enabled.  Replace fatal error with a status code.
2022-11-10 08:55:38 +01:00
Sebastian Huber
1bf1c779e1 bsps/riscv: bsp_interrupt_raise_on()
Implement bsp_interrupt_raise_on() and bsp_interrupt_raise().
2022-11-10 08:55:38 +01:00
Sebastian Huber
8a51ecc7b9 bsps/riscv: bsp_interrupt_is_pending()
Implement this function.
2022-11-10 08:55:38 +01:00
Sebastian Huber
d156d7b2f8 bsps/riscv: bsp_interrupt_get_attributes()
Implement this function.
2022-11-10 08:55:38 +01:00
Sebastian Huber
a52fc42454 bsps/riscv: Improve bsp_interrupt_vector_disable()
Add support for hart-specific software and timer interrupts.
2022-11-10 08:55:38 +01:00
Sebastian Huber
e19d490fbe bsps/riscv: Improve bsp_interrupt_vector_enable()
Add support for hart-specific software and timer interrupts.
2022-11-10 08:55:38 +01:00
Sebastian Huber
16c352de2f bsps/riscv: bsp_interrupt_vector_is_enabled()
Implement this function.
2022-11-10 08:55:38 +01:00
Sebastian Huber
9c80a88694 bsps/riscv: bsp_interrupt_is_valid_vector()
Implement this function.
2022-11-10 08:55:38 +01:00
Sebastian Huber
b4ffaa7cdc bsps/riscv: Use start data for object
Maybe this helps to ensure that the object is properly aligned.

Update #4658.
2022-11-04 14:01:44 +01:00
Sebastian Huber
89ba2a9838 bsps/riscv: Workaround for sporadic linker issues
Disable the linker relaxation in start.S to work around an issue described
here:

https://mail.gnu.org/archive/html/bug-binutils/2021-03/msg00164.html

The real issue is probably in the linker command file or the linker itself.

Update #4658.
2022-10-28 14:05:02 +02:00
Alan Cudmore
1d2fab8a79 bsps: Improve riscv console FDT parsing
This fixes a problem with parsing the FDT compatible property by
replacing the RISCV_CONSOLE_IS_COMPATIBLE macro with calls to
the fdt_stringlist_contains function. The macro only works when
the compatible FDT entry is a single string and not a list of
strings. The new call will compare each item in the string list.

Close #4728.
2022-10-14 08:15:14 -05:00
Sebastian Huber
e9a69c5744 riscv: Move functions to avoid build issues
The _RISCV_Map_cpu_index_to_hardid() and _RISCV_Map_hardid_to_cpu_index()
functions must be available to all riscv BSPs.
2022-10-14 10:52:52 +02:00
Padmarao Begari
6b0d3c9873 bsps/riscv: Add Microchip PolarFire SoC BSP variant
The Microchip PolarFire SoC support is implemented as a
riscv BSP variant to boot with any individual hart(cpu core)
or SMP based on the boot HARTID configurable and support
components are 4 CPU Cores (U54), Interrupt controller (PLIC),
Timer (CLINT), UART.
2022-09-20 12:00:51 -05:00
Padmarao Begari
9cdc00881e bsps/riscv: Add device tree blob
Add the basic Microchip PolarFire SoC device tree source and blob

The mpfs-dtb.h is generated by the bin2hex

https://github.com/padmaraob/bin2hex

1.Compile and build the bin2hex.c
	$ gcc -o bin2hex bin2hex.c

2.Generate the mpfs.dtb from the mpfs.dts
	$ dtc -O dtb -o mpfs.dtb mpfs.dts

3.Generate the mpfs-dtb.h Header file from the mpfs.dtb.
	$ ./bin2hex mpfs.dtb
2022-09-20 12:00:51 -05:00
Alan Cudmore
88f4d44f00 bsps/riscv/riscv: Fix fe310_uart_read
Note: Resending after learning how to use git send-email, please disregard previous message.

This fixes the riscv fe310 console driver fe310_uart_read function. The function
reads the RX status/data register to check if data is available, but discards
the data and reads it a seconds time.
Also cleared the interrupt enable bit in the first_open function.

Close #4719
2022-09-19 17:10:01 +02:00
Martin Aberg
9ec9be834d bsp/riscv: Add NOEL-V BSP
Added support for Cobham Gaisler NOEL-V systems. The NOEL-V support
is implemented as a riscv BSP. Both 32-bit and 64-bit processor
systems are supported. Cobham Gaisler's NOEL-V RISC-V processor IP
is described here:
  https://www.gaisler.com/NOELV

Compatible with the following NOEL-V FPGA example design ranges
available from Cobham Gaisler. Follow the links for free
bit-streams, DTS/DTB, user's manuals and quick-start guides:
- NOEL-ARTYA7-EX    (https://www.gaisler.com/NOEL-ARTYA7)
- NOEL-PF-EX        (https://www.gaisler.com/NOEL-PF)
- NOEL-XCKU-EX      (https://www.gaisler.com/NOEL-XCKU)

Uses the shared GRLIB APBUART console driver "apbuart_termios.c".
APBUART devices are probed using device tree.

Closes #4225.
2022-09-06 16:15:58 +02:00
Daniel Cederman
ca07efd571 bsp/riscv: Work area size based on /memory node in fdt
Uses the first entry in the /memory node to determine the end of the
work area. Falls back on linker symbol if unable to parse the node.
2022-09-06 15:51:58 +02:00
Sebastian Huber
faaffbd913 riscv: Use zicsr architecture extension
This is required for ISA 2.0 support, see chapter

"Zicsr", Control and Status Register (CSR) Instructions, Version 2.0

in

RISC-V Instruction Set Manual, Volume I: RISC-V User-Level ISA
2022-02-25 20:38:20 +01:00
Sebastian Huber
4b09a4c7b8 bsps/riscv: Add missing include 2022-02-25 20:38:20 +01:00
Joel Sherrill
dd70c81699 bsp_specs: Delete last remnants of these.
Updates #3937.
2021-11-29 08:50:03 -06:00
Sebastian Huber
db8f598d56 build: Remove old build system
Close #3250.
Close #4081.
2021-09-21 07:39:09 +02:00
Sebastian Huber
8b65b57472 score: Canonicalize _CPU_Fatal_halt()
Move _CPU_Fatal_halt() declaration to <rtems/score/cpuimpl.h> and make sure it
is a proper declaration of a function which does not return.  Fix the type of
the error code.  If necessary, add the implementation to cpu.c.  Implementing
_CPU_Fatal_halt() as a function makes it possible to wrap this function for
example to fully test _Terminate().
2021-07-28 21:04:20 +02:00
Sebastian Huber
c7b4eca7fa bsps/irq: bsp_interrupt_facility_initialize()
Do not return a status code in bsp_interrupt_facility_initialize() since this
leads to unreachable code in bsp_interrupt_initialize().  Use RTEMS_DEBUG
assertions in bsp_interrupt_facility_initialize() if necessary.
2021-07-27 10:03:19 +02:00
Sebastian Huber
85a378510d bsps/irq: bsp_interrupt_set_affinity()
Return a status code for bsp_interrupt_set_affinity().

Update #3269.
2021-07-26 19:57:31 +02:00
Sebastian Huber
23ec04c48c bsps/irq: bsp_interrupt_get_affinity()
Return a status code for bsp_interrupt_get_affinity().

Update #3269.
2021-07-26 19:57:31 +02:00