Merge tag 'x86-pull-20230801' of https://source.denx.de/u-boot/custodians/u-boot-x86
- MTRR fixes for x86 boards
- Add a little more info to 'cbsysinfo' command
diff --git a/arch/arm/dts/ac5-98dx35xx-atl-x240.dts b/arch/arm/dts/ac5-98dx35xx-atl-x240.dts
index 820ec18..c19b259 100644
--- a/arch/arm/dts/ac5-98dx35xx-atl-x240.dts
+++ b/arch/arm/dts/ac5-98dx35xx-atl-x240.dts
@@ -16,7 +16,7 @@
gpio0 = &gpio0;
gpio1 = &gpio1;
spi0 = &spi0;
- i2c0 = &i2c0;
+ i2c0 = &i2cgpio;
usb0 = &usb0;
pinctrl0 = &pinctrl0;
};
@@ -40,6 +40,19 @@
default-state = "on";
};
};
+
+ i2cgpio: i2c-gpio-0 {
+ compatible = "i2c-gpio";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c0_gpio>;
+ scl-gpios = <&gpio0 26 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ sda-gpios = <&gpio0 27 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ i2c-gpio,delay-us = <2>;
+ status = "okay";
+ };
};
&nand {
@@ -70,9 +83,7 @@
status = "okay";
};
-&i2c0 {
- status = "okay";
-
+&i2cgpio {
mux@71 {
#address-cells = <1>;
#size-cells = <0>;
@@ -177,8 +188,8 @@
* LED_OE_N [23]
* USB_PWR_FLT_N [24]
* SFP_INT_N [25]
- * I2C0_SCL [26]
- * I2C0_SDA [27]
+ * I2C0_SCL [26] (GPIO)
+ * I2C0_SDA [27] (GPIO)
* USB_EN [28]
* MONITOR_INT_N [29]
* XM1_MDC [30]
@@ -201,7 +212,7 @@
/* 0 1 2 3 4 5 6 7 8 9 */
pin-func = < 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 1 1 1 1 0xff 0xff 0 0
- 0 0 0 0 0 0 1 1 0 0
+ 0 0 0 0 0 0 0xff 0xff 0 0
1 1 1 1 0 0 0 0 0 0
0 0 0 1 1 1 >;
@@ -209,4 +220,9 @@
marvell,pins = <0 1 2 3 4 5 6 7 8 9 10 11 16 17>;
marvell,function = <2>;
};
+
+ i2c0_gpio: i2c0-gpio-pins {
+ marvell,pins = <26 27>;
+ marvell,function = <0>;
+ };
};
diff --git a/configs/x240_defconfig b/configs/x240_defconfig
index a78cb3c..7d2b860 100644
--- a/configs/x240_defconfig
+++ b/configs/x240_defconfig
@@ -42,6 +42,7 @@
CONFIG_GPIO_HOG=y
CONFIG_DM_PCA953X=y
CONFIG_DM_I2C=y
+CONFIG_DM_I2C_GPIO=y
CONFIG_SYS_I2C_MVTWSI=y
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_PCA954x=y
diff --git a/drivers/i2c/i2c-gpio.c b/drivers/i2c/i2c-gpio.c
index 4ed9e9e..c1fc290 100644
--- a/drivers/i2c/i2c-gpio.c
+++ b/drivers/i2c/i2c-gpio.c
@@ -339,7 +339,7 @@
/* "gpios" is deprecated and replaced by "sda-gpios" + "scl-gpios". */
ret = gpio_request_list_by_name(dev, "gpios", bus->gpios,
ARRAY_SIZE(bus->gpios), 0);
- if (ret == -ENOENT) {
+ if (ret == 0) {
ret = gpio_request_by_name(dev, "sda-gpios", 0,
&bus->gpios[PIN_SDA], 0);
if (ret < 0)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index b41dc60..e32ce13 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -64,8 +64,9 @@
config VIDEO_PCI_DEFAULT_FB_SIZE
hex "Default framebuffer size to use if no drivers request it"
- default 0x1000000 if X86 && PCI
- default 0 if !(X86 && PCI)
+ default 0x1000000 if X86
+ default 0x800000 if !X86 && VIDEO_BOCHS
+ default 0 if !X86 && !VIDEO_BOCHS
help
Generally, video drivers request the amount of memory they need for
the frame buffer when they are bound, by setting the size field in
@@ -77,7 +78,7 @@
devices to have a framebuffer allocated by U-Boot.
Note: the framebuffer needs to be large enough to store all pixels at
- maximum resolution. For example, at 1920 x 1200 with 32 bits per
+ maximum resolution. For example, at 2560 x 1600 with 32 bits per
pixel, 2560 * 1600 * 32 / 8 = 0xfa0000 bytes are needed.
config VIDEO_COPY
@@ -280,7 +281,6 @@
config VIDEO_BOCHS
bool "Enable Bochs video emulation for QEMU"
- depends on X86
help
Enable this to use the Bochs video support provided in the QEMU
emulator. This appears as a PCI device which U-Boot can set up to
@@ -1037,8 +1037,9 @@
config SPL_VIDEO_PCI_DEFAULT_FB_SIZE
hex "Default framebuffer size to use if no drivers request it at SPL"
- default 0x1000000 if X86 && PCI
- default 0 if !(X86 && PCI)
+ default 0x1000000 if X86
+ default 0x800000 if !X86 && VIDEO_BOCHS
+ default 0 if !X86 && !VIDEO_BOCHS
help
Generally, video drivers request the amount of memory they need for
the frame buffer when they are bound, by setting the size field in
@@ -1050,7 +1051,7 @@
devices to have a framebuffer allocated by U-Boot.
Note: the framebuffer needs to be large enough to store all pixels at
- maximum resolution. For example, at 1920 x 1200 with 32 bits per
+ maximum resolution. For example, at 2560 x 1600 with 32 bits per
pixel, 2560 * 1600 * 32 / 8 = 0xfa0000 bytes are needed.
config SPL_CONSOLE_SCROLL_LINES
diff --git a/drivers/video/bochs.c b/drivers/video/bochs.c
index 2136b51..022ea38 100644
--- a/drivers/video/bochs.c
+++ b/drivers/video/bochs.c
@@ -11,7 +11,6 @@
#include <pci.h>
#include <video.h>
#include <asm/io.h>
-#include <asm/mtrr.h>
#include <linux/sizes.h>
#include "bochs.h"
@@ -28,9 +27,9 @@
return readw(mmio + MMIO_BASE + index * 2);
}
-static void bochs_vga_write(int index, uint8_t val)
+static void bochs_vga_write(void *mmio, int index, uint8_t val)
{
- outb(val, VGA_INDEX);
+ writeb(val, mmio + VGA_BASE + index);
}
static int bochs_init_fb(struct udevice *dev)
@@ -79,7 +78,8 @@
bochs_write(mmio, INDEX_Y_OFFSET, 0);
bochs_write(mmio, INDEX_ENABLE, ENABLED | LFB_ENABLED);
- bochs_vga_write(0, 0x20); /* disable blanking */
+ /* disable blanking */
+ bochs_vga_write(mmio, VGA_ATT_W - VGA_INDEX, VGA_AR_ENABLE_DISPLAY);
plat->base = fb;
@@ -101,8 +101,8 @@
{
struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
- /* Set the maximum supported resolution */
- uc_plat->size = 2560 * 1600 * 4;
+ /* Set the frame buffer size per configuration */
+ uc_plat->size = xsize * ysize * 32 / 8;
log_debug("%s: Frame buffer size %x\n", __func__, uc_plat->size);
return 0;
diff --git a/drivers/video/bochs.h b/drivers/video/bochs.h
index 4c8ec83..3facf69 100644
--- a/drivers/video/bochs.h
+++ b/drivers/video/bochs.h
@@ -6,10 +6,10 @@
#ifndef __BOCHS_H
#define __BOCHS_H
-#define VGA_INDEX 0x3c0
+#define VGA_INDEX 0x3c0
-#define IOPORT_INDEX 0x01ce
-#define IOPORT_DATA 0x01cf
+#define VGA_ATT_W 0x3c0
+#define VGA_AR_ENABLE_DISPLAY 0x20
enum {
INDEX_ID,
@@ -31,6 +31,7 @@
#define LFB_ENABLED BIT(6)
#define NOCLEARMEM BIT(7)
+#define VGA_BASE 0x400
#define MMIO_BASE 0x500
#endif
diff --git a/drivers/video/tidss/tidss_drv.c b/drivers/video/tidss/tidss_drv.c
index 078e3e8..e285f25 100644
--- a/drivers/video/tidss/tidss_drv.c
+++ b/drivers/video/tidss/tidss_drv.c
@@ -901,18 +901,10 @@
static int tidss_drv_remove(struct udevice *dev)
{
- u32 val;
- int ret;
- struct tidss_drv_priv *priv = dev_get_priv(dev);
+ if (CONFIG_IS_ENABLED(VIDEO_REMOVE)) {
+ struct tidss_drv_priv *priv = dev_get_priv(dev);
- priv->base_common = dev_remap_addr_index(dev, 0);
- REG_FLD_MOD(priv, DSS_SYSCONFIG, 1, 1, 1);
- /* Wait for reset to complete */
- ret = readl_poll_timeout(priv->base_common + DSS_SYSSTATUS,
- val, val & 1, 5000);
- if (ret) {
- dev_warn(priv->dev, "failed to reset priv\n");
- return ret;
+ VP_REG_FLD_MOD(priv, 0, DSS_VP_CONTROL, 0, 0, 0);
}
return 0;
}
@@ -939,5 +931,9 @@
.probe = tidss_drv_probe,
.remove = tidss_drv_remove,
.priv_auto = sizeof(struct tidss_drv_priv),
+#if CONFIG_IS_ENABLED(VIDEO_REMOVE)
.flags = DM_FLAG_OS_PREPARE,
+#else
+ .flags = DM_FLAG_OS_PREPARE | DM_FLAG_LEAVE_PD_ON,
+#endif
};
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 949595f..8f268fc 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -626,10 +626,12 @@
addr = uc_priv->video_ptr;
size = alloc_fb(dev, &addr);
if (addr < gd->video_bottom) {
- /* Device tree node may need the 'bootph-all' or
+ /*
+ * Device tree node may need the 'bootph-all' or
* 'bootph-some-ram' tag
*/
- printf("Video device '%s' cannot allocate frame buffer memory -ensure the device is set up before relocation\n",
+ printf("Video device '%s' cannot allocate frame buffer memory "
+ "- ensure the device is set up before relocation\n",
dev->name);
return -ENOSPC;
}