Commit Graph

36 Commits

Author SHA1 Message Date
Mike Frysinger f790ef6ff1 Blackfin: dynamically update UART speed when initializing
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-05 21:25:35 -05:00
Mike Frysinger 97f265f14f Blackfin: add support for fast SPI reads with Boot ROM
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-05 21:25:35 -05:00
Mike Frysinger 67619982bf Blackfin: check for reserved settings in DDR MMRs
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-05 21:25:35 -05:00
Mike Frysinger 622a8dc095 Blackfin: set default voltage levels for BF538/BF539 parts
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-05 21:25:34 -05:00
Mike Frysinger 09dc6b0bbd Blackfin: use on-chip syscontrol() rom function when available
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-05 21:25:28 -05:00
Mike Frysinger fdce83c108 Blackfin: rewrite cache handling functions
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-02 12:24:44 -05:00
Mike Frysinger 6957a6209b Blackfin: enable --gc-sections
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-02 12:24:40 -05:00
Mike Frysinger ee1d2001ea Blackfin: dont check baud if it wont actually get used
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-02 12:24:31 -05:00
Mike Frysinger fe033ad6d0 Blackfin: fixup misc warnings such as printf's and missing casts
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28 13:27:28 -05:00
Mike Frysinger 7633903bff Blackfin: allow serial console to be disabled
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-28 13:26:15 -05:00
Mike Frysinger 36ea8e9ad1 Blackfin: support console-over-JTAG
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-28 13:26:15 -05:00
Mike Frysinger cf8f2efb5f Blackfin: handle new anomalies with reset
Workaround fun new anomalies related to software reset of the processor.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28 13:26:15 -05:00
Mike Frysinger b1e9435b64 Blackfin: pass RETX to Linux
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-28 13:26:15 -05:00
Mike Frysinger b5eba3fafc Blackfin: clarify relocation comment during init
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-28 13:26:14 -05:00
Mike Frysinger 95433f6d43 Blackfin: just set SP register directly during init
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-28 13:26:14 -05:00
Mike Frysinger 51230e6e35 Blackfin: add portmuxing for UARTs on the BF51x
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28 13:26:14 -05:00
Mike Frysinger 4f6a313240 Blackfin: respect CONFIG_CLKIN_HALF
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-28 13:26:14 -05:00
Mike Frysinger dc2bfb0b58 Blackfin: use common memcpy routine during init
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-28 13:26:14 -05:00
Mike Frysinger be853bf86b Blackfin: overhaul i2c driver
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-28 13:26:13 -05:00
Mike Frysinger 05b75e4883 Blackfin: fix dcache handling when doing dma memcpy's
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-28 13:26:12 -05:00
Mike Frysinger 0332e4df71 Blackfin: minimize time cache is turned off when replacing cplb entries
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-28 13:26:10 -05:00
Timur Tabi ecf5f077c8 i2c: merge all i2c_reg_read() and i2c_reg_write() into inline functions
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-12-15 23:46:21 +01:00
Mike Frysinger f177f4250c Blackfin: fix up UART status bit handling
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-23 05:03:51 -04:00
Mike Frysinger bd33e5c613 Blackfin: small cpu init optimization while setting interrupt mask
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>
2008-10-23 05:03:51 -04:00
Mike Frysinger 960922291c Blackfin: set initial stack correctly according to Blackfin ABI
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-10-23 05:03:51 -04:00
Mike Frysinger 25cd33d82e Blackfin: make baud calculation more accurate
We should use the algorithm in the Linux kernel so that the UART divisor
calculation is more accurate.  It also fixes problems on some picky UARTs
that have sampling anomalies.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-10-23 05:03:51 -04:00
Mike Frysinger 0ba1da116e Blackfin: decode hwerrcause/excause when crashing
Having to decode hwerrcause/excause values is a pain, so automate it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-10-23 05:03:50 -04:00
Mike Frysinger 2de95bb20c Blackfin: fix register dump messages
Make sure we report RETI/IPEND correctly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-10-23 05:03:50 -04:00
Mike Frysinger 7133999e6f Blackfin: don't bother displaying reboot msg when crashing
The hang function already tells you to reboot, so no point in showing it
twice.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-10-23 05:03:50 -04:00
Mike Frysinger 70c4c032ea Blackfin: enable support for nested interrupts
During cpu init, make sure we initialize the CEC properly so that
interrupts can fire and be handled while U-Boot is running.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-10-23 05:03:50 -04:00
Mike Frysinger 2c1ea9e370 Blackfin: drop unused cache flush code
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-10-23 05:03:50 -04:00
Mike Frysinger 50f0d21191 Blackfin: unify cache handling code
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-10-23 05:03:50 -04:00
Mike Frysinger e4337968e4 Blackfin: only enable hardware error irq by default
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-10-23 05:03:50 -04:00
Jean-Christophe PLAGNIOL-VILLARD 6d0f6bcf33 rename CFG_ macros to CONFIG_SYS
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-10-18 21:54:03 +02:00
Wolfgang Denk 53677ef18e Big white-space cleanup.
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>
2008-05-21 00:14:08 +02:00
Mike Frysinger 9171fc8172 Blackfin: unify cpu and boot modes
All of the duplicated code for Blackfin processors and boot modes have been
unified.  After all, the core is the same for all processors, just the
peripheral set differs (which gets handled in the drivers).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-03-30 15:50:19 -04:00