From 1be88b4e84c67b537c6ceb3b16ee75eb418db465 Mon Sep 17 00:00:00 2001 From: Praveenkumar I Date: Mon, 20 Nov 2023 20:18:34 +0530 Subject: [PATCH 1/5] pci: pci_ipq: Fix pci_find_ipq_devices() to not check all PCIe hose Fix pci_find_ipq_devices(), which is checking all the PCIe hose from the given ID and if searching device is not present, it moves till the last PCIe hose and finds the device. This leads to duplicate entries if unknown devices are also present. Instead it should check only the selected PCIe hose and return success or failure. Add QCN6432 in PCI device list so that list_pci command can show it. Change-Id: I1fd1af9a760354f558680889dd5804abd6145dea Signed-off-by: Praveenkumar I --- drivers/pci/pci_ipq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci_ipq.c b/drivers/pci/pci_ipq.c index 949211e6f5..806651e63e 100644 --- a/drivers/pci/pci_ipq.c +++ b/drivers/pci/pci_ipq.c @@ -409,6 +409,7 @@ DECLARE_GLOBAL_DATA_PTR; #define QCN_VENDOR_ID 0x17CB #define QCN9224_DEVICE_ID 0x1109 #define QCN9000_DEVICE_ID 0x1104 +#define QCN6432_DEVICE_ID 0x110c #define MAX_UNWINDOWED_ADDRESS 0x80000 #define WINDOW_ENABLE_BIT 0x40000000 #define WINDOW_SHIFT 19 @@ -1996,7 +1997,7 @@ pci_dev_t pci_find_ipq_devices(struct pci_device_id *ids, int device_id) hose = hose->next; device_id--; } - for (;hose; hose = hose->next) { + if (hose) { for (bus = hose->first_busno; bus <= hose->last_busno; bus++) { bdf = pci_hose_find_devices(hose, bus, ids, &index); if (bdf != -1) @@ -2195,6 +2196,7 @@ U_BOOT_CMD(fuse_qcn9224, 2, 1, do_fuse_qcn9224, static struct pci_device_id pci_device[] = { {QCN_VENDOR_ID, QCN9224_DEVICE_ID}, {QCN_VENDOR_ID, QCN9000_DEVICE_ID}, + {QCN_VENDOR_ID, QCN6432_DEVICE_ID}, {} }; From 33bf8df37a27959b3db6a40cba753b3f4543af84 Mon Sep 17 00:00:00 2001 From: Saahil Tomar Date: Mon, 6 Nov 2023 11:47:58 +0530 Subject: [PATCH 2/5] arm: dts: Add MI01.13 (RDP480) dts support. RDP480 IPQ5332 + QCN9224 + QCN6432 + QCN9160 (2+4+2+Y) Change-Id: Ibd36002d30c563932da501901c0e1504e1c33d8f Signed-off-by: Saahil Tomar --- arch/arm/dts/Makefile | 1 + arch/arm/dts/ipq5332-mi01.13.dts | 298 ++++++++++++++++++++++++++++++ arch/arm/include/asm/mach-types.h | 1 + board/qca/arm/ipq5332/ipq5332.c | 3 +- 4 files changed, 302 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/ipq5332-mi01.13.dts diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index e43c63c14b..5d7b1128df 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -100,6 +100,7 @@ dtb-$(CONFIG_ARCH_IPQ5332) += ipq5332-emulation.dtb \ ipq5332-mi01.6.dtb \ ipq5332-mi01.9.dtb \ ipq5332-mi01.12.dtb \ + ipq5332-mi01.13.dtb \ ipq5332-mi03.1.dtb \ ipq5332-mi04.1.dtb \ ipq5332-mi04.3.dtb \ diff --git a/arch/arm/dts/ipq5332-mi01.13.dts b/arch/arm/dts/ipq5332-mi01.13.dts new file mode 100644 index 0000000000..cb54e704ae --- /dev/null +++ b/arch/arm/dts/ipq5332-mi01.13.dts @@ -0,0 +1,298 @@ +/* + * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. + * + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +/dts-v1/; +#include "ipq5332-soc.dtsi" +/ { + machid = <0x8060402>; + config_name = "config@mi01.13", "config@rdp480", "config-rdp480"; + + aliases { + console = "/serial@78AF000"; + nand = "/nand-controller@79B0000"; + mmc = "/sdhci@7804000"; + usb0 = "/xhci@8a00000"; + i2c0 = "/i2c@78B6000"; + pci0 = "/pci@20000000"; + pci1 = "/pci@18000000"; + pci2 = "/pci@10000000"; + }; + + serial@78AF000 { + status = "ok"; + serial_gpio { + blsp0_uart_rx { + gpio = <18>; + func = <1>; + pull = ; + drvstr = ; + }; + blsp0_uart_tx { + gpio = <19>; + func = <1>; + pull = ; + drvstr = ; + }; + }; + }; + + spi { + spi_gpio { + blsp0_spi_clk { + gpio = <14>; + func = <1>; + pull = ; + oe = ; + drvstr = ; + }; + blsp0_spi_mosi { + gpio = <15>; + func = <1>; + pull = ; + oe = ; + drvstr = ; + }; + blsp0_spi_miso { + gpio = <16>; + func = <1>; + pull = ; + drvstr = ; + }; + blsp0_spi_cs { + gpio = <17>; + func = <1>; + pull = ; + oe = ; + drvstr = ; + }; + }; + }; + + i2c@78B6000 { + i2c_gpio { + gpio1 { + gpio = <29>; + func = <3>; + pull = ; + drvstr = ; + oe = ; + }; + + gpio2 { + gpio = <30>; + func = <3>; + pull = ; + drvstr = ; + oe = ; + }; + }; + }; + + nand: nand-controller@79B0000 { + nand_gpio { + qspi_dat3 { + gpio = <8>; + func = <2>; + pull = ; + drvstr = ; + }; + qspi_dat2 { + gpio = <9>; + func = <2>; + pull = ; + drvstr = ; + }; + qspi_dat1 { + gpio = <10>; + func = <2>; + pull = ; + drvstr = ; + }; + qspi_dat0 { + gpio = <11>; + func = <2>; + pull = ; + drvstr = ; + }; + qspi_cs_n { + gpio = <12>; + func = <2>; + pull = ; + drvstr = ; + }; + qspi_clk { + gpio = <13>; + func = <2>; + pull = ; + drvstr = ; + }; + }; + }; + + mmc: sdhci@7804000 { + mmc_gpio { + emmc_dat3 { + gpio = <8>; + func = <1>; + pull = ; + drvstr = ; + }; + emmc_dat2 { + gpio = <9>; + func = <1>; + pull = ; + drvstr = ; + }; + emmc_dat1 { + gpio = <10>; + func = <1>; + pull = ; + drvstr = ; + }; + emmc_dat0 { + gpio = <11>; + func = <1>; + pull = ; + drvstr = ; + }; + emmc_cmd{ + gpio = <12>; + func = <1>; + pull = ; + drvstr = ; + }; + emmc_clk{ + gpio = <13>; + func = <1>; + pull = ; + drvstr = ; + }; + }; + }; + + pci0: pci@20000000 { + status = "ok"; + perst_gpio = <38>; + lane = <1>; + pci_gpio { + pci_rst { + gpio = <38>; + pull = ; + oe = ; + drvstr = ; + }; + }; + }; + + pci1: pci@18000000 { + status = "ok"; + perst_gpio = <47>; + lane = <1>; + pci_gpio { + pci_rst { + gpio = <47>; + pull = ; + oe = ; + drvstr = ; + }; + }; + }; + + pci2: pci@10000000 { + status = "ok"; + perst_gpio = <44>; + lane = <1>; + pci_gpio { + pci_rst { + gpio = <44>; + pull = ; + oe = ; + }; + }; + }; + + ess-switch { + switch_mac_mode0 = ; + switch_mac_mode1 = ; + qca808x_gpio = <51>; + qca808x_gpio_cnt = <1>; + qca8084_switch_enable = <1>; + sfp_gpio = <24>; + sfp_gpio_cnt = <1>; + + mdio_gpio { + mdc1 { + gpio = <27>; + func = <1>; + pull = ; + drvstr = ; + }; + mdio { + gpio = <28>; + func = <1>; + pull = ; + drvstr = ; + }; + }; + + port_phyinfo { + port@0 { + phy_address = <1>; + uniphy_id = <0>; + phy_type = ; + uniphy_mode = ; + }; + port@1 { + phy_type = ; + uniphy_id = <1>; + uniphy_mode = ; + }; + }; + + qca8084_swt_info { + switch_mac_mode0 = ; + switch_mac_mode1 = ; + + port@0 { + phy_address = <0xff>; + phy_type = ; + forced-speed = <2500>; + forced-duplex = <1>; + }; + port@1 { + phy_address = <1>; + phy_type = ; + }; + port@2 { + phy_address = <2>; + phy_type = ; + }; + port@3 { + phy_address = <3>; + phy_type = ; + }; + port@4 { + phy_address = <0x4>; + phy_type = ; + }; + port@5 { + phy_address = <0xff>; + phy_type = ; + forced-speed = <2500>; + forced-duplex = <1>; + }; + }; + }; +}; diff --git a/arch/arm/include/asm/mach-types.h b/arch/arm/include/asm/mach-types.h index 4005df05d4..c00a313fa9 100644 --- a/arch/arm/include/asm/mach-types.h +++ b/arch/arm/include/asm/mach-types.h @@ -1184,6 +1184,7 @@ extern unsigned int __machine_arch_type; #define MACH_TYPE_IPQ5332_AP_MI04_1_C2 0x8060007 #define MACH_TYPE_IPQ5332_AP_MI04_3 0x8060107 #define MACH_TYPE_IPQ5332_AP_MI01_12 0x8060202 +#define MACH_TYPE_IPQ5332_AP_MI01_13 0x8060402 #define MACH_TYPE_IPQ5332_AP_MI01_14 0x8060302 #ifdef CONFIG_ARCH_EBSA110 diff --git a/board/qca/arm/ipq5332/ipq5332.c b/board/qca/arm/ipq5332/ipq5332.c index cfcc75f6d7..bac41b31d4 100644 --- a/board/qca/arm/ipq5332/ipq5332.c +++ b/board/qca/arm/ipq5332/ipq5332.c @@ -851,8 +851,9 @@ unsigned int get_dts_machid(unsigned int machid) case MACH_TYPE_IPQ5332_AP_MI01_2_C2: return MACH_TYPE_IPQ5332_AP_MI01_2; case MACH_TYPE_IPQ5332_AP_MI01_3_C2: - case MACH_TYPE_IPQ5332_AP_MI01_7: return MACH_TYPE_IPQ5332_AP_MI01_3; + case MACH_TYPE_IPQ5332_AP_MI01_7: + return MACH_TYPE_IPQ5332_AP_MI01_13; case MACH_TYPE_IPQ5332_AP_MI01_14: return MACH_TYPE_IPQ5332_AP_MI01_12; case MACH_TYPE_IPQ5332_AP_MI04_1_C2: From 1bf2b245435c504f68f6301ea6253fc553c2d46c Mon Sep 17 00:00:00 2001 From: Gurumoorthy Santhakumar Date: Thu, 27 Jul 2023 11:13:56 +0530 Subject: [PATCH 3/5] ipqsoc: board: Add restriction for bootm and mw cmd Added restriction for secure board Change-Id: I7a7b4089689d98a6502b0360bb742fa42eff4759 Signed-off-by: Gurumoorthy Santhakumar (cherry picked from commit 59cb1c85296ac6ac817e42c71517785666b3ec16) --- board/ipq40xx/Kconfig | 4 ++++ board/ipq5018/Kconfig | 3 +++ board/ipq5332/Kconfig | 4 ++++ board/ipq6018/Kconfig | 4 ++++ board/ipq806x/Kconfig | 4 ++++ board/ipq807x/Kconfig | 4 ++++ board/ipq9574/Kconfig | 4 ++++ board/qca/arm/common/board_init.c | 29 +++++++++++++++++++++++++++ board/qca/arm/common/cmd_bootqca.c | 32 +++++++++++++++++++++++------- common/cmd_bootm.c | 7 +++++++ common/cmd_mem.c | 7 +++++++ 11 files changed, 95 insertions(+), 7 deletions(-) diff --git a/board/ipq40xx/Kconfig b/board/ipq40xx/Kconfig index ee5773c492..0816040891 100644 --- a/board/ipq40xx/Kconfig +++ b/board/ipq40xx/Kconfig @@ -20,4 +20,8 @@ config USB_XHCI_IPQ config PCI_IPQ bool "ipq40xx pci" + +config BOARD_TYPES + bool "Support board_type member in global data" + default y endif diff --git a/board/ipq5018/Kconfig b/board/ipq5018/Kconfig index 92c280dc44..df0251983d 100644 --- a/board/ipq5018/Kconfig +++ b/board/ipq5018/Kconfig @@ -51,4 +51,7 @@ config GEPHY config ART_COMPRESSED bool "Enable uncompress support for ipq5018" +config BOARD_TYPES + bool "Support board_type member in global data" + default y endif diff --git a/board/ipq5332/Kconfig b/board/ipq5332/Kconfig index 4b295f2001..5d5f0def54 100644 --- a/board/ipq5332/Kconfig +++ b/board/ipq5332/Kconfig @@ -56,4 +56,8 @@ config QCA8081_PHY config DPR_EXECUTE bool "Enable DPR support" + +config BOARD_TYPES + bool "Support board_type member in global data" + default y endif diff --git a/board/ipq6018/Kconfig b/board/ipq6018/Kconfig index d03d7a8ea8..f58ba0e483 100644 --- a/board/ipq6018/Kconfig +++ b/board/ipq6018/Kconfig @@ -21,4 +21,8 @@ config PCI_IPQ config IPQ6018_QCA_AQUANTIA_PHY bool "Enable Aquantia PHY support for ipq6018" +config BOARD_TYPES + bool "Support board_type member in global data" + default y + endif diff --git a/board/ipq806x/Kconfig b/board/ipq806x/Kconfig index a0618db816..7d3a417edf 100644 --- a/board/ipq806x/Kconfig +++ b/board/ipq806x/Kconfig @@ -20,4 +20,8 @@ config USB_XHCI_IPQ config PCI_IPQ bool "ipq806x pci" +config BOARD_TYPES + bool "Support board_type member in global data" + default y + endif diff --git a/board/ipq807x/Kconfig b/board/ipq807x/Kconfig index db6c88cec8..25346bcbac 100644 --- a/board/ipq807x/Kconfig +++ b/board/ipq807x/Kconfig @@ -30,3 +30,7 @@ config QCA8081_PHY config QCA8075_PHY bool "Enable QCA8075 PHY support for ipq807x" + +config BOARD_TYPES + bool "Support board_type member in global data" + default y diff --git a/board/ipq9574/Kconfig b/board/ipq9574/Kconfig index 1a533b21dc..01998e0043 100644 --- a/board/ipq9574/Kconfig +++ b/board/ipq9574/Kconfig @@ -17,4 +17,8 @@ config IPQ9574_QCA_AQUANTIA_PHY config IPQ9574_QCA8075_PHY bool "Enable Malibu PHY support for ipq9574" + +config BOARD_TYPES + bool "Support board_type member in global data" + default y endif diff --git a/board/qca/arm/common/board_init.c b/board/qca/arm/common/board_init.c index 38164cc38e..f3a4942333 100644 --- a/board/qca/arm/common/board_init.c +++ b/board/qca/arm/common/board_init.c @@ -121,6 +121,32 @@ __weak int bring_sec_core_up(unsigned int cpuid, unsigned int entry, unsigned in } #endif +#define SECURE_BOARD_MAGIC 0x5ECB001 + +void update_board_type(void) +{ + int ret; + uint8_t buf = 0; + qca_smem_flash_info_t *sfi = &qca_smem_flash_info; + + if(SMEM_BOOT_NO_FLASH == sfi->flash_type) + return; + + ret = qca_scm_call(SCM_SVC_FUSE, QFPROM_IS_AUTHENTICATE_CMD, &buf, + sizeof(char)); + + if (ret) { + printf("%s: scm call failed. ret = %d\n", __func__, ret); + printf("%s: Failed\n", __func__); + gd->board_type = 0; + return; + } + + gd->board_type = (buf == 1) ? SECURE_BOARD_MAGIC : 0; + + return; +} + int board_init(void) { int ret; @@ -262,6 +288,9 @@ int board_init(void) * serial init after relocation */ uart_wait_tx_empty(); + + update_board_type(); + return 0; } diff --git a/board/qca/arm/common/cmd_bootqca.c b/board/qca/arm/common/cmd_bootqca.c index a06bf6f576..5a7ac45b48 100644 --- a/board/qca/arm/common/cmd_bootqca.c +++ b/board/qca/arm/common/cmd_bootqca.c @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -85,6 +86,21 @@ typedef struct { } image_info; #endif +extern bootm_headers_t images; /* pointers to os/initrd/fdt images */ + +static int boot_os(int argc, char *const argv[]) +{ + + return do_bootm_states(NULL, 0, argc, argv, BOOTM_STATE_START | + BOOTM_STATE_FINDOS | BOOTM_STATE_FINDOTHER | + BOOTM_STATE_LOADOS | +#if defined(CONFIG_PPC) || defined(CONFIG_MIPS) + BOOTM_STATE_OS_CMDLINE | +#endif + BOOTM_STATE_OS_PREP | BOOTM_STATE_OS_FAKE_GO | + BOOTM_STATE_OS_GO, &images, 1); +} + void __stack_chk_fail(void) { printf("stack-protector: U-boot stack is corrupted.\n"); @@ -263,7 +279,7 @@ int config_select(unsigned int addr, char *rcmd, int rcmd_size) ret = update_bootargs((void *)addr); if (ret) goto fail; - snprintf(rcmd, rcmd_size, "bootm 0x%x#%s\n", + snprintf(rcmd, rcmd_size, "0x%x#%s", addr, dtb_config_name); return 0; } @@ -296,7 +312,7 @@ int config_select(unsigned int addr, char *rcmd, int rcmd_size) ret = update_bootargs((void *)addr); if (ret) goto fail; - snprintf(rcmd, rcmd_size, "bootm 0x%x#%s\n", + snprintf(rcmd, rcmd_size, "0x%x#%s", addr, dtb_config_name); return 0; } @@ -497,6 +513,7 @@ static int authenticate_rootfs_elf(unsigned int rootfs_hdr) static int do_boot_signedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) { char runcmd[256]; + char * const arg[1] = {runcmd}; int ret; unsigned int request; #ifdef CONFIG_VERSION_ROLLBACK_PARTITION_INFO @@ -741,7 +758,7 @@ static int do_boot_signedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const a if (debug) printf("%s", runcmd); - if (ret < 0 || run_command(runcmd, 0) != CMD_RET_SUCCESS) { + if (ret < 0 || boot_os(1, arg) != CMD_RET_SUCCESS) { #ifdef CONFIG_QCA_MMC mmc_initialize(gd->bd); #endif @@ -763,6 +780,7 @@ static int do_boot_unsignedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const { int ret; char runcmd[256]; + char * const arg[1] = {runcmd}; #ifdef CONFIG_QCA_MMC block_dev_desc_t *blk_dev; disk_partition_t disk_info; @@ -881,7 +899,7 @@ static int do_boot_unsignedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const runcmd, sizeof(runcmd)); } else if (ret == IMAGE_FORMAT_LEGACY) { snprintf(runcmd, sizeof(runcmd), - "bootm 0x%x\n", CONFIG_SYS_LOAD_ADDR); + "0x%x", CONFIG_SYS_LOAD_ADDR); } else { ret = genimg_get_format((void *)CONFIG_SYS_LOAD_ADDR + sizeof(mbn_header_t)); @@ -898,16 +916,16 @@ static int do_boot_unsignedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const #endif } else if (ret == IMAGE_FORMAT_LEGACY) { snprintf(runcmd, sizeof(runcmd), - "bootm 0x%x\n", (CONFIG_SYS_LOAD_ADDR + + "0x%x", (CONFIG_SYS_LOAD_ADDR + sizeof(mbn_header_t))); + } else { dcache_disable(); return CMD_RET_FAILURE; } } - - if (ret < 0 || run_command(runcmd, 0) != CMD_RET_SUCCESS) { + if (ret < 0 || boot_os(1, arg) != CMD_RET_SUCCESS) { #ifdef CONFIG_USB_XHCI_IPQ ipq_board_usb_init(); #endif diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index fe81d4ebf8..e7f11e98f4 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -26,6 +26,8 @@ DECLARE_GLOBAL_DATA_PTR; +#define SECURE_BOARD_MAGIC 0x5ECB001 + #if defined(CONFIG_CMD_IMI) static int image_info(unsigned long addr); #endif @@ -96,6 +98,11 @@ static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc, int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { + if(SECURE_BOARD_MAGIC == gd->board_type) { + printf("Booting restricted without authentication!!\n"); + reset_board(); + } + #ifdef CONFIG_NEEDS_MANUAL_RELOC static int relocated = 0; diff --git a/common/cmd_mem.c b/common/cmd_mem.c index 210ea13a1e..a3e9c175ec 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -33,6 +33,8 @@ DECLARE_GLOBAL_DATA_PTR; #define CONFIG_SYS_MEMTEST_SCRATCH 0 #endif +#define SECURE_BOARD_MAGIC 0x5ECB001 + static int mod_mem(cmd_tbl_t *, int, int, int, char * const []); /* Display values from last command. @@ -171,6 +173,11 @@ static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) void *buf, *start; ulong bytes; + if(SECURE_BOARD_MAGIC == gd->board_type) { + printf("Command not supported \'%s\'\n", argv[0]); + return 0; + } + if ((argc < 3) || (argc > 4)) return CMD_RET_USAGE; From ab765304c8a76e1367af15f4e23f00a3340e8449 Mon Sep 17 00:00:00 2001 From: Saahil Tomar Date: Thu, 23 Nov 2023 16:57:54 +0530 Subject: [PATCH 4/5] arch: arm: dts: Enable SPI NOR support for MI01.2 Change-Id: I3c823cde2dcde912169da878bba0569b5c9b088a Signed-off-by: Saahil Tomar (cherry picked from commit a91b6759b1c6bccd862b0b2777eec1851535977e) --- arch/arm/dts/ipq5332-mi01.2.dts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm/dts/ipq5332-mi01.2.dts b/arch/arm/dts/ipq5332-mi01.2.dts index 4b63285f19..f892e009d0 100644 --- a/arch/arm/dts/ipq5332-mi01.2.dts +++ b/arch/arm/dts/ipq5332-mi01.2.dts @@ -47,6 +47,38 @@ }; }; + spi { + spi_gpio { + blsp0_spi_clk { + gpio = <14>; + func = <1>; + pull = ; + oe = ; + drvstr = ; + }; + blsp0_spi_mosi { + gpio = <15>; + func = <1>; + pull = ; + oe = ; + drvstr = ; + }; + blsp0_spi_miso { + gpio = <16>; + func = <1>; + pull = ; + drvstr = ; + }; + blsp0_spi_cs { + gpio = <17>; + func = <1>; + pull = ; + oe = ; + drvstr = ; + }; + }; + }; + i2c@78B6000 { i2c_gpio { gpio1 { From 2e896eccc84a21fd240b6adf9d3fe0d5cfe00acd Mon Sep 17 00:00:00 2001 From: Timple Raj M Date: Fri, 17 Nov 2023 20:52:20 +0530 Subject: [PATCH 5/5] qca: ipq: fix to correct wrong delay obtained from udelay function If usec >= 224000 usec, then: usec * GPT_FREQ_KHZ = 224000 * 19200 >= 0x100590000, which is a 33 bits value To fix this usec is typecasted to 64 bit (unsigned long long)usec * GPT_FREQ_KHZ Change-Id: Ib1642d39b0581d2c04c62e415a1fd2dfed47fff1 Signed-off-by: Timple Raj M (cherry picked from commit 72d8ec613fe67eb64569200627c8c2da80218563) --- arch/arm/cpu/armv7/qca/common/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv7/qca/common/timer.c b/arch/arm/cpu/armv7/qca/common/timer.c index 004f9cc4b1..5e0ad07204 100644 --- a/arch/arm/cpu/armv7/qca/common/timer.c +++ b/arch/arm/cpu/armv7/qca/common/timer.c @@ -153,7 +153,7 @@ void __udelay(unsigned long usec) if (usec == 0) return; - val = (usec * GPT_FREQ_KHZ) / 1000; + val = ((unsigned long long)usec * GPT_FREQ_KHZ) / 1000; if (val == 0 ) val = 1; /* Wait for atleast 1 tick */