coreboot/src/cpu
David Hendricks c0c1dc29c1 armv7: replace read/write macros with inlines
This enables type checking for safety as to help prevent errors like
http://review.coreboot.org/#/c/3038/ . Now compilation fails if the
wrong type is passed into readb/readw/readl/writeb/writew/writel
or other macros in io.h.

This also deprecates readw/writew. The previous definition was 16-bits
which is incorrect since wordsize on ARMv7 is 32-bits and there was
only 1 instance of writew (#if 0'd anyway). Going forward we should
always use read{8,16,32} and write{8,16,32} where N specifies the
exact length rather than relying on ambiguous definition of wordsize.

Since many macros relied on __raw_*, which were basically the same
(minus data memory barrier instructions), this patch also gets rid
of __raw_*. There were parts of the code which ended up using these
macros consecutively, for example:
	setbits_le32(&regs->ch_cfg, SPI_CH_RST);
	clrbits_le32(&regs->ch_cfg, SPI_CH_RST);

In such cases the safe versions of readl() and writel() should be
used anyway.

Note: This also fixes two dubious casts as to avoid breaking
compilation.

Change-Id: I8850933f68ea3a9b615d00ebd422f7c242268f1c
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: http://review.coreboot.org/3045
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-04-30 18:09:26 -07:00
..
amd AMD: Drop six copies of wrmsr_amd and rdmsr_amd 2013-04-04 04:52:18 +02:00
armltd ARMV7: minor tweaks to inter-stage calling and payload handling. 2013-02-20 20:49:16 +01:00
intel haswell: Update ULT microcode to rev 'a' 2013-04-30 14:51:30 -07:00
samsung armv7: replace read/write macros with inlines 2013-04-30 18:09:26 -07:00
via GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
x86 smi: Update mainboard_smi_gpi() to have 32bit argument 2013-04-30 13:47:43 -07:00
Kconfig Minor Kconfig help text fix 2013-04-01 23:27:07 +02:00
Makefile.inc Fix microcode selection code 2013-02-27 21:01:53 +01:00