summaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/files/arch/rlx/bsp/rlxhack.h
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/realtek/files/arch/rlx/bsp/rlxhack.h')
-rw-r--r--target/linux/realtek/files/arch/rlx/bsp/rlxhack.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/target/linux/realtek/files/arch/rlx/bsp/rlxhack.h b/target/linux/realtek/files/arch/rlx/bsp/rlxhack.h
new file mode 100644
index 000000000..5d7d87433
--- /dev/null
+++ b/target/linux/realtek/files/arch/rlx/bsp/rlxhack.h
@@ -0,0 +1,21 @@
+#ifndef __RLXHACK_H
+#define __RLXHACK_H
+
+/*
+ * Register access macro
+ */
+
+#define REG32(reg) (*(volatile unsigned int *)((unsigned int)reg))
+#define REG16(reg) (*(volatile unsigned short *)((unsigned int)reg))
+#define REG08(reg) (*(volatile unsigned char *)((unsigned int)reg))
+#define REG8(reg) (*(volatile unsigned char *)((unsigned int)reg))
+
+#define WRITE_MEM32(addr, val) (*(volatile unsigned int *) (addr)) = (val)
+#define READ_MEM32(addr) (*(volatile unsigned int *) (addr))
+#define WRITE_MEM16(addr, val) (*(volatile unsigned short *) (addr)) = (val)
+#define READ_MEM16(addr) (*(volatile unsigned short *) (addr))
+#define WRITE_MEM8(addr, val) (*(volatile unsigned char *) (addr)) = (val)
+#define READ_MEM8(addr) (*(volatile unsigned char *) (addr))
+
+
+#endif