mb/google/nissa: Create pujjogatwin variant
[coreboot2.git] / src / mainboard / amd / mandolin / mainboard.c
blobc044a81c89a9b017894622be69e8d994b29b9bd5
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>
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"
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[] = {
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 },
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);
49 return 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");
64 else
65 mainboard_program_emmc_gpios();
68 struct chip_operations mainboard_ops = {
69 .init = mainboard_init,