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 <albert_herranz@yahoo.es>
This commit is contained in:
Albert Herranz 2009-05-22 19:30:33 +02:00 committed by bushing
parent 950adf002f
commit 68791a05fe
3 changed files with 13 additions and 0 deletions

1
ipc.h
View File

@ -77,6 +77,7 @@ Copyright (C) 2009 John Kelley <wiidev@kelley.ca>
// etc.
#define IPC_SDHC_DISCOVER 0x0000
#define IPC_SDHC_EXIT 0x0001
#define IPC_SDMMC_ACK 0x0000
#define IPC_SDMMC_READ 0x0001

11
sdhc.c
View File

@ -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

View File

@ -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);