summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJuergen Beisert <j.beisert@pengutronix.de>2009-07-31 13:07:36 +0200
committerJuergen Beisert <j.beisert@pengutronix.de>2009-07-31 13:24:43 +0200
commitc54abdc4f797845a5c3727136f871f701f3591b7 (patch)
treeea5d968e3dc813e3cae8f3003c81d02390224bb1 /arch
parentb8b205c72b4ed7e7a195a819b431157686a6eef5 (diff)
downloadbarebox-c54abdc4f797845a5c3727136f871f701f3591b7.tar.gz
barebox-c54abdc4f797845a5c3727136f871f701f3591b7.tar.xz
Add the IO API documentation for all architectures. First try.
Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/architecture.dox80
1 files changed, 80 insertions, 0 deletions
diff --git a/arch/architecture.dox b/arch/architecture.dox
index 94360989cf..6ef5ba928d 100644
--- a/arch/architecture.dox
+++ b/arch/architecture.dox
@@ -90,4 +90,84 @@ TODO
*/
+/** @page io_access_functions I/O access functions
+List of functions to be used for hardware register access (I/O).
+
+@section native_access Native IN/OUT access
+
+@note Native means: It uses the same endianess than the CPU.
+
+@subsection single_native_access Single access of various width
+
+The following functions are intended to be used for a single I/O access.
+
+To read a byte (8 bit) from a specific I/O address:
+@code
+uint8_t readb(unsigned long)
+@endcode
+
+To read a word (16 bit) from a specific I/O address:
+@code
+uint16_t readw(unsigned long)
+@endcode
+
+To read a long word (32 bit) from a specific I/O address:
+@code
+uint32_t readl(unsigned long)
+@endcode
+
+To write a byte (8 bit) into a specific I/O address:
+@code
+void writeb(uint8_t val, unsigned long)
+@endcode
+
+To write a word (16 bit) into a specific I/O address:
+@code
+void writew(uint16_t val, unsigned long)
+@endcode
+
+To write a long word (32 bit) into a specific I/O address:
+@code
+void writel(uint32_t val, unsigned long)
+@endcode
+
+@subsection string_native_access String native access of various width
+
+The following functions are intended to be used for string based I/O access.
+
+To read a string of bytes (8 bit) from one specific I/O address:
+@code
+void readsb(const void __iomem *addr, void *mem_buffer, int byte_count);
+@endcode
+
+To read a string of words (16 bit) from one specific I/O address:
+@code
+void readsw(const void __iomem *addr, void *mem_buffer, int word_count);
+@endcode
+
+To read a string of long words (32 bit) from one specific I/O address:
+@code
+void readsl(const void __iomem *addr, void *mem_buffer, int long_count);
+@endcode
+
+To write a string of bytes (8 bit) to one specific I/O address:
+@code
+void writesb(void __iomem *addr, const void *mem_buffer, int byte_count);
+@endcode
+
+To write a string of words (16 bit) to one specific I/O address:
+@code
+void writesw(void __iomem *addr, const void *mem_buffer, int word_count);
+@endcode
+
+To write a string of long words (32 bit) to one specific I/O address:
+@code
+void writesl(void __iomem *addr, const void *mem_buffer, int long_count);
+@endcode
+
+@section special_access Special IN/OUT access
+
+TBD
+
+*/