mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
Fix UART1 (x86 COMx output) on link proto0
Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7703 TEST=reboot; look for "Hello on UART1" message on UART1 (which is uart2 on servo) Change-Id: Ie497af48e62c28174b69adca5bea52d2f68d494f
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
@@ -28,7 +28,7 @@
|
||||
* KSI0 - KSI7 = PN0:7
|
||||
*
|
||||
* Other:
|
||||
* PWR_BTN# = PK7
|
||||
* PWR_BTN# = PK7 (handled by gpio module)
|
||||
*
|
||||
*
|
||||
* BDS board:
|
||||
@@ -40,7 +40,7 @@
|
||||
* Rows (inputs):
|
||||
* KSI0 - KSI7 = PH0:7
|
||||
* Other:
|
||||
* PWR_BTN# = PC5
|
||||
* PWR_BTN# = PC5 (handled by gpio module)
|
||||
*/
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ static uint8_t raw_state[KB_COLS];
|
||||
/* Mask with 1 bits only for keys that actually exist */
|
||||
static const uint8_t *actual_key_mask;
|
||||
|
||||
/* All actual key masks (todo: move to keyboard matrix definition */
|
||||
/* All actual key masks (todo: move to keyboard matrix definition) */
|
||||
/* TODO: (crosbug.com/p/7485) fill in real key mask with 0-bits for coords that
|
||||
aren't keys */
|
||||
static const uint8_t actual_key_masks[4][KB_COLS] = {
|
||||
@@ -142,18 +142,16 @@ int keyboard_scan_init(void)
|
||||
|
||||
/* Enable GPIOs */
|
||||
#ifdef BOARD_link
|
||||
/* Enable clock to GPIO modules C,H,K,N,P,Q */
|
||||
LM4_SYSTEM_RCGCGPIO |= 0x7284;
|
||||
/* Enable clock to GPIO modules N,P,Q */
|
||||
LM4_SYSTEM_RCGCGPIO |= 0x7000;
|
||||
#else
|
||||
/* Enable clock to GPIO modules C,H,K,N,Q */
|
||||
LM4_SYSTEM_RCGCGPIO |= 0x5284;
|
||||
#endif
|
||||
scratch = LM4_SYSTEM_RCGCGPIO;
|
||||
|
||||
/* Clear GPIOAFSEL and enable digital function for PC5, PH0:7,
|
||||
* PK0:3, PN2, PQ0:7. */
|
||||
LM4_GPIO_AFSEL(LM4_GPIO_C) &= ~0x20;
|
||||
LM4_GPIO_DEN(LM4_GPIO_C) |= 0x20;
|
||||
/* Clear GPIOAFSEL and enable digital function for PH0:7,
|
||||
* PK0:3, PN2, PQ0:7. Power button is just a GPIO now. */
|
||||
#ifdef BOARD_link
|
||||
LM4_GPIO_AFSEL(LM4_GPIO_N) &= 0xff; /* KSI[7:0] */
|
||||
LM4_GPIO_DEN(LM4_GPIO_N) |= 0xff;
|
||||
@@ -176,12 +174,6 @@ int keyboard_scan_init(void)
|
||||
LM4_GPIO_DIR(KB_SCAN_ROW_GPIO) = 0;
|
||||
LM4_GPIO_PUR(KB_SCAN_ROW_GPIO) = 0xff;
|
||||
|
||||
/* Set PC5 as input with pull-up. */
|
||||
/* TODO: no need for pull-up on real circuit, since it'll be
|
||||
* externally pulled up. */
|
||||
LM4_GPIO_DIR(LM4_GPIO_C) &= ~0x04;
|
||||
LM4_GPIO_PUR(LM4_GPIO_C) |= 0x04;
|
||||
|
||||
/* Tri-state the columns */
|
||||
select_column(COLUMN_TRI_STATE_ALL);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
@@ -159,7 +159,7 @@ static void configure_gpio(void)
|
||||
/* UART0 RX and TX are GPIO PA0:1 alternate function 1 */
|
||||
gpio_set_alternate_function(LM4_GPIO_A, 0x03, 1);
|
||||
/* UART1 RX and TX are GPIO PC4:5 alternate function 2 */
|
||||
gpio_set_alternate_function(LM4_GPIO_B, 0x03, 2);
|
||||
gpio_set_alternate_function(LM4_GPIO_C, 0x30, 2);
|
||||
#else
|
||||
/* UART0 RX and TX are GPIO PA0:1 alternate function 1 */
|
||||
gpio_set_alternate_function(LM4_GPIO_A, 0x03, 1);
|
||||
|
||||
Reference in New Issue
Block a user