summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86/Kconfig8
-rw-r--r--arch/x86/config.mk4
-rw-r--r--arch/x86/cpu/x86_64/cpu.c12
-rw-r--r--arch/x86/dts/coreboot.dts10
-rw-r--r--board/emulation/qemu-x86/Kconfig3
-rw-r--r--configs/coreboot64_defconfig2
-rw-r--r--configs/coreboot_defconfig2
-rw-r--r--configs/qemu-x86_64_defconfig5
-rw-r--r--configs/qemu-x86_defconfig1
-rw-r--r--drivers/video/Kconfig1
-rw-r--r--drivers/video/console_truetype.c10
-rw-r--r--drivers/video/vidconsole-uclass.c15
12 files changed, 63 insertions, 10 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e5ee10af33c..23a1e21b29e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -723,6 +723,14 @@ config ROM_TABLE_SIZE
hex
default 0x10000
+config X86_HARDFP
+ bool "Support hardware floating point"
+ help
+ U-Boot generally does not make use of floating point. Where this is
+ needed, it can be enabled using this option. This adjusts the
+ start-up code for 64-bit mode and changes the compiler options for
+ 64-bit to enable SSE.
+
config HAVE_ITSS
bool "Enable ITSS"
help
diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 26ec1af2f0b..2e3a7119e79 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -27,9 +27,13 @@ ifeq ($(IS_32BIT),y)
PLATFORM_CPPFLAGS += -march=i386 -m32
else
PLATFORM_CPPFLAGS += $(if $(CONFIG_SPL_BUILD),,-fpic) -fno-common -march=core2 -m64
+
+ifndef CONFIG_X86_HARDFP
PLATFORM_CPPFLAGS += -mno-mmx -mno-sse
endif
+endif # IS_32BIT
+
PLATFORM_RELFLAGS += -fdata-sections -ffunction-sections -fvisibility=hidden
KBUILD_LDFLAGS += -Bsymbolic -Bsymbolic-functions
diff --git a/arch/x86/cpu/x86_64/cpu.c b/arch/x86/cpu/x86_64/cpu.c
index 2647bff891f..5ea746ecce4 100644
--- a/arch/x86/cpu/x86_64/cpu.c
+++ b/arch/x86/cpu/x86_64/cpu.c
@@ -10,6 +10,7 @@
#include <init.h>
#include <asm/cpu.h>
#include <asm/global_data.h>
+#include <asm/processor-flags.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -39,11 +40,22 @@ int x86_mp_init(void)
return 0;
}
+/* enable SSE features for hardware floating point */
+static void setup_sse_features(void)
+{
+ asm ("mov %%cr4, %%rax\n" \
+ "or %0, %%rax\n" \
+ "mov %%rax, %%cr4\n" \
+ : : "i" (X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT) : "eax");
+}
+
int x86_cpu_reinit_f(void)
{
/* set the vendor to Intel so that native_calibrate_tsc() works */
gd->arch.x86_vendor = X86_VENDOR_INTEL;
gd->arch.has_mtrr = true;
+ if (IS_ENABLED(CONFIG_X86_HARDFP))
+ setup_sse_features();
return 0;
}
diff --git a/arch/x86/dts/coreboot.dts b/arch/x86/dts/coreboot.dts
index dfce7c2d591..b867468e16c 100644
--- a/arch/x86/dts/coreboot.dts
+++ b/arch/x86/dts/coreboot.dts
@@ -46,6 +46,16 @@
compatible = "coreboot-fb";
};
+ bootstd {
+ compatible = "u-boot,boot-std";
+
+ theme {
+ font-size = <30>;
+ menu-inset = <3>;
+ menuitem-gap-y = <1>;
+ };
+ };
+
sysinfo {
compatible = "coreboot,sysinfo";
};
diff --git a/board/emulation/qemu-x86/Kconfig b/board/emulation/qemu-x86/Kconfig
index 9a0611820ce..b2a4e0891a4 100644
--- a/board/emulation/qemu-x86/Kconfig
+++ b/board/emulation/qemu-x86/Kconfig
@@ -18,7 +18,8 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select X86_RESET_VECTOR
select QEMU
select QFW_PIO if CMD_QFW
- select BOARD_ROMSIZE_KB_1024
+ select BOARD_ROMSIZE_KB_1024 if TARGET_QEMU_X86
+ select BOARD_ROMSIZE_KB_2048 if TARGET_QEMU_X86_64
imply VIRTIO_PCI
imply VIRTIO_NET
imply VIRTIO_BLK
diff --git a/configs/coreboot64_defconfig b/configs/coreboot64_defconfig
index dab5eafe160..da42ad0a20a 100644
--- a/configs/coreboot64_defconfig
+++ b/configs/coreboot64_defconfig
@@ -16,6 +16,7 @@ CONFIG_BOOTSTD_FULL=y
CONFIG_SHOW_BOOT_PROGRESS=y
CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
+CONFIG_BOOTCOMMAND="bootflow scan -l; if bootflow menu; then cls; bootflow boot; fi"
CONFIG_SYS_PBSIZE=532
CONFIG_PRE_CONSOLE_BUFFER=y
CONFIG_SYS_CONSOLE_INFO_QUIET=y
@@ -59,6 +60,7 @@ CONFIG_SYS_NS16550_MEM32=y
CONFIG_SOUND=y
CONFIG_SOUND_I8254=y
CONFIG_VIDEO_COPY=y
+CONFIG_CONSOLE_TRUETYPE=y
CONFIG_CONSOLE_SCROLL_LINES=5
CONFIG_SPL_ACPI=y
CONFIG_CMD_DHRYSTONE=y
diff --git a/configs/coreboot_defconfig b/configs/coreboot_defconfig
index c846dfc2b91..0b103efe16d 100644
--- a/configs/coreboot_defconfig
+++ b/configs/coreboot_defconfig
@@ -14,6 +14,7 @@ CONFIG_BOOTSTD_FULL=y
CONFIG_SHOW_BOOT_PROGRESS=y
CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="root=/dev/sdb3 init=/sbin/init rootwait ro"
+CONFIG_BOOTCOMMAND="bootflow scan -l; if bootflow menu; then cls; bootflow boot; fi"
CONFIG_PRE_CONSOLE_BUFFER=y
CONFIG_SYS_CONSOLE_INFO_QUIET=y
CONFIG_LOG=y
@@ -53,6 +54,7 @@ CONFIG_SYS_NS16550_MEM32=y
CONFIG_SOUND=y
CONFIG_SOUND_I8254=y
CONFIG_VIDEO_COPY=y
+CONFIG_CONSOLE_TRUETYPE=y
CONFIG_CONSOLE_SCROLL_LINES=5
CONFIG_CMD_DHRYSTONE=y
# CONFIG_GZIP is not set
diff --git a/configs/qemu-x86_64_defconfig b/configs/qemu-x86_64_defconfig
index 451af0bda68..008eb46a01c 100644
--- a/configs/qemu-x86_64_defconfig
+++ b/configs/qemu-x86_64_defconfig
@@ -6,7 +6,7 @@ CONFIG_ENV_SIZE=0x40000
CONFIG_MAX_CPUS=2
CONFIG_SPL_DM_SPI=y
CONFIG_DEFAULT_DEVICE_TREE="qemu-x86_i440fx"
-CONFIG_SPL_TEXT_BASE=0xfffd8000
+CONFIG_SPL_TEXT_BASE=0xfffd4000
CONFIG_SPL_SYS_MALLOC_F_LEN=0x2000
CONFIG_DEBUG_UART_BASE=0x3f8
CONFIG_DEBUG_UART_CLOCK=1843200
@@ -17,7 +17,7 @@ CONFIG_DEBUG_UART=y
CONFIG_SMP=y
CONFIG_GENERATE_PIRQ_TABLE=y
CONFIG_GENERATE_MP_TABLE=y
-CONFIG_X86_OFFSET_U_BOOT=0xfff00000
+CONFIG_X86_OFFSET_U_BOOT=0xffe00000
CONFIG_SYS_MONITOR_BASE=0x01110000
CONFIG_FIT=y
CONFIG_SPL_LOAD_FIT=y
@@ -80,6 +80,7 @@ CONFIG_SPL_DM_RTC=y
CONFIG_SYS_NS16550_PORT_MAPPED=y
CONFIG_SPI=y
CONFIG_USB_KEYBOARD=y
+CONFIG_CONSOLE_TRUETYPE=y
CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
CONFIG_FRAMEBUFFER_VESA_MODE_USER=y
CONFIG_FRAMEBUFFER_VESA_MODE=0x144
diff --git a/configs/qemu-x86_defconfig b/configs/qemu-x86_defconfig
index b2a221b12a3..947d15cd727 100644
--- a/configs/qemu-x86_defconfig
+++ b/configs/qemu-x86_defconfig
@@ -57,6 +57,7 @@ CONFIG_NVME_PCI=y
CONFIG_SYS_NS16550_PORT_MAPPED=y
CONFIG_SPI=y
CONFIG_USB_KEYBOARD=y
+CONFIG_CONSOLE_TRUETYPE=y
CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
CONFIG_FRAMEBUFFER_VESA_MODE_USER=y
CONFIG_FRAMEBUFFER_VESA_MODE=0x144
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 6f319ba0d54..39c82521be1 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -180,6 +180,7 @@ config CONSOLE_ROTATION
config CONSOLE_TRUETYPE
bool "Support a console that uses TrueType fonts"
+ select X86_HARDFP if X86
help
TrueTrype fonts can provide outline-drawing capability rather than
needing to provide a bitmap for each font and size that is needed.
diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c
index 362458aecd4..28665a32757 100644
--- a/drivers/video/console_truetype.c
+++ b/drivers/video/console_truetype.c
@@ -8,6 +8,7 @@
#include <dm.h>
#include <log.h>
#include <malloc.h>
+#include <spl.h>
#include <video.h>
#include <video_console.h>
@@ -802,6 +803,9 @@ static int truetype_entry_save(struct udevice *dev, struct abuf *buf)
struct console_tt_store store;
const uint size = sizeof(store);
+ if (spl_phase() <= PHASE_SPL)
+ return -ENOSYS;
+
/*
* store the whole priv structure as it is simpler that picking out
* what we need
@@ -823,6 +827,9 @@ static int truetype_entry_restore(struct udevice *dev, struct abuf *buf)
struct console_tt_priv *priv = dev_get_priv(dev);
struct console_tt_store store;
+ if (spl_phase() <= PHASE_SPL)
+ return -ENOSYS;
+
memcpy(&store, abuf_data(buf), sizeof(store));
vc_priv->xcur_frac = store.cur.xpos_frac;
@@ -847,6 +854,9 @@ static int truetype_set_cursor_visible(struct udevice *dev, bool visible,
uint out, val;
int ret;
+ if (spl_phase() <= PHASE_SPL)
+ return -ENOSYS;
+
if (!visible)
return 0;
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index 5f89f6a5219..5d06e51ff23 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -126,6 +126,7 @@ void vidconsole_set_cursor_pos(struct udevice *dev, int x, int y)
priv->xcur_frac = VID_TO_POS(x);
priv->xstart_frac = priv->xcur_frac;
priv->ycur = y;
+ vidconsole_entry_start(dev);
}
/**
@@ -135,8 +136,10 @@ void vidconsole_set_cursor_pos(struct udevice *dev, int x, int y)
* @row: new row
* @col: new column
*/
-static void set_cursor_position(struct vidconsole_priv *priv, int row, int col)
+static void set_cursor_position(struct udevice *dev, int row, int col)
{
+ struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
+
/*
* Ensure we stay in the bounds of the screen.
*/
@@ -145,9 +148,7 @@ static void set_cursor_position(struct vidconsole_priv *priv, int row, int col)
if (col >= priv->cols)
col = priv->cols - 1;
- priv->ycur = row * priv->y_charsize;
- priv->xcur_frac = priv->xstart_frac +
- VID_TO_POS(col * priv->x_charsize);
+ vidconsole_position_cursor(dev, col, row);
}
/**
@@ -194,7 +195,7 @@ static void vidconsole_escape_char(struct udevice *dev, char ch)
int row = priv->row_saved;
int col = priv->col_saved;
- set_cursor_position(priv, row, col);
+ set_cursor_position(dev, row, col);
priv->escape = 0;
return;
}
@@ -256,7 +257,7 @@ static void vidconsole_escape_char(struct udevice *dev, char ch)
if (row < 0)
row = 0;
/* Right and bottom overflows are handled in the callee. */
- set_cursor_position(priv, row, col);
+ set_cursor_position(dev, row, col);
break;
}
case 'H':
@@ -280,7 +281,7 @@ static void vidconsole_escape_char(struct udevice *dev, char ch)
if (col)
--col;
- set_cursor_position(priv, row, col);
+ set_cursor_position(dev, row, col);
break;
}