cr50: Remove BOARD_AP_USB property

We previously disabled the USB PHY to the AP.  But the BOARD_AP_USB
property lingered on.  Remove the property.

Also clean up the idle task deciding when to do utmi wakes.  With the
AP USB connection disabled, that's only necessary when the debug cable
is attached, so we can check that explicitly.

BUG=none
BRANCH=cr50
TEST=make buildall; boot CR50_DEV=1 image

Change-Id: If81a7bcfe845d9d70dcc7e16239244a4f5f2427b
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/616301
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
This commit is contained in:
Randall Spangler
2017-08-15 17:45:38 -07:00
committed by chrome-bot
parent f2b3aa47a6
commit 86d7ea33af
6 changed files with 14 additions and 33 deletions

View File

@@ -115,11 +115,6 @@ void ec_tx_cr50_rx(enum gpio_signal signal)
hook_call_deferred(&ec_uart_deferred__data, 0);
}
int board_has_ap_usb(void)
{
return !!(board_properties & BOARD_USB_AP);
}
int board_use_plt_rst(void)
{
return !!(board_properties & BOARD_USE_PLT_RESET);
@@ -204,18 +199,17 @@ const struct strap_desc strap_regs[] = {
"a12"},
};
#define BOARD_PROPERTIES_DEFAULT (BOARD_SLAVE_CONFIG_I2C | BOARD_USE_PLT_RESET \
| BOARD_USB_AP)
#define BOARD_PROPERTIES_DEFAULT (BOARD_SLAVE_CONFIG_I2C | BOARD_USE_PLT_RESET)
static struct board_cfg board_cfg_table[] = {
/* SPI Variants: DIOA12 = 1M PD, DIOA6 = 1M PD */
/* Kevin/Gru: DI0A9 = 5k PD, DIOA1 = 1M PU */
{ 0x02, BOARD_SLAVE_CONFIG_SPI | BOARD_NEEDS_SYS_RST_PULL_UP },
/* Poppy: DI0A9 = 1M PU, DIOA1 = 1M PU */
{ 0x0A, BOARD_SLAVE_CONFIG_SPI | BOARD_USB_AP | BOARD_USE_PLT_RESET },
{ 0x0A, BOARD_SLAVE_CONFIG_SPI | BOARD_USE_PLT_RESET },
/* I2C Variants: DIOA9 = 1M PD, DIOA1 = 1M PD */
/* Reef/Eve: DIOA12 = 5k PD, DIOA6 = 1M PU */
{ 0x20, BOARD_SLAVE_CONFIG_I2C | BOARD_USB_AP | BOARD_USE_PLT_RESET },
{ 0x20, BOARD_SLAVE_CONFIG_I2C | BOARD_USE_PLT_RESET },
/* Rowan: DIOA12 = 5k PD, DIOA6 = 5k PU */
{ 0x30, BOARD_SLAVE_CONFIG_I2C },
};

View File

@@ -203,7 +203,6 @@ void assert_ec_rst(void);
void deassert_ec_rst(void);
int is_ec_rst_asserted(void);
int board_has_ap_usb(void);
int board_use_plt_rst(void);
int board_rst_pullup_needed(void);
int board_tpm_uses_i2c(void);

View File

@@ -20,7 +20,6 @@
#define CPRINTS(format, args...) cprints(CC_USB, format, ## args)
static int keep_ccd_enabled;
static int enable_usb_wakeup;
struct uart_config {
const char *name;
@@ -38,12 +37,6 @@ int rdd_is_connected(void)
return ccd_get_mode() == CCD_MODE_ENABLED;
}
int is_utmi_wakeup_allowed(void)
{
return enable_usb_wakeup;
}
/* If the UART TX is connected the pinmux select will have a non-zero value */
int uart_tx_is_connected(int uart)
{
@@ -114,8 +107,6 @@ static void configure_ccd(int enable)
/* Enable CCD */
ccd_set_mode(CCD_MODE_ENABLED);
enable_usb_wakeup = 1;
/* Attempt to connect UART TX */
uartn_tx_connect(UART_AP);
uartn_tx_connect(UART_EC);
@@ -127,8 +118,6 @@ static void configure_ccd(int enable)
uartn_tx_disconnect(UART_EC);
uartn_tx_disconnect(UART_AP);
enable_usb_wakeup = board_has_ap_usb();
/* Disable CCD */
ccd_set_mode(CCD_MODE_DISABLED);

View File

@@ -13,8 +13,7 @@
*/
#define BOARD_SLAVE_CONFIG_SPI (1 << 0) /* TPM uses SPI interface */
#define BOARD_SLAVE_CONFIG_I2C (1 << 1) /* TPM uses I2C interface */
#define BOARD_USB_AP (1 << 2) /* One of the USB PHYs is */
/* connected to the AP */
/*
* The gaps are left to enusre backwards compatibility with the earliest cr50
* code releases. It will be possible to safely reuse these gaps if and when the
@@ -51,6 +50,6 @@
* updated if additional strap related properties are added.
*/
#define BOARD_ALL_PROPERTIES (BOARD_SLAVE_CONFIG_SPI | BOARD_SLAVE_CONFIG_I2C \
| BOARD_USB_AP | BOARD_NEEDS_SYS_RST_PULL_UP | BOARD_USE_PLT_RESET)
| BOARD_NEEDS_SYS_RST_PULL_UP | BOARD_USE_PLT_RESET)
#endif /* ! __EC_BOARD_CR50_SCRATCH_REG1_H */

View File

@@ -71,9 +71,15 @@ DECLARE_SAFE_CONSOLE_COMMAND(idle, command_idle,
static int utmi_wakeup_is_enabled(void)
{
#ifdef CONFIG_RDD
return is_utmi_wakeup_allowed();
#endif
/*
* USB is only used for CCD, so only enable UTMI wakeups when RDD
* detects that a debug accessory is attached.
*/
return rdd_is_connected();
#else
/* USB is used for the host interface, so always enable UTMI wakeups */
return 1;
#endif
}
static void prepare_to_sleep(void)
@@ -226,7 +232,7 @@ void __idle(void)
while (1) {
/* Anyone still busy? */
/* Anyone still busy? (this checks sleep_mask) */
sleep_ok = DEEP_SLEEP_ALLOWED;
/* Wait a bit, just in case */

View File

@@ -12,10 +12,4 @@ void rdd_detached(void);
/* Attach to debug cable */
void rdd_attached(void);
/*
* USB is only used for CCD, so only enable UTMI wakeups when RDD detects that
* a debug accessory is attached and disable it as a wakeup source when the
* cable is detached.
*/
int is_utmi_wakeup_allowed(void);
#endif /* __CROS_RDD_H */