blob: 36cd1c143957b51c269bfe23001aa0a27908c1f3 [file] [log] [blame]
Lee Leahy5cb9dda2015-05-01 10:34:54 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 Google Inc.
5 * Copyright (C) 2015 Intel Corp.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Lee Leahy5cb9dda2015-05-01 10:34:54 -070015 */
16
17#include <arch/io.h>
18#include <soc/gpio.h>
19#include <soc/lpc.h>
20#include <soc/pci_devs.h>
21#include <soc/romstage.h>
22
23/*
24 * return family number and internal pad number in that community
25 * by pad number and which community it is in.
26 */
27
28
29
30 /* family number in high byte and inner pad number in lowest byte */
31
Aaron Durbine6af4be2015-09-24 12:26:31 -050032void car_mainboard_pre_console_init(void)
Lee Leahy5cb9dda2015-05-01 10:34:54 -070033{
34 uint32_t reg;
35 uint32_t *pad_config_reg;
36
37 /* Enable the UART hardware for COM1. */
38 reg = 1;
39 pci_write_config32(PCI_DEV(0, LPC_DEV, 0), UART_CONT, reg);
40
41 /*
42 * Set up the pads to select the UART function
43 * AD12 SW16(UART1_DATAIN/UART0_DATAIN) - Setting Mode 2 for UART0_RXD
44 * AD10 SW20(UART1_DATAOUT/UART0_DATAOUT) - Setting Mode 2 for UART0_TXD
45 */
46 pad_config_reg = gpio_pad_config_reg(GP_SOUTHWEST, UART1_RXD_PAD);
47 write32(pad_config_reg, SET_PAD_MODE_SELECTION(PAD_CONFIG0_DEFAULT0,
48 M2));
49
50 pad_config_reg = gpio_pad_config_reg(GP_SOUTHWEST, UART1_TXD_PAD);
51 write32(pad_config_reg, SET_PAD_MODE_SELECTION(PAD_CONFIG0_DEFAULT0,
52 M2));
53}