All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options
@ 2016-11-07  8:34 Emmanuel Vadot
  2016-11-07  8:34 ` [U-Boot] [PATCH 1/4] kconfig: Add API kconfig file Emmanuel Vadot
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Emmanuel Vadot @ 2016-11-07  8:34 UTC (permalink / raw)
  To: u-boot

This series of patches add the needed bits for booting the FreeBSD
loader.
FreeBSD loader needs the U-Boot API and dache disabled for it to run so
add kconfig options for them.
Also add some some boot command that locate and run the FreeBSD loader
if found.

Emmanuel Vadot (4):
  kconfig: Add API kconfig file
  kconfig: arm: Add SYS_DCACHE_OFF option
  kconfig: Add a FREEBSD option
  distro_bootcmd: Add command to run FreeBSD

 Kconfig                         |  2 ++
 api/Kconfig                     |  9 +++++++++
 arch/arm/Kconfig                |  6 ++++++
 common/Kconfig                  |  9 +++++++++
 include/config_distro_bootcmd.h | 32 ++++++++++++++++++++++++++++++++
 5 files changed, 58 insertions(+)
 create mode 100644 api/Kconfig

-- 
2.9.2

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 1/4] kconfig: Add API kconfig file
  2016-11-07  8:34 [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options Emmanuel Vadot
@ 2016-11-07  8:34 ` Emmanuel Vadot
  2016-11-07  8:34 ` [U-Boot] [PATCH 2/4] kconfig: arm: Add SYS_DCACHE_OFF option Emmanuel Vadot
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Emmanuel Vadot @ 2016-11-07  8:34 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 1263d0b..6e7c9b0 100644
--- a/Kconfig
+++ b/Kconfig
@@ -335,6 +335,8 @@ config ARCH_FIXUP_FDT
 
 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 0000000..88b4f6c
--- /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.9.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/4] kconfig: arm: Add SYS_DCACHE_OFF option
  2016-11-07  8:34 [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options Emmanuel Vadot
  2016-11-07  8:34 ` [U-Boot] [PATCH 1/4] kconfig: Add API kconfig file Emmanuel Vadot
@ 2016-11-07  8:34 ` Emmanuel Vadot
  2016-11-07  8:34 ` [U-Boot] [PATCH 3/4] kconfig: Add a FREEBSD option Emmanuel Vadot
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Emmanuel Vadot @ 2016-11-07  8:34 UTC (permalink / raw)
  To: u-boot

Add a kconfig option to disable the data cache.

Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
---
 arch/arm/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d7a9b11..59b91a0 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -118,6 +118,12 @@ config SYS_L2CACHE_OFF
 	  If SoC does not support L2CACHE or one do not want to enable
 	  L2CACHE, choose this option.
 
+config SYS_DCACHE_OFF
+	bool "Do not use Data Cache"
+	default n
+	help
+	  If one do not want to enable the data cache, choose this option.
+
 config ENABLE_ARM_SOC_BOOT0_HOOK
 	bool "prepare BOOT0 header"
 	help
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 3/4] kconfig: Add a FREEBSD option
  2016-11-07  8:34 [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options Emmanuel Vadot
  2016-11-07  8:34 ` [U-Boot] [PATCH 1/4] kconfig: Add API kconfig file Emmanuel Vadot
  2016-11-07  8:34 ` [U-Boot] [PATCH 2/4] kconfig: arm: Add SYS_DCACHE_OFF option Emmanuel Vadot
@ 2016-11-07  8:34 ` Emmanuel Vadot
  2016-11-07  8:34 ` [U-Boot] [PATCH 4/4] distro_bootcmd: Add command to run FreeBSD Emmanuel Vadot
  2016-11-11 16:07 ` [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options Tom Rini
  4 siblings, 0 replies; 8+ messages in thread
From: Emmanuel Vadot @ 2016-11-07  8:34 UTC (permalink / raw)
  To: u-boot

Add a FreeBSD option that enable the API and disable the data cache 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 913d21a..73cd205 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -383,4 +383,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 SYS_DCACHE_OFF
+	default n
+	help
+	  This option adds boot configuration that can run the FreeBSD
+	  loader.
+
 source "common/spl/Kconfig"
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 4/4] distro_bootcmd: Add command to run FreeBSD
  2016-11-07  8:34 [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options Emmanuel Vadot
                   ` (2 preceding siblings ...)
  2016-11-07  8:34 ` [U-Boot] [PATCH 3/4] kconfig: Add a FREEBSD option Emmanuel Vadot
@ 2016-11-07  8:34 ` Emmanuel Vadot
  2016-11-11 16:07 ` [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options Tom Rini
  4 siblings, 0 replies; 8+ messages in thread
From: Emmanuel Vadot @ 2016-11-07  8:34 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 9ecaf38..0f5d385 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.9.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options
  2016-11-07  8:34 [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options Emmanuel Vadot
                   ` (3 preceding siblings ...)
  2016-11-07  8:34 ` [U-Boot] [PATCH 4/4] distro_bootcmd: Add command to run FreeBSD Emmanuel Vadot
@ 2016-11-11 16:07 ` Tom Rini
  2016-11-17 14:12   ` Emmanuel Vadot
  4 siblings, 1 reply; 8+ messages in thread
From: Tom Rini @ 2016-11-11 16:07 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 07, 2016 at 09:34:27AM +0100, Emmanuel Vadot wrote:

> This series of patches add the needed bits for booting the FreeBSD
> loader.
> FreeBSD loader needs the U-Boot API and dache disabled for it to run so
> add kconfig options for them.
> Also add some some boot command that locate and run the FreeBSD loader
> if found.
> 
> Emmanuel Vadot (4):
>   kconfig: Add API kconfig file
>   kconfig: arm: Add SYS_DCACHE_OFF option
>   kconfig: Add a FREEBSD option
>   distro_bootcmd: Add command to run FreeBSD
> 
>  Kconfig                         |  2 ++
>  api/Kconfig                     |  9 +++++++++
>  arch/arm/Kconfig                |  6 ++++++
>  common/Kconfig                  |  9 +++++++++
>  include/config_distro_bootcmd.h | 32 ++++++++++++++++++++++++++++++++

This is a good first start.  But I think there's a few things that need
tweaking.  First, we don't want to globally turn off dcache, but it does
need to be migrated to Kconfig (so we know if it's enabled or not).
Second, we should instead use CMD_CACHE and the 'dcache' command to
disable dcache prior to running the FreeBSD loader.  Then we make sure
that the generic distro feature has CMD_CACHE if !SYS_DCACHE_OFF (and
!SYS_ICACHE_OFF).  Thanks!

-- 
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/20161111/3704eb3c/attachment.sig>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options
  2016-11-11 16:07 ` [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options Tom Rini
@ 2016-11-17 14:12   ` Emmanuel Vadot
  2016-11-17 16:27     ` Tom Rini
  0 siblings, 1 reply; 8+ messages in thread
From: Emmanuel Vadot @ 2016-11-17 14:12 UTC (permalink / raw)
  To: u-boot

On Fri, 11 Nov 2016 11:07:34 -0500
Tom Rini <trini@konsulko.com> wrote:

> On Mon, Nov 07, 2016 at 09:34:27AM +0100, Emmanuel Vadot wrote:
> 
> > This series of patches add the needed bits for booting the FreeBSD
> > loader.
> > FreeBSD loader needs the U-Boot API and dache disabled for it to run so
> > add kconfig options for them.
> > Also add some some boot command that locate and run the FreeBSD loader
> > if found.
> > 
> > Emmanuel Vadot (4):
> >   kconfig: Add API kconfig file
> >   kconfig: arm: Add SYS_DCACHE_OFF option
> >   kconfig: Add a FREEBSD option
> >   distro_bootcmd: Add command to run FreeBSD
> > 
> >  Kconfig                         |  2 ++
> >  api/Kconfig                     |  9 +++++++++
> >  arch/arm/Kconfig                |  6 ++++++
> >  common/Kconfig                  |  9 +++++++++
> >  include/config_distro_bootcmd.h | 32 ++++++++++++++++++++++++++++++++
> 
> This is a good first start.  But I think there's a few things that need
> tweaking.  First, we don't want to globally turn off dcache, but it does
> need to be migrated to Kconfig (so we know if it's enabled or not).
> Second, we should instead use CMD_CACHE and the 'dcache' command to
> disable dcache prior to running the FreeBSD loader.  Then we make sure
> that the generic distro feature has CMD_CACHE if !SYS_DCACHE_OFF (and
> !SYS_ICACHE_OFF).  Thanks!
> 
> -- 
> Tom

 Hi Tom,

 I will make the modification, should I sent the patch for
migration of SYS_DCACHE_OFF to Kconfig as a separate patch ?


-- 
Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options
  2016-11-17 14:12   ` Emmanuel Vadot
@ 2016-11-17 16:27     ` Tom Rini
  0 siblings, 0 replies; 8+ messages in thread
From: Tom Rini @ 2016-11-17 16:27 UTC (permalink / raw)
  To: u-boot

On Thu, Nov 17, 2016 at 03:12:02PM +0100, Emmanuel Vadot wrote:
> On Fri, 11 Nov 2016 11:07:34 -0500
> Tom Rini <trini@konsulko.com> wrote:
> 
> > On Mon, Nov 07, 2016 at 09:34:27AM +0100, Emmanuel Vadot wrote:
> > 
> > > This series of patches add the needed bits for booting the FreeBSD
> > > loader.
> > > FreeBSD loader needs the U-Boot API and dache disabled for it to run so
> > > add kconfig options for them.
> > > Also add some some boot command that locate and run the FreeBSD loader
> > > if found.
> > > 
> > > Emmanuel Vadot (4):
> > >   kconfig: Add API kconfig file
> > >   kconfig: arm: Add SYS_DCACHE_OFF option
> > >   kconfig: Add a FREEBSD option
> > >   distro_bootcmd: Add command to run FreeBSD
> > > 
> > >  Kconfig                         |  2 ++
> > >  api/Kconfig                     |  9 +++++++++
> > >  arch/arm/Kconfig                |  6 ++++++
> > >  common/Kconfig                  |  9 +++++++++
> > >  include/config_distro_bootcmd.h | 32 ++++++++++++++++++++++++++++++++
> > 
> > This is a good first start.  But I think there's a few things that need
> > tweaking.  First, we don't want to globally turn off dcache, but it does
> > need to be migrated to Kconfig (so we know if it's enabled or not).
> > Second, we should instead use CMD_CACHE and the 'dcache' command to
> > disable dcache prior to running the FreeBSD loader.  Then we make sure
> > that the generic distro feature has CMD_CACHE if !SYS_DCACHE_OFF (and
> > !SYS_ICACHE_OFF).  Thanks!
> > 
> > -- 
> > Tom
> 
>  Hi Tom,
> 
>  I will make the modification, should I sent the patch for
> migration of SYS_DCACHE_OFF to Kconfig as a separate patch ?

I'll grab (and re-run the moveconfig.py part) for the first two parts of
your series.

-- 
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/20161117/2958b9c3/attachment.sig>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-11-17 16:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-07  8:34 [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options Emmanuel Vadot
2016-11-07  8:34 ` [U-Boot] [PATCH 1/4] kconfig: Add API kconfig file Emmanuel Vadot
2016-11-07  8:34 ` [U-Boot] [PATCH 2/4] kconfig: arm: Add SYS_DCACHE_OFF option Emmanuel Vadot
2016-11-07  8:34 ` [U-Boot] [PATCH 3/4] kconfig: Add a FREEBSD option Emmanuel Vadot
2016-11-07  8:34 ` [U-Boot] [PATCH 4/4] distro_bootcmd: Add command to run FreeBSD Emmanuel Vadot
2016-11-11 16:07 ` [U-Boot] [PATCH 0/4] config: Add FreeBSD kconfig options Tom Rini
2016-11-17 14:12   ` Emmanuel Vadot
2016-11-17 16:27     ` Tom Rini

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.