summaryrefslogtreecommitdiff
path: root/board/yorp/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/yorp/board.c')
-rw-r--r--board/yorp/board.c72
1 files changed, 13 insertions, 59 deletions
diff --git a/board/yorp/board.c b/board/yorp/board.c
index 77eb5cd5f1..d3cf15cd55 100644
--- a/board/yorp/board.c
+++ b/board/yorp/board.c
@@ -43,6 +43,8 @@
#define CPRINTSUSB(format, args...) cprints(CC_USBCHARGE, format, ## args)
#define CPRINTFUSB(format, args...) cprintf(CC_USBCHARGE, format, ## args)
+#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args)
+
static void tcpc_alert_event(enum gpio_signal signal)
{
if ((signal == GPIO_USB_C1_MUX_INT_ODL) &&
@@ -231,71 +233,23 @@ void lid_angle_peripheral_enable(int enable)
keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE);
}
-#endif
-/* Sets the gpio flags correct taking into account warm resets */
-static void reset_gpio_flags(enum gpio_signal signal, int flags)
-{
- /*
- * If the system was already on, we cannot set the value otherwise we
- * may change the value from the previous image which could cause a
- * brownout.
- */
- if (system_is_reboot_warm() || system_jumped_to_this_image())
- flags &= ~(GPIO_LOW | GPIO_HIGH);
- gpio_set_flags(signal, flags);
-}
-
-/* Runtime GPIO defaults */
-enum gpio_signal gpio_sys_reset_l_runtime = GPIO_SYS_RESET_L_V1;
-enum gpio_signal gpio_entering_rw_runtime = GPIO_ENTERING_RW_V1;
-enum gpio_signal gpio_usb2_otg_id_runtime = GPIO_USB2_OTG_ID_V1;
-
-static void update_drivers_from_board_id(void)
+static void post_old_board_warning(void)
{
uint32_t board_id = 0;
- /* Errors will count as board_id 0 */
cbi_get_board_version(&board_id);
- if (board_id == 0) {
- /* EC drives C1 PPC for proto 1. b/78896495 */
- reset_gpio_flags(GPIO_WFCAM_VSYNC, GPIO_OUT_LOW);
- reset_gpio_flags(GPIO_C1_EN_SNK_V0, GPIO_OUT_LOW);
- ppc_chips[1].flags = PPC_CFG_FLAGS_GPIO_CONTROL;
- ppc_chips[1].snk_gpio = GPIO_C1_EN_SNK_V0; /* GPIO40 */
- ppc_chips[1].src_gpio = GPIO_WFCAM_VSYNC; /* GPIO03 */
-
- /*
- * We don't have to worry about changing USB-A port count from
- * 2 -> 1 since GPIO_EN_USB_A1_5V on V0 board just drives the
- * EC_BRD_ID_EN signal (which will burn ~ 400uW of power)
- */
-
- /* Move the runtime GPIOS */
- reset_gpio_flags(GPIO_SYS_RESET_L_V0, GPIO_ODR_HIGH);
- gpio_sys_reset_l_runtime = GPIO_SYS_RESET_L_V0; /* GPIO02 */
-
- reset_gpio_flags(GPIO_ENTERING_RW_V0, GPIO_OUT_LOW);
- gpio_entering_rw_runtime = GPIO_ENTERING_RW_V0; /* GPIO80 */
-
- reset_gpio_flags(GPIO_USB_A1_CHARGE_EN_L, GPIO_OUT_LOW);
- gpio_usb2_otg_id_runtime = GPIO_USB_A1_CHARGE_EN_L; /* GPIOA0 */
- }
- if (board_id >= 1) {
- /* Reset flags to correct state instead of GPIO_DEFAULT */
- reset_gpio_flags(GPIO_SYS_RESET_L_V1, GPIO_ODR_HIGH);
- reset_gpio_flags(GPIO_ENTERING_RW_V1, GPIO_OUT_LOW);
- reset_gpio_flags(GPIO_USB_A1_CHARGE_EN_L, GPIO_OUT_HIGH);
- reset_gpio_flags(GPIO_USB2_OTG_ID_V1, GPIO_OUT_LOW);
- reset_gpio_flags(GPIO_WFCAM_VSYNC, GPIO_INPUT);
+ if (board_id != 0)
+ return;
- /*
- * Configure alternate mode to enable PWM3 that is required for
- * KB_BL_PWM.
- */
- gpio_set_alternate_function(GPIO_8, 0x1, 0);
- }
+ /*
+ * BOARD ID 0 is officially deprecated. Indicate this by posting a
+ * warning.
+ */
+ CPRINTS("\n\n\n ***** BOARD ID 0 is not officially supported!!! *****"
+ "\n\n\n");
}
-DECLARE_HOOK(HOOK_INIT, update_drivers_from_board_id, HOOK_PRIO_INIT_I2C + 1);
+DECLARE_HOOK(HOOK_INIT, post_old_board_warning, HOOK_PRIO_INIT_I2C + 1);
+#endif