mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
oak: use EXTRA_CLFAGS instead of CONFIG_BOARD_OAK_REV
Oak board revisions are not global configs. Move them out of
include/config.h . This change also makes it easier to build EC
and PD image for different board revisions.
BRANCH=none
BUG=none
TEST=manual
build for board revision n and load on oak:
make BOARD=oak clean
make BOARD=oak_pd claen
make EXTRA_CFLAGS=-DBOARD_REV=n BOARD=oak -j
make EXTRA_CFLAGS=-DBOARD_REV=n BOARD=oak_pd -j
Change-Id: I331b4c5a1af94b179d7c6f7878a9c3939ea6025a
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/294441
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
9f146c7b8a
commit
c2ebc9e477
@@ -250,7 +250,7 @@ void board_typec_dp_on(int port)
|
||||
if (dp_hw_port != !port) {
|
||||
/* Get control of DP hardware */
|
||||
dp_hw_port = port;
|
||||
#ifdef CONFIG_BOARD_OAK_REV_2
|
||||
#if BOARD_REV == OAK_REV2
|
||||
gpio_set_level(GPIO_DP_SWITCH_CTL, port);
|
||||
#endif
|
||||
if (!gpio_get_level(GPIO_USB_DP_HPD)) {
|
||||
@@ -295,7 +295,7 @@ void board_typec_dp_set(int port, int level)
|
||||
|
||||
if (dp_hw_port == PD_PORT_NONE) {
|
||||
dp_hw_port = port;
|
||||
#ifdef CONFIG_BOARD_OAK_REV_2
|
||||
#if BOARD_REV == OAK_REV2
|
||||
gpio_set_level(GPIO_DP_SWITCH_CTL, port);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
#ifndef __CROS_EC_BOARD_H
|
||||
#define __CROS_EC_BOARD_H
|
||||
|
||||
/* Board revision */
|
||||
#undef CONFIG_BOARD_OAK_REV_1
|
||||
#define CONFIG_BOARD_OAK_REV_2
|
||||
#undef CONFIG_BOARD_OAK_REV_3
|
||||
/* board revision */
|
||||
#include "board_revs.h"
|
||||
|
||||
#define CONFIG_ADC
|
||||
#undef CONFIG_ADC_WATCHDOG
|
||||
@@ -23,7 +21,8 @@
|
||||
#define CONFIG_CHARGER
|
||||
|
||||
#define CONFIG_CHARGER_INPUT_CURRENT 512
|
||||
#ifdef CONFIG_BOARD_OAK_REV_1
|
||||
|
||||
#if BOARD_REV == OAK_REV1
|
||||
#define CONFIG_CHARGER_BQ24773
|
||||
#define CONFIG_CHARGER_MAX_INPUT_CURRENT 2150
|
||||
#define CONFIG_CHARGER_SENSE_RESISTOR 10
|
||||
@@ -33,7 +32,7 @@
|
||||
#define CONFIG_CHARGER_MAX_INPUT_CURRENT 2250
|
||||
#define CONFIG_CHARGER_SENSE_RESISTOR 10
|
||||
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20
|
||||
#endif /* CONFIG_BOARD_OAK_REV_1 */
|
||||
#endif /* BOARD_REV */
|
||||
|
||||
#define CONFIG_CHARGER_DISCHARGE_ON_AC
|
||||
#define CONFIG_CHARGER_V2
|
||||
|
||||
25
board/oak/board_revs.h
Normal file
25
board/oak/board_revs.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/* Copyright 2015 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.
|
||||
*/
|
||||
|
||||
#ifndef __CROS_EC_BOARD_REVS_H
|
||||
#define __CROS_EC_BOARD_REVS_H
|
||||
|
||||
#define OAK_REV0 0
|
||||
#define OAK_REV1 1
|
||||
#define OAK_REV2 2
|
||||
#define OAK_REV3 3
|
||||
#define OAK_REV4 4
|
||||
#define OAK_REV_LAST OAK_REV4
|
||||
#define OAK_REV_DEFAULT OAK_REV3
|
||||
|
||||
#if !defined(BOARD_REV)
|
||||
#define BOARD_REV OAK_REV_DEFAULT
|
||||
#endif
|
||||
|
||||
#if BOARD_REV < OAK_REV1 || BOARD_REV > OAK_REV_LAST
|
||||
#error "Board revision out of range"
|
||||
#endif
|
||||
|
||||
#endif /* __CROS_EC_BOARD_REVS_H */
|
||||
@@ -46,7 +46,7 @@ GPIO(EC_INT, PIN(B, 9), GPIO_OUT_HIGH)
|
||||
GPIO(ENTERING_RW, PIN(F, 0), GPIO_OUT_LOW)
|
||||
|
||||
|
||||
#ifdef CONFIG_BOARD_OAK_REV_1
|
||||
#if BOARD_REV == OAK_REV1
|
||||
GPIO(AP_RESET_L, PIN(C, 3), GPIO_INPUT|GPIO_PULL_UP) /* AP reset signal from servo board */
|
||||
GPIO(USB_C_BC12_SEL, PIN(A, 14), GPIO_OUT_LOW)
|
||||
GPIO(KB_OUT00, PIN(B, 0), GPIO_KB_OUTPUT)
|
||||
@@ -62,7 +62,8 @@ GPIO(KB_OUT09, PIN(B, 1), GPIO_KB_OUTPUT)
|
||||
GPIO(KB_OUT10, PIN(C, 5), GPIO_KB_OUTPUT)
|
||||
GPIO(KB_OUT11, PIN(C, 4), GPIO_KB_OUTPUT)
|
||||
GPIO(KB_OUT12, PIN(A, 13), GPIO_KB_OUTPUT)
|
||||
#elif defined(CONFIG_BOARD_OAK_REV_2)
|
||||
|
||||
#elif BOARD_REV == OAK_REV2
|
||||
GPIO(AP_RESET_L, PIN(C, 3), GPIO_INPUT|GPIO_PULL_UP) /* AP reset signal from servo board */
|
||||
GPIO(USB_C_BC12_SEL, PIN(D, 7), GPIO_OUT_LOW)
|
||||
GPIO(KB_OUT00, PIN(B, 0), GPIO_KB_OUTPUT)
|
||||
@@ -80,7 +81,8 @@ GPIO(KB_OUT11, PIN(C, 4), GPIO_KB_OUTPUT)
|
||||
GPIO(KB_OUT12, PIN(D, 5), GPIO_KB_OUTPUT)
|
||||
GPIO(DP_MUX_EN_L, PIN(E, 6), GPIO_OUT_LOW)
|
||||
GPIO(DP_SWITCH_CTL, PIN(E, 5), GPIO_OUT_LOW)
|
||||
#else /* BOARD_OAK_REV_3 or later */
|
||||
|
||||
#else /* BOARD_REV >= 3 */
|
||||
GPIO(AP_RESET_L, PIN(C, 3), GPIO_ODR_HIGH) /* Connect to the PMU_SYSRSTB */
|
||||
GPIO(USB_C_BC12_SEL, PIN(D, 7), GPIO_OUT_LOW)
|
||||
GPIO(KB_OUT00, PIN(B, 0), GPIO_KB_OUTPUT)
|
||||
@@ -96,7 +98,7 @@ GPIO(KB_OUT09, PIN(B, 1), GPIO_KB_OUTPUT)
|
||||
GPIO(KB_OUT10, PIN(C, 5), GPIO_KB_OUTPUT)
|
||||
GPIO(KB_OUT11, PIN(C, 4), GPIO_KB_OUTPUT)
|
||||
GPIO(KB_OUT12, PIN(C, 2), GPIO_KB_OUTPUT)
|
||||
#endif
|
||||
#endif /* BOARD_REV */
|
||||
|
||||
GPIO(SYSTEM_POWER_H, PIN(B, 10), GPIO_OUT_LOW)
|
||||
GPIO(PMIC_PWRON_H, PIN(A, 12), GPIO_OUT_LOW)
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
#ifndef __CROS_EC_BOARD_H
|
||||
#define __CROS_EC_BOARD_H
|
||||
|
||||
#undef CONFIG_BOARD_OAK_REV_1
|
||||
#define CONFIG_BOARD_OAK_REV_2
|
||||
#undef CONFIG_BOARD_OAK_REV_3
|
||||
#include "board_revs.h"
|
||||
|
||||
/*
|
||||
* The flash size is only 32kB.
|
||||
|
||||
1
board/oak_pd/board_revs.h
Symbolic link
1
board/oak_pd/board_revs.h
Symbolic link
@@ -0,0 +1 @@
|
||||
../oak/board_revs.h
|
||||
@@ -42,7 +42,7 @@ GPIO(USB_C1_CC2_ODL, PIN(A, 8), GPIO_ODR_LOW)
|
||||
GPIO(SLAVE_I2C_SCL, PIN(B, 6), GPIO_INPUT)
|
||||
GPIO(SLAVE_I2C_SDA, PIN(B, 7), GPIO_INPUT)
|
||||
|
||||
#ifdef CONFIG_OAK_BOARD_REV_1
|
||||
#if BOARD_REV == OAK_REV1
|
||||
GPIO(EC_INT, PIN(A, 14), GPIO_OUT_HIGH)
|
||||
#else
|
||||
GPIO(EC_INT, PIN(B, 5), GPIO_OUT_HIGH)
|
||||
|
||||
@@ -214,12 +214,6 @@
|
||||
/* Permanent LM4 boot configuration */
|
||||
#undef CONFIG_BOOTCFG_VALUE
|
||||
|
||||
/******************************************************************************/
|
||||
/* Oak Board Revisions */
|
||||
#undef CONFIG_BOARD_OAK_REV_1
|
||||
#undef CONFIG_BOARD_OAK_REV_2
|
||||
#undef CONFIG_BOARD_OAK_REV_3
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Modify the default behavior to make system bringup easier. */
|
||||
#undef CONFIG_BRINGUP
|
||||
|
||||
Reference in New Issue
Block a user