* [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options @ 2017-01-17 15:50 Emmanuel Vadot 2017-01-17 15:50 ` [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file Emmanuel Vadot ` (5 more replies) 0 siblings, 6 replies; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-17 15:50 UTC (permalink / raw) To: u-boot This series of patches add the needed bits for booting the FreeBSD loader and kernel. FreeBSD loader and kernel needs the U-Boot API and dcache/icache flushed for it to run so add this operation in go/bootelf command and when closing the API. Also add some some boot command that locate and run the FreeBSD loader if found. Changes in v2: Remove SYS_DCACHE_OFF option Flush dcache/icache in go/boot command Flush dcache/icache in API closedev Emmanuel Vadot (3): kconfig: Add API kconfig file kconfig: Add a FREEBSD option distro_bootcmd: Add command to run FreeBSD Warner Losh (1): api: FreeBSD: flush cache before starting loader/kernel Kconfig | 2 ++ api/Kconfig | 9 +++++++++ api/api.c | 5 +++++ cmd/boot.c | 5 +++++ cmd/elf.c | 8 +++++++- common/Kconfig | 9 +++++++++ include/config_distro_bootcmd.h | 32 ++++++++++++++++++++++++++++++++ 7 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 api/Kconfig -- 2.11.0 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file 2017-01-17 15:50 [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options Emmanuel Vadot @ 2017-01-17 15:50 ` Emmanuel Vadot 2017-01-17 17:16 ` Andreas Färber 2017-01-21 3:51 ` Simon Glass 2017-01-17 15:50 ` [U-Boot] [PATCH v2 2/4] kconfig: Add a FREEBSD option Emmanuel Vadot ` (4 subsequent siblings) 5 siblings, 2 replies; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-17 15:50 UTC (permalink / raw) To: u-boot Add kconfig file to enable API support Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> --- Kconfig | 2 ++ api/Kconfig | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 api/Kconfig diff --git a/Kconfig b/Kconfig index 39a4d938d8..6a93d8820f 100644 --- a/Kconfig +++ b/Kconfig @@ -306,6 +306,8 @@ config ARCH_FIXUP_FDT_MEMORY endmenu # Boot images +source "api/Kconfig" + source "common/Kconfig" source "cmd/Kconfig" diff --git a/api/Kconfig b/api/Kconfig new file mode 100644 index 0000000000..88b4f6c4e5 --- /dev/null +++ b/api/Kconfig @@ -0,0 +1,9 @@ +menu "API" + +config API + bool "Enable U-Boot API" + default n + help + This option enable the U-Boot API. + +endmenu -- 2.11.0 ^ permalink raw reply related [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file 2017-01-17 15:50 ` [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file Emmanuel Vadot @ 2017-01-17 17:16 ` Andreas Färber 2017-01-17 19:40 ` Emmanuel Vadot 2017-01-21 3:51 ` Simon Glass 1 sibling, 1 reply; 29+ messages in thread From: Andreas Färber @ 2017-01-17 17:16 UTC (permalink / raw) To: u-boot Am 17.01.2017 um 16:50 schrieb Emmanuel Vadot: > Add kconfig file to enable API support > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> > --- > Kconfig | 2 ++ > api/Kconfig | 9 +++++++++ > 2 files changed, 11 insertions(+) > create mode 100644 api/Kconfig > > diff --git a/Kconfig b/Kconfig > index 39a4d938d8..6a93d8820f 100644 > --- a/Kconfig > +++ b/Kconfig > @@ -306,6 +306,8 @@ config ARCH_FIXUP_FDT_MEMORY > > endmenu # Boot images > > +source "api/Kconfig" > + > source "common/Kconfig" > > source "cmd/Kconfig" > diff --git a/api/Kconfig b/api/Kconfig > new file mode 100644 > index 0000000000..88b4f6c4e5 > --- /dev/null > +++ b/api/Kconfig > @@ -0,0 +1,9 @@ > +menu "API" > + > +config API > + bool "Enable U-Boot API" > + default n > + help > + This option enable the U-Boot API. "enables" Should the help say, e.g., "userspace API" for clarity? > + > +endmenu Otherwise looks okay, obviously. Regards, Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg) ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file 2017-01-17 17:16 ` Andreas Färber @ 2017-01-17 19:40 ` Emmanuel Vadot 2017-01-17 19:51 ` Warner Losh 0 siblings, 1 reply; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-17 19:40 UTC (permalink / raw) To: u-boot Hi Andreas, On Tue, 17 Jan 2017 18:16:58 +0100 Andreas F?rber <afaerber@suse.de> wrote: > Am 17.01.2017 um 16:50 schrieb Emmanuel Vadot: > > Add kconfig file to enable API support > > > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> > > --- > > Kconfig | 2 ++ > > api/Kconfig | 9 +++++++++ > > 2 files changed, 11 insertions(+) > > create mode 100644 api/Kconfig > > > > diff --git a/Kconfig b/Kconfig > > index 39a4d938d8..6a93d8820f 100644 > > --- a/Kconfig > > +++ b/Kconfig > > @@ -306,6 +306,8 @@ config ARCH_FIXUP_FDT_MEMORY > > > > endmenu # Boot images > > > > +source "api/Kconfig" > > + > > source "common/Kconfig" > > > > source "cmd/Kconfig" > > diff --git a/api/Kconfig b/api/Kconfig > > new file mode 100644 > > index 0000000000..88b4f6c4e5 > > --- /dev/null > > +++ b/api/Kconfig > > @@ -0,0 +1,9 @@ > > +menu "API" > > + > > +config API > > + bool "Enable U-Boot API" > > + default n > > + help > > + This option enable the U-Boot API. > > "enables" I'll change that, thanks for reviewing. > Should the help say, e.g., "userspace API" for clarity? I don't know, I'm for whatever is best. > > > + > > +endmenu > > Otherwise looks okay, obviously. > > Regards, > Andreas > > -- > SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany > GF: Felix Imend?rffer, Jane Smithard, Graham Norton > HRB 21284 (AG N?rnberg) -- Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file 2017-01-17 19:40 ` Emmanuel Vadot @ 2017-01-17 19:51 ` Warner Losh 0 siblings, 0 replies; 29+ messages in thread From: Warner Losh @ 2017-01-17 19:51 UTC (permalink / raw) To: u-boot On Tue, Jan 17, 2017 at 12:40 PM, Emmanuel Vadot <manu@bidouilliste.com> wrote: > > Hi Andreas, > > On Tue, 17 Jan 2017 18:16:58 +0100 > Andreas F?rber <afaerber@suse.de> wrote: > >> Am 17.01.2017 um 16:50 schrieb Emmanuel Vadot: >> > Add kconfig file to enable API support >> > >> > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> >> > --- >> > Kconfig | 2 ++ >> > api/Kconfig | 9 +++++++++ >> > 2 files changed, 11 insertions(+) >> > create mode 100644 api/Kconfig >> > >> > diff --git a/Kconfig b/Kconfig >> > index 39a4d938d8..6a93d8820f 100644 >> > --- a/Kconfig >> > +++ b/Kconfig >> > @@ -306,6 +306,8 @@ config ARCH_FIXUP_FDT_MEMORY >> > >> > endmenu # Boot images >> > >> > +source "api/Kconfig" >> > + >> > source "common/Kconfig" >> > >> > source "cmd/Kconfig" >> > diff --git a/api/Kconfig b/api/Kconfig >> > new file mode 100644 >> > index 0000000000..88b4f6c4e5 >> > --- /dev/null >> > +++ b/api/Kconfig >> > @@ -0,0 +1,9 @@ >> > +menu "API" >> > + >> > +config API >> > + bool "Enable U-Boot API" >> > + default n >> > + help >> > + This option enable the U-Boot API. >> >> "enables" > > I'll change that, thanks for reviewing. > >> Should the help say, e.g., "userspace API" for clarity? > > I don't know, I'm for whatever is best. It isn't a userspace API, per se, since it isn't used after the kernel is loaded and booted. It's likely to lead to confusion if use use that term. The README file calls it "U-Boot machine/arch independent API for external apps" FWIW, so maybe some variation on that might make the help text better. Warner Losh <imp@freebsd.org> >> > + >> > +endmenu >> >> Otherwise looks okay, obviously. >> >> Regards, >> Andreas >> >> -- >> SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany >> GF: Felix Imend?rffer, Jane Smithard, Graham Norton >> HRB 21284 (AG N?rnberg) > > > -- > Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file 2017-01-17 15:50 ` [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file Emmanuel Vadot 2017-01-17 17:16 ` Andreas Färber @ 2017-01-21 3:51 ` Simon Glass 2017-01-22 4:22 ` Warner Losh 2017-01-23 12:48 ` Emmanuel Vadot 1 sibling, 2 replies; 29+ messages in thread From: Simon Glass @ 2017-01-21 3:51 UTC (permalink / raw) To: u-boot Hi, On 17 January 2017 at 08:50, Emmanuel Vadot <manu@bidouilliste.com> wrote: > Add kconfig file to enable API support > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> > --- > Kconfig | 2 ++ > api/Kconfig | 9 +++++++++ > 2 files changed, 11 insertions(+) > create mode 100644 api/Kconfig > > diff --git a/Kconfig b/Kconfig > index 39a4d938d8..6a93d8820f 100644 > --- a/Kconfig > +++ b/Kconfig > @@ -306,6 +306,8 @@ config ARCH_FIXUP_FDT_MEMORY > > endmenu # Boot images > > +source "api/Kconfig" > + > source "common/Kconfig" > > source "cmd/Kconfig" > diff --git a/api/Kconfig b/api/Kconfig > new file mode 100644 > index 0000000000..88b4f6c4e5 > --- /dev/null > +++ b/api/Kconfig > @@ -0,0 +1,9 @@ > +menu "API" > + > +config API > + bool "Enable U-Boot API" > + default n > + help > + This option enable the U-Boot API. Can you add a little detail about what the API is and what it is for? Also, are you going to migrate all boards to use Kconfig for this option and drop it from the whitelist? > + > +endmenu > -- > 2.11.0 > Regards, Simon ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file 2017-01-21 3:51 ` Simon Glass @ 2017-01-22 4:22 ` Warner Losh 2017-01-23 14:51 ` Tom Rini 2017-01-23 12:48 ` Emmanuel Vadot 1 sibling, 1 reply; 29+ messages in thread From: Warner Losh @ 2017-01-22 4:22 UTC (permalink / raw) To: u-boot On Fri, Jan 20, 2017 at 8:51 PM, Simon Glass <sjg@chromium.org> wrote: > Hi, > > On 17 January 2017 at 08:50, Emmanuel Vadot <manu@bidouilliste.com> wrote: >> Add kconfig file to enable API support >> >> Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> >> --- >> Kconfig | 2 ++ >> api/Kconfig | 9 +++++++++ >> 2 files changed, 11 insertions(+) >> create mode 100644 api/Kconfig >> >> diff --git a/Kconfig b/Kconfig >> index 39a4d938d8..6a93d8820f 100644 >> --- a/Kconfig >> +++ b/Kconfig >> @@ -306,6 +306,8 @@ config ARCH_FIXUP_FDT_MEMORY >> >> endmenu # Boot images >> >> +source "api/Kconfig" >> + >> source "common/Kconfig" >> >> source "cmd/Kconfig" >> diff --git a/api/Kconfig b/api/Kconfig >> new file mode 100644 >> index 0000000000..88b4f6c4e5 >> --- /dev/null >> +++ b/api/Kconfig >> @@ -0,0 +1,9 @@ >> +menu "API" >> + >> +config API >> + bool "Enable U-Boot API" >> + default n >> + help >> + This option enable the U-Boot API. > > Can you add a little detail about what the API is and what it is for? You can find complete documentation in the api directory. In brief, it allows the loaded binary to call back into the loader to do generic things like send network packets or read blocks from mass storage. > Also, are you going to migrate all boards to use Kconfig for this > option and drop it from the whitelist? I'll leave that to Emmanuel. Warner >> + >> +endmenu >> -- >> 2.11.0 >> > > Regards, > Simon ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file 2017-01-22 4:22 ` Warner Losh @ 2017-01-23 14:51 ` Tom Rini 2017-01-23 16:05 ` Emmanuel Vadot 0 siblings, 1 reply; 29+ messages in thread From: Tom Rini @ 2017-01-23 14:51 UTC (permalink / raw) To: u-boot On Sat, Jan 21, 2017 at 09:22:47PM -0700, Warner Losh wrote: > On Fri, Jan 20, 2017 at 8:51 PM, Simon Glass <sjg@chromium.org> wrote: > > Hi, > > > > On 17 January 2017 at 08:50, Emmanuel Vadot <manu@bidouilliste.com> wrote: > >> Add kconfig file to enable API support > >> > >> Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> > >> --- > >> Kconfig | 2 ++ > >> api/Kconfig | 9 +++++++++ > >> 2 files changed, 11 insertions(+) > >> create mode 100644 api/Kconfig > >> > >> diff --git a/Kconfig b/Kconfig > >> index 39a4d938d8..6a93d8820f 100644 > >> --- a/Kconfig > >> +++ b/Kconfig > >> @@ -306,6 +306,8 @@ config ARCH_FIXUP_FDT_MEMORY > >> > >> endmenu # Boot images > >> > >> +source "api/Kconfig" > >> + > >> source "common/Kconfig" > >> > >> source "cmd/Kconfig" > >> diff --git a/api/Kconfig b/api/Kconfig > >> new file mode 100644 > >> index 0000000000..88b4f6c4e5 > >> --- /dev/null > >> +++ b/api/Kconfig > >> @@ -0,0 +1,9 @@ > >> +menu "API" > >> + > >> +config API > >> + bool "Enable U-Boot API" > >> + default n > >> + help > >> + This option enable the U-Boot API. > > > > Can you add a little detail about what the API is and what it is for? > > You can find complete documentation in the api directory. In brief, it > allows the loaded binary to call back into the loader to do generic > things like send network packets or read blocks from mass storage. Right. Can you re-word the "In brief.." slightly so it reads well under the 'help' section and point to api/README for more details please? > > Also, are you going to migrate all boards to use Kconfig for this > > option and drop it from the whitelist? > > I'll leave that to Emmanuel. There's two boards that enable API today but tools/moveconfig.py may be more overhead than just editing configs/PMC440_defconfig and configs/lsxhl_defconfig (and the respective include/configs/ files). -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170123/c8f1541a/attachment.sig> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file 2017-01-23 14:51 ` Tom Rini @ 2017-01-23 16:05 ` Emmanuel Vadot 2017-01-23 16:22 ` Tom Rini 0 siblings, 1 reply; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-23 16:05 UTC (permalink / raw) To: u-boot Hi Tom, On Mon, 23 Jan 2017 09:51:59 -0500 Tom Rini <trini@konsulko.com> wrote: > On Sat, Jan 21, 2017 at 09:22:47PM -0700, Warner Losh wrote: > > On Fri, Jan 20, 2017 at 8:51 PM, Simon Glass <sjg@chromium.org> wrote: > > > Hi, > > > > > > On 17 January 2017 at 08:50, Emmanuel Vadot <manu@bidouilliste.com> wrote: > > >> Add kconfig file to enable API support > > >> > > >> Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> > > >> --- > > >> Kconfig | 2 ++ > > >> api/Kconfig | 9 +++++++++ > > >> 2 files changed, 11 insertions(+) > > >> create mode 100644 api/Kconfig > > >> > > >> diff --git a/Kconfig b/Kconfig > > >> index 39a4d938d8..6a93d8820f 100644 > > >> --- a/Kconfig > > >> +++ b/Kconfig > > >> @@ -306,6 +306,8 @@ config ARCH_FIXUP_FDT_MEMORY > > >> > > >> endmenu # Boot images > > >> > > >> +source "api/Kconfig" > > >> + > > >> source "common/Kconfig" > > >> > > >> source "cmd/Kconfig" > > >> diff --git a/api/Kconfig b/api/Kconfig > > >> new file mode 100644 > > >> index 0000000000..88b4f6c4e5 > > >> --- /dev/null > > >> +++ b/api/Kconfig > > >> @@ -0,0 +1,9 @@ > > >> +menu "API" > > >> + > > >> +config API > > >> + bool "Enable U-Boot API" > > >> + default n > > >> + help > > >> + This option enable the U-Boot API. > > > > > > Can you add a little detail about what the API is and what it is for? > > > > You can find complete documentation in the api directory. In brief, it > > allows the loaded binary to call back into the loader to do generic > > things like send network packets or read blocks from mass storage. > > Right. Can you re-word the "In brief.." slightly so it reads well under > the 'help' section and point to api/README for more details please? All right, I'll do that for v3. > > > Also, are you going to migrate all boards to use Kconfig for this > > > option and drop it from the whitelist? > > > > I'll leave that to Emmanuel. > > There's two boards that enable API today but tools/moveconfig.py may be > more overhead than just editing configs/PMC440_defconfig and > configs/lsxhl_defconfig (and the respective include/configs/ files). > > -- > Tom Ah, I've missed those. Would it make more sense to submit a patch that handle adding CONFIG_API into Kconfig (and changing configs for those two board and remove from the whitelist) separate from the FreeBSD config sets of patches ? Thanks, -- Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file 2017-01-23 16:05 ` Emmanuel Vadot @ 2017-01-23 16:22 ` Tom Rini 0 siblings, 0 replies; 29+ messages in thread From: Tom Rini @ 2017-01-23 16:22 UTC (permalink / raw) To: u-boot On Mon, Jan 23, 2017 at 05:05:50PM +0100, Emmanuel Vadot wrote: > > Hi Tom, > > On Mon, 23 Jan 2017 09:51:59 -0500 > Tom Rini <trini@konsulko.com> wrote: > > > On Sat, Jan 21, 2017 at 09:22:47PM -0700, Warner Losh wrote: > > > On Fri, Jan 20, 2017 at 8:51 PM, Simon Glass <sjg@chromium.org> wrote: > > > > Hi, > > > > > > > > On 17 January 2017 at 08:50, Emmanuel Vadot <manu@bidouilliste.com> wrote: > > > >> Add kconfig file to enable API support > > > >> > > > >> Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> > > > >> --- > > > >> Kconfig | 2 ++ > > > >> api/Kconfig | 9 +++++++++ > > > >> 2 files changed, 11 insertions(+) > > > >> create mode 100644 api/Kconfig > > > >> > > > >> diff --git a/Kconfig b/Kconfig > > > >> index 39a4d938d8..6a93d8820f 100644 > > > >> --- a/Kconfig > > > >> +++ b/Kconfig > > > >> @@ -306,6 +306,8 @@ config ARCH_FIXUP_FDT_MEMORY > > > >> > > > >> endmenu # Boot images > > > >> > > > >> +source "api/Kconfig" > > > >> + > > > >> source "common/Kconfig" > > > >> > > > >> source "cmd/Kconfig" > > > >> diff --git a/api/Kconfig b/api/Kconfig > > > >> new file mode 100644 > > > >> index 0000000000..88b4f6c4e5 > > > >> --- /dev/null > > > >> +++ b/api/Kconfig > > > >> @@ -0,0 +1,9 @@ > > > >> +menu "API" > > > >> + > > > >> +config API > > > >> + bool "Enable U-Boot API" > > > >> + default n > > > >> + help > > > >> + This option enable the U-Boot API. > > > > > > > > Can you add a little detail about what the API is and what it is for? > > > > > > You can find complete documentation in the api directory. In brief, it > > > allows the loaded binary to call back into the loader to do generic > > > things like send network packets or read blocks from mass storage. > > > > Right. Can you re-word the "In brief.." slightly so it reads well under > > the 'help' section and point to api/README for more details please? > > All right, I'll do that for v3. > > > > > Also, are you going to migrate all boards to use Kconfig for this > > > > option and drop it from the whitelist? > > > > > > I'll leave that to Emmanuel. > > > > There's two boards that enable API today but tools/moveconfig.py may be > > more overhead than just editing configs/PMC440_defconfig and > > configs/lsxhl_defconfig (and the respective include/configs/ files). > > Ah, I've missed those. Would it make more sense to submit a patch that > handle adding CONFIG_API into Kconfig (and changing configs for those > two board and remove from the whitelist) separate from the FreeBSD > config sets of patches ? It's up to you guys. I want to see this thread sorted out and changes required to support FreeBSD happily, out of the box, in. So API gets converted one way or another :) -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170123/e3a7c34c/attachment.sig> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file 2017-01-21 3:51 ` Simon Glass 2017-01-22 4:22 ` Warner Losh @ 2017-01-23 12:48 ` Emmanuel Vadot 1 sibling, 0 replies; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-23 12:48 UTC (permalink / raw) To: u-boot On Fri, 20 Jan 2017 20:51:48 -0700 Simon Glass <sjg@chromium.org> wrote: > Hi, > > On 17 January 2017 at 08:50, Emmanuel Vadot <manu@bidouilliste.com> wrote: > > Add kconfig file to enable API support > > > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> > > --- > > Kconfig | 2 ++ > > api/Kconfig | 9 +++++++++ > > 2 files changed, 11 insertions(+) > > create mode 100644 api/Kconfig > > > > diff --git a/Kconfig b/Kconfig > > index 39a4d938d8..6a93d8820f 100644 > > --- a/Kconfig > > +++ b/Kconfig > > @@ -306,6 +306,8 @@ config ARCH_FIXUP_FDT_MEMORY > > > > endmenu # Boot images > > > > +source "api/Kconfig" > > + > > source "common/Kconfig" > > > > source "cmd/Kconfig" > > diff --git a/api/Kconfig b/api/Kconfig > > new file mode 100644 > > index 0000000000..88b4f6c4e5 > > --- /dev/null > > +++ b/api/Kconfig > > @@ -0,0 +1,9 @@ > > +menu "API" > > + > > +config API > > + bool "Enable U-Boot API" > > + default n > > + help > > + This option enable the U-Boot API. > > Can you add a little detail about what the API is and what it is for? > > Also, are you going to migrate all boards to use Kconfig for this > option and drop it from the whitelist? I don't understand your question about migration, currently no board are using it. As for the whitelist, if I understand correctly how it works it should be removed in the same patch. > > + > > +endmenu > > -- > > 2.11.0 > > > > Regards, > Simon -- Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 2/4] kconfig: Add a FREEBSD option 2017-01-17 15:50 [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options Emmanuel Vadot 2017-01-17 15:50 ` [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file Emmanuel Vadot @ 2017-01-17 15:50 ` Emmanuel Vadot 2017-01-21 3:51 ` Simon Glass 2017-01-17 15:50 ` [U-Boot] [PATCH v2 3/4] api: FreeBSD: flush cache before starting loader/kernel Emmanuel Vadot ` (3 subsequent siblings) 5 siblings, 1 reply; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-17 15:50 UTC (permalink / raw) To: u-boot Add a FreeBSD option that enable the API and enable the data cache command as it is needed to boot the FreeBSD loader. Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> --- common/Kconfig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/Kconfig b/common/Kconfig index a04ee1084f..b719ccd888 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -389,4 +389,13 @@ config DISPLAY_BOARDINFO when U-Boot starts up. The board function checkboard() is called to do this. +config FREEBSD + bool "Enable FreeBSD boot" + select API + select CMD_CACHE + default n + help + This option adds boot configuration that can run the FreeBSD + loader. + source "common/spl/Kconfig" -- 2.11.0 ^ permalink raw reply related [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 2/4] kconfig: Add a FREEBSD option 2017-01-17 15:50 ` [U-Boot] [PATCH v2 2/4] kconfig: Add a FREEBSD option Emmanuel Vadot @ 2017-01-21 3:51 ` Simon Glass 2017-01-21 10:31 ` Jeroen Hofstee 2017-01-22 4:19 ` Warner Losh 0 siblings, 2 replies; 29+ messages in thread From: Simon Glass @ 2017-01-21 3:51 UTC (permalink / raw) To: u-boot Hi, On 17 January 2017 at 08:50, Emmanuel Vadot <manu@bidouilliste.com> wrote: > Add a FreeBSD option that enable the API and enable the data cache > command as it is needed to boot the FreeBSD loader. > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> > --- > common/Kconfig | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/common/Kconfig b/common/Kconfig > index a04ee1084f..b719ccd888 100644 > --- a/common/Kconfig > +++ b/common/Kconfig > @@ -389,4 +389,13 @@ config DISPLAY_BOARDINFO > when U-Boot starts up. The board function checkboard() is called > to do this. > > +config FREEBSD > + bool "Enable FreeBSD boot" > + select API > + select CMD_CACHE > + default n > + help > + This option adds boot configuration that can run the FreeBSD > + loader. What is the FreeBSD loader? Do you mean that U-Boot can boot FreeBSD? > + > source "common/spl/Kconfig" > -- > 2.11.0 > Regards, Simon ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 2/4] kconfig: Add a FREEBSD option 2017-01-21 3:51 ` Simon Glass @ 2017-01-21 10:31 ` Jeroen Hofstee 2017-01-22 4:19 ` Warner Losh 1 sibling, 0 replies; 29+ messages in thread From: Jeroen Hofstee @ 2017-01-21 10:31 UTC (permalink / raw) To: u-boot Hello Simon, On 21-01-17 04:51, Simon Glass wrote: > Hi, > > On 17 January 2017 at 08:50, Emmanuel Vadot <manu@bidouilliste.com> wrote: >> Add a FreeBSD option that enable the API and enable the data cache >> command as it is needed to boot the FreeBSD loader. >> >> Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> >> --- >> common/Kconfig | 9 +++++++++ >> 1 file changed, 9 insertions(+) >> >> diff --git a/common/Kconfig b/common/Kconfig >> index a04ee1084f..b719ccd888 100644 >> --- a/common/Kconfig >> +++ b/common/Kconfig >> @@ -389,4 +389,13 @@ config DISPLAY_BOARDINFO >> when U-Boot starts up. The board function checkboard() is called >> to do this. >> >> +config FREEBSD >> + bool "Enable FreeBSD boot" >> + select API >> + select CMD_CACHE >> + default n >> + help >> + This option adds boot configuration that can run the FreeBSD >> + loader. > What is the FreeBSD loader? see https://www.freebsd.org/cgi/man.cgi?loader(8). Which is rather nice, FreeBSD uses the same loader independent of arch, so booting the previous kernel / kernel module stuff and rescue things are roughly the same on i386, amd64 and arm. The loader communicates with u-boot by its api. > Do you mean that U-Boot can boot FreeBSD? > Hence he meant what he wrote. Be able to run the FreeBSD _loader_. The FreeBSD loader will take care of booting FreeBSD. Regards, Jeroen ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 2/4] kconfig: Add a FREEBSD option 2017-01-21 3:51 ` Simon Glass 2017-01-21 10:31 ` Jeroen Hofstee @ 2017-01-22 4:19 ` Warner Losh 1 sibling, 0 replies; 29+ messages in thread From: Warner Losh @ 2017-01-22 4:19 UTC (permalink / raw) To: u-boot On Fri, Jan 20, 2017 at 8:51 PM, Simon Glass <sjg@chromium.org> wrote: > Hi, > > On 17 January 2017 at 08:50, Emmanuel Vadot <manu@bidouilliste.com> wrote: >> Add a FreeBSD option that enable the API and enable the data cache >> command as it is needed to boot the FreeBSD loader. >> >> Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> >> --- >> common/Kconfig | 9 +++++++++ >> 1 file changed, 9 insertions(+) >> >> diff --git a/common/Kconfig b/common/Kconfig >> index a04ee1084f..b719ccd888 100644 >> --- a/common/Kconfig >> +++ b/common/Kconfig >> @@ -389,4 +389,13 @@ config DISPLAY_BOARDINFO >> when U-Boot starts up. The board function checkboard() is called >> to do this. >> >> +config FREEBSD >> + bool "Enable FreeBSD boot" >> + select API >> + select CMD_CACHE >> + default n >> + help >> + This option adds boot configuration that can run the FreeBSD >> + loader. > > What is the FreeBSD loader? Do you mean that U-Boot can boot FreeBSD? No. The FreeBSD loader is loaded by u-boot and it loads the kernel, modules and sets up a number of environment variables. Warner >> + >> source "common/spl/Kconfig" >> -- >> 2.11.0 >> > > Regards, > Simon ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 3/4] api: FreeBSD: flush cache before starting loader/kernel 2017-01-17 15:50 [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options Emmanuel Vadot 2017-01-17 15:50 ` [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file Emmanuel Vadot 2017-01-17 15:50 ` [U-Boot] [PATCH v2 2/4] kconfig: Add a FREEBSD option Emmanuel Vadot @ 2017-01-17 15:50 ` Emmanuel Vadot 2017-01-17 20:13 ` Alexander Graf 2017-01-21 3:51 ` Simon Glass 2017-01-17 15:50 ` [U-Boot] [PATCH v2 4/4] distro_bootcmd: Add command to run FreeBSD Emmanuel Vadot ` (2 subsequent siblings) 5 siblings, 2 replies; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-17 15:50 UTC (permalink / raw) To: u-boot From: Warner Losh <imp@freebsd.org> FreeBSD loader(8) just loaded code to some random location that may contain stale icache entries. FreeBSD Kernel needs the icache and dcache flushed. Before running either one of them, flush the icache and dcache. Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> --- api/api.c | 5 +++++ cmd/boot.c | 5 +++++ cmd/elf.c | 8 +++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/api/api.c b/api/api.c index 8a1433af78..cc25deca09 100644 --- a/api/api.c +++ b/api/api.c @@ -290,6 +290,11 @@ static int API_dev_close(va_list ap) if (!err) di->state = DEV_STA_CLOSED; +#ifdef CONFIG_FREEBSD + flush_dcache_all(); + invalidate_icache_all(); +#endif + return err; } diff --git a/cmd/boot.c b/cmd/boot.c index 72f2cf362d..a1a91fbf0a 100644 --- a/cmd/boot.c +++ b/cmd/boot.c @@ -19,6 +19,11 @@ __attribute__((weak)) unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc, char * const argv[]) { +#ifdef CONFIG_FREEBSD + flush_dcache_all(); + invalidate_icache_all(); +#endif + return entry (argc, argv); } diff --git a/cmd/elf.c b/cmd/elf.c index 5190cc6c0f..b2827fa042 100644 --- a/cmd/elf.c +++ b/cmd/elf.c @@ -109,6 +109,7 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]), { unsigned long ret; +#ifndef CONFIG_FREEBSD /* * QNX images require the data cache is disabled. * Data cache is already flushed, so just turn it off. @@ -116,15 +117,20 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]), int dcache = dcache_status(); if (dcache) dcache_disable(); - +#else + flush_dcache_all(); + invalidate_icache_all(); +#endif /* * pass address parameter as argv[0] (aka command name), * and all remaining args */ ret = entry(argc, argv); +#ifndef CONFIG_FREEBSD if (dcache) dcache_enable(); +#endif return ret; } -- 2.11.0 ^ permalink raw reply related [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 3/4] api: FreeBSD: flush cache before starting loader/kernel 2017-01-17 15:50 ` [U-Boot] [PATCH v2 3/4] api: FreeBSD: flush cache before starting loader/kernel Emmanuel Vadot @ 2017-01-17 20:13 ` Alexander Graf 2017-01-17 20:45 ` Emmanuel Vadot 2017-01-21 3:51 ` Simon Glass 1 sibling, 1 reply; 29+ messages in thread From: Alexander Graf @ 2017-01-17 20:13 UTC (permalink / raw) To: u-boot On 17/01/2017 16:50, Emmanuel Vadot wrote: > From: Warner Losh <imp@freebsd.org> > > FreeBSD loader(8) just loaded code to some random location that may > contain stale icache entries. > FreeBSD Kernel needs the icache and dcache flushed. > Before running either one of them, flush the icache and dcache. > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> Is there any downside to doing the flush always? I would prefer to not conditionalize it on CONFIG_FREEBSD. > --- > api/api.c | 5 +++++ > cmd/boot.c | 5 +++++ > cmd/elf.c | 8 +++++++- > 3 files changed, 17 insertions(+), 1 deletion(-) > > diff --git a/api/api.c b/api/api.c > index 8a1433af78..cc25deca09 100644 > --- a/api/api.c > +++ b/api/api.c > @@ -290,6 +290,11 @@ static int API_dev_close(va_list ap) > if (!err) > di->state = DEV_STA_CLOSED; > > +#ifdef CONFIG_FREEBSD > + flush_dcache_all(); > + invalidate_icache_all(); > +#endif > + > return err; > } > > diff --git a/cmd/boot.c b/cmd/boot.c > index 72f2cf362d..a1a91fbf0a 100644 > --- a/cmd/boot.c > +++ b/cmd/boot.c > @@ -19,6 +19,11 @@ __attribute__((weak)) > unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc, > char * const argv[]) > { > +#ifdef CONFIG_FREEBSD > + flush_dcache_all(); > + invalidate_icache_all(); > +#endif > + > return entry (argc, argv); > } > > diff --git a/cmd/elf.c b/cmd/elf.c > index 5190cc6c0f..b2827fa042 100644 > --- a/cmd/elf.c > +++ b/cmd/elf.c > @@ -109,6 +109,7 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]), > { > unsigned long ret; > > +#ifndef CONFIG_FREEBSD > /* > * QNX images require the data cache is disabled. > * Data cache is already flushed, so just turn it off. > @@ -116,15 +117,20 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]), > int dcache = dcache_status(); > if (dcache) > dcache_disable(); Can FreeBSD boot with dcache disabled? Is there some way we can determine what payload we have from the elf header? Alex ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 3/4] api: FreeBSD: flush cache before starting loader/kernel 2017-01-17 20:13 ` Alexander Graf @ 2017-01-17 20:45 ` Emmanuel Vadot 2017-01-17 20:58 ` Alexander Graf 0 siblings, 1 reply; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-17 20:45 UTC (permalink / raw) To: u-boot On Tue, 17 Jan 2017 21:13:51 +0100 Alexander Graf <agraf@suse.de> wrote: > > > On 17/01/2017 16:50, Emmanuel Vadot wrote: > > From: Warner Losh <imp@freebsd.org> > > > > FreeBSD loader(8) just loaded code to some random location that may > > contain stale icache entries. > > FreeBSD Kernel needs the icache and dcache flushed. > > Before running either one of them, flush the icache and dcache. > > > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> > > Is there any downside to doing the flush always? I would prefer to not > conditionalize it on CONFIG_FREEBSD. I don't think there is any downside. > > --- > > api/api.c | 5 +++++ > > cmd/boot.c | 5 +++++ > > cmd/elf.c | 8 +++++++- > > 3 files changed, 17 insertions(+), 1 deletion(-) > > > > diff --git a/api/api.c b/api/api.c > > index 8a1433af78..cc25deca09 100644 > > --- a/api/api.c > > +++ b/api/api.c > > @@ -290,6 +290,11 @@ static int API_dev_close(va_list ap) > > if (!err) > > di->state = DEV_STA_CLOSED; > > > > +#ifdef CONFIG_FREEBSD > > + flush_dcache_all(); > > + invalidate_icache_all(); > > +#endif > > + > > return err; > > } > > > > diff --git a/cmd/boot.c b/cmd/boot.c > > index 72f2cf362d..a1a91fbf0a 100644 > > --- a/cmd/boot.c > > +++ b/cmd/boot.c > > @@ -19,6 +19,11 @@ __attribute__((weak)) > > unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc, > > char * const argv[]) > > { > > +#ifdef CONFIG_FREEBSD > > + flush_dcache_all(); > > + invalidate_icache_all(); > > +#endif > > + > > return entry (argc, argv); > > } > > > > diff --git a/cmd/elf.c b/cmd/elf.c > > index 5190cc6c0f..b2827fa042 100644 > > --- a/cmd/elf.c > > +++ b/cmd/elf.c > > @@ -109,6 +109,7 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]), > > { > > unsigned long ret; > > > > +#ifndef CONFIG_FREEBSD > > /* > > * QNX images require the data cache is disabled. > > * Data cache is already flushed, so just turn it off. > > @@ -116,15 +117,20 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]), > > int dcache = dcache_status(); > > if (dcache) > > dcache_disable(); > > Can FreeBSD boot with dcache disabled? Is there some way we can > determine what payload we have from the elf header? > > > Alex FreeBSD can boot with dcache disabled (our loader and kernel can) I'm not sure I get your other question, sorry. -- Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 3/4] api: FreeBSD: flush cache before starting loader/kernel 2017-01-17 20:45 ` Emmanuel Vadot @ 2017-01-17 20:58 ` Alexander Graf 2017-01-18 10:42 ` Emmanuel Vadot 0 siblings, 1 reply; 29+ messages in thread From: Alexander Graf @ 2017-01-17 20:58 UTC (permalink / raw) To: u-boot On 17/01/2017 21:45, Emmanuel Vadot wrote: > On Tue, 17 Jan 2017 21:13:51 +0100 > Alexander Graf <agraf@suse.de> wrote: > >> >> >> On 17/01/2017 16:50, Emmanuel Vadot wrote: >>> From: Warner Losh <imp@freebsd.org> >>> >>> FreeBSD loader(8) just loaded code to some random location that may >>> contain stale icache entries. >>> FreeBSD Kernel needs the icache and dcache flushed. >>> Before running either one of them, flush the icache and dcache. >>> >>> Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> >> >> Is there any downside to doing the flush always? I would prefer to not >> conditionalize it on CONFIG_FREEBSD. > > I don't think there is any downside. > >>> --- >>> api/api.c | 5 +++++ >>> cmd/boot.c | 5 +++++ >>> cmd/elf.c | 8 +++++++- >>> 3 files changed, 17 insertions(+), 1 deletion(-) >>> >>> diff --git a/api/api.c b/api/api.c >>> index 8a1433af78..cc25deca09 100644 >>> --- a/api/api.c >>> +++ b/api/api.c >>> @@ -290,6 +290,11 @@ static int API_dev_close(va_list ap) >>> if (!err) >>> di->state = DEV_STA_CLOSED; >>> >>> +#ifdef CONFIG_FREEBSD >>> + flush_dcache_all(); >>> + invalidate_icache_all(); >>> +#endif >>> + >>> return err; >>> } >>> >>> diff --git a/cmd/boot.c b/cmd/boot.c >>> index 72f2cf362d..a1a91fbf0a 100644 >>> --- a/cmd/boot.c >>> +++ b/cmd/boot.c >>> @@ -19,6 +19,11 @@ __attribute__((weak)) >>> unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc, >>> char * const argv[]) >>> { >>> +#ifdef CONFIG_FREEBSD >>> + flush_dcache_all(); >>> + invalidate_icache_all(); >>> +#endif >>> + >>> return entry (argc, argv); >>> } >>> >>> diff --git a/cmd/elf.c b/cmd/elf.c >>> index 5190cc6c0f..b2827fa042 100644 >>> --- a/cmd/elf.c >>> +++ b/cmd/elf.c >>> @@ -109,6 +109,7 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]), >>> { >>> unsigned long ret; >>> >>> +#ifndef CONFIG_FREEBSD >>> /* >>> * QNX images require the data cache is disabled. >>> * Data cache is already flushed, so just turn it off. >>> @@ -116,15 +117,20 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]), >>> int dcache = dcache_status(); >>> if (dcache) >>> dcache_disable(); >> >> Can FreeBSD boot with dcache disabled? Is there some way we can >> determine what payload we have from the elf header? >> >> >> Alex > > FreeBSD can boot with dcache disabled (our loader and kernel can) > I'm not sure I get your other question, sorry. Your patch #ifdefs out the dcache_disable() if CONFIG_FREEBSD is set. So if you can boot just fine with dcache disabled, you can remove this hunk altogether FWIW. All the other changes in this file are mere cache flushes - and they shouldn't hurt any u-boot api user and thus could be done unconditionally. Alex ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 3/4] api: FreeBSD: flush cache before starting loader/kernel 2017-01-17 20:58 ` Alexander Graf @ 2017-01-18 10:42 ` Emmanuel Vadot 0 siblings, 0 replies; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-18 10:42 UTC (permalink / raw) To: u-boot On Tue, 17 Jan 2017 21:58:31 +0100 Alexander Graf <agraf@suse.de> wrote: > > > On 17/01/2017 21:45, Emmanuel Vadot wrote: > > On Tue, 17 Jan 2017 21:13:51 +0100 > > Alexander Graf <agraf@suse.de> wrote: > > > >> > >> > >> On 17/01/2017 16:50, Emmanuel Vadot wrote: > >>> From: Warner Losh <imp@freebsd.org> > >>> > >>> FreeBSD loader(8) just loaded code to some random location that may > >>> contain stale icache entries. > >>> FreeBSD Kernel needs the icache and dcache flushed. > >>> Before running either one of them, flush the icache and dcache. > >>> > >>> Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> > >> > >> Is there any downside to doing the flush always? I would prefer to not > >> conditionalize it on CONFIG_FREEBSD. > > > > I don't think there is any downside. > > > >>> --- > >>> api/api.c | 5 +++++ > >>> cmd/boot.c | 5 +++++ > >>> cmd/elf.c | 8 +++++++- > >>> 3 files changed, 17 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/api/api.c b/api/api.c > >>> index 8a1433af78..cc25deca09 100644 > >>> --- a/api/api.c > >>> +++ b/api/api.c > >>> @@ -290,6 +290,11 @@ static int API_dev_close(va_list ap) > >>> if (!err) > >>> di->state = DEV_STA_CLOSED; > >>> > >>> +#ifdef CONFIG_FREEBSD > >>> + flush_dcache_all(); > >>> + invalidate_icache_all(); > >>> +#endif > >>> + > >>> return err; > >>> } > >>> > >>> diff --git a/cmd/boot.c b/cmd/boot.c > >>> index 72f2cf362d..a1a91fbf0a 100644 > >>> --- a/cmd/boot.c > >>> +++ b/cmd/boot.c > >>> @@ -19,6 +19,11 @@ __attribute__((weak)) > >>> unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc, > >>> char * const argv[]) > >>> { > >>> +#ifdef CONFIG_FREEBSD > >>> + flush_dcache_all(); > >>> + invalidate_icache_all(); > >>> +#endif > >>> + > >>> return entry (argc, argv); > >>> } > >>> > >>> diff --git a/cmd/elf.c b/cmd/elf.c > >>> index 5190cc6c0f..b2827fa042 100644 > >>> --- a/cmd/elf.c > >>> +++ b/cmd/elf.c > >>> @@ -109,6 +109,7 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]), > >>> { > >>> unsigned long ret; > >>> > >>> +#ifndef CONFIG_FREEBSD > >>> /* > >>> * QNX images require the data cache is disabled. > >>> * Data cache is already flushed, so just turn it off. > >>> @@ -116,15 +117,20 @@ static unsigned long do_bootelf_exec(ulong (*entry)(int, char * const[]), > >>> int dcache = dcache_status(); > >>> if (dcache) > >>> dcache_disable(); > >> > >> Can FreeBSD boot with dcache disabled? Is there some way we can > >> determine what payload we have from the elf header? > >> > >> > >> Alex > > > > FreeBSD can boot with dcache disabled (our loader and kernel can) > > I'm not sure I get your other question, sorry. > > Your patch #ifdefs out the dcache_disable() if CONFIG_FREEBSD is set. So > if you can boot just fine with dcache disabled, you can remove this hunk > altogether FWIW. Loading the kernel from our loader is much faster with dcache enabled (1 sec instead of 5/7 sec). I guess we can always flush the cache and only disable it for QNX, I'll check if there is a CONFIG_QNX or something like that. > All the other changes in this file are mere cache flushes - and they > shouldn't hurt any u-boot api user and thus could be done unconditionally. True, I can remove the #ifdefs on CONFIG_FREEBSD here. > > Alex -- Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 3/4] api: FreeBSD: flush cache before starting loader/kernel 2017-01-17 15:50 ` [U-Boot] [PATCH v2 3/4] api: FreeBSD: flush cache before starting loader/kernel Emmanuel Vadot 2017-01-17 20:13 ` Alexander Graf @ 2017-01-21 3:51 ` Simon Glass 2017-01-23 12:50 ` Emmanuel Vadot 1 sibling, 1 reply; 29+ messages in thread From: Simon Glass @ 2017-01-21 3:51 UTC (permalink / raw) To: u-boot Hi, On 17 January 2017 at 08:50, Emmanuel Vadot <manu@bidouilliste.com> wrote: > From: Warner Losh <imp@freebsd.org> > > FreeBSD loader(8) just loaded code to some random location that may > contain stale icache entries. > FreeBSD Kernel needs the icache and dcache flushed. > Before running either one of them, flush the icache and dcache. > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> > --- > api/api.c | 5 +++++ > cmd/boot.c | 5 +++++ > cmd/elf.c | 8 +++++++- > 3 files changed, 17 insertions(+), 1 deletion(-) > > diff --git a/api/api.c b/api/api.c > index 8a1433af78..cc25deca09 100644 > --- a/api/api.c > +++ b/api/api.c > @@ -290,6 +290,11 @@ static int API_dev_close(va_list ap) > if (!err) > di->state = DEV_STA_CLOSED; > > +#ifdef CONFIG_FREEBSD > + flush_dcache_all(); > + invalidate_icache_all(); > +#endif It's not nice IMO to add OS-specific #ifdefs to generic code. Can you instead define a Kconfig option with a sensible name, and have FreeBSD define it? > + > return err; > } > > diff --git a/cmd/boot.c b/cmd/boot.c > index 72f2cf362d..a1a91fbf0a 100644 > --- a/cmd/boot.c > +++ b/cmd/boot.c > @@ -19,6 +19,11 @@ __attribute__((weak)) > unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc, > char * const argv[]) > { > +#ifdef CONFIG_FREEBSD > + flush_dcache_all(); > + invalidate_icache_all(); > +#endif > + > return entry (argc, argv); > } > Regards, Simon ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 3/4] api: FreeBSD: flush cache before starting loader/kernel 2017-01-21 3:51 ` Simon Glass @ 2017-01-23 12:50 ` Emmanuel Vadot 0 siblings, 0 replies; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-23 12:50 UTC (permalink / raw) To: u-boot Hi Simon, On Fri, 20 Jan 2017 20:51:54 -0700 Simon Glass <sjg@chromium.org> wrote: > Hi, > > On 17 January 2017 at 08:50, Emmanuel Vadot <manu@bidouilliste.com> wrote: > > From: Warner Losh <imp@freebsd.org> > > > > FreeBSD loader(8) just loaded code to some random location that may > > contain stale icache entries. > > FreeBSD Kernel needs the icache and dcache flushed. > > Before running either one of them, flush the icache and dcache. > > > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> > > --- > > api/api.c | 5 +++++ > > cmd/boot.c | 5 +++++ > > cmd/elf.c | 8 +++++++- > > 3 files changed, 17 insertions(+), 1 deletion(-) > > > > diff --git a/api/api.c b/api/api.c > > index 8a1433af78..cc25deca09 100644 > > --- a/api/api.c > > +++ b/api/api.c > > @@ -290,6 +290,11 @@ static int API_dev_close(va_list ap) > > if (!err) > > di->state = DEV_STA_CLOSED; > > > > +#ifdef CONFIG_FREEBSD > > + flush_dcache_all(); > > + invalidate_icache_all(); > > +#endif > > It's not nice IMO to add OS-specific #ifdefs to generic code. Can you > instead define a Kconfig option with a sensible name, and have FreeBSD > define it? In the same thread, Alexander Graf said that since this are just cache flush it doesn't even need to be FreeBSD/CONFIG specific so I'll do that on the v3. > > + > > return err; > > } > > > > diff --git a/cmd/boot.c b/cmd/boot.c > > index 72f2cf362d..a1a91fbf0a 100644 > > --- a/cmd/boot.c > > +++ b/cmd/boot.c > > @@ -19,6 +19,11 @@ __attribute__((weak)) > > unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc, > > char * const argv[]) > > { > > +#ifdef CONFIG_FREEBSD > > + flush_dcache_all(); > > + invalidate_icache_all(); > > +#endif > > + > > return entry (argc, argv); > > } > > > > Regards, > Simon -- Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 4/4] distro_bootcmd: Add command to run FreeBSD 2017-01-17 15:50 [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options Emmanuel Vadot ` (2 preceding siblings ...) 2017-01-17 15:50 ` [U-Boot] [PATCH v2 3/4] api: FreeBSD: flush cache before starting loader/kernel Emmanuel Vadot @ 2017-01-17 15:50 ` Emmanuel Vadot 2017-01-17 20:15 ` Alexander Graf 2017-01-17 19:36 ` [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options Alexander Graf [not found] ` <f07ec2834278bb372fb456338f2af313@agner.ch> 5 siblings, 1 reply; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-17 15:50 UTC (permalink / raw) To: u-boot Add commands that scans for the FreeBSD loader and run it if found. FreeBSD has two loader: ubldr which is an ELF binary and ubldr.bin which is a PIE binary. Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> --- include/config_distro_bootcmd.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 9ecaf38a33..0f5d38534a 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -153,6 +153,36 @@ #define SCAN_DEV_FOR_EFI #endif +#ifdef CONFIG_FREEBSD +#define BOOTENV_SHARED_FREEBSD \ + "boot_freebsd_binary=" \ + "load ${devtype} ${devnum}:${distro_bootpart} " \ + "${kernel_addr_r} ubldr.bin; " \ + "go ${kernel_addr_r}\0" \ + \ + "boot_freebsd_elf=" \ + "load ${devtype} ${devnum}:${distro_bootpart} " \ + "${kernel_addr_r} ubldr; " \ + "bootelf ${kernel_addr_r}\0" \ + \ + "scan_dev_for_freebsd=" \ + "if test -e ${devtype} ${devnum}:${distro_bootpart} " \ + "ubldr.bin; then " \ + "echo Found FreeBSD U-Boot Loader (bin);" \ + "run boot_freebsd_binary; " \ + "echo FREEBSD FAILED: continuing...; " \ + "elif test -e ${devtype} ${devnum}:${distro_bootpart} " \ + "ubldr; then " \ + "echo Found FreeBSD U-Boot Loader (elf);" \ + "run boot_freebsd_elf; " \ + "echo FREEBSD FAILED: continuing...; " \ + "fi;\0" +#define SCAN_DEV_FOR_FREEBSD "run scan_dev_for_freebsd;" +#else +#define BOOTENV_SHARED_FREEBSD +#define SCAN_DEV_FOR_FREEBSD +#endif + #ifdef CONFIG_CMD_SATA #define BOOTENV_SHARED_SATA BOOTENV_SHARED_BLKDEV(sata) #define BOOTENV_DEV_SATA BOOTENV_DEV_BLKDEV @@ -326,6 +356,7 @@ BOOTENV_SHARED_IDE \ BOOTENV_SHARED_UBIFS \ BOOTENV_SHARED_EFI \ + BOOTENV_SHARED_FREEBSD \ "boot_prefixes=/ /boot/\0" \ "boot_scripts=boot.scr.uimg boot.scr\0" \ "boot_script_dhcp=boot.scr.uimg\0" \ @@ -369,6 +400,7 @@ "run scan_dev_for_scripts; " \ "done;" \ SCAN_DEV_FOR_EFI \ + SCAN_DEV_FOR_FREEBSD \ "\0" \ \ "scan_dev_for_boot_part=" \ -- 2.11.0 ^ permalink raw reply related [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 4/4] distro_bootcmd: Add command to run FreeBSD 2017-01-17 15:50 ` [U-Boot] [PATCH v2 4/4] distro_bootcmd: Add command to run FreeBSD Emmanuel Vadot @ 2017-01-17 20:15 ` Alexander Graf 0 siblings, 0 replies; 29+ messages in thread From: Alexander Graf @ 2017-01-17 20:15 UTC (permalink / raw) To: u-boot On 17/01/2017 16:50, Emmanuel Vadot wrote: > Add commands that scans for the FreeBSD loader and run it if found. > FreeBSD has two loader: ubldr which is an ELF binary and ubldr.bin which > is a PIE binary. > > Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> If we can make the dcache disable part unconditional, I would just fold the CONFIG_FREEBSD part in here and only make the boot script hunk conditional on it. Alex ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options 2017-01-17 15:50 [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options Emmanuel Vadot ` (3 preceding siblings ...) 2017-01-17 15:50 ` [U-Boot] [PATCH v2 4/4] distro_bootcmd: Add command to run FreeBSD Emmanuel Vadot @ 2017-01-17 19:36 ` Alexander Graf 2017-01-17 19:47 ` Emmanuel Vadot [not found] ` <f07ec2834278bb372fb456338f2af313@agner.ch> 5 siblings, 1 reply; 29+ messages in thread From: Alexander Graf @ 2017-01-17 19:36 UTC (permalink / raw) To: u-boot On 17/01/2017 16:50, Emmanuel Vadot wrote: > This series of patches add the needed bits for booting the FreeBSD > loader and kernel. > FreeBSD loader and kernel needs the U-Boot API and dcache/icache flushed > for it to run so add this operation in go/bootelf command and when closing > the API. > Also add some some boot command that locate and run the FreeBSD loader > if found. Is there any particular reason the EFI boot path doesn't work for you? Configuring u-boot differently to be able to boot FreeBSD sounds a bit strange to me. Alex ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options 2017-01-17 19:36 ` [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options Alexander Graf @ 2017-01-17 19:47 ` Emmanuel Vadot 2017-01-17 19:57 ` Warner Losh 0 siblings, 1 reply; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-17 19:47 UTC (permalink / raw) To: u-boot Hi Alexander, On Tue, 17 Jan 2017 20:36:59 +0100 Alexander Graf <agraf@suse.de> wrote: > > > On 17/01/2017 16:50, Emmanuel Vadot wrote: > > This series of patches add the needed bits for booting the FreeBSD > > loader and kernel. > > FreeBSD loader and kernel needs the U-Boot API and dcache/icache flushed > > for it to run so add this operation in go/bootelf command and when closing > > the API. > > Also add some some boot command that locate and run the FreeBSD loader > > if found. > > Is there any particular reason the EFI boot path doesn't work for you? > > Configuring u-boot differently to be able to boot FreeBSD sounds a bit > strange to me. > > > Alex EFI works fine for us, that's what we use for arm64 (pine64/rpi3 for example) because we want to only use EFI for arm64. For armv6/v7 we have legacy devices etc ... and even if EFI works (well honestly I have to fix our smbios code for it to work properly) we need to be able to boot without EFI support. With this series of patches is an EFI binary is found this is the one that would be loaded, so when the times comes we could make our releases with EFI bootloaders for ARM. In the meantimes we still need the U-Boot API for our loader. Cheers, -- Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options 2017-01-17 19:47 ` Emmanuel Vadot @ 2017-01-17 19:57 ` Warner Losh 2017-01-17 20:11 ` Alexander Graf 0 siblings, 1 reply; 29+ messages in thread From: Warner Losh @ 2017-01-17 19:57 UTC (permalink / raw) To: u-boot On Tue, Jan 17, 2017 at 12:47 PM, Emmanuel Vadot <manu@bidouilliste.com> wrote: > > Hi Alexander, > > On Tue, 17 Jan 2017 20:36:59 +0100 > Alexander Graf <agraf@suse.de> wrote: > >> >> >> On 17/01/2017 16:50, Emmanuel Vadot wrote: >> > This series of patches add the needed bits for booting the FreeBSD >> > loader and kernel. >> > FreeBSD loader and kernel needs the U-Boot API and dcache/icache flushed >> > for it to run so add this operation in go/bootelf command and when closing >> > the API. >> > Also add some some boot command that locate and run the FreeBSD loader >> > if found. >> >> Is there any particular reason the EFI boot path doesn't work for you? >> >> Configuring u-boot differently to be able to boot FreeBSD sounds a bit >> strange to me. >> >> >> Alex > > EFI works fine for us, that's what we use for arm64 (pine64/rpi3 for > example) because we want to only use EFI for arm64. > For armv6/v7 we have legacy devices etc ... and even if EFI works > (well honestly I have to fix our smbios code for it to work properly) > we need to be able to boot without EFI support. > With this series of patches is an EFI binary is found this is the one > that would be loaded, so when the times comes we could make our > releases with EFI bootloaders for ARM. In the meantimes we still need > the U-Boot API for our loader. In addition, we have a long-term support branch (FreeBSD 11.x) that we need to support with the current setup since we use u-boot to load our tertiary loader which loads the kernel and related files (hence the need for the u-boot app API). It's something that's evolved over a number of years without proper upstreaming in the past. This series of patches lets us continue to use the tried and true paths, as well as setting the stage for a migration to EFI for the next major supported branch of FreeBSD (12.x, not due for a release for about a year or so). FreeBSD 11 support needs to continue past FreeBSD 12's release. Finally, as Emmanuel has said, there's still some rough edges to FreeBSD/arm's EFI support that need to be worked through in parallel before people will switch to the new way. Warner Losh <imp@freebsd.org> ^ permalink raw reply [flat|nested] 29+ messages in thread
* [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options 2017-01-17 19:57 ` Warner Losh @ 2017-01-17 20:11 ` Alexander Graf 0 siblings, 0 replies; 29+ messages in thread From: Alexander Graf @ 2017-01-17 20:11 UTC (permalink / raw) To: u-boot On 17/01/2017 20:57, Warner Losh wrote: > On Tue, Jan 17, 2017 at 12:47 PM, Emmanuel Vadot <manu@bidouilliste.com> wrote: >> >> Hi Alexander, >> >> On Tue, 17 Jan 2017 20:36:59 +0100 >> Alexander Graf <agraf@suse.de> wrote: >> >>> >>> >>> On 17/01/2017 16:50, Emmanuel Vadot wrote: >>>> This series of patches add the needed bits for booting the FreeBSD >>>> loader and kernel. >>>> FreeBSD loader and kernel needs the U-Boot API and dcache/icache flushed >>>> for it to run so add this operation in go/bootelf command and when closing >>>> the API. >>>> Also add some some boot command that locate and run the FreeBSD loader >>>> if found. >>> >>> Is there any particular reason the EFI boot path doesn't work for you? >>> >>> Configuring u-boot differently to be able to boot FreeBSD sounds a bit >>> strange to me. >>> >>> >>> Alex >> >> EFI works fine for us, that's what we use for arm64 (pine64/rpi3 for >> example) because we want to only use EFI for arm64. >> For armv6/v7 we have legacy devices etc ... and even if EFI works >> (well honestly I have to fix our smbios code for it to work properly) >> we need to be able to boot without EFI support. >> With this series of patches is an EFI binary is found this is the one >> that would be loaded, so when the times comes we could make our >> releases with EFI bootloaders for ARM. In the meantimes we still need >> the U-Boot API for our loader. > > In addition, we have a long-term support branch (FreeBSD 11.x) that we > need to support with the current setup since we use u-boot to load our > tertiary loader which loads the kernel and related files (hence the > need for the u-boot app API). It's something that's evolved over a > number of years without proper upstreaming in the past. This series of > patches lets us continue to use the tried and true paths, as well as > setting the stage for a migration to EFI for the next major supported > branch of FreeBSD (12.x, not due for a release for about a year or > so). FreeBSD 11 support needs to continue past FreeBSD 12's release. > Finally, as Emmanuel has said, there's still some rough edges to > FreeBSD/arm's EFI support that need to be worked through in parallel > before people will switch to the new way. Thanks a lot to both of you for the detailed description. That indeed makes a lot of sense altogether. Alex ^ permalink raw reply [flat|nested] 29+ messages in thread
[parent not found: <f07ec2834278bb372fb456338f2af313@agner.ch>]
* [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options [not found] ` <f07ec2834278bb372fb456338f2af313@agner.ch> @ 2017-01-17 19:41 ` Emmanuel Vadot 0 siblings, 0 replies; 29+ messages in thread From: Emmanuel Vadot @ 2017-01-17 19:41 UTC (permalink / raw) To: u-boot Hi Stefan, On Tue, 17 Jan 2017 10:08:54 -0800 Stefan Agner <stefan@agner.ch> wrote: > On 2017-01-17 07:50, Emmanuel Vadot wrote: > > This series of patches add the needed bits for booting the FreeBSD > > loader and kernel. > > FreeBSD loader and kernel needs the U-Boot API and dcache/icache flushed > > for it to run so add this operation in go/bootelf command and when closing > > the API. > > Also add some some boot command that locate and run the FreeBSD loader > > if found. > > Are FreeBSD's entry conditions documented? Not really, you can find some stuff in the source code but that's all. > Linux has some things documented, especially the MMU must be off and > also data cache: > https://www.kernel.org/doc/Documentation/arm/Booting > > -- > Stefan > > > > > Changes in v2: > > Remove SYS_DCACHE_OFF option > > Flush dcache/icache in go/boot command > > Flush dcache/icache in API closedev > > > > Emmanuel Vadot (3): > > kconfig: Add API kconfig file > > kconfig: Add a FREEBSD option > > distro_bootcmd: Add command to run FreeBSD > > > > Warner Losh (1): > > api: FreeBSD: flush cache before starting loader/kernel > > > > Kconfig | 2 ++ > > api/Kconfig | 9 +++++++++ > > api/api.c | 5 +++++ > > cmd/boot.c | 5 +++++ > > cmd/elf.c | 8 +++++++- > > common/Kconfig | 9 +++++++++ > > include/config_distro_bootcmd.h | 32 ++++++++++++++++++++++++++++++++ > > 7 files changed, 69 insertions(+), 1 deletion(-) > > create mode 100644 api/Kconfig -- Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org> ^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2017-01-23 16:22 UTC | newest] Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-01-17 15:50 [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options Emmanuel Vadot 2017-01-17 15:50 ` [U-Boot] [PATCH v2 1/4] kconfig: Add API kconfig file Emmanuel Vadot 2017-01-17 17:16 ` Andreas Färber 2017-01-17 19:40 ` Emmanuel Vadot 2017-01-17 19:51 ` Warner Losh 2017-01-21 3:51 ` Simon Glass 2017-01-22 4:22 ` Warner Losh 2017-01-23 14:51 ` Tom Rini 2017-01-23 16:05 ` Emmanuel Vadot 2017-01-23 16:22 ` Tom Rini 2017-01-23 12:48 ` Emmanuel Vadot 2017-01-17 15:50 ` [U-Boot] [PATCH v2 2/4] kconfig: Add a FREEBSD option Emmanuel Vadot 2017-01-21 3:51 ` Simon Glass 2017-01-21 10:31 ` Jeroen Hofstee 2017-01-22 4:19 ` Warner Losh 2017-01-17 15:50 ` [U-Boot] [PATCH v2 3/4] api: FreeBSD: flush cache before starting loader/kernel Emmanuel Vadot 2017-01-17 20:13 ` Alexander Graf 2017-01-17 20:45 ` Emmanuel Vadot 2017-01-17 20:58 ` Alexander Graf 2017-01-18 10:42 ` Emmanuel Vadot 2017-01-21 3:51 ` Simon Glass 2017-01-23 12:50 ` Emmanuel Vadot 2017-01-17 15:50 ` [U-Boot] [PATCH v2 4/4] distro_bootcmd: Add command to run FreeBSD Emmanuel Vadot 2017-01-17 20:15 ` Alexander Graf 2017-01-17 19:36 ` [U-Boot] [PATCH v2 0/4] Add FreeBSD kconfig options Alexander Graf 2017-01-17 19:47 ` Emmanuel Vadot 2017-01-17 19:57 ` Warner Losh 2017-01-17 20:11 ` Alexander Graf [not found] ` <f07ec2834278bb372fb456338f2af313@agner.ch> 2017-01-17 19:41 ` Emmanuel Vadot
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.