Skip to content

Commit 68791a0

Browse files
herraa1bushing
authored andcommitted
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 <[email protected]>
1 parent 950adf0 commit 68791a0

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

ipc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Copyright (C) 2009 John Kelley <[email protected]>
7777
// etc.
7878

7979
#define IPC_SDHC_DISCOVER 0x0000
80+
#define IPC_SDHC_EXIT 0x0001
8081

8182
#define IPC_SDMMC_ACK 0x0000
8283
#define IPC_SDMMC_READ 0x0001

sdhc.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,13 +1033,24 @@ void sdhc_init(void)
10331033
// sdhc_host_found(&__softc, 0, 0x0d080000, 1);
10341034
}
10351035

1036+
void sdhc_exit(void)
1037+
{
1038+
#ifdef CAN_HAZ_IRQ
1039+
irq_disable(IRQ_SDHC);
1040+
#endif
1041+
sdhc_shutdown(&__softc);
1042+
}
1043+
10361044
#ifdef CAN_HAZ_IPC
10371045
void sdhc_ipc(volatile ipc_request *req)
10381046
{
10391047
switch (req->req) {
10401048
case IPC_SDHC_DISCOVER:
10411049
sdmmc_needs_discover((struct device *)req->args[0]);
10421050
break;
1051+
case IPC_SDHC_EXIT:
1052+
sdhc_exit();
1053+
ipc_post(req->code, req->tag, 0);
10431054
}
10441055
}
10451056
#endif

sdhcvar.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ void sdhc_power(int, void *);
5757
void sdhc_shutdown(void *);
5858
int sdhc_intr(void *);
5959
void sdhc_init(void);
60+
void sdhc_exit(void);
6061
void sdhc_irq(void);
6162
#ifdef CAN_HAZ_IPC
6263
void sdhc_ipc(volatile ipc_request *req);

0 commit comments

Comments
 (0)