From 68791a05fe74eb334e484afe06e61935db869087 Mon Sep 17 00:00:00 2001 From: Albert Herranz Date: Fri, 22 May 2009 19:30:33 +0200 Subject: [PATCH] sdhc: add ipc call IPC_SDHC_EXIT In some cases it is desirable to let the Broadway processor take complete control of hardware initially managed by 'mini'. Add a new IPC call to instruct 'mini' to relinquish control of the SD Host Controller. One immediate user of this IPC call is Linux on the Nintendo Wii which takes complete control of the SDHC hardware. Signed-off-by: Albert Herranz --- ipc.h | 1 + sdhc.c | 11 +++++++++++ sdhcvar.h | 1 + 3 files changed, 13 insertions(+) diff --git a/ipc.h b/ipc.h index bb3ca77..1071f08 100644 --- a/ipc.h +++ b/ipc.h @@ -77,6 +77,7 @@ Copyright (C) 2009 John Kelley // etc. #define IPC_SDHC_DISCOVER 0x0000 +#define IPC_SDHC_EXIT 0x0001 #define IPC_SDMMC_ACK 0x0000 #define IPC_SDMMC_READ 0x0001 diff --git a/sdhc.c b/sdhc.c index 336c0a3..5b072d9 100644 --- a/sdhc.c +++ b/sdhc.c @@ -1033,6 +1033,14 @@ void sdhc_init(void) // sdhc_host_found(&__softc, 0, 0x0d080000, 1); } +void sdhc_exit(void) +{ +#ifdef CAN_HAZ_IRQ + irq_disable(IRQ_SDHC); +#endif + sdhc_shutdown(&__softc); +} + #ifdef CAN_HAZ_IPC void sdhc_ipc(volatile ipc_request *req) { @@ -1040,6 +1048,9 @@ void sdhc_ipc(volatile ipc_request *req) case IPC_SDHC_DISCOVER: sdmmc_needs_discover((struct device *)req->args[0]); break; + case IPC_SDHC_EXIT: + sdhc_exit(); + ipc_post(req->code, req->tag, 0); } } #endif diff --git a/sdhcvar.h b/sdhcvar.h index d098a58..3398d09 100644 --- a/sdhcvar.h +++ b/sdhcvar.h @@ -57,6 +57,7 @@ void sdhc_power(int, void *); void sdhc_shutdown(void *); int sdhc_intr(void *); void sdhc_init(void); +void sdhc_exit(void); void sdhc_irq(void); #ifdef CAN_HAZ_IPC void sdhc_ipc(volatile ipc_request *req);