mainboard/intel/avenuecity_crb: Update full IIO configuration
[coreboot2.git] / src / mainboard / amd / birman / mainboard.c
blobf2d3ef9e5337325ad942bea46ab7e0e588d03616
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <amdblocks/acpi.h>
4 #include <amdblocks/amd_pci_util.h>
5 #include <commonlib/helpers.h>
6 #include <device/device.h>
7 #include <types.h>
8 #include "gpio.h"
9 #include "update_devicetree.h"
11 /* TODO: Update for birman */
13 /* The IRQ mapping in fch_irq_map ends up getting written to the indirect address space that is
14 accessed via I/O ports 0xc00/0xc01. */
17 * This controls the device -> IRQ routing.
19 * Hardcoded IRQs:
20 * 0: timer < soc/amd/common/acpi/lpc.asl
21 * 1: i8042 - Keyboard
22 * 2: cascade
23 * 8: rtc0 <- soc/amd/common/acpi/lpc.asl
24 * 9: acpi <- soc/amd/common/acpi/lpc.asl
26 static const struct fch_irq_routing fch_irq_map[] = {
27 { PIRQ_A, 12, PIRQ_NC },
28 { PIRQ_B, 14, PIRQ_NC },
29 { PIRQ_C, 15, PIRQ_NC },
30 { PIRQ_D, 12, PIRQ_NC },
31 { PIRQ_E, 14, PIRQ_NC },
32 { PIRQ_F, 15, PIRQ_NC },
33 { PIRQ_G, 12, PIRQ_NC },
34 { PIRQ_H, 14, PIRQ_NC },
36 { PIRQ_SCI, ACPI_SCI_IRQ, ACPI_SCI_IRQ },
37 { PIRQ_SDIO, PIRQ_NC, PIRQ_NC },
38 { PIRQ_GPIO, 11, 11 },
39 { PIRQ_I2C0, 10, 10 },
40 { PIRQ_I2C1, 7, 7 },
41 { PIRQ_I2C2, 6, 6 },
42 { PIRQ_I2C3, 5, 5 },
43 { PIRQ_UART0, 4, 4 },
44 { PIRQ_UART1, 3, 3 },
46 /* The MISC registers are not interrupt numbers */
47 { PIRQ_MISC, 0xfa, 0x00 },
48 { PIRQ_MISC0, 0x91, 0x00 },
49 { PIRQ_HPET_L, 0x00, 0x00 },
50 { PIRQ_HPET_H, 0x00, 0x00 },
53 const struct fch_irq_routing *mb_get_fch_irq_mapping(size_t *length)
55 *length = ARRAY_SIZE(fch_irq_map);
56 return fch_irq_map;
59 static void mainboard_init(void *chip_info)
61 mainboard_program_gpios();
63 if (CONFIG(BOARD_AMD_BIRMAN_PHOENIX_OPENSIL))
64 mainboard_update_devicetree_opensil();
67 struct chip_operations mainboard_ops = {
68 .init = mainboard_init,