coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
southbridge.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef AMD_CEZANNE_SOUTHBRIDGE_H
4 #define AMD_CEZANNE_SOUTHBRIDGE_H
5 
6 #include <soc/iomap.h>
7 
8 /* Power management registers: 0xfed80300 or index/data at IO 0xcd6/cd7 */
9 #define PM_ISACONTROL 0x04
10 #define ABCLKGATEEN BIT(16)
11 #define PM_PCI_CTRL 0x08
12 #define FORCE_SLPSTATE_RETRY BIT(25)
13 #define PWR_RESET_CFG 0x10
14 #define TOGGLE_ALL_PWR_GOOD (1 << 1)
15 #define PM_SERIRQ_CONF 0x54
16 #define PM_SERIRQ_NUM_BITS_17 0x0000
17 #define PM_SERIRQ_NUM_BITS_18 0x0004
18 #define PM_SERIRQ_NUM_BITS_19 0x0008
19 #define PM_SERIRQ_NUM_BITS_20 0x000c
20 #define PM_SERIRQ_NUM_BITS_21 0x0010
21 #define PM_SERIRQ_NUM_BITS_22 0x0014
22 #define PM_SERIRQ_NUM_BITS_23 0x0018
23 #define PM_SERIRQ_NUM_BITS_24 0x001c
24 #define PM_SERIRQ_MODE BIT(6)
25 #define PM_SERIRQ_ENABLE BIT(7)
26 #define PM_EVT_BLK 0x60
27 #define WAK_STS BIT(15) /*AcpiPmEvtBlkx00 Pm1Status */
28 #define PCIEXPWAK_STS BIT(14)
29 #define RTC_STS BIT(10)
30 #define PWRBTN_STS BIT(8)
31 #define GBL_STS BIT(5)
32 #define BM_STS BIT(4)
33 #define TIMER_STS BIT(0)
34 #define PCIEXPWAK_DIS BIT(14) /*AcpiPmEvtBlkx02 Pm1Enable */
35 #define RTC_EN BIT(10)
36 #define PWRBTN_EN BIT(8)
37 #define GBL_EN BIT(5)
38 #define TIMER_STS BIT(0)
39 #define PM1_CNT_BLK 0x62
40 #define PM_TMR_BLK 0x64
41 #define PM_GPE0_BLK 0x68
42 #define PM_ACPI_SMI_CMD 0x6a
43 #define PM_ACPI_CONF 0x74
44 #define PM_ACPI_DECODE_STD BIT(0)
45 #define PM_ACPI_GLOBAL_EN BIT(1)
46 #define PM_ACPI_RTC_EN_EN BIT(2)
47 #define PM_ACPI_SLPBTN_EN_EN BIT(3)
48 #define PM_ACPI_TIMER_EN_EN BIT(4)
49 #define PM_ACPI_MASK_ARB_DIS BIT(6)
50 #define PM_ACPI_BIOS_RLS BIT(7)
51 #define PM_ACPI_PWRBTNEN_EN BIT(8)
52 #define PM_ACPI_REDUCED_HW_EN BIT(9)
53 #define PM_ACPI_S5_LPC_PIN_MODE_SEL BIT(10)
54 #define PM_ACPI_S5_LPC_PIN_MODE BIT(11)
55 #define PM_ACPI_LPC_RST_DIS BIT(12)
56 #define PM_ACPI_SEL_PWRGD_PAD BIT(13)
57 #define PM_ACPI_SEL_SMU_THERMTRIP BIT(14)
58 #define PM_ACPI_SW_S5PWRMUX_OVRD_N BIT(15)
59 #define PM_ACPI_SW_S5PWRMUX BIT(16)
60 #define PM_ACPI_EN_SHUTDOWN_MSG BIT(17)
61 #define PM_ACPI_EN_SYNC_FLOOD BIT(18)
62 #define PM_ACPI_FORCE_SPIUSEPIN_0 BIT(19)
63 #define PM_ACPI_EN_DF_INTRWAKE BIT(20)
64 #define PM_ACPI_MASK_USB_S5_RST BIT(21)
65 #define PM_ACPI_USE_RSMU_RESET BIT(22)
66 #define PM_ACPI_RST_USB_S5 BIT(23)
67 #define PM_ACPI_BLOCK_PCIE_PME BIT(24)
68 #define PM_ACPI_PCIE_WAK_MASK BIT(25)
69 #define PM_ACPI_PCIE_WAK_INTR_DIS BIT(26)
70 #define PM_ACPI_WAKE_AS_GEVENT BIT(27)
71 #define PM_ACPI_NB_PME_GEVENT BIT(28)
72 #define PM_ACPI_RTC_WAKE_EN BIT(29)
73 #define PM_ACPI_USE_GATED_ALINK_CLK BIT(30)
74 #define PM_ACPI_DELAY_GPP_OFF_TIME BIT(31)
75 #define PM_SPI_PAD_PU_PD 0x90
76 #define PM_ESPI_CS_USE_DATA2 BIT(16)
77 #define PM_LPC_GATING 0xec
78 #define PM_LPC_AB_NO_BYPASS_EN BIT(2)
79 #define PM_LPC_A20_EN BIT(1)
80 #define PM_LPC_ENABLE BIT(0)
81 
82 #define PM1_LIMIT 16
83 #define GPE0_LIMIT 32
84 #define TOTAL_BITS(a) (8 * sizeof(a))
85 
86 #define FCH_LEGACY_UART_DECODE (ALINK_AHB_ADDRESS + 0x20) /* 0xfedc0020 */
87 
88 /* FCH MISC Registers 0xfed80e00 */
89 #define GPP_CLK_CNTRL 0x00
90 #define GPP_CLK0_REQ_SHIFT 0
91 #define GPP_CLK1_REQ_SHIFT 2
92 #define GPP_CLK4_REQ_SHIFT 4
93 #define GPP_CLK2_REQ_SHIFT 6
94 #define GPP_CLK3_REQ_SHIFT 8
95 #define GPP_CLK5_REQ_SHIFT 10
96 #define GPP_CLK6_REQ_SHIFT 12
97 #define GPP_CLK_OUTPUT_COUNT 7
98 #define GPP_CLK_REQ_MASK(clk_shift) (0x3 << (clk_shift))
99 #define GPP_CLK_REQ_ON(clk_shift) (0x3 << (clk_shift))
100 #define GPP_CLK_REQ_EXT(clk_shift) (0x1 << (clk_shift))
101 #define GPP_CLK_REQ_OFF(clk_shift) (0x0 << (clk_shift))
102 
103 #define MISC_CLKGATEDCNTL 0x2c
104 #define ALINKCLK_GATEOFFEN BIT(16)
105 #define BLINKCLK_GATEOFFEN BIT(17)
106 #define XTAL_PAD_S3_TURNOFF_EN BIT(20)
107 #define XTAL_PAD_S5_TURNOFF_EN BIT(21)
108 #define MISC_CGPLL_CONFIGURATION0 0x30
109 #define USB_PHY_CMCLK_S3_DIS BIT(8)
110 #define USB_PHY_CMCLK_S0I3_DIS BIT(9)
111 #define USB_PHY_CMCLK_S5_DIS BIT(10)
112 #define MISC_CLK_CNTL0 0x40 /* named MISC_CLK_CNTL1 on Picasso */
113 #define BP_X48M0_S0I3_DIS BIT(4)
114 #define BP_X48M0_OUTPUT_EN BIT(2) /* 1=En, unlike Hudson, Kern */
115 
116 void fch_pre_init(void);
117 void fch_early_init(void);
118 void fch_init(void *chip_info);
119 void fch_final(void *chip_info);
120 
121 void enable_aoac_devices(void);
122 void wait_for_aoac_enabled(unsigned int dev);
123 
124 #endif /* AMD_CEZANNE_SOUTHBRIDGE_H */
void fch_pre_init(void)
Definition: early_fch.c:35
void fch_init(void *chip_info)
Definition: fch.c:290
void enable_aoac_devices(void)
Definition: aoac.c:41
void fch_final(void *chip_info)
Definition: fch.c:304
void wait_for_aoac_enabled(unsigned int dev)
Definition: aoac.c:35
void fch_early_init(void)
Definition: early_fch.c:71