From patchwork Fri Jul 8 13:14:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 588511 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:bb16:0:0:0:0 with SMTP id jd22csp639975mab; Fri, 8 Jul 2022 06:16:15 -0700 (PDT) X-Google-Smtp-Source: AGRyM1semf9AwnLos2kHZa3kR7D95Kl8FKQtyZYaQadKmneZCRInNyMUgseYZHcrfgki+U5YtxmH X-Received: by 2002:a2e:99c8:0:b0:25a:8c47:81c9 with SMTP id l8-20020a2e99c8000000b0025a8c4781c9mr2036865ljj.371.1657286175073; Fri, 08 Jul 2022 06:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657286175; cv=none; d=google.com; s=arc-20160816; b=r9aMfqknZgTqUyO42tc59QyF3a2SB/4NSqtMJujcneH+Z4K7iscawic8rH6/Nd5LMO oVog9pJz3w2JbVk/8Xvmh9sr3U+vOWgZHBFsBbV3ecxE8n0QIdUDKehPfhumDETzm80R +sPHsCXpEFDoIeQmOKrEE+tv5rd/he70Kf7in/ssTdMQL0QSDGS54t3TgREcwFggfTHb HZ4ICsgVCcJWLZRhhECEdUsD78CucaQQ4xvaxpG4nQFhiScn0OqMhXNQ1icZipRtkRmI K0hiaWagXyO83vWTr30IwOiflgG4o4UnDvUQyya6NXb/D7wy6dvCvg55khxw6RZNTOxh B80A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KG9rb99/lJ0ydEhcrhJcEbSTwqggQgUJLPWiCjgPPQg=; b=flOuZqFbAPipFsDOqRGR6/OvXQl+Z9a/81/GvLHjp4EK++EOuCcqi6isE9HuoRjuA3 /Ab74epdQJamGDuBqj87h8lYaw0T6C2SFWD/9NXYjPKQCa5Mxy5DxrNTEuNS2d3h43bH 2PPDiuAuYEkv/rwgeI5IoGr6oRtD41SZkJmpdHyMNbkhYkjE/YMe/9j4yTz+uHqgLfLs GO5QQIct4MjFVhuz2benJJh2UPFqHM3rY7WtyI+zssmjNWW7iTkojF3SkX0o61jU4SRY HyjFUSJBnjvToAed5srlMqFEAMkSkZlE+n5SlctTKZj+yO6CAHoI/zceNcdN+lCgRj+u EO9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="z8SvrQY/"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id d25-20020a2e3619000000b0024b6abfb630si36915604lja.10.2022.07.08.06.16.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 06:16:15 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="z8SvrQY/"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 07C6F845C1; Fri, 8 Jul 2022 15:15:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="z8SvrQY/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9170B845C1; Fri, 8 Jul 2022 15:15:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 346EF84580 for ; Fri, 8 Jul 2022 15:14:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pj1-x1031.google.com with SMTP id z12-20020a17090a7b8c00b001ef84000b8bso1871641pjc.1 for ; Fri, 08 Jul 2022 06:14:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KG9rb99/lJ0ydEhcrhJcEbSTwqggQgUJLPWiCjgPPQg=; b=z8SvrQY/kWyVZzTwd1r23gUV8pg2Rqio5b3A0kd2KiLpTxQRKit+54bE7xyGKihHj5 G9uYZHr3PDpXDvqsR1Im+6mcwhnJgHa3Gt95VfYGJVuHx5QFumvvS3839dwYWl3YwsDN IIG8Dws2tT66rG8d4yTAb7vfpeYQO4CGS+/FgJxnI/urUxzRP7BDyNEbflzBWoLVW0Ym goTaCo4mjhRVSk+X+Eo/ZO9CFxnmCwug6V1qoYBkzP/VP6pzxQb2Qn6hCPJTiFE6Alcc A27GSZgOONxeeZaJ1kk1H9kBwq6GbBux4Uc/aBTB8A/3TrZdWTIx/T6Myu2BeEdbmYeR rt/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KG9rb99/lJ0ydEhcrhJcEbSTwqggQgUJLPWiCjgPPQg=; b=RM800lQ2XL70GNyAeheW9FmuLwnYzSQZWYEJe/5ql29iGEaRSOli+xo46L2fpVoWQG Ik/g1aGHBIvQx1nKudU5qJ65HagQaPuI5S3/Yf/kUJW1L126zENj6OKUPAgUps7jSBjc rv112dVCqYFVO+iT1lEzs0KnhFP4YMKvUnY/6dkxyZHFawDuTi3PJsXziHXyvK3rHh7k jUVhrfy1/D0XQEFi36j54VyWwof4DkfZNkhH5vZUN8y+UAZ3xRLE9mhl10qKfzd6dZzV vIhVPgExRMHrvbLH4rvZRNQtnJLMTU/fGl6MaJxn3Xpnw77hCcOFAWB7UoUeAv+EUedb e8Cw== X-Gm-Message-State: AJIora8RGP7f2CTijN8tMPFlcYu22UHDKOr44H+tm9K0vrIMUZLScDQJ r1cpkcLksvHdwQ8mBRmEgWcJ5bKlJWrSww== X-Received: by 2002:a17:902:a406:b0:16b:c816:6427 with SMTP id p6-20020a170902a40600b0016bc8166427mr3784635plq.88.1657286098384; Fri, 08 Jul 2022 06:14:58 -0700 (PDT) Received: from localhost.localdomain ([182.77.21.191]) by smtp.gmail.com with ESMTPSA id c9-20020a624e09000000b0052974b651b9sm2026493pfb.38.2022.07.08.06.14.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jul 2022 06:14:58 -0700 (PDT) From: Sumit Garg To: u-boot@lists.denx.de Cc: rfried.dev@gmail.com, peng.fan@nxp.com, jh80.chung@samsung.com, sjg@chromium.org, trini@konsulko.com, dsankouski@gmail.com, stephan@gerhold.net, vinod.koul@linaro.org, nicolas.dechesne@linaro.org, mworsfold@impinj.com, daniel.thompson@linaro.org, pbrobinson@gmail.com, Sumit Garg Subject: [PATCH v2 9/9] board: qualcomm: Add support for QCS404 EVB Date: Fri, 8 Jul 2022 18:44:04 +0530 Message-Id: <20220708131404.1489347-10-sumit.garg@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220708131404.1489347-1-sumit.garg@linaro.org> References: <20220708131404.1489347-1-sumit.garg@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Add support for Qualcomm QCS404 SoC based evaluation board. Features: - Qualcomm Snapdragon QCS404 SoC - 1GiB RAM - 8GiB eMMC, uSD slot U-boot is chain loaded by ABL in 64-bit mode as part of boot.img. For detailed build and boot instructions, refer to doc/board/qualcomm/qcs404.rst. Signed-off-by: Sumit Garg --- arch/arm/dts/Makefile | 1 + arch/arm/dts/qcs404-evb-uboot.dtsi | 24 ++++++ arch/arm/dts/qcs404-evb.dts | 81 +++++++++++++++++++ arch/arm/mach-snapdragon/Kconfig | 11 +++ arch/arm/mach-snapdragon/Makefile | 2 + .../include/mach/sysmap-qcs404.h | 13 +++ arch/arm/mach-snapdragon/sysmap-qcs404.c | 31 +++++++ board/qualcomm/qcs404-evb/Kconfig | 15 ++++ board/qualcomm/qcs404-evb/MAINTAINERS | 6 ++ board/qualcomm/qcs404-evb/Makefile | 6 ++ board/qualcomm/qcs404-evb/qcs404-evb.c | 33 ++++++++ board/qualcomm/qcs404-evb/qcs404-evb.its | 64 +++++++++++++++ configs/qcs404evb_defconfig | 39 +++++++++ doc/board/qualcomm/index.rst | 1 + doc/board/qualcomm/qcs404.rst | 79 ++++++++++++++++++ include/configs/qcs404-evb.h | 27 +++++++ 16 files changed, 433 insertions(+) create mode 100644 arch/arm/dts/qcs404-evb-uboot.dtsi create mode 100644 arch/arm/dts/qcs404-evb.dts create mode 100644 arch/arm/mach-snapdragon/include/mach/sysmap-qcs404.h create mode 100644 arch/arm/mach-snapdragon/sysmap-qcs404.c create mode 100644 board/qualcomm/qcs404-evb/Kconfig create mode 100644 board/qualcomm/qcs404-evb/MAINTAINERS create mode 100644 board/qualcomm/qcs404-evb/Makefile create mode 100644 board/qualcomm/qcs404-evb/qcs404-evb.c create mode 100644 board/qualcomm/qcs404-evb/qcs404-evb.its create mode 100644 configs/qcs404evb_defconfig create mode 100644 doc/board/qualcomm/qcs404.rst create mode 100644 include/configs/qcs404-evb.h diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index a7e0d9f6c0..a561b28cef 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -502,6 +502,7 @@ dtb-$(CONFIG_TARGET_TEN64) += fsl-ls1088a-ten64.dtb dtb-$(CONFIG_TARGET_DRAGONBOARD410C) += dragonboard410c.dtb dtb-$(CONFIG_TARGET_DRAGONBOARD820C) += dragonboard820c.dtb dtb-$(CONFIG_TARGET_STARQLTECHN) += starqltechn.dtb +dtb-$(CONFIG_TARGET_QCS404EVB) += qcs404-evb.dtb dtb-$(CONFIG_TARGET_STEMMY) += ste-ux500-samsung-stemmy.dtb diff --git a/arch/arm/dts/qcs404-evb-uboot.dtsi b/arch/arm/dts/qcs404-evb-uboot.dtsi new file mode 100644 index 0000000000..c18080a483 --- /dev/null +++ b/arch/arm/dts/qcs404-evb-uboot.dtsi @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * U-Boot addition to handle QCS404 EVB pre-relocation devices + * + * (C) Copyright 2022 Sumit Garg + */ + +/ { + soc { + u-boot,dm-pre-reloc; + + pinctrl_north@1300000 { + u-boot,dm-pre-reloc; + }; + + clock-controller@1800000 { + u-boot,dm-pre-reloc; + }; + + serial@78b1000 { + u-boot,dm-pre-reloc; + }; + }; +}; diff --git a/arch/arm/dts/qcs404-evb.dts b/arch/arm/dts/qcs404-evb.dts new file mode 100644 index 0000000000..4f0ae20bdb --- /dev/null +++ b/arch/arm/dts/qcs404-evb.dts @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm QCS404 based evaluation board device tree source + * + * (C) Copyright 2022 Sumit Garg + */ + +/dts-v1/; + +#include "skeleton64.dtsi" +#include +#include +#include + +/ { + model = "Qualcomm Technologies, Inc. QCS404 EVB"; + compatible = "qcom,qcs404-evb", "qcom,qcs404"; + #address-cells = <0x2>; + #size-cells = <0x2>; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + serial0 = &debug_uart; + }; + + memory { + device_type = "memory"; + reg = <0 0x80000000 0 0x40000000>; + }; + + soc { + #address-cells = <0x1>; + #size-cells = <0x1>; + ranges = <0x0 0x0 0x0 0xffffffff>; + compatible = "simple-bus"; + + pinctrl_north@1300000 { + compatible = "qcom,tlmm-qcs404"; + reg = <0x1300000 0x200000>; + + blsp1_uart2: uart { + pins = "GPIO_17", "GPIO_18"; + function = "blsp_uart2"; + }; + }; + + gcc: clock-controller@1800000 { + compatible = "qcom,gcc-qcs404"; + reg = <0x1800000 0x80000>; + #address-cells = <0x1>; + #size-cells = <0x0>; + }; + + debug_uart: serial@78b1000 { + compatible = "qcom,msm-uartdm-v1.4"; + reg = <0x78b1000 0x200>; + clock = <&gcc GCC_BLSP1_UART2_APPS_CLK>, + <&gcc GCC_BLSP1_AHB_CLK>; + bit-rate = <0xFF>; + pinctrl-names = "uart"; + pinctrl-0 = <&blsp1_uart2>; + }; + + sdhci@7804000 { + compatible = "qcom,sdhci-msm-v5"; + reg = <0x7804000 0x1000 0x7805000 0x1000>; + clock = <&gcc GCC_SDCC1_APPS_CLK>, + <&gcc GCC_SDCC1_AHB_CLK>; + bus-width = <0x8>; + index = <0x0>; + non-removable; + mmc-ddr-1_8v; + mmc-hs400-1_8v; + }; + }; +}; + +#include "qcs404-evb-uboot.dtsi" diff --git a/arch/arm/mach-snapdragon/Kconfig b/arch/arm/mach-snapdragon/Kconfig index cb53dc8901..0927333306 100644 --- a/arch/arm/mach-snapdragon/Kconfig +++ b/arch/arm/mach-snapdragon/Kconfig @@ -69,11 +69,22 @@ config TARGET_STARQLTECHN select SDM845 select DM_ETH if NET +config TARGET_QCS404EVB + bool "Qualcomm Technologies, Inc. QCS404 EVB" + select LINUX_KERNEL_IMAGE_HEADER + help + Support for Qualcomm Technologies, Inc. QCS404 evaluation board. + Features: + - Qualcomm Snapdragon QCS404 SoC + - 1GiB RAM + - 8GiB eMMC, uSD slot + endchoice source "board/qualcomm/dragonboard410c/Kconfig" source "board/qualcomm/dragonboard820c/Kconfig" source "board/qualcomm/dragonboard845c/Kconfig" source "board/samsung/starqltechn/Kconfig" +source "board/qualcomm/qcs404-evb/Kconfig" endif diff --git a/arch/arm/mach-snapdragon/Makefile b/arch/arm/mach-snapdragon/Makefile index cb8c1aa8d2..0d31f10f68 100644 --- a/arch/arm/mach-snapdragon/Makefile +++ b/arch/arm/mach-snapdragon/Makefile @@ -17,3 +17,5 @@ obj-y += pinctrl-apq8016.o obj-y += pinctrl-apq8096.o obj-y += pinctrl-qcs404.o obj-$(CONFIG_SDM845) += pinctrl-sdm845.o +obj-$(CONFIG_TARGET_QCS404EVB) += clock-qcs404.o +obj-$(CONFIG_TARGET_QCS404EVB) += sysmap-qcs404.o diff --git a/arch/arm/mach-snapdragon/include/mach/sysmap-qcs404.h b/arch/arm/mach-snapdragon/include/mach/sysmap-qcs404.h new file mode 100644 index 0000000000..c495f43a6b --- /dev/null +++ b/arch/arm/mach-snapdragon/include/mach/sysmap-qcs404.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Qualcomm QCS404 sysmap + * + * (C) Copyright 2022 Sumit Garg + */ +#ifndef _MACH_SYSMAP_QCS404_H +#define _MACH_SYSMAP_QCS404_H + +#define GICD_BASE (0x0b000000) +#define GICC_BASE (0x0b002000) + +#endif diff --git a/arch/arm/mach-snapdragon/sysmap-qcs404.c b/arch/arm/mach-snapdragon/sysmap-qcs404.c new file mode 100644 index 0000000000..b7409031a0 --- /dev/null +++ b/arch/arm/mach-snapdragon/sysmap-qcs404.c @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Qualcomm QCS404 memory map + * + * (C) Copyright 2022 Sumit Garg + */ + +#include +#include + +static struct mm_region qcs404_mem_map[] = { + { + .virt = 0x0UL, /* Peripheral block */ + .phys = 0x0UL, /* Peripheral block */ + .size = 0x8000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | + PTE_BLOCK_NON_SHARE | + PTE_BLOCK_PXN | PTE_BLOCK_UXN + }, { + .virt = 0x80000000UL, /* DDR */ + .phys = 0x80000000UL, /* DDR */ + .size = 0x40000000UL, + .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | + PTE_BLOCK_INNER_SHARE + }, { + /* List terminator */ + 0, + } +}; + +struct mm_region *mem_map = qcs404_mem_map; diff --git a/board/qualcomm/qcs404-evb/Kconfig b/board/qualcomm/qcs404-evb/Kconfig new file mode 100644 index 0000000000..32657c7d5e --- /dev/null +++ b/board/qualcomm/qcs404-evb/Kconfig @@ -0,0 +1,15 @@ +if TARGET_QCS404EVB + +config SYS_BOARD + default "qcs404-evb" + +config SYS_VENDOR + default "qualcomm" + +config SYS_SOC + default "qcs404" + +config SYS_CONFIG_NAME + default "qcs404-evb" + +endif diff --git a/board/qualcomm/qcs404-evb/MAINTAINERS b/board/qualcomm/qcs404-evb/MAINTAINERS new file mode 100644 index 0000000000..0a2e194ff6 --- /dev/null +++ b/board/qualcomm/qcs404-evb/MAINTAINERS @@ -0,0 +1,6 @@ +Qualcomm Technologies, Inc. QCS404 evaluation board +M: Sumit Garg +S: Maintained +F: board/qualcomm/qcs404-evb/ +F: include/configs/qcs404-evb.h +F: configs/qcs404evb_defconfig diff --git a/board/qualcomm/qcs404-evb/Makefile b/board/qualcomm/qcs404-evb/Makefile new file mode 100644 index 0000000000..4665827e08 --- /dev/null +++ b/board/qualcomm/qcs404-evb/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2022 Sumit Garg +# + +obj-y += qcs404-evb.o diff --git a/board/qualcomm/qcs404-evb/qcs404-evb.c b/board/qualcomm/qcs404-evb/qcs404-evb.c new file mode 100644 index 0000000000..f1e6e7f7eb --- /dev/null +++ b/board/qualcomm/qcs404-evb/qcs404-evb.c @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Board init file for QCS404-EVB + * + * (C) Copyright 2022 Sumit Garg + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +int dram_init(void) +{ + return fdtdec_setup_mem_size_base(); +} + +int board_init(void) +{ + return 0; +} + +void reset_cpu(void) +{ + psci_system_reset(); +} diff --git a/board/qualcomm/qcs404-evb/qcs404-evb.its b/board/qualcomm/qcs404-evb/qcs404-evb.its new file mode 100644 index 0000000000..c9822827c9 --- /dev/null +++ b/board/qualcomm/qcs404-evb/qcs404-evb.its @@ -0,0 +1,64 @@ +/* + * U-Boot uImage source file with multiple kernels, ramdisks and FDT blobs + */ + +/dts-v1/; + +/ { + description = "Various kernels, ramdisks and FDT blobs"; + #address-cells = <1>; + + images { + kernel-1 { + description = "5.18.0-rc1"; + data = /incbin/("./qcs404_imgs/Image.gz"); + type = "kernel"; + arch = "arm64"; + os = "linux"; + compression = "gzip"; + load = <0x80000000>; + entry = <0x80000000>; + hash-1 { + algo = "sha1"; + }; + }; + + ramdisk-1 { + description = "Initial ramdisk"; + data = /incbin/("./qcs404_imgs/initramfs-tiny-image-qemuarm64-20220618074058-1169.rootfs.cpio.gz"); + type = "ramdisk"; + arch = "arm64"; + os = "linux"; + compression = "gzip"; + load = <00000000>; + entry = <00000000>; + hash-1 { + algo = "sha1"; + }; + }; + + fdt-1 { + description = "qcs404-evb-fdt"; + data = /incbin/("./qcs404_imgs/qcs404-evb-4000.dtb"); + type = "flat_dt"; + arch = "arm64"; + compression = "none"; + load = <0x83000000>; + hash-1 { + algo = "sha1"; + }; + }; + + }; + + configurations { + default = "config-1"; + + config-1 { + description = "qcs404-evb kernel-5.18.0-rc1 configuration"; + kernel = "kernel-1"; + ramdisk = "ramdisk-1"; + fdt = "fdt-1"; + }; + }; +}; diff --git a/configs/qcs404evb_defconfig b/configs/qcs404evb_defconfig new file mode 100644 index 0000000000..7c76e8353e --- /dev/null +++ b/configs/qcs404evb_defconfig @@ -0,0 +1,39 @@ +CONFIG_ARM=y +CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_COUNTER_FREQUENCY=19000000 +CONFIG_POSITION_INDEPENDENT=y +CONFIG_ARCH_SNAPDRAGON=y +CONFIG_DEFAULT_DEVICE_TREE="qcs404-evb" +CONFIG_TARGET_QCS404EVB=y +CONFIG_IDENT_STRING="\nQualcomm QCS404-EVB" +CONFIG_SYS_TEXT_BASE=0x0 +CONFIG_SYS_LOAD_ADDR=0x80000000 +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_BOOTDELAY=5 +CONFIG_SAVE_PREV_BL_FDT_ADDR=y +CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR=y +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_HUSH_PARSER=y +CONFIG_CMD_BMP=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_MMC=y +CONFIG_CMD_GPT=y +CONFIG_CMD_PART=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +# CONFIG_NET is not set +CONFIG_CLK=y +CONFIG_PINCTRL=y +CONFIG_DM_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_ADMA=y +CONFIG_MMC_SDHCI_MSM=y +CONFIG_MMC_HS400_SUPPORT=y +CONFIG_MSM_SERIAL=y +CONFIG_LMB_MAX_REGIONS=64 +CONFIG_USE_BOOTARGS=y +CONFIG_BOOTARGS="earlycon ignore_loglevel root= clk_ignore_unused" diff --git a/doc/board/qualcomm/index.rst b/doc/board/qualcomm/index.rst index 10b98214e9..0f9c429956 100644 --- a/doc/board/qualcomm/index.rst +++ b/doc/board/qualcomm/index.rst @@ -8,3 +8,4 @@ Qualcomm dragonboard410c sdm845 + qcs404 diff --git a/doc/board/qualcomm/qcs404.rst b/doc/board/qualcomm/qcs404.rst new file mode 100644 index 0000000000..bbb40b043b --- /dev/null +++ b/doc/board/qualcomm/qcs404.rst @@ -0,0 +1,79 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. sectionauthor:: Sumit Garg + +QCS404 EVB +========== + +About this +---------- +This document describes the information about Qualcomm QCS404 evaluation board +and it's usage steps. + +U-Boot can be used as a replacement for Qualcomm's original ABL (UEFI) bootloader. +It is loaded as an Android boot image through ABL + +Installation +------------ +Build +^^^^^ +Setup ``CROSS_COMPILE`` for aarch64 and build U-Boot for your board:: + + $ export CROSS_COMPILE= + $ make qcs404evb_defconfig + $ make + +This will build ``u-boot.bin`` in the configured output directory. + +Generate FIT image +^^^^^^^^^^^^^^^^^^ +A ``qcs404.its`` file can be found in ``board/qualcomm/qcs404-evb/`` directory. +It expects a folder as ``qcs404_imgs/`` in the main directory containing +pre-built kernel, dts and ramdisk images. See ``qcs404.its`` for full path to +images. + +- Build FIT image:: + + mkimage -f qcs404-evb.its qcs404-evb.itb + +Pack android boot image +^^^^^^^^^^^^^^^^^^^^^^^ +We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel, +and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel +with appended dtb, so let's mimic linux to satisfy stock bootloader: + +- create dump dtb:: + + workdir=/tmp/prepare_payload + mkdir -p "$workdir" + cd "$workdir" + mock_dtb="$workdir"/payload_mock.dtb + + dtc -I dts -O dtb -o "$mock_dtb" << EOF + /dts-v1/; + / { + model = "Qualcomm Technologies, Inc. QCS404 EVB 4000"; + compatible = "qcom,qcs404-evb-4000", "qcom,qcs404-evb", "qcom,qcs404"; + + #address-cells = <2>; + #size-cells = <2>; + + memory@80000000 { + device_type = "memory"; + /* We expect the bootloader to fill in the size */ + reg = <0 0x80000000 0 0>; + }; + + chosen { }; + }; + EOF + +- gzip u-boot ``gzip u-boot.bin`` +- append dtb to gzipped u-boot: ``cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb`` + +Now we've got everything to build android boot image::: + + mkbootimg --kernel u-boot.bin.gz-dtb \ + --ramdisk qcs404-evb.itb --pagesize 4096 \ + --base 0x80000000 --output boot.img + +Flash image on qcs404-evb using fastboot method. diff --git a/include/configs/qcs404-evb.h b/include/configs/qcs404-evb.h new file mode 100644 index 0000000000..a7f645b613 --- /dev/null +++ b/include/configs/qcs404-evb.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Configuration file for QCS404 evaluation board + * + * (C) Copyright 2022 Sumit Garg + */ + +#ifndef __CONFIGS_QCS404EVB_H +#define __CONFIGS_QCS404EVB_H + +#include +#include + +#define CONFIG_SYS_BAUDRATE_TABLE { 115200, 230400, 460800, 921600 } + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "bootm_size=0x5000000\0" \ + "bootm_low=0x80000000\0" \ + "bootcmd=bootm $prevbl_initrd_start_addr\0" + +#define CONFIG_SYS_BOOTM_LEN SZ_64M + +/* Monitor Command Prompt */ +#define CONFIG_SYS_CBSIZE 512 +#define CONFIG_SYS_MAXARGS 64 + +#endif