Lines Matching refs:spi
31 int check_compatible_keys(struct flash_device *img, struct flash_device *spi) in check_compatible_keys() argument
35 uint8_t *spi_rootkey = gbb_get_rootkey(spi, &spi_size); in check_compatible_keys()
83 static int update_recovery_fw(struct flash_device *spi, struct flash_device *ec, in update_recovery_fw() argument
92 if (!check_compatible_keys(img, spi)) in update_recovery_fw()
95 ra = update_partition(img, spi, "RW_SECTION_A"); in update_recovery_fw()
96 rb = update_partition(img, spi, "RW_SECTION_B"); in update_recovery_fw()
97 rs = update_partition(img, spi, "RW_SHARED"); in update_recovery_fw()
115 static int update_rw_fw(struct flash_device *spi, struct flash_device *img, in update_rw_fw() argument
125 if (!check_compatible_keys(img, spi)) in update_rw_fw()
128 res = update_partition(img, spi, rw_name); in update_rw_fw()
131 vbnv_set_flag(spi, "fw_try_next", try_next); in update_rw_fw()
132 vbnv_set_flag(spi, "try_count", 6); in update_rw_fw()
142 static int update_ap_fw(struct flash_device *spi, struct flash_device *img) in update_ap_fw() argument
152 void *rovpd = fmap_read_section(spi, "RO_VPD", &rovpd_sz, &rovpd_off); in update_ap_fw()
156 res = update_partition(img, spi, NULL); in update_ap_fw()
158 res = flash_erase(spi, new_rovpd_off, new_rovpd_sz); in update_ap_fw()
162 res = flash_write(spi, new_rovpd_off, rovpd, new_rovpd_sz); in update_ap_fw()
172 struct flash_device *img, *spi, *ec; in update_fw() local
205 spi = flash_open("spi", NULL); in update_fw()
206 if (!spi) in update_fw()
210 res = update_ap_fw(spi, img); in update_fw()
213 res = update_recovery_fw(spi, ec, img, ec_file); in update_fw()
215 res = update_rw_fw(spi, img, cur_part); in update_fw()
220 flash_close(spi); in update_fw()