1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <amdblocks/acpi.h>
4 #include <console/console.h>
5 #include <device/device.h>
6 #include <amdblocks/amd_pci_util.h>
9 #include <soc/southbridge.h>
10 #include <soc/pci_devs.h>
13 #include <commonlib/helpers.h>
14 #include <soc/amd/picasso/chip.h>
17 /* TODO: recheck IRQ tables */
19 /* The IRQ mapping in fch_irq_map ends up getting written to the indirect address space that is
20 accessed via I/O ports 0xc00/0xc01. */
21 static const struct fch_irq_routing fch_irq_map
[] = {
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 },
33 { PIRQ_I2C3
, 14, 14 },
39 /* The MISC registers are not interrupt numbers */
40 { PIRQ_MISC
, 0xfa, 0x00 },
41 { PIRQ_MISC0
, 0x91, 0x00 },
42 { PIRQ_MISC1
, 0x00, 0x00 },
43 { PIRQ_MISC2
, 0x00, 0x00 },
46 const struct fch_irq_routing
*mb_get_fch_irq_mapping(size_t *length
)
48 *length
= ARRAY_SIZE(fch_irq_map
);
52 static void mainboard_init(void *chip_info
)
54 struct soc_amd_picasso_config
*cfg
= config_of_soc();
56 if (!CONFIG(MANDOLIN_LPC
))
57 cfg
->emmc_config
.timing
= SD_EMMC_EMMC_HS400
;
59 mainboard_program_gpios();
61 /* Re-muxing LPCCLK0 can hang the system if LPC is in use. */
62 if (CONFIG(MANDOLIN_LPC
))
63 printk(BIOS_INFO
, "eMMC not available due to LPC requirement\n");
65 mainboard_program_emmc_gpios();
68 struct chip_operations mainboard_ops
= {
69 .init
= mainboard_init
,