1 | .. SPDX-License-Identifier: CC-BY-SA-4.0 |
---|
2 | |
---|
3 | .. Copyright (C) 2018 embedded brains GmbH |
---|
4 | |
---|
5 | riscv (RISC-V) |
---|
6 | ************** |
---|
7 | |
---|
8 | riscv |
---|
9 | ===== |
---|
10 | |
---|
11 | This BSP offers 13 variants: |
---|
12 | |
---|
13 | * rv32i |
---|
14 | |
---|
15 | * rv32iac |
---|
16 | |
---|
17 | * rv32im |
---|
18 | |
---|
19 | * rv32imac |
---|
20 | |
---|
21 | * rv32imafc |
---|
22 | |
---|
23 | * rv32imafd |
---|
24 | |
---|
25 | * rv32imafdc |
---|
26 | |
---|
27 | * rv64imac |
---|
28 | |
---|
29 | * rv64imac_medany |
---|
30 | |
---|
31 | * rv64imafd |
---|
32 | |
---|
33 | * rv64imafd_medany |
---|
34 | |
---|
35 | * rv64imafdc |
---|
36 | |
---|
37 | * rv64imafdc_medany |
---|
38 | |
---|
39 | Each variant corresponds to a GCC multilib. A particular variant reflects an |
---|
40 | ISA with ABI and code model choice. |
---|
41 | |
---|
42 | The basic hardware initialization is not performed by the BSP. A boot loader |
---|
43 | with device tree support must be used to start the BSP, e.g. BBL. The BSP must |
---|
44 | be started im machine mode. |
---|
45 | |
---|
46 | The reference platform for this BSP is the Qemu `virt` machine. |
---|
47 | |
---|
48 | Build Configuration Options |
---|
49 | --------------------------- |
---|
50 | |
---|
51 | The following options are available at the configure command line. |
---|
52 | |
---|
53 | ``BSP_PRESS_KEY_FOR_RESET`` |
---|
54 | If defined to a non-zero value, then print a message and wait until pressed |
---|
55 | before resetting board when application terminates. |
---|
56 | |
---|
57 | ``BSP_RESET_BOARD_AT_EXIT`` |
---|
58 | If defined to a non-zero value, then reset the board when the application |
---|
59 | terminates. |
---|
60 | |
---|
61 | ``BSP_PRINT_EXCEPTION_CONTEXT`` |
---|
62 | If defined to a non-zero value, then print the exception context when an |
---|
63 | unexpected exception occurs. |
---|
64 | |
---|
65 | ``BSP_FDT_BLOB_SIZE_MAX`` |
---|
66 | The maximum size of the device tree blob in bytes (default is 65536). |
---|
67 | |
---|
68 | ``BSP_CONSOLE_BAUD`` |
---|
69 | The default baud for console driver devices (default 115200). |
---|
70 | |
---|
71 | ``RISCV_MAXIMUM_EXTERNAL_INTERRUPTS`` |
---|
72 | The maximum number of external interrupts supported by the BSP (default |
---|
73 | 64). |
---|
74 | |
---|
75 | ``RISCV_ENABLE_HTIF_SUPPORT`` |
---|
76 | Enables the HTIF support if defined to a non-zero value, otherwise it is |
---|
77 | disabled (disabled by default). |
---|
78 | |
---|
79 | ``RISCV_CONSOLE_MAX_NS16550_DEVICES`` |
---|
80 | The maximum number of NS16550 devices supported by the console driver (2 |
---|
81 | by default). |
---|
82 | |
---|
83 | ``RISCV_RAM_REGION_BEGIN`` |
---|
84 | The begin of the RAM region for linker command file (default is 0x70000000 |
---|
85 | for 64-bit with -mcmodel=medlow and 0x80000000 for all other). |
---|
86 | |
---|
87 | ``RISCV_RAM_REGION_SIZE`` |
---|
88 | The size of the RAM region for linker command file (default 64MiB). |
---|
89 | |
---|
90 | Interrupt Controller |
---|
91 | -------------------- |
---|
92 | |
---|
93 | Exactly one Core Local Interruptor (CLINT) and exactly one Platform-Level |
---|
94 | Interrupt Controller (PLIC) are supported. The maximum number of external |
---|
95 | interrupts supported by the BSP is defined by the |
---|
96 | ``RISCV_MAXIMUM_EXTERNAL_INTERRUPTS`` BSP option. |
---|
97 | |
---|
98 | Clock Driver |
---|
99 | ------------ |
---|
100 | |
---|
101 | The clock driver uses the CLINT timer. |
---|
102 | |
---|
103 | Console Driver |
---|
104 | -------------- |
---|
105 | |
---|
106 | The console driver supports devices compatible to |
---|
107 | |
---|
108 | * "ucb,htif0" (depending on the ``RISCV_ENABLE_HTIF_SUPPORT`` BSP option), |
---|
109 | |
---|
110 | * "ns16550a" (see ``RISCV_CONSOLE_MAX_NS16550_DEVICES`` BSP option), and |
---|
111 | |
---|
112 | * "ns16750" (see ``RISCV_CONSOLE_MAX_NS16550_DEVICES`` BSP option). |
---|
113 | |
---|
114 | They are initialized according to the device tree. The console driver does not |
---|
115 | configure the pins or peripheral clocks. The console device is selected |
---|
116 | according to the device tree "/chosen/stdout-path" property value. |
---|
117 | |
---|
118 | griscv |
---|
119 | ====== |
---|
120 | |
---|
121 | This RISC-V BSP supports chips using the |
---|
122 | `GRLIB <https://www.gaisler.com/products/grlib/grlib.pdf>`_. |
---|