summaryrefslogtreecommitdiff
path: root/arch/nds32/lib
AgeCommit message (Collapse)Author
2019-05-18CONFIG_SPL_SYS_[DI]CACHE_OFF: addTrevor Woerner
While converting CONFIG_SYS_[DI]CACHE_OFF to Kconfig, there are instances where these configuration items are conditional on SPL. This commit adds SPL variants of these configuration items, uses CONFIG_IS_ENABLED(), and updates the configurations as required. Acked-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Trevor Woerner <trevor@toganlabs.com> [trini: Make the default depend on the setting for full U-Boot, update more zynq hardware] Signed-off-by: Tom Rini <trini@konsulko.com>
2019-05-18CONFIG_SYS_[ID]CACHE_OFF: unify the 'any' caseTrevor Woerner
According to De Morgan's Law[1]: !(A && B) = !A || !B !(A || B) = !A && !B There are 5 places in the code where we find: #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) and 4 places in the code where we find: #if (!defined(CONFIG_SYS_ICACHE_OFF) || !defined(CONFIG_SYS_DCACHE_OFF)) In words, the construct: !defined(CONFIG_SYS_[DI]CACHE_OFF) means: "is the [DI]CACHE on?" and the construct: defined(CONFIG_SYS_[DI]CACHE_OFF) means: "is the [DI]CACHE off?" Therefore !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) means: "the opposite of 'are they both off?'" in other words: "are either or both on?" and: (!defined(CONFIG_SYS_ICACHE_OFF) || !defined(CONFIG_SYS_DCACHE_OFF) means: "are either or both on?" As a result, I've converted the 4 instances of '(!A || !B)' to '!(A && B)' for consistency. [1] https://en.wikipedia.org/wiki/De_Morgan%27s_laws Signed-off-by: Trevor Woerner <trevor@toganlabs.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-27Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini
We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-02-18fdt: Implement weak arch_fixup_fdt()Alexey Brodkin
Only ARM and in some configs MIPS really implement arch_fixup_fdt(). Others just use the same boilerplate which is not good by itself, but what's worse if we try to build with disabled CONFIG_CMD_BOOTM and enabled CONFIG_OF_LIBFDT we'll hit an unknown symbol which was apparently implemented in arch/xxx/lib/bootm.c. Now with weak arch_fixup_fdt() right in image-fdt.c where it is used we get both items highlighted above fixed. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: York Sun <york.sun@nxp.com> Cc: Stefan Roese <sr@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2017-09-21nds32: bootm: Fix warning of struct tag_serialnr declaredrick
move #include <asm/setup.h> from bootm.c to bootm.h Signed-off-by: rick <rick@andestech.com>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05nds32: Remove include files from common.hSimon Glass
With a few tweaks we can avoid including these files, which are only needed by two C files. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-05-22nds32: Support AE3XX platform.rick
Support Andestech AE3xx platform: serial, timer device tree flow. Signed-off-by: rick <rick@andestech.com>
2017-05-22nds32: Support AG101P serial DM.rick
Support AG101P serial device tree flow. Signed-off-by: rick <rick@andestech.com>
2015-08-28NDS32: Generic Board Support and UnsupportKun-Hua Huang
Add nds32 ag101p generic board support. Signed-off-by: Kun-Hua Huang <kunhua@andestech.com>
2015-04-18net: Remove the bd* parameter from net stack functionsJoe Hershberger
This value is not used by the network stack and is available in the global data, so stop passing it around. For the one legacy function that still expects it (init op on old Ethernet drivers) pass in the global pointer version directly to avoid changing that interface. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reported-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> (Trival fix to remove an unneeded variable declaration in 4xx_enet.c)
2014-05-12bd_info: remove bi_barudrate member from struct bd_infoMasahiro Yamada
gd->bd->bi_baudrate is a copy of gd->baudrate. Since baudrate is a common feature for all architectures, keep gd->baudrate only. It is true that bi_baudrate was passed to the kernel in that structure but it was a long time ago. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Tom Rini <trini@ti.com> Cc: Simon Glass <sjg@chromium.org> Cc: Wolfgang Denk <wd@denx.de> Cc: Heiko Schocher <hs@denx.de> Acked-by: Michal Simek <monstr@monstr.eu> (For microblaze)
2014-03-28kbuild: move asm-offsets.c from SoC directory to arch/$(ARCH)/libMasahiro Yamada
U-Boot has supported two kinds of asm-offsets.h. One is generic for all architectures and its source is located at ./lib/asm-offsets.c. The other is SoC specific and its source is under SoC directory. The problem here is that only boards with SoC directory can use the asm-offsets infrastructure. Putting asm-offsets.c right under CPU directory does not work. Now a new demand is coming. PowerPC folks want to use asm-offsets. But no PowerPC boards have SoC directory. It seems inconsistent that some boards add asm-offsets.c to SoC directoreis and some to CPU directories. It looks more reasonable to put asm-offsets.c under arch/$(ARCH)/lib. This commit merges asm-offsets.c under SoC directories into arch/$(ARCH)/lib/asm-offsets.c. By the way, I doubt the necessity of some entries in asm-offsets.c. I am leaving refactoring to the board maintainers. Please check "TODO" in the comment blocks in arch/{arm,nds32}/lib/asm-offsets.c. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Yuantian Tang <Yuantian.Tang@freescale.com>
2013-11-01nds32: convert makefiles to Kbuild styleMasahiro Yamada
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Macpaul Lin <macpaul@gmail.com>
2013-07-25Merge branch 'master' of git://git.denx.de/u-boot-nds32Tom Rini
2013-07-25nds32: Convert Makefiles to use COBJS-y styleken kuo
Signed-off-by: Kuan-Yu Kuo <ken.kuoky@gmail.com> Cc: Macpaul Lin <macpaul@gmail.com>
2013-07-24Merge branch 'master' of git://git.denx.de/u-boot-i2cTom Rini
The sandburst-specific i2c drivers have been deleted, conflict was just over the SPDX conversion. Conflicts: board/sandburst/common/ppc440gx_i2c.c board/sandburst/common/ppc440gx_i2c.h Signed-off-by: Tom Rini <trini@ti.com>
2013-07-24Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
2013-07-23i2c: common changes for multibus/multiadapter supportHeiko Schocher
Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org> Cc: Henrik Nordström <henrik@henriknordstrom.net>
2013-07-16Build arch/$ARCH/lib/bootm.o depending on CONFIG_CMD_BOOTMDirk Eibach
MAKEALL is fine for ppc4xx and mpc85xx. Run checks were done on our controlcenterd hardware. Signed-off-by: Dirk Eibach <dirk.eibach@gdsys.cc> Signed-off-by: Andy Fleming <afleming@freescale.com>
2013-07-02avr32/m68k/microblaze/nds32/nios2/openrisc/sh/sparc: fix do_bootm_linuxAndreas Bießmann
Commit 35fc84fa1ff51e15ecd3e464dac87eb105ffed30 broke bootm on avr32. It requires to call do_bootm_linux() with flag set to BOOTM_STATE_OS_PREP before calling it again with flag set to BOOTM_STATE_OS_GO. Fix this by allowing flag set to BOOTM_STATE_OS_PREP, this however will require a complete refactoring later on. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> [trini: Apply to m68k, microblaze, nds32, nios2, openrisc, sh and sparc] Signed-off-by: Tom Rini <trini@ti.com>
2013-05-08nds32: Use sections header to obtain link symbolsKuan-Yu Kuo
Include this header to get access to link symbols, which are otherwise removed. Signed-off-by: Kuan-Yu Kuo <ken.kuoky@gmail.com> Cc: Macpaul Lin <macpaul@gmail.com>
2013-05-01lib: consolidate hang()Andreas Bießmann
Delete all occurrences of hang() and provide a generic function. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Acked-by: Albert ARIBAUD <albert.u.boot@aribaud.net> [trini: Modify check around puts() in hang.c slightly] Signed-off-by: Tom Rini <trini@ti.com>
2013-04-01Consolidate bool typeYork Sun
'bool' is defined in random places. This patch consolidates them into a single header file include/linux/types.h, using stdbool.h introduced in C99. All other #define, typedef and enum are removed. They are all consistent with true = 1, false = 0. Replace FALSE, False with false. Replace TRUE, True with true. Skip *.py, *.php, lib/* files. Signed-off-by: York Sun <yorksun@freescale.com>
2013-03-15Replace __bss_end__ with __bss_endSimon Glass
Note this is a tree-wide change affecting multiple architectures. At present we use __bss_start, but mostly __bss_end__. This seems inconsistent and in a number of places __bss_end is used instead. Change to use __bss_end for the BSS end symbol throughout U-Boot. This makes it possible to use the asm-generic/sections.h file on all archs. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-02-19malloc: make malloc_bin_reloc staticGabor Juhos
On architectures where manual relocation is needed, the 'malloc_bin_reloc' function must be called after 'mem_malloc_init'. Make the 'malloc_bin_reloc' function static and call it directly from 'mem_malloc_init' instead of calling that from board_init_{r,f} functions of the affected architectures. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: Wolfgang Denk <wd@denx.de> Cc: Andreas Bießmann <andreas.devel@gmail.com> Cc: Jason Jin <Jason.jin@freescale.com> Cc: Macpaul Lin <macpaul@andestech.com> Cc: Daniel Hellstrom <daniel@gaisler.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
2013-02-01nds32: Drop tlb_addr from global dataSimon Glass
This field doesn't appear to be used for anything important, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-10-22common: Convert the U-Boot commands to LG-arraysMarek Vasut
This patch converts the old method of creating a list of command onto the new LG-arrays code. The old u_boot_cmd section is converted to new u_boot_list_cmd subsection and LG-array macros used as needed. Minor adjustments had to be made to the common code to work with the LG-array macros, mostly the fixup_cmdtable() calls are now passed the ll_entry_start and ll_entry_count instead of linker-generated symbols. The command.c had to be adjusted as well so it would use the newly introduced LG-array API instead of directly using linker-generated symbols. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@gmail.com> Cc: Mike Frysinger <vapier@gentoo.org>
2012-10-17nds32: Change macro from BOARD_LATE_INIT to CONFIG_BOARD_LATE_INITNobuhiro Iwamatsu
With almost all the architecture and board BOARD_LATE_INIT does not use. CONFIG_BOARD_LATE_INIT is used instead. This changed CONFIG_BOARD_LATE_INIT from BOARD_LATE_INIT. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> CC: Macpaul Lin <macpaul@andestech.com> [trini: Fixup for context changes] Signed-off-by: Tom Rini <trini@ti.com>
2012-10-15serial: Remove CONFIG_SERIAL_MULTI from remaining sourcesMarek Vasut
Remove the parts depending either on disabled CONFIG_SERIAL_MULTI or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI is now enabled by default. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Tom Rini <trini@ti.com> Cc: Anatolij Gustschin <agust@denx.de> Cc: Stefan Roese <sr@denx.de>
2012-09-26malloc: remove extern declarations of malloc_bin_reloc() in board.c filesDaniel Schwierzeck
Declare malloc_bin_reloc() in malloc.h and remove all extern declarations in various board.c files to get rid of one checkpatch.pl warning. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Andreas Bießmann <andreas.devel@gmail.com> Cc: Jason Jin <Jason.jin@freescale.com> Cc: Macpaul Lin <macpaul@andestech.com> Cc: Daniel Hellstrom <daniel@gaisler.com> Acked-by: Andreas Bießmann <andreas.devel@gmail.com>
2012-08-11nds32: fix unused pmu_init warningMike Frysinger
Fixes the build-time warning: board.c: At top level: board.c:106: warning: 'pmu_init' defined but not used This makes the ifdef logic at the call site match the logic at the function definition. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-11nds32: delete unused local variableMike Frysinger
Fixes the build-time warning: board.c: In function 'board_init_r': board.c:304: warning: unused variable 's' Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-07-20nds32: split common cache access from cpu into libMacpaul Lin
This commit does the following updates. 1. Split the common cache access from cpu.c into lib folder. 2. Rename the following cache api to adapt common.h - dcache_flush_rang -> flush_dcache_rang - icache_inval_range -> invalidate_icache_range 3. Add invalidate_dcache_range Signed-off-by: Macpaul Lin <macpaul@gmail.com>
2012-05-15net: move bootfile init into eth_initializeMike Frysinger
All arches init this the same way, so move the logic into the core net code to avoid duplicating it everywhere else. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
2012-05-15net: punt bd->bi_ip_addrMike Frysinger
This field gets read in one place (by "bdinfo"), and we can replace that with getenv("ipaddr"). After all, the bi_ip_addr field is kept up-to-date implicitly with the value of the ipaddr env var. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
2012-03-19nds32: fix ptrace and interrupt register overflowMacpaul Lin
Fix ptrace and interrupt register overflow warning. Add missing P0 and P1 (r26 and r27) into register lists. These register are usually used in OS. Signed-off-by: Macpaul Lin <macpaul@gmail.com>
2012-03-18bootstage: Replace show_boot_progress/error() with bootstage_...()Simon Glass
These calls should not be made directly any more, since bootstage will call the show_boot_...() functions as needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-18bootstage: Make use of BOOTSTAGE_ID_RUN_OS in show_boot_progress()Simon Glass
This changes the number 15 as used in boot_stage_progress() to use the new name provided for it. This is a separate patch because it touches so many files. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-02-28nds32/board.c: add PCI prompt at boot upMacpaul Lin
add PCI prompt at boot up for probing PCI device Signed-off-by: Macpaul Lin <macpaul@andestech.com>
2011-11-18nds32/lib: add ide generic supportMacpaul Lin
Add ide generic support. Signed-off-by: Macpaul Lin <macpaul@andestech.com>
2011-11-01nds32: Use getenv_ulong() in place of getenv(), strtoulMacpaul Lin
This changes the board code to use the new getenv_ulong() function. Signed-off-by: Macpaul Lin <macpaul@andestech.com>
2011-10-22nds32/lib: add generic funcs in NDS32 libMacpaul Lin
Add Makefile, board.c, interrupts.c and bootm.c functions to nds32 architecture. Signed-off-by: Macpaul Lin <macpaul@andestech.com>