Home | History | Annotate | Download | only in updater

Lines Matching refs:spi

31 int check_compatible_keys(struct flash_device *img, struct flash_device *spi)
35 uint8_t *spi_rootkey = gbb_get_rootkey(spi, &spi_size);
38 ALOGD("Invalid root key SPI %zd IMG %zd\n", spi_size, img_size);
83 static int update_recovery_fw(struct flash_device *spi, struct flash_device *ec,
87 int wp = 1; /* TODO: read SPI read-write */
92 if (!check_compatible_keys(img, spi))
95 ra = update_partition(img, spi, "RW_SECTION_A");
96 rb = update_partition(img, spi, "RW_SECTION_B");
97 rs = update_partition(img, spi, "RW_SHARED");
99 } else { /* Update both RO & RW on SPI + EC */
102 // TODO write full SPI flash with "img"
115 static int update_rw_fw(struct flash_device *spi, struct flash_device *img,
125 if (!check_compatible_keys(img, spi))
128 res = update_partition(img, spi, rw_name);
130 /* We have updated the SPI flash */
131 vbnv_set_flag(spi, "fw_try_next", try_next);
132 vbnv_set_flag(spi, "try_count", 6);
142 static int update_ap_fw(struct flash_device *spi, struct flash_device *img)
152 void *rovpd = fmap_read_section(spi, "RO_VPD", &rovpd_sz, &rovpd_off);
156 res = update_partition(img, spi, NULL);
158 res = flash_erase(spi, new_rovpd_off, new_rovpd_sz);
162 res = flash_write(spi, new_rovpd_off, rovpd, new_rovpd_sz);
172 struct flash_device *img, *spi, *ec;
205 spi = flash_open("spi", NULL);
206 if (!spi)
210 res = update_ap_fw(spi, img);
213 res = update_recovery_fw(spi, ec, img, ec_file);
215 res = update_rw_fw(spi, img, cur_part);
220 flash_close(spi);