summaryrefslogtreecommitdiff
path: root/board/bds/board.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2011-12-12 15:39:07 -0800
committerRandall Spangler <rspangler@chromium.org>2011-12-13 09:50:53 -0800
commitcaba91fe2797f2e7a2792a151d337c20d080a950 (patch)
tree59165d9809476115709733cf0c333c8789481c23 /board/bds/board.c
parent1ce694189a847727e8eca53fbc324f67b92238e5 (diff)
downloadchrome-ec-caba91fe2797f2e7a2792a151d337c20d080a950.tar.gz
Change register.h macros to use inline funcs without concatenate (##).
Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=none Change-Id: Ia8c54bfeff2351e8f76d97db558952a9d2ca9a45
Diffstat (limited to 'board/bds/board.c')
-rw-r--r--board/bds/board.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/board/bds/board.c b/board/bds/board.c
index 88d528bf51..d9c79b675a 100644
--- a/board/bds/board.c
+++ b/board/bds/board.c
@@ -1,3 +1,7 @@
+/* Copyright (c) 2011 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.
+ */
/* Stellaris EKB-LM4F-EAC pins multiplexing */
#include "board.h"
@@ -15,24 +19,24 @@ void configure_board(void)
* pin 6 : GPIO = function 0 (SD card CS -- open drain)
* pin 7 : GPIO = function 0 (user LED)
*/
- LM4_GPIO_PCTL(A) = 0x00222211;
- LM4_GPIO_AFSEL(A) = 0x3f;
- LM4_GPIO_DEN(A) = 0xff;
- LM4_GPIO_PDR(A) = 0x00;
- LM4_GPIO_PUR(A) = 0x3c;
- LM4_GPIO_DIR(A) = 0xc0;
- LM4_GPIO_ODR(A) = 0x40;
- LM4_GPIO_DR2R(A) = 0xc3;
- LM4_GPIO_DR8R(A) = 0x3c;
- LM4_GPIO_DATA_BITS(A, 0x100) = 0x40;
- LM4_GPIO_DATA_BITS(A, 0x200) = 0;
+ LM4_GPIO_PCTL(LM4_GPIO_A) = 0x00222211;
+ LM4_GPIO_AFSEL(LM4_GPIO_A) = 0x3f;
+ LM4_GPIO_DEN(LM4_GPIO_A) = 0xff;
+ LM4_GPIO_PDR(LM4_GPIO_A) = 0x00;
+ LM4_GPIO_PUR(LM4_GPIO_A) = 0x3c;
+ LM4_GPIO_DIR(LM4_GPIO_A) = 0xc0;
+ LM4_GPIO_ODR(LM4_GPIO_A) = 0x40;
+ LM4_GPIO_DR2R(LM4_GPIO_A) = 0xc3;
+ LM4_GPIO_DR8R(LM4_GPIO_A) = 0x3c;
+ LM4_GPIO_DATA(LM4_GPIO_A, 0x40) = 0x40;
+ LM4_GPIO_DATA(LM4_GPIO_A, 0x80) = 0;
/* GPIOB muxing
* pin 0 : GPIO = function 0 (USB ID)
* pin 1 : USB digital (VBus sense)
*/
- LM4_GPIO_DEN(B) |= 0x01;
- LM4_GPIO_AFSEL(B)|= 0x01;
+ LM4_GPIO_DEN(LM4_GPIO_B) |= 0x01;
+ LM4_GPIO_AFSEL(LM4_GPIO_B) |= 0x01;
/* GPIOC muxing
* pins 0/1/2/3 : JTAG (default config)
@@ -40,24 +44,24 @@ void configure_board(void)
* pin 6 : USB digital (USB power enable)
* pin 7 : USB digital (USB current overflow)
*/
- LM4_GPIO_PCTL(C) = 0x88001111;
- LM4_GPIO_AFSEL(C) = 0xcf;
- LM4_GPIO_DEN(C) = 0xdf;
- LM4_GPIO_DIR(C) = 0x10;
- LM4_GPIO_DATA_BITS(C, 0x40) = 0;
+ LM4_GPIO_PCTL(LM4_GPIO_C) = 0x88001111;
+ LM4_GPIO_AFSEL(LM4_GPIO_C) = 0xcf;
+ LM4_GPIO_DEN(LM4_GPIO_C) = 0xdf;
+ LM4_GPIO_DIR(LM4_GPIO_C) = 0x10;
+ LM4_GPIO_DATA(LM4_GPIO_C, 0x10) = 0;
/* GPIOD muxing
* pins 0/1/2/3/4 : GPIO = function 0 (buttons up,down,left,right,select)
* pin 5 : GPIO = function 0 (OLED d/Cn)
* pin 6 : GPIO = function 0 (OLED reset)
*/
- LM4_GPIO_DEN(D) = 0x7f;
- LM4_GPIO_DIR(D) = 0x60;
- LM4_GPIO_PUR(D) = 0x1f;
+ LM4_GPIO_DEN(LM4_GPIO_D) = 0x7f;
+ LM4_GPIO_DIR(LM4_GPIO_D) = 0x60;
+ LM4_GPIO_PUR(LM4_GPIO_D) = 0x1f;
/* GPIOE muxing
* pin 3 : Analog function : AIN0 ADC (potentiometer)
* pin 6/7: USB analog
*/
- LM4_GPIO_AMSEL(E) = 0x8;
+ LM4_GPIO_AMSEL(LM4_GPIO_E) = 0x8;
}