1
0
forked from me/IronOS

Fix watchdog timeouts && get unit to boot

This commit is contained in:
Ben V. Brown
2020-06-14 21:12:25 +10:00
parent f196c5f1c9
commit 61f991e423
4 changed files with 20 additions and 8 deletions

View File

@@ -152,14 +152,21 @@ void fusb_setup() {
/* Flush the RX buffer */
fusb_write_byte( FUSB_CONTROL1, FUSB_CONTROL1_RX_FLUSH);
resetWatchdog();
/* Measure CC1 */
fusb_write_byte( FUSB_SWITCHES0, 0x07);
osDelay(1);
resetWatchdog();
delay_ms(1);
resetWatchdog();
uint8_t cc1 = fusb_read_byte( FUSB_STATUS0) & FUSB_STATUS0_BC_LVL;
resetWatchdog();
/* Measure CC2 */
resetWatchdog();
fusb_write_byte( FUSB_SWITCHES0, 0x0B);
osDelay(1);
resetWatchdog();
delay_ms(1);
resetWatchdog();
uint8_t cc2 = fusb_read_byte( FUSB_STATUS0) & FUSB_STATUS0_BC_LVL;
/* Select the correct CC line for BMC signaling; also enable AUTO_CRC */
@@ -170,6 +177,7 @@ void fusb_setup() {
fusb_write_byte( FUSB_SWITCHES1, 0x26);
fusb_write_byte( FUSB_SWITCHES0, 0x0B);
}
resetWatchdog();
/* Reset the PD logic */
fusb_write_byte( FUSB_RESET, FUSB_RESET_PD_RESET);

View File

@@ -24,10 +24,10 @@
#include <pdb_msg.h>
/* I2C addresses of the FUSB302B chips */
#define FUSB302B_ADDR 0x22
#define FUSB302B01_ADDR 0x23
#define FUSB302B10_ADDR 0x24
#define FUSB302B11_ADDR 0x25
#define FUSB302B_ADDR (0x22<<1)
#define FUSB302B01_ADDR (0x23<<1)
#define FUSB302B10_ADDR (0x24<<1)
#define FUSB302B11_ADDR (0x25<<1)
/* Device ID register */
#define FUSB_DEVICE_ID 0x01