Refactoring #391
openRefactor singleton states into reentrant pattern
80%
Description
Move global singleton states into a struct and store within the spi_master
/ opaque_master
/ par_master
data field for the life-time of the driver.
This is one of the steps on the way to move *_master
data memory management behind the initialisation API.
List of programmers which need to be refactored:
-
atahpthttps://review.coreboot.org/c/flashrom/+/64963 -
atapromisehttps://review.coreboot.org/c/flashrom/+/65706 - atavia
*
-
buspirate_spihttps://review.coreboot.org/c/flashrom/+/52958 - ch341a_spi
*
-
dediproghttps://review.coreboot.org/c/flashrom/+/56414 -
developerbox_spihttps://review.coreboot.org/c/flashrom/+/54993 -
digilent_spihttps://review.coreboot.org/c/flashrom/+/54012 -
drkaiserhttps://review.coreboot.org/c/flashrom/+/65194 - dummyflasher
*
-
ft2232_spihttps://review.coreboot.org/c/flashrom/+/52256 -
gfxnvidiahttps://review.coreboot.org/c/flashrom/+/65342 - internal
*
-
it8212https://review.coreboot.org/c/flashrom/+/65745 -
jlink_spihttps://review.coreboot.org/c/flashrom/+/52560 -
linux_mtdhttps://review.coreboot.org/c/flashrom/+/53947 -
linux_spihttps://review.coreboot.org/c/flashrom/+/52285 -
lspcon_i2c_spihttps://review.coreboot.org/c/flashrom/+/56103 -
mediatek_i2c_spihttps://review.coreboot.org/c/flashrom/+/65746 -
mstarddc_spihttps://review.coreboot.org/c/flashrom/+/54033 - ni845x_spi
-
nic3comhttps://review.coreboot.org/c/flashrom/+/55107 -
nicintelhttps://review.coreboot.org/c/flashrom/+/65974 -
nicintel_eepromhttps://review.coreboot.org/c/flashrom/+/66491 -
nicintel_spihttps://review.coreboot.org/c/flashrom/+/54995 -
nicnatsemihttps://review.coreboot.org/c/flashrom/+/65970 -
nicrealtekhttps://review.coreboot.org/c/flashrom/+/55108 -
ogp_spihttps://review.coreboot.org/c/flashrom/+/54996 -
pickit2_spihttps://review.coreboot.org/c/flashrom/+/52774 -
pony_spihttps://review.coreboot.org/c/flashrom/+/54997 -
raiden_debug_spihttps://review.coreboot.org/c/flashrom/+/56103 -
rayer_spihttps://review.coreboot.org/c/flashrom/+/54998 -
realtek_mst_i2c_spihttps://review.coreboot.org/c/flashrom/+/56103 -
satamvhttps://review.coreboot.org/c/flashrom/+/65978 -
satasiihttps://review.coreboot.org/c/flashrom/+/66075 - serprog
*
-
stlinkv3_spihttps://review.coreboot.org/c/flashrom/+/54042 -
usbblaster_spihttps://review.coreboot.org/c/flashrom/+/54044
*
- non-trivial case, this programmer requires some tricks
Updated by Alexander Goncharov almost 3 years ago
Added a list of programmers and links to patches
Updated by Anastasia Klimchuk almost 3 years ago
I can add more info on some of those:
dummyflasher: needs to migrate shutdown function into master struct(s), global state has already been removed
ch341a_spi and serprog are non-trivial cases of global state: it is wired into the core of flashrom unfortunately, via programmer_delay
function. still possible of course, but this is more work and needs some design & experimenting first. So to me it seems better to go through easier cases first, and then get to harder ones.
internal is also a special one, and probably needs collaboration with other people, which I will try to organise.
Updated by Alexander Goncharov almost 3 years ago
- Description updated (diff)
drkaiser , gfxnvidia are done.
I've marked non-trivial cases with *
.
dummyflasher : depending on supported buses, it can register opaque, par and spi masters at the same time.
atavia : atavia_map
function doesn't have access to struct flashctx
.
Updated by Alexander Goncharov almost 3 years ago
- Description updated (diff)
mediatek_i2c_spi, it8212, atapromise, nicintel are done.
Updated by Alexander Goncharov over 2 years ago
- Description updated (diff)
nicintel_eeprom, nicnatsemi, satamv, satasii are done.
Updated by Felix Singer over 2 years ago
- Tracker changed from Feature to Refactoring
- Target version changed from none to main