summaryrefslogtreecommitdiff
path: root/cpu/mips
Commit message (Collapse)AuthorAgeLines
* [MIPS] <asm/mipsregs.h>: Update coprocessor register access macrosShinya Kuribayashi2008-05-30-5/+5
| | | | Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* Fix some whitespace issuesWolfgang Denk2008-05-21-3/+3
| | | | | | introduced by 53677ef18 "Big white-space cleanup." Signed-off-by: Wolfgang Denk <wd@denx.de>
* Big white-space cleanup.Wolfgang Denk2008-05-21-136/+136
| | | | | | | | | | | This commit gets rid of a huge amount of silly white-space issues. Especially, all sequences of SPACEs followed by TAB characters get removed (unless they appear in print statements). Also remove all embedded "vim:" and "vi:" statements which hide indentation problems. Signed-off-by: Wolfgang Denk <wd@denx.de>
* [MIPS] cpu/mips/cache.S: Fix build warningShinya Kuribayashi2008-05-06-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some old GNU assemblers, such as v2.14 (ELDK 3.1.1), v2.16 (ELDK 4.1.0), warns illegal global symbol references by bal (and jal also) instruction. This does not happen with the latest binutils v2.18. Here's an example on gth2_config: mips_4KC-gcc -D__ASSEMBLY__ -g -Os -D__KERNEL__ -DTEXT_BASE=0x90000000 -I/home/skuribay/devel/u-boot.git/include -fno-builtin -ffreestanding -nostdinc -isy stem /opt/eldk311/usr/bin/../lib/gcc-lib/mips-linux/3.3.3/include -pipe -DCONFIG_MIPS -D__MIPS__ -G 0 -mabicalls -fpic -pipe -msoft-float -march=4kc -mtune=4k c -EB -c -o cache.o cache.S cache.S: Assembler messages: cache.S:243: Warning: Pretending global symbol used as branch target is local. cache.S:250: Warning: Pretending global symbol used as branch target is local. In principle, gas might be sensitive to global symbol references in PIC code because they should be processed through GOT (global offset table). But if `bal' instruction is used, it results in PC-based offset jump. This is the cause of this warning. In practice, we know it doesn't matter whether PC-based reference or GOT- based. As for this case, both will work before/after relocation. But let's fix the code. This patch explicitly sets up a target address, then jump there. Here's an example of disassembled code with/without this patch. 90000668: 1485ffef bne a0,a1,90000628 <mips_cache_reset+0x20> 9000066c: ac80fffc sw zero,-4(a0) 90000670: 01402821 move a1,t2 -90000674: 0411ffba bal 90000560 <mips_init_icache> -90000678: 01803021 move a2,t4 -9000067c: 01602821 move a1,t3 -90000680: 0411ffcc bal 900005b4 <mips_init_dcache> -90000684: 01a03021 move a2,t5 -90000688: 03000008 jr t8 -9000068c: 00000000 nop +90000674: 01803021 move a2,t4 +90000678: 8f8f83ec lw t7,-31764(gp) +9000067c: 01e0f809 jalr t7 +90000680: 00000000 nop +90000684: 01602821 move a1,t3 +90000688: 01a03021 move a2,t5 +9000068c: 8f8f81e0 lw t7,-32288(gp) +90000690: 01e0f809 jalr t7 +90000694: 00000000 nop +90000698: 03000008 jr t8 +9000069c: 00000000 nop Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* Allow building mips versions with ELDK 3.1.1Vlad Lungu2008-05-05-3/+6
| | | | | | .gpword works only with local symbols on certain binutils versions Signed-off-by: Vlad Lungu <vlad.lungu@windrvier.com>
* [MIPS] cpu/mips/config.mk: Fix GNU assembler minor version pickerShinya Kuribayashi2008-05-03-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Current trick to pick up GNU assembler minor version uses a dot(.) as a delimiter, and take the second field to obtain minor version number. But as can be expected, this doesn't work with a version string which has dots more than needs. Here's an example: $ mips-linux-gnu-as --version | grep 'GNU assembler' GNU assembler (Sourcery G++ Lite 4.2-129) 2.18.50.20080215 $ mips-linux-gnu-as --version | grep 'GNU assembler' | cut -d. -f2 2-129) 2 $ This patch restricts the version format to 2.XX.XX... This will work in most cases. $ mips-linux-gnu-as --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' 2.18.50.20080215 $ mips-linux-gnu-as --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' | cut -d. -f2 18 $ Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] cpu/mips/cache.S: Add dcache_enableShinya Kuribayashi2008-05-03-0/+16
| | | | | | | | | Recent bootelf command fixes (017e9b7925f74878d0e9475388cca9bda5ef9482, "allow ports to override bootelf behavior") requires ports to have this function. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Use jr as register jump instructionShinya Kuribayashi2008-04-18-6/+6
| | | | | | | | | | Current assembler codes are inconsistent in the way of register jump instruction usage; some use jr, some use j. Of course GNU as allows both usages, but as can be expected from `Jump Register' the mnemonic `jr' is more intuitive than `j'. For example, Linux doesn't have `j <reg>' usage at all. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* cpu/mips/cpu.c: Fix flush_cache bugShinya Kuribayashi2008-04-17-2/+2
| | | | | | | Cache operations have to take line address (addr), not start_addr. I noticed this bug when debugging ping failure. Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
* [MIPS] Extend MIPS_MAX_CACHE_SIZE upto 64kBShinya Kuribayashi2008-03-25-5/+9
| | | | Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] Fix dcache_status()Shinya Kuribayashi2008-03-25-3/+7
| | | | | | You can't judge UNCACHED by Config.K0 LSB. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] Introduce _machine_restartShinya Kuribayashi2008-03-25-7/+6
| | | | | | Handles machine specific functions by using weak functions. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] Cleanup CP0 Status initializationShinya Kuribayashi2008-03-25-9/+25
| | | | | | | | Add setup_c0_status from Linux. For the moment we disable interrupts, set CU0, mark the kernel mode, and clear ERL and EXL. This is good enough for reset-time configuration and will work well across most processors. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] Initialize CP0 Cause before setting up CP0 Status registerShinya Kuribayashi2008-03-25-3/+3
| | | | | | | Without this change, we'll be suffering from deffered WATCH exception once Status.EXL is cleared. Make sure Cause.WP is cleared. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] INCA-IP: Move watchdog init code from start.S to lowlevel_init()Shinya Kuribayashi2008-03-25-8/+0
| | | | | | Move things to appropriate place. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] Implement flush_cache()Shinya Kuribayashi2008-03-25-0/+22
| | | | | | | | | We do Hit_Writeback_Inv_D and Hit_Invalidate_I. You might think that you don't need to do Hit_Invalidate_I, but flush_cache() needs it since this function is used not only in U-Boot specfic programs but also at loading target binaries. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] Fix I-/D-cache initialization loopsShinya Kuribayashi2008-03-25-39/+76
| | | | | | | | | | | | | Currently we do 1) Index_Store_Tag_I, 2) Fill and 3) Index_Store_Tag_I again per a loop for I-cache initialization. But according to 'See MIPS Run', we're encouraged to use three separate loops rather than combining them *for both I- and D-cache*. This patch tries to fix this. In accordance with fixing above, mips_init_[id]cache are separated from mips_cache_reset(), and rewrite cache loops are completely rewritten with useful macros. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] Replace memory clearance code with f_fill64Shinya Kuribayashi2008-03-25-15/+28
| | | | | | This routine fills memory with zero by 64 bytes, and is 64-bit capable. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] cpu/mips/cache.S: Introduce NESTED/LEAF/END macrosShinya Kuribayashi2008-03-25-18/+7
| | | | | | | | | | This patch replaces the current function definitions with NESTED, LEAF and END macro. They specify some more additional information about the function; an alignment of symbol, type of symbol, stack frame usage, etc. These information explicitly tells the assembler and the debugger about the types of code we want to generate. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] Request for the 'mips_cache_lock()' removalShinya Kuribayashi2008-03-25-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial intension of having mips_cache_lock() was to use the cache as memory for temporary stack use so that a C environment can be set up as early as possible. But now mips_cache_lock() follow lowlevel_init(). We've already have the real memory initilaized at this point, therefore we could/should use it. No reason to lock at all. Other problems: Cache locking is not consistent across MIPS implementaions. Some imple- mentations don't support locking at all. The style of locking varies - some support per line locking, others per way, etc. Some parts use bits in status registers instead of cache ops. Current mips_cache_lock() is not necessarily general-purpose. And this is worthy of special mention; once U-Boot/MIPS locks the lines, they are never get unlocked, so the code relies on whatever gets loaded after U-Boot to re-initialize the cache and clear the locks. We're sup- posed to have CFG_INIT_RAM_LOCK and unlock_ram_in_cache() implemented, but leave the situation as it is for a long time. For these reasons, I proposed the removal of mips_cache_lock() from the global start-up code. This patch adds CFG_INIT_RAM_LOCK_MIPS to make existing users aware that *things have changed*. If he wants the same behavior as before, he needs to have CFG_INIT_RAM_LOCK_MIPS in his config file. If we don't have any regression report through several releases, then we'll remove codes entirely. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp> Acked-by: Andrew Dyer <amdyer@gmail.com>
* cpu/mips/cofigl.mk: Make a needlessly deffered expansion immediate.Shinya Kuribayashi2008-02-23-1/+1
| | | | | | | | | | | This reduces the build time by ~10%. Here's the gth2_config example. BEFORE AFTER real 0m31.441s 0m27.833s user 0m24.766s 0m23.045s sys 0m10.425s 0m7.468s Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] cpu/mips/config.mk: Fix GNU assembler minor version pickerShinya Kuribayashi2007-11-17-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current trick to pick up GNU assembler minor version does not work with the latest binutils (2007-03-01 or later) due to ${PKGVERSION} now default to "(GNU Binutils) ". $ sde-as --version |grep "GNU assembler" GNU assembler 2.15.94 mipssde-6.02.02-20050602 $ sde-as --version |grep "GNU assembler" |awk '{print $3}' 2.15.94 $ sde-as --version |grep "GNU assembler" |awk '{print $3}' |awk -F. '{print $2}' 15 $ $ mips-linux-as --version |grep "GNU assembler" GNU assembler (GNU Binutils) 2.18 $ mips-linux-as --version |grep "GNU assembler" |awk '{print $3}' (GNU $ mips-linux-as --version |grep "GNU assembler" |awk '{print $3}' |awk -F. '{print $2}' (no output) $ As a result of above, you'll see many noises with such binutils: make -C cpu/mips/ /bin/sh: line 0: [: : integer expression expected /bin/sh: line 0: [: : integer expression expected make[1]: Entering directory `/home/skuribay/devel/u-boot.git/cpu/mips' mips-linux-gcc -D__ASSEMBLY__ -g -Os -D__KERNEL__ -DTEXT_BASE=0xB0000000 -I/home/skuribay/devel/u-boot.git/include -fno-builtin -ffreestanding -nostdinc -isystem /home/skuribay/devel/buildroot/build_mips/staging_dir/usr/bin/../lib/gcc/mips-linux-uclibc/4.2.1/include -pipe -DCONFIG_MIPS -D__MIPS__ -G 0 -mabicalls -fpic -pipe -msoft-float -march=4kc -mtune=4kc -EB -c -o incaip_wdt.o incaip_wdt.S /bin/sh: line 0: [: : integer expression expected mips-linux-gcc -D__ASSEMBLY__ -g -Os -D__KERNEL__ -DTEXT_BASE=0xB0000000 -I/home/skuribay/devel/u-boot.git/include -fno-builtin -ffreestanding -nostdinc -isystem /home/skuribay/devel/buildroot/build_mips/staging_dir/usr/bin/../lib/gcc/mips-linux-uclibc/4.2.1/include -pipe -DCONFIG_MIPS -D__MIPS__ -G 0 -mabicalls -fpic -pipe -msoft-float -march=4kc -mtune=4kc -EB -c -o cache.o cache.S /bin/sh: line 0: [: : integer expression expected mips-linux-gcc -g -Os -D__KERNEL__ -DTEXT_BASE=0xB0000000 -I/home/skuribay/devel/u-boot.git/include -fno-builtin -ffreestanding -nostdinc -isystem /home/skuribay/devel/buildroot/build_mips/staging_dir/usr/bin/../lib/gcc/mips-linux-uclibc/4.2.1/include -pipe -DCONFIG_MIPS -D__MIPS__ -G 0 -mabicalls -fpic -pipe -msoft-float -march=4kc -mtune=4kc -EB -Wall -Wstrict-prototypes -c -o asc_serial.o asc_serial.c /bin/sh: line 0: [: : integer expression expected This patch simplifies the trick and makes it work with both versions of gas. I also replace an expensive `awk (or gawk)' with `cut'. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] Remove useless instructions for initializing $gp.Shinya Kuribayashi2007-11-17-3/+1
| | | | Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] MIPS 4K core: Coding style cleanupsShinya Kuribayashi2007-11-17-47/+39
| | | | | | No logical changes. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] au1x00_eth.c: Fixed a warning on pb1000 build.Shinya Kuribayashi2007-11-17-1/+1
| | | | | | | au1x00_eth.c: In function 'au1x00_miiphy_write': au1x00_eth.c:139: warning: 'return' with no value, in function returning non-void Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] au1x00_eth.c: Fix au1x00_miiphy_{read,write} build errorShinya Kuribayashi2007-11-17-59/+59
| | | | | | | | | | | | | | | au1x00_eth.c: In function 'au1x00_enet_initialize': au1x00_eth.c:246: error: 'au1x00_miiphy_read' undeclared (first use in this function) au1x00_eth.c:246: error: (Each undeclared identifier is reported only once au1x00_eth.c:246: error: for each function it appears in.) au1x00_eth.c:246: error: 'au1x00_miiphy_write' undeclared (first use in this function) au1x00_eth.c: In function 'au1x00_miiphy_write': au1x00_eth.c:298: warning: 'return' with no value, in function returning non-void make[1]: *** [au1x00_eth.o] Error 1 Fixed by moving these two functions forward. Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
* [MIPS] Add PIC-related switches to PLATFORM_{CPP,LD}FLAGS and cleanupShinya Kuribayashi2007-10-21-1/+1
| | | | Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
* [MIPS] Fix $gp usageShinya Kuribayashi2007-10-21-6/+13
| | | | | | | | | | | | | | | | | | | | Now we load $gp with _GLOBAL_OFFSET_TABLE_, but this is incorrect use. As a general principle, we should use _gp for $gp. Thanks to linker script's help we fortunately have _gp which equals to _GLOBAL_OFFSET_TABLE_. But once _gp gets out of alignment, we will not be able to access to GOT entires, global variables and procedure entry points. The right thing to do is to use _gp. This patch also introduce a new symbol `.gpword _GLOBAL_OFFSET_TABLE_' which holds the offset from _gp. When updating GOT entries, we use this offset and _gp to calculate the final _GLOBAL_OFFSET_TABLE_. This patch is originally submitted by Vlad Lungu <vlad@comsys.ro>, then I made some change to leave over num_got_entries. Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com> Cc: Vlad Lungu <vlad@comsys.ro>
* cpu/m*: Remove obsolete references to CONFIG_COMMANDSJon Loeliger2007-07-09-4/+4
| | | | Signed-off-by: Jon Loeliger <jdl@freescale.com>
* cpu/ non-mpc*: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger2007-07-04-3/+3
| | | | | | | | | | | | | | This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger <jdl@freescale.com>
* Move "ar" flags to config.mk to allow for silent "make -s"Wolfgang Denk2006-10-09-1/+1
| | | | Based on patch by Mike Frysinger, 20 Jun 2006
* Add support for a saving build objects in a separate directory.Marian Balakowicz2006-09-01-9/+13
| | | | | | | | | | | | | | | | | | | | | Modifications are based on the linux kernel approach and support two use cases: 1) Add O= to the make command line 'make O=/tmp/build all' 2) Set environement variable BUILD_DIR to point to the desired location 'export BUILD_DIR=/tmp/build' 'make' The second approach can also be used with a MAKEALL script 'export BUILD_DIR=/tmp/build' './MAKEALL' Command line 'O=' setting overrides BUILD_DIR environent variable. When none of the above methods is used the local build is performed and the object files are placed in the source directory.
* Fix MIPS LE build problemWolfgang Denk2006-07-21-1/+1
| | | | Patch by Thomas Lange, 10 Aug 2005
* au1x00_eth.c: check malloc return value and abort if it failedWolfgang Denk2006-03-13-2/+6
| | | | Patch by Andrew Dyer, 26 Jul 2005
* Code cleanup, especially MIPS for GCC 4.xWolfgang Denk2005-12-04-1/+1
|
* Fix U-Boot compilation for MIPS boards using ELDK 4.0Wolfgang Denk2005-12-01-14/+19
|
* Add support for multiple PHYs.Marian Balakowicz2005-10-28-2/+13
|
* Fix au1x00_serial baud rate calculation:Wolfgang Denk2005-09-25-2/+14
| | | | | | remove hardcoded cpu clock divisor and use register instead; round up instead of truncate Patch by Andrew Dyer, 15 Feb 2005
* Add support for AMD's Pb1x00 eval board;Wolfgang Denk2005-09-25-7/+2207
| | | | | | add MII routines to the au1x00 ethernet driver; add USB ohci driver (work in progress) Patch by Thomas Sailer, 20 Jan 2005
* Fix ethernet timeouts on dbau1550 and other au1x00 systemsWolfgang Denk2005-09-24-2/+2
| | | | Patch by Leif Lindholm, 29 Dec 2004
* Fix dbau1xxx (= MIPS big and little endian) build options.Wolfgang Denk2005-08-08-2/+10
| | | | | | Incorrect gcc options (big endian -BE switch) were used for dbau1550_el which is a little endian build; also get rid of reference to non-existant cpu/mips/little/liblittle.a library
* Prepare for SoC rework of ARM code:wdenk2005-04-02-1/+1
| | | | | - rename CONFIG_BOOTBINFUNC into CONFIG_INIT_CRITICAL - rename memsetup into lowlevel_init (function name and source files)
* * Patch by Leif Lindholm, 23 Sep 2004:wdenk2005-01-09-2/+7
| | | | | | | | add support for the AMD db1550 board * Patch by Travis Sawyer, 15 Sep 2004: Add CONFIG_SERIAL_MULTI support for ppc4xx, update README.serial_multi
* * Fix configuration for ERIC board (needs more room)wdenk2004-10-24-1/+9
| | | | | | * Adjust MIPS compiler options at run-time depending on tools version ("-march=4kc -mtune=4kc -Wa,-mips_allow_branch_to_undefined" for new, "-mcpu=4kc" for old tools)
* * Patch by liang a lei, 9 Jan 2004:wdenk2004-02-07-1/+5
| | | | | | | | | | | Fix Intel 28F128J3 ID in include/flash.h * Patch by Masami Komiya, 09 Jan 2004: add support for TB0229 board (NEC VR4131 MIPS processor) * Patch by Leon Kukovec, 12 Dec 2003: changed extern __inline__ into static __inline__ in include/linux/byteorder/swab.h
* * Implement adaptive SDRAM timing configuration based on actual CPUwdenk2004-01-29-1/+3
| | | | | | | clock frequency for INCA-IP; fix problem with board hanging when switching from 150MHz to 100MHz * Add PCMCIA CS support for BMS2003 board
* * Fix PS/2 keyboard problem caused by statically initialized variablewdenk2004-01-21-3/+3
| | | | | | pointing to a location in flash * Fix INCA-IP clock calculation: 400/3 = 133.3 MHz, not 130.
* * Patch by André Schwarz, 8 Dec 2003:wdenk2004-01-02-2/+7
| | | | | | | | | | | | | | fixes for Davicom DM9102A Ethernet Chip (#define CONFIG_TULIP_FIX_DAVICOM): - TX and RX deskriptors must be quad-word aligned - does not work with only one TX deskriptor - standard reset method does not work * Patch by Masami Komiya, 08 Dec 2003: add RTL8139 ethernet driver * Patches by Ed Okerson, 07 Dec 2003: - fix ethernet for the AU1x00 processors in little-endian mode. - extend memsetup.S for the AU1x00 processors in BE and LE modes
* Cleanupwdenk2003-12-27-47/+42
|
* * Make CPU clock on ICA-IP board controllable by a "cpuclk"wdenk2003-12-27-0/+15
| | | | | | | | | | | | | | environment variable which can set to "100", "133", or "150". The CPU clock will be configured accordingly upon next reboot. Other values are ignored. In case of an invalid or undefined "cpuclk" value, the compile-time default CPU clock speed will be used. * Enable Quad-UART on BMS2003 board (initialize the PCMCIA memory window that is used to access the UART registers by the Linux driver) * Patch by Reinhard Meyer, 20 Dec 2003: Fix clock calculation for the MPC5200 for higher clock frequencies (above 2**32 / 10 = 429.5 MHz).