summaryrefslogtreecommitdiff
path: root/doc/README.displaying-bmps
diff options
context:
space:
mode:
authorNikita Kiryanov <nikita@compulab.co.il>2013-02-24 21:28:43 +0000
committerTom Rini <trini@ti.com>2013-03-11 11:06:09 -0400
commitc08804853361bb7c6e2f9e0cdcdc0b327f71fe35 (patch)
treec534705bdd53f50cdf361b5715b93aaa46a055ed /doc/README.displaying-bmps
parent48ec52910047e048a5857fdaf00679b85a952ec5 (diff)
downloadu-boot-c08804853361bb7c6e2f9e0cdcdc0b327f71fe35.tar.gz
u-boot-c08804853361bb7c6e2f9e0cdcdc0b327f71fe35.tar.bz2
u-boot-c08804853361bb7c6e2f9e0cdcdc0b327f71fe35.zip
lcd: implement a callback for splashimage
On some architectures certain values of splashimage will lead to a data abort exception. Document the problem, and implement a callback for splashimage to reject such values. Cc: Anatolij Gustschin <agust@denx.de> Cc: Wolfgang Denk <wd@denx.de> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Diffstat (limited to 'doc/README.displaying-bmps')
-rw-r--r--doc/README.displaying-bmps27
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/README.displaying-bmps b/doc/README.displaying-bmps
new file mode 100644
index 0000000000..331154166d
--- /dev/null
+++ b/doc/README.displaying-bmps
@@ -0,0 +1,27 @@
+If you are experiencing hangups/data-aborts when trying to display a BMP image,
+the following might be relevant to your situation...
+
+Some architectures cannot handle unaligned memory accesses, and an attempt to
+perform one will lead to a data abort. On such architectures it is necessary to
+make sure all data is properly aligned, and in many situations simply choosing
+a 32 bit aligned address is enough to ensure proper alignment. This is not
+always the case when dealing with data that has an internal layout such as a
+BMP image:
+
+BMP images have a header that starts with 2 byte-size fields followed by mostly
+32 bit fields. The packed struct that represents this header can be seen below:
+
+typedef struct bmp_header {
+ /* Header */
+ char signature[2];
+ __u32 file_size;
+ __u32 reserved;
+ __u32 data_offset;
+ ... etc
+} __attribute__ ((packed)) bmp_header_t;
+
+When placed in an aligned address such as 0x80a00000, char signature offsets
+the __u32 fields into unaligned addresses (in our example 0x80a00002,
+0x80a00006, and so on...). When these fields are accessed by U-Boot, a 32 bit
+access is generated at a non-32-bit-aligned address, causing a data abort.
+The proper alignment for BMP images is therefore: 32-bit-aligned-address + 2.