aboutsummaryrefslogtreecommitdiff
path: root/platforms/mambo/mambo.c
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2016-12-21 15:52:26 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-01-04 17:15:34 +1100
commit8b00ce79a32f9a7dedd392f8a64a672fcbd8d1e0 (patch)
tree769f658d9255da2a00efb2b60962802cc70e2b27 /platforms/mambo/mambo.c
parent7edaf63587aace2729f70144d6ff5e9c3a3766c4 (diff)
downloadskiboot-8b00ce79a32f9a7dedd392f8a64a672fcbd8d1e0.zip
skiboot-8b00ce79a32f9a7dedd392f8a64a672fcbd8d1e0.tar.gz
skiboot-8b00ce79a32f9a7dedd392f8a64a672fcbd8d1e0.tar.bz2
mambo: move callouts into separate header file
This just moves the mambo callout handlers into a private header file so we don't have to continue junking up the main platform file. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'platforms/mambo/mambo.c')
-rw-r--r--platforms/mambo/mambo.c41
1 files changed, 2 insertions, 39 deletions
diff --git a/platforms/mambo/mambo.c b/platforms/mambo/mambo.c
index 663164d..659d1ba 100644
--- a/platforms/mambo/mambo.c
+++ b/platforms/mambo/mambo.c
@@ -24,6 +24,8 @@
#include <time-utils.h>
#include <time.h>
+#include "mambo.h"
+
static bool mambo_probe(void)
{
if (!dt_find_by_path(dt_root, "/mambo"))
@@ -32,35 +34,6 @@ static bool mambo_probe(void)
return true;
}
-static inline unsigned long callthru0(int command)
-{
- register uint64_t c asm("r3") = command;
- asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c));
- return (c);
-}
-
-static inline unsigned long callthru2(int command, unsigned long arg1,
- unsigned long arg2)
-{
- register unsigned long c asm("r3") = command;
- register unsigned long a1 asm("r4") = arg1;
- register unsigned long a2 asm("r5") = arg2;
- asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2));
- return (c);
-}
-
-static inline unsigned long callthru3(int command, unsigned long arg1,
- unsigned long arg2, unsigned long arg3)
-{
- register unsigned long c asm("r3") = command;
- register unsigned long a1 asm("r4") = arg1;
- register unsigned long a2 asm("r5") = arg2;
- register unsigned long a3 asm("r6") = arg3;
- asm volatile (".long 0x000eaeb0":"=r" (c):"r"(c), "r"(a1), "r"(a2),
- "r"(a3));
- return (c);
-}
-
#define BD_INFO_SYNC 0
#define BD_INFO_STATUS 1
#define BD_INFO_BLKSZ 2
@@ -69,16 +42,6 @@ static inline unsigned long callthru3(int command, unsigned long arg1,
#define BD_SECT_SZ 512
-/* Mambo callthru commands */
-#define SIM_WRITE_CONSOLE_CODE 0
-#define SIM_EXIT_CODE 31
-#define SIM_READ_CONSOLE_CODE 60
-#define SIM_GET_TIME_CODE 70
-#define SIM_CALL_TCL 86
-#define SIM_BOGUS_DISK_READ 116
-#define SIM_BOGUS_DISK_WRITE 117
-#define SIM_BOGUS_DISK_INFO 118
-
static inline int callthru_disk_read(int id, void *buf, unsigned long sect,
unsigned long nrsect)
{