config: Add FreeBSD kconfig options
cover config: Add FreeBSD kconfig options
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
Signature · 1 line
2.9.2
PATCH 1/4 kconfig: Add API kconfig file
Add kconfig file to enable API support
--- Kconfig | 2 ++ api/Kconfig | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 api/Kconfig
Kconfig +2 -0
@@ -335,6 +335,8 @@ config ARCH_FIXUP_FDT endmenu # Boot images +source "api/Kconfig" + source "common/Kconfig" source "cmd/Kconfig"
api/Kconfig new file +9 -0
@@ -0,0 +1,9 @@ +menu "API" + +config API + bool "Enable U-Boot API" + default n + help + This option enable the U-Boot API. + +endmenu
Signature · 1 line
2.9.2
PATCH 2/4 kconfig: arm: Add SYS_DCACHE_OFF option
In reply to Emmanuel VadotAdd a kconfig option to disable the data cache.
--- arch/arm/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/Kconfig +6 -0
@@ -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
Signature · 1 line
2.9.2
PATCH 3/4 kconfig: Add a FREEBSD option
In reply to Emmanuel VadotAdd a FreeBSD option that enable the API and disable the data cache as it is needed to boot the FreeBSD loader.
--- common/Kconfig | 9 +++++++++ 1 file changed, 9 insertions(+)
common/Kconfig +9 -0
@@ -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"
Signature · 1 line
2.9.2
PATCH 4/4 distro_bootcmd: Add command to run FreeBSD
In reply to Emmanuel VadotAdd 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.
--- include/config_distro_bootcmd.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
include/config_distro_bootcmd.h +32 -0
@@ -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=" \
Signature · 1 line
2.9.2
cover config: Add FreeBSD kconfig options
In reply to Emmanuel VadotQuoted 13 lines · Emmanuel Vadot
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: AddSYS_DCACHE_OFFoption
kconfig: Add a FREEBSD option
distro_bootcmd: Add command to run FreeBSD
Quoted 5 lines
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!
Signature · 8 lines
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>
cover config: Add FreeBSD kconfig options
Quoted 21 lines · On Fri, 11 Nov 2016 11:07:34 -0500 Tom Rini <[email protected]> wrote:
Quoted 13 lines · Emmanuel Vadot
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: AddSYS_DCACHE_OFFoption
kconfig: Add a FREEBSD option
distro_bootcmd: Add command to run FreeBSDQuoted 5 lines
Kconfig | 2 ++ api/Kconfig | 9 +++++++++ arch/arm/Kconfig | 6 ++++++ common/Kconfig | 9 +++++++++ include/config_distro_bootcmd.h | 32 ++++++++++++++++++++++++++++++++
Quoted 10 lines
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 useCMD_CACHEand the 'dcache' command to disable dcache prior to running the FreeBSD loader. Then we make sure that the generic distro feature hasCMD_CACHEif !SYS_DCACHE_OFF (and !SYS_ICACHE_OFF). Thanks!Signature · 1 line
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 ?
Signature · 1 line
Emmanuel Vadot <[email protected]> <[email protected]>
cover config: Add FreeBSD kconfig options
Quoted 32 lines · Emmanuel Vadot
Quoted 29 lines · On Fri, 11 Nov 2016 11:07:34 -0500 Tom Rini <[email protected]> wrote:
Quoted 13 lines · Emmanuel Vadot
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: AddSYS_DCACHE_OFFoption
kconfig: Add a FREEBSD option
distro_bootcmd: Add command to run FreeBSDQuoted 5 lines
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 useCMD_CACHEand the 'dcache' command to disable dcache prior to running the FreeBSD loader. Then we make sure that the generic distro feature hasCMD_CACHEif !SYS_DCACHE_OFF (and !SYS_ICACHE_OFF). Thanks!
Quoted 7 lines
Quoted 2 lines
Signature · 1 line
TomHi Tom,
I will make the modification, should I sent the patch for
migration ofSYS_DCACHE_OFFtoKconfigas a separate patch ?
I'll grab (and re-run the moveconfig.py part) for the first two parts of your series.
Signature · 8 lines
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>