| 1 |
|
| 2 |
|
| 3 |
#include <console/console.h> |
| 4 |
#include <device/device.h> |
| 5 |
#include <device/pci.h> |
| 6 |
#include <device/pci_ids.h> |
| 7 |
#include <reg_script.h> |
| 8 |
|
| 9 |
#include <soc/device_nvs.h> |
| 10 |
#include <soc/iosf.h> |
| 11 |
#include <soc/pci_devs.h> |
| 12 |
#include <soc/ramstage.h> |
| 13 |
#include "chip.h" |
| 14 |
|
| 15 |
static const struct reg_script emmc_ops[] = { |
| 16 |
|
| 17 |
REG_PCI_OR32(0xa8, (1 << 24)), |
| 18 |
|
| 19 |
REG_PCI_WRITE32(0xa0, 0x446cc801), |
| 20 |
REG_PCI_WRITE32(0xa4, 0x80000807), |
| 21 |
|
| 22 |
REG_IOSF_OR(IOSF_PORT_SCORE, 0x49c0, (1 << 3)), |
| 23 |
|
| 24 |
REG_IOSF_RMW(IOSF_PORT_CCU, 0x1c, ~(3 << 26), (1 << 26)), |
| 25 |
|
| 26 |
REG_IOSF_RMW(IOSF_PORT_SCORE, 0x48c0, ~0x3c, 0x3c), |
| 27 |
REG_IOSF_RMW(IOSF_PORT_SCORE, 0x48c4, ~0x3c, 0x3c), |
| 28 |
|
| 29 |
REG_RES_WRITE8(PCI_BASE_ADDRESS_0, 0x002e, 0x0e), |
| 30 |
REG_SCRIPT_END, |
| 31 |
}; |
| 32 |
|
| 33 |
static void emmc_init(struct device *dev) |
| 34 |
{ |
| 35 |
struct soc_intel_baytrail_config *config = config_of(dev); |
| 36 |
|
| 37 |
printk(BIOS_DEBUG, "eMMC init\n"); |
| 38 |
reg_script_run_on_dev(dev, emmc_ops); |
| 39 |
|
| 40 |
if (config->scc_acpi_mode) |
| 41 |
scc_enable_acpi_mode(dev, SCC_MMC_CTL, SCC_NVS_MMC); |
| 42 |
} |
| 43 |
|
| 44 |
static struct device_operations device_ops = { |
| 45 |
.read_resources = pci_dev_read_resources, |
| 46 |
.set_resources = pci_dev_set_resources, |
| 47 |
.enable_resources = pci_dev_enable_resources, |
| 48 |
.init = emmc_init, |
| 49 |
.ops_pci = &soc_pci_ops, |
| 50 |
}; |
| 51 |
|
| 52 |
static const struct pci_driver southcluster __pci_driver = { |
| 53 |
.ops = &device_ops, |
| 54 |
.vendor = PCI_VID_INTEL, |
| 55 |
.device = MMC45_DEVID, |
| 56 |
}; |