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