| 1 |
|
| 2 |
|
| 3 |
#include <amdblocks/acpi.h> |
| 4 |
#include <console/console.h> |
| 5 |
#include <device/device.h> |
| 6 |
#include <amdblocks/amd_pci_util.h> |
| 7 |
#include <FspsUpd.h> |
| 8 |
#include <soc/cpu.h> |
| 9 |
#include <soc/southbridge.h> |
| 10 |
#include <soc/pci_devs.h> |
| 11 |
#include <static.h> |
| 12 |
#include <types.h> |
| 13 |
#include <commonlib/helpers.h> |
| 14 |
#include <soc/amd/picasso/chip.h> |
| 15 |
#include "gpio.h" |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
static const struct fch_irq_routing fch_irq_map[] = { |
| 22 |
{ PIRQ_A, 8, 16 }, |
| 23 |
{ PIRQ_B, 10, 17 }, |
| 24 |
{ PIRQ_C, 11, 18 }, |
| 25 |
{ PIRQ_D, 12, 19 }, |
| 26 |
{ PIRQ_SCI, ACPI_SCI_IRQ, ACPI_SCI_IRQ }, |
| 27 |
{ PIRQ_SD, PIRQ_NC, 16 }, |
| 28 |
{ PIRQ_SDIO, PIRQ_NC, 16 }, |
| 29 |
{ PIRQ_SATA, PIRQ_NC, 19 }, |
| 30 |
{ PIRQ_EMMC, PIRQ_NC, 17 }, |
| 31 |
{ PIRQ_GPIO, 7, 7 }, |
| 32 |
{ PIRQ_I2C2, 6, 6 }, |
| 33 |
{ PIRQ_I2C3, 14, 14 }, |
| 34 |
{ PIRQ_UART0, 4, 4 }, |
| 35 |
{ PIRQ_UART1, 3, 3 }, |
| 36 |
{ PIRQ_UART2, 4, 4 }, |
| 37 |
{ PIRQ_UART3, 3, 3 }, |
| 38 |
|
| 39 |
|
| 40 |
{ PIRQ_MISC, 0xfa, 0x00 }, |
| 41 |
{ PIRQ_MISC0, 0x91, 0x00 }, |
| 42 |
{ PIRQ_MISC1, 0x00, 0x00 }, |
| 43 |
{ PIRQ_MISC2, 0x00, 0x00 }, |
| 44 |
}; |
| 45 |
|
| 46 |
const struct fch_irq_routing *mb_get_fch_irq_mapping(size_t *length) |
| 47 |
{ |
| 48 |
*length = ARRAY_SIZE(fch_irq_map); |
| 49 |
return fch_irq_map; |
| 50 |
} |
| 51 |
|
| 52 |
static void mainboard_init(void *chip_info) |
| 53 |
{ |
| 54 |
struct soc_amd_picasso_config *cfg = config_of_soc(); |
| 55 |
|
| 56 |
if (!CONFIG(MANDOLIN_LPC)) |
| 57 |
cfg->emmc_config.timing = SD_EMMC_EMMC_HS400; |
| 58 |
|
| 59 |
mainboard_program_gpios(); |
| 60 |
|
| 61 |
|
| 62 |
if (CONFIG(MANDOLIN_LPC)) |
| 63 |
printk(BIOS_INFO, "eMMC not available due to LPC requirement\n"); |
| 64 |
else |
| 65 |
mainboard_program_emmc_gpios(); |
| 66 |
} |
| 67 |
|
| 68 |
struct chip_operations mainboard_ops = { |
| 69 |
.init = mainboard_init, |
| 70 |
}; |