From e2219fe5b31b04cec63514852d5bef18143bcba0 Mon Sep 17 00:00:00 2001 From: Saahil Tomar Date: Mon, 29 May 2023 13:32:04 +0530 Subject: [PATCH 1/7] arm: dts: ipq9574: Add AL05 & AL06 RDP support This RDP is based on AL02-C4, with changes in ethernet for GPON enablement Change-Id: Ic25d9009e685d8646564bda582305fbf1bce2be6 Signed-off-by: Saahil Tomar --- arch/arm/dts/Makefile | 2 ++ arch/arm/dts/ipq9574-al05.dts | 20 ++++++++++++++++++++ arch/arm/dts/ipq9574-al06.dts | 20 ++++++++++++++++++++ tools/pack.py | 4 ++-- 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 arch/arm/dts/ipq9574-al05.dts create mode 100644 arch/arm/dts/ipq9574-al06.dts diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index c289d54be2..64bc55bd6d 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -124,6 +124,8 @@ dtb-$(CONFIG_ARCH_IPQ9574) += ipq9574-al01-c1.dtb \ ipq9574-al02-c17.dtb \ ipq9574-al02-c18.dtb \ ipq9574-al02-c19.dtb \ + ipq9574-al05.dtb \ + ipq9574-al06.dtb \ ipq9574-db-al01-c1.dtb \ ipq9574-db-al01-c2.dtb \ ipq9574-db-al01-c3.dtb \ diff --git a/arch/arm/dts/ipq9574-al05.dts b/arch/arm/dts/ipq9574-al05.dts new file mode 100644 index 0000000000..2aa1d64171 --- /dev/null +++ b/arch/arm/dts/ipq9574-al05.dts @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2016-2021, 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 "ipq9574-al02-c4.dts" +/ { + machid = <0x8050003>; + config_name = "config@al05"; +}; diff --git a/arch/arm/dts/ipq9574-al06.dts b/arch/arm/dts/ipq9574-al06.dts new file mode 100644 index 0000000000..31eb5cd478 --- /dev/null +++ b/arch/arm/dts/ipq9574-al06.dts @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2016-2021, 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 "ipq9574-al02-c4.dts" +/ { + machid = <0x8050004>; + config_name = "config@al06"; +}; diff --git a/tools/pack.py b/tools/pack.py index ebae72195b..848bf961ab 100644 --- a/tools/pack.py +++ b/tools/pack.py @@ -2262,7 +2262,7 @@ class Pack(object): flinfo.chipsize, blocksize, chipsize, root_part) self.partitions = mibib_qcn9224.get_parts() - script.append('if test "$machid" = "8050301" || test "$machid" = "8050501" || test "$machid" = "8050601" || test "$machid" = "8050701" || test "$machid" = "8050801" || test "$machid" = "8050901" || test "$machid" = "8050a01" || test "$machid" = "8050b01" || test "$machid" = "8050c01" || test "$machid" = "8050d01" || test "$machid" = "8050e01" || test "$machid" = "8050f01" || test "$machid" = "8051001" || test "$machid" = "0x8051101" || test "$machid" = "8051201" || test "$machid" = "8050002" || test "$machid" = "8050102"; then\n', fatal=False) + script.append('if test "$machid" = "8050301" || test "$machid" = "8050501" || test "$machid" = "8050601" || test "$machid" = "8050701" || test "$machid" = "8050801" || test "$machid" = "8050901" || test "$machid" = "8050a01" || test "$machid" = "8050b01" || test "$machid" = "8050c01" || test "$machid" = "8050d01" || test "$machid" = "8050e01" || test "$machid" = "8050f01" || test "$machid" = "8051001" || test "$machid" = "0x8051101" || test "$machid" = "8051201" || test "$machid" = "8050002" || test "$machid" = "8050102" || test "$machid" = "8050003" || test "$machid" = "8050004"; then\n', fatal=False) ret = self.__gen_flash_script(script, flinfo, root, True) if ret == 0: return 0 #Issue in packing al+wkk single-image @@ -2288,7 +2288,7 @@ class Pack(object): gpt = GPT(part_fname_qcn9224, flinfo.pagesize, flinfo.blocksize, flinfo.chipsize) self.partitions = gpt.get_parts() - script.append('if test "$machid" = "8050301" || test "$machid" = "8050501" || test "$machid" = "8050601" || test "$machid" = "8050701" || test "$machid" = "8050801" || test "$machid" = "8050901" || test "$machid" = "8050a01" || test "$machid" = "8050b01" || test "$machid" = "8050c01" || test "$machid" = "8050d01" || test "$machid" = "8050e01" || test "$machid" = "8050f01" || test "$machid" = "8051001" || test "$machid" = "0x8051101" || test "$machid" = "8051201" || test "$machid" = "8050002" || test "$machid" = "8050102"; then\n', fatal=False) + script.append('if test "$machid" = "8050301" || test "$machid" = "8050501" || test "$machid" = "8050601" || test "$machid" = "8050701" || test "$machid" = "8050801" || test "$machid" = "8050901" || test "$machid" = "8050a01" || test "$machid" = "8050b01" || test "$machid" = "8050c01" || test "$machid" = "8050d01" || test "$machid" = "8050e01" || test "$machid" = "8050f01" || test "$machid" = "8051001" || test "$machid" = "0x8051101" || test "$machid" = "8051201" || test "$machid" = "8050002" || test "$machid" = "8050102" || test "$machid" = "8050003" || test "$machid" = "8050004"; then\n', fatal=False) ret = self.__gen_flash_script(script, flinfo, root, True) if ret == 0: return 0 #Issue in packing al+wkk single-image From 62e96bfe91d51ab570c36c9a87a2937b9bdb1581 Mon Sep 17 00:00:00 2001 From: Hariharan K Date: Fri, 14 Apr 2023 23:46:37 +0530 Subject: [PATCH 2/7] pack_v2: Append flupdate commands If flash image type is emmc, switch the flash type to emmc from nor in norplusemmc board using the flupdate commands. Once the image is flashed switch back the flash type to nor using the same flupdate commands. This change is to support the below Change-Id Ib328cc1fea0b37f27e6479d55fce08365fbfcf69 Change-Id: Ia5f75923d7bdfd313a986826f1ac2f7f571c414a Signed-off-by: Hariharan K --- tools/pack_v2.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/pack_v2.py b/tools/pack_v2.py index 39f159dc78..31847a81af 100644 --- a/tools/pack_v2.py +++ b/tools/pack_v2.py @@ -903,6 +903,8 @@ class Pack(object): script.append("flashinit nand") elif flinfo.type == "emmc" or self.flash_type == "norplusemmc": script.append("flashinit mmc") + if flinfo.type == "emmc": + script.append("flupdate set mmc") if flinfo.type != "emmc": self.__gen_script_mibib(script, flinfo, parts, parts_length, "mibib_reload") @@ -1068,6 +1070,9 @@ class Pack(object): continue + if flinfo.type == "emmc": + script.append("flupdate clear") + return 1 def __gen_script_cdt(self, images, flinfo, root, section_conf, partition): From 13581265b0266325e7061b2727c495c8bc78ff7f Mon Sep 17 00:00:00 2001 From: Timple Raj M Date: Mon, 24 Apr 2023 20:25:38 +0530 Subject: [PATCH 3/7] mtd: nand: Add support for giga device spi nand This change will add support for giga device GD5F2GM7REYIG spi nand support. Change-Id: I97772e0a8210bd5a6d41e10bbfbdd75b44e53108 Signed-off-by: Timple Raj M --- drivers/mtd/nand/qpic_nand.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/mtd/nand/qpic_nand.c b/drivers/mtd/nand/qpic_nand.c index 38d4775644..604583e7d0 100644 --- a/drivers/mtd/nand/qpic_nand.c +++ b/drivers/mtd/nand/qpic_nand.c @@ -205,6 +205,22 @@ static struct qpic_serial_nand_params qpic_serial_nand_tbl[] = { .check_quad_config = true, .name = "GD5F1GM7REYIG", }, + { + .id = { 0xc8, 0x82 }, + .page_size = 2048, + .erase_blk_size = 0x00020000, + .pgs_per_blk = 64, + .no_of_blocks = 2048, + .spare_size = 128, + .density = 0x10000000, + .otp_region = 0x5000, + .no_of_addr_cycle = 0x3, + .num_bits_ecc_correctability = 8, + .timing_mode_support = 0, + .quad_mode = true, + .check_quad_config = true, + .name = "GD5F2GM7REYIG", + }, { .id = { 0xc8, 0x21 }, .page_size = 2048, From 8d93686a7487fbe3962b13d9b68b12c8f125f95c Mon Sep 17 00:00:00 2001 From: Saahil Tomar Date: Tue, 20 Jun 2023 15:35:54 +0530 Subject: [PATCH 4/7] pack_v2: remove the mibib_reload sequence for nand apps img Change-Id: I846700d480a5ef0577a8f279fcd1932d2463d38c Signed-off-by: Saahil Tomar --- tools/pack_v2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pack_v2.py b/tools/pack_v2.py index 39f159dc78..5c1d176968 100644 --- a/tools/pack_v2.py +++ b/tools/pack_v2.py @@ -904,7 +904,7 @@ class Pack(object): elif flinfo.type == "emmc" or self.flash_type == "norplusemmc": script.append("flashinit mmc") - if flinfo.type != "emmc": + if flinfo.type != "emmc" and image_type != "hlos": self.__gen_script_mibib(script, flinfo, parts, parts_length, "mibib_reload") for index in range(parts_length): From 77d37303b484a91d26c488db0c528dc690600b62 Mon Sep 17 00:00:00 2001 From: Purna Chandra Mandal Date: Wed, 20 Jan 2016 14:07:39 +0530 Subject: [PATCH 5/7] bootm: fix size arg of flush_cache() in bootm_load_os(). Variable _load_end_ points to end address of uncompressed buffer (*not* uncomress_buffer_end / sizeof(ulong)), so multipling uncompressed size with sizeof(ulong) is grossly incorrect in flush_cache(). It might lead to access of address beyond valid memory range and hang the CPU. Tested on MIPS architecture by using compressed(gzip, lzma) and uncompressed uImage. Signed-off-by: Purna Chandra Mandal Reviewed-by: Simon Glass Reviewed-by: Daniel Schwierzeck Signed-off-by: POOVENDHAN SELVARAJ Change-Id: Ia93bfc549e348e655a748a24f59b38a0f80659ce (cherry picked from commit 8d4f11c2033d0621f22a1501d92616596a8d1a62) --- common/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/bootm.c b/common/bootm.c index 3526eb6de4..64edcc59fe 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -442,7 +442,7 @@ int bootm_load_os(bootm_headers_t *images, unsigned long *load_end, bootstage_error(BOOTSTAGE_ID_DECOMP_IMAGE); return err; } - flush_cache(load, (*load_end - load) * sizeof(ulong)); + flush_cache(load, *load_end - load); debug(" %s loaded at 0x%08lx, end = 0x%08lx\n", genimg_get_type_name(os.type), load, *load_end); From 4f3f613b4058ef1dad4389eec2b3bdb8557cc9ed Mon Sep 17 00:00:00 2001 From: Karthick Shanmugham Date: Fri, 14 Jul 2023 11:29:29 +0530 Subject: [PATCH 6/7] board: qca: ipq9574: Add atf crypto fixup support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This changes fixup "qcom,controlled-remotely" property and "qti,config-pipe-trust-reg" property in the crypto bam node in ATF boot. This will enable the kernel to do complete bam pipe initialization. Change-Id: I454c4e4e68354506dc16b1e72b514264778314e0 Signed-off-by: Karthick Shanmugham --- board/qca/arm/ipq9574/ipq9574.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/board/qca/arm/ipq9574/ipq9574.c b/board/qca/arm/ipq9574/ipq9574.c index 7fdc3bd11f..5618fe4903 100644 --- a/board/qca/arm/ipq9574/ipq9574.c +++ b/board/qca/arm/ipq9574/ipq9574.c @@ -1426,6 +1426,16 @@ void ipq_uboot_fdt_fixup(void) return; } +void fdt_fixup_for_atf(void *blob) +{ + if (fdt_path_offset(blob, "/soc/dma@704000") >= 0) { + parse_fdt_fixup("/soc/dma@704000%qcom,controlled-remotely%0", + blob); + parse_fdt_fixup("/soc/dma@704000%qti,config-pipe-trust-reg%2", + blob); + } +} + int do_dpr(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) { int ret; From 9f2501f794b72c560829e92f4b85bae81404522b Mon Sep 17 00:00:00 2001 From: Ram Kumar D Date: Mon, 3 Jul 2023 16:32:49 +0530 Subject: [PATCH 7/7] arch: arm: dts: updated qca808x PHY mode support in AL06 This patch updates the following ethernet configuration on ipq9574. Previously, AL06 has qca8075 PHY attached in the UNIPHY0, now it has been replaced with qca808x PHY mode. Change-Id: Ieb5b9ef10bd1ebfd1992cbfa10cb02b2ac4d0534 Signed-off-by: Ram Kumar D --- arch/arm/dts/ipq9574-al06.dts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/dts/ipq9574-al06.dts b/arch/arm/dts/ipq9574-al06.dts index 31eb5cd478..0084f75694 100644 --- a/arch/arm/dts/ipq9574-al06.dts +++ b/arch/arm/dts/ipq9574-al06.dts @@ -17,4 +17,33 @@ / { machid = <0x8050004>; config_name = "config@al06"; + + ess-switch { + /* Overriding config to support QCA8084 PHY instead of + * QCA8075 PHY + */ + /delete-property/qca807x_gpio; + /delete-property/qca807x_gpio_cnt; + qca808x_gpio = <60>; + qca808x_gpio_cnt = <1>; + switch_mac_mode0 = ; + port_phyinfo { + port@0 { + phy_address = <1>; + phy_type = ; + }; + port@1 { + phy_address = <2>; + phy_type = ; + }; + port@2 { + phy_address = <3>; + phy_type = ; + }; + port@3 { + phy_address = <4>; + phy_type = ; + }; + }; + }; };