summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorTorne Wuff <torne@wolfpuppy.org.uk>2010-02-01 17:16:39 +0000
committerTorne Wuff <torne@wolfpuppy.org.uk>2010-02-01 17:16:39 +0000
commitc4e051bed7318b413bb9ba881678041acbec5991 (patch)
tree73172a91e509788d41ffc8f75d5d6ba3af7b21fb /firmware
parenta09606123f4e8501dd527c48d493853435df2a0d (diff)
downloadrockbox-c4e051bed7318b413bb9ba881678041acbec5991.tar.gz
rockbox-c4e051bed7318b413bb9ba881678041acbec5991.zip
Align addresses in the buffering code to STORAGE_ALIGN_MASK if the target has one.
The PP502x DMA controller can only deal with doing DMA to 16-byte-aligned addresses because we have inadequate control over the cache to prevent interference. Other targets may also *prefer* cacheline aligned DMAs to reduce the number of cache operations required. Almost all disk reads in buffering.c will now be suitably aligned, allowing DMA to be used on PP502x. Original change from FS#9708 by Boris Gjenero (dreamlayers). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24440 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/config.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/firmware/export/config.h b/firmware/export/config.h
index f731fb5513..96fec57d7b 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -889,6 +889,22 @@ Lyre prototype 1 */
889 889
890#endif /* HAVE_USBSTACK */ 890#endif /* HAVE_USBSTACK */
891 891
892/* Storage alignment: the mask specifies a mask of bits which should be
893 * clear in addresses used for storage_{read,write}_sectors(). This is
894 * only relevant for buffers that will contain one or more whole sectors.
895 */
896
897/* PP502x DMA requires an alignment of at least 16 bytes */
898#ifdef HAVE_ATA_DMA
899#ifdef CPU_PP502x
900#define STORAGE_ALIGN_MASK 15
901#endif
902#endif /* HAVE_ATA_DMA */
903
904/* by default no alignment is required */
905#ifndef STORAGE_ALIGN_MASK
906#define STORAGE_ALIGN_MASK 0
907#endif
892 908
893 909
894#endif /* __CONFIG_H__ */ 910#endif /* __CONFIG_H__ */