Cr50: Move board-specific rdd stuff out of chip/g/

Poking GPIOs is something that belongs in board/ not chip/

BUG=none
BRANCH=none
TEST=make buildall; test on Kevin

Change-Id: I798053c3760415ed787800d37eb81c765b826399
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/341065
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
This commit is contained in:
Bill Richardson
2016-04-27 22:08:02 -07:00
committed by chrome-bot
parent 38c93a26f3
commit c5dd305dff
3 changed files with 11 additions and 13 deletions

View File

@@ -4,6 +4,7 @@
*/
#include "console.h"
#include "gpio.h"
#include "rdd.h"
#include "registers.h"
#include "usb_api.h"
@@ -22,11 +23,11 @@ static void usart_tx_disconnect(void)
void rdd_attached(void)
{
/* Indicate case-closed debug mode (active low) */
gpio_set_level(GPIO_CCD_MODE_L, 0);
/* Select the CCD PHY */
usb_select_phy(USB_SEL_PHY1);
/* Connect to selected phy */
usb_init();
}
void rdd_detached(void)
@@ -34,11 +35,11 @@ void rdd_detached(void)
/* Disconnect from AP and EC UART TX */
usart_tx_disconnect();
/* Done with case-closed debug mode */
gpio_set_level(GPIO_CCD_MODE_L, 1);
/* Select the AP PHY */
usb_select_phy(USB_SEL_PHY0);
/* Connect to selected phy */
usb_init();
}
static int command_uart(int argc, char **argv)

View File

@@ -5,7 +5,6 @@
#include "clock.h"
#include "console.h"
#include "gpio.h"
#include "hooks.h"
#include "rdd.h"
#include "registers.h"
@@ -49,11 +48,9 @@ void rdd_init(void)
debug_detect = GREAD(RDD, PROG_DEBUG_STATE_MAP);
/* If cable is attached, detect when it is disconnected */
if (debug_cable_is_attached()) {
GWRITE(RDD, PROG_DEBUG_STATE_MAP, ~debug_detect);
rdd_attached();
}
/* Invoke the interrupt handler manually so that the board-specific
* callbacks can process the initial state. */
rdd_interrupt();
/* Enable RDD interrupts */
task_enable_irq(GC_IRQNUM_RDD0_INTR_DEBUG_STATE_DETECTED_INT);

View File

@@ -320,6 +320,7 @@ void usb_select_phy(uint32_t phy)
which_phy = phy;
GR_USB_GGPIO = GGPIO_WRITE(USB_CUSTOM_CFG_REG,
(USB_PHY_ACTIVE | which_phy));
CPRINTS("USB PHY %c", which_phy == USB_SEL_PHY0 ? 'A' : 'B');
}
uint32_t usb_get_phy(void)
@@ -1244,7 +1245,6 @@ void usb_init(void)
/* Select the correct PHY */
usb_select_phy(which_phy);
gpio_set_level(GPIO_CCD_MODE_L, !(which_phy == USB_SEL_PHY1));
/* Full-Speed Serial PHY */
GR_USB_GUSBCFG = GUSBCFG_PHYSEL_FS | GUSBCFG_FSINTF_6PIN