Regarding link script, some memory offsets and sizes are different
between the standard version and the smart version (such as
"__STACKSIZE__", kernel start address, kernel memory size, etc.).
Original solution is replacing link scripts and use INCLUDE,
which is relatively complicated.
This improvement uses macros to replace constants in the link
script. The preprocessing mechanism provided by gcc is used
to dynamically replace constant values during the build process.
In addition, the kernel load address (the corresponding
KERNEL_VADDR_START for smart) was originally configured as
0xFFFFFFC000200000, which is default value of riscv with
kernelmap enabled (0xffffffc000000000) plus offset to skip over
bootloader (0x200000). This caused a trouble: due to
default bsp configuration is for smart, if we switched to the
standard version and build, and then switched back to the smart
version, the value of KERNEL_VADDR_START will be default back to
0xffffffc000000000, which is different from the original configuration
value, resulting in the need to manually reconfigure it, which
is easy to forget and cause problems.
The current solution is to use the default value
0xffffffc000000000 in the configuration. Add offset to the code
and link script when using it.
This patch update the default .config and rtconfig.h for cv18xx_riscv.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
include :rtdef.h : [ Refine the annotation of RT_ALIGN and RT_ALIGN_DOWN ]
This macro is vulnerable to non-2-byte alignments,
but I assume that the macro definition was designed with an explicit use case of 2-byte alignments in mind.
Therefore, I only modify the comment to remind the user.
Solution:
RT_ALIGN(size, align) ((size) + (align) - 1) / (align) * (align)
RT_ALIGN_DOWN(size, align) (size) / (align) * (align)
Here's what deepseek recommends more.
Signed-off-by: Yucai Liu <1486344514@qq.com>
Match the organization of modules (groups) with
that of user guide.
Preliminary arrangement. This patch is just a
framework arrangement. Details need to be continued.
P.S., in this patch, adding numerical prefixes to
the files in documentation/0.doxygen is to meet the
need of displaying sorting in HTML pages.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Fix garble caused by empty implementation of earlycon series
function in driver.If driver doesn't offer earlycon_id or rt_f
dt_earlycon_id.setup function but open option, the checking
of best_earlycon_id will failed.
Signed-off-by: 1078249029 <1078249029@qq.com>
This patch contains two small changes, mainly to
prepare for the next step of organizing the modules
framework.
The first change: move the files related to doxygen
examples to `documentation/0.doxygen/example/`
The second change: delete `documentation/0.doxygen/mainpage.h`,
which is the mainpage of the old page. Now the new mainpage
is `documentation/INDEX.md`, so the duplicate can be
deleted.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
libcpu/risc-v/common64/mmu.c uses the external
symbol "__bss_end" (this symbol generally is
defined in the link script file) and depends
on the extern declaration of this symbol in
the bsp's "board.h". This is not a problem in
implementation, but it is not a good habit.
If this extern symbol is used locally, just
declare it locally should be better.
In this way, there will be no dependency of
the kernel core on the bsp header file. And
there will be no special requirements for the
bsp board code, such as the need to make
extern declarations for these "__bss_end"
symbols in "board.h".
This patch currently only explicitly externly
declares "__bss_end" inside libcpu itself.
The code of "#include <board.h>" is kept, because
the modification involved is too large, it is
necessary to clean up the bsp involved before
cleaning this include code line uniformly.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
* libcpu: cleanup undefined rt_hw_mmu_kernel_map_init
rt_hw_mmu_kernel_map_init() is declared in header files but
no definition found, cleanup the code.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
* bsp: allwinner: d1: remove calling of rt_hw_mmu_kernel_map_init
rt_hw_mmu_kernel_map_init is an undefined function, calling it
is meaningless.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
---------
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Add description on how to configure pinmux in menuconfig for
cvitek products.
Add myself to maintainer list in README.md.
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>