Files
OpenCellular/board/mccroskey/board.h
Anton Staaf 9ccfd4553e gpio: Replace duplication in gpio declarations with X-macro file
Previously each board.h and board.c contained an enum and an array
for gpio definitons that had to be manually kept in sync, with no
compiler assistance other than that their lengths matched.

This change adds a single gpio.inc file that declares all gpio's
that a board uses and is used as an X-macro include file to
generate both the gpio_signal enum and the gpio_list array.

Signed-off-by: Anton Staaf <robotboy@chromium.org>

BRANCH=none
TEST=make buildall -j

Change-Id: If9c9feca968619a59ff9f20701359bcb9374e4da
Reviewed-on: https://chromium-review.googlesource.com/205354
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
2014-06-26 02:43:01 +00:00

53 lines
1.3 KiB
C

/* Copyright (c) 2013 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.
*/
/* McCroskey board configuration */
#ifndef __BOARD_H
#define __BOARD_H
/* 48 MHz SYSCLK clock frequency */
#define CPU_CLOCK 48000000
/* Debug features */
/* TODO(crosbug.com/p/23494): turn off extra I2C debugging when it works */
#define CONFIG_I2C_DEBUG
#undef CONFIG_TASK_PROFILING
/* Features not present on this reference board */
#undef CONFIG_LID_SWITCH
/* Optional features */
#define CONFIG_BOARD_PRE_INIT
#define CONFIG_KEYBOARD_PROTOCOL_MKBP
/*
* TODO(crosbug.com/p/23494): Stop mode causes the UART to drop characters and
* likely other bad side-effects. Disable for now.
*/
#undef CONFIG_LOW_POWER_IDLE
#ifndef __ASSEMBLER__
/* Keyboard output ports */
#define KB_OUT_PORT_LIST GPIO_C
/* EC is I2C master */
#define I2C_PORT_MASTER 0
#define I2C_PORT_SLAVE 0 /* needed for DMAC macros (ugh) */
#define GPIO_I2C2_SCL 0 /* unused, but must be defined anyway */
#define GPIO_I2C2_SDA 0 /* unused, but must be defined anyway */
/* Timer selection */
#define TIM_CLOCK_MSB 3
#define TIM_CLOCK_LSB 4
#define TIM_WATCHDOG 1
#include "gpio_signal.h"
#endif /* !__ASSEMBLER__ */
#endif /* __BOARD_H */