summaryrefslogtreecommitdiffstats
path: root/arch/nios2/cpu
Commit message (Collapse)AuthorAgeFilesLines
* Delete tests of CONFIG_OF_LIBFDT when testing CONFIG_OF_BOARD_SETUPRobert P. J. Day2016-05-271-2/+2
| | | | | | | | | | | | | | | | Since CONFIG_OF_BOARD_SETUP depends on CONFIG_OF_LIBFDT: config OF_BOARD_SETUP bool "Set up board-specific details in device tree before boot" depends on OF_LIBFDT ... remove superfluous tests of CONFIG_OF_LIBFDT when testing for CONFIG_OF_BOARD_SETUP. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> [trini: Typo fix: s/ifdefi/ifdef/] Signed-off-by: Tom Rini <trini@konsulko.com>
* dm: Use uclass_first_device_err() where it is usefulSimon Glass2016-03-141-3/+1
| | | | | | Use this new function in places where it simplifies the code. Signed-off-by: Simon Glass <sjg@chromium.org>
* nios2: set up the debug UART earlyThomas Chou2016-02-061-0/+7
| | | | | | | Set up the debug UART early if enabled, so that it is ready to use. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Chin Liang See <clsee@altera.com>
* Fix board init code to respect the C runtime environmentAlbert ARIBAUD2016-01-131-5/+9
| | | | | | | | | | | | | board_init_f_mem() alters the C runtime environment's stack it is actually already using. This is not a valid behaviour within a C runtime environment. Split board_init_f_mem into C functions which do not alter their own stack and always behave properly with respect to their C runtime environment. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Acked-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: display altera sysid at startupThomas Chou2015-12-191-0/+8
| | | | | | | | Display altera sysid at startup, which was once removed during the move. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de>
* nios2: fix cached mode in clearing the BSSThomas Chou2015-11-061-1/+1
| | | | | | | | As the generic board runs in cached mode, it should not use "stwio" which bypass the cache. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Reviewed-by: Chin Liang See <clsee@altera.com>
* nios2: remove CONFIG_SYS_INIT_SP macroThomas Chou2015-11-061-2/+1
| | | | | | | | | Remove CONFIG_SYS_INIT_SP macro, as the initial stack is set to below the u-boot code. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Chin Liang See <clsee@altera.com>
* nios2: change virt_to_phys to use physaddr_mask in global dataThomas Chou2015-11-061-0/+1
| | | | | | | | | As virt_to_phys() is used a lot in DMA transfer, change it to use physaddr_mask in global data. This will save an "if" statement and get a little faster. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de>
* nios2: fix map_physmem to do real cache mappingThomas Chou2015-11-061-1/+2
| | | | | | | Fix the map_physmem() to do real cache mapping. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de>
* nios2: convert copy_exception_trampoline to use dm cpu dataThomas Chou2015-10-232-24/+25
| | | | | | Convert copy_exception_trampoline() to use dm cpu data. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: convert cache flush to use dm cpu dataThomas Chou2015-10-231-15/+0
| | | | | | | | | | | | | | | Convert cache flush to use dm cpu data. The original cache flush functions are written in assembly and use CONFIG_SYS_{I,D}CACHE_SIZE... macros. It is difficult to convert to use cache configuration in dm cpu data which is extracted from device tree. The cacheflush.c of Linux nios2 arch uses cpuinfo structure, which is very close to our dm cpu data. So we copy and modify it to arch/nios2/lib/cache.c to replace the old cache.S. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: set default cache configuration in start.SThomas Chou2015-10-231-7/+15
| | | | | | | | | | | | | | | | | | | Set default icache and dcache configuration for start.S. We want to remove the CONFIG_SYS_{I,D}CACHE_SIZE... configuration macros. As we are just barely starting from reset, there is no luxury of device tree. We will set some maximum cache configuration so that it will work for most configurations. This is used only in this start.S. The speed penalty is only once here. After start up, during board initialization, cpu information will be extracted from device tree. Then cache flush operations will have correct cache configurations. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de>
* nios2: clean up comments style in start.SThomas Chou2015-10-231-31/+30
| | | | | | Clean up comments style in start.S. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: convert do_reset to use dm cpu dataThomas Chou2015-10-231-1/+1
| | | | | | | Convert do_reset to use dm cpu data. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Reviewed-by: Simon Glass <sjg@chromium.org>
* nios2: convert altera sysid to driver modelThomas Chou2015-10-233-58/+3
| | | | | | | | Convert altera sysid to driver model with misc uclass. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Chin Liang See <clsee@altera.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* nios2: convert altera timer to driver modelThomas Chou2015-10-232-66/+1
| | | | | | | Convert altera timer to driver model. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Chin Liang See <clsee@altera.com>
* nios2: convert nios2 cpu to driver modelThomas Chou2015-10-231-3/+87
| | | | | | | | | Convert nios2 cpu to driver model. The cpu parameters are extracted from device tree and saved to global data structure. We will use them to replace the custom_fpga.h . Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Reviewed-by: Simon Glass <sjg@chromium.org>
* nios2: map physical address to uncached virtual addressThomas Chou2015-10-231-2/+2
| | | | | | | | | | | | | | | | | | Add ioremap() to map physical address to uncached virtual address. We need this to convert the reg address from the device tree. The order of headers inclusion in interrupts.c is changed because common.h will include board header that contains IO_REGION_BASE. In the future, the IO_REGION_BASE should be decided from the device tree. tree Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* nios2: call board_init_f_memThomas Chou2015-10-231-0/+10
| | | | | | | | | | We will need CONFIG_SYS_MALLOC_F_LEN to use serial uclass. So we shall undefine CONFIG_SYS_GENERIC_GLOBAL_DATA, and call board_init_f_mem() to allocates early malloc() memory with size of CONFIG_SYS_MALLOC_F_LEN in board_f.c. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Reviewed-by: Marek Vasut <marex@denx.de>
* nios2: zap version_stringThomas Chou2015-10-231-6/+0
| | | | | | | | There is a weak version_string[] at common/cmd_version.c . Remove the one in start.S. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de>
* nios2: zap dly_clksThomas Chou2015-10-231-33/+0
| | | | | | | | The dly_clks() in start.S is no use after switching to generic timer. Remove it. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de>
* nios2: Split timer code into timer.cThomas Chou2015-10-233-84/+67
| | | | | | | | Move the timer code from interrupts.c into timer.c . Eliminate the installation of timer interrupt handler, which is no longer used. Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: Switch to generic timerThomas Chou2015-10-231-94/+38
| | | | | | | | Zap almost all of the ad-hoc timer code from interrupts.c and use the code in lib/time.c instead. Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: define _end in link scriptThomas Chou2015-10-231-0/+6
| | | | | | | | | | | | | Since commit 44c6e6591cb451ae606f8bde71dd5fb7b4002544 "rename _end to __bss_end__" , the _end was removed. But we need it now for separated device tree control, ie, CONFIG_OF_SEPARATE . The _end is used by fdtdec_setup() to find the blob. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* nios2: remove gp assignments in link scriptThomas Chou2015-10-231-3/+5
| | | | | | | | | | | | | Since we don't use gp for small data with option "-G0", we use gp as global data pointer. The _gp location is not needed. The ALIGN(16) was for gp only. It is removed, so that we can get correct address of dtb in u-boot-dtb.bin image. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de>
* nios2: enlarge the code relocation rangeThomas Chou2015-10-231-2/+3
| | | | | | | | | As we will use u-boot-dtb.bin, the code relocation range should be adjusted to accommodate the additional dtb. It might be overkilled to look into dtb header to find the dtb size, so we will simply use CONFIG_SYS_MONITOR_LEN. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: BSS should be cleared only after board_init_fThomas Chou2015-10-231-14/+16
| | | | | | | | | As dtb in u-boot-dtb.bin overlapped the BSS section, we should delay the clearing of BSS until dtb is relocated in board_init_f(). Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Acked-by: Marek Vasut <marex@denx.de>
* fdt: nios: Fix warning in ft_cpu_setup()Simon Glass2015-04-101-2/+0
| | | | | | | This function should not return a value. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Thomas Chou <thomas@wytron.com.tw>
* fdt: Allow ft_board_setup() to report failureSimon Glass2014-11-211-2/+6
| | | | | | | | | | | | | | | | | | This function can fail if the device tree runs out of space. Rather than silently booting with an incomplete device tree, allow the failure to be detected. Unfortunately this involves changing a lot of places in the code. I have not changed behvaiour to return an error where one is not currently returned, to avoid unexpected breakage. Eventually it would be nice to allow boards to register functions to be called to update the device tree. This would avoid all the many functions to do this. However it's not clear yet if this should be done using driver model or with a linker list. This work is left for later. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
* nios2: link to CONFIG_SYS_MONITOR_BASE and remove text_base hookThomas Chou2014-08-301-0/+2
| | | | | | | This patch changes the link script to base at CONFIG_SYS_MONITOR_BASE. Then we can remove the text_base hook in nios2-generic board. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: move nios2.h to arch asm directoryThomas Chou2014-08-302-2/+2
| | | | | | | The nios2.h is nios2 cpu specific, and should go arch asm directory. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: divide nios2-io.h into each specific drivers and remove itThomas Chou2014-08-303-4/+25
| | | | | | | | | | The nios2-io.h defines hardware registers and bits of several FPGA IP cores. It could be divided in to the specific drivers, including altera timer, altera sysid, altera uart and altera jtag uart. The altera pio and altera spi drivers use their own hardware definitions. The removal of nios2-io.h will help modularity and maintenance. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: remove EPCS driverThomas Chou2014-08-242-718/+1
| | | | | | | The Altera EPCS is SPI flash. We have been using SPI flash driver to access EPCS for years. The old EPCS driver could be removed. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: add generic board supportThomas Chou2014-08-242-5/+43
| | | | | | | | | This patch implements the generic board init as described in doc/README.generic-board. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Signed-off-by: Scott McNutt <smcnutt@psyent.com> Reviewed-by: Stefan Roese <sr@denx.de>
* nios2: convert makefiles to Kbuild styleMasahiro Yamada2013-11-011-26/+4
| | | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Thomas Chou <thomas@wytron.com.tw>
* Coding Style cleanup: replace leading SPACEs by TABsWolfgang Denk2013-10-141-1/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Drop changes for PEP 4 following python tools] Signed-off-by: Tom Rini <trini@ti.com>
* Coding Style cleanup: remove trailing white spaceWolfgang Denk2013-10-142-2/+2
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-2410-170/+10
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2013-03-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Albert's rework of the linker scripts conflicted with Simon's making everyone use __bss_end. We also had a minor conflict over README.scrapyard being added to in mainline and enhanced in u-boot-arm/master with proper formatting. Conflicts: arch/arm/cpu/ixp/u-boot.lds arch/arm/cpu/u-boot.lds arch/arm/lib/Makefile board/actux1/u-boot.lds board/actux2/u-boot.lds board/actux3/u-boot.lds board/dvlhost/u-boot.lds board/freescale/mx31ads/u-boot.lds doc/README.scrapyard include/configs/tegra-common.h Build tested for all of ARM and run-time tested on am335x_evm. Signed-off-by: Tom Rini <trini@ti.com>
| * Refactor linker-generated arraysAlbert ARIBAUD2013-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor linker-generated array code so that symbols which were previously linker-generated are now compiler- generated. This causes relocation records of type R_ARM_ABS32 to become R_ARM_RELATIVE, which makes code which uses LGA able to run before relocation as well as after. Note: this affects more than ARM targets, as linker- lists span possibly all target architectures, notably PowerPC. Conflicts: arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds arch/arm/cpu/armv7/omap-common/u-boot-spl.lds board/ait/cam_enc_4xx/u-boot-spl.lds board/davinci/da8xxevm/u-boot-spl-da850evm.lds board/davinci/da8xxevm/u-boot-spl-hawk.lds board/vpac270/u-boot-spl.lds Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
* | Replace __bss_end__ with __bss_endSimon Glass2013-03-152-4/+4
|/ | | | | | | | | | | | | 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>
* Clean up libfdt.h includesGerald Van Baren2013-02-081-1/+0
| | | | | | | | | | The libfdt.h file is the definition file for libfdt. It is unnecessary to include other fdt header files (the necessary ones are pulled in by libfdt.h). Signed-off-by: Gerald Van Baren <gvb@unssw.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Stefan Roese <sr@denx.de>
* common: Discard the __u_boot_cmd sectionMarek Vasut2012-10-221-7/+0
| | | | | | | | | | | The command declaration now uses the new LG-array method to generate list of commands. Thus the __u_boot_cmd section is now superseded and redundant and therefore can be removed. Also, remove externed symbols associated with this section from include/command.h . Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@gmail.com> Cc: Mike Frysinger <vapier@gentoo.org>
* common: Add .u_boot_list into all linker filesMarek Vasut2012-10-221-0/+5
| | | | | | | | | | Add section for the linker-generated lists into all possible linker files, so that everyone can easily use these lists. This is mostly a mechanical adjustment. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@gmail.com> Cc: Mike Frysinger <vapier@gentoo.org>
* nios2: implement get_ticks and get_tbclkAlex Hornung2012-02-231-0/+21
| | | | | | | | * Copy over Blackfin's get_ticks and get_tbclk - they work just fine on Nios2. Signed-off-by: Alex Hornung <alex@alexhornung.com> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: Offer ft_board_setup() capability and call fdt_fixup_ethernet().Joachim Foerster2011-10-302-0/+54
| | | | | | | | The main motivation is, to have the local-mac-address property of the ethernet peripherals fixed/synced with U-Boot's environment settings. Signed-off-by: Joachim Foerster <joachim.foerster@missinglinkelectronics.com> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: Pseudo implement dcache_status/enable/disable()Joachim Foerster2011-10-281-0/+16
| | | | | | | | | | | AFAIK the NIOS2 architecture does not have any possibility to dynamically switch off the data cache. So _status() always reports 1 and _enable/_disable() just issue a flush of everything. For example, common/cmd_elf.c depends on these symbols. Signed-off-by: Joachim Foerster <joachim.foerster@missinglinkelectronics.com> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* unify version_stringAndreas Bießmann2011-07-281-8/+1
| | | | | | | | | | | | This patch removes the architecture specific implementation of version_string where possible. Some architectures use a special place and therefore we provide U_BOOT_VERSION_STRING definition and a common weak symbol version_string. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> CC: Mike Frysinger <vapier@gentoo.org> CC: Peter Pan <pppeterpppan@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Timer: Remove set_timer completelyGraeme Russ2011-07-261-6/+0
|
* rename _end to __bss_end__Po-Yu Chuang2011-03-272-4/+4
| | | | | | | Currently, _end is used for end of BSS section. We want _end to mean end of u-boot image, so we rename _end to __bss_end__ first. Signed-off-by: Po-Yu Chuang <ratbert@faraday-tech.com>
OpenPOWER on IntegriCloud