* [PATCH 0/3] Clarify standalone application support @ 2022-05-05 15:32 Paul Barker 2022-05-05 15:32 ` [PATCH 1/3] Licenses: Clarify exceptions for standalone apps Paul Barker ` (2 more replies) 0 siblings, 3 replies; 12+ messages in thread From: Paul Barker @ 2022-05-05 15:32 UTC (permalink / raw) To: u-boot; +Cc: Paul Barker, Wolfgang Denk While looking into the support for u-boot standalone applications I noticed that there was some mis-alignment between the license exception and the files which needed to be included to get a functioning application. I also noticed that the set of SPI access functions defined in the jump table was missing a key function and did not match the set of prototypes defined in the exports header. These patches should rectify the issues I found. Paul Barker (3): Licenses: Clarify exceptions for standalone apps examples: hello_world: Drop inclusion of common header exports: Fix export of SPI access functions Licenses/Exceptions | 12 ++++++++---- examples/standalone/hello_world.c | 1 - include/_exports.h | 4 ++++ include/exports.h | 15 ++++++++++++++- 4 files changed, 26 insertions(+), 6 deletions(-) -- 2.25.1 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/3] Licenses: Clarify exceptions for standalone apps 2022-05-05 15:32 [PATCH 0/3] Clarify standalone application support Paul Barker @ 2022-05-05 15:32 ` Paul Barker 2022-05-11 13:34 ` Tom Rini ` (2 more replies) 2022-05-05 15:32 ` [PATCH 2/3] examples: hello_world: Drop inclusion of common header Paul Barker 2022-05-05 15:32 ` [PATCH 3/3] exports: Fix export of SPI access functions Paul Barker 2 siblings, 3 replies; 12+ messages in thread From: Paul Barker @ 2022-05-05 15:32 UTC (permalink / raw) To: u-boot; +Cc: Paul Barker, Wolfgang Denk On 2010-01-27, an email [1] was sent to the mailing list by Wolfgang Denk which clarified the intended licensing exceptions for standalone applications. As the "export.h" header and the "stubs.c" source files are required to implement a standalone application, the intention was that these files be covered by the licensing exception. This is made clear in the following quotes from that email: "exports.h" should be added to the "allowed" file list; there should be no need to include "common.h". Eventually this needs fixing. Patches are welcome. "examples/standalone/stubs.c" should be added to the "allowed" file list (the ppc_*jmp.S files are LGPLed). There should be no doubts - the intention is clear, the current state may need improvement. Help (read: patches) welcome. [1]: https://lists.denx.de/pipermail/u-boot/2010-January/067174.html Signed-off-by: Paul Barker <paul.barker@sancloud.com> Cc: Wolfgang Denk <wd@denx.de> --- Licenses/Exceptions | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Licenses/Exceptions b/Licenses/Exceptions index c9b3cd981f51..4f241f4aff29 100644 --- a/Licenses/Exceptions +++ b/Licenses/Exceptions @@ -7,9 +7,13 @@ use U-Boot services by means of the jump table provided by U-Boot exactly for this purpose - this is merely considered normal use of U-Boot, and does *not* fall under the heading of "derived work". - The header files "include/image.h" and "arch/*/include/asm/u-boot.h" -define interfaces to U-Boot. Including these (unmodified) header -files in another file is considered normal use of U-Boot, and does -*not* fall under the heading of "derived work". +The following files define interfaces to U-Boot: + * include/image.h + * include/export.h + * arch/*/include/asm/u-boot.h + * examples/standalone/stubs.c + +Including these (unmodified) files in another file is considered normal +use of U-Boot, and does *not* fall under the heading of "derived work". -- Wolfgang Denk -- 2.25.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] Licenses: Clarify exceptions for standalone apps 2022-05-05 15:32 ` [PATCH 1/3] Licenses: Clarify exceptions for standalone apps Paul Barker @ 2022-05-11 13:34 ` Tom Rini 2022-08-26 13:35 ` Wolfgang Denk 2022-10-26 19:26 ` Tom Rini 2 siblings, 0 replies; 12+ messages in thread From: Tom Rini @ 2022-05-11 13:34 UTC (permalink / raw) To: Paul Barker, Wolfgang Denk; +Cc: u-boot [-- Attachment #1: Type: text/plain, Size: 2212 bytes --] On Thu, May 05, 2022 at 03:32:40PM +0000, Paul Barker wrote: > On 2010-01-27, an email [1] was sent to the mailing list by Wolfgang > Denk which clarified the intended licensing exceptions for standalone > applications. As the "export.h" header and the "stubs.c" source files > are required to implement a standalone application, the intention was > that these files be covered by the licensing exception. This is made > clear in the following quotes from that email: > > "exports.h" should be added to the "allowed" file list; there should > be no need to include "common.h". Eventually this needs fixing. > Patches are welcome. > > "examples/standalone/stubs.c" should be added to the "allowed" file > list (the ppc_*jmp.S files are LGPLed). > > There should be no doubts - the intention is clear, the current state > may need improvement. Help (read: patches) welcome. > > [1]: https://lists.denx.de/pipermail/u-boot/2010-January/067174.html > > Signed-off-by: Paul Barker <paul.barker@sancloud.com> > Cc: Wolfgang Denk <wd@denx.de> > --- > Licenses/Exceptions | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/Licenses/Exceptions b/Licenses/Exceptions > index c9b3cd981f51..4f241f4aff29 100644 > --- a/Licenses/Exceptions > +++ b/Licenses/Exceptions > @@ -7,9 +7,13 @@ use U-Boot services by means of the jump table provided by U-Boot > exactly for this purpose - this is merely considered normal use of > U-Boot, and does *not* fall under the heading of "derived work". > > - The header files "include/image.h" and "arch/*/include/asm/u-boot.h" > -define interfaces to U-Boot. Including these (unmodified) header > -files in another file is considered normal use of U-Boot, and does > -*not* fall under the heading of "derived work". > +The following files define interfaces to U-Boot: > + * include/image.h > + * include/export.h > + * arch/*/include/asm/u-boot.h > + * examples/standalone/stubs.c > + > +Including these (unmodified) files in another file is considered normal > +use of U-Boot, and does *not* fall under the heading of "derived work". > -- Wolfgang Denk Wolfgang? -- Tom [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 659 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] Licenses: Clarify exceptions for standalone apps 2022-05-05 15:32 ` [PATCH 1/3] Licenses: Clarify exceptions for standalone apps Paul Barker 2022-05-11 13:34 ` Tom Rini @ 2022-08-26 13:35 ` Wolfgang Denk 2022-10-26 19:26 ` Tom Rini 2 siblings, 0 replies; 12+ messages in thread From: Wolfgang Denk @ 2022-08-26 13:35 UTC (permalink / raw) To: Paul Barker; +Cc: u-boot Dear Paul Barker, In message <20220505153242.1598807-2-paul.barker@sancloud.com> you wrote: > On 2010-01-27, an email [1] was sent to the mailing list by Wolfgang > Denk which clarified the intended licensing exceptions for standalone > applications. As the "export.h" header and the "stubs.c" source files > are required to implement a standalone application, the intention was > that these files be covered by the licensing exception. This is made > clear in the following quotes from that email: > > "exports.h" should be added to the "allowed" file list; there should > be no need to include "common.h". Eventually this needs fixing. > Patches are welcome. > > "examples/standalone/stubs.c" should be added to the "allowed" file > list (the ppc_*jmp.S files are LGPLed). > > There should be no doubts - the intention is clear, the current state > may need improvement. Help (read: patches) welcome. > > [1]: https://lists.denx.de/pipermail/u-boot/2010-January/067174.html > > Signed-off-by: Paul Barker <paul.barker@sancloud.com> > Cc: Wolfgang Denk <wd@denx.de> Acked-by: Wolfgang Denk <wd@denx.de> Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr. 5, 82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de It usually takes more than three weeks to prepare a good impromptu speech. - Mark Twain ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] Licenses: Clarify exceptions for standalone apps 2022-05-05 15:32 ` [PATCH 1/3] Licenses: Clarify exceptions for standalone apps Paul Barker 2022-05-11 13:34 ` Tom Rini 2022-08-26 13:35 ` Wolfgang Denk @ 2022-10-26 19:26 ` Tom Rini 2 siblings, 0 replies; 12+ messages in thread From: Tom Rini @ 2022-10-26 19:26 UTC (permalink / raw) To: Paul Barker; +Cc: u-boot, Wolfgang Denk [-- Attachment #1: Type: text/plain, Size: 1161 bytes --] On Thu, May 05, 2022 at 03:32:40PM +0000, Paul Barker wrote: > On 2010-01-27, an email [1] was sent to the mailing list by Wolfgang > Denk which clarified the intended licensing exceptions for standalone > applications. As the "export.h" header and the "stubs.c" source files > are required to implement a standalone application, the intention was > that these files be covered by the licensing exception. This is made > clear in the following quotes from that email: > > "exports.h" should be added to the "allowed" file list; there should > be no need to include "common.h". Eventually this needs fixing. > Patches are welcome. > > "examples/standalone/stubs.c" should be added to the "allowed" file > list (the ppc_*jmp.S files are LGPLed). > > There should be no doubts - the intention is clear, the current state > may need improvement. Help (read: patches) welcome. > > [1]: https://lists.denx.de/pipermail/u-boot/2010-January/067174.html > > Signed-off-by: Paul Barker <paul.barker@sancloud.com> > Cc: Wolfgang Denk <wd@denx.de> > Acked-by: Wolfgang Denk <wd@denx.de> Applied to u-boot/master, thanks! -- Tom [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 659 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/3] examples: hello_world: Drop inclusion of common header 2022-05-05 15:32 [PATCH 0/3] Clarify standalone application support Paul Barker 2022-05-05 15:32 ` [PATCH 1/3] Licenses: Clarify exceptions for standalone apps Paul Barker @ 2022-05-05 15:32 ` Paul Barker 2022-05-11 13:34 ` Tom Rini ` (2 more replies) 2022-05-05 15:32 ` [PATCH 3/3] exports: Fix export of SPI access functions Paul Barker 2 siblings, 3 replies; 12+ messages in thread From: Paul Barker @ 2022-05-05 15:32 UTC (permalink / raw) To: u-boot; +Cc: Paul Barker The "common.h" header is not covered by the licensing exception for standalone applications. Let's drop inclusion of this header from the hello_world example to prove that a standalone app can be built without it. Signed-off-by: Paul Barker <paul.barker@sancloud.com> --- examples/standalone/hello_world.c | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/standalone/hello_world.c b/examples/standalone/hello_world.c index 263cd9ca079d..27ec3793155d 100644 --- a/examples/standalone/hello_world.c +++ b/examples/standalone/hello_world.c @@ -4,7 +4,6 @@ * Wolfgang Denk, DENX Software Engineering, wd@denx.de. */ -#include <common.h> #include <exports.h> int hello_world(int argc, char *const argv[]) -- 2.25.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 2/3] examples: hello_world: Drop inclusion of common header 2022-05-05 15:32 ` [PATCH 2/3] examples: hello_world: Drop inclusion of common header Paul Barker @ 2022-05-11 13:34 ` Tom Rini 2022-08-26 13:36 ` Wolfgang Denk 2022-10-26 19:26 ` Tom Rini 2 siblings, 0 replies; 12+ messages in thread From: Tom Rini @ 2022-05-11 13:34 UTC (permalink / raw) To: Paul Barker; +Cc: u-boot [-- Attachment #1: Type: text/plain, Size: 409 bytes --] On Thu, May 05, 2022 at 03:32:41PM +0000, Paul Barker wrote: > The "common.h" header is not covered by the licensing exception for > standalone applications. Let's drop inclusion of this header from the > hello_world example to prove that a standalone app can be built without > it. > > Signed-off-by: Paul Barker <paul.barker@sancloud.com> Reviewed-by: Tom Rini <trini@konsulko.com> -- Tom [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 659 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/3] examples: hello_world: Drop inclusion of common header 2022-05-05 15:32 ` [PATCH 2/3] examples: hello_world: Drop inclusion of common header Paul Barker 2022-05-11 13:34 ` Tom Rini @ 2022-08-26 13:36 ` Wolfgang Denk 2022-10-26 19:26 ` Tom Rini 2 siblings, 0 replies; 12+ messages in thread From: Wolfgang Denk @ 2022-08-26 13:36 UTC (permalink / raw) To: Paul Barker Dear Paul, In message <20220505153242.1598807-3-paul.barker@sancloud.com> you wrote: > The "common.h" header is not covered by the licensing exception for > standalone applications. Let's drop inclusion of this header from the > hello_world example to prove that a standalone app can be built without > it. > > Signed-off-by: Paul Barker <paul.barker@sancloud.com> > --- > examples/standalone/hello_world.c | 1 - > 1 file changed, 1 deletion(-) Acked-off-by: Wolfgang Denk <wd@denx.de> Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr. 5, 82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de An expert is a person who avoids the small errors while sweeping on to the grand fallacy. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/3] examples: hello_world: Drop inclusion of common header 2022-05-05 15:32 ` [PATCH 2/3] examples: hello_world: Drop inclusion of common header Paul Barker 2022-05-11 13:34 ` Tom Rini 2022-08-26 13:36 ` Wolfgang Denk @ 2022-10-26 19:26 ` Tom Rini 2 siblings, 0 replies; 12+ messages in thread From: Tom Rini @ 2022-10-26 19:26 UTC (permalink / raw) To: Paul Barker; +Cc: u-boot [-- Attachment #1: Type: text/plain, Size: 446 bytes --] On Thu, May 05, 2022 at 03:32:41PM +0000, Paul Barker wrote: > The "common.h" header is not covered by the licensing exception for > standalone applications. Let's drop inclusion of this header from the > hello_world example to prove that a standalone app can be built without > it. > > Signed-off-by: Paul Barker <paul.barker@sancloud.com> > Reviewed-by: Tom Rini <trini@konsulko.com> Applied to u-boot/master, thanks! -- Tom [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 659 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/3] exports: Fix export of SPI access functions 2022-05-05 15:32 [PATCH 0/3] Clarify standalone application support Paul Barker 2022-05-05 15:32 ` [PATCH 1/3] Licenses: Clarify exceptions for standalone apps Paul Barker 2022-05-05 15:32 ` [PATCH 2/3] examples: hello_world: Drop inclusion of common header Paul Barker @ 2022-05-05 15:32 ` Paul Barker 2022-05-11 13:34 ` Tom Rini 2022-08-26 13:42 ` Wolfgang Denk 2 siblings, 2 replies; 12+ messages in thread From: Paul Barker @ 2022-05-05 15:32 UTC (permalink / raw) To: u-boot; +Cc: Paul Barker * With CONFIG_DM_SPI defined, spi_get_bus_and_cs needs to be used instead of spi_setup_slave to configure a SPI bus. As spi_setup_slave is already present in the export list it is reasonable to also export spi_get_bus_and_cs. * For the functions listed in the jump table to be callable they must also be defined in the "exports.h" header. Define the various exported SPI functions so that they can be used. Signed-off-by: Paul Barker <paul.barker@sancloud.com> --- include/_exports.h | 4 ++++ include/exports.h | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/include/_exports.h b/include/_exports.h index f6df8b610734..3457a92c95ad 100644 --- a/include/_exports.h +++ b/include/_exports.h @@ -60,11 +60,15 @@ EXPORT_FUNC(dummy, void, spi_claim_bus, void) EXPORT_FUNC(dummy, void, spi_release_bus, void) EXPORT_FUNC(dummy, void, spi_xfer, void) + EXPORT_FUNC(dummy, void, spi_get_bus_and_cs, void) #else EXPORT_FUNC(spi_claim_bus, int, spi_claim_bus, struct spi_slave *) EXPORT_FUNC(spi_release_bus, void, spi_release_bus, struct spi_slave *) EXPORT_FUNC(spi_xfer, int, spi_xfer, struct spi_slave *, unsigned int, const void *, void *, unsigned long) + EXPORT_FUNC(spi_get_bus_and_cs, int, spi_get_bus_and_cs, int, int, int, + int, const char *, const char *, struct udevice **, + struct spi_slave **) #endif EXPORT_FUNC(ustrtoul, unsigned long, ustrtoul, const char *, char **, unsigned int) diff --git a/include/exports.h b/include/exports.h index 6f8c9cf4517e..93110d63a235 100644 --- a/include/exports.h +++ b/include/exports.h @@ -53,6 +53,19 @@ unsigned long long ustrtoull(const char *cp, char **endp, unsigned int base); int i2c_write (uchar, uint, int , uchar* , int); int i2c_read (uchar, uint, int , uchar* , int); #endif +#ifdef CONFIG_CMD_SPI +#ifndef CONFIG_DM_SPI +struct spi_slave * spi_setup_slave(unsigned int, unsigned int, + unsigned int, unsigned int); +void spi_free_slave(struct spi_slave *); +#endif +int spi_claim_bus(struct spi_slave *); +void spi_release_bus(struct spi_slave *); +int spi_xfer(struct spi_slave *, unsigned int, const void *, void *, + unsigned long); +int spi_get_bus_and_cs(int, int, int, int, const char *, const char *, + struct udevice **, struct spi_slave **); +#endif #ifdef CONFIG_PHY_AQUANTIA struct mii_dev *mdio_get_current_dev(void); struct phy_device *phy_find_by_mask(struct mii_dev *bus, unsigned phy_mask); @@ -71,7 +84,7 @@ struct jt_funcs { }; -#define XF_VERSION 9 +#define XF_VERSION 10 #if defined(CONFIG_X86) extern gd_t *global_data; -- 2.25.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] exports: Fix export of SPI access functions 2022-05-05 15:32 ` [PATCH 3/3] exports: Fix export of SPI access functions Paul Barker @ 2022-05-11 13:34 ` Tom Rini 2022-08-26 13:42 ` Wolfgang Denk 1 sibling, 0 replies; 12+ messages in thread From: Tom Rini @ 2022-05-11 13:34 UTC (permalink / raw) To: Paul Barker; +Cc: u-boot [-- Attachment #1: Type: text/plain, Size: 615 bytes --] On Thu, May 05, 2022 at 03:32:42PM +0000, Paul Barker wrote: > * With CONFIG_DM_SPI defined, spi_get_bus_and_cs needs to be used > instead of spi_setup_slave to configure a SPI bus. As spi_setup_slave is > already present in the export list it is reasonable to also export > spi_get_bus_and_cs. > > * For the functions listed in the jump table to be callable they must > also be defined in the "exports.h" header. Define the various exported > SPI functions so that they can be used. > > Signed-off-by: Paul Barker <paul.barker@sancloud.com> Reviewed-by: Tom Rini <trini@konsulko.com> -- Tom [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 659 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] exports: Fix export of SPI access functions 2022-05-05 15:32 ` [PATCH 3/3] exports: Fix export of SPI access functions Paul Barker 2022-05-11 13:34 ` Tom Rini @ 2022-08-26 13:42 ` Wolfgang Denk 1 sibling, 0 replies; 12+ messages in thread From: Wolfgang Denk @ 2022-08-26 13:42 UTC (permalink / raw) To: Paul Barker; +Cc: u-boot Dear Paul, In message <20220505153242.1598807-4-paul.barker@sancloud.com> you wrote: > * With CONFIG_DM_SPI defined, spi_get_bus_and_cs needs to be used > instead of spi_setup_slave to configure a SPI bus. As spi_setup_slave is > already present in the export list it is reasonable to also export > spi_get_bus_and_cs. > > * For the functions listed in the jump table to be callable they must > also be defined in the "exports.h" header. Define the various exported > SPI functions so that they can be used. > > Signed-off-by: Paul Barker <paul.barker@sancloud.com> > --- > include/_exports.h | 4 ++++ > include/exports.h | 15 ++++++++++++++- > 2 files changed, 18 insertions(+), 1 deletion(-) Sorry, but I disagree here. The SPI functions should have never been part of the export interface. As far as I can see now, they have been added by commit bedd8403f7 export SPI functions to standalone apps While we're here, fix the broken #ifdef handling in _exports.h. Signed-off-by: Mike Frysinger <vapier@gentoo.org> in 2009. Actually I must even have seen them, as I complained about incorrect comment style :-( But no, SPI support should not be inclluded. I2C was there because it was needed for reading the environment from an EEPROM, but then the interface was frozen ano no more new interfices / drivers should be allowed. Viele Grüße, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr. 5, 82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de If you can't explain it to a six year old, you don't understand it yourself. - Albert Einstein ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2022-10-26 19:27 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-05-05 15:32 [PATCH 0/3] Clarify standalone application support Paul Barker 2022-05-05 15:32 ` [PATCH 1/3] Licenses: Clarify exceptions for standalone apps Paul Barker 2022-05-11 13:34 ` Tom Rini 2022-08-26 13:35 ` Wolfgang Denk 2022-10-26 19:26 ` Tom Rini 2022-05-05 15:32 ` [PATCH 2/3] examples: hello_world: Drop inclusion of common header Paul Barker 2022-05-11 13:34 ` Tom Rini 2022-08-26 13:36 ` Wolfgang Denk 2022-10-26 19:26 ` Tom Rini 2022-05-05 15:32 ` [PATCH 3/3] exports: Fix export of SPI access functions Paul Barker 2022-05-11 13:34 ` Tom Rini 2022-08-26 13:42 ` Wolfgang Denk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).