From patchwork Fri Oct 21 18:10:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13015249 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4FC0FC433FE for ; Fri, 21 Oct 2022 18:11:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Ju2Gh4pJVpJvbMom656X3a0rbH9Ub9d9bFkvss+GSgQ=; b=Lpdy1q8VjB+Xr7 dsMirP8zdqybWTBMzUsWKlXsCfuPv06Xw6EWofw7infDCLvqWv3vSVeI9P8/sgt7O0hMrcu4VD53+ qCafRNZSbn5ACuFg3IM7WbSX2MEilGZzDuUBbwmoDdizl+UDE8VadgzlRH8CqADOs35Xp7AgbHHgt 9YzyFHQIUShTJyJhhrVb7aNaDn8GlzhAMYe52J7g9TnopMr1bSfIDCbsTr+FeMN374NPnsCBIbZXd GeREoNDFttGTEIWMz91woWBrSyb+yX5kDgdLYYVDnvOZGiLr7hoArrwhVnC7DFESv9Kc4KROyJ/I+ 0raZeAGPRAmJxJb2rTrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olwTg-009OUQ-1B; Fri, 21 Oct 2022 18:10:40 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1olwTd-009OTc-33 for linux-arm-kernel@lists.infradead.org; Fri, 21 Oct 2022 18:10:38 +0000 Received: by mail-wm1-x32c.google.com with SMTP id m29-20020a05600c3b1d00b003c6bf423c71so5707580wms.0 for ; Fri, 21 Oct 2022 11:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=SCMIWHkICzZX+kzd/gI/19yCCEBlViFGlZeb1lVVKQg=; b=ATNr3M0VRGusUEwflQ479GhtRIKW9FvwjCy8T7uu6a4Ao3Htu8J2o/Uxu4KvLqAVBF Rt/hjm4xIhTmGAkBi9RFa0wzdZ2KcpRqzNSZeT0p8/Zr9IH2NoCmCUPXkAHnCBOfx7WA w6m0jVoyAq61lw/arct5Ix6Uby5aVZcZjwKMd7Q2rs5SRPnjC+3fUnU1hChkeGEvSLdl nBohAnz+/Wu/h0zbhLlwrehNTODOU0+5ECxZsqiEvFFKGA7f8JWs5Lb3KB4YpKRfXei9 tyDkhS/AbiQ+Wz1tQzsKoCAOlcjF7cpcAl7ijlFenqA/bf0LNeBoXHNtMpegIRSQvdee vwIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SCMIWHkICzZX+kzd/gI/19yCCEBlViFGlZeb1lVVKQg=; b=JLkWgU1vTMZrSf5n158jxMgNU9qAMo7y+J4aNwMfHQfJgIgQizJ7H/NNmuTzzNJQhX wAr/P2+s3jd7z202Ce17UwLrRg/vJCZieGk4yJgnqieMTTd35IwD7Pub1CqxRIMYjvE3 /fIHDDR+JWxSDXEwaV/Wc7eeMLs8ziWyg8im3z4hod941re9ZY7XAu8LlzRGs709d58r lFNyG+/wY0wLn91UkPOapf5OiOp3YKdx/AIZrUqk6rf3uHzJselYCEdRIERR+bLvLkf6 oudFKbXeQCp6zBQHvtrsSRt687mW0zrHPos478U+fJbrCdXnpdbAHxp0IpWjnUS5MDfH F6QQ== X-Gm-Message-State: ACrzQf2DIAK+SAT7ejr5z6frkq/rafOlLAVou+png/pnQ+mWl5hsbxPO MgPXBbBB5YcdJwEVja7JJjM= X-Google-Smtp-Source: AMsMyM5fYQqms17JBH73QPjPi8937bCrhD3OavyX5Wvz4WFDIYa/O9aNVXfJcuMLX1G1w9HAStRCpQ== X-Received: by 2002:a7b:c047:0:b0:3b4:adc7:1ecb with SMTP id u7-20020a7bc047000000b003b4adc71ecbmr14010575wmc.144.1666375832503; Fri, 21 Oct 2022 11:10:32 -0700 (PDT) Received: from localhost.localdomain (93-42-70-134.ip85.fastwebnet.it. [93.42.70.134]) by smtp.googlemail.com with ESMTPSA id fc18-20020a05600c525200b003b505d26776sm356335wmb.5.2022.10.21.11.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 11:10:32 -0700 (PDT) From: Christian Marangi To: Russell King , Andy Gross , Bjorn Andersson , Konrad Dybcio , Arnd Bergmann , Ard Biesheuvel , Linus Walleij , "Russell King (Oracle)" , Geert Uytterhoeven , Nick Hawkins , John Crispin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Christian Marangi Subject: [PATCH] ARM: mach-qcom: fix support for ipq806x Date: Fri, 21 Oct 2022 20:10:16 +0200 Message-Id: <20221021181016.14740-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221021_111037_152444_D4E61F4B X-CRM114-Status: GOOD ( 15.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a specific config flag for Qcom IPQ806x as this SoC can't use AUTO_ZRELADDR and require the PHYS_OFFSET set to 0x42000000. This is needed as some legacy board (or some wrongly configured bootloader) pass the wrong memory map and doesn't exclude the first ~20MB of RAM reserved for the hardware network accellerators. With this change we can correctly support each board and prevent any kind of misconfiguration done by the OEM. Signed-off-by: Christian Marangi --- arch/arm/Kconfig | 3 ++- arch/arm/mach-qcom/Kconfig | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 1af63e17b4ad..0818d35973ad 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -282,6 +282,7 @@ config PHYS_OFFSET default 0x30000000 if ARCH_S3C24XX default 0xa0000000 if ARCH_IOP32X || ARCH_PXA default 0xc0000000 if ARCH_EP93XX || ARCH_SA1100 + default 0x42000000 if ARCH_IPQ806X default 0 help Please provide the physical address corresponding to the @@ -1701,7 +1702,7 @@ config CRASH_DUMP config AUTO_ZRELADDR bool "Auto calculation of the decompressed kernel image address" if !ARCH_MULTIPLATFORM - default !(ARCH_FOOTBRIDGE || ARCH_RPC || ARCH_SA1100) + default !(ARCH_FOOTBRIDGE || ARCH_RPC || ARCH_SA1100 || ARCH_IPQ806X) help ZRELADDR is the physical address where the decompressed kernel image will be placed. If AUTO_ZRELADDR is selected, the address diff --git a/arch/arm/mach-qcom/Kconfig b/arch/arm/mach-qcom/Kconfig index 12a812e61c16..b11b6e391ff0 100644 --- a/arch/arm/mach-qcom/Kconfig +++ b/arch/arm/mach-qcom/Kconfig @@ -46,4 +46,17 @@ config ARCH_MDM9615 bool "Enable support for MDM9615" select CLKSRC_QCOM +config ARCH_IPQ806X + bool "Enable support for IPQ806x" + help + Enable support for the Qualcomm IPQ806x. + + IPQ806x require special PHYS_OFFSET and can't use AUTO_ZRELADDR. + The first ~20MB of RAM is reserved for the hardware network accelerators, + and the bootloader removes this section from the layout passed from the + ATAGS (when used by some bootloader doesn't even do that). + + To support every system and handle legacy systems, hardcode PHYS_OFFSET and + disable AUTO_ZRELADDR. + endif