Yuji Sasaki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34711 )
Change subject: TEMP: NOT FOR REVIEW: google/mistral: LED Pattern change ......................................................................
TEMP: NOT FOR REVIEW: google/mistral: LED Pattern change
LED Pattern and timing change, requested from UI design team.
WWR_RECOVERY_PUSHED: Bright White -> Fast Blink Yellow
WWR_WIPEOUT_REQUEST: Solid Yellow -> Fast Blink Yellow after 3 second brank 8seconds -> 22 seconds
WWR_RECOVERY_REQUEST: Blink Yellow -> Blink Red
BUG=b:138850607 TEST=Run on DUT, verify LED pattern Signed-off-by: Yuji Sasaki sasakiy@chromium.org Change-Id: Ibd426162f18aefae79cb390cc0c4e44de6cb6f6e --- M src/drivers/i2c/lp5562/led_lp5562_programs.c M src/mainboard/google/mistral/chromeos.c 2 files changed, 247 insertions(+), 59 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/34711/1
diff --git a/src/drivers/i2c/lp5562/led_lp5562_programs.c b/src/drivers/i2c/lp5562/led_lp5562_programs.c index 9c698ca..8bd2366 100644 --- a/src/drivers/i2c/lp5562/led_lp5562_programs.c +++ b/src/drivers/i2c/lp5562/led_lp5562_programs.c @@ -88,67 +88,59 @@ } };
-static uint8_t solid_FF_b_text[] = { - 0x40, 255, 0xc0, 0x00, -}; - -static uint8_t solid_FF_g_text[] = { - 0x40, 255, 0xc0, 0x00 -}; - -static uint8_t solid_FF_r_text[] = { - 0x40, 255, 0xc0, 0x00 -}; - -static TiLp5562Program solid_FFFFFF_program = { - { - { /* Engine1:Blue */ - solid_FF_b_text, - sizeof(solid_FF_b_text), - 0, - LED_LP5562_DEFAULT_CURRENT - }, - { /* Engine2:Green */ - solid_FF_g_text, - sizeof(solid_FF_g_text), - 0, - LED_LP5562_DEFAULT_CURRENT - }, - { /* Engine3:Red */ - solid_FF_r_text, - sizeof(solid_FF_r_text), - 0, - LED_LP5562_DEFAULT_CURRENT - }, - } -}; - /* * fdr_press1.src * 1 00 .ENGINE1(B) 2 00 4000 set_pwm 0 - 3 01 C000 end - 4 - 5 10 .ENGINE2(G) - 6 10 40CC set_pwm 204 - 7 11 C000 end - 8 - 9 20 .ENGINE3(R) - 10 20 40FF set_pwm 255 - 11 21 C000 end + 3 loop1_1: + 4 01 E208 trigger w3,s3 + 5 02 4000 set_pwm 0 + 6 03 4000 set_pwm 0 + 7 04 E208 trigger w3,s3 + 8 05 4000 set_pwm 0 + 9 06 4000 set_pwm 0 + 10 07 A001 branch 0, loop1_1 + 11 + 12 10 .ENGINE2(G) + 13 10 4000 set_pwm 0 + 14 loop2_1: + 15 11 E208 trigger w3,s3 + 16 12 0565 ramp 250, 102 + 17 13 0565 ramp 250, 102 + 18 14 E208 trigger w3,s3 + 19 15 05E5 ramp 250, -102 + 20 16 05E5 ramp 250, -102 + 21 17 A011 branch 0,loop2_1 + 22 + 23 20 .ENGINE3(R) + 24 20 4000 set_pwm 0 + 25 loop3_1: + 26 21 E186 trigger s21,w21 + 27 22 047E ramp 250, 127 + 28 23 047F ramp 250, 128 + 29 24 E186 trigger s21,w21 + 30 25 04FE ramp 250, -127 + 31 26 04FF ramp 250, -128 + 32 27 A021 branch 0,loop3_1 */
+/* WWR_RECOVERY_PUSHED */ +/* Fast Blinking Yellow */ +/* Ramp up to (255,204,0) in 0.5sec, ramp down to (0,0,0) in 0.5sec */ static uint8_t fdr_press1_b_text[] = { - 0x40, 0, 0xc0, 0x00, + 0x40, 0x00, 0xE2, 0x08, 0x40, 0x00, 0x40, 0x00, + 0xE2, 0x08, 0x40, 0x00, 0x40, 0x00, 0xA0, 0x01, };
static uint8_t fdr_press1_g_text[] = { - 0x40, 204, 0xc0, 0x00 + 0x40, 0x00, 0xE2, 0x08, 0x05, 0x65, 0x05, 0x65, + 0xE2, 0x08, 0x05, 0xE5, 0x05, 0xE5, 0xA0, 0x11, };
static uint8_t fdr_press1_r_text[] = { - 0x40, 255, 0xc0, 0x00 + 0x40, 0x00, 0xE1, 0x86, 0x04, 0x7E, 0x04, 0x7F, + 0xE1, 0x86, 0x04, 0xFE, 0x04, 0xFF, 0xA0, 0x21, };
static TiLp5562Program fdr_press1_program = { @@ -175,6 +167,88 @@ };
/* + * wipeout_request1.src + * + 1 00 .ENGINE1(B) + 2 00 4000 set_pwm 0 + 3 loop1_1: + 4 01 E208 trigger w3,s3 + 5 02 4000 set_pwm 0 + 6 03 4000 set_pwm 0 + 7 04 E208 trigger w3,s3 + 8 05 4000 set_pwm 0 + 9 06 4000 set_pwm 0 + 10 07 A001 branch 0, loop1_1 + 11 + 12 10 .ENGINE2(G) + 13 10 4000 set_pwm 0 + 14 loop2_1: + 15 11 E208 trigger w3,s3 + 16 12 0565 ramp 250, 102 + 17 13 0565 ramp 250, 102 + 18 14 E208 trigger w3,s3 + 19 15 05E5 ramp 250, -102 + 20 16 05E5 ramp 250, -102 + 21 17 A011 branch 0,loop2_1 + 22 + 23 20 .ENGINE3(R) + 24 20 4000 set_pwm 0 + 25 loop3_2: + 26 21 6000 wait 500 + 27 22 A321 branch 6,loop3_2 + 28 loop3_1: + 29 23 E186 trigger s21,w21 + 30 24 047E ramp 250, 127 + 31 25 047F ramp 250, 128 + 32 26 E186 trigger s21,w21 + 33 27 04FE ramp 250, -127 + 34 28 04FF ramp 250, -128 +*/ + +/* WWR_WIPEOUT_REQUEST */ +/* Fast Blinking Yellow with 3sec delay */ +/* Blank for 3sec */ +/* Ramp up to (255,204,0) in 0.5sec, ramp down to (0,0,0) in 0.5sec */ +static uint8_t wipeout_request1_b_text[] = { + 0x40, 0x00, 0xE2, 0x08, 0x40, 0x00, 0x40, 0x00, + 0xE2, 0x08, 0x40, 0x00, 0x40, 0x00, 0xA0, 0x01, +}; + +static uint8_t wipeout_request1_g_text[] = { + 0x40, 0x00, 0xE2, 0x08, 0x05, 0x65, 0x05, 0x65, + 0xE2, 0x08, 0x05, 0xE5, 0x05, 0xE5, 0xA0, 0x11, +}; + +static uint8_t wipeout_request1_r_text[] = { + 0x40, 0x00, 0x60, 0x00, 0xA3, 0x21, 0xE1, 0x86, + 0x04, 0x7E, 0x04, 0x7F, 0xE1, 0x86, 0x04, 0xFE, + 0x04, 0xFF, 0xA0, 0x23, +}; + +static TiLp5562Program wipeout_request1_program = { + { + { + wipeout_request1_b_text, + sizeof(wipeout_request1_b_text), + 0, + LED_LP5562_DEFAULT_CURRENT + }, + { + wipeout_request1_g_text, + sizeof(wipeout_request1_g_text), + 0, + LED_LP5562_DEFAULT_CURRENT + }, + { + wipeout_request1_r_text, + sizeof(wipeout_request1_r_text), + 0, + LED_LP5562_DEFAULT_CURRENT + }, + } +}; + +/* * blink_recovery1.src * 1 00 .ENGINE1(B) @@ -186,7 +260,7 @@ 7 8 10 .ENGINE2(G) 9 10 E200 trigger w3 - 10 11 40CC set_pwm 204 + 10 11 40CC set_pwm 0 11 12 E200 trigger w3 12 13 4000 set_pwm 0 13 14 0000 gotostart @@ -201,13 +275,15 @@ 22 26 0000 gotostart */
+/* WWR_RECOVERY_REQUEST */ +/* Blinking Red, (255,0,0) for 0.3sec, (0,0,0) for 0.3sec */ static uint8_t blink_recovery1_b_text[] = { 0xe2, 0x00, 0x40, 0, 0xe2, 0x00, 0x40, 0, 0x00, 0x00, };
static uint8_t blink_recovery1_g_text[] = { - 0xe2, 0x00, 0x40, 204, 0xe2, 0x00, 0x40, 0, + 0xe2, 0x00, 0x40, 0, 0xe2, 0x00, 0x40, 0, 0x00, 0x00, };
@@ -261,6 +337,8 @@ 17 23 C000 end */
+/* WWR_NORMAL_BOOT */ +/* Ramp up to (77,77,77) in 0.5sec */ static uint8_t preboot1_b_text[] = { 0x40, 0x00, 0xe2, 0x00, 0x0d, 0x4c, 0xc0, 0x00 }; @@ -296,8 +374,8 @@
const Led5562StateProg led_lp5562_state_programs[] = { {LED_ALL_OFF, {&solid_000000_program} }, - {LED_RECOVERY_PUSHED, {&solid_FFFFFF_program} }, - {LED_WIPEOUT_REQUEST, {&fdr_press1_program} }, + {LED_RECOVERY_PUSHED, {&fdr_press1_program} }, + {LED_WIPEOUT_REQUEST, {&wipeout_request1_program} }, {LED_RECOVERY_REQUEST, {&blink_recovery1_program} }, {LED_NORMAL_BOOT, {&preboot1_program} }, {}, /* Empty record to mark the end of the table. */ @@ -408,12 +486,122 @@ } };
+// Calibration code map for "fast blink" pattern. +// Start from OFF, +// ramp up in 0.5sec, ramp down in 0.5sec, repeat forever. +const struct lp5562_calibration_code_map mistral_code_map_fast_blink[] = { + { + blue, + ramp, + 0x02, + 2, + { {250, 128}, {250, 128} } + }, + { + blue, + ramp, + 0x05, + 2, + { {250, -128}, {250, -128} } + }, + { + green, + ramp, + 0x12, + 2, + { {250, 128}, {250, 128} } + }, + { + green, + ramp, + 0x15, + 2, + { {250, -128}, {250, -128} } + }, + { + red, + ramp, + 0x22, + 2, + { {250, 128}, {250, 128} } + }, + { + red, + ramp, + 0x25, + 2, + { {250, -128}, {250, -128} } + }, + { + 0, + invalid, + 0x00, + 0, + { } + } +}; + +// Calibration code map for "wipeout request" pattern. +// Start from OFF, wait for 3 seconds +// ramp up in 0.5sec, ramp down in 0.5sec, repeat forever. +const struct lp5562_calibration_code_map mistral_code_map_wipeout_request1[] = { + { + blue, + ramp, + 0x02, + 2, + { {250, 128}, {250, 128} } + }, + { + blue, + ramp, + 0x05, + 2, + { {250, -128}, {250, -128} } + }, + { + green, + ramp, + 0x12, + 2, + { {250, 128}, {250, 128} } + }, + { + green, + ramp, + 0x15, + 2, + { {250, -128}, {250, -128} } + }, + { + red, + ramp, + 0x24, + 2, + { {250, 128}, {250, 128} } + }, + { + red, + ramp, + 0x27, + 2, + { {250, -128}, {250, -128} } + }, + { + 0, + invalid, + 0x00, + 0, + { } + } +}; + const struct lp5562_calibration_data mistral_calibration_database[] = { { - &solid_FFFFFF_program, - 0, /* White */ - 100, /* 30% brigheness */ - mistral_code_map_solid, + &fdr_press1_program, + 1, /* Yellow */ + 100, /* 100% brigheness */ + mistral_code_map_fast_blink, }, { &preboot1_program, @@ -423,15 +611,15 @@ }, { &blink_recovery1_program, - 1, /* Yellow */ + 2, /* Red */ 100, /* 100% brightness */ mistral_code_map_blink, }, { - &fdr_press1_program, + &wipeout_request1_program, 1, /* Yellow */ 100, /* 100% brightness */ - mistral_code_map_solid, + mistral_code_map_wipeout_request1, }, { NULL, diff --git a/src/mainboard/google/mistral/chromeos.c b/src/mainboard/google/mistral/chromeos.c index 8873edd..a61c722 100644 --- a/src/mainboard/google/mistral/chromeos.c +++ b/src/mainboard/google/mistral/chromeos.c @@ -46,7 +46,7 @@ }
#define WIPEOUT_MODE_DELAY_MS (8 * 1000) -#define RECOVERY_MODE_EXTRA_DELAY_MS (8 * 1000) +#define RECOVERY_MODE_EXTRA_DELAY_MS (22 * 1000)
/* * The recovery switch: it needs to be pressed for a