From e38f55d2e58b2c05b95006d41c59211420e73e62 Mon Sep 17 00:00:00 2001 From: Artem Lapkin Date: Thu, 27 May 2021 14:43:51 +0800 Subject: [PATCH 1/7] meson64: add kernel compression vars make possible to load simple compressed linux kernel for meson64 Signed-off-by: Artem Lapkin Signed-off-by: Neil Armstrong --- include/configs/meson64.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/configs/meson64.h b/include/configs/meson64.h index 17ebccd2c4..fb7f16d148 100644 --- a/include/configs/meson64.h +++ b/include/configs/meson64.h @@ -83,6 +83,8 @@ "stdin=" STDIN_CFG "\0" \ "stdout=" STDOUT_CFG "\0" \ "stderr=" STDOUT_CFG "\0" \ + "kernel_comp_addr_r=0x0d080000\0" \ + "kernel_comp_size=0x2000000\0" \ "fdt_addr_r=0x08008000\0" \ "scriptaddr=0x08000000\0" \ "kernel_addr_r=0x08080000\0" \ From 786c514946d485b009f49f8cb2231b83dfb22718 Mon Sep 17 00:00:00 2001 From: Artem Lapkin Date: Thu, 27 May 2021 15:35:28 +0800 Subject: [PATCH 2/7] VIM3: mmc_get_env_dev correct non emmc boot sources need return -1 if boot source is not EMMC or SD ( for example it will be useful if we have multy env sources configuration and device was booted from SPI flash and env need read from SPI not from mmc ) Signed-off-by: Artem Lapkin Reviewed-by: Jaehoon Chung Signed-off-by: Neil Armstrong --- board/amlogic/vim3/vim3.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/board/amlogic/vim3/vim3.c b/board/amlogic/vim3/vim3.c index 6cd5f2e115..71aaa0d804 100644 --- a/board/amlogic/vim3/vim3.c +++ b/board/amlogic/vim3/vim3.c @@ -19,9 +19,15 @@ int mmc_get_env_dev(void) { - if (meson_get_boot_device() == BOOT_DEVICE_EMMC) + switch (meson_get_boot_device()) { + case BOOT_DEVICE_EMMC: return 2; - return 1; + case BOOT_DEVICE_SD: + return 1; + default: + /* boot device is not EMMC|SD */ + return -1; + } } /* From 4f038ee6dca74254424c5e54ec4440450c1286ba Mon Sep 17 00:00:00 2001 From: Artem Lapkin Date: Tue, 13 Jul 2021 14:48:47 +0800 Subject: [PATCH 3/7] board: amlogic: vim3: fix phy-names property setup phy-names was improperly implemented resulting in an inoperable USB-OTG port. - phy-names = "usb2-phy0\0\0usb2-phy1\0"; + phy-names = "usb2-phy0\0usb2-phy1"; Signed-off-by: Artem Lapkin Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong --- board/amlogic/vim3/vim3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/amlogic/vim3/vim3.c b/board/amlogic/vim3/vim3.c index 71aaa0d804..18ef146218 100644 --- a/board/amlogic/vim3/vim3.c +++ b/board/amlogic/vim3/vim3.c @@ -104,8 +104,8 @@ int meson_ft_board_setup(void *blob, struct bd_info *bd) } /* Update PHY names (mandatory to disable USB3.0) */ - len = strlcpy(data, "usb2-phy0", 32) + 1; - len += strlcpy(&data[len], "usb2-phy1", 32 - len) + 1; + len = strlcpy(data, "usb2-phy0", 32); + len += strlcpy(&data[len], "usb2-phy1", 32 - len); ret = fdt_setprop(blob, node, "phy-names", data, len); if (ret < 0) { printf("vim3: failed to update usb phy names property (%d)\n", ret); From a41862d25e10c2476ba8810222bf77b50bd17ec3 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Fri, 14 May 2021 23:54:19 +0300 Subject: [PATCH 4/7] phy: meson-axg-mipi: Rename "priv_auto_alloc_size" to "priv_auto" With commit 41575d8e4c33 ("dm: treewide: Rename auto_alloc_size members to be shorter") "priv_auto_alloc_size" was renamed to "priv_auto". Apply the rename to these two drivers as well. Fixes: 4547551aa019 ("phy: Add Amlogic AXG MIPI PCIe Analog PHY driver") Fixes: 7ef19503bacf ("phy: Add Amlogic AXG MIPI D-PHY driver") Signed-off-by: Alper Nebi Yasak Reviewed-by: Simon Glass Signed-off-by: Neil Armstrong --- drivers/phy/meson-axg-mipi-dphy.c | 2 +- drivers/phy/meson-axg-mipi-pcie-analog.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/meson-axg-mipi-dphy.c b/drivers/phy/meson-axg-mipi-dphy.c index 8b2469793d..cf2a1cd14c 100644 --- a/drivers/phy/meson-axg-mipi-dphy.c +++ b/drivers/phy/meson-axg-mipi-dphy.c @@ -389,5 +389,5 @@ U_BOOT_DRIVER(meson_axg_mipi_dphy) = { .of_match = meson_axg_mipi_dphy_ids, .probe = meson_axg_mipi_dphy_probe, .ops = &meson_axg_mipi_dphy_ops, - .priv_auto_alloc_size = sizeof(struct phy_meson_axg_mipi_dphy_priv), + .priv_auto = sizeof(struct phy_meson_axg_mipi_dphy_priv), }; diff --git a/drivers/phy/meson-axg-mipi-pcie-analog.c b/drivers/phy/meson-axg-mipi-pcie-analog.c index 276e6004e5..7106c23d50 100644 --- a/drivers/phy/meson-axg-mipi-pcie-analog.c +++ b/drivers/phy/meson-axg-mipi-pcie-analog.c @@ -229,5 +229,5 @@ U_BOOT_DRIVER(meson_axg_mipi_pcie_analog) = { .of_match = meson_axg_mipi_pcie_analog_ids, .probe = meson_axg_mipi_pcie_analog_probe, .ops = &meson_axg_mipi_pcie_analog_ops, - .priv_auto_alloc_size = sizeof(struct phy_meson_axg_mipi_pcie_analog_priv), + .priv_auto = sizeof(struct phy_meson_axg_mipi_pcie_analog_priv), }; From a3f1eaa793a1b25a113e2814451b5795954fbb17 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Fri, 14 May 2021 23:54:20 +0300 Subject: [PATCH 5/7] phy: meson-axg-mipi: Access parent ofnode through dev_ofnode() With commit 84a42ae36683 ("dm: core: Rename device node to indicate it is private") and commit f10643cf8a4c ("dm: core: Access device ofnode through functions") accesses to the "node" member were replaced with dev_ofnode(). Also apply that replacement here. Fixes: 4547551aa019 ("phy: Add Amlogic AXG MIPI PCIe Analog PHY driver") Signed-off-by: Alper Nebi Yasak Reviewed-by: Simon Glass Signed-off-by: Neil Armstrong --- drivers/phy/meson-axg-mipi-pcie-analog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/phy/meson-axg-mipi-pcie-analog.c b/drivers/phy/meson-axg-mipi-pcie-analog.c index 7106c23d50..236ea1ce5c 100644 --- a/drivers/phy/meson-axg-mipi-pcie-analog.c +++ b/drivers/phy/meson-axg-mipi-pcie-analog.c @@ -211,7 +211,7 @@ int meson_axg_mipi_pcie_analog_probe(struct udevice *dev) { struct phy_meson_axg_mipi_pcie_analog_priv *priv = dev_get_priv(dev); - priv->regmap = syscon_node_to_regmap(dev_get_parent(dev)->node); + priv->regmap = syscon_node_to_regmap(dev_ofnode(dev_get_parent(dev))); if (IS_ERR(priv->regmap)) return PTR_ERR(priv->regmap); From e10481be1e7bc835aa8a3bd01037216ad7797140 Mon Sep 17 00:00:00 2001 From: Artem Lapkin Date: Tue, 27 Jul 2021 09:23:18 +0800 Subject: [PATCH 6/7] ARM: dts: meson: Use devicetree for SMBIOS settings for Khadas VIM boards Khadas vim series: Use devicetree for SMBIOS settings Add settings and enable the default sysinfo driver so that these can come from the device tree. Reviewed-by: Neil Armstrong Signed-off-by: Artem Lapkin Signed-off-by: Neil Armstrong --- .../meson-g12b-a311d-khadas-vim3-u-boot.dtsi | 23 +++++++++++++++++++ .../meson-gxl-s905x-khadas-vim-u-boot.dtsi | 23 +++++++++++++++++++ .../arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi | 21 +++++++++++++++++ .../dts/meson-sm1-khadas-vim3l-u-boot.dtsi | 23 +++++++++++++++++++ 4 files changed, 90 insertions(+) diff --git a/arch/arm/dts/meson-g12b-a311d-khadas-vim3-u-boot.dtsi b/arch/arm/dts/meson-g12b-a311d-khadas-vim3-u-boot.dtsi index 489efa150a..b0909cf25f 100644 --- a/arch/arm/dts/meson-g12b-a311d-khadas-vim3-u-boot.dtsi +++ b/arch/arm/dts/meson-g12b-a311d-khadas-vim3-u-boot.dtsi @@ -6,3 +6,26 @@ #include "meson-g12-common-u-boot.dtsi" #include "meson-khadas-vim3-u-boot.dtsi" + +/ { + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + manufacturer = "khadas"; + product = "VIM3"; + }; + + baseboard { + manufacturer = "khadas"; + product = "VIM3"; + }; + + chassis { + manufacturer = "khadas"; + product = "VIM3"; + }; + }; + }; +}; diff --git a/arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi b/arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi index 39270ea71c..6109088afa 100644 --- a/arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi +++ b/arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi @@ -5,3 +5,26 @@ */ #include "meson-gxl-u-boot.dtsi" + +/ { + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + manufacturer = "khadas"; + product = "VIM"; + }; + + baseboard { + manufacturer = "khadas"; + product = "VIM"; + }; + + chassis { + manufacturer = "khadas"; + product = "VIM"; + }; + }; + }; +}; diff --git a/arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi b/arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi index c1763336cf..e906bcaa78 100644 --- a/arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi +++ b/arch/arm/dts/meson-gxm-khadas-vim2-u-boot.dtsi @@ -10,6 +10,27 @@ aliases { spi0 = &spifc; }; + + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + manufacturer = "khadas"; + product = "VIM2"; + }; + + baseboard { + manufacturer = "khadas"; + product = "VIM2"; + }; + + chassis { + manufacturer = "khadas"; + product = "VIM2"; + }; + }; + }; }; &sd_emmc_c { diff --git a/arch/arm/dts/meson-sm1-khadas-vim3l-u-boot.dtsi b/arch/arm/dts/meson-sm1-khadas-vim3l-u-boot.dtsi index a591c0c9f2..4b8ea3d21a 100644 --- a/arch/arm/dts/meson-sm1-khadas-vim3l-u-boot.dtsi +++ b/arch/arm/dts/meson-sm1-khadas-vim3l-u-boot.dtsi @@ -6,3 +6,26 @@ #include "meson-sm1-u-boot.dtsi" #include "meson-khadas-vim3-u-boot.dtsi" + +/ { + smbios { + compatible = "u-boot,sysinfo-smbios"; + + smbios { + system { + manufacturer = "khadas"; + product = "VIM3L"; + }; + + baseboard { + manufacturer = "khadas"; + product = "VIM3L"; + }; + + chassis { + manufacturer = "khadas"; + product = "VIM3L"; + }; + }; + }; +}; From 24d2aea19b8069fb124313435cffcbb07c8317a1 Mon Sep 17 00:00:00 2001 From: Artem Lapkin Date: Tue, 27 Jul 2021 09:23:19 +0800 Subject: [PATCH 7/7] configs: Enable SMBIOS for Khadas VIM boards Enable configs to support SMBIOS for all Khadas VIM boards Reviewed-by: Neil Armstrong Signed-off-by: Artem Lapkin Signed-off-by: Neil Armstrong --- configs/khadas-vim2_defconfig | 2 ++ configs/khadas-vim3_defconfig | 2 ++ configs/khadas-vim3l_defconfig | 2 ++ configs/khadas-vim_defconfig | 2 ++ 4 files changed, 8 insertions(+) diff --git a/configs/khadas-vim2_defconfig b/configs/khadas-vim2_defconfig index 3251399839..5d67346366 100644 --- a/configs/khadas-vim2_defconfig +++ b/configs/khadas-vim2_defconfig @@ -50,6 +50,8 @@ CONFIG_DM_RESET=y CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_DEBUG_UART_SKIP_INIT=y CONFIG_MESON_SERIAL=y +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y CONFIG_SPI=y CONFIG_DM_SPI=y CONFIG_MESON_SPIFC=y diff --git a/configs/khadas-vim3_defconfig b/configs/khadas-vim3_defconfig index c4b24fc314..5a7a9006ea 100644 --- a/configs/khadas-vim3_defconfig +++ b/configs/khadas-vim3_defconfig @@ -61,6 +61,8 @@ CONFIG_DM_RESET=y CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_DEBUG_UART_SKIP_INIT=y CONFIG_MESON_SERIAL=y +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y CONFIG_SPI=y CONFIG_DM_SPI=y CONFIG_MESON_SPIFC=y diff --git a/configs/khadas-vim3l_defconfig b/configs/khadas-vim3l_defconfig index 0c731d4cee..d719511f6c 100644 --- a/configs/khadas-vim3l_defconfig +++ b/configs/khadas-vim3l_defconfig @@ -61,6 +61,8 @@ CONFIG_DM_RESET=y CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_DEBUG_UART_SKIP_INIT=y CONFIG_MESON_SERIAL=y +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y CONFIG_SPI=y CONFIG_DM_SPI=y CONFIG_MESON_SPIFC=y diff --git a/configs/khadas-vim_defconfig b/configs/khadas-vim_defconfig index 2df00d54ec..dc6365fcf4 100644 --- a/configs/khadas-vim_defconfig +++ b/configs/khadas-vim_defconfig @@ -44,6 +44,8 @@ CONFIG_DM_RESET=y CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_DEBUG_UART_SKIP_INIT=y CONFIG_MESON_SERIAL=y +CONFIG_SYSINFO=y +CONFIG_SYSINFO_SMBIOS=y CONFIG_USB=y CONFIG_DM_USB=y CONFIG_USB_XHCI_HCD=y