From patchwork Wed Feb 1 23:37:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 649185 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp581829pva; Wed, 1 Feb 2023 15:38:59 -0800 (PST) X-Google-Smtp-Source: AK7set9NOnTEhouw+tOXA76I8oJSH5k/vFXMRitG2l2BgjLZJwVgdolIxq9ePESkqIUKegYbfQ/9 X-Received: by 2002:a05:6871:a6:b0:163:2054:44db with SMTP id u38-20020a05687100a600b00163205444dbmr2515362oaa.30.1675294739751; Wed, 01 Feb 2023 15:38:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675294739; cv=none; d=google.com; s=arc-20160816; b=imMb/ZofWDr0ufWyoUyAaH7+fbBTt9oyc7hihsVU1P6YgBHQnvgVCoNGVeuJj3UAWN xsA2MBHCbB1ZbkILTSzh7XxW6+8PvQUVrdCx8njPPrn6zJjVT5DiESVcvfheMT2j/NBM SIRl7V+E/wrDmKsp6dIP3axn7HRgnsAmJPhWfm3E1jWZIw4BzkpffgJ+ISMmrLN5v5hT T3sYX02DzZ+HNdMfTDXarWzPJrwWuECLmnDGSo/g0ebRWOzJT7PsbLhDZBH3VD6b6aqa n3Z/O/Jdq38BWvmW7YKcaRX2GpxXZqnZplU8teSk/51RDs8tZxIRLPB6n+MpMpmQjZ4w wnKw== 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=8LvaDVVycerqgnTh7EbYuPpIpbclV1dv39FD+/Tc+SQ=; b=a5EmJimMi7JBmYwQqzLrDexohl3O3/STOTIKA/DAHSEYUWqa9R7e1C9vuJjedYloKP 2Kq8NRbLeRV5dM5GuU71T1ivjF4f6Ho9wudHoRPHQto07iru1YQcA1hMyDQhka1w4VDf rEnI7jOCn/KQUwMLmX3Xd47HAyjM6xoMEvxADbFKkoMTuvnAOmDH4YW7ayo4iAWcAEzw hH5HIVBerN/9behzCCTp55BCH7zXYiqwAqW5kTe6s+WZUU8WJ2CNPpqfUn/Qrqhut7d8 kHgb0HRrVgl8dNCLWe7S/4wkDbG2KxY8DTPZS43h7h1lQ26yPqL0tyc83nzDrS4k7dhz 2+EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cFYZWFaT; 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 xl6-20020a0568709f0600b0015f5ddde0casi5954020oab.253.2023.02.01.15.38.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 15:38:59 -0800 (PST) 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=cFYZWFaT; 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 275BB85E5D; Thu, 2 Feb 2023 00:38:41 +0100 (CET) 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="cFYZWFaT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6E0E885E50; Thu, 2 Feb 2023 00:38:22 +0100 (CET) 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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) (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 6DBBF85E60 for ; Thu, 2 Feb 2023 00:38:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=linus.walleij@linaro.org Received: by mail-ej1-x62c.google.com with SMTP id mf7so1251269ejc.6 for ; Wed, 01 Feb 2023 15:38:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8LvaDVVycerqgnTh7EbYuPpIpbclV1dv39FD+/Tc+SQ=; b=cFYZWFaT5WtK2Ph4Cs8QTXU66R+ftZRcCbiqUVlmrGnorlpiOR0+tb7P+8uURNVhRz MUUkuqEJHtbJCsVzBaEhCBCuC+Os7dqbsfL/fza3HgsGnRtf5dlNJuLLKsYCvFsn4Iak gbslPyOnL3/GVgoKwkd7Oy1iNvfBQDZjDSQh58gCtFH0AzpA8FPf3JOfsssGVeUCzZd6 zPf+PVSIXl2iXsS5P11BGgTELkLOEP9VmYZHJFjSl+F4T6tvSb+n54aiDEQdjAbTFkEj 8xAXltfDx9suesdPloN6+4ZcFFoh6YPW5RPlwOw1pptCgNFGqWMbAICaO9TuRM9HIXQF c/jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8LvaDVVycerqgnTh7EbYuPpIpbclV1dv39FD+/Tc+SQ=; b=j3cENefFYKL+7vk4sqnOBjqKbzgKyxBNHdX1VFqCzsUaASrdQj/pub9tn9s4p43zEK M7Ex3p05ORo0Pda0wwhuw0/AQ1lWQEyOuIhzeOdqgNQ/mul50f/fhk1j6olS/c2bGV4Y snwnzcRcpn3dkAeHUruF1umO6E4CMnBqGPnaw+59Nq7ZykmZpr9iR86B7CGbXCwsJeJk xf6AxTk7Ts0HEc9XLIuXXB12f24ANrfRNb25Yll6hc3vI+ErH8mRFJAYYBwR9U68TMAU 8B0gr4QXPzh99U13Bk+9MPgiqyIw54F5ItMqfQM0fFTsHMgT+X6fx/Ejd990sGkJCtcz Aa7w== X-Gm-Message-State: AO0yUKX5Z/tLdVh8WcJ5Q4aMJQjoP2+apYT/XhHvHbf3aukCwf/ger46 7hH8Sk29C30p5/8P/b+z9gypdre66fscs/zI X-Received: by 2002:a17:907:3e82:b0:878:6755:9089 with SMTP id hs2-20020a1709073e8200b0087867559089mr5975979ejc.39.1675294690558; Wed, 01 Feb 2023 15:38:10 -0800 (PST) Received: from localhost.localdomain (c-05d8225c.014-348-6c756e10.bbcust.telenor.se. [92.34.216.5]) by smtp.gmail.com with ESMTPSA id b8-20020a170906708800b0088550a1ce6esm6921171ejk.222.2023.02.01.15.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 15:38:10 -0800 (PST) From: Linus Walleij To: u-boot@lists.denx.de, Tom Rini Cc: Anand Gore , William Zhang , Kursad Oney , Joel Peshkin , Philippe Reynes , =?utf-8?b?UmFmYcWCIE1p?= =?utf-8?b?xYJlY2tp?= , Linus Walleij Subject: [PATCH 3/3] board: Add new Broadcom Northstar board Date: Thu, 2 Feb 2023 00:37:45 +0100 Message-Id: <20230201233745.469603-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230201233745.469603-1-linus.walleij@linaro.org> References: <20230201233745.469603-1-linus.walleij@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 This adds a simple Northstar "BRCMNS" board to be used with the BCM4709x and BCM5301x chips. The main intention is to use this with the D-Link DIR-890L and DIR-885L routers for loading the kernel into RAM from NAND memory using the BCH-1 ECC and using the separately submitted SEAMA load command, so we are currently not adding support for things such as networking. If other board need other ECC for example, they need to create a separate DTS file and augment the code, but I don't know if any other users will turn up. Cc: Rafał Miłecki Signed-off-by: Linus Walleij --- arch/arm/Kconfig | 1 + arch/arm/dts/Makefile | 2 ++ arch/arm/dts/ns-board.dts | 57 ++++++++++++++++++++++++++++++ board/broadcom/bcmns/Kconfig | 12 +++++++ board/broadcom/bcmns/MAINTAINERS | 6 ++++ board/broadcom/bcmns/Makefile | 2 ++ board/broadcom/bcmns/ns.c | 60 ++++++++++++++++++++++++++++++++ configs/bcmns_defconfig | 41 ++++++++++++++++++++++ include/configs/bcmns.h | 49 ++++++++++++++++++++++++++ 9 files changed, 230 insertions(+) create mode 100644 arch/arm/dts/ns-board.dts create mode 100644 board/broadcom/bcmns/Kconfig create mode 100644 board/broadcom/bcmns/MAINTAINERS create mode 100644 board/broadcom/bcmns/Makefile create mode 100644 board/broadcom/bcmns/ns.c create mode 100644 configs/bcmns_defconfig create mode 100644 include/configs/bcmns.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 312f1411f85b..7c6fdff2692f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -2284,6 +2284,7 @@ source "board/Marvell/octeontx2/Kconfig" source "board/armltd/vexpress/Kconfig" source "board/armltd/vexpress64/Kconfig" source "board/cortina/presidio-asic/Kconfig" +source "board/broadcom/bcmns/Kconfig" source "board/broadcom/bcmns3/Kconfig" source "board/cavium/thunderx/Kconfig" source "board/eets/pdu001/Kconfig" diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 3ecd6a86e95e..d045511cd1ee 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1173,6 +1173,8 @@ dtb-$(CONFIG_ARCH_BCM283X) += \ bcm2837-rpi-cm3-io3.dtb \ bcm2711-rpi-4-b.dtb +dtb-$(CONFIG_TARGET_BCMNS) += ns-board.dtb + dtb-$(CONFIG_TARGET_BCMNS3) += ns3-board.dtb dtb-$(CONFIG_ARCH_BCMSTB) += bcm7xxx.dtb diff --git a/arch/arm/dts/ns-board.dts b/arch/arm/dts/ns-board.dts new file mode 100644 index 000000000000..bc2a0dd1c961 --- /dev/null +++ b/arch/arm/dts/ns-board.dts @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +#include "bcm5301x.dtsi" + +/ { + /* + * The Northstar does not have a proper fallback compatible, but + * these basic chips will suffice. + */ + model = "Northstar model"; + compatible = "brcm,bcm47094", "brcm,bcm4708"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&gic>; + + memory { + device_type = "memory"; + reg = <0x00000000 0x08000000>, + <0x88000000 0x08000000>; + }; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + nand-controller@18028000 { + nandcs: nand@0 { + compatible = "brcm,nandcs"; + reg = <0>; + #address-cells = <1>; + #size-cells = <1>; + + /* + * Same as using the bcm5301x-nand-cs0-bch1.dtsi + * include from the Linux kernel. + */ + nand-ecc-algo = "bch"; + nand-ecc-strength = <1>; + nand-ecc-step-size = <512>; + + partitions { + compatible = "brcm,bcm947xx-cfe-partitions"; + }; + }; + }; +}; + +&uart0 { + clock-frequency = <125000000>; + status = "okay"; +}; diff --git a/board/broadcom/bcmns/Kconfig b/board/broadcom/bcmns/Kconfig new file mode 100644 index 000000000000..82f4709e2d2d --- /dev/null +++ b/board/broadcom/bcmns/Kconfig @@ -0,0 +1,12 @@ +if TARGET_BCMNS + +config SYS_BOARD + default "bcmns" + +config SYS_VENDOR + default "broadcom" + +config SYS_CONFIG_NAME + default "bcmns" + +endif diff --git a/board/broadcom/bcmns/MAINTAINERS b/board/broadcom/bcmns/MAINTAINERS new file mode 100644 index 000000000000..fd37c334a5b1 --- /dev/null +++ b/board/broadcom/bcmns/MAINTAINERS @@ -0,0 +1,6 @@ +BCMNS BOARD +M: Linus Walleij +S: Maintained +F: board/broadcom/bcmnsp/ +F: configs/bcmnsp_defconfig +F: include/configs/bcmnsp.h diff --git a/board/broadcom/bcmns/Makefile b/board/broadcom/bcmns/Makefile new file mode 100644 index 000000000000..8a6a8543a90b --- /dev/null +++ b/board/broadcom/bcmns/Makefile @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +obj-y := ns.o diff --git a/board/broadcom/bcmns/ns.c b/board/broadcom/bcmns/ns.c new file mode 100644 index 000000000000..1249e45af036 --- /dev/null +++ b/board/broadcom/bcmns/ns.c @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Broadcom Northstar generic board set-up code + * Copyright (C) 2023 Linus Walleij + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +int dram_init(void) +{ + return fdtdec_setup_mem_size_base(); +} + +int dram_init_banksize(void) +{ + return fdtdec_setup_memory_banksize(); +} + +int board_late_init(void) +{ + /* LEDs etc can be initialized here */ + return 0; +} + +int board_init(void) +{ + return 0; +} + +void reset_cpu(void) +{ +} + +int print_cpuinfo(void) +{ + printf("BCMNS Northstar SoC\n"); + return 0; +} + +int misc_init_r(void) +{ + return 0; +} + +int ft_board_setup(void *fdt, struct bd_info *bd) +{ + printf("Northstar board setup: DTB at 0x%08lx\n", (ulong)fdt); + return 0; +} + diff --git a/configs/bcmns_defconfig b/configs/bcmns_defconfig new file mode 100644 index 000000000000..02e2fbe3db28 --- /dev/null +++ b/configs/bcmns_defconfig @@ -0,0 +1,41 @@ +CONFIG_ARM=y +CONFIG_TARGET_BCMNS=y +CONFIG_TEXT_BASE=0x00008000 +CONFIG_SYS_MALLOC_LEN=0x2000000 +CONFIG_SYS_MALLOC_F_LEN=0x8000 +CONFIG_NR_DRAM_BANKS=2 +CONFIG_DEFAULT_DEVICE_TREE="ns-board" +CONFIG_IDENT_STRING="Broadcom Northstar" +CONFIG_SYS_LOAD_ADDR=0x00008000 +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x00100000 +# CONFIG_BOOTSTD is not set +CONFIG_AUTOBOOT_KEYED=y +CONFIG_AUTOBOOT_PROMPT="Boot Northstar system in %d seconds\n" +CONFIG_BOOTDELAY=1 +CONFIG_USE_BOOTCOMMAND=y +CONFIG_BOOTCOMMAND="run bootcmd_dlink_dir8xxl" +CONFIG_SYS_PROMPT="northstar> " +CONFIG_ENV_VARS_UBOOT_CONFIG=y +CONFIG_OF_BOARD_SETUP=y +CONFIG_OF_STDOUT_VIA_ALIAS=y +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_HUSH_PARSER=y +CONFIG_SYS_MAXARGS=64 +CONFIG_CMD_SEAMA=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_CACHE=y +CONFIG_OF_EMBED=y +CONFIG_USE_HOSTNAME=y +CONFIG_HOSTNAME="NS" +CONFIG_CLK=y +CONFIG_MTD=y +CONFIG_DM_MTD=y +CONFIG_MTD_RAW_NAND=y +CONFIG_NAND_BRCMNAND=y +CONFIG_SYS_NAND_ONFI_DETECTION=y +CONFIG_CMD_NAND=y +CONFIG_DM_SERIAL=y +CONFIG_SYS_NS16550=y +# CONFIG_NET is not set +# CONFIG_EFI_LOADER is not set diff --git a/include/configs/bcmns.h b/include/configs/bcmns.h new file mode 100644 index 000000000000..6f5f2b7ccf23 --- /dev/null +++ b/include/configs/bcmns.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#ifndef __BCM_NS_H +#define __BCM_NS_H + +#include + +/* Physical Memory Map */ +#define V2M_BASE 0x00000000 +#define PHYS_SDRAM_1 V2M_BASE + +#define CFG_SYS_SDRAM_BASE PHYS_SDRAM_1 + +/* Called "periph_clk" in Linux, used by the global timer */ +#define CFG_SYS_HZ_CLOCK 500000000 + +/* Called "iprocslow" in Linux */ +#define CFG_SYS_NS16550_CLK 125000000 + +/* console configuration */ +#define CONSOLE_ARGS "console_args=console=ttyS0,115200n8\0" +#define MAX_CPUS "max_cpus=maxcpus=2\0" +#define EXTRA_ARGS "extra_args=earlycon=uart8250,mmio32,0x18000300\0" + +#define BASE_ARGS "${console_args} ${extra_args} ${pcie_args}" \ + " ${max_cpus} ${log_level} ${reserved_mem}" +#define SETBOOTARGS "setbootargs=setenv bootargs " BASE_ARGS "\0" + +#define KERNEL_LOADADDR_CFG \ + "loadaddr=0x01000000\0" \ + "dtb_loadaddr=0x02000000\0" + +/* + * Hardcoded for the only boards we support, if you add more + * boards, add a more clever bootcmd! + */ +#define NS_BOOTCMD "bootcmd_dlink_dir8xxl=seama 0x00fe0000; go 0x01000000" + +#define ARCH_ENV_SETTINGS \ + CONSOLE_ARGS \ + MAX_CPUS \ + EXTRA_ARGS \ + KERNEL_LOADADDR_CFG \ + NS_BOOTCMD + +#define CFG_EXTRA_ENV_SETTINGS \ + ARCH_ENV_SETTINGS + +#endif /* __BCM_NS_H */