From patchwork Tue Sep 17 19:18:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13806432 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 7E19FCAC596 for ; Tue, 17 Sep 2024 19:21:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iX7BdyXyEKseaHvoeHfy59VsEhhm7BLq/GzuL5Qq8gA=; b=Cm8ZN4F/mDhV47DWmp+WgbOv/s DZ0icI1aRj61Z3Q9GHmY0izGj7okLHQ0tIB89Pg4u9+Ner5DOGVNpvR/Ud1IW+4tE9dvXdLQYycGp RGLgJJYddmjR7gjGIqhuUFOZsFCd/1RSUozYCkYOGguBpQwvRQaWYOVz1jDJ0rDmS0CO0B/oGtP4/ xjrgsPEtrBY8GzON8rKUQ08Zd+6vJ9wM5oQSBy5lw+EiUr306YNfE/eB/jIX+fzlRKwu3c+liR603 IHmVHuVoYCrbqbjadJWXp8yOg557A1u+ThvcfuTycJW8S8w174klKUqwyNp2YIgmj3ptBQq2aXxhO HzcAQNXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sqdl3-00000006koO-40Bt; Tue, 17 Sep 2024 19:21:06 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sqdij-00000006kLq-0jsJ for linux-arm-kernel@lists.infradead.org; Tue, 17 Sep 2024 19:18:42 +0000 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5c42f406e29so5142044a12.2 for ; Tue, 17 Sep 2024 12:18:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726600719; x=1727205519; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=iX7BdyXyEKseaHvoeHfy59VsEhhm7BLq/GzuL5Qq8gA=; b=HHTsnEzoGSZl5MK795+DhpIbz3L6PuOieszHwAihCxvHRkepspwp+W5qPS6pTHx68x 1O1oGCF561FVFK5MYs/+tjxdwfG6EDA9Uf0MS/OSVS4BlJhyFg/AV2AgiIshlnPmFSWa RJoKcwpxiUVDH/IgdCFggqZh9bbJs6ZpCIA21LEitVMip8vtwZ2dhVB6hrl1xLLqwjv4 d+ccTcsxOBJ3Y7HwbFCGK384RlSfWSMZWe0x/lhCgfSzRwTyRKRJ7fCnRrAuSm7GQmf+ DVH08UV/EA72c31PIjFp8IECAE/Bl63kMmfHrV0ndEbUyGSqAP9DAnnLeonKOj5OahH+ m7zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726600719; x=1727205519; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iX7BdyXyEKseaHvoeHfy59VsEhhm7BLq/GzuL5Qq8gA=; b=UJp/rYUy4/CvWyZAqgGY5fw5nrCTy9du8nbQLtEfkjxSKe5x8btTyASs2HfXeb+PHH pYFU3ibMbO4dQjA72tDCK7iM3tGIh4oBeMKYRBtFmnpQ4cERFETOHhFhcvWrD7wmRebO 4vTLjy0A/2z1iq3xqgii76nCsjPc4Okbm917leDCSIH/FwYLIgOMVSPAR2BqjYqrsRri GccP/foEgKRHlA3seVvUzQlcNUcTQWkahMsqIZJ7Bz40ChURcFzkYSLRsmsqWyC8+8cx ast5IdNq8yv/jIo60MGfzdxfPd/iAy5WIpoQ8plElOhne3wI1ACxF7f7Gy8XT/CCiFlK gQuQ== X-Gm-Message-State: AOJu0YymJ9OPJTsHFb46GmoNf4o0hM1ryEPJLg+hMucHl0M0s4t38C8n PUcV2BsU/AQ7HnPXPF7/F3vSmqADCOUpS8yEB4ZJfS/ZS5CsKJ7+rJC0NxH2A4o= X-Google-Smtp-Source: AGHT+IFKMcHxFj603IokkUERIgghRnzNx4gN9UOQXAxpeBpW8r5lWRvc1Ht/B68zzEtmcIrhPJ2Zrg== X-Received: by 2002:a17:907:e2df:b0:a8d:55ce:fb97 with SMTP id a640c23a62f3a-a90293dfc54mr2058055366b.11.1726600719299; Tue, 17 Sep 2024 12:18:39 -0700 (PDT) Received: from lino.lan ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90610f4320sm482418366b.85.2024.09.17.12.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 12:18:37 -0700 (PDT) From: Linus Walleij Date: Tue, 17 Sep 2024 21:18:28 +0200 Subject: [PATCH 1/2] ARM: bcm: Add selects for the Cortex-A7 BCMBCA MIME-Version: 1.0 Message-Id: <20240917-bcm-arm-bcm6846-v1-1-236e29661f4c@linaro.org> References: <20240917-bcm-arm-bcm6846-v1-0-236e29661f4c@linaro.org> In-Reply-To: <20240917-bcm-arm-bcm6846-v1-0-236e29661f4c@linaro.org> To: Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Russell King , William Zhang , Anand Gore , Kursad Oney , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij X-Mailer: b4 0.14.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240917_121841_248376_5EDE92D5 X-CRM114-Status: GOOD ( 12.15 ) 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 The Cortex-A7 versions of BCMBCA have most of the stuff that the Cortex-A9 version has and it can be selected independently with the Cortex-A9 disabled, so make sure it will also select all needed features. Signed-off-by: Linus Walleij --- arch/arm/mach-bcm/Kconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index 7318d8789e24..39d1d713efe0 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -217,6 +217,11 @@ if ARCH_BCMBCA config ARCH_BCMBCA_CORTEXA7 bool "Cortex-A7 SoCs" + select ARCH_HAS_RESET_CONTROLLER + select ARM_GLOBAL_TIMER + select CACHE_L2X0 + select HAVE_ARM_TWD if SMP + select HAVE_ARM_SCU if SMP help Say Y if you intend to run the kernel on a Broadcom Broadband ARM A7 based chipset. From patchwork Tue Sep 17 19:18:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13806433 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 2250FCAC596 for ; Tue, 17 Sep 2024 19:22:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nQNcRnro2TwdI8T137ApAlQOr5Evibnwbonj3bC1iG4=; b=3IRagsmpyMnm5+gQS97Upo/pI7 0lQWwecm6xdPnfpwUsvqCKKoiw2yGzgN+7YzrHH3SadsXTxBnxx1/YIJeqgOVsDthVJhBwNfQwkpH p5c3VR+7cyW6J1iiiX9Wn+TEc8DMycnUsr8ZPOEhxSepEXl/xoDmkbZ1nUZ+vt+y3TfEyKep4Zl6t D0Ap23YTrLftTDoeEweGmoHX9EZf3QVSst2vMAmGHKx0AL3EXJtowhlI2YdhF8js55w9XyCOJu8CJ MmR41JF51OUND7nZ1wfCu1dKvLUKOg1s8p0nlDfAiETsNkp0cbLjMzu/UjFK+pML9PZh7D1Ci9/Ek SXn+oYpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sqdm9-00000006l1g-1w4Z; Tue, 17 Sep 2024 19:22:13 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sqdil-00000006kNk-0ocV for linux-arm-kernel@lists.infradead.org; Tue, 17 Sep 2024 19:18:44 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a8d4093722bso851397566b.0 for ; Tue, 17 Sep 2024 12:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726600721; x=1727205521; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=nQNcRnro2TwdI8T137ApAlQOr5Evibnwbonj3bC1iG4=; b=lT3vFa7RCFsdnk+A+So5C/RA/c1W53MZUf/c91RNOVCn/9WppfTrx32G4HkhohOyDm 2E+tdgr9sAl30GsPmtPBdTv2cqrcr8g/2coOMAwYHxAGWcSY8Xj9WlN1td7qJ0Hg+3Ga yNhpPVvDUnztxa6FKmzRR+g2wV+yzMz0UiFsDBjROHrzWevAdIxNc3dOCz6GJG9kNTZ+ 4vjRQZLukAgReoiZa6EMRCcVwwe4Jtl/2/FnprmczA6t1Bi6JeC/A3t1gC531XBmJ8AT xMFPvTakggDSqpWHumemCXnvt6gZ2kT6OquYisHmxC26ge9XCqmUFwCzuqNDvn346Ody sd6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726600721; x=1727205521; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nQNcRnro2TwdI8T137ApAlQOr5Evibnwbonj3bC1iG4=; b=n/n5FoeifM70P4oNdqfsLgucldJDYfadaCV6b1K6kN/x6UBiYatdezGuSpM9VwByiT wUixqSxQu1Ci6MJ2IQuNzmm+V81rRBVhRCb06Mb8ZCIgUhax8H7XEr86fSZWAlC+7JgU Fokpo69jir03o5DyQcvHJ5TJyg3mbetqg2YKOJSgm3a4lBSeYy16AyYkaATBBIcl2AP3 s/KbnBjiZYCX2tCchQSLWEVrI3SRZTsqWonamZkxORW5ZhEHjs8tfQwL4j6hZ9nojmSz 1AIbegA5bXOVqHPHfL0cWC53/zTxOnmgBDS+nkpvAQhesB13bVoKfpFi78M1uwSfD/RT 1sDw== X-Gm-Message-State: AOJu0YzSUna4GMVQ+ZF0hJe9+oKzH6om4PozwBTNWbk1zoJtGTPju0wu wU6OVkF3uznC7QfcHCh9Yh4s+SAW3wfTRI4KPw3h+NznxddgPs4dVTUL5mHNXkU= X-Google-Smtp-Source: AGHT+IE/YWiz9LGbnLfcBHfiLUbv3Ita5RLfGYa/pTjhCPFiFBo13CRIAnp/g0Y+kVN9zUrspPNDuQ== X-Received: by 2002:a17:906:4794:b0:a8a:43bd:a9e8 with SMTP id a640c23a62f3a-a90296bc598mr2358913666b.65.1726600721226; Tue, 17 Sep 2024 12:18:41 -0700 (PDT) Received: from lino.lan ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90610f4320sm482418366b.85.2024.09.17.12.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 12:18:39 -0700 (PDT) From: Linus Walleij Date: Tue, 17 Sep 2024 21:18:29 +0200 Subject: [PATCH 2/2] ARM: bcm: Support BCM6846 debug UART MIME-Version: 1.0 Message-Id: <20240917-bcm-arm-bcm6846-v1-2-236e29661f4c@linaro.org> References: <20240917-bcm-arm-bcm6846-v1-0-236e29661f4c@linaro.org> In-Reply-To: <20240917-bcm-arm-bcm6846-v1-0-236e29661f4c@linaro.org> To: Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , Russell King , William Zhang , Anand Gore , Kursad Oney , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij X-Mailer: b4 0.14.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240917_121843_270462_6EDC6733 X-CRM114-Status: GOOD ( 18.12 ) 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 The debug UART on the BCM6846 is in a different place than on the other BCM platforms. Signed-off-by: Linus Walleij --- arch/arm/Kconfig.debug | 12 +++++++++--- arch/arm/mach-bcm/Makefile | 1 + arch/arm/mach-bcm/board_bcm6846.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 7f47b4f335c3..86989257b968 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -242,6 +242,10 @@ choice depends on ARCH_BCM_5301X || ARCH_BCM_NSP select DEBUG_UART_8250 + config DEBUG_BCM6846 + bool "Kernel low-level debugging on BCM6846 UART0" + depends on ARCH_BCMBCA + config DEBUG_BCM_HR2 bool "Kernel low-level debugging on Hurricane 2 UART2" depends on ARCH_BCM_HR2 @@ -1526,7 +1530,7 @@ config DEBUG_LL_INCLUDE default "debug/vf.S" if DEBUG_VF_UART default "debug/vt8500.S" if DEBUG_VT8500_UART0 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 - default "debug/bcm63xx.S" if DEBUG_BCM63XX_UART + default "debug/bcm63xx.S" if DEBUG_BCM63XX_UART || DEBUG_BCM6846 default "debug/digicolor.S" if DEBUG_DIGICOLOR_UA0 default "debug/brcmstb.S" if DEBUG_BRCMSTB_UART default "mach/debug-macro.S" @@ -1640,6 +1644,7 @@ config DEBUG_UART_PHYS default 0xfe531000 if DEBUG_STIH41X_SBC_ASC1 default 0xfed32000 if DEBUG_STIH41X_ASC2 default 0xff690000 if DEBUG_RK32_UART2 + default 0xff800640 if DEBUG_BCM6846 default 0xffc02000 if DEBUG_SOCFPGA_UART0 default 0xffc02100 if DEBUG_SOCFPGA_ARRIA10_UART1 default 0xffc03000 if DEBUG_SOCFPGA_CYCLONE5_UART1 @@ -1664,7 +1669,7 @@ config DEBUG_UART_PHYS DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \ DEBUG_RMOBILE_SCIFA4 || \ DEBUG_S3C64XX_UART || \ - DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \ + DEBUG_BCM63XX_UART || DEBUG_BCM6846 || DEBUG_ASM9260_UART || \ DEBUG_DIGICOLOR_UA0 || \ DEBUG_AT91_UART || DEBUG_STM32_UART || \ DEBUG_STIH41X_ASC2 || DEBUG_STIH41X_SBC_ASC1 || \ @@ -1734,6 +1739,7 @@ config DEBUG_UART_VIRT default 0xfe018000 if DEBUG_MMP_UART3 default 0xfe100000 if DEBUG_IMX23_UART || DEBUG_IMX28_UART default 0xfe300000 if DEBUG_BCM_KONA_UART + default 0xfe300640 if DEBUG_BCM6846 default 0xfeb00000 if DEBUG_HI3620_UART || DEBUG_HIX5HD2_UART default 0xfeb24000 if DEBUG_RK3X_UART0 default 0xfeb26000 if DEBUG_RK3X_UART1 @@ -1765,7 +1771,7 @@ config DEBUG_UART_VIRT DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \ DEBUG_QCOM_UARTDM || \ DEBUG_S3C64XX_UART || \ - DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \ + DEBUG_BCM63XX_UART || DEBUG_BCM6846 || DEBUG_ASM9260_UART || \ DEBUG_DIGICOLOR_UA0 || \ DEBUG_AT91_UART || DEBUG_STM32_UART || \ DEBUG_STIH41X_ASC2 || DEBUG_STIH41X_SBC_ASC1 || \ diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile index 2e523f29ec3b..22699a7e18ec 100644 --- a/arch/arm/mach-bcm/Makefile +++ b/arch/arm/mach-bcm/Makefile @@ -58,5 +58,6 @@ endif # BCMBCA ifeq ($(CONFIG_ARCH_BCMBCA),y) +obj-y += board_bcm6846.o obj-$(CONFIG_SMP) += bcm63xx_smp.o bcm63xx_pmb.o endif diff --git a/arch/arm/mach-bcm/board_bcm6846.c b/arch/arm/mach-bcm/board_bcm6846.c new file mode 100644 index 000000000000..7a086c7a1e71 --- /dev/null +++ b/arch/arm/mach-bcm/board_bcm6846.c @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright (C) 2024 Linus Walleij + +#include +#include + +#ifdef CONFIG_DEBUG_BCM6846 +/* This is needed for LL-debug/earlyprintk/debug-macro.S */ +static struct map_desc bcm6846_io_desc[] __initdata = { + { + .virtual = CONFIG_DEBUG_UART_VIRT, + .pfn = __phys_to_pfn(CONFIG_DEBUG_UART_PHYS), + .length = SZ_4K, + .type = MT_DEVICE, + }, +}; + +static void __init bcm6846_map_io(void) +{ + iotable_init(bcm6846_io_desc, ARRAY_SIZE(bcm6846_io_desc)); +} +#else +#define bcm6846_map_io NULL +#endif + +static const char * const bcm6846_dt_compat[] = { + "brcm,bcm6846", + NULL, +}; + +DT_MACHINE_START(BCM6846_DT, "BCM6846 Application Processor") + .map_io = bcm6846_map_io, + .dt_compat = bcm6846_dt_compat, +MACHINE_END