From cb6f4d6510b83ad8aa393633b470a64a9a58b658 Mon Sep 17 00:00:00 2001 From: Brandon Maier Date: Mon, 22 Jan 2024 18:45:50 +0000 Subject: scripts/gen_compile_commands: update to Linux v6.7 Adds support for assembly files and updates the LINE_PATTERN so it supports both "cmd" and "savedcmd", which allows reverting the U-Boot modification in commit 97fbb2eb016b ("scripts/gen_compile_commands.py: adapt _LINE_PATTERN"). Upstream commits: - 880946158b011 gen_compile_commands.py: fix path resolve with symlinks in it - 9e56d3be4bfd2 gen_compile_commands: Sort output compile commands by file name - 52c15e7e79285 gen_compile_commands: Allow the line prefix to still be cmd_ - 1c67921444bf6 gen_compile_commands: add assembly files to compilation database Signed-off-by: Brandon Maier Cc: Joao Marcos Costa --- scripts/gen_compile_commands.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/gen_compile_commands.py b/scripts/gen_compile_commands.py index cdca85e6b0..fec513e554 100755 --- a/scripts/gen_compile_commands.py +++ b/scripts/gen_compile_commands.py @@ -21,7 +21,7 @@ _DEFAULT_OUTPUT = 'compile_commands.json' _DEFAULT_LOG_LEVEL = 'WARNING' _FILENAME_PATTERN = r'^\..*\.cmd$' -_LINE_PATTERN = r'^cmd_[^ ]*\.o := (.* )([^ ]*\.c) *(;|$)' +_LINE_PATTERN = r'^(saved)?cmd_[^ ]*\.o := (?P.* )(?P[^ ]*\.[cS]) *(;|$)' _VALID_LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] # The tools/ directory adopts a different build system, and produces .cmd # files in a different format. Do not support it. @@ -66,7 +66,7 @@ def parse_arguments(): args = parser.parse_args() return (args.log_level, - os.path.abspath(args.directory), + os.path.realpath(args.directory), args.output, args.ar, args.paths if len(args.paths) > 0 else [args.directory]) @@ -174,8 +174,8 @@ def process_line(root_directory, command_prefix, file_path): # by Make, so this code replaces the escaped version with '#'. prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#') - # Use os.path.abspath() to normalize the path resolving '.' and '..' . - abs_path = os.path.abspath(os.path.join(root_directory, file_path)) + # Return the canonical path, eliminating any symbolic links encountered in the path. + abs_path = os.path.realpath(os.path.join(root_directory, file_path)) if not os.path.exists(abs_path): raise ValueError('File %s not found' % abs_path) return { @@ -215,15 +215,15 @@ def main(): result = line_matcher.match(f.readline()) if result: try: - entry = process_line(directory, result.group(1), - result.group(2)) + entry = process_line(directory, result.group('command_prefix'), + result.group('file_path')) compile_commands.append(entry) except ValueError as err: logging.info('Could not add line from %s: %s', cmdfile, err) with open(output, 'wt') as f: - json.dump(compile_commands, f, indent=2, sort_keys=True) + json.dump(sorted(compile_commands, key=lambda x: x["file"]), f, indent=2, sort_keys=True) if __name__ == '__main__': -- cgit v1.2.3 From dd0807804ecdc10fdc22fdb9f0ff9889f5fc4b08 Mon Sep 17 00:00:00 2001 From: Jim Liu Date: Wed, 24 Jan 2024 09:54:51 +0800 Subject: arm: dts: nuvoton: modify npcm8xx reset property Change reset method from generic to reset driver Signed-off-by: Jim Liu --- arch/arm/dts/nuvoton-common-npcm8xx.dtsi | 2 + arch/arm/dts/nuvoton-npcm8xx-u-boot.dtsi | 71 ++++++++++---------------------- 2 files changed, 24 insertions(+), 49 deletions(-) diff --git a/arch/arm/dts/nuvoton-common-npcm8xx.dtsi b/arch/arm/dts/nuvoton-common-npcm8xx.dtsi index 1694ef8849..db7517cc9b 100644 --- a/arch/arm/dts/nuvoton-common-npcm8xx.dtsi +++ b/arch/arm/dts/nuvoton-common-npcm8xx.dtsi @@ -5,6 +5,7 @@ #include #include #include +#include / { #address-cells = <2>; @@ -152,6 +153,7 @@ interrupts = ; clocks = <&clk NPCM8XX_CLK_APB5>; clock-names = "clk_apb5"; + resets = <&rstc NPCM8XX_RESET_IPSRST2 NPCM8XX_RESET_PSPI2>; status = "disabled"; }; diff --git a/arch/arm/dts/nuvoton-npcm8xx-u-boot.dtsi b/arch/arm/dts/nuvoton-npcm8xx-u-boot.dtsi index 4c6d5bed44..bc047d4b44 100644 --- a/arch/arm/dts/nuvoton-npcm8xx-u-boot.dtsi +++ b/arch/arm/dts/nuvoton-npcm8xx-u-boot.dtsi @@ -20,34 +20,7 @@ compatible = "nuvoton,npcm845-reset", "syscon", "simple-mfd"; reg = <0x0 0xf0801000 0x0 0xC4>; - rstc1: reset-controller1 { - compatible = "syscon-reset"; - #reset-cells = <1>; - regmap = <&rstc>; - offset = ; - mask = <0xFFFFFFFF>; - }; - rstc2: reset-controller2 { - compatible = "syscon-reset"; - #reset-cells = <1>; - regmap = <&rstc>; - offset = ; - mask = <0xFFFFFFFF>; - }; - rstc3: reset-controller3 { - compatible = "syscon-reset"; - #reset-cells = <1>; - regmap = <&rstc>; - offset = ; - mask = <0xFFFFFFFF>; - }; - rstc4: reset-controller4 { - compatible = "syscon-reset"; - #reset-cells = <1>; - regmap = <&rstc>; - offset = ; - mask = <0xFFFFFFFF>; - }; + #reset-cells = <2>; }; clk: clock-controller@f0801000 { @@ -70,7 +43,7 @@ clock-names = "stmmaceth"; pinctrl-names = "default"; pinctrl-0 = <&rg1mdio_pins>; - resets = <&rstc2 NPCM8XX_RESET_GMAC1>; + resets = <&rstc NPCM8XX_RESET_IPSRST2 NPCM8XX_RESET_GMAC1>; status = "disabled"; }; @@ -85,7 +58,7 @@ pinctrl-names = "default"; pinctrl-0 = <&rg2_pins &rg2mdio_pins>; - resets = <&rstc2 NPCM8XX_RESET_GMAC2>; + resets = <&rstc NPCM8XX_RESET_IPSRST2 NPCM8XX_RESET_GMAC2>; status = "disabled"; }; @@ -101,7 +74,7 @@ pinctrl-0 = <&r1_pins &r1err_pins &r1md_pins>; - resets = <&rstc1 NPCM8XX_RESET_GMAC3>; + resets = <&rstc NPCM8XX_RESET_IPSRST1 NPCM8XX_RESET_GMAC3>; status = "disabled"; }; @@ -117,7 +90,7 @@ pinctrl-0 = <&r2_pins &r2err_pins &r2md_pins>; - resets = <&rstc1 NPCM8XX_RESET_GMAC4>; + resets = <&rstc NPCM8XX_RESET_IPSRST1 NPCM8XX_RESET_GMAC4>; status = "disabled"; }; @@ -125,7 +98,7 @@ compatible = "nuvoton,npcm845-ehci"; reg = <0x0 0xf0828100 0x0 0x1000>; interrupts = ; - resets = <&rstc2 NPCM8XX_RESET_USBH1>; + resets = <&rstc NPCM8XX_RESET_IPSRST2 NPCM8XX_RESET_USBH1>; status = "disabled"; }; @@ -133,21 +106,21 @@ compatible = "nuvoton,npcm845-ehci"; reg = <0x0 0xf082a100 0x0 0x1000>; interrupts = ; - resets = <&rstc4 NPCM8XX_RESET_USBH2>; + resets = <&rstc NPCM8XX_RESET_IPSRST4 NPCM8XX_RESET_USBH2>; status = "disabled"; }; ohci1: usb@f0829000 { compatible = "nuvoton,npcm845-ohci"; reg = <0x0 0xF0829000 0x0 0x1000>; - resets = <&rstc2 NPCM8XX_RESET_USBH1>; + resets = <&rstc NPCM8XX_RESET_IPSRST2 NPCM8XX_RESET_USBH1>; status = "disabled"; }; ohci2: usb@f082b000 { compatible = "nuvoton,npcm845-ohci"; reg = <0x0 0xF082B000 0x0 0x1000>; - resets = <&rstc4 NPCM8XX_RESET_USBH2>; + resets = <&rstc NPCM8XX_RESET_IPSRST4 NPCM8XX_RESET_USBH2>; status = "disabled"; }; @@ -160,21 +133,21 @@ compatible = "nuvoton,npcm845-usb-phy"; #phy-cells = <1>; reg = <1>; - resets = <&rstc3 NPCM8XX_RESET_USBPHY1>; + resets = <&rstc NPCM8XX_RESET_IPSRST3 NPCM8XX_RESET_USBPHY1>; status = "disabled"; }; usbphy2: usbphy@2 { compatible = "nuvoton,npcm845-usb-phy"; #phy-cells = <1>; reg = <2>; - resets = <&rstc3 NPCM8XX_RESET_USBPHY2>; + resets = <&rstc NPCM8XX_RESET_IPSRST3 NPCM8XX_RESET_USBPHY2>; status = "disabled"; }; usbphy3: usbphy@3 { compatible = "nuvoton,npcm845-usb-phy"; #phy-cells = <1>; reg = <3>; - resets = <&rstc4 NPCM8XX_RESET_USBPHY3>; + resets = <&rstc NPCM8XX_RESET_IPSRST4 NPCM8XX_RESET_USBPHY3>; status = "disabled"; }; }; @@ -186,7 +159,7 @@ interrupts = ; clocks = <&clk NPCM8XX_CLK_SU>; clock-names = "clk_usb_bridge"; - resets = <&rstc3 NPCM8XX_RESET_UDC0>; + resets = <&rstc NPCM8XX_RESET_IPSRST3 NPCM8XX_RESET_UDC0>; status = "disable"; }; @@ -197,7 +170,7 @@ interrupts = ; clocks = <&clk NPCM8XX_CLK_SU>; clock-names = "clk_usb_bridge"; - resets = <&rstc1 NPCM8XX_RESET_UDC1>; + resets = <&rstc NPCM8XX_RESET_IPSRST1 NPCM8XX_RESET_UDC1>; status = "disable"; }; @@ -208,7 +181,7 @@ interrupts = ; clocks = <&clk NPCM8XX_CLK_SU>; clock-names = "clk_usb_bridge"; - resets = <&rstc1 NPCM8XX_RESET_UDC2>; + resets = <&rstc NPCM8XX_RESET_IPSRST1 NPCM8XX_RESET_UDC2>; status = "disable"; }; @@ -219,7 +192,7 @@ interrupts = ; clocks = <&clk NPCM8XX_CLK_SU>; clock-names = "clk_usb_bridge"; - resets = <&rstc1 NPCM8XX_RESET_UDC3>; + resets = <&rstc NPCM8XX_RESET_IPSRST1 NPCM8XX_RESET_UDC3>; status = "disable"; }; @@ -230,7 +203,7 @@ interrupts = ; clocks = <&clk NPCM8XX_CLK_SU>; clock-names = "clk_usb_bridge"; - resets = <&rstc1 NPCM8XX_RESET_UDC4>; + resets = <&rstc NPCM8XX_RESET_IPSRST1 NPCM8XX_RESET_UDC4>; status = "disable"; }; @@ -241,7 +214,7 @@ interrupts = ; clocks = <&clk NPCM8XX_CLK_SU>; clock-names = "clk_usb_bridge"; - resets = <&rstc1 NPCM8XX_RESET_UDC5>; + resets = <&rstc NPCM8XX_RESET_IPSRST1 NPCM8XX_RESET_UDC5>; status = "disable"; }; @@ -252,7 +225,7 @@ interrupts = ; clocks = <&clk NPCM8XX_CLK_SU>; clock-names = "clk_usb_bridge"; - resets = <&rstc1 NPCM8XX_RESET_UDC6>; + resets = <&rstc NPCM8XX_RESET_IPSRST1 NPCM8XX_RESET_UDC6>; status = "disable"; }; @@ -263,7 +236,7 @@ interrupts = ; clocks = <&clk NPCM8XX_CLK_SU>; clock-names = "clk_usb_bridge"; - resets = <&rstc3 NPCM8XX_RESET_UDC7>; + resets = <&rstc NPCM8XX_RESET_IPSRST3 NPCM8XX_RESET_UDC7>; status = "disable"; }; @@ -274,7 +247,7 @@ interrupts = ; clocks = <&clk NPCM8XX_CLK_SU>; clock-names = "clk_usb_bridge"; - resets = <&rstc3 NPCM8XX_RESET_UDC8>; + resets = <&rstc NPCM8XX_RESET_IPSRST3 NPCM8XX_RESET_UDC8>; status = "disable"; }; @@ -285,7 +258,7 @@ interrupts = ; clocks = <&clk NPCM8XX_CLK_SU>; clock-names = "clk_usb_bridge"; - resets = <&rstc3 NPCM8XX_RESET_UDC9>; + resets = <&rstc NPCM8XX_RESET_IPSRST3 NPCM8XX_RESET_UDC9>; status = "disable"; }; -- cgit v1.2.3 From 0c5110ccf83c2e9c3190e501855c49ee168a7239 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 28 Jan 2024 08:58:55 +0100 Subject: common: event: check event_type_name() argument In event_type_name() we should avoid possible buffer overruns by checking the type argument. Addresses-Coverity-ID: 478862 Out-of-bounds access Signed-off-by: Heinrich Schuchardt --- common/event.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/event.c b/common/event.c index dc61b9672f..16c2ba6cc9 100644 --- a/common/event.c +++ b/common/event.c @@ -56,7 +56,10 @@ _Static_assert(ARRAY_SIZE(type_name) == EVT_COUNT, "event type_name size"); const char *event_type_name(enum event_t type) { #if CONFIG_IS_ENABLED(EVENT_DEBUG) - return type_name[type]; + if (type < ARRAY_SIZE(type_name)) + return type_name[type]; + else + return "(unknown)"; #else return "(unknown)"; #endif -- cgit v1.2.3 From 798ad3e6b2ec69a7dc111257270507f95559c5eb Mon Sep 17 00:00:00 2001 From: "Ole P. Orhagen" Date: Fri, 26 Jan 2024 13:47:50 +0100 Subject: vexpress_ca9x4: Enable DM_SERIAL This commit enables support for DM_SERIAL in the vexpress_ca9x4 boards. When running the board with the DM_SERIAL driver, the board ran out of memory in SPL when initialising the DM serial driver. Thus this required an increase in the pre-allocated SRAM memory. I did increase it to 0x800, and it now works graciously. It could probably be set lower, but I do not see any reason not to use the available SRAM at this point. Also adds stdout-path to the 'chosen' node in the device tree. Signed-off-by: Ole P. Orhagen Reviewed-by: Linus Walleij --- arch/arm/Kconfig | 2 +- arch/arm/dts/vexpress-v2p-ca9.dts | 4 +++- configs/vexpress_ca9x4_defconfig | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 59e4d4d949..ef48864b4a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -678,7 +678,7 @@ config ARCH_BCMBCA config TARGET_VEXPRESS_CA9X4 bool "Support vexpress_ca9x4" select CPU_V7A - select PL011_SERIAL + select PL01X_SERIAL config TARGET_BCMNS bool "Support Broadcom Northstar" diff --git a/arch/arm/dts/vexpress-v2p-ca9.dts b/arch/arm/dts/vexpress-v2p-ca9.dts index bf00c62bcf..e5b86c0d67 100644 --- a/arch/arm/dts/vexpress-v2p-ca9.dts +++ b/arch/arm/dts/vexpress-v2p-ca9.dts @@ -20,7 +20,9 @@ #address-cells = <1>; #size-cells = <1>; - chosen { }; + chosen { + stdout-path = &v2m_serial0; + }; aliases { serial0 = &v2m_serial0; diff --git a/configs/vexpress_ca9x4_defconfig b/configs/vexpress_ca9x4_defconfig index 2601e55ebf..f8e93bef4e 100644 --- a/configs/vexpress_ca9x4_defconfig +++ b/configs/vexpress_ca9x4_defconfig @@ -2,7 +2,7 @@ CONFIG_ARM=y CONFIG_SYS_L2CACHE_OFF=y CONFIG_TARGET_VEXPRESS_CA9X4=y CONFIG_TEXT_BASE=0x60800000 -CONFIG_SYS_MALLOC_F_LEN=0x400 +CONFIG_SYS_MALLOC_F_LEN=0x800 CONFIG_NR_DRAM_BANKS=2 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x60000f10 @@ -41,6 +41,7 @@ CONFIG_ARM_PL180_MMCI=y CONFIG_SYS_MMC_MAX_BLK_COUNT=127 CONFIG_MTD=y CONFIG_DM_MTD=y +CONFIG_DM_SERIAL=y CONFIG_MTD_NOR_FLASH=y CONFIG_SYS_FLASH_CFI_WIDTH_32BIT=y CONFIG_FLASH_SHOW_PROGRESS=0 -- cgit v1.2.3 From 4312a1dfca26a0b5c30ac6890b0078e8d31ff6bf Mon Sep 17 00:00:00 2001 From: MD Danish Anwar Date: Tue, 30 Jan 2024 11:48:04 +0530 Subject: dma: ti: k3-udma: Use ring_idx to pair k3 nav rings Use ring_idx to pair rings. ring_idx will be same as tx flow_id for all non-negative flow_ids. For negative flow_ids, ring_idx will be tchan->id added with bchan_cnt. Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/dma/ti/k3-udma.c?h=v6.8-rc2#n1686 Signed-off-by: MD Danish Anwar Reviewed-by: Ravi Gunasekaran --- drivers/dma/ti/k3-udma.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index 8a62d63dfe..eea9ec9659 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -876,13 +876,20 @@ static int udma_alloc_tx_resources(struct udma_chan *uc) { struct k3_nav_ring_cfg ring_cfg; struct udma_dev *ud = uc->ud; - int ret; + struct udma_tchan *tchan; + int ring_idx, ret; ret = udma_get_tchan(uc); if (ret) return ret; - ret = k3_nav_ringacc_request_rings_pair(ud->ringacc, uc->tchan->id, -1, + tchan = uc->tchan; + if (tchan->tflow_id >= 0) + ring_idx = tchan->tflow_id; + else + ring_idx = ud->bchan_cnt + tchan->id; + + ret = k3_nav_ringacc_request_rings_pair(ud->ringacc, ring_idx, -1, &uc->tchan->t_ring, &uc->tchan->tc_ring); if (ret) { -- cgit v1.2.3 From 94cfc6fc96d2e718026d6aed9471994489a192f0 Mon Sep 17 00:00:00 2001 From: Neha Malcom Francis Date: Tue, 30 Jan 2024 15:53:56 +0530 Subject: arm: mach-k3: j721s2_init: Support less than max DDR controllers The number of DDR controllers to be initialised and used should depend on the device tree with the constraint of the maximum number of controllers the device supports. Since J721S2 has multiple (2) controllers, instead of hardcoding the number of probes, move to depending on the device tree UCLASS_RAM nodes present. Signed-off-by: Neha Malcom Francis Reviewed-by: Manorit Chawdhry --- arch/arm/mach-k3/j721s2_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-k3/j721s2_init.c b/arch/arm/mach-k3/j721s2_init.c index fb0708bae1..3374889558 100644 --- a/arch/arm/mach-k3/j721s2_init.c +++ b/arch/arm/mach-k3/j721s2_init.c @@ -228,7 +228,7 @@ void k3_mem_init(void) panic("DRAM 0 init failed: %d\n", ret); ret = uclass_next_device_err(&dev); - if (ret) + if (ret && ret != -ENODEV) panic("DRAM 1 init failed: %d\n", ret); } spl_enable_cache(); -- cgit v1.2.3 From 0c4e36d65f6c25e5016235cc3f1e97c8d237f416 Mon Sep 17 00:00:00 2001 From: Dhruva Gole Date: Tue, 30 Jan 2024 20:29:59 +0530 Subject: firmware: ti_sci: fix the secure_hdr in do_xfer The ti_sci driver in U-Boot has support for secure_msg as part of it's do_xfer function. This let's U-boot send secure messages during boot up. The protocol to send such secure messages is described as part of the struct ti_sci_secure_msg_hdr. As part of this, there are 2 fields for checksum and reserved that occupy the first 4 bytes of any secure message. This is called as the secure_hdr. As of now, the secure_hdr needs to be 0 init-ed before sending secure messages. However the existing code was never putting the zero-inited vars into the secure_buf, leading to possibility of the first 4 bytes of secure_buf being possibly garbage. Fix this by initialising the secure_hdr itself to the secure_buf location, thus when we make secure_hdr members 0, it automatically ensures the first 4 bytes of secure_buf are 0. Fixes: 32cd25128bd849 ("firmware: Add basic support for TI System Control Interface (TI SCI)") Reviewed-by: Nishanth Menon Signed-off-by: Dhruva Gole --- drivers/firmware/ti_sci.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 6e9f93e9a3..b77ac36af2 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -236,21 +236,21 @@ static int ti_sci_do_xfer(struct ti_sci_info *info, { struct k3_sec_proxy_msg *msg = &xfer->tx_message; u8 secure_buf[info->desc->max_msg_size]; - struct ti_sci_secure_msg_hdr secure_hdr; + struct ti_sci_secure_msg_hdr *secure_hdr = (struct ti_sci_secure_msg_hdr *)secure_buf; int ret; if (info->is_secure) { /* ToDo: get checksum of the entire message */ - secure_hdr.checksum = 0; - secure_hdr.reserved = 0; - memcpy(&secure_buf[sizeof(secure_hdr)], xfer->tx_message.buf, + secure_hdr->checksum = 0; + secure_hdr->reserved = 0; + memcpy(&secure_buf[sizeof(*secure_hdr)], xfer->tx_message.buf, xfer->tx_message.len); xfer->tx_message.buf = (u32 *)secure_buf; - xfer->tx_message.len += sizeof(secure_hdr); + xfer->tx_message.len += sizeof(*secure_hdr); if (xfer->rx_len) - xfer->rx_len += sizeof(secure_hdr); + xfer->rx_len += sizeof(*secure_hdr); } /* Send the message */ -- cgit v1.2.3 From c59720c5f4c592688d2899b352f446703c968666 Mon Sep 17 00:00:00 2001 From: Dhruva Gole Date: Tue, 30 Jan 2024 20:30:00 +0530 Subject: firmware: ti_sci: Add comment explaining the is_secure code Add a comment to explain the code under is_secure condition of ti_sci_do_xfer. This will help avoid confusion amongst people who may in future touch upon this code. Reviewed-by: Nishanth Menon Signed-off-by: Dhruva Gole --- drivers/firmware/ti_sci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index b77ac36af2..ee09218558 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -239,6 +239,12 @@ static int ti_sci_do_xfer(struct ti_sci_info *info, struct ti_sci_secure_msg_hdr *secure_hdr = (struct ti_sci_secure_msg_hdr *)secure_buf; int ret; + /* + * The reason why we need the is_secure code is because of boot R5. + * boot R5 starts off in "secure mode" when it hands off from Boot + * ROM over to the Secondary bootloader. The initial set of calls + * we have to make need to be on a secure pipe. + */ if (info->is_secure) { /* ToDo: get checksum of the entire message */ secure_hdr->checksum = 0; -- cgit v1.2.3 From e5e7d8bbcffb26f5ac9a8fab7909225f527e157d Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 31 Jan 2024 10:09:52 +0300 Subject: blk: host_dev: Fix error code in host_sb_attach_file() This error path should return -EINVAL instead of success. Fixes: e261fbf34785 ("blk: host_dev: Sanity check on the size of host backing file") Signed-off-by: Dan Carpenter --- drivers/block/host_dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/host_dev.c b/drivers/block/host_dev.c index 30c7415793..52313435a0 100644 --- a/drivers/block/host_dev.c +++ b/drivers/block/host_dev.c @@ -61,6 +61,7 @@ static int host_sb_attach_file(struct udevice *dev, const char *filename) if (size % desc->blksz) { printf("The size of host backing file '%s' is not multiple of " "the device block size\n", filename); + ret = -EINVAL; goto err_fname; } desc->lba = size / desc->blksz; -- cgit v1.2.3