efi spi flash support - where to place
Hi all,
first of all, I am new to this group/grub. So please be patient if I violate some group internal rules, just point it out. Formerly I worked many years on U-Boot.
I have made a driver and command line tool for accessing SPI NOR flash via EFI interface which I would like to upstream.
Q: where to place the efi driver, where to place the command line handler.
Currently I'd say
- create grub-core/flash/efispinor.c for the driver
- create grub-core/commands/efi/efispinor.c for the command line tool.
Is this acceptable?
Is there any specific branch where these files should go into?
KR
Michael
Dear Michael,
Am 19.01.21 um 11:38 schrieb Michael Lawnick:
Quoted 3 lines
first of all, I am new to this group/grub. So please be patient if I violate some group internal rules, just point it out. Formerly I worked many years on U-Boot.
Welcome to GRUB, and no worries. Plain text emails, and polite. What more can we wish for. ;-)
Quoted 2 lines
I have made a driver and command line tool for accessing SPI NOR flash via EFI interface which I would like to upstream.
Very nice.
Quoted 4 lines
Q: where to place the efi driver, where to place the command line handler.
Currently I'd say
- creategrub-core/flash/efispinor.cfor the driver
I guess, that would be fine, but I found, grub-core/bus/spi/rk3288_spi.c, so I suggest to place it there.
Quoted 1 line
- create
grub-core/commands/efi/efispinor.cfor the command line tool.
Can you please elaborate on the usage? Couldn’t it be some generic tool, and it doesn’t matter, what interface in the background?
[…]
I am looking forward to this patch. I have no idea, if it will get into the next release. But as it’s a new driver and command not affecting existing stuff, an exception could be made.
Kind regards,
Paul
Am 22.01.2021 um 07:51 schrieb Paul Menzel:
Quoted 8 lines
Am 19.01.21 um 11:38 schrieb Michael Lawnick:
Quoted 4 lines
Q: where to place the efi driver, where to place the command line handler.
Currently I'd say
- creategrub-core/flash/efispinor.cfor the driverI guess, that would be fine, but I found,
grub-core/bus/spi/rk3288_spi.c, so I suggest to place it there.
I'll check for a move before sending the patch set.
Version to patch against is 6213184b26689fa2e3db297b54cf4eb1713bcad1 , right?
Quoted 4 lines
Quoted 1 line
- create
grub-core/commands/efi/efispinor.cfor the command line tool.Can you please elaborate on the usage? Couldn’t it be some generic tool, and it doesn’t matter, what interface in the background?
efispinor.c contains commands 'spinor init|read|write|erase'. i.e. commands to work with flash through efi.
Adding a SPI bus driver like rk3288_spi.c into this implies an additional SPI flash layer which then bases on the SPI bus controller. This is something I wouldn't be able to test due to missing H/W and adds a huge amount of work (which I guess my company isn't interested in to pay ;-) )
If there were already a flash command layer there wouldn't be any issue to integrate into that. But I didn't see it.
May be in flow of discussion we can rearrange my code in such way that it easily integrates to a possibly upcoming flash command frame work.
Quoted 3 lines
I am looking forward to this patch. I have no idea, if it will get into the next release. But as it’s a new driver and command not affecting existing stuff, an exception could be made.
I'm not (yet) in sync with grub timeline, when is next release planned (last commit date)?
--
KR
Michael
Dear Michael,
Am 22.01.21 um 10:42 schrieb Michael Lawnick:
Quoted 7 lines
Am 22.01.2021 um 07:51 schrieb Paul Menzel:
Quoted 6 lines
Am 19.01.21 um 11:38 schrieb Michael Lawnick:
Quoted 4 lines
Q: where to place the efi driver, where to place the command line handler.
Currently I'd say
- creategrub-core/flash/efispinor.cfor the driver
Quoted 6 lines
Quoted 2 lines
I guess, that would be fine, but I found,
grub-core/bus/spi/rk3288_spi.c, so I suggest to place it there.I'll check for a move before sending the patch set.
Version to patch against is6213184b26689fa2e3db297b54cf4eb1713bcad1, right?
Sounds right – whatever is at the top in master. I don’t expect conflicts, these are new files.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
- create
grub-core/commands/efi/efispinor.cfor the command line tool.Can you please elaborate on the usage? Couldn’t it be some generic tool, and it doesn’t matter, what interface in the background?
efispinor.ccontains commands 'spinor init|read|write|erase'. i.e. commands to work with flash through efi.
But the command is generic, isn’t it? Shouldn’t that go into grub-core/commands/flash/spinor.c at least?
Quoted 9 lines
Adding a SPI bus driver like
rk3288_spi.cinto this implies an additional SPI flash layer which then bases on the SPI bus controller. This is something I wouldn't be able to test due to missing H/W and adds a huge amount of work (which I guess my company isn't interested in to pay ;-) )
If there were already a flash command layer there wouldn't be any issue to integrate into that. But I didn't see it.
May be in flow of discussion we can rearrange my code in such way that it easily integrates to a possibly upcoming flash command frame work.
Yes, please post the patch first.
Quoted 6 lines
Quoted 3 lines
I am looking forward to this patch. I have no idea, if it will get into the next release. But as it’s a new driver and command not affecting existing stuff, an exception could be made.
I'm not (yet) in sync with grub timeline, when is next release planned (last commit date)?
March *last* year sometime? ;-) I think the current date is March, though re-reading the list posts, do not hold your breath, that it will be committed, as the maintainers won’t have time to apply the commit.
Kind regards,
Paul
Am 22.01.2021 um 16:58 schrieb Paul Menzel:
Quoted 6 lines
Quoted 2 lines
I'm not (yet) in sync with grub timeline, when is next release planned (last commit date)?
March *last* year sometime? ;-) I think the current date is March, though re-reading the list posts, do not hold your breath, that it will be committed, as the maintainers won’t have time to apply the commit.
:-)
My commitr is currently in approval process for upstream by company. Hope to get a 'go' next week.
In parallel I am now working on EFI_PCI_IO_CONTROL and run into a problem while trying to find a common API:
From U-Boot I am accustomed to #define CONFIG_xxxxx usage. This approach seems not to be used in GRUB but just module selection.
How can I control compilation of component selection dependent code parts, especially in header files?
e.g. something like this (noted just for demo)
#ifdef EFI_PCI
typedef struct pci_dev {EFI_type *attr1;EFI_type *attr2;
};
#else
typedef struct pci_dev {grub_type *attr3;grub_type *attr4;
};
#endif
--
KR
Michael
Dear Michael,
Am 01.02.21 um 10:46 schrieb Michael Lawnick:
Quoted 4 lines
Am 22.01.2021 um 16:58 schrieb Paul Menzel:
Quoted 3 lines
Quoted 2 lines
I'm not (yet) in sync with grub timeline, when is next release planned (last commit date)?
Quoted 8 lines
Quoted 3 lines
March *last* year sometime? ;-) I think the current date is March, though re-reading the list posts, do not hold your breath, that it will be committed, as the maintainers won’t have time to apply the commit.
:-)
My commit is currently in approval process for upstream by company. Hope to get a 'go' next week.
Awesome. Thank you for going the extra mile to upstream the stuff.
Quoted 2 lines
In parallel I am now working on
EFI_PCI_IO_CONTROLand run into a problem while trying to find a common API:
[…]
Please start a new thread with a new descriptive subject line for this issue to increase your chances of getting a response, and to follow the mailing list netiquette.
Kind regards,
Paul