Attention is currently required from: Nico Huber, Angel Pons, Arthur Heymans.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54905 )
Change subject: dummyflasher.c: Don't leak `emu_persistent_image`
......................................................................
Patch Set 1:
(1 comment)
File dummyflasher.c:
https://review.coreboot.org/c/flashrom/+/54905/comment/6113fea7_bcb0ad82
PS1, Line 1026: free(data->emu_persistent_image);
> > Is it ok to free something which is !(not) ? […]
Oh thank you, super useful!
So the code like `if (pointer) free(pointer)` is not needed, just `free(pointer)` is sufficient? Specifically, when I write new code?
--
To view, visit https://review.coreboot.org/c/flashrom/+/54905
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I76529973cefcc6a1472681e1f4da8239fcbf07a6
Gerrit-Change-Number: 54905
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Comment-Date: Wed, 26 May 2021 22:04:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Arthur Heymans, Anastasia Klimchuk.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54905 )
Change subject: dummyflasher.c: Don't leak `emu_persistent_image`
......................................................................
Patch Set 1:
(1 comment)
File dummyflasher.c:
https://review.coreboot.org/c/flashrom/+/54905/comment/564cc727_142daf52
PS1, Line 1026: free(data->emu_persistent_image);
> Is it ok to free something which is !(not) ?
Do you mean if it's okay to pass a null pointer to `free()`? Quoting the C standard, 7.20.3.2/2 from ISO-IEC 9899 [1]:
> If ptr is a null pointer, no action occurs.
So yes, it's a perfectly fine thing to do.
[1]: http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf
--
To view, visit https://review.coreboot.org/c/flashrom/+/54905
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I76529973cefcc6a1472681e1f4da8239fcbf07a6
Gerrit-Change-Number: 54905
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Wed, 26 May 2021 10:00:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Paul Menzel, Stefan Reinauer.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54943 )
Change subject: Add AmigaOS suppport to flashrom
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/54943/comment/3145b028_1c020388
PS1, Line 8:
Also, I'd greatly appreciate if you could give a body to this commit message. For example, mention that this change introduces the `IS_AMIGA` macro to handle AmigaOS-specific quirks, and describe how this was tested.
--
To view, visit https://review.coreboot.org/c/flashrom/+/54943
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3e4a3885f88313aad019454fdbdf4be176b35330
Gerrit-Change-Number: 54943
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Comment-Date: Wed, 26 May 2021 09:13:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Stefan Reinauer.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54944 )
Change subject: Add support for TerribleFire TF530 SPI controller
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/54944/comment/4ab3b33b_914a7f37
PS1, Line 8:
I'd greatly appreciate if you could elaborate a bit about this programmer. Where can one find this SPI controller? Is it part of a chipset? Was this code tested?
--
To view, visit https://review.coreboot.org/c/flashrom/+/54944
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I109eec4dec89650bb80d3d1da905d33f65f60f5a
Gerrit-Change-Number: 54944
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Comment-Date: Wed, 26 May 2021 09:06:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Stefan Reinauer.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54944 )
Change subject: Add support for TerribleFire TF530 SPI controller
......................................................................
Patch Set 1: Code-Review+1
(11 comments)
File tf530_spi.c:
https://review.coreboot.org/c/flashrom/+/54944/comment/8bf26232_729fe20c
PS1, Line 17: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
I don't think we need this paragraph
https://review.coreboot.org/c/flashrom/+/54944/comment/f761131f_87369065
PS1, Line 20: #if CONFIG_TF530_SPI == 1
Is this really necessary? I know other files have these guards, but I don't think they're actually useful.
https://review.coreboot.org/c/flashrom/+/54944/comment/6e02616e_fa9d92d9
PS1, Line 62: static struct ConfigDev *cd = NULL;
There's an ongoing effort to remove global state from programmers. See changes to `digilent_spi.c` in CB:54012 and CB:54067 as an example of what should be changed here.
https://review.coreboot.org/c/flashrom/+/54944/comment/3af232c9_df3b790d
PS1, Line 64: #define TF53x_CTRL_CS0 1
: #define TF53x_CTRL_CS1 2
: #define TF53x_CTRL_BUSY 4
: #define TF53x_CTRL_CS2 8
Looks like these are bits within a register. Why not rewrite them as shifts?
#define TF53x_CTRL_CS0 (1 << 0)
#define TF53x_CTRL_CS1 (1 << 1)
#define TF53x_CTRL_BUSY (1 << 2)
#define TF53x_CTRL_CS2 (1 << 3)
https://review.coreboot.org/c/flashrom/+/54944/comment/1b4e7db9_bf3e29a2
PS1, Line 71: uint8_t busy = 0;
:
: while (busy == 0) {
: busy = port->ctrl & TF53x_CTRL_BUSY;
: }
nit: I'd remove the `busy` variable, the name is confusing (it's active-low):
do {} while ((port->ctrl & TF53x_CTRL_BUSY) == 0);
Same below.
https://review.coreboot.org/c/flashrom/+/54944/comment/793764a9_450ff517
PS1, Line 106: return 0;
Don't we need to release `struct ConfigDev *cd` or similar?
https://review.coreboot.org/c/flashrom/+/54944/comment/57caca48_0d5a32ba
PS1, Line 119: unsigned int
Support for for-loop initial declarations was introduced with C99. Some old compilers that do not use C99 mode by default may complain about it. It's not a big deal in this particular case because this programmer is tied to a particular OS, but it's something to keep in mind.
https://review.coreboot.org/c/flashrom/+/54944/comment/4a47284a_29851863
PS1, Line 125: uint8_t volatile
nit: `volatile uint8_t`
Also, would this work?
(volatile uint8_t)spi_recv_byte(port);
https://review.coreboot.org/c/flashrom/+/54944/comment/b9a142c6_71e09fa3
PS1, Line 149:
: struct Library *ExpansionBase = NULL;
:
: if ((ExpansionBase = (struct Library *)
: OpenLibrary((unsigned char *)"expansion.library", 0L)) == NULL) {
Moving the assignment out of the if-block's condition should be easier to read:
struct Library *ExpansionBase = (struct Library *)
OpenLibrary((unsigned char *)"expansion.library", 0L);
if ((ExpansionBase == NULL) {
return 0;
}
Also, are the type casts really necessary? If not, please drop them.
https://review.coreboot.org/c/flashrom/+/54944/comment/afa638da_69ab5f68
PS1, Line 154: 0
Why return 0?
https://review.coreboot.org/c/flashrom/+/54944/comment/dda622a6_9d03416c
PS1, Line 169: register_spi_master(&spi_master_tf53x, NULL);
This function returns something. Why not propagate the return value?
return register_spi_master(&spi_master_tf53x, NULL);
--
To view, visit https://review.coreboot.org/c/flashrom/+/54944
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I109eec4dec89650bb80d3d1da905d33f65f60f5a
Gerrit-Change-Number: 54944
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Comment-Date: Wed, 26 May 2021 08:57:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Paul Menzel, Stefan Reinauer.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54943 )
Change subject: Add AmigaOS suppport to flashrom
......................................................................
Patch Set 1: Code-Review+1
(7 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/54943/comment/1541c8da_5b73dde0
PS1, Line 8:
> How can this be tested? In QEMU?
I'm not sure if it's doable (licensing issues, maybe?), but it would be nice to add a target to util/manibuilder to build-test for AmigaOS.
File Makefile:
https://review.coreboot.org/c/flashrom/+/54943/comment/40641b8f_96cba8e5
PS1, Line 141: Bus Pirate, Serprog and PonyProg are not supported under AmigaOS (missing serial support).
I'd rather not list all the programmers in the comment. Instead, I'd say something like this:
# AmigaOS is missing serial support, disable incompatible programmers
https://review.coreboot.org/c/flashrom/+/54943/comment/0f1aae50_7b64caf7
PS1, Line 157: # Digilent SPI, Dediprog, Developerbox, USB-Blaster, PICkit2, CH341A and FT2232 are not supported under AmigaOS (missing USB support).
Same story here:
# AmigaOS is missing USB support, disable incompatible programmers
https://review.coreboot.org/c/flashrom/+/54943/comment/b9460cae_60a1f251
PS1, Line 213: DOS
AmigaOS
File cli_classic.c:
https://review.coreboot.org/c/flashrom/+/54943/comment/b2517d92_28b543ab
PS1, Line 162: *argv[]
I guess this type is what makes AmigaOS unhappy?
File flash.h:
https://review.coreboot.org/c/flashrom/+/54943/comment/51d11540_5010b230
PS1, Line 55: wrong
Out of curiosity, what does `PRIxPTR` get defined as?
https://review.coreboot.org/c/flashrom/+/54943/comment/9dd92f6b_c2996753
PS1, Line 56: __AMIGA__
Why not use `IS_AMIGA` here?
--
To view, visit https://review.coreboot.org/c/flashrom/+/54943
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3e4a3885f88313aad019454fdbdf4be176b35330
Gerrit-Change-Number: 54943
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Comment-Date: Wed, 26 May 2021 08:26:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-MessageType: comment
Attention is currently required from: Stefan Reinauer.
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54944 )
Change subject: Add support for TerribleFire TF530 SPI controller
......................................................................
Patch Set 1:
(1 comment)
File tf530_spi.c:
https://review.coreboot.org/c/flashrom/+/54944/comment/6a3ad7e9_2d7b77d4
PS1, Line 4: * Copyright (C) 2019 Steven J Leary
This differs from the commit author data.
--
To view, visit https://review.coreboot.org/c/flashrom/+/54944
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I109eec4dec89650bb80d3d1da905d33f65f60f5a
Gerrit-Change-Number: 54944
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Comment-Date: Wed, 26 May 2021 06:20:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Stefan Reinauer.
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/54943 )
Change subject: Add AmigaOS suppport to flashrom
......................................................................
Patch Set 1: Code-Review+1
(2 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/54943/comment/8d4dbf0c_a782cf12
PS1, Line 8:
How can this be tested? In QEMU?
Patchset:
PS1:
Had to look twice to verify I am not misreading. Very nice!
--
To view, visit https://review.coreboot.org/c/flashrom/+/54943
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3e4a3885f88313aad019454fdbdf4be176b35330
Gerrit-Change-Number: 54943
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Comment-Date: Wed, 26 May 2021 06:19:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment