summaryrefslogtreecommitdiff
path: root/cpu/blackfin
AgeCommit message (Collapse)Author
2009-09-02Blackfin: use scratch pad for exception stackMike Frysinger
If the memory layout pushes the stack out of the default DCPLB coverage, the exception handler may trigger a double fault by trying to push onto the uncovered stack. So handle the exception stack similar to the kernel by using the top of the scratch pad SRAM. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-18Blackfin: split cpu COBJS into multilinesMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-18Blackfin: add os log functionsMike Frysinger
Part of the mini Blackfin ABI with operating systems is that they can use 0x4f0-0x4f8 to pass log buffers to/from bootloaders. So add support to U-Boot for reading the log buffer. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-18stdio/device: rework function naming conventionJean-Christophe PLAGNIOL-VILLARD
So far the console API uses the following naming convention: ======Extract====== typedef struct device_t; int device_register (device_t * dev); int devices_init (void); int device_deregister(char *devname); struct list_head* device_get_list(void); device_t* device_get_by_name(char* name); device_t* device_clone(device_t *dev); ======= which is too generic and confusing. Instead of using device_XX and device_t we change this into stdio_XX and stdio_dev This will also allow to add later a generic device mechanism in order to have support for multiple devices and driver instances. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Edited commit message. Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-06-15Blackfin: bump up default JTAG console timeoutVivi Li
The debug tools that interface with the other side of the JTAG console got much slower when generalizing things, so bump up the default timeout value on the U-Boot side to cope. Hopefully at some point we can improve the debug tools to speed things back up. Signed-off-by: Vivi Li <vivi.li@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-06-12Add support for Linux-like kallsysmsMike Frysinger
The kernel stores address<->symbol names in it so things can be decoded at runtime. Do it in U-Boot, and we get nice symbol decoding when crashing. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-19Blackfin: fix timer_init()/timer_reset()Graf Yang
The timer_init() function was not using the right csync instruction, nor was it doing it right after disabling the core timer. The timer_reset() function would reset the timestamp, but not the actual timer, so there was a common edge case where get_timer() return a jump of one timestamp (couple milliseconds) right after resetting. This caused many functions to improperly timeout right away. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-06Blackfin: avoid get_sclk() with early serial debugMike Frysinger
When the clock functions were changed to use cached values (and thereby avoiding expensive math functions), early serial debug broke because the baud programming is called before external memory is available. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-06Blackfin: fix booting with older bootroms (no EVT1)Mike Frysinger
When dropping jump block support, the assumption was that all bootroms supported entry point redirection via the EVT1 register. Unfortunately, this turned out to be incorrect for the oldest Blackfin parts (BF533-0.2 and older and BF561). No one really noticed earlier because these parts usually are booted by bypassing the bootrom entirely, and older BF533 parts are not supported at all (too many anomalies). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-06Blackfin: recurse with early serial initcodeMike Frysinger
Make sure we recurse through serial_putc() rather than bang on the UART transmit register directly to avoid hardware overflows when using \n. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-04-06Blackfin: audit UART for all known anomaliesMike Frysinger
There is no code change here, just new comments, but this keeps me from having to do another audit from scratch in the future. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-04-06Blackfin: add check for anomaly 05000362Mike Frysinger
DESCRIPTION: The column address width settings for banks 2 and 3 are misconnected in the SDRAM controller. Accesses to bank 2 will result in an error if the Column Address Width for bank 3 (EB3CAW ) is not set to be the same as that of bank 2. WORKAROUND: If using bank 2, make sure that banks 2 and 3 have the same column address width settings in the EBIU_SDBCTL register. This must be the case regardless of whether or not bank 3 is enabled. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-04-06Blackfin: add comment about anomaly 05000430 avoidanceMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-04-06Blackfin: add workaround for anomaly 05000242Mike Frysinger
DESCRIPTION: If the DF bit is set prior to a hardware reset, the PLL will continue to divide CLKIN by 2 after the hardware reset, but the DF bit itself will be cleared in the PLL_CTL register. WORKAROUND: Reprogram the PLL with DF cleared if the desire is to not divide CLKIN by 2 after reset. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-04-06Blackfin: add workaround for anomaly 05000171Mike Frysinger
DESCRIPTION: The Boot ROM is executed at power up/reset and changes the value of the SICA_IWR registers from their default reset value of 0xFFFF, but does not restore them. WORKAROUND: User code should not rely on the default value of these registers. Set the desired values explicitly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-04-02Blackfin: do not delay on output bytesMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-04-02Blackfin: fix crash when booting from external memoryMike Frysinger
When testing a u-boot binary that hasn't been booted from the bootrom, we have to make sure the bootstruct structure has sane storage space. If we don't, the initcode will crash when it tries to dereference an invalid pointer. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-03-23Blackfin: put memory into self-refresh before/after programming clocksMike Frysinger
When initializing the core clocks, stick external memory into self-refresh. This gains us a few cool things: - support suspend-to-RAM with Linux - reprogram clocks automatically when doing "go" on u-boot.bin in RAM - make sure settings are stable before flashing new version - finally fully unify initialize startup code path between LDR/non-LDR Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-03-23Blackfin: do not program voltage regulator on parts that do not have oneMike Frysinger
Some newer Blackfins (like the BF51x) do not have an on-chip voltage regulator, so do not attempt to program the memory as if it does. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-03-23Blackfin: setup a sane default EBIU_SDBCTL for SDRAM controllersMike Frysinger
If the board config does not specify an explicit EBIU_SDBCTL value, set it up with sane values based on other configuration options. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-03-23Blackfin: handle reboot anomaly 432Mike Frysinger
Workaround anomaly 432: The bfrom_SysControl() firmware function does not clear the SIC_IWR1 register before executing the PLL programming sequence. Therefore, any interrupt enabled in the SIC_IWR1 register prior to the call to bfrom_SysControl() can prematurely terminate the idle sequence required for the PLL to relock properly. SIC_IWR0 is properly handled. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-03-23Blackfin: kill off LDR jump blockMike Frysinger
The Boot ROM uses EVT1 as the entry point so set that rather than having to use a tiny jump block in the default EVT1 location. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-03-23Blackfin: simplify symbol_lookup() a bitMike Frysinger
No need to skip a byte as the symbol table handles this. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-03-23Blackfin: mark bfin_reset staticMike Frysinger
The function is only used locally, so mark it static. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-03-23Blackfin: fix jtag console tstcMike Frysinger
The jtag tstc operation was checking the hardware to see if data is available from it (which is fine for the jtag getc operation), but the higher layers need to know whether any data is available. Since we have to read up to 4 bytes at a time from the hardware, the higher layers need to know they can consume the cached bytes as well. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-21Blackfin: disable syscontrol code for nowMike Frysinger
Looks like the initcode updates fell out of order during my merges. The patch that really fixes up this code is part of power-on overhaul and so is too large for merging at this point. Instead, we can disable the code as no currently in-tree board depends on it. The next merge window will fix things up properly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-05Blackfin: dynamically update UART speed when initializingMike Frysinger
Previously, booting over the UART required the baud rate to be known ahead of time. Using a bit of tricky simple math, we can calculate the new board rate based on the old divisors. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
2009-02-05Blackfin: add support for fast SPI reads with Boot ROMMike Frysinger
Newer Blackfin boot roms support using the fast SPI read command rather than just the slow one. If the functionality is available, then use it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-05Blackfin: check for reserved settings in DDR MMRsMike Frysinger
Some bits of the DDR MMRs should not be set. If they do, bad things may happen (like random failures or hardware destruction). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-05Blackfin: set default voltage levels for BF538/BF539 partsMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-05Blackfin: use on-chip syscontrol() rom function when availableMike Frysinger
Newer Blackfin's have an on-chip rom with a syscontrol() function that needs to be used to properly program the memory and voltage settings as it will include (possibly critical) factory tested bias values. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-02Blackfin: rewrite cache handling functionsMike Frysinger
Take the cache flush functions from the kernel as they use hardware loops in order to get optimal performance. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-02Blackfin: enable --gc-sectionsMike Frysinger
Start building all Blackfin boards with -ffunction-sections/-fdata-sections and linking with --gc-sections. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-02Blackfin: dont check baud if it wont actually get usedMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: fixup misc warnings such as printf's and missing castsMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: allow serial console to be disabledMike Frysinger
Some devices have no UART device pulled out, so allow people to disable the driver completely in favor of other methods (like JTAG-console). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: support console-over-JTAGMike Frysinger
The Blackfin JTAG has the ability to pass data via a back-channel without halting the processor. Utilize that channel to emulate a console. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: handle new anomalies with resetMike Frysinger
Workaround fun new anomalies related to software reset of the processor. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: pass RETX to LinuxMike Frysinger
Make sure we save the value of RETX at power on and then pass it on to the kernel so that it can nicely debug a "double-fault-caused-a-reset" crash. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: clarify relocation comment during initMike Frysinger
People often ask questions about the init process and when things go from flash to relocated base, so clarify the comments a bit. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: just set SP register directly during initMike Frysinger
No need to set the SP register indirectly to the configured value when it can be set directly. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: add portmuxing for UARTs on the BF51xMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: respect CONFIG_CLKIN_HALFMike Frysinger
As pointed out by Ivan Koryakovskiy, the initialization code was not actually respecting the CONFIG_CLKIN_HALF option when configuring the PLL_CTL register. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: use common memcpy routine during initMike Frysinger
Rather than using a local custom memcpy function, just call the existing optimized Blackfin version. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: overhaul i2c driverMike Frysinger
The current Blackfin i2c driver does not work properly with certain devices due to it breaking up transfers incorrectly. This is a rewrite of the driver and relocates it to the newer place in the source tree. Also remove duplicated I2C speed defines in Blackfin board configs and disable I2C slave address usage since it isn't implemented. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: fix dcache handling when doing dma memcpy'sMike Frysinger
Our dcache invalidate function doesn't just invalidate, it also flushes. So rename the function accordingly and fix the dma_memcpy() function so it doesn't inadvertently corrupt the data destination. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28Blackfin: minimize time cache is turned off when replacing cplb entriesMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-12-15i2c: merge all i2c_reg_read() and i2c_reg_write() into inline functionsTimur Tabi
All implementations of the functions i2c_reg_read() and i2c_reg_write() are identical. We can save space and simplify the code by converting these functions into inlines and putting them in i2c.h. Signed-off-by: Timur Tabi <timur@freescale.com> Acked-By: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-10-23Blackfin: fix up UART status bit handlingMike Frysinger
Some Blackfin UARTs are read-to-clear while others are write-to-clear. This can cause problems when we poll the LSR and then later try and handle any errors detected. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-10-23Blackfin: small cpu init optimization while setting interrupt maskMike Frysinger
Use the sti instruction to set the initial interrupt mask rather than banging on the core IMASK MMR to save both space and time. Signed-off-by: Mike Frysinger <vapier@gentoo.org>