static void wii_machine_kexec(struct kimage *image)
{
	local_irq_disable();

#ifdef CONFIG_STARLET_IOS
	/*
	 * Reload IOS to make sure that I/O resources are freed before
	 * the final kexec phase.
	 */
	if (starlet_get_ipc_flavour() == STARLET_IPC_IOS)
		starlet_es_reload_ios_and_discard();
#endif

	default_machine_kexec(image);
}
static int __devinit sdhci_hlwd_probe(struct of_device *ofdev,
				      const struct of_device_id *match)
{
	struct device_node *np = ofdev->node;
	struct sdhci_hlwd_data *sdhci_hlwd_data = match->data;
	struct sdhci_host *host;
	struct sdhci_hlwd_host *hlwd_host;
	struct resource res;
	int error;

	if (starlet_get_ipc_flavour() != STARLET_IPC_MINI) {
		error = -ENODEV;
		goto out;
	}

	if (!of_device_is_available(np)) {
		error = -ENODEV;
		goto out;
	}

	host = sdhci_alloc_host(&ofdev->dev, sizeof(*hlwd_host));
	if (!host) {
		DBG("unable to allocate sdhci_host\n");
		error = -ENODEV;
		goto out;
	}

	dev_set_drvdata(&ofdev->dev, host);

	error = of_address_to_resource(np, 0, &res);
	if (error) {
		DBG("of_address_to_resource failed (%d)\n", error);
		goto err_no_address;
	}

	host->ioaddr = ioremap(res.start, resource_size(&res));
	if (!host->ioaddr) {
		DBG("ioremap failed\n");
		error = -EINVAL;
		goto err_ioremap;
	}

	host->irq = irq_of_parse_and_map(np, 0);
	if (!host->irq) {
		DBG("irq_of_parse_and_map failed\n");
		error = -EINVAL;
		goto err_no_irq;
	}

	host->hw_name = dev_name(&ofdev->dev);
	if (sdhci_hlwd_data) {
		host->quirks = sdhci_hlwd_data->quirks;
		host->ops = &sdhci_hlwd_data->ops;
	}

	error = sdhci_add_host(host);
	if (error) {
		DBG("sdhci_add_host failed\n");
		goto err_add_host;
	}

	return 0;

err_add_host:
	irq_dispose_mapping(host->irq);
err_no_irq:
	iounmap(host->ioaddr);
err_ioremap:
err_no_address:
	sdhci_free_host(host);
out:
	return error;
}
static int __devinit
ehci_hcd_hlwd_probe(struct of_device *op, const struct of_device_id *match)
{
	struct device_node *dn = op->node;
	struct usb_hcd *hcd;
	struct ehci_hcd	*ehci = NULL;
	struct resource res;
	dma_addr_t coherent_mem_addr;
	size_t coherent_mem_size;
	int irq;
	int error = -ENODEV;

	if (usb_disabled())
		goto out;

	if (starlet_get_ipc_flavour() != STARLET_IPC_MINI)
		goto out;

	dev_dbg(&op->dev, "initializing " DRV_MODULE_NAME " USB Controller\n");

	error = of_address_to_resource(dn, 0, &res);
	if (error)
		goto out;

	hcd = usb_create_hcd(&ehci_hlwd_hc_driver, &op->dev, DRV_MODULE_NAME);
	if (!hcd) {
		error = -ENOMEM;
		goto out;
	}

	hcd->rsrc_start = res.start;
	hcd->rsrc_len = resource_size(&res);

	error = of_address_to_resource(dn, 1, &res);
	if (error) {
		/* satisfy coherent memory allocations from mem1 or mem2 */
		dev_warn(&op->dev, "using normal memory\n");
	} else {
		coherent_mem_addr = res.start;
		coherent_mem_size = res.end - res.start + 1;
		if (!dma_declare_coherent_memory(&op->dev, coherent_mem_addr,
						 coherent_mem_addr,
						 coherent_mem_size,
						 DMA_MEMORY_MAP |
						 DMA_MEMORY_EXCLUSIVE)) {
			dev_err(&op->dev, "error declaring %u bytes of"
				" coherent memory at 0x%p\n",
				coherent_mem_size, (void *)coherent_mem_addr);
			error = -EBUSY;
			goto err_decl_coherent;
		}
	}

	irq = irq_of_parse_and_map(dn, 0);
	if (irq == NO_IRQ) {
		printk(KERN_ERR __FILE__ ": irq_of_parse_and_map failed\n");
		error = -EBUSY;
		goto err_irq;
	}

	hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
	if (!hcd->regs) {
		printk(KERN_ERR __FILE__ ": ioremap failed\n");
		error = -EBUSY;
		goto err_ioremap;
	}

	ehci = hcd_to_ehci(hcd);
	ehci->caps = hcd->regs;
	ehci->regs = hcd->regs +
			HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase));

	/* cache this readonly data; minimize chip reads */
	ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);

	error = usb_add_hcd(hcd, irq, 0);
	if (error == 0)
		return 0;

	iounmap(hcd->regs);
err_ioremap:
	irq_dispose_mapping(irq);
err_irq:
	dma_release_declared_memory(&op->dev);
err_decl_coherent:
	usb_put_hcd(hcd);
out:
	return error;
}