summaryrefslogtreecommitdiffstats
path: root/arch/kvx
Commit message (Collapse)AuthorAgeFilesLines
* of: Add common device tree register functionSascha Hauer2020-10-121-11/+1
| | | | | | | | The different architectures duplicate some code around unflattening and registering the device tree. Add common functions to reduce this duplication. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc' into masterSascha Hauer2020-09-252-8/+6
|\
| * Regenerate defconfig filesUwe Kleine-König2020-09-231-7/+5
| | | | | | | | | | | | | | | | Done with the same script used to generate commit d952a0eeba37 ("Regenerate defconfig files"). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * restart: give all restart handlers a descriptive nameAhmad Fatoum2020-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | With incoming changes to choose a specific reset method, give all currently unnamed "default" reset handlers a name: - soc reset via SoC-specific means - soc-wdt reset via SoC watchdog timer - vector reset via jump to reset vector - efi reset via EFI firmware Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kvx,riscv: remove unused $(dtb-y) assignmentMasahiro Yamada2020-08-191-1/+0
|/ | | | | | | dtb-y is not defined in these Makefiles. Remove the meaningless code. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kvx: exclude dtb from malloc zoneClement Leger2020-08-111-2/+41
| | | | | | | | | | | | | | When dtb is provided by the FSBL (first stage bootloader), it might end up in the malloc zone initialized by barebox. While the dtb is discarded after being unflatten, if the dtb is provided right after barebox elf, then the malloc can overwrite it while unflattening it when allocating nodes. To avoid that, exclude the dtb from the malloc zone by checking if it overlaps it. If so, determine the largest zone for the allocation and modify the memory area to use that. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kvx: remove duplicated dtb symbolsClement Leger2020-07-011-9/+0
| | | | | | | | | | dtb symbols (__dtb_start, __dtb_end) are already defined using RO_DATA_SECTION. This duplicated dtb section is a leftover used by Kalray internal tools to patch the dtb when loading the elf on a target. Remove it to keep only one symbol definition. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kvx: add support for elf loading using bootmClement Leger2020-07-016-2/+155
| | | | | | | | | In order to boot elfs files, add bootm command support for kvx. This support can boot elf files using bootm elf support. initrd and device-tree handling is also included and loads them after the elf file load address. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kvx: add I-cache and D-cache synchronisationClement Leger2020-07-011-0/+18
| | | | | | | | | | | Before booting, we must make sure the I-cache is synchronized with the D-cache to execute loaded instructions. In order to do that, add a function which execute a fence to ensure every memory accesses have been committed out of processor pipeline to memory and then invalidate I-cache to reload from memory. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kbuild: fix typo in --no-whole-archive flagClement Leger2020-06-241-1/+1
| | | | | | | | | "whole" was replaced with "while" during a previous patch. Fix this flag to allow building correctly. Fixes 0a78b33954 ("kbuild: switch over to thin archive") Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/kvx'Sascha Hauer2020-06-113-4/+0
|\
| * kvx: do not include empty <config.h>Masahiro Yamada2020-05-183-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <config.h> is per-board config file, which is only allowed for old boards. For new boards, the top Makefile creates an empty include/config.h kvx does not have config.h, so #include <config.h> is useless. Also, remove meaningless board-$(CONFIG_GENERIC). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-By: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: switch over to thin archiveMasahiro Yamada2020-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting v4.13, Linux always uses thin archive instead of relocatable ELF to combine builtin objects. The thin archive is basically a text file that only contains paths to object files. As Linux commit 98ced886dd79 mentioned, this has a lot of benefits: - save disk space for builds - speed-up building a little - fix some issues when liking a giant executable (for example, allyesconfig on ARM Linux) - work better with dead code elimination The last one is important for barebox because pbl highly relies on the dead code elimination (-f{function,data}-sections and --gc-sections) dropping symbols that are unreachable from the linker's entry point. The dead code elimination does not work if the same symbol names are used in the pevious incremental link mechanism because the same name symbols all go into the same section. Commit a83c97f2a406 ("ARM: socfpga: generate smaller images when multiple boards are selected") worked around it by giving a dedicate section to each of the same name symbols. This workaround can go away. built-in.o was renamed to built-in.a since it is now an archive. built-in-pbl.o was renamed to built-in.pbl.a for consistency. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: remove obj-dtb-y, pbl-dtb-y, lwl-dtb-y syntaxMasahiro Yamada2020-05-201-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The embedded DTBs are compiled by the chain of pattern rules as follows: %.dts -> %.dtb -> %.dtb.S -> %.dtb.o for barebox proper %.dts -> %.dtb -> %.dtb.S -> %.dtb.pbl.o for pbl Barebox introduced {obj,pbl,lwl}-dtb-y syntax to put the intermediate files into extra-y. The purposes of doing so were: [1] prevent GNU Make from deleting the intermediate files [2] include .*.cmd files In contrast, Linux does not use a special syntax for embedding DTBs into the kernel. For example, as you see in arch/sh/boot/dts/Makefile of Linux 5.6, obj-y += <basename>.dtb.o ... just works. This is because scripts/Kbuild.include specifies .SECONDARY to cater to [1], and scripts/Makefile.build adds the intermediates to 'targets' to deal with [2]. Barebox had already imported the same code from Linux, so you can use obj-y instead of obj-dtb-y, like Linux. pbl-dtb-y and lwl-dtb-y are barebox-specific cases, so I added the %.dtb.pbl.o pattern to intermediate_targets. Going forward, please use obj-y, pbl-y, or lwl-y. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kbuild: prefix compiler flag variables with KBUILD_Masahiro Yamada2020-04-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | In old days, Linux also used to use well-known variables such CFLAGS, CPPFLAGS, etc. They were prefixed with KBUILD_ presumably for preventing users from overriding them accidentally. Rename as follows: CFLAGS -> KBUILD_CFLAGS AFLAGS -> KBUILD_AFLAGS CPPFLAGS -> KBUILD_CPPFLAGS LDFLAGS -> KBUILD_LDFLAGS HOSTCFLAGS -> KBUILD_HOSTCFLAGS HOSTCXXFLAGS -> KBUILD_HOSTCXXFLAGS HOSTLDFLAGS -> KBUILD_HOSTLDFLAGS HOST_LOADLIBES -> KBUILD_HOSTLDLIBS HOSTCFLAGS, HOSTCXXFLAGS, HOSTLDFLAGS, HOSTLDLIBS are re-used to allow users to pass-in additional flags to the host compiler. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* watchdog: kvx: Add kvx watchdog supportClement Leger2020-04-151-0/+3
| | | | | | | Add a watchdog for kvx architecture based on core watchdog. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: kvx: Add kvx clocksource supportClement Leger2020-04-151-0/+1
| | | | | | | | | Add a clocksource for kvx architecture based on core performance counter. This performance counter is configured to count cycles and as such can be used to be a clocksource. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kvx: Implement reset source and resetClement Leger2020-04-155-1/+95
| | | | | | | | Implement reset and reset source handling using ftu. This support uses regmap to access the ftu easily using "kalray,kvx-syscon" compatible. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kvx: Add support for device treeClement Leger2020-04-154-0/+144
| | | | | | | Add dts folder with minimal device tree for kalray K200 board. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kvx: Add processor definitionsClement Leger2020-04-151-0/+5029
| | | | | | | | This file is generated from processor description and is used to access and modify processor registers. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kvx: Initial Kalray Coolidge (kv3) architecture supportClement Leger2020-04-1531-0/+1154
Add kalray coolidge arch/ support. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>