| 1 |
|
| 2 |
|
| 3 |
#include <bootstate.h> |
| 4 |
#include <cf9_reset.h> |
| 5 |
#include <device/pci_def.h> |
| 6 |
#include <device/pci_ids.h> |
| 7 |
#include <device/pci_ops.h> |
| 8 |
#include <gpio.h> |
| 9 |
#include <hwilib.h> |
| 10 |
#include <intelblocks/lpc_lib.h> |
| 11 |
#include <intelblocks/pcr.h> |
| 12 |
#include <soc/pcr_ids.h> |
| 13 |
#include <baseboard/variants.h> |
| 14 |
#include <types.h> |
| 15 |
|
| 16 |
#define TX_DWORD3_P0 0xc8c |
| 17 |
#define TX_SWING_MASK 0x00ff0000 |
| 18 |
|
| 19 |
void variant_mainboard_final(void) |
| 20 |
{ |
| 21 |
struct device *dev = NULL; |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
pcr_write16(PID_ITSS, 0x314c, 0x0321); |
| 26 |
|
| 27 |
|
| 28 |
lpc_enable_pci_clk_cntl(); |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
pcr_or32(PID_LPC, PCR_LPC_PRC, (PCR_LPC_CCE_EN | PCR_LPC_PCE_EN)); |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
pcr_rmw32(PID_MODPHY, TX_DWORD3_P0, ~TX_SWING_MASK, 0x5a << 16); |
| 45 |
|
| 46 |
|
| 47 |
dev = dev_find_device(PCI_VID_SIEMENS, 0x403e, 0); |
| 48 |
if (dev) { |
| 49 |
if (CONFIG(PCI_ALLOW_BUS_MASTER_ANY_DEVICE)) |
| 50 |
pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER); |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
struct device *parent = dev->upstream->dev; |
| 55 |
if (parent && parent->device == PCI_DID_TI_XIO2001) |
| 56 |
pci_write_config8(parent, 0xd8, 0x0f); |
| 57 |
} |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
dev = dev_find_device(PCI_VID_SIEMENS, 0x403f, 0); |
| 62 |
if (dev) { |
| 63 |
struct device *parent = dev->upstream->dev; |
| 64 |
if (parent && parent->device == PCI_DID_TI_XIO2001) |
| 65 |
pci_write_config8(parent, 0xd8, 0x3e); |
| 66 |
} |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
outb(FULL_RST, RST_CNT); |
| 72 |
} |
| 73 |
|
| 74 |
static void finalize_boot(void *unused) |
| 75 |
{ |
| 76 |
|
| 77 |
gpio_output(CNV_RGI_DT, 1); |
| 78 |
} |
| 79 |
|
| 80 |
BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, finalize_boot, NULL); |